MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / ik

Function ik

package/cli.js:138–138  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

136`)){let z=_.match(/^(ID|VERSION_ID)=(.*)$/);if(z&&z[1]&&z[2]){let Y=z[2].replace(/^"|"$/g,"");if(z[1]==="ID")q.linuxDistroId=Y;else q.linuxDistroVersion=Y}}}catch{}return q}),ZL5=[[".git","git"],[".hg","mercurial"],[".svn","svn"],[".p4config","perforce"],["$tf","tfs"],[".tfvc","tfs"],[".jj","jujutsu"],[".sl","sapling"]]});import{execSync as GL5}from"child_process";function xe(q,K){let z=[];try{const _=Bz(z,cA`execSync: ${q.slice(0,100)}`,0);return GL5(q,K)}catch(Y){var $=Y,A=1}finally{gz(z,$,A)}}var x$8=y(()=>{l8()});class BW6{heap;length;static#q=!1;static create(q){let K=YR7(q);if(!K)return[];BW6.#q=!0;let _=new BW6(q,K);return BW6.#q=!1,_}constructor(q,K){if(!BW6.#q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new K(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}var pW6,_R7,J41,zR7=(q,K,_,z)=>{typeof J41.emitWarning==="function"?J41.emitWarning(q,K,_,z):console.error(`[${_}] ${K}: ${q}`)},I$8,KR7,TL5=(q)=>!_R7.has(q),Jb$,Ie=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),YR7=(q)=>!Ie(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?em6:null,em6,nk;var gW6=y(()=>{pW6=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,_R7=new Set,J41=typeof process==="object"&&!!process?process:{},I$8=globalThis.AbortController,KR7=globalThis.AbortSignal;if(typeof I$8>"u"){KR7=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(z,Y){this._onabort.push(Y)}},I$8=class{constructor(){K()}signal=new KR7;abort(z){if(this.signal.aborted)return;this.signal.reason=z,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(z);this.signal.onabort?.(z)}};let q=J41.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",K=()=>{if(!q)return;q=!1,zR7("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",K)}}Jb$=Symbol("type");em6=class em6 extends Array{constructor(q){super(q);this.fill(0)}};nk=class nk{#q;#K;#_;#Y;#z;#O;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#w;#H;#j;#A;#M;#D;#P;#J;#f;#W;#G;#k;#T;#v;#N;#Z;static unsafeExposeInternals(q){return{starts:q.#k,ttls:q.#T,sizes:q.#G,keyMap:q.#H,keyList:q.#j,valList:q.#A,next:q.#M,prev:q.#D,get head(){return q.#P},get tail(){return q.#J},free:q.#f,isBackgroundFetch:(K)=>q.#X(K),backgroundFetch:(K,_,z,Y)=>q.#m(K,_,z,Y),moveToTail:(K)=>q.#x(K),indexes:(K)=>q.#E(K),rindexes:(K)=>q.#L(K),isStale:(K)=>q.#V(K)}}get max(){return this.#q}get maxSize(){return this.#K}get calculatedSize(){return this.#w}get size(){return this.#$}get fetchMethod(){return this.#z}get memoMethod(){return this.#O}get dispose(){return this.#_}get disposeAfter(){return this.#Y}constructor(q){let{max:K=0,ttl:_,ttlResolution:z=1,ttlAutopurge:Y,updateAgeOnGet:$,updateAgeOnHas:A,allowStale:O,dispose:w,disposeAfter:j,noDisposeOnSet:H,noUpdateTTL:J,maxSize:M=0,maxEntrySize:X=0,sizeCalculation:P,fetchMethod:W,memoMethod:D,noDeleteOnFetchRejection:f,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:T,ignoreFetchAbort:v}=q;if(K!==0&&!Ie(K))throw TypeError("max option must be a nonnegative integer");let V=K?YR7(K):Array;if(!V)throw Error("invalid max value: "+K);if(this.#q=K,this.#K=M,this.maxEntrySize=X||this.#K,this.sizeCalculation=P,this.sizeCalculation){if(!this.#K&&!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(D!==void 0&&typeof D!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#O=D,W!==void 0&&typeof W!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#z=W,this.#N=!!W,this.#H=new Map,this.#j=Array(K).fill(void 0),this.#A=Array(K).fill(void 0),this.#M=new V(K),this.#D=new V(K),this.#P=0,this.#J=0,this.#f=BW6.create(K),this.#$=0,this.#w=0,typeof w==="function")this.#_=w;if(typeof j==="function")this.#Y=j,this.#W=[];else this.#Y=void 0,this.#W=void 0;if(this.#v=!!this.#_,this.#Z=!!this.#Y,this.noDisposeOnSet=!!H,this.noUpdateTTL=!!J,this.noDeleteOnFetchRejection=!!f,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#K!==0){if(!Ie(this.#K))throw TypeError("maxSize must be a positive integer if specified")}if(!Ie(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!O,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!$,this.updateAgeOnHas=!!A,this.ttlResolution=Ie(z)||z===0?z:1,this.ttlAutopurge=!!Y,this.ttl=_||0,this.ttl){if(!Ie(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#q===0&&this.ttl===0&&this.#K===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#K){if(TL5("LRU_CACHE_UNBOUNDED"))_R7.add("LRU_CACHE_UNBOUNDED"),zR7("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",nk)}}getRemainingTTL(q){return this.#H.has(q)?1/0:0}#C(){let q=new em6(this.#q),K=new em6(this.#q);this.#T=q,this.#k=K,this.#S=(Y,$,A=pW6.now())=>{if(K[Y]=$!==0?A:0,q[Y]=$,$!==0&&this.ttlAutopurge){let O=setTimeout(()=>{if(this.#V(Y))this.#R(this.#j[Y],"expire")},$+1);if(O.unref)O.unref()}},this.#h=(Y)=>{K[Y]=q[Y]!==0?pW6.now():0},this.#y=(Y,$)=>{if(q[$]){let A=q[$],O=K[$];if(!A||!O)return;Y.ttl=A,Y.start=O,Y.now=_||z();let w=Y.now-O;Y.remainingTTL=A-w}};let _=0,z=()=>{let Y=pW6.now();if(this.ttlResolution>0){_=Y;let $=setTimeout(()=>_=0,this.ttlResolution);if($.unref)$.unref()}return Y};this.getRemainingTTL=(Y)=>{let $=this.#H.get(Y);if($===void 0)return 0;let A=q[$],O=K[$];if(!A||!O)return 1/0;let w=(_||z())-O;return A-w},this.#V=(Y)=>{let $=K[Y],A=q[Y];return!!A&&!!$&&(_||z())-$>A}}#h=()=>{};#y=()=>{};#S=()=>{};#V=()=>!1;#U(){let q=new em6(this.#q);this.#w=0,this.#G=q,this.#b=(K)=>{this.#w-=q[K],q[K]=0},this.#p=(K,_,z,Y)=>{if(this.#X(_))return 0;if(!Ie(z))if(Y){if(typeof Y!=="function")throw TypeError("sizeCalculation must be a function");if(z=Y(_,K),!Ie(z))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 z},this.#I=(K,_,z)=>{if(q[K]=_,this.#K){let Y=this.#K-q[K];while(this.#w>Y)this.#u(!0)}if(this.#w+=q[K],z)z.entrySize=_,z.totalCalculatedSize=this.#w}}#b=(q)=>{};#I=(q,K,_)=>{};#p=(q,K,_,z)=>{if(_||z)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let K=this.#J;;){if(!this.#B(K))break;if(q||!this.#V(K))yield K;if(K===this.#P)break;else K=this.#D[K]}}*#L({allowStale:q=this.allowStale}={}){if(this.#$)for(let K=this.#P;;){if(!this.#B(K))break;if(q||!this.#V(K))yield K;if(K===this.#J)break;else K=this.#M[K]}}#B(q){return q!==void 0&&this.#H.get(this.#j[q])===q}*entries(){for(let q of this.#E())if(this.#A[q]!==void 0&&this.#j[q]!==void 0&&!this.#X(this.#A[q]))yield[this.#j[q],this.#A[q]]}*rentries(){for(let q of this.#L())if(this.#A[q]!==void 0&&this.#j[q]!==void 0&&!this.#X(this.#A[q]))yield[this.#j[q],this.#A[q]]}*keys(){for(let q of this.#E()){let K=this.#j[q];if(K!==void 0&&!this.#X(this.#A[q]))yield K}}*rkeys(){for(let q of this.#L()){let K=this.#j[q];if(K!==void 0&&!this.#X(this.#A[q]))yield K}}*values(){for(let q of this.#E())if(this.#A[q]!==void 0&&!this.#X(this.#A[q]))yield this.#A[q]}*rvalues(){for(let q of this.#L())if(this.#A[q]!==void 0&&!this.#X(this.#A[q]))yield this.#A[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,K={}){for(let _ of this.#E()){let z=this.#A[_],Y=this.#X(z)?z.__staleWhileFetching:z;if(Y===void 0)continue;if(q(Y,this.#j[_],this))return this.get(this.#j[_],K)}}forEach(q,K=this){for(let _ of this.#E()){let z=this.#A[_],Y=this.#X(z)?z.__staleWhileFetching:z;if(Y===void 0)continue;q.call(K,Y,this.#j[_],this)}}rforEach(q,K=this){for(let _ of this.#L()){let z=this.#A[_],Y=this.#X(z)?z.__staleWhileFetching:z;if(Y===void 0)continue;q.call(K,Y,this.#j[_],this)}}purgeStale(){let q=!1;for(let K of this.#L({allowStale:!0}))if(this.#V(K))this.#R(this.#j[K],"expire"),q=!0;return q}info(q){let K=this.#H.get(q);if(K===void 0)return;let _=this.#A[K],z=this.#X(_)?_.__staleWhileFetching:_;if(z===void 0)return;let Y={value:z};if(this.#T&&this.#k){let $=this.#T[K],A=this.#k[K];if($&&A){let O=$-(pW6.now()-A);Y.ttl=O,Y.start=Date.now()}}if(this.#G)Y.size=this.#G[K];return Y}dump(){let q=[];for(let K of this.#E({allowStale:!0})){let _=this.#j[K],z=this.#A[K],Y=this.#X(z)?z.__staleWhileFetching:z;if(Y===void 0||_===void 0)continue;let $={value:Y};if(this.#T&&this.#k){$.ttl=this.#T[K];let A=pW6.now()-this.#k[K];$.start=Math.floor(Date.now()-A)}if(this.#G)$.size=this.#G[K];q.unshift([_,$])}return q}load(q){this.clear();for(let[K,_]of q){if(_.start){let z=Date.now()-_.start;_.start=pW6.now()-z}this.set(K,_.value,_)}}set(q,K,_={}){if(K===void 0)return this.delete(q),this;let{ttl:z=this.ttl,start:Y,noDisposeOnSet:$=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=_,{noUpdateTTL:w=this.noUpdateTTL}=_,j=this.#p(q,K,_.size||0,A);if(this.maxEntrySize&&j>this.maxEntrySize){if(O)O.set="miss",O.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let H=this.#$===0?void 0:this.#H.get(q);if(H===void 0){if(H=this.#$===0?this.#J:this.#f.length!==0?this.#f.pop():this.#$===this.#q?this.#u(!1):this.#$,this.#j[H]=q,this.#A[H]=K,this.#H.set(q,H),this.#M[this.#J]=H,this.#D[H]=this.#J,this.#J=H,this.#$++,this.#I(H,j,O),O)O.set="add";w=!1}else{this.#x(H);let J=this.#A[H];if(K!==J){if(this.#N&&this.#X(J)){J.__abortController.abort(Error("replaced"));let{__staleWhileFetching:M}=J;if(M!==void 0&&!$){if(this.#v)this.#_?.(M,q,"set");if(this.#Z)this.#W?.push([M,q,"set"])}}else if(!$){if(this.#v)this.#_?.(J,q,"set");if(this.#Z)this.#W?.push([J,q,"set"])}if(this.#b(H),this.#I(H,j,O),this.#A[H]=K,O){O.set="replace";let M=J&&this.#X(J)?J.__staleWhileFetching:J;if(M!==void 0)O.oldValue=M}}else if(O)O.set="update"}if(z!==0&&!this.#T)this.#C();if(this.#T){if(!w)this.#S(H,z,Y);if(O)this.#y(O,H)}if(!$&&this.#Z&&this.#W){let J=this.#W,M;while(M=J?.shift())this.#Y?.(...M)}return this}pop(){try{while(this.#$){let q=this.#A[this.#P];if(this.#u(!0),this.#X(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#Z&&this.#W){let q=this.#W,K;while(K=q?.shift())this.#Y?.(...K)}}}#u(q){let K=this.#P,_=this.#j[K],z=this.#A[K];if(this.#N&&this.#X(z))z.__abortController.abort(Error("evicted"));else if(this.#v||this.#Z){if(this.#v)this.#_?.(z,_,"evict");if(this.#Z)this.#W?.push([z,_,"evict"])}if(this.#b(K),q)this.#j[K]=void 0,this.#A[K]=void 0,this.#f.push(K);if(this.#$===1)this.#P=this.#J=0,this.#f.length=0;else this.#P=this.#M[K];return this.#H.delete(_),this.#$--,K}has(q,K={}){let{updateAgeOnHas:_=this.updateAgeOnHas,status:z}=K,Y=this.#H.get(q);if(Y!==void 0){let $=this.#A[Y];if(this.#X($)&&$.__staleWhileFetching===void 0)return!1;if(!this.#V(Y)){if(_)this.#h(Y);if(z)z.has="hit",this.#y(z,Y);return!0}else if(z)z.has="stale",this.#y(z,Y)}else if(z)z.has="miss";return!1}peek(q,K={}){let{allowStale:_=this.allowStale}=K,z=this.#H.get(q);if(z===void 0||!_&&this.#V(z))return;let Y=this.#A[z];return this.#X(Y)?Y.__staleWhileFetching:Y}#m(q,K,_,z){let Y=K===void 0?void 0:this.#A[K];if(this.#X(Y))return Y;let $=new I$8,{signal:A}=_;A?.addEventListener("abort",()=>$.abort(A.reason),{signal:$.signal});let O={signal:$.signal,options:_,context:z},w=(P,W=!1)=>{let{aborted:D}=$.signal,f=_.ignoreFetchAbort&&P!==void 0;if(_.status)if(D&&!W){if(_.status.fetchAborted=!0,_.status.fetchError=$.signal.reason,f)_.status.fetchAbortIgnored=!0}else _.status.fetchResolved=!0;if(D&&!f&&!W)return H($.signal.reason);let G=M;if(this.#A[K]===M)if(P===void 0)if(G.__staleWhileFetching)this.#A[K]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(_.status)_.status.fetchUpdated=!0;this.set(q,P,O.options)}return P},j=(P)=>{if(_.status)_.status.fetchRejected=!0,_.status.fetchError=P;return H(P)},H=(P)=>{let{aborted:W}=$.signal,D=W&&_.allowStaleOnFetchAbort,f=D||_.allowStaleOnFetchRejection,G=f||_.noDeleteOnFetchRejection,Z=M;if(this.#A[K]===M){if(!G||Z.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!D)this.#A[K]=Z.__staleWhileFetching}if(f){if(_.status&&Z.__staleWhileFetching!==void 0)_.status.returnedStale=!0;return Z.__staleWhileFetching}else if(Z.__returned===Z)throw P},J=(P,W)=>{let D=this.#z?.(q,Y,O);if(D&&D instanceof Promise)D.then((f)=>P(f===void 0?void 0:f),W);$.signal.addEventListener("abort",()=>{if(!_.ignoreFetchAbort||_.allowStaleOnFetchAbort){if(P(void 0),_.allowStaleOnFetchAbort)P=(f)=>w(f,!0)}})};if(_.status)_.status.fetchDispatched=!0;let M=new Promise(J).then(w,j),X=Object.assign(M,{__abortController:$,__staleWhileFetching:Y,__returned:void 0});if(K===void 0)this.set(q,X,{...O.options,status:void 0}),K=this.#H.get(q);else this.#A[K]=X;return X}#X(q){if(!this.#N)return!1;let K=q;return!!K&&K instanceof Promise&&K.hasOwnProperty("__staleWhileFetching")&&K.__abortController instanceof I$8}async fetch(q,K={}){let{allowStale:_=this.allowStale,updateAgeOnGet:z=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:$=this.ttl,noDisposeOnSet:A=this.noDisposeOnSet,size:O=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:j=this.noUpdateTTL,noDeleteOnFetchRejection:H=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:J=this.allowStaleOnFetchRejection,ignoreFetchAbort:M=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,context:P,forceRefresh:W=!1,status:D,signal:f}=K;if(!this.#N){if(D)D.fetch="get";return this.get(q,{allowStale:_,updateAgeOnGet:z,noDeleteOnStaleGet:Y,status:D})}let G={allowStale:_,updateAgeOnGet:z,noDeleteOnStaleGet:Y,ttl:$,noDisposeOnSet:A,size:O,sizeCalculation:w,noUpdateTTL:j,noDeleteOnFetchRejection:H,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:X,ignoreFetchAbort:M,status:D,signal:f},Z=this.#H.get(q);if(Z===void 0){if(D)D.fetch="miss";let T=this.#m(q,Z,G,P);return T.__returned=T}else{let T=this.#A[Z];if(this.#X(T)){let R=_&&T.__staleWhileFetching!==void 0;if(D){if(D.fetch="inflight",R)D.returnedStale=!0}return R?T.__staleWhileFetching:T.__returned=T}let v=this.#V(Z);if(!W&&!v){if(D)D.fetch="hit";if(this.#x(Z),z)this.#h(Z);if(D)this.#y(D,Z);return T}let V=this.#m(q,Z,G,P),S=V.__staleWhileFetching!==void 0&&_;if(D){if(D.fetch=v?"stale":"refresh",S&&v)D.returnedStale=!0}return S?V.__staleWhileFetching:V.__returned=V}}async forceFetch(q,K={}){let _=await this.fetch(q,K);if(_===void 0)throw Error("fetch() returned undefined");return _}memo(q,K={}){let _=this.#O;if(!_)throw Error("no memoMethod provided to constructor");let{context:z,forceRefresh:Y,...$}=K,A=this.get(q,$);if(!Y&&A!==void 0)return A;let O=_(q,A,{options:$,context:z});return this.set(q,O,$),O}get(q,K={}){let{allowStale:_=this.allowStale,updateAgeOnGet:z=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:$}=K,A=this.#H.get(q);if(A!==void 0){let O=this.#A[A],w=this.#X(O);if($)this.#y($,A);if(this.#V(A)){if($)$.get="stale";if(!w){if(!Y)this.#R(q,"expire");if($&&_)$.returnedStale=!0;return _?O:void 0}else{if($&&_&&O.__staleWhileFetching!==void 0)$.returnedStale=!0;return _?O.__staleWhileFetching:void 0}}else{if($)$.get="hit";if(w)return O.__staleWhileFetching;if(this.#x(A),z)this.#h(A);return O}}else if($)$.get="miss"}#g(q,K){this.#D[K]=q,this.#M[q]=K}#x(q){if(q!==this.#J){if(q===this.#P)this.#P=this.#M[q];else this.#g(this.#D[q],this.#M[q]);this.#g(this.#J,q),this.#J=q}}delete(q){return this.#R(q,"delete")}#R(q,K){let _=!1;if(this.#$!==0){let z=this.#H.get(q);if(z!==void 0)if(_=!0,this.#$===1)this.#F(K);else{this.#b(z);let Y=this.#A[z];if(this.#X(Y))Y.__abortController.abort(Error("deleted"));else if(this.#v||this.#Z){if(this.#v)this.#_?.(Y,q,K);if(this.#Z)this.#W?.push([Y,q,K])}if(this.#H.delete(q),this.#j[z]=void 0,this.#A[z]=void 0,z===this.#J)this.#J=this.#D[z];else if(z===this.#P)this.#P=this.#M[z];else{let $=this.#D[z];this.#M[$]=this.#M[z];let A=this.#M[z];this.#D[A]=this.#D[z]}this.#$--,this.#f.push(z)}}if(this.#Z&&this.#W?.length){let z=this.#W,Y;while(Y=z?.shift())this.#Y?.(...Y)}return _}clear(){return this.#F("delete")}#F(q){for(let K of this.#L({allowStale:!0})){let _=this.#A[K];if(this.#X(_))_.__abortController.abort(Error("deleted"));else{let z=this.#j[K];if(this.#v)this.#_?.(_,z,q);if(this.#Z)this.#W?.push([_,z,q])}}if(this.#H.clear(),this.#A.fill(void 0),this.#j.fill(void 0),this.#T&&this.#k)this.#T.fill(0),this.#k.fill(0);if(this.#G)this.#G.fill(0);if(this.#P=0,this.#J=0,this.#f.length=0,this.#w=0,this.#$=0,this.#Z&&this.#W){let K=this.#W,_;while(_=K?.shift())this.#Y?.(..._)}}}});function qp6(q,K=300000){let _=new Map,z=new Map,Y=async(...$)=>{let A=g6($),O=_.get(A),w=Date.now();if(!O){let j=z.get(A);if(j)return j;let H=q(...$);z.set(A,H);try{let J=await H;if(z.get(A)===H)_.set(A,{value:J,timestamp:w,refreshing:!1});return J}finally{if(z.get(A)===H)z.delete(A)}}if(O&&w-O.timestamp>K&&!O.refreshing){O.refreshing=!0;let j=O;return q(...$).then((H)=>{if(_.get(A)===j)_.set(A,{value:H,timestamp:Date.now(),refreshing:!1})}).catch((H)=>{if(H6(H),_.get(A)===j)_.delete(A)}),O.value}return _.get(A).value};return Y.cache={clear:()=>{_.clear(),z.clear()}},Y}function HP(q,K,_=100){let z=new nk({max:_}),Y=(...$)=>{let A=K(...$),O=z.get(A);if(O!==void 0)return O;let w=q(...$);return z.set(A,w),w};return Y.cache={clear:()=>z.clear(),size:()=>z.size,delete:($)=>z.delete($),get:($)=>z.peek($),has:($)=>z.has($)},Y}var VB=y(()=>{gW6();E8();l8()});import*as FW6 from"path";import*as $R7 from"path/win32";function M41(q){try{return xe(`dir "${q}"`,{stdio:"pipe"}),!0}catch{return!1}}function vL5(q){if(q==="git"){let K=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let _ of K)if(M41(_))return _}try{let _=xe(`where.exe ${q}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
137`).filter(Boolean),z=Z8().toLowerCase();for(let Y of _){let $=FW6.resolve(Y).toLowerCase();if(FW6.dirname($).toLowerCase()===z||$.startsWith(z+FW6.sep)){N(`Skipping potentially malicious executable in current directory: ${Y}`);continue}return Y}return null}catch{return null}}function AR7(){if(Z1()==="windows"){let q=X41();process.env.SHELL=q,N(`Using bash path: "${q}"`)}}var X41,ff,w_6;var NB=y(()=>{F4();I7();_8();x$8();VB();vK();X41=_1(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(M41(process.env.CLAUDE_CODE_GIT_BASH_PATH))return process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${process.env.CLAUDE_CODE_GIT_BASH_PATH}"`),process.exit(1)}let q=vL5("git");if(q){let K=$R7.join(q,"..","..","bin","bash.exe");if(M41(K))return K}console.error("Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe"),process.exit(1)}),ff=HP((q)=>{if(q.startsWith("\\\\"))return q.replace(/\\/g,"/");let K=q.match(/^([A-Za-z]):[/\\]/);if(K)return"/"+K[1].toLowerCase()+q.slice(2).replace(/\\/g,"/");return q.replace(/\\/g,"/")},(q)=>q,500),w_6=HP((q)=>{if(q.startsWith("//"))return q.replace(/\//g,"\\");let K=q.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(K){let z=K[1].toUpperCase(),Y=q.slice(("/cygdrive/"+K[1]).length);return z+":"+(Y||"\\").replace(/\//g,"\\")}let _=q.match(/^\/([A-Za-z])(\/|$)/);if(_){let z=_[1].toUpperCase(),Y=q.slice(2);return z+":"+(Y||"\\").replace(/\//g,"\\")}return q.replace(/\//g,"\\")},(q)=>q,500)});import{execFile as kL5}from"child_process";import{promisify as VL5}from"util";async function u$8(q){try{let{stdout:K}=await NL5("git",["worktree","list","--porcelain"],{cwd:q,timeout:5000});if(!K)return[];return K.split(`
138`).filter((_)=>_.startsWith("worktree ")).map((_)=>_.slice(9).normalize("NFC"))}catch{return[]}}var NL5;var m$8=y(()=>{NL5=VL5(kL5)});import{open as OR7,readdir as Rb$,realpath as hb$,stat as Sb$}from"fs/promises";import{join as yL5}from"path";function wR7(q){if(typeof q!=="string")return null;return EL5.test(q)?q:null}function jR7(q){if(!q.includes("\\"))return q;try{return JSON.parse(`"${q}"`)}catch{return q}}function UW6(q,K){let _=[`"${K}":"`,`"${K}": "`];for(let z of _){let Y=q.indexOf(z);if(Y<0)continue;let $=Y+z.length,A=$;while(A<q.length){if(q[A]==="\\"){A+=2;continue}if(q[A]==='"')return jR7(q.slice($,A));A++}}return}function UT(q,K){let _=[`"${K}":"`,`"${K}": "`],z;for(let Y of _){let $=0;while(!0){let A=q.indexOf(Y,$);if(A<0)break;let O=A+Y.length,w=O;while(w<q.length){if(q[w]==="\\"){w+=2;continue}if(q[w]==='"'){z=jR7(q.slice(O,w));break}w++}$=w+1}}return z}async function HR7(q,K,_){try{let z=await OR7(q,"r");try{let Y=await z.read(_,0,ue,0);if(Y.bytesRead===0)return{head:"",tail:""};let $=_.toString("utf8",0,Y.bytesRead),A=Math.max(0,K-ue),O=$;if(A>0){let w=await z.read(_,0,ue,A);O=_.toString("utf8",0,w.bytesRead)}return{head:$,tail:O}}finally{await z.close()}}catch{return{head:"",tail:""}}}function LL5(q){return Math.abs(Y_6(q)).toString(36)}function JP(q){let K=q.replace(/[^a-zA-Z0-9]/g,"-");if(K.length<=P41)return K;let _=typeof Bun<"u"?Bun.hash(q).toString(36):LL5(q);return`${K.slice(0,P41)}-${_}`}function W41(){return yL5(c1(),"projects")}function SL5(){return hL5??=Buffer.from('"compact_boundary"')}function JR7(q){try{let K=JSON.parse(q);if(K.type!=="system"||K.subtype!=="compact_boundary")return null;return{hasPreservedSegment:Boolean(K.compactMetadata?.preservedSegment)}}catch{return null}}function j_6(q,K,_,z){let Y=z-_;if(Y<=0)return;if(q.len+Y>q.buf.length){let $=Buffer.allocUnsafe(Math.min(Math.max(q.buf.length*2,q.len+Y),q.cap));q.buf.copy($,0,0,q.len),q.buf=$}K.copy(q.buf,q.len,_,z),q.len+=Y}function p$8(q,K,_,z){return z-_>=K.length&&q.compare(K,0,K.length,_,_+K.length)===0}function IL5(q,K,_){if(q.straddleSnapCarryLen=0,q.straddleSnapTailEnd=0,q.carryLen===0)return 0;let z=q.carryBuf,Y=K.indexOf(Kp6);if(Y===-1||Y>=_)return 0;let $=Y+1;if(p$8(z,B$8,0,q.carryLen))q.straddleSnapCarryLen=q.carryLen,q.straddleSnapTailEnd=$,q.lastSnapSrc=null;else if(q.carryLen<B$8.length)return 0;else{if(p$8(z,CL5,0,q.carryLen)){let A=JR7(z.toString("utf-8",0,q.carryLen)+K.toString("utf-8",0,Y));if(A?.hasPreservedSegment)q.hasPreservedSegment=!0;else if(A)q.out.len=0,q.boundaryStartOffset=q.bufFileOff,q.hasPreservedSegment=!1,q.lastSnapSrc=null}j_6(q.out,z,0,q.carryLen),j_6(q.out,K,0,$)}return q.bufFileOff+=q.carryLen+$,q.carryLen=0,$}function uL5(q,K,_){let z=K.indexOf(_),Y=0,$=0,A=-1,O=-1,w=K.indexOf(Kp6);while(w!==-1){let j=w+1;if(z!==-1&&z<$)z=K.indexOf(_,$);if(p$8(K,B$8,$,j))j_6(q.out,K,Y,$),A=$,O=j,Y=j;else if(z>=$&&z<Math.min($+xL5,j)){let H=JR7(K.toString("utf-8",$,w));if(H?.hasPreservedSegment)q.hasPreservedSegment=!0;else if(H)q.out.len=0,q.boundaryStartOffset=q.bufFileOff+$,q.hasPreservedSegment=!1,q.lastSnapSrc=null,A=-1,q.straddleSnapCarryLen=0,Y=$;z=K.indexOf(_,z+_.length)}$=j,w=K.indexOf(Kp6,$)}return j_6(q.out,K,Y,$),{lastSnapStart:A,lastSnapEnd:O,trailStart:$}}function mL5(q,K,_,z,Y){if(z!==-1){if(q.lastSnapLen=Y-z,q.lastSnapBuf===void 0||q.lastSnapLen>q.lastSnapBuf.length)q.lastSnapBuf=Buffer.allocUnsafe(q.lastSnapLen);K.copy(q.lastSnapBuf,0,z,Y),q.lastSnapSrc=q.lastSnapBuf}else if(q.straddleSnapCarryLen>0){if(q.lastSnapLen=q.straddleSnapCarryLen+q.straddleSnapTailEnd,q.lastSnapBuf===void 0||q.lastSnapLen>q.lastSnapBuf.length)q.lastSnapBuf=Buffer.allocUnsafe(q.lastSnapLen);q.carryBuf.copy(q.lastSnapBuf,0,0,q.straddleSnapCarryLen),_.copy(q.lastSnapBuf,q.straddleSnapCarryLen,0,q.straddleSnapTailEnd),q.lastSnapSrc=q.lastSnapBuf}}function pL5(q,K,_){if(q.carryLen=K.length-_,q.carryLen>0){if(q.carryBuf===void 0||q.carryLen>q.carryBuf.length)q.carryBuf=Buffer.allocUnsafe(q.carryLen);K.copy(q.carryBuf,0,_,K.length)}}function BL5(q){if(q.carryLen>0){let K=q.carryBuf;if(p$8(K,B$8,0,q.carryLen))q.lastSnapSrc=K,q.lastSnapLen=q.carryLen;else j_6(q.out,K,0,q.carryLen)}if(q.lastSnapSrc){if(q.out.len>0&&q.out.buf[q.out.len-1]!==Kp6)j_6(q.out,bL5,0,1);j_6(q.out,q.lastSnapSrc,0,q.lastSnapLen)}}async function g$8(q,K){let _=SL5(),z=RL5,Y={out:{buf:Buffer.allocUnsafe(Math.min(K,8388608)),len:0,cap:K+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},$=Buffer.allocUnsafe(z),A=await OR7(q,"r");try{let O=0;while(O<K){let{bytesRead:w}=await A.read($,0,Math.min(z,K-O),O);if(w===0)break;O+=w;let j=IL5(Y,$,w),H;if(Y.carryLen>0){let M=Y.carryLen+(w-j);H=Buffer.allocUnsafe(M),Y.carryBuf.copy(H,0,0,Y.carryLen),$.copy(H,Y.carryLen,j,w)}else H=$.subarray(j,w);let J=uL5(Y,H,_);mL5(Y,H,$,J.lastSnapStart,J.lastSnapEnd),pL5(Y,H,J.trailStart),Y.bufFileOff+=J.trailStart}BL5(Y)}finally{await A.close()}return{boundaryStartOffset:Y.boundaryStartOffset,postBoundaryBuf:Y.out.buf.subarray(0,Y.out.len),hasPreservedSegment:Y.hasPreservedSegment}}var ue=65536,EL5,P41=200,RL5=1048576,D41=5242880,hL5,B$8,CL5,Kp6=10,bL5,xL5=256;var QW6=y(()=>{m8();m$8();EL5=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;B$8=Buffer.from('{"type":"attribution-snapshot"'),CL5=Buffer.from('{"type":"system"'),bL5=Buffer.from([Kp6])});import{homedir as MR7}from"os";import{dirname as XR7,isAbsolute as gL5,join as FL5,normalize as f41,relative as UL5,resolve as QL5}from"path";function lq(q,K){let _=K??Z8()??X8().cwd();if(typeof q!=="string")throw TypeError(`Path must be a string, received ${typeof q}`);if(typeof _!=="string")throw TypeError(`Base directory must be a string, received ${typeof _}`);if(q.includes("\x00")||_.includes("\x00"))throw Error("Path contains null bytes");let z=q.trim();if(!z)return f41(_).normalize("NFC");if(z==="~")return MR7().normalize("NFC");if(z.startsWith("~/"))return FL5(MR7(),z.slice(2)).normalize("NFC");let Y=z;if(Z1()==="windows"&&z.match(/^\/[a-z]\//i))try{Y=w_6(z)}catch{Y=z}if(gL5(Y))return f41(Y).normalize("NFC");return QL5(_,Y).normalize("NFC")}function dW6(q){let K=UL5(Z8(),q);return K.startsWith("..")?q:K}function IZ(q){let K=lq(q);if(K.startsWith("\\\\")||K.startsWith("//"))return XR7(K);try{if(X8().statSync(K).isDirectory())return K}catch{}return XR7(K)}function yB(q){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(q)}function H_6(q){return f41(q).replace(/\\/g,"/")}var dz=y(()=>{I7();e7();vK();NB();QW6()});import{chmodSync as dL5,writeFileSync as PR7}from"fs";import{realpath as cL5,stat as DR7}from"fs/promises";import{homedir as fR7}from"os";import{basename as Z41,dirname as F$8,extname as WR7,isAbsolute as lL5,join as cW6,normalize as nL5,relative as ZR7,resolve as iL5,sep as _p6}from"path";async function u5(q){try{return await DR7(q),!0}catch{return!1}}function GR7(q){try{return X8().readFileSync(q,{encoding:"utf8"})}catch(K){return H6(K),null}}function ik(q){let K=X8();return Math.floor(K.statSync(q).mtimeMs)}async function zp6(q){let K=await X8().stat(q);return Math.floor(K.mtimeMs)}function me(q,K,_,z){let Y=K;if(z==="CRLF")Y=K.replaceAll(`\r
139`,`
140`).split(`
141`).join(`\r

Callers 4

hV6Function · 0.85
validateInputFunction · 0.85
callFunction · 0.85
A5YFunction · 0.85

Calls 1

X8Function · 0.85

Tested by

no test coverage detected