ocx 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +156 -157
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -1,107 +1,106 @@
1
1
  #!/usr/bin/env -S bun --no-env-file
2
2
  // @bun
3
- var hW=Object.create;var{getPrototypeOf:cW,defineProperty:o8,getOwnPropertyNames:lW}=Object;var dW=Object.prototype.hasOwnProperty;var tY=($,_,U)=>{U=$!=null?hW(cW($)):{};let Q=_||!$||!$.__esModule?o8(U,"default",{value:$,enumerable:!0}):U;for(let v of lW($))if(!dW.call(Q,v))o8(Q,v,{get:()=>$[v],enumerable:!0});return Q};var N6=($,_)=>()=>(_||$((_={exports:{}}).exports,_),_.exports);var s$=($,_)=>{for(var U in _)o8($,U,{get:_[U],enumerable:!0,configurable:!0,set:(Q)=>_[U]=()=>Q})};var b=($,_)=>()=>($&&(_=$($=0)),_);var P1=import.meta.require;function l0($,_=!1){let U=$.length,Q=0,v="",J=0,Y=16,z=0,I=0,X=0,q=0,G=0;function j(A,u){let k=0,O=0;while(k<A||!u){let w=$.charCodeAt(Q);if(w>=48&&w<=57)O=O*16+w-48;else if(w>=65&&w<=70)O=O*16+w-65+10;else if(w>=97&&w<=102)O=O*16+w-97+10;else break;Q++,k++}if(k<A)O=-1;return O}function H(A){Q=A,v="",J=0,Y=16,G=0}function Z(){let A=Q;if($.charCodeAt(Q)===48)Q++;else{Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}if(Q<$.length&&$.charCodeAt(Q)===46)if(Q++,Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}else return G=3,$.substring(A,Q);let u=Q;if(Q<$.length&&($.charCodeAt(Q)===69||$.charCodeAt(Q)===101)){if(Q++,Q<$.length&&$.charCodeAt(Q)===43||$.charCodeAt(Q)===45)Q++;if(Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++;u=Q}else G=3}return $.substring(A,u)}function V(){let A="",u=Q;while(!0){if(Q>=U){A+=$.substring(u,Q),G=2;break}let k=$.charCodeAt(Q);if(k===34){A+=$.substring(u,Q),Q++;break}if(k===92){if(A+=$.substring(u,Q),Q++,Q>=U){G=2;break}switch($.charCodeAt(Q++)){case 34:A+='"';break;case 92:A+="\\";break;case 47:A+="/";break;case 98:A+="\b";break;case 102:A+="\f";break;case 110:A+=`
4
- `;break;case 114:A+="\r";break;case 116:A+="\t";break;case 117:let w=j(4,!0);if(w>=0)A+=String.fromCharCode(w);else G=4;break;default:G=5}u=Q;continue}if(k>=0&&k<=31)if(c0(k)){A+=$.substring(u,Q),G=2;break}else G=6;Q++}return A}function S(){if(v="",G=0,J=Q,I=z,q=X,Q>=U)return J=U,Y=17;let A=$.charCodeAt(Q);if(t8(A)){do Q++,v+=String.fromCharCode(A),A=$.charCodeAt(Q);while(t8(A));return Y=15}if(c0(A)){if(Q++,v+=String.fromCharCode(A),A===13&&$.charCodeAt(Q)===10)Q++,v+=`
5
- `;return z++,X=Q,Y=14}switch(A){case 123:return Q++,Y=1;case 125:return Q++,Y=2;case 91:return Q++,Y=3;case 93:return Q++,Y=4;case 58:return Q++,Y=6;case 44:return Q++,Y=5;case 34:return Q++,v=V(),Y=10;case 47:let u=Q-1;if($.charCodeAt(Q+1)===47){Q+=2;while(Q<U){if(c0($.charCodeAt(Q)))break;Q++}return v=$.substring(u,Q),Y=12}if($.charCodeAt(Q+1)===42){Q+=2;let k=U-1,O=!1;while(Q<k){let w=$.charCodeAt(Q);if(w===42&&$.charCodeAt(Q+1)===47){Q+=2,O=!0;break}if(Q++,c0(w)){if(w===13&&$.charCodeAt(Q)===10)Q++;z++,X=Q}}if(!O)Q++,G=1;return v=$.substring(u,Q),Y=13}return v+=String.fromCharCode(A),Q++,Y=16;case 45:if(v+=String.fromCharCode(A),Q++,Q===U||!x1($.charCodeAt(Q)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return v+=Z(),Y=11;default:while(Q<U&&T(A))Q++,A=$.charCodeAt(Q);if(J!==Q){switch(v=$.substring(J,Q),v){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return v+=String.fromCharCode(A),Q++,Y=16}}function T(A){if(t8(A)||c0(A))return!1;switch(A){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function r(){let A;do A=S();while(A>=12&&A<=15);return A}return{setPosition:H,getPosition:()=>Q,scan:_?r:S,getToken:()=>Y,getTokenValue:()=>v,getTokenOffset:()=>J,getTokenLength:()=>Q-J,getTokenStartLine:()=>I,getTokenStartCharacter:()=>J-q,getTokenError:()=>G}}function t8($){return $===32||$===9}function c0($){return $===10||$===13}function x1($){return $>=48&&$<=57}var aY;var vv=b(()=>{(function($){$[$.lineFeed=10]="lineFeed",$[$.carriageReturn=13]="carriageReturn",$[$.space=32]="space",$[$._0=48]="_0",$[$._1=49]="_1",$[$._2=50]="_2",$[$._3=51]="_3",$[$._4=52]="_4",$[$._5=53]="_5",$[$._6=54]="_6",$[$._7=55]="_7",$[$._8=56]="_8",$[$._9=57]="_9",$[$.a=97]="a",$[$.b=98]="b",$[$.c=99]="c",$[$.d=100]="d",$[$.e=101]="e",$[$.f=102]="f",$[$.g=103]="g",$[$.h=104]="h",$[$.i=105]="i",$[$.j=106]="j",$[$.k=107]="k",$[$.l=108]="l",$[$.m=109]="m",$[$.n=110]="n",$[$.o=111]="o",$[$.p=112]="p",$[$.q=113]="q",$[$.r=114]="r",$[$.s=115]="s",$[$.t=116]="t",$[$.u=117]="u",$[$.v=118]="v",$[$.w=119]="w",$[$.x=120]="x",$[$.y=121]="y",$[$.z=122]="z",$[$.A=65]="A",$[$.B=66]="B",$[$.C=67]="C",$[$.D=68]="D",$[$.E=69]="E",$[$.F=70]="F",$[$.G=71]="G",$[$.H=72]="H",$[$.I=73]="I",$[$.J=74]="J",$[$.K=75]="K",$[$.L=76]="L",$[$.M=77]="M",$[$.N=78]="N",$[$.O=79]="O",$[$.P=80]="P",$[$.Q=81]="Q",$[$.R=82]="R",$[$.S=83]="S",$[$.T=84]="T",$[$.U=85]="U",$[$.V=86]="V",$[$.W=87]="W",$[$.X=88]="X",$[$.Y=89]="Y",$[$.Z=90]="Z",$[$.asterisk=42]="asterisk",$[$.backslash=92]="backslash",$[$.closeBrace=125]="closeBrace",$[$.closeBracket=93]="closeBracket",$[$.colon=58]="colon",$[$.comma=44]="comma",$[$.dot=46]="dot",$[$.doubleQuote=34]="doubleQuote",$[$.minus=45]="minus",$[$.openBrace=123]="openBrace",$[$.openBracket=91]="openBracket",$[$.plus=43]="plus",$[$.slash=47]="slash",$[$.formFeed=12]="formFeed",$[$.tab=9]="tab"})(aY||(aY={}))});var M4,a8,sY;var eY=b(()=>{M4=Array(20).fill(0).map(($,_)=>{return" ".repeat(_)}),a8={" ":{"\n":Array(200).fill(0).map(($,_)=>{return`
6
- `+" ".repeat(_)}),"\r":Array(200).fill(0).map(($,_)=>{return"\r"+" ".repeat(_)}),"\r\n":Array(200).fill(0).map(($,_)=>{return`\r
7
- `+" ".repeat(_)})},"\t":{"\n":Array(200).fill(0).map(($,_)=>{return`
8
- `+"\t".repeat(_)}),"\r":Array(200).fill(0).map(($,_)=>{return"\r"+"\t".repeat(_)}),"\r\n":Array(200).fill(0).map(($,_)=>{return`\r
9
- `+"\t".repeat(_)})}},sY=[`
3
+ var HW=Object.create;var{getPrototypeOf:GW,defineProperty:F7,getOwnPropertyNames:KW}=Object;var WW=Object.prototype.hasOwnProperty;var z5=(Q,$,Y)=>{Y=Q!=null?HW(GW(Q)):{};let q=$||!Q||!Q.__esModule?F7(Y,"default",{value:Q,enumerable:!0}):Y;for(let J of KW(Q))if(!WW.call(q,J))F7(q,J,{get:()=>Q[J],enumerable:!0});return q};var F8=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports);var Y8=(Q,$)=>{for(var Y in $)F7(Q,Y,{get:$[Y],enumerable:!0,configurable:!0,set:(q)=>$[Y]=()=>q})};var A=(Q,$)=>()=>(Q&&($=Q(Q=0)),$);var z9=import.meta.require;function s9(Q,$=!1){let Y=Q.length,q=0,J="",X=0,H=16,G=0,K=0,W=0,z=0,B=0;function Z(N,x){let w=0,b=0;while(w<N||!x){let D=Q.charCodeAt(q);if(D>=48&&D<=57)b=b*16+D-48;else if(D>=65&&D<=70)b=b*16+D-65+10;else if(D>=97&&D<=102)b=b*16+D-97+10;else break;q++,w++}if(w<N)b=-1;return b}function M(N){q=N,J="",X=0,H=16,B=0}function V(){let N=q;if(Q.charCodeAt(q)===48)q++;else{q++;while(q<Q.length&&B9(Q.charCodeAt(q)))q++}if(q<Q.length&&Q.charCodeAt(q)===46)if(q++,q<Q.length&&B9(Q.charCodeAt(q))){q++;while(q<Q.length&&B9(Q.charCodeAt(q)))q++}else return B=3,Q.substring(N,q);let x=q;if(q<Q.length&&(Q.charCodeAt(q)===69||Q.charCodeAt(q)===101)){if(q++,q<Q.length&&Q.charCodeAt(q)===43||Q.charCodeAt(q)===45)q++;if(q<Q.length&&B9(Q.charCodeAt(q))){q++;while(q<Q.length&&B9(Q.charCodeAt(q)))q++;x=q}else B=3}return Q.substring(N,x)}function U(){let N="",x=q;while(!0){if(q>=Y){N+=Q.substring(x,q),B=2;break}let w=Q.charCodeAt(q);if(w===34){N+=Q.substring(x,q),q++;break}if(w===92){if(N+=Q.substring(x,q),q++,q>=Y){B=2;break}switch(Q.charCodeAt(q++)){case 34:N+='"';break;case 92:N+="\\";break;case 47:N+="/";break;case 98:N+="\b";break;case 102:N+="\f";break;case 110:N+=`
4
+ `;break;case 114:N+="\r";break;case 116:N+="\t";break;case 117:let D=Z(4,!0);if(D>=0)N+=String.fromCharCode(D);else B=4;break;default:B=5}x=q;continue}if(w>=0&&w<=31)if(o9(w)){N+=Q.substring(x,q),B=2;break}else B=6;q++}return N}function R(){if(J="",B=0,X=q,K=G,z=W,q>=Y)return X=Y,H=17;let N=Q.charCodeAt(q);if(j7(N)){do q++,J+=String.fromCharCode(N),N=Q.charCodeAt(q);while(j7(N));return H=15}if(o9(N)){if(q++,J+=String.fromCharCode(N),N===13&&Q.charCodeAt(q)===10)q++,J+=`
5
+ `;return G++,W=q,H=14}switch(N){case 123:return q++,H=1;case 125:return q++,H=2;case 91:return q++,H=3;case 93:return q++,H=4;case 58:return q++,H=6;case 44:return q++,H=5;case 34:return q++,J=U(),H=10;case 47:let x=q-1;if(Q.charCodeAt(q+1)===47){q+=2;while(q<Y){if(o9(Q.charCodeAt(q)))break;q++}return J=Q.substring(x,q),H=12}if(Q.charCodeAt(q+1)===42){q+=2;let w=Y-1,b=!1;while(q<w){let D=Q.charCodeAt(q);if(D===42&&Q.charCodeAt(q+1)===47){q+=2,b=!0;break}if(q++,o9(D)){if(D===13&&Q.charCodeAt(q)===10)q++;G++,W=q}}if(!b)q++,B=1;return J=Q.substring(x,q),H=13}return J+=String.fromCharCode(N),q++,H=16;case 45:if(J+=String.fromCharCode(N),q++,q===Y||!B9(Q.charCodeAt(q)))return H=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return J+=V(),H=11;default:while(q<Y&&I(N))q++,N=Q.charCodeAt(q);if(X!==q){switch(J=Q.substring(X,q),J){case"true":return H=8;case"false":return H=9;case"null":return H=7}return H=16}return J+=String.fromCharCode(N),q++,H=16}}function I(N){if(j7(N)||o9(N))return!1;switch(N){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function g(){let N;do N=R();while(N>=12&&N<=15);return N}return{setPosition:M,getPosition:()=>q,scan:$?g:R,getToken:()=>H,getTokenValue:()=>J,getTokenOffset:()=>X,getTokenLength:()=>q-X,getTokenStartLine:()=>K,getTokenStartCharacter:()=>X-z,getTokenError:()=>B}}function j7(Q){return Q===32||Q===9}function o9(Q){return Q===10||Q===13}function B9(Q){return Q>=48&&Q<=57}var B5;var u2=A(()=>{(function(Q){Q[Q.lineFeed=10]="lineFeed",Q[Q.carriageReturn=13]="carriageReturn",Q[Q.space=32]="space",Q[Q._0=48]="_0",Q[Q._1=49]="_1",Q[Q._2=50]="_2",Q[Q._3=51]="_3",Q[Q._4=52]="_4",Q[Q._5=53]="_5",Q[Q._6=54]="_6",Q[Q._7=55]="_7",Q[Q._8=56]="_8",Q[Q._9=57]="_9",Q[Q.a=97]="a",Q[Q.b=98]="b",Q[Q.c=99]="c",Q[Q.d=100]="d",Q[Q.e=101]="e",Q[Q.f=102]="f",Q[Q.g=103]="g",Q[Q.h=104]="h",Q[Q.i=105]="i",Q[Q.j=106]="j",Q[Q.k=107]="k",Q[Q.l=108]="l",Q[Q.m=109]="m",Q[Q.n=110]="n",Q[Q.o=111]="o",Q[Q.p=112]="p",Q[Q.q=113]="q",Q[Q.r=114]="r",Q[Q.s=115]="s",Q[Q.t=116]="t",Q[Q.u=117]="u",Q[Q.v=118]="v",Q[Q.w=119]="w",Q[Q.x=120]="x",Q[Q.y=121]="y",Q[Q.z=122]="z",Q[Q.A=65]="A",Q[Q.B=66]="B",Q[Q.C=67]="C",Q[Q.D=68]="D",Q[Q.E=69]="E",Q[Q.F=70]="F",Q[Q.G=71]="G",Q[Q.H=72]="H",Q[Q.I=73]="I",Q[Q.J=74]="J",Q[Q.K=75]="K",Q[Q.L=76]="L",Q[Q.M=77]="M",Q[Q.N=78]="N",Q[Q.O=79]="O",Q[Q.P=80]="P",Q[Q.Q=81]="Q",Q[Q.R=82]="R",Q[Q.S=83]="S",Q[Q.T=84]="T",Q[Q.U=85]="U",Q[Q.V=86]="V",Q[Q.W=87]="W",Q[Q.X=88]="X",Q[Q.Y=89]="Y",Q[Q.Z=90]="Z",Q[Q.asterisk=42]="asterisk",Q[Q.backslash=92]="backslash",Q[Q.closeBrace=125]="closeBrace",Q[Q.closeBracket=93]="closeBracket",Q[Q.colon=58]="colon",Q[Q.comma=44]="comma",Q[Q.dot=46]="dot",Q[Q.doubleQuote=34]="doubleQuote",Q[Q.minus=45]="minus",Q[Q.openBrace=123]="openBrace",Q[Q.openBracket=91]="openBracket",Q[Q.plus=43]="plus",Q[Q.slash=47]="slash",Q[Q.formFeed=12]="formFeed",Q[Q.tab=9]="tab"})(B5||(B5={}))});var Z0,w7,_5;var Z5=A(()=>{Z0=Array(20).fill(0).map((Q,$)=>{return" ".repeat($)}),w7={" ":{"\n":Array(200).fill(0).map((Q,$)=>{return`
6
+ `+" ".repeat($)}),"\r":Array(200).fill(0).map((Q,$)=>{return"\r"+" ".repeat($)}),"\r\n":Array(200).fill(0).map((Q,$)=>{return`\r
7
+ `+" ".repeat($)})},"\t":{"\n":Array(200).fill(0).map((Q,$)=>{return`
8
+ `+"\t".repeat($)}),"\r":Array(200).fill(0).map((Q,$)=>{return"\r"+"\t".repeat($)}),"\r\n":Array(200).fill(0).map((Q,$)=>{return`\r
9
+ `+"\t".repeat($)})}},_5=[`
10
10
  `,"\r",`\r
11
- `]});function s8($,_,U){let Q,v,J,Y,z;if(_){Y=_.offset,z=Y+_.length,J=Y;while(J>0&&!d0($,J-1))J--;let k=z;while(k<$.length&&!d0($,k))k++;v=$.substring(J,k),Q=iW(v,U)}else v=$,Q=0,J=0,Y=0,z=$.length;let I=nW(U,$),X=sY.includes(I),q=0,G=0,j;if(U.insertSpaces)j=M4[U.tabSize||4]??u1(M4[1],U.tabSize||4);else j="\t";let H=j==="\t"?"\t":" ",Z=l0(v,!1),V=!1;function S(){if(q>1)return u1(I,q)+u1(j,Q+G);let k=j.length*(Q+G);if(!X||k>a8[H][I].length)return I+u1(j,Q+G);if(k<=0)return I;return a8[H][I][k]}function T(){let k=Z.scan();q=0;while(k===15||k===14){if(k===14&&U.keepLines)q+=1;else if(k===14)q=1;k=Z.scan()}return V=k===16||Z.getTokenError()!==0,k}let r=[];function A(k,O,w){if(!V&&(!_||O<z&&w>Y)&&$.substring(O,w)!==k)r.push({offset:O,length:w-O,content:k})}let u=T();if(U.keepLines&&q>0)A(u1(I,q),0,0);if(u!==17){let k=Z.getTokenOffset()+J,O=j.length*Q<20&&U.insertSpaces?M4[j.length*Q]:u1(j,Q);A(O,J,k)}while(u!==17){let k=Z.getTokenOffset()+Z.getTokenLength()+J,O=T(),w="",v$=!1;while(q===0&&(O===12||O===13)){let Q$=Z.getTokenOffset()+J;A(M4[1],k,Q$),k=Z.getTokenOffset()+Z.getTokenLength()+J,v$=O===12,w=v$?S():"",O=T()}if(O===2){if(u!==1)G--;if(U.keepLines&&q>0||!U.keepLines&&u!==1)w=S();else if(U.keepLines)w=M4[1]}else if(O===4){if(u!==3)G--;if(U.keepLines&&q>0||!U.keepLines&&u!==3)w=S();else if(U.keepLines)w=M4[1]}else{switch(u){case 3:case 1:if(G++,U.keepLines&&q>0||!U.keepLines)w=S();else w=M4[1];break;case 5:if(U.keepLines&&q>0||!U.keepLines)w=S();else w=M4[1];break;case 12:w=S();break;case 13:if(q>0)w=S();else if(!v$)w=M4[1];break;case 6:if(U.keepLines&&q>0)w=S();else if(!v$)w=M4[1];break;case 10:if(U.keepLines&&q>0)w=S();else if(O===6&&!v$)w="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(U.keepLines&&q>0)w=S();else if((O===12||O===13)&&!v$)w=M4[1];else if(O!==5&&O!==17)V=!0;break;case 16:V=!0;break}if(q>0&&(O===12||O===13))w=S()}if(O===17)if(U.keepLines&&q>0)w=S();else w=U.insertFinalNewline?I:"";let o=Z.getTokenOffset()+J;A(w,k,o),u=O}return r}function u1($,_){let U="";for(let Q=0;Q<_;Q++)U+=$;return U}function iW($,_){let U=0,Q=0,v=_.tabSize||4;while(U<$.length){let J=$.charAt(U);if(J===M4[1])Q++;else if(J==="\t")Q+=v;else break;U++}return Math.floor(Q/v)}function nW($,_){for(let U=0;U<_.length;U++){let Q=_.charAt(U);if(Q==="\r"){if(U+1<_.length&&_.charAt(U+1)===`
11
+ `]});function D7(Q,$,Y){let q,J,X,H,G;if($){H=$.offset,G=H+$.length,X=H;while(X>0&&!r9(Q,X-1))X--;let w=G;while(w<Q.length&&!r9(Q,w))w++;J=Q.substring(X,w),q=BW(J,Y)}else J=Q,q=0,X=0,H=0,G=Q.length;let K=_W(Y,Q),W=_5.includes(K),z=0,B=0,Z;if(Y.insertSpaces)Z=Z0[Y.tabSize||4]??_9(Z0[1],Y.tabSize||4);else Z="\t";let M=Z==="\t"?"\t":" ",V=s9(J,!1),U=!1;function R(){if(z>1)return _9(K,z)+_9(Z,q+B);let w=Z.length*(q+B);if(!W||w>w7[M][K].length)return K+_9(Z,q+B);if(w<=0)return K;return w7[M][K][w]}function I(){let w=V.scan();z=0;while(w===15||w===14){if(w===14&&Y.keepLines)z+=1;else if(w===14)z=1;w=V.scan()}return U=w===16||V.getTokenError()!==0,w}let g=[];function N(w,b,D){if(!U&&(!$||b<G&&D>H)&&Q.substring(b,D)!==w)g.push({offset:b,length:D-b,content:w})}let x=I();if(Y.keepLines&&z>0)N(_9(K,z),0,0);if(x!==17){let w=V.getTokenOffset()+X,b=Z.length*q<20&&Y.insertSpaces?Z0[Z.length*q]:_9(Z,q);N(b,X,w)}while(x!==17){let w=V.getTokenOffset()+V.getTokenLength()+X,b=I(),D="",r=!1;while(z===0&&(b===12||b===13)){let l=V.getTokenOffset()+X;N(Z0[1],w,l),w=V.getTokenOffset()+V.getTokenLength()+X,r=b===12,D=r?R():"",b=I()}if(b===2){if(x!==1)B--;if(Y.keepLines&&z>0||!Y.keepLines&&x!==1)D=R();else if(Y.keepLines)D=Z0[1]}else if(b===4){if(x!==3)B--;if(Y.keepLines&&z>0||!Y.keepLines&&x!==3)D=R();else if(Y.keepLines)D=Z0[1]}else{switch(x){case 3:case 1:if(B++,Y.keepLines&&z>0||!Y.keepLines)D=R();else D=Z0[1];break;case 5:if(Y.keepLines&&z>0||!Y.keepLines)D=R();else D=Z0[1];break;case 12:D=R();break;case 13:if(z>0)D=R();else if(!r)D=Z0[1];break;case 6:if(Y.keepLines&&z>0)D=R();else if(!r)D=Z0[1];break;case 10:if(Y.keepLines&&z>0)D=R();else if(b===6&&!r)D="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(Y.keepLines&&z>0)D=R();else if((b===12||b===13)&&!r)D=Z0[1];else if(b!==5&&b!==17)U=!0;break;case 16:U=!0;break}if(z>0&&(b===12||b===13))D=R()}if(b===17)if(Y.keepLines&&z>0)D=R();else D=Y.insertFinalNewline?K:"";let n=V.getTokenOffset()+X;N(D,w,n),x=b}return g}function _9(Q,$){let Y="";for(let q=0;q<$;q++)Y+=Q;return Y}function BW(Q,$){let Y=0,q=0,J=$.tabSize||4;while(Y<Q.length){let X=Q.charAt(Y);if(X===Z0[1])q++;else if(X==="\t")q+=J;else break;Y++}return Math.floor(q/J)}function _W(Q,$){for(let Y=0;Y<$.length;Y++){let q=$.charAt(Y);if(q==="\r"){if(Y+1<$.length&&$.charAt(Y+1)===`
12
12
  `)return`\r
13
- `;return"\r"}else if(Q===`
13
+ `;return"\r"}else if(q===`
14
14
  `)return`
15
- `}return $&&$.eol||`
16
- `}function d0($,_){return`\r
17
- `.indexOf($.charAt(_))!==-1}var e8=b(()=>{vv();eY()});function $z($,_=[],U=p0.DEFAULT){let Q=null,v=[],J=[];function Y(I){if(Array.isArray(v))v.push(I);else if(Q!==null)v[Q]=I}return _9($,{onObjectBegin:()=>{let I={};Y(I),J.push(v),v=I,Q=null},onObjectProperty:(I)=>{Q=I},onObjectEnd:()=>{v=J.pop()},onArrayBegin:()=>{let I=[];Y(I),J.push(v),v=I,Q=null},onArrayEnd:()=>{v=J.pop()},onLiteralValue:Y,onError:(I,X,q)=>{_.push({error:I,offset:X,length:q})}},U),v[0]}function $9($,_=[],U=p0.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function v(I){if(Q.type==="property")Q.length=I-Q.offset,Q=Q.parent}function J(I){return Q.children.push(I),I}_9($,{onObjectBegin:(I)=>{Q=J({type:"object",offset:I,length:-1,parent:Q,children:[]})},onObjectProperty:(I,X,q)=>{Q=J({type:"property",offset:X,length:-1,parent:Q,children:[]}),Q.children.push({type:"string",value:I,offset:X,length:q,parent:Q})},onObjectEnd:(I,X)=>{v(I+X),Q.length=I+X-Q.offset,Q=Q.parent,v(I+X)},onArrayBegin:(I,X)=>{Q=J({type:"array",offset:I,length:-1,parent:Q,children:[]})},onArrayEnd:(I,X)=>{Q.length=I+X-Q.offset,Q=Q.parent,v(I+X)},onLiteralValue:(I,X,q)=>{J({type:oW(I),offset:X,length:q,parent:Q,value:I}),v(X+q)},onSeparator:(I,X,q)=>{if(Q.type==="property"){if(I===":")Q.colonOffset=X;else if(I===",")v(X)}},onError:(I,X,q)=>{_.push({error:I,offset:X,length:q})}},U);let z=Q.children[0];if(z)delete z.parent;return z}function Uv($,_){if(!$)return;let U=$;for(let Q of _)if(typeof Q==="string"){if(U.type!=="object"||!Array.isArray(U.children))return;let v=!1;for(let J of U.children)if(Array.isArray(J.children)&&J.children[0].value===Q&&J.children.length===2){U=J.children[1],v=!0;break}if(!v)return}else{let v=Q;if(U.type!=="array"||v<0||!Array.isArray(U.children)||v>=U.children.length)return;U=U.children[v]}return U}function _9($,_,U=p0.DEFAULT){let Q=l0($,!1),v=[],J=0;function Y(C){return C?()=>J===0&&C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function z(C){return C?(h)=>J===0&&C(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function I(C){return C?(h)=>J===0&&C(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>v.slice()):()=>!0}function X(C){return C?()=>{if(J>0)J++;else if(C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>v.slice())===!1)J=1}:()=>!0}function q(C){return C?()=>{if(J>0)J--;if(J===0)C(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let G=X(_.onObjectBegin),j=I(_.onObjectProperty),H=q(_.onObjectEnd),Z=X(_.onArrayBegin),V=q(_.onArrayEnd),S=I(_.onLiteralValue),T=z(_.onSeparator),r=Y(_.onComment),A=z(_.onError),u=U&&U.disallowComments,k=U&&U.allowTrailingComma;function O(){while(!0){let C=Q.scan();switch(Q.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:if(!u)w(11);break;case 2:w(12);break;case 6:w(16);break}switch(C){case 12:case 13:if(u)w(10);else r();break;case 16:w(1);break;case 15:case 14:break;default:return C}}}function w(C,h=[],I$=[]){if(A(C),h.length+I$.length>0){let $$=Q.getToken();while($$!==17){if(h.indexOf($$)!==-1){O();break}else if(I$.indexOf($$)!==-1)break;$$=O()}}}function v$(C){let h=Q.getTokenValue();if(C)S(h);else j(h),v.push(h);return O(),!0}function o(){switch(Q.getToken()){case 11:let C=Q.getTokenValue(),h=Number(C);if(isNaN(h))w(2),h=0;S(h);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return O(),!0}function Q$(){if(Q.getToken()!==10)return w(3,[],[2,5]),!1;if(v$(!1),Q.getToken()===6){if(T(":"),O(),!t())w(4,[],[2,5])}else w(5,[],[2,5]);return v.pop(),!0}function D$(){G(),O();let C=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!C)w(4,[],[]);if(T(","),O(),Q.getToken()===2&&k)break}else if(C)w(6,[],[]);if(!Q$())w(4,[],[2,5]);C=!0}if(H(),Q.getToken()!==2)w(7,[2],[]);else O();return!0}function x(){Z(),O();let C=!0,h=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!h)w(4,[],[]);if(T(","),O(),Q.getToken()===4&&k)break}else if(h)w(6,[],[]);if(C)v.push(0),C=!1;else v[v.length-1]++;if(!t())w(4,[],[4,5]);h=!0}if(V(),!C)v.pop();if(Q.getToken()!==4)w(8,[4],[]);else O();return!0}function t(){switch(Q.getToken()){case 3:return x();case 1:return D$();case 10:return v$(!0);default:return o()}}if(O(),Q.getToken()===17){if(U.allowEmptyContent)return!0;return w(4,[],[]),!1}if(!t())return w(4,[],[]),!1;if(Q.getToken()!==17)w(9,[],[]);return!0}function oW($){switch(typeof $){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!$)return"null";else if(Array.isArray($))return"array";return"object"}default:return"null"}}var p0;var v9=b(()=>{vv();(function($){$.DEFAULT={allowTrailingComma:!1}})(p0||(p0={}))});function _z($,_,U,Q){let v=_.slice(),Y=$9($,[]),z=void 0,I=void 0;while(v.length>0)if(I=v.pop(),z=Uv(Y,v),z===void 0&&U!==void 0)if(typeof I==="string")U={[I]:U};else U=[U];else break;if(!z){if(U===void 0)throw Error("Can not delete in empty document");return a6($,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(U)},Q)}else if(z.type==="object"&&typeof I==="string"&&Array.isArray(z.children)){let X=Uv(z,[I]);if(X!==void 0)if(U===void 0){if(!X.parent)throw Error("Malformed AST");let q=z.children.indexOf(X.parent),G,j=X.parent.offset+X.parent.length;if(q>0){let H=z.children[q-1];G=H.offset+H.length}else if(G=z.offset+1,z.children.length>1)j=z.children[1].offset;return a6($,{offset:G,length:j-G,content:""},Q)}else return a6($,{offset:X.offset,length:X.length,content:JSON.stringify(U)},Q);else{if(U===void 0)return[];let q=`${JSON.stringify(I)}: ${JSON.stringify(U)}`,G=Q.getInsertionIndex?Q.getInsertionIndex(z.children.map((H)=>H.children[0].value)):z.children.length,j;if(G>0){let H=z.children[G-1];j={offset:H.offset+H.length,length:0,content:","+q}}else if(z.children.length===0)j={offset:z.offset+1,length:0,content:q};else j={offset:z.offset+1,length:0,content:q+","};return a6($,j,Q)}}else if(z.type==="array"&&typeof I==="number"&&Array.isArray(z.children)){let X=I;if(X===-1){let q=`${JSON.stringify(U)}`,G;if(z.children.length===0)G={offset:z.offset+1,length:0,content:q};else{let j=z.children[z.children.length-1];G={offset:j.offset+j.length,length:0,content:","+q}}return a6($,G,Q)}else if(U===void 0&&z.children.length>=0){let q=I,G=z.children[q],j;if(z.children.length===1)j={offset:z.offset+1,length:z.length-2,content:""};else if(z.children.length-1===q){let H=z.children[q-1],Z=H.offset+H.length,V=z.offset+z.length;j={offset:Z,length:V-2-Z,content:""}}else j={offset:G.offset,length:z.children[q+1].offset-G.offset,content:""};return a6($,j,Q)}else if(U!==void 0){let q,G=`${JSON.stringify(U)}`;if(!Q.isArrayInsertion&&z.children.length>I){let j=z.children[I];q={offset:j.offset,length:j.length,content:G}}else if(z.children.length===0||I===0)q={offset:z.offset+1,length:0,content:z.children.length===0?G:G+","};else{let j=I>z.children.length?z.children.length:I,H=z.children[j-1];q={offset:H.offset+H.length,length:0,content:","+G}}return a6($,q,Q)}else throw Error(`Can not ${U===void 0?"remove":Q.isArrayInsertion?"insert":"modify"} Array index ${X} as length is not sufficient`)}else throw Error(`Can not add ${typeof I!=="number"?"index":"property"} to parent of type ${z.type}`)}function a6($,_,U){if(!U.formattingOptions)return[_];let Q=Qv($,_),v=_.offset,J=_.offset+_.content.length;if(_.length===0||_.content.length===0){while(v>0&&!d0(Q,v-1))v--;while(J<Q.length&&!d0(Q,J))J++}let Y=s8(Q,{offset:v,length:J-v},{...U.formattingOptions,keepLines:!1});for(let I=Y.length-1;I>=0;I--){let X=Y[I];Q=Qv(Q,X),v=Math.min(v,X.offset),J=Math.max(J,X.offset+X.length),J+=X.content.length-X.length}let z=$.length-(Q.length-J)-v;return[{offset:v,length:z,content:Q.substring(v,J)}]}function Qv($,_){return $.substring(0,_.offset)+_.content+$.substring(_.offset+_.length)}var vz=b(()=>{e8();v9()});function S6($){switch($){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function y1($,_,U,Q){return _z($,_,U,Q)}function C1($,_){let U=_.slice(0).sort((v,J)=>{let Y=v.offset-J.offset;if(Y===0)return v.length-J.length;return Y}),Q=$.length;for(let v=U.length-1;v>=0;v--){let J=U[v];if(J.offset+J.length<=Q)$=Qv($,J);else throw Error("Overlapping edit");Q=J.offset}return $}var Uz,Qz,x$,Jz;var c4=b(()=>{e8();vz();vv();v9();(function($){$[$.None=0]="None",$[$.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=2]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",$[$.InvalidUnicode=4]="InvalidUnicode",$[$.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",$[$.InvalidCharacter=6]="InvalidCharacter"})(Uz||(Uz={}));(function($){$[$.OpenBraceToken=1]="OpenBraceToken",$[$.CloseBraceToken=2]="CloseBraceToken",$[$.OpenBracketToken=3]="OpenBracketToken",$[$.CloseBracketToken=4]="CloseBracketToken",$[$.CommaToken=5]="CommaToken",$[$.ColonToken=6]="ColonToken",$[$.NullKeyword=7]="NullKeyword",$[$.TrueKeyword=8]="TrueKeyword",$[$.FalseKeyword=9]="FalseKeyword",$[$.StringLiteral=10]="StringLiteral",$[$.NumericLiteral=11]="NumericLiteral",$[$.LineCommentTrivia=12]="LineCommentTrivia",$[$.BlockCommentTrivia=13]="BlockCommentTrivia",$[$.LineBreakTrivia=14]="LineBreakTrivia",$[$.Trivia=15]="Trivia",$[$.Unknown=16]="Unknown",$[$.EOF=17]="EOF"})(Qz||(Qz={}));x$=$z;(function($){$[$.InvalidSymbol=1]="InvalidSymbol",$[$.InvalidNumberFormat=2]="InvalidNumberFormat",$[$.PropertyNameExpected=3]="PropertyNameExpected",$[$.ValueExpected=4]="ValueExpected",$[$.ColonExpected=5]="ColonExpected",$[$.CommaExpected=6]="CommaExpected",$[$.CloseBraceExpected=7]="CloseBraceExpected",$[$.CloseBracketExpected=8]="CloseBracketExpected",$[$.EndOfFileExpected=9]="EndOfFileExpected",$[$.InvalidCommentToken=10]="InvalidCommentToken",$[$.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=12]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",$[$.InvalidUnicode=14]="InvalidUnicode",$[$.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",$[$.InvalidCharacter=16]="InvalidCharacter"})(Jz||(Jz={}))});function B($,_,U){function Q(z,I){if(!z._zod)Object.defineProperty(z,"_zod",{value:{def:I,constr:Y,traits:new Set},enumerable:!1});if(z._zod.traits.has($))return;z._zod.traits.add($),_(z,I);let X=Y.prototype,q=Object.keys(X);for(let G=0;G<q.length;G++){let j=q[G];if(!(j in z))z[j]=X[j].bind(z)}}let v=U?.Parent??Object;class J extends v{}Object.defineProperty(J,"name",{value:$});function Y(z){var I;let X=U?.Parent?new J:this;Q(X,z),(I=X._zod).deferred??(I.deferred=[]);for(let q of X._zod.deferred)q();return X}return Object.defineProperty(Y,"init",{value:Q}),Object.defineProperty(Y,Symbol.hasInstance,{value:(z)=>{if(U?.Parent&&z instanceof U.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(Y,"name",{value:$}),Y}function l$($){if($)Object.assign(i0,$);return i0}var U9,Q9,_6,s6,i0;var f1=b(()=>{U9=Object.freeze({status:"aborted"});Q9=Symbol("zod_brand");_6=class _6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};s6=class s6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};i0={}});var E={};s$(E,{unwrapMessage:()=>n0,uint8ArrayToHex:()=>wb,uint8ArrayToBase64url:()=>Db,uint8ArrayToBase64:()=>Iz,stringifyPrimitive:()=>N,slugify:()=>z9,shallowClone:()=>X9,safeExtend:()=>Hb,required:()=>Bb,randomString:()=>zb,propertyKeyTypes:()=>t0,promiseAllObject:()=>Yb,primitiveTypes:()=>q9,prefixIssues:()=>w4,pick:()=>Gb,partial:()=>bb,parsedType:()=>R,optionalKeys:()=>G9,omit:()=>jb,objectClone:()=>Ub,numKeys:()=>Ib,nullish:()=>T6,normalizeParams:()=>P,mergeDefs:()=>H6,merge:()=>Wb,jsonStringifyReplacer:()=>m1,joinValues:()=>D,issue:()=>h1,isPlainObject:()=>E6,isObject:()=>e6,hexToUint8Array:()=>Mb,getSizableOrigin:()=>a0,getParsedType:()=>Xb,getLengthableOrigin:()=>s0,getEnumValues:()=>r0,getElementAtPath:()=>Jb,floatSafeRemainder:()=>Y9,finalizeIssue:()=>H4,extend:()=>Kb,escapeRegex:()=>R4,esc:()=>Jv,defineLazy:()=>Y$,createTransparentProxy:()=>qb,cloneDef:()=>Qb,clone:()=>Y4,cleanRegex:()=>o0,cleanEnum:()=>Zb,captureStackTrace:()=>Yv,cached:()=>g1,base64urlToUint8Array:()=>Vb,base64ToUint8Array:()=>zz,assignProp:()=>R6,assertNotEqual:()=>eW,assertNever:()=>_b,assertIs:()=>$b,assertEqual:()=>sW,assert:()=>vb,allowsEval:()=>I9,aborted:()=>P6,NUMBER_FORMAT_RANGES:()=>j9,Class:()=>Xz,BIGINT_FORMAT_RANGES:()=>K9});function sW($){return $}function eW($){return $}function $b($){}function _b($){throw Error("Unexpected value in exhaustive check")}function vb($){}function r0($){let _=Object.values($).filter((Q)=>typeof Q==="number");return Object.entries($).filter(([Q,v])=>_.indexOf(+Q)===-1).map(([Q,v])=>v)}function D($,_="|"){return $.map((U)=>N(U)).join(_)}function m1($,_){if(typeof _==="bigint")return _.toString();return _}function g1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function T6($){return $===null||$===void 0}function o0($){let _=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(_,U)}function Y9($,_){let U=($.toString().split(".")[1]||"").length,Q=_.toString(),v=(Q.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(Q)){let I=Q.match(/\d?e-(\d?)/);if(I?.[1])v=Number.parseInt(I[1])}let J=U>v?U:v,Y=Number.parseInt($.toFixed(J).replace(".","")),z=Number.parseInt(_.toFixed(J).replace(".",""));return Y%z/10**J}function Y$($,_,U){let Q=void 0;Object.defineProperty($,_,{get(){if(Q===Yz)return;if(Q===void 0)Q=Yz,Q=U();return Q},set(v){Object.defineProperty($,_,{value:v})},configurable:!0})}function Ub($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R6($,_,U){Object.defineProperty($,_,{value:U,writable:!0,enumerable:!0,configurable:!0})}function H6(...$){let _={};for(let U of $){let Q=Object.getOwnPropertyDescriptors(U);Object.assign(_,Q)}return Object.defineProperties({},_)}function Qb($){return H6($._zod.def)}function Jb($,_){if(!_)return $;return _.reduce((U,Q)=>U?.[Q],$)}function Yb($){let _=Object.keys($),U=_.map((Q)=>$[Q]);return Promise.all(U).then((Q)=>{let v={};for(let J=0;J<_.length;J++)v[_[J]]=Q[J];return v})}function zb($=10){let U="";for(let Q=0;Q<$;Q++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Jv($){return JSON.stringify($)}function z9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function e6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function E6($){if(e6($)===!1)return!1;let _=$.constructor;if(_===void 0)return!0;if(typeof _!=="function")return!0;let U=_.prototype;if(e6(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function X9($){if(E6($))return{...$};if(Array.isArray($))return[...$];return $}function Ib($){let _=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))_++;return _}function R4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y4($,_,U){let Q=new $._zod.constr(_??$._zod.def);if(!_||U?.parent)Q._zod.parent=$;return Q}function P($){let _=$;if(!_)return{};if(typeof _==="string")return{error:()=>_};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 qb($){let _;return new Proxy({},{get(U,Q,v){return _??(_=$()),Reflect.get(_,Q,v)},set(U,Q,v,J){return _??(_=$()),Reflect.set(_,Q,v,J)},has(U,Q){return _??(_=$()),Reflect.has(_,Q)},deleteProperty(U,Q){return _??(_=$()),Reflect.deleteProperty(_,Q)},ownKeys(U){return _??(_=$()),Reflect.ownKeys(_)},getOwnPropertyDescriptor(U,Q){return _??(_=$()),Reflect.getOwnPropertyDescriptor(_,Q)},defineProperty(U,Q,v){return _??(_=$()),Reflect.defineProperty(_,Q,v)}})}function N($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function G9($){return Object.keys($).filter((_)=>{return $[_]._zod.optin==="optional"&&$[_]._zod.optout==="optional"})}function Gb($,_){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let J=H6($._zod.def,{get shape(){let Y={};for(let z in _){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;Y[z]=U.shape[z]}return R6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function jb($,_){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let J=H6($._zod.def,{get shape(){let Y={...$._zod.def.shape};for(let z in _){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!_[z])continue;delete Y[z]}return R6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Kb($,_){if(!E6(_))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let J=$._zod.def.shape;for(let Y in _)if(Object.getOwnPropertyDescriptor(J,Y)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let v=H6($._zod.def,{get shape(){let J={...$._zod.def.shape,..._};return R6(this,"shape",J),J}});return Y4($,v)}function Hb($,_){if(!E6(_))throw Error("Invalid input to safeExtend: expected a plain object");let U=H6($._zod.def,{get shape(){let Q={...$._zod.def.shape,..._};return R6(this,"shape",Q),Q}});return Y4($,U)}function Wb($,_){let U=H6($._zod.def,{get shape(){let Q={...$._zod.def.shape,..._._zod.def.shape};return R6(this,"shape",Q),Q},get catchall(){return _._zod.def.catchall},checks:[]});return Y4($,U)}function bb($,_,U){let v=_._zod.def.checks;if(v&&v.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let Y=H6(_._zod.def,{get shape(){let z=_._zod.def.shape,I={...z};if(U)for(let X in U){if(!(X in z))throw Error(`Unrecognized key: "${X}"`);if(!U[X])continue;I[X]=$?new $({type:"optional",innerType:z[X]}):z[X]}else for(let X in z)I[X]=$?new $({type:"optional",innerType:z[X]}):z[X];return R6(this,"shape",I),I},checks:[]});return Y4(_,Y)}function Bb($,_,U){let Q=H6(_._zod.def,{get shape(){let v=_._zod.def.shape,J={...v};if(U)for(let Y in U){if(!(Y in J))throw Error(`Unrecognized key: "${Y}"`);if(!U[Y])continue;J[Y]=new $({type:"nonoptional",innerType:v[Y]})}else for(let Y in v)J[Y]=new $({type:"nonoptional",innerType:v[Y]});return R6(this,"shape",J),J}});return Y4(_,Q)}function P6($,_=0){if($.aborted===!0)return!0;for(let U=_;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function w4($,_){return _.map((U)=>{var Q;return(Q=U).path??(Q.path=[]),U.path.unshift($),U})}function n0($){return typeof $==="string"?$:$?.message}function H4($,_,U){let Q={...$,path:$.path??[]};if(!$.message){let v=n0($.inst?._zod.def?.error?.($))??n0(_?.error?.($))??n0(U.customError?.($))??n0(U.localeError?.($))??"Invalid input";Q.message=v}if(delete Q.inst,delete Q.continue,!_?.reportInput)delete Q.input;return Q}function a0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function s0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function R($){let _=typeof $;switch(_){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return _}function h1(...$){let[_,U,Q]=$;if(typeof _==="string")return{message:_,code:"custom",input:U,inst:Q};return{..._}}function Zb($){return Object.entries($).filter(([_,U])=>{return Number.isNaN(Number.parseInt(_,10))}).map((_)=>_[1])}function zz($){let _=atob($),U=new Uint8Array(_.length);for(let Q=0;Q<_.length;Q++)U[Q]=_.charCodeAt(Q);return U}function Iz($){let _="";for(let U=0;U<$.length;U++)_+=String.fromCharCode($[U]);return btoa(_)}function Vb($){let _=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-_.length%4)%4);return zz(_+U)}function Db($){return Iz($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Mb($){let _=$.replace(/^0x/,"");if(_.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(_.length/2);for(let Q=0;Q<_.length;Q+=2)U[Q/2]=Number.parseInt(_.slice(Q,Q+2),16);return U}function wb($){return Array.from($).map((_)=>_.toString(16).padStart(2,"0")).join("")}class Xz{constructor(...$){}}var Yz,Yv,I9,Xb=($)=>{let _=typeof $;switch(_){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${_}`)}},t0,q9,j9,K9;var l=b(()=>{Yz=Symbol("evaluating");Yv="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};I9=g1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});t0=new Set(["string","number","symbol"]),q9=new Set(["string","number","bigint","boolean","symbol","undefined"]);j9={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]},K9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function $_($,_=(U)=>U.message){let U={},Q=[];for(let v of $.issues)if(v.path.length>0)U[v.path[0]]=U[v.path[0]]||[],U[v.path[0]].push(_(v));else Q.push(_(v));return{formErrors:Q,fieldErrors:U}}function __($,_=(U)=>U.message){let U={_errors:[]},Q=(v)=>{for(let J of v.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((Y)=>Q({issues:Y}));else if(J.code==="invalid_key")Q({issues:J.issues});else if(J.code==="invalid_element")Q({issues:J.issues});else if(J.path.length===0)U._errors.push(_(J));else{let Y=U,z=0;while(z<J.path.length){let I=J.path[z];if(z!==J.path.length-1)Y[I]=Y[I]||{_errors:[]};else Y[I]=Y[I]||{_errors:[]},Y[I]._errors.push(_(J));Y=Y[I],z++}}};return Q($),U}function H9($,_=(U)=>U.message){let U={errors:[]},Q=(v,J=[])=>{var Y,z;for(let I of v.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((X)=>Q({issues:X},I.path));else if(I.code==="invalid_key")Q({issues:I.issues},I.path);else if(I.code==="invalid_element")Q({issues:I.issues},I.path);else{let X=[...J,...I.path];if(X.length===0){U.errors.push(_(I));continue}let q=U,G=0;while(G<X.length){let j=X[G],H=G===X.length-1;if(typeof j==="string")q.properties??(q.properties={}),(Y=q.properties)[j]??(Y[j]={errors:[]}),q=q.properties[j];else q.items??(q.items=[]),(z=q.items)[j]??(z[j]={errors:[]}),q=q.items[j];if(H)q.errors.push(_(I));G++}}};return Q($),U}function Gz($){let _=[],U=$.map((Q)=>typeof Q==="object"?Q.key:Q);for(let Q of U)if(typeof Q==="number")_.push(`[${Q}]`);else if(typeof Q==="symbol")_.push(`[${JSON.stringify(String(Q))}]`);else if(/[^\w$]/.test(Q))_.push(`[${JSON.stringify(Q)}]`);else{if(_.length)_.push(".");_.push(Q)}return _.join("")}function W9($){let _=[],U=[...$.issues].sort((Q,v)=>(Q.path??[]).length-(v.path??[]).length);for(let Q of U)if(_.push(`\u2716 ${Q.message}`),Q.path?.length)_.push(` \u2192 at ${Gz(Q.path)}`);return _.join(`
18
- `)}var qz=($,_)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:_,enumerable:!1}),$.message=JSON.stringify(_,m1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},e0,W4;var b9=b(()=>{f1();l();e0=B("$ZodError",qz),W4=B("$ZodError",qz,{Parent:Error})});var c1=($)=>(_,U,Q,v)=>{let J=Q?Object.assign(Q,{async:!1}):{async:!1},Y=_._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)throw new _6;if(Y.issues.length){let z=new(v?.Err??$)(Y.issues.map((I)=>H4(I,J,l$())));throw Yv(z,v?.callee),z}return Y.value},zv,l1=($)=>async(_,U,Q,v)=>{let J=Q?Object.assign(Q,{async:!0}):{async:!0},Y=_._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let z=new(v?.Err??$)(Y.issues.map((I)=>H4(I,J,l$())));throw Yv(z,v?.callee),z}return Y.value},Iv,d1=($)=>(_,U,Q)=>{let v=Q?{...Q,async:!1}:{async:!1},J=_._zod.run({value:U,issues:[]},v);if(J instanceof Promise)throw new _6;return J.issues.length?{success:!1,error:new($??e0)(J.issues.map((Y)=>H4(Y,v,l$())))}:{success:!0,data:J.value}},B9,p1=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{async:!0}):{async:!0},J=_._zod.run({value:U,issues:[]},v);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Y)=>H4(Y,v,l$())))}:{success:!0,data:J.value}},Z9,Xv=($)=>(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return c1($)(_,U,v)},kb,qv=($)=>(_,U,Q)=>{return c1($)(_,U,Q)},Ab,Gv=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return l1($)(_,U,v)},Fb,jv=($)=>async(_,U,Q)=>{return l1($)(_,U,Q)},Ob,Kv=($)=>(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return d1($)(_,U,v)},Nb,Hv=($)=>(_,U,Q)=>{return d1($)(_,U,Q)},Sb,Wv=($)=>async(_,U,Q)=>{let v=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return p1($)(_,U,v)},Tb,bv=($)=>async(_,U,Q)=>{return p1($)(_,U,Q)},Rb;var V9=b(()=>{f1();b9();l();zv=c1(W4),Iv=l1(W4),B9=d1(W4),Z9=p1(W4),kb=Xv(W4),Ab=qv(W4),Fb=Gv(W4),Ob=jv(W4),Nb=Kv(W4),Sb=Hv(W4),Tb=Wv(W4),Rb=bv(W4)});var E4={};s$(E4,{xid:()=>L9,uuid7:()=>ub,uuid6:()=>xb,uuid4:()=>Pb,uuid:()=>$1,uppercase:()=>n9,unicodeEmail:()=>jz,undefined:()=>p9,ulid:()=>w9,time:()=>f9,string:()=>g9,sha512_hex:()=>vB,sha512_base64url:()=>QB,sha512_base64:()=>UB,sha384_hex:()=>eb,sha384_base64url:()=>_B,sha384_base64:()=>$B,sha256_hex:()=>tb,sha256_base64url:()=>sb,sha256_base64:()=>ab,sha1_hex:()=>nb,sha1_base64url:()=>ob,sha1_base64:()=>rb,rfc5322Email:()=>Cb,number:()=>v_,null:()=>d9,nanoid:()=>A9,md5_hex:()=>db,md5_base64url:()=>ib,md5_base64:()=>pb,mac:()=>E9,lowercase:()=>i9,ksuid:()=>k9,ipv6:()=>R9,ipv4:()=>T9,integer:()=>c9,idnEmail:()=>fb,html5Email:()=>yb,hostname:()=>hb,hex:()=>lb,guid:()=>O9,extendedDuration:()=>Eb,emoji:()=>S9,email:()=>N9,e164:()=>y9,duration:()=>F9,domain:()=>cb,datetime:()=>m9,date:()=>C9,cuid2:()=>M9,cuid:()=>D9,cidrv6:()=>x9,cidrv4:()=>P9,browserEmail:()=>mb,boolean:()=>l9,bigint:()=>h9,base64url:()=>Bv,base64:()=>u9});function S9(){return new RegExp(gb,"u")}function Hz($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function f9($){return new RegExp(`^${Hz($)}$`)}function m9($){let _=Hz({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Q=`${_}(?:${U.join("|")})`;return new RegExp(`^${Kz}T(?:${Q})$`)}function U_($,_){return new RegExp(`^[A-Za-z0-9+/]{${$}}${_}$`)}function Q_($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var D9,M9,w9,L9,k9,A9,F9,Eb,O9,$1=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Pb,xb,ub,N9,yb,Cb,jz,fb,mb,gb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",T9,R9,E9=($)=>{let _=R4($??":");return new RegExp(`^(?:[0-9A-F]{2}${_}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${_}){5}[0-9a-f]{2}$`)},P9,x9,u9,Bv,hb,cb,y9,Kz="(?:(?:\\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])))",C9,g9=($)=>{let _=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${_}$`)},h9,c9,v_,l9,d9,p9,i9,n9,lb,db,pb,ib,nb,rb,ob,tb,ab,sb,eb,$B,_B,vB,UB,QB;var Zv=b(()=>{l();D9=/^[cC][^\s-]{8,}$/,M9=/^[0-9a-z]+$/,w9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,L9=/^[0-9a-vA-V]{20}$/,k9=/^[A-Za-z0-9]{27}$/,A9=/^[a-zA-Z0-9_-]{21}$/,F9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Eb=/^[-+]?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)?)??$/,O9=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Pb=$1(4),xb=$1(6),ub=$1(7),N9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yb=/^[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])?)*$/,Cb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,jz=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,fb=jz,mb=/^[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])?)*$/;T9=/^(?:(?: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])$/,R9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,P9=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,x9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bv=/^[A-Za-z0-9_-]*$/,hb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,cb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,y9=/^\+[1-9]\d{6,14}$/,C9=new RegExp(`^${Kz}$`);h9=/^-?\d+n?$/,c9=/^-?\d+$/,v_=/^-?\d+(?:\.\d+)?$/,l9=/^(?:true|false)$/i,d9=/^null$/i,p9=/^undefined$/i,i9=/^[^A-Z]*$/,n9=/^[^a-z]*$/,lb=/^[0-9a-fA-F]*$/;db=/^[0-9a-fA-F]{32}$/,pb=U_(22,"=="),ib=Q_(22),nb=/^[0-9a-fA-F]{40}$/,rb=U_(27,"="),ob=Q_(27),tb=/^[0-9a-fA-F]{64}$/,ab=U_(43,"="),sb=Q_(43),eb=/^[0-9a-fA-F]{96}$/,$B=U_(64,""),_B=Q_(64),vB=/^[0-9a-fA-F]{128}$/,UB=U_(86,"=="),QB=Q_(86)});function Wz($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues))}var T$,bz,Vv,Dv,r9,o9,t9,a9,s9,e9,$3,_3,v3,i1,U3,Q3,J3,Y3,z3,I3,X3,q3,G3;var Mv=b(()=>{f1();Zv();l();T$=B("$ZodCheck",($,_)=>{var U;$._zod??($._zod={}),$._zod.def=_,(U=$._zod).onattach??(U.onattach=[])}),bz={number:"number",bigint:"bigint",object:"date"},Vv=B("$ZodCheckLessThan",($,_)=>{T$.init($,_);let U=bz[typeof _.value];$._zod.onattach.push((Q)=>{let v=Q._zod.bag,J=(_.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(_.value<J)if(_.inclusive)v.maximum=_.value;else v.exclusiveMaximum=_.value}),$._zod.check=(Q)=>{if(_.inclusive?Q.value<=_.value:Q.value<_.value)return;Q.issues.push({origin:U,code:"too_big",maximum:typeof _.value==="object"?_.value.getTime():_.value,input:Q.value,inclusive:_.inclusive,inst:$,continue:!_.abort})}}),Dv=B("$ZodCheckGreaterThan",($,_)=>{T$.init($,_);let U=bz[typeof _.value];$._zod.onattach.push((Q)=>{let v=Q._zod.bag,J=(_.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(_.value>J)if(_.inclusive)v.minimum=_.value;else v.exclusiveMinimum=_.value}),$._zod.check=(Q)=>{if(_.inclusive?Q.value>=_.value:Q.value>_.value)return;Q.issues.push({origin:U,code:"too_small",minimum:typeof _.value==="object"?_.value.getTime():_.value,input:Q.value,inclusive:_.inclusive,inst:$,continue:!_.abort})}}),r9=B("$ZodCheckMultipleOf",($,_)=>{T$.init($,_),$._zod.onattach.push((U)=>{var Q;(Q=U._zod.bag).multipleOf??(Q.multipleOf=_.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof _.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%_.value===BigInt(0):Y9(U.value,_.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:_.value,input:U.value,inst:$,continue:!_.abort})}}),o9=B("$ZodCheckNumberFormat",($,_)=>{T$.init($,_),_.format=_.format||"float64";let U=_.format?.includes("int"),Q=U?"int":"number",[v,J]=j9[_.format];$._zod.onattach.push((Y)=>{let z=Y._zod.bag;if(z.format=_.format,z.minimum=v,z.maximum=J,U)z.pattern=c9}),$._zod.check=(Y)=>{let z=Y.value;if(U){if(!Number.isInteger(z)){Y.issues.push({expected:Q,format:_.format,code:"invalid_type",continue:!1,input:z,inst:$});return}if(!Number.isSafeInteger(z)){if(z>0)Y.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!_.abort});else Y.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!_.abort});return}}if(z<v)Y.issues.push({origin:"number",input:z,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!_.abort});if(z>J)Y.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inclusive:!0,inst:$,continue:!_.abort})}}),t9=B("$ZodCheckBigIntFormat",($,_)=>{T$.init($,_);let[U,Q]=K9[_.format];$._zod.onattach.push((v)=>{let J=v._zod.bag;J.format=_.format,J.minimum=U,J.maximum=Q}),$._zod.check=(v)=>{let J=v.value;if(J<U)v.issues.push({origin:"bigint",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!_.abort});if(J>Q)v.issues.push({origin:"bigint",input:J,code:"too_big",maximum:Q,inclusive:!0,inst:$,continue:!_.abort})}}),a9=B("$ZodCheckMaxSize",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(_.maximum<v)Q._zod.bag.maximum=_.maximum}),$._zod.check=(Q)=>{let v=Q.value;if(v.size<=_.maximum)return;Q.issues.push({origin:a0(v),code:"too_big",maximum:_.maximum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),s9=B("$ZodCheckMinSize",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(_.minimum>v)Q._zod.bag.minimum=_.minimum}),$._zod.check=(Q)=>{let v=Q.value;if(v.size>=_.minimum)return;Q.issues.push({origin:a0(v),code:"too_small",minimum:_.minimum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),e9=B("$ZodCheckSizeEquals",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.size!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.minimum=_.size,v.maximum=_.size,v.size=_.size}),$._zod.check=(Q)=>{let v=Q.value,J=v.size;if(J===_.size)return;let Y=J>_.size;Q.issues.push({origin:a0(v),...Y?{code:"too_big",maximum:_.size}:{code:"too_small",minimum:_.size},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!_.abort})}}),$3=B("$ZodCheckMaxLength",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(_.maximum<v)Q._zod.bag.maximum=_.maximum}),$._zod.check=(Q)=>{let v=Q.value;if(v.length<=_.maximum)return;let Y=s0(v);Q.issues.push({origin:Y,code:"too_big",maximum:_.maximum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),_3=B("$ZodCheckMinLength",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(_.minimum>v)Q._zod.bag.minimum=_.minimum}),$._zod.check=(Q)=>{let v=Q.value;if(v.length>=_.minimum)return;let Y=s0(v);Q.issues.push({origin:Y,code:"too_small",minimum:_.minimum,inclusive:!0,input:v,inst:$,continue:!_.abort})}}),v3=B("$ZodCheckLengthEquals",($,_)=>{var U;T$.init($,_),(U=$._zod.def).when??(U.when=(Q)=>{let v=Q.value;return!T6(v)&&v.length!==void 0}),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.minimum=_.length,v.maximum=_.length,v.length=_.length}),$._zod.check=(Q)=>{let v=Q.value,J=v.length;if(J===_.length)return;let Y=s0(v),z=J>_.length;Q.issues.push({origin:Y,...z?{code:"too_big",maximum:_.length}:{code:"too_small",minimum:_.length},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!_.abort})}}),i1=B("$ZodCheckStringFormat",($,_)=>{var U,Q;if(T$.init($,_),$._zod.onattach.push((v)=>{let J=v._zod.bag;if(J.format=_.format,_.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(_.pattern)}),_.pattern)(U=$._zod).check??(U.check=(v)=>{if(_.pattern.lastIndex=0,_.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:_.format,input:v.value,..._.pattern?{pattern:_.pattern.toString()}:{},inst:$,continue:!_.abort})});else(Q=$._zod).check??(Q.check=()=>{})}),U3=B("$ZodCheckRegex",($,_)=>{i1.init($,_),$._zod.check=(U)=>{if(_.pattern.lastIndex=0,_.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:_.pattern.toString(),inst:$,continue:!_.abort})}}),Q3=B("$ZodCheckLowerCase",($,_)=>{_.pattern??(_.pattern=i9),i1.init($,_)}),J3=B("$ZodCheckUpperCase",($,_)=>{_.pattern??(_.pattern=n9),i1.init($,_)}),Y3=B("$ZodCheckIncludes",($,_)=>{T$.init($,_);let U=R4(_.includes),Q=new RegExp(typeof _.position==="number"?`^.{${_.position}}${U}`:U);_.pattern=Q,$._zod.onattach.push((v)=>{let J=v._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(v)=>{if(v.value.includes(_.includes,_.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:_.includes,input:v.value,inst:$,continue:!_.abort})}}),z3=B("$ZodCheckStartsWith",($,_)=>{T$.init($,_);let U=new RegExp(`^${R4(_.prefix)}.*`);_.pattern??(_.pattern=U),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.startsWith(_.prefix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:_.prefix,input:Q.value,inst:$,continue:!_.abort})}}),I3=B("$ZodCheckEndsWith",($,_)=>{T$.init($,_);let U=new RegExp(`.*${R4(_.suffix)}$`);_.pattern??(_.pattern=U),$._zod.onattach.push((Q)=>{let v=Q._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.endsWith(_.suffix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:_.suffix,input:Q.value,inst:$,continue:!_.abort})}});X3=B("$ZodCheckProperty",($,_)=>{T$.init($,_),$._zod.check=(U)=>{let Q=_.schema._zod.run({value:U.value[_.property],issues:[]},{});if(Q instanceof Promise)return Q.then((v)=>Wz(v,U,_.property));Wz(Q,U,_.property);return}}),q3=B("$ZodCheckMimeType",($,_)=>{T$.init($,_);let U=new Set(_.mime);$._zod.onattach.push((Q)=>{Q._zod.bag.mime=_.mime}),$._zod.check=(Q)=>{if(U.has(Q.value.type))return;Q.issues.push({code:"invalid_value",values:_.mime,input:Q.value.type,inst:$,continue:!_.abort})}}),G3=B("$ZodCheckOverwrite",($,_)=>{T$.init($,_),$._zod.check=(U)=>{U.value=_.tx(U.value)}})});class wv{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
19
- `).filter((J)=>J),Q=Math.min(...U.map((J)=>J.length-J.trimStart().length)),v=U.map((J)=>J.slice(Q)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of v)this.content.push(J)}compile(){let $=Function,_=this?.args,Q=[...(this?.content??[""]).map((v)=>` ${v}`)];return new $(..._,Q.join(`
20
- `))}}var j3;var K3=b(()=>{j3={major:4,minor:3,patch:6}});function u3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Sz($){if(!Bv.test($))return!1;let _=$.replace(/[-_]/g,(Q)=>Q==="-"?"+":"/"),U=_.padEnd(Math.ceil(_.length/4)*4,"=");return u3(U)}function Tz($,_=null){try{let U=$.split(".");if(U.length!==3)return!1;let[Q]=U;if(!Q)return!1;let v=JSON.parse(atob(Q));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(_&&(!("alg"in v)||v.alg!==_))return!1;return!0}catch{return!1}}function Zz($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues));_.value[U]=$.value}function Ov($,_,U,Q,v){if($.issues.length){if(v&&!(U in Q))return;_.issues.push(...w4(U,$.issues))}if($.value===void 0){if(U in Q)_.value[U]=void 0}else _.value[U]=$.value}function Rz($){let _=Object.keys($.shape);for(let Q of _)if(!$.shape?.[Q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Q}": expected a Zod schema`);let U=G9($.shape);return{...$,keys:_,keySet:new Set(_),numKeys:_.length,optionalKeys:new Set(U)}}function Ez($,_,U,Q,v,J){let Y=[],z=v.keySet,I=v.catchall._zod,X=I.def.type,q=I.optout==="optional";for(let G in _){if(z.has(G))continue;if(X==="never"){Y.push(G);continue}let j=I.run({value:_[G],issues:[]},Q);if(j instanceof Promise)$.push(j.then((H)=>Ov(H,U,G,_,q)));else Ov(j,U,G,_,q)}if(Y.length)U.issues.push({code:"unrecognized_keys",keys:Y,input:_,inst:J});if(!$.length)return U;return Promise.all($).then(()=>{return U})}function Vz($,_,U,Q){for(let J of $)if(J.issues.length===0)return _.value=J.value,_;let v=$.filter((J)=>!P6(J));if(v.length===1)return _.value=v[0].value,v[0];return _.issues.push({code:"invalid_union",input:_.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,l$())))}),_}function Dz($,_,U,Q){let v=$.filter((J)=>J.issues.length===0);if(v.length===1)return _.value=v[0].value,_;if(v.length===0)_.issues.push({code:"invalid_union",input:_.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,l$())))});else _.issues.push({code:"invalid_union",input:_.value,inst:U,errors:[],inclusive:!1});return _}function H3($,_){if($===_)return{valid:!0,data:$};if($ instanceof Date&&_ instanceof Date&&+$===+_)return{valid:!0,data:$};if(E6($)&&E6(_)){let U=Object.keys(_),Q=Object.keys($).filter((J)=>U.indexOf(J)!==-1),v={...$,..._};for(let J of Q){let Y=H3($[J],_[J]);if(!Y.valid)return{valid:!1,mergeErrorPath:[J,...Y.mergeErrorPath]};v[J]=Y.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(_)){if($.length!==_.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Q=0;Q<$.length;Q++){let v=$[Q],J=_[Q],Y=H3(v,J);if(!Y.valid)return{valid:!1,mergeErrorPath:[Q,...Y.mergeErrorPath]};U.push(Y.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Mz($,_,U){let Q=new Map,v;for(let z of _.issues)if(z.code==="unrecognized_keys"){v??(v=z);for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).l=!0}}else $.issues.push(z);for(let z of U.issues)if(z.code==="unrecognized_keys")for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).r=!0}else $.issues.push(z);let J=[...Q].filter(([,z])=>z.l&&z.r).map(([z])=>z);if(J.length&&v)$.issues.push({...v,keys:J});if(P6($))return $;let Y=H3(_.value,U.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}function Lv($,_,U){if($.issues.length)_.issues.push(...w4(U,$.issues));_.value[U]=$.value}function wz($,_,U,Q,v,J,Y){if($.issues.length)if(t0.has(typeof Q))U.issues.push(...w4(Q,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:v,inst:J,issues:$.issues.map((z)=>H4(z,Y,l$()))});if(_.issues.length)if(t0.has(typeof Q))U.issues.push(...w4(Q,_.issues));else U.issues.push({origin:"map",code:"invalid_element",input:v,inst:J,key:Q,issues:_.issues.map((z)=>H4(z,Y,l$()))});U.value.set($.value,_.value)}function Lz($,_){if($.issues.length)_.issues.push(...$.issues);_.value.add($.value)}function kz($,_){if($.issues.length&&_===void 0)return{issues:[],value:void 0};return $}function Az($,_){if($.value===void 0)$.value=_.defaultValue;return $}function Fz($,_){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:_});return $}function kv($,_,U){if($.issues.length)return $.aborted=!0,$;return _._zod.run({value:$.value,issues:$.issues},U)}function Av($,_,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let v=_.transform($.value,$);if(v instanceof Promise)return v.then((J)=>Fv($,J,_.out,U));return Fv($,v,_.out,U)}else{let v=_.reverseTransform($.value,$);if(v instanceof Promise)return v.then((J)=>Fv($,J,_.in,U));return Fv($,v,_.in,U)}}function Fv($,_,U,Q){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:_,issues:$.issues},Q)}function Oz($){return $.value=Object.freeze($.value),$}function Nz($,_,U,Q){if(!$){let v={code:"custom",input:U,inst:Q,path:[...Q._zod.def.path??[]],continue:!Q._zod.def.abort};if(Q._zod.def.params)v.params=Q._zod.def.params;_.issues.push(h1(v))}}var e,_1,A$,W3,b3,B3,Z3,V3,D3,M3,w3,L3,k3,A3,F3,O3,N3,S3,T3,R3,E3,P3,x3,y3,C3,f3,m3,g3,Nv,h3,J_,Sv,c3,l3,d3,p3,i3,n3,r3,o3,t3,a3,Pz,s3,Y_,e3,$7,_7,Tv,v7,U7,Q7,J7,Y7,z7,I7,Rv,X7,q7,G7,j7,K7,H7,W7,b7,B7,z_,Z7,V7,D7,M7,w7,L7;var k7=b(()=>{Mv();f1();V9();Zv();l();K3();l();e=B("$ZodType",($,_)=>{var U;$??($={}),$._zod.def=_,$._zod.bag=$._zod.bag||{},$._zod.version=j3;let Q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Q.unshift($);for(let v of Q)for(let J of v._zod.onattach)J($);if(Q.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(Y,z,I)=>{let X=P6(Y),q;for(let G of z){if(G._zod.def.when){if(!G._zod.def.when(Y))continue}else if(X)continue;let j=Y.issues.length,H=G._zod.check(Y);if(H instanceof Promise&&I?.async===!1)throw new _6;if(q||H instanceof Promise)q=(q??Promise.resolve()).then(async()=>{if(await H,Y.issues.length===j)return;if(!X)X=P6(Y,j)});else{if(Y.issues.length===j)continue;if(!X)X=P6(Y,j)}}if(q)return q.then(()=>{return Y});return Y},J=(Y,z,I)=>{if(P6(Y))return Y.aborted=!0,Y;let X=v(z,Q,I);if(X instanceof Promise){if(I.async===!1)throw new _6;return X.then((q)=>$._zod.parse(q,I))}return $._zod.parse(X,I)};$._zod.run=(Y,z)=>{if(z.skipChecks)return $._zod.parse(Y,z);if(z.direction==="backward"){let X=$._zod.parse({value:Y.value,issues:[]},{...z,skipChecks:!0});if(X instanceof Promise)return X.then((q)=>{return J(q,Y,z)});return J(X,Y,z)}let I=$._zod.parse(Y,z);if(I instanceof Promise){if(z.async===!1)throw new _6;return I.then((X)=>v(X,Q,z))}return v(I,Q,z)}}Y$($,"~standard",()=>({validate:(v)=>{try{let J=B9($,v);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return Z9($,v).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}))}),_1=B("$ZodString",($,_)=>{e.init($,_),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??g9($._zod.bag),$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=String(U.value)}catch(v){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),A$=B("$ZodStringFormat",($,_)=>{i1.init($,_),_1.init($,_)}),W3=B("$ZodGUID",($,_)=>{_.pattern??(_.pattern=O9),A$.init($,_)}),b3=B("$ZodUUID",($,_)=>{if(_.version){let Q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[_.version];if(Q===void 0)throw Error(`Invalid UUID version: "${_.version}"`);_.pattern??(_.pattern=$1(Q))}else _.pattern??(_.pattern=$1());A$.init($,_)}),B3=B("$ZodEmail",($,_)=>{_.pattern??(_.pattern=N9),A$.init($,_)}),Z3=B("$ZodURL",($,_)=>{A$.init($,_),$._zod.check=(U)=>{try{let Q=U.value.trim(),v=new URL(Q);if(_.hostname){if(_.hostname.lastIndex=0,!_.hostname.test(v.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:_.hostname.source,input:U.value,inst:$,continue:!_.abort})}if(_.protocol){if(_.protocol.lastIndex=0,!_.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:_.protocol.source,input:U.value,inst:$,continue:!_.abort})}if(_.normalize)U.value=v.href;else U.value=Q;return}catch(Q){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!_.abort})}}}),V3=B("$ZodEmoji",($,_)=>{_.pattern??(_.pattern=S9()),A$.init($,_)}),D3=B("$ZodNanoID",($,_)=>{_.pattern??(_.pattern=A9),A$.init($,_)}),M3=B("$ZodCUID",($,_)=>{_.pattern??(_.pattern=D9),A$.init($,_)}),w3=B("$ZodCUID2",($,_)=>{_.pattern??(_.pattern=M9),A$.init($,_)}),L3=B("$ZodULID",($,_)=>{_.pattern??(_.pattern=w9),A$.init($,_)}),k3=B("$ZodXID",($,_)=>{_.pattern??(_.pattern=L9),A$.init($,_)}),A3=B("$ZodKSUID",($,_)=>{_.pattern??(_.pattern=k9),A$.init($,_)}),F3=B("$ZodISODateTime",($,_)=>{_.pattern??(_.pattern=m9(_)),A$.init($,_)}),O3=B("$ZodISODate",($,_)=>{_.pattern??(_.pattern=C9),A$.init($,_)}),N3=B("$ZodISOTime",($,_)=>{_.pattern??(_.pattern=f9(_)),A$.init($,_)}),S3=B("$ZodISODuration",($,_)=>{_.pattern??(_.pattern=F9),A$.init($,_)}),T3=B("$ZodIPv4",($,_)=>{_.pattern??(_.pattern=T9),A$.init($,_),$._zod.bag.format="ipv4"}),R3=B("$ZodIPv6",($,_)=>{_.pattern??(_.pattern=R9),A$.init($,_),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!_.abort})}}}),E3=B("$ZodMAC",($,_)=>{_.pattern??(_.pattern=E9(_.delimiter)),A$.init($,_),$._zod.bag.format="mac"}),P3=B("$ZodCIDRv4",($,_)=>{_.pattern??(_.pattern=P9),A$.init($,_)}),x3=B("$ZodCIDRv6",($,_)=>{_.pattern??(_.pattern=x9),A$.init($,_),$._zod.check=(U)=>{let Q=U.value.split("/");try{if(Q.length!==2)throw Error();let[v,J]=Q;if(!J)throw Error();let Y=Number(J);if(`${Y}`!==J)throw Error();if(Y<0||Y>128)throw Error();new URL(`http://[${v}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!_.abort})}}});y3=B("$ZodBase64",($,_)=>{_.pattern??(_.pattern=u9),A$.init($,_),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(u3(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!_.abort})}});C3=B("$ZodBase64URL",($,_)=>{_.pattern??(_.pattern=Bv),A$.init($,_),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Sz(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!_.abort})}}),f3=B("$ZodE164",($,_)=>{_.pattern??(_.pattern=y9),A$.init($,_)});m3=B("$ZodJWT",($,_)=>{A$.init($,_),$._zod.check=(U)=>{if(Tz(U.value,_.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!_.abort})}}),g3=B("$ZodCustomStringFormat",($,_)=>{A$.init($,_),$._zod.check=(U)=>{if(_.fn(U.value))return;U.issues.push({code:"invalid_format",format:_.format,input:U.value,inst:$,continue:!_.abort})}}),Nv=B("$ZodNumber",($,_)=>{e.init($,_),$._zod.pattern=$._zod.bag.pattern??v_,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=Number(U.value)}catch(Y){}let v=U.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return U;let J=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:v,inst:$,...J?{received:J}:{}}),U}}),h3=B("$ZodNumberFormat",($,_)=>{o9.init($,_),Nv.init($,_)}),J_=B("$ZodBoolean",($,_)=>{e.init($,_),$._zod.pattern=l9,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=Boolean(U.value)}catch(J){}let v=U.value;if(typeof v==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),U}}),Sv=B("$ZodBigInt",($,_)=>{e.init($,_),$._zod.pattern=h9,$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=BigInt(U.value)}catch(v){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),c3=B("$ZodBigIntFormat",($,_)=>{t9.init($,_),Sv.init($,_)}),l3=B("$ZodSymbol",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),U}}),d3=B("$ZodUndefined",($,_)=>{e.init($,_),$._zod.pattern=p9,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),U}}),p3=B("$ZodNull",($,_)=>{e.init($,_),$._zod.pattern=d9,$._zod.values=new Set([null]),$._zod.parse=(U,Q)=>{let v=U.value;if(v===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),U}}),i3=B("$ZodAny",($,_)=>{e.init($,_),$._zod.parse=(U)=>U}),n3=B("$ZodUnknown",($,_)=>{e.init($,_),$._zod.parse=(U)=>U}),r3=B("$ZodNever",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),o3=B("$ZodVoid",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(typeof v>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),U}}),t3=B("$ZodDate",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(_.coerce)try{U.value=new Date(U.value)}catch(z){}let v=U.value,J=v instanceof Date;if(J&&!Number.isNaN(v.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:v,...J?{received:"Invalid Date"}:{},inst:$}),U}});a3=B("$ZodArray",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!Array.isArray(v))return U.issues.push({expected:"array",code:"invalid_type",input:v,inst:$}),U;U.value=Array(v.length);let J=[];for(let Y=0;Y<v.length;Y++){let z=v[Y],I=_.element._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)J.push(I.then((X)=>Zz(X,U,Y)));else Zz(I,U,Y)}if(J.length)return Promise.all(J).then(()=>U);return U}});Pz=B("$ZodObject",($,_)=>{if(e.init($,_),!Object.getOwnPropertyDescriptor(_,"shape")?.get){let z=_.shape;Object.defineProperty(_,"shape",{get:()=>{let I={...z};return Object.defineProperty(_,"shape",{value:I}),I}})}let Q=g1(()=>Rz(_));Y$($._zod,"propValues",()=>{let z=_.shape,I={};for(let X in z){let q=z[X]._zod;if(q.values){I[X]??(I[X]=new Set);for(let G of q.values)I[X].add(G)}}return I});let v=e6,J=_.catchall,Y;$._zod.parse=(z,I)=>{Y??(Y=Q.value);let X=z.value;if(!v(X))return z.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),z;z.value={};let q=[],G=Y.shape;for(let j of Y.keys){let H=G[j],Z=H._zod.optout==="optional",V=H._zod.run({value:X[j],issues:[]},I);if(V instanceof Promise)q.push(V.then((S)=>Ov(S,z,j,X,Z)));else Ov(V,z,j,X,Z)}if(!J)return q.length?Promise.all(q).then(()=>z):z;return Ez(q,X,z,I,Q.value,$)}}),s3=B("$ZodObjectJIT",($,_)=>{Pz.init($,_);let U=$._zod.parse,Q=g1(()=>Rz(_)),v=(j)=>{let H=new wv(["shape","payload","ctx"]),Z=Q.value,V=(A)=>{let u=Jv(A);return`shape[${u}]._zod.run({ value: input[${u}], issues: [] }, ctx)`};H.write("const input = payload.value;");let S=Object.create(null),T=0;for(let A of Z.keys)S[A]=`key_${T++}`;H.write("const newResult = {};");for(let A of Z.keys){let u=S[A],k=Jv(A),w=j[A]?._zod?.optout==="optional";if(H.write(`const ${u} = ${V(A)};`),w)H.write(`
21
- if (${u}.issues.length) {
22
- if (${k} in input) {
23
- payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
15
+ `}return Q&&Q.eol||`
16
+ `}function r9(Q,$){return`\r
17
+ `.indexOf(Q.charAt($))!==-1}var O7=A(()=>{u2();Z5()});function M5(Q,$=[],Y=a9.DEFAULT){let q=null,J=[],X=[];function H(K){if(Array.isArray(J))J.push(K);else if(q!==null)J[q]=K}return N7(Q,{onObjectBegin:()=>{let K={};H(K),X.push(J),J=K,q=null},onObjectProperty:(K)=>{q=K},onObjectEnd:()=>{J=X.pop()},onArrayBegin:()=>{let K=[];H(K),X.push(J),J=K,q=null},onArrayEnd:()=>{J=X.pop()},onLiteralValue:H,onError:(K,W,z)=>{$.push({error:K,offset:W,length:z})}},Y),J[0]}function I7(Q,$=[],Y=a9.DEFAULT){let q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function J(K){if(q.type==="property")q.length=K-q.offset,q=q.parent}function X(K){return q.children.push(K),K}N7(Q,{onObjectBegin:(K)=>{q=X({type:"object",offset:K,length:-1,parent:q,children:[]})},onObjectProperty:(K,W,z)=>{q=X({type:"property",offset:W,length:-1,parent:q,children:[]}),q.children.push({type:"string",value:K,offset:W,length:z,parent:q})},onObjectEnd:(K,W)=>{J(K+W),q.length=K+W-q.offset,q=q.parent,J(K+W)},onArrayBegin:(K,W)=>{q=X({type:"array",offset:K,length:-1,parent:q,children:[]})},onArrayEnd:(K,W)=>{q.length=K+W-q.offset,q=q.parent,J(K+W)},onLiteralValue:(K,W,z)=>{X({type:MW(K),offset:W,length:z,parent:q,value:K}),J(W+z)},onSeparator:(K,W,z)=>{if(q.type==="property"){if(K===":")q.colonOffset=W;else if(K===",")J(W)}},onError:(K,W,z)=>{$.push({error:K,offset:W,length:z})}},Y);let G=q.children[0];if(G)delete G.parent;return G}function m2(Q,$){if(!Q)return;let Y=Q;for(let q of $)if(typeof q==="string"){if(Y.type!=="object"||!Array.isArray(Y.children))return;let J=!1;for(let X of Y.children)if(Array.isArray(X.children)&&X.children[0].value===q&&X.children.length===2){Y=X.children[1],J=!0;break}if(!J)return}else{let J=q;if(Y.type!=="array"||J<0||!Array.isArray(Y.children)||J>=Y.children.length)return;Y=Y.children[J]}return Y}function N7(Q,$,Y=a9.DEFAULT){let q=s9(Q,!1),J=[],X=0;function H(E){return E?()=>X===0&&E(q.getTokenOffset(),q.getTokenLength(),q.getTokenStartLine(),q.getTokenStartCharacter()):()=>!0}function G(E){return E?(C)=>X===0&&E(C,q.getTokenOffset(),q.getTokenLength(),q.getTokenStartLine(),q.getTokenStartCharacter()):()=>!0}function K(E){return E?(C)=>X===0&&E(C,q.getTokenOffset(),q.getTokenLength(),q.getTokenStartLine(),q.getTokenStartCharacter(),()=>J.slice()):()=>!0}function W(E){return E?()=>{if(X>0)X++;else if(E(q.getTokenOffset(),q.getTokenLength(),q.getTokenStartLine(),q.getTokenStartCharacter(),()=>J.slice())===!1)X=1}:()=>!0}function z(E){return E?()=>{if(X>0)X--;if(X===0)E(q.getTokenOffset(),q.getTokenLength(),q.getTokenStartLine(),q.getTokenStartCharacter())}:()=>!0}let B=W($.onObjectBegin),Z=K($.onObjectProperty),M=z($.onObjectEnd),V=W($.onArrayBegin),U=z($.onArrayEnd),R=K($.onLiteralValue),I=G($.onSeparator),g=H($.onComment),N=G($.onError),x=Y&&Y.disallowComments,w=Y&&Y.allowTrailingComma;function b(){while(!0){let E=q.scan();switch(q.getTokenError()){case 4:D(14);break;case 5:D(15);break;case 3:D(13);break;case 1:if(!x)D(11);break;case 2:D(12);break;case 6:D(16);break}switch(E){case 12:case 13:if(x)D(10);else g();break;case 16:D(1);break;case 15:case 14:break;default:return E}}}function D(E,C=[],e=[]){if(N(E),C.length+e.length>0){let o=q.getToken();while(o!==17){if(C.indexOf(o)!==-1){b();break}else if(e.indexOf(o)!==-1)break;o=b()}}}function r(E){let C=q.getTokenValue();if(E)R(C);else Z(C),J.push(C);return b(),!0}function n(){switch(q.getToken()){case 11:let E=q.getTokenValue(),C=Number(E);if(isNaN(C))D(2),C=0;R(C);break;case 7:R(null);break;case 8:R(!0);break;case 9:R(!1);break;default:return!1}return b(),!0}function l(){if(q.getToken()!==10)return D(3,[],[2,5]),!1;if(r(!1),q.getToken()===6){if(I(":"),b(),!d())D(4,[],[2,5])}else D(5,[],[2,5]);return J.pop(),!0}function M1(){B(),b();let E=!1;while(q.getToken()!==2&&q.getToken()!==17){if(q.getToken()===5){if(!E)D(4,[],[]);if(I(","),b(),q.getToken()===2&&w)break}else if(E)D(6,[],[]);if(!l())D(4,[],[2,5]);E=!0}if(M(),q.getToken()!==2)D(7,[2],[]);else b();return!0}function S(){V(),b();let E=!0,C=!1;while(q.getToken()!==4&&q.getToken()!==17){if(q.getToken()===5){if(!C)D(4,[],[]);if(I(","),b(),q.getToken()===4&&w)break}else if(C)D(6,[],[]);if(E)J.push(0),E=!1;else J[J.length-1]++;if(!d())D(4,[],[4,5]);C=!0}if(U(),!E)J.pop();if(q.getToken()!==4)D(8,[4],[]);else b();return!0}function d(){switch(q.getToken()){case 3:return S();case 1:return M1();case 10:return r(!0);default:return n()}}if(b(),q.getToken()===17){if(Y.allowEmptyContent)return!0;return D(4,[],[]),!1}if(!d())return D(4,[],[]),!1;if(q.getToken()!==17)D(9,[],[]);return!0}function MW(Q){switch(typeof Q){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Q)return"null";else if(Array.isArray(Q))return"array";return"object"}default:return"null"}}var a9;var T7=A(()=>{u2();(function(Q){Q.DEFAULT={allowTrailingComma:!1}})(a9||(a9={}))});function U5(Q,$,Y,q){let J=$.slice(),H=I7(Q,[]),G=void 0,K=void 0;while(J.length>0)if(K=J.pop(),G=m2(H,J),G===void 0&&Y!==void 0)if(typeof K==="string")Y={[K]:Y};else Y=[Y];else break;if(!G){if(Y===void 0)throw Error("Can not delete in empty document");return h8(Q,{offset:H?H.offset:0,length:H?H.length:0,content:JSON.stringify(Y)},q)}else if(G.type==="object"&&typeof K==="string"&&Array.isArray(G.children)){let W=m2(G,[K]);if(W!==void 0)if(Y===void 0){if(!W.parent)throw Error("Malformed AST");let z=G.children.indexOf(W.parent),B,Z=W.parent.offset+W.parent.length;if(z>0){let M=G.children[z-1];B=M.offset+M.length}else if(B=G.offset+1,G.children.length>1)Z=G.children[1].offset;return h8(Q,{offset:B,length:Z-B,content:""},q)}else return h8(Q,{offset:W.offset,length:W.length,content:JSON.stringify(Y)},q);else{if(Y===void 0)return[];let z=`${JSON.stringify(K)}: ${JSON.stringify(Y)}`,B=q.getInsertionIndex?q.getInsertionIndex(G.children.map((M)=>M.children[0].value)):G.children.length,Z;if(B>0){let M=G.children[B-1];Z={offset:M.offset+M.length,length:0,content:","+z}}else if(G.children.length===0)Z={offset:G.offset+1,length:0,content:z};else Z={offset:G.offset+1,length:0,content:z+","};return h8(Q,Z,q)}}else if(G.type==="array"&&typeof K==="number"&&Array.isArray(G.children)){let W=K;if(W===-1){let z=`${JSON.stringify(Y)}`,B;if(G.children.length===0)B={offset:G.offset+1,length:0,content:z};else{let Z=G.children[G.children.length-1];B={offset:Z.offset+Z.length,length:0,content:","+z}}return h8(Q,B,q)}else if(Y===void 0&&G.children.length>=0){let z=K,B=G.children[z],Z;if(G.children.length===1)Z={offset:G.offset+1,length:G.length-2,content:""};else if(G.children.length-1===z){let M=G.children[z-1],V=M.offset+M.length,U=G.offset+G.length;Z={offset:V,length:U-2-V,content:""}}else Z={offset:B.offset,length:G.children[z+1].offset-B.offset,content:""};return h8(Q,Z,q)}else if(Y!==void 0){let z,B=`${JSON.stringify(Y)}`;if(!q.isArrayInsertion&&G.children.length>K){let Z=G.children[K];z={offset:Z.offset,length:Z.length,content:B}}else if(G.children.length===0||K===0)z={offset:G.offset+1,length:0,content:G.children.length===0?B:B+","};else{let Z=K>G.children.length?G.children.length:K,M=G.children[Z-1];z={offset:M.offset+M.length,length:0,content:","+B}}return h8(Q,z,q)}else throw Error(`Can not ${Y===void 0?"remove":q.isArrayInsertion?"insert":"modify"} Array index ${W} as length is not sufficient`)}else throw Error(`Can not add ${typeof K!=="number"?"index":"property"} to parent of type ${G.type}`)}function h8(Q,$,Y){if(!Y.formattingOptions)return[$];let q=g2(Q,$),J=$.offset,X=$.offset+$.content.length;if($.length===0||$.content.length===0){while(J>0&&!r9(q,J-1))J--;while(X<q.length&&!r9(q,X))X++}let H=D7(q,{offset:J,length:X-J},{...Y.formattingOptions,keepLines:!1});for(let K=H.length-1;K>=0;K--){let W=H[K];q=g2(q,W),J=Math.min(J,W.offset),X=Math.max(X,W.offset+W.length),X+=W.content.length-W.length}let G=Q.length-(q.length-X)-J;return[{offset:J,length:G,content:q.substring(J,X)}]}function g2(Q,$){return Q.substring(0,$.offset)+$.content+Q.substring($.offset+$.length)}var V5=A(()=>{O7();T7()});function n0(Q){switch(Q){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function Z9(Q,$,Y,q){return U5(Q,$,Y,q)}function M9(Q,$){let Y=$.slice(0).sort((J,X)=>{let H=J.offset-X.offset;if(H===0)return J.length-X.length;return H}),q=Q.length;for(let J=Y.length-1;J>=0;J--){let X=Y[J];if(X.offset+X.length<=q)Q=g2(Q,X);else throw Error("Overlapping edit");q=X.offset}return Q}var A5,L5,O1,F5;var D0=A(()=>{O7();V5();u2();T7();(function(Q){Q[Q.None=0]="None",Q[Q.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Q[Q.UnexpectedEndOfString=2]="UnexpectedEndOfString",Q[Q.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Q[Q.InvalidUnicode=4]="InvalidUnicode",Q[Q.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Q[Q.InvalidCharacter=6]="InvalidCharacter"})(A5||(A5={}));(function(Q){Q[Q.OpenBraceToken=1]="OpenBraceToken",Q[Q.CloseBraceToken=2]="CloseBraceToken",Q[Q.OpenBracketToken=3]="OpenBracketToken",Q[Q.CloseBracketToken=4]="CloseBracketToken",Q[Q.CommaToken=5]="CommaToken",Q[Q.ColonToken=6]="ColonToken",Q[Q.NullKeyword=7]="NullKeyword",Q[Q.TrueKeyword=8]="TrueKeyword",Q[Q.FalseKeyword=9]="FalseKeyword",Q[Q.StringLiteral=10]="StringLiteral",Q[Q.NumericLiteral=11]="NumericLiteral",Q[Q.LineCommentTrivia=12]="LineCommentTrivia",Q[Q.BlockCommentTrivia=13]="BlockCommentTrivia",Q[Q.LineBreakTrivia=14]="LineBreakTrivia",Q[Q.Trivia=15]="Trivia",Q[Q.Unknown=16]="Unknown",Q[Q.EOF=17]="EOF"})(L5||(L5={}));O1=M5;(function(Q){Q[Q.InvalidSymbol=1]="InvalidSymbol",Q[Q.InvalidNumberFormat=2]="InvalidNumberFormat",Q[Q.PropertyNameExpected=3]="PropertyNameExpected",Q[Q.ValueExpected=4]="ValueExpected",Q[Q.ColonExpected=5]="ColonExpected",Q[Q.CommaExpected=6]="CommaExpected",Q[Q.CloseBraceExpected=7]="CloseBraceExpected",Q[Q.CloseBracketExpected=8]="CloseBracketExpected",Q[Q.EndOfFileExpected=9]="EndOfFileExpected",Q[Q.InvalidCommentToken=10]="InvalidCommentToken",Q[Q.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Q[Q.UnexpectedEndOfString=12]="UnexpectedEndOfString",Q[Q.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Q[Q.InvalidUnicode=14]="InvalidUnicode",Q[Q.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Q[Q.InvalidCharacter=16]="InvalidCharacter"})(F5||(F5={}))});function j(Q,$,Y){function q(G,K){if(!G._zod)Object.defineProperty(G,"_zod",{value:{def:K,constr:H,traits:new Set},enumerable:!1});if(G._zod.traits.has(Q))return;G._zod.traits.add(Q),$(G,K);let W=H.prototype,z=Object.keys(W);for(let B=0;B<z.length;B++){let Z=z[B];if(!(Z in G))G[Z]=W[Z].bind(G)}}let J=Y?.Parent??Object;class X extends J{}Object.defineProperty(X,"name",{value:Q});function H(G){var K;let W=Y?.Parent?new X:this;q(W,G),(K=W._zod).deferred??(K.deferred=[]);for(let z of W._zod.deferred)z();return W}return Object.defineProperty(H,"init",{value:q}),Object.defineProperty(H,Symbol.hasInstance,{value:(G)=>{if(Y?.Parent&&G instanceof Y.Parent)return!0;return G?._zod?.traits?.has(Q)}}),Object.defineProperty(H,"name",{value:Q}),H}function O0(Q){if(Q)Object.assign(c2,Q);return c2}var HF,GF,q8,t9,c2;var U9=A(()=>{HF=Object.freeze({status:"aborted"});GF=Symbol("zod_brand");q8=class q8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};t9=class t9 extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}};c2={}});var W1={};Y8(W1,{unwrapMessage:()=>e9,uint8ArrayToHex:()=>gW,uint8ArrayToBase64url:()=>uW,uint8ArrayToBase64:()=>T5,stringifyPrimitive:()=>i2,slugify:()=>S7,shallowClone:()=>w5,safeExtend:()=>PW,required:()=>yW,randomString:()=>TW,propertyKeyTypes:()=>k7,promiseAllObject:()=>NW,primitiveTypes:()=>D5,prefixIssues:()=>H8,pick:()=>EW,partial:()=>CW,parsedType:()=>x7,optionalKeys:()=>v7,omit:()=>kW,objectClone:()=>DW,numKeys:()=>bW,nullish:()=>Y2,normalizeParams:()=>c,mergeDefs:()=>J8,merge:()=>xW,jsonStringifyReplacer:()=>A9,joinValues:()=>d2,issue:()=>L9,isPlainObject:()=>w8,isObject:()=>V9,hexToUint8Array:()=>mW,getSizableOrigin:()=>I5,getParsedType:()=>RW,getLengthableOrigin:()=>J2,getEnumValues:()=>Q2,getElementAtPath:()=>IW,floatSafeRemainder:()=>R7,finalizeIssue:()=>x0,extend:()=>vW,escapeRegex:()=>X8,esc:()=>p2,defineLazy:()=>U1,createTransparentProxy:()=>SW,cloneDef:()=>OW,clone:()=>P0,cleanRegex:()=>q2,cleanEnum:()=>hW,captureStackTrace:()=>l2,cached:()=>$2,base64urlToUint8Array:()=>fW,base64ToUint8Array:()=>N5,assignProp:()=>j8,assertNotEqual:()=>LW,assertNever:()=>jW,assertIs:()=>FW,assertEqual:()=>AW,assert:()=>wW,allowsEval:()=>E7,aborted:()=>D8,NUMBER_FORMAT_RANGES:()=>P7,Class:()=>b5,BIGINT_FORMAT_RANGES:()=>O5});function AW(Q){return Q}function LW(Q){return Q}function FW(Q){}function jW(Q){throw Error("Unexpected value in exhaustive check")}function wW(Q){}function Q2(Q){let $=Object.values(Q).filter((q)=>typeof q==="number");return Object.entries(Q).filter(([q,J])=>$.indexOf(+q)===-1).map(([q,J])=>J)}function d2(Q,$="|"){return Q.map((Y)=>i2(Y)).join($)}function A9(Q,$){if(typeof $==="bigint")return $.toString();return $}function $2(Q){return{get value(){{let Y=Q();return Object.defineProperty(this,"value",{value:Y}),Y}throw Error("cached value already set")}}}function Y2(Q){return Q===null||Q===void 0}function q2(Q){let $=Q.startsWith("^")?1:0,Y=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice($,Y)}function R7(Q,$){let Y=(Q.toString().split(".")[1]||"").length,q=$.toString(),J=(q.split(".")[1]||"").length;if(J===0&&/\d?e-\d?/.test(q)){let K=q.match(/\d?e-(\d?)/);if(K?.[1])J=Number.parseInt(K[1])}let X=Y>J?Y:J,H=Number.parseInt(Q.toFixed(X).replace(".","")),G=Number.parseInt($.toFixed(X).replace(".",""));return H%G/10**X}function U1(Q,$,Y){let q=void 0;Object.defineProperty(Q,$,{get(){if(q===j5)return;if(q===void 0)q=j5,q=Y();return q},set(J){Object.defineProperty(Q,$,{value:J})},configurable:!0})}function DW(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function j8(Q,$,Y){Object.defineProperty(Q,$,{value:Y,writable:!0,enumerable:!0,configurable:!0})}function J8(...Q){let $={};for(let Y of Q){let q=Object.getOwnPropertyDescriptors(Y);Object.assign($,q)}return Object.defineProperties({},$)}function OW(Q){return J8(Q._zod.def)}function IW(Q,$){if(!$)return Q;return $.reduce((Y,q)=>Y?.[q],Q)}function NW(Q){let $=Object.keys(Q),Y=$.map((q)=>Q[q]);return Promise.all(Y).then((q)=>{let J={};for(let X=0;X<$.length;X++)J[$[X]]=q[X];return J})}function TW(Q=10){let Y="";for(let q=0;q<Q;q++)Y+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Y}function p2(Q){return JSON.stringify(Q)}function S7(Q){return Q.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function V9(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function w8(Q){if(V9(Q)===!1)return!1;let $=Q.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let Y=$.prototype;if(V9(Y)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Y,"isPrototypeOf")===!1)return!1;return!0}function w5(Q){if(w8(Q))return{...Q};if(Array.isArray(Q))return[...Q];return Q}function bW(Q){let $=0;for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))$++;return $}function X8(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P0(Q,$,Y){let q=new Q._zod.constr($??Q._zod.def);if(!$||Y?.parent)q._zod.parent=Q;return q}function c(Q){let $=Q;if(!$)return{};if(typeof $==="string")return{error:()=>$};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 SW(Q){let $;return new Proxy({},{get(Y,q,J){return $??($=Q()),Reflect.get($,q,J)},set(Y,q,J,X){return $??($=Q()),Reflect.set($,q,J,X)},has(Y,q){return $??($=Q()),Reflect.has($,q)},deleteProperty(Y,q){return $??($=Q()),Reflect.deleteProperty($,q)},ownKeys(Y){return $??($=Q()),Reflect.ownKeys($)},getOwnPropertyDescriptor(Y,q){return $??($=Q()),Reflect.getOwnPropertyDescriptor($,q)},defineProperty(Y,q,J){return $??($=Q()),Reflect.defineProperty($,q,J)}})}function i2(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function v7(Q){return Object.keys(Q).filter(($)=>{return Q[$]._zod.optin==="optional"&&Q[$]._zod.optout==="optional"})}function EW(Q,$){let Y=Q._zod.def,q=Y.checks;if(q&&q.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let X=J8(Q._zod.def,{get shape(){let H={};for(let G in $){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!$[G])continue;H[G]=Y.shape[G]}return j8(this,"shape",H),H},checks:[]});return P0(Q,X)}function kW(Q,$){let Y=Q._zod.def,q=Y.checks;if(q&&q.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let X=J8(Q._zod.def,{get shape(){let H={...Q._zod.def.shape};for(let G in $){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!$[G])continue;delete H[G]}return j8(this,"shape",H),H},checks:[]});return P0(Q,X)}function vW(Q,$){if(!w8($))throw Error("Invalid input to extend: expected a plain object");let Y=Q._zod.def.checks;if(Y&&Y.length>0){let X=Q._zod.def.shape;for(let H in $)if(Object.getOwnPropertyDescriptor(X,H)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=J8(Q._zod.def,{get shape(){let X={...Q._zod.def.shape,...$};return j8(this,"shape",X),X}});return P0(Q,J)}function PW(Q,$){if(!w8($))throw Error("Invalid input to safeExtend: expected a plain object");let Y=J8(Q._zod.def,{get shape(){let q={...Q._zod.def.shape,...$};return j8(this,"shape",q),q}});return P0(Q,Y)}function xW(Q,$){let Y=J8(Q._zod.def,{get shape(){let q={...Q._zod.def.shape,...$._zod.def.shape};return j8(this,"shape",q),q},get catchall(){return $._zod.def.catchall},checks:[]});return P0(Q,Y)}function CW(Q,$,Y){let J=$._zod.def.checks;if(J&&J.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let H=J8($._zod.def,{get shape(){let G=$._zod.def.shape,K={...G};if(Y)for(let W in Y){if(!(W in G))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;K[W]=Q?new Q({type:"optional",innerType:G[W]}):G[W]}else for(let W in G)K[W]=Q?new Q({type:"optional",innerType:G[W]}):G[W];return j8(this,"shape",K),K},checks:[]});return P0($,H)}function yW(Q,$,Y){let q=J8($._zod.def,{get shape(){let J=$._zod.def.shape,X={...J};if(Y)for(let H in Y){if(!(H in X))throw Error(`Unrecognized key: "${H}"`);if(!Y[H])continue;X[H]=new Q({type:"nonoptional",innerType:J[H]})}else for(let H in J)X[H]=new Q({type:"nonoptional",innerType:J[H]});return j8(this,"shape",X),X}});return P0($,q)}function D8(Q,$=0){if(Q.aborted===!0)return!0;for(let Y=$;Y<Q.issues.length;Y++)if(Q.issues[Y]?.continue!==!0)return!0;return!1}function H8(Q,$){return $.map((Y)=>{var q;return(q=Y).path??(q.path=[]),Y.path.unshift(Q),Y})}function e9(Q){return typeof Q==="string"?Q:Q?.message}function x0(Q,$,Y){let q={...Q,path:Q.path??[]};if(!Q.message){let J=e9(Q.inst?._zod.def?.error?.(Q))??e9($?.error?.(Q))??e9(Y.customError?.(Q))??e9(Y.localeError?.(Q))??"Invalid input";q.message=J}if(delete q.inst,delete q.continue,!$?.reportInput)delete q.input;return q}function I5(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function J2(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function x7(Q){let $=typeof Q;switch($){case"number":return Number.isNaN(Q)?"nan":"number";case"object":{if(Q===null)return"null";if(Array.isArray(Q))return"array";let Y=Q;if(Y&&Object.getPrototypeOf(Y)!==Object.prototype&&"constructor"in Y&&Y.constructor)return Y.constructor.name}}return $}function L9(...Q){let[$,Y,q]=Q;if(typeof $==="string")return{message:$,code:"custom",input:Y,inst:q};return{...$}}function hW(Q){return Object.entries(Q).filter(([$,Y])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function N5(Q){let $=atob(Q),Y=new Uint8Array($.length);for(let q=0;q<$.length;q++)Y[q]=$.charCodeAt(q);return Y}function T5(Q){let $="";for(let Y=0;Y<Q.length;Y++)$+=String.fromCharCode(Q[Y]);return btoa($)}function fW(Q){let $=Q.replace(/-/g,"+").replace(/_/g,"/"),Y="=".repeat((4-$.length%4)%4);return N5($+Y)}function uW(Q){return T5(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mW(Q){let $=Q.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let Y=new Uint8Array($.length/2);for(let q=0;q<$.length;q+=2)Y[q/2]=Number.parseInt($.slice(q,q+2),16);return Y}function gW(Q){return Array.from(Q).map(($)=>$.toString(16).padStart(2,"0")).join("")}class b5{constructor(...Q){}}var j5,l2,E7,RW=(Q)=>{let $=typeof Q;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},k7,D5,P7,O5;var C0=A(()=>{j5=Symbol("evaluating");l2="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};E7=$2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});k7=new Set(["string","number","symbol"]),D5=new Set(["string","number","bigint","boolean","symbol","undefined"]);P7={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]},O5={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function S5(Q,$=(Y)=>Y.message){let Y={},q=[];for(let J of Q.issues)if(J.path.length>0)Y[J.path[0]]=Y[J.path[0]]||[],Y[J.path[0]].push($(J));else q.push($(J));return{formErrors:q,fieldErrors:Y}}function E5(Q,$=(Y)=>Y.message){let Y={_errors:[]},q=(J)=>{for(let X of J.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((H)=>q({issues:H}));else if(X.code==="invalid_key")q({issues:X.issues});else if(X.code==="invalid_element")q({issues:X.issues});else if(X.path.length===0)Y._errors.push($(X));else{let H=Y,G=0;while(G<X.path.length){let K=X.path[G];if(G!==X.path.length-1)H[K]=H[K]||{_errors:[]};else H[K]=H[K]||{_errors:[]},H[K]._errors.push($(X));H=H[K],G++}}};return q(Q),Y}var R5=(Q,$)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:$,enumerable:!1}),Q.message=JSON.stringify($,A9,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},n2,C7;var y7=A(()=>{U9();C0();n2=j("$ZodError",R5),C7=j("$ZodError",R5,{Parent:Error})});var o2=(Q)=>($,Y,q,J)=>{let X=q?Object.assign(q,{async:!1}):{async:!1},H=$._zod.run({value:Y,issues:[]},X);if(H instanceof Promise)throw new q8;if(H.issues.length){let G=new(J?.Err??Q)(H.issues.map((K)=>x0(K,X,O0())));throw l2(G,J?.callee),G}return H.value},s2=(Q)=>async($,Y,q,J)=>{let X=q?Object.assign(q,{async:!0}):{async:!0},H=$._zod.run({value:Y,issues:[]},X);if(H instanceof Promise)H=await H;if(H.issues.length){let G=new(J?.Err??Q)(H.issues.map((K)=>x0(K,X,O0())));throw l2(G,J?.callee),G}return H.value},X2=(Q)=>($,Y,q)=>{let J=q?{...q,async:!1}:{async:!1},X=$._zod.run({value:Y,issues:[]},J);if(X instanceof Promise)throw new q8;return X.issues.length?{success:!1,error:new(Q??n2)(X.issues.map((H)=>x0(H,J,O0())))}:{success:!0,data:X.value}},k5,H2=(Q)=>async($,Y,q)=>{let J=q?Object.assign(q,{async:!0}):{async:!0},X=$._zod.run({value:Y,issues:[]},J);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new Q(X.issues.map((H)=>x0(H,J,O0())))}:{success:!0,data:X.value}},v5,P5=(Q)=>($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return o2(Q)($,Y,J)},x5=(Q)=>($,Y,q)=>{return o2(Q)($,Y,q)},C5=(Q)=>async($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return s2(Q)($,Y,J)},y5=(Q)=>async($,Y,q)=>{return s2(Q)($,Y,q)},h5=(Q)=>($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return X2(Q)($,Y,J)},f5=(Q)=>($,Y,q)=>{return X2(Q)($,Y,q)},u5=(Q)=>async($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return H2(Q)($,Y,J)},m5=(Q)=>async($,Y,q)=>{return H2(Q)($,Y,q)};var h7=A(()=>{U9();y7();C0();k5=X2(C7),v5=H2(C7)});function r5(){return new RegExp(dW,"u")}function XQ(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function HQ(Q){return new RegExp(`^${XQ(Q)}$`)}function GQ(Q){let $=XQ({precision:Q.precision}),Y=["Z"];if(Q.local)Y.push("");if(Q.offset)Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let q=`${$}(?:${Y.join("|")})`;return new RegExp(`^${qQ}T(?:${q})$`)}var g5,c5,d5,p5,l5,i5,n5,o5,f7=(Q)=>{if(!Q)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},s5,dW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",a5,t5,e5,QQ,$Q,u7,YQ,qQ="(?:(?:\\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])))",JQ,KQ=(Q)=>{let $=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},WQ,r2,zQ,BQ,_Q;var t2=A(()=>{g5=/^[cC][^\s-]{8,}$/,c5=/^[0-9a-z]+$/,d5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,p5=/^[0-9a-vA-V]{20}$/,l5=/^[A-Za-z0-9]{27}$/,i5=/^[a-zA-Z0-9_-]{21}$/,n5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,s5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;a5=/^(?:(?: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])$/,t5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,e5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,QQ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u7=/^[A-Za-z0-9_-]*$/,YQ=/^\+[1-9]\d{6,14}$/,JQ=new RegExp(`^${qQ}$`);WQ=/^-?\d+$/,r2=/^-?\d+(?:\.\d+)?$/,zQ=/^(?:true|false)$/i,BQ=/^[^A-Z]*$/,_Q=/^[^a-z]*$/});var s1,ZQ,m7,g7,MQ,UQ,VQ,AQ,LQ,G2,FQ,jQ,wQ,DQ,OQ,IQ,NQ;var e2=A(()=>{U9();t2();C0();s1=j("$ZodCheck",(Q,$)=>{var Y;Q._zod??(Q._zod={}),Q._zod.def=$,(Y=Q._zod).onattach??(Y.onattach=[])}),ZQ={number:"number",bigint:"bigint",object:"date"},m7=j("$ZodCheckLessThan",(Q,$)=>{s1.init(Q,$);let Y=ZQ[typeof $.value];Q._zod.onattach.push((q)=>{let J=q._zod.bag,X=($.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if($.value<X)if($.inclusive)J.maximum=$.value;else J.exclusiveMaximum=$.value}),Q._zod.check=(q)=>{if($.inclusive?q.value<=$.value:q.value<$.value)return;q.issues.push({origin:Y,code:"too_big",maximum:typeof $.value==="object"?$.value.getTime():$.value,input:q.value,inclusive:$.inclusive,inst:Q,continue:!$.abort})}}),g7=j("$ZodCheckGreaterThan",(Q,$)=>{s1.init(Q,$);let Y=ZQ[typeof $.value];Q._zod.onattach.push((q)=>{let J=q._zod.bag,X=($.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if($.value>X)if($.inclusive)J.minimum=$.value;else J.exclusiveMinimum=$.value}),Q._zod.check=(q)=>{if($.inclusive?q.value>=$.value:q.value>$.value)return;q.issues.push({origin:Y,code:"too_small",minimum:typeof $.value==="object"?$.value.getTime():$.value,input:q.value,inclusive:$.inclusive,inst:Q,continue:!$.abort})}}),MQ=j("$ZodCheckMultipleOf",(Q,$)=>{s1.init(Q,$),Q._zod.onattach.push((Y)=>{var q;(q=Y._zod.bag).multipleOf??(q.multipleOf=$.value)}),Q._zod.check=(Y)=>{if(typeof Y.value!==typeof $.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Y.value==="bigint"?Y.value%$.value===BigInt(0):R7(Y.value,$.value)===0)return;Y.issues.push({origin:typeof Y.value,code:"not_multiple_of",divisor:$.value,input:Y.value,inst:Q,continue:!$.abort})}}),UQ=j("$ZodCheckNumberFormat",(Q,$)=>{s1.init(Q,$),$.format=$.format||"float64";let Y=$.format?.includes("int"),q=Y?"int":"number",[J,X]=P7[$.format];Q._zod.onattach.push((H)=>{let G=H._zod.bag;if(G.format=$.format,G.minimum=J,G.maximum=X,Y)G.pattern=WQ}),Q._zod.check=(H)=>{let G=H.value;if(Y){if(!Number.isInteger(G)){H.issues.push({expected:q,format:$.format,code:"invalid_type",continue:!1,input:G,inst:Q});return}if(!Number.isSafeInteger(G)){if(G>0)H.issues.push({input:G,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:q,inclusive:!0,continue:!$.abort});else H.issues.push({input:G,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:q,inclusive:!0,continue:!$.abort});return}}if(G<J)H.issues.push({origin:"number",input:G,code:"too_small",minimum:J,inclusive:!0,inst:Q,continue:!$.abort});if(G>X)H.issues.push({origin:"number",input:G,code:"too_big",maximum:X,inclusive:!0,inst:Q,continue:!$.abort})}}),VQ=j("$ZodCheckMaxLength",(Q,$)=>{var Y;s1.init(Q,$),(Y=Q._zod.def).when??(Y.when=(q)=>{let J=q.value;return!Y2(J)&&J.length!==void 0}),Q._zod.onattach.push((q)=>{let J=q._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<J)q._zod.bag.maximum=$.maximum}),Q._zod.check=(q)=>{let J=q.value;if(J.length<=$.maximum)return;let H=J2(J);q.issues.push({origin:H,code:"too_big",maximum:$.maximum,inclusive:!0,input:J,inst:Q,continue:!$.abort})}}),AQ=j("$ZodCheckMinLength",(Q,$)=>{var Y;s1.init(Q,$),(Y=Q._zod.def).when??(Y.when=(q)=>{let J=q.value;return!Y2(J)&&J.length!==void 0}),Q._zod.onattach.push((q)=>{let J=q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>J)q._zod.bag.minimum=$.minimum}),Q._zod.check=(q)=>{let J=q.value;if(J.length>=$.minimum)return;let H=J2(J);q.issues.push({origin:H,code:"too_small",minimum:$.minimum,inclusive:!0,input:J,inst:Q,continue:!$.abort})}}),LQ=j("$ZodCheckLengthEquals",(Q,$)=>{var Y;s1.init(Q,$),(Y=Q._zod.def).when??(Y.when=(q)=>{let J=q.value;return!Y2(J)&&J.length!==void 0}),Q._zod.onattach.push((q)=>{let J=q._zod.bag;J.minimum=$.length,J.maximum=$.length,J.length=$.length}),Q._zod.check=(q)=>{let J=q.value,X=J.length;if(X===$.length)return;let H=J2(J),G=X>$.length;q.issues.push({origin:H,...G?{code:"too_big",maximum:$.length}:{code:"too_small",minimum:$.length},inclusive:!0,exact:!0,input:q.value,inst:Q,continue:!$.abort})}}),G2=j("$ZodCheckStringFormat",(Q,$)=>{var Y,q;if(s1.init(Q,$),Q._zod.onattach.push((J)=>{let X=J._zod.bag;if(X.format=$.format,$.pattern)X.patterns??(X.patterns=new Set),X.patterns.add($.pattern)}),$.pattern)(Y=Q._zod).check??(Y.check=(J)=>{if($.pattern.lastIndex=0,$.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:$.format,input:J.value,...$.pattern?{pattern:$.pattern.toString()}:{},inst:Q,continue:!$.abort})});else(q=Q._zod).check??(q.check=()=>{})}),FQ=j("$ZodCheckRegex",(Q,$)=>{G2.init(Q,$),Q._zod.check=(Y)=>{if($.pattern.lastIndex=0,$.pattern.test(Y.value))return;Y.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Y.value,pattern:$.pattern.toString(),inst:Q,continue:!$.abort})}}),jQ=j("$ZodCheckLowerCase",(Q,$)=>{$.pattern??($.pattern=BQ),G2.init(Q,$)}),wQ=j("$ZodCheckUpperCase",(Q,$)=>{$.pattern??($.pattern=_Q),G2.init(Q,$)}),DQ=j("$ZodCheckIncludes",(Q,$)=>{s1.init(Q,$);let Y=X8($.includes),q=new RegExp(typeof $.position==="number"?`^.{${$.position}}${Y}`:Y);$.pattern=q,Q._zod.onattach.push((J)=>{let X=J._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(q)}),Q._zod.check=(J)=>{if(J.value.includes($.includes,$.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:$.includes,input:J.value,inst:Q,continue:!$.abort})}}),OQ=j("$ZodCheckStartsWith",(Q,$)=>{s1.init(Q,$);let Y=new RegExp(`^${X8($.prefix)}.*`);$.pattern??($.pattern=Y),Q._zod.onattach.push((q)=>{let J=q._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Y)}),Q._zod.check=(q)=>{if(q.value.startsWith($.prefix))return;q.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:$.prefix,input:q.value,inst:Q,continue:!$.abort})}}),IQ=j("$ZodCheckEndsWith",(Q,$)=>{s1.init(Q,$);let Y=new RegExp(`.*${X8($.suffix)}$`);$.pattern??($.pattern=Y),Q._zod.onattach.push((q)=>{let J=q._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Y)}),Q._zod.check=(q)=>{if(q.value.endsWith($.suffix))return;q.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:$.suffix,input:q.value,inst:Q,continue:!$.abort})}}),NQ=j("$ZodCheckOverwrite",(Q,$)=>{s1.init(Q,$),Q._zod.check=(Y)=>{Y.value=$.tx(Y.value)}})});class c7{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let Y=Q.split(`
18
+ `).filter((X)=>X),q=Math.min(...Y.map((X)=>X.length-X.trimStart().length)),J=Y.map((X)=>X.slice(q)).map((X)=>" ".repeat(this.indent*2)+X);for(let X of J)this.content.push(X)}compile(){let Q=Function,$=this?.args,q=[...(this?.content??[""]).map((J)=>` ${J}`)];return new Q(...$,q.join(`
19
+ `))}}var bQ;var d7=A(()=>{bQ={major:4,minor:3,patch:6}});function $$(Q){if(Q==="")return!0;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}function pW(Q){if(!u7.test(Q))return!1;let $=Q.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),Y=$.padEnd(Math.ceil($.length/4)*4,"=");return $$(Y)}function lW(Q,$=null){try{let Y=Q.split(".");if(Y.length!==3)return!1;let[q]=Y;if(!q)return!1;let J=JSON.parse(atob(q));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if($&&(!("alg"in J)||J.alg!==$))return!1;return!0}catch{return!1}}function RQ(Q,$,Y){if(Q.issues.length)$.issues.push(...H8(Y,Q.issues));$.value[Y]=Q.value}function $3(Q,$,Y,q,J){if(Q.issues.length){if(J&&!(Y in q))return;$.issues.push(...H8(Y,Q.issues))}if(Q.value===void 0){if(Y in q)$.value[Y]=void 0}else $.value[Y]=Q.value}function _$(Q){let $=Object.keys(Q.shape);for(let q of $)if(!Q.shape?.[q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${q}": expected a Zod schema`);let Y=v7(Q.shape);return{...Q,keys:$,keySet:new Set($),numKeys:$.length,optionalKeys:new Set(Y)}}function Z$(Q,$,Y,q,J,X){let H=[],G=J.keySet,K=J.catchall._zod,W=K.def.type,z=K.optout==="optional";for(let B in $){if(G.has(B))continue;if(W==="never"){H.push(B);continue}let Z=K.run({value:$[B],issues:[]},q);if(Z instanceof Promise)Q.push(Z.then((M)=>$3(M,Y,B,$,z)));else $3(Z,Y,B,$,z)}if(H.length)Y.issues.push({code:"unrecognized_keys",keys:H,input:$,inst:X});if(!Q.length)return Y;return Promise.all(Q).then(()=>{return Y})}function SQ(Q,$,Y,q){for(let X of Q)if(X.issues.length===0)return $.value=X.value,$;let J=Q.filter((X)=>!D8(X));if(J.length===1)return $.value=J[0].value,J[0];return $.issues.push({code:"invalid_union",input:$.value,inst:Y,errors:Q.map((X)=>X.issues.map((H)=>x0(H,q,O0())))}),$}function p7(Q,$){if(Q===$)return{valid:!0,data:Q};if(Q instanceof Date&&$ instanceof Date&&+Q===+$)return{valid:!0,data:Q};if(w8(Q)&&w8($)){let Y=Object.keys($),q=Object.keys(Q).filter((X)=>Y.indexOf(X)!==-1),J={...Q,...$};for(let X of q){let H=p7(Q[X],$[X]);if(!H.valid)return{valid:!1,mergeErrorPath:[X,...H.mergeErrorPath]};J[X]=H.data}return{valid:!0,data:J}}if(Array.isArray(Q)&&Array.isArray($)){if(Q.length!==$.length)return{valid:!1,mergeErrorPath:[]};let Y=[];for(let q=0;q<Q.length;q++){let J=Q[q],X=$[q],H=p7(J,X);if(!H.valid)return{valid:!1,mergeErrorPath:[q,...H.mergeErrorPath]};Y.push(H.data)}return{valid:!0,data:Y}}return{valid:!1,mergeErrorPath:[]}}function EQ(Q,$,Y){let q=new Map,J;for(let G of $.issues)if(G.code==="unrecognized_keys"){J??(J=G);for(let K of G.keys){if(!q.has(K))q.set(K,{});q.get(K).l=!0}}else Q.issues.push(G);for(let G of Y.issues)if(G.code==="unrecognized_keys")for(let K of G.keys){if(!q.has(K))q.set(K,{});q.get(K).r=!0}else Q.issues.push(G);let X=[...q].filter(([,G])=>G.l&&G.r).map(([G])=>G);if(X.length&&J)Q.issues.push({...J,keys:X});if(D8(Q))return Q;let H=p7($.value,Y.value);if(!H.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(H.mergeErrorPath)}`);return Q.value=H.data,Q}function kQ(Q,$){if(Q.issues.length&&$===void 0)return{issues:[],value:void 0};return Q}function vQ(Q,$){if(Q.value===void 0)Q.value=$.defaultValue;return Q}function PQ(Q,$){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:$});return Q}function Q3(Q,$,Y){if(Q.issues.length)return Q.aborted=!0,Q;return $._zod.run({value:Q.value,issues:Q.issues},Y)}function xQ(Q){return Q.value=Object.freeze(Q.value),Q}function CQ(Q,$,Y,q){if(!Q){let J={code:"custom",input:Y,inst:q,path:[...q._zod.def.path??[]],continue:!q._zod.def.abort};if(q._zod.def.params)J.params=q._zod.def.params;$.issues.push(L9(J))}}var T1,Y3,b1,yQ,hQ,fQ,uQ,mQ,gQ,cQ,dQ,pQ,lQ,iQ,nQ,oQ,sQ,rQ,aQ,tQ,eQ,Q$,Y$,q$,J$,X$,l7,H$,G$,K$,W$,z$,B$,iW,M$,U$,V$,A$,L$,F$,j$,i7,w$,D$,O$,I$,N$,T$,b$,R$,S$;var E$=A(()=>{e2();U9();h7();t2();C0();d7();C0();T1=j("$ZodType",(Q,$)=>{var Y;Q??(Q={}),Q._zod.def=$,Q._zod.bag=Q._zod.bag||{},Q._zod.version=bQ;let q=[...Q._zod.def.checks??[]];if(Q._zod.traits.has("$ZodCheck"))q.unshift(Q);for(let J of q)for(let X of J._zod.onattach)X(Q);if(q.length===0)(Y=Q._zod).deferred??(Y.deferred=[]),Q._zod.deferred?.push(()=>{Q._zod.run=Q._zod.parse});else{let J=(H,G,K)=>{let W=D8(H),z;for(let B of G){if(B._zod.def.when){if(!B._zod.def.when(H))continue}else if(W)continue;let Z=H.issues.length,M=B._zod.check(H);if(M instanceof Promise&&K?.async===!1)throw new q8;if(z||M instanceof Promise)z=(z??Promise.resolve()).then(async()=>{if(await M,H.issues.length===Z)return;if(!W)W=D8(H,Z)});else{if(H.issues.length===Z)continue;if(!W)W=D8(H,Z)}}if(z)return z.then(()=>{return H});return H},X=(H,G,K)=>{if(D8(H))return H.aborted=!0,H;let W=J(G,q,K);if(W instanceof Promise){if(K.async===!1)throw new q8;return W.then((z)=>Q._zod.parse(z,K))}return Q._zod.parse(W,K)};Q._zod.run=(H,G)=>{if(G.skipChecks)return Q._zod.parse(H,G);if(G.direction==="backward"){let W=Q._zod.parse({value:H.value,issues:[]},{...G,skipChecks:!0});if(W instanceof Promise)return W.then((z)=>{return X(z,H,G)});return X(W,H,G)}let K=Q._zod.parse(H,G);if(K instanceof Promise){if(G.async===!1)throw new q8;return K.then((W)=>J(W,q,G))}return J(K,q,G)}}U1(Q,"~standard",()=>({validate:(J)=>{try{let X=k5(Q,J);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return v5(Q,J).then((H)=>H.success?{value:H.data}:{issues:H.error?.issues})}},vendor:"zod",version:1}))}),Y3=j("$ZodString",(Q,$)=>{T1.init(Q,$),Q._zod.pattern=[...Q?._zod.bag?.patterns??[]].pop()??KQ(Q._zod.bag),Q._zod.parse=(Y,q)=>{if($.coerce)try{Y.value=String(Y.value)}catch(J){}if(typeof Y.value==="string")return Y;return Y.issues.push({expected:"string",code:"invalid_type",input:Y.value,inst:Q}),Y}}),b1=j("$ZodStringFormat",(Q,$)=>{G2.init(Q,$),Y3.init(Q,$)}),yQ=j("$ZodGUID",(Q,$)=>{$.pattern??($.pattern=o5),b1.init(Q,$)}),hQ=j("$ZodUUID",(Q,$)=>{if($.version){let q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[$.version];if(q===void 0)throw Error(`Invalid UUID version: "${$.version}"`);$.pattern??($.pattern=f7(q))}else $.pattern??($.pattern=f7());b1.init(Q,$)}),fQ=j("$ZodEmail",(Q,$)=>{$.pattern??($.pattern=s5),b1.init(Q,$)}),uQ=j("$ZodURL",(Q,$)=>{b1.init(Q,$),Q._zod.check=(Y)=>{try{let q=Y.value.trim(),J=new URL(q);if($.hostname){if($.hostname.lastIndex=0,!$.hostname.test(J.hostname))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$.hostname.source,input:Y.value,inst:Q,continue:!$.abort})}if($.protocol){if($.protocol.lastIndex=0,!$.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))Y.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:$.protocol.source,input:Y.value,inst:Q,continue:!$.abort})}if($.normalize)Y.value=J.href;else Y.value=q;return}catch(q){Y.issues.push({code:"invalid_format",format:"url",input:Y.value,inst:Q,continue:!$.abort})}}}),mQ=j("$ZodEmoji",(Q,$)=>{$.pattern??($.pattern=r5()),b1.init(Q,$)}),gQ=j("$ZodNanoID",(Q,$)=>{$.pattern??($.pattern=i5),b1.init(Q,$)}),cQ=j("$ZodCUID",(Q,$)=>{$.pattern??($.pattern=g5),b1.init(Q,$)}),dQ=j("$ZodCUID2",(Q,$)=>{$.pattern??($.pattern=c5),b1.init(Q,$)}),pQ=j("$ZodULID",(Q,$)=>{$.pattern??($.pattern=d5),b1.init(Q,$)}),lQ=j("$ZodXID",(Q,$)=>{$.pattern??($.pattern=p5),b1.init(Q,$)}),iQ=j("$ZodKSUID",(Q,$)=>{$.pattern??($.pattern=l5),b1.init(Q,$)}),nQ=j("$ZodISODateTime",(Q,$)=>{$.pattern??($.pattern=GQ($)),b1.init(Q,$)}),oQ=j("$ZodISODate",(Q,$)=>{$.pattern??($.pattern=JQ),b1.init(Q,$)}),sQ=j("$ZodISOTime",(Q,$)=>{$.pattern??($.pattern=HQ($)),b1.init(Q,$)}),rQ=j("$ZodISODuration",(Q,$)=>{$.pattern??($.pattern=n5),b1.init(Q,$)}),aQ=j("$ZodIPv4",(Q,$)=>{$.pattern??($.pattern=a5),b1.init(Q,$),Q._zod.bag.format="ipv4"}),tQ=j("$ZodIPv6",(Q,$)=>{$.pattern??($.pattern=t5),b1.init(Q,$),Q._zod.bag.format="ipv6",Q._zod.check=(Y)=>{try{new URL(`http://[${Y.value}]`)}catch{Y.issues.push({code:"invalid_format",format:"ipv6",input:Y.value,inst:Q,continue:!$.abort})}}}),eQ=j("$ZodCIDRv4",(Q,$)=>{$.pattern??($.pattern=e5),b1.init(Q,$)}),Q$=j("$ZodCIDRv6",(Q,$)=>{$.pattern??($.pattern=QQ),b1.init(Q,$),Q._zod.check=(Y)=>{let q=Y.value.split("/");try{if(q.length!==2)throw Error();let[J,X]=q;if(!X)throw Error();let H=Number(X);if(`${H}`!==X)throw Error();if(H<0||H>128)throw Error();new URL(`http://[${J}]`)}catch{Y.issues.push({code:"invalid_format",format:"cidrv6",input:Y.value,inst:Q,continue:!$.abort})}}});Y$=j("$ZodBase64",(Q,$)=>{$.pattern??($.pattern=$Q),b1.init(Q,$),Q._zod.bag.contentEncoding="base64",Q._zod.check=(Y)=>{if($$(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64",input:Y.value,inst:Q,continue:!$.abort})}});q$=j("$ZodBase64URL",(Q,$)=>{$.pattern??($.pattern=u7),b1.init(Q,$),Q._zod.bag.contentEncoding="base64url",Q._zod.check=(Y)=>{if(pW(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64url",input:Y.value,inst:Q,continue:!$.abort})}}),J$=j("$ZodE164",(Q,$)=>{$.pattern??($.pattern=YQ),b1.init(Q,$)});X$=j("$ZodJWT",(Q,$)=>{b1.init(Q,$),Q._zod.check=(Y)=>{if(lW(Y.value,$.alg))return;Y.issues.push({code:"invalid_format",format:"jwt",input:Y.value,inst:Q,continue:!$.abort})}}),l7=j("$ZodNumber",(Q,$)=>{T1.init(Q,$),Q._zod.pattern=Q._zod.bag.pattern??r2,Q._zod.parse=(Y,q)=>{if($.coerce)try{Y.value=Number(Y.value)}catch(H){}let J=Y.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return Y;let X=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return Y.issues.push({expected:"number",code:"invalid_type",input:J,inst:Q,...X?{received:X}:{}}),Y}}),H$=j("$ZodNumberFormat",(Q,$)=>{UQ.init(Q,$),l7.init(Q,$)}),G$=j("$ZodBoolean",(Q,$)=>{T1.init(Q,$),Q._zod.pattern=zQ,Q._zod.parse=(Y,q)=>{if($.coerce)try{Y.value=Boolean(Y.value)}catch(X){}let J=Y.value;if(typeof J==="boolean")return Y;return Y.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:Q}),Y}}),K$=j("$ZodAny",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y)=>Y}),W$=j("$ZodUnknown",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y)=>Y}),z$=j("$ZodNever",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y,q)=>{return Y.issues.push({expected:"never",code:"invalid_type",input:Y.value,inst:Q}),Y}});B$=j("$ZodArray",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y,q)=>{let J=Y.value;if(!Array.isArray(J))return Y.issues.push({expected:"array",code:"invalid_type",input:J,inst:Q}),Y;Y.value=Array(J.length);let X=[];for(let H=0;H<J.length;H++){let G=J[H],K=$.element._zod.run({value:G,issues:[]},q);if(K instanceof Promise)X.push(K.then((W)=>RQ(W,Y,H)));else RQ(K,Y,H)}if(X.length)return Promise.all(X).then(()=>Y);return Y}});iW=j("$ZodObject",(Q,$)=>{if(T1.init(Q,$),!Object.getOwnPropertyDescriptor($,"shape")?.get){let G=$.shape;Object.defineProperty($,"shape",{get:()=>{let K={...G};return Object.defineProperty($,"shape",{value:K}),K}})}let q=$2(()=>_$($));U1(Q._zod,"propValues",()=>{let G=$.shape,K={};for(let W in G){let z=G[W]._zod;if(z.values){K[W]??(K[W]=new Set);for(let B of z.values)K[W].add(B)}}return K});let J=V9,X=$.catchall,H;Q._zod.parse=(G,K)=>{H??(H=q.value);let W=G.value;if(!J(W))return G.issues.push({expected:"object",code:"invalid_type",input:W,inst:Q}),G;G.value={};let z=[],B=H.shape;for(let Z of H.keys){let M=B[Z],V=M._zod.optout==="optional",U=M._zod.run({value:W[Z],issues:[]},K);if(U instanceof Promise)z.push(U.then((R)=>$3(R,G,Z,W,V)));else $3(U,G,Z,W,V)}if(!X)return z.length?Promise.all(z).then(()=>G):G;return Z$(z,W,G,K,q.value,Q)}}),M$=j("$ZodObjectJIT",(Q,$)=>{iW.init(Q,$);let Y=Q._zod.parse,q=$2(()=>_$($)),J=(Z)=>{let M=new c7(["shape","payload","ctx"]),V=q.value,U=(N)=>{let x=p2(N);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};M.write("const input = payload.value;");let R=Object.create(null),I=0;for(let N of V.keys)R[N]=`key_${I++}`;M.write("const newResult = {};");for(let N of V.keys){let x=R[N],w=p2(N),D=Z[N]?._zod?.optout==="optional";if(M.write(`const ${x} = ${U(N)};`),D)M.write(`
20
+ if (${x}.issues.length) {
21
+ if (${w} in input) {
22
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
24
23
  ...iss,
25
- path: iss.path ? [${k}, ...iss.path] : [${k}]
24
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
26
25
  })));
27
26
  }
28
27
  }
29
28
 
30
- if (${u}.value === undefined) {
31
- if (${k} in input) {
32
- newResult[${k}] = undefined;
29
+ if (${x}.value === undefined) {
30
+ if (${w} in input) {
31
+ newResult[${w}] = undefined;
33
32
  }
34
33
  } else {
35
- newResult[${k}] = ${u}.value;
34
+ newResult[${w}] = ${x}.value;
36
35
  }
37
36
 
38
- `);else H.write(`
39
- if (${u}.issues.length) {
40
- payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
37
+ `);else M.write(`
38
+ if (${x}.issues.length) {
39
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
41
40
  ...iss,
42
- path: iss.path ? [${k}, ...iss.path] : [${k}]
41
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
43
42
  })));
44
43
  }
45
44
 
46
- if (${u}.value === undefined) {
47
- if (${k} in input) {
48
- newResult[${k}] = undefined;
45
+ if (${x}.value === undefined) {
46
+ if (${w} in input) {
47
+ newResult[${w}] = undefined;
49
48
  }
50
49
  } else {
51
- newResult[${k}] = ${u}.value;
50
+ newResult[${w}] = ${x}.value;
52
51
  }
53
52
 
54
- `)}H.write("payload.value = newResult;"),H.write("return payload;");let r=H.compile();return(A,u)=>r(j,A,u)},J,Y=e6,z=!i0.jitless,X=z&&I9.value,q=_.catchall,G;$._zod.parse=(j,H)=>{G??(G=Q.value);let Z=j.value;if(!Y(Z))return j.issues.push({expected:"object",code:"invalid_type",input:Z,inst:$}),j;if(z&&X&&H?.async===!1&&H.jitless!==!0){if(!J)J=v(_.shape);if(j=J(j,H),!q)return j;return Ez([],Z,j,H,G,$)}return U(j,H)}});Y_=B("$ZodUnion",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),Y$($._zod,"optout",()=>_.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),Y$($._zod,"values",()=>{if(_.options.every((v)=>v._zod.values))return new Set(_.options.flatMap((v)=>Array.from(v._zod.values)));return}),Y$($._zod,"pattern",()=>{if(_.options.every((v)=>v._zod.pattern)){let v=_.options.map((J)=>J._zod.pattern);return new RegExp(`^(${v.map((J)=>o0(J.source)).join("|")})$`)}return});let U=_.options.length===1,Q=_.options[0]._zod.run;$._zod.parse=(v,J)=>{if(U)return Q(v,J);let Y=!1,z=[];for(let I of _.options){let X=I._zod.run({value:v.value,issues:[]},J);if(X instanceof Promise)z.push(X),Y=!0;else{if(X.issues.length===0)return X;z.push(X)}}if(!Y)return Vz(z,v,$,J);return Promise.all(z).then((I)=>{return Vz(I,v,$,J)})}});e3=B("$ZodXor",($,_)=>{Y_.init($,_),_.inclusive=!1;let U=_.options.length===1,Q=_.options[0]._zod.run;$._zod.parse=(v,J)=>{if(U)return Q(v,J);let Y=!1,z=[];for(let I of _.options){let X=I._zod.run({value:v.value,issues:[]},J);if(X instanceof Promise)z.push(X),Y=!0;else z.push(X)}if(!Y)return Dz(z,v,$,J);return Promise.all(z).then((I)=>{return Dz(I,v,$,J)})}}),$7=B("$ZodDiscriminatedUnion",($,_)=>{_.inclusive=!1,Y_.init($,_);let U=$._zod.parse;Y$($._zod,"propValues",()=>{let v={};for(let J of _.options){let Y=J._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${_.options.indexOf(J)}"`);for(let[z,I]of Object.entries(Y)){if(!v[z])v[z]=new Set;for(let X of I)v[z].add(X)}}return v});let Q=g1(()=>{let v=_.options,J=new Map;for(let Y of v){let z=Y._zod.propValues?.[_.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${_.options.indexOf(Y)}"`);for(let I of z){if(J.has(I))throw Error(`Duplicate discriminator value "${String(I)}"`);J.set(I,Y)}}return J});$._zod.parse=(v,J)=>{let Y=v.value;if(!e6(Y))return v.issues.push({code:"invalid_type",expected:"object",input:Y,inst:$}),v;let z=Q.value.get(Y?.[_.discriminator]);if(z)return z._zod.run(v,J);if(_.unionFallback)return U(v,J);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:_.discriminator,input:Y,path:[_.discriminator],inst:$}),v}}),_7=B("$ZodIntersection",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value,J=_.left._zod.run({value:v,issues:[]},Q),Y=_.right._zod.run({value:v,issues:[]},Q);if(J instanceof Promise||Y instanceof Promise)return Promise.all([J,Y]).then(([I,X])=>{return Mz(U,I,X)});return Mz(U,J,Y)}});Tv=B("$ZodTuple",($,_)=>{e.init($,_);let U=_.items;$._zod.parse=(Q,v)=>{let J=Q.value;if(!Array.isArray(J))return Q.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),Q;Q.value=[];let Y=[],z=[...U].reverse().findIndex((q)=>q._zod.optin!=="optional"),I=z===-1?0:U.length-z;if(!_.rest){let q=J.length>U.length,G=J.length<I-1;if(q||G)return Q.issues.push({...q?{code:"too_big",maximum:U.length,inclusive:!0}:{code:"too_small",minimum:U.length},input:J,inst:$,origin:"array"}),Q}let X=-1;for(let q of U){if(X++,X>=J.length){if(X>=I)continue}let G=q._zod.run({value:J[X],issues:[]},v);if(G instanceof Promise)Y.push(G.then((j)=>Lv(j,Q,X)));else Lv(G,Q,X)}if(_.rest){let q=J.slice(U.length);for(let G of q){X++;let j=_.rest._zod.run({value:G,issues:[]},v);if(j instanceof Promise)Y.push(j.then((H)=>Lv(H,Q,X)));else Lv(j,Q,X)}}if(Y.length)return Promise.all(Y).then(()=>Q);return Q}});v7=B("$ZodRecord",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!E6(v))return U.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),U;let J=[],Y=_.keyType._zod.values;if(Y){U.value={};let z=new Set;for(let X of Y)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){z.add(typeof X==="number"?X.toString():X);let q=_.valueType._zod.run({value:v[X],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...w4(X,G.issues));U.value[X]=G.value}));else{if(q.issues.length)U.issues.push(...w4(X,q.issues));U.value[X]=q.value}}let I;for(let X in v)if(!z.has(X))I=I??[],I.push(X);if(I&&I.length>0)U.issues.push({code:"unrecognized_keys",input:v,inst:$,keys:I})}else{U.value={};for(let z of Reflect.ownKeys(v)){if(z==="__proto__")continue;let I=_.keyType._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof z==="string"&&v_.test(z)&&I.issues.length){let G=_.keyType._zod.run({value:Number(z),issues:[]},Q);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length===0)I=G}if(I.issues.length){if(_.mode==="loose")U.value[z]=v[z];else U.issues.push({code:"invalid_key",origin:"record",issues:I.issues.map((G)=>H4(G,Q,l$())),input:z,path:[z],inst:$});continue}let q=_.valueType._zod.run({value:v[z],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...w4(z,G.issues));U.value[I.value]=G.value}));else{if(q.issues.length)U.issues.push(...w4(z,q.issues));U.value[I.value]=q.value}}}if(J.length)return Promise.all(J).then(()=>U);return U}}),U7=B("$ZodMap",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!(v instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),U;let J=[];U.value=new Map;for(let[Y,z]of v){let I=_.keyType._zod.run({value:Y,issues:[]},Q),X=_.valueType._zod.run({value:z,issues:[]},Q);if(I instanceof Promise||X instanceof Promise)J.push(Promise.all([I,X]).then(([q,G])=>{wz(q,G,U,Y,v,$,Q)}));else wz(I,X,U,Y,v,$,Q)}if(J.length)return Promise.all(J).then(()=>U);return U}});Q7=B("$ZodSet",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(!(v instanceof Set))return U.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),U;let J=[];U.value=new Set;for(let Y of v){let z=_.valueType._zod.run({value:Y,issues:[]},Q);if(z instanceof Promise)J.push(z.then((I)=>Lz(I,U)));else Lz(z,U)}if(J.length)return Promise.all(J).then(()=>U);return U}});J7=B("$ZodEnum",($,_)=>{e.init($,_);let U=r0(_.entries),Q=new Set(U);$._zod.values=Q,$._zod.pattern=new RegExp(`^(${U.filter((v)=>t0.has(typeof v)).map((v)=>typeof v==="string"?R4(v):v.toString()).join("|")})$`),$._zod.parse=(v,J)=>{let Y=v.value;if(Q.has(Y))return v;return v.issues.push({code:"invalid_value",values:U,input:Y,inst:$}),v}}),Y7=B("$ZodLiteral",($,_)=>{if(e.init($,_),_.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(_.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${_.values.map((Q)=>typeof Q==="string"?R4(Q):Q?R4(Q.toString()):String(Q)).join("|")})$`),$._zod.parse=(Q,v)=>{let J=Q.value;if(U.has(J))return Q;return Q.issues.push({code:"invalid_value",values:_.values,input:J,inst:$}),Q}}),z7=B("$ZodFile",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{let v=U.value;if(v instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),U}}),I7=B("$ZodTransform",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6($.constructor.name);let v=_.transform(U.value,U);if(Q.async)return(v instanceof Promise?v:Promise.resolve(v)).then((Y)=>{return U.value=Y,U});if(v instanceof Promise)throw new _6;return U.value=v,U}});Rv=B("$ZodOptional",($,_)=>{e.init($,_),$._zod.optin="optional",$._zod.optout="optional",Y$($._zod,"values",()=>{return _.innerType._zod.values?new Set([..._.innerType._zod.values,void 0]):void 0}),Y$($._zod,"pattern",()=>{let U=_.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)})?$`):void 0}),$._zod.parse=(U,Q)=>{if(_.innerType._zod.optin==="optional"){let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>kz(J,U.value));return kz(v,U.value)}if(U.value===void 0)return U;return _.innerType._zod.run(U,Q)}}),X7=B("$ZodExactOptional",($,_)=>{Rv.init($,_),Y$($._zod,"values",()=>_.innerType._zod.values),Y$($._zod,"pattern",()=>_.innerType._zod.pattern),$._zod.parse=(U,Q)=>{return _.innerType._zod.run(U,Q)}}),q7=B("$ZodNullable",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.innerType._zod.optin),Y$($._zod,"optout",()=>_.innerType._zod.optout),Y$($._zod,"pattern",()=>{let U=_.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)}|null)$`):void 0}),Y$($._zod,"values",()=>{return _.innerType._zod.values?new Set([..._.innerType._zod.values,null]):void 0}),$._zod.parse=(U,Q)=>{if(U.value===null)return U;return _.innerType._zod.run(U,Q)}}),G7=B("$ZodDefault",($,_)=>{e.init($,_),$._zod.optin="optional",Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);if(U.value===void 0)return U.value=_.defaultValue,U;let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>Az(J,_));return Az(v,_)}});j7=B("$ZodPrefault",($,_)=>{e.init($,_),$._zod.optin="optional",Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);if(U.value===void 0)U.value=_.defaultValue;return _.innerType._zod.run(U,Q)}}),K7=B("$ZodNonOptional",($,_)=>{e.init($,_),Y$($._zod,"values",()=>{let U=_.innerType._zod.values;return U?new Set([...U].filter((Q)=>Q!==void 0)):void 0}),$._zod.parse=(U,Q)=>{let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>Fz(J,$));return Fz(v,$)}});H7=B("$ZodSuccess",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6("ZodSuccess");let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>{return U.value=J.issues.length===0,U});return U.value=v.issues.length===0,U}}),W7=B("$ZodCatch",($,_)=>{e.init($,_),Y$($._zod,"optin",()=>_.innerType._zod.optin),Y$($._zod,"optout",()=>_.innerType._zod.optout),Y$($._zod,"values",()=>_.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>{if(U.value=J.value,J.issues.length)U.value=_.catchValue({...U,error:{issues:J.issues.map((Y)=>H4(Y,Q,l$()))},input:U.value}),U.issues=[];return U});if(U.value=v.value,v.issues.length)U.value=_.catchValue({...U,error:{issues:v.issues.map((J)=>H4(J,Q,l$()))},input:U.value}),U.issues=[];return U}}),b7=B("$ZodNaN",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),B7=B("$ZodPipe",($,_)=>{e.init($,_),Y$($._zod,"values",()=>_.in._zod.values),Y$($._zod,"optin",()=>_.in._zod.optin),Y$($._zod,"optout",()=>_.out._zod.optout),Y$($._zod,"propValues",()=>_.in._zod.propValues),$._zod.parse=(U,Q)=>{if(Q.direction==="backward"){let J=_.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>kv(Y,_.in,Q));return kv(J,_.in,Q)}let v=_.in._zod.run(U,Q);if(v instanceof Promise)return v.then((J)=>kv(J,_.out,Q));return kv(v,_.out,Q)}});z_=B("$ZodCodec",($,_)=>{e.init($,_),Y$($._zod,"values",()=>_.in._zod.values),Y$($._zod,"optin",()=>_.in._zod.optin),Y$($._zod,"optout",()=>_.out._zod.optout),Y$($._zod,"propValues",()=>_.in._zod.propValues),$._zod.parse=(U,Q)=>{if((Q.direction||"forward")==="forward"){let J=_.in._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>Av(Y,_,Q));return Av(J,_,Q)}else{let J=_.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>Av(Y,_,Q));return Av(J,_,Q)}}});Z7=B("$ZodReadonly",($,_)=>{e.init($,_),Y$($._zod,"propValues",()=>_.innerType._zod.propValues),Y$($._zod,"values",()=>_.innerType._zod.values),Y$($._zod,"optin",()=>_.innerType?._zod?.optin),Y$($._zod,"optout",()=>_.innerType?._zod?.optout),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return _.innerType._zod.run(U,Q);let v=_.innerType._zod.run(U,Q);if(v instanceof Promise)return v.then(Oz);return Oz(v)}});V7=B("$ZodTemplateLiteral",($,_)=>{e.init($,_);let U=[];for(let Q of _.parts)if(typeof Q==="object"&&Q!==null){if(!Q._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Q._zod.traits].shift()}`);let v=Q._zod.pattern instanceof RegExp?Q._zod.pattern.source:Q._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${Q._zod.traits}`);let J=v.startsWith("^")?1:0,Y=v.endsWith("$")?v.length-1:v.length;U.push(v.slice(J,Y))}else if(Q===null||q9.has(typeof Q))U.push(R4(`${Q}`));else throw Error(`Invalid template literal part: ${Q}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(Q,v)=>{if(typeof Q.value!=="string")return Q.issues.push({input:Q.value,inst:$,expected:"string",code:"invalid_type"}),Q;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(Q.value))return Q.issues.push({input:Q.value,inst:$,code:"invalid_format",format:_.format??"template_literal",pattern:$._zod.pattern.source}),Q;return Q}}),D7=B("$ZodFunction",($,_)=>{return e.init($,_),$._def=_,$._zod.def=_,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...Q){let v=$._def.input?zv($._def.input,Q):Q,J=Reflect.apply(U,this,v);if($._def.output)return zv($._def.output,J);return J}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...Q){let v=$._def.input?await Iv($._def.input,Q):Q,J=await Reflect.apply(U,this,v);if($._def.output)return await Iv($._def.output,J);return J}},$._zod.parse=(U,Q)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let Q=$.constructor;if(Array.isArray(U[0]))return new Q({type:"function",input:new Tv({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new Q({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),M7=B("$ZodPromise",($,_)=>{e.init($,_),$._zod.parse=(U,Q)=>{return Promise.resolve(U.value).then((v)=>_.innerType._zod.run({value:v,issues:[]},Q))}}),w7=B("$ZodLazy",($,_)=>{e.init($,_),Y$($._zod,"innerType",()=>_.getter()),Y$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),Y$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),Y$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),Y$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,Q)=>{return $._zod.innerType._zod.run(U,Q)}}),L7=B("$ZodCustom",($,_)=>{T$.init($,_),e.init($,_),$._zod.parse=(U,Q)=>{return U},$._zod.check=(U)=>{let Q=U.value,v=_.fn(Q);if(v instanceof Promise)return v.then((J)=>Nz(J,U,Q,$));Nz(v,U,Q,$);return}})});function A7(){return{localeError:YB()}}var YB=()=>{let $={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function _(v){return $[v]??null}let U={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${v.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${z}`;return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${J}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${z}`}case"invalid_value":if(v.values.length===1)return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${N(v.values[0])}`;return`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${v.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631"}`;return`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${v.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${v.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${v.minimum.toString()} ${Y.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${v.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${v.prefix}"`;if(J.format==="ends_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${J.suffix}"`;if(J.format==="includes")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${J.includes}"`;if(J.format==="regex")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${J.pattern}`;return`${U[J.format]??v.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${v.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${v.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${v.keys.length>1?"\u0629":""}: ${D(v.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${v.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${v.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};var xz=b(()=>{l()});function F7(){return{localeError:zB()}}var zB=()=>{let $={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function _(v){return $[v]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${v.expected}, daxil olan ${z}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J}, daxil olan ${z}`}case"invalid_value":if(v.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${N(v.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${v.origin??"d\u0259y\u0259r"} ${J}${v.maximum.toString()} ${Y.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${v.origin??"d\u0259y\u0259r"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Yanl\u0131\u015F m\u0259tn: "${J.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;if(J.format==="ends_with")return`Yanl\u0131\u015F m\u0259tn: "${J.suffix}" il\u0259 bitm\u0259lidir`;if(J.format==="includes")return`Yanl\u0131\u015F m\u0259tn: "${J.includes}" daxil olmal\u0131d\u0131r`;if(J.format==="regex")return`Yanl\u0131\u015F m\u0259tn: ${J.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;return`Yanl\u0131\u015F ${U[J.format]??v.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${v.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${v.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};var uz=b(()=>{l()});function yz($,_,U,Q){let v=Math.abs($),J=v%10,Y=v%100;if(Y>=11&&Y<=19)return Q;if(J===1)return _;if(J>=2&&J<=4)return U;return Q}function O7(){return{localeError:IB()}}var IB=()=>{let $={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function _(v){return $[v]??null}let U={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},Q={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${v.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${z}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${J}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${N(v.values[0])}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=yz(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${v.maximum.toString()} ${I}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=yz(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${v.minimum.toString()} ${I}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${v.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${J.includes}"`;if(J.format==="regex")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${v.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${v.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${v.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};var Cz=b(()=>{l()});function N7(){return{localeError:XB()}}var XB=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${v.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${z}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${J}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${N(v.values[0])}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${v.minimum.toString()} ${Y.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${v.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${J.pattern}`;let Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";if(J.format==="emoji")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="datetime")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="date")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";if(J.format==="time")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(J.format==="duration")Y="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";return`${Y} ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${v.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${v.keys.length>1?"\u043E\u0432\u0435":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${v.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};var fz=b(()=>{l()});function S7(){return{localeError:qB()}}var qB=()=>{let $={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function _(v){return $[v]??null}let U={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${v.expected}, s'ha rebut ${z}`;return`Tipus inv\xE0lid: s'esperava ${J}, s'ha rebut ${z}`}case"invalid_value":if(v.values.length===1)return`Valor inv\xE0lid: s'esperava ${N(v.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${D(v.values," o ")}`;case"too_big":{let J=v.inclusive?"com a m\xE0xim":"menys de",Y=_(v.origin);if(Y)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingu\xE9s ${J} ${v.maximum.toString()} ${Y.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"com a m\xEDnim":"m\xE9s de",Y=_(v.origin);if(Y)return`Massa petit: s'esperava que ${v.origin} contingu\xE9s ${J} ${v.minimum.toString()} ${Y.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Format inv\xE0lid: ha de comen\xE7ar amb "${J.prefix}"`;if(J.format==="ends_with")return`Format inv\xE0lid: ha d'acabar amb "${J.suffix}"`;if(J.format==="includes")return`Format inv\xE0lid: ha d'incloure "${J.includes}"`;if(J.format==="regex")return`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${J.pattern}`;return`Format inv\xE0lid per a ${U[J.format]??v.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${v.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${v.origin}`;default:return"Entrada inv\xE0lida"}}};var mz=b(()=>{l()});function T7(){return{localeError:GB()}}var GB=()=>{let $={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function _(v){return $[v]??null}let U={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},Q={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${v.expected}, obdr\u017Eeno ${z}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J}, obdr\u017Eeno ${z}`}case"invalid_value":if(v.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${N(v.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${v.origin??"hodnota"} mus\xED m\xEDt ${J}${v.maximum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${v.origin??"hodnota"} mus\xED b\xFDt ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${v.origin??"hodnota"} mus\xED m\xEDt ${J}${v.minimum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${v.origin??"hodnota"} mus\xED b\xFDt ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${J.prefix}"`;if(J.format==="ends_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${J.suffix}"`;if(J.format==="includes")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${J.includes}"`;if(J.format==="regex")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${J.pattern}`;return`Neplatn\xFD form\xE1t ${U[J.format]??v.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${v.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${D(v.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${v.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${v.origin}`;default:return"Neplatn\xFD vstup"}}};var gz=b(()=>{l()});function R7(){return{localeError:jB()}}var jB=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function _(v){return $[v]??null}let U={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ugyldigt input: forventede instanceof ${v.expected}, fik ${z}`;return`Ugyldigt input: forventede ${J}, fik ${z}`}case"invalid_value":if(v.values.length===1)return`Ugyldig v\xE6rdi: forventede ${N(v.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`For stor: forventede ${z??"value"} ${Y.verb} ${J} ${v.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor: forventede ${z??"value"} havde ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`For lille: forventede ${z} ${Y.verb} ${J} ${v.minimum.toString()} ${Y.unit}`;return`For lille: forventede ${z} havde ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ugyldig streng: skal starte med "${J.prefix}"`;if(J.format==="ends_with")return`Ugyldig streng: skal ende med "${J.suffix}"`;if(J.format==="includes")return`Ugyldig streng: skal indeholde "${J.includes}"`;if(J.format==="regex")return`Ugyldig streng: skal matche m\xF8nsteret ${J.pattern}`;return`Ugyldig ${U[J.format]??v.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${v.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${v.origin}`;default:return"Ugyldigt input"}}};var hz=b(()=>{l()});function E7(){return{localeError:KB()}}var KB=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function _(v){return $[v]??null}let U={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},Q={nan:"NaN",number:"Zahl",array:"Array"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${v.expected}, erhalten ${z}`;return`Ung\xFCltige Eingabe: erwartet ${J}, erhalten ${z}`}case"invalid_value":if(v.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${N(v.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Zu gro\xDF: erwartet, dass ${v.origin??"Wert"} ${J}${v.maximum.toString()} ${Y.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${v.origin??"Wert"} ${J}${v.maximum.toString()} ist`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Zu klein: erwartet, dass ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${J}${v.minimum.toString()} ist`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ung\xFCltiger String: muss mit "${J.prefix}" beginnen`;if(J.format==="ends_with")return`Ung\xFCltiger String: muss mit "${J.suffix}" enden`;if(J.format==="includes")return`Ung\xFCltiger String: muss "${J.includes}" enthalten`;if(J.format==="regex")return`Ung\xFCltiger String: muss dem Muster ${J.pattern} entsprechen`;return`Ung\xFCltig: ${U[J.format]??v.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${v.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${v.origin}`;default:return"Ung\xFCltige Eingabe"}}};var cz=b(()=>{l()});function I_(){return{localeError:HB()}}var HB=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function _(v){return $[v]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;return`Invalid input: expected ${J}, received ${z}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${N(v.values[0])}`;return`Invalid option: expected one of ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Too big: expected ${v.origin??"value"} to have ${J}${v.maximum.toString()} ${Y.unit??"elements"}`;return`Too big: expected ${v.origin??"value"} to be ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Too small: expected ${v.origin} to have ${J}${v.minimum.toString()} ${Y.unit}`;return`Too small: expected ${v.origin} to be ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Invalid string: must start with "${J.prefix}"`;if(J.format==="ends_with")return`Invalid string: must end with "${J.suffix}"`;if(J.format==="includes")return`Invalid string: must include "${J.includes}"`;if(J.format==="regex")return`Invalid string: must match pattern ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${v.divisor}`;case"unrecognized_keys":return`Unrecognized key${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Invalid key in ${v.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${v.origin}`;default:return"Invalid input"}}};var P7=b(()=>{l()});function x7(){return{localeError:WB()}}var WB=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function _(v){return $[v]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},Q={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${v.expected}, ricevi\u011Dis ${z}`;return`Nevalida enigo: atendi\u011Dis ${J}, ricevi\u011Dis ${z}`}case"invalid_value":if(v.values.length===1)return`Nevalida enigo: atendi\u011Dis ${N(v.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Tro granda: atendi\u011Dis ke ${v.origin??"valoro"} havu ${J}${v.maximum.toString()} ${Y.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${v.origin??"valoro"} havu ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Tro malgranda: atendi\u011Dis ke ${v.origin} havu ${J}${v.minimum.toString()} ${Y.unit}`;return`Tro malgranda: atendi\u011Dis ke ${v.origin} estu ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Nevalida karaktraro: devas komenci\u011Di per "${J.prefix}"`;if(J.format==="ends_with")return`Nevalida karaktraro: devas fini\u011Di per "${J.suffix}"`;if(J.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${J.includes}"`;if(J.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${J.pattern}`;return`Nevalida ${U[J.format]??v.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${v.divisor}`;case"unrecognized_keys":return`Nekonata${v.keys.length>1?"j":""} \u015Dlosilo${v.keys.length>1?"j":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${v.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${v.origin}`;default:return"Nevalida enigo"}}};var lz=b(()=>{l()});function u7(){return{localeError:bB()}}var bB=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function _(v){return $[v]??null}let U={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${v.expected}, recibido ${z}`;return`Entrada inv\xE1lida: se esperaba ${J}, recibido ${z}`}case"invalid_value":if(v.values.length===1)return`Entrada inv\xE1lida: se esperaba ${N(v.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`Demasiado grande: se esperaba que ${z??"valor"} tuviera ${J}${v.maximum.toString()} ${Y.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${z??"valor"} fuera ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=Q[v.origin]??v.origin;if(Y)return`Demasiado peque\xF1o: se esperaba que ${z} tuviera ${J}${v.minimum.toString()} ${Y.unit}`;return`Demasiado peque\xF1o: se esperaba que ${z} fuera ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cadena inv\xE1lida: debe comenzar con "${J.prefix}"`;if(J.format==="ends_with")return`Cadena inv\xE1lida: debe terminar en "${J.suffix}"`;if(J.format==="includes")return`Cadena inv\xE1lida: debe incluir "${J.includes}"`;if(J.format==="regex")return`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${J.pattern}`;return`Inv\xE1lido ${U[J.format]??v.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${v.divisor}`;case"unrecognized_keys":return`Llave${v.keys.length>1?"s":""} desconocida${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${Q[v.origin]??v.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${Q[v.origin]??v.origin}`;default:return"Entrada inv\xE1lida"}}};var dz=b(()=>{l()});function y7(){return{localeError:BB()}}var BB=()=>{let $={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function _(v){return $[v]??null}let U={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},Q={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${v.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${z} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${J} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${z} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":if(v.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${N(v.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;return`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${D(v.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${v.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${v.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} ${Y.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${J.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;if(J.format==="ends_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${J.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;if(J.format==="includes")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${J.includes}" \u0628\u0627\u0634\u062F`;if(J.format==="regex")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${J.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;return`${U[J.format]??v.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${v.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${v.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${D(v.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${v.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${v.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};var pz=b(()=>{l()});function C7(){return{localeError:ZB()}}var ZB=()=>{let $={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function _(v){return $[v]??null}let U={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Virheellinen tyyppi: odotettiin instanceof ${v.expected}, oli ${z}`;return`Virheellinen tyyppi: odotettiin ${J}, oli ${z}`}case"invalid_value":if(v.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${N(v.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Liian suuri: ${Y.subject} t\xE4ytyy olla ${J}${v.maximum.toString()} ${Y.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Liian pieni: ${Y.subject} t\xE4ytyy olla ${J}${v.minimum.toString()} ${Y.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${J.prefix}"`;if(J.format==="ends_with")return`Virheellinen sy\xF6te: t\xE4ytyy loppua "${J.suffix}"`;if(J.format==="includes")return`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${J.includes}"`;if(J.format==="regex")return`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${J.pattern}`;return`Virheellinen ${U[J.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${D(v.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};var iz=b(()=>{l()});function f7(){return{localeError:VB()}}var VB=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function _(v){return $[v]??null}let U={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},Q={nan:"NaN",number:"nombre",array:"tableau"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entr\xE9e invalide : instanceof ${v.expected} attendu, ${z} re\xE7u`;return`Entr\xE9e invalide : ${J} attendu, ${z} re\xE7u`}case"invalid_value":if(v.values.length===1)return`Entr\xE9e invalide : ${N(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${D(v.values,"|")} attendue`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Trop grand : ${v.origin??"valeur"} doit ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit \xEAtre ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Trop petit : ${v.origin} doit ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Trop petit : ${v.origin} doit \xEAtre ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${J.prefix}"`;if(J.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${J.suffix}"`;if(J.format==="includes")return`Cha\xEEne invalide : doit inclure "${J.includes}"`;if(J.format==="regex")return`Cha\xEEne invalide : doit correspondre au mod\xE8le ${J.pattern}`;return`${U[J.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${v.divisor}`;case"unrecognized_keys":return`Cl\xE9${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${D(v.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${v.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entr\xE9e invalide"}}};var nz=b(()=>{l()});function m7(){return{localeError:DB()}}var DB=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function _(v){return $[v]??null}let U={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Entr\xE9e invalide : attendu instanceof ${v.expected}, re\xE7u ${z}`;return`Entr\xE9e invalide : attendu ${J}, re\xE7u ${z}`}case"invalid_value":if(v.values.length===1)return`Entr\xE9e invalide : attendu ${N(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"\u2264":"<",Y=_(v.origin);if(Y)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${J}${v.maximum.toString()} ${Y.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"\u2265":">",Y=_(v.origin);if(Y)return`Trop petit : attendu que ${v.origin} ait ${J}${v.minimum.toString()} ${Y.unit}`;return`Trop petit : attendu que ${v.origin} soit ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${J.prefix}"`;if(J.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${J.suffix}"`;if(J.format==="includes")return`Cha\xEEne invalide : doit inclure "${J.includes}"`;if(J.format==="regex")return`Cha\xEEne invalide : doit correspondre au motif ${J.pattern}`;return`${U[J.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${v.divisor}`;case"unrecognized_keys":return`Cl\xE9${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${D(v.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${v.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entr\xE9e invalide"}}};var rz=b(()=>{l()});function g7(){return{localeError:MB()}}var MB=()=>{let $={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},_={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},U=(X)=>X?$[X]:void 0,Q=(X)=>{let q=U(X);if(q)return q.label;return X??$.unknown.label},v=(X)=>`\u05D4${Q(X)}`,J=(X)=>{return(U(X)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA"},Y=(X)=>{if(!X)return null;return _[X]??null},z={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},I={nan:"NaN"};return(X)=>{switch(X.code){case"invalid_type":{let q=X.expected,G=I[q??""]??Q(q),j=R(X.input),H=I[j]??$[j]?.label??j;if(/^[A-Z]/.test(X.expected))return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${X.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${H}`;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${G}, \u05D4\u05EA\u05E7\u05D1\u05DC ${H}`}case"invalid_value":{if(X.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${N(X.values[0])}`;let q=X.values.map((H)=>N(H));if(X.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${q[0]} \u05D0\u05D5 ${q[1]}`;let G=q[q.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${q.slice(0,-1).join(", ")} \u05D0\u05D5 ${G}`}case"too_big":{let q=Y(X.origin),G=v(X.origin??"value");if(X.origin==="string")return`${q?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${X.maximum.toString()} ${q?.unit??""} ${X.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(X.origin==="number"){let Z=X.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${X.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${X.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${Z}`}if(X.origin==="array"||X.origin==="set"){let Z=X.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",V=X.inclusive?`${X.maximum} ${q?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${X.maximum} ${q?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${V}`.trim()}let j=X.inclusive?"<=":"<",H=J(X.origin??"value");if(q?.unit)return`${q.longLabel} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.maximum.toString()} ${q.unit}`;return`${q?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.maximum.toString()}`}case"too_small":{let q=Y(X.origin),G=v(X.origin??"value");if(X.origin==="string")return`${q?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${X.minimum.toString()} ${q?.unit??""} ${X.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(X.origin==="number"){let Z=X.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${X.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${X.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${Z}`}if(X.origin==="array"||X.origin==="set"){let Z=X.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(X.minimum===1&&X.inclusive){let S=X.origin==="set"?"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3":"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let V=X.inclusive?`${X.minimum} ${q?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${X.minimum} ${q?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${G} ${Z} \u05DC\u05D4\u05DB\u05D9\u05DC ${V}`.trim()}let j=X.inclusive?">=":">",H=J(X.origin??"value");if(q?.unit)return`${q.shortLabel} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.minimum.toString()} ${q.unit}`;return`${q?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${G} ${H} ${j}${X.minimum.toString()}`}case"invalid_format":{let q=X;if(q.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${q.prefix}"`;if(q.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${q.suffix}"`;if(q.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${q.includes}"`;if(q.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${q.pattern}`;let G=z[q.format],j=G?.label??q.format,Z=(G?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${j} \u05DC\u05D0 ${Z}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${X.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${X.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${X.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${D(X.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${v(X.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};var oz=b(()=>{l()});function h7(){return{localeError:wB()}}var wB=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function _(v){return $[v]??null}let U={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},Q={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${v.expected}, a kapott \xE9rt\xE9k ${z}`;return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${J}, a kapott \xE9rt\xE9k ${z}`}case"invalid_value":if(v.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${N(v.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`T\xFAl nagy: ${v.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${J}${v.maximum.toString()} ${Y.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${v.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${v.origin} m\xE9rete t\xFAl kicsi ${J}${v.minimum.toString()} ${Y.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${v.origin} t\xFAl kicsi ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\xC9rv\xE9nytelen string: "${J.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;if(J.format==="ends_with")return`\xC9rv\xE9nytelen string: "${J.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;if(J.format==="includes")return`\xC9rv\xE9nytelen string: "${J.includes}" \xE9rt\xE9ket kell tartalmaznia`;if(J.format==="regex")return`\xC9rv\xE9nytelen string: ${J.pattern} mint\xE1nak kell megfelelnie`;return`\xC9rv\xE9nytelen ${U[J.format]??v.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${v.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${v.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${v.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};var tz=b(()=>{l()});function az($,_,U){return Math.abs($)===1?_:U}function n1($){if(!$)return"";let _=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],U=$[$.length-1];return $+(_.includes(U)?"\u0576":"\u0568")}function c7(){return{localeError:LB()}}var LB=()=>{let $={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function _(v){return $[v]??null}let U={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},Q={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${v.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${z}`;return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${J}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${z}`}case"invalid_value":if(v.values.length===1)return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${N(v.values[1])}`;return`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=az(z,Y.unit.one,Y.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${v.maximum.toString()} ${I}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=az(z,Y.unit.one,Y.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${v.minimum.toString()} ${I}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${n1(v.origin)} \u056C\u056B\u0576\u056B ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${J.prefix}"-\u0578\u057E`;if(J.format==="ends_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${J.suffix}"-\u0578\u057E`;if(J.format==="includes")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${J.includes}"`;if(J.format==="regex")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${J.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;return`\u054D\u056D\u0561\u056C ${U[J.format]??v.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${v.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${v.keys.length>1?"\u0576\u0565\u0580":""}. ${D(v.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${n1(v.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${n1(v.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};var sz=b(()=>{l()});function l7(){return{localeError:kB()}}var kB=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function _(v){return $[v]??null}let U={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input tidak valid: diharapkan instanceof ${v.expected}, diterima ${z}`;return`Input tidak valid: diharapkan ${J}, diterima ${z}`}case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${N(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${J}${v.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${J}${v.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`String tidak valid: harus dimulai dengan "${J.prefix}"`;if(J.format==="ends_with")return`String tidak valid: harus berakhir dengan "${J.suffix}"`;if(J.format==="includes")return`String tidak valid: harus menyertakan "${J.includes}"`;if(J.format==="regex")return`String tidak valid: harus sesuai pola ${J.pattern}`;return`${U[J.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};var ez=b(()=>{l()});function d7(){return{localeError:AB()}}var AB=()=>{let $={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function _(v){return $[v]??null}let U={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},Q={nan:"NaN",number:"n\xFAmer",array:"fylki"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera instanceof ${v.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera ${J}`}case"invalid_value":if(v.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${N(v.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin??"gildi"} hafi ${J}${v.maximum.toString()} ${Y.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin??"gildi"} s\xE9 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin} hafi ${J}${v.minimum.toString()} ${Y.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${v.origin} s\xE9 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${J.prefix}"`;if(J.format==="ends_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${J.suffix}"`;if(J.format==="includes")return`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${J.includes}"`;if(J.format==="regex")return`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${J.pattern}`;return`Rangt ${U[J.format]??v.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${v.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${v.keys.length>1?"ir lyklar":"ur lykill"}: ${D(v.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${v.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${v.origin}`;default:return"Rangt gildi"}}};var $I=b(()=>{l()});function p7(){return{localeError:FB()}}var FB=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function _(v){return $[v]??null}let U={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"numero",array:"vettore"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input non valido: atteso instanceof ${v.expected}, ricevuto ${z}`;return`Input non valido: atteso ${J}, ricevuto ${z}`}case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${N(v.values[0])}`;return`Opzione non valida: atteso uno tra ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Troppo grande: ${v.origin??"valore"} deve avere ${J}${v.maximum.toString()} ${Y.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Troppo piccolo: ${v.origin} deve avere ${J}${v.minimum.toString()} ${Y.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Stringa non valida: deve iniziare con "${J.prefix}"`;if(J.format==="ends_with")return`Stringa non valida: deve terminare con "${J.suffix}"`;if(J.format==="includes")return`Stringa non valida: deve includere "${J.includes}"`;if(J.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${D(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};var _I=b(()=>{l()});function i7(){return{localeError:OB()}}var OB=()=>{let $={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function _(v){return $[v]??null}let U={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},Q={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${v.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${z}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u5165\u529B: ${J}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${z}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":if(v.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${N(v.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${D(v.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let J=v.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",Y=_(v.origin);if(Y)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${v.origin??"\u5024"}\u306F${v.maximum.toString()}${Y.unit??"\u8981\u7D20"}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${v.origin??"\u5024"}\u306F${v.maximum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let J=v.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",Y=_(v.origin);if(Y)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${v.origin}\u306F${v.minimum.toString()}${Y.unit}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${v.origin}\u306F${v.minimum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="ends_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="includes")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${J.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(J.format==="regex")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${J.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u7121\u52B9\u306A${U[J.format]??v.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${v.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${v.keys.length>1?"\u7FA4":""}: ${D(v.keys,"\u3001")}`;case"invalid_key":return`${v.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${v.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};var vI=b(()=>{l()});function n7(){return{localeError:NB()}}var NB=()=>{let $={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function _(v){return $[v]??null}let U={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},Q={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${v.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${z}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${J}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${z}`}case"invalid_value":if(v.values.length===1)return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${N(v.values[0])}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${D(v.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${v.origin} \u10D8\u10E7\u10DD\u10E1 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${J.prefix}"-\u10D8\u10D7`;if(J.format==="ends_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${J.suffix}"-\u10D8\u10D7`;if(J.format==="includes")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${J.includes}"-\u10E1`;if(J.format==="regex")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${J.pattern}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${v.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${v.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${v.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${v.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};var UI=b(()=>{l()});function X_(){return{localeError:SB()}}var SB=()=>{let $={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function _(v){return $[v]??null}let U={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},Q={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${v.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${z}`;return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${J} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${z}`}case"invalid_value":if(v.values.length===1)return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${N(v.values[0])}`;return`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${v.maximum.toString()} ${Y.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin} ${J} ${v.minimum.toString()} ${Y.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${v.origin} ${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${J.prefix}"`;if(J.format==="ends_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${J.suffix}"`;if(J.format==="includes")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${J.includes}"`;if(J.format==="regex")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${J.pattern}`;return`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${v.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${D(v.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${v.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${v.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};var r7=b(()=>{l()});function o7(){return X_()}var QI=b(()=>{r7()});function t7(){return{localeError:TB()}}var TB=()=>{let $={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function _(v){return $[v]??null}let U={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${v.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${z}\uC785\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${J}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${z}\uC785\uB2C8\uB2E4`}case"invalid_value":if(v.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${N(v.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${D(v.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let J=v.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",Y=J==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",z=_(v.origin),I=z?.unit??"\uC694\uC18C";if(z)return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${v.maximum.toString()}${I} ${J}${Y}`;return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${v.maximum.toString()} ${J}${Y}`}case"too_small":{let J=v.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",Y=J==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",z=_(v.origin),I=z?.unit??"\uC694\uC18C";if(z)return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${v.minimum.toString()}${I} ${J}${Y}`;return`${v.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${v.minimum.toString()} ${J}${Y}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="ends_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="includes")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${J.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;if(J.format==="regex")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${J.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C ${U[J.format]??v.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${v.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${D(v.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${v.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${v.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};var JI=b(()=>{l()});function YI($){let _=Math.abs($),U=_%10,Q=_%100;if(Q>=11&&Q<=19||U===0)return"many";if(U===1)return"one";return"few"}function a7(){return{localeError:RB()}}var q_=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)},RB=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function _(v,J,Y,z){let I=$[v]??null;if(I===null)return I;return{unit:I.unit[J],verb:I.verb[z][Y?"inclusive":"notInclusive"]}}let U={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},Q={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Gautas tipas ${z}, o tik\u0117tasi - instanceof ${v.expected}`;return`Gautas tipas ${z}, o tik\u0117tasi - ${J}`}case"invalid_value":if(v.values.length===1)return`Privalo b\u016Bti ${N(v.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${D(v.values,"|")} pasirinkim\u0173`;case"too_big":{let J=Q[v.origin]??v.origin,Y=_(v.origin,YI(Number(v.maximum)),v.inclusive??!1,"smaller");if(Y?.verb)return`${q_(J??v.origin??"reik\u0161m\u0117")} ${Y.verb} ${v.maximum.toString()} ${Y.unit??"element\u0173"}`;let z=v.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${q_(J??v.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${v.maximum.toString()} ${Y?.unit}`}case"too_small":{let J=Q[v.origin]??v.origin,Y=_(v.origin,YI(Number(v.minimum)),v.inclusive??!1,"bigger");if(Y?.verb)return`${q_(J??v.origin??"reik\u0161m\u0117")} ${Y.verb} ${v.minimum.toString()} ${Y.unit??"element\u0173"}`;let z=v.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${q_(J??v.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${v.minimum.toString()} ${Y?.unit}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Eilut\u0117 privalo prasid\u0117ti "${J.prefix}"`;if(J.format==="ends_with")return`Eilut\u0117 privalo pasibaigti "${J.suffix}"`;if(J.format==="includes")return`Eilut\u0117 privalo \u012Ftraukti "${J.includes}"`;if(J.format==="regex")return`Eilut\u0117 privalo atitikti ${J.pattern}`;return`Neteisingas ${U[J.format]??v.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${v.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${v.keys.length>1?"i":"as"} rakt${v.keys.length>1?"ai":"as"}: ${D(v.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let J=Q[v.origin]??v.origin;return`${q_(J??v.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};var zI=b(()=>{l()});function s7(){return{localeError:EB()}}var EB=()=>{let $={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function _(v){return $[v]??null}let U={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},Q={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${v.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${z}`;return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${J}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${N(v.values[0])}`;return`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin} \u0434\u0430 \u0438\u043C\u0430 ${J}${v.minimum.toString()} ${Y.unit}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${v.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${J.pattern}`;return`Invalid ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${v.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${v.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};var II=b(()=>{l()});function e7(){return{localeError:PB()}}var PB=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function _(v){return $[v]??null}let U={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"nombor"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Input tidak sah: dijangka instanceof ${v.expected}, diterima ${z}`;return`Input tidak sah: dijangka ${J}, diterima ${z}`}case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${N(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Terlalu kecil: dijangka ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`String tidak sah: mesti bermula dengan "${J.prefix}"`;if(J.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${J.suffix}"`;if(J.format==="includes")return`String tidak sah: mesti mengandungi "${J.includes}"`;if(J.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${J.pattern}`;return`${U[J.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${D(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};var XI=b(()=>{l()});function $5(){return{localeError:xB()}}var xB=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function _(v){return $[v]??null}let U={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},Q={nan:"NaN",number:"getal"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ongeldige invoer: verwacht instanceof ${v.expected}, ontving ${z}`;return`Ongeldige invoer: verwacht ${J}, ontving ${z}`}case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${N(v.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin),z=v.origin==="date"?"laat":v.origin==="string"?"lang":"groot";if(Y)return`Te ${z}: verwacht dat ${v.origin??"waarde"} ${J}${v.maximum.toString()} ${Y.unit??"elementen"} ${Y.verb}`;return`Te ${z}: verwacht dat ${v.origin??"waarde"} ${J}${v.maximum.toString()} is`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin),z=v.origin==="date"?"vroeg":v.origin==="string"?"kort":"klein";if(Y)return`Te ${z}: verwacht dat ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Te ${z}: verwacht dat ${v.origin} ${J}${v.minimum.toString()} is`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ongeldige tekst: moet met "${J.prefix}" beginnen`;if(J.format==="ends_with")return`Ongeldige tekst: moet op "${J.suffix}" eindigen`;if(J.format==="includes")return`Ongeldige tekst: moet "${J.includes}" bevatten`;if(J.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${J.pattern}`;return`Ongeldig: ${U[J.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};var qI=b(()=>{l()});function _5(){return{localeError:uB()}}var uB=()=>{let $={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function _(v){return $[v]??null}let U={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"tall",array:"liste"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ugyldig input: forventet instanceof ${v.expected}, fikk ${z}`;return`Ugyldig input: forventet ${J}, fikk ${z}`}case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${N(v.values[0])}`;return`Ugyldig valg: forventet en av ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`For stor(t): forventet ${v.origin??"value"} til \xE5 ha ${J}${v.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til \xE5 ha ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`For lite(n): forventet ${v.origin} til \xE5 ha ${J}${v.minimum.toString()} ${Y.unit}`;return`For lite(n): forventet ${v.origin} til \xE5 ha ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ugyldig streng: m\xE5 starte med "${J.prefix}"`;if(J.format==="ends_with")return`Ugyldig streng: m\xE5 ende med "${J.suffix}"`;if(J.format==="includes")return`Ugyldig streng: m\xE5 inneholde "${J.includes}"`;if(J.format==="regex")return`Ugyldig streng: m\xE5 matche m\xF8nsteret ${J.pattern}`;return`Ugyldig ${U[J.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};var GI=b(()=>{l()});function v5(){return{localeError:yB()}}var yB=()=>{let $={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function _(v){return $[v]??null}let U={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},Q={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`F\xE2sit giren: umulan instanceof ${v.expected}, al\u0131nan ${z}`;return`F\xE2sit giren: umulan ${J}, al\u0131nan ${z}`}case"invalid_value":if(v.values.length===1)return`F\xE2sit giren: umulan ${N(v.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Fazla b\xFCy\xFCk: ${v.origin??"value"}, ${J}${v.maximum.toString()} ${Y.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${v.origin??"value"}, ${J}${v.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Fazla k\xFC\xE7\xFCk: ${v.origin}, ${J}${v.minimum.toString()} ${Y.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${v.origin}, ${J}${v.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`F\xE2sit metin: "${J.prefix}" ile ba\u015Flamal\u0131.`;if(J.format==="ends_with")return`F\xE2sit metin: "${J.suffix}" ile bitmeli.`;if(J.format==="includes")return`F\xE2sit metin: "${J.includes}" ihtiv\xE2 etmeli.`;if(J.format==="regex")return`F\xE2sit metin: ${J.pattern} nak\u015F\u0131na uymal\u0131.`;return`F\xE2sit ${U[J.format]??v.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${v.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${v.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};var jI=b(()=>{l()});function U5(){return{localeError:CB()}}var CB=()=>{let $={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function _(v){return $[v]??null}let U={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},Q={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${v.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${z} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${J} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${z} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":if(v.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${N(v.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${D(v.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${v.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${v.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${v.maximum.toString()} \u0648\u064A`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} ${Y.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${v.origin} \u0628\u0627\u06CC\u062F ${J}${v.minimum.toString()} \u0648\u064A`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${J.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;if(J.format==="ends_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${J.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;if(J.format==="includes")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${J.includes}" \u0648\u0644\u0631\u064A`;if(J.format==="regex")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${J.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;return`${U[J.format]??v.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${v.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${v.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${D(v.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${v.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${v.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};var KI=b(()=>{l()});function Q5(){return{localeError:fB()}}var fB=()=>{let $={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function _(v){return $[v]??null}let U={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},Q={nan:"NaN",number:"liczba",array:"tablica"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${v.expected}, otrzymano ${z}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J}, otrzymano ${z}`}case"invalid_value":if(v.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${N(v.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${v.maximum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${v.minimum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${v.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${J.prefix}"`;if(J.format==="ends_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${J.suffix}"`;if(J.format==="includes")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${J.includes}"`;if(J.format==="regex")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${J.pattern}`;return`Nieprawid\u0142ow(y/a/e) ${U[J.format]??v.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${v.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${v.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};var HI=b(()=>{l()});function J5(){return{localeError:mB()}}var mB=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function _(v){return $[v]??null}let U={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},Q={nan:"NaN",number:"n\xFAmero",null:"nulo"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Tipo inv\xE1lido: esperado instanceof ${v.expected}, recebido ${z}`;return`Tipo inv\xE1lido: esperado ${J}, recebido ${z}`}case"invalid_value":if(v.values.length===1)return`Entrada inv\xE1lida: esperado ${N(v.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${J}${v.maximum.toString()} ${Y.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Muito pequeno: esperado que ${v.origin} tivesse ${J}${v.minimum.toString()} ${Y.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Texto inv\xE1lido: deve come\xE7ar com "${J.prefix}"`;if(J.format==="ends_with")return`Texto inv\xE1lido: deve terminar com "${J.suffix}"`;if(J.format==="includes")return`Texto inv\xE1lido: deve incluir "${J.includes}"`;if(J.format==="regex")return`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${J.pattern}`;return`${U[J.format]??v.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${D(v.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${v.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${v.origin}`;default:return"Campo inv\xE1lido"}}};var WI=b(()=>{l()});function bI($,_,U,Q){let v=Math.abs($),J=v%10,Y=v%100;if(Y>=11&&Y<=19)return Q;if(J===1)return _;if(J>=2&&J<=4)return U;return Q}function Y5(){return{localeError:gB()}}var gB=()=>{let $={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${v.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${z}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${J}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${N(v.values[0])}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y){let z=Number(v.maximum),I=bI(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${v.maximum.toString()} ${I}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y){let z=Number(v.minimum),I=bI(z,Y.unit.one,Y.unit.few,Y.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${v.minimum.toString()} ${I}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${v.origin} \u0431\u0443\u0434\u0435\u0442 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${v.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${v.keys.length>1?"\u0438":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${v.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};var BI=b(()=>{l()});function z5(){return{localeError:hB()}}var hB=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function _(v){return $[v]??null}let U={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},Q={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${v.expected}, prejeto ${z}`;return`Neveljaven vnos: pri\u010Dakovano ${J}, prejeto ${z}`}case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${N(v.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Preveliko: pri\u010Dakovano, da bo ${v.origin??"vrednost"} imelo ${J}${v.maximum.toString()} ${Y.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${v.origin??"vrednost"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Premajhno: pri\u010Dakovano, da bo ${v.origin} imelo ${J}${v.minimum.toString()} ${Y.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Neveljaven niz: mora se za\u010Deti z "${J.prefix}"`;if(J.format==="ends_with")return`Neveljaven niz: mora se kon\u010Dati z "${J.suffix}"`;if(J.format==="includes")return`Neveljaven niz: mora vsebovati "${J.includes}"`;if(J.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${J.pattern}`;return`Neveljaven ${U[J.format]??v.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${D(v.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};var ZI=b(()=>{l()});function I5(){return{localeError:cB()}}var cB=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function _(v){return $[v]??null}let U={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},Q={nan:"NaN",number:"antal",array:"lista"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${v.expected}, fick ${z}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${J}, fick ${z}`}case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${N(v.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.maximum.toString()} ${Y.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${v.origin??"v\xE4rdet"} att ha ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.minimum.toString()} ${Y.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${v.origin??"v\xE4rdet"} att ha ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${J.prefix}"`;if(J.format==="ends_with")return`Ogiltig str\xE4ng: m\xE5ste sluta med "${J.suffix}"`;if(J.format==="includes")return`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${J.includes}"`;if(J.format==="regex")return`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${J.pattern}"`;return`Ogiltig(t) ${U[J.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${D(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${v.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};var VI=b(()=>{l()});function X5(){return{localeError:lB()}}var lB=()=>{let $={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function _(v){return $[v]??null}let U={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},Q={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${v.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${J}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z}`}case"invalid_value":if(v.values.length===1)return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(v.values[0])}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${D(v.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${v.maximum.toString()} ${Y.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${v.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v.origin} ${J}${v.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="ends_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="includes")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${J.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(J.format==="regex")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${J.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${v.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${v.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${v.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};var DI=b(()=>{l()});function q5(){return{localeError:dB()}}var dB=()=>{let $={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function _(v){return $[v]??null}let U={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},Q={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${v.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${z}`;return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${J} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${z}`}case"invalid_value":if(v.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${N(v.values[0])}`;return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",Y=_(v.origin);if(Y)return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.maximum.toString()} ${Y.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",Y=_(v.origin);if(Y)return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.minimum.toString()} ${Y.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${v.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${J.prefix}"`;if(J.format==="ends_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${J.suffix}"`;if(J.format==="includes")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${J.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;if(J.format==="regex")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${J.pattern}`;return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${U[J.format]??v.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${v.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${D(v.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${v.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${v.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};var MI=b(()=>{l()});function G5(){return{localeError:pB()}}var pB=()=>{let $={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function _(v){return $[v]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${v.expected}, al\u0131nan ${z}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${J}, al\u0131nan ${z}`}case"invalid_value":if(v.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${N(v.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\xC7ok b\xFCy\xFCk: beklenen ${v.origin??"de\u011Fer"} ${J}${v.maximum.toString()} ${Y.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${v.origin??"de\u011Fer"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Ge\xE7ersiz metin: "${J.prefix}" ile ba\u015Flamal\u0131`;if(J.format==="ends_with")return`Ge\xE7ersiz metin: "${J.suffix}" ile bitmeli`;if(J.format==="includes")return`Ge\xE7ersiz metin: "${J.includes}" i\xE7ermeli`;if(J.format==="regex")return`Ge\xE7ersiz metin: ${J.pattern} desenine uymal\u0131`;return`Ge\xE7ersiz ${U[J.format]??v.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${v.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${v.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};var wI=b(()=>{l()});function G_(){return{localeError:iB()}}var iB=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function _(v){return $[v]??null}let U={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},Q={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${v.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${z}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${J}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${z}`}case"invalid_value":if(v.values.length===1)return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${N(v.values[0])}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${v.origin} \u0431\u0443\u0434\u0435 ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${J.prefix}"`;if(J.format==="ends_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${J.suffix}"`;if(J.format==="includes")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${J.includes}"`;if(J.format==="regex")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${J.pattern}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${v.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${v.keys.length>1?"\u0456":""}: ${D(v.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${v.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${v.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};var j5=b(()=>{l()});function K5(){return G_()}var LI=b(()=>{j5()});function H5(){return{localeError:nB()}}var nB=()=>{let $={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function _(v){return $[v]??null}let U={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},Q={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${v.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${z} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${J} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${z} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":if(v.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${N(v.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${D(v.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${v.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${J}${v.maximum.toString()} ${Y.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${v.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${J}${v.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${v.origin} \u06A9\u06D2 ${J}${v.minimum.toString()} ${Y.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${v.origin} \u06A9\u0627 ${J}${v.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="ends_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="includes")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${J.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(J.format==="regex")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${J.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;return`\u063A\u0644\u0637 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${v.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${v.keys.length>1?"\u0632":""}: ${D(v.keys,"\u060C ")}`;case"invalid_key":return`${v.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${v.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};var kI=b(()=>{l()});function W5(){return{localeError:rB()}}var rB=()=>{let $={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function _(v){return $[v]??null}let U={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},Q={nan:"NaN",number:"raqam",array:"massiv"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${v.expected}, qabul qilingan ${z}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${J}, qabul qilingan ${z}`}case"invalid_value":if(v.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${N(v.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Juda katta: kutilgan ${v.origin??"qiymat"} ${J}${v.maximum.toString()} ${Y.unit} ${Y.verb}`;return`Juda katta: kutilgan ${v.origin??"qiymat"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Juda kichik: kutilgan ${v.origin} ${J}${v.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Juda kichik: kutilgan ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Noto\u2018g\u2018ri satr: "${J.prefix}" bilan boshlanishi kerak`;if(J.format==="ends_with")return`Noto\u2018g\u2018ri satr: "${J.suffix}" bilan tugashi kerak`;if(J.format==="includes")return`Noto\u2018g\u2018ri satr: "${J.includes}" ni o\u2018z ichiga olishi kerak`;if(J.format==="regex")return`Noto\u2018g\u2018ri satr: ${J.pattern} shabloniga mos kelishi kerak`;return`Noto\u2018g\u2018ri ${U[J.format]??v.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${v.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${v.keys.length>1?"lar":""}: ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${v.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};var AI=b(()=>{l()});function b5(){return{localeError:oB()}}var oB=()=>{let $={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function _(v){return $[v]??null}let U={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},Q={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${v.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${z}`;return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${J}, nh\u1EADn \u0111\u01B0\u1EE3c ${z}`}case"invalid_value":if(v.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${N(v.values[0])}`;return`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${v.origin??"gi\xE1 tr\u1ECB"} ${Y.verb} ${J}${v.maximum.toString()} ${Y.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${v.origin??"gi\xE1 tr\u1ECB"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${v.origin} ${Y.verb} ${J}${v.minimum.toString()} ${Y.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${J.prefix}"`;if(J.format==="ends_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${J.suffix}"`;if(J.format==="includes")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${J.includes}"`;if(J.format==="regex")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${J.pattern}`;return`${U[J.format]??v.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${v.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${D(v.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${v.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${v.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};var FI=b(()=>{l()});function B5(){return{localeError:tB()}}var tB=()=>{let $={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function _(v){return $[v]??null}let U={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},Q={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${v.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${z}`;return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${J}\uFF0C\u5B9E\u9645\u63A5\u6536 ${z}`}case"invalid_value":if(v.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${N(v.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${v.origin??"\u503C"} ${J}${v.maximum.toString()} ${Y.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${v.origin??"\u503C"} ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${v.origin} ${J}${v.minimum.toString()} ${Y.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${v.origin} ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${J.prefix}" \u5F00\u5934`;if(J.format==="ends_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${J.suffix}" \u7ED3\u5C3E`;if(J.format==="includes")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${J.includes}"`;if(J.format==="regex")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${J.pattern}`;return`\u65E0\u6548${U[J.format]??v.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${v.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${D(v.keys,", ")}`;case"invalid_key":return`${v.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${v.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};var OI=b(()=>{l()});function Z5(){return{localeError:aB()}}var aB=()=>{let $={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function _(v){return $[v]??null}let U={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},Q={nan:"NaN"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${v.expected}\uFF0C\u4F46\u6536\u5230 ${z}`;return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${J}\uFF0C\u4F46\u6536\u5230 ${z}`}case"invalid_value":if(v.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${N(v.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${v.origin??"\u503C"} \u61C9\u70BA ${J}${v.maximum.toString()} ${Y.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${v.origin??"\u503C"} \u61C9\u70BA ${J}${v.maximum.toString()}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${v.origin} \u61C9\u70BA ${J}${v.minimum.toString()} ${Y.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${v.origin} \u61C9\u70BA ${J}${v.minimum.toString()}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${J.prefix}" \u958B\u982D`;if(J.format==="ends_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${J.suffix}" \u7D50\u5C3E`;if(J.format==="includes")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${J.includes}"`;if(J.format==="regex")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${J.pattern}`;return`\u7121\u6548\u7684 ${U[J.format]??v.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${v.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${v.keys.length>1?"\u5011":""}\uFF1A${D(v.keys,"\u3001")}`;case"invalid_key":return`${v.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${v.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};var NI=b(()=>{l()});function V5(){return{localeError:sB()}}var sB=()=>{let $={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function _(v){return $[v]??null}let U={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},Q={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return(v)=>{switch(v.code){case"invalid_type":{let J=Q[v.expected]??v.expected,Y=R(v.input),z=Q[Y]??Y;if(/^[A-Z]/.test(v.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${v.expected}, \xE0m\u1ECD\u0300 a r\xED ${z}`;return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${J}, \xE0m\u1ECD\u0300 a r\xED ${z}`}case"invalid_value":if(v.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${N(v.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${D(v.values,"|")}`;case"too_big":{let J=v.inclusive?"<=":"<",Y=_(v.origin);if(Y)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${v.origin??"iye"} ${Y.verb} ${J}${v.maximum} ${Y.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${v.maximum}`}case"too_small":{let J=v.inclusive?">=":">",Y=_(v.origin);if(Y)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${v.origin} ${Y.verb} ${J}${v.minimum} ${Y.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${v.minimum}`}case"invalid_format":{let J=v;if(J.format==="starts_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${J.prefix}"`;if(J.format==="ends_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${J.suffix}"`;if(J.format==="includes")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${J.includes}"`;if(J.format==="regex")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${J.pattern}`;return`A\u1E63\xEC\u1E63e: ${U[J.format]??v.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${v.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${D(v.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${v.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${v.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};var SI=b(()=>{l()});var j_={};s$(j_,{zhTW:()=>Z5,zhCN:()=>B5,yo:()=>V5,vi:()=>b5,uz:()=>W5,ur:()=>H5,uk:()=>G_,ua:()=>K5,tr:()=>G5,th:()=>q5,ta:()=>X5,sv:()=>I5,sl:()=>z5,ru:()=>Y5,pt:()=>J5,ps:()=>U5,pl:()=>Q5,ota:()=>v5,no:()=>_5,nl:()=>$5,ms:()=>e7,mk:()=>s7,lt:()=>a7,ko:()=>t7,km:()=>X_,kh:()=>o7,ka:()=>n7,ja:()=>i7,it:()=>p7,is:()=>d7,id:()=>l7,hy:()=>c7,hu:()=>h7,he:()=>g7,frCA:()=>m7,fr:()=>f7,fi:()=>C7,fa:()=>y7,es:()=>u7,eo:()=>x7,en:()=>I_,de:()=>E7,da:()=>R7,cs:()=>T7,ca:()=>S7,bg:()=>N7,be:()=>O7,az:()=>F7,ar:()=>A7});var D5=b(()=>{xz();uz();Cz();fz();mz();gz();hz();cz();P7();lz();dz();pz();iz();nz();rz();oz();tz();sz();ez();$I();_I();vI();UI();QI();r7();JI();zI();II();XI();qI();GI();jI();KI();HI();WI();BI();ZI();VI();DI();MI();wI();LI();j5();kI();AI();FI();OI();NI();SI()});class L5{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,..._){let U=_[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U)this._idmap.set(U.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let _=this._map.get($);if(_&&typeof _==="object"&&"id"in _)this._idmap.delete(_.id);return this._map.delete($),this}get($){let _=$._zod.parent;if(_){let U={...this.get(_)??{}};delete U.id;let Q={...U,...this._map.get($)};return Object.keys(Q).length?Q:void 0}return this._map.get($)}has($){return this._map.has($)}}function Ev(){return new L5}var TI,M5,w5,e$;var K_=b(()=>{M5=Symbol("ZodOutput"),w5=Symbol("ZodInput");(TI=globalThis).__zod_globalRegistry??(TI.__zod_globalRegistry=Ev());e$=globalThis.__zod_globalRegistry});function k5($,_){return new $({type:"string",...P(_)})}function A5($,_){return new $({type:"string",coerce:!0,...P(_)})}function Pv($,_){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(_)})}function H_($,_){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(_)})}function xv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(_)})}function uv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(_)})}function yv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(_)})}function Cv($,_){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(_)})}function W_($,_){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(_)})}function fv($,_){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(_)})}function mv($,_){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(_)})}function gv($,_){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(_)})}function hv($,_){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(_)})}function cv($,_){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(_)})}function lv($,_){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(_)})}function dv($,_){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(_)})}function pv($,_){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(_)})}function iv($,_){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(_)})}function F5($,_){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(_)})}function nv($,_){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(_)})}function rv($,_){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(_)})}function ov($,_){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(_)})}function tv($,_){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(_)})}function av($,_){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(_)})}function sv($,_){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(_)})}function N5($,_){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(_)})}function S5($,_){return new $({type:"string",format:"date",check:"string_format",...P(_)})}function T5($,_){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(_)})}function R5($,_){return new $({type:"string",format:"duration",check:"string_format",...P(_)})}function E5($,_){return new $({type:"number",checks:[],...P(_)})}function P5($,_){return new $({type:"number",coerce:!0,checks:[],...P(_)})}function x5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(_)})}function u5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(_)})}function y5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(_)})}function C5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(_)})}function f5($,_){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(_)})}function m5($,_){return new $({type:"boolean",...P(_)})}function g5($,_){return new $({type:"boolean",coerce:!0,...P(_)})}function h5($,_){return new $({type:"bigint",...P(_)})}function c5($,_){return new $({type:"bigint",coerce:!0,...P(_)})}function l5($,_){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(_)})}function d5($,_){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(_)})}function p5($,_){return new $({type:"symbol",...P(_)})}function i5($,_){return new $({type:"undefined",...P(_)})}function n5($,_){return new $({type:"null",...P(_)})}function r5($){return new $({type:"any"})}function o5($){return new $({type:"unknown"})}function t5($,_){return new $({type:"never",...P(_)})}function a5($,_){return new $({type:"void",...P(_)})}function s5($,_){return new $({type:"date",...P(_)})}function e5($,_){return new $({type:"date",coerce:!0,...P(_)})}function $U($,_){return new $({type:"nan",...P(_)})}function v6($,_){return new Vv({check:"less_than",...P(_),value:$,inclusive:!1})}function L4($,_){return new Vv({check:"less_than",...P(_),value:$,inclusive:!0})}function U6($,_){return new Dv({check:"greater_than",...P(_),value:$,inclusive:!1})}function z4($,_){return new Dv({check:"greater_than",...P(_),value:$,inclusive:!0})}function ev($){return U6(0,$)}function $2($){return v6(0,$)}function _2($){return L4(0,$)}function v2($){return z4(0,$)}function x6($,_){return new r9({check:"multiple_of",...P(_),value:$})}function u6($,_){return new a9({check:"max_size",...P(_),maximum:$})}function Q6($,_){return new s9({check:"min_size",...P(_),minimum:$})}function v1($,_){return new e9({check:"size_equals",...P(_),size:$})}function U1($,_){return new $3({check:"max_length",...P(_),maximum:$})}function W6($,_){return new _3({check:"min_length",...P(_),minimum:$})}function Q1($,_){return new v3({check:"length_equals",...P(_),length:$})}function r1($,_){return new U3({check:"string_format",format:"regex",...P(_),pattern:$})}function o1($){return new Q3({check:"string_format",format:"lowercase",...P($)})}function t1($){return new J3({check:"string_format",format:"uppercase",...P($)})}function a1($,_){return new Y3({check:"string_format",format:"includes",...P(_),includes:$})}function s1($,_){return new z3({check:"string_format",format:"starts_with",...P(_),prefix:$})}function e1($,_){return new I3({check:"string_format",format:"ends_with",...P(_),suffix:$})}function U2($,_,U){return new X3({check:"property",property:$,schema:_,...P(U)})}function $0($,_){return new q3({check:"mime_type",mime:$,...P(_)})}function l4($){return new G3({check:"overwrite",tx:$})}function _0($){return l4((_)=>_.normalize($))}function v0(){return l4(($)=>$.trim())}function U0(){return l4(($)=>$.toLowerCase())}function Q0(){return l4(($)=>$.toUpperCase())}function J0(){return l4(($)=>z9($))}function _U($,_,U){return new $({type:"array",element:_,...P(U)})}function $Z($,_,U){return new $({type:"union",options:_,...P(U)})}function _Z($,_,U){return new $({type:"union",options:_,inclusive:!1,...P(U)})}function vZ($,_,U,Q){return new $({type:"union",options:U,discriminator:_,...P(Q)})}function UZ($,_,U){return new $({type:"intersection",left:_,right:U})}function QZ($,_,U,Q){let v=U instanceof e;return new $({type:"tuple",items:_,rest:v?U:null,...P(v?Q:U)})}function JZ($,_,U,Q){return new $({type:"record",keyType:_,valueType:U,...P(Q)})}function YZ($,_,U,Q){return new $({type:"map",keyType:_,valueType:U,...P(Q)})}function zZ($,_,U){return new $({type:"set",valueType:_,...P(U)})}function IZ($,_,U){let Q=Array.isArray(_)?Object.fromEntries(_.map((v)=>[v,v])):_;return new $({type:"enum",entries:Q,...P(U)})}function XZ($,_,U){return new $({type:"enum",entries:_,...P(U)})}function qZ($,_,U){return new $({type:"literal",values:Array.isArray(_)?_:[_],...P(U)})}function vU($,_){return new $({type:"file",...P(_)})}function GZ($,_){return new $({type:"transform",transform:_})}function jZ($,_){return new $({type:"optional",innerType:_})}function KZ($,_){return new $({type:"nullable",innerType:_})}function HZ($,_,U){return new $({type:"default",innerType:_,get defaultValue(){return typeof U==="function"?U():X9(U)}})}function WZ($,_,U){return new $({type:"nonoptional",innerType:_,...P(U)})}function bZ($,_){return new $({type:"success",innerType:_})}function BZ($,_,U){return new $({type:"catch",innerType:_,catchValue:typeof U==="function"?U:()=>U})}function ZZ($,_,U){return new $({type:"pipe",in:_,out:U})}function VZ($,_){return new $({type:"readonly",innerType:_})}function DZ($,_,U){return new $({type:"template_literal",parts:_,...P(U)})}function MZ($,_){return new $({type:"lazy",getter:_})}function wZ($,_){return new $({type:"promise",innerType:_})}function UU($,_,U){let Q=P(U);return Q.abort??(Q.abort=!0),new $({type:"custom",check:"custom",fn:_,...Q})}function QU($,_,U){return new $({type:"custom",check:"custom",fn:_,...P(U)})}function JU($){let _=RI((U)=>{return U.addIssue=(Q)=>{if(typeof Q==="string")U.issues.push(h1(Q,U.value,_._zod.def));else{let v=Q;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=U.value),v.inst??(v.inst=_),v.continue??(v.continue=!_._zod.def.abort),U.issues.push(h1(v))}},$(U.value,U)});return _}function RI($,_){let U=new T$({check:"custom",...P(_)});return U._zod.check=$,U}function YU($){let _=new T$({check:"describe"});return _._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,description:$})}],_._zod.check=()=>{},_}function zU($){let _=new T$({check:"meta"});return _._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,...$})}],_._zod.check=()=>{},_}function IU($,_){let U=P(_),Q=U.truthy??["true","1","yes","on","y","enabled"],v=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")Q=Q.map((H)=>typeof H==="string"?H.toLowerCase():H),v=v.map((H)=>typeof H==="string"?H.toLowerCase():H);let J=new Set(Q),Y=new Set(v),z=$.Codec??z_,I=$.Boolean??J_,q=new($.String??_1)({type:"string",error:U.error}),G=new I({type:"boolean",error:U.error}),j=new z({type:"pipe",in:q,out:G,transform:(H,Z)=>{let V=H;if(U.case!=="sensitive")V=V.toLowerCase();if(J.has(V))return!0;else if(Y.has(V))return!1;else return Z.issues.push({code:"invalid_value",expected:"stringbool",values:[...J,...Y],input:Z.value,inst:j,continue:!1}),{}},reverseTransform:(H,Z)=>{if(H===!0)return Q[0]||"true";else return v[0]||"false"},error:U.error});return j}function Y0($,_,U,Q={}){let v=P(Q),J={...P(Q),check:"string_format",type:"string",format:_,fn:typeof U==="function"?U:(z)=>U.test(z),...v};if(U instanceof RegExp)J.pattern=U;return new $(J)}var O5;var EI=b(()=>{Mv();K_();k7();l();O5={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function y6($){let _=$?.target??"draft-2020-12";if(_==="draft-4")_="draft-04";if(_==="draft-7")_="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??e$,target:_,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function M$($,_,U={path:[],schemaPath:[]}){var Q;let v=$._zod.def,J=_.seen.get($);if(J){if(J.count++,U.schemaPath.includes($))J.cycle=U.path;return J.schema}let Y={schema:{},count:1,cycle:void 0,path:U.path};_.seen.set($,Y);let z=$._zod.toJSONSchema?.();if(z)Y.schema=z;else{let q={...U,schemaPath:[...U.schemaPath,$],path:U.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(_,Y.schema,q);else{let j=Y.schema,H=_.processors[v.type];if(!H)throw Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);H($,_,j,q)}let G=$._zod.parent;if(G){if(!Y.ref)Y.ref=G;M$(G,_,q),_.seen.get(G).isParent=!0}}let I=_.metadataRegistry.get($);if(I)Object.assign(Y.schema,I);if(_.io==="input"&&I4($))delete Y.schema.examples,delete Y.schema.default;if(_.io==="input"&&Y.schema._prefault)(Q=Y.schema).default??(Q.default=Y.schema._prefault);return delete Y.schema._prefault,_.seen.get($).schema}function C6($,_){let U=$.seen.get(_);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Q=new Map;for(let Y of $.seen.entries()){let z=$.metadataRegistry.get(Y[0])?.id;if(z){let I=Q.get(z);if(I&&I!==Y[0])throw Error(`Duplicate schema id "${z}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Q.set(z,Y[0])}}let v=(Y)=>{let z=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let G=$.external.registry.get(Y[0])?.id,j=$.external.uri??((Z)=>Z);if(G)return{ref:j(G)};let H=Y[1].defId??Y[1].schema.id??`schema${$.counter++}`;return Y[1].defId=H,{defId:H,ref:`${j("__shared")}#/${z}/${H}`}}if(Y[1]===U)return{ref:"#"};let X=`${"#"}/${z}/`,q=Y[1].schema.id??`__schema${$.counter++}`;return{defId:q,ref:X+q}},J=(Y)=>{if(Y[1].schema.$ref)return;let z=Y[1],{ref:I,defId:X}=v(Y);if(z.def={...z.schema},X)z.defId=X;let q=z.schema;for(let G in q)delete q[G];q.$ref=I};if($.cycles==="throw")for(let Y of $.seen.entries()){let z=Y[1];if(z.cycle)throw Error(`Cycle detected: #/${z.cycle?.join("/")}/<root>
53
+ `)}M.write("payload.value = newResult;"),M.write("return payload;");let g=M.compile();return(N,x)=>g(Z,N,x)},X,H=V9,G=!c2.jitless,W=G&&E7.value,z=$.catchall,B;Q._zod.parse=(Z,M)=>{B??(B=q.value);let V=Z.value;if(!H(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:Q}),Z;if(G&&W&&M?.async===!1&&M.jitless!==!0){if(!X)X=J($.shape);if(Z=X(Z,M),!z)return Z;return Z$([],V,Z,M,B,Q)}return Y(Z,M)}});U$=j("$ZodUnion",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"optin",()=>$.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),U1(Q._zod,"optout",()=>$.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),U1(Q._zod,"values",()=>{if($.options.every((J)=>J._zod.values))return new Set($.options.flatMap((J)=>Array.from(J._zod.values)));return}),U1(Q._zod,"pattern",()=>{if($.options.every((J)=>J._zod.pattern)){let J=$.options.map((X)=>X._zod.pattern);return new RegExp(`^(${J.map((X)=>q2(X.source)).join("|")})$`)}return});let Y=$.options.length===1,q=$.options[0]._zod.run;Q._zod.parse=(J,X)=>{if(Y)return q(J,X);let H=!1,G=[];for(let K of $.options){let W=K._zod.run({value:J.value,issues:[]},X);if(W instanceof Promise)G.push(W),H=!0;else{if(W.issues.length===0)return W;G.push(W)}}if(!H)return SQ(G,J,Q,X);return Promise.all(G).then((K)=>{return SQ(K,J,Q,X)})}}),V$=j("$ZodIntersection",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y,q)=>{let J=Y.value,X=$.left._zod.run({value:J,issues:[]},q),H=$.right._zod.run({value:J,issues:[]},q);if(X instanceof Promise||H instanceof Promise)return Promise.all([X,H]).then(([K,W])=>{return EQ(Y,K,W)});return EQ(Y,X,H)}});A$=j("$ZodRecord",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y,q)=>{let J=Y.value;if(!w8(J))return Y.issues.push({expected:"record",code:"invalid_type",input:J,inst:Q}),Y;let X=[],H=$.keyType._zod.values;if(H){Y.value={};let G=new Set;for(let W of H)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){G.add(typeof W==="number"?W.toString():W);let z=$.valueType._zod.run({value:J[W],issues:[]},q);if(z instanceof Promise)X.push(z.then((B)=>{if(B.issues.length)Y.issues.push(...H8(W,B.issues));Y.value[W]=B.value}));else{if(z.issues.length)Y.issues.push(...H8(W,z.issues));Y.value[W]=z.value}}let K;for(let W in J)if(!G.has(W))K=K??[],K.push(W);if(K&&K.length>0)Y.issues.push({code:"unrecognized_keys",input:J,inst:Q,keys:K})}else{Y.value={};for(let G of Reflect.ownKeys(J)){if(G==="__proto__")continue;let K=$.keyType._zod.run({value:G,issues:[]},q);if(K instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof G==="string"&&r2.test(G)&&K.issues.length){let B=$.keyType._zod.run({value:Number(G),issues:[]},q);if(B instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(B.issues.length===0)K=B}if(K.issues.length){if($.mode==="loose")Y.value[G]=J[G];else Y.issues.push({code:"invalid_key",origin:"record",issues:K.issues.map((B)=>x0(B,q,O0())),input:G,path:[G],inst:Q});continue}let z=$.valueType._zod.run({value:J[G],issues:[]},q);if(z instanceof Promise)X.push(z.then((B)=>{if(B.issues.length)Y.issues.push(...H8(G,B.issues));Y.value[K.value]=B.value}));else{if(z.issues.length)Y.issues.push(...H8(G,z.issues));Y.value[K.value]=z.value}}}if(X.length)return Promise.all(X).then(()=>Y);return Y}}),L$=j("$ZodEnum",(Q,$)=>{T1.init(Q,$);let Y=Q2($.entries),q=new Set(Y);Q._zod.values=q,Q._zod.pattern=new RegExp(`^(${Y.filter((J)=>k7.has(typeof J)).map((J)=>typeof J==="string"?X8(J):J.toString()).join("|")})$`),Q._zod.parse=(J,X)=>{let H=J.value;if(q.has(H))return J;return J.issues.push({code:"invalid_value",values:Y,input:H,inst:Q}),J}}),F$=j("$ZodLiteral",(Q,$)=>{if(T1.init(Q,$),$.values.length===0)throw Error("Cannot create literal schema with no valid values");let Y=new Set($.values);Q._zod.values=Y,Q._zod.pattern=new RegExp(`^(${$.values.map((q)=>typeof q==="string"?X8(q):q?X8(q.toString()):String(q)).join("|")})$`),Q._zod.parse=(q,J)=>{let X=q.value;if(Y.has(X))return q;return q.issues.push({code:"invalid_value",values:$.values,input:X,inst:Q}),q}}),j$=j("$ZodTransform",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")throw new t9(Q.constructor.name);let J=$.transform(Y.value,Y);if(q.async)return(J instanceof Promise?J:Promise.resolve(J)).then((H)=>{return Y.value=H,Y});if(J instanceof Promise)throw new q8;return Y.value=J,Y}});i7=j("$ZodOptional",(Q,$)=>{T1.init(Q,$),Q._zod.optin="optional",Q._zod.optout="optional",U1(Q._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,void 0]):void 0}),U1(Q._zod,"pattern",()=>{let Y=$.innerType._zod.pattern;return Y?new RegExp(`^(${q2(Y.source)})?$`):void 0}),Q._zod.parse=(Y,q)=>{if($.innerType._zod.optin==="optional"){let J=$.innerType._zod.run(Y,q);if(J instanceof Promise)return J.then((X)=>kQ(X,Y.value));return kQ(J,Y.value)}if(Y.value===void 0)return Y;return $.innerType._zod.run(Y,q)}}),w$=j("$ZodExactOptional",(Q,$)=>{i7.init(Q,$),U1(Q._zod,"values",()=>$.innerType._zod.values),U1(Q._zod,"pattern",()=>$.innerType._zod.pattern),Q._zod.parse=(Y,q)=>{return $.innerType._zod.run(Y,q)}}),D$=j("$ZodNullable",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"optin",()=>$.innerType._zod.optin),U1(Q._zod,"optout",()=>$.innerType._zod.optout),U1(Q._zod,"pattern",()=>{let Y=$.innerType._zod.pattern;return Y?new RegExp(`^(${q2(Y.source)}|null)$`):void 0}),U1(Q._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,null]):void 0}),Q._zod.parse=(Y,q)=>{if(Y.value===null)return Y;return $.innerType._zod.run(Y,q)}}),O$=j("$ZodDefault",(Q,$)=>{T1.init(Q,$),Q._zod.optin="optional",U1(Q._zod,"values",()=>$.innerType._zod.values),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")return $.innerType._zod.run(Y,q);if(Y.value===void 0)return Y.value=$.defaultValue,Y;let J=$.innerType._zod.run(Y,q);if(J instanceof Promise)return J.then((X)=>vQ(X,$));return vQ(J,$)}});I$=j("$ZodPrefault",(Q,$)=>{T1.init(Q,$),Q._zod.optin="optional",U1(Q._zod,"values",()=>$.innerType._zod.values),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")return $.innerType._zod.run(Y,q);if(Y.value===void 0)Y.value=$.defaultValue;return $.innerType._zod.run(Y,q)}}),N$=j("$ZodNonOptional",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"values",()=>{let Y=$.innerType._zod.values;return Y?new Set([...Y].filter((q)=>q!==void 0)):void 0}),Q._zod.parse=(Y,q)=>{let J=$.innerType._zod.run(Y,q);if(J instanceof Promise)return J.then((X)=>PQ(X,Q));return PQ(J,Q)}});T$=j("$ZodCatch",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"optin",()=>$.innerType._zod.optin),U1(Q._zod,"optout",()=>$.innerType._zod.optout),U1(Q._zod,"values",()=>$.innerType._zod.values),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")return $.innerType._zod.run(Y,q);let J=$.innerType._zod.run(Y,q);if(J instanceof Promise)return J.then((X)=>{if(Y.value=X.value,X.issues.length)Y.value=$.catchValue({...Y,error:{issues:X.issues.map((H)=>x0(H,q,O0()))},input:Y.value}),Y.issues=[];return Y});if(Y.value=J.value,J.issues.length)Y.value=$.catchValue({...Y,error:{issues:J.issues.map((X)=>x0(X,q,O0()))},input:Y.value}),Y.issues=[];return Y}}),b$=j("$ZodPipe",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"values",()=>$.in._zod.values),U1(Q._zod,"optin",()=>$.in._zod.optin),U1(Q._zod,"optout",()=>$.out._zod.optout),U1(Q._zod,"propValues",()=>$.in._zod.propValues),Q._zod.parse=(Y,q)=>{if(q.direction==="backward"){let X=$.out._zod.run(Y,q);if(X instanceof Promise)return X.then((H)=>Q3(H,$.in,q));return Q3(X,$.in,q)}let J=$.in._zod.run(Y,q);if(J instanceof Promise)return J.then((X)=>Q3(X,$.out,q));return Q3(J,$.out,q)}});R$=j("$ZodReadonly",(Q,$)=>{T1.init(Q,$),U1(Q._zod,"propValues",()=>$.innerType._zod.propValues),U1(Q._zod,"values",()=>$.innerType._zod.values),U1(Q._zod,"optin",()=>$.innerType?._zod?.optin),U1(Q._zod,"optout",()=>$.innerType?._zod?.optout),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")return $.innerType._zod.run(Y,q);let J=$.innerType._zod.run(Y,q);if(J instanceof Promise)return J.then(xQ);return xQ(J)}});S$=j("$ZodCustom",(Q,$)=>{s1.init(Q,$),T1.init(Q,$),Q._zod.parse=(Y,q)=>{return Y},Q._zod.check=(Y)=>{let q=Y.value,J=$.fn(q);if(J instanceof Promise)return J.then((X)=>CQ(X,Y,q,Q));CQ(J,Y,q,Q);return}})});function n7(){return{localeError:nW()}}var nW=()=>{let Q={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function $(J){return Q[J]??null}let Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},q={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let X=q[J.expected]??J.expected,H=x7(J.input),G=q[H]??H;return`Invalid input: expected ${X}, received ${G}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${i2(J.values[0])}`;return`Invalid option: expected one of ${d2(J.values,"|")}`;case"too_big":{let X=J.inclusive?"<=":"<",H=$(J.origin);if(H)return`Too big: expected ${J.origin??"value"} to have ${X}${J.maximum.toString()} ${H.unit??"elements"}`;return`Too big: expected ${J.origin??"value"} to be ${X}${J.maximum.toString()}`}case"too_small":{let X=J.inclusive?">=":">",H=$(J.origin);if(H)return`Too small: expected ${J.origin} to have ${X}${J.minimum.toString()} ${H.unit}`;return`Too small: expected ${J.origin} to be ${X}${J.minimum.toString()}`}case"invalid_format":{let X=J;if(X.format==="starts_with")return`Invalid string: must start with "${X.prefix}"`;if(X.format==="ends_with")return`Invalid string: must end with "${X.suffix}"`;if(X.format==="includes")return`Invalid string: must include "${X.includes}"`;if(X.format==="regex")return`Invalid string: must match pattern ${X.pattern}`;return`Invalid ${Y[X.format]??J.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${J.divisor}`;case"unrecognized_keys":return`Unrecognized key${J.keys.length>1?"s":""}: ${d2(J.keys,", ")}`;case"invalid_key":return`Invalid key in ${J.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${J.origin}`;default:return"Invalid input"}}};var k$=A(()=>{C0()});var o7=()=>{};class x${constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...$){let Y=$[0];if(this._map.set(Q,Y),Y&&typeof Y==="object"&&"id"in Y)this._idmap.set(Y.id,Q);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let $=this._map.get(Q);if($&&typeof $==="object"&&"id"in $)this._idmap.delete($.id);return this._map.delete(Q),this}get(Q){let $=Q._zod.parent;if($){let Y={...this.get($)??{}};delete Y.id;let q={...Y,...this._map.get(Q)};return Object.keys(q).length?q:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function oW(){return new x$}var P$,NF,TF,f8;var s7=A(()=>{NF=Symbol("ZodOutput"),TF=Symbol("ZodInput");(P$=globalThis).__zod_globalRegistry??(P$.__zod_globalRegistry=oW());f8=globalThis.__zod_globalRegistry});function C$(Q,$){return new Q({type:"string",...c($)})}function y$(Q,$){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...c($)})}function r7(Q,$){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...c($)})}function h$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...c($)})}function f$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...c($)})}function u$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...c($)})}function m$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...c($)})}function g$(Q,$){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...c($)})}function c$(Q,$){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...c($)})}function d$(Q,$){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...c($)})}function p$(Q,$){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...c($)})}function l$(Q,$){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...c($)})}function i$(Q,$){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...c($)})}function n$(Q,$){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...c($)})}function o$(Q,$){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...c($)})}function s$(Q,$){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...c($)})}function r$(Q,$){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...c($)})}function a$(Q,$){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...c($)})}function t$(Q,$){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...c($)})}function e$(Q,$){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...c($)})}function QY(Q,$){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...c($)})}function $Y(Q,$){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...c($)})}function YY(Q,$){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...c($)})}function qY(Q,$){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...c($)})}function JY(Q,$){return new Q({type:"string",format:"date",check:"string_format",...c($)})}function XY(Q,$){return new Q({type:"string",format:"time",check:"string_format",precision:null,...c($)})}function HY(Q,$){return new Q({type:"string",format:"duration",check:"string_format",...c($)})}function GY(Q,$){return new Q({type:"number",checks:[],...c($)})}function KY(Q,$){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...c($)})}function WY(Q,$){return new Q({type:"boolean",...c($)})}function zY(Q){return new Q({type:"any"})}function BY(Q){return new Q({type:"unknown"})}function _Y(Q,$){return new Q({type:"never",...c($)})}function q3(Q,$){return new m7({check:"less_than",...c($),value:Q,inclusive:!1})}function K2(Q,$){return new m7({check:"less_than",...c($),value:Q,inclusive:!0})}function J3(Q,$){return new g7({check:"greater_than",...c($),value:Q,inclusive:!1})}function W2(Q,$){return new g7({check:"greater_than",...c($),value:Q,inclusive:!0})}function X3(Q,$){return new MQ({check:"multiple_of",...c($),value:Q})}function H3(Q,$){return new VQ({check:"max_length",...c($),maximum:Q})}function F9(Q,$){return new AQ({check:"min_length",...c($),minimum:Q})}function G3(Q,$){return new LQ({check:"length_equals",...c($),length:Q})}function a7(Q,$){return new FQ({check:"string_format",format:"regex",...c($),pattern:Q})}function t7(Q){return new jQ({check:"string_format",format:"lowercase",...c(Q)})}function e7(Q){return new wQ({check:"string_format",format:"uppercase",...c(Q)})}function Q4(Q,$){return new DQ({check:"string_format",format:"includes",...c($),includes:Q})}function $4(Q,$){return new OQ({check:"string_format",format:"starts_with",...c($),prefix:Q})}function Y4(Q,$){return new IQ({check:"string_format",format:"ends_with",...c($),suffix:Q})}function O8(Q){return new NQ({check:"overwrite",tx:Q})}function q4(Q){return O8(($)=>$.normalize(Q))}function J4(){return O8((Q)=>Q.trim())}function X4(){return O8((Q)=>Q.toLowerCase())}function H4(){return O8((Q)=>Q.toUpperCase())}function G4(){return O8((Q)=>S7(Q))}function ZY(Q,$,Y){return new Q({type:"array",element:$,...c(Y)})}function MY(Q,$,Y){return new Q({type:"custom",check:"custom",fn:$,...c(Y)})}function UY(Q){let $=sW((Y)=>{return Y.addIssue=(q)=>{if(typeof q==="string")Y.issues.push(L9(q,Y.value,$._zod.def));else{let J=q;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=Y.value),J.inst??(J.inst=$),J.continue??(J.continue=!$._zod.def.abort),Y.issues.push(L9(J))}},Q(Y.value,Y)});return $}function sW(Q,$){let Y=new s1({check:"custom",...c($)});return Y._zod.check=Q,Y}var VY=A(()=>{e2();C0()});function K4(Q){let $=Q?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";return{processors:Q.processors??{},metadataRegistry:Q?.metadata??f8,target:$,unrepresentable:Q?.unrepresentable??"throw",override:Q?.override??(()=>{}),io:Q?.io??"output",counter:0,seen:new Map,cycles:Q?.cycles??"ref",reused:Q?.reused??"inline",external:Q?.external??void 0}}function m1(Q,$,Y={path:[],schemaPath:[]}){var q;let J=Q._zod.def,X=$.seen.get(Q);if(X){if(X.count++,Y.schemaPath.includes(Q))X.cycle=Y.path;return X.schema}let H={schema:{},count:1,cycle:void 0,path:Y.path};$.seen.set(Q,H);let G=Q._zod.toJSONSchema?.();if(G)H.schema=G;else{let z={...Y,schemaPath:[...Y.schemaPath,Q],path:Y.path};if(Q._zod.processJSONSchema)Q._zod.processJSONSchema($,H.schema,z);else{let Z=H.schema,M=$.processors[J.type];if(!M)throw Error(`[toJSONSchema]: Non-representable type encountered: ${J.type}`);M(Q,$,Z,z)}let B=Q._zod.parent;if(B){if(!H.ref)H.ref=B;m1(B,$,z),$.seen.get(B).isParent=!0}}let K=$.metadataRegistry.get(Q);if(K)Object.assign(H.schema,K);if($.io==="input"&&Y0(Q))delete H.schema.examples,delete H.schema.default;if($.io==="input"&&H.schema._prefault)(q=H.schema).default??(q.default=H.schema._prefault);return delete H.schema._prefault,$.seen.get(Q).schema}function W4(Q,$){let Y=Q.seen.get($);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let q=new Map;for(let H of Q.seen.entries()){let G=Q.metadataRegistry.get(H[0])?.id;if(G){let K=q.get(G);if(K&&K!==H[0])throw Error(`Duplicate schema id "${G}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);q.set(G,H[0])}}let J=(H)=>{let G=Q.target==="draft-2020-12"?"$defs":"definitions";if(Q.external){let B=Q.external.registry.get(H[0])?.id,Z=Q.external.uri??((V)=>V);if(B)return{ref:Z(B)};let M=H[1].defId??H[1].schema.id??`schema${Q.counter++}`;return H[1].defId=M,{defId:M,ref:`${Z("__shared")}#/${G}/${M}`}}if(H[1]===Y)return{ref:"#"};let W=`${"#"}/${G}/`,z=H[1].schema.id??`__schema${Q.counter++}`;return{defId:z,ref:W+z}},X=(H)=>{if(H[1].schema.$ref)return;let G=H[1],{ref:K,defId:W}=J(H);if(G.def={...G.schema},W)G.defId=W;let z=G.schema;for(let B in z)delete z[B];z.$ref=K};if(Q.cycles==="throw")for(let H of Q.seen.entries()){let G=H[1];if(G.cycle)throw Error(`Cycle detected: #/${G.cycle?.join("/")}/<root>
55
54
 
56
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Y of $.seen.entries()){let z=Y[1];if(_===Y[0]){J(Y);continue}if($.external){let X=$.external.registry.get(Y[0])?.id;if(_!==Y[0]&&X){J(Y);continue}}if($.metadataRegistry.get(Y[0])?.id){J(Y);continue}if(z.cycle){J(Y);continue}if(z.count>1){if($.reused==="ref"){J(Y);continue}}}}function f6($,_){let U=$.seen.get(_);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Q=(Y)=>{let z=$.seen.get(Y);if(z.ref===null)return;let I=z.def??z.schema,X={...I},q=z.ref;if(z.ref=null,q){Q(q);let j=$.seen.get(q),H=j.schema;if(H.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))I.allOf=I.allOf??[],I.allOf.push(H);else Object.assign(I,H);if(Object.assign(I,X),Y._zod.parent===q)for(let V in I){if(V==="$ref"||V==="allOf")continue;if(!(V in X))delete I[V]}if(H.$ref&&j.def)for(let V in I){if(V==="$ref"||V==="allOf")continue;if(V in j.def&&JSON.stringify(I[V])===JSON.stringify(j.def[V]))delete I[V]}}let G=Y._zod.parent;if(G&&G!==q){Q(G);let j=$.seen.get(G);if(j?.schema.$ref){if(I.$ref=j.schema.$ref,j.def)for(let H in I){if(H==="$ref"||H==="allOf")continue;if(H in j.def&&JSON.stringify(I[H])===JSON.stringify(j.def[H]))delete I[H]}}}$.override({zodSchema:Y,jsonSchema:I,path:z.path??[]})};for(let Y of[...$.seen.entries()].reverse())Q(Y[0]);let v={};if($.target==="draft-2020-12")v.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")v.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")v.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Y=$.external.registry.get(_)?.id;if(!Y)throw Error("Schema is missing an `id` property");v.$id=$.external.uri(Y)}Object.assign(v,U.def??U.schema);let J=$.external?.defs??{};for(let Y of $.seen.entries()){let z=Y[1];if(z.def&&z.defId)J[z.defId]=z.def}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")v.$defs=J;else v.definitions=J;try{let Y=JSON.parse(JSON.stringify(v));return Object.defineProperty(Y,"~standard",{value:{..._["~standard"],jsonSchema:{input:z0(_,"input",$.processors),output:z0(_,"output",$.processors)}},enumerable:!1,writable:!1}),Y}catch(Y){throw Error("Error converting schema to JSON.")}}function I4($,_){let U=_??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let Q=$._zod.def;if(Q.type==="transform")return!0;if(Q.type==="array")return I4(Q.element,U);if(Q.type==="set")return I4(Q.valueType,U);if(Q.type==="lazy")return I4(Q.getter(),U);if(Q.type==="promise"||Q.type==="optional"||Q.type==="nonoptional"||Q.type==="nullable"||Q.type==="readonly"||Q.type==="default"||Q.type==="prefault")return I4(Q.innerType,U);if(Q.type==="intersection")return I4(Q.left,U)||I4(Q.right,U);if(Q.type==="record"||Q.type==="map")return I4(Q.keyType,U)||I4(Q.valueType,U);if(Q.type==="pipe")return I4(Q.in,U)||I4(Q.out,U);if(Q.type==="object"){for(let v in Q.shape)if(I4(Q.shape[v],U))return!0;return!1}if(Q.type==="union"){for(let v of Q.options)if(I4(v,U))return!0;return!1}if(Q.type==="tuple"){for(let v of Q.items)if(I4(v,U))return!0;if(Q.rest&&I4(Q.rest,U))return!0;return!1}return!1}var XU=($,_={})=>(U)=>{let Q=y6({...U,processors:_});return M$($,Q),C6(Q,$),f6(Q,$)},z0=($,_,U={})=>(Q)=>{let{libraryOptions:v,target:J}=Q??{},Y=y6({...v??{},target:J,io:_,processors:U});return M$($,Y),C6(Y,$),f6(Y,$)};var b_=b(()=>{K_()});function z2($,_){if("_idmap"in $){let Q=$,v=y6({..._,processors:Q2}),J={};for(let I of Q._idmap.entries()){let[X,q]=I;M$(q,v)}let Y={},z={registry:Q,uri:_?.uri,defs:J};v.external=z;for(let I of Q._idmap.entries()){let[X,q]=I;C6(v,q),Y[X]=f6(v,q)}if(Object.keys(J).length>0){let I=v.target==="draft-2020-12"?"$defs":"definitions";Y.__shared={[I]:J}}return{schemas:Y}}let U=y6({..._,processors:Q2});return M$($,U),C6(U,$),f6(U,$)}var LZ,qU=($,_,U,Q)=>{let v=U;v.type="string";let{minimum:J,maximum:Y,format:z,patterns:I,contentEncoding:X}=$._zod.bag;if(typeof J==="number")v.minLength=J;if(typeof Y==="number")v.maxLength=Y;if(z){if(v.format=LZ[z]??z,v.format==="")delete v.format;if(z==="time")delete v.format}if(X)v.contentEncoding=X;if(I&&I.size>0){let q=[...I];if(q.length===1)v.pattern=q[0].source;else if(q.length>1)v.allOf=[...q.map((G)=>({..._.target==="draft-07"||_.target==="draft-04"||_.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},GU=($,_,U,Q)=>{let v=U,{minimum:J,maximum:Y,format:z,multipleOf:I,exclusiveMaximum:X,exclusiveMinimum:q}=$._zod.bag;if(typeof z==="string"&&z.includes("int"))v.type="integer";else v.type="number";if(typeof q==="number")if(_.target==="draft-04"||_.target==="openapi-3.0")v.minimum=q,v.exclusiveMinimum=!0;else v.exclusiveMinimum=q;if(typeof J==="number"){if(v.minimum=J,typeof q==="number"&&_.target!=="draft-04")if(q>=J)delete v.minimum;else delete v.exclusiveMinimum}if(typeof X==="number")if(_.target==="draft-04"||_.target==="openapi-3.0")v.maximum=X,v.exclusiveMaximum=!0;else v.exclusiveMaximum=X;if(typeof Y==="number"){if(v.maximum=Y,typeof X==="number"&&_.target!=="draft-04")if(X<=Y)delete v.maximum;else delete v.exclusiveMaximum}if(typeof I==="number")v.multipleOf=I},jU=($,_,U,Q)=>{U.type="boolean"},KU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},HU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},WU=($,_,U,Q)=>{if(_.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},bU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},BU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},ZU=($,_,U,Q)=>{U.not={}},VU=($,_,U,Q)=>{},DU=($,_,U,Q)=>{},MU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},wU=($,_,U,Q)=>{let v=$._zod.def,J=r0(v.entries);if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";U.enum=J},LU=($,_,U,Q)=>{let v=$._zod.def,J=[];for(let Y of v.values)if(Y===void 0){if(_.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Y==="bigint")if(_.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else J.push(Number(Y));else J.push(Y);if(J.length===0);else if(J.length===1){let Y=J[0];if(U.type=Y===null?"null":typeof Y,_.target==="draft-04"||_.target==="openapi-3.0")U.enum=[Y];else U.const=Y}else{if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";if(J.every((Y)=>typeof Y==="boolean"))U.type="boolean";if(J.every((Y)=>Y===null))U.type="null";U.enum=J}},kU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},AU=($,_,U,Q)=>{let v=U,J=$._zod.pattern;if(!J)throw Error("Pattern not found in template literal");v.type="string",v.pattern=J.source},FU=($,_,U,Q)=>{let v=U,J={type:"string",format:"binary",contentEncoding:"binary"},{minimum:Y,maximum:z,mime:I}=$._zod.bag;if(Y!==void 0)J.minLength=Y;if(z!==void 0)J.maxLength=z;if(I)if(I.length===1)J.contentMediaType=I[0],Object.assign(v,J);else Object.assign(v,J),v.anyOf=I.map((X)=>({contentMediaType:X}));else Object.assign(v,J)},OU=($,_,U,Q)=>{U.type="boolean"},NU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},SU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},TU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},RU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},EU=($,_,U,Q)=>{if(_.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},PU=($,_,U,Q)=>{let v=U,J=$._zod.def,{minimum:Y,maximum:z}=$._zod.bag;if(typeof Y==="number")v.minItems=Y;if(typeof z==="number")v.maxItems=z;v.type="array",v.items=M$(J.element,_,{...Q,path:[...Q.path,"items"]})},xU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="object",v.properties={};let Y=J.shape;for(let X in Y)v.properties[X]=M$(Y[X],_,{...Q,path:[...Q.path,"properties",X]});let z=new Set(Object.keys(Y)),I=new Set([...z].filter((X)=>{let q=J.shape[X]._zod;if(_.io==="input")return q.optin===void 0;else return q.optout===void 0}));if(I.size>0)v.required=Array.from(I);if(J.catchall?._zod.def.type==="never")v.additionalProperties=!1;else if(!J.catchall){if(_.io==="output")v.additionalProperties=!1}else if(J.catchall)v.additionalProperties=M$(J.catchall,_,{...Q,path:[...Q.path,"additionalProperties"]})},J2=($,_,U,Q)=>{let v=$._zod.def,J=v.inclusive===!1,Y=v.options.map((z,I)=>M$(z,_,{...Q,path:[...Q.path,J?"oneOf":"anyOf",I]}));if(J)U.oneOf=Y;else U.anyOf=Y},uU=($,_,U,Q)=>{let v=$._zod.def,J=M$(v.left,_,{...Q,path:[...Q.path,"allOf",0]}),Y=M$(v.right,_,{...Q,path:[...Q.path,"allOf",1]}),z=(X)=>("allOf"in X)&&Object.keys(X).length===1,I=[...z(J)?J.allOf:[J],...z(Y)?Y.allOf:[Y]];U.allOf=I},yU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="array";let Y=_.target==="draft-2020-12"?"prefixItems":"items",z=_.target==="draft-2020-12"?"items":_.target==="openapi-3.0"?"items":"additionalItems",I=J.items.map((j,H)=>M$(j,_,{...Q,path:[...Q.path,Y,H]})),X=J.rest?M$(J.rest,_,{...Q,path:[...Q.path,z,..._.target==="openapi-3.0"?[J.items.length]:[]]}):null;if(_.target==="draft-2020-12"){if(v.prefixItems=I,X)v.items=X}else if(_.target==="openapi-3.0"){if(v.items={anyOf:I},X)v.items.anyOf.push(X);if(v.minItems=I.length,!X)v.maxItems=I.length}else if(v.items=I,X)v.additionalItems=X;let{minimum:q,maximum:G}=$._zod.bag;if(typeof q==="number")v.minItems=q;if(typeof G==="number")v.maxItems=G},CU=($,_,U,Q)=>{let v=U,J=$._zod.def;v.type="object";let Y=J.keyType,I=Y._zod.bag?.patterns;if(J.mode==="loose"&&I&&I.size>0){let q=M$(J.valueType,_,{...Q,path:[...Q.path,"patternProperties","*"]});v.patternProperties={};for(let G of I)v.patternProperties[G.source]=q}else{if(_.target==="draft-07"||_.target==="draft-2020-12")v.propertyNames=M$(J.keyType,_,{...Q,path:[...Q.path,"propertyNames"]});v.additionalProperties=M$(J.valueType,_,{...Q,path:[...Q.path,"additionalProperties"]})}let X=Y._zod.values;if(X){let q=[...X].filter((G)=>typeof G==="string"||typeof G==="number");if(q.length>0)v.required=q}},fU=($,_,U,Q)=>{let v=$._zod.def,J=M$(v.innerType,_,Q),Y=_.seen.get($);if(_.target==="openapi-3.0")Y.ref=v.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},mU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},gU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType,U.default=JSON.parse(JSON.stringify(v.defaultValue))},hU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);if(J.ref=v.innerType,_.io==="input")U._prefault=JSON.parse(JSON.stringify(v.defaultValue))},cU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType;let Y;try{Y=v.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=Y},lU=($,_,U,Q)=>{let v=$._zod.def,J=_.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;M$(J,_,Q);let Y=_.seen.get($);Y.ref=J},dU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType,U.readOnly=!0},pU=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},Y2=($,_,U,Q)=>{let v=$._zod.def;M$(v.innerType,_,Q);let J=_.seen.get($);J.ref=v.innerType},iU=($,_,U,Q)=>{let v=$._zod.innerType;M$(v,_,Q);let J=_.seen.get($);J.ref=v},Q2;var B_=b(()=>{b_();l();LZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Q2={string:qU,number:GU,boolean:jU,bigint:KU,symbol:HU,null:WU,undefined:bU,void:BU,never:ZU,any:VU,unknown:DU,date:MU,enum:wU,literal:LU,nan:kU,template_literal:AU,file:FU,success:OU,custom:NU,function:SU,transform:TU,map:RU,set:EU,array:PU,object:xU,union:J2,intersection:uU,tuple:yU,record:CU,nullable:fU,nonoptional:mU,default:gU,prefault:hU,catch:cU,pipe:lU,readonly:dU,promise:pU,optional:Y2,lazy:iU}});class nU{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let _=$?.target??"draft-2020-12";if(_==="draft-4")_="draft-04";if(_==="draft-7")_="draft-07";this.ctx=y6({processors:Q2,target:_,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,_={path:[],schemaPath:[]}){return M$($,this.ctx,_)}emit($,_){if(_){if(_.cycles)this.ctx.cycles=_.cycles;if(_.reused)this.ctx.reused=_.reused;if(_.external)this.ctx.external=_.external}C6(this.ctx,$);let U=f6(this.ctx,$),{"~standard":Q,...v}=U;return v}}var PI=b(()=>{B_();b_()});var xI={};var uI=()=>{};var b6={};s$(b6,{version:()=>j3,util:()=>E,treeifyError:()=>H9,toJSONSchema:()=>z2,toDotPath:()=>Gz,safeParseAsync:()=>Z9,safeParse:()=>B9,safeEncodeAsync:()=>Tb,safeEncode:()=>Nb,safeDecodeAsync:()=>Rb,safeDecode:()=>Sb,registry:()=>Ev,regexes:()=>E4,process:()=>M$,prettifyError:()=>W9,parseAsync:()=>Iv,parse:()=>zv,meta:()=>zU,locales:()=>j_,isValidJWT:()=>Tz,isValidBase64URL:()=>Sz,isValidBase64:()=>u3,initializeContext:()=>y6,globalRegistry:()=>e$,globalConfig:()=>i0,formatError:()=>__,flattenError:()=>$_,finalize:()=>f6,extractDefs:()=>C6,encodeAsync:()=>Fb,encode:()=>kb,describe:()=>YU,decodeAsync:()=>Ob,decode:()=>Ab,createToJSONSchemaMethod:()=>XU,createStandardJSONSchemaMethod:()=>z0,config:()=>l$,clone:()=>Y4,_xor:()=>_Z,_xid:()=>lv,_void:()=>a5,_uuidv7:()=>Cv,_uuidv6:()=>yv,_uuidv4:()=>uv,_uuid:()=>xv,_url:()=>W_,_uppercase:()=>t1,_unknown:()=>o5,_union:()=>$Z,_undefined:()=>i5,_ulid:()=>cv,_uint64:()=>d5,_uint32:()=>f5,_tuple:()=>QZ,_trim:()=>v0,_transform:()=>GZ,_toUpperCase:()=>Q0,_toLowerCase:()=>U0,_templateLiteral:()=>DZ,_symbol:()=>p5,_superRefine:()=>JU,_success:()=>bZ,_stringbool:()=>IU,_stringFormat:()=>Y0,_string:()=>k5,_startsWith:()=>s1,_slugify:()=>J0,_size:()=>v1,_set:()=>zZ,_safeParseAsync:()=>p1,_safeParse:()=>d1,_safeEncodeAsync:()=>Wv,_safeEncode:()=>Kv,_safeDecodeAsync:()=>bv,_safeDecode:()=>Hv,_regex:()=>r1,_refine:()=>QU,_record:()=>JZ,_readonly:()=>VZ,_property:()=>U2,_promise:()=>wZ,_positive:()=>ev,_pipe:()=>ZZ,_parseAsync:()=>l1,_parse:()=>c1,_overwrite:()=>l4,_optional:()=>jZ,_number:()=>E5,_nullable:()=>KZ,_null:()=>n5,_normalize:()=>_0,_nonpositive:()=>_2,_nonoptional:()=>WZ,_nonnegative:()=>v2,_never:()=>t5,_negative:()=>$2,_nativeEnum:()=>XZ,_nanoid:()=>mv,_nan:()=>$U,_multipleOf:()=>x6,_minSize:()=>Q6,_minLength:()=>W6,_min:()=>z4,_mime:()=>$0,_maxSize:()=>u6,_maxLength:()=>U1,_max:()=>L4,_map:()=>YZ,_mac:()=>F5,_lte:()=>L4,_lt:()=>v6,_lowercase:()=>o1,_literal:()=>qZ,_length:()=>Q1,_lazy:()=>MZ,_ksuid:()=>dv,_jwt:()=>sv,_isoTime:()=>T5,_isoDuration:()=>R5,_isoDateTime:()=>N5,_isoDate:()=>S5,_ipv6:()=>iv,_ipv4:()=>pv,_intersection:()=>UZ,_int64:()=>l5,_int32:()=>C5,_int:()=>x5,_includes:()=>a1,_guid:()=>H_,_gte:()=>z4,_gt:()=>U6,_float64:()=>y5,_float32:()=>u5,_file:()=>vU,_enum:()=>IZ,_endsWith:()=>e1,_encodeAsync:()=>Gv,_encode:()=>Xv,_emoji:()=>fv,_email:()=>Pv,_e164:()=>av,_discriminatedUnion:()=>vZ,_default:()=>HZ,_decodeAsync:()=>jv,_decode:()=>qv,_date:()=>s5,_custom:()=>UU,_cuid2:()=>hv,_cuid:()=>gv,_coercedString:()=>A5,_coercedNumber:()=>P5,_coercedDate:()=>e5,_coercedBoolean:()=>g5,_coercedBigint:()=>c5,_cidrv6:()=>rv,_cidrv4:()=>nv,_check:()=>RI,_catch:()=>BZ,_boolean:()=>m5,_bigint:()=>h5,_base64url:()=>tv,_base64:()=>ov,_array:()=>_U,_any:()=>r5,TimePrecision:()=>O5,NEVER:()=>U9,JSONSchemaGenerator:()=>nU,JSONSchema:()=>xI,Doc:()=>wv,$output:()=>M5,$input:()=>w5,$constructor:()=>B,$brand:()=>Q9,$ZodXor:()=>e3,$ZodXID:()=>k3,$ZodVoid:()=>o3,$ZodUnknown:()=>n3,$ZodUnion:()=>Y_,$ZodUndefined:()=>d3,$ZodUUID:()=>b3,$ZodURL:()=>Z3,$ZodULID:()=>L3,$ZodType:()=>e,$ZodTuple:()=>Tv,$ZodTransform:()=>I7,$ZodTemplateLiteral:()=>V7,$ZodSymbol:()=>l3,$ZodSuccess:()=>H7,$ZodStringFormat:()=>A$,$ZodString:()=>_1,$ZodSet:()=>Q7,$ZodRegistry:()=>L5,$ZodRecord:()=>v7,$ZodRealError:()=>W4,$ZodReadonly:()=>Z7,$ZodPromise:()=>M7,$ZodPrefault:()=>j7,$ZodPipe:()=>B7,$ZodOptional:()=>Rv,$ZodObjectJIT:()=>s3,$ZodObject:()=>Pz,$ZodNumberFormat:()=>h3,$ZodNumber:()=>Nv,$ZodNullable:()=>q7,$ZodNull:()=>p3,$ZodNonOptional:()=>K7,$ZodNever:()=>r3,$ZodNanoID:()=>D3,$ZodNaN:()=>b7,$ZodMap:()=>U7,$ZodMAC:()=>E3,$ZodLiteral:()=>Y7,$ZodLazy:()=>w7,$ZodKSUID:()=>A3,$ZodJWT:()=>m3,$ZodIntersection:()=>_7,$ZodISOTime:()=>N3,$ZodISODuration:()=>S3,$ZodISODateTime:()=>F3,$ZodISODate:()=>O3,$ZodIPv6:()=>R3,$ZodIPv4:()=>T3,$ZodGUID:()=>W3,$ZodFunction:()=>D7,$ZodFile:()=>z7,$ZodExactOptional:()=>X7,$ZodError:()=>e0,$ZodEnum:()=>J7,$ZodEncodeError:()=>s6,$ZodEmoji:()=>V3,$ZodEmail:()=>B3,$ZodE164:()=>f3,$ZodDiscriminatedUnion:()=>$7,$ZodDefault:()=>G7,$ZodDate:()=>t3,$ZodCustomStringFormat:()=>g3,$ZodCustom:()=>L7,$ZodCodec:()=>z_,$ZodCheckUpperCase:()=>J3,$ZodCheckStringFormat:()=>i1,$ZodCheckStartsWith:()=>z3,$ZodCheckSizeEquals:()=>e9,$ZodCheckRegex:()=>U3,$ZodCheckProperty:()=>X3,$ZodCheckOverwrite:()=>G3,$ZodCheckNumberFormat:()=>o9,$ZodCheckMultipleOf:()=>r9,$ZodCheckMinSize:()=>s9,$ZodCheckMinLength:()=>_3,$ZodCheckMimeType:()=>q3,$ZodCheckMaxSize:()=>a9,$ZodCheckMaxLength:()=>$3,$ZodCheckLowerCase:()=>Q3,$ZodCheckLessThan:()=>Vv,$ZodCheckLengthEquals:()=>v3,$ZodCheckIncludes:()=>Y3,$ZodCheckGreaterThan:()=>Dv,$ZodCheckEndsWith:()=>I3,$ZodCheckBigIntFormat:()=>t9,$ZodCheck:()=>T$,$ZodCatch:()=>W7,$ZodCUID2:()=>w3,$ZodCUID:()=>M3,$ZodCIDRv6:()=>x3,$ZodCIDRv4:()=>P3,$ZodBoolean:()=>J_,$ZodBigIntFormat:()=>c3,$ZodBigInt:()=>Sv,$ZodBase64URL:()=>C3,$ZodBase64:()=>y3,$ZodAsyncError:()=>_6,$ZodArray:()=>a3,$ZodAny:()=>i3});var k4=b(()=>{l();Zv();D5();B_();PI();uI();f1();V9();b9();k7();Mv();K3();K_();EI();b_()});var I2={};s$(I2,{uppercase:()=>t1,trim:()=>v0,toUpperCase:()=>Q0,toLowerCase:()=>U0,startsWith:()=>s1,slugify:()=>J0,size:()=>v1,regex:()=>r1,property:()=>U2,positive:()=>ev,overwrite:()=>l4,normalize:()=>_0,nonpositive:()=>_2,nonnegative:()=>v2,negative:()=>$2,multipleOf:()=>x6,minSize:()=>Q6,minLength:()=>W6,mime:()=>$0,maxSize:()=>u6,maxLength:()=>U1,lte:()=>L4,lt:()=>v6,lowercase:()=>o1,length:()=>Q1,includes:()=>a1,gte:()=>z4,gt:()=>U6,endsWith:()=>e1});var X2=b(()=>{k4()});var I0={};s$(I0,{time:()=>tU,duration:()=>aU,datetime:()=>rU,date:()=>oU,ZodISOTime:()=>j2,ZodISODuration:()=>K2,ZodISODateTime:()=>q2,ZodISODate:()=>G2});function rU($){return N5(q2,$)}function oU($){return S5(G2,$)}function tU($){return T5(j2,$)}function aU($){return R5(K2,$)}var q2,G2,j2,K2;var Z_=b(()=>{k4();D_();q2=B("ZodISODateTime",($,_)=>{F3.init($,_),F$.init($,_)});G2=B("ZodISODate",($,_)=>{O3.init($,_),F$.init($,_)});j2=B("ZodISOTime",($,_)=>{N3.init($,_),F$.init($,_)});K2=B("ZodISODuration",($,_)=>{S3.init($,_),F$.init($,_)})});var yI=($,_)=>{e0.init($,_),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>__($,U)},flatten:{value:(U)=>$_($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,m1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,m1,2)}},isEmpty:{get(){return $.issues.length===0}}})},H2,b4;var sU=b(()=>{k4();k4();l();H2=B("ZodError",yI),b4=B("ZodError",yI,{Parent:Error})});var eU,$Q,_Q,vQ,UQ,QQ,JQ,YQ,zQ,IQ,XQ,qQ;var GQ=b(()=>{k4();sU();eU=c1(b4),$Q=l1(b4),_Q=d1(b4),vQ=p1(b4),UQ=Xv(b4),QQ=qv(b4),JQ=Gv(b4),YQ=jv(b4),zQ=Kv(b4),IQ=Hv(b4),XQ=Wv(b4),qQ=bv(b4)});var V_={};s$(V_,{xor:()=>OX,xid:()=>tI,void:()=>MX,uuidv7:()=>cI,uuidv6:()=>hI,uuidv4:()=>gI,uuid:()=>mI,url:()=>lI,unknown:()=>J1,union:()=>y2,undefined:()=>VX,ulid:()=>oI,uint64:()=>BX,uint32:()=>HX,tuple:()=>SQ,transform:()=>f2,templateLiteral:()=>gX,symbol:()=>ZX,superRefine:()=>vJ,success:()=>CX,stringbool:()=>rX,stringFormat:()=>zX,string:()=>W2,strictObject:()=>AX,set:()=>EX,refine:()=>_J,record:()=>TQ,readonly:()=>oQ,promise:()=>hX,preprocess:()=>tX,prefault:()=>cQ,pipe:()=>k_,partialRecord:()=>SX,optional:()=>w_,object:()=>kX,number:()=>KQ,nullish:()=>yX,nullable:()=>L_,null:()=>ZQ,nonoptional:()=>lQ,never:()=>u2,nativeEnum:()=>PX,nanoid:()=>iI,nan:()=>fX,meta:()=>iX,map:()=>RX,mac:()=>eI,looseRecord:()=>TX,looseObject:()=>FX,literal:()=>xX,lazy:()=>sQ,ksuid:()=>aI,keyof:()=>LX,jwt:()=>YX,json:()=>oX,ipv6:()=>$X,ipv4:()=>sI,intersection:()=>OQ,int64:()=>bX,int32:()=>KX,int:()=>b2,instanceof:()=>nX,httpUrl:()=>dI,hostname:()=>IX,hex:()=>XX,hash:()=>qX,guid:()=>fI,function:()=>cX,float64:()=>jX,float32:()=>GX,file:()=>uX,exactOptional:()=>CQ,enum:()=>C2,emoji:()=>pI,email:()=>CI,e164:()=>JX,discriminatedUnion:()=>NX,describe:()=>pX,date:()=>wX,custom:()=>dX,cuid2:()=>rI,cuid:()=>nI,codec:()=>mX,cidrv6:()=>vX,cidrv4:()=>_X,check:()=>lX,catch:()=>iQ,boolean:()=>HQ,bigint:()=>WX,base64url:()=>QX,base64:()=>UX,array:()=>O_,any:()=>DX,_function:()=>cX,_default:()=>gQ,_ZodString:()=>B2,ZodXor:()=>kQ,ZodXID:()=>k2,ZodVoid:()=>wQ,ZodUnknown:()=>DQ,ZodUnion:()=>S_,ZodUndefined:()=>bQ,ZodUUID:()=>J6,ZodURL:()=>A_,ZodULID:()=>L2,ZodType:()=>U$,ZodTuple:()=>NQ,ZodTransform:()=>uQ,ZodTemplateLiteral:()=>tQ,ZodSymbol:()=>WQ,ZodSuccess:()=>dQ,ZodStringFormat:()=>F$,ZodString:()=>q0,ZodSet:()=>EQ,ZodRecord:()=>T_,ZodReadonly:()=>rQ,ZodPromise:()=>eQ,ZodPrefault:()=>hQ,ZodPipe:()=>h2,ZodOptional:()=>m2,ZodObject:()=>N_,ZodNumberFormat:()=>Y1,ZodNumber:()=>j0,ZodNullable:()=>fQ,ZodNull:()=>BQ,ZodNonOptional:()=>g2,ZodNever:()=>MQ,ZodNanoID:()=>D2,ZodNaN:()=>nQ,ZodMap:()=>RQ,ZodMAC:()=>jQ,ZodLiteral:()=>PQ,ZodLazy:()=>aQ,ZodKSUID:()=>A2,ZodJWT:()=>P2,ZodIntersection:()=>FQ,ZodIPv6:()=>O2,ZodIPv4:()=>F2,ZodGUID:()=>M_,ZodFunction:()=>$J,ZodFile:()=>xQ,ZodExactOptional:()=>yQ,ZodEnum:()=>X0,ZodEmoji:()=>V2,ZodEmail:()=>Z2,ZodE164:()=>E2,ZodDiscriminatedUnion:()=>AQ,ZodDefault:()=>mQ,ZodDate:()=>F_,ZodCustomStringFormat:()=>G0,ZodCustom:()=>R_,ZodCodec:()=>c2,ZodCatch:()=>pQ,ZodCUID2:()=>w2,ZodCUID:()=>M2,ZodCIDRv6:()=>S2,ZodCIDRv4:()=>N2,ZodBoolean:()=>K0,ZodBigIntFormat:()=>x2,ZodBigInt:()=>H0,ZodBase64URL:()=>R2,ZodBase64:()=>T2,ZodArray:()=>LQ,ZodAny:()=>VQ});function W2($){return k5(q0,$)}function CI($){return Pv(Z2,$)}function fI($){return H_(M_,$)}function mI($){return xv(J6,$)}function gI($){return uv(J6,$)}function hI($){return yv(J6,$)}function cI($){return Cv(J6,$)}function lI($){return W_(A_,$)}function dI($){return W_(A_,{protocol:/^https?$/,hostname:E4.domain,...E.normalizeParams($)})}function pI($){return fv(V2,$)}function iI($){return mv(D2,$)}function nI($){return gv(M2,$)}function rI($){return hv(w2,$)}function oI($){return cv(L2,$)}function tI($){return lv(k2,$)}function aI($){return dv(A2,$)}function sI($){return pv(F2,$)}function eI($){return F5(jQ,$)}function $X($){return iv(O2,$)}function _X($){return nv(N2,$)}function vX($){return rv(S2,$)}function UX($){return ov(T2,$)}function QX($){return tv(R2,$)}function JX($){return av(E2,$)}function YX($){return sv(P2,$)}function zX($,_,U={}){return Y0(G0,$,_,U)}function IX($){return Y0(G0,"hostname",E4.hostname,$)}function XX($){return Y0(G0,"hex",E4.hex,$)}function qX($,_){let U=_?.enc??"hex",Q=`${$}_${U}`,v=E4[Q];if(!v)throw Error(`Unrecognized hash format: ${Q}`);return Y0(G0,Q,v,_)}function KQ($){return E5(j0,$)}function b2($){return x5(Y1,$)}function GX($){return u5(Y1,$)}function jX($){return y5(Y1,$)}function KX($){return C5(Y1,$)}function HX($){return f5(Y1,$)}function HQ($){return m5(K0,$)}function WX($){return h5(H0,$)}function bX($){return l5(x2,$)}function BX($){return d5(x2,$)}function ZX($){return p5(WQ,$)}function VX($){return i5(bQ,$)}function ZQ($){return n5(BQ,$)}function DX(){return r5(VQ)}function J1(){return o5(DQ)}function u2($){return t5(MQ,$)}function MX($){return a5(wQ,$)}function wX($){return s5(F_,$)}function O_($,_){return _U(LQ,$,_)}function LX($){let _=$._zod.def.shape;return C2(Object.keys(_))}function kX($,_){let U={type:"object",shape:$??{},...E.normalizeParams(_)};return new N_(U)}function AX($,_){return new N_({type:"object",shape:$,catchall:u2(),...E.normalizeParams(_)})}function FX($,_){return new N_({type:"object",shape:$,catchall:J1(),...E.normalizeParams(_)})}function y2($,_){return new S_({type:"union",options:$,...E.normalizeParams(_)})}function OX($,_){return new kQ({type:"union",options:$,inclusive:!1,...E.normalizeParams(_)})}function NX($,_,U){return new AQ({type:"union",options:_,discriminator:$,...E.normalizeParams(U)})}function OQ($,_){return new FQ({type:"intersection",left:$,right:_})}function SQ($,_,U){let Q=_ instanceof e,v=Q?U:_;return new NQ({type:"tuple",items:$,rest:Q?_:null,...E.normalizeParams(v)})}function TQ($,_,U){return new T_({type:"record",keyType:$,valueType:_,...E.normalizeParams(U)})}function SX($,_,U){let Q=Y4($);return Q._zod.values=void 0,new T_({type:"record",keyType:Q,valueType:_,...E.normalizeParams(U)})}function TX($,_,U){return new T_({type:"record",keyType:$,valueType:_,mode:"loose",...E.normalizeParams(U)})}function RX($,_,U){return new RQ({type:"map",keyType:$,valueType:_,...E.normalizeParams(U)})}function EX($,_){return new EQ({type:"set",valueType:$,...E.normalizeParams(_)})}function C2($,_){let U=Array.isArray($)?Object.fromEntries($.map((Q)=>[Q,Q])):$;return new X0({type:"enum",entries:U,...E.normalizeParams(_)})}function PX($,_){return new X0({type:"enum",entries:$,...E.normalizeParams(_)})}function xX($,_){return new PQ({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(_)})}function uX($){return vU(xQ,$)}function f2($){return new uQ({type:"transform",transform:$})}function w_($){return new m2({type:"optional",innerType:$})}function CQ($){return new yQ({type:"optional",innerType:$})}function L_($){return new fQ({type:"nullable",innerType:$})}function yX($){return w_(L_($))}function gQ($,_){return new mQ({type:"default",innerType:$,get defaultValue(){return typeof _==="function"?_():E.shallowClone(_)}})}function cQ($,_){return new hQ({type:"prefault",innerType:$,get defaultValue(){return typeof _==="function"?_():E.shallowClone(_)}})}function lQ($,_){return new g2({type:"nonoptional",innerType:$,...E.normalizeParams(_)})}function CX($){return new dQ({type:"success",innerType:$})}function iQ($,_){return new pQ({type:"catch",innerType:$,catchValue:typeof _==="function"?_:()=>_})}function fX($){return $U(nQ,$)}function k_($,_){return new h2({type:"pipe",in:$,out:_})}function mX($,_,U){return new c2({type:"pipe",in:$,out:_,transform:U.decode,reverseTransform:U.encode})}function oQ($){return new rQ({type:"readonly",innerType:$})}function gX($,_){return new tQ({type:"template_literal",parts:$,...E.normalizeParams(_)})}function sQ($){return new aQ({type:"lazy",getter:$})}function hX($){return new eQ({type:"promise",innerType:$})}function cX($){return new $J({type:"function",input:Array.isArray($?.input)?SQ($?.input):$?.input??O_(J1()),output:$?.output??J1()})}function lX($){let _=new T$({check:"custom"});return _._zod.check=$,_}function dX($,_){return UU(R_,$??(()=>!0),_)}function _J($,_={}){return QU(R_,$,_)}function vJ($){return JU($)}function nX($,_={}){let U=new R_({type:"custom",check:"custom",fn:(Q)=>Q instanceof $,abort:!0,...E.normalizeParams(_)});return U._zod.bag.Class=$,U._zod.check=(Q)=>{if(!(Q.value instanceof $))Q.issues.push({code:"invalid_type",expected:$.name,input:Q.value,inst:U,path:[...U._zod.def.path??[]]})},U}function oX($){let _=sQ(()=>{return y2([W2($),KQ(),HQ(),ZQ(),O_(_),TQ(W2(),_)])});return _}function tX($,_){return k_(f2($),_)}var U$,B2,q0,F$,Z2,M_,J6,A_,V2,D2,M2,w2,L2,k2,A2,F2,jQ,O2,N2,S2,T2,R2,E2,P2,G0,j0,Y1,K0,H0,x2,WQ,bQ,BQ,VQ,DQ,MQ,wQ,F_,LQ,N_,S_,kQ,AQ,FQ,NQ,T_,RQ,EQ,X0,PQ,xQ,uQ,m2,yQ,fQ,mQ,hQ,g2,dQ,pQ,nQ,h2,c2,rQ,tQ,aQ,eQ,$J,R_,pX,iX,rX=(...$)=>IU({Codec:c2,Boolean:K0,String:q0},...$);var D_=b(()=>{k4();k4();B_();b_();X2();Z_();GQ();U$=B("ZodType",($,_)=>{return e.init($,_),Object.assign($["~standard"],{jsonSchema:{input:z0($,"input"),output:z0($,"output")}}),$.toJSONSchema=XU($,{}),$.def=_,$.type=_.type,Object.defineProperty($,"_def",{value:_}),$.check=(...U)=>{return $.clone(E.mergeDefs(_,{checks:[..._.checks??[],...U.map((Q)=>typeof Q==="function"?{_zod:{check:Q,def:{check:"custom"},onattach:[]}}:Q)]}),{parent:!0})},$.with=$.check,$.clone=(U,Q)=>Y4($,U,Q),$.brand=()=>$,$.register=(U,Q)=>{return U.add($,Q),$},$.parse=(U,Q)=>eU($,U,Q,{callee:$.parse}),$.safeParse=(U,Q)=>_Q($,U,Q),$.parseAsync=async(U,Q)=>$Q($,U,Q,{callee:$.parseAsync}),$.safeParseAsync=async(U,Q)=>vQ($,U,Q),$.spa=$.safeParseAsync,$.encode=(U,Q)=>UQ($,U,Q),$.decode=(U,Q)=>QQ($,U,Q),$.encodeAsync=async(U,Q)=>JQ($,U,Q),$.decodeAsync=async(U,Q)=>YQ($,U,Q),$.safeEncode=(U,Q)=>zQ($,U,Q),$.safeDecode=(U,Q)=>IQ($,U,Q),$.safeEncodeAsync=async(U,Q)=>XQ($,U,Q),$.safeDecodeAsync=async(U,Q)=>qQ($,U,Q),$.refine=(U,Q)=>$.check(_J(U,Q)),$.superRefine=(U)=>$.check(vJ(U)),$.overwrite=(U)=>$.check(l4(U)),$.optional=()=>w_($),$.exactOptional=()=>CQ($),$.nullable=()=>L_($),$.nullish=()=>w_(L_($)),$.nonoptional=(U)=>lQ($,U),$.array=()=>O_($),$.or=(U)=>y2([$,U]),$.and=(U)=>OQ($,U),$.transform=(U)=>k_($,f2(U)),$.default=(U)=>gQ($,U),$.prefault=(U)=>cQ($,U),$.catch=(U)=>iQ($,U),$.pipe=(U)=>k_($,U),$.readonly=()=>oQ($),$.describe=(U)=>{let Q=$.clone();return e$.add(Q,{description:U}),Q},Object.defineProperty($,"description",{get(){return e$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return e$.get($);let Q=$.clone();return e$.add(Q,U[0]),Q},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(U)=>U($),$}),B2=B("_ZodString",($,_)=>{_1.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>qU($,Q,v,J);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...Q)=>$.check(r1(...Q)),$.includes=(...Q)=>$.check(a1(...Q)),$.startsWith=(...Q)=>$.check(s1(...Q)),$.endsWith=(...Q)=>$.check(e1(...Q)),$.min=(...Q)=>$.check(W6(...Q)),$.max=(...Q)=>$.check(U1(...Q)),$.length=(...Q)=>$.check(Q1(...Q)),$.nonempty=(...Q)=>$.check(W6(1,...Q)),$.lowercase=(Q)=>$.check(o1(Q)),$.uppercase=(Q)=>$.check(t1(Q)),$.trim=()=>$.check(v0()),$.normalize=(...Q)=>$.check(_0(...Q)),$.toLowerCase=()=>$.check(U0()),$.toUpperCase=()=>$.check(Q0()),$.slugify=()=>$.check(J0())}),q0=B("ZodString",($,_)=>{_1.init($,_),B2.init($,_),$.email=(U)=>$.check(Pv(Z2,U)),$.url=(U)=>$.check(W_(A_,U)),$.jwt=(U)=>$.check(sv(P2,U)),$.emoji=(U)=>$.check(fv(V2,U)),$.guid=(U)=>$.check(H_(M_,U)),$.uuid=(U)=>$.check(xv(J6,U)),$.uuidv4=(U)=>$.check(uv(J6,U)),$.uuidv6=(U)=>$.check(yv(J6,U)),$.uuidv7=(U)=>$.check(Cv(J6,U)),$.nanoid=(U)=>$.check(mv(D2,U)),$.guid=(U)=>$.check(H_(M_,U)),$.cuid=(U)=>$.check(gv(M2,U)),$.cuid2=(U)=>$.check(hv(w2,U)),$.ulid=(U)=>$.check(cv(L2,U)),$.base64=(U)=>$.check(ov(T2,U)),$.base64url=(U)=>$.check(tv(R2,U)),$.xid=(U)=>$.check(lv(k2,U)),$.ksuid=(U)=>$.check(dv(A2,U)),$.ipv4=(U)=>$.check(pv(F2,U)),$.ipv6=(U)=>$.check(iv(O2,U)),$.cidrv4=(U)=>$.check(nv(N2,U)),$.cidrv6=(U)=>$.check(rv(S2,U)),$.e164=(U)=>$.check(av(E2,U)),$.datetime=(U)=>$.check(rU(U)),$.date=(U)=>$.check(oU(U)),$.time=(U)=>$.check(tU(U)),$.duration=(U)=>$.check(aU(U))});F$=B("ZodStringFormat",($,_)=>{A$.init($,_),B2.init($,_)}),Z2=B("ZodEmail",($,_)=>{B3.init($,_),F$.init($,_)});M_=B("ZodGUID",($,_)=>{W3.init($,_),F$.init($,_)});J6=B("ZodUUID",($,_)=>{b3.init($,_),F$.init($,_)});A_=B("ZodURL",($,_)=>{Z3.init($,_),F$.init($,_)});V2=B("ZodEmoji",($,_)=>{V3.init($,_),F$.init($,_)});D2=B("ZodNanoID",($,_)=>{D3.init($,_),F$.init($,_)});M2=B("ZodCUID",($,_)=>{M3.init($,_),F$.init($,_)});w2=B("ZodCUID2",($,_)=>{w3.init($,_),F$.init($,_)});L2=B("ZodULID",($,_)=>{L3.init($,_),F$.init($,_)});k2=B("ZodXID",($,_)=>{k3.init($,_),F$.init($,_)});A2=B("ZodKSUID",($,_)=>{A3.init($,_),F$.init($,_)});F2=B("ZodIPv4",($,_)=>{T3.init($,_),F$.init($,_)});jQ=B("ZodMAC",($,_)=>{E3.init($,_),F$.init($,_)});O2=B("ZodIPv6",($,_)=>{R3.init($,_),F$.init($,_)});N2=B("ZodCIDRv4",($,_)=>{P3.init($,_),F$.init($,_)});S2=B("ZodCIDRv6",($,_)=>{x3.init($,_),F$.init($,_)});T2=B("ZodBase64",($,_)=>{y3.init($,_),F$.init($,_)});R2=B("ZodBase64URL",($,_)=>{C3.init($,_),F$.init($,_)});E2=B("ZodE164",($,_)=>{f3.init($,_),F$.init($,_)});P2=B("ZodJWT",($,_)=>{m3.init($,_),F$.init($,_)});G0=B("ZodCustomStringFormat",($,_)=>{g3.init($,_),F$.init($,_)});j0=B("ZodNumber",($,_)=>{Nv.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>GU($,Q,v,J),$.gt=(Q,v)=>$.check(U6(Q,v)),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.lt=(Q,v)=>$.check(v6(Q,v)),$.lte=(Q,v)=>$.check(L4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v)),$.int=(Q)=>$.check(b2(Q)),$.safe=(Q)=>$.check(b2(Q)),$.positive=(Q)=>$.check(U6(0,Q)),$.nonnegative=(Q)=>$.check(z4(0,Q)),$.negative=(Q)=>$.check(v6(0,Q)),$.nonpositive=(Q)=>$.check(L4(0,Q)),$.multipleOf=(Q,v)=>$.check(x6(Q,v)),$.step=(Q,v)=>$.check(x6(Q,v)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});Y1=B("ZodNumberFormat",($,_)=>{h3.init($,_),j0.init($,_)});K0=B("ZodBoolean",($,_)=>{J_.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>jU($,U,Q,v)});H0=B("ZodBigInt",($,_)=>{Sv.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>KU($,Q,v,J),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.gt=(Q,v)=>$.check(U6(Q,v)),$.gte=(Q,v)=>$.check(z4(Q,v)),$.min=(Q,v)=>$.check(z4(Q,v)),$.lt=(Q,v)=>$.check(v6(Q,v)),$.lte=(Q,v)=>$.check(L4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v)),$.positive=(Q)=>$.check(U6(BigInt(0),Q)),$.negative=(Q)=>$.check(v6(BigInt(0),Q)),$.nonpositive=(Q)=>$.check(L4(BigInt(0),Q)),$.nonnegative=(Q)=>$.check(z4(BigInt(0),Q)),$.multipleOf=(Q,v)=>$.check(x6(Q,v));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});x2=B("ZodBigIntFormat",($,_)=>{c3.init($,_),H0.init($,_)});WQ=B("ZodSymbol",($,_)=>{l3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>HU($,U,Q,v)});bQ=B("ZodUndefined",($,_)=>{d3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>bU($,U,Q,v)});BQ=B("ZodNull",($,_)=>{p3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>WU($,U,Q,v)});VQ=B("ZodAny",($,_)=>{i3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>VU($,U,Q,v)});DQ=B("ZodUnknown",($,_)=>{n3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>DU($,U,Q,v)});MQ=B("ZodNever",($,_)=>{r3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>ZU($,U,Q,v)});wQ=B("ZodVoid",($,_)=>{o3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>BU($,U,Q,v)});F_=B("ZodDate",($,_)=>{t3.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>MU($,Q,v,J),$.min=(Q,v)=>$.check(z4(Q,v)),$.max=(Q,v)=>$.check(L4(Q,v));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});LQ=B("ZodArray",($,_)=>{a3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>PU($,U,Q,v),$.element=_.element,$.min=(U,Q)=>$.check(W6(U,Q)),$.nonempty=(U)=>$.check(W6(1,U)),$.max=(U,Q)=>$.check(U1(U,Q)),$.length=(U,Q)=>$.check(Q1(U,Q)),$.unwrap=()=>$.element});N_=B("ZodObject",($,_)=>{s3.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>xU($,U,Q,v),E.defineLazy($,"shape",()=>{return _.shape}),$.keyof=()=>C2(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:J1()}),$.loose=()=>$.clone({...$._zod.def,catchall:J1()}),$.strict=()=>$.clone({...$._zod.def,catchall:u2()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(m2,$,U[0]),$.required=(...U)=>E.required(g2,$,U[0])});S_=B("ZodUnion",($,_)=>{Y_.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>J2($,U,Q,v),$.options=_.options});kQ=B("ZodXor",($,_)=>{S_.init($,_),e3.init($,_),$._zod.processJSONSchema=(U,Q,v)=>J2($,U,Q,v),$.options=_.options});AQ=B("ZodDiscriminatedUnion",($,_)=>{S_.init($,_),$7.init($,_)});FQ=B("ZodIntersection",($,_)=>{_7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>uU($,U,Q,v)});NQ=B("ZodTuple",($,_)=>{Tv.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>yU($,U,Q,v),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});T_=B("ZodRecord",($,_)=>{v7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>CU($,U,Q,v),$.keyType=_.keyType,$.valueType=_.valueType});RQ=B("ZodMap",($,_)=>{U7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>RU($,U,Q,v),$.keyType=_.keyType,$.valueType=_.valueType,$.min=(...U)=>$.check(Q6(...U)),$.nonempty=(U)=>$.check(Q6(1,U)),$.max=(...U)=>$.check(u6(...U)),$.size=(...U)=>$.check(v1(...U))});EQ=B("ZodSet",($,_)=>{Q7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>EU($,U,Q,v),$.min=(...U)=>$.check(Q6(...U)),$.nonempty=(U)=>$.check(Q6(1,U)),$.max=(...U)=>$.check(u6(...U)),$.size=(...U)=>$.check(v1(...U))});X0=B("ZodEnum",($,_)=>{J7.init($,_),U$.init($,_),$._zod.processJSONSchema=(Q,v,J)=>wU($,Q,v,J),$.enum=_.entries,$.options=Object.values(_.entries);let U=new Set(Object.keys(_.entries));$.extract=(Q,v)=>{let J={};for(let Y of Q)if(U.has(Y))J[Y]=_.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({..._,checks:[],...E.normalizeParams(v),entries:J})},$.exclude=(Q,v)=>{let J={..._.entries};for(let Y of Q)if(U.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({..._,checks:[],...E.normalizeParams(v),entries:J})}});PQ=B("ZodLiteral",($,_)=>{Y7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>LU($,U,Q,v),$.values=new Set(_.values),Object.defineProperty($,"value",{get(){if(_.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return _.values[0]}})});xQ=B("ZodFile",($,_)=>{z7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>FU($,U,Q,v),$.min=(U,Q)=>$.check(Q6(U,Q)),$.max=(U,Q)=>$.check(u6(U,Q)),$.mime=(U,Q)=>$.check($0(Array.isArray(U)?U:[U],Q))});uQ=B("ZodTransform",($,_)=>{I7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>TU($,U,Q,v),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new s6($.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(E.issue(J,U.value,_));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=U.value),Y.inst??(Y.inst=$),U.issues.push(E.issue(Y))}};let v=_.transform(U.value,U);if(v instanceof Promise)return v.then((J)=>{return U.value=J,U});return U.value=v,U}});m2=B("ZodOptional",($,_)=>{Rv.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>Y2($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});yQ=B("ZodExactOptional",($,_)=>{X7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>Y2($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});fQ=B("ZodNullable",($,_)=>{q7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>fU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});mQ=B("ZodDefault",($,_)=>{G7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>gU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});hQ=B("ZodPrefault",($,_)=>{j7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>hU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});g2=B("ZodNonOptional",($,_)=>{K7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>mU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});dQ=B("ZodSuccess",($,_)=>{H7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>OU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});pQ=B("ZodCatch",($,_)=>{W7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>cU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});nQ=B("ZodNaN",($,_)=>{b7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>kU($,U,Q,v)});h2=B("ZodPipe",($,_)=>{B7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>lU($,U,Q,v),$.in=_.in,$.out=_.out});c2=B("ZodCodec",($,_)=>{h2.init($,_),z_.init($,_)});rQ=B("ZodReadonly",($,_)=>{Z7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>dU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});tQ=B("ZodTemplateLiteral",($,_)=>{V7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>AU($,U,Q,v)});aQ=B("ZodLazy",($,_)=>{w7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>iU($,U,Q,v),$.unwrap=()=>$._zod.def.getter()});eQ=B("ZodPromise",($,_)=>{M7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>pU($,U,Q,v),$.unwrap=()=>$._zod.def.innerType});$J=B("ZodFunction",($,_)=>{D7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>SU($,U,Q,v)});R_=B("ZodCustom",($,_)=>{L7.init($,_),U$.init($,_),$._zod.processJSONSchema=(U,Q,v)=>NU($,U,Q,v)});pX=YU,iX=zU});function OZ($){l$({customError:$})}function NZ(){return l$().customError}var FZ,UJ;var aX=b(()=>{k4();FZ={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function($){})(UJ||(UJ={}))});function TZ($,_){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return _??"draft-2020-12"}function RZ($,_){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return _.rootSchema;let Q=_.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===Q){let v=U[1];if(!v||!_.defs[v])throw Error(`Reference not found: ${$}`);return _.defs[v]}throw Error(`Reference not found: ${$}`)}function sX($,_){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return y.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let v=$.$ref;if(_.refs.has(v))return _.refs.get(v);if(_.processing.has(v))return y.lazy(()=>{if(!_.refs.has(v))throw Error(`Circular reference not resolved: ${v}`);return _.refs.get(v)});_.processing.add(v);let J=RZ(v,_),Y=v4(J,_);return _.refs.set(v,Y),_.processing.delete(v),Y}if($.enum!==void 0){let v=$.enum;if(_.version==="openapi-3.0"&&$.nullable===!0&&v.length===1&&v[0]===null)return y.null();if(v.length===0)return y.never();if(v.length===1)return y.literal(v[0]);if(v.every((Y)=>typeof Y==="string"))return y.enum(v);let J=v.map((Y)=>y.literal(Y));if(J.length<2)return J[0];return y.union([J[0],J[1],...J.slice(2)])}if($.const!==void 0)return y.literal($.const);let U=$.type;if(Array.isArray(U)){let v=U.map((J)=>{let Y={...$,type:J};return sX(Y,_)});if(v.length===0)return y.never();if(v.length===1)return v[0];return y.union(v)}if(!U)return y.any();let Q;switch(U){case"string":{let v=y.string();if($.format){let J=$.format;if(J==="email")v=v.check(y.email());else if(J==="uri"||J==="uri-reference")v=v.check(y.url());else if(J==="uuid"||J==="guid")v=v.check(y.uuid());else if(J==="date-time")v=v.check(y.iso.datetime());else if(J==="date")v=v.check(y.iso.date());else if(J==="time")v=v.check(y.iso.time());else if(J==="duration")v=v.check(y.iso.duration());else if(J==="ipv4")v=v.check(y.ipv4());else if(J==="ipv6")v=v.check(y.ipv6());else if(J==="mac")v=v.check(y.mac());else if(J==="cidr")v=v.check(y.cidrv4());else if(J==="cidr-v6")v=v.check(y.cidrv6());else if(J==="base64")v=v.check(y.base64());else if(J==="base64url")v=v.check(y.base64url());else if(J==="e164")v=v.check(y.e164());else if(J==="jwt")v=v.check(y.jwt());else if(J==="emoji")v=v.check(y.emoji());else if(J==="nanoid")v=v.check(y.nanoid());else if(J==="cuid")v=v.check(y.cuid());else if(J==="cuid2")v=v.check(y.cuid2());else if(J==="ulid")v=v.check(y.ulid());else if(J==="xid")v=v.check(y.xid());else if(J==="ksuid")v=v.check(y.ksuid())}if(typeof $.minLength==="number")v=v.min($.minLength);if(typeof $.maxLength==="number")v=v.max($.maxLength);if($.pattern)v=v.regex(new RegExp($.pattern));Q=v;break}case"number":case"integer":{let v=U==="integer"?y.number().int():y.number();if(typeof $.minimum==="number")v=v.min($.minimum);if(typeof $.maximum==="number")v=v.max($.maximum);if(typeof $.exclusiveMinimum==="number")v=v.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")v=v.gt($.minimum);if(typeof $.exclusiveMaximum==="number")v=v.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")v=v.lt($.maximum);if(typeof $.multipleOf==="number")v=v.multipleOf($.multipleOf);Q=v;break}case"boolean":{Q=y.boolean();break}case"null":{Q=y.null();break}case"object":{let v={},J=$.properties||{},Y=new Set($.required||[]);for(let[I,X]of Object.entries(J)){let q=v4(X,_);v[I]=Y.has(I)?q:q.optional()}if($.propertyNames){let I=v4($.propertyNames,_),X=$.additionalProperties&&typeof $.additionalProperties==="object"?v4($.additionalProperties,_):y.any();if(Object.keys(v).length===0){Q=y.record(I,X);break}let q=y.object(v).passthrough(),G=y.looseRecord(I,X);Q=y.intersection(q,G);break}if($.patternProperties){let I=$.patternProperties,X=Object.keys(I),q=[];for(let j of X){let H=v4(I[j],_),Z=y.string().regex(new RegExp(j));q.push(y.looseRecord(Z,H))}let G=[];if(Object.keys(v).length>0)G.push(y.object(v).passthrough());if(G.push(...q),G.length===0)Q=y.object({}).passthrough();else if(G.length===1)Q=G[0];else{let j=y.intersection(G[0],G[1]);for(let H=2;H<G.length;H++)j=y.intersection(j,G[H]);Q=j}break}let z=y.object(v);if($.additionalProperties===!1)Q=z.strict();else if(typeof $.additionalProperties==="object")Q=z.catchall(v4($.additionalProperties,_));else Q=z.passthrough();break}case"array":{let{prefixItems:v,items:J}=$;if(v&&Array.isArray(v)){let Y=v.map((I)=>v4(I,_)),z=J&&typeof J==="object"&&!Array.isArray(J)?v4(J,_):void 0;if(z)Q=y.tuple(Y).rest(z);else Q=y.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(y.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(y.maxLength($.maxItems))}else if(Array.isArray(J)){let Y=J.map((I)=>v4(I,_)),z=$.additionalItems&&typeof $.additionalItems==="object"?v4($.additionalItems,_):void 0;if(z)Q=y.tuple(Y).rest(z);else Q=y.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(y.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(y.maxLength($.maxItems))}else if(J!==void 0){let Y=v4(J,_),z=y.array(Y);if(typeof $.minItems==="number")z=z.min($.minItems);if(typeof $.maxItems==="number")z=z.max($.maxItems);Q=z}else Q=y.array(y.any());break}default:throw Error(`Unsupported type: ${U}`)}if($.description)Q=Q.describe($.description);if($.default!==void 0)Q=Q.default($.default);return Q}function v4($,_){if(typeof $==="boolean")return $?y.any():y.never();let U=sX($,_),Q=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let z=$.anyOf.map((X)=>v4(X,_)),I=y.union(z);U=Q?y.intersection(U,I):I}if($.oneOf&&Array.isArray($.oneOf)){let z=$.oneOf.map((X)=>v4(X,_)),I=y.xor(z);U=Q?y.intersection(U,I):I}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=Q?U:y.any();else{let z=Q?U:v4($.allOf[0],_),I=Q?0:1;for(let X=I;X<$.allOf.length;X++)z=y.intersection(z,v4($.allOf[X],_));U=z}if($.nullable===!0&&_.version==="openapi-3.0")U=y.nullable(U);if($.readOnly===!0)U=y.readonly(U);let v={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let z of J)if(z in $)v[z]=$[z];let Y=["contentEncoding","contentMediaType","contentSchema"];for(let z of Y)if(z in $)v[z]=$[z];for(let z of Object.keys($))if(!SZ.has(z))v[z]=$[z];if(Object.keys(v).length>0)_.registry.add(U,v);return U}function eX($,_){if(typeof $==="boolean")return $?y.any():y.never();let U=TZ($,_?.defaultTarget),Q=$.$defs||$.definitions||{},v={version:U,defs:Q,refs:new Map,processing:new Set,rootSchema:$,registry:_?.registry??e$};return v4($,v)}var y,SZ;var $q=b(()=>{K_();X2();Z_();D_();y={...V_,...I2,iso:I0},SZ=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var QJ={};s$(QJ,{string:()=>EZ,number:()=>PZ,date:()=>yZ,boolean:()=>xZ,bigint:()=>uZ});function EZ($){return A5(q0,$)}function PZ($){return P5(j0,$)}function xZ($){return g5(K0,$)}function uZ($){return c5(H0,$)}function yZ($){return e5(F_,$)}var _q=b(()=>{k4();D_()});var K={};s$(K,{xor:()=>OX,xid:()=>tI,void:()=>MX,uuidv7:()=>cI,uuidv6:()=>hI,uuidv4:()=>gI,uuid:()=>mI,util:()=>E,url:()=>lI,uppercase:()=>t1,unknown:()=>J1,union:()=>y2,undefined:()=>VX,ulid:()=>oI,uint64:()=>BX,uint32:()=>HX,tuple:()=>SQ,trim:()=>v0,treeifyError:()=>H9,transform:()=>f2,toUpperCase:()=>Q0,toLowerCase:()=>U0,toJSONSchema:()=>z2,templateLiteral:()=>gX,symbol:()=>ZX,superRefine:()=>vJ,success:()=>CX,stringbool:()=>rX,stringFormat:()=>zX,string:()=>W2,strictObject:()=>AX,startsWith:()=>s1,slugify:()=>J0,size:()=>v1,setErrorMap:()=>OZ,set:()=>EX,safeParseAsync:()=>vQ,safeParse:()=>_Q,safeEncodeAsync:()=>XQ,safeEncode:()=>zQ,safeDecodeAsync:()=>qQ,safeDecode:()=>IQ,registry:()=>Ev,regexes:()=>E4,regex:()=>r1,refine:()=>_J,record:()=>TQ,readonly:()=>oQ,property:()=>U2,promise:()=>hX,prettifyError:()=>W9,preprocess:()=>tX,prefault:()=>cQ,positive:()=>ev,pipe:()=>k_,partialRecord:()=>SX,parseAsync:()=>$Q,parse:()=>eU,overwrite:()=>l4,optional:()=>w_,object:()=>kX,number:()=>KQ,nullish:()=>yX,nullable:()=>L_,null:()=>ZQ,normalize:()=>_0,nonpositive:()=>_2,nonoptional:()=>lQ,nonnegative:()=>v2,never:()=>u2,negative:()=>$2,nativeEnum:()=>PX,nanoid:()=>iI,nan:()=>fX,multipleOf:()=>x6,minSize:()=>Q6,minLength:()=>W6,mime:()=>$0,meta:()=>iX,maxSize:()=>u6,maxLength:()=>U1,map:()=>RX,mac:()=>eI,lte:()=>L4,lt:()=>v6,lowercase:()=>o1,looseRecord:()=>TX,looseObject:()=>FX,locales:()=>j_,literal:()=>xX,length:()=>Q1,lazy:()=>sQ,ksuid:()=>aI,keyof:()=>LX,jwt:()=>YX,json:()=>oX,iso:()=>I0,ipv6:()=>$X,ipv4:()=>sI,intersection:()=>OQ,int64:()=>bX,int32:()=>KX,int:()=>b2,instanceof:()=>nX,includes:()=>a1,httpUrl:()=>dI,hostname:()=>IX,hex:()=>XX,hash:()=>qX,guid:()=>fI,gte:()=>z4,gt:()=>U6,globalRegistry:()=>e$,getErrorMap:()=>NZ,function:()=>cX,fromJSONSchema:()=>eX,formatError:()=>__,float64:()=>jX,float32:()=>GX,flattenError:()=>$_,file:()=>uX,exactOptional:()=>CQ,enum:()=>C2,endsWith:()=>e1,encodeAsync:()=>JQ,encode:()=>UQ,emoji:()=>pI,email:()=>CI,e164:()=>JX,discriminatedUnion:()=>NX,describe:()=>pX,decodeAsync:()=>YQ,decode:()=>QQ,date:()=>wX,custom:()=>dX,cuid2:()=>rI,cuid:()=>nI,core:()=>b6,config:()=>l$,coerce:()=>QJ,codec:()=>mX,clone:()=>Y4,cidrv6:()=>vX,cidrv4:()=>_X,check:()=>lX,catch:()=>iQ,boolean:()=>HQ,bigint:()=>WX,base64url:()=>QX,base64:()=>UX,array:()=>O_,any:()=>DX,_function:()=>cX,_default:()=>gQ,_ZodString:()=>B2,ZodXor:()=>kQ,ZodXID:()=>k2,ZodVoid:()=>wQ,ZodUnknown:()=>DQ,ZodUnion:()=>S_,ZodUndefined:()=>bQ,ZodUUID:()=>J6,ZodURL:()=>A_,ZodULID:()=>L2,ZodType:()=>U$,ZodTuple:()=>NQ,ZodTransform:()=>uQ,ZodTemplateLiteral:()=>tQ,ZodSymbol:()=>WQ,ZodSuccess:()=>dQ,ZodStringFormat:()=>F$,ZodString:()=>q0,ZodSet:()=>EQ,ZodRecord:()=>T_,ZodRealError:()=>b4,ZodReadonly:()=>rQ,ZodPromise:()=>eQ,ZodPrefault:()=>hQ,ZodPipe:()=>h2,ZodOptional:()=>m2,ZodObject:()=>N_,ZodNumberFormat:()=>Y1,ZodNumber:()=>j0,ZodNullable:()=>fQ,ZodNull:()=>BQ,ZodNonOptional:()=>g2,ZodNever:()=>MQ,ZodNanoID:()=>D2,ZodNaN:()=>nQ,ZodMap:()=>RQ,ZodMAC:()=>jQ,ZodLiteral:()=>PQ,ZodLazy:()=>aQ,ZodKSUID:()=>A2,ZodJWT:()=>P2,ZodIssueCode:()=>FZ,ZodIntersection:()=>FQ,ZodISOTime:()=>j2,ZodISODuration:()=>K2,ZodISODateTime:()=>q2,ZodISODate:()=>G2,ZodIPv6:()=>O2,ZodIPv4:()=>F2,ZodGUID:()=>M_,ZodFunction:()=>$J,ZodFirstPartyTypeKind:()=>UJ,ZodFile:()=>xQ,ZodExactOptional:()=>yQ,ZodError:()=>H2,ZodEnum:()=>X0,ZodEmoji:()=>V2,ZodEmail:()=>Z2,ZodE164:()=>E2,ZodDiscriminatedUnion:()=>AQ,ZodDefault:()=>mQ,ZodDate:()=>F_,ZodCustomStringFormat:()=>G0,ZodCustom:()=>R_,ZodCodec:()=>c2,ZodCatch:()=>pQ,ZodCUID2:()=>w2,ZodCUID:()=>M2,ZodCIDRv6:()=>S2,ZodCIDRv4:()=>N2,ZodBoolean:()=>K0,ZodBigIntFormat:()=>x2,ZodBigInt:()=>H0,ZodBase64URL:()=>R2,ZodBase64:()=>T2,ZodArray:()=>LQ,ZodAny:()=>VQ,TimePrecision:()=>O5,NEVER:()=>U9,$output:()=>M5,$input:()=>w5,$brand:()=>Q9});var JJ=b(()=>{k4();k4();P7();k4();B_();$q();D5();Z_();Z_();_q();D_();X2();sU();GQ();aX();l$(I_())});var B6=b(()=>{JJ();JJ()});var Uq;var vq=b(()=>{Uq={name:"ocx",version:"2.0.5",description:"OCX CLI - OpenCode extension manager with portable, isolated profiles. Your setup, anywhere.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.3",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^9.3.0",remeda:"^2.33.7",zod:"^4.3.6"},devDependencies:{"@types/bun":"^1.3.11"}}});function fZ($){return`https://${E_}/schemas/v${$}/registry.json`}var E_="ocx.kdco.dev",Qq="kdcokenny/ocx",YJ,zJ,d4=2,p4,Jq;var l2=b(()=>{vq();YJ=`https://${E_}/schemas/ocx.json`,zJ=`https://${E_}/schemas/registry.json`;p4=fZ(d4),Jq=Uq.version});var K$,b$,B$,E$,n,M,z1,t$,I1,f$,i4,m$,m6,W0,n4,b0,IJ;var z$=b(()=>{K$={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};b$=class b$ extends Error{code;exitCode;constructor($,_,U=K$.GENERAL){super($);this.code=_;this.exitCode=U;this.name="OCXError"}};B$=class B$ extends b${constructor($){super($,"NOT_FOUND",K$.NOT_FOUND);this.name="NotFoundError"}};E$=class E$ extends b${url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor($,_){super($,"NETWORK_ERROR",K$.NETWORK);this.name="NetworkError",this.url=_?.url,this.status=_?.status,this.statusText=_?.statusText,this.phase=_?.phase,this.qualifiedName=_?.qualifiedName,this.registryContext=_?.registryContext,this.registryName=_?.registryName}};n=class n extends b${constructor($){super($,"CONFIG_ERROR",K$.CONFIG);this.name="ConfigError"}};M=class M extends b${constructor($){super($,"VALIDATION_ERROR",K$.GENERAL);this.name="ValidationError"}};z1=class z1 extends b${details;constructor($){super("Registry validation failed","VALIDATION_FAILED",K$.CONFIG);this.details=$;this.name="ValidationFailedError"}};t$=class t$ extends b${constructor($){super($,"CONFLICT",K$.CONFLICT);this.name="ConflictError"}};I1=class I1 extends b${component;expected;found;constructor($,_,U){let Q=`Integrity verification failed for "${$}"
57
- Expected: ${_}
58
- Found: ${U}
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let H of Q.seen.entries()){let G=H[1];if($===H[0]){X(H);continue}if(Q.external){let W=Q.external.registry.get(H[0])?.id;if($!==H[0]&&W){X(H);continue}}if(Q.metadataRegistry.get(H[0])?.id){X(H);continue}if(G.cycle){X(H);continue}if(G.count>1){if(Q.reused==="ref"){X(H);continue}}}}function z4(Q,$){let Y=Q.seen.get($);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let q=(H)=>{let G=Q.seen.get(H);if(G.ref===null)return;let K=G.def??G.schema,W={...K},z=G.ref;if(G.ref=null,z){q(z);let Z=Q.seen.get(z),M=Z.schema;if(M.$ref&&(Q.target==="draft-07"||Q.target==="draft-04"||Q.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(M);else Object.assign(K,M);if(Object.assign(K,W),H._zod.parent===z)for(let U in K){if(U==="$ref"||U==="allOf")continue;if(!(U in W))delete K[U]}if(M.$ref&&Z.def)for(let U in K){if(U==="$ref"||U==="allOf")continue;if(U in Z.def&&JSON.stringify(K[U])===JSON.stringify(Z.def[U]))delete K[U]}}let B=H._zod.parent;if(B&&B!==z){q(B);let Z=Q.seen.get(B);if(Z?.schema.$ref){if(K.$ref=Z.schema.$ref,Z.def)for(let M in K){if(M==="$ref"||M==="allOf")continue;if(M in Z.def&&JSON.stringify(K[M])===JSON.stringify(Z.def[M]))delete K[M]}}}Q.override({zodSchema:H,jsonSchema:K,path:G.path??[]})};for(let H of[...Q.seen.entries()].reverse())q(H[0]);let J={};if(Q.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if(Q.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if(Q.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";else if(Q.target==="openapi-3.0");if(Q.external?.uri){let H=Q.external.registry.get($)?.id;if(!H)throw Error("Schema is missing an `id` property");J.$id=Q.external.uri(H)}Object.assign(J,Y.def??Y.schema);let X=Q.external?.defs??{};for(let H of Q.seen.entries()){let G=H[1];if(G.def&&G.defId)X[G.defId]=G.def}if(Q.external);else if(Object.keys(X).length>0)if(Q.target==="draft-2020-12")J.$defs=X;else J.definitions=X;try{let H=JSON.parse(JSON.stringify(J));return Object.defineProperty(H,"~standard",{value:{...$["~standard"],jsonSchema:{input:z2($,"input",Q.processors),output:z2($,"output",Q.processors)}},enumerable:!1,writable:!1}),H}catch(H){throw Error("Error converting schema to JSON.")}}function Y0(Q,$){let Y=$??{seen:new Set};if(Y.seen.has(Q))return!1;Y.seen.add(Q);let q=Q._zod.def;if(q.type==="transform")return!0;if(q.type==="array")return Y0(q.element,Y);if(q.type==="set")return Y0(q.valueType,Y);if(q.type==="lazy")return Y0(q.getter(),Y);if(q.type==="promise"||q.type==="optional"||q.type==="nonoptional"||q.type==="nullable"||q.type==="readonly"||q.type==="default"||q.type==="prefault")return Y0(q.innerType,Y);if(q.type==="intersection")return Y0(q.left,Y)||Y0(q.right,Y);if(q.type==="record"||q.type==="map")return Y0(q.keyType,Y)||Y0(q.valueType,Y);if(q.type==="pipe")return Y0(q.in,Y)||Y0(q.out,Y);if(q.type==="object"){for(let J in q.shape)if(Y0(q.shape[J],Y))return!0;return!1}if(q.type==="union"){for(let J of q.options)if(Y0(J,Y))return!0;return!1}if(q.type==="tuple"){for(let J of q.items)if(Y0(J,Y))return!0;if(q.rest&&Y0(q.rest,Y))return!0;return!1}return!1}var AY=(Q,$={})=>(Y)=>{let q=K4({...Y,processors:$});return m1(Q,q),W4(q,Q),z4(q,Q)},z2=(Q,$,Y={})=>(q)=>{let{libraryOptions:J,target:X}=q??{},H=K4({...J??{},target:X,io:$,processors:Y});return m1(Q,H),W4(H,Q),z4(H,Q)};var K3=A(()=>{s7()});var rW,LY=(Q,$,Y,q)=>{let J=Y;J.type="string";let{minimum:X,maximum:H,format:G,patterns:K,contentEncoding:W}=Q._zod.bag;if(typeof X==="number")J.minLength=X;if(typeof H==="number")J.maxLength=H;if(G){if(J.format=rW[G]??G,J.format==="")delete J.format;if(G==="time")delete J.format}if(W)J.contentEncoding=W;if(K&&K.size>0){let z=[...K];if(z.length===1)J.pattern=z[0].source;else if(z.length>1)J.allOf=[...z.map((B)=>({...$.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},FY=(Q,$,Y,q)=>{let J=Y,{minimum:X,maximum:H,format:G,multipleOf:K,exclusiveMaximum:W,exclusiveMinimum:z}=Q._zod.bag;if(typeof G==="string"&&G.includes("int"))J.type="integer";else J.type="number";if(typeof z==="number")if($.target==="draft-04"||$.target==="openapi-3.0")J.minimum=z,J.exclusiveMinimum=!0;else J.exclusiveMinimum=z;if(typeof X==="number"){if(J.minimum=X,typeof z==="number"&&$.target!=="draft-04")if(z>=X)delete J.minimum;else delete J.exclusiveMinimum}if(typeof W==="number")if($.target==="draft-04"||$.target==="openapi-3.0")J.maximum=W,J.exclusiveMaximum=!0;else J.exclusiveMaximum=W;if(typeof H==="number"){if(J.maximum=H,typeof W==="number"&&$.target!=="draft-04")if(W<=H)delete J.maximum;else delete J.exclusiveMaximum}if(typeof K==="number")J.multipleOf=K},jY=(Q,$,Y,q)=>{Y.type="boolean"},wY=(Q,$,Y,q)=>{Y.not={}},DY=(Q,$,Y,q)=>{},OY=(Q,$,Y,q)=>{},IY=(Q,$,Y,q)=>{let J=Q._zod.def,X=Q2(J.entries);if(X.every((H)=>typeof H==="number"))Y.type="number";if(X.every((H)=>typeof H==="string"))Y.type="string";Y.enum=X},NY=(Q,$,Y,q)=>{let J=Q._zod.def,X=[];for(let H of J.values)if(H===void 0){if($.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof H==="bigint")if($.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(H));else X.push(H);if(X.length===0);else if(X.length===1){let H=X[0];if(Y.type=H===null?"null":typeof H,$.target==="draft-04"||$.target==="openapi-3.0")Y.enum=[H];else Y.const=H}else{if(X.every((H)=>typeof H==="number"))Y.type="number";if(X.every((H)=>typeof H==="string"))Y.type="string";if(X.every((H)=>typeof H==="boolean"))Y.type="boolean";if(X.every((H)=>H===null))Y.type="null";Y.enum=X}},TY=(Q,$,Y,q)=>{if($.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},bY=(Q,$,Y,q)=>{if($.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},RY=(Q,$,Y,q)=>{let J=Y,X=Q._zod.def,{minimum:H,maximum:G}=Q._zod.bag;if(typeof H==="number")J.minItems=H;if(typeof G==="number")J.maxItems=G;J.type="array",J.items=m1(X.element,$,{...q,path:[...q.path,"items"]})},SY=(Q,$,Y,q)=>{let J=Y,X=Q._zod.def;J.type="object",J.properties={};let H=X.shape;for(let W in H)J.properties[W]=m1(H[W],$,{...q,path:[...q.path,"properties",W]});let G=new Set(Object.keys(H)),K=new Set([...G].filter((W)=>{let z=X.shape[W]._zod;if($.io==="input")return z.optin===void 0;else return z.optout===void 0}));if(K.size>0)J.required=Array.from(K);if(X.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!X.catchall){if($.io==="output")J.additionalProperties=!1}else if(X.catchall)J.additionalProperties=m1(X.catchall,$,{...q,path:[...q.path,"additionalProperties"]})},EY=(Q,$,Y,q)=>{let J=Q._zod.def,X=J.inclusive===!1,H=J.options.map((G,K)=>m1(G,$,{...q,path:[...q.path,X?"oneOf":"anyOf",K]}));if(X)Y.oneOf=H;else Y.anyOf=H},kY=(Q,$,Y,q)=>{let J=Q._zod.def,X=m1(J.left,$,{...q,path:[...q.path,"allOf",0]}),H=m1(J.right,$,{...q,path:[...q.path,"allOf",1]}),G=(W)=>("allOf"in W)&&Object.keys(W).length===1,K=[...G(X)?X.allOf:[X],...G(H)?H.allOf:[H]];Y.allOf=K},vY=(Q,$,Y,q)=>{let J=Y,X=Q._zod.def;J.type="object";let H=X.keyType,K=H._zod.bag?.patterns;if(X.mode==="loose"&&K&&K.size>0){let z=m1(X.valueType,$,{...q,path:[...q.path,"patternProperties","*"]});J.patternProperties={};for(let B of K)J.patternProperties[B.source]=z}else{if($.target==="draft-07"||$.target==="draft-2020-12")J.propertyNames=m1(X.keyType,$,{...q,path:[...q.path,"propertyNames"]});J.additionalProperties=m1(X.valueType,$,{...q,path:[...q.path,"additionalProperties"]})}let W=H._zod.values;if(W){let z=[...W].filter((B)=>typeof B==="string"||typeof B==="number");if(z.length>0)J.required=z}},PY=(Q,$,Y,q)=>{let J=Q._zod.def,X=m1(J.innerType,$,q),H=$.seen.get(Q);if($.target==="openapi-3.0")H.ref=J.innerType,Y.nullable=!0;else Y.anyOf=[X,{type:"null"}]},xY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType},CY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType,Y.default=JSON.parse(JSON.stringify(J.defaultValue))},yY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);if(X.ref=J.innerType,$.io==="input")Y._prefault=JSON.parse(JSON.stringify(J.defaultValue))},hY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType;let H;try{H=J.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}Y.default=H},fY=(Q,$,Y,q)=>{let J=Q._zod.def,X=$.io==="input"?J.in._zod.def.type==="transform"?J.out:J.in:J.out;m1(X,$,q);let H=$.seen.get(Q);H.ref=X},uY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType,Y.readOnly=!0},B4=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType};var mY=A(()=>{K3();C0();rW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""}});var gY=()=>{};var o0=A(()=>{C0();t2();o7();gY();U9();h7();y7();E$();e2();d7();s7();VY();K3()});var _4=A(()=>{o0()});function cY(Q){return qY(qz,Q)}function dY(Q){return JY(Jz,Q)}function pY(Q){return XY(Xz,Q)}function lY(Q){return HY(Hz,Q)}var qz,Jz,Xz,Hz;var Z4=A(()=>{o0();M4();qz=j("ZodISODateTime",(Q,$)=>{nQ.init(Q,$),S1.init(Q,$)});Jz=j("ZodISODate",(Q,$)=>{oQ.init(Q,$),S1.init(Q,$)});Xz=j("ZodISOTime",(Q,$)=>{sQ.init(Q,$),S1.init(Q,$)});Hz=j("ZodISODuration",(Q,$)=>{rQ.init(Q,$),S1.init(Q,$)})});var nY=(Q,$)=>{n2.init(Q,$),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(Y)=>E5(Q,Y)},flatten:{value:(Y)=>S5(Q,Y)},addIssue:{value:(Y)=>{Q.issues.push(Y),Q.message=JSON.stringify(Q.issues,A9,2)}},addIssues:{value:(Y)=>{Q.issues.push(...Y),Q.message=JSON.stringify(Q.issues,A9,2)}},isEmpty:{get(){return Q.issues.length===0}}})},U4,M0;var V4=A(()=>{o0();o0();C0();U4=j("ZodError",nY),M0=j("ZodError",nY,{Parent:Error})});var oY,sY,rY,aY,tY,eY,Qq,$q,Yq,qq,Jq,Xq;var A4=A(()=>{o0();V4();oY=o2(M0),sY=s2(M0),rY=X2(M0),aY=H2(M0),tY=P5(M0),eY=x5(M0),Qq=C5(M0),$q=y5(M0),Yq=h5(M0),qq=f5(M0),Jq=u5(M0),Xq=m5(M0)});function F(Q){return C$(Wz,Q)}function j9(Q){return GY(_q,Q)}function Gq(Q){return KY(bz,Q)}function i1(Q){return WY(Rz,Q)}function Zq(){return zY(Sz)}function I8(){return BY(Ez)}function vz(Q){return _Y(kz,Q)}function R1(Q,$){return ZY(Pz,Q,$)}function Q1(Q,$){let Y={type:"object",shape:Q??{},...W1.normalizeParams($)};return new xz(Y)}function U0(Q,$){return new Cz({type:"union",options:Q,...W1.normalizeParams($)})}function hz(Q,$){return new yz({type:"intersection",left:Q,right:$})}function q1(Q,$,Y){return new fz({type:"record",keyType:Q,valueType:$,...W1.normalizeParams(Y)})}function t1(Q,$){let Y=Array.isArray(Q)?Object.fromEntries(Q.map((q)=>[q,q])):Q;return new L4({type:"enum",entries:Y,...W1.normalizeParams($)})}function F4(Q,$){return new uz({type:"literal",values:Array.isArray(Q)?Q:[Q],...W1.normalizeParams($)})}function gz(Q){return new mz({type:"transform",transform:Q})}function Kq(Q){return new Mq({type:"optional",innerType:Q})}function dz(Q){return new cz({type:"optional",innerType:Q})}function Wq(Q){return new pz({type:"nullable",innerType:Q})}function iz(Q,$){return new lz({type:"default",innerType:Q,get defaultValue(){return typeof $==="function"?$():W1.shallowClone($)}})}function oz(Q,$){return new nz({type:"prefault",innerType:Q,get defaultValue(){return typeof $==="function"?$():W1.shallowClone($)}})}function sz(Q,$){return new Uq({type:"nonoptional",innerType:Q,...W1.normalizeParams($)})}function az(Q,$){return new rz({type:"catch",innerType:Q,catchValue:typeof $==="function"?$:()=>$})}function zq(Q,$){return new tz({type:"pipe",in:Q,out:$})}function QB(Q){return new ez({type:"readonly",innerType:Q})}function YB(Q,$={}){return MY($B,Q,$)}function qB(Q){return UY(Q)}var E1,Bq,Wz,S1,zz,Hq,W3,Bz,_z,Zz,Mz,Uz,Vz,Az,Lz,Fz,jz,wz,Dz,Oz,Iz,Nz,Tz,_q,bz,Rz,Sz,Ez,kz,Pz,xz,Cz,yz,fz,L4,uz,mz,Mq,cz,pz,lz,nz,Uq,rz,tz,ez,$B;var M4=A(()=>{o0();o0();mY();K3();_4();Z4();A4();E1=j("ZodType",(Q,$)=>{return T1.init(Q,$),Object.assign(Q["~standard"],{jsonSchema:{input:z2(Q,"input"),output:z2(Q,"output")}}),Q.toJSONSchema=AY(Q,{}),Q.def=$,Q.type=$.type,Object.defineProperty(Q,"_def",{value:$}),Q.check=(...Y)=>{return Q.clone(W1.mergeDefs($,{checks:[...$.checks??[],...Y.map((q)=>typeof q==="function"?{_zod:{check:q,def:{check:"custom"},onattach:[]}}:q)]}),{parent:!0})},Q.with=Q.check,Q.clone=(Y,q)=>P0(Q,Y,q),Q.brand=()=>Q,Q.register=(Y,q)=>{return Y.add(Q,q),Q},Q.parse=(Y,q)=>oY(Q,Y,q,{callee:Q.parse}),Q.safeParse=(Y,q)=>rY(Q,Y,q),Q.parseAsync=async(Y,q)=>sY(Q,Y,q,{callee:Q.parseAsync}),Q.safeParseAsync=async(Y,q)=>aY(Q,Y,q),Q.spa=Q.safeParseAsync,Q.encode=(Y,q)=>tY(Q,Y,q),Q.decode=(Y,q)=>eY(Q,Y,q),Q.encodeAsync=async(Y,q)=>Qq(Q,Y,q),Q.decodeAsync=async(Y,q)=>$q(Q,Y,q),Q.safeEncode=(Y,q)=>Yq(Q,Y,q),Q.safeDecode=(Y,q)=>qq(Q,Y,q),Q.safeEncodeAsync=async(Y,q)=>Jq(Q,Y,q),Q.safeDecodeAsync=async(Y,q)=>Xq(Q,Y,q),Q.refine=(Y,q)=>Q.check(YB(Y,q)),Q.superRefine=(Y)=>Q.check(qB(Y)),Q.overwrite=(Y)=>Q.check(O8(Y)),Q.optional=()=>Kq(Q),Q.exactOptional=()=>dz(Q),Q.nullable=()=>Wq(Q),Q.nullish=()=>Kq(Wq(Q)),Q.nonoptional=(Y)=>sz(Q,Y),Q.array=()=>R1(Q),Q.or=(Y)=>U0([Q,Y]),Q.and=(Y)=>hz(Q,Y),Q.transform=(Y)=>zq(Q,gz(Y)),Q.default=(Y)=>iz(Q,Y),Q.prefault=(Y)=>oz(Q,Y),Q.catch=(Y)=>az(Q,Y),Q.pipe=(Y)=>zq(Q,Y),Q.readonly=()=>QB(Q),Q.describe=(Y)=>{let q=Q.clone();return f8.add(q,{description:Y}),q},Object.defineProperty(Q,"description",{get(){return f8.get(Q)?.description},configurable:!0}),Q.meta=(...Y)=>{if(Y.length===0)return f8.get(Q);let q=Q.clone();return f8.add(q,Y[0]),q},Q.isOptional=()=>Q.safeParse(void 0).success,Q.isNullable=()=>Q.safeParse(null).success,Q.apply=(Y)=>Y(Q),Q}),Bq=j("_ZodString",(Q,$)=>{Y3.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>LY(Q,q,J,X);let Y=Q._zod.bag;Q.format=Y.format??null,Q.minLength=Y.minimum??null,Q.maxLength=Y.maximum??null,Q.regex=(...q)=>Q.check(a7(...q)),Q.includes=(...q)=>Q.check(Q4(...q)),Q.startsWith=(...q)=>Q.check($4(...q)),Q.endsWith=(...q)=>Q.check(Y4(...q)),Q.min=(...q)=>Q.check(F9(...q)),Q.max=(...q)=>Q.check(H3(...q)),Q.length=(...q)=>Q.check(G3(...q)),Q.nonempty=(...q)=>Q.check(F9(1,...q)),Q.lowercase=(q)=>Q.check(t7(q)),Q.uppercase=(q)=>Q.check(e7(q)),Q.trim=()=>Q.check(J4()),Q.normalize=(...q)=>Q.check(q4(...q)),Q.toLowerCase=()=>Q.check(X4()),Q.toUpperCase=()=>Q.check(H4()),Q.slugify=()=>Q.check(G4())}),Wz=j("ZodString",(Q,$)=>{Y3.init(Q,$),Bq.init(Q,$),Q.email=(Y)=>Q.check(y$(zz,Y)),Q.url=(Y)=>Q.check(g$(Bz,Y)),Q.jwt=(Y)=>Q.check(YY(Tz,Y)),Q.emoji=(Y)=>Q.check(c$(_z,Y)),Q.guid=(Y)=>Q.check(r7(Hq,Y)),Q.uuid=(Y)=>Q.check(h$(W3,Y)),Q.uuidv4=(Y)=>Q.check(f$(W3,Y)),Q.uuidv6=(Y)=>Q.check(u$(W3,Y)),Q.uuidv7=(Y)=>Q.check(m$(W3,Y)),Q.nanoid=(Y)=>Q.check(d$(Zz,Y)),Q.guid=(Y)=>Q.check(r7(Hq,Y)),Q.cuid=(Y)=>Q.check(p$(Mz,Y)),Q.cuid2=(Y)=>Q.check(l$(Uz,Y)),Q.ulid=(Y)=>Q.check(i$(Vz,Y)),Q.base64=(Y)=>Q.check(e$(Oz,Y)),Q.base64url=(Y)=>Q.check(QY(Iz,Y)),Q.xid=(Y)=>Q.check(n$(Az,Y)),Q.ksuid=(Y)=>Q.check(o$(Lz,Y)),Q.ipv4=(Y)=>Q.check(s$(Fz,Y)),Q.ipv6=(Y)=>Q.check(r$(jz,Y)),Q.cidrv4=(Y)=>Q.check(a$(wz,Y)),Q.cidrv6=(Y)=>Q.check(t$(Dz,Y)),Q.e164=(Y)=>Q.check($Y(Nz,Y)),Q.datetime=(Y)=>Q.check(cY(Y)),Q.date=(Y)=>Q.check(dY(Y)),Q.time=(Y)=>Q.check(pY(Y)),Q.duration=(Y)=>Q.check(lY(Y))});S1=j("ZodStringFormat",(Q,$)=>{b1.init(Q,$),Bq.init(Q,$)}),zz=j("ZodEmail",(Q,$)=>{fQ.init(Q,$),S1.init(Q,$)}),Hq=j("ZodGUID",(Q,$)=>{yQ.init(Q,$),S1.init(Q,$)}),W3=j("ZodUUID",(Q,$)=>{hQ.init(Q,$),S1.init(Q,$)}),Bz=j("ZodURL",(Q,$)=>{uQ.init(Q,$),S1.init(Q,$)}),_z=j("ZodEmoji",(Q,$)=>{mQ.init(Q,$),S1.init(Q,$)}),Zz=j("ZodNanoID",(Q,$)=>{gQ.init(Q,$),S1.init(Q,$)}),Mz=j("ZodCUID",(Q,$)=>{cQ.init(Q,$),S1.init(Q,$)}),Uz=j("ZodCUID2",(Q,$)=>{dQ.init(Q,$),S1.init(Q,$)}),Vz=j("ZodULID",(Q,$)=>{pQ.init(Q,$),S1.init(Q,$)}),Az=j("ZodXID",(Q,$)=>{lQ.init(Q,$),S1.init(Q,$)}),Lz=j("ZodKSUID",(Q,$)=>{iQ.init(Q,$),S1.init(Q,$)}),Fz=j("ZodIPv4",(Q,$)=>{aQ.init(Q,$),S1.init(Q,$)}),jz=j("ZodIPv6",(Q,$)=>{tQ.init(Q,$),S1.init(Q,$)}),wz=j("ZodCIDRv4",(Q,$)=>{eQ.init(Q,$),S1.init(Q,$)}),Dz=j("ZodCIDRv6",(Q,$)=>{Q$.init(Q,$),S1.init(Q,$)}),Oz=j("ZodBase64",(Q,$)=>{Y$.init(Q,$),S1.init(Q,$)}),Iz=j("ZodBase64URL",(Q,$)=>{q$.init(Q,$),S1.init(Q,$)}),Nz=j("ZodE164",(Q,$)=>{J$.init(Q,$),S1.init(Q,$)}),Tz=j("ZodJWT",(Q,$)=>{X$.init(Q,$),S1.init(Q,$)}),_q=j("ZodNumber",(Q,$)=>{l7.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>FY(Q,q,J,X),Q.gt=(q,J)=>Q.check(J3(q,J)),Q.gte=(q,J)=>Q.check(W2(q,J)),Q.min=(q,J)=>Q.check(W2(q,J)),Q.lt=(q,J)=>Q.check(q3(q,J)),Q.lte=(q,J)=>Q.check(K2(q,J)),Q.max=(q,J)=>Q.check(K2(q,J)),Q.int=(q)=>Q.check(Gq(q)),Q.safe=(q)=>Q.check(Gq(q)),Q.positive=(q)=>Q.check(J3(0,q)),Q.nonnegative=(q)=>Q.check(W2(0,q)),Q.negative=(q)=>Q.check(q3(0,q)),Q.nonpositive=(q)=>Q.check(K2(0,q)),Q.multipleOf=(q,J)=>Q.check(X3(q,J)),Q.step=(q,J)=>Q.check(X3(q,J)),Q.finite=()=>Q;let Y=Q._zod.bag;Q.minValue=Math.max(Y.minimum??Number.NEGATIVE_INFINITY,Y.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(Y.maximum??Number.POSITIVE_INFINITY,Y.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(Y.format??"").includes("int")||Number.isSafeInteger(Y.multipleOf??0.5),Q.isFinite=!0,Q.format=Y.format??null});bz=j("ZodNumberFormat",(Q,$)=>{H$.init(Q,$),_q.init(Q,$)});Rz=j("ZodBoolean",(Q,$)=>{G$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>jY(Q,Y,q,J)});Sz=j("ZodAny",(Q,$)=>{K$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>DY(Q,Y,q,J)});Ez=j("ZodUnknown",(Q,$)=>{W$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>OY(Q,Y,q,J)});kz=j("ZodNever",(Q,$)=>{z$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>wY(Q,Y,q,J)});Pz=j("ZodArray",(Q,$)=>{B$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>RY(Q,Y,q,J),Q.element=$.element,Q.min=(Y,q)=>Q.check(F9(Y,q)),Q.nonempty=(Y)=>Q.check(F9(1,Y)),Q.max=(Y,q)=>Q.check(H3(Y,q)),Q.length=(Y,q)=>Q.check(G3(Y,q)),Q.unwrap=()=>Q.element});xz=j("ZodObject",(Q,$)=>{M$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>SY(Q,Y,q,J),W1.defineLazy(Q,"shape",()=>{return $.shape}),Q.keyof=()=>t1(Object.keys(Q._zod.def.shape)),Q.catchall=(Y)=>Q.clone({...Q._zod.def,catchall:Y}),Q.passthrough=()=>Q.clone({...Q._zod.def,catchall:I8()}),Q.loose=()=>Q.clone({...Q._zod.def,catchall:I8()}),Q.strict=()=>Q.clone({...Q._zod.def,catchall:vz()}),Q.strip=()=>Q.clone({...Q._zod.def,catchall:void 0}),Q.extend=(Y)=>{return W1.extend(Q,Y)},Q.safeExtend=(Y)=>{return W1.safeExtend(Q,Y)},Q.merge=(Y)=>W1.merge(Q,Y),Q.pick=(Y)=>W1.pick(Q,Y),Q.omit=(Y)=>W1.omit(Q,Y),Q.partial=(...Y)=>W1.partial(Mq,Q,Y[0]),Q.required=(...Y)=>W1.required(Uq,Q,Y[0])});Cz=j("ZodUnion",(Q,$)=>{U$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>EY(Q,Y,q,J),Q.options=$.options});yz=j("ZodIntersection",(Q,$)=>{V$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>kY(Q,Y,q,J)});fz=j("ZodRecord",(Q,$)=>{A$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>vY(Q,Y,q,J),Q.keyType=$.keyType,Q.valueType=$.valueType});L4=j("ZodEnum",(Q,$)=>{L$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>IY(Q,q,J,X),Q.enum=$.entries,Q.options=Object.values($.entries);let Y=new Set(Object.keys($.entries));Q.extract=(q,J)=>{let X={};for(let H of q)if(Y.has(H))X[H]=$.entries[H];else throw Error(`Key ${H} not found in enum`);return new L4({...$,checks:[],...W1.normalizeParams(J),entries:X})},Q.exclude=(q,J)=>{let X={...$.entries};for(let H of q)if(Y.has(H))delete X[H];else throw Error(`Key ${H} not found in enum`);return new L4({...$,checks:[],...W1.normalizeParams(J),entries:X})}});uz=j("ZodLiteral",(Q,$)=>{F$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>NY(Q,Y,q,J),Q.values=new Set($.values),Object.defineProperty(Q,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});mz=j("ZodTransform",(Q,$)=>{j$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>bY(Q,Y,q,J),Q._zod.parse=(Y,q)=>{if(q.direction==="backward")throw new t9(Q.constructor.name);Y.addIssue=(X)=>{if(typeof X==="string")Y.issues.push(W1.issue(X,Y.value,$));else{let H=X;if(H.fatal)H.continue=!1;H.code??(H.code="custom"),H.input??(H.input=Y.value),H.inst??(H.inst=Q),Y.issues.push(W1.issue(H))}};let J=$.transform(Y.value,Y);if(J instanceof Promise)return J.then((X)=>{return Y.value=X,Y});return Y.value=J,Y}});Mq=j("ZodOptional",(Q,$)=>{i7.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>B4(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});cz=j("ZodExactOptional",(Q,$)=>{w$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>B4(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});pz=j("ZodNullable",(Q,$)=>{D$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>PY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});lz=j("ZodDefault",(Q,$)=>{O$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>CY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});nz=j("ZodPrefault",(Q,$)=>{I$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>yY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});Uq=j("ZodNonOptional",(Q,$)=>{N$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>xY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});rz=j("ZodCatch",(Q,$)=>{T$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>hY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});tz=j("ZodPipe",(Q,$)=>{b$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>fY(Q,Y,q,J),Q.in=$.in,Q.out=$.out});ez=j("ZodReadonly",(Q,$)=>{R$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>uY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});$B=j("ZodCustom",(Q,$)=>{S$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>TY(Q,Y,q,J)})});var Vq;var Aq=A(()=>{(function(Q){})(Vq||(Vq={}))});var Lq=()=>{};var Fq=A(()=>{o0();o0();k$();o7();Z4();Lq();M4();_4();V4();A4();Aq();O0(n7())});var G8=A(()=>{Fq()});var wq;var jq=A(()=>{wq={name:"ocx",version:"2.0.7",description:"OCX CLI - OpenCode extension manager with portable, isolated profiles. Your setup, anywhere.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts","release:tag":"bun run scripts/release-tag.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.3",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^9.3.0",remeda:"^2.33.7",zod:"^4.3.6"},devDependencies:{"@types/bun":"^1.3.11"}}});function HB(Q){return`https://${_2}/schemas/v${Q}/registry.json`}var _2="ocx.kdco.dev",Dq="kdcokenny/ocx",j4,w4,y0=2,h0,Oq;var z3=A(()=>{jq();j4=`https://${_2}/schemas/ocx.json`,w4=`https://${_2}/schemas/registry.json`;h0=HB(y0),Oq=wq.version});var H1,z1,B1,I1,h,L,u8,n1,m8,x1,f0,C1,N8,w9,u0,D9,D4;var t=A(()=>{H1={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};z1=class z1 extends Error{code;exitCode;constructor(Q,$,Y=H1.GENERAL){super(Q);this.code=$;this.exitCode=Y;this.name="OCXError"}};B1=class B1 extends z1{constructor(Q){super(Q,"NOT_FOUND",H1.NOT_FOUND);this.name="NotFoundError"}};I1=class I1 extends z1{url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor(Q,$){super(Q,"NETWORK_ERROR",H1.NETWORK);this.name="NetworkError",this.url=$?.url,this.status=$?.status,this.statusText=$?.statusText,this.phase=$?.phase,this.qualifiedName=$?.qualifiedName,this.registryContext=$?.registryContext,this.registryName=$?.registryName}};h=class h extends z1{constructor(Q){super(Q,"CONFIG_ERROR",H1.CONFIG);this.name="ConfigError"}};L=class L extends z1{constructor(Q){super(Q,"VALIDATION_ERROR",H1.GENERAL);this.name="ValidationError"}};u8=class u8 extends z1{details;constructor(Q){super("Registry validation failed","VALIDATION_FAILED",H1.CONFIG);this.details=Q;this.name="ValidationFailedError"}};n1=class n1 extends z1{constructor(Q){super(Q,"CONFLICT",H1.CONFLICT);this.name="ConflictError"}};m8=class m8 extends z1{component;expected;found;constructor(Q,$,Y){let q=`Integrity verification failed for "${Q}"
56
+ Expected: ${$}
57
+ Found: ${Y}
59
58
 
60
59
  The registry content has changed since this component was locked.
61
- Use 'ocx update ${$}' to intentionally update this component.`;super(Q,"INTEGRITY_ERROR",K$.INTEGRITY);this.component=$;this.expected=_;this.found=U;this.name="IntegrityError"}};f$=class f$ extends b${constructor($){super($,"UPDATE_ERROR",K$.GENERAL);this.name="SelfUpdateError"}};i4=class i4 extends b${url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor($,_){super($,"REGISTRY_COMPAT_ERROR",K$.CONFIG);this.name="RegistryCompatibilityError",this.url=_.url,this.issue=_.issue,this.remediation=_.remediation,this.schemaUrl=_.schemaUrl,this.supportedMajor=_.supportedMajor,this.detectedMajor=_.detectedMajor}};m$=class m$ extends b${profile;constructor($,_){let U=_??`Profile "${$}" not found`;super(U,"NOT_FOUND",K$.NOT_FOUND);this.profile=$;this.name="ProfileNotFoundError"}};m6=class m6 extends b${profile;constructor($,_){let U=_?`Profile "${$}" already exists. ${_}`:`Profile "${$}" already exists.`;super(U,"CONFLICT",K$.CONFLICT);this.profile=$;this.name="ProfileExistsError"}};W0=class W0 extends b${registryName;existingUrl;newUrl;targetLabel;existingName;conflictType;constructor($,_,U,Q,v){let J=Q?` in ${Q}`:"",Y=v!==void 0&&v!==$,z=Y?`Registry URL already registered under name "${v}"${J}.
62
- URL: ${_}
63
- Existing name: ${v}
64
- Requested name: ${$}
60
+ Use 'ocx update ${Q}' to intentionally update this component.`;super(q,"INTEGRITY_ERROR",H1.INTEGRITY);this.component=Q;this.expected=$;this.found=Y;this.name="IntegrityError"}};x1=class x1 extends z1{constructor(Q){super(Q,"UPDATE_ERROR",H1.GENERAL);this.name="SelfUpdateError"}};f0=class f0 extends z1{url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor(Q,$){super(Q,"REGISTRY_COMPAT_ERROR",H1.CONFIG);this.name="RegistryCompatibilityError",this.url=$.url,this.issue=$.issue,this.remediation=$.remediation,this.schemaUrl=$.schemaUrl,this.supportedMajor=$.supportedMajor,this.detectedMajor=$.detectedMajor}};C1=class C1 extends z1{profile;constructor(Q,$){let Y=$??`Profile "${Q}" not found`;super(Y,"NOT_FOUND",H1.NOT_FOUND);this.profile=Q;this.name="ProfileNotFoundError"}};N8=class N8 extends z1{profile;constructor(Q,$){let Y=$?`Profile "${Q}" already exists. ${$}`:`Profile "${Q}" already exists.`;super(Y,"CONFLICT",H1.CONFLICT);this.profile=Q;this.name="ProfileExistsError"}};w9=class w9 extends z1{registryName;existingUrl;newUrl;targetLabel;existingName;conflictType;constructor(Q,$,Y,q,J){let X=q?` in ${q}`:"",H=J!==void 0&&J!==Q,G=H?`Registry URL already registered under name "${J}"${X}.
61
+ URL: ${$}
62
+ Existing name: ${J}
63
+ Requested name: ${Q}
65
64
 
66
- Run 'ocx registry remove ${v}' first, then re-add with the new name.`:`Registry "${$}" already exists${J}.
67
- Current: ${_}
68
- New: ${U}
65
+ Run 'ocx registry remove ${J}' first, then re-add with the new name.`:`Registry "${Q}" already exists${X}.
66
+ Current: ${$}
67
+ New: ${Y}
69
68
 
70
- Run 'ocx registry remove ${$}' first, then re-add with the new URL.`;super(z,"CONFLICT",K$.CONFLICT);this.registryName=$;this.existingUrl=_;this.newUrl=U;this.targetLabel=Q;this.existingName=v;this.name="RegistryExistsError",this.conflictType=Y?"url":"name"}};n4=class n4 extends b${profile;reason;constructor($,_){super(`Invalid profile name "${$}": ${_}`,"VALIDATION_ERROR",K$.GENERAL);this.profile=$;this.reason=_;this.name="InvalidProfileNameError"}};b0=class b0 extends b${constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",K$.NOT_FOUND);this.name="ProfilesNotInitializedError"}};IJ=class IJ extends b${profile;localDir;constructor($,_){super(`Local profile directory unsupported: "${_}"
69
+ Run 'ocx registry remove ${Q}' first, then re-add with the new URL.`;super(G,"CONFLICT",H1.CONFLICT);this.registryName=Q;this.existingUrl=$;this.newUrl=Y;this.targetLabel=q;this.existingName=J;this.name="RegistryExistsError",this.conflictType=H?"url":"name"}};u0=class u0 extends z1{profile;reason;constructor(Q,$){super(`Invalid profile name "${Q}": ${$}`,"VALIDATION_ERROR",H1.GENERAL);this.profile=Q;this.reason=$;this.name="InvalidProfileNameError"}};D9=class D9 extends z1{constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",H1.NOT_FOUND);this.name="ProfilesNotInitializedError"}};D4=class D4 extends z1{profile;localDir;constructor(Q,$){super(`Local profile directory unsupported: "${$}"
71
70
 
72
71
  Local profiles are not supported. Profiles must be global only.
73
72
  Remove the local profile directory and use global profiles instead:
74
- rm -rf "${_}"
75
- ocx profile show ${$} --global`,"CONFIG_ERROR",K$.CONFIG);this.profile=$;this.localDir=_;this.name="LocalProfileUnsupportedError"}}});import*as P4 from"path";function A4($,_){if(_.includes("\x00"))throw new U4("Path contains null bytes",_,"null_byte");if(P4.isAbsolute(_)||P4.win32.isAbsolute(_))throw new U4("Path must be relative",_,"absolute_path");if(/^[a-zA-Z]:/.test(_)||_.startsWith("\\\\"))throw new U4("Path contains Windows absolute",_,"windows_absolute");let U=P4.basename(_).toUpperCase().split(".")[0]??"";if(mZ.has(U))throw new U4("Path uses Windows reserved name",_,"windows_reserved");let v=_.normalize("NFC").replace(/\\/g,"/"),J=P4.resolve($),Y=P4.resolve(J,v),z=P4.relative(J,Y);if(z.startsWith("../")||z.startsWith("..\\")||z===".."||P4.isAbsolute(z))throw new U4("Path escapes base directory",_,"path_traversal");return Y}var U4,mZ;var X1=b(()=>{U4=class U4 extends Error{attemptedPath;reason;constructor($,_,U){super($);this.attemptedPath=_;this.reason=U;this.name="PathValidationError"}};mZ=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"])});import{isAbsolute as gZ,normalize as zq}from"path";function r4($){if(!$.includes("/"))throw Error(`Invalid component reference: "${$}". Use format: alias/component`);let _=$.split("/");if(_.length>2)throw Error(`Invalid component reference: "${$}". Too many "/" separators. Use format: alias/component`);let[U,Q]=_;if(!U||!Q)throw Error(`Invalid component reference: "${$}". Both alias and component are required.`);return{namespace:U,component:Q}}function GJ($,_){return`${$}/${_}`}function XJ($){if(gZ($))throw new M(`Invalid path: "${$}" - absolute paths not allowed`);if($.startsWith("~"))throw new M(`Invalid path: "${$}" - home directory paths not allowed`);if(zq($).startsWith(".."))throw new M(`Invalid path: "${$}" - path traversal not allowed`)}function Bq($){return $}function Yq($,_){if(hZ.has($))throw new M(`Target "${$}" is reserved for installer use`);try{A4("/dummy/base",$)}catch(Q){if(Q instanceof U4)throw new M(`Invalid target "${$}": ${Q.message}`);throw Q}if(_!=="profile"){let Q=zq($);if(Xq.some((J)=>Q===J||Q.startsWith(J)))throw new M(`Target path '${$}' is protected and cannot be overwritten by registry components`)}}function g6($,_){if(typeof $==="string"){XJ($);let U=Bq($);return Yq(U,_),{path:$,target:U}}return XJ($.path),XJ($.target),Yq($.target,_),$}function Zq($){if(typeof $==="string")return{type:"remote",url:$,enabled:!0};return $}function G1($){let _;if($.opencode){let{mcp:U,...Q}=$.opencode;_={...Q,...U&&{mcp:Object.fromEntries(Object.entries(U).map(([v,J])=>[v,Zq(J)]))}}}return{...$,files:$.files.map((U)=>g6(U,$.type)),opencode:_}}function Z0($){if($===null||$===void 0||typeof $!=="object")return null;let _=$;if(!Object.hasOwn(_,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${p4}".`,supportedMajor:d4};let Q=_.$schema;if(typeof Q!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:String(Q),supportedMajor:d4};if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};if(Q===zJ)return{issue:"legacy-schema-v1",remediation:`Schema URL "${zJ}" is legacy v1. Use "${p4}" instead.`,schemaUrl:Q,supportedMajor:d4};let v=Q.match(sZ);if(!v)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};let J=v[1];if(!J)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${p4}".`,schemaUrl:Q,supportedMajor:d4};let Y=Number.parseInt(J,10);if(Y!==d4)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${p4}" (v${d4}).`,schemaUrl:Q,supportedMajor:d4,detectedMajor:Y};return null}var OS,d2,qJ,Iq,B0,hZ,Xq,cZ,lZ,qq,Gq,jq,Kq,dZ,pZ,iZ,nZ,rZ,oZ,tZ,aZ,Hq,Wq,bq,q1,sZ,P_,j1,x_,jJ;var o4=b(()=>{B6();l2();z$();X1();OS=K.string().refine(($)=>$.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine(($)=>{let _=$.slice(4);if(!_)return!1;if(_.includes("..")||_.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),d2=K.string().min(1,"Name cannot be empty").max(64,"Name cannot exceed 64 characters").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Must be lowercase alphanumeric with single hyphen separators (e.g., 'my-component', 'my-plugin'). Cannot start/end with hyphen or have consecutive hyphens."}),qJ=K.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/,{message:'Must be in format "alias/component" (e.g., "kdco/researcher"). Both parts must be lowercase alphanumeric with hyphens.'});Iq=K.string().refine(($)=>{let _=/^[a-z0-9]+(-[a-z0-9]+)*$/,U=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return _.test($)||U.test($)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),B0=K.enum(["agent","skill","plugin","command","tool","bundle","profile"]),hZ=new Set([".ocx","ocx.lock"]),Xq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],cZ=K.string().min(1,"Target path cannot be empty").refine(($)=>{if($.startsWith("/")||/^[a-zA-Z]:/.test($))return!1;if($.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine(($)=>{return!Xq.some((_)=>$===_||$.startsWith(_))},{message:"Target path is protected and cannot be overwritten by registry components"}),lZ=K.object({clientId:K.string().optional(),scopes:K.array(K.string()).optional(),authUrl:K.string().optional(),tokenUrl:K.string().optional()}),qq=K.object({type:K.enum(["remote","local"]),url:K.string().optional(),command:K.union([K.string(),K.array(K.string())]).optional(),environment:K.record(K.string(),K.string()).optional(),headers:K.record(K.string(),K.string()).optional(),oauth:K.union([K.boolean(),lZ]).optional(),enabled:K.boolean().default(!0)}).refine(($)=>{if($.type==="remote"&&!$.url)return!1;if($.type==="local"&&!$.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),Gq=K.union([K.string(),qq]),jq=K.object({path:K.string().min(1,"File path cannot be empty"),target:K.string().min(1,"Target path cannot be empty")}),Kq=K.union([K.string().min(1,"File path cannot be empty"),jq]),dZ=K.object({api:K.string().optional(),headers:K.record(K.string(),K.string()).optional(),env:K.record(K.string(),K.string()).optional(),enabled:K.boolean().optional()}).passthrough(),pZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),enabled:K.boolean().optional()}).passthrough(),iZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),glob:K.string().optional()}).passthrough(),nZ=K.object({description:K.string().optional(),run:K.string().optional()}).passthrough(),rZ=K.object({disabled:K.boolean().optional()}).passthrough(),oZ=K.object({host:K.string().optional(),port:K.number().optional()}).passthrough(),tZ=K.record(K.string(),K.string()),aZ=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough(),Hq=K.object({model:K.string().optional(),description:K.string().optional(),steps:K.number().int().positive().optional(),maxSteps:K.number().int().positive().optional(),mode:K.enum(["primary","subagent","all"]).optional(),tools:K.record(K.string(),K.boolean()).optional(),temperature:K.number().optional(),top_p:K.number().optional(),prompt:K.string().optional(),permission:K.record(K.string(),K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])).optional(),color:K.string().optional(),disable:K.boolean().optional(),options:K.record(K.string(),K.any()).optional()}),Wq=K.object({bash:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),edit:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),mcp:K.record(K.string(),K.enum(["ask","allow","deny"])).optional()}).catchall(K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])),bq=K.object({$schema:K.string().optional(),theme:K.string().optional(),logLevel:K.string().optional(),username:K.string().optional(),model:K.string().optional(),small_model:K.string().optional(),default_agent:K.string().optional(),mcp:K.record(K.string(),Gq).optional(),plugin:K.array(K.string()).optional(),tools:K.record(K.string(),K.boolean()).optional(),agent:K.record(K.string(),Hq).optional(),instructions:K.array(K.string()).optional(),permission:Wq.optional(),provider:K.record(K.string(),dZ).optional(),lsp:K.record(K.string(),pZ).optional(),formatter:K.record(K.string(),iZ).optional(),command:K.record(K.string(),nZ).optional(),tui:rZ.optional(),server:oZ.optional(),keybind:tZ.optional(),watcher:aZ.optional(),auto_update:K.boolean().optional(),auto_compact:K.boolean().optional(),share:K.union([K.boolean(),K.string()]).optional()}),q1=K.object({name:d2,type:B0,description:K.string().min(1).max(1024),files:K.array(Kq).default([]),dependencies:K.array(Iq).default([]),npmDependencies:K.array(K.string()).optional(),npmDevDependencies:K.array(K.string()).optional(),opencode:bq.optional()});sZ=new RegExp(`^https://${E_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);P_=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,j1=K.object({$schema:K.string().optional(),name:K.string().min(1,"Registry name cannot be empty"),version:K.string().regex(P_,{message:"Version must be valid semver"}),author:K.string().min(1,"Author cannot be empty"),opencode:K.string().regex(P_,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(P_,{message:"OCX version must be valid semver"}).optional(),components:K.array(q1)}).refine(($)=>{let _=new Set($.components.map((U)=>U.name));for(let U of $.components)for(let Q of U.dependencies)if(!Q.includes("/")&&!_.has(Q))return!1;return!0},{message:"Bare dependencies must reference components that exist in the registry. Use qualified references (e.g., 'other-registry/component') for cross-registry dependencies."}),x_=K.object({name:d2,"dist-tags":K.object({latest:K.string()}),versions:K.record(K.string(),q1)}),jJ=K.object({$schema:K.string().optional(),author:K.string(),opencode:K.string().regex(P_,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(P_,{message:"OCX version must be valid semver"}).optional(),components:K.array(K.object({name:d2,type:B0,description:K.string()}))})});import{mkdir as KJ}from"fs/promises";import{dirname as eZ,join as Y6}from"path";async function u_($){let{source:_,out:U}=$,Q=Bun.file(Y6(_,"registry.jsonc")),v=Bun.file(Y6(_,"registry.json")),J=await Q.exists(),Y=await v.exists();if(!J&&!Y)throw new z6("No registry.jsonc or registry.json found in source directory");let I=await(J?Q:v).text(),X=x$(I,[],{allowTrailingComma:!0}),q=Z0(X);if(q)throw new z6(`Registry schema compatibility failed (${q.issue})`,[q.remediation,...q.schemaUrl!==void 0?[`Invalid $schema: ${q.schemaUrl}`]:[]]);let G=j1.safeParse(X);if(!G.success){let A=G.error.issues.map((u)=>`${u.path.join(".")}: ${u.message}`);throw new z6("Registry validation failed",A)}let j=G.data,H=[];if($.dryRun){let A=[];for(let k of j.components){A.push({action:"create",target:`file:components/${k.name}.json`,details:{type:"packument"}});for(let O of k.files){let w=g6(O,k.type),v$=Y6(_,"files",w.path);if(!await Bun.file(v$).exists()){H.push(`${k.name}: Source file not found at ${v$}`);continue}A.push({action:"create",target:`file:components/${k.name}/${w.path}`,details:{source:v$}})}}A.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),A.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let u=A.filter((k)=>k.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:A,validation:{passed:H.length===0,errors:H.length>0?H:void 0},summary:`Would build ${j.components.length} components, ${u} files to ${U}`}}let Z=Y6(U,"components");await KJ(Z,{recursive:!0});let V="1.0.0";for(let A of j.components){let u={name:A.name,versions:{[V]:A},"dist-tags":{latest:V}},k=Y6(Z,`${A.name}.json`);await Bun.write(k,JSON.stringify(u,null,2));for(let O of A.files){let w=g6(O,A.type),v$=Y6(_,"files",w.path),o=Y6(Z,A.name,w.path),Q$=eZ(o);if(!await Bun.file(v$).exists()){H.push(`${A.name}: Source file not found at ${v$}`);continue}await KJ(Q$,{recursive:!0});let D$=Bun.file(v$);await Bun.write(o,D$)}}if(H.length>0)throw new z6(`Build failed with ${H.length} errors`,H);let S={$schema:j.$schema,name:j.name,version:j.version,author:j.author,...j.opencode&&{opencode:j.opencode},...j.ocx&&{ocx:j.ocx},components:j.components.map((A)=>({name:A.name,type:A.type,description:A.description}))};await Bun.write(Y6(U,"index.json"),JSON.stringify(S,null,2));let T=Y6(U,".well-known");await KJ(T,{recursive:!0});let r={registry:"/index.json"};return await Bun.write(Y6(T,"ocx.json"),JSON.stringify(r,null,2)),{componentsCount:j.components.length,outputPath:U}}var z6;var p2=b(()=>{c4();o4();z6=class z6 extends Error{errors;constructor($,_=[]){super($);this.errors=_;this.name="BuildRegistryError"}}});import Vq from"path";function Dq($){return Vq.posix.isAbsolute($)||Vq.win32.isAbsolute($)}var Mq=()=>{};var HJ;var WJ=b(()=>{B6();Mq();HJ=K.string().refine(($)=>!$.includes("\x00"),"Path cannot contain null bytes").refine(($)=>!$.split(/[/\\]/).some((_)=>_===".."),"Path cannot contain '..'").refine(($)=>!Dq($),"Path must be relative, not absolute")});function d$($){return $.trim().replace(/\/+$/,"")}import{existsSync as V0}from"fs";import{mkdir as Lq}from"fs/promises";import Z6 from"path";function C_($,_,U,Q){return`${d$($)}::${_}/${U}@${Q}`}function c6($){if(!$.includes("::"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let[_,U]=$.split("::");if(!U||!_)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!U.includes("@"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let Q=U.indexOf("@");if(Q===-1)throw Error(`Invalid canonical ID: missing revision in ${$}`);let v=U.slice(0,Q),J=U.slice(Q+1);if(!v||!J)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!v.includes("/"))throw Error(`Invalid canonical ID: "${$}". Component must be qualified (registryName/component)`);let[Y,z]=v.split("/");if(!Y||!z)throw Error(`Invalid canonical ID: "${$}". Both registry name and component name are required`);return{registryUrl:d$(_),registryName:Y,name:z,revision:J}}function l6($){let _=Z6.join($,kq,Aq);return{path:_,exists:V0(_)}}async function F4($){let{path:_,exists:U}=l6($);if(!U)return null;let v=await Bun.file(_).text(),J=x$(v,[],{allowTrailingComma:!0});return Oq.parse(J)}async function x4($,_){let U=Z6.join($,kq,Aq);await Lq(Z6.dirname(U),{recursive:!0});let Q=JSON.stringify(_,null,2);await Bun.write(U,Q)}function d6($){let _=Z6.join($,bJ,y_),U=Z6.join($,y_),Q=V0(_),v=V0(U);if(Q&&v)throw Error(`Found ${y_} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${y_})`);if(Q)return{path:_,exists:!0};if(v)return{path:U,exists:!0};return{path:_,exists:!1}}function D0($,_){let U=Z6.join($,bJ,wq),Q=Z6.join($,wq);if(_?.isFlattened){if(V0(Q))return{path:Q,exists:!0};return{path:Q,exists:!1}}if(V0(U))return{path:U,exists:!0};if(V0(Q))return{path:Q,exists:!0};return{path:U,exists:!1}}async function u4($,_={}){let{path:U,exists:Q}=d6($);if(!Q)return null;let J=await Bun.file(U).text();try{let Y=x$(J,[],{allowTrailingComma:!0});return h6.parse(Y)}catch(Y){if(_.emitParseDiagnostics??!0)console.error(`Error parsing ${U}:`,Y);throw Y}}async function r2($,_,U){let Q=U??Z6.join($,bJ,y_);await Lq(Z6.dirname(Q),{recursive:!0});let v=JSON.stringify(_,null,2);await Bun.write(Q,v)}async function f_($,_){let{path:U,exists:Q}=D0($,_);if(!Q)return null;let J=await Bun.file(U).text(),Y=x$(J,[],{allowTrailingComma:!0});return n2.parse(Y)}var i2,h6,kq=".ocx",Aq="receipt.jsonc",Fq,Oq,$V,_V,n2,y_="ocx.jsonc",wq="ocx.lock",bJ=".opencode";var X4=b(()=>{c4();B6();o4();i2=K.object({url:K.string().url("Registry URL must be a valid URL"),headers:K.record(K.string(),K.string()).optional()}),h6=K.object({$schema:K.string().optional(),profile:K.string().optional(),registries:K.record(K.string(),i2).default({}),lockRegistries:K.boolean().default(!1),skipCompatCheck:K.boolean().default(!1)}),Fq=K.object({registryUrl:K.string(),registryName:K.string(),name:K.string(),revision:K.string(),hash:K.string(),files:K.array(K.object({path:K.string(),hash:K.string()})),installedAt:K.string(),updatedAt:K.string().optional(),owner:K.object({type:K.enum(["user","profile","system"]),id:K.string().optional()}).optional(),opencode:K.record(K.string(),K.unknown()).optional()}),Oq=K.object({version:K.literal(1),root:K.string().optional(),installed:K.record(K.string(),Fq).default({})}),$V=K.object({registry:K.string(),version:K.string(),hash:K.string(),files:K.array(K.string()),installedAt:K.string(),updatedAt:K.string().optional()}),_V=K.object({registry:K.string(),component:K.string(),version:K.string().optional(),hash:K.string(),installedAt:K.string()}),n2=K.object({lockVersion:K.literal(1),installedFrom:_V.optional(),installed:K.record(qJ,$V).default({})})});var{Glob:vV}=globalThis.Bun;var Nq,V6;var M0=b(()=>{B6();WJ();X4();Nq=K.string().refine(($)=>{try{return new vV($),!0}catch{return!1}},{message:"Invalid glob pattern"}),V6=K.object({$schema:K.string().optional(),bin:K.string().optional(),registries:K.record(K.string(),i2).default({}),componentPath:HJ.optional(),renameWindow:K.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:K.array(Nq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:K.array(Nq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var BJ=b(()=>{WJ();X4();M0();o4()});var m_=N6((UV)=>{class ZJ extends Error{constructor($,_,U){super(U);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=$,this.nestedError=void 0}}class Sq extends ZJ{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}UV.CommanderError=ZJ;UV.InvalidArgumentError=Sq});var o2=N6((IV)=>{var{InvalidArgumentError:YV}=m_();class Tq{constructor($,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,_){if(_===this.defaultValue||!Array.isArray(_))return[$];return _.push($),_}default($,_){return this.defaultValue=$,this.defaultValueDescription=_,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(_,U)=>{if(!this.argChoices.includes(_))throw new YV(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,U);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function zV($){let _=$.name()+($.variadic===!0?"...":"");return $.required?"<"+_+">":"["+_+"]"}IV.Argument=Tq;IV.humanReadableArgName=zV});var VJ=N6((jV)=>{var{humanReadableArgName:GV}=o2();class Rq{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let _=$.commands.filter((Q)=>!Q._hidden),U=$._getHelpCommand();if(U&&!U._hidden)_.push(U);if(this.sortSubcommands)_.sort((Q,v)=>{return Q.name().localeCompare(v.name())});return _}compareOptions($,_){let U=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return U($).localeCompare(U(_))}visibleOptions($){let _=$.options.filter((Q)=>!Q.hidden),U=$._getHelpOption();if(U&&!U.hidden){let Q=U.short&&$._findOption(U.short),v=U.long&&$._findOption(U.long);if(!Q&&!v)_.push(U);else if(U.long&&!v)_.push($.createOption(U.long,U.description));else if(U.short&&!Q)_.push($.createOption(U.short,U.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let _=[];for(let U=$.parent;U;U=U.parent){let Q=U.options.filter((v)=>!v.hidden);_.push(...Q)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((_)=>{_.description=_.description||$._argsDescription[_.name()]||""});if($.registeredArguments.find((_)=>_.description))return $.registeredArguments;return[]}subcommandTerm($){let _=$.registeredArguments.map((U)=>GV(U)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(_?" "+_:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,_){return _.visibleCommands($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(Q))))},0)}longestOptionTermLength($,_){return _.visibleOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleOptionTerm(_.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,_){return _.visibleGlobalOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleOptionTerm(_.optionTerm(Q))))},0)}longestArgumentTermLength($,_){return _.visibleArguments($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(Q))))},0)}commandUsage($){let _=$._name;if($._aliases[0])_=_+"|"+$._aliases[0];let U="";for(let Q=$.parent;Q;Q=Q.parent)U=Q.name()+" "+U;return U+_+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let _=[];if($.argChoices)_.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")_.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)_.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)_.push(`env: ${$.envVar}`);if(_.length>0){let U=`(${_.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}argumentDescription($){let _=[];if($.argChoices)_.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0)_.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(_.length>0){let U=`(${_.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}formatItemList($,_,U){if(_.length===0)return[];return[U.styleTitle($),..._,""]}groupItems($,_,U){let Q=new Map;return $.forEach((v)=>{let J=U(v);if(!Q.has(J))Q.set(J,[])}),_.forEach((v)=>{let J=U(v);if(!Q.has(J))Q.set(J,[]);Q.get(J).push(v)}),Q}formatHelp($,_){let U=_.padWidth($,_),Q=_.helpWidth??80;function v(q,G){return _.formatItem(q,U,G,_)}let J=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage($))}`,""],Y=_.commandDescription($);if(Y.length>0)J=J.concat([_.boxWrap(_.styleCommandDescription(Y),Q),""]);let z=_.visibleArguments($).map((q)=>{return v(_.styleArgumentTerm(_.argumentTerm(q)),_.styleArgumentDescription(_.argumentDescription(q)))});if(J=J.concat(this.formatItemList("Arguments:",z,_)),this.groupItems($.options,_.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,G)=>{let j=q.map((H)=>{return v(_.styleOptionTerm(_.optionTerm(H)),_.styleOptionDescription(_.optionDescription(H)))});J=J.concat(this.formatItemList(G,j,_))}),_.showGlobalOptions){let q=_.visibleGlobalOptions($).map((G)=>{return v(_.styleOptionTerm(_.optionTerm(G)),_.styleOptionDescription(_.optionDescription(G)))});J=J.concat(this.formatItemList("Global Options:",q,_))}return this.groupItems($.commands,_.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,G)=>{let j=q.map((H)=>{return v(_.styleSubcommandTerm(_.subcommandTerm(H)),_.styleSubcommandDescription(_.subcommandDescription(H)))});J=J.concat(this.formatItemList(G,j,_))}),J.join(`
76
- `)}displayWidth($){return Eq($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,_){return Math.max(_.longestOptionTermLength($,_),_.longestGlobalOptionTermLength($,_),_.longestSubcommandTermLength($,_),_.longestArgumentTermLength($,_))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,_,U,Q){let J=" ".repeat(2);if(!U)return J+$;let Y=$.padEnd(_+$.length-Q.displayWidth($)),z=2,X=(this.helpWidth??80)-_-z-2,q;if(X<this.minWidthToWrap||Q.preformatted(U))q=U;else q=Q.boxWrap(U,X).replace(/\n/g,`
77
- `+" ".repeat(_+z));return J+Y+" ".repeat(z)+q.replace(/\n/g,`
78
- ${J}`)}boxWrap($,_){if(_<this.minWidthToWrap)return $;let U=$.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,v=[];return U.forEach((J)=>{let Y=J.match(Q);if(Y===null){v.push("");return}let z=[Y.shift()],I=this.displayWidth(z[0]);Y.forEach((X)=>{let q=this.displayWidth(X);if(I+q<=_){z.push(X),I+=q;return}v.push(z.join(""));let G=X.trimStart();z=[G],I=this.displayWidth(G)}),v.push(z.join(""))}),v.join(`
79
- `)}}function Eq($){let _=/\x1b\[\d*(;\d*)*m/g;return $.replace(_,"")}jV.Help=Rq;jV.stripColor=Eq});var DJ=N6((BV)=>{var{InvalidArgumentError:WV}=m_();class xq{constructor($,_){this.flags=$,this.description=_||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let U=bV($);if(this.short=U.shortFlag,this.long=U.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,_){return this.defaultValue=$,this.defaultValueDescription=_,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let _=$;if(typeof $==="string")_={[$]:!0};return this.implied=Object.assign(this.implied||{},_),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,_){if(_===this.defaultValue||!Array.isArray(_))return[$];return _.push($),_}choices($){return this.argChoices=$.slice(),this.parseArg=(_,U)=>{if(!this.argChoices.includes(_))throw new WV(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(_,U);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Pq(this.name().replace(/^no-/,""));return Pq(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class uq{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,U)=>{if(this.positiveOptions.has(U))this.dualOptions.add(U)})}valueFromOption($,_){let U=_.attributeName();if(!this.dualOptions.has(U))return!0;let Q=this.negativeOptions.get(U).presetArg,v=Q!==void 0?Q:!1;return _.negate===(v===$)}}function Pq($){return $.split("-").reduce((_,U)=>{return _+U[0].toUpperCase()+U.slice(1)})}function bV($){let _,U,Q=/^-[^-]$/,v=/^--[^-]/,J=$.split(/[ |,]+/).concat("guard");if(Q.test(J[0]))_=J.shift();if(v.test(J[0]))U=J.shift();if(!_&&Q.test(J[0]))_=J.shift();if(!_&&v.test(J[0]))_=U,U=J.shift();if(J[0].startsWith("-")){let Y=J[0],z=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${z}
73
+ rm -rf "${$}"
74
+ ocx profile show ${Q} --global`,"CONFIG_ERROR",H1.CONFIG);this.profile=Q;this.localDir=$;this.name="LocalProfileUnsupportedError"}}});import*as I0 from"path";function V0(Q,$){if($.includes("\x00"))throw new e1("Path contains null bytes",$,"null_byte");if(I0.isAbsolute($)||I0.win32.isAbsolute($))throw new e1("Path must be relative",$,"absolute_path");if(/^[a-zA-Z]:/.test($)||$.startsWith("\\\\"))throw new e1("Path contains Windows absolute",$,"windows_absolute");let Y=I0.basename($).toUpperCase().split(".")[0]??"";if(GB.has(Y))throw new e1("Path uses Windows reserved name",$,"windows_reserved");let J=$.normalize("NFC").replace(/\\/g,"/"),X=I0.resolve(Q),H=I0.resolve(X,J),G=I0.relative(X,H);if(G.startsWith("../")||G.startsWith("..\\")||G===".."||I0.isAbsolute(G))throw new e1("Path escapes base directory",$,"path_traversal");return H}var e1,GB;var g8=A(()=>{e1=class e1 extends Error{attemptedPath;reason;constructor(Q,$,Y){super(Q);this.attemptedPath=$;this.reason=Y;this.name="PathValidationError"}};GB=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"])});import{isAbsolute as KB,normalize as Nq}from"path";function m0(Q){if(!Q.includes("/"))throw Error(`Invalid component reference: "${Q}". Use format: alias/component`);let $=Q.split("/");if($.length>2)throw Error(`Invalid component reference: "${Q}". Too many "/" separators. Use format: alias/component`);let[Y,q]=$;if(!Y||!q)throw Error(`Invalid component reference: "${Q}". Both alias and component are required.`);return{namespace:Y,component:q}}function N4(Q,$){return`${Q}/${$}`}function O4(Q){if(KB(Q))throw new L(`Invalid path: "${Q}" - absolute paths not allowed`);if(Q.startsWith("~"))throw new L(`Invalid path: "${Q}" - home directory paths not allowed`);if(Nq(Q).startsWith(".."))throw new L(`Invalid path: "${Q}" - path traversal not allowed`)}function Cq(Q){return Q}function Iq(Q,$){if(WB.has(Q))throw new L(`Target "${Q}" is reserved for installer use`);try{V0("/dummy/base",Q)}catch(q){if(q instanceof e1)throw new L(`Invalid target "${Q}": ${q.message}`);throw q}if($!=="profile"){let q=Nq(Q);if(bq.some((X)=>q===X||q.startsWith(X)))throw new L(`Target path '${Q}' is protected and cannot be overwritten by registry components`)}}function T8(Q,$){if(typeof Q==="string"){O4(Q);let Y=Cq(Q);return Iq(Y,$),{path:Q,target:Y}}return O4(Q.path),O4(Q.target),Iq(Q.target,$),Q}function yq(Q){if(typeof Q==="string")return{type:"remote",url:Q,enabled:!0};return Q}function d8(Q){let $;if(Q.opencode){let{mcp:Y,...q}=Q.opencode;$={...q,...Y&&{mcp:Object.fromEntries(Object.entries(Y).map(([J,X])=>[J,yq(X)]))}}}return{...Q,files:Q.files.map((Y)=>T8(Y,Q.type)),opencode:$}}function I9(Q){if(Q===null||Q===void 0||typeof Q!=="object")return null;let $=Q;if(!Object.hasOwn($,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${h0}".`,supportedMajor:y0};let q=$.$schema;if(typeof q!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${h0}".`,schemaUrl:String(q),supportedMajor:y0};if(!q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${h0}".`,schemaUrl:q,supportedMajor:y0};if(q===w4)return{issue:"legacy-schema-v1",remediation:`Schema URL "${w4}" is legacy v1. Use "${h0}" instead.`,schemaUrl:q,supportedMajor:y0};let J=q.match(jB);if(!J)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${h0}".`,schemaUrl:q,supportedMajor:y0};let X=J[1];if(!X)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${h0}".`,schemaUrl:q,supportedMajor:y0};let H=Number.parseInt(X,10);if(H!==y0)return{issue:"unsupported-schema-version",remediation:`Schema major v${H} is unsupported. Use "${h0}" (v${y0}).`,schemaUrl:q,supportedMajor:y0,detectedMajor:H};return null}var kw,B3,I4,Tq,O9,WB,bq,zB,BB,Rq,Sq,Eq,kq,_B,ZB,MB,UB,VB,AB,LB,FB,vq,Pq,xq,c8,jB,Z2,p8,M2,T4;var g0=A(()=>{G8();z3();t();g8();kw=F().refine((Q)=>Q.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine((Q)=>{let $=Q.slice(4);if(!$)return!1;if($.includes("..")||$.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),B3=F().min(1,"Name cannot be empty").max(64,"Name cannot exceed 64 characters").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Must be lowercase alphanumeric with single hyphen separators (e.g., 'my-component', 'my-plugin'). Cannot start/end with hyphen or have consecutive hyphens."}),I4=F().regex(/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/,{message:'Must be in format "alias/component" (e.g., "kdco/researcher"). Both parts must be lowercase alphanumeric with hyphens.'});Tq=F().refine((Q)=>{let $=/^[a-z0-9]+(-[a-z0-9]+)*$/,Y=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return $.test(Q)||Y.test(Q)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),O9=t1(["agent","skill","plugin","command","tool","bundle","profile"]),WB=new Set([".ocx","ocx.lock"]),bq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],zB=F().min(1,"Target path cannot be empty").refine((Q)=>{if(Q.startsWith("/")||/^[a-zA-Z]:/.test(Q))return!1;if(Q.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine((Q)=>{return!bq.some(($)=>Q===$||Q.startsWith($))},{message:"Target path is protected and cannot be overwritten by registry components"}),BB=Q1({clientId:F().optional(),scopes:R1(F()).optional(),authUrl:F().optional(),tokenUrl:F().optional()}),Rq=Q1({type:t1(["remote","local"]),url:F().optional(),command:U0([F(),R1(F())]).optional(),environment:q1(F(),F()).optional(),headers:q1(F(),F()).optional(),oauth:U0([i1(),BB]).optional(),enabled:i1().default(!0)}).refine((Q)=>{if(Q.type==="remote"&&!Q.url)return!1;if(Q.type==="local"&&!Q.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),Sq=U0([F(),Rq]),Eq=Q1({path:F().min(1,"File path cannot be empty"),target:F().min(1,"Target path cannot be empty")}),kq=U0([F().min(1,"File path cannot be empty"),Eq]),_B=Q1({api:F().optional(),headers:q1(F(),F()).optional(),env:q1(F(),F()).optional(),enabled:i1().optional()}).passthrough(),ZB=Q1({command:U0([F(),R1(F())]).optional(),enabled:i1().optional()}).passthrough(),MB=Q1({command:U0([F(),R1(F())]).optional(),glob:F().optional()}).passthrough(),UB=Q1({description:F().optional(),run:F().optional()}).passthrough(),VB=Q1({disabled:i1().optional()}).passthrough(),AB=Q1({host:F().optional(),port:j9().optional()}).passthrough(),LB=q1(F(),F()),FB=Q1({include:R1(F()).optional(),exclude:R1(F()).optional()}).passthrough(),vq=Q1({model:F().optional(),description:F().optional(),steps:j9().int().positive().optional(),maxSteps:j9().int().positive().optional(),mode:t1(["primary","subagent","all"]).optional(),tools:q1(F(),i1()).optional(),temperature:j9().optional(),top_p:j9().optional(),prompt:F().optional(),permission:q1(F(),U0([t1(["ask","allow","deny"]),q1(F(),t1(["ask","allow","deny"]))])).optional(),color:F().optional(),disable:i1().optional(),options:q1(F(),Zq()).optional()}),Pq=Q1({bash:U0([t1(["ask","allow","deny"]),q1(F(),t1(["ask","allow","deny"]))]).optional(),edit:U0([t1(["ask","allow","deny"]),q1(F(),t1(["ask","allow","deny"]))]).optional(),mcp:q1(F(),t1(["ask","allow","deny"])).optional()}).catchall(U0([t1(["ask","allow","deny"]),q1(F(),t1(["ask","allow","deny"]))])),xq=Q1({$schema:F().optional(),theme:F().optional(),logLevel:F().optional(),username:F().optional(),model:F().optional(),small_model:F().optional(),default_agent:F().optional(),mcp:q1(F(),Sq).optional(),plugin:R1(F()).optional(),tools:q1(F(),i1()).optional(),agent:q1(F(),vq).optional(),instructions:R1(F()).optional(),permission:Pq.optional(),provider:q1(F(),_B).optional(),lsp:q1(F(),ZB).optional(),formatter:q1(F(),MB).optional(),command:q1(F(),UB).optional(),tui:VB.optional(),server:AB.optional(),keybind:LB.optional(),watcher:FB.optional(),auto_update:i1().optional(),auto_compact:i1().optional(),share:U0([i1(),F()]).optional()}),c8=Q1({name:B3,type:O9,description:F().min(1).max(1024),files:R1(kq).default([]),dependencies:R1(Tq).default([]),npmDependencies:R1(F()).optional(),npmDevDependencies:R1(F()).optional(),opencode:xq.optional()});jB=new RegExp(`^https://${_2.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);Z2=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,p8=Q1({$schema:F().optional(),name:F().min(1,"Registry name cannot be empty"),version:F().regex(Z2,{message:"Version must be valid semver"}),author:F().min(1,"Author cannot be empty"),opencode:F().regex(Z2,{message:"OpenCode version must be valid semver"}).optional(),ocx:F().regex(Z2,{message:"OCX version must be valid semver"}).optional(),components:R1(c8)}).refine((Q)=>{let $=new Set(Q.components.map((Y)=>Y.name));for(let Y of Q.components)for(let q of Y.dependencies)if(!q.includes("/")&&!$.has(q))return!1;return!0},{message:"Bare dependencies must reference components that exist in the registry. Use qualified references (e.g., 'other-registry/component') for cross-registry dependencies."}),M2=Q1({name:B3,"dist-tags":Q1({latest:F()}),versions:q1(F(),c8)}),T4=Q1({$schema:F().optional(),author:F(),opencode:F().regex(Z2,{message:"OpenCode version must be valid semver"}).optional(),ocx:F().regex(Z2,{message:"OCX version must be valid semver"}).optional(),components:R1(Q1({name:B3,type:O9,description:F()}))})});import{mkdir as b4}from"fs/promises";import{dirname as wB,join as s0}from"path";async function U2(Q){let{source:$,out:Y}=Q,q=Bun.file(s0($,"registry.jsonc")),J=Bun.file(s0($,"registry.json")),X=await q.exists(),H=await J.exists();if(!X&&!H)throw new r0("No registry.jsonc or registry.json found in source directory");let K=await(X?q:J).text(),W=O1(K,[],{allowTrailingComma:!0}),z=I9(W);if(z)throw new r0(`Registry schema compatibility failed (${z.issue})`,[z.remediation,...z.schemaUrl!==void 0?[`Invalid $schema: ${z.schemaUrl}`]:[]]);let B=p8.safeParse(W);if(!B.success){let N=B.error.issues.map((x)=>`${x.path.join(".")}: ${x.message}`);throw new r0("Registry validation failed",N)}let Z=B.data,M=[];if(Q.dryRun){let N=[];for(let w of Z.components){N.push({action:"create",target:`file:components/${w.name}.json`,details:{type:"packument"}});for(let b of w.files){let D=T8(b,w.type),r=s0($,"files",D.path);if(!await Bun.file(r).exists()){M.push(`${w.name}: Source file not found at ${r}`);continue}N.push({action:"create",target:`file:components/${w.name}/${D.path}`,details:{source:r}})}}N.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),N.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let x=N.filter((w)=>w.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:N,validation:{passed:M.length===0,errors:M.length>0?M:void 0},summary:`Would build ${Z.components.length} components, ${x} files to ${Y}`}}let V=s0(Y,"components");await b4(V,{recursive:!0});let U="1.0.0";for(let N of Z.components){let x={name:N.name,versions:{[U]:N},"dist-tags":{latest:U}},w=s0(V,`${N.name}.json`);await Bun.write(w,JSON.stringify(x,null,2));for(let b of N.files){let D=T8(b,N.type),r=s0($,"files",D.path),n=s0(V,N.name,D.path),l=wB(n);if(!await Bun.file(r).exists()){M.push(`${N.name}: Source file not found at ${r}`);continue}await b4(l,{recursive:!0});let M1=Bun.file(r);await Bun.write(n,M1)}}if(M.length>0)throw new r0(`Build failed with ${M.length} errors`,M);let R={$schema:Z.$schema,name:Z.name,version:Z.version,author:Z.author,...Z.opencode&&{opencode:Z.opencode},...Z.ocx&&{ocx:Z.ocx},components:Z.components.map((N)=>({name:N.name,type:N.type,description:N.description}))};await Bun.write(s0(Y,"index.json"),JSON.stringify(R,null,2));let I=s0(Y,".well-known");await b4(I,{recursive:!0});let g={registry:"/index.json"};return await Bun.write(s0(I,"ocx.json"),JSON.stringify(g,null,2)),{componentsCount:Z.components.length,outputPath:Y}}var r0;var _3=A(()=>{D0();g0();r0=class r0 extends Error{errors;constructor(Q,$=[]){super(Q);this.errors=$;this.name="BuildRegistryError"}}});import hq from"path";function fq(Q){return hq.posix.isAbsolute(Q)||hq.win32.isAbsolute(Q)}var uq=()=>{};var R4;var S4=A(()=>{G8();uq();R4=F().refine((Q)=>!Q.includes("\x00"),"Path cannot contain null bytes").refine((Q)=>!Q.split(/[/\\]/).some(($)=>$===".."),"Path cannot contain '..'").refine((Q)=>!fq(Q),"Path must be relative, not absolute")});function g1(Q){return Q.trim().replace(/\/+$/,"")}import{existsSync as N9}from"fs";import{mkdir as gq}from"fs/promises";import K8 from"path";function A2(Q,$,Y,q){return`${g1(Q)}::${$}/${Y}@${q}`}function R8(Q){if(!Q.includes("::"))throw Error(`Invalid canonical ID: "${Q}". Expected format: registryUrl::registryName/component@revision`);let[$,Y]=Q.split("::");if(!Y||!$)throw Error(`Invalid canonical ID: "${Q}". Expected format: registryUrl::registryName/component@revision`);if(!Y.includes("@"))throw Error(`Invalid canonical ID: "${Q}". Expected format: registryUrl::registryName/component@revision`);let q=Y.indexOf("@");if(q===-1)throw Error(`Invalid canonical ID: missing revision in ${Q}`);let J=Y.slice(0,q),X=Y.slice(q+1);if(!J||!X)throw Error(`Invalid canonical ID: "${Q}". Expected format: registryUrl::registryName/component@revision`);if(!J.includes("/"))throw Error(`Invalid canonical ID: "${Q}". Component must be qualified (registryName/component)`);let[H,G]=J.split("/");if(!H||!G)throw Error(`Invalid canonical ID: "${Q}". Both registry name and component name are required`);return{registryUrl:g1($),registryName:H,name:G,revision:X}}function S8(Q){let $=K8.join(Q,cq,dq);return{path:$,exists:N9($)}}async function A0(Q){let{path:$,exists:Y}=S8(Q);if(!Y)return null;let J=await Bun.file($).text(),X=O1(J,[],{allowTrailingComma:!0});return lq.parse(X)}async function N0(Q,$){let Y=K8.join(Q,cq,dq);await gq(K8.dirname(Y),{recursive:!0});let q=JSON.stringify($,null,2);await Bun.write(Y,q)}function E8(Q){let $=K8.join(Q,E4,V2),Y=K8.join(Q,V2),q=N9($),J=N9(Y);if(q&&J)throw Error(`Found ${V2} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${V2})`);if(q)return{path:$,exists:!0};if(J)return{path:Y,exists:!0};return{path:$,exists:!1}}function T9(Q,$){let Y=K8.join(Q,E4,mq),q=K8.join(Q,mq);if($?.isFlattened){if(N9(q))return{path:q,exists:!0};return{path:q,exists:!1}}if(N9(Y))return{path:Y,exists:!0};if(N9(q))return{path:q,exists:!0};return{path:Y,exists:!1}}async function T0(Q,$={}){let{path:Y,exists:q}=E8(Q);if(!q)return null;let X=await Bun.file(Y).text();try{let H=O1(X,[],{allowTrailingComma:!0});return b8.parse(H)}catch(H){if($.emitParseDiagnostics??!0)console.error(`Error parsing ${Y}:`,H);throw H}}async function U3(Q,$,Y){let q=Y??K8.join(Q,E4,V2);await gq(K8.dirname(q),{recursive:!0});let J=JSON.stringify($,null,2);await Bun.write(q,J)}async function L2(Q,$){let{path:Y,exists:q}=T9(Q,$);if(!q)return null;let X=await Bun.file(Y).text(),H=O1(X,[],{allowTrailingComma:!0});return M3.parse(H)}var Z3,b8,cq=".ocx",dq="receipt.jsonc",pq,lq,DB,OB,M3,V2="ocx.jsonc",mq="ocx.lock",E4=".opencode";var q0=A(()=>{D0();G8();g0();Z3=Q1({url:F().url("Registry URL must be a valid URL"),headers:q1(F(),F()).optional()}),b8=Q1({$schema:F().optional(),profile:F().optional(),registries:q1(F(),Z3).default({}),lockRegistries:i1().default(!1),skipCompatCheck:i1().default(!1)}),pq=Q1({registryUrl:F(),registryName:F(),name:F(),revision:F(),hash:F(),files:R1(Q1({path:F(),hash:F()})),installedAt:F(),updatedAt:F().optional(),owner:Q1({type:t1(["user","profile","system"]),id:F().optional()}).optional(),opencode:q1(F(),I8()).optional()}),lq=Q1({version:F4(1),root:F().optional(),installed:q1(F(),pq).default({})}),DB=Q1({registry:F(),version:F(),hash:F(),files:R1(F()),installedAt:F(),updatedAt:F().optional()}),OB=Q1({registry:F(),component:F(),version:F().optional(),hash:F(),installedAt:F()}),M3=Q1({lockVersion:F4(1),installedFrom:OB.optional(),installed:q1(I4,DB).default({})})});var{Glob:IB}=globalThis.Bun;var iq,W8;var b9=A(()=>{G8();S4();q0();iq=F().refine((Q)=>{try{return new IB(Q),!0}catch{return!1}},{message:"Invalid glob pattern"}),W8=Q1({$schema:F().optional(),bin:F().optional(),registries:q1(F(),Z3).default({}),componentPath:R4.optional(),renameWindow:i1().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:R1(iq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:R1(iq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var k4=A(()=>{S4();q0();b9();g0()});var F2=F8((NB)=>{class v4 extends Error{constructor(Q,$,Y){super(Y);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=Q,this.nestedError=void 0}}class nq extends v4{constructor(Q){super(1,"commander.invalidArgument",Q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}NB.CommanderError=v4;NB.InvalidArgumentError=nq});var V3=F8((EB)=>{var{InvalidArgumentError:RB}=F2();class oq{constructor(Q,$){switch(this.description=$||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,Q[0]){case"<":this.required=!0,this._name=Q.slice(1,-1);break;case"[":this.required=!1,this._name=Q.slice(1,-1);break;default:this.required=!0,this._name=Q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(Q,$){if($===this.defaultValue||!Array.isArray($))return[Q];return $.push(Q),$}default(Q,$){return this.defaultValue=Q,this.defaultValueDescription=$,this}argParser(Q){return this.parseArg=Q,this}choices(Q){return this.argChoices=Q.slice(),this.parseArg=($,Y)=>{if(!this.argChoices.includes($))throw new RB(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,Y);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function SB(Q){let $=Q.name()+(Q.variadic===!0?"...":"");return Q.required?"<"+$+">":"["+$+"]"}EB.Argument=oq;EB.humanReadableArgName=SB});var P4=F8((xB)=>{var{humanReadableArgName:PB}=V3();class sq{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(Q){this.helpWidth=this.helpWidth??Q.helpWidth??80}visibleCommands(Q){let $=Q.commands.filter((q)=>!q._hidden),Y=Q._getHelpCommand();if(Y&&!Y._hidden)$.push(Y);if(this.sortSubcommands)$.sort((q,J)=>{return q.name().localeCompare(J.name())});return $}compareOptions(Q,$){let Y=(q)=>{return q.short?q.short.replace(/^-/,""):q.long.replace(/^--/,"")};return Y(Q).localeCompare(Y($))}visibleOptions(Q){let $=Q.options.filter((q)=>!q.hidden),Y=Q._getHelpOption();if(Y&&!Y.hidden){let q=Y.short&&Q._findOption(Y.short),J=Y.long&&Q._findOption(Y.long);if(!q&&!J)$.push(Y);else if(Y.long&&!J)$.push(Q.createOption(Y.long,Y.description));else if(Y.short&&!q)$.push(Q.createOption(Y.short,Y.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(Q){if(!this.showGlobalOptions)return[];let $=[];for(let Y=Q.parent;Y;Y=Y.parent){let q=Y.options.filter((J)=>!J.hidden);$.push(...q)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(Q){if(Q._argsDescription)Q.registeredArguments.forEach(($)=>{$.description=$.description||Q._argsDescription[$.name()]||""});if(Q.registeredArguments.find(($)=>$.description))return Q.registeredArguments;return[]}subcommandTerm(Q){let $=Q.registeredArguments.map((Y)=>PB(Y)).join(" ");return Q._name+(Q._aliases[0]?"|"+Q._aliases[0]:"")+(Q.options.length?" [options]":"")+($?" "+$:"")}optionTerm(Q){return Q.flags}argumentTerm(Q){return Q.name()}longestSubcommandTermLength(Q,$){return $.visibleCommands(Q).reduce((Y,q)=>{return Math.max(Y,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(q))))},0)}longestOptionTermLength(Q,$){return $.visibleOptions(Q).reduce((Y,q)=>{return Math.max(Y,this.displayWidth($.styleOptionTerm($.optionTerm(q))))},0)}longestGlobalOptionTermLength(Q,$){return $.visibleGlobalOptions(Q).reduce((Y,q)=>{return Math.max(Y,this.displayWidth($.styleOptionTerm($.optionTerm(q))))},0)}longestArgumentTermLength(Q,$){return $.visibleArguments(Q).reduce((Y,q)=>{return Math.max(Y,this.displayWidth($.styleArgumentTerm($.argumentTerm(q))))},0)}commandUsage(Q){let $=Q._name;if(Q._aliases[0])$=$+"|"+Q._aliases[0];let Y="";for(let q=Q.parent;q;q=q.parent)Y=q.name()+" "+Y;return Y+$+" "+Q.usage()}commandDescription(Q){return Q.description()}subcommandDescription(Q){return Q.summary()||Q.description()}optionDescription(Q){let $=[];if(Q.argChoices)$.push(`choices: ${Q.argChoices.map((Y)=>JSON.stringify(Y)).join(", ")}`);if(Q.defaultValue!==void 0){if(Q.required||Q.optional||Q.isBoolean()&&typeof Q.defaultValue==="boolean")$.push(`default: ${Q.defaultValueDescription||JSON.stringify(Q.defaultValue)}`)}if(Q.presetArg!==void 0&&Q.optional)$.push(`preset: ${JSON.stringify(Q.presetArg)}`);if(Q.envVar!==void 0)$.push(`env: ${Q.envVar}`);if($.length>0){let Y=`(${$.join(", ")})`;if(Q.description)return`${Q.description} ${Y}`;return Y}return Q.description}argumentDescription(Q){let $=[];if(Q.argChoices)$.push(`choices: ${Q.argChoices.map((Y)=>JSON.stringify(Y)).join(", ")}`);if(Q.defaultValue!==void 0)$.push(`default: ${Q.defaultValueDescription||JSON.stringify(Q.defaultValue)}`);if($.length>0){let Y=`(${$.join(", ")})`;if(Q.description)return`${Q.description} ${Y}`;return Y}return Q.description}formatItemList(Q,$,Y){if($.length===0)return[];return[Y.styleTitle(Q),...$,""]}groupItems(Q,$,Y){let q=new Map;return Q.forEach((J)=>{let X=Y(J);if(!q.has(X))q.set(X,[])}),$.forEach((J)=>{let X=Y(J);if(!q.has(X))q.set(X,[]);q.get(X).push(J)}),q}formatHelp(Q,$){let Y=$.padWidth(Q,$),q=$.helpWidth??80;function J(z,B){return $.formatItem(z,Y,B,$)}let X=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(Q))}`,""],H=$.commandDescription(Q);if(H.length>0)X=X.concat([$.boxWrap($.styleCommandDescription(H),q),""]);let G=$.visibleArguments(Q).map((z)=>{return J($.styleArgumentTerm($.argumentTerm(z)),$.styleArgumentDescription($.argumentDescription(z)))});if(X=X.concat(this.formatItemList("Arguments:",G,$)),this.groupItems(Q.options,$.visibleOptions(Q),(z)=>z.helpGroupHeading??"Options:").forEach((z,B)=>{let Z=z.map((M)=>{return J($.styleOptionTerm($.optionTerm(M)),$.styleOptionDescription($.optionDescription(M)))});X=X.concat(this.formatItemList(B,Z,$))}),$.showGlobalOptions){let z=$.visibleGlobalOptions(Q).map((B)=>{return J($.styleOptionTerm($.optionTerm(B)),$.styleOptionDescription($.optionDescription(B)))});X=X.concat(this.formatItemList("Global Options:",z,$))}return this.groupItems(Q.commands,$.visibleCommands(Q),(z)=>z.helpGroup()||"Commands:").forEach((z,B)=>{let Z=z.map((M)=>{return J($.styleSubcommandTerm($.subcommandTerm(M)),$.styleSubcommandDescription($.subcommandDescription(M)))});X=X.concat(this.formatItemList(B,Z,$))}),X.join(`
75
+ `)}displayWidth(Q){return rq(Q).length}styleTitle(Q){return Q}styleUsage(Q){return Q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).join(" ")}styleCommandDescription(Q){return this.styleDescriptionText(Q)}styleOptionDescription(Q){return this.styleDescriptionText(Q)}styleSubcommandDescription(Q){return this.styleDescriptionText(Q)}styleArgumentDescription(Q){return this.styleDescriptionText(Q)}styleDescriptionText(Q){return Q}styleOptionTerm(Q){return this.styleOptionText(Q)}styleSubcommandTerm(Q){return Q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).join(" ")}styleArgumentTerm(Q){return this.styleArgumentText(Q)}styleOptionText(Q){return Q}styleArgumentText(Q){return Q}styleSubcommandText(Q){return Q}styleCommandText(Q){return Q}padWidth(Q,$){return Math.max($.longestOptionTermLength(Q,$),$.longestGlobalOptionTermLength(Q,$),$.longestSubcommandTermLength(Q,$),$.longestArgumentTermLength(Q,$))}preformatted(Q){return/\n[^\S\r\n]/.test(Q)}formatItem(Q,$,Y,q){let X=" ".repeat(2);if(!Y)return X+Q;let H=Q.padEnd($+Q.length-q.displayWidth(Q)),G=2,W=(this.helpWidth??80)-$-G-2,z;if(W<this.minWidthToWrap||q.preformatted(Y))z=Y;else z=q.boxWrap(Y,W).replace(/\n/g,`
76
+ `+" ".repeat($+G));return X+H+" ".repeat(G)+z.replace(/\n/g,`
77
+ ${X}`)}boxWrap(Q,$){if($<this.minWidthToWrap)return Q;let Y=Q.split(/\r\n|\n/),q=/[\s]*[^\s]+/g,J=[];return Y.forEach((X)=>{let H=X.match(q);if(H===null){J.push("");return}let G=[H.shift()],K=this.displayWidth(G[0]);H.forEach((W)=>{let z=this.displayWidth(W);if(K+z<=$){G.push(W),K+=z;return}J.push(G.join(""));let B=W.trimStart();G=[B],K=this.displayWidth(B)}),J.push(G.join(""))}),J.join(`
78
+ `)}}function rq(Q){let $=/\x1b\[\d*(;\d*)*m/g;return Q.replace($,"")}xB.Help=sq;xB.stripColor=rq});var x4=F8((uB)=>{var{InvalidArgumentError:hB}=F2();class tq{constructor(Q,$){this.flags=Q,this.description=$||"",this.required=Q.includes("<"),this.optional=Q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(Q),this.mandatory=!1;let Y=fB(Q);if(this.short=Y.shortFlag,this.long=Y.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(Q,$){return this.defaultValue=Q,this.defaultValueDescription=$,this}preset(Q){return this.presetArg=Q,this}conflicts(Q){return this.conflictsWith=this.conflictsWith.concat(Q),this}implies(Q){let $=Q;if(typeof Q==="string")$={[Q]:!0};return this.implied=Object.assign(this.implied||{},$),this}env(Q){return this.envVar=Q,this}argParser(Q){return this.parseArg=Q,this}makeOptionMandatory(Q=!0){return this.mandatory=!!Q,this}hideHelp(Q=!0){return this.hidden=!!Q,this}_collectValue(Q,$){if($===this.defaultValue||!Array.isArray($))return[Q];return $.push(Q),$}choices(Q){return this.argChoices=Q.slice(),this.parseArg=($,Y)=>{if(!this.argChoices.includes($))throw new hB(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,Y);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return aq(this.name().replace(/^no-/,""));return aq(this.name())}helpGroup(Q){return this.helpGroupHeading=Q,this}is(Q){return this.short===Q||this.long===Q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class eq{constructor(Q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,Q.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,Y)=>{if(this.positiveOptions.has(Y))this.dualOptions.add(Y)})}valueFromOption(Q,$){let Y=$.attributeName();if(!this.dualOptions.has(Y))return!0;let q=this.negativeOptions.get(Y).presetArg,J=q!==void 0?q:!1;return $.negate===(J===Q)}}function aq(Q){return Q.split("-").reduce(($,Y)=>{return $+Y[0].toUpperCase()+Y.slice(1)})}function fB(Q){let $,Y,q=/^-[^-]$/,J=/^--[^-]/,X=Q.split(/[ |,]+/).concat("guard");if(q.test(X[0]))$=X.shift();if(J.test(X[0]))Y=X.shift();if(!$&&q.test(X[0]))$=X.shift();if(!$&&J.test(X[0]))$=Y,Y=X.shift();if(X[0].startsWith("-")){let H=X[0],G=`option creation failed due to '${H}' in option flags '${Q}'`;if(/^-[^-][^-]/.test(H))throw Error(`${G}
80
79
  - a short flag is a single dash and a single character
81
80
  - either use a single dash and a single character (for a short flag)
82
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Q.test(Y))throw Error(`${z}
83
- - too many short flags`);if(v.test(Y))throw Error(`${z}
84
- - too many long flags`);throw Error(`${z}
85
- - unrecognised flag format`)}if(_===void 0&&U===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:_,longFlag:U}}BV.Option=xq;BV.DualOptions=uq});var yq=N6((wV)=>{function DV($,_){if(Math.abs($.length-_.length)>3)return Math.max($.length,_.length);let U=[];for(let Q=0;Q<=$.length;Q++)U[Q]=[Q];for(let Q=0;Q<=_.length;Q++)U[0][Q]=Q;for(let Q=1;Q<=_.length;Q++)for(let v=1;v<=$.length;v++){let J=1;if($[v-1]===_[Q-1])J=0;else J=1;if(U[v][Q]=Math.min(U[v-1][Q]+1,U[v][Q-1]+1,U[v-1][Q-1]+J),v>1&&Q>1&&$[v-1]===_[Q-2]&&$[v-2]===_[Q-1])U[v][Q]=Math.min(U[v][Q],U[v-2][Q-2]+1)}return U[$.length][_.length]}function MV($,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let U=$.startsWith("--");if(U)$=$.slice(2),_=_.map((Y)=>Y.slice(2));let Q=[],v=3,J=0.4;if(_.forEach((Y)=>{if(Y.length<=1)return;let z=DV($,Y),I=Math.max($.length,Y.length);if((I-z)/I>J){if(z<v)v=z,Q=[Y];else if(z===v)Q.push(Y)}}),Q.sort((Y,z)=>Y.localeCompare(z)),U)Q=Q.map((Y)=>`--${Y}`);if(Q.length>1)return`
86
- (Did you mean one of ${Q.join(", ")}?)`;if(Q.length===1)return`
87
- (Did you mean ${Q[0]}?)`;return""}wV.suggestSimilar=MV});var gq=N6((TV)=>{var kV=P1("events").EventEmitter,MJ=P1("child_process"),D6=P1("path"),t2=P1("fs"),Z$=P1("process"),{Argument:AV,humanReadableArgName:FV}=o2(),{CommanderError:wJ}=m_(),{Help:OV,stripColor:NV}=VJ(),{Option:Cq,DualOptions:SV}=DJ(),{suggestSimilar:fq}=yq();class kJ extends kV{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>Z$.stdout.write(_),writeErr:(_)=>Z$.stderr.write(_),outputError:(_,U)=>U(_),getOutHelpWidth:()=>Z$.stdout.isTTY?Z$.stdout.columns:void 0,getErrHelpWidth:()=>Z$.stderr.isTTY?Z$.stderr.columns:void 0,getOutHasColors:()=>LJ()??(Z$.stdout.isTTY&&Z$.stdout.hasColors?.()),getErrHasColors:()=>LJ()??(Z$.stderr.isTTY&&Z$.stderr.hasColors?.()),stripColor:(_)=>NV(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let _=this;_;_=_.parent)$.push(_);return $}command($,_,U){let Q=_,v=U;if(typeof Q==="object"&&Q!==null)v=Q,Q=null;v=v||{};let[,J,Y]=$.match(/([^ ]+) *(.*)/),z=this.createCommand(J);if(Q)z.description(Q),z._executableHandler=!0;if(v.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!(v.noHelp||v.hidden),z._executableFile=v.executableFile||null,Y)z.arguments(Y);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),Q)return this;return z}createCommand($){return new kJ($)}createHelp(){return Object.assign(new OV,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,_){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
88
- - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=$._name;if(_.noHelp||_.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,_){return new AV($,_)}argument($,_,U,Q){let v=this.createArgument($,_);if(typeof U==="function")v.default(Q).argParser(U);else v.default(U);return this.addArgument(v),this}arguments($){return $.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument($){let _=this.registeredArguments.slice(-1)[0];if(_?.variadic)throw Error(`only the last argument can be variadic '${_.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,_){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let U=$??"help [command]",[,Q,v]=U.match(/([^ ]+) *(.*)/),J=_??"display help for command",Y=this.createCommand(Q);if(Y.helpOption(!1),v)Y.arguments(v);if(J)Y.description(J);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||_)this._initCommandGroup(Y);return this}addHelpCommand($,_){if(typeof $!=="object")return this.helpCommand($,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,_){let U=["preSubcommand","preAction","postAction"];if(!U.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
89
- Expecting one of '${U.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(_);else this._lifeCycleHooks[$]=[_];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit($,_,U){if(this._exitCallback)this._exitCallback(new wJ($,_,U));Z$.exit($)}action($){let _=(U)=>{let Q=this.registeredArguments.length,v=U.slice(0,Q);if(this._storeOptionsAsProperties)v[Q]=this;else v[Q]=this.opts();return v.push(this),$.apply(this,v)};return this._actionHandler=_,this}createOption($,_){return new Cq($,_)}_callParseArg($,_,U,Q){try{return $.parseArg(_,U)}catch(v){if(v.code==="commander.invalidArgument"){let J=`${Q} ${v.message}`;this.error(J,{exitCode:v.exitCode,code:v.code})}throw v}}_registerOption($){let _=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(_){let U=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${U}'
90
- - already used by option '${_.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let _=(Q)=>{return[Q.name()].concat(Q.aliases())},U=_($).find((Q)=>this._findCommand(Q));if(U){let Q=_(this._findCommand(U)).join("|"),v=_($).join("|");throw Error(`cannot add command '${v}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let _=$.name(),U=$.attributeName();if($.negate){let v=$.long.replace(/^--no-/,"--");if(!this._findOption(v))this.setOptionValueWithSource(U,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(U,$.defaultValue,"default");let Q=(v,J,Y)=>{if(v==null&&$.presetArg!==void 0)v=$.presetArg;let z=this.getOptionValue(U);if(v!==null&&$.parseArg)v=this._callParseArg($,v,z,J);else if(v!==null&&$.variadic)v=$._collectValue(v,z);if(v==null)if($.negate)v=!1;else if($.isBoolean()||$.optional)v=!0;else v="";this.setOptionValueWithSource(U,v,Y)};if(this.on("option:"+_,(v)=>{let J=`error: option '${$.flags}' argument '${v}' is invalid.`;Q(v,J,"cli")}),$.envVar)this.on("optionEnv:"+_,(v)=>{let J=`error: option '${$.flags}' value '${v}' from env '${$.envVar}' is invalid.`;Q(v,J,"env")});return this}_optionEx($,_,U,Q,v){if(typeof _==="object"&&_ instanceof Cq)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let J=this.createOption(_,U);if(J.makeOptionMandatory(!!$.mandatory),typeof Q==="function")J.default(v).argParser(Q);else if(Q instanceof RegExp){let Y=Q;Q=(z,I)=>{let X=Y.exec(z);return X?X[0]:I},J.default(v).argParser(Q)}else J.default(Q);return this.addOption(J)}option($,_,U,Q){return this._optionEx({},$,_,U,Q)}requiredOption($,_,U,Q){return this._optionEx({mandatory:!0},$,_,U,Q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,_){return this.setOptionValueWithSource($,_,void 0)}setOptionValueWithSource($,_,U){if(this._storeOptionsAsProperties)this[$]=_;else this._optionValues[$]=_;return this._optionValueSources[$]=U,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let _;return this._getCommandAndAncestors().forEach((U)=>{if(U.getOptionValueSource($)!==void 0)_=U.getOptionValueSource($)}),_}_prepareUserArgs($,_){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(_=_||{},$===void 0&&_.from===void 0){if(Z$.versions?.electron)_.from="electron";let Q=Z$.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))_.from="eval"}if($===void 0)$=Z$.argv;this.rawArgs=$.slice();let U;switch(_.from){case void 0:case"node":this._scriptPath=$[1],U=$.slice(2);break;case"electron":if(Z$.defaultApp)this._scriptPath=$[1],U=$.slice(2);else U=$.slice(1);break;case"user":U=$.slice(0);break;case"eval":U=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",U}parse($,_){this._prepareForParse();let U=this._prepareUserArgs($,_);return this._parseCommand([],U),this}async parseAsync($,_){this._prepareForParse();let U=this._prepareUserArgs($,_);return await this._parseCommand([],U),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
91
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,_,U){if(t2.existsSync($))return;let Q=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",v=`'${$}' does not exist
92
- - if '${U}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
81
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(q.test(H))throw Error(`${G}
82
+ - too many short flags`);if(J.test(H))throw Error(`${G}
83
+ - too many long flags`);throw Error(`${G}
84
+ - unrecognised flag format`)}if($===void 0&&Y===void 0)throw Error(`option creation failed due to no flags found in '${Q}'.`);return{shortFlag:$,longFlag:Y}}uB.Option=tq;uB.DualOptions=eq});var QJ=F8((pB)=>{function cB(Q,$){if(Math.abs(Q.length-$.length)>3)return Math.max(Q.length,$.length);let Y=[];for(let q=0;q<=Q.length;q++)Y[q]=[q];for(let q=0;q<=$.length;q++)Y[0][q]=q;for(let q=1;q<=$.length;q++)for(let J=1;J<=Q.length;J++){let X=1;if(Q[J-1]===$[q-1])X=0;else X=1;if(Y[J][q]=Math.min(Y[J-1][q]+1,Y[J][q-1]+1,Y[J-1][q-1]+X),J>1&&q>1&&Q[J-1]===$[q-2]&&Q[J-2]===$[q-1])Y[J][q]=Math.min(Y[J][q],Y[J-2][q-2]+1)}return Y[Q.length][$.length]}function dB(Q,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let Y=Q.startsWith("--");if(Y)Q=Q.slice(2),$=$.map((H)=>H.slice(2));let q=[],J=3,X=0.4;if($.forEach((H)=>{if(H.length<=1)return;let G=cB(Q,H),K=Math.max(Q.length,H.length);if((K-G)/K>X){if(G<J)J=G,q=[H];else if(G===J)q.push(H)}}),q.sort((H,G)=>H.localeCompare(G)),Y)q=q.map((H)=>`--${H}`);if(q.length>1)return`
85
+ (Did you mean one of ${q.join(", ")}?)`;if(q.length===1)return`
86
+ (Did you mean ${q[0]}?)`;return""}pB.suggestSimilar=dB});var JJ=F8((tB)=>{var iB=z9("events").EventEmitter,C4=z9("child_process"),z8=z9("path"),A3=z9("fs"),_1=z9("process"),{Argument:nB,humanReadableArgName:oB}=V3(),{CommanderError:y4}=F2(),{Help:sB,stripColor:rB}=P4(),{Option:$J,DualOptions:aB}=x4(),{suggestSimilar:YJ}=QJ();class f4 extends iB{constructor(Q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=Q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:($)=>_1.stdout.write($),writeErr:($)=>_1.stderr.write($),outputError:($,Y)=>Y($),getOutHelpWidth:()=>_1.stdout.isTTY?_1.stdout.columns:void 0,getErrHelpWidth:()=>_1.stderr.isTTY?_1.stderr.columns:void 0,getOutHasColors:()=>h4()??(_1.stdout.isTTY&&_1.stdout.hasColors?.()),getErrHasColors:()=>h4()??(_1.stderr.isTTY&&_1.stderr.hasColors?.()),stripColor:($)=>rB($)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(Q){return this._outputConfiguration=Q._outputConfiguration,this._helpOption=Q._helpOption,this._helpCommand=Q._helpCommand,this._helpConfiguration=Q._helpConfiguration,this._exitCallback=Q._exitCallback,this._storeOptionsAsProperties=Q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=Q._combineFlagAndOptionalValue,this._allowExcessArguments=Q._allowExcessArguments,this._enablePositionalOptions=Q._enablePositionalOptions,this._showHelpAfterError=Q._showHelpAfterError,this._showSuggestionAfterError=Q._showSuggestionAfterError,this}_getCommandAndAncestors(){let Q=[];for(let $=this;$;$=$.parent)Q.push($);return Q}command(Q,$,Y){let q=$,J=Y;if(typeof q==="object"&&q!==null)J=q,q=null;J=J||{};let[,X,H]=Q.match(/([^ ]+) *(.*)/),G=this.createCommand(X);if(q)G.description(q),G._executableHandler=!0;if(J.isDefault)this._defaultCommandName=G._name;if(G._hidden=!!(J.noHelp||J.hidden),G._executableFile=J.executableFile||null,H)G.arguments(H);if(this._registerCommand(G),G.parent=this,G.copyInheritedSettings(this),q)return this;return G}createCommand(Q){return new f4(Q)}createHelp(){return Object.assign(new sB,this.configureHelp())}configureHelp(Q){if(Q===void 0)return this._helpConfiguration;return this._helpConfiguration=Q,this}configureOutput(Q){if(Q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...Q},this}showHelpAfterError(Q=!0){if(typeof Q!=="string")Q=!!Q;return this._showHelpAfterError=Q,this}showSuggestionAfterError(Q=!0){return this._showSuggestionAfterError=!!Q,this}addCommand(Q,$){if(!Q._name)throw Error(`Command passed to .addCommand() must have a name
87
+ - specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=Q._name;if($.noHelp||$.hidden)Q._hidden=!0;return this._registerCommand(Q),Q.parent=this,Q._checkForBrokenPassThrough(),this}createArgument(Q,$){return new nB(Q,$)}argument(Q,$,Y,q){let J=this.createArgument(Q,$);if(typeof Y==="function")J.default(q).argParser(Y);else J.default(Y);return this.addArgument(J),this}arguments(Q){return Q.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(Q){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.name()}'`);if(Q.required&&Q.defaultValue!==void 0&&Q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${Q.name()}'`);return this.registeredArguments.push(Q),this}helpCommand(Q,$){if(typeof Q==="boolean"){if(this._addImplicitHelpCommand=Q,Q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let Y=Q??"help [command]",[,q,J]=Y.match(/([^ ]+) *(.*)/),X=$??"display help for command",H=this.createCommand(q);if(H.helpOption(!1),J)H.arguments(J);if(X)H.description(X);if(this._addImplicitHelpCommand=!0,this._helpCommand=H,Q||$)this._initCommandGroup(H);return this}addHelpCommand(Q,$){if(typeof Q!=="object")return this.helpCommand(Q,$),this;return this._addImplicitHelpCommand=!0,this._helpCommand=Q,this._initCommandGroup(Q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(Q,$){let Y=["preSubcommand","preAction","postAction"];if(!Y.includes(Q))throw Error(`Unexpected value for event passed to hook : '${Q}'.
88
+ Expecting one of '${Y.join("', '")}'`);if(this._lifeCycleHooks[Q])this._lifeCycleHooks[Q].push($);else this._lifeCycleHooks[Q]=[$];return this}exitOverride(Q){if(Q)this._exitCallback=Q;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(Q,$,Y){if(this._exitCallback)this._exitCallback(new y4(Q,$,Y));_1.exit(Q)}action(Q){let $=(Y)=>{let q=this.registeredArguments.length,J=Y.slice(0,q);if(this._storeOptionsAsProperties)J[q]=this;else J[q]=this.opts();return J.push(this),Q.apply(this,J)};return this._actionHandler=$,this}createOption(Q,$){return new $J(Q,$)}_callParseArg(Q,$,Y,q){try{return Q.parseArg($,Y)}catch(J){if(J.code==="commander.invalidArgument"){let X=`${q} ${J.message}`;this.error(X,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption(Q){let $=Q.short&&this._findOption(Q.short)||Q.long&&this._findOption(Q.long);if($){let Y=Q.long&&this._findOption(Q.long)?Q.long:Q.short;throw Error(`Cannot add option '${Q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${Y}'
89
+ - already used by option '${$.flags}'`)}this._initOptionGroup(Q),this.options.push(Q)}_registerCommand(Q){let $=(q)=>{return[q.name()].concat(q.aliases())},Y=$(Q).find((q)=>this._findCommand(q));if(Y){let q=$(this._findCommand(Y)).join("|"),J=$(Q).join("|");throw Error(`cannot add command '${J}' as already have command '${q}'`)}this._initCommandGroup(Q),this.commands.push(Q)}addOption(Q){this._registerOption(Q);let $=Q.name(),Y=Q.attributeName();if(Q.negate){let J=Q.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(Y,Q.defaultValue===void 0?!0:Q.defaultValue,"default")}else if(Q.defaultValue!==void 0)this.setOptionValueWithSource(Y,Q.defaultValue,"default");let q=(J,X,H)=>{if(J==null&&Q.presetArg!==void 0)J=Q.presetArg;let G=this.getOptionValue(Y);if(J!==null&&Q.parseArg)J=this._callParseArg(Q,J,G,X);else if(J!==null&&Q.variadic)J=Q._collectValue(J,G);if(J==null)if(Q.negate)J=!1;else if(Q.isBoolean()||Q.optional)J=!0;else J="";this.setOptionValueWithSource(Y,J,H)};if(this.on("option:"+$,(J)=>{let X=`error: option '${Q.flags}' argument '${J}' is invalid.`;q(J,X,"cli")}),Q.envVar)this.on("optionEnv:"+$,(J)=>{let X=`error: option '${Q.flags}' value '${J}' from env '${Q.envVar}' is invalid.`;q(J,X,"env")});return this}_optionEx(Q,$,Y,q,J){if(typeof $==="object"&&$ instanceof $J)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let X=this.createOption($,Y);if(X.makeOptionMandatory(!!Q.mandatory),typeof q==="function")X.default(J).argParser(q);else if(q instanceof RegExp){let H=q;q=(G,K)=>{let W=H.exec(G);return W?W[0]:K},X.default(J).argParser(q)}else X.default(q);return this.addOption(X)}option(Q,$,Y,q){return this._optionEx({},Q,$,Y,q)}requiredOption(Q,$,Y,q){return this._optionEx({mandatory:!0},Q,$,Y,q)}combineFlagAndOptionalValue(Q=!0){return this._combineFlagAndOptionalValue=!!Q,this}allowUnknownOption(Q=!0){return this._allowUnknownOption=!!Q,this}allowExcessArguments(Q=!0){return this._allowExcessArguments=!!Q,this}enablePositionalOptions(Q=!0){return this._enablePositionalOptions=!!Q,this}passThroughOptions(Q=!0){return this._passThroughOptions=!!Q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(Q=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!Q,this}getOptionValue(Q){if(this._storeOptionsAsProperties)return this[Q];return this._optionValues[Q]}setOptionValue(Q,$){return this.setOptionValueWithSource(Q,$,void 0)}setOptionValueWithSource(Q,$,Y){if(this._storeOptionsAsProperties)this[Q]=$;else this._optionValues[Q]=$;return this._optionValueSources[Q]=Y,this}getOptionValueSource(Q){return this._optionValueSources[Q]}getOptionValueSourceWithGlobals(Q){let $;return this._getCommandAndAncestors().forEach((Y)=>{if(Y.getOptionValueSource(Q)!==void 0)$=Y.getOptionValueSource(Q)}),$}_prepareUserArgs(Q,$){if(Q!==void 0&&!Array.isArray(Q))throw Error("first parameter to parse must be array or undefined");if($=$||{},Q===void 0&&$.from===void 0){if(_1.versions?.electron)$.from="electron";let q=_1.execArgv??[];if(q.includes("-e")||q.includes("--eval")||q.includes("-p")||q.includes("--print"))$.from="eval"}if(Q===void 0)Q=_1.argv;this.rawArgs=Q.slice();let Y;switch($.from){case void 0:case"node":this._scriptPath=Q[1],Y=Q.slice(2);break;case"electron":if(_1.defaultApp)this._scriptPath=Q[1],Y=Q.slice(2);else Y=Q.slice(1);break;case"user":Y=Q.slice(0);break;case"eval":Y=Q.slice(1);break;default:throw Error(`unexpected parse option { from: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",Y}parse(Q,$){this._prepareForParse();let Y=this._prepareUserArgs(Q,$);return this._parseCommand([],Y),this}async parseAsync(Q,$){this._prepareForParse();let Y=this._prepareUserArgs(Q,$);return await this._parseCommand([],Y),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
90
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(Q,$,Y){if(A3.existsSync(Q))return;let q=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${Q}' does not exist
91
+ - if '${Y}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
93
92
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
94
- - ${Q}`;throw Error(v)}_executeSubCommand($,_){_=_.slice();let U=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function v(X,q){let G=D6.resolve(X,q);if(t2.existsSync(G))return G;if(Q.includes(D6.extname(q)))return;let j=Q.find((H)=>t2.existsSync(`${G}${H}`));if(j)return`${G}${j}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let X;try{X=t2.realpathSync(this._scriptPath)}catch{X=this._scriptPath}Y=D6.resolve(D6.dirname(X),Y)}if(Y){let X=v(Y,J);if(!X&&!$._executableFile&&this._scriptPath){let q=D6.basename(this._scriptPath,D6.extname(this._scriptPath));if(q!==this._name)X=v(Y,`${q}-${$._name}`)}J=X||J}U=Q.includes(D6.extname(J));let z;if(Z$.platform!=="win32")if(U)_.unshift(J),_=mq(Z$.execArgv).concat(_),z=MJ.spawn(Z$.argv[0],_,{stdio:"inherit"});else z=MJ.spawn(J,_,{stdio:"inherit"});else this._checkForMissingExecutable(J,Y,$._name),_.unshift(J),_=mq(Z$.execArgv).concat(_),z=MJ.spawn(Z$.execPath,_,{stdio:"inherit"});if(!z.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{Z$.on(q,()=>{if(z.killed===!1&&z.exitCode===null)z.kill(q)})});let I=this._exitCallback;z.on("close",(X)=>{if(X=X??1,!I)Z$.exit(X);else I(new wJ(X,"commander.executeSubCommandAsync","(close)"))}),z.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(J,Y,$._name);else if(X.code==="EACCES")throw Error(`'${J}' not executable`);if(!I)Z$.exit(1);else{let q=new wJ(1,"commander.executeSubCommandAsync","(error)");q.nestedError=X,I(q)}}),this.runningCommand=z}_dispatchSubcommand($,_,U){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let v;return v=this._chainOrCallSubCommandHook(v,Q,"preSubcommand"),v=this._chainOrCall(v,()=>{if(Q._executableHandler)this._executeSubCommand(Q,_.concat(U));else return Q._parseCommand(_,U)}),v}_dispatchHelpCommand($){if(!$)this.help();let _=this._findCommand($);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,_)=>{if($.required&&this.args[_]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(U,Q,v)=>{let J=Q;if(Q!==null&&U.parseArg){let Y=`error: command-argument value '${Q}' is invalid for argument '${U.name()}'.`;J=this._callParseArg(U,Q,v,Y)}return J};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((U,Q)=>{let v=U.defaultValue;if(U.variadic){if(Q<this.args.length){if(v=this.args.slice(Q),U.parseArg)v=v.reduce((J,Y)=>{return $(U,Y,J)},U.defaultValue)}else if(v===void 0)v=[]}else if(Q<this.args.length){if(v=this.args[Q],U.parseArg)v=$(U,v,U.defaultValue)}_[Q]=v}),this.processedArgs=_}_chainOrCall($,_){if($?.then&&typeof $.then==="function")return $.then(()=>_());return _()}_chainOrCallHooks($,_){let U=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((v)=>v._lifeCycleHooks[_]!==void 0).forEach((v)=>{v._lifeCycleHooks[_].forEach((J)=>{Q.push({hookedCommand:v,callback:J})})}),_==="postAction")Q.reverse();return Q.forEach((v)=>{U=this._chainOrCall(U,()=>{return v.callback(v.hookedCommand,this)})}),U}_chainOrCallSubCommandHook($,_,U){let Q=$;if(this._lifeCycleHooks[U]!==void 0)this._lifeCycleHooks[U].forEach((v)=>{Q=this._chainOrCall(Q,()=>{return v(this,_)})});return Q}_parseCommand($,_){let U=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(U.operands),_=U.unknown,this.args=$.concat(_),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),_);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,$,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(U.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(U.unknown.length>0)this.unknownOption(U.unknown[0])},v=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let J;if(J=this._chainOrCallHooks(J,"preAction"),J=this._chainOrCall(J,()=>this._actionHandler(this.processedArgs)),this.parent)J=this._chainOrCall(J,()=>{this.parent.emit(v,$,_)});return J=this._chainOrCallHooks(J,"postAction"),J}if(this.parent?.listenerCount(v))Q(),this._processArguments(),this.parent.emit(v,$,_);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,_);if(this.listenerCount("command:*"))this.emit("command:*",$,_);else if(this.commands.length)this.unknownCommand();else Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((_)=>_._name===$||_._aliases.includes($))}_findOption($){return this.options.find((_)=>_.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((_)=>{if(_.mandatory&&$.getOptionValue(_.attributeName())===void 0)$.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((U)=>{let Q=U.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});$.filter((U)=>U.conflictsWith.length>0).forEach((U)=>{let Q=$.find((v)=>U.conflictsWith.includes(v.attributeName()));if(Q)this._conflictingOption(U,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let _=[],U=[],Q=_;function v(X){return X.length>1&&X[0]==="-"}let J=(X)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(X))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Y=null,z=null,I=0;while(I<$.length||z){let X=z??$[I++];if(z=null,X==="--"){if(Q===U)Q.push(X);Q.push(...$.slice(I));break}if(Y&&(!v(X)||J(X))){this.emit(`option:${Y.name()}`,X);continue}if(Y=null,v(X)){let q=this._findOption(X);if(q){if(q.required){let G=$[I++];if(G===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,G)}else if(q.optional){let G=null;if(I<$.length&&(!v($[I])||J($[I])))G=$[I++];this.emit(`option:${q.name()}`,G)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(X.length>2&&X[0]==="-"&&X[1]!=="-"){let q=this._findOption(`-${X[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,X.slice(2));else this.emit(`option:${q.name()}`),z=`-${X.slice(2)}`;continue}}if(/^--[^=]+=/.test(X)){let q=X.indexOf("="),G=this._findOption(X.slice(0,q));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,X.slice(q+1));continue}}if(Q===_&&v(X)&&!(this.commands.length===0&&J(X)))Q=U;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&U.length===0){if(this._findCommand(X)){_.push(X),U.push(...$.slice(I));break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){_.push(X,...$.slice(I));break}else if(this._defaultCommandName){U.push(X,...$.slice(I));break}}if(this._passThroughOptions){Q.push(X,...$.slice(I));break}Q.push(X)}return{operands:_,unknown:U}}opts(){if(this._storeOptionsAsProperties){let $={},_=this.options.length;for(let U=0;U<_;U++){let Q=this.options[U].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,_)=>Object.assign($,_.opts()),{})}error($,_){if(this._outputConfiguration.outputError(`${$}
93
+ - ${q}`;throw Error(J)}_executeSubCommand(Q,$){$=$.slice();let Y=!1,q=[".js",".ts",".tsx",".mjs",".cjs"];function J(W,z){let B=z8.resolve(W,z);if(A3.existsSync(B))return B;if(q.includes(z8.extname(z)))return;let Z=q.find((M)=>A3.existsSync(`${B}${M}`));if(Z)return`${B}${Z}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=Q._executableFile||`${this._name}-${Q._name}`,H=this._executableDir||"";if(this._scriptPath){let W;try{W=A3.realpathSync(this._scriptPath)}catch{W=this._scriptPath}H=z8.resolve(z8.dirname(W),H)}if(H){let W=J(H,X);if(!W&&!Q._executableFile&&this._scriptPath){let z=z8.basename(this._scriptPath,z8.extname(this._scriptPath));if(z!==this._name)W=J(H,`${z}-${Q._name}`)}X=W||X}Y=q.includes(z8.extname(X));let G;if(_1.platform!=="win32")if(Y)$.unshift(X),$=qJ(_1.execArgv).concat($),G=C4.spawn(_1.argv[0],$,{stdio:"inherit"});else G=C4.spawn(X,$,{stdio:"inherit"});else this._checkForMissingExecutable(X,H,Q._name),$.unshift(X),$=qJ(_1.execArgv).concat($),G=C4.spawn(_1.execPath,$,{stdio:"inherit"});if(!G.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((z)=>{_1.on(z,()=>{if(G.killed===!1&&G.exitCode===null)G.kill(z)})});let K=this._exitCallback;G.on("close",(W)=>{if(W=W??1,!K)_1.exit(W);else K(new y4(W,"commander.executeSubCommandAsync","(close)"))}),G.on("error",(W)=>{if(W.code==="ENOENT")this._checkForMissingExecutable(X,H,Q._name);else if(W.code==="EACCES")throw Error(`'${X}' not executable`);if(!K)_1.exit(1);else{let z=new y4(1,"commander.executeSubCommandAsync","(error)");z.nestedError=W,K(z)}}),this.runningCommand=G}_dispatchSubcommand(Q,$,Y){let q=this._findCommand(Q);if(!q)this.help({error:!0});q._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,q,"preSubcommand"),J=this._chainOrCall(J,()=>{if(q._executableHandler)this._executeSubCommand(q,$.concat(Y));else return q._parseCommand($,Y)}),J}_dispatchHelpCommand(Q){if(!Q)this.help();let $=this._findCommand(Q);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(Q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((Q,$)=>{if(Q.required&&this.args[$]==null)this.missingArgument(Q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let Q=(Y,q,J)=>{let X=q;if(q!==null&&Y.parseArg){let H=`error: command-argument value '${q}' is invalid for argument '${Y.name()}'.`;X=this._callParseArg(Y,q,J,H)}return X};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((Y,q)=>{let J=Y.defaultValue;if(Y.variadic){if(q<this.args.length){if(J=this.args.slice(q),Y.parseArg)J=J.reduce((X,H)=>{return Q(Y,H,X)},Y.defaultValue)}else if(J===void 0)J=[]}else if(q<this.args.length){if(J=this.args[q],Y.parseArg)J=Q(Y,J,Y.defaultValue)}$[q]=J}),this.processedArgs=$}_chainOrCall(Q,$){if(Q?.then&&typeof Q.then==="function")return Q.then(()=>$());return $()}_chainOrCallHooks(Q,$){let Y=Q,q=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[$]!==void 0).forEach((J)=>{J._lifeCycleHooks[$].forEach((X)=>{q.push({hookedCommand:J,callback:X})})}),$==="postAction")q.reverse();return q.forEach((J)=>{Y=this._chainOrCall(Y,()=>{return J.callback(J.hookedCommand,this)})}),Y}_chainOrCallSubCommandHook(Q,$,Y){let q=Q;if(this._lifeCycleHooks[Y]!==void 0)this._lifeCycleHooks[Y].forEach((J)=>{q=this._chainOrCall(q,()=>{return J(this,$)})});return q}_parseCommand(Q,$){let Y=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),Q=Q.concat(Y.operands),$=Y.unknown,this.args=Q.concat($),Q&&this._findCommand(Q[0]))return this._dispatchSubcommand(Q[0],Q.slice(1),$);if(this._getHelpCommand()&&Q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(Q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,Q,$);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(Y.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=()=>{if(Y.unknown.length>0)this.unknownOption(Y.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){q(),this._processArguments();let X;if(X=this._chainOrCallHooks(X,"preAction"),X=this._chainOrCall(X,()=>this._actionHandler(this.processedArgs)),this.parent)X=this._chainOrCall(X,()=>{this.parent.emit(J,Q,$)});return X=this._chainOrCallHooks(X,"postAction"),X}if(this.parent?.listenerCount(J))q(),this._processArguments(),this.parent.emit(J,Q,$);else if(Q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",Q,$);if(this.listenerCount("command:*"))this.emit("command:*",Q,$);else if(this.commands.length)this.unknownCommand();else q(),this._processArguments()}else if(this.commands.length)q(),this.help({error:!0});else q(),this._processArguments()}_findCommand(Q){if(!Q)return;return this.commands.find(($)=>$._name===Q||$._aliases.includes(Q))}_findOption(Q){return this.options.find(($)=>$.is(Q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((Q)=>{Q.options.forEach(($)=>{if($.mandatory&&Q.getOptionValue($.attributeName())===void 0)Q.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let Q=this.options.filter((Y)=>{let q=Y.attributeName();if(this.getOptionValue(q)===void 0)return!1;return this.getOptionValueSource(q)!=="default"});Q.filter((Y)=>Y.conflictsWith.length>0).forEach((Y)=>{let q=Q.find((J)=>Y.conflictsWith.includes(J.attributeName()));if(q)this._conflictingOption(Y,q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((Q)=>{Q._checkForConflictingLocalOptions()})}parseOptions(Q){let $=[],Y=[],q=$;function J(W){return W.length>1&&W[0]==="-"}let X=(W)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(W))return!1;return!this._getCommandAndAncestors().some((z)=>z.options.map((B)=>B.short).some((B)=>/^-\d$/.test(B)))},H=null,G=null,K=0;while(K<Q.length||G){let W=G??Q[K++];if(G=null,W==="--"){if(q===Y)q.push(W);q.push(...Q.slice(K));break}if(H&&(!J(W)||X(W))){this.emit(`option:${H.name()}`,W);continue}if(H=null,J(W)){let z=this._findOption(W);if(z){if(z.required){let B=Q[K++];if(B===void 0)this.optionMissingArgument(z);this.emit(`option:${z.name()}`,B)}else if(z.optional){let B=null;if(K<Q.length&&(!J(Q[K])||X(Q[K])))B=Q[K++];this.emit(`option:${z.name()}`,B)}else this.emit(`option:${z.name()}`);H=z.variadic?z:null;continue}}if(W.length>2&&W[0]==="-"&&W[1]!=="-"){let z=this._findOption(`-${W[1]}`);if(z){if(z.required||z.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${z.name()}`,W.slice(2));else this.emit(`option:${z.name()}`),G=`-${W.slice(2)}`;continue}}if(/^--[^=]+=/.test(W)){let z=W.indexOf("="),B=this._findOption(W.slice(0,z));if(B&&(B.required||B.optional)){this.emit(`option:${B.name()}`,W.slice(z+1));continue}}if(q===$&&J(W)&&!(this.commands.length===0&&X(W)))q=Y;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&Y.length===0){if(this._findCommand(W)){$.push(W),Y.push(...Q.slice(K));break}else if(this._getHelpCommand()&&W===this._getHelpCommand().name()){$.push(W,...Q.slice(K));break}else if(this._defaultCommandName){Y.push(W,...Q.slice(K));break}}if(this._passThroughOptions){q.push(W,...Q.slice(K));break}q.push(W)}return{operands:$,unknown:Y}}opts(){if(this._storeOptionsAsProperties){let Q={},$=this.options.length;for(let Y=0;Y<$;Y++){let q=this.options[Y].attributeName();Q[q]=q===this._versionOptionName?this._version:this[q]}return Q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((Q,$)=>Object.assign(Q,$.opts()),{})}error(Q,$){if(this._outputConfiguration.outputError(`${Q}
95
94
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
96
95
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
97
- `),this.outputHelp({error:!0});let U=_||{},Q=U.exitCode||1,v=U.code||"commander.error";this._exit(Q,v,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in Z$.env){let _=$.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,Z$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new SV(this.options),_=(U)=>{return this.getOptionValue(U)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(U))};this.options.filter((U)=>U.implied!==void 0&&_(U.attributeName())&&$.valueFromOption(this.getOptionValue(U.attributeName()),U)).forEach((U)=>{Object.keys(U.implied).filter((Q)=>!_(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,U.implied[Q],"implied")})})}missingArgument($){let _=`error: missing required argument '${$}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument($){let _=`error: option '${$.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let _=`error: required option '${$.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,_){let U=(J)=>{let Y=J.attributeName(),z=this.getOptionValue(Y),I=this.options.find((q)=>q.negate&&Y===q.attributeName()),X=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(I&&(I.presetArg===void 0&&z===!1||I.presetArg!==void 0&&z===I.presetArg))return I;return X||J},Q=(J)=>{let Y=U(J),z=Y.attributeName();if(this.getOptionValueSource(z)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},v=`error: ${Q($)} cannot be used with ${Q(_)}`;this.error(v,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let _="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],v=this;do{let J=v.createHelp().visibleOptions(v).filter((Y)=>Y.long).map((Y)=>Y.long);Q=Q.concat(J),v=v.parent}while(v&&!v._enablePositionalOptions);_=fq($,Q)}let U=`error: unknown option '${$}'${_}`;this.error(U,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,U=_===1?"":"s",v=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${U} but got ${$.length}.`;this.error(v,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],_="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((v)=>{if(Q.push(v.name()),v.alias())Q.push(v.alias())}),_=fq($,Q)}let U=`error: unknown command '${$}'${_}`;this.error(U,{code:"commander.unknownCommand"})}version($,_,U){if($===void 0)return this._version;this._version=$,_=_||"-V, --version",U=U||"output the version number";let Q=this.createOption(_,U);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${$}
98
- `),this._exit(0,"commander.version",$)}),this}description($,_){if($===void 0&&_===void 0)return this._description;if(this._description=$,_)this._argsDescription=_;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if($===_._name)throw Error("Command alias can't be the same as its name");let U=this.parent?._findCommand($);if(U){let Q=[U.name()].concat(U.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${Q}'`)}return _._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((_)=>this.alias(_)),this}usage($){if($===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((U)=>{return FV(U)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=D6.basename($,D6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let _=this.createHelp(),U=this._getOutputContext($);_.prepareContext({error:U.error,helpWidth:U.helpWidth,outputHasColors:U.hasColors});let Q=_.formatHelp(this,_);if(U.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let _=!!$.error,U,Q,v;if(_)U=(Y)=>this._outputConfiguration.writeErr(Y),Q=this._outputConfiguration.getErrHasColors(),v=this._outputConfiguration.getErrHelpWidth();else U=(Y)=>this._outputConfiguration.writeOut(Y),Q=this._outputConfiguration.getOutHasColors(),v=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(Y)=>{if(!Q)Y=this._outputConfiguration.stripColor(Y);return U(Y)},hasColors:Q,helpWidth:v}}outputHelp($){let _;if(typeof $==="function")_=$,$=void 0;let U=this._getOutputContext($),Q={error:U.error,write:U.write,command:this};this._getCommandAndAncestors().reverse().forEach((J)=>J.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let v=this.helpInformation({error:U.error});if(_){if(v=_(v),typeof v!=="string"&&!Buffer.isBuffer(v))throw Error("outputHelp callback must return a string or a Buffer")}if(U.write(v),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",Q))}helpOption($,_){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",_??"display help for command"),$||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let _=Number(Z$.exitCode??0);if(_===0&&$&&typeof $!=="function"&&$.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText($,_){let U=["beforeAll","before","after","afterAll"];if(!U.includes($))throw Error(`Unexpected value for position to addHelpText.
99
- Expecting one of '${U.join("', '")}'`);let Q=`${$}Help`;return this.on(Q,(v)=>{let J;if(typeof _==="function")J=_({error:v.error,command:v.command});else J=_;if(J)v.write(`${J}
100
- `)}),this}_outputHelpIfRequested($){let _=this._getHelpOption();if(_&&$.find((Q)=>_.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function mq($){return $.map((_)=>{if(!_.startsWith("--inspect"))return _;let U,Q="127.0.0.1",v="9229",J;if((J=_.match(/^(--inspect(-brk)?)$/))!==null)U=J[1];else if((J=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(U=J[1],/^\d+$/.test(J[3]))v=J[3];else Q=J[3];else if((J=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)U=J[1],Q=J[3],v=J[4];if(U&&v!=="0")return`${U}=${Q}:${parseInt(v)+1}`;return _})}function LJ(){if(Z$.env.NO_COLOR||Z$.env.FORCE_COLOR==="0"||Z$.env.FORCE_COLOR==="false")return!1;if(Z$.env.FORCE_COLOR||Z$.env.CLICOLOR_FORCE!==void 0)return!0;return}TV.Command=kJ;TV.useColor=LJ});var dq=N6((uV)=>{var{Argument:hq}=o2(),{Command:AJ}=gq(),{CommanderError:PV,InvalidArgumentError:cq}=m_(),{Help:xV}=VJ(),{Option:lq}=DJ();uV.program=new AJ;uV.createCommand=($)=>new AJ($);uV.createOption=($,_)=>new lq($,_);uV.createArgument=($,_)=>new hq($,_);uV.Command=AJ;uV.Option=lq;uV.Argument=hq;uV.Help=xV;uV.CommanderError=PV;uV.InvalidArgumentError=cq;uV.InvalidOptionArgumentError=cq});var pq,VT,DT,MT,wT,LT,iq,kT,nq,AT,M6,FT;var a2=b(()=>{pq=tY(dq(),1),{program:VT,createCommand:DT,createArgument:MT,createOption:wT,CommanderError:LT,InvalidArgumentError:iq,InvalidOptionArgumentError:kT,Command:nq,Argument:AT,Option:M6,Help:FT}=pq.default});import{existsSync as oq,statSync as nV}from"fs";import{join as tq}from"path";function rq($,_){let U=tq($,_);if(!oq(U))return"missing";if(!nV(U).isDirectory())throw new M(`Component root "${_}" exists at "${U}" but is not a directory.`);return"directory"}function tV($,_){let U=rq($,_.singular),Q=rq($,_.plural);if(U==="directory"&&Q==="directory")return _.plural;if(U==="directory")return _.singular;if(Q==="directory")return _.plural;return _.plural}function aV($,_,U,Q,v){if(!v)return;let Y=`${U===Q.plural?Q.singular:Q.plural}/${v}`,z=tq($,Y);if(!oq(z))return;throw new t$(`Cross-root logical collision for "${_}": selected root "${U}" but "${Y}" already exists.`)}function w0($,_){let[U,...Q]=$.split("/");if(!U)return $;let v=oV.get(U);if(!v)return $;let J=tV(_,v),Y=Q.join("/");if(aV(_,$,J,v,Y),!Y)return J;return`${J}/${Y}`}var rV,oV;var FJ=b(()=>{z$();rV={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},oV=new Map(Object.entries(rV).flatMap(([$,_])=>{let U={singular:$,plural:_};return[[$,U],[_,U]]}))});import{stat as sV}from"fs/promises";import{homedir as eV}from"os";import{isAbsolute as $D,join as aq,relative as _D,resolve as sq}from"path";function vD($){let _=$.replace(/\\/g,"/");if(_===s2)return".";if(_.startsWith(OJ))return _.slice(OJ.length);return $}function O4(){let $=process.env.XDG_CONFIG_HOME,_=$&&$D($)?$:aq(eV(),".config");return aq(_,"opencode")}async function eq(){try{return(await sV(O4())).isDirectory()}catch{return!1}}function K1($,_,U){if(_){if(!U)return $;return w0($,U)}let Q=vD($),v=U?sq(U):process.cwd(),J=sq(v,s2),Y;try{Y=A4(J,Q)}catch(X){if(X instanceof U4)throw new M(`Invalid local target "${$}": ${X.message}`);throw X}let z=_D(J,Y).replace(/\\/g,"/");if(z==="."||z==="")return s2;let I=U?w0(z,J):z;return`${OJ}${I}`}var s2=".opencode",OJ;var p6=b(()=>{FJ();z$();X1();OJ=`${s2}/`});class y4{cwd;config;constructor($,_){this.cwd=$,this.config=_}static async requireInitialized($){let _=await u4($);if(!_)throw new n("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new y4($,_)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class L0{cwd;config;constructor($,_){this.cwd=$,this.config=_}static async requireInitialized(){let $=O4();if(!await eq())throw new n("Global config not found. Run 'ocx init --global' first.");let _=await u4($);if(!_)throw new n("Global config not found. Run 'ocx init --global' first.");return new L0($,_)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var k0=b(()=>{X4();z$();p6()});import{rename as $G,symlink as dT,unlink as _G}from"fs/promises";async function A0($,_){let U=`${$}.tmp.${process.pid}`;try{await Bun.write(U,JSON.stringify(_,null,"\t"),{mode:384}),await $G(U,$)}catch(Q){try{await _G(U)}catch{}throw Q}}async function vG($,_){let U=`${_}.tmp.${process.pid}`;try{let v=await Bun.file($).arrayBuffer();await Bun.write(U,v,{mode:384}),await $G(U,_)}catch(Q){try{await _G(U)}catch{}throw Q}}var e2=()=>{};import{existsSync as UG,statSync as UD}from"fs";import{readFile as QD,stat as JD}from"fs/promises";import{homedir as YD}from"os";import g$ from"path";function zD($={}){let _=$.xdgConfigHome??process.env.XDG_CONFIG_HOME;if(_&&_.trim().length>0)return g$.resolve(_);let U=$.homeDir??YD();return g$.resolve(U,".config")}function QG($,_){let U=g$.resolve($),Q=g$.resolve(_),v=g$.relative(U,Q);if(v==="")return!0;if(v==="..")return!1;if(v.startsWith(`..${g$.sep}`))return!1;return!g$.isAbsolute(v)}function $8($={}){return g$.join(zD($),"opencode")}function SJ($,_={}){let U=$8(_);if(!QG(U,$))return"local-project";let Q=g$.join(U,"profiles");if(QG(Q,$))return"global-profile-root";return"global-root"}function w6($={}){return g$.join($8($),"profiles")}function ID($=process.cwd()){let _=b1($);if(_)return g$.join(_,"profiles");return g$.join($,H1,"profiles")}function p$($){return g$.join(w6(),$)}function JG($,_=process.cwd()){return g$.join(ID(_),$)}function B4($){return g$.join(p$($),"ocx.jsonc")}function L6($){return g$.join(p$($),"opencode.jsonc")}function W1($){return g$.join(p$($),"AGENTS.md")}function b1($){let _=$;while(!0){let U=g$.join(_,H1);if(UG(U)&&UD(U).isDirectory())return U;let Q=g$.join(_,".git");if(UG(Q))return null;let v=g$.dirname(_);if(v===_)return null;_=v}}function F0(){return g$.join($8(),t4)}async function YG($={}){let _=g$.join($8($),t4),U;try{U=await JD(_)}catch(Q){let v=Q.code;if(v==="ENOENT"||v==="ENOTDIR")throw new i6("missing",_);throw new i6("read-failed",_,Q instanceof Error?Q.message:String(Q))}if(!U.isFile())throw new i6("not-file",_);try{let Q=await QD(_,"utf8");return{path:_,content:Q}}catch(Q){throw new i6("read-failed",_,Q instanceof Error?Q.message:String(Q))}}var t4="ocx.jsonc",NJ="opencode.jsonc",H1=".opencode",i6;var Z4=b(()=>{i6=class i6 extends Error{reason;configPath;constructor($,_,U){let Q=$==="missing"?`Required global config is missing at "${_}".`:$==="not-file"?`Required global config target is not a file: "${_}".`:`Failed to read required global config at "${_}": ${U??"Unknown read error"}`;super(Q);this.reason=$;this.configPath=_;this.name="RequiredGlobalConfigReadError"}}});var I6,eT;var _8=b(()=>{B6();M0();I6=K.string().min(1,"Profile name is required").max(32,"Profile name must be 32 characters or less").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Profile name must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens"),eT=K.object({name:I6,ocx:V6,opencode:K.record(K.string(),K.unknown()).optional(),hasAgents:K.boolean()})});import{mkdir as zG,readdir as XD,rename as qD,rm as GD,stat as TJ}from"fs/promises";function KD($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function IG($,_){let U=[],Q=x$($,U,{allowTrailingComma:!0});if(U.length>0){let v=KD(U);throw new n(`Invalid JSONC in ${_}: ${v}`)}return Q}function HD($,_,U){let Q=V6.safeParse($);if(!Q.success){let v=Q.error.issues[0],J=v?.path.length?v.path.join("."):"root",Y=v?.message??"Invalid profile OCX configuration";throw new n(`Invalid profile "${U}" ocx.jsonc at ${_}: ${J} ${Y}`)}return Q.data}function WD($,_,U){if(!$||typeof $!=="object"||Array.isArray($))throw new n(`Invalid profile "${U}" opencode.jsonc at ${_}: root must be an object`);return $}function XG($,_){if($.trim().length===0)throw new n(`Invalid profile from ${_}: value cannot be empty or whitespace`);return $}class h${cwd;constructor($=process.cwd()){this.cwd=$}get profilesDir(){return w6()}static create($){return new h$($??process.cwd())}static async requireInitialized(){let $=h$.create();if(!await $.isInitialized())throw new b0;return $}async isInitialized(){try{return(await TJ(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new b0}async list(){return await this.ensureInitialized(),(await XD(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter((_)=>_.isDirectory()&&!_.name.startsWith(".")).map((_)=>_.name).sort()}async exists($){let _=p$($);try{return(await TJ(_)).isDirectory()}catch{return!1}}async get($){if(!await this.exists($))throw new m$($);let _=B4($),U=Bun.file(_);if(!await U.exists())throw new n(`Profile "${$}" is missing ocx.jsonc. Expected at: ${_}`);let Q=await U.text(),v=IG(Q,_),J=HD(v,_,$),Y=L6($),z=Bun.file(Y),I;if(await z.exists()){let j=await z.text(),H=IG(j,Y);I=WD(H,Y,$)}let X=W1($),G=await Bun.file(X).exists();return{name:$,ocx:J,opencode:I,hasAgents:G}}async getLayered($,_){let U=JG($,_),Q=!1;try{Q=(await TJ(U)).isDirectory()}catch{Q=!1}if(Q)throw new IJ($,U);return this.get($)}async add($){let _=I6.safeParse($);if(!_.success)throw new n4($,_.error.issues[0]?.message??"Invalid name");if(await this.exists($))throw new m6($);let U=p$($);await zG(U,{recursive:!0,mode:448});let Q=B4($);if(!await Bun.file(Q).exists())await Bun.write(Q,jD,{mode:384});let J=L6($);if(!await Bun.file(J).exists())await A0(J,{});let z=W1($);if(!await Bun.file(z).exists()){let X=`# Profile Instructions
96
+ `),this.outputHelp({error:!0});let Y=$||{},q=Y.exitCode||1,J=Y.code||"commander.error";this._exit(q,J,Q)}_parseOptionsEnv(){this.options.forEach((Q)=>{if(Q.envVar&&Q.envVar in _1.env){let $=Q.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(Q.required||Q.optional)this.emit(`optionEnv:${Q.name()}`,_1.env[Q.envVar]);else this.emit(`optionEnv:${Q.name()}`)}})}_parseOptionsImplied(){let Q=new aB(this.options),$=(Y)=>{return this.getOptionValue(Y)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(Y))};this.options.filter((Y)=>Y.implied!==void 0&&$(Y.attributeName())&&Q.valueFromOption(this.getOptionValue(Y.attributeName()),Y)).forEach((Y)=>{Object.keys(Y.implied).filter((q)=>!$(q)).forEach((q)=>{this.setOptionValueWithSource(q,Y.implied[q],"implied")})})}missingArgument(Q){let $=`error: missing required argument '${Q}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(Q){let $=`error: option '${Q.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(Q){let $=`error: required option '${Q.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(Q,$){let Y=(X)=>{let H=X.attributeName(),G=this.getOptionValue(H),K=this.options.find((z)=>z.negate&&H===z.attributeName()),W=this.options.find((z)=>!z.negate&&H===z.attributeName());if(K&&(K.presetArg===void 0&&G===!1||K.presetArg!==void 0&&G===K.presetArg))return K;return W||X},q=(X)=>{let H=Y(X),G=H.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${H.envVar}'`;return`option '${H.flags}'`},J=`error: ${q(Q)} cannot be used with ${q($)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption(Q){if(this._allowUnknownOption)return;let $="";if(Q.startsWith("--")&&this._showSuggestionAfterError){let q=[],J=this;do{let X=J.createHelp().visibleOptions(J).filter((H)=>H.long).map((H)=>H.long);q=q.concat(X),J=J.parent}while(J&&!J._enablePositionalOptions);$=YJ(Q,q)}let Y=`error: unknown option '${Q}'${$}`;this.error(Y,{code:"commander.unknownOption"})}_excessArguments(Q){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,Y=$===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${Y} but got ${Q.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let Q=this.args[0],$="";if(this._showSuggestionAfterError){let q=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(q.push(J.name()),J.alias())q.push(J.alias())}),$=YJ(Q,q)}let Y=`error: unknown command '${Q}'${$}`;this.error(Y,{code:"commander.unknownCommand"})}version(Q,$,Y){if(Q===void 0)return this._version;this._version=Q,$=$||"-V, --version",Y=Y||"output the version number";let q=this.createOption($,Y);return this._versionOptionName=q.attributeName(),this._registerOption(q),this.on("option:"+q.name(),()=>{this._outputConfiguration.writeOut(`${Q}
97
+ `),this._exit(0,"commander.version",Q)}),this}description(Q,$){if(Q===void 0&&$===void 0)return this._description;if(this._description=Q,$)this._argsDescription=$;return this}summary(Q){if(Q===void 0)return this._summary;return this._summary=Q,this}alias(Q){if(Q===void 0)return this._aliases[0];let $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(Q===$._name)throw Error("Command alias can't be the same as its name");let Y=this.parent?._findCommand(Q);if(Y){let q=[Y.name()].concat(Y.aliases()).join("|");throw Error(`cannot add alias '${Q}' to command '${this.name()}' as already have command '${q}'`)}return $._aliases.push(Q),this}aliases(Q){if(Q===void 0)return this._aliases;return Q.forEach(($)=>this.alias($)),this}usage(Q){if(Q===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((Y)=>{return oB(Y)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).join(" ")}return this._usage=Q,this}name(Q){if(Q===void 0)return this._name;return this._name=Q,this}helpGroup(Q){if(Q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=Q,this}commandsGroup(Q){if(Q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=Q,this}optionsGroup(Q){if(Q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=Q,this}_initOptionGroup(Q){if(this._defaultOptionGroup&&!Q.helpGroupHeading)Q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(Q){if(this._defaultCommandGroup&&!Q.helpGroup())Q.helpGroup(this._defaultCommandGroup)}nameFromFilename(Q){return this._name=z8.basename(Q,z8.extname(Q)),this}executableDir(Q){if(Q===void 0)return this._executableDir;return this._executableDir=Q,this}helpInformation(Q){let $=this.createHelp(),Y=this._getOutputContext(Q);$.prepareContext({error:Y.error,helpWidth:Y.helpWidth,outputHasColors:Y.hasColors});let q=$.formatHelp(this,$);if(Y.hasColors)return q;return this._outputConfiguration.stripColor(q)}_getOutputContext(Q){Q=Q||{};let $=!!Q.error,Y,q,J;if($)Y=(H)=>this._outputConfiguration.writeErr(H),q=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else Y=(H)=>this._outputConfiguration.writeOut(H),q=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(H)=>{if(!q)H=this._outputConfiguration.stripColor(H);return Y(H)},hasColors:q,helpWidth:J}}outputHelp(Q){let $;if(typeof Q==="function")$=Q,Q=void 0;let Y=this._getOutputContext(Q),q={error:Y.error,write:Y.write,command:this};this._getCommandAndAncestors().reverse().forEach((X)=>X.emit("beforeAllHelp",q)),this.emit("beforeHelp",q);let J=this.helpInformation({error:Y.error});if($){if(J=$(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(Y.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",q),this._getCommandAndAncestors().forEach((X)=>X.emit("afterAllHelp",q))}helpOption(Q,$){if(typeof Q==="boolean"){if(Q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(Q??"-h, --help",$??"display help for command"),Q||$)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(Q){return this._helpOption=Q,this._initOptionGroup(Q),this}help(Q){this.outputHelp(Q);let $=Number(_1.exitCode??0);if($===0&&Q&&typeof Q!=="function"&&Q.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(Q,$){let Y=["beforeAll","before","after","afterAll"];if(!Y.includes(Q))throw Error(`Unexpected value for position to addHelpText.
98
+ Expecting one of '${Y.join("', '")}'`);let q=`${Q}Help`;return this.on(q,(J)=>{let X;if(typeof $==="function")X=$({error:J.error,command:J.command});else X=$;if(X)J.write(`${X}
99
+ `)}),this}_outputHelpIfRequested(Q){let $=this._getHelpOption();if($&&Q.find((q)=>$.is(q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function qJ(Q){return Q.map(($)=>{if(!$.startsWith("--inspect"))return $;let Y,q="127.0.0.1",J="9229",X;if((X=$.match(/^(--inspect(-brk)?)$/))!==null)Y=X[1];else if((X=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Y=X[1],/^\d+$/.test(X[3]))J=X[3];else q=X[3];else if((X=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Y=X[1],q=X[3],J=X[4];if(Y&&J!=="0")return`${Y}=${q}:${parseInt(J)+1}`;return $})}function h4(){if(_1.env.NO_COLOR||_1.env.FORCE_COLOR==="0"||_1.env.FORCE_COLOR==="false")return!1;if(_1.env.FORCE_COLOR||_1.env.CLICOLOR_FORCE!==void 0)return!0;return}tB.Command=f4;tB.useColor=h4});var KJ=F8((q_)=>{var{Argument:XJ}=V3(),{Command:u4}=JJ(),{CommanderError:$_,InvalidArgumentError:HJ}=F2(),{Help:Y_}=P4(),{Option:GJ}=x4();q_.program=new u4;q_.createCommand=(Q)=>new u4(Q);q_.createOption=(Q,$)=>new GJ(Q,$);q_.createArgument=(Q,$)=>new XJ(Q,$);q_.Command=u4;q_.Option=GJ;q_.Argument=XJ;q_.Help=Y_;q_.CommanderError=$_;q_.InvalidArgumentError=HJ;q_.InvalidOptionArgumentError=HJ});var WJ,OD,ID,ND,TD,bD,zJ,RD,BJ,SD,B8,ED;var L3=A(()=>{WJ=z5(KJ(),1),{program:OD,createCommand:ID,createArgument:ND,createOption:TD,CommanderError:bD,InvalidArgumentError:zJ,InvalidOptionArgumentError:RD,Command:BJ,Argument:SD,Option:B8,Help:ED}=WJ.default});import{existsSync as ZJ,statSync as U_}from"fs";import{join as MJ}from"path";function _J(Q,$){let Y=MJ(Q,$);if(!ZJ(Y))return"missing";if(!U_(Y).isDirectory())throw new L(`Component root "${$}" exists at "${Y}" but is not a directory.`);return"directory"}function L_(Q,$){let Y=_J(Q,$.singular),q=_J(Q,$.plural);if(Y==="directory"&&q==="directory")return $.plural;if(Y==="directory")return $.singular;if(q==="directory")return $.plural;return $.plural}function F_(Q,$,Y,q,J){if(!J)return;let H=`${Y===q.plural?q.singular:q.plural}/${J}`,G=MJ(Q,H);if(!ZJ(G))return;throw new n1(`Cross-root logical collision for "${$}": selected root "${Y}" but "${H}" already exists.`)}function R9(Q,$){let[Y,...q]=Q.split("/");if(!Y)return Q;let J=A_.get(Y);if(!J)return Q;let X=L_($,J),H=q.join("/");if(F_($,Q,X,J,H),!H)return X;return`${X}/${H}`}var V_,A_;var m4=A(()=>{t();V_={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},A_=new Map(Object.entries(V_).flatMap(([Q,$])=>{let Y={singular:Q,plural:$};return[[Q,Y],[$,Y]]}))});import{stat as j_}from"fs/promises";import{homedir as w_}from"os";import{isAbsolute as D_,join as UJ,relative as O_,resolve as VJ}from"path";function I_(Q){let $=Q.replace(/\\/g,"/");if($===F3)return".";if($.startsWith(g4))return $.slice(g4.length);return Q}function L0(){let Q=process.env.XDG_CONFIG_HOME,$=Q&&D_(Q)?Q:UJ(w_(),".config");return UJ($,"opencode")}async function AJ(){try{return(await j_(L0())).isDirectory()}catch{return!1}}function l8(Q,$,Y){if($){if(!Y)return Q;return R9(Q,Y)}let q=I_(Q),J=Y?VJ(Y):process.cwd(),X=VJ(J,F3),H;try{H=V0(X,q)}catch(W){if(W instanceof e1)throw new L(`Invalid local target "${Q}": ${W.message}`);throw W}let G=O_(X,H).replace(/\\/g,"/");if(G==="."||G==="")return F3;let K=Y?R9(G,X):G;return`${g4}${K}`}var F3=".opencode",g4;var k8=A(()=>{m4();t();g8();g4=`${F3}/`});class b0{cwd;config;constructor(Q,$){this.cwd=Q,this.config=$}static async requireInitialized(Q){let $=await T0(Q);if(!$)throw new h("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new b0(Q,$)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class S9{cwd;config;constructor(Q,$){this.cwd=Q,this.config=$}static async requireInitialized(){let Q=L0();if(!await AJ())throw new h("Global config not found. Run 'ocx init --global' first.");let $=await T0(Q);if(!$)throw new h("Global config not found. Run 'ocx init --global' first.");return new S9(Q,$)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var E9=A(()=>{q0();t();k8()});import{rename as LJ,symlink as oD,unlink as FJ}from"fs/promises";async function k9(Q,$){let Y=`${Q}.tmp.${process.pid}`;try{await Bun.write(Y,JSON.stringify($,null,"\t"),{mode:384}),await LJ(Y,Q)}catch(q){try{await FJ(Y)}catch{}throw q}}async function jJ(Q,$){let Y=`${$}.tmp.${process.pid}`;try{let J=await Bun.file(Q).arrayBuffer();await Bun.write(Y,J,{mode:384}),await LJ(Y,$)}catch(q){try{await FJ(Y)}catch{}throw q}}var j3=()=>{};import{existsSync as wJ,statSync as N_}from"fs";import{readFile as T_,stat as b_}from"fs/promises";import{homedir as R_}from"os";import y1 from"path";function S_(Q={}){let $=Q.xdgConfigHome??process.env.XDG_CONFIG_HOME;if($&&$.trim().length>0)return y1.resolve($);let Y=Q.homeDir??R_();return y1.resolve(Y,".config")}function DJ(Q,$){let Y=y1.resolve(Q),q=y1.resolve($),J=y1.relative(Y,q);if(J==="")return!0;if(J==="..")return!1;if(J.startsWith(`..${y1.sep}`))return!1;return!y1.isAbsolute(J)}function w3(Q={}){return y1.join(S_(Q),"opencode")}function c4(Q,$={}){let Y=w3($);if(!DJ(Y,Q))return"local-project";let q=y1.join(Y,"profiles");if(DJ(q,Q))return"global-profile-root";return"global-root"}function _8(Q={}){return y1.join(w3(Q),"profiles")}function E_(Q=process.cwd()){let $=M8(Q);if($)return y1.join($,"profiles");return y1.join(Q,i8,"profiles")}function h1(Q){return y1.join(_8(),Q)}function OJ(Q,$=process.cwd()){return y1.join(E_($),Q)}function K0(Q){return y1.join(h1(Q),"ocx.jsonc")}function Z8(Q){return y1.join(h1(Q),"opencode.jsonc")}function n8(Q){return y1.join(h1(Q),"AGENTS.md")}function M8(Q){let $=Q;while(!0){let Y=y1.join($,i8);if(wJ(Y)&&N_(Y).isDirectory())return Y;let q=y1.join($,".git");if(wJ(q))return null;let J=y1.dirname($);if(J===$)return null;$=J}}function v9(){return y1.join(w3(),c0)}async function IJ(Q={}){let $=y1.join(w3(Q),c0),Y;try{Y=await b_($)}catch(q){let J=q.code;if(J==="ENOENT"||J==="ENOTDIR")throw new v8("missing",$);throw new v8("read-failed",$,q instanceof Error?q.message:String(q))}if(!Y.isFile())throw new v8("not-file",$);try{let q=await T_($,"utf8");return{path:$,content:q}}catch(q){throw new v8("read-failed",$,q instanceof Error?q.message:String(q))}}var c0="ocx.jsonc",j2="opencode.jsonc",i8=".opencode",v8;var W0=A(()=>{v8=class v8 extends Error{reason;configPath;constructor(Q,$,Y){let q=Q==="missing"?`Required global config is missing at "${$}".`:Q==="not-file"?`Required global config target is not a file: "${$}".`:`Failed to read required global config at "${$}": ${Y??"Unknown read error"}`;super(q);this.reason=Q;this.configPath=$;this.name="RequiredGlobalConfigReadError"}}});var a0,qO;var D3=A(()=>{G8();b9();a0=F().min(1,"Profile name is required").max(32,"Profile name must be 32 characters or less").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Profile name must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens"),qO=Q1({name:a0,ocx:W8,opencode:q1(F(),I8()).optional(),hasAgents:i1()})});import{mkdir as NJ,readdir as k_,rename as v_,rm as P_,stat as d4}from"fs/promises";function C_(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function TJ(Q,$){let Y=[],q=O1(Q,Y,{allowTrailingComma:!0});if(Y.length>0){let J=C_(Y);throw new h(`Invalid JSONC in ${$}: ${J}`)}return q}function y_(Q,$,Y){let q=W8.safeParse(Q);if(!q.success){let J=q.error.issues[0],X=J?.path.length?J.path.join("."):"root",H=J?.message??"Invalid profile OCX configuration";throw new h(`Invalid profile "${Y}" ocx.jsonc at ${$}: ${X} ${H}`)}return q.data}function h_(Q,$,Y){if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new h(`Invalid profile "${Y}" opencode.jsonc at ${$}: root must be an object`);return Q}function bJ(Q,$){if(Q.trim().length===0)throw new h(`Invalid profile from ${$}: value cannot be empty or whitespace`);return Q}class f1{cwd;constructor(Q=process.cwd()){this.cwd=Q}get profilesDir(){return _8()}static create(Q){return new f1(Q??process.cwd())}static async requireInitialized(){let Q=f1.create();if(!await Q.isInitialized())throw new D9;return Q}async isInitialized(){try{return(await d4(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new D9}async list(){return await this.ensureInitialized(),(await k_(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter(($)=>$.isDirectory()&&!$.name.startsWith(".")).map(($)=>$.name).sort()}async exists(Q){let $=h1(Q);try{return(await d4($)).isDirectory()}catch{return!1}}async get(Q){if(!await this.exists(Q))throw new C1(Q);let $=K0(Q),Y=Bun.file($);if(!await Y.exists())throw new h(`Profile "${Q}" is missing ocx.jsonc. Expected at: ${$}`);let q=await Y.text(),J=TJ(q,$),X=y_(J,$,Q),H=Z8(Q),G=Bun.file(H),K;if(await G.exists()){let Z=await G.text(),M=TJ(Z,H);K=h_(M,H,Q)}let W=n8(Q),B=await Bun.file(W).exists();return{name:Q,ocx:X,opencode:K,hasAgents:B}}async getLayered(Q,$){let Y=OJ(Q,$),q=!1;try{q=(await d4(Y)).isDirectory()}catch{q=!1}if(q)throw new D4(Q,Y);return this.get(Q)}async add(Q){let $=a0.safeParse(Q);if(!$.success)throw new u0(Q,$.error.issues[0]?.message??"Invalid name");if(await this.exists(Q))throw new N8(Q);let Y=h1(Q);await NJ(Y,{recursive:!0,mode:448});let q=K0(Q);if(!await Bun.file(q).exists())await Bun.write(q,x_,{mode:384});let X=Z8(Q);if(!await Bun.file(X).exists())await k9(X,{});let G=n8(Q);if(!await Bun.file(G).exists()){let W=`# Profile Instructions
101
100
 
102
101
  <!-- Add your custom instructions for this profile here -->
103
- <!-- These will be included when running \`ocx opencode -p ${$}\` -->
104
- `;await Bun.write(z,X,{mode:384})}}async remove($){if(!await this.exists($))throw new m$($);if((await this.list()).length<=1)throw Error("Cannot delete the last profile. At least one profile must exist.");let U=p$($);await GD(U,{recursive:!0})}async move($,_){let U=I6.safeParse($);if(!U.success)throw new n4($,U.error.issues[0]?.message??"Invalid name");let Q=I6.safeParse(_);if(!Q.success)throw new n4(_,Q.error.issues[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists($))throw new m$($);if($===_)return{warnActiveProfile:!1};if(await this.exists(_))throw new t$(`Cannot move: profile "${_}" already exists. Remove it first with 'ocx profile rm ${_} --global'.`);let v=process.env.OCX_PROFILE===$,J=p$($),Y=p$(_);try{await qD(J,Y)}catch(z){if(z instanceof Error&&"code"in z){let I=z.code;if(I==="EEXIST"||I==="ENOTEMPTY")throw new t$(`Cannot move: profile "${_}" already exists. Remove it first with 'ocx profile rm ${_} --global'.`);if(I==="ENOENT")throw new m$($)}throw z}return{warnActiveProfile:v}}async resolveProfile($){if($!==void 0){let Q=XG($,"CLI option --profile");if(!await this.exists(Q))throw new m$(Q);return Q}let _=process.env.OCX_PROFILE;if(_!==void 0){let Q=XG(_,"environment variable OCX_PROFILE");if(!await this.exists(Q))throw new m$(Q);return Q}let U="default";if(!await this.exists(U))throw new m$(U);return U}async initialize(){await zG(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var qG,jD=`{
102
+ <!-- These will be included when running \`ocx opencode -p ${Q}\` -->
103
+ `;await Bun.write(G,W,{mode:384})}}async remove(Q){if(!await this.exists(Q))throw new C1(Q);if((await this.list()).length<=1)throw Error("Cannot delete the last profile. At least one profile must exist.");let Y=h1(Q);await P_(Y,{recursive:!0})}async move(Q,$){let Y=a0.safeParse(Q);if(!Y.success)throw new u0(Q,Y.error.issues[0]?.message??"Invalid name");let q=a0.safeParse($);if(!q.success)throw new u0($,q.error.issues[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists(Q))throw new C1(Q);if(Q===$)return{warnActiveProfile:!1};if(await this.exists($))throw new n1(`Cannot move: profile "${$}" already exists. Remove it first with 'ocx profile rm ${$} --global'.`);let J=process.env.OCX_PROFILE===Q,X=h1(Q),H=h1($);try{await v_(X,H)}catch(G){if(G instanceof Error&&"code"in G){let K=G.code;if(K==="EEXIST"||K==="ENOTEMPTY")throw new n1(`Cannot move: profile "${$}" already exists. Remove it first with 'ocx profile rm ${$} --global'.`);if(K==="ENOENT")throw new C1(Q)}throw G}return{warnActiveProfile:J}}async resolveProfile(Q){if(Q!==void 0){let q=bJ(Q,"CLI option --profile");if(!await this.exists(q))throw new C1(q);return q}let $=process.env.OCX_PROFILE;if($!==void 0){let q=bJ($,"environment variable OCX_PROFILE");if(!await this.exists(q))throw new C1(q);return q}let Y="default";if(!await this.exists(Y))throw new C1(Y);return Y}async initialize(){await NJ(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var RJ,x_=`{
105
104
  "$schema": "https://ocx.kdco.dev/schemas/profile.json",
106
105
  "registries": {},
107
106
  "renameWindow": true,
@@ -115,161 +114,161 @@ Expecting one of '${U.join("', '")}'`);let Q=`${$}Help`;return this.on(Q,(v)=>{l
115
114
  ],
116
115
  "include": []
117
116
  }
118
- `;var X6=b(()=>{c4();M0();z$();e2();Z4();_8();qG={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function GG($,_,U){let Q=(v)=>$(v,..._);return U===void 0?Q:Object.assign(Q,{lazy:U,lazyArgs:_})}var jG=()=>{};function KG($,_,U){let Q=$.length-_.length;if(Q===0)return $(..._);if(Q===1)return GG($,_,U);throw Error("Wrong number of arguments")}var HG=b(()=>{jG()});function RJ($){if(typeof $!="object"||!$)return!1;let _=Object.getPrototypeOf($);return _===null||_===Object.prototype}var WG=()=>{};function EJ(...$){return KG(bG,$)}function bG($,_){let U={...$,..._};for(let Q in _){if(!(Q in $))continue;let{[Q]:v}=$;if(!RJ(v))continue;let{[Q]:J}=_;RJ(J)&&(U[Q]=bG(v,J))}return U}var BG=b(()=>{HG();WG()});var ZG=b(()=>{BG()});function VG($){let _=$.startsWith("npm:"),U=_?$.slice(4):$;if(!U)return $;if(U.startsWith("@")){let J=U.indexOf("/");if(J===-1)return $;let z=U.slice(J+1).indexOf("@");if(z===-1)return $;let I=U.slice(0,J+1+z);return _?`npm:${I}`:I}let Q=U.indexOf("@");if(Q===-1)return $;let v=U.slice(0,Q);return _?`npm:${v}`:v}function bD($){let _=new Map;for(let Q=$.length-1;Q>=0;Q--){let v=$[Q],J=VG(v);if(!_.has(J))_.set(J,Q)}let U=[];for(let[Q,v]of $.entries()){let J=VG(v);if(_.get(J)===Q)U.push(v)}return U}function v8($,_){let U=EJ($,_);if(Array.isArray($.plugin)&&Array.isArray(_.plugin))U.plugin=bD([...$.plugin,..._.plugin]);else if(Array.isArray($.plugin))U.plugin=$.plugin;else if(Array.isArray(_.plugin))U.plugin=_.plugin;if(Array.isArray($.instructions)&&Array.isArray(_.instructions))U.instructions=Array.from(new Set([...$.instructions,..._.instructions]));else if(Array.isArray($.instructions))U.instructions=$.instructions;else if(Array.isArray(_.instructions))U.instructions=_.instructions;return U}var PJ=b(()=>{ZG()});import{existsSync as BD,readFileSync as ZD}from"fs";import{dirname as VD,isAbsolute as wR,resolve as xJ}from"path";function DD($){let _=xJ($);while(!0){let U=xJ(_,".git");if(BD(U))try{let v=P1("fs").statSync(U);if(v.isDirectory())return _;if(v.isFile()){if(ZD(U,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return _}}catch{}let Q=VD(_);if(Q===_)return null;_=Q}}function uJ($){let _=xJ($);return DD(_)??_}var DG=()=>{};import{existsSync as MD}from"fs";import*as B1 from"path";var{Glob:wD}=globalThis.Bun;function MG($){return $.startsWith("http://")||$.startsWith("https://")}function LD($,_){if(MG($))return;if(B1.isAbsolute($)||B1.win32.isAbsolute($))throw new M(`Absolute path not allowed in registry instructions: "${$}" (from ${_})`);if($.startsWith("~"))throw new M(`Home directory path not allowed in registry instructions: "${$}" (from ${_})`);if($.split(/[/\\]/).some((Q)=>Q===".."))throw new M(`Path traversal (..) not allowed in registry instructions: "${$}" (from ${_})`)}function kD($,_,U){if(MG($))return[$];if(LD($,U),$.includes("*")||$.includes("?")||$.includes("[")){let J=new wD($),Y=[];for(let z of J.scanSync(_)){let I=B1.join(_,z);Y.push(I)}return Y}let v=B1.join(_,$);if(!MD(v))throw new M(`Registry instruction file not found: "${$}" (from ${U})
119
- Expected at: ${v}`);return[v]}function wG($,_,U){let Q=[],v=new Set;for(let J of $){let Y=kD(J,_,U);for(let z of Y)if(!v.has(z))v.add(z),Q.push(z)}return Q}var LG=b(()=>{z$()});import{existsSync as Z1,readFileSync as AG,statSync as AD}from"fs";import{homedir as FD}from"os";import{join as C4,relative as FG}from"path";var{Glob:U8}=globalThis.Bun;function OD($){return $==="local-config"||$==="cli"||$==="env"}function yJ($,_){if($.trim().length===0)throw new n(`Invalid profile from ${_}: value cannot be empty or whitespace`);return $}function OG($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function kG($){let _;try{_=AG($,"utf8")}catch(J){let Y=J instanceof Error?J.message:"Unknown read error";throw new n(`Failed to read local config at ${$}: ${Y}`)}let U=[],Q=x$(_,U,{allowTrailingComma:!0});if(U.length>0){let J=OG(U);throw new n(`Invalid JSONC in local config at ${$}: ${J}`)}let v=h6.safeParse(Q);if(!v.success){let J=v.error.issues[0],Y=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid OCX config";throw new n(`Invalid local config at ${$}: ${Y} ${z}`)}return v.data}function ND($){let _;try{_=AG($,"utf8")}catch(v){let J=v instanceof Error?v.message:"Unknown read error";throw new n(`Failed to read local OpenCode config at ${$}: ${J}`)}let U=[],Q=x$(_,U,{allowTrailingComma:!0});if(U.length>0){let v=OG(U);throw new n(`Invalid JSONC in local OpenCode config at ${$}: ${v}`)}if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new n(`Invalid local OpenCode config at ${$}: root must be an object`);return Q}function TD($,_,U){let Q=[],v=_;while(!0){let J=C4(v,$);if(Z1(J)&&AD(J).isFile()){let z=FG(U,J);Q.push(z)}if(v===U)break;let Y=C4(v,"..");if(Y===v)break;v=Y}return Q}function RD($,_){for(let U of SD){let Q=TD(U,$,_);if(Q.length>0)return Q}return[]}function Q8($){return $.startsWith("./")?$.slice(2):$}function ED($,_,U){return $.filter((Q)=>{for(let v of U)if(new U8(Q8(v)).match(Q))return!0;for(let v of _)if(new U8(Q8(v)).match(Q))return!1;return!0})}async function PD($){let _=await F4($);if(!_||Object.keys(_.installed).length===0)return[];let U=[];for(let[Q,v]of Object.entries(_.installed)){if(!v.opencode?.instructions)continue;let J=v.opencode.instructions;if(!Array.isArray(J))continue;let Y=`${v.registryName}/${v.name} (${Q})`,z=wG(J,$,Y);U.push(...z)}return Array.from(new Set(U))}class q6{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor($,_,U,Q,v){this.cwd=$,this.profileName=_,this.profile=U,this.localConfigDir=Q,this.registryInstructions=v}static async create($,_){let U=h$.create($),Q=null,v="none",J=b1($);if(J){let q=C4(J,t4);if(Z1(q)){let G=kG(q);if(G.profile!==void 0)Q=yJ(G.profile,`local config at ${q}`),v="local-config"}}if(Q===null){if(_?.profile!==void 0)Q=yJ(_.profile,"CLI option --profile"),v="cli";else if(process.env.OCX_PROFILE!==void 0)Q=yJ(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),v="env"}let Y=await U.isInitialized();if(OD(v)&&!Y)throw new b0;let z=null;if(Y)if(Q!==null)z=await U.getLayered(Q,$);else try{Q=await U.resolveProfile(),z=await U.getLayered(Q,$),v="default"}catch(q){if(!(q instanceof m$)||q.profile!=="default")throw q;Q=null,z=null,v="none"}let I;if(z)I=p$(Q);else if(J)I=C4(J,"..");else I=O4();let X=await PD(I);return new q6($,Q,z,J,X)}resolve(){if(this.cachedConfig)return this.cachedConfig;let $={},_=H1,U={};if(this.profile){if($={...$,...this.profile.ocx.registries},this.profile.ocx.componentPath)_=this.profile.ocx.componentPath;if(this.profile.opencode)U=this.mergeOpencode(U,this.profile.opencode)}let Q=this.shouldLoadLocalConfig();if(!this.profile&&Q&&this.localConfigDir){let J=this.loadLocalOcxConfig();if(J)$=J.registries}if(this.localConfigDir){let J=this.loadLocalOpencodeConfig();if(J)U=this.mergeOpencode(U,J)}let v=this.discoverInstructions();return this.cachedConfig={registries:$,componentPath:_,opencode:U,instructions:v,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let $=new Map,_={},U=H1,Q={};if($.set("componentPath",{path:"",source:"default"}),this.profile){let Y=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[z,I]of Object.entries(this.profile.ocx.registries))_[z]=I,$.set(`registries.${z}`,{path:Y,source:"global-profile"});if(this.profile.ocx.componentPath)U=this.profile.ocx.componentPath,$.set("componentPath",{path:Y,source:"global-profile"});if(this.profile.opencode){Q=this.mergeOpencode(Q,this.profile.opencode);let z=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let I of Object.keys(this.profile.opencode))$.set(`opencode.${I}`,{path:z,source:"global-profile"})}}let v=this.shouldLoadLocalConfig();if(!this.profile&&v&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let z=C4(this.localConfigDir,t4);for(let[I,X]of Object.entries(Y.registries))_[I]=X,$.set(`registries.${I}`,{path:z,source:"local-config"})}}if(this.localConfigDir){let Y=this.loadLocalOpencodeConfig();if(Y){Q=this.mergeOpencode(Q,Y);let z=C4(this.localConfigDir,NJ);for(let I of Object.keys(Y))$.set(`opencode.${I}`,{path:z,source:"local-opencode"})}}let J=this.discoverInstructions();return{registries:_,componentPath:U,opencode:Q,instructions:J,profileName:this.profileName,origins:$}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let _=uJ(this.cwd),U=FG(_,this.localConfigDir),Q=this.profile.ocx.exclude??[],v=this.profile.ocx.include??[];for(let J of v){let Y=new U8(Q8(J));if(Y.match(`${U}/`)||Y.match(U))return!0}for(let J of Q){let Y=new U8(Q8(J));if(Y.match(`${U}/`)||Y.match(`${U}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let $=C4(this.localConfigDir,t4);if(!Z1($))return null;return{registries:kG($).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let $=C4(this.localConfigDir,NJ);if(!Z1($))return null;return ND($)}discoverInstructions(){let $=[],_=O4(),U=C4(_,"AGENTS.md");if(Z1(U))$.push(U);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let q=C4(FD(),".claude","CLAUDE.md");if(Z1(q))$.push(q)}if(this.profile&&this.profileName){let q=C4(p$(this.profileName),"AGENTS.md");if(Z1(q))$.push(q)}let Q=this.loadRegistryInstructions();$.push(...Q);let v=uJ(this.cwd),J=RD(this.cwd,v),Y=this.profile?.ocx.exclude??[],z=this.profile?.ocx.include??[],X=ED(J,Y,z).map((q)=>C4(v,q));return $.push(...X),$}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode($,_){return v8($,_)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var SD;var g_=b(()=>{c4();X6();Z4();PJ();X4();z$();DG();LG();p6();SD=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function q4($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&Object.getPrototypeOf($)===Object.prototype}var xG={};s$(xG,{fetchRegistryIndex:()=>n6,fetchFileContent:()=>V1,fetchComponentVersion:()=>I8,fetchComponent:()=>c_,classifyRegistryIndexIssue:()=>PG,_clearFetcherCacheForTests:()=>lD});import{posix as xD}from"path";function CD($,_){return new i4(`Registry at ${$} uses an incompatible format (${_.issue}). ${_.remediation}`,{url:$,issue:_.issue,remediation:_.remediation,..._.schemaUrl!==void 0&&{schemaUrl:_.schemaUrl},..._.supportedMajor!==void 0&&{supportedMajor:_.supportedMajor},..._.detectedMajor!==void 0&&{detectedMajor:_.detectedMajor}})}function SG($,_){if(typeof $!=="string")throw new M(`Invalid ${_}: expected string, got ${typeof $}`);let U=z8[$]??$,Q=B0.safeParse(U);if(!Q.success)throw new M(`Unsupported component type "${$}" in ${_}. Expected one of: ${B0.options.join(", ")}`);return Q.data}function TG($){return typeof $==="string"&&Object.hasOwn(z8,$)}function Y8($){return $.startsWith(".opencode/")||$.startsWith(".opencode\\")}function RG($){if(!q4($)||!Array.isArray($.files))return[];let _=[];for(let[U,Q]of $.files.entries()){if(typeof Q==="string"){if(!Y8(Q))continue;_.push({path:`files[${U}]`,target:Q});continue}if(!q4(Q)||typeof Q.target!=="string")continue;if(!Y8(Q.target))continue;_.push({path:`files[${U}].target`,target:Q.target})}return _}function fD($){if(!q4($))return[];let _=$.components;if(!Array.isArray(_))return[];let U=[];for(let[Q,v]of _.entries()){if(!q4(v))continue;let J=v.type;if(!TG(J))continue;U.push({path:`components[${Q}].type`,type:J})}return U}function mD($){if(!q4($))return!1;if(typeof $.type==="string"&&$.type.startsWith("ocx:"))return!0;return RG($).length>0}async function gD($){let _=d$($),U=h_.get(_);if(U)return U;try{await n6(_)}catch(v){if(v instanceof E$||v instanceof B$)return null;throw v}if(!h_.has(_))return null;let Q=h_.get(_);if(!Q)throw Error(`Missing registry schema mode cache entry for ${_}`);return Q}function NG($,_){if($.includes("\x00"))throw new M(`Unsafe target "${$}" in ${_}: null bytes are not allowed`);if($.includes("%"))throw new M(`Unsafe target "${$}" in ${_}: encoded paths are not allowed`);if($.includes("\\"))throw new M(`Unsafe target "${$}" in ${_}: Windows separators are not allowed`);if($.startsWith("/")||$.startsWith("//")||/^[a-zA-Z]:/.test($))throw new M(`Unsafe target "${$}" in ${_}: absolute paths are not allowed`);let U=$.startsWith(".opencode/")?$.slice(10):$;if(!U)throw new M(`Unsafe target "${$}" in ${_}: missing path after .opencode/`);let Q=U.split("/");if(Q.some((X)=>X.length===0))throw new M(`Unsafe target "${$}" in ${_}: empty path segments are not allowed`);if(Q.some((X)=>X==="."||X===".."))throw new M(`Unsafe target "${$}" in ${_}: traversal segments are not allowed`);let[v,...J]=Q;if(!v)throw new M(`Unsafe target "${$}" in ${_}: missing path root segment`);let z=[uD[v]??v,...J].join("/"),I=xD.normalize(z);if(I!==z)throw new M(`Unsafe target "${$}" in ${_}: path normalization is ambiguous`);if(I==="."||I===".."||I.startsWith("../"))throw new M(`Unsafe target "${$}" in ${_}: target escapes project root`);return I}function hD($,_){if(!q4($))return $;let U={...$};if(Object.hasOwn(U,"type"))U.type=SG(U.type,`${_}.type`);if(Array.isArray(U.files))U.files=U.files.map((Q,v)=>{if(typeof Q==="string"){if(!Y8(Q))return Q;return NG(Q,`${_}.files[${v}]`)}if(!q4(Q))return Q;let J=Q.target;if(typeof J!=="string")return Q;if(!Y8(J))return Q;return{...Q,target:NG(J,`${_}.files[${v}].target`)}});return U}function cD($,_){if(!q4($))throw new i4(`Registry at ${_} uses legacy schema v1 but does not expose an object index payload.`,{url:_,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let U=$.components;if(!Array.isArray(U))throw new i4(`Registry at ${_} uses legacy schema v1 but the components field is missing or invalid.`,{url:_,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let Q=U.map((v,J)=>{if(!q4(v))throw new M(`Invalid index component at components[${J}]: expected object, got ${typeof v}`);let{name:Y,description:z}=v;if(typeof Y!=="string")throw new M(`Invalid index component name at components[${J}].name`);if(typeof z!=="string")throw new M(`Invalid index component description at components[${J}].description`);return{name:Y,type:SG(v.type,`components[${J}].type`),description:z}});return{...$,components:Q}}async function EG($,_,U={}){let Q=J8.get($);if(Q)return Q;let v=U.requestUrl??$,J=(async()=>{let Y={url:v,phase:U.phase},z;try{z=await fetch(v)}catch(X){throw new E$(`Network request failed for ${v}: ${X instanceof Error?X.message:String(X)}`,Y)}if(!z.ok){if(z.status===404)throw new B$(`Not found: ${v}`);throw new E$(`Failed to fetch ${v}: ${z.status} ${z.statusText}`,{...Y,status:z.status,statusText:z.statusText})}let I;try{I=await z.json()}catch(X){throw new E$(`Invalid JSON response from ${v}: ${X instanceof Error?X.message:String(X)}`,Y)}return await _(I)})();return J8.set($,J),J.catch(()=>J8.delete($)),J}function PG($){let _=Z0($);if(!_)return null;return{issue:_.issue,remediation:_.remediation,schemaUrl:_.schemaUrl,supportedMajor:_.supportedMajor,detectedMajor:_.detectedMajor}}async function n6($){let _=d$($),U=`${_}/index.json`;return EG(U,(Q)=>{let v=PG(Q);if(v&&v.issue!=="legacy-schema-v1")throw CD(U,v);let J=Q,Y="v2";if(v?.issue==="legacy-schema-v1"){Y="legacy-v1";try{J=cD(Q,U)}catch(I){if(I instanceof i4)throw I;let X=I instanceof Error?I.message:String(I);throw new i4(`Registry at ${U} uses legacy schema v1 but cannot be adapted safely. ${X}`,{url:U,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let I=fD(J);if(I.length>0){let X=I[0];if(!X)throw Error("Unexpected missing legacy type issue");let q=z8[X.type];throw new i4(`Registry at ${U} uses legacy component type "${X.type}" in ${X.path}. Use "${q}" for v2 registries.`,{url:U,issue:"invalid-format",remediation:`Replace legacy type "${X.type}" with canonical "${q}" in v2 manifests.`})}}let z=jJ.safeParse(J);if(!z.success)throw new i4(`Registry at ${U} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${z.error.message}`,{url:U,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${z.error.message}`});return h_.set(_,Y),z.data},{phase:"registry-index-fetch"})}async function c_($,_){return(await I8($,_)).manifest}async function I8($,_,U){let Q=`${d$($)}/components/${_}.json`;return EG(`${Q}#v=${U??"latest"}`,async(v)=>{let J=yD.safeParse(v);if(!J.success)throw new M(`Invalid packument format for "${_}": ${J.error.message}`);let Y=J.data,z=U??Y["dist-tags"].latest,I=Y.versions[z];if(!I){if(U){let j=Object.keys(Y.versions).join(", ");throw new M(`Component "${_}" has no version "${U}". Available: ${j}`)}throw new M(`Component "${_}" has no manifest for latest version ${z}`)}let X=`component "${_}@${z}"`,q=I;if(mD(I))if(await gD($)!=="v2")q=hD(I,X);else{let Z=RG(I)[0];if(Z)throw new M(`Invalid component manifest for "${_}@${z}": target "${Z.target}" at ${Z.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(q4(I)&&TG(I.type)){let V=z8[I.type];throw new M(`Invalid component manifest for "${_}@${z}": type "${I.type}" is a legacy v1 alias. Use "${V}" for v2 registries.`)}}let G=q1.safeParse(q);if(!G.success)throw new M(`Invalid component manifest for "${_}@${z}": ${G.error.message}`);return{manifest:G.data,version:z}},{phase:"packument-fetch",requestUrl:Q})}async function V1($,_,U){let Q=`${d$($)}/components/${_}/${U}`,v={url:Q,phase:"file-content-fetch",qualifiedName:_},J;try{J=await fetch(Q)}catch(Y){throw new E$(`Network request failed for ${Q}: ${Y instanceof Error?Y.message:String(Y)}`,v)}if(!J.ok)throw new E$(`Failed to fetch file ${U} for ${_} from ${Q}: ${J.status} ${J.statusText}`,{...v,status:J.status,statusText:J.statusText});return J.text()}function lD(){J8.clear(),h_.clear()}var J8,h_,z8,uD,yD;var D1=b(()=>{B6();o4();z$();J8=new Map,h_=new Map,z8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},uD={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},yD=x_.extend({versions:K.record(K.string(),K.unknown())})});function uG($,_){if($.includes("/"))return r4($);if(_)return{namespace:_,component:$};throw new M(`Component '${$}' must include a registry alias (e.g., 'kdco/${$}')`)}async function yG($,_){let U=new Map,Q=new Set,v=new Set,J=new Set,Y={};async function z(q,G,j=[]){let H=GJ(q,G);if(U.has(H))return;if(Q.has(H)){let T=[...j,H].join(" \u2192 ");throw new M(`Circular dependency detected: ${T}`)}Q.add(H);let Z=$[q];if(!Z)throw new B$(`Registry alias '${q}' not found. Add it with 'ocx registry add <url> --name ${q}'.`);let V;try{V=await c_(Z.url,G)}catch(T){if(T instanceof E$)throw T;if(T instanceof B$)throw new B$(`Component '${G}' not found in registry '${q}'.`);if(T instanceof b$)throw T;throw new E$(`Failed to fetch component '${G}' from registry '${q}': ${T instanceof Error?T.message:String(T)}`,{url:Z.url})}for(let T of V.dependencies){let r=uG(T,q);await z(r.namespace,r.component,[...j,H])}let S=G1(V);if(U.set(H,{...S,registryName:q,baseUrl:Z.url,qualifiedName:H}),Q.delete(H),V.npmDependencies)for(let T of V.npmDependencies)v.add(T);if(V.npmDevDependencies)for(let T of V.npmDevDependencies)J.add(T);if(S.opencode)Y=v8(Y,S.opencode)}for(let q of _){let G=uG(q);await z(G.namespace,G.component)}let I=Array.from(U.values()),X=Array.from(U.keys());return{components:I,installOrder:X,npmDependencies:Array.from(v),npmDevDependencies:Array.from(J),opencode:Y}}var CG=b(()=>{o4();z$();D1();PJ()});import{statSync as dD}from"fs";import{mkdir as fG}from"fs/promises";import V4 from"path";function O0($){try{return dD($).isFile()}catch{return!1}}function X8($){let _=V4.resolve($);if(SJ(_)!=="local-project"){let I=V4.join(_,"opencode.jsonc"),X=V4.join(_,"opencode.json");if(O0(I))return{path:I,exists:!0};if(O0(X))return{path:X,exists:!0};return{path:I,exists:!1}}let v=V4.join(_,fJ,"opencode.jsonc"),J=V4.join(_,fJ,"opencode.json");if(O0(v))return{path:v,exists:!0};if(O0(J))return{path:J,exists:!0};let Y=V4.join(_,"opencode.jsonc"),z=V4.join(_,"opencode.json");if(O0(Y))return{path:Y,exists:!0};if(O0(z))return{path:z,exists:!0};return{path:v,exists:!1}}async function mG($){let{path:_,exists:U}=X8($);if(U)return{path:_,created:!1};return await fG(V4.dirname(_),{recursive:!0}),await Bun.write(_,pD),{path:_,created:!0}}async function mJ($){let{path:_,exists:U}=X8($);if(!U)return null;let v=await Bun.file(_).text();return{config:x$(v,[],{allowTrailingComma:!0}),content:v,path:_}}async function iD($,_){await Bun.write($,_)}function nD($,_){let Q=x$($,[],{allowTrailingComma:!0});for(let v of _){if(Q===null||Q===void 0)return;if(typeof Q!=="object")return;Q=Q[v]}return Q}function gG($,_,U){if(U===null||U===void 0)return $;if(q4(U)){let v=nD($,_);if(v!==void 0&&(v===null||typeof v!=="object")){let Y=y1($,_,U,CJ);return C1($,Y)}let J=$;for(let[Y,z]of Object.entries(U))J=gG(J,[..._,Y],z);return J}if(Array.isArray(U)){let v=y1($,_,U,CJ);return C1($,v)}let Q=y1($,_,U,CJ);return C1($,Q)}async function gJ($,_){let U=await mJ($),Q,v,J=!1;if(U)Q=U.content,v=U.path;else{Q=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let X=V4.resolve($);v=SJ(X)!=="local-project"?V4.join(X,"opencode.jsonc"):V4.join(X,fJ,"opencode.jsonc"),await fG(V4.dirname(v),{recursive:!0}),J=!0}let Y=Q;Q=gG(Q,[],_);let z=Q!==Y;if(z)await iD(v,Q);return{path:v,created:J,changed:z}}var fJ=".opencode",CJ,pD=`{
117
+ `;var t0=A(()=>{D0();b9();t();j3();W0();D3();RJ={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function SJ(Q,$,Y){let q=(J)=>Q(J,...$);return Y===void 0?q:Object.assign(q,{lazy:Y,lazyArgs:$})}var EJ=()=>{};function kJ(Q,$,Y){let q=Q.length-$.length;if(q===0)return Q(...$);if(q===1)return SJ(Q,$,Y);throw Error("Wrong number of arguments")}var vJ=A(()=>{EJ()});function p4(Q){if(typeof Q!="object"||!Q)return!1;let $=Object.getPrototypeOf(Q);return $===null||$===Object.prototype}var PJ=()=>{};function l4(...Q){return kJ(xJ,Q)}function xJ(Q,$){let Y={...Q,...$};for(let q in $){if(!(q in Q))continue;let{[q]:J}=Q;if(!p4(J))continue;let{[q]:X}=$;p4(X)&&(Y[q]=xJ(J,X))}return Y}var CJ=A(()=>{vJ();PJ()});var yJ=A(()=>{CJ()});function w2(Q){let $=Q.startsWith("npm:"),Y=$?Q.slice(4):Q;if(!Y)return Q;if(Y.startsWith("@")){let X=Y.indexOf("/");if(X===-1)return Q;let G=Y.slice(X+1).indexOf("@");if(G===-1)return Q;let K=Y.slice(0,X+1+G);return $?`npm:${K}`:K}let q=Y.indexOf("@");if(q===-1)return Q;let J=Y.slice(0,q);return $?`npm:${J}`:J}function i4(Q){let $=new Map;for(let q=Q.length-1;q>=0;q--){let J=Q[q],X=w2(J);if(!$.has(X))$.set(X,q)}let Y=[];for(let[q,J]of Q.entries()){let X=w2(J);if($.get(X)===q)Y.push(J)}return Y}function O3(Q,$){let Y=l4(Q,$);if(Array.isArray(Q.plugin)&&Array.isArray($.plugin))Y.plugin=i4([...Q.plugin,...$.plugin]);else if(Array.isArray(Q.plugin))Y.plugin=Q.plugin;else if(Array.isArray($.plugin))Y.plugin=$.plugin;if(Array.isArray(Q.instructions)&&Array.isArray($.instructions))Y.instructions=Array.from(new Set([...Q.instructions,...$.instructions]));else if(Array.isArray(Q.instructions))Y.instructions=Q.instructions;else if(Array.isArray($.instructions))Y.instructions=$.instructions;return Y}var I3=A(()=>{yJ()});import{existsSync as f_,readFileSync as u_}from"fs";import{dirname as m_,isAbsolute as TO,resolve as n4}from"path";function g_(Q){let $=n4(Q);while(!0){let Y=n4($,".git");if(f_(Y))try{let J=z9("fs").statSync(Y);if(J.isDirectory())return $;if(J.isFile()){if(u_(Y,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return $}}catch{}let q=m_($);if(q===$)return null;$=q}}function o4(Q){let $=n4(Q);return g_($)??$}var hJ=()=>{};import{existsSync as c_}from"fs";import*as o8 from"path";var{Glob:d_}=globalThis.Bun;function fJ(Q){return Q.startsWith("http://")||Q.startsWith("https://")}function p_(Q,$){if(fJ(Q))return;if(o8.isAbsolute(Q)||o8.win32.isAbsolute(Q))throw new L(`Absolute path not allowed in registry instructions: "${Q}" (from ${$})`);if(Q.startsWith("~"))throw new L(`Home directory path not allowed in registry instructions: "${Q}" (from ${$})`);if(Q.split(/[/\\]/).some((q)=>q===".."))throw new L(`Path traversal (..) not allowed in registry instructions: "${Q}" (from ${$})`)}function l_(Q,$,Y){if(fJ(Q))return[Q];if(p_(Q,Y),Q.includes("*")||Q.includes("?")||Q.includes("[")){let X=new d_(Q),H=[];for(let G of X.scanSync($)){let K=o8.join($,G);H.push(K)}return H}let J=o8.join($,Q);if(!c_(J))throw new L(`Registry instruction file not found: "${Q}" (from ${Y})
118
+ Expected at: ${J}`);return[J]}function uJ(Q,$,Y){let q=[],J=new Set;for(let X of Q){let H=l_(X,$,Y);for(let G of H)if(!J.has(G))J.add(G),q.push(G)}return q}var mJ=A(()=>{t()});import{existsSync as s8,readFileSync as cJ,statSync as i_}from"fs";import{homedir as n_}from"os";import{join as R0,relative as dJ}from"path";var{Glob:N3}=globalThis.Bun;function o_(Q){return Q==="local-config"||Q==="cli"||Q==="env"}function s4(Q,$){if(Q.trim().length===0)throw new h(`Invalid profile from ${$}: value cannot be empty or whitespace`);return Q}function pJ(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function gJ(Q){let $;try{$=cJ(Q,"utf8")}catch(X){let H=X instanceof Error?X.message:"Unknown read error";throw new h(`Failed to read local config at ${Q}: ${H}`)}let Y=[],q=O1($,Y,{allowTrailingComma:!0});if(Y.length>0){let X=pJ(Y);throw new h(`Invalid JSONC in local config at ${Q}: ${X}`)}let J=b8.safeParse(q);if(!J.success){let X=J.error.issues[0],H=X?.path.length?X.path.join("."):"root",G=X?.message??"Invalid OCX config";throw new h(`Invalid local config at ${Q}: ${H} ${G}`)}return J.data}function s_(Q){let $;try{$=cJ(Q,"utf8")}catch(J){let X=J instanceof Error?J.message:"Unknown read error";throw new h(`Failed to read local OpenCode config at ${Q}: ${X}`)}let Y=[],q=O1($,Y,{allowTrailingComma:!0});if(Y.length>0){let J=pJ(Y);throw new h(`Invalid JSONC in local OpenCode config at ${Q}: ${J}`)}if(!q||typeof q!=="object"||Array.isArray(q))throw new h(`Invalid local OpenCode config at ${Q}: root must be an object`);return q}function a_(Q,$,Y){let q=[],J=$;while(!0){let X=R0(J,Q);if(s8(X)&&i_(X).isFile()){let G=dJ(Y,X);q.push(G)}if(J===Y)break;let H=R0(J,"..");if(H===J)break;J=H}return q}function t_(Q,$){for(let Y of r_){let q=a_(Y,Q,$);if(q.length>0)return q}return[]}function T3(Q){return Q.startsWith("./")?Q.slice(2):Q}function e_(Q,$,Y){return Q.filter((q)=>{for(let J of Y)if(new N3(T3(J)).match(q))return!0;for(let J of $)if(new N3(T3(J)).match(q))return!1;return!0})}async function QZ(Q){let $=await A0(Q);if(!$||Object.keys($.installed).length===0)return[];let Y=[];for(let[q,J]of Object.entries($.installed)){if(!J.opencode?.instructions)continue;let X=J.opencode.instructions;if(!Array.isArray(X))continue;let H=`${J.registryName}/${J.name} (${q})`,G=uJ(X,Q,H);Y.push(...G)}return Array.from(new Set(Y))}class e0{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor(Q,$,Y,q,J){this.cwd=Q,this.profileName=$,this.profile=Y,this.localConfigDir=q,this.registryInstructions=J}static async create(Q,$){let Y=f1.create(Q),q=null,J="none",X=M8(Q);if(X){let z=R0(X,c0);if(s8(z)){let B=gJ(z);if(B.profile!==void 0)q=s4(B.profile,`local config at ${z}`),J="local-config"}}if(q===null){if($?.profile!==void 0)q=s4($.profile,"CLI option --profile"),J="cli";else if(process.env.OCX_PROFILE!==void 0)q=s4(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),J="env"}let H=await Y.isInitialized();if(o_(J)&&!H)throw new D9;let G=null;if(H)if(q!==null)G=await Y.getLayered(q,Q);else try{q=await Y.resolveProfile(),G=await Y.getLayered(q,Q),J="default"}catch(z){if(!(z instanceof C1)||z.profile!=="default")throw z;q=null,G=null,J="none"}let K;if(G)K=h1(q);else if(X)K=R0(X,"..");else K=L0();let W=await QZ(K);return new e0(Q,q,G,X,W)}resolve(){if(this.cachedConfig)return this.cachedConfig;let Q={},$=i8,Y={};if(this.profile){if(Q={...Q,...this.profile.ocx.registries},this.profile.ocx.componentPath)$=this.profile.ocx.componentPath;if(this.profile.opencode)Y=this.mergeOpencode(Y,this.profile.opencode)}let q=this.shouldLoadLocalConfig();if(!this.profile&&q&&this.localConfigDir){let X=this.loadLocalOcxConfig();if(X)Q=X.registries}if(this.localConfigDir){let X=this.loadLocalOpencodeConfig();if(X)Y=this.mergeOpencode(Y,X)}let J=this.discoverInstructions();return this.cachedConfig={registries:Q,componentPath:$,opencode:Y,instructions:J,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let Q=new Map,$={},Y=i8,q={};if(Q.set("componentPath",{path:"",source:"default"}),this.profile){let H=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[G,K]of Object.entries(this.profile.ocx.registries))$[G]=K,Q.set(`registries.${G}`,{path:H,source:"global-profile"});if(this.profile.ocx.componentPath)Y=this.profile.ocx.componentPath,Q.set("componentPath",{path:H,source:"global-profile"});if(this.profile.opencode){q=this.mergeOpencode(q,this.profile.opencode);let G=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let K of Object.keys(this.profile.opencode))Q.set(`opencode.${K}`,{path:G,source:"global-profile"})}}let J=this.shouldLoadLocalConfig();if(!this.profile&&J&&this.localConfigDir){let H=this.loadLocalOcxConfig();if(H){let G=R0(this.localConfigDir,c0);for(let[K,W]of Object.entries(H.registries))$[K]=W,Q.set(`registries.${K}`,{path:G,source:"local-config"})}}if(this.localConfigDir){let H=this.loadLocalOpencodeConfig();if(H){q=this.mergeOpencode(q,H);let G=R0(this.localConfigDir,j2);for(let K of Object.keys(H))Q.set(`opencode.${K}`,{path:G,source:"local-opencode"})}}let X=this.discoverInstructions();return{registries:$,componentPath:Y,opencode:q,instructions:X,profileName:this.profileName,origins:Q}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let $=o4(this.cwd),Y=dJ($,this.localConfigDir),q=this.profile.ocx.exclude??[],J=this.profile.ocx.include??[];for(let X of J){let H=new N3(T3(X));if(H.match(`${Y}/`)||H.match(Y))return!0}for(let X of q){let H=new N3(T3(X));if(H.match(`${Y}/`)||H.match(`${Y}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let Q=R0(this.localConfigDir,c0);if(!s8(Q))return null;return{registries:gJ(Q).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let Q=R0(this.localConfigDir,j2);if(!s8(Q))return null;return s_(Q)}discoverInstructions(){let Q=[],$=L0(),Y=R0($,"AGENTS.md");if(s8(Y))Q.push(Y);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let z=R0(n_(),".claude","CLAUDE.md");if(s8(z))Q.push(z)}if(this.profile&&this.profileName){let z=R0(h1(this.profileName),"AGENTS.md");if(s8(z))Q.push(z)}let q=this.loadRegistryInstructions();Q.push(...q);let J=o4(this.cwd),X=t_(this.cwd,J),H=this.profile?.ocx.exclude??[],G=this.profile?.ocx.include??[],W=e_(X,H,G).map((z)=>R0(J,z));return Q.push(...W),Q}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode(Q,$){return O3(Q,$)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var r_;var D2=A(()=>{D0();t0();W0();I3();q0();t();hJ();mJ();k8();r_=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function J0(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)&&Object.getPrototypeOf(Q)===Object.prototype}var aJ={};Y8(aJ,{fetchRegistryIndex:()=>P8,fetchFileContent:()=>r8,fetchComponentVersion:()=>E3,fetchComponent:()=>I2,classifyRegistryIndexIssue:()=>rJ,_clearFetcherCacheForTests:()=>zZ});import{posix as $Z}from"path";function JZ(Q,$){return new f0(`Registry at ${Q} uses an incompatible format (${$.issue}). ${$.remediation}`,{url:Q,issue:$.issue,remediation:$.remediation,...$.schemaUrl!==void 0&&{schemaUrl:$.schemaUrl},...$.supportedMajor!==void 0&&{supportedMajor:$.supportedMajor},...$.detectedMajor!==void 0&&{detectedMajor:$.detectedMajor}})}function iJ(Q,$){if(typeof Q!=="string")throw new L(`Invalid ${$}: expected string, got ${typeof Q}`);let Y=S3[Q]??Q,q=O9.safeParse(Y);if(!q.success)throw new L(`Unsupported component type "${Q}" in ${$}. Expected one of: ${O9.options.join(", ")}`);return q.data}function nJ(Q){return typeof Q==="string"&&Object.hasOwn(S3,Q)}function R3(Q){return Q.startsWith(".opencode/")||Q.startsWith(".opencode\\")}function oJ(Q){if(!J0(Q)||!Array.isArray(Q.files))return[];let $=[];for(let[Y,q]of Q.files.entries()){if(typeof q==="string"){if(!R3(q))continue;$.push({path:`files[${Y}]`,target:q});continue}if(!J0(q)||typeof q.target!=="string")continue;if(!R3(q.target))continue;$.push({path:`files[${Y}].target`,target:q.target})}return $}function XZ(Q){if(!J0(Q))return[];let $=Q.components;if(!Array.isArray($))return[];let Y=[];for(let[q,J]of $.entries()){if(!J0(J))continue;let X=J.type;if(!nJ(X))continue;Y.push({path:`components[${q}].type`,type:X})}return Y}function HZ(Q){if(!J0(Q))return!1;if(typeof Q.type==="string"&&Q.type.startsWith("ocx:"))return!0;return oJ(Q).length>0}async function GZ(Q){let $=g1(Q),Y=O2.get($);if(Y)return Y;try{await P8($)}catch(J){if(J instanceof I1||J instanceof B1)return null;throw J}if(!O2.has($))return null;let q=O2.get($);if(!q)throw Error(`Missing registry schema mode cache entry for ${$}`);return q}function lJ(Q,$){if(Q.includes("\x00"))throw new L(`Unsafe target "${Q}" in ${$}: null bytes are not allowed`);if(Q.includes("%"))throw new L(`Unsafe target "${Q}" in ${$}: encoded paths are not allowed`);if(Q.includes("\\"))throw new L(`Unsafe target "${Q}" in ${$}: Windows separators are not allowed`);if(Q.startsWith("/")||Q.startsWith("//")||/^[a-zA-Z]:/.test(Q))throw new L(`Unsafe target "${Q}" in ${$}: absolute paths are not allowed`);let Y=Q.startsWith(".opencode/")?Q.slice(10):Q;if(!Y)throw new L(`Unsafe target "${Q}" in ${$}: missing path after .opencode/`);let q=Y.split("/");if(q.some((W)=>W.length===0))throw new L(`Unsafe target "${Q}" in ${$}: empty path segments are not allowed`);if(q.some((W)=>W==="."||W===".."))throw new L(`Unsafe target "${Q}" in ${$}: traversal segments are not allowed`);let[J,...X]=q;if(!J)throw new L(`Unsafe target "${Q}" in ${$}: missing path root segment`);let G=[YZ[J]??J,...X].join("/"),K=$Z.normalize(G);if(K!==G)throw new L(`Unsafe target "${Q}" in ${$}: path normalization is ambiguous`);if(K==="."||K===".."||K.startsWith("../"))throw new L(`Unsafe target "${Q}" in ${$}: target escapes project root`);return K}function KZ(Q,$){if(!J0(Q))return Q;let Y={...Q};if(Object.hasOwn(Y,"type"))Y.type=iJ(Y.type,`${$}.type`);if(Array.isArray(Y.files))Y.files=Y.files.map((q,J)=>{if(typeof q==="string"){if(!R3(q))return q;return lJ(q,`${$}.files[${J}]`)}if(!J0(q))return q;let X=q.target;if(typeof X!=="string")return q;if(!R3(X))return q;return{...q,target:lJ(X,`${$}.files[${J}].target`)}});return Y}function WZ(Q,$){if(!J0(Q))throw new f0(`Registry at ${$} uses legacy schema v1 but does not expose an object index payload.`,{url:$,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let Y=Q.components;if(!Array.isArray(Y))throw new f0(`Registry at ${$} uses legacy schema v1 but the components field is missing or invalid.`,{url:$,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let q=Y.map((J,X)=>{if(!J0(J))throw new L(`Invalid index component at components[${X}]: expected object, got ${typeof J}`);let{name:H,description:G}=J;if(typeof H!=="string")throw new L(`Invalid index component name at components[${X}].name`);if(typeof G!=="string")throw new L(`Invalid index component description at components[${X}].description`);return{name:H,type:iJ(J.type,`components[${X}].type`),description:G}});return{...Q,components:q}}async function sJ(Q,$,Y={}){let q=b3.get(Q);if(q)return q;let J=Y.requestUrl??Q,X=(async()=>{let H={url:J,phase:Y.phase},G;try{G=await fetch(J)}catch(W){throw new I1(`Network request failed for ${J}: ${W instanceof Error?W.message:String(W)}`,H)}if(!G.ok){if(G.status===404)throw new B1(`Not found: ${J}`);throw new I1(`Failed to fetch ${J}: ${G.status} ${G.statusText}`,{...H,status:G.status,statusText:G.statusText})}let K;try{K=await G.json()}catch(W){throw new I1(`Invalid JSON response from ${J}: ${W instanceof Error?W.message:String(W)}`,H)}return await $(K)})();return b3.set(Q,X),X.catch(()=>b3.delete(Q)),X}function rJ(Q){let $=I9(Q);if(!$)return null;return{issue:$.issue,remediation:$.remediation,schemaUrl:$.schemaUrl,supportedMajor:$.supportedMajor,detectedMajor:$.detectedMajor}}async function P8(Q){let $=g1(Q),Y=`${$}/index.json`;return sJ(Y,(q)=>{let J=rJ(q);if(J&&J.issue!=="legacy-schema-v1")throw JZ(Y,J);let X=q,H="v2";if(J?.issue==="legacy-schema-v1"){H="legacy-v1";try{X=WZ(q,Y)}catch(K){if(K instanceof f0)throw K;let W=K instanceof Error?K.message:String(K);throw new f0(`Registry at ${Y} uses legacy schema v1 but cannot be adapted safely. ${W}`,{url:Y,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let K=XZ(X);if(K.length>0){let W=K[0];if(!W)throw Error("Unexpected missing legacy type issue");let z=S3[W.type];throw new f0(`Registry at ${Y} uses legacy component type "${W.type}" in ${W.path}. Use "${z}" for v2 registries.`,{url:Y,issue:"invalid-format",remediation:`Replace legacy type "${W.type}" with canonical "${z}" in v2 manifests.`})}}let G=T4.safeParse(X);if(!G.success)throw new f0(`Registry at ${Y} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${G.error.message}`,{url:Y,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${G.error.message}`});return O2.set($,H),G.data},{phase:"registry-index-fetch"})}async function I2(Q,$){return(await E3(Q,$)).manifest}async function E3(Q,$,Y){let q=`${g1(Q)}/components/${$}.json`;return sJ(`${q}#v=${Y??"latest"}`,async(J)=>{let X=qZ.safeParse(J);if(!X.success)throw new L(`Invalid packument format for "${$}": ${X.error.message}`);let H=X.data,G=Y??H["dist-tags"].latest,K=H.versions[G];if(!K){if(Y){let Z=Object.keys(H.versions).join(", ");throw new L(`Component "${$}" has no version "${Y}". Available: ${Z}`)}throw new L(`Component "${$}" has no manifest for latest version ${G}`)}let W=`component "${$}@${G}"`,z=K;if(HZ(K))if(await GZ(Q)!=="v2")z=KZ(K,W);else{let V=oJ(K)[0];if(V)throw new L(`Invalid component manifest for "${$}@${G}": target "${V.target}" at ${V.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(J0(K)&&nJ(K.type)){let U=S3[K.type];throw new L(`Invalid component manifest for "${$}@${G}": type "${K.type}" is a legacy v1 alias. Use "${U}" for v2 registries.`)}}let B=c8.safeParse(z);if(!B.success)throw new L(`Invalid component manifest for "${$}@${G}": ${B.error.message}`);return{manifest:B.data,version:G}},{phase:"packument-fetch",requestUrl:q})}async function r8(Q,$,Y){let q=`${g1(Q)}/components/${$}/${Y}`,J={url:q,phase:"file-content-fetch",qualifiedName:$},X;try{X=await fetch(q)}catch(H){throw new I1(`Network request failed for ${q}: ${H instanceof Error?H.message:String(H)}`,J)}if(!X.ok)throw new I1(`Failed to fetch file ${Y} for ${$} from ${q}: ${X.status} ${X.statusText}`,{...J,status:X.status,statusText:X.statusText});return X.text()}function zZ(){b3.clear(),O2.clear()}var b3,O2,S3,YZ,qZ;var a8=A(()=>{G8();g0();t();b3=new Map,O2=new Map,S3={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},YZ={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},qZ=M2.extend({versions:q1(F(),I8())})});function tJ(Q,$){if(Q.includes("/"))return m0(Q);if($)return{namespace:$,component:Q};throw new L(`Component '${Q}' must include a registry alias (e.g., 'kdco/${Q}')`)}async function eJ(Q,$){let Y=new Map,q=new Set,J=new Set,X=new Set,H={};async function G(z,B,Z=[]){let M=N4(z,B);if(Y.has(M))return;if(q.has(M)){let I=[...Z,M].join(" \u2192 ");throw new L(`Circular dependency detected: ${I}`)}q.add(M);let V=Q[z];if(!V)throw new B1(`Registry alias '${z}' not found. Add it with 'ocx registry add <url> --name ${z}'.`);let U;try{U=await I2(V.url,B)}catch(I){if(I instanceof I1)throw I;if(I instanceof B1)throw new B1(`Component '${B}' not found in registry '${z}'.`);if(I instanceof z1)throw I;throw new I1(`Failed to fetch component '${B}' from registry '${z}': ${I instanceof Error?I.message:String(I)}`,{url:V.url})}for(let I of U.dependencies){let g=tJ(I,z);await G(g.namespace,g.component,[...Z,M])}let R=d8(U);if(Y.set(M,{...R,registryName:z,baseUrl:V.url,qualifiedName:M}),q.delete(M),U.npmDependencies)for(let I of U.npmDependencies)J.add(I);if(U.npmDevDependencies)for(let I of U.npmDevDependencies)X.add(I);if(R.opencode)H=O3(H,R.opencode)}for(let z of $){let B=tJ(z);await G(B.namespace,B.component)}let K=Array.from(Y.values()),W=Array.from(Y.keys());return{components:K,installOrder:W,npmDependencies:Array.from(J),npmDevDependencies:Array.from(X),opencode:H}}var QX=A(()=>{g0();t();a8();I3()});import{statSync as BZ}from"fs";import{mkdir as $X}from"fs/promises";import z0 from"path";function P9(Q){try{return BZ(Q).isFile()}catch{return!1}}function k3(Q){let $=z0.resolve(Q);if(c4($)!=="local-project"){let K=z0.join($,"opencode.jsonc"),W=z0.join($,"opencode.json");if(P9(K))return{path:K,exists:!0};if(P9(W))return{path:W,exists:!0};return{path:K,exists:!1}}let J=z0.join($,a4,"opencode.jsonc"),X=z0.join($,a4,"opencode.json");if(P9(J))return{path:J,exists:!0};if(P9(X))return{path:X,exists:!0};let H=z0.join($,"opencode.jsonc"),G=z0.join($,"opencode.json");if(P9(H))return{path:H,exists:!0};if(P9(G))return{path:G,exists:!0};return{path:J,exists:!1}}async function YX(Q){let{path:$,exists:Y}=k3(Q);if(Y)return{path:$,created:!1};return await $X(z0.dirname($),{recursive:!0}),await Bun.write($,_Z),{path:$,created:!0}}async function t4(Q){let{path:$,exists:Y}=k3(Q);if(!Y)return null;let J=await Bun.file($).text();return{config:O1(J,[],{allowTrailingComma:!0}),content:J,path:$}}async function ZZ(Q,$){await Bun.write(Q,$)}function MZ(Q,$){let q=O1(Q,[],{allowTrailingComma:!0});for(let J of $){if(q===null||q===void 0)return;if(typeof q!=="object")return;q=q[J]}return q}function qX(Q,$,Y){if(Y===null||Y===void 0)return Q;if(J0(Y)){let J=MZ(Q,$);if(J!==void 0&&(J===null||typeof J!=="object")){let H=Z9(Q,$,Y,r4);return M9(Q,H)}let X=Q;for(let[H,G]of Object.entries(Y))X=qX(X,[...$,H],G);return X}if(Array.isArray(Y)){let J=Z9(Q,$,Y,r4);return M9(Q,J)}let q=Z9(Q,$,Y,r4);return M9(Q,q)}async function e4(Q,$){let Y=await t4(Q),q,J,X=!1;if(Y)q=Y.content,J=Y.path;else{q=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let W=z0.resolve(Q);J=c4(W)!=="local-project"?z0.join(W,"opencode.jsonc"):z0.join(W,a4,"opencode.jsonc"),await $X(z0.dirname(J),{recursive:!0}),X=!0}let H=q;q=qX(q,[],$);let G=q!==H;if(G)await ZZ(J,q);return{path:J,created:X,changed:G}}var a4=".opencode",r4,_Z=`{
120
119
  "$schema": "https://opencode.ai/config.json"
121
120
  // Add MCP servers, tools, plugins here
122
121
  }
123
- `;var hJ=b(()=>{c4();Z4();CJ={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
124
- `}}});function hG($){return $.replace(/\r\n/g,`
125
- `).trim()}function cJ($,_){return hG($)===hG(_)}import{existsSync as rD,lstatSync as oD}from"fs";import{rm as tD,unlink as aD}from"fs/promises";import{join as dG}from"path";function pG($,_){let U=[];for(let[Q,v]of Object.entries(_)){let J=$[Q]??null;if(J!==v)U.push({name:Q,from:J,to:v})}return{changed:U.length>0,entries:U}}function iG($,_){let U=dG($,"node_modules"),Q=_.map((v)=>v.name).join(", ");return{action:"delete",target:U,details:{reason:`dependency declarations changed (${Q}); invalidating to force reinstall`,path:U}}}function lG($){if($&&typeof $==="object"&&"code"in $)return String($.code);return"UNKNOWN"}function lJ($){if($ instanceof Error)return $.message;return String($)}function $M($){return new Promise((_)=>setTimeout(_,$))}async function nG($,_){let U=dG($,"node_modules"),Q=_?.rmImpl??((v,J)=>tD(v,J));if(!rD(U))return{success:!0,action:"none"};try{if(oD(U).isSymbolicLink())return await aD(U),{success:!0,action:"unlinked"}}catch(v){let J=lG(v);if(J==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:J,message:lJ(v)}}}for(let v=0;v<=cG;v++)try{return await Q(U,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(J){let Y=lG(J);if(Y==="ENOENT")return{success:!0,action:"none"};if(!sD.has(Y))return{success:!1,action:"failed",error:{code:Y,message:lJ(J)}};if(v<cG)await $M(eD*2**v);else return{success:!1,action:"failed",error:{code:Y,message:lJ(J)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var sD,cG=3,eD=100;var rG=b(()=>{sD=new Set(["EBUSY","ENOTEMPTY"])});function oG($,_){let U=0,Q,v="",J="";for(;U<$.length;U++)if(Q=$[U],v+=Q.open,J+=Q.close,~_.indexOf(Q.close))_=_.replace(Q.rgx,Q.close+Q.open);return v+_+J}function _M($,_){let U={has:$,keys:_};return U.reset=k$.reset.bind(U),U.bold=k$.bold.bind(U),U.dim=k$.dim.bind(U),U.italic=k$.italic.bind(U),U.underline=k$.underline.bind(U),U.inverse=k$.inverse.bind(U),U.hidden=k$.hidden.bind(U),U.strikethrough=k$.strikethrough.bind(U),U.black=k$.black.bind(U),U.red=k$.red.bind(U),U.green=k$.green.bind(U),U.yellow=k$.yellow.bind(U),U.blue=k$.blue.bind(U),U.magenta=k$.magenta.bind(U),U.cyan=k$.cyan.bind(U),U.white=k$.white.bind(U),U.gray=k$.gray.bind(U),U.grey=k$.grey.bind(U),U.bgBlack=k$.bgBlack.bind(U),U.bgRed=k$.bgRed.bind(U),U.bgGreen=k$.bgGreen.bind(U),U.bgYellow=k$.bgYellow.bind(U),U.bgBlue=k$.bgBlue.bind(U),U.bgMagenta=k$.bgMagenta.bind(U),U.bgCyan=k$.bgCyan.bind(U),U.bgWhite=k$.bgWhite.bind(U),U}function P$($,_){let U={open:`\x1B[${$}m`,close:`\x1B[${_}m`,rgx:new RegExp(`\\x1b\\[${_}m`,"g")};return function(Q){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf($)||(this.has.push($),this.keys.push(U)),Q===void 0?this:k$.enabled?oG(this.keys,Q+""):Q+"";return Q===void 0?_M([$],[U]):k$.enabled?oG([U],Q+""):Q+""}}var dJ,tG,aG,sG,eG=!0,k$,g;var k6=b(()=>{if(typeof process<"u")({FORCE_COLOR:dJ,NODE_DISABLE_COLORS:tG,NO_COLOR:aG,TERM:sG}=process.env||{}),eG=process.stdout&&process.stdout.isTTY;k$={enabled:!tG&&aG==null&&sG!=="dumb"&&(dJ!=null&&dJ!=="0"||eG),reset:P$(0,0),bold:P$(1,22),dim:P$(2,22),italic:P$(3,23),underline:P$(4,24),inverse:P$(7,27),hidden:P$(8,28),strikethrough:P$(9,29),black:P$(30,39),red:P$(31,39),green:P$(32,39),yellow:P$(33,39),blue:P$(34,39),magenta:P$(35,39),cyan:P$(36,39),white:P$(37,39),gray:P$(90,39),grey:P$(90,39),bgBlack:P$(40,49),bgRed:P$(41,49),bgGreen:P$(42,49),bgYellow:P$(43,49),bgBlue:P$(44,49),bgMagenta:P$(45,49),bgCyan:P$(46,49),bgWhite:P$(47,49)};g=k$});function _j($,_){if($==null||$==="")return _;let U=$.trim().toLowerCase();if(U==="true"||U==="1"||U==="yes"||U==="on")return!0;if(U==="false"||U==="0"||U==="no"||U==="off")return!1;return _}var vM,M1,$j;var l_=b(()=>{vM=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),M1=Boolean(process.stdout.isTTY&&!vM),$j=Boolean(M1&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var N0,W,N4;var i$=b(()=>{k6();l_();if(!$j)g.enabled=!1;N0={},W={info(...$){if(N0.quiet)return;console.log(g.blue("info"),...$)},success(...$){if(N0.quiet)return;console.log(g.green("\u2713"),...$)},warn(...$){if(N0.quiet)return;console.warn(g.yellow("warn"),...$)},error(...$){console.error(g.red("error"),...$)},debug(...$){if(!N0.verbose)return;console.log(g.gray("debug"),...$)},log(...$){if(N0.quiet)return;console.log(...$)},break(){if(N0.quiet)return;console.log("")}},N4={component:($)=>g.cyan($),path:($)=>g.green($),command:($)=>g.yellow($),url:($)=>g.blue().underline($),error:($)=>g.red($),dim:($)=>g.gray($),bold:($)=>g.bold($)}});function S4($,_={}){if(_.json){console.log(JSON.stringify($,null,2));return}if(_.quiet)return;if(W.info(N4.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),W.break(),$.wouldPerform.length===0)W.info("No actions would be performed.");else{let Q=UM($.wouldPerform);for(let[v,J]of Object.entries(Q)){let Y=QM(v);W.info(`Would ${Y} ${J.length} item(s):`);for(let z of J){let I=JM(z.details);W.info(` \u2022 ${N4.component(z.target)}${I}`)}W.break()}}if($.summary)W.info($.summary),W.break();if($.validation.errors&&$.validation.errors.length>0){W.error("Would fail with errors:");for(let Q of $.validation.errors)W.error(` \u2022 ${Q}`);W.break()}if($.validation.warnings&&$.validation.warnings.length>0){W.warn("Warnings:");for(let Q of $.validation.warnings)W.warn(` \u2022 ${Q}`);W.break()}if(_.hints&&_.hints.length>0){for(let Q of _.hints)W.info(N4.dim(Q));W.break()}W.info(N4.dim("Run without --dry-run to apply changes."))}function UM($){let _={};for(let U of $){if(!_[U.action])_[U.action]=[];_[U.action]?.push(U)}return _}function QM($){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[$]??$}function JM($){if(!$||Object.keys($).length===0)return"";let _=[];for(let[U,Q]of Object.entries($??{}))if(Q!==void 0&&Q!==null)_.push(`${U}: ${N4.dim(String(Q))}`);return _.length>0?` (${_.join(", ")})`:""}var w1=b(()=>{i$()});var vj={};s$(vj,{wrapAction:()=>YM,handleError:()=>_$});function _$($,_={}){if(_.json){let U=zM($);console.log(JSON.stringify(U,null,2)),process.exit(U.exitCode)}if($ instanceof b$)W.error($.message),process.exit($.exitCode);if($ instanceof H2){W.error("Validation failed:");for(let U of $.issues){let Q=U.path.join(".");W.error(` ${Q}: ${U.message}`)}process.exit(K$.CONFIG)}if($ instanceof Error){if(W.error($.message),process.env.DEBUG)console.error($.stack)}else W.error("An unknown error occurred");process.exit(K$.GENERAL)}function YM($){return async(..._)=>{try{await $(..._)}catch(U){_$(U)}}}function zM($){if($ instanceof W0)return{success:!1,error:{code:$.code,message:$.message,details:{conflictType:$.conflictType,registryName:$.registryName,existingUrl:$.existingUrl,newUrl:$.newUrl,...$.targetLabel&&{targetLabel:$.targetLabel},...$.existingName&&{existingName:$.existingName}}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof I1)return{success:!1,error:{code:$.code,message:$.message,details:{component:$.component,expected:$.expected,found:$.found}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof E$){let _={};if($.url)_.url=$.url;if($.status!==void 0)_.status=$.status;if($.statusText)_.statusText=$.statusText;if($.phase)_.phase=$.phase;if($.qualifiedName)_.qualifiedName=$.qualifiedName;if($.registryContext)_.registryContext=$.registryContext;if($.registryName)_.registryName=$.registryName;return{success:!1,error:{code:$.code,message:$.message,...Object.keys(_).length>0&&{details:_}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof m$)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof m6)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof n4)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile,reason:$.reason}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof z6)return{success:!1,error:{code:"BUILD_ERROR",message:$.message,details:{errors:$.errors}},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}};if($ instanceof i4){let _={url:$.url,issue:$.issue,remediation:$.remediation};if($.schemaUrl!==void 0)_.schemaUrl=$.schemaUrl;if($.supportedMajor!==void 0)_.supportedMajor=$.supportedMajor;if($.detectedMajor!==void 0)_.detectedMajor=$.detectedMajor;return{success:!1,error:{code:$.code,message:$.message,details:_},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof z1)return{success:!1,error:{code:$.code,message:$.message,details:$.details},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof b$)return{success:!1,error:{code:$.code,message:$.message},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof H2)return{success:!1,error:{code:"VALIDATION_ERROR",message:$.issues.map((_)=>`${_.path.join(".")}: ${_.message}`).join("; "),details:{issues:$.issues.map((_)=>({path:_.path.join("."),message:_.message,code:_.code}))}},exitCode:K$.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:$ instanceof Error?$.message:"An unknown error occurred"},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}}}var c$=b(()=>{B6();p2();z$();i$()});function O$($){console.log(JSON.stringify($,null,2))}function Qj($){if(!$)throw new M("npm package name cannot be empty");if($.length>Uj)throw new M(`npm package name exceeds maximum length of ${Uj} characters: \`${$}\``);if($.includes("..")||$.includes("/./")||$.startsWith("./"))throw new M(`Invalid npm package name - path traversal detected: \`${$}\``);if(!qM.test($))throw new M(`Invalid npm package name: \`${$}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function Jj($){if(!$?.trim())throw new M("npm specifier cannot be empty");let _=$.trim();if(!_.startsWith("npm:"))throw new M(`Invalid npm specifier: \`${$}\`. Must start with \`npm:\` prefix.`);let U=_.slice(4);if(!U)throw new M(`Invalid npm specifier: \`${$}\`. Package name is required.`);let Q=U.lastIndexOf("@"),v,J;if(Q>0){let Y=U.slice(0,Q),z=U.slice(Q+1);if(Y.includes("/")||!Y.startsWith("@"))v=Y,J=z||void 0;else throw new M(`Invalid npm specifier: \`${$}\`. Scoped packages must have format @scope/pkg.`)}else v=U;return Qj(v),{type:"npm",name:v,version:J}}function Yj($){return $.trim().startsWith("npm:")}async function pJ($,_){Qj($);let U=$.startsWith("@")?`@${encodeURIComponent($.slice(1))}`:encodeURIComponent($),Q=`${IM}/${U}`;try{let v=_??AbortSignal.timeout(XM),J=await fetch(Q,{signal:v,headers:{Accept:"application/json"}});if(J.status===404)throw new B$(`npm package \`${$}\` not found on registry`);if(!J.ok)throw new E$(`Failed to fetch npm package \`${$}\`: HTTP ${J.status} ${J.statusText}`);return await J.json()}catch(v){if(v instanceof B$||v instanceof E$)throw v;if(v instanceof Error&&(v.name==="AbortError"||v.name==="TimeoutError"))throw new E$(`Request to npm registry timed out for package \`${$}\``);let J=v instanceof Error?v.message:String(v);throw new E$(`Failed to fetch npm package \`${$}\`: ${J}`)}}function S0($,_){return _?`${$}@${_}`:$}function zj($){let _=[];if($.type!=="module")throw new M(`Package \`${$.name}\` is not an ESM module (missing "type": "module" in package.json)`);let U=Boolean($.main),Q=$.exports!==void 0;if(!U&&!Q)throw new M(`Package \`${$.name}\` has no entry point (missing "main" or "exports")`);if(!$.name.includes("opencode"))_.push(`Package name \`${$.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:_}}async function q8($,_,U){let Q=await pJ($,U),v=_??Q["dist-tags"].latest,J=Q.versions[v];if(!J)throw new B$(`Version \`${v}\` not found for npm package \`${$}\``);return J}function Ij($){let _=$.trim(),U=_.lastIndexOf("@");if(U<=0)return _;let Q=_.slice(0,U);if(Q.includes("/")||!Q.startsWith("@"))return Q;return _}var IM="https://registry.npmjs.org",XM=30000,qM,Uj=214;var iJ=b(()=>{z$();qM=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function L1($,_){let U=$.get(_.absolutePath);if(!U){$.set(_.absolutePath,_);return}let Q=U.content.equals(_.content)?"identical content":"different content";throw new t$(`Intra-batch target collision at "${_.relativePath}". Both "${U.source}" and "${_.source}" resolve to this path with ${Q}. Rename one manifest target so each component writes to a unique path.`)}var G8=b(()=>{z$()});import{createHash as GM}from"crypto";import{existsSync as jM}from"fs";import{join as KM}from"path";function k1($){return GM("sha256").update($).digest("hex")}async function j8($){let _=[...$].sort((Q,v)=>Q.path.localeCompare(v.path)),U=[];for(let Q of _){let v=k1(Q.content);U.push(`${Q.path}:${v}`)}return k1(U.join(`
126
- `))}async function d_($,_){let U=[],Q=[],v=[];for(let J of _.files){let Y=KM($,J.path);if(!jM(Y)){Q.push(J.path),v.push({path:J.path,status:"missing"});continue}let z=await Bun.file(Y).text();if(k1(z)!==J.hash)U.push(J.path),v.push({path:J.path,status:"modified"});else v.push({path:J.path,status:"intact"})}return{intact:U.length===0&&Q.length===0,modified:U,missing:Q,details:v}}var T0=b(()=>{X4()});function Q4($){return $.addOption(f4.cwd()).addOption(f4.quiet()).addOption(f4.json())}function m4($){return $.addOption(f4.verbose())}function G6($){return $.addOption(f4.global)}function K8($){return $.addOption(f4.profile())}function Xj($){if(!$||$.length===0)throw new n4($,"cannot be empty");if($.length>32)throw new n4($,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test($))throw new n4($,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var f4;var a4=b(()=>{a2();z$();f4={cwd:()=>new M6("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new M6("-q, --quiet","Suppress output"),json:()=>new M6("--json","Output as JSON"),profile:()=>new M6("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new M6("-v, --verbose","Verbose output"),global:new M6("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function bM(){let $=new Map;for(let[_,U]of Object.entries(u$)){for(let[Q,v]of Object.entries(U))u$[Q]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},U[Q]=u$[Q],$.set(v[0],v[1]);Object.defineProperty(u$,_,{value:U,enumerable:!1})}return Object.defineProperty(u$,"codes",{value:$,enumerable:!1}),u$.color.close="\x1B[39m",u$.bgColor.close="\x1B[49m",u$.color.ansi=qj(),u$.color.ansi256=Gj(),u$.color.ansi16m=jj(),u$.bgColor.ansi=qj(10),u$.bgColor.ansi256=Gj(10),u$.bgColor.ansi16m=jj(10),Object.defineProperties(u$,{rgbToAnsi256:{value(_,U,Q){if(_===U&&U===Q){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(U/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(_){let U=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!U)return[0,0,0];let[Q]=U;if(Q.length===3)Q=[...Q].map((J)=>J+J).join("");let v=Number.parseInt(Q,16);return[v>>16&255,v>>8&255,v&255]},enumerable:!1},hexToAnsi256:{value:(_)=>u$.rgbToAnsi256(...u$.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let U,Q,v;if(_>=232)U=((_-232)*10+8)/255,Q=U,v=U;else{_-=16;let z=_%36;U=Math.floor(_/36)/5,Q=Math.floor(z/6)/5,v=z%6/5}let J=Math.max(U,Q,v)*2;if(J===0)return 30;let Y=30+(Math.round(v)<<2|Math.round(Q)<<1|Math.round(U));if(J===2)Y+=60;return Y},enumerable:!1},rgbToAnsi:{value:(_,U,Q)=>u$.ansi256ToAnsi(u$.rgbToAnsi256(_,U,Q)),enumerable:!1},hexToAnsi:{value:(_)=>u$.ansi256ToAnsi(u$.hexToAnsi256(_)),enumerable:!1}}),u$}var qj=($=0)=>(_)=>`\x1B[${_+$}m`,Gj=($=0)=>(_)=>`\x1B[${38+$};5;${_}m`,jj=($=0)=>(_,U,Q)=>`\x1B[${38+$};2;${_};${U};${Q}m`,u$,yE,HM,WM,CE,BM,s4;var Kj=b(()=>{u$={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]}},yE=Object.keys(u$.modifier),HM=Object.keys(u$.color),WM=Object.keys(u$.bgColor),CE=[...HM,...WM];BM=bM(),s4=BM});import nJ from"process";import ZM from"os";import Hj from"tty";function g4($,_=globalThis.Deno?globalThis.Deno.args:nJ.argv){let U=$.startsWith("-")?"":$.length===1?"-":"--",Q=_.indexOf(U+$),v=_.indexOf("--");return Q!==-1&&(v===-1||Q<v)}function VM(){if("FORCE_COLOR"in y$){if(y$.FORCE_COLOR==="true")return 1;if(y$.FORCE_COLOR==="false")return 0;return y$.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(y$.FORCE_COLOR,10),3)}}function DM($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function MM($,{streamIsTTY:_,sniffFlags:U=!0}={}){let Q=VM();if(Q!==void 0)H8=Q;let v=U?H8:Q;if(v===0)return 0;if(U){if(g4("color=16m")||g4("color=full")||g4("color=truecolor"))return 3;if(g4("color=256"))return 2}if("TF_BUILD"in y$&&"AGENT_NAME"in y$)return 1;if($&&!_&&v===void 0)return 0;let J=v||0;if(y$.TERM==="dumb")return J;if(nJ.platform==="win32"){let Y=ZM.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in y$){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Y)=>(Y in y$)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Y)=>(Y in y$))||y$.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in y$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(y$.TEAMCITY_VERSION)?1:0;if(y$.COLORTERM==="truecolor")return 3;if(y$.TERM==="xterm-kitty")return 3;if(y$.TERM==="xterm-ghostty")return 3;if(y$.TERM==="wezterm")return 3;if("TERM_PROGRAM"in y$){let Y=Number.parseInt((y$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(y$.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(y$.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(y$.TERM))return 1;if("COLORTERM"in y$)return 1;return J}function Wj($,_={}){let U=MM($,{streamIsTTY:$&&$.isTTY,..._});return DM(U)}var y$,H8,wM,bj;var Bj=b(()=>{({env:y$}=nJ);if(g4("no-color")||g4("no-colors")||g4("color=false")||g4("color=never"))H8=0;else if(g4("color")||g4("colors")||g4("color=true")||g4("color=always"))H8=1;wM={stdout:Wj({isTTY:Hj.isatty(1)}),stderr:Wj({isTTY:Hj.isatty(2)})},bj=wM});function Zj($,_,U){let Q=$.indexOf(_);if(Q===-1)return $;let v=_.length,J=0,Y="";do Y+=$.slice(J,Q)+_+U,J=Q+v,Q=$.indexOf(_,J);while(Q!==-1);return Y+=$.slice(J),Y}function Vj($,_,U,Q){let v=0,J="";do{let Y=$[Q-1]==="\r";J+=$.slice(v,Y?Q-1:Q)+_+(Y?`\r
122
+ `;var Q6=A(()=>{D0();W0();r4={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
123
+ `}}});function JX(Q){return Q.replace(/\r\n/g,`
124
+ `).trim()}function $6(Q,$){return JX(Q)===JX($)}import{existsSync as UZ,lstatSync as VZ}from"fs";import{rm as AZ,unlink as LZ}from"fs/promises";import{join as GX}from"path";function KX(Q,$){let Y=[];for(let[q,J]of Object.entries($)){let X=Q[q]??null;if(X!==J)Y.push({name:q,from:X,to:J})}return{changed:Y.length>0,entries:Y}}function WX(Q,$){let Y=GX(Q,"node_modules"),q=$.map((J)=>J.name).join(", ");return{action:"delete",target:Y,details:{reason:`dependency declarations changed (${q}); invalidating to force reinstall`,path:Y}}}function HX(Q){if(Q&&typeof Q==="object"&&"code"in Q)return String(Q.code);return"UNKNOWN"}function Y6(Q){if(Q instanceof Error)return Q.message;return String(Q)}function wZ(Q){return new Promise(($)=>setTimeout($,Q))}async function zX(Q,$){let Y=GX(Q,"node_modules"),q=$?.rmImpl??((J,X)=>AZ(J,X));if(!UZ(Y))return{success:!0,action:"none"};try{if(VZ(Y).isSymbolicLink())return await LZ(Y),{success:!0,action:"unlinked"}}catch(J){let X=HX(J);if(X==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:X,message:Y6(J)}}}for(let J=0;J<=XX;J++)try{return await q(Y,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(X){let H=HX(X);if(H==="ENOENT")return{success:!0,action:"none"};if(!FZ.has(H))return{success:!1,action:"failed",error:{code:H,message:Y6(X)}};if(J<XX)await wZ(jZ*2**J);else return{success:!1,action:"failed",error:{code:H,message:Y6(X)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var FZ,XX=3,jZ=100;var BX=A(()=>{FZ=new Set(["EBUSY","ENOTEMPTY"])});function _X(Q,$){let Y=0,q,J="",X="";for(;Y<Q.length;Y++)if(q=Q[Y],J+=q.open,X+=q.close,~$.indexOf(q.close))$=$.replace(q.rgx,q.close+q.open);return J+$+X}function DZ(Q,$){let Y={has:Q,keys:$};return Y.reset=L1.reset.bind(Y),Y.bold=L1.bold.bind(Y),Y.dim=L1.dim.bind(Y),Y.italic=L1.italic.bind(Y),Y.underline=L1.underline.bind(Y),Y.inverse=L1.inverse.bind(Y),Y.hidden=L1.hidden.bind(Y),Y.strikethrough=L1.strikethrough.bind(Y),Y.black=L1.black.bind(Y),Y.red=L1.red.bind(Y),Y.green=L1.green.bind(Y),Y.yellow=L1.yellow.bind(Y),Y.blue=L1.blue.bind(Y),Y.magenta=L1.magenta.bind(Y),Y.cyan=L1.cyan.bind(Y),Y.white=L1.white.bind(Y),Y.gray=L1.gray.bind(Y),Y.grey=L1.grey.bind(Y),Y.bgBlack=L1.bgBlack.bind(Y),Y.bgRed=L1.bgRed.bind(Y),Y.bgGreen=L1.bgGreen.bind(Y),Y.bgYellow=L1.bgYellow.bind(Y),Y.bgBlue=L1.bgBlue.bind(Y),Y.bgMagenta=L1.bgMagenta.bind(Y),Y.bgCyan=L1.bgCyan.bind(Y),Y.bgWhite=L1.bgWhite.bind(Y),Y}function N1(Q,$){let Y={open:`\x1B[${Q}m`,close:`\x1B[${$}m`,rgx:new RegExp(`\\x1b\\[${$}m`,"g")};return function(q){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf(Q)||(this.has.push(Q),this.keys.push(Y)),q===void 0?this:L1.enabled?_X(this.keys,q+""):q+"";return q===void 0?DZ([Q],[Y]):L1.enabled?_X([Y],q+""):q+""}}var q6,ZX,MX,UX,VX=!0,L1,P;var U8=A(()=>{if(typeof process<"u")({FORCE_COLOR:q6,NODE_DISABLE_COLORS:ZX,NO_COLOR:MX,TERM:UX}=process.env||{}),VX=process.stdout&&process.stdout.isTTY;L1={enabled:!ZX&&MX==null&&UX!=="dumb"&&(q6!=null&&q6!=="0"||VX),reset:N1(0,0),bold:N1(1,22),dim:N1(2,22),italic:N1(3,23),underline:N1(4,24),inverse:N1(7,27),hidden:N1(8,28),strikethrough:N1(9,29),black:N1(30,39),red:N1(31,39),green:N1(32,39),yellow:N1(33,39),blue:N1(34,39),magenta:N1(35,39),cyan:N1(36,39),white:N1(37,39),gray:N1(90,39),grey:N1(90,39),bgBlack:N1(40,49),bgRed:N1(41,49),bgGreen:N1(42,49),bgYellow:N1(43,49),bgBlue:N1(44,49),bgMagenta:N1(45,49),bgCyan:N1(46,49),bgWhite:N1(47,49)};P=L1});function LX(Q,$){if(Q==null||Q==="")return $;let Y=Q.trim().toLowerCase();if(Y==="true"||Y==="1"||Y==="yes"||Y==="on")return!0;if(Y==="false"||Y==="0"||Y==="no"||Y==="off")return!1;return $}var OZ,t8,AX;var N2=A(()=>{OZ=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),t8=Boolean(process.stdout.isTTY&&!OZ),AX=Boolean(t8&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var x9,_,F0;var c1=A(()=>{U8();N2();if(!AX)P.enabled=!1;x9={},_={info(...Q){if(x9.quiet)return;console.log(P.blue("info"),...Q)},success(...Q){if(x9.quiet)return;console.log(P.green("\u2713"),...Q)},warn(...Q){if(x9.quiet)return;console.warn(P.yellow("warn"),...Q)},error(...Q){console.error(P.red("error"),...Q)},debug(...Q){if(!x9.verbose)return;console.log(P.gray("debug"),...Q)},log(...Q){if(x9.quiet)return;console.log(...Q)},break(){if(x9.quiet)return;console.log("")}},F0={component:(Q)=>P.cyan(Q),path:(Q)=>P.green(Q),command:(Q)=>P.yellow(Q),url:(Q)=>P.blue().underline(Q),error:(Q)=>P.red(Q),dim:(Q)=>P.gray(Q),bold:(Q)=>P.bold(Q)}});function j0(Q,$={}){if($.json){console.log(JSON.stringify(Q,null,2));return}if($.quiet)return;if(_.info(F0.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),_.break(),Q.wouldPerform.length===0)_.info("No actions would be performed.");else{let q=IZ(Q.wouldPerform);for(let[J,X]of Object.entries(q)){let H=NZ(J);_.info(`Would ${H} ${X.length} item(s):`);for(let G of X){let K=TZ(G.details);_.info(` \u2022 ${F0.component(G.target)}${K}`)}_.break()}}if(Q.summary)_.info(Q.summary),_.break();if(Q.validation.errors&&Q.validation.errors.length>0){_.error("Would fail with errors:");for(let q of Q.validation.errors)_.error(` \u2022 ${q}`);_.break()}if(Q.validation.warnings&&Q.validation.warnings.length>0){_.warn("Warnings:");for(let q of Q.validation.warnings)_.warn(` \u2022 ${q}`);_.break()}if($.hints&&$.hints.length>0){for(let q of $.hints)_.info(F0.dim(q));_.break()}_.info(F0.dim("Run without --dry-run to apply changes."))}function IZ(Q){let $={};for(let Y of Q){if(!$[Y.action])$[Y.action]=[];$[Y.action]?.push(Y)}return $}function NZ(Q){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[Q]??Q}function TZ(Q){if(!Q||Object.keys(Q).length===0)return"";let $=[];for(let[Y,q]of Object.entries(Q??{}))if(q!==void 0&&q!==null)$.push(`${Y}: ${F0.dim(String(q))}`);return $.length>0?` (${$.join(", ")})`:""}var e8=A(()=>{c1()});var FX={};Y8(FX,{wrapAction:()=>bZ,handleError:()=>s});function s(Q,$={}){if($.json){let Y=RZ(Q);console.log(JSON.stringify(Y,null,2)),process.exit(Y.exitCode)}if(Q instanceof z1)_.error(Q.message),process.exit(Q.exitCode);if(Q instanceof U4){_.error("Validation failed:");for(let Y of Q.issues){let q=Y.path.join(".");_.error(` ${q}: ${Y.message}`)}process.exit(H1.CONFIG)}if(Q instanceof Error){if(_.error(Q.message),process.env.DEBUG)console.error(Q.stack)}else _.error("An unknown error occurred");process.exit(H1.GENERAL)}function bZ(Q){return async(...$)=>{try{await Q(...$)}catch(Y){s(Y)}}}function RZ(Q){if(Q instanceof w9)return{success:!1,error:{code:Q.code,message:Q.message,details:{conflictType:Q.conflictType,registryName:Q.registryName,existingUrl:Q.existingUrl,newUrl:Q.newUrl,...Q.targetLabel&&{targetLabel:Q.targetLabel},...Q.existingName&&{existingName:Q.existingName}}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof m8)return{success:!1,error:{code:Q.code,message:Q.message,details:{component:Q.component,expected:Q.expected,found:Q.found}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof I1){let $={};if(Q.url)$.url=Q.url;if(Q.status!==void 0)$.status=Q.status;if(Q.statusText)$.statusText=Q.statusText;if(Q.phase)$.phase=Q.phase;if(Q.qualifiedName)$.qualifiedName=Q.qualifiedName;if(Q.registryContext)$.registryContext=Q.registryContext;if(Q.registryName)$.registryName=Q.registryName;return{success:!1,error:{code:Q.code,message:Q.message,...Object.keys($).length>0&&{details:$}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}}}if(Q instanceof C1)return{success:!1,error:{code:Q.code,message:Q.message,details:{profile:Q.profile}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof N8)return{success:!1,error:{code:Q.code,message:Q.message,details:{profile:Q.profile}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof u0)return{success:!1,error:{code:Q.code,message:Q.message,details:{profile:Q.profile,reason:Q.reason}},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof r0)return{success:!1,error:{code:"BUILD_ERROR",message:Q.message,details:{errors:Q.errors}},exitCode:H1.GENERAL,meta:{timestamp:new Date().toISOString()}};if(Q instanceof f0){let $={url:Q.url,issue:Q.issue,remediation:Q.remediation};if(Q.schemaUrl!==void 0)$.schemaUrl=Q.schemaUrl;if(Q.supportedMajor!==void 0)$.supportedMajor=Q.supportedMajor;if(Q.detectedMajor!==void 0)$.detectedMajor=Q.detectedMajor;return{success:!1,error:{code:Q.code,message:Q.message,details:$},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}}}if(Q instanceof u8)return{success:!1,error:{code:Q.code,message:Q.message,details:Q.details},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof z1)return{success:!1,error:{code:Q.code,message:Q.message},exitCode:Q.exitCode,meta:{timestamp:new Date().toISOString()}};if(Q instanceof U4)return{success:!1,error:{code:"VALIDATION_ERROR",message:Q.issues.map(($)=>`${$.path.join(".")}: ${$.message}`).join("; "),details:{issues:Q.issues.map(($)=>({path:$.path.join("."),message:$.message,code:$.code}))}},exitCode:H1.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:Q instanceof Error?Q.message:"An unknown error occurred"},exitCode:H1.GENERAL,meta:{timestamp:new Date().toISOString()}}}var u1=A(()=>{G8();_3();t();c1()});function F1(Q){console.log(JSON.stringify(Q,null,2))}function wX(Q){if(!Q)throw new L("npm package name cannot be empty");if(Q.length>jX)throw new L(`npm package name exceeds maximum length of ${jX} characters: \`${Q}\``);if(Q.includes("..")||Q.includes("/./")||Q.startsWith("./"))throw new L(`Invalid npm package name - path traversal detected: \`${Q}\``);if(!kZ.test(Q))throw new L(`Invalid npm package name: \`${Q}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function DX(Q){if(!Q?.trim())throw new L("npm specifier cannot be empty");let $=Q.trim();if(!$.startsWith("npm:"))throw new L(`Invalid npm specifier: \`${Q}\`. Must start with \`npm:\` prefix.`);let Y=$.slice(4);if(!Y)throw new L(`Invalid npm specifier: \`${Q}\`. Package name is required.`);let q=Y.lastIndexOf("@"),J,X;if(q>0){let H=Y.slice(0,q),G=Y.slice(q+1);if(H.includes("/")||!H.startsWith("@"))J=H,X=G||void 0;else throw new L(`Invalid npm specifier: \`${Q}\`. Scoped packages must have format @scope/pkg.`)}else J=Y;return wX(J),{type:"npm",name:J,version:X}}function OX(Q){return Q.trim().startsWith("npm:")}async function J6(Q,$){wX(Q);let Y=Q.startsWith("@")?`@${encodeURIComponent(Q.slice(1))}`:encodeURIComponent(Q),q=`${SZ}/${Y}`;try{let J=$??AbortSignal.timeout(EZ),X=await fetch(q,{signal:J,headers:{Accept:"application/json"}});if(X.status===404)throw new B1(`npm package \`${Q}\` not found on registry`);if(!X.ok)throw new I1(`Failed to fetch npm package \`${Q}\`: HTTP ${X.status} ${X.statusText}`);return await X.json()}catch(J){if(J instanceof B1||J instanceof I1)throw J;if(J instanceof Error&&(J.name==="AbortError"||J.name==="TimeoutError"))throw new I1(`Request to npm registry timed out for package \`${Q}\``);let X=J instanceof Error?J.message:String(J);throw new I1(`Failed to fetch npm package \`${Q}\`: ${X}`)}}function C9(Q,$){return $?`${Q}@${$}`:Q}function IX(Q){let $=[];if(Q.type!=="module")throw new L(`Package \`${Q.name}\` is not an ESM module (missing "type": "module" in package.json)`);let Y=Boolean(Q.main),q=Q.exports!==void 0;if(!Y&&!q)throw new L(`Package \`${Q.name}\` has no entry point (missing "main" or "exports")`);if(!Q.name.includes("opencode"))$.push(`Package name \`${Q.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:$}}async function v3(Q,$,Y){let q=await J6(Q,Y),J=$??q["dist-tags"].latest,X=q.versions[J];if(!X)throw new B1(`Version \`${J}\` not found for npm package \`${Q}\``);return X}function NX(Q){let $=Q.trim(),Y=$.lastIndexOf("@");if(Y<=0)return $;let q=$.slice(0,Y);if(q.includes("/")||!q.startsWith("@"))return q;return $}var SZ="https://registry.npmjs.org",EZ=30000,kZ,jX=214;var X6=A(()=>{t();kZ=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function Q9(Q,$){let Y=Q.get($.absolutePath);if(!Y){Q.set($.absolutePath,$);return}let q=Y.content.equals($.content)?"identical content":"different content";throw new n1(`Intra-batch target collision at "${$.relativePath}". Both "${Y.source}" and "${$.source}" resolve to this path with ${q}. Rename one manifest target so each component writes to a unique path.`)}var P3=A(()=>{t()});import{createHash as vZ}from"crypto";import{existsSync as PZ}from"fs";import{join as xZ}from"path";function $9(Q){return vZ("sha256").update(Q).digest("hex")}async function x3(Q){let $=[...Q].sort((q,J)=>q.path.localeCompare(J.path)),Y=[];for(let q of $){let J=$9(q.content);Y.push(`${q.path}:${J}`)}return $9(Y.join(`
125
+ `))}async function T2(Q,$){let Y=[],q=[],J=[];for(let X of $.files){let H=xZ(Q,X.path);if(!PZ(H)){q.push(X.path),J.push({path:X.path,status:"missing"});continue}let G=await Bun.file(H).text();if($9(G)!==X.hash)Y.push(X.path),J.push({path:X.path,status:"modified"});else J.push({path:X.path,status:"intact"})}return{intact:Y.length===0&&q.length===0,modified:Y,missing:q,details:J}}var y9=A(()=>{q0()});function Q0(Q){return Q.addOption(S0.cwd()).addOption(S0.quiet()).addOption(S0.json())}function E0(Q){return Q.addOption(S0.verbose())}function Q8(Q){return Q.addOption(S0.global)}function C3(Q){return Q.addOption(S0.profile())}function TX(Q){if(!Q||Q.length===0)throw new u0(Q,"cannot be empty");if(Q.length>32)throw new u0(Q,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(Q))throw new u0(Q,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var S0;var d0=A(()=>{L3();t();S0={cwd:()=>new B8("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new B8("-q, --quiet","Suppress output"),json:()=>new B8("--json","Output as JSON"),profile:()=>new B8("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new B8("-v, --verbose","Verbose output"),global:new B8("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function hZ(){let Q=new Map;for(let[$,Y]of Object.entries(k1)){for(let[q,J]of Object.entries(Y))k1[q]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},Y[q]=k1[q],Q.set(J[0],J[1]);Object.defineProperty(k1,$,{value:Y,enumerable:!1})}return Object.defineProperty(k1,"codes",{value:Q,enumerable:!1}),k1.color.close="\x1B[39m",k1.bgColor.close="\x1B[49m",k1.color.ansi=bX(),k1.color.ansi256=RX(),k1.color.ansi16m=SX(),k1.bgColor.ansi=bX(10),k1.bgColor.ansi256=RX(10),k1.bgColor.ansi16m=SX(10),Object.defineProperties(k1,{rgbToAnsi256:{value($,Y,q){if($===Y&&Y===q){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(Y/255*5)+Math.round(q/255*5)},enumerable:!1},hexToRgb:{value($){let Y=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!Y)return[0,0,0];let[q]=Y;if(q.length===3)q=[...q].map((X)=>X+X).join("");let J=Number.parseInt(q,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:($)=>k1.rgbToAnsi256(...k1.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let Y,q,J;if($>=232)Y=(($-232)*10+8)/255,q=Y,J=Y;else{$-=16;let G=$%36;Y=Math.floor($/36)/5,q=Math.floor(G/6)/5,J=G%6/5}let X=Math.max(Y,q,J)*2;if(X===0)return 30;let H=30+(Math.round(J)<<2|Math.round(q)<<1|Math.round(Y));if(X===2)H+=60;return H},enumerable:!1},rgbToAnsi:{value:($,Y,q)=>k1.ansi256ToAnsi(k1.rgbToAnsi256($,Y,q)),enumerable:!1},hexToAnsi:{value:($)=>k1.ansi256ToAnsi(k1.hexToAnsi256($)),enumerable:!1}}),k1}var bX=(Q=0)=>($)=>`\x1B[${$+Q}m`,RX=(Q=0)=>($)=>`\x1B[${38+Q};5;${$}m`,SX=(Q=0)=>($,Y,q)=>`\x1B[${38+Q};2;${$};${Y};${q}m`,k1,mI,CZ,yZ,gI,fZ,p0;var EX=A(()=>{k1={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]}},mI=Object.keys(k1.modifier),CZ=Object.keys(k1.color),yZ=Object.keys(k1.bgColor),gI=[...CZ,...yZ];fZ=hZ(),p0=fZ});import H6 from"process";import uZ from"os";import kX from"tty";function k0(Q,$=globalThis.Deno?globalThis.Deno.args:H6.argv){let Y=Q.startsWith("-")?"":Q.length===1?"-":"--",q=$.indexOf(Y+Q),J=$.indexOf("--");return q!==-1&&(J===-1||q<J)}function mZ(){if("FORCE_COLOR"in v1){if(v1.FORCE_COLOR==="true")return 1;if(v1.FORCE_COLOR==="false")return 0;return v1.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(v1.FORCE_COLOR,10),3)}}function gZ(Q){if(Q===0)return!1;return{level:Q,hasBasic:!0,has256:Q>=2,has16m:Q>=3}}function cZ(Q,{streamIsTTY:$,sniffFlags:Y=!0}={}){let q=mZ();if(q!==void 0)y3=q;let J=Y?y3:q;if(J===0)return 0;if(Y){if(k0("color=16m")||k0("color=full")||k0("color=truecolor"))return 3;if(k0("color=256"))return 2}if("TF_BUILD"in v1&&"AGENT_NAME"in v1)return 1;if(Q&&!$&&J===void 0)return 0;let X=J||0;if(v1.TERM==="dumb")return X;if(H6.platform==="win32"){let H=uZ.release().split(".");if(Number(H[0])>=10&&Number(H[2])>=10586)return Number(H[2])>=14931?3:2;return 1}if("CI"in v1){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((H)=>(H in v1)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((H)=>(H in v1))||v1.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in v1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(v1.TEAMCITY_VERSION)?1:0;if(v1.COLORTERM==="truecolor")return 3;if(v1.TERM==="xterm-kitty")return 3;if(v1.TERM==="xterm-ghostty")return 3;if(v1.TERM==="wezterm")return 3;if("TERM_PROGRAM"in v1){let H=Number.parseInt((v1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(v1.TERM_PROGRAM){case"iTerm.app":return H>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(v1.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(v1.TERM))return 1;if("COLORTERM"in v1)return 1;return X}function vX(Q,$={}){let Y=cZ(Q,{streamIsTTY:Q&&Q.isTTY,...$});return gZ(Y)}var v1,y3,dZ,PX;var xX=A(()=>{({env:v1}=H6);if(k0("no-color")||k0("no-colors")||k0("color=false")||k0("color=never"))y3=0;else if(k0("color")||k0("colors")||k0("color=true")||k0("color=always"))y3=1;dZ={stdout:vX({isTTY:kX.isatty(1)}),stderr:vX({isTTY:kX.isatty(2)})},PX=dZ});function CX(Q,$,Y){let q=Q.indexOf($);if(q===-1)return Q;let J=$.length,X=0,H="";do H+=Q.slice(X,q)+$+Y,X=q+J,q=Q.indexOf($,X);while(q!==-1);return H+=Q.slice(X),H}function yX(Q,$,Y,q){let J=0,X="";do{let H=Q[q-1]==="\r";X+=Q.slice(J,H?q-1:q)+$+(H?`\r
127
126
  `:`
128
- `)+U,v=Q+1,Q=$.indexOf(`
129
- `,v)}while(Q!==-1);return J+=$.slice(v),J}function i_($){return kM($)}var Dj,Mj,rJ,R0,p_,wj,E0,LM=($,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let U=Dj?Dj.level:0;$.level=_.level===void 0?U:_.level},kM=($)=>{let _=(...U)=>U.join(" ");return LM(_,$),Object.setPrototypeOf(_,i_.prototype),_},oJ=($,_,U,...Q)=>{if($==="rgb"){if(_==="ansi16m")return s4[U].ansi16m(...Q);if(_==="ansi256")return s4[U].ansi256(s4.rgbToAnsi256(...Q));return s4[U].ansi(s4.rgbToAnsi(...Q))}if($==="hex")return oJ("rgb",_,U,...s4.hexToRgb(...Q));return s4[U][$](...Q)},AM,FM,tJ=($,_,U)=>{let Q,v;if(U===void 0)Q=$,v=_;else Q=U.openAll+$,v=_+U.closeAll;return{open:$,close:_,openAll:Q,closeAll:v,parent:U}},W8=($,_,U)=>{let Q=(...v)=>OM(Q,v.length===1?""+v[0]:v.join(" "));return Object.setPrototypeOf(Q,FM),Q[rJ]=$,Q[R0]=_,Q[p_]=U,Q},OM=($,_)=>{if($.level<=0||!_)return $[p_]?"":_;let U=$[R0];if(U===void 0)return _;let{openAll:Q,closeAll:v}=U;if(_.includes("\x1B"))while(U!==void 0)_=Zj(_,U.close,U.open),U=U.parent;let J=_.indexOf(`
130
- `);if(J!==-1)_=Vj(_,v,Q,J);return Q+_+v},NM,nE,Lj;var kj=b(()=>{Kj();Bj();({stdout:Dj,stderr:Mj}=bj),rJ=Symbol("GENERATOR"),R0=Symbol("STYLER"),p_=Symbol("IS_EMPTY"),wj=["ansi","ansi","ansi256","ansi16m"],E0=Object.create(null);Object.setPrototypeOf(i_.prototype,Function.prototype);for(let[$,_]of Object.entries(s4))E0[$]={get(){let U=W8(this,tJ(_.open,_.close,this[R0]),this[p_]);return Object.defineProperty(this,$,{value:U}),U}};E0.visible={get(){let $=W8(this,this[R0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};AM=["rgb","hex","ansi256"];for(let $ of AM){E0[$]={get(){let{level:U}=this;return function(...Q){let v=tJ(oJ($,wj[U],"color",...Q),s4.color.close,this[R0]);return W8(this,v,this[p_])}}};let _="bg"+$[0].toUpperCase()+$.slice(1);E0[_]={get(){let{level:U}=this;return function(...Q){let v=tJ(oJ($,wj[U],"bgColor",...Q),s4.bgColor.close,this[R0]);return W8(this,v,this[p_])}}}}FM=Object.defineProperties(()=>{},{...E0,level:{enumerable:!0,get(){return this[rJ].level},set($){this[rJ].level=$}}});Object.defineProperties(i_.prototype,E0);NM=i_(),nE=i_({level:Mj?Mj.level:0}),Lj=NM});function aJ($,_,{ignoreNonConfigurable:U=!1}={}){let{name:Q}=$;for(let v of Reflect.ownKeys(_))SM($,_,v,U);return RM($,_),uM($,_,Q),$}var SM=($,_,U,Q)=>{if(U==="length"||U==="prototype")return;if(U==="arguments"||U==="caller")return;let v=Object.getOwnPropertyDescriptor($,U),J=Object.getOwnPropertyDescriptor(_,U);if(!TM(v,J)&&Q)return;Object.defineProperty($,U,J)},TM=function($,_){return $===void 0||$.configurable||$.writable===_.writable&&$.enumerable===_.enumerable&&$.configurable===_.configurable&&($.writable||$.value===_.value)},RM=($,_)=>{let U=Object.getPrototypeOf(_);if(U===Object.getPrototypeOf($))return;Object.setPrototypeOf($,U)},EM=($,_)=>`/* Wrapped ${$}*/
131
- ${_}`,PM,xM,uM=($,_,U)=>{let Q=U===""?"":`with ${U.trim()}() `,v=EM.bind(null,Q,_.toString());Object.defineProperty(v,"name",xM);let{writable:J,enumerable:Y,configurable:z}=PM;Object.defineProperty($,"toString",{value:v,writable:J,enumerable:Y,configurable:z})};var Aj=b(()=>{PM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var b8,Fj=($,_={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let U,Q=0,v=$.displayName||$.name||"<anonymous>",J=function(...Y){if(b8.set(J,++Q),Q===1)U=$.apply(this,Y),$=void 0;else if(_.throw===!0)throw Error(`Function \`${v}\` can only be called once`);return U};return aJ(J,$),b8.set(J,Q),J},Oj;var Nj=b(()=>{Aj();b8=new WeakMap;Fj.callCount=($)=>{if(!b8.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return b8.get($)};Oj=Fj});var A1;var Sj=b(()=>{A1=[];A1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")A1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")A1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class Tj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(eJ[sJ])return eJ[sJ];yM(eJ,sJ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,_){this.listeners[$].push(_)}removeListener($,_){let U=this.listeners[$],Q=U.indexOf(_);if(Q===-1)return;if(Q===0&&U.length===1)U.length=0;else U.splice(Q,1)}emit($,_,U){if(this.emitted[$])return!1;this.emitted[$]=!0;let Q=!1;for(let v of this.listeners[$])Q=v(_,U)===!0||Q;if($==="exit")Q=this.emit("afterExit",_,U)||Q;return Q}}class _Y{}var B8=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",sJ,eJ,yM,CM=($)=>{return{onExit(_,U){return $.onExit(_,U)},load(){return $.load()},unload(){return $.unload()}}},Rj,Ej,$Y,Pj,$P,_P;var xj=b(()=>{Sj();sJ=Symbol.for("signal-exit emitter"),eJ=globalThis,yM=Object.defineProperty.bind(Object);Rj=class Rj extends _Y{onExit(){return()=>{}}load(){}unload(){}};Ej=class Ej extends _Y{#J=$Y.platform==="win32"?"SIGINT":"SIGHUP";#U=new Tj;#v;#$;#Q;#_={};#Y=!1;constructor($){super();this.#v=$,this.#_={};for(let _ of A1)this.#_[_]=()=>{let U=this.#v.listeners(_),{count:Q}=this.#U,v=$;if(typeof v.__signal_exit_emitter__==="object"&&typeof v.__signal_exit_emitter__.count==="number")Q+=v.__signal_exit_emitter__.count;if(U.length===Q){this.unload();let J=this.#U.emit("exit",null,_),Y=_==="SIGHUP"?this.#J:_;if(!J)$.kill($.pid,Y)}};this.#Q=$.reallyExit,this.#$=$.emit}onExit($,_){if(!B8(this.#v))return()=>{};if(this.#Y===!1)this.load();let U=_?.alwaysLast?"afterExit":"exit";return this.#U.on(U,$),()=>{if(this.#U.removeListener(U,$),this.#U.listeners.exit.length===0&&this.#U.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#U.count+=1;for(let $ of A1)try{let _=this.#_[$];if(_)this.#v.on($,_)}catch(_){}this.#v.emit=($,..._)=>{return this.#G($,..._)},this.#v.reallyExit=($)=>{return this.#I($)}}unload(){if(!this.#Y)return;this.#Y=!1,A1.forEach(($)=>{let _=this.#_[$];if(!_)throw Error("Listener not defined for signal: "+$);try{this.#v.removeListener($,_)}catch(U){}}),this.#v.emit=this.#$,this.#v.reallyExit=this.#Q,this.#U.count-=1}#I($){if(!B8(this.#v))return 0;return this.#v.exitCode=$||0,this.#U.emit("exit",this.#v.exitCode,null),this.#Q.call(this.#v,this.#v.exitCode)}#G($,..._){let U=this.#$;if($==="exit"&&B8(this.#v)){if(typeof _[0]==="number")this.#v.exitCode=_[0];let Q=U.call(this.#v,$,..._);return this.#U.emit("exit",this.#v.exitCode,null),Q}else return U.call(this.#v,$,..._)}};$Y=globalThis.process,{onExit:Pj,load:$P,unload:_P}=CM(B8($Y)?new Ej($Y):new Rj)});import Z8 from"process";var uj,fM,yj;var Cj=b(()=>{Nj();xj();uj=Z8.stderr.isTTY?Z8.stderr:Z8.stdout.isTTY?Z8.stdout:void 0,fM=uj?Oj(()=>{Pj(()=>{uj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},yj=fM});import fj from"process";var V8=!1,P0,vY;var mj=b(()=>{Cj();P0={};P0.show=($=fj.stderr)=>{if(!$.isTTY)return;V8=!1,$.write("\x1B[?25h")};P0.hide=($=fj.stderr)=>{if(!$.isTTY)return;yj(),V8=!0,$.write("\x1B[?25l")};P0.toggle=($,_)=>{if($!==void 0)V8=$;if(V8)P0.show(_);else P0.hide(_)};vY=P0});var UY;var gj=b(()=>{UY={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\uD83D\uDC97 "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","\xBA> ~~~~~~~~~~~~~~~~~","(\xBA> ~~~~~~~~~~~~~~~~","((\xBA> ~~~~~~~~~~~~~~~","<((\xBA> ~~~~~~~~~~~~~~","><((\xBA> ~~~~~~~~~~~~~"," ><((\xBA> ~~~~~~~~~~~~","~ ><((\xBA> ~~~~~~~~~~~","~~ <>((\xBA> ~~~~~~~~~~","~~~ ><((\xBA> ~~~~~~~~~","~~~~ <>((\xBA> ~~~~~~~~","~~~~~ ><((\xBA> ~~~~~~~","~~~~~~ <>((\xBA> ~~~~~~","~~~~~~~ ><((\xBA> ~~~~~","~~~~~~~~ <>((\xBA> ~~~~","~~~~~~~~~ ><((\xBA> ~~~","~~~~~~~~~~ <>((\xBA> ~~","~~~~~~~~~~~ ><((\xBA> ~","~~~~~~~~~~~~ <>((\xBA> ","~~~~~~~~~~~~~ ><((\xBA>","~~~~~~~~~~~~~~ <>((\xBA","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}});var n_,jP;var hj=b(()=>{gj();n_=UY,jP=Object.keys(UY)});import gM from"tty";var hM,J$=($,_)=>{if(!hM)return(v)=>v;let U=`\x1B[${$}m`,Q=`\x1B[${_}m`;return(v)=>{let J=v+"",Y=J.indexOf(Q);if(Y===-1)return U+J+Q;let z=U,I=0,q=(_===22?Q:"")+U;while(Y!==-1)z+=J.slice(I,Y)+q,I=Y+Q.length,Y=J.indexOf(Q,I);return z+=J.slice(I)+Q,z}},WP,bP,BP,ZP,VP,DP,MP,wP,LP,kP,cj,lj,dj,pj,AP,FP,OP,NP,SP,TP,RP,EP,PP,xP,uP,yP,CP,fP,mP,gP,hP,cP,lP,dP,pP,iP,nP,rP,oP,tP,aP;var QY=b(()=>{hM=gM?.WriteStream?.prototype?.hasColors?.()??!1,WP=J$(0,0),bP=J$(1,22),BP=J$(2,22),ZP=J$(3,23),VP=J$(4,24),DP=J$(53,55),MP=J$(7,27),wP=J$(8,28),LP=J$(9,29),kP=J$(30,39),cj=J$(31,39),lj=J$(32,39),dj=J$(33,39),pj=J$(34,39),AP=J$(35,39),FP=J$(36,39),OP=J$(37,39),NP=J$(90,39),SP=J$(40,49),TP=J$(41,49),RP=J$(42,49),EP=J$(43,49),PP=J$(44,49),xP=J$(45,49),uP=J$(46,49),yP=J$(47,49),CP=J$(100,49),fP=J$(91,39),mP=J$(92,39),gP=J$(93,39),hP=J$(94,39),cP=J$(95,39),lP=J$(96,39),dP=J$(97,39),pP=J$(101,49),iP=J$(102,49),nP=J$(103,49),rP=J$(104,49),oP=J$(105,49),tP=J$(106,49),aP=J$(107,49)});var ij=b(()=>{QY();QY()});import nj from"process";function r_(){let{env:$}=nj,{TERM:_,TERM_PROGRAM:U}=$;if(nj.platform!=="win32")return _!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||U==="Terminus-Sublime"||U==="vscode"||_==="xterm-256color"||_==="alacritty"||_==="rxvt-unicode"||_==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JY=()=>{};var F1={};s$(F1,{warning:()=>pM,success:()=>dM,info:()=>lM,error:()=>iM});var D8,lM,dM,pM,iM;var rj=b(()=>{ij();JY();D8=r_(),lM=pj(D8?"\u2139":"i"),dM=lj(D8?"\u2714":"\u221A"),pM=dj(D8?"\u26A0":"\u203C"),iM=cj(D8?"\u2716":"\xD7")});var oj=b(()=>{rj()});function YY({onlyFirst:$=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",$?void 0:"g")}function zY($){if(typeof $!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(nM,"")}var nM;var tj=b(()=>{nM=YY()});var M8,w8,IY,XY,o_;var aj=b(()=>{M8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],w8=[12288,12288,65281,65376,65504,65510],IY=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],XY=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],o_=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var L8=($,_)=>{let U=0,Q=Math.floor($.length/2)-1;while(U<=Q){let v=Math.floor((U+Q)/2),J=v*2;if(_<$[J])Q=v-1;else if(_>$[J+1])U=v+1;else return!0}return!1};function vw($){let _=$[0],U=$[1];for(let Q=0;Q<$.length;Q+=2){let v=$[Q],J=$[Q+1];if(sj>=v&&sj<=J)return[v,J];if(J-v>U-_)_=v,U=J}return[_,U]}var rM,oM,tM,aM,jx,Kx,Hx,Wx,sM,eM,sj=19968,$w,_w,ej=($)=>{if($<rM||$>oM)return!1;return L8(M8,$)},$K=($)=>{if($<tM||$>aM)return!1;return L8(w8,$)},_K=($)=>{if($>=$w&&$<=_w)return!0;if($<sM||$>eM)return!1;return L8(o_,$)};var vK=b(()=>{aj();rM=M8[0],oM=M8.at(-1),tM=w8[0],aM=w8.at(-1),jx=IY[0],Kx=IY.at(-1),Hx=XY[0],Wx=XY.at(-1),sM=o_[0],eM=o_.at(-1),[$w,_w]=vw(o_)});function Uw($){if(!Number.isSafeInteger($))throw TypeError(`Expected a code point, got \`${typeof $}\`.`)}function qY($,{ambiguousAsWide:_=!1}={}){if(Uw($),$K($)||_K($)||_&&ej($))return 2;return 1}var UK=b(()=>{vK()});function qw($){if($.length>50)return!1;if(Iw.test($))return!0;if($.includes("\u200D")){let _=$.match(Xw);return _!==null&&_.length>=2}return!1}function Gw($){return $.replace(Yw,"")}function jw($){return Jw.test($)}function Kw($,_){let U=0;if($.length>1){for(let Q of $.slice(1))if(Q>="\uFF00"&&Q<="\uFFEF")U+=qY(Q.codePointAt(0),_)}return U}function GY($,_={}){if(typeof $!=="string"||$.length===0)return 0;let{ambiguousIsNarrow:U=!0,countAnsiEscapeCodes:Q=!1}=_,v=$;if(!Q&&(v.includes("\x1B")||v.includes("\x9B")))v=zY(v);if(v.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(v))return v.length;let J=0,Y={ambiguousAsWide:!U};for(let{segment:z}of Qw.segment(v)){if(jw(z))continue;if(zw.test(z)||qw(z)){J+=2;continue}let I=Gw(z).codePointAt(0);J+=qY(I,Y),J+=Kw(z,Y)}return J}var Qw,Jw,Yw,zw,Iw,Xw;var QK=b(()=>{tj();UK();Qw=new Intl.Segmenter,Jw=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Yw=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,zw=/^\p{RGI_Emoji}$/v,Iw=/^[\d#*]\u20E3$/,Xw=/\p{Extended_Pictographic}/gu});function jY({stream:$=process.stdout}={}){return Boolean($&&$.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import x0 from"process";class JK{#J=0;#U;#v=!1;#$=!1;#Q=($)=>{if(!$?.length)return;if((typeof $==="string"?$.codePointAt(0):$[0])===Hw)if(x0.listenerCount("SIGINT")>0)x0.emit("SIGINT");else x0.kill(x0.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#_()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#Y()}#_(){let{stdin:$}=x0;if(x0.platform==="win32"||!$?.isTTY||typeof $.setRawMode!=="function"){this.#U=void 0;return}if(this.#U=$,this.#v=$.isPaused(),this.#$=Boolean($.isRaw),$.setRawMode(!0),$.prependListener("data",this.#Q),this.#v)$.resume()}#Y(){if(!this.#U)return;let $=this.#U;if($.off("data",this.#Q),$.isTTY)$.setRawMode?.(this.#$);if(this.#v)$.pause();this.#U=void 0,this.#v=!1,this.#$=!1}}var Hw=3,Ww,KY;var YK=b(()=>{Ww=new JK,KY=Object.freeze(Ww)});import t_ from"process";import{stripVTControlCharacters as bw}from"util";class zK{#J=0;#U=-1;#v=0;#$;#Q;#_;#Y;#I=new Map;#G=!1;#X;#z;#j=!1;color;#q($){this.#G=!0;try{return $()}finally{this.#G=!1}}#H(){if(this.isSpinning)this.render()}#D($,_){if($===void 0||$===null)return"";if(typeof $==="string")return $;if(Buffer.isBuffer($)||ArrayBuffer.isView($)){let U=typeof _==="string"&&_&&_!=="buffer"?_:"utf8";return Buffer.from($).toString(U)}return String($)}#M($){if(!$)return!1;let _=$.at(-1);return _===`
132
- `||_==="\r"}#w(){if(this.#z)return;if(this.#z=setTimeout(()=>{if(this.#z=void 0,this.isSpinning)this.#H()},Bw),typeof this.#z?.unref==="function")this.#z.unref()}#W(){if(this.#z)clearTimeout(this.#z),this.#z=void 0}#b($,_,U,Q){let v=this.#Z(U," "),Y=typeof _==="string"?($?" ":"")+_:"",z=this.#V(Q," ");return v+$+Y+z}constructor($){if(typeof $==="string")$={text:$};if(this.#$={color:"cyan",stream:t_.stderr,discardStdin:!0,hideCursor:!0,...$},this.color=this.#$.color,this.#_=this.#$.stream,typeof this.#$.isEnabled!=="boolean")this.#$.isEnabled=jY({stream:this.#_});if(typeof this.#$.isSilent!=="boolean")this.#$.isSilent=!1;let _=this.#$.interval;if(this.spinner=this.#$.spinner,this.#$.interval=_,this.text=this.#$.text,this.prefixText=this.#$.prefixText,this.suffixText=this.#$.suffixText,this.indent=this.#$.indent,t_.env.NODE_ENV==="test")this._stream=this.#_,this._isEnabled=this.#$.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set(U){this.#J=U}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#U}}),Object.defineProperty(this,"_lineCount",{get(){let U=this.#_.columns??80,Q=typeof this.#$.prefixText==="function"?"":this.#$.prefixText,v=typeof this.#$.suffixText==="function"?"":this.#$.suffixText,J=typeof Q==="string"&&Q!==""?Q+" ":"",Y=typeof v==="string"&&v!==""?" "+v:"",z="-",I=" ".repeat(this.#$.indent)+J+"-"+(typeof this.#$.text==="string"?" "+this.#$.text:"")+Y;return this.#K(I,U)}})}get indent(){return this.#$.indent}set indent($=0){if(!($>=0&&Number.isInteger($)))throw Error("The `indent` option must be an integer from 0 and up");this.#$.indent=$}get interval(){return this.#$.interval??this.#Q.interval??100}get spinner(){return this.#Q}set spinner($){if(this.#U=-1,this.#$.interval=void 0,typeof $==="object"){if(!Array.isArray($.frames)||$.frames.length===0||$.frames.some((_)=>typeof _!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if($.interval!==void 0&&!(Number.isInteger($.interval)&&$.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#Q=$}else if(!r_())this.#Q=n_.line;else if($===void 0)this.#Q=n_.dots;else if($!=="default"&&n_[$])this.#Q=n_[$];else throw Error(`There is no built-in spinner named '${$}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#$.text}set text($=""){this.#$.text=$}get prefixText(){return this.#$.prefixText}set prefixText($=""){this.#$.prefixText=$}get suffixText(){return this.#$.suffixText}set suffixText($=""){this.#$.suffixText=$}get isSpinning(){return this.#Y!==void 0}#B($,_,U=!1){let Q=typeof $==="function"?$():$;if(typeof Q==="string"&&Q!=="")return U?_+Q:Q+_;return""}#Z($=this.#$.prefixText,_=" "){return this.#B($,_,!1)}#V($=this.#$.suffixText,_=" "){return this.#B($,_,!0)}#K($,_){let U=0;for(let Q of bw($).split(`
133
- `))U+=Math.max(1,Math.ceil(GY(Q)/_));return U}get isEnabled(){return this.#$.isEnabled&&!this.#$.isSilent}set isEnabled($){if(typeof $!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#$.isEnabled=$}get isSilent(){return this.#$.isSilent}set isSilent($){if(typeof $!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#$.isSilent=$}frame(){let $=Date.now();if(this.#U===-1||$-this.#v>=this.interval)this.#U=(this.#U+1)%this.#Q.frames.length,this.#v=$;let{frames:_}=this.#Q,U=_[this.#U];if(this.color)U=Lj[this.color](U);let Q=this.#Z(this.#$.prefixText," "),v=typeof this.text==="string"?" "+this.text:"",J=this.#V(this.#$.suffixText," ");return Q+U+v+J}clear(){if(!this.isEnabled||!this.#_.isTTY)return this;return this.#q(()=>{this.#_.cursorTo(0);for(let $=0;$<this.#J;$++){if($>0)this.#_.moveCursor(0,-1);this.#_.clearLine(1)}if(this.#$.indent)this.#_.cursorTo(this.#$.indent)}),this.#J=0,this}#L($){if(!$||this.#I.has($)||!$.isTTY||typeof $.write!=="function")return;if(k8.has($))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let _=$.write;this.#I.set($,_),k8.set($,this),$.write=(U,Q,v)=>this.#F($,_,U,Q,v)}#k(){if(!this.isEnabled||this.#I.size>0)return;let $=new Set([this.#_,t_.stdout,t_.stderr]);for(let _ of $)this.#L(_)}#A(){for(let[$,_]of this.#I)if($.write=_,k8.get($)===this)k8.delete($);this.#I.clear()}#F($,_,U,Q,v){if(typeof Q==="function")v=Q,Q=void 0;if(this.#G)return _.call($,U,Q,v);this.clear();let J=this.#D(U,Q),Y=this.#M(J),z=_.call($,U,Q,v);if(Y)this.#W();else if(J.length>0)this.#w();if(this.isSpinning&&!this.#z)this.render();return z}render(){if(!this.isEnabled||this.#X||this.#z)return this;let $=this.#_.isTTY,_=!1;try{if($)this.#q(()=>this.#_.write(Zw)),_=!0;this.clear();let U=this.frame(),Q=this.#_.columns??80,v=this.#K(U,Q),J=this.#_.rows;if(J&&J>1&&v>J){let z=U.split(`
134
- `),I=J-1;U=[...z.slice(0,I),"... (content truncated to fit terminal)"].join(`
135
- `)}if(this.#q(()=>this.#_.write(U))===!1&&this.#_.isTTY)this.#X=()=>{this.#X=void 0,this.#H()},this.#_.once("drain",this.#X);this.#J=this.#K(U,Q)}finally{if(_)this.#q(()=>this.#_.write(Vw))}return this}start($){if($)this.text=$;if(this.isSilent)return this;if(!this.isEnabled){let _=this.text?"-":"",U=" ".repeat(this.#$.indent)+this.#b(_,this.text,this.#$.prefixText,this.#$.suffixText);if(U.trim()!=="")this.#q(()=>this.#_.write(U+`
136
- `));return this}if(this.isSpinning)return this;if(this.#$.hideCursor)vY.hide(this.#_);if(this.#$.discardStdin&&t_.stdin.isTTY)KY.start(),this.#j=!0;return this.#k(),this.render(),this.#Y=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#Y),this.#Y=void 0,this.#U=-1,this.#v=0,this.#W(),this.#A(),this.#X)this.#_.removeListener("drain",this.#X),this.#X=void 0;if(this.isEnabled){if(this.clear(),this.#$.hideCursor)vY.show(this.#_)}if(this.#j)this.#j=!1,KY.stop();return this}succeed($){return this.stopAndPersist({symbol:F1.success,text:$})}fail($){return this.stopAndPersist({symbol:F1.error,text:$})}warn($){return this.stopAndPersist({symbol:F1.warning,text:$})}info($){return this.stopAndPersist({symbol:F1.info,text:$})}stopAndPersist($={}){if(this.isSilent)return this;let _=$.symbol??" ",U=$.text??this.text,Q=$.prefixText??this.#$.prefixText,v=$.suffixText??this.#$.suffixText,J=this.#b(_,U,Q,v)+`
137
- `;return this.stop(),this.#q(()=>this.#_.write(J)),this}}function HY($){return new zK($)}var Bw=200,Zw="\x1B[?2026h",Vw="\x1B[?2026l",k8;var IK=b(()=>{kj();mj();hj();oj();QK();JY();YK();k8=new Map});function V$($){let _=M1&&!$.quiet;return HY({text:$.text,isSilent:!_})}var e4=b(()=>{IK();l_()});function XK($){let[_=""]=$.split("-"),U=_.split("."),Q=parseInt(U[0]??"",10),v=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(v)||Number.isNaN(J))return null;return{major:Q,minor:v,patch:J}}function Dw($,_){let U=XK($),Q=XK(_);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}function qK($,_,U){if(!$)return{compatible:!0};let Q=Dw(_,$);if(Q===null)return{compatible:!0};if(Q>=0)return{compatible:!0};return{compatible:!1,required:$,installed:_,type:U}}function Mw($,_){let U=_.type==="opencode"?"OpenCode":"OCX CLI",Q=_.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
138
- ${g.yellow().bold("\u26A0 WARN")} ${g.yellow("Version compatibility notice")}
139
-
140
- Registry ${g.cyan(`"${$}"`)} requires ${U} ${g.green(_.required)}
141
- You are running ${U} ${g.red(_.installed)}
127
+ `)+Y,J=q+1,q=Q.indexOf(`
128
+ `,J)}while(q!==-1);return X+=Q.slice(J),X}function R2(Q){return lZ(Q)}var hX,fX,G6,h9,b2,uX,f9,pZ=(Q,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let Y=hX?hX.level:0;Q.level=$.level===void 0?Y:$.level},lZ=(Q)=>{let $=(...Y)=>Y.join(" ");return pZ($,Q),Object.setPrototypeOf($,R2.prototype),$},K6=(Q,$,Y,...q)=>{if(Q==="rgb"){if($==="ansi16m")return p0[Y].ansi16m(...q);if($==="ansi256")return p0[Y].ansi256(p0.rgbToAnsi256(...q));return p0[Y].ansi(p0.rgbToAnsi(...q))}if(Q==="hex")return K6("rgb",$,Y,...p0.hexToRgb(...q));return p0[Y][Q](...q)},iZ,nZ,W6=(Q,$,Y)=>{let q,J;if(Y===void 0)q=Q,J=$;else q=Y.openAll+Q,J=$+Y.closeAll;return{open:Q,close:$,openAll:q,closeAll:J,parent:Y}},h3=(Q,$,Y)=>{let q=(...J)=>oZ(q,J.length===1?""+J[0]:J.join(" "));return Object.setPrototypeOf(q,nZ),q[G6]=Q,q[h9]=$,q[b2]=Y,q},oZ=(Q,$)=>{if(Q.level<=0||!$)return Q[b2]?"":$;let Y=Q[h9];if(Y===void 0)return $;let{openAll:q,closeAll:J}=Y;if($.includes("\x1B"))while(Y!==void 0)$=CX($,Y.close,Y.open),Y=Y.parent;let X=$.indexOf(`
129
+ `);if(X!==-1)$=yX($,J,q,X);return q+$+J},sZ,aI,mX;var gX=A(()=>{EX();xX();({stdout:hX,stderr:fX}=PX),G6=Symbol("GENERATOR"),h9=Symbol("STYLER"),b2=Symbol("IS_EMPTY"),uX=["ansi","ansi","ansi256","ansi16m"],f9=Object.create(null);Object.setPrototypeOf(R2.prototype,Function.prototype);for(let[Q,$]of Object.entries(p0))f9[Q]={get(){let Y=h3(this,W6($.open,$.close,this[h9]),this[b2]);return Object.defineProperty(this,Q,{value:Y}),Y}};f9.visible={get(){let Q=h3(this,this[h9],!0);return Object.defineProperty(this,"visible",{value:Q}),Q}};iZ=["rgb","hex","ansi256"];for(let Q of iZ){f9[Q]={get(){let{level:Y}=this;return function(...q){let J=W6(K6(Q,uX[Y],"color",...q),p0.color.close,this[h9]);return h3(this,J,this[b2])}}};let $="bg"+Q[0].toUpperCase()+Q.slice(1);f9[$]={get(){let{level:Y}=this;return function(...q){let J=W6(K6(Q,uX[Y],"bgColor",...q),p0.bgColor.close,this[h9]);return h3(this,J,this[b2])}}}}nZ=Object.defineProperties(()=>{},{...f9,level:{enumerable:!0,get(){return this[G6].level},set(Q){this[G6].level=Q}}});Object.defineProperties(R2.prototype,f9);sZ=R2(),aI=R2({level:fX?fX.level:0}),mX=sZ});function z6(Q,$,{ignoreNonConfigurable:Y=!1}={}){let{name:q}=Q;for(let J of Reflect.ownKeys($))rZ(Q,$,J,Y);return tZ(Q,$),YM(Q,$,q),Q}var rZ=(Q,$,Y,q)=>{if(Y==="length"||Y==="prototype")return;if(Y==="arguments"||Y==="caller")return;let J=Object.getOwnPropertyDescriptor(Q,Y),X=Object.getOwnPropertyDescriptor($,Y);if(!aZ(J,X)&&q)return;Object.defineProperty(Q,Y,X)},aZ=function(Q,$){return Q===void 0||Q.configurable||Q.writable===$.writable&&Q.enumerable===$.enumerable&&Q.configurable===$.configurable&&(Q.writable||Q.value===$.value)},tZ=(Q,$)=>{let Y=Object.getPrototypeOf($);if(Y===Object.getPrototypeOf(Q))return;Object.setPrototypeOf(Q,Y)},eZ=(Q,$)=>`/* Wrapped ${Q}*/
130
+ ${$}`,QM,$M,YM=(Q,$,Y)=>{let q=Y===""?"":`with ${Y.trim()}() `,J=eZ.bind(null,q,$.toString());Object.defineProperty(J,"name",$M);let{writable:X,enumerable:H,configurable:G}=QM;Object.defineProperty(Q,"toString",{value:J,writable:X,enumerable:H,configurable:G})};var cX=A(()=>{QM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),$M=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var f3,dX=(Q,$={})=>{if(typeof Q!=="function")throw TypeError("Expected a function");let Y,q=0,J=Q.displayName||Q.name||"<anonymous>",X=function(...H){if(f3.set(X,++q),q===1)Y=Q.apply(this,H),Q=void 0;else if($.throw===!0)throw Error(`Function \`${J}\` can only be called once`);return Y};return z6(X,Q),f3.set(X,q),X},pX;var lX=A(()=>{cX();f3=new WeakMap;dX.callCount=(Q)=>{if(!f3.has(Q))throw Error(`The given function \`${Q.name}\` is not wrapped by the \`onetime\` package`);return f3.get(Q)};pX=dX});var Y9;var iX=A(()=>{Y9=[];Y9.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")Y9.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Y9.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class nX{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_6[B6])return _6[B6];qM(_6,B6,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Q,$){this.listeners[Q].push($)}removeListener(Q,$){let Y=this.listeners[Q],q=Y.indexOf($);if(q===-1)return;if(q===0&&Y.length===1)Y.length=0;else Y.splice(q,1)}emit(Q,$,Y){if(this.emitted[Q])return!1;this.emitted[Q]=!0;let q=!1;for(let J of this.listeners[Q])q=J($,Y)===!0||q;if(Q==="exit")q=this.emit("afterExit",$,Y)||q;return q}}class M6{}var u3=(Q)=>!!Q&&typeof Q==="object"&&typeof Q.removeListener==="function"&&typeof Q.emit==="function"&&typeof Q.reallyExit==="function"&&typeof Q.listeners==="function"&&typeof Q.kill==="function"&&typeof Q.pid==="number"&&typeof Q.on==="function",B6,_6,qM,JM=(Q)=>{return{onExit($,Y){return Q.onExit($,Y)},load(){return Q.load()},unload(){return Q.unload()}}},oX,sX,Z6,rX,JN,XN;var aX=A(()=>{iX();B6=Symbol.for("signal-exit emitter"),_6=globalThis,qM=Object.defineProperty.bind(Object);oX=class oX extends M6{onExit(){return()=>{}}load(){}unload(){}};sX=class sX extends M6{#X=Z6.platform==="win32"?"SIGINT":"SIGHUP";#q=new nX;#Y;#Q;#J;#$={};#H=!1;constructor(Q){super();this.#Y=Q,this.#$={};for(let $ of Y9)this.#$[$]=()=>{let Y=this.#Y.listeners($),{count:q}=this.#q,J=Q;if(typeof J.__signal_exit_emitter__==="object"&&typeof J.__signal_exit_emitter__.count==="number")q+=J.__signal_exit_emitter__.count;if(Y.length===q){this.unload();let X=this.#q.emit("exit",null,$),H=$==="SIGHUP"?this.#X:$;if(!X)Q.kill(Q.pid,H)}};this.#J=Q.reallyExit,this.#Q=Q.emit}onExit(Q,$){if(!u3(this.#Y))return()=>{};if(this.#H===!1)this.load();let Y=$?.alwaysLast?"afterExit":"exit";return this.#q.on(Y,Q),()=>{if(this.#q.removeListener(Y,Q),this.#q.listeners.exit.length===0&&this.#q.listeners.afterExit.length===0)this.unload()}}load(){if(this.#H)return;this.#H=!0,this.#q.count+=1;for(let Q of Y9)try{let $=this.#$[Q];if($)this.#Y.on(Q,$)}catch($){}this.#Y.emit=(Q,...$)=>{return this.#B(Q,...$)},this.#Y.reallyExit=(Q)=>{return this.#K(Q)}}unload(){if(!this.#H)return;this.#H=!1,Y9.forEach((Q)=>{let $=this.#$[Q];if(!$)throw Error("Listener not defined for signal: "+Q);try{this.#Y.removeListener(Q,$)}catch(Y){}}),this.#Y.emit=this.#Q,this.#Y.reallyExit=this.#J,this.#q.count-=1}#K(Q){if(!u3(this.#Y))return 0;return this.#Y.exitCode=Q||0,this.#q.emit("exit",this.#Y.exitCode,null),this.#J.call(this.#Y,this.#Y.exitCode)}#B(Q,...$){let Y=this.#Q;if(Q==="exit"&&u3(this.#Y)){if(typeof $[0]==="number")this.#Y.exitCode=$[0];let q=Y.call(this.#Y,Q,...$);return this.#q.emit("exit",this.#Y.exitCode,null),q}else return Y.call(this.#Y,Q,...$)}};Z6=globalThis.process,{onExit:rX,load:JN,unload:XN}=JM(u3(Z6)?new sX(Z6):new oX)});import m3 from"process";var tX,XM,eX;var QH=A(()=>{lX();aX();tX=m3.stderr.isTTY?m3.stderr:m3.stdout.isTTY?m3.stdout:void 0,XM=tX?pX(()=>{rX(()=>{tX.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},eX=XM});import $H from"process";var g3=!1,u9,U6;var YH=A(()=>{QH();u9={};u9.show=(Q=$H.stderr)=>{if(!Q.isTTY)return;g3=!1,Q.write("\x1B[?25h")};u9.hide=(Q=$H.stderr)=>{if(!Q.isTTY)return;eX(),g3=!0,Q.write("\x1B[?25l")};u9.toggle=(Q,$)=>{if(Q!==void 0)g3=Q;if(g3)u9.show($);else u9.hide($)};U6=u9});var V6;var qH=A(()=>{V6={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\uD83D\uDC97 "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","\xBA> ~~~~~~~~~~~~~~~~~","(\xBA> ~~~~~~~~~~~~~~~~","((\xBA> ~~~~~~~~~~~~~~~","<((\xBA> ~~~~~~~~~~~~~~","><((\xBA> ~~~~~~~~~~~~~"," ><((\xBA> ~~~~~~~~~~~~","~ ><((\xBA> ~~~~~~~~~~~","~~ <>((\xBA> ~~~~~~~~~~","~~~ ><((\xBA> ~~~~~~~~~","~~~~ <>((\xBA> ~~~~~~~~","~~~~~ ><((\xBA> ~~~~~~~","~~~~~~ <>((\xBA> ~~~~~~","~~~~~~~ ><((\xBA> ~~~~~","~~~~~~~~ <>((\xBA> ~~~~","~~~~~~~~~ ><((\xBA> ~~~","~~~~~~~~~~ <>((\xBA> ~~","~~~~~~~~~~~ ><((\xBA> ~","~~~~~~~~~~~~ <>((\xBA> ","~~~~~~~~~~~~~ ><((\xBA>","~~~~~~~~~~~~~~ <>((\xBA","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}});var S2,VN;var JH=A(()=>{qH();S2=V6,VN=Object.keys(V6)});import GM from"tty";var KM,a=(Q,$)=>{if(!KM)return(J)=>J;let Y=`\x1B[${Q}m`,q=`\x1B[${$}m`;return(J)=>{let X=J+"",H=X.indexOf(q);if(H===-1)return Y+X+q;let G=Y,K=0,z=($===22?q:"")+Y;while(H!==-1)G+=X.slice(K,H)+z,K=H+q.length,H=X.indexOf(q,K);return G+=X.slice(K)+q,G}},FN,jN,wN,DN,ON,IN,NN,TN,bN,RN,XH,HH,GH,KH,SN,EN,kN,vN,PN,xN,CN,yN,hN,fN,uN,mN,gN,cN,dN,pN,lN,iN,nN,oN,sN,rN,aN,tN,eN,QT,$T;var A6=A(()=>{KM=GM?.WriteStream?.prototype?.hasColors?.()??!1,FN=a(0,0),jN=a(1,22),wN=a(2,22),DN=a(3,23),ON=a(4,24),IN=a(53,55),NN=a(7,27),TN=a(8,28),bN=a(9,29),RN=a(30,39),XH=a(31,39),HH=a(32,39),GH=a(33,39),KH=a(34,39),SN=a(35,39),EN=a(36,39),kN=a(37,39),vN=a(90,39),PN=a(40,49),xN=a(41,49),CN=a(42,49),yN=a(43,49),hN=a(44,49),fN=a(45,49),uN=a(46,49),mN=a(47,49),gN=a(100,49),cN=a(91,39),dN=a(92,39),pN=a(93,39),lN=a(94,39),iN=a(95,39),nN=a(96,39),oN=a(97,39),sN=a(101,49),rN=a(102,49),aN=a(103,49),tN=a(104,49),eN=a(105,49),QT=a(106,49),$T=a(107,49)});var WH=A(()=>{A6();A6()});import zH from"process";function E2(){let{env:Q}=zH,{TERM:$,TERM_PROGRAM:Y}=Q;if(zH.platform!=="win32")return $!=="linux";return Boolean(Q.WT_SESSION)||Boolean(Q.TERMINUS_SUBLIME)||Q.ConEmuTask==="{cmd::Cmder}"||Y==="Terminus-Sublime"||Y==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||Q.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var L6=()=>{};var q9={};Y8(q9,{warning:()=>_M,success:()=>BM,info:()=>zM,error:()=>ZM});var c3,zM,BM,_M,ZM;var BH=A(()=>{WH();L6();c3=E2(),zM=KH(c3?"\u2139":"i"),BM=HH(c3?"\u2714":"\u221A"),_M=GH(c3?"\u26A0":"\u203C"),ZM=XH(c3?"\u2716":"\xD7")});var _H=A(()=>{BH()});function F6({onlyFirst:Q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",Q?void 0:"g")}function j6(Q){if(typeof Q!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof Q}\``);return Q.replace(MM,"")}var MM;var ZH=A(()=>{MM=F6()});var d3,p3,w6,D6,k2;var MH=A(()=>{d3=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],p3=[12288,12288,65281,65376,65504,65510],w6=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],D6=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],k2=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var l3=(Q,$)=>{let Y=0,q=Math.floor(Q.length/2)-1;while(Y<=q){let J=Math.floor((Y+q)/2),X=J*2;if($<Q[X])q=J-1;else if($>Q[X+1])Y=J+1;else return!0}return!1};function OM(Q){let $=Q[0],Y=Q[1];for(let q=0;q<Q.length;q+=2){let J=Q[q],X=Q[q+1];if(UH>=J&&UH<=X)return[J,X];if(X-J>Y-$)$=J,Y=X}return[$,Y]}var UM,VM,AM,LM,VT,AT,LT,FT,FM,jM,UH=19968,wM,DM,VH=(Q)=>{if(Q<UM||Q>VM)return!1;return l3(d3,Q)},AH=(Q)=>{if(Q<AM||Q>LM)return!1;return l3(p3,Q)},LH=(Q)=>{if(Q>=wM&&Q<=DM)return!0;if(Q<FM||Q>jM)return!1;return l3(k2,Q)};var FH=A(()=>{MH();UM=d3[0],VM=d3.at(-1),AM=p3[0],LM=p3.at(-1),VT=w6[0],AT=w6.at(-1),LT=D6[0],FT=D6.at(-1),FM=k2[0],jM=k2.at(-1),[wM,DM]=OM(k2)});function IM(Q){if(!Number.isSafeInteger(Q))throw TypeError(`Expected a code point, got \`${typeof Q}\`.`)}function O6(Q,{ambiguousAsWide:$=!1}={}){if(IM(Q),AH(Q)||LH(Q)||$&&VH(Q))return 2;return 1}var jH=A(()=>{FH()});function kM(Q){if(Q.length>50)return!1;if(SM.test(Q))return!0;if(Q.includes("\u200D")){let $=Q.match(EM);return $!==null&&$.length>=2}return!1}function vM(Q){return Q.replace(bM,"")}function PM(Q){return TM.test(Q)}function xM(Q,$){let Y=0;if(Q.length>1){for(let q of Q.slice(1))if(q>="\uFF00"&&q<="\uFFEF")Y+=O6(q.codePointAt(0),$)}return Y}function I6(Q,$={}){if(typeof Q!=="string"||Q.length===0)return 0;let{ambiguousIsNarrow:Y=!0,countAnsiEscapeCodes:q=!1}=$,J=Q;if(!q&&(J.includes("\x1B")||J.includes("\x9B")))J=j6(J);if(J.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(J))return J.length;let X=0,H={ambiguousAsWide:!Y};for(let{segment:G}of NM.segment(J)){if(PM(G))continue;if(RM.test(G)||kM(G)){X+=2;continue}let K=vM(G).codePointAt(0);X+=O6(K,H),X+=xM(G,H)}return X}var NM,TM,bM,RM,SM,EM;var wH=A(()=>{ZH();jH();NM=new Intl.Segmenter,TM=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,bM=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,RM=/^\p{RGI_Emoji}$/v,SM=/^[\d#*]\u20E3$/,EM=/\p{Extended_Pictographic}/gu});function N6({stream:Q=process.stdout}={}){return Boolean(Q&&Q.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import m9 from"process";class DH{#X=0;#q;#Y=!1;#Q=!1;#J=(Q)=>{if(!Q?.length)return;if((typeof Q==="string"?Q.codePointAt(0):Q[0])===CM)if(m9.listenerCount("SIGINT")>0)m9.emit("SIGINT");else m9.kill(m9.pid,"SIGINT")};start(){if(this.#X++,this.#X===1)this.#$()}stop(){if(this.#X===0)return;if(--this.#X===0)this.#H()}#$(){let{stdin:Q}=m9;if(m9.platform==="win32"||!Q?.isTTY||typeof Q.setRawMode!=="function"){this.#q=void 0;return}if(this.#q=Q,this.#Y=Q.isPaused(),this.#Q=Boolean(Q.isRaw),Q.setRawMode(!0),Q.prependListener("data",this.#J),this.#Y)Q.resume()}#H(){if(!this.#q)return;let Q=this.#q;if(Q.off("data",this.#J),Q.isTTY)Q.setRawMode?.(this.#Q);if(this.#Y)Q.pause();this.#q=void 0,this.#Y=!1,this.#Q=!1}}var CM=3,yM,T6;var OH=A(()=>{yM=new DH,T6=Object.freeze(yM)});import v2 from"process";import{stripVTControlCharacters as hM}from"util";class IH{#X=0;#q=-1;#Y=0;#Q;#J;#$;#H;#K=new Map;#B=!1;#W;#G;#_=!1;color;#z(Q){this.#B=!0;try{return Q()}finally{this.#B=!1}}#M(){if(this.isSpinning)this.render()}#j(Q,$){if(Q===void 0||Q===null)return"";if(typeof Q==="string")return Q;if(Buffer.isBuffer(Q)||ArrayBuffer.isView(Q)){let Y=typeof $==="string"&&$&&$!=="buffer"?$:"utf8";return Buffer.from(Q).toString(Y)}return String(Q)}#w(Q){if(!Q)return!1;let $=Q.at(-1);return $===`
131
+ `||$==="\r"}#D(){if(this.#G)return;if(this.#G=setTimeout(()=>{if(this.#G=void 0,this.isSpinning)this.#M()},fM),typeof this.#G?.unref==="function")this.#G.unref()}#U(){if(this.#G)clearTimeout(this.#G),this.#G=void 0}#V(Q,$,Y,q){let J=this.#L(Y," "),H=typeof $==="string"?(Q?" ":"")+$:"",G=this.#F(q," ");return J+Q+H+G}constructor(Q){if(typeof Q==="string")Q={text:Q};if(this.#Q={color:"cyan",stream:v2.stderr,discardStdin:!0,hideCursor:!0,...Q},this.color=this.#Q.color,this.#$=this.#Q.stream,typeof this.#Q.isEnabled!=="boolean")this.#Q.isEnabled=N6({stream:this.#$});if(typeof this.#Q.isSilent!=="boolean")this.#Q.isSilent=!1;let $=this.#Q.interval;if(this.spinner=this.#Q.spinner,this.#Q.interval=$,this.text=this.#Q.text,this.prefixText=this.#Q.prefixText,this.suffixText=this.#Q.suffixText,this.indent=this.#Q.indent,v2.env.NODE_ENV==="test")this._stream=this.#$,this._isEnabled=this.#Q.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#X},set(Y){this.#X=Y}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#q}}),Object.defineProperty(this,"_lineCount",{get(){let Y=this.#$.columns??80,q=typeof this.#Q.prefixText==="function"?"":this.#Q.prefixText,J=typeof this.#Q.suffixText==="function"?"":this.#Q.suffixText,X=typeof q==="string"&&q!==""?q+" ":"",H=typeof J==="string"&&J!==""?" "+J:"",G="-",K=" ".repeat(this.#Q.indent)+X+"-"+(typeof this.#Q.text==="string"?" "+this.#Q.text:"")+H;return this.#Z(K,Y)}})}get indent(){return this.#Q.indent}set indent(Q=0){if(!(Q>=0&&Number.isInteger(Q)))throw Error("The `indent` option must be an integer from 0 and up");this.#Q.indent=Q}get interval(){return this.#Q.interval??this.#J.interval??100}get spinner(){return this.#J}set spinner(Q){if(this.#q=-1,this.#Q.interval=void 0,typeof Q==="object"){if(!Array.isArray(Q.frames)||Q.frames.length===0||Q.frames.some(($)=>typeof $!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if(Q.interval!==void 0&&!(Number.isInteger(Q.interval)&&Q.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#J=Q}else if(!E2())this.#J=S2.line;else if(Q===void 0)this.#J=S2.dots;else if(Q!=="default"&&S2[Q])this.#J=S2[Q];else throw Error(`There is no built-in spinner named '${Q}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#Q.text}set text(Q=""){this.#Q.text=Q}get prefixText(){return this.#Q.prefixText}set prefixText(Q=""){this.#Q.prefixText=Q}get suffixText(){return this.#Q.suffixText}set suffixText(Q=""){this.#Q.suffixText=Q}get isSpinning(){return this.#H!==void 0}#A(Q,$,Y=!1){let q=typeof Q==="function"?Q():Q;if(typeof q==="string"&&q!=="")return Y?$+q:q+$;return""}#L(Q=this.#Q.prefixText,$=" "){return this.#A(Q,$,!1)}#F(Q=this.#Q.suffixText,$=" "){return this.#A(Q,$,!0)}#Z(Q,$){let Y=0;for(let q of hM(Q).split(`
132
+ `))Y+=Math.max(1,Math.ceil(I6(q)/$));return Y}get isEnabled(){return this.#Q.isEnabled&&!this.#Q.isSilent}set isEnabled(Q){if(typeof Q!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#Q.isEnabled=Q}get isSilent(){return this.#Q.isSilent}set isSilent(Q){if(typeof Q!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#Q.isSilent=Q}frame(){let Q=Date.now();if(this.#q===-1||Q-this.#Y>=this.interval)this.#q=(this.#q+1)%this.#J.frames.length,this.#Y=Q;let{frames:$}=this.#J,Y=$[this.#q];if(this.color)Y=mX[this.color](Y);let q=this.#L(this.#Q.prefixText," "),J=typeof this.text==="string"?" "+this.text:"",X=this.#F(this.#Q.suffixText," ");return q+Y+J+X}clear(){if(!this.isEnabled||!this.#$.isTTY)return this;return this.#z(()=>{this.#$.cursorTo(0);for(let Q=0;Q<this.#X;Q++){if(Q>0)this.#$.moveCursor(0,-1);this.#$.clearLine(1)}if(this.#Q.indent)this.#$.cursorTo(this.#Q.indent)}),this.#X=0,this}#O(Q){if(!Q||this.#K.has(Q)||!Q.isTTY||typeof Q.write!=="function")return;if(i3.has(Q))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let $=Q.write;this.#K.set(Q,$),i3.set(Q,this),Q.write=(Y,q,J)=>this.#T(Q,$,Y,q,J)}#I(){if(!this.isEnabled||this.#K.size>0)return;let Q=new Set([this.#$,v2.stdout,v2.stderr]);for(let $ of Q)this.#O($)}#N(){for(let[Q,$]of this.#K)if(Q.write=$,i3.get(Q)===this)i3.delete(Q);this.#K.clear()}#T(Q,$,Y,q,J){if(typeof q==="function")J=q,q=void 0;if(this.#B)return $.call(Q,Y,q,J);this.clear();let X=this.#j(Y,q),H=this.#w(X),G=$.call(Q,Y,q,J);if(H)this.#U();else if(X.length>0)this.#D();if(this.isSpinning&&!this.#G)this.render();return G}render(){if(!this.isEnabled||this.#W||this.#G)return this;let Q=this.#$.isTTY,$=!1;try{if(Q)this.#z(()=>this.#$.write(uM)),$=!0;this.clear();let Y=this.frame(),q=this.#$.columns??80,J=this.#Z(Y,q),X=this.#$.rows;if(X&&X>1&&J>X){let G=Y.split(`
133
+ `),K=X-1;Y=[...G.slice(0,K),"... (content truncated to fit terminal)"].join(`
134
+ `)}if(this.#z(()=>this.#$.write(Y))===!1&&this.#$.isTTY)this.#W=()=>{this.#W=void 0,this.#M()},this.#$.once("drain",this.#W);this.#X=this.#Z(Y,q)}finally{if($)this.#z(()=>this.#$.write(mM))}return this}start(Q){if(Q)this.text=Q;if(this.isSilent)return this;if(!this.isEnabled){let $=this.text?"-":"",Y=" ".repeat(this.#Q.indent)+this.#V($,this.text,this.#Q.prefixText,this.#Q.suffixText);if(Y.trim()!=="")this.#z(()=>this.#$.write(Y+`
135
+ `));return this}if(this.isSpinning)return this;if(this.#Q.hideCursor)U6.hide(this.#$);if(this.#Q.discardStdin&&v2.stdin.isTTY)T6.start(),this.#_=!0;return this.#I(),this.render(),this.#H=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#H),this.#H=void 0,this.#q=-1,this.#Y=0,this.#U(),this.#N(),this.#W)this.#$.removeListener("drain",this.#W),this.#W=void 0;if(this.isEnabled){if(this.clear(),this.#Q.hideCursor)U6.show(this.#$)}if(this.#_)this.#_=!1,T6.stop();return this}succeed(Q){return this.stopAndPersist({symbol:q9.success,text:Q})}fail(Q){return this.stopAndPersist({symbol:q9.error,text:Q})}warn(Q){return this.stopAndPersist({symbol:q9.warning,text:Q})}info(Q){return this.stopAndPersist({symbol:q9.info,text:Q})}stopAndPersist(Q={}){if(this.isSilent)return this;let $=Q.symbol??" ",Y=Q.text??this.text,q=Q.prefixText??this.#Q.prefixText,J=Q.suffixText??this.#Q.suffixText,X=this.#V($,Y,q,J)+`
136
+ `;return this.stop(),this.#z(()=>this.#$.write(X)),this}}function b6(Q){return new IH(Q)}var fM=200,uM="\x1B[?2026h",mM="\x1B[?2026l",i3;var NH=A(()=>{gX();YH();JH();_H();wH();L6();OH();i3=new Map});function Z1(Q){let $=t8&&!Q.quiet;return b6({text:Q.text,isSilent:!$})}var l0=A(()=>{NH();N2()});function TH(Q){let[$=""]=Q.split("-"),Y=$.split("."),q=parseInt(Y[0]??"",10),J=parseInt(Y[1]??"",10),X=parseInt(Y[2]??"",10);if(Number.isNaN(q)||Number.isNaN(J)||Number.isNaN(X))return null;return{major:q,minor:J,patch:X}}function gM(Q,$){let Y=TH(Q),q=TH($);if(!Y||!q)return null;if(Y.major!==q.major)return Y.major-q.major;if(Y.minor!==q.minor)return Y.minor-q.minor;return Y.patch-q.patch}function bH(Q,$,Y){if(!Q)return{compatible:!0};let q=gM($,Q);if(q===null)return{compatible:!0};if(q>=0)return{compatible:!0};return{compatible:!1,required:Q,installed:$,type:Y}}function cM(Q,$){let Y=$.type==="opencode"?"OpenCode":"OCX CLI",q=$.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
137
+ ${P.yellow().bold("\u26A0 WARN")} ${P.yellow("Version compatibility notice")}
138
+
139
+ Registry ${P.cyan(`"${Q}"`)} requires ${Y} ${P.green($.required)}
140
+ You are running ${Y} ${P.red($.installed)}
142
141
 
143
142
  This may work fine, but if you encounter issues,
144
- consider updating: ${g.dim(Q)}
143
+ consider updating: ${P.dim(q)}
145
144
 
146
- To silence: ${g.dim("--skip-compat-check")} or set ${g.dim('"skipCompatCheck": true')} in ocx.jsonc
147
- `}function GK($){let{registry:_,ocxVersion:U,opencodeVersion:Q}=$,v=[],J=qK(_.ocx,U,"ocx");if(!J.compatible)v.push(J);if(Q){let Y=qK(_.opencode,Q,"opencode");if(!Y.compatible)v.push(Y)}return v}function jK($,_){for(let U of _)W.log(Mw($,U))}var KK=b(()=>{k6();i$()});import{randomUUID as HK}from"crypto";import{existsSync as h4}from"fs";import{lstat as ww,mkdir as BY,rename as WY,rm as u0,stat as ZK,writeFile as Lw}from"fs/promises";import{dirname as A8,isAbsolute as kw,join as G4,relative as Aw,resolve as WK}from"path";function Fw($,_){if(!$?.installed)return null;for(let[U,Q]of Object.entries($.installed))if(Q.files?.some((v)=>v.path===_))return U;return null}function bK($){let _=$.split("::")[1];if(!_)return $;return _.split("@")[0]||$}function Ow($){if(!$?.trim())throw new M("Component name cannot be empty");let _=$.trim();if(Yj(_)){let U=Jj(_);return{type:"npm",name:U.name,version:U.version}}if(_.includes("/")){let{namespace:U,component:Q}=r4(_);return{type:"registry",namespace:U,component:Q}}return{type:"registry",namespace:"",component:_}}function VK($){let _=$.command("add").description(`Add components or npm plugins to your project.
145
+ To silence: ${P.dim("--skip-compat-check")} or set ${P.dim('"skipCompatCheck": true')} in ocx.jsonc
146
+ `}function RH(Q){let{registry:$,ocxVersion:Y,opencodeVersion:q}=Q,J=[],X=bH($.ocx,Y,"ocx");if(!X.compatible)J.push(X);if(q){let H=bH($.opencode,q,"opencode");if(!H.compatible)J.push(H)}return J}function SH(Q,$){for(let Y of $)_.log(cM(Q,Y))}var EH=A(()=>{U8();c1()});import{randomUUID as kH}from"crypto";import{existsSync as v0}from"fs";import{lstat as dM,mkdir as E6,rename as R6,rm as g9,stat as CH,writeFile as pM}from"fs/promises";import{dirname as n3,isAbsolute as lM,join as X0,relative as iM,resolve as vH}from"path";function nM(Q,$){if(!Q?.installed)return null;for(let[Y,q]of Object.entries(Q.installed))if(q.files?.some((J)=>J.path===$))return Y;return null}function PH(Q){let $=Q.split("::")[1];if(!$)return Q;return $.split("@")[0]||Q}function oM(Q){if(!Q?.trim())throw new L("Component name cannot be empty");let $=Q.trim();if(OX($)){let Y=DX($);return{type:"npm",name:Y.name,version:Y.version}}if($.includes("/")){let{namespace:Y,component:q}=m0($);return{type:"registry",namespace:Y,component:q}}return{type:"registry",namespace:"",component:$}}function yH(Q){let $=Q.command("add").description(`Add components or npm plugins to your project.
148
147
 
149
148
  Registry components: ocx add alias/component
150
- npm plugins: ocx add npm:package-name[@version]`).argument("<components...>","Components to install (alias/component or npm:package[@version])").option("--dry-run","Show what would be installed without making changes").option("--skip-compat-check","Skip version compatibility checks").option("--trust","Skip npm plugin validation (for packages that don't follow conventions)").option("-p, --profile <name>","Use specific profile").option("--from <url>","Use ephemeral registry (does not persist)");Q4(_),m4(_),G6(_),_.action(async(U,Q)=>{try{let v=Q.json?{...Q,quiet:!0,verbose:!1}:Q,J;if(v.profile){let Y=await q6.create(v.cwd??process.cwd(),{profile:v.profile});J={cwd:p$(v.profile),getRegistries:()=>Y.getRegistries(),getComponentPath:()=>Y.getComponentPath()}}else if(v.global)J=await L0.requireInitialized();else J=await y4.requireInitialized(v.cwd??process.cwd());await ZY(U,v,J)}catch(v){_$(v,{json:Q.json})}})}async function ZY($,_,U){let Q=U.cwd,v=$.map(Ow),J=v.filter((G)=>G.type==="npm"),Y=v.filter((G)=>G.type==="registry"),z=Boolean(_.json&&J.length>0&&Y.length>0),I=z?{..._,json:!1,quiet:!0,verbose:!1}:_,X,q;if(J.length>0)X=await Nw(J,I,Q,!z);if(Y.length>0){let G=Y.map((j)=>j.namespace?`${j.namespace}/${j.component}`:j.component);q=await Sw(G,I,U,!z)}if(z)O$({success:!0,plugins:X?.plugins??[],installed:q?.installed??[],opencode:q?.opencode??!1,dryRun:Boolean(X?.dryRun||q?.dryRun)})}async function Nw($,_,U,Q=!0){let v=_.quiet?null:V$({text:"Validating npm packages..."});v?.start();try{let J=[];for(let H of $)if(await pJ(H.name),!_.trust)try{let Z=await q8(H.name,H.version),V=zj(Z);J.push(...V.warnings)}catch(Z){if(Z instanceof M)throw v?.fail("Plugin validation failed"),new M(`${Z.message}
149
+ npm plugins: ocx add npm:package-name[@version]`).argument("<components...>","Components to install (alias/component or npm:package[@version])").option("--dry-run","Show what would be installed without making changes").option("--skip-compat-check","Skip version compatibility checks").option("--trust","Skip npm plugin validation (for packages that don't follow conventions)").option("-p, --profile <name>","Use specific profile").option("--from <url>","Use ephemeral registry (does not persist)");Q0($),E0($),Q8($),$.action(async(Y,q)=>{try{let J=q.json?{...q,quiet:!0,verbose:!1}:q,X;if(J.profile){let H=await e0.create(J.cwd??process.cwd(),{profile:J.profile});X={cwd:h1(J.profile),getRegistries:()=>H.getRegistries(),getComponentPath:()=>H.getComponentPath()}}else if(J.global)X=await S9.requireInitialized();else X=await b0.requireInitialized(J.cwd??process.cwd());await k6(Y,J,X)}catch(J){s(J,{json:q.json})}})}async function k6(Q,$,Y){let q=Y.cwd,J=Q.map(oM),X=J.filter((B)=>B.type==="npm"),H=J.filter((B)=>B.type==="registry"),G=Boolean($.json&&X.length>0&&H.length>0),K=G?{...$,json:!1,quiet:!0,verbose:!1}:$,W,z;if(X.length>0)W=await sM(X,K,q,!G);if(H.length>0){let B=H.map((Z)=>Z.namespace?`${Z.namespace}/${Z.component}`:Z.component);z=await rM(B,K,Y,!G)}if(G)F1({success:!0,plugins:W?.plugins??[],installed:z?.installed??[],opencode:z?.opencode??!1,dryRun:Boolean(W?.dryRun||z?.dryRun)})}async function sM(Q,$,Y,q=!0){let J=$.quiet?null:Z1({text:"Validating npm packages..."});J?.start();try{let X=[];for(let M of Q)if(await J6(M.name),!$.trust)try{let V=await v3(M.name,M.version),U=IX(V);X.push(...U.warnings)}catch(V){if(V instanceof L)throw J?.fail("Plugin validation failed"),new L(`${V.message}
151
150
  hint OpenCode plugins must be ESM modules with an entry point
152
- hint Use \`--trust\` to add anyway`);throw Z}if(v?.succeed(`Validated ${$.length} npm package(s)`),J.length>0&&!_.quiet){W.info("");for(let H of J)W.warn(H)}let z=(await mJ(U))?.config.plugin??[],I=new Map;for(let H of z){let Z=Ij(H);I.set(Z,H)}let X=[],q=[];for(let H of $)if(I.get(H.name))q.push(H.name);else X.push(S0(H.name,H.version));if(q.length>0)throw new t$(`Plugin(s) already exist in opencode.json: ${q.join(", ")}.
153
- Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let G=[...I.values(),...X];if(_.dryRun){let Z={dryRun:!0,command:"add",wouldPerform:$.map((V)=>({action:"add",target:S0(V.name,V.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${$.length} npm plugin(s)`};if(Q||!_.json)S4(Z,{json:_.json,quiet:_.quiet});return{plugins:$.map((V)=>S0(V.name,V.version)),dryRun:!0}}if(await gJ(U,{plugin:G}),!_.quiet){W.info(""),W.success(`Added ${$.length} npm plugin(s) to opencode.json`);for(let H of $)W.info(` \u2713 ${S0(H.name,H.version)}`)}let j=$.map((H)=>S0(H.name,H.version));if(_.json&&Q)O$({success:!0,plugins:j});return{plugins:j,dryRun:!1}}catch(J){throw v?.fail("Failed to add npm plugins"),J}}async function Sw($,_,U,Q=!0){let v=Boolean(_.quiet||_.json),J=U.cwd,Y=!!(_.global||_.profile),z=U.getRegistries(),I=z;if(_.from){let Z=_.from.trim();if(!Z)throw new M("--from URL cannot be empty");try{new URL(Z)}catch{throw new M(`Invalid --from URL: ${Z}`)}let V=new Set;for(let T of $){let{namespace:r}=r4(T);V.add(r)}if(V.size>1){let T=Array.from(V).join(", ");throw new M(`Mixed registry prefixes in --from call: ${T}.
154
- When using --from, all components must use the same prefix.`)}let S=Array.from(V)[0];if(!S)throw new M("No valid component references provided");await n6(Z),I={...z,[S]:{url:Z}}}let X={version:1,root:J,installed:{}},q=await F4(J);if(q)X=q;let G=v?null:V$({text:"Resolving dependencies..."});G?.start();let j=null,H=null;try{let Z=new Set;for(let x of $){let{namespace:t}=r4(x);Z.add(t)}for(let x of Z){let t=I[x];if(t)await n6(t.url)}let V=await yG(I,$);if(_.verbose){W.info("Install order:");for(let x of V.installOrder)W.info(` - ${x}`)}let S=new Map,T=new Map;for(let x of V.components)if(!T.has(x.registryName))T.set(x.registryName,x.baseUrl);for(let[x,t]of T){let C=await n6(t);S.set(x,C)}if(G?.succeed(`Resolved ${V.components.length} components from ${S.size} registries`),!_.skipCompatCheck&&!v)for(let[x,t]of S){let C=GK({registry:{opencode:t.opencode,ocx:t.ocx},ocxVersion:Jq});jK(x,C)}if(_.dryRun){let x=V.components.map((C)=>({action:"add",target:`${C.registryName}/${C.name}`,details:{type:C.type}}));if(V.npmDependencies.length>0||V.npmDevDependencies.length>0){let C=_.global||_.profile?J:G4(J,".opencode"),I$=[...V.npmDependencies,...V.npmDevDependencies].map(($$)=>{let R$=$$.lastIndexOf("@"),X$=R$>0?$$.slice(0,R$):$$,j4=R$>0?$$.slice(R$+1):"*";return{name:X$,from:null,to:j4}});x.push(iG(C,I$))}let t={dryRun:!0,command:"add",wouldPerform:x,validation:{passed:!0},summary:`Would add ${V.components.length} component(s)`};if(Q||!_.json)S4(t,{json:_.json,quiet:_.quiet});return{installed:V.installOrder,opencode:Boolean(V.opencode),dryRun:!0}}let A=v?null:V$({text:"Fetching components..."});A?.start();let u=[];for(let x of V.components){let t=[];for(let $$ of x.files){let R$=await V1(x.baseUrl,x.name,$$.path);t.push({path:$$.path,content:Buffer.from(R$)})}let C=await j8(t);for(let $$ of x.files){let R$=K1($$.target,Y,J),X$=G4(J,R$);try{A4(J,R$)}catch(j4){if(j4 instanceof U4)throw new M(`Invalid path "${X$}": ${j4.message}`);throw j4}}let h=Object.entries(X.installed).filter(([$$,R$])=>d$(R$.registryUrl)===d$(x.baseUrl)&&R$.registryName===x.registryName&&R$.name===x.name);if(h.length>0){let $$=h[0];if($$){let[R$,X$]=$$;if(X$.hash!==C)throw A?.fail("Integrity check failed"),new I1(R$,X$.hash,C)}}let I$=C_(x.baseUrl,x.registryName,x.name,`sha256:${C}`);u.push({component:x,files:t,computedHash:C,canonicalId:I$})}A?.succeed(`Fetched ${V.components.length} components`);let k=new Map;for(let{component:x,files:t}of u)for(let C of t){let h=x.files.find((R$)=>R$.path===C.path);if(!h)continue;let I$=K1(h.target,Y,J),$$=G4(J,I$);L1(k,{absolutePath:$$,relativePath:I$,content:C.content,source:`${x.registryName}/${x.name}:${h.path}`})}let O=[];for(let x of k.values()){if(!h4(x.absolutePath))continue;let t=await Bun.file(x.absolutePath).text(),C=x.content.toString("utf-8");if(!cJ(t,C)){let h=Fw(X,x.relativePath);O.push({path:x.relativePath,owningComponent:h})}}if(O.length>0){let x=O.filter((h)=>h.owningComponent!==null),t=O.filter((h)=>h.owningComponent===null);if(!v){if(W.error(""),W.error("File conflicts detected:"),x.length>0){W.error(""),W.error("Files from installed components (use 'ocx update' or 'ocx remove'):");for(let h of x)if(h.owningComponent){let I$=bK(h.owningComponent);W.error(` \u2717 ${h.path} (from ${I$})`)}}if(t.length>0){W.error(""),W.error("Files not managed by OCX (resolve manually):");for(let h of t)W.error(` \u2717 ${h.path}`)}W.error("")}let C=`${O.length} file(s) have conflicts.
155
- `;if(x.length>0){let h=new Set(x.filter((I$)=>I$.owningComponent!==null).map((I$)=>bK(I$.owningComponent)));C+=`For OCX-managed files, use 'ocx update ${Array.from(h).join(" ")}' or 'ocx remove ${Array.from(h).join(" ")}'.
156
- `}if(t.length>0)C+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new t$(C.trim())}let w=v?null:V$({text:"Installing components..."});w?.start(),H=await xw({cwd:J,isFlattened:Y,trackOpencodeConfig:Boolean(V.opencode&&Object.keys(V.opencode).length>0),trackNpmManifests:V.npmDependencies.length>0||V.npmDevDependencies.length>0,quiet:_.quiet});let v$=uw({quiet:_.quiet});j=v$;for(let{component:x,files:t,computedHash:C,canonicalId:h}of u){let I$=await yw(x,t,J,Y,v$,{verbose:_.verbose});if(_.verbose){for(let X$ of I$.skipped)W.info(` \u25CB Skipped ${X$} (unchanged)`);for(let X$ of I$.overwritten)W.info(` \u2713 Overwrote ${X$}`);for(let X$ of I$.written)W.info(` \u2713 Wrote ${X$}`)}if(!S.get(x.registryName))throw new M(`Registry index not found for "${x.registryName}". This is an internal error - please report it at https://github.com/${Qq}/issues`);let R$=[];for(let X$ of t){let j4=x.files.find((E1)=>E1.path===X$.path);if(!j4)throw Error(`File ${X$.path} not found in component manifest`);let n8=K1(j4.target,Y,J);R$.push({path:n8,hash:k1(X$.content)})}X.installed[h]={registryUrl:x.baseUrl,registryName:x.registryName,name:x.name,revision:`sha256:${C}`,hash:C,files:R$,installedAt:new Date().toISOString(),...x.opencode&&{opencode:x.opencode}}}if(w?.succeed(`Installed ${V.components.length} components`),V.opencode&&Object.keys(V.opencode).length>0){let x=await gJ(J,V.opencode);if(!_.quiet&&x.changed)if(x.created)W.info(`Created ${x.path}`);else W.info(`Updated ${x.path}`)}let o=V.npmDependencies.length>0,Q$=V.npmDevDependencies.length>0,D$=_.global||_.profile?G4(J,"package.json"):G4(J,".opencode/package.json");if(o||Q$){let x=v?null:V$({text:`Updating ${D$}...`});x?.start();try{let t=!!(_.global||_.profile),C=await cw(J,V.npmDependencies,V.npmDevDependencies,{isFlattened:t}),h=V.npmDependencies.length+V.npmDevDependencies.length;if(x?.succeed(`Added ${h} dependencies to ${D$}`),C.changed){let I$=await nG(C.packageDir);if(I$.success&&I$.action!=="none"){if(!v)W.info(`Invalidated ${G4(C.packageDir,"node_modules")} to force reinstall`)}else if(!I$.success){let $$=G4(C.packageDir,"node_modules");W.warn(`Could not invalidate ${$$}: ${I$.error?.message??"unknown error"}. Run \`rm -rf "${$$}"\` manually to force reinstall.`)}}}catch(t){throw x?.fail(`Failed to update ${D$}`),t}}if(await x4(J,X),!j)throw Error("Internal error: missing add write transaction after install phase.");if(await j.commit(),j=null,H?.commit(),H=null,_.json&&Q)O$({success:!0,installed:V.installOrder,opencode:!!V.opencode});else if(!_.quiet)W.info(""),W.success(`Done! Installed ${V.components.length} components.`);return{installed:V.installOrder,opencode:!!V.opencode,dryRun:!1}}catch(Z){if(j)await j.rollback(),j=null;if(H)await H.rollback(),H=null;if(G&&!G.isSpinning);else G?.fail("Failed to add components");throw Z}}function bY($,_,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${_}" (${Q})`}function Tw($,_){let U=Aw(_,$);return U!==""&&!U.startsWith("..")&&!kw(U)}async function Rw($,_){let U=WK($),Q=WK(_);while(Tw(U,Q)){let v=!0;try{if(!(await ww(U)).isDirectory())break}catch(Y){if(Y.code==="ENOENT")v=!1;else throw Y}try{if(v)await u0(U,{recursive:!1})}catch(Y){let z=Y.code;if(z==="ENOENT");else if(z==="ENOTEMPTY"||z==="EEXIST"||z==="EBUSY")break;else if(z==="ENOTDIR")break;else throw Y}let J=A8(U);if(J===U)break;U=J}}async function Ew($){let _;try{_=await ZK($)}catch(U){let Q=U.code;if(Q==="ENOENT"||Q==="ENOTDIR")return{path:$,state:"missing",content:""};throw U}if(!_.isFile())return{path:$,state:"non-file",content:""};return{path:$,state:"file",content:await Bun.file($).text()}}async function Pw($,_){if($.state==="file"){await BY(A8($.path),{recursive:!0}),await Bun.write($.path,$.content);return}if($.state==="non-file")return;if(h4($.path))await u0($.path,{force:!0,recursive:!0});await Rw(A8($.path),_)}async function xw($){let _=[],U=new Set,Q=!1,v=async(z)=>{if(U.has(z))return;U.add(z),_.push(await Ew(z))};if($.trackOpencodeConfig){let z=X8($.cwd).path;await v(z)}if($.trackNpmManifests){let z=$.isFlattened?$.cwd:G4($.cwd,".opencode");if(await v(G4(z,"package.json")),!$.isFlattened)await v(G4(z,".gitignore"))}return await v(l6($.cwd).path),{rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of[..._].reverse())try{await Pw(I,$.cwd)}catch(X){z.push(bY("Add rollback cleanup warning: failed to restore",I.path,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:()=>{Q=!0}}}function uw($){let _=[],U=new Set,Q=!1;return{writeFileAtomically:async({targetPath:z,resolvedTarget:I,content:X})=>{let q=A8(z);if(!h4(q))await BY(q,{recursive:!0});if(h4(z)){if((await ZK(z)).isDirectory())throw new M(`Cannot install "${I}": target path is a directory.`)}let G=`${z}.ocx-add-tmp-${HK()}`;await Lw(G,X),U.add(G);let j=null;if(h4(z))j=`${z}.ocx-add-backup-${HK()}`,await WY(z,j),_.push({targetPath:z,backupPath:j});if(await WY(G,z),U.delete(G),!j)_.push({targetPath:z,backupPath:null})},rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of U)try{await u0(I,{force:!0})}catch(X){z.push(bY("Add rollback cleanup warning: failed to remove temp file",I,X))}for(let I of[..._].reverse())try{if(I.backupPath){if(h4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0});if(h4(I.backupPath))await WY(I.backupPath,I.targetPath)}else if(h4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0})}catch(X){z.push(bY("Add rollback cleanup warning: failed to restore target",I.targetPath,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:async()=>{if(Q)return;Q=!0;for(let z of _){if(!z.backupPath||!h4(z.backupPath))continue;try{await u0(z.backupPath,{force:!0})}catch(I){if(!$.quiet){let X=I instanceof Error?I.message:String(I);W.warn(`Post-add cleanup warning: failed to remove backup "${z.backupPath}" (${X})`)}}}}}}async function yw($,_,U,Q,v,J){let Y={written:[],skipped:[],overwritten:[]};for(let z of _){let I=$.files.find((G)=>G.path===z.path);if(!I)continue;let X=K1(I.target,Q,U),q=G4(U,X);if(h4(q)){let G=await Bun.file(q).text(),j=z.content.toString("utf-8");if(cJ(G,j)){Y.skipped.push(X);continue}Y.overwritten.push(X)}else Y.written.push(X);await v.writeFileAtomically({targetPath:q,resolvedTarget:X,content:z.content})}return Y}function BK($){if(!$?.trim())throw new M(`Invalid npm dependency: expected non-empty string, got "${$}"`);let _=$.trim(),U=_.lastIndexOf("@");if(U>0){let Q=_.slice(0,U),v=_.slice(U+1);if(!v)throw new M(`Invalid npm dependency: missing version after @ in "${$}"`);return{name:Q,version:v}}return{name:_,version:"*"}}function fw($,_){let U={...$.dependencies};for(let Q of _)U[Q.name]=Q.version;return{...$,dependencies:U}}function mw($,_){let U={...$.devDependencies};for(let Q of _)U[Q.name]=Q.version;return{...$,devDependencies:U}}async function gw($){let _=G4($,"package.json");if(!h4(_))return{...Cw};try{let U=await Bun.file(_).text();return JSON.parse(U)}catch(U){let Q=U instanceof Error?U.message:String(U);throw new n(`Invalid ${_}: ${Q}`)}}async function hw($){let _=G4($,".gitignore"),U=new Set(["package.json","bun.lock"]),Q=["node_modules"],v=[];if(h4(_))v=(await Bun.file(_).text()).split(`
157
- `).map((Y)=>Y.trim()).filter(Boolean);v=v.filter((J)=>!U.has(J));for(let J of Q)if(!v.includes(J))v.push(J);await Bun.write(_,`${v.join(`
151
+ hint Use \`--trust\` to add anyway`);throw V}if(J?.succeed(`Validated ${Q.length} npm package(s)`),X.length>0&&!$.quiet){_.info("");for(let M of X)_.warn(M)}let G=(await t4(Y))?.config.plugin??[],K=new Map;for(let M of G){let V=NX(M);K.set(V,M)}let W=[],z=[];for(let M of Q)if(K.get(M.name))z.push(M.name);else W.push(C9(M.name,M.version));if(z.length>0)throw new n1(`Plugin(s) already exist in opencode.json: ${z.join(", ")}.
152
+ Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let B=[...K.values(),...W];if($.dryRun){let V={dryRun:!0,command:"add",wouldPerform:Q.map((U)=>({action:"add",target:C9(U.name,U.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${Q.length} npm plugin(s)`};if(q||!$.json)j0(V,{json:$.json,quiet:$.quiet});return{plugins:Q.map((U)=>C9(U.name,U.version)),dryRun:!0}}if(await e4(Y,{plugin:B}),!$.quiet){_.info(""),_.success(`Added ${Q.length} npm plugin(s) to opencode.json`);for(let M of Q)_.info(` \u2713 ${C9(M.name,M.version)}`)}let Z=Q.map((M)=>C9(M.name,M.version));if($.json&&q)F1({success:!0,plugins:Z});return{plugins:Z,dryRun:!1}}catch(X){throw J?.fail("Failed to add npm plugins"),X}}async function rM(Q,$,Y,q=!0){let J=Boolean($.quiet||$.json),X=Y.cwd,H=!!($.global||$.profile),G=Y.getRegistries(),K=G;if($.from){let V=$.from.trim();if(!V)throw new L("--from URL cannot be empty");try{new URL(V)}catch{throw new L(`Invalid --from URL: ${V}`)}let U=new Set;for(let I of Q){let{namespace:g}=m0(I);U.add(g)}if(U.size>1){let I=Array.from(U).join(", ");throw new L(`Mixed registry prefixes in --from call: ${I}.
153
+ When using --from, all components must use the same prefix.`)}let R=Array.from(U)[0];if(!R)throw new L("No valid component references provided");await P8(V),K={...G,[R]:{url:V}}}let W={version:1,root:X,installed:{}},z=await A0(X);if(z)W=z;let B=J?null:Z1({text:"Resolving dependencies..."});B?.start();let Z=null,M=null;try{let V=new Set;for(let S of Q){let{namespace:d}=m0(S);V.add(d)}for(let S of V){let d=K[S];if(d)await P8(d.url)}let U=await eJ(K,Q);if($.verbose){_.info("Install order:");for(let S of U.installOrder)_.info(` - ${S}`)}let R=new Map,I=new Map;for(let S of U.components)if(!I.has(S.registryName))I.set(S.registryName,S.baseUrl);for(let[S,d]of I){let E=await P8(d);R.set(S,E)}if(B?.succeed(`Resolved ${U.components.length} components from ${R.size} registries`),!$.skipCompatCheck&&!J)for(let[S,d]of R){let E=RH({registry:{opencode:d.opencode,ocx:d.ocx},ocxVersion:Oq});SH(S,E)}if($.dryRun){let S=U.components.map((E)=>({action:"add",target:`${E.registryName}/${E.name}`,details:{type:E.type}}));if(U.npmDependencies.length>0||U.npmDevDependencies.length>0){let E=$.global||$.profile?X:X0(X,".opencode"),e=[...U.npmDependencies,...U.npmDevDependencies].map((o)=>{let D1=o.lastIndexOf("@"),$1=D1>0?o.slice(0,D1):o,H0=D1>0?o.slice(D1+1):"*";return{name:$1,from:null,to:H0}});S.push(WX(E,e))}let d={dryRun:!0,command:"add",wouldPerform:S,validation:{passed:!0},summary:`Would add ${U.components.length} component(s)`};if(q||!$.json)j0(d,{json:$.json,quiet:$.quiet});return{installed:U.installOrder,opencode:Boolean(U.opencode),dryRun:!0}}let N=J?null:Z1({text:"Fetching components..."});N?.start();let x=[];for(let S of U.components){let d=[];for(let o of S.files){let D1=await r8(S.baseUrl,S.name,o.path);d.push({path:o.path,content:Buffer.from(D1)})}let E=await x3(d);for(let o of S.files){let D1=l8(o.target,H,X),$1=X0(X,D1);try{V0(X,D1)}catch(H0){if(H0 instanceof e1)throw new L(`Invalid path "${$1}": ${H0.message}`);throw H0}}let C=Object.entries(W.installed).filter(([o,D1])=>g1(D1.registryUrl)===g1(S.baseUrl)&&D1.registryName===S.registryName&&D1.name===S.name);if(C.length>0){let o=C[0];if(o){let[D1,$1]=o;if($1.hash!==E)throw N?.fail("Integrity check failed"),new m8(D1,$1.hash,E)}}let e=A2(S.baseUrl,S.registryName,S.name,`sha256:${E}`);x.push({component:S,files:d,computedHash:E,canonicalId:e})}N?.succeed(`Fetched ${U.components.length} components`);let w=new Map;for(let{component:S,files:d}of x)for(let E of d){let C=S.files.find((D1)=>D1.path===E.path);if(!C)continue;let e=l8(C.target,H,X),o=X0(X,e);Q9(w,{absolutePath:o,relativePath:e,content:E.content,source:`${S.registryName}/${S.name}:${C.path}`})}let b=[];for(let S of w.values()){if(!v0(S.absolutePath))continue;let d=await Bun.file(S.absolutePath).text(),E=S.content.toString("utf-8");if(!$6(d,E)){let C=nM(W,S.relativePath);b.push({path:S.relativePath,owningComponent:C})}}if(b.length>0){let S=b.filter((C)=>C.owningComponent!==null),d=b.filter((C)=>C.owningComponent===null);if(!J){if(_.error(""),_.error("File conflicts detected:"),S.length>0){_.error(""),_.error("Files from installed components (use 'ocx update' or 'ocx remove'):");for(let C of S)if(C.owningComponent){let e=PH(C.owningComponent);_.error(` \u2717 ${C.path} (from ${e})`)}}if(d.length>0){_.error(""),_.error("Files not managed by OCX (resolve manually):");for(let C of d)_.error(` \u2717 ${C.path}`)}_.error("")}let E=`${b.length} file(s) have conflicts.
154
+ `;if(S.length>0){let C=new Set(S.filter((e)=>e.owningComponent!==null).map((e)=>PH(e.owningComponent)));E+=`For OCX-managed files, use 'ocx update ${Array.from(C).join(" ")}' or 'ocx remove ${Array.from(C).join(" ")}'.
155
+ `}if(d.length>0)E+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new n1(E.trim())}let D=J?null:Z1({text:"Installing components..."});D?.start(),M=await $U({cwd:X,isFlattened:H,trackOpencodeConfig:Boolean(U.opencode&&Object.keys(U.opencode).length>0),trackNpmManifests:U.npmDependencies.length>0||U.npmDevDependencies.length>0,quiet:$.quiet});let r=YU({quiet:$.quiet});Z=r;for(let{component:S,files:d,computedHash:E,canonicalId:C}of x){let e=await qU(S,d,X,H,r,{verbose:$.verbose});if($.verbose){for(let $1 of e.skipped)_.info(` \u25CB Skipped ${$1} (unchanged)`);for(let $1 of e.overwritten)_.info(` \u2713 Overwrote ${$1}`);for(let $1 of e.written)_.info(` \u2713 Wrote ${$1}`)}if(!R.get(S.registryName))throw new L(`Registry index not found for "${S.registryName}". This is an internal error - please report it at https://github.com/${Dq}/issues`);let D1=[];for(let $1 of d){let H0=S.files.find((W9)=>W9.path===$1.path);if(!H0)throw Error(`File ${$1.path} not found in component manifest`);let A7=l8(H0.target,H,X);D1.push({path:A7,hash:$9($1.content)})}W.installed[C]={registryUrl:S.baseUrl,registryName:S.registryName,name:S.name,revision:`sha256:${E}`,hash:E,files:D1,installedAt:new Date().toISOString(),...S.opencode&&{opencode:S.opencode}}}if(D?.succeed(`Installed ${U.components.length} components`),U.opencode&&Object.keys(U.opencode).length>0){let S=await e4(X,U.opencode);if(!$.quiet&&S.changed)if(S.created)_.info(`Created ${S.path}`);else _.info(`Updated ${S.path}`)}let n=U.npmDependencies.length>0,l=U.npmDevDependencies.length>0,M1=$.global||$.profile?X0(X,"package.json"):X0(X,".opencode/package.json");if(n||l){let S=J?null:Z1({text:`Updating ${M1}...`});S?.start();try{let d=!!($.global||$.profile),E=await WU(X,U.npmDependencies,U.npmDevDependencies,{isFlattened:d}),C=U.npmDependencies.length+U.npmDevDependencies.length;if(S?.succeed(`Added ${C} dependencies to ${M1}`),E.changed){let e=await zX(E.packageDir);if(e.success&&e.action!=="none"){if(!J)_.info(`Invalidated ${X0(E.packageDir,"node_modules")} to force reinstall`)}else if(!e.success){let o=X0(E.packageDir,"node_modules");_.warn(`Could not invalidate ${o}: ${e.error?.message??"unknown error"}. Run \`rm -rf "${o}"\` manually to force reinstall.`)}}}catch(d){throw S?.fail(`Failed to update ${M1}`),d}}if(await N0(X,W),!Z)throw Error("Internal error: missing add write transaction after install phase.");if(await Z.commit(),Z=null,M?.commit(),M=null,$.json&&q)F1({success:!0,installed:U.installOrder,opencode:!!U.opencode});else if(!$.quiet)_.info(""),_.success(`Done! Installed ${U.components.length} components.`);return{installed:U.installOrder,opencode:!!U.opencode,dryRun:!1}}catch(V){if(Z)await Z.rollback(),Z=null;if(M)await M.rollback(),M=null;if(B&&!B.isSpinning);else B?.fail("Failed to add components");throw V}}function S6(Q,$,Y){let q=Y instanceof Error?Y.message:String(Y);return`${Q} "${$}" (${q})`}function aM(Q,$){let Y=iM($,Q);return Y!==""&&!Y.startsWith("..")&&!lM(Y)}async function tM(Q,$){let Y=vH(Q),q=vH($);while(aM(Y,q)){let J=!0;try{if(!(await dM(Y)).isDirectory())break}catch(H){if(H.code==="ENOENT")J=!1;else throw H}try{if(J)await g9(Y,{recursive:!1})}catch(H){let G=H.code;if(G==="ENOENT");else if(G==="ENOTEMPTY"||G==="EEXIST"||G==="EBUSY")break;else if(G==="ENOTDIR")break;else throw H}let X=n3(Y);if(X===Y)break;Y=X}}async function eM(Q){let $;try{$=await CH(Q)}catch(Y){let q=Y.code;if(q==="ENOENT"||q==="ENOTDIR")return{path:Q,state:"missing",content:""};throw Y}if(!$.isFile())return{path:Q,state:"non-file",content:""};return{path:Q,state:"file",content:await Bun.file(Q).text()}}async function QU(Q,$){if(Q.state==="file"){await E6(n3(Q.path),{recursive:!0}),await Bun.write(Q.path,Q.content);return}if(Q.state==="non-file")return;if(v0(Q.path))await g9(Q.path,{force:!0,recursive:!0});await tM(n3(Q.path),$)}async function $U(Q){let $=[],Y=new Set,q=!1,J=async(G)=>{if(Y.has(G))return;Y.add(G),$.push(await eM(G))};if(Q.trackOpencodeConfig){let G=k3(Q.cwd).path;await J(G)}if(Q.trackNpmManifests){let G=Q.isFlattened?Q.cwd:X0(Q.cwd,".opencode");if(await J(X0(G,"package.json")),!Q.isFlattened)await J(X0(G,".gitignore"))}return await J(S8(Q.cwd).path),{rollback:async()=>{if(q)return;q=!0;let G=[];for(let K of[...$].reverse())try{await QU(K,Q.cwd)}catch(W){G.push(S6("Add rollback cleanup warning: failed to restore",K.path,W))}if(!Q.quiet)for(let K of G)_.warn(K)},commit:()=>{q=!0}}}function YU(Q){let $=[],Y=new Set,q=!1;return{writeFileAtomically:async({targetPath:G,resolvedTarget:K,content:W})=>{let z=n3(G);if(!v0(z))await E6(z,{recursive:!0});if(v0(G)){if((await CH(G)).isDirectory())throw new L(`Cannot install "${K}": target path is a directory.`)}let B=`${G}.ocx-add-tmp-${kH()}`;await pM(B,W),Y.add(B);let Z=null;if(v0(G))Z=`${G}.ocx-add-backup-${kH()}`,await R6(G,Z),$.push({targetPath:G,backupPath:Z});if(await R6(B,G),Y.delete(B),!Z)$.push({targetPath:G,backupPath:null})},rollback:async()=>{if(q)return;q=!0;let G=[];for(let K of Y)try{await g9(K,{force:!0})}catch(W){G.push(S6("Add rollback cleanup warning: failed to remove temp file",K,W))}for(let K of[...$].reverse())try{if(K.backupPath){if(v0(K.targetPath))await g9(K.targetPath,{force:!0,recursive:!0});if(v0(K.backupPath))await R6(K.backupPath,K.targetPath)}else if(v0(K.targetPath))await g9(K.targetPath,{force:!0,recursive:!0})}catch(W){G.push(S6("Add rollback cleanup warning: failed to restore target",K.targetPath,W))}if(!Q.quiet)for(let K of G)_.warn(K)},commit:async()=>{if(q)return;q=!0;for(let G of $){if(!G.backupPath||!v0(G.backupPath))continue;try{await g9(G.backupPath,{force:!0})}catch(K){if(!Q.quiet){let W=K instanceof Error?K.message:String(K);_.warn(`Post-add cleanup warning: failed to remove backup "${G.backupPath}" (${W})`)}}}}}}async function qU(Q,$,Y,q,J,X){let H={written:[],skipped:[],overwritten:[]};for(let G of $){let K=Q.files.find((B)=>B.path===G.path);if(!K)continue;let W=l8(K.target,q,Y),z=X0(Y,W);if(v0(z)){let B=await Bun.file(z).text(),Z=G.content.toString("utf-8");if($6(B,Z)){H.skipped.push(W);continue}H.overwritten.push(W)}else H.written.push(W);await J.writeFileAtomically({targetPath:z,resolvedTarget:W,content:G.content})}return H}function xH(Q){if(!Q?.trim())throw new L(`Invalid npm dependency: expected non-empty string, got "${Q}"`);let $=Q.trim(),Y=$.lastIndexOf("@");if(Y>0){let q=$.slice(0,Y),J=$.slice(Y+1);if(!J)throw new L(`Invalid npm dependency: missing version after @ in "${Q}"`);return{name:q,version:J}}return{name:$,version:"*"}}function XU(Q,$){let Y={...Q.dependencies};for(let q of $)Y[q.name]=q.version;return{...Q,dependencies:Y}}function HU(Q,$){let Y={...Q.devDependencies};for(let q of $)Y[q.name]=q.version;return{...Q,devDependencies:Y}}async function GU(Q){let $=X0(Q,"package.json");if(!v0($))return{...JU};try{let Y=await Bun.file($).text();return JSON.parse(Y)}catch(Y){let q=Y instanceof Error?Y.message:String(Y);throw new h(`Invalid ${$}: ${q}`)}}async function KU(Q){let $=X0(Q,".gitignore"),Y=new Set(["package.json","bun.lock"]),q=["node_modules"],J=[];if(v0($))J=(await Bun.file($).text()).split(`
156
+ `).map((H)=>H.trim()).filter(Boolean);J=J.filter((X)=>!Y.has(X));for(let X of q)if(!J.includes(X))J.push(X);await Bun.write($,`${J.join(`
158
157
  `)}
159
- `)}async function cw($,_,U,Q={}){let v=Q.isFlattened?$:G4($,".opencode");if(_.length===0&&U.length===0)return{changed:!1,packageDir:v,delta:[]};await BY(v,{recursive:!0});let J=_.map(BK),Y=U.map(BK),z=new Set(J.map((Z)=>Z.name)),I=Y.filter((Z)=>z.has(Z.name));if(I.length>0)throw new t$(`Package(s) appear in both dependencies and devDependencies: ${I.map((Z)=>Z.name).join(", ")}.
160
- A package cannot be in both fields. Remove from one list manually before adding.`);let X=await gw(v),q={...X.dependencies,...X.devDependencies},G=X;G=fw(G,J),G=mw(G,Y),await Bun.write(G4(v,"package.json"),`${JSON.stringify(G,null,2)}
161
- `);let j={...G.dependencies,...G.devDependencies},H=pG(q,j);if(!Q.isFlattened)await hw(v);return{changed:H.changed,packageDir:v,delta:H.entries}}var Cw;var VY=b(()=>{k0();g_();l2();Z4();D1();CG();X4();o4();hJ();rG();w1();z$();c$();i$();iJ();X1();p6();G8();T0();a4();e4();KK();Cw={name:"opencode-plugins",private:!0,type:"module"}});import{join as lw,posix as dw}from"path";function pw($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}async function DK($){let _=Bun.file(`${$}/registry.jsonc`),U=Bun.file(`${$}/registry.json`),Q=await _.exists(),v=await U.exists();if(!Q&&!v)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let J=Q?_:U,Y=Q?"registry.jsonc":"registry.json",z=await J.text(),I=[],X=x$(z,I,{allowTrailingComma:!0});if(I.length>0){let q=pw(I);return{success:!1,error:`Invalid JSONC in ${Y}: ${q}`,errorKind:"parse_error"}}return{success:!0,data:X}}function MK($,_){let U=Z0($);if(U)return{valid:!1,errors:[`Schema compatibility issue: ${U.issue} - ${U.remediation}`]};return iw($,_)}function iw($,_){let U=j1.safeParse($);if(!U.success)return{valid:!1,errors:U.error.issues.map((v)=>`${v.path.join(".")}: ${v.message}`)};return{valid:!0,errors:[],data:U.data}}async function nw($,_){let U=[];for(let Q of $.components)for(let v of Q.files){let J=g6(v,Q.type),Y=lw(_,"files",J.path);if(!await Bun.file(Y).exists())U.push(`${Q.name}: Source file not found at ${J.path}`)}return{valid:U.length===0,errors:U}}function rw($){let _=[],U=new Map($.components.map((J)=>[J.name,J]));function Q(J,Y,z,I){if(Y.has(J))return[...I,J].join(" -> ");if(z.has(J))return null;let X=U.get(J);if(!X)return null;Y.add(J),I.push(J);for(let q of X.dependencies){if(q.includes("/"))continue;let G=Q(q,Y,z,I);if(G)return G}return Y.delete(J),z.add(J),I.pop(),null}let v=new Set;for(let J of $.components){if(v.has(J.name))continue;let Y=Q(J.name,new Set,v,[]);if(Y){_.push(`Circular dependency detected: ${Y}`);break}}return{valid:_.length===0,errors:_}}function ow($){let _=[],U=new Map,Q=(v)=>{let Y=v.normalize("NFC").replace(/\\/g,"/");return dw.normalize(Y).replace(/^\.\//,"")};for(let v of $.components)for(let J of v.files){let Y=g6(J,v.type),z=Q(Y.target),I=U.get(z);if(I)_.push(`Duplicate target "${z}" in components "${I.componentName}" and "${v.name}"`);else U.set(z,{componentName:v.name})}return{valid:_.length===0,errors:_}}async function*wK($,_,U={}){let Q=await nw($,_);for(let J of Q.errors)yield J;let v=rw($);for(let J of v.errors)yield J;if(!U.skipDuplicateTargets){let J=ow($);for(let Y of J.errors)yield Y}}var LK=b(()=>{c4();o4()});async function F8($,_={}){let U=await DK($);if(!U.success)return{success:!1,errors:[U.error||"Failed to load registry"],failureType:"load",loadErrorKind:U.errorKind};let Q=MK(U.data,$);if(!Q.valid)return{success:!1,errors:Q.errors,failureType:"schema"};let v=Q.data;if(!v)throw Error("Registry validation succeeded but returned no parsed data");let J=[];for await(let Y of wK(v,$,_))J.push(Y);if(J.length>0)return{success:!1,errors:J,failureType:"rules"};return{success:!0,errors:[],registry:v}}var DY=b(()=>{LK()});function MY($){return{file:$.filter((_)=>_.includes("Source file not found")),circular:$.filter((_)=>_.includes("Circular dependency")),duplicate:$.filter((_)=>_.includes("Duplicate target"))}}function a_($,_={}){let U=MY($),Q=_.schemaErrors??0,v=$.length,J=Math.max(0,v-Q-U.file.length-U.circular.length-U.duplicate.length);return{valid:v===0,totalErrors:v,schemaErrors:Q,sourceFileErrors:U.file.length,circularDependencyErrors:U.circular.length,duplicateTargetErrors:U.duplicate.length,otherErrors:J}}import{relative as tw,resolve as kK}from"path";function aw($,_){if(_==="not_found")return new B$($);if(_==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function sw($,_){let U=a_($,{schemaErrors:_==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new z1(Q)}function ew($,_){if(_==="schema"){W.error("\u2717 Registry schema");for(let Q of $)console.log(g.red(` ${Q}`));return}let U=MY($);if(U.file.length>0){W.error("\u2717 Source files");for(let Q of U.file)console.log(g.red(` ${Q}`))}if(U.circular.length>0){W.error("\u2717 Circular dependencies");for(let Q of U.circular)console.log(g.red(` ${Q}`))}if(U.duplicate.length>0){W.error("\u2717 Duplicate targets");for(let Q of U.duplicate)console.log(g.red(` ${Q}`))}}function AK($){$.command("build").description("Build a registry from source (for registry authors)").argument("[path]","Registry source directory",".").option("--out <dir>","Output directory","./dist").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--dry-run","Validate and show what would be built").option("--show-validation","Display validation results before building",!1).action(async(_,U)=>{try{let Q=kK(U.cwd,_),v=kK(U.cwd,U.out);if(U.showValidation){let I=!U.json&&!U.quiet;if(I)W.info("Running validation checks...");let X=await F8(Q,{skipDuplicateTargets:!1});if(!X.success){let[q="Registry validation failed"]=X.errors;if(X.failureType==="load")throw aw(q,X.loadErrorKind);let G=X.failureType==="schema"?"schema":"rules",j=sw(X.errors,G);if(U.json)throw j;if(!U.quiet)ew(X.errors,G);process.exit(j.exitCode)}if(I)W.success("\u2713 Schema compatibility and structure"),W.success("\u2713 Source files"),W.success("\u2713 No circular dependencies"),W.success("\u2713 No duplicate targets"),console.log("")}let J=V$({text:"Building registry...",quiet:U.quiet||U.json});if(!U.json)J.start();let Y=await u_({source:Q,out:v,dryRun:U.dryRun});if("dryRun"in Y&&Y.dryRun){if(!U.json)J.stop();S4(Y,{json:U.json,quiet:U.quiet});return}let z=Y;if(!U.json){let I=`Built ${z.componentsCount} components to ${tw(U.cwd,v)}`;if(J.succeed(I),!process.stdout.isTTY)W.success(`Built ${z.componentsCount} components`)}if(U.json)O$({success:!0,data:{components:z.componentsCount,output:z.outputPath}})}catch(Q){if(Q instanceof z6){if(U.json)_$(Q,{json:!0});if(!U.quiet){W.error(Q.message);for(let v of Q.errors)console.log(g.red(` ${v}`))}process.exit(1)}_$(Q,{json:U.json})}})}var FK=b(()=>{k6();p2();DY();w1();z$();c$();i$();e4()});import{existsSync as OK}from"fs";import{mkdir as $L}from"fs/promises";import{join as wY}from"path";function NK($){$.command("edit").description("Open configuration file in editor").option("-g, --global","Edit global ocx.jsonc").option("-p, --profile <name>","Edit specific profile's config").action(async(_)=>{try{await _L(_)}catch(U){_$(U)}})}async function _L($){if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");let _;if($.profile){let J=I6.safeParse($.profile);if(!J.success)throw new M(`Invalid profile name "${$.profile}": ${J.error.issues[0]?.message??"Invalid name"}`);if(await h$.requireInitialized(),!await h$.create().exists($.profile))throw new m$($.profile);_=B4($.profile)}else if($.global){if(_=F0(),!OK(_))throw new n(`Global config not found at ${_}.
162
- Run 'ocx init --global' first.`)}else{let J=b1(process.cwd());if(J)_=wY(J,t4);else{let Y=wY(process.cwd(),H1);if(await $L(Y,{recursive:!0}),_=wY(Y,t4),!OK(_)){let z={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write(_,JSON.stringify(z,null,2)),W.info(`Created ${_}`)}}}let U=process.env.EDITOR||process.env.VISUAL||"vi",v=await Bun.spawn([U,_],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(v!==0)throw Error(`Editor exited with code ${v}`)}var SK=b(()=>{X6();Z4();_8();z$();c$();i$()});function TK($){$.command("show").description("Display resolved configuration for current directory").addOption(f4.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async(_)=>{try{await vL(_)}catch(U){_$(U,{json:_.json})}})}async function vL($){let _=await q6.create(process.cwd(),{profile:$.profile});if($.origin){let Q=_.resolveWithOrigin();if($.json){let J={};for(let[Y,z]of Q.origins)J[Y]=z;console.log(JSON.stringify({...Q,origins:J},null,2));return}if(console.log(g.bold("Resolved Configuration")),console.log(),Q.profileName){let J=Q.origins.get("profileName");if(console.log(`${g.cyan("Profile:")} ${Q.profileName}`),J)console.log(` ${g.dim(`\u2190 ${J.source}`)}`)}console.log(),console.log(g.cyan("Component Path:"),Q.componentPath);let v=Q.origins.get("componentPath");if(v)console.log(` ${g.dim(`\u2190 ${v.source} (${v.path})`)}`);console.log(),console.log(g.cyan("Registries:"));for(let[J,Y]of Object.entries(Q.registries)){console.log(` ${g.green(J)}: ${Y.url}`);let z=Q.origins.get(`registries.${J}`);if(z)console.log(` ${g.dim(`\u2190 ${z.source} (${z.path})`)}`)}if(Q.instructions.length>0){console.log(),console.log(g.cyan("Instructions:"));for(let J of Q.instructions)console.log(` ${J}`)}if(Object.keys(Q.opencode).length>0){console.log(),console.log(g.cyan("OpenCode Config:"));for(let J of Object.keys(Q.opencode)){let Y=Q.origins.get(`opencode.${J}`);if(console.log(` ${J}:`,JSON.stringify(Q.opencode[J])),Y)console.log(` ${g.dim(`\u2190 ${Y.source} (${Y.path})`)}`)}}return}let U=_.resolve();if($.json){console.log(JSON.stringify(U,null,2));return}if(console.log(g.bold("Resolved Configuration")),console.log(),U.profileName)console.log(`${g.cyan("Profile:")} ${U.profileName}`);if(console.log(`${g.cyan("Component Path:")} ${U.componentPath}`),console.log(),console.log(g.cyan("Registries:")),Object.keys(U.registries).length===0)console.log(" (none)");else for(let[Q,v]of Object.entries(U.registries))console.log(` ${g.green(Q)}: ${v.url}`);if(U.instructions.length>0){console.log(),console.log(g.cyan("Instructions:"));for(let Q of U.instructions)console.log(` ${Q}`)}}var RK=b(()=>{k6();g_();c$();a4()});function EK($){let _=$.command("config").description("View and edit configuration");TK(_),NK(_)}var PK=b(()=>{SK();RK()});import{existsSync as O1}from"fs";import{cp as UL,mkdir as y0,readdir as xK,readFile as QL,rm as JL,writeFile as LY}from"fs/promises";import{dirname as uK,join as O8}from"path";function yK($){let _=$.command("init").description("Initialize OCX configuration in your project");Q4(_),m4(_),G6(_),_.option("--registry <path>","Scaffold a new OCX registry project at path").option("--namespace <name>","Registry namespace (e.g., my-org)").option("--author <name>","Author name for the registry").option("--canary","Use canary (main branch) instead of latest release").option("--local <path>","Use local template directory instead of fetching").action(async(U)=>{try{if(U.registry)await qL(U.registry,U);else if(U.global)await XL(U);else await IL(U)}catch(Q){_$(Q,{json:U.json})}})}async function IL($){let _=$.cwd??process.cwd(),{path:U,exists:Q}=d6(_);if(Q)throw new t$(`ocx.jsonc already exists at ${U}
158
+ `)}async function WU(Q,$,Y,q={}){let J=q.isFlattened?Q:X0(Q,".opencode");if($.length===0&&Y.length===0)return{changed:!1,packageDir:J,delta:[]};await E6(J,{recursive:!0});let X=$.map(xH),H=Y.map(xH),G=new Set(X.map((V)=>V.name)),K=H.filter((V)=>G.has(V.name));if(K.length>0)throw new n1(`Package(s) appear in both dependencies and devDependencies: ${K.map((V)=>V.name).join(", ")}.
159
+ A package cannot be in both fields. Remove from one list manually before adding.`);let W=await GU(J),z={...W.dependencies,...W.devDependencies},B=W;B=XU(B,X),B=HU(B,H),await Bun.write(X0(J,"package.json"),`${JSON.stringify(B,null,2)}
160
+ `);let Z={...B.dependencies,...B.devDependencies},M=KX(z,Z);if(!q.isFlattened)await KU(J);return{changed:M.changed,packageDir:J,delta:M.entries}}var JU;var v6=A(()=>{E9();D2();z3();W0();a8();QX();q0();g0();Q6();BX();e8();t();u1();c1();X6();g8();k8();P3();y9();d0();l0();EH();JU={name:"opencode-plugins",private:!0,type:"module"}});import{join as zU,posix as BU}from"path";function _U(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}async function hH(Q){let $=Bun.file(`${Q}/registry.jsonc`),Y=Bun.file(`${Q}/registry.json`),q=await $.exists(),J=await Y.exists();if(!q&&!J)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let X=q?$:Y,H=q?"registry.jsonc":"registry.json",G=await X.text(),K=[],W=O1(G,K,{allowTrailingComma:!0});if(K.length>0){let z=_U(K);return{success:!1,error:`Invalid JSONC in ${H}: ${z}`,errorKind:"parse_error"}}return{success:!0,data:W}}function fH(Q,$){let Y=I9(Q);if(Y)return{valid:!1,errors:[`Schema compatibility issue: ${Y.issue} - ${Y.remediation}`]};return ZU(Q,$)}function ZU(Q,$){let Y=p8.safeParse(Q);if(!Y.success)return{valid:!1,errors:Y.error.issues.map((J)=>`${J.path.join(".")}: ${J.message}`)};return{valid:!0,errors:[],data:Y.data}}async function MU(Q,$){let Y=[];for(let q of Q.components)for(let J of q.files){let X=T8(J,q.type),H=zU($,"files",X.path);if(!await Bun.file(H).exists())Y.push(`${q.name}: Source file not found at ${X.path}`)}return{valid:Y.length===0,errors:Y}}function UU(Q){let $=[],Y=new Map(Q.components.map((X)=>[X.name,X]));function q(X,H,G,K){if(H.has(X))return[...K,X].join(" -> ");if(G.has(X))return null;let W=Y.get(X);if(!W)return null;H.add(X),K.push(X);for(let z of W.dependencies){if(z.includes("/"))continue;let B=q(z,H,G,K);if(B)return B}return H.delete(X),G.add(X),K.pop(),null}let J=new Set;for(let X of Q.components){if(J.has(X.name))continue;let H=q(X.name,new Set,J,[]);if(H){$.push(`Circular dependency detected: ${H}`);break}}return{valid:$.length===0,errors:$}}function VU(Q){let $=[],Y=new Map,q=(J)=>{let H=J.normalize("NFC").replace(/\\/g,"/");return BU.normalize(H).replace(/^\.\//,"")};for(let J of Q.components)for(let X of J.files){let H=T8(X,J.type),G=q(H.target),K=Y.get(G);if(K)$.push(`Duplicate target "${G}" in components "${K.componentName}" and "${J.name}"`);else Y.set(G,{componentName:J.name})}return{valid:$.length===0,errors:$}}async function*uH(Q,$,Y={}){let q=await MU(Q,$);for(let X of q.errors)yield X;let J=UU(Q);for(let X of J.errors)yield X;if(!Y.skipDuplicateTargets){let X=VU(Q);for(let H of X.errors)yield H}}var mH=A(()=>{D0();g0()});async function o3(Q,$={}){let Y=await hH(Q);if(!Y.success)return{success:!1,errors:[Y.error||"Failed to load registry"],failureType:"load",loadErrorKind:Y.errorKind};let q=fH(Y.data,Q);if(!q.valid)return{success:!1,errors:q.errors,failureType:"schema"};let J=q.data;if(!J)throw Error("Registry validation succeeded but returned no parsed data");let X=[];for await(let H of uH(J,Q,$))X.push(H);if(X.length>0)return{success:!1,errors:X,failureType:"rules"};return{success:!0,errors:[],registry:J}}var P6=A(()=>{mH()});function x6(Q){return{file:Q.filter(($)=>$.includes("Source file not found")),circular:Q.filter(($)=>$.includes("Circular dependency")),duplicate:Q.filter(($)=>$.includes("Duplicate target"))}}function P2(Q,$={}){let Y=x6(Q),q=$.schemaErrors??0,J=Q.length,X=Math.max(0,J-q-Y.file.length-Y.circular.length-Y.duplicate.length);return{valid:J===0,totalErrors:J,schemaErrors:q,sourceFileErrors:Y.file.length,circularDependencyErrors:Y.circular.length,duplicateTargetErrors:Y.duplicate.length,otherErrors:X}}import{relative as AU,resolve as gH}from"path";function LU(Q,$){if($==="not_found")return new B1(Q);if($==="parse_error")return new z1(Q,"CONFIG_ERROR",H1.CONFIG);return new z1(Q,"CONFIG_ERROR",H1.CONFIG)}function FU(Q,$){let Y=P2(Q,{schemaErrors:$==="schema"?Q.length:0}),q={valid:!1,errors:Q,summary:{valid:!1,totalErrors:Y.totalErrors,schemaErrors:Y.schemaErrors,sourceFileErrors:Y.sourceFileErrors,circularDependencyErrors:Y.circularDependencyErrors,duplicateTargetErrors:Y.duplicateTargetErrors,otherErrors:Y.otherErrors}};return new u8(q)}function jU(Q,$){if($==="schema"){_.error("\u2717 Registry schema");for(let q of Q)console.log(P.red(` ${q}`));return}let Y=x6(Q);if(Y.file.length>0){_.error("\u2717 Source files");for(let q of Y.file)console.log(P.red(` ${q}`))}if(Y.circular.length>0){_.error("\u2717 Circular dependencies");for(let q of Y.circular)console.log(P.red(` ${q}`))}if(Y.duplicate.length>0){_.error("\u2717 Duplicate targets");for(let q of Y.duplicate)console.log(P.red(` ${q}`))}}function cH(Q){Q.command("build").description("Build a registry from source (for registry authors)").argument("[path]","Registry source directory",".").option("--out <dir>","Output directory","./dist").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--dry-run","Validate and show what would be built").option("--show-validation","Display validation results before building",!1).action(async($,Y)=>{try{let q=gH(Y.cwd,$),J=gH(Y.cwd,Y.out);if(Y.showValidation){let K=!Y.json&&!Y.quiet;if(K)_.info("Running validation checks...");let W=await o3(q,{skipDuplicateTargets:!1});if(!W.success){let[z="Registry validation failed"]=W.errors;if(W.failureType==="load")throw LU(z,W.loadErrorKind);let B=W.failureType==="schema"?"schema":"rules",Z=FU(W.errors,B);if(Y.json)throw Z;if(!Y.quiet)jU(W.errors,B);process.exit(Z.exitCode)}if(K)_.success("\u2713 Schema compatibility and structure"),_.success("\u2713 Source files"),_.success("\u2713 No circular dependencies"),_.success("\u2713 No duplicate targets"),console.log("")}let X=Z1({text:"Building registry...",quiet:Y.quiet||Y.json});if(!Y.json)X.start();let H=await U2({source:q,out:J,dryRun:Y.dryRun});if("dryRun"in H&&H.dryRun){if(!Y.json)X.stop();j0(H,{json:Y.json,quiet:Y.quiet});return}let G=H;if(!Y.json){let K=`Built ${G.componentsCount} components to ${AU(Y.cwd,J)}`;if(X.succeed(K),!process.stdout.isTTY)_.success(`Built ${G.componentsCount} components`)}if(Y.json)F1({success:!0,data:{components:G.componentsCount,output:G.outputPath}})}catch(q){if(q instanceof r0){if(Y.json)s(q,{json:!0});if(!Y.quiet){_.error(q.message);for(let J of q.errors)console.log(P.red(` ${J}`))}process.exit(1)}s(q,{json:Y.json})}})}var dH=A(()=>{U8();_3();P6();e8();t();u1();c1();l0()});import{existsSync as pH}from"fs";import{mkdir as wU}from"fs/promises";import{join as C6}from"path";function lH(Q){Q.command("edit").description("Open configuration file in editor").option("-g, --global","Edit global ocx.jsonc").option("-p, --profile <name>","Edit specific profile's config").action(async($)=>{try{await DU($)}catch(Y){s(Y)}})}async function DU(Q){if(Q.global&&Q.profile)throw new L("Cannot use both --global and --profile flags");let $;if(Q.profile){let X=a0.safeParse(Q.profile);if(!X.success)throw new L(`Invalid profile name "${Q.profile}": ${X.error.issues[0]?.message??"Invalid name"}`);if(await f1.requireInitialized(),!await f1.create().exists(Q.profile))throw new C1(Q.profile);$=K0(Q.profile)}else if(Q.global){if($=v9(),!pH($))throw new h(`Global config not found at ${$}.
161
+ Run 'ocx init --global' first.`)}else{let X=M8(process.cwd());if(X)$=C6(X,c0);else{let H=C6(process.cwd(),i8);if(await wU(H,{recursive:!0}),$=C6(H,c0),!pH($)){let G={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write($,JSON.stringify(G,null,2)),_.info(`Created ${$}`)}}}let Y=process.env.EDITOR||process.env.VISUAL||"vi",J=await Bun.spawn([Y,$],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(J!==0)throw Error(`Editor exited with code ${J}`)}var iH=A(()=>{t0();W0();D3();t();u1();c1()});function nH(Q){Q.command("show").description("Display resolved configuration for current directory").addOption(S0.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async($)=>{try{await OU($)}catch(Y){s(Y,{json:$.json})}})}async function OU(Q){let $=await e0.create(process.cwd(),{profile:Q.profile});if(Q.origin){let q=$.resolveWithOrigin();if(Q.json){let X={};for(let[H,G]of q.origins)X[H]=G;console.log(JSON.stringify({...q,origins:X},null,2));return}if(console.log(P.bold("Resolved Configuration")),console.log(),q.profileName){let X=q.origins.get("profileName");if(console.log(`${P.cyan("Profile:")} ${q.profileName}`),X)console.log(` ${P.dim(`\u2190 ${X.source}`)}`)}console.log(),console.log(P.cyan("Component Path:"),q.componentPath);let J=q.origins.get("componentPath");if(J)console.log(` ${P.dim(`\u2190 ${J.source} (${J.path})`)}`);console.log(),console.log(P.cyan("Registries:"));for(let[X,H]of Object.entries(q.registries)){console.log(` ${P.green(X)}: ${H.url}`);let G=q.origins.get(`registries.${X}`);if(G)console.log(` ${P.dim(`\u2190 ${G.source} (${G.path})`)}`)}if(q.instructions.length>0){console.log(),console.log(P.cyan("Instructions:"));for(let X of q.instructions)console.log(` ${X}`)}if(Object.keys(q.opencode).length>0){console.log(),console.log(P.cyan("OpenCode Config:"));for(let X of Object.keys(q.opencode)){let H=q.origins.get(`opencode.${X}`);if(console.log(` ${X}:`,JSON.stringify(q.opencode[X])),H)console.log(` ${P.dim(`\u2190 ${H.source} (${H.path})`)}`)}}return}let Y=$.resolve();if(Q.json){console.log(JSON.stringify(Y,null,2));return}if(console.log(P.bold("Resolved Configuration")),console.log(),Y.profileName)console.log(`${P.cyan("Profile:")} ${Y.profileName}`);if(console.log(`${P.cyan("Component Path:")} ${Y.componentPath}`),console.log(),console.log(P.cyan("Registries:")),Object.keys(Y.registries).length===0)console.log(" (none)");else for(let[q,J]of Object.entries(Y.registries))console.log(` ${P.green(q)}: ${J.url}`);if(Y.instructions.length>0){console.log(),console.log(P.cyan("Instructions:"));for(let q of Y.instructions)console.log(` ${q}`)}}var oH=A(()=>{U8();D2();u1();d0()});function sH(Q){let $=Q.command("config").description("View and edit configuration");nH($),lH($)}var rH=A(()=>{iH();oH()});import{existsSync as J9}from"fs";import{cp as IU,mkdir as c9,readdir as aH,readFile as NU,rm as TU,writeFile as y6}from"fs/promises";import{dirname as tH,join as s3}from"path";function eH(Q){let $=Q.command("init").description("Initialize OCX configuration in your project");Q0($),E0($),Q8($),$.option("--registry <path>","Scaffold a new OCX registry project at path").option("--namespace <name>","Registry namespace (e.g., my-org)").option("--author <name>","Author name for the registry").option("--canary","Use canary (main branch) instead of latest release").option("--local <path>","Use local template directory instead of fetching").action(async(Y)=>{try{if(Y.registry)await kU(Y.registry,Y);else if(Y.global)await EU(Y);else await SU(Y)}catch(q){s(q,{json:Y.json})}})}async function SU(Q){let $=Q.cwd??process.cwd(),{path:Y,exists:q}=E8($);if(q)throw new n1(`ocx.jsonc already exists at ${Y}
163
162
 
164
163
  To reset, delete the config and run init again:
165
- rm ${U} && ocx init`);let v=$.quiet?null:V$({text:"Initializing OCX..."});v?.start();try{let J={$schema:YJ,registries:{}},Y=h6.parse(J);await y0(uK(U),{recursive:!0});let z=JSON.stringify(Y,null,2);await LY(U,z,"utf-8");let I=await mG(_);if(v?.succeed("Initialized OCX configuration"),$.json)console.log(JSON.stringify({success:!0,path:U,opencodePath:I.path,opencodeCreated:I.created}));else if(!$.quiet){if(W.info(`Created ${U}`),I.created)W.info(`Created ${I.path}`);W.info(""),W.info("Next steps:"),W.info(" 1. Add a registry: ocx registry add <url>"),W.info(" 2. Install components: ocx add <component>")}}catch(J){throw v?.fail("Failed to initialize"),J}}async function XL($){let _=$.quiet?null:V$({text:"Initializing global profiles..."});_?.start();try{let U=[],Q=[],v=F0();if(O1(v))Q.push("globalConfig");else await y0(uK(v),{recursive:!0,mode:448}),await A0(v,{$schema:YJ,registries:{}}),U.push("globalConfig");let J=w6();if(!O1(J))await y0(J,{recursive:!0,mode:448});let Y=p$("default");if(!O1(Y))await y0(Y,{recursive:!0,mode:448});let z=B4("default");if(O1(z))Q.push("profileOcx");else await A0(z,qG),U.push("profileOcx");let I=L6("default");if(O1(I))Q.push("profileOpencode");else await A0(I,{}),U.push("profileOpencode");let X=W1("default");if(O1(X))Q.push("profileAgents");else await Bun.write(X,`# Profile Instructions
164
+ rm ${Y} && ocx init`);let J=Q.quiet?null:Z1({text:"Initializing OCX..."});J?.start();try{let X={$schema:j4,registries:{}},H=b8.parse(X);await c9(tH(Y),{recursive:!0});let G=JSON.stringify(H,null,2);await y6(Y,G,"utf-8");let K=await YX($);if(J?.succeed("Initialized OCX configuration"),Q.json)console.log(JSON.stringify({success:!0,path:Y,opencodePath:K.path,opencodeCreated:K.created}));else if(!Q.quiet){if(_.info(`Created ${Y}`),K.created)_.info(`Created ${K.path}`);_.info(""),_.info("Next steps:"),_.info(" 1. Add a registry: ocx registry add <url>"),_.info(" 2. Install components: ocx add <component>")}}catch(X){throw J?.fail("Failed to initialize"),X}}async function EU(Q){let $=Q.quiet?null:Z1({text:"Initializing global profiles..."});$?.start();try{let Y=[],q=[],J=v9();if(J9(J))q.push("globalConfig");else await c9(tH(J),{recursive:!0,mode:448}),await k9(J,{$schema:j4,registries:{}}),Y.push("globalConfig");let X=_8();if(!J9(X))await c9(X,{recursive:!0,mode:448});let H=h1("default");if(!J9(H))await c9(H,{recursive:!0,mode:448});let G=K0("default");if(J9(G))q.push("profileOcx");else await k9(G,RJ),Y.push("profileOcx");let K=Z8("default");if(J9(K))q.push("profileOpencode");else await k9(K,{}),Y.push("profileOpencode");let W=n8("default");if(J9(W))q.push("profileAgents");else await Bun.write(W,`# Profile Instructions
166
165
 
167
166
  <!-- Add your custom instructions for this profile here -->
168
167
  <!-- These will be included when running \`ocx opencode -p default\` -->
169
- `,{mode:384}),U.push("profileAgents");if(_?.succeed("Initialized global profiles"),$.json)console.log(JSON.stringify({success:!0,files:{globalConfig:v,profileOcx:z,profileOpencode:I,profileAgents:X},created:U,existed:Q}));else if(!$.quiet)if(U.length>0){for(let q of U){if(q==="globalConfig")W.info(`Created global config: ${v}`);if(q==="profileOcx")W.info(`Created profile config: ${z}`);if(q==="profileOpencode")W.info(`Created profile opencode config: ${I}`);if(q==="profileAgents")W.info(`Created profile instructions: ${X}`)}W.info(""),W.info("Next steps:"),W.info(" 1. Edit your profile config: ocx config edit -p default"),W.info(" 2. Add registries: ocx registry add <url> --name <name> --global"),W.info(" 3. Launch OpenCode: ocx opencode"),W.info(" 4. Create more profiles: ocx profile add <name> --global")}else W.info("Global profiles already initialized (all files exist)")}catch(U){throw _?.fail("Failed to initialize"),U}}async function qL($,_){let U=$,Q=_.namespace??"my-registry",v=_.author??"Your Name";if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(Q))throw new M("Invalid namespace format: must start with letter/number, use hyphens only between segments (e.g., 'my-registry')");if((await xK(U).catch(()=>[])).some((I)=>!I.startsWith(".")))throw new t$("Directory is not empty. Remove existing files or choose a different directory.");let z=_.quiet?null:V$({text:"Scaffolding registry..."});z?.start();try{if(z)z.text=_.local?"Copying template...":"Fetching template...";if(_.local)await y0(U,{recursive:!0}),await CK(_.local,U);else{let I=_.canary?"main":GL();await KL(U,I,_.verbose)}if(z)z.text="Configuring project...";if(await WL(U,{namespace:Q,author:v}),z?.succeed(`Created registry: ${Q}`),_.json)console.log(JSON.stringify({success:!0,namespace:Q,path:U}));else if(!_.quiet)W.info(""),W.info("Next steps:"),W.info(" 1. bun install"),W.info(" 2. Edit registry.jsonc with your components"),W.info(" 3. bun run build"),W.info(""),W.info("Deploy to:"),W.info(" Cloudflare: bunx wrangler deploy"),W.info(" Vercel: vercel"),W.info(" Netlify: netlify deploy")}catch(I){throw z?.fail("Failed to scaffold registry"),I}}async function CK($,_){await UL($,_,{recursive:!0})}function GL(){return"v2.0.5"}function jL($){let _=$==="main"?"heads/main":`tags/${$}`;return`https://github.com/${YL}/archive/refs/${_}.tar.gz`}async function KL($,_,U){let Q=jL(_);if(U)W.info(`Fetching ${Q}`);let v=await fetch(Q);if(!v.ok||!v.body)throw new E$(`Failed to fetch template from ${Q}: ${v.statusText}`);let J=O8($,".ocx-temp");await y0(J,{recursive:!0});try{let Y=O8(J,"template.tar.gz"),z=await v.arrayBuffer();await LY(Y,Buffer.from(z));let I=Bun.spawn(["tar","-xzf",Y,"-C",J],{stdout:"ignore",stderr:"pipe"});if(await I.exited!==0){let H=await new Response(I.stderr).text();throw Error(`Failed to extract template: ${H}`)}let G=(await xK(J)).find((H)=>H.startsWith("ocx-"));if(!G)throw Error("Failed to find extracted template directory");let j=O8(J,G,zL);await CK(j,$)}finally{await JL(J,{recursive:!0,force:!0})}}function HL($){return $.split(/[-_\s]+/).map((_)=>_.charAt(0).toUpperCase()+_.slice(1).toLowerCase()).join(" ")}async function WL($,_){let U=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let Q of U){let v=O8($,Q);if(!O1(v))continue;let J=await QL(v).then((Y)=>Y.toString());if(J=J.replace(/my-registry/g,_.namespace),J=J.replace(/My Registry/g,HL(_.namespace)),J=J.replace(/Your Name/g,_.author),Q==="registry.jsonc")if(/"\$schema"\s*:/.test(J))J=J.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${p4}$2`);else J=J.replace(/{/,`{
170
- "$schema": "${p4}",`);await LY(v,J)}}var YL="kdcokenny/ocx",zL="examples/registry-starter";var fK=b(()=>{l2();e2();X6();Z4();X4();hJ();z$();c$();i$();a4();e4()});function bL($,_,U){let Q=$.indexOf("/");if(Q===-1)throw Error(`Invalid legacy key: "${$}". Expected format: alias/component`);let v=$.slice(0,Q),J=$.slice(Q+1);if(!v||!J)throw Error(`Invalid legacy key: "${$}". Both alias and component are required.`);let Y=C_(U,v,J,_.version),z={registryUrl:U,registryName:v,name:J,revision:_.version,hash:_.hash,files:_.files.map((I)=>({path:I,hash:""})),installedAt:_.installedAt,..._.updatedAt&&{updatedAt:_.updatedAt},owner:{type:"user"}};return[Y,z]}function N8($,_,U){let Q={},v=[],J=Object.keys($.installed).sort();for(let z of J){let I=$.installed[z];if(!I)continue;let X=_.registries[I.registry];if(!X)throw new n(`Registry "${I.registry}" referenced in lock key "${z}" is not configured in ocx.jsonc. Add it before migrating.`);let[q,G]=bL(z,I,X.url);Q[q]=G,v.push({legacyKey:z,canonicalId:q,name:G.name,registryName:G.registryName})}return{receipt:{version:1,...U&&{root:U},installed:Q},components:v}}function mK($){let _=$.registries;if(!_||typeof _!=="object"||Array.isArray(_))return[];let U=[],Q=_;for(let v of Object.keys(Q).sort()){let J=Q[v];if(!J||typeof J!=="object"||Array.isArray(J))continue;let Y=J;for(let z of BL)if(z in Y)U.push({registry:v,field:z,action:"remove_deprecated"})}return U}var BL;var gK=b(()=>{X4();z$();BL=["version"]});import{existsSync as kY,readdirSync as ZL,readFileSync as dK,statSync as VL}from"fs";import{rename as S8,writeFile as DL}from"fs/promises";import{join as hK}from"path";function pK($){$.command("migrate").description("Migrate legacy ocx.lock to receipt format (.ocx/receipt.jsonc)").option("--global","Migrate global config scope (includes profiles)").option("--apply","Apply migration (default is dry-run preview)").option("--json","Output as JSON").option("-q, --quiet","Suppress output").option("--cwd <path>","Working directory").action(async(_)=>{try{await wL(_)}catch(U){_$(U,{json:_.json})}})}async function wL($){if($.global){await LL($);return}await uL($,"local",mL($),!1)}async function LL($){let _=$.cwd??O4(),U=kL(_);if(!$.apply){let Y=[],z=new Set;for(let{label:q,path:G}of U){let j=l6(G),H=D0(G,{isFlattened:!0});if(j.exists&&H.exists)z.add(q);try{let Z=await AL(G,!0,{emitWarnings:!$.json&&!$.quiet});Y.push({...Z,target:q})}catch(Z){let V=lK(q,Z);if(Y.push(V),!$.json&&!$.quiet)W.error(`[global:${q}] Preview failed: ${V.error}`)}}let I=cK(Y,"global",!1),X=OL(I);if($.json){if(C0(I,!1),X)process.exit(1);return}if(!$.quiet)yL(Y,I,z);if(X)process.exit(1);return}let Q=[],v=!1;for(let{label:Y,path:z}of U)try{let I=await FL(z,!0);Q.push({...I,target:Y})}catch(I){v=!0;let X=lK(Y,I);if(Q.push(X),!$.json&&!$.quiet)W.error(`[global:${Y}] Migration failed: ${X.error}`)}let J=cK(Q,"global",!0);if($.json){if(C0(J,!0),v)process.exit(1);return}if(!$.quiet)CL(Q,v);if(v)process.exit(1)}function kL($){let _=[];_.push({label:"root",path:$});let U=hK($,"profiles");if(kY(U)&&VL(U).isDirectory()){let v=ZL(U,{withFileTypes:!0}).filter((J)=>J.isDirectory()&&!J.name.startsWith(".")).map((J)=>J.name).sort();for(let J of v)_.push({label:`profile:${J}`,path:hK(U,J)})}return _}async function AL($,_,U){let Q=U?.emitWarnings??!0,v=AY($),J=l6($),Y=D0($,{isFlattened:_}),z=J.exists&&Y.exists;if(J.exists&&v.length===0&&!z)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!J.exists&&v.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let I=[];if(Y.exists&&!J.exists)try{let X=await f_($,{isFlattened:_}),q=await u4($,{emitParseDiagnostics:Q});if(X&&q)I=N8(X,q,$).components}catch{if(Q)W.warn(`[preview] Could not parse lock/config at "${$}"; component count may be incomplete.`)}return{status:"preview",count:I.length,components:I,configActions:v}}async function FL($,_){let U=AY($),Q=l6($),v=D0($,{isFlattened:_}),J=Q.exists&&v.exists;if(Q.exists&&U.length===0&&!J)return{status:"already_v2",count:0,components:[],configActions:[]};if(!v.exists&&!Q.exists&&U.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(v.exists&&!Q.exists){let q=await f_($,{isFlattened:_});if(!q)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let G=await u4($);if(!G)throw new n("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:H}=N8(q,G,$);Y={newReceipt:j,components:H}}let z=Y?.components??[],I=z.length;if(Y){await x4($,Y.newReceipt);let q=T8(v.path);await S8(v.path,q)}if(J){let q=T8(v.path);await S8(v.path,q)}if(U.length>0)await iK($,U);return{status:Y!==null||J||U.length>0?"migrated":"already_v2",count:I,components:z,configActions:U}}function cK($,_,U){let Q=$.some((q)=>q.status==="error"),v=$.some((q)=>q.status==="migrated"||q.status==="preview"),J=$.every((q)=>q.status==="already_v2"||q.status==="nothing_to_migrate"),Y=$.reduce((q,G)=>q+G.count,0),z=$.flatMap((q)=>q.components),I=$.flatMap((q)=>q.configActions),X;if(Q)X=U?"partial_failure":"preview_with_errors";else if(J)X=$.every((G)=>G.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(U)X=v?"migrated":"already_v2";else X=v?"preview":"already_v2";return{success:!Q,status:X,scope:_,count:Y,components:z,configActions:I,targets:$}}function OL($){return $.status==="preview_with_errors"}function C0($,_){let U=NL($,_);console.log(JSON.stringify(U,null,2))}function NL($,_){let U=SL($),Q=U.flatMap((v)=>v.blockers??[]);return{...$,lifecycle_status:EL($.status,_),schema_version:ML,blockers:Q,targets:U}}function SL($){return($.targets&&$.targets.length>0?$.targets:[TL($)]).map((U)=>RL(U))}function TL($){return{target:$.scope,status:$.status,count:$.count,components:$.components,configActions:$.configActions,blockers:$.blockers??[]}}function RL($){let _=$.blockers??($.status==="error"?[{code:"MIGRATE_BLOCKER",message:$.error??"Migration blocked",path:$.target}]:[]);return{...$,scope:$.scope??$.target,result:$.result??$.status,blockers:_}}function EL($,_){if(_)return $==="partial_failure"?"apply_failed":"apply_ok";return $==="preview_with_errors"?"preview_blocked":"preview_ok"}function lK($,_){let U=PL(_,$);return{target:$,status:"error",count:0,components:[],configActions:[],error:U.message,blockers:[U]}}function PL($,_){let U=$ instanceof Error?$.message:String($);return{code:xL($,U),message:U,path:_}}function xL($,_){if(typeof $==="object"&&$!==null&&"code"in $){let Q=$.code;if(typeof Q==="string"&&Q.length>0)return Q}let U=_.toLowerCase();if(U.includes("ocx.jsonc")||U.includes("registry"))return"CONFIG_ERROR";if(U.includes("parse")||U.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function uL($,_,U,Q){let v=AY(U),J=l6(U),Y=D0(U,{isFlattened:Q}),z=J.exists&&Y.exists;if(J.exists&&v.length===0&&!z){let H={success:!0,status:"already_v2",scope:_,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.success(`[${_}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!J.exists&&v.length===0){let H={success:!0,status:"nothing_to_migrate",scope:_,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.info(`[${_}] Nothing to migrate. No legacy ocx.lock found.`);return}let I=null;if(Y.exists&&!J.exists){let H=await f_(U,{isFlattened:Q});if(!H)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let Z=await u4(U);if(!Z)throw new n("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:V,components:S}=N8(H,Z,U);I={newReceipt:V,components:S}}let X=I?.components??[],q=X.length;if(!$.apply){let H={success:!0,status:"preview",scope:_,count:q,components:X,configActions:v};if($.json){C0(H,!1);return}if(!$.quiet){if(q>0){W.info(`[${_}] Migration preview: ${q} component(s) would be migrated.`),W.break();for(let Z of X)W.info(` ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break()}if(z)W.info(`[${_}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),W.break();if(v.length>0){W.info(`[${_}] Config normalization: ${v.length} deprecated field(s) would be removed.`);for(let Z of v)W.info(` registries.${Z.registry}.${Z.field} \u2192 remove`);W.break()}if(q===0&&v.length===0&&!z)W.info(`[${_}] Nothing to migrate.`);else W.info("No changes made. Run with --apply to perform migration.")}return}if(I){await x4(U,I.newReceipt);let H=T8(Y.path);if(await S8(Y.path,H),!$.json&&!$.quiet){W.success(`[${_}] Migrated ${q} component(s) to receipt format (.ocx/receipt.jsonc).`),W.break();for(let Z of X)W.success(` \u2713 ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break(),W.info(`Legacy lock backed up to: ${H}`)}}if(z){let H=T8(Y.path);if(await S8(Y.path,H),!$.json&&!$.quiet)W.success(`[${_}] Removed stale legacy lock (receipt already exists).`),W.info(`Legacy lock backed up to: ${H}`)}if(v.length>0){if(await iK(U,v),!$.json&&!$.quiet){if(I)W.break();W.success(`[${_}] Normalized ${v.length} deprecated config field(s).`);for(let H of v)W.success(` \u2713 registries.${H.registry}.${H.field} removed`)}}let j={success:!0,status:I!==null||z||v.length>0?"migrated":"already_v2",scope:_,count:q,components:X,configActions:v};if($.json){C0(j,!0);return}if(!I&&v.length>0&&!$.quiet)W.break(),W.success(`[${_}] Config normalization complete.`)}function yL($,_,U){if(_.status==="nothing_to_migrate"){W.info("[global] Nothing to migrate across all targets.");return}if(_.status==="already_v2"){W.success("[global] All targets already migrated.");return}W.info(`[global] Migration preview across ${$.length} target(s):`),W.break();for(let Q of $){let v=U.has(Q.target),J=fL(Q,v);W.info(` ${Q.target}: ${J}`)}if(W.break(),_.status==="preview_with_errors")W.warn("[global] Preview completed with errors on some targets. See above for details."),W.info("No changes made. Run with --apply to perform migration.");else W.info("No changes made. Run with --apply to perform migration.")}function CL($,_){W.break();let U=$.filter((J)=>J.status==="migrated"),Q=$.filter((J)=>J.status==="already_v2"||J.status==="nothing_to_migrate"),v=$.filter((J)=>J.status==="error");if(U.length>0){W.success(`[global] Migrated ${U.length} target(s):`);for(let J of U)W.success(` \u2713 ${J.target}`)}if(Q.length>0)W.info(`[global] ${Q.length} target(s) already up to date.`);if(v.length>0){W.error(`[global] ${v.length} target(s) failed:`);for(let J of v)W.error(` \u2717 ${J.target}: ${J.error}`)}if(_)W.break(),W.error("[global] Migration completed with errors. See above for details.")}function fL($,_){if($.status==="error")return"error";if($.status==="already_v2")return"already migrated";if($.status==="nothing_to_migrate")return"nothing to migrate";let U=[];if($.count>0)U.push(`${$.count} component(s) to migrate`);if($.configActions.length>0)U.push(`${$.configActions.length} config field(s) to normalize`);if(_)U.push("legacy lock cleanup pending");if(U.length===0)return"nothing to migrate";return U.join(", ")}function mL($){if($.global)return $.cwd??O4();return $.cwd??process.cwd()}function T8($){let _=`${$}.bak`;if(!kY(_))return _;for(let U=1;U<=100;U++){let Q=`${_}.${U}`;if(!kY(Q))return Q}return`${_}.${Date.now()}`}function AY($){let _=d6($);if(!_.exists)return[];try{let U=dK(_.path,"utf-8"),Q=x$(U,[],{allowTrailingComma:!0});if(!Q||typeof Q!=="object"||Array.isArray(Q))return[];return mK(Q)}catch{return[]}}async function iK($,_){if(_.length===0)return;let U=d6($);if(!U.exists)return;let Q=dK(U.path,"utf-8");for(let v of _){let J=y1(Q,["registries",v.registry,v.field],void 0,gL);Q=C1(Q,J)}await DL(U.path,Q)}var ML=1,gL;var nK=b(()=>{c4();X4();z$();c$();i$();p6();gK();gL={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
171
- `}}});import{basename as hL,resolve as Ey}from"path";function R8(){let{GIT_DIR:$,GIT_WORK_TREE:_,...U}=process.env;return U}async function cL($){let _=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await _.exited===0){let I=(await new Response(_.stdout).text()).trim();if(I)return I}let Q=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await Q.exited===0){let I=(await new Response(Q.stdout).text()).trim();if(I)return I}let J=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await J.exited===0){let I=(await new Response(J.stdout).text()).trim();if(I)return I}return null}async function lL($){let _=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:$,env:R8(),stdout:"pipe",stderr:"pipe"});if(await _.exited!==0)return null;let v=(await new Response(_.stdout).text()).trim();if(!v)return null;return hL(v)}async function rK($){let[_,U]=await Promise.all([lL($),cL($)]);return{repoName:_,branch:U}}var oK=()=>{};import dL from"path";function aK(){return Boolean(process.env.TMUX)}function pL($){if(!aK())return;Bun.spawnSync(["tmux","rename-window",$]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function iL($){if(!M1)return;process.stdout.write(`\x1B]0;${$}\x07`)}function sK($){pL($),iL($)}function eK(){if(E8||!M1)return;process.stdout.write("\x1B[22;2t"),E8=!0}function FY(){if(!E8)return;if(aK())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(M1)process.stdout.write("\x1B[23;2t");E8=!1}function $H($,_,U){let Q=U.repoName??dL.basename($);if(!U.branch)return`ocx[${_}]:${Q}`;let v=U.branch.length>tK?`${U.branch.slice(0,tK-3)}...`:U.branch;return`ocx[${_}]:${Q}/${v}`}var tK=20,E8=!1;var _H=b(()=>{l_()});import{randomUUID as nL}from"crypto";import{copyFile as rL,cp as oL,lstat as o6,mkdir as tL,mkdtemp as aL,readdir as QH,readFile as sL,realpath as m0,rename as eL,rm as $k,unlink as _k}from"fs/promises";import{tmpdir as vk}from"os";import{basename as Uk,dirname as SY,isAbsolute as JH,join as A6,relative as TY}from"path";var{Glob:OY}=globalThis.Bun;function a($,_){return new n(`ocx oc ${$} error: ${_}`)}function C$($){if($ instanceof Error)return $.message;return String($)}function zk($){if($.length===0)return"Unknown parse error";let _=$[0];if(!_)return"Unknown parse error";return`${S6(_.error)} at offset ${_.offset}`}function x8($){return $.replaceAll("\\","/")}function NY($){return $.startsWith("./")?$.slice(2):$}function RY($,_){let U=TY($,_);if(U.length===0)return!0;return!U.startsWith("..")&&!JH(U)}function Ik($){if($.isFile())return"file";if($.isDirectory())return"directory";if($.isSymbolicLink())return"symlink";return"other"}function s_($){return{entryType:Ik($),device:String($.dev),inode:String($.ino),mode:String($.mode),size:String($.size),mtimeMs:String($.mtimeMs)}}function Xk($,_){return $.entryType===_.entryType&&$.device===_.device&&$.inode===_.inode&&$.mode===_.mode}function qk($,_){return $.size===_.size&&$.mtimeMs===_.mtimeMs}async function f0($){let _;try{_=await o6($.absolutePath)}catch{throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`)}if($.mustRemainDirectory&&!_.isDirectory())throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`);if($.mustRemainFile&&!_.isFile())throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`);let U=s_(_),Q=Xk($.expectedSnapshot,U),J=!($.compareContent??!0)?!0:qk($.expectedSnapshot,U);if(!Q||!J)throw a("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${r6}`)}async function P8($,_,U){let v=x8(TY($,_)).split("/").filter((Y)=>Y.length>0),J=$;for(let Y of v){J=A6(J,Y);let z;try{z=await o6(J)}catch(I){if(I.code==="ENOENT")return;throw a("validate",`Failed to inspect overlay destination path (${U}): ${C$(I)}`)}if(z.isSymbolicLink())throw a("validate",`Overlay destination path contains existing symlink (${U})`)}}function vH($,_,U){for(let Q of U)try{new OY(NY(Q))}catch{throw a("validate",`Invalid project overlay policy at ${$}: ${_} contains invalid glob pattern "${Q}"`)}}async function jk($){if(!$)return{include:[],exclude:[]};let _=A6($,t4),U=await Kk($,_);if(!U)return{include:[],exclude:[]};let Q;try{Q=await sL(U,"utf8")}catch(X){throw a("read",`Failed to read project overlay policy at ${_}: ${C$(X)}`)}let v=[],J=x$(Q,v,{allowTrailingComma:!0});if(v.length>0)throw a("parse",`Failed to parse project overlay policy at ${_}: ${zk(v)}`);if(!J||typeof J!=="object"||Array.isArray(J))throw a("validate",`Invalid project overlay policy at ${_}: root must be an object`);let Y=Gk.safeParse(J);if(!Y.success){let X=Y.error.issues[0],q=X?.path.length?X.path.join("."):"root",G=X?.message??"Invalid project overlay policy";throw a("validate",`Invalid project overlay policy at ${_}: ${q} ${G}`)}let z=Y.data.include??[],I=Y.data.exclude??[];return vH(_,"include",z),vH(_,"exclude",I),{include:z,exclude:I}}async function Kk($,_){let U;try{U=await o6(_)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw a("read",`Failed to inspect project overlay policy at ${_}: ${C$(J)}`)}if(!U.isSymbolicLink())return _;let Q;try{Q=await m0($)}catch(J){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(J)}`)}let v;try{v=await m0(_)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw a("validate",`Broken symlink in project overlay policy: ${_}`);throw a("read",`Failed to inspect project overlay policy symlink at ${_}: ${C$(J)}`)}if(!RY(Q,v))throw a("validate",`Symlink escapes project overlay policy scope: ${_}`);return v}function Hk($,_){for(let U of _.include)if(new OY(NY(U)).match($))return!0;for(let U of _.exclude)if(new OY(NY(U)).match($))return!1;return!0}function Wk($,_){return $.filter((U)=>Hk(U.overlayRelativePath,_)).map((U)=>({sourcePath:U.sourcePath,destinationRelativePath:U.overlayRelativePath,sourceSnapshot:U.sourceSnapshot}))}async function YH($,_,U){let Q;try{Q=await m0(_)}catch(v){let J=v.code;if(J==="ENOENT"||J==="ENOTDIR")throw a("validate",`Broken symlink in project overlay scope: ${U}`);throw a("read",`Failed to inspect symlink at ${U}: ${C$(v)}`)}if(!RY($,Q))throw a("validate",`Symlink escapes project overlay scope: ${U}`);throw a("validate",`Symlink entries are not supported in project overlay scope: ${U}`)}async function zH($,_,U,Q,v){let J;try{J=await o6(_)}catch(z){throw a("read",`Failed to inspect project overlay path ${U}: ${C$(z)}`)}if(J.isSymbolicLink())await YH($,_,U);let Y=s_(J);if(J.isDirectory()){await v.beforeDirectoryRead?.({absolutePath:_,overlayRelativePath:U});let z;try{z=await QH(_)}catch(I){throw a("read",`Failed to read project overlay directory ${U}: ${C$(I)}`)}z.sort((I,X)=>I.localeCompare(X));for(let I of z){let X=A6(_,I),q=x8(A6(U,I));await zH($,X,q,Q,v)}await f0({absolutePath:_,overlayRelativePath:U,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!J.isFile())return;Q.push({sourcePath:_,overlayRelativePath:x8(U),sourceSnapshot:Y})}async function bk($,_={}){let U;try{U=await m0($)}catch(Y){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(Y)}`)}let Q;try{Q=await o6($)}catch(Y){throw a("validate",`Unable to inspect project overlay root ${$}: ${C$(Y)}`)}if(!Q.isDirectory())throw a("validate",`Project overlay root changed before discovery: ${$}. ${r6}`);let v=s_(Q),J=[];for(let Y of Qk){let z=A6($,Y);await _.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:z,projectConfigDir:$}),await f0({absolutePath:$,overlayRelativePath:".opencode",expectedSnapshot:v,phase:"overlay discovery",mustRemainDirectory:!0});let I;try{I=await o6(z)}catch(X){let q=X.code;if(q==="ENOENT"||q==="ENOTDIR")continue;throw a("read",`Failed to inspect project overlay scope ${Y}: ${C$(X)}`)}if(I.isSymbolicLink())await YH(U,z,Y);await zH(U,z,Y,J,_)}return J.sort((Y,z)=>Y.overlayRelativePath.localeCompare(z.overlayRelativePath)),J}function Bk($){let _=SY($),U=Uk($),Q=`${process.pid}-${nL()}`;return A6(_,`.${U}.ocx-tmp-${Q}`)}async function Zk($,_){let U=Bk(_);try{await rL($,U),await eL(U,_)}catch(Q){try{await _k(U)}catch{}throw Q}}async function Vk($,_,U={}){let Q=U.publishAtomically??Zk,v;try{v=await o6(_)}catch(Y){throw a("validate",`Unable to inspect merged overlay root ${_}: ${C$(Y)}`)}if(!v.isDirectory())throw a("validate",`Merged overlay root is not a directory: ${_}`);let J=s_(v);for(let Y of $){if(await U.beforeSourceVerification?.(Y),Y.sourceSnapshot)await f0({absolutePath:Y.sourcePath,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:Y.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await f0({absolutePath:_,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let z;try{z=A4(_,Y.destinationRelativePath)}catch(G){throw a("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${C$(G)}`)}await P8(_,z,Y.destinationRelativePath);let I=SY(z);await U.beforeDestinationParentCreate?.({operation:Y,destinationPath:z,destinationParentPath:I}),await P8(_,z,Y.destinationRelativePath);try{await tL(I,{recursive:!0})}catch(G){throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}await P8(_,z,Y.destinationRelativePath);let X;try{X=await o6(I)}catch(G){throw a("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${C$(G)}`)}if(!X.isDirectory())throw a("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${r6}`);let q=s_(X);await U.beforeDestinationPublish?.({operation:Y,destinationPath:z,destinationParentPath:I}),await f0({absolutePath:_,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await f0({absolutePath:I,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:q,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await P8(_,z,Y.destinationRelativePath);try{await Q(Y.sourcePath,z)}catch(G){if(G instanceof n)throw G;throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}}}async function Dk($,_){let U;try{U=await QH($)}catch(Q){throw a("copy",`Failed to read profile directory ${$}: ${C$(Q)}`)}for(let Q of U){let v=A6($,Q),J=A6(_,Q);try{await oL(v,J,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw a("copy",`Failed to copy profile base file ${Q}: ${C$(Y)}`)}}}async function UH($){try{await $k($,{recursive:!0,force:!0})}catch(_){throw a("cleanup",`Failed to remove temporary merged config directory ${$}: ${C$(_)}`)}}function Mk($,_){let U=x8(TY($,_));if(!U||U===".")throw a("validate",`Overlay source path failed relative parsing: ${_}`);if(U===".."||U.startsWith("../")||JH(U))throw a("validate",`Overlay source path escapes project overlay scope: ${_}`);return U}function wk($,_){let U=_.map((Q)=>{if(!Q.sourceSnapshot)throw a("validate",`Overlay source snapshot missing for ${Q.destinationRelativePath}. ${r6}`);return{sourceRelativePath:Mk($,Q.sourcePath),destinationRelativePath:Q.destinationRelativePath,sourceSnapshot:Q.sourceSnapshot}});return{version:Yk,projectConfigDir:$,operations:U}}function Lk(){return null}async function kk($){let _=$.manifest.operations.map((U)=>({sourcePath:A4($.manifest.projectConfigDir,U.sourceRelativePath),destinationRelativePath:U.destinationRelativePath,sourceSnapshot:U.sourceSnapshot}));await Vk(_,$.mergedConfigDir,$.copySeams)}async function Ak($){if($.manifest.operations.length===0)return"best-effort-js";let _=$.nativeHelper??Lk();if(_)return await _.applyManifest($.manifest,$.mergedConfigDir),"native-fd";if($.hardeningMode==="native-fd-required")throw a("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${r6}`);return await kk({manifest:$.manifest,mergedConfigDir:$.mergedConfigDir,copySeams:$.copySeams}),"best-effort-js"}async function Fk($){let _=SY($),U;try{U=await m0(_)}catch(v){throw a("validate",`Unable to resolve project directory ${_}: ${C$(v)}`)}let Q;try{Q=await m0($)}catch(v){throw a("validate",`Unable to resolve project config directory ${$}: ${C$(v)}`)}if(!RY(U,Q))throw a("validate",`Project .opencode root resolves outside project directory: ${$}`);return Q}function Ok($){if($ instanceof n)return $;return a("copy",`Failed to prepare temporary merged config directory: ${C$($)}`)}async function IH($){let _=b1($.projectDir),U=$.hardeningMode??"best-effort-js",Q=null;try{Q=await aL(A6(vk(),Jk)),await Dk($.profileDir,Q);let v="best-effort-js";if(_){let Y=await Fk(_),z=await jk(Y),I=await bk(Y,$.seams?.collection),X=Wk(I,z),q=wk(Y,X);v=await Ak({manifest:q,mergedConfigDir:Q,hardeningMode:U,copySeams:$.seams?.copy,nativeHelper:$.seams?.nativeHelper})}let J=Q;return{path:J,cleanup:()=>UH(J),hardeningLevel:v}}catch(v){let J=Ok(v);if(Q)try{await UH(Q)}catch(Y){J.message=`${J.message}
172
- Cleanup warning: ${C$(Y)}`}throw J}}var Qk,Jk="ocx-oc-merged-",Yk=1,r6="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",Gk;var XH=b(()=>{c4();B6();Z4();z$();X1();Qk=["agent","agents","skill","skills"];Gk=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough()});import*as j6 from"path";function Nk($){let _=new Set,U=[];for(let Q=$.length-1;Q>=0;Q--){let v=$[Q];if(!_.has(v))_.add(v),U.unshift(v)}return U}function Sk($){return $.configBin??$.envBin??"opencode"}function qH($){return $.includes("/")||$.includes("\\")}function Tk($){let{configuredBin:_,cwd:U}=$,Q=$.resolveExecutable??((J)=>Bun.which(J));if(!_.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(qH(_))return j6.isAbsolute(_)?_:j6.resolve(U,_);let v=Q(_);if(!v)throw Error(`OpenCode launcher "${_}" is not available in PATH and cannot be used as OPENCODE_BIN`);return j6.isAbsolute(v)?v:j6.resolve(U,v)}function Rk($){let _=$.resolveExecutable??((X)=>Bun.which(X)),U=$.argv??process.argv,Q=$.execPath??process.execPath,v=$.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),J=$.inheritedOcxBin?.trim(),Y=v?Q:U[1],z=J&&J.length>0?J:Y;if(!z?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(qH(z))return j6.isAbsolute(z)?z:j6.resolve($.cwd,z);let I=_(z);if(!I)throw Error(`OCX executable "${z}" is not available in PATH and cannot be persisted as OCX_BIN`);return j6.isAbsolute(I)?I:j6.resolve($.cwd,I)}function Ek($){let _=Boolean($.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:U,OPENCODE_BIN:Q,OCX_CONTEXT:v,OCX_BIN:J,OCX_PROFILE:Y,...z}=$.baseEnv;return{...z,...$.opencodeBin!==void 0&&{OPENCODE_BIN:$.opencodeBin},..._&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:$.configDir??(_?p$($.profileName):O4()),...$.configContent&&{OPENCODE_CONFIG_CONTENT:$.configContent},..._&&{OCX_CONTEXT:"1"},..._&&$.ocxBin&&{OCX_BIN:$.ocxBin},...$.profileName&&{OCX_PROFILE:$.profileName}}}function GH($){$.command("oc").alias("opencode").description("Launch OpenCode with resolved configuration").option("-p, --profile <name>","Use specific profile").option("--no-rename","Disable terminal/tmux window renaming").allowUnknownOption().allowExcessArguments(!0).action(async(_,U)=>{try{await Pk(U.args,_)}catch(Q){_$(Q)}})}async function Pk($,_){let U=process.cwd(),Q=await q6.create(U,{profile:_.profile}),v=Q.resolve(),J=Q.getProfile();if(v.profileName)W.info(`Using profile: ${v.profileName}`);let Y=J?.ocx,z=_.rename!==!1&&Y?.renameWindow!==!1;if(v.profileName){let u=L6(v.profileName);if(!await Bun.file(u).exists())W.warn(`No opencode.jsonc found at ${u}. Create one to customize OpenCode settings.`)}let I=Array.isArray(v.opencode.instructions)?v.opencode.instructions:[],X=[...v.instructions,...I],q=Nk(X),G=q.length>0||Object.keys(v.opencode).length>0?{...v.opencode,instructions:q.length>0?q:void 0}:void 0,j=null,H=null,Z=null,V=null,S=null,T=()=>{if(j)j.kill("SIGINT");else S=130},r=()=>{if(j)j.kill("SIGTERM");else S=143},A=()=>{if(z)FY()};try{if(process.on("SIGINT",T),process.on("SIGTERM",r),process.on("exit",A),S!==null){V=S;return}if(v.profileName)H=await IH({projectDir:U,profileDir:p$(v.profileName)});if(S!==null){V=S;return}if(z){eK();let o=await rK(U);if(S!==null){V=S;return}sK($H(U,v.profileName??"default",o))}if(S!==null){V=S;return}let u=Sk({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),k=Boolean(v.profileName),O=k?Tk({configuredBin:u,cwd:U}):u,w=k?Rk({cwd:U,inheritedOcxBin:process.env.OCX_BIN}):void 0,v$=G?JSON.stringify(G):void 0;try{j=Bun.spawn({cmd:[O,...$],cwd:U,env:Ek({baseEnv:process.env,profileName:v.profileName??void 0,ocxBin:w,opencodeBin:O,configDir:H?.path,configContent:v$}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(o){throw a("spawn",`Failed to launch OpenCode binary "${u}": ${o instanceof Error?o.message:String(o)}`)}V=await j.exited}catch(u){Z=u instanceof Error?u:a("spawn",`OpenCode process failed: ${String(u)}`)}finally{if(process.off("SIGINT",T),process.off("SIGTERM",r),process.off("exit",A),z)FY();if(H)try{await H.cleanup()}catch(u){if(Z!==null||S!==null||V!==null&&V!==0)W.warn(`Cleanup warning: ${u instanceof Error?u.message:String(u)}`);else Z=u instanceof Error?u:a("cleanup",`Failed to remove temporary merged config directory: ${String(u)}`)}}if(Z)throw Z;if(V!==null)process.exit(V)}var jH=b(()=>{g_();Z4();oK();c$();i$();p6();_H();XH()});import{existsSync as g0}from"fs";import{mkdir as EY,mkdtemp as xk,rename as uk,rm as KH,writeFile as yk}from"fs/promises";import{dirname as HH,join as u8,relative as Ck}from"path";function WH($,_,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${_}" (${Q})`}function VH($,_){let[U,Q]=_.split("/");if(!U||!Q)return;return`${d$($)}/components/${Q}.json`}function bH($){if(!$)return null;let[_,U,...Q]=$.split("/");if(!_||!U||Q.length>0)return null;return{registryName:_,componentName:U}}function fk($,_){if(!$)return{};let U;try{let Y=new URL($),z=Y.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(z?.[1])U=decodeURIComponent(z[1]);else{let I=Y.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(I?.[1])U=decodeURIComponent(I[1])}}catch{}let Q=d$($),v,J=-1;for(let[Y,z]of Object.entries(_)){let I=d$(z.url);if(!(Q===I||Q.startsWith(`${I}/`))||I.length<=J)continue;v=Y,J=I.length}return{registryName:v,componentName:U}}function mk($){let _=$.depRefs[0]??`${$.namespace}/${$.component}`,U={...$.profileRegistries,...$.profileRegistries[$.namespace]?{}:{[$.namespace]:{url:$.registryUrl}}},Q=$.error.registryName,v=$.error.qualifiedName,J=bH(v);if(!Q&&J)Q=J.registryName;let Y=J?.componentName,z=v&&!J&&!v.includes("/")?v:void 0,I=fk($.error.url,U);if(!Q&&I.registryName)Q=I.registryName;let X=Y??z??I.componentName;if((!v||!J)&&Q&&X)v=`${Q}/${X}`;if(!v)v=_;if(!Q)Q=bH(v)?.registryName??$.namespace;let q=U[Q]?.url||(Q===$.namespace?$.registryUrl:void 0);return{registryName:Q,qualifiedName:v,fallbackUrl:$.error.url||(q?VH(q,v):void 0)}}function BH($,_){let U=$.phase??_.fallbackPhase,Q=$.url??_.fallbackUrl,v=[`phase: ${U}`,`qualifiedName: ${_.qualifiedName}`,`registryContext: ${_.registryContext}`,`registryName: ${_.registryName}`,...Q?[`url: ${Q}`]:[]];return new E$(`${$.message} (${v.join(", ")})`,{url:Q,status:$.status,statusText:$.statusText,phase:U,qualifiedName:_.qualifiedName,registryContext:_.registryContext,registryName:_.registryName})}function ZH($,_){if(!$.startsWith(".opencode/"))throw new M(`Invalid embedded target "${$}": expected .opencode/ prefix for embedded profile files.`);let U=$.slice(10);if(!U)throw new M(`Invalid embedded target "${$}": missing path after .opencode/ prefix.`);let Q;try{Q=A4(_,U)}catch(J){if(J instanceof U4)throw new M(`Invalid embedded target "${$}": ${J.message}`);throw J}let v=Ck(_,Q).replace(/\\/g,"/");if(v==="."||v==="")throw new M(`Invalid embedded target "${$}": target must resolve to a file path.`);return v}async function PY($){let{namespace:_,component:U,profileName:Q,registryUrl:v,quiet:J}=$;if(!I6.safeParse(Q).success)throw new M(`Invalid profile name: "${Q}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let z;if(_)z=_;else throw new M(`Registry name is required for URL-based profile installs.
168
+ `,{mode:384}),Y.push("profileAgents");if($?.succeed("Initialized global profiles"),Q.json)console.log(JSON.stringify({success:!0,files:{globalConfig:J,profileOcx:G,profileOpencode:K,profileAgents:W},created:Y,existed:q}));else if(!Q.quiet)if(Y.length>0){for(let z of Y){if(z==="globalConfig")_.info(`Created global config: ${J}`);if(z==="profileOcx")_.info(`Created profile config: ${G}`);if(z==="profileOpencode")_.info(`Created profile opencode config: ${K}`);if(z==="profileAgents")_.info(`Created profile instructions: ${W}`)}_.info(""),_.info("Next steps:"),_.info(" 1. Edit your profile config: ocx config edit -p default"),_.info(" 2. Add registries: ocx registry add <url> --name <name> --global"),_.info(" 3. Launch OpenCode: ocx opencode"),_.info(" 4. Create more profiles: ocx profile add <name> --global")}else _.info("Global profiles already initialized (all files exist)")}catch(Y){throw $?.fail("Failed to initialize"),Y}}async function kU(Q,$){let Y=Q,q=$.namespace??"my-registry",J=$.author??"Your Name";if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(q))throw new L("Invalid namespace format: must start with letter/number, use hyphens only between segments (e.g., 'my-registry')");if((await aH(Y).catch(()=>[])).some((K)=>!K.startsWith(".")))throw new n1("Directory is not empty. Remove existing files or choose a different directory.");let G=$.quiet?null:Z1({text:"Scaffolding registry..."});G?.start();try{if(G)G.text=$.local?"Copying template...":"Fetching template...";if($.local)await c9(Y,{recursive:!0}),await QG($.local,Y);else{let K=$.canary?"main":vU();await xU(Y,K,$.verbose)}if(G)G.text="Configuring project...";if(await yU(Y,{namespace:q,author:J}),G?.succeed(`Created registry: ${q}`),$.json)console.log(JSON.stringify({success:!0,namespace:q,path:Y}));else if(!$.quiet)_.info(""),_.info("Next steps:"),_.info(" 1. bun install"),_.info(" 2. Edit registry.jsonc with your components"),_.info(" 3. bun run build"),_.info(""),_.info("Deploy to:"),_.info(" Cloudflare: bunx wrangler deploy"),_.info(" Vercel: vercel"),_.info(" Netlify: netlify deploy")}catch(K){throw G?.fail("Failed to scaffold registry"),K}}async function QG(Q,$){await IU(Q,$,{recursive:!0})}function vU(){return"v2.0.7"}function PU(Q){let $=Q==="main"?"heads/main":`tags/${Q}`;return`https://github.com/${bU}/archive/refs/${$}.tar.gz`}async function xU(Q,$,Y){let q=PU($);if(Y)_.info(`Fetching ${q}`);let J=await fetch(q);if(!J.ok||!J.body)throw new I1(`Failed to fetch template from ${q}: ${J.statusText}`);let X=s3(Q,".ocx-temp");await c9(X,{recursive:!0});try{let H=s3(X,"template.tar.gz"),G=await J.arrayBuffer();await y6(H,Buffer.from(G));let K=Bun.spawn(["tar","-xzf",H,"-C",X],{stdout:"ignore",stderr:"pipe"});if(await K.exited!==0){let M=await new Response(K.stderr).text();throw Error(`Failed to extract template: ${M}`)}let B=(await aH(X)).find((M)=>M.startsWith("ocx-"));if(!B)throw Error("Failed to find extracted template directory");let Z=s3(X,B,RU);await QG(Z,Q)}finally{await TU(X,{recursive:!0,force:!0})}}function CU(Q){return Q.split(/[-_\s]+/).map(($)=>$.charAt(0).toUpperCase()+$.slice(1).toLowerCase()).join(" ")}async function yU(Q,$){let Y=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let q of Y){let J=s3(Q,q);if(!J9(J))continue;let X=await NU(J).then((H)=>H.toString());if(X=X.replace(/my-registry/g,$.namespace),X=X.replace(/My Registry/g,CU($.namespace)),X=X.replace(/Your Name/g,$.author),q==="registry.jsonc")if(/"\$schema"\s*:/.test(X))X=X.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${h0}$2`);else X=X.replace(/{/,`{
169
+ "$schema": "${h0}",`);await y6(J,X)}}var bU="kdcokenny/ocx",RU="examples/registry-starter";var $G=A(()=>{z3();j3();t0();W0();q0();Q6();t();u1();c1();d0();l0()});function hU(Q,$,Y){let q=Q.indexOf("/");if(q===-1)throw Error(`Invalid legacy key: "${Q}". Expected format: alias/component`);let J=Q.slice(0,q),X=Q.slice(q+1);if(!J||!X)throw Error(`Invalid legacy key: "${Q}". Both alias and component are required.`);let H=A2(Y,J,X,$.version),G={registryUrl:Y,registryName:J,name:X,revision:$.version,hash:$.hash,files:$.files.map((K)=>({path:K,hash:""})),installedAt:$.installedAt,...$.updatedAt&&{updatedAt:$.updatedAt},owner:{type:"user"}};return[H,G]}function r3(Q,$,Y){let q={},J=[],X=Object.keys(Q.installed).sort();for(let G of X){let K=Q.installed[G];if(!K)continue;let W=$.registries[K.registry];if(!W)throw new h(`Registry "${K.registry}" referenced in lock key "${G}" is not configured in ocx.jsonc. Add it before migrating.`);let[z,B]=hU(G,K,W.url);q[z]=B,J.push({legacyKey:G,canonicalId:z,name:B.name,registryName:B.registryName})}return{receipt:{version:1,...Y&&{root:Y},installed:q},components:J}}function YG(Q){let $=Q.registries;if(!$||typeof $!=="object"||Array.isArray($))return[];let Y=[],q=$;for(let J of Object.keys(q).sort()){let X=q[J];if(!X||typeof X!=="object"||Array.isArray(X))continue;let H=X;for(let G of fU)if(G in H)Y.push({registry:J,field:G,action:"remove_deprecated"})}return Y}var fU;var qG=A(()=>{q0();t();fU=["version"]});import{existsSync as h6,readdirSync as uU,readFileSync as GG,statSync as mU}from"fs";import{rename as a3,writeFile as gU}from"fs/promises";import{join as JG}from"path";function KG(Q){Q.command("migrate").description("Migrate legacy ocx.lock to receipt format (.ocx/receipt.jsonc)").option("--global","Migrate global config scope (includes profiles)").option("--apply","Apply migration (default is dry-run preview)").option("--json","Output as JSON").option("-q, --quiet","Suppress output").option("--cwd <path>","Working directory").action(async($)=>{try{await dU($)}catch(Y){s(Y,{json:$.json})}})}async function dU(Q){if(Q.global){await pU(Q);return}await YV(Q,"local",HV(Q),!1)}async function pU(Q){let $=Q.cwd??L0(),Y=lU($);if(!Q.apply){let H=[],G=new Set;for(let{label:z,path:B}of Y){let Z=S8(B),M=T9(B,{isFlattened:!0});if(Z.exists&&M.exists)G.add(z);try{let V=await iU(B,!0,{emitWarnings:!Q.json&&!Q.quiet});H.push({...V,target:z})}catch(V){let U=HG(z,V);if(H.push(U),!Q.json&&!Q.quiet)_.error(`[global:${z}] Preview failed: ${U.error}`)}}let K=XG(H,"global",!1),W=oU(K);if(Q.json){if(d9(K,!1),W)process.exit(1);return}if(!Q.quiet)qV(H,K,G);if(W)process.exit(1);return}let q=[],J=!1;for(let{label:H,path:G}of Y)try{let K=await nU(G,!0);q.push({...K,target:H})}catch(K){J=!0;let W=HG(H,K);if(q.push(W),!Q.json&&!Q.quiet)_.error(`[global:${H}] Migration failed: ${W.error}`)}let X=XG(q,"global",!0);if(Q.json){if(d9(X,!0),J)process.exit(1);return}if(!Q.quiet)JV(q,J);if(J)process.exit(1)}function lU(Q){let $=[];$.push({label:"root",path:Q});let Y=JG(Q,"profiles");if(h6(Y)&&mU(Y).isDirectory()){let J=uU(Y,{withFileTypes:!0}).filter((X)=>X.isDirectory()&&!X.name.startsWith(".")).map((X)=>X.name).sort();for(let X of J)$.push({label:`profile:${X}`,path:JG(Y,X)})}return $}async function iU(Q,$,Y){let q=Y?.emitWarnings??!0,J=f6(Q),X=S8(Q),H=T9(Q,{isFlattened:$}),G=X.exists&&H.exists;if(X.exists&&J.length===0&&!G)return{status:"already_v2",count:0,components:[],configActions:[]};if(!H.exists&&!X.exists&&J.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let K=[];if(H.exists&&!X.exists)try{let W=await L2(Q,{isFlattened:$}),z=await T0(Q,{emitParseDiagnostics:q});if(W&&z)K=r3(W,z,Q).components}catch{if(q)_.warn(`[preview] Could not parse lock/config at "${Q}"; component count may be incomplete.`)}return{status:"preview",count:K.length,components:K,configActions:J}}async function nU(Q,$){let Y=f6(Q),q=S8(Q),J=T9(Q,{isFlattened:$}),X=q.exists&&J.exists;if(q.exists&&Y.length===0&&!X)return{status:"already_v2",count:0,components:[],configActions:[]};if(!J.exists&&!q.exists&&Y.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let H=null;if(J.exists&&!q.exists){let z=await L2(Q,{isFlattened:$});if(!z)throw new L("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let B=await T0(Q);if(!B)throw new h("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:Z,components:M}=r3(z,B,Q);H={newReceipt:Z,components:M}}let G=H?.components??[],K=G.length;if(H){await N0(Q,H.newReceipt);let z=t3(J.path);await a3(J.path,z)}if(X){let z=t3(J.path);await a3(J.path,z)}if(Y.length>0)await WG(Q,Y);return{status:H!==null||X||Y.length>0?"migrated":"already_v2",count:K,components:G,configActions:Y}}function XG(Q,$,Y){let q=Q.some((z)=>z.status==="error"),J=Q.some((z)=>z.status==="migrated"||z.status==="preview"),X=Q.every((z)=>z.status==="already_v2"||z.status==="nothing_to_migrate"),H=Q.reduce((z,B)=>z+B.count,0),G=Q.flatMap((z)=>z.components),K=Q.flatMap((z)=>z.configActions),W;if(q)W=Y?"partial_failure":"preview_with_errors";else if(X)W=Q.every((B)=>B.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(Y)W=J?"migrated":"already_v2";else W=J?"preview":"already_v2";return{success:!q,status:W,scope:$,count:H,components:G,configActions:K,targets:Q}}function oU(Q){return Q.status==="preview_with_errors"}function d9(Q,$){let Y=sU(Q,$);console.log(JSON.stringify(Y,null,2))}function sU(Q,$){let Y=rU(Q),q=Y.flatMap((J)=>J.blockers??[]);return{...Q,lifecycle_status:eU(Q.status,$),schema_version:cU,blockers:q,targets:Y}}function rU(Q){return(Q.targets&&Q.targets.length>0?Q.targets:[aU(Q)]).map((Y)=>tU(Y))}function aU(Q){return{target:Q.scope,status:Q.status,count:Q.count,components:Q.components,configActions:Q.configActions,blockers:Q.blockers??[]}}function tU(Q){let $=Q.blockers??(Q.status==="error"?[{code:"MIGRATE_BLOCKER",message:Q.error??"Migration blocked",path:Q.target}]:[]);return{...Q,scope:Q.scope??Q.target,result:Q.result??Q.status,blockers:$}}function eU(Q,$){if($)return Q==="partial_failure"?"apply_failed":"apply_ok";return Q==="preview_with_errors"?"preview_blocked":"preview_ok"}function HG(Q,$){let Y=QV($,Q);return{target:Q,status:"error",count:0,components:[],configActions:[],error:Y.message,blockers:[Y]}}function QV(Q,$){let Y=Q instanceof Error?Q.message:String(Q);return{code:$V(Q,Y),message:Y,path:$}}function $V(Q,$){if(typeof Q==="object"&&Q!==null&&"code"in Q){let q=Q.code;if(typeof q==="string"&&q.length>0)return q}let Y=$.toLowerCase();if(Y.includes("ocx.jsonc")||Y.includes("registry"))return"CONFIG_ERROR";if(Y.includes("parse")||Y.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function YV(Q,$,Y,q){let J=f6(Y),X=S8(Y),H=T9(Y,{isFlattened:q}),G=X.exists&&H.exists;if(X.exists&&J.length===0&&!G){let M={success:!0,status:"already_v2",scope:$,count:0,components:[],configActions:[]};if(Q.json){d9(M,Boolean(Q.apply));return}if(!Q.quiet)_.success(`[${$}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!H.exists&&!X.exists&&J.length===0){let M={success:!0,status:"nothing_to_migrate",scope:$,count:0,components:[],configActions:[]};if(Q.json){d9(M,Boolean(Q.apply));return}if(!Q.quiet)_.info(`[${$}] Nothing to migrate. No legacy ocx.lock found.`);return}let K=null;if(H.exists&&!X.exists){let M=await L2(Y,{isFlattened:q});if(!M)throw new L("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let V=await T0(Y);if(!V)throw new h("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:U,components:R}=r3(M,V,Y);K={newReceipt:U,components:R}}let W=K?.components??[],z=W.length;if(!Q.apply){let M={success:!0,status:"preview",scope:$,count:z,components:W,configActions:J};if(Q.json){d9(M,!1);return}if(!Q.quiet){if(z>0){_.info(`[${$}] Migration preview: ${z} component(s) would be migrated.`),_.break();for(let V of W)_.info(` ${V.legacyKey} \u2192 ${V.canonicalId}`);_.break()}if(G)_.info(`[${$}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),_.break();if(J.length>0){_.info(`[${$}] Config normalization: ${J.length} deprecated field(s) would be removed.`);for(let V of J)_.info(` registries.${V.registry}.${V.field} \u2192 remove`);_.break()}if(z===0&&J.length===0&&!G)_.info(`[${$}] Nothing to migrate.`);else _.info("No changes made. Run with --apply to perform migration.")}return}if(K){await N0(Y,K.newReceipt);let M=t3(H.path);if(await a3(H.path,M),!Q.json&&!Q.quiet){_.success(`[${$}] Migrated ${z} component(s) to receipt format (.ocx/receipt.jsonc).`),_.break();for(let V of W)_.success(` \u2713 ${V.legacyKey} \u2192 ${V.canonicalId}`);_.break(),_.info(`Legacy lock backed up to: ${M}`)}}if(G){let M=t3(H.path);if(await a3(H.path,M),!Q.json&&!Q.quiet)_.success(`[${$}] Removed stale legacy lock (receipt already exists).`),_.info(`Legacy lock backed up to: ${M}`)}if(J.length>0){if(await WG(Y,J),!Q.json&&!Q.quiet){if(K)_.break();_.success(`[${$}] Normalized ${J.length} deprecated config field(s).`);for(let M of J)_.success(` \u2713 registries.${M.registry}.${M.field} removed`)}}let Z={success:!0,status:K!==null||G||J.length>0?"migrated":"already_v2",scope:$,count:z,components:W,configActions:J};if(Q.json){d9(Z,!0);return}if(!K&&J.length>0&&!Q.quiet)_.break(),_.success(`[${$}] Config normalization complete.`)}function qV(Q,$,Y){if($.status==="nothing_to_migrate"){_.info("[global] Nothing to migrate across all targets.");return}if($.status==="already_v2"){_.success("[global] All targets already migrated.");return}_.info(`[global] Migration preview across ${Q.length} target(s):`),_.break();for(let q of Q){let J=Y.has(q.target),X=XV(q,J);_.info(` ${q.target}: ${X}`)}if(_.break(),$.status==="preview_with_errors")_.warn("[global] Preview completed with errors on some targets. See above for details."),_.info("No changes made. Run with --apply to perform migration.");else _.info("No changes made. Run with --apply to perform migration.")}function JV(Q,$){_.break();let Y=Q.filter((X)=>X.status==="migrated"),q=Q.filter((X)=>X.status==="already_v2"||X.status==="nothing_to_migrate"),J=Q.filter((X)=>X.status==="error");if(Y.length>0){_.success(`[global] Migrated ${Y.length} target(s):`);for(let X of Y)_.success(` \u2713 ${X.target}`)}if(q.length>0)_.info(`[global] ${q.length} target(s) already up to date.`);if(J.length>0){_.error(`[global] ${J.length} target(s) failed:`);for(let X of J)_.error(` \u2717 ${X.target}: ${X.error}`)}if($)_.break(),_.error("[global] Migration completed with errors. See above for details.")}function XV(Q,$){if(Q.status==="error")return"error";if(Q.status==="already_v2")return"already migrated";if(Q.status==="nothing_to_migrate")return"nothing to migrate";let Y=[];if(Q.count>0)Y.push(`${Q.count} component(s) to migrate`);if(Q.configActions.length>0)Y.push(`${Q.configActions.length} config field(s) to normalize`);if($)Y.push("legacy lock cleanup pending");if(Y.length===0)return"nothing to migrate";return Y.join(", ")}function HV(Q){if(Q.global)return Q.cwd??L0();return Q.cwd??process.cwd()}function t3(Q){let $=`${Q}.bak`;if(!h6($))return $;for(let Y=1;Y<=100;Y++){let q=`${$}.${Y}`;if(!h6(q))return q}return`${$}.${Date.now()}`}function f6(Q){let $=E8(Q);if(!$.exists)return[];try{let Y=GG($.path,"utf-8"),q=O1(Y,[],{allowTrailingComma:!0});if(!q||typeof q!=="object"||Array.isArray(q))return[];return YG(q)}catch{return[]}}async function WG(Q,$){if($.length===0)return;let Y=E8(Q);if(!Y.exists)return;let q=GG(Y.path,"utf-8");for(let J of $){let X=Z9(q,["registries",J.registry,J.field],void 0,GV);q=M9(q,X)}await gU(Y.path,q)}var cU=1,GV;var zG=A(()=>{D0();q0();t();u1();c1();k8();qG();GV={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
170
+ `}}});import{basename as KV,resolve as yR}from"path";function e3(){let{GIT_DIR:Q,GIT_WORK_TREE:$,...Y}=process.env;return Y}async function WV(Q){let $=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:Q,env:e3(),stdout:"pipe",stderr:"pipe"});if(await $.exited===0){let K=(await new Response($.stdout).text()).trim();if(K)return K}let q=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:Q,env:e3(),stdout:"pipe",stderr:"pipe"});if(await q.exited===0){let K=(await new Response(q.stdout).text()).trim();if(K)return K}let X=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:Q,env:e3(),stdout:"pipe",stderr:"pipe"});if(await X.exited===0){let K=(await new Response(X.stdout).text()).trim();if(K)return K}return null}async function zV(Q){let $=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:Q,env:e3(),stdout:"pipe",stderr:"pipe"});if(await $.exited!==0)return null;let J=(await new Response($.stdout).text()).trim();if(!J)return null;return KV(J)}async function BG(Q){let[$,Y]=await Promise.all([zV(Q),WV(Q)]);return{repoName:$,branch:Y}}var _G=()=>{};import BV from"path";function MG(){return Boolean(process.env.TMUX)}function _V(Q){if(!MG())return;Bun.spawnSync(["tmux","rename-window",Q]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function ZV(Q){if(!t8)return;process.stdout.write(`\x1B]0;${Q}\x07`)}function UG(Q){_V(Q),ZV(Q)}function VG(){if(Q7||!t8)return;process.stdout.write("\x1B[22;2t"),Q7=!0}function u6(){if(!Q7)return;if(MG())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(t8)process.stdout.write("\x1B[23;2t");Q7=!1}function AG(Q,$,Y){let q=Y.repoName??BV.basename(Q);if(!Y.branch)return`ocx[${$}]:${q}`;let J=Y.branch.length>ZG?`${Y.branch.slice(0,ZG-3)}...`:Y.branch;return`ocx[${$}]:${q}/${J}`}var ZG=20,Q7=!1;var LG=A(()=>{N2()});import{randomUUID as MV}from"crypto";import{copyFile as UV,cp as VV,lstat as C8,mkdir as AV,mkdtemp as LV,readdir as wG,readFile as FV,realpath as l9,rename as jV,rm as wV,unlink as DV}from"fs/promises";import{tmpdir as OV}from"os";import{basename as IV,dirname as c6,isAbsolute as DG,join as V8,relative as d6}from"path";var{Glob:m6}=globalThis.Bun;function p(Q,$){return new h(`ocx oc ${Q} error: ${$}`)}function P1(Q){if(Q instanceof Error)return Q.message;return String(Q)}function RV(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function Y7(Q){return Q.replaceAll("\\","/")}function g6(Q){return Q.startsWith("./")?Q.slice(2):Q}function p6(Q,$){let Y=d6(Q,$);if(Y.length===0)return!0;return!Y.startsWith("..")&&!DG(Y)}function SV(Q){if(Q.isFile())return"file";if(Q.isDirectory())return"directory";if(Q.isSymbolicLink())return"symlink";return"other"}function x2(Q){return{entryType:SV(Q),device:String(Q.dev),inode:String(Q.ino),mode:String(Q.mode),size:String(Q.size),mtimeMs:String(Q.mtimeMs)}}function EV(Q,$){return Q.entryType===$.entryType&&Q.device===$.device&&Q.inode===$.inode&&Q.mode===$.mode}function kV(Q,$){return Q.size===$.size&&Q.mtimeMs===$.mtimeMs}async function p9(Q){let $;try{$=await C8(Q.absolutePath)}catch{throw p("validate",`Overlay path changed during ${Q.phase}: ${Q.overlayRelativePath}. ${x8}`)}if(Q.mustRemainDirectory&&!$.isDirectory())throw p("validate",`Overlay path changed during ${Q.phase}: ${Q.overlayRelativePath}. ${x8}`);if(Q.mustRemainFile&&!$.isFile())throw p("validate",`Overlay path changed during ${Q.phase}: ${Q.overlayRelativePath}. ${x8}`);let Y=x2($),q=EV(Q.expectedSnapshot,Y),X=!(Q.compareContent??!0)?!0:kV(Q.expectedSnapshot,Y);if(!q||!X)throw p("validate",`Overlay path changed during ${Q.phase}: ${Q.overlayRelativePath}. ${x8}`)}async function $7(Q,$,Y){let J=Y7(d6(Q,$)).split("/").filter((H)=>H.length>0),X=Q;for(let H of J){X=V8(X,H);let G;try{G=await C8(X)}catch(K){if(K.code==="ENOENT")return;throw p("validate",`Failed to inspect overlay destination path (${Y}): ${P1(K)}`)}if(G.isSymbolicLink())throw p("validate",`Overlay destination path contains existing symlink (${Y})`)}}function FG(Q,$,Y){for(let q of Y)try{new m6(g6(q))}catch{throw p("validate",`Invalid project overlay policy at ${Q}: ${$} contains invalid glob pattern "${q}"`)}}async function PV(Q){if(!Q)return{include:[],exclude:[]};let $=V8(Q,c0),Y=await xV(Q,$);if(!Y)return{include:[],exclude:[]};let q;try{q=await FV(Y,"utf8")}catch(W){throw p("read",`Failed to read project overlay policy at ${$}: ${P1(W)}`)}let J=[],X=O1(q,J,{allowTrailingComma:!0});if(J.length>0)throw p("parse",`Failed to parse project overlay policy at ${$}: ${RV(J)}`);if(!X||typeof X!=="object"||Array.isArray(X))throw p("validate",`Invalid project overlay policy at ${$}: root must be an object`);let H=vV.safeParse(X);if(!H.success){let W=H.error.issues[0],z=W?.path.length?W.path.join("."):"root",B=W?.message??"Invalid project overlay policy";throw p("validate",`Invalid project overlay policy at ${$}: ${z} ${B}`)}let G=H.data.include??[],K=H.data.exclude??[];return FG($,"include",G),FG($,"exclude",K),{include:G,exclude:K}}async function xV(Q,$){let Y;try{Y=await C8($)}catch(X){let H=X.code;if(H==="ENOENT"||H==="ENOTDIR")return null;throw p("read",`Failed to inspect project overlay policy at ${$}: ${P1(X)}`)}if(!Y.isSymbolicLink())return $;let q;try{q=await l9(Q)}catch(X){throw p("validate",`Unable to resolve project config directory ${Q}: ${P1(X)}`)}let J;try{J=await l9($)}catch(X){let H=X.code;if(H==="ENOENT"||H==="ENOTDIR")throw p("validate",`Broken symlink in project overlay policy: ${$}`);throw p("read",`Failed to inspect project overlay policy symlink at ${$}: ${P1(X)}`)}if(!p6(q,J))throw p("validate",`Symlink escapes project overlay policy scope: ${$}`);return J}function CV(Q,$){for(let Y of $.include)if(new m6(g6(Y)).match(Q))return!0;for(let Y of $.exclude)if(new m6(g6(Y)).match(Q))return!1;return!0}function yV(Q,$){return Q.filter((Y)=>CV(Y.overlayRelativePath,$)).map((Y)=>({sourcePath:Y.sourcePath,destinationRelativePath:Y.overlayRelativePath,sourceSnapshot:Y.sourceSnapshot}))}async function OG(Q,$,Y){let q;try{q=await l9($)}catch(J){let X=J.code;if(X==="ENOENT"||X==="ENOTDIR")throw p("validate",`Broken symlink in project overlay scope: ${Y}`);throw p("read",`Failed to inspect symlink at ${Y}: ${P1(J)}`)}if(!p6(Q,q))throw p("validate",`Symlink escapes project overlay scope: ${Y}`);throw p("validate",`Symlink entries are not supported in project overlay scope: ${Y}`)}async function IG(Q,$,Y,q,J){let X;try{X=await C8($)}catch(G){throw p("read",`Failed to inspect project overlay path ${Y}: ${P1(G)}`)}if(X.isSymbolicLink())await OG(Q,$,Y);let H=x2(X);if(X.isDirectory()){await J.beforeDirectoryRead?.({absolutePath:$,overlayRelativePath:Y});let G;try{G=await wG($)}catch(K){throw p("read",`Failed to read project overlay directory ${Y}: ${P1(K)}`)}G.sort((K,W)=>K.localeCompare(W));for(let K of G){let W=V8($,K),z=Y7(V8(Y,K));await IG(Q,W,z,q,J)}await p9({absolutePath:$,overlayRelativePath:Y,expectedSnapshot:H,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!X.isFile())return;q.push({sourcePath:$,overlayRelativePath:Y7(Y),sourceSnapshot:H})}async function hV(Q,$={}){let Y;try{Y=await l9(Q)}catch(H){throw p("validate",`Unable to resolve project config directory ${Q}: ${P1(H)}`)}let q;try{q=await C8(Q)}catch(H){throw p("validate",`Unable to inspect project overlay root ${Q}: ${P1(H)}`)}if(!q.isDirectory())throw p("validate",`Project overlay root changed before discovery: ${Q}. ${x8}`);let J=x2(q),X=[];for(let H of NV){let G=V8(Q,H);await $.beforeScopeInspect?.({scope:H,scopeAbsolutePath:G,projectConfigDir:Q}),await p9({absolutePath:Q,overlayRelativePath:".opencode",expectedSnapshot:J,phase:"overlay discovery",mustRemainDirectory:!0});let K;try{K=await C8(G)}catch(W){let z=W.code;if(z==="ENOENT"||z==="ENOTDIR")continue;throw p("read",`Failed to inspect project overlay scope ${H}: ${P1(W)}`)}if(K.isSymbolicLink())await OG(Y,G,H);await IG(Y,G,H,X,$)}return X.sort((H,G)=>H.overlayRelativePath.localeCompare(G.overlayRelativePath)),X}function fV(Q){let $=c6(Q),Y=IV(Q),q=`${process.pid}-${MV()}`;return V8($,`.${Y}.ocx-tmp-${q}`)}async function uV(Q,$){let Y=fV($);try{await UV(Q,Y),await jV(Y,$)}catch(q){try{await DV(Y)}catch{}throw q}}async function mV(Q,$,Y={}){let q=Y.publishAtomically??uV,J;try{J=await C8($)}catch(H){throw p("validate",`Unable to inspect merged overlay root ${$}: ${P1(H)}`)}if(!J.isDirectory())throw p("validate",`Merged overlay root is not a directory: ${$}`);let X=x2(J);for(let H of Q){if(await Y.beforeSourceVerification?.(H),H.sourceSnapshot)await p9({absolutePath:H.sourcePath,overlayRelativePath:H.destinationRelativePath,expectedSnapshot:H.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await p9({absolutePath:$,overlayRelativePath:".merged",expectedSnapshot:X,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let G;try{G=V0($,H.destinationRelativePath)}catch(B){throw p("validate",`Overlay destination path is invalid (${H.destinationRelativePath}): ${P1(B)}`)}await $7($,G,H.destinationRelativePath);let K=c6(G);await Y.beforeDestinationParentCreate?.({operation:H,destinationPath:G,destinationParentPath:K}),await $7($,G,H.destinationRelativePath);try{await AV(K,{recursive:!0})}catch(B){throw p("copy",`Failed to copy overlay file ${H.destinationRelativePath}: ${P1(B)}`)}await $7($,G,H.destinationRelativePath);let W;try{W=await C8(K)}catch(B){throw p("validate",`Failed to inspect overlay destination parent (${H.destinationRelativePath}): ${P1(B)}`)}if(!W.isDirectory())throw p("validate",`Overlay destination parent changed before publish (${H.destinationRelativePath}). ${x8}`);let z=x2(W);await Y.beforeDestinationPublish?.({operation:H,destinationPath:G,destinationParentPath:K}),await p9({absolutePath:$,overlayRelativePath:".merged",expectedSnapshot:X,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await p9({absolutePath:K,overlayRelativePath:H.destinationRelativePath,expectedSnapshot:z,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await $7($,G,H.destinationRelativePath);try{await q(H.sourcePath,G)}catch(B){if(B instanceof h)throw B;throw p("copy",`Failed to copy overlay file ${H.destinationRelativePath}: ${P1(B)}`)}}}async function gV(Q,$){let Y;try{Y=await wG(Q)}catch(q){throw p("copy",`Failed to read profile directory ${Q}: ${P1(q)}`)}for(let q of Y){let J=V8(Q,q),X=V8($,q);try{await VV(J,X,{recursive:!0,force:!0,errorOnExist:!1})}catch(H){throw p("copy",`Failed to copy profile base file ${q}: ${P1(H)}`)}}}async function jG(Q){try{await wV(Q,{recursive:!0,force:!0})}catch($){throw p("cleanup",`Failed to remove temporary merged config directory ${Q}: ${P1($)}`)}}function cV(Q,$){let Y=Y7(d6(Q,$));if(!Y||Y===".")throw p("validate",`Overlay source path failed relative parsing: ${$}`);if(Y===".."||Y.startsWith("../")||DG(Y))throw p("validate",`Overlay source path escapes project overlay scope: ${$}`);return Y}function dV(Q,$){let Y=$.map((q)=>{if(!q.sourceSnapshot)throw p("validate",`Overlay source snapshot missing for ${q.destinationRelativePath}. ${x8}`);return{sourceRelativePath:cV(Q,q.sourcePath),destinationRelativePath:q.destinationRelativePath,sourceSnapshot:q.sourceSnapshot}});return{version:bV,projectConfigDir:Q,operations:Y}}function pV(){return null}async function lV(Q){let $=Q.manifest.operations.map((Y)=>({sourcePath:V0(Q.manifest.projectConfigDir,Y.sourceRelativePath),destinationRelativePath:Y.destinationRelativePath,sourceSnapshot:Y.sourceSnapshot}));await mV($,Q.mergedConfigDir,Q.copySeams)}async function iV(Q){if(Q.manifest.operations.length===0)return"best-effort-js";let $=Q.nativeHelper??pV();if($)return await $.applyManifest(Q.manifest,Q.mergedConfigDir),"native-fd";if(Q.hardeningMode==="native-fd-required")throw p("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${x8}`);return await lV({manifest:Q.manifest,mergedConfigDir:Q.mergedConfigDir,copySeams:Q.copySeams}),"best-effort-js"}async function nV(Q){let $=c6(Q),Y;try{Y=await l9($)}catch(J){throw p("validate",`Unable to resolve project directory ${$}: ${P1(J)}`)}let q;try{q=await l9(Q)}catch(J){throw p("validate",`Unable to resolve project config directory ${Q}: ${P1(J)}`)}if(!p6(Y,q))throw p("validate",`Project .opencode root resolves outside project directory: ${Q}`);return q}function oV(Q){if(Q instanceof h)return Q;return p("copy",`Failed to prepare temporary merged config directory: ${P1(Q)}`)}async function NG(Q){let $=M8(Q.projectDir),Y=Q.hardeningMode??"best-effort-js",q=null;try{q=await LV(V8(OV(),TV)),await gV(Q.profileDir,q);let J="best-effort-js";if($){let H=await nV($),G=await PV(H),K=await hV(H,Q.seams?.collection),W=yV(K,G),z=dV(H,W);J=await iV({manifest:z,mergedConfigDir:q,hardeningMode:Y,copySeams:Q.seams?.copy,nativeHelper:Q.seams?.nativeHelper})}let X=q;return{path:X,cleanup:()=>jG(X),hardeningLevel:J}}catch(J){let X=oV(J);if(q)try{await jG(q)}catch(H){X.message=`${X.message}
171
+ Cleanup warning: ${P1(H)}`}throw X}}var NV,TV="ocx-oc-merged-",bV=1,x8="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",vV;var TG=A(()=>{D0();G8();W0();t();g8();NV=["agent","agents","skill","skills"];vV=Q1({include:R1(F()).optional(),exclude:R1(F()).optional()}).passthrough()});import*as B0 from"path";function q7(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function sV(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function J7(Q){if(Q.length===0)return"$";let $="";for(let Y of Q){if(typeof Y==="number"){$+=`[${Y}]`;continue}$=$.length===0?Y:`${$}.${Y}`}return $}function C2(Q,$,Y,q){if(Q===void 0)return;if(q7(Q)){for(let[J,X]of Object.entries(Q))C2(X,$,[...Y,J],q);return}if(Array.isArray(Q)){for(let[J,X]of Q.entries())C2(X,$,[...Y,J],q);return}q.set(J7(Y),$)}function rV(Q,$,Y,q){let J=Array.from(new Set([...Q,...$])),X=new Map;for(let H of Q)if(!X.has(H))X.set(H,"profile");for(let H of $)if(!X.has(H))X.set(H,"local");for(let[H,G]of J.entries())q.set(J7([...Y,H]),X.get(G)??"local")}function aV(Q,$,Y,q){let J=[...Q,...$],X=i4(J),H=new Map;for(let G=J.length-1;G>=0;G--){let K=J[G];if(!K)continue;let W=w2(K);if(!H.has(W))H.set(W,G<Q.length?"profile":"local")}for(let[G,K]of X.entries()){let W=w2(K);q.set(J7([...Y,G]),H.get(W)??"local")}}function bG(Q,$){return Q.length===1&&Q[0]===$}function RG(Q){let{profileValue:$,localValue:Y,pathSegments:q,origins:J}=Q;if(Y===void 0){C2($,"profile",q,J);return}if($===void 0){C2(Y,"local",q,J);return}if(q7($)&&q7(Y)){let X=new Set([...Object.keys($),...Object.keys(Y)]);for(let H of X)RG({profileValue:$[H],localValue:Y[H],pathSegments:[...q,H],origins:J});return}if(Array.isArray($)&&Array.isArray(Y)){if(bG(q,"instructions")){if($.every((X)=>typeof X==="string")&&Y.every((X)=>typeof X==="string")){rV($,Y,q,J);return}}if(bG(q,"plugin")){if($.every((X)=>typeof X==="string")&&Y.every((X)=>typeof X==="string")){aV($,Y,q,J);return}}}C2(Y,"local",q,J)}function tV(Q){let $=new Map;return RG({profileValue:Q.profileConfig,localValue:Q.localConfig,pathSegments:[],origins:$}),$}function eV(Q){if(!Q.startsWith("{file:"))return null;if(!Q.endsWith("}"))return null;let $=Q.slice(6,-1);return $.length>0?$:null}function QA(Q){return/^[A-Za-z]:[\\/]/.test(Q)}function $A(Q){if(Q.startsWith("~"))return!1;if(B0.isAbsolute(Q))return!1;if(QA(Q))return!1;return!0}function YA(Q){let $=eV(Q.value);if(!$)return Q.value;let Y=J7(Q.pathSegments);if(Q.origins.get(Y)!=="profile")return Q.value;if(!$A($))return Q.value;return`{file:${B0.resolve(Q.profileDir,$)}}`}function l6(Q){let{value:$,pathSegments:Y,origins:q,profileDir:J}=Q;if(typeof $==="string")return YA({value:$,pathSegments:Y,origins:q,profileDir:J});if(Array.isArray($))return $.map((X,H)=>l6({value:X,pathSegments:[...Y,H],origins:q,profileDir:J}));if(q7($)){let X={};for(let[H,G]of Object.entries($))X[H]=l6({value:G,pathSegments:[...Y,H],origins:q,profileDir:J});return X}return $}async function qA(Q){let $=M8(Q);if(!$)return{};let Y=B0.join($,j2),q=Bun.file(Y);if(!await q.exists())return{};let J;try{J=await q.text()}catch(G){let K=G instanceof Error?G.message:"Unknown read error";throw new h(`Failed to read local OpenCode config at ${Y}: ${K}`)}let X=[],H=O1(J,X,{allowTrailingComma:!0});if(X.length>0){let G=sV(X);throw new h(`Invalid JSONC in local OpenCode config at ${Y}: ${G}`)}if(!H||typeof H!=="object"||Array.isArray(H))throw new h(`Invalid local OpenCode config at ${Y}: root must be an object`);return H}async function JA(Q){let $=await qA(Q.projectDir),Y=tV({profileConfig:Q.profileConfig,localConfig:$});return l6({value:Q.mergedConfig,pathSegments:[],origins:Y,profileDir:Q.profileDir})}function XA(Q){let $=new Set,Y=[];for(let q=Q.length-1;q>=0;q--){let J=Q[q];if(!$.has(J))$.add(J),Y.unshift(J)}return Y}function HA(Q){return Q.configBin??Q.envBin??"opencode"}function SG(Q){return Q.includes("/")||Q.includes("\\")}function GA(Q){let{configuredBin:$,cwd:Y}=Q,q=Q.resolveExecutable??((X)=>Bun.which(X));if(!$.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(SG($))return B0.isAbsolute($)?$:B0.resolve(Y,$);let J=q($);if(!J)throw Error(`OpenCode launcher "${$}" is not available in PATH and cannot be used as OPENCODE_BIN`);return B0.isAbsolute(J)?J:B0.resolve(Y,J)}function KA(Q){let $=Q.resolveExecutable??((W)=>Bun.which(W)),Y=Q.argv??process.argv,q=Q.execPath??process.execPath,J=Q.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),X=Q.inheritedOcxBin?.trim(),H=J?q:Y[1],G=X&&X.length>0?X:H;if(!G?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(SG(G))return B0.isAbsolute(G)?G:B0.resolve(Q.cwd,G);let K=$(G);if(!K)throw Error(`OCX executable "${G}" is not available in PATH and cannot be persisted as OCX_BIN`);return B0.isAbsolute(K)?K:B0.resolve(Q.cwd,K)}function WA(Q){let $=Boolean(Q.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:Y,OPENCODE_BIN:q,OCX_CONTEXT:J,OCX_BIN:X,OCX_PROFILE:H,...G}=Q.baseEnv;return{...G,...Q.opencodeBin!==void 0&&{OPENCODE_BIN:Q.opencodeBin},...$&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:Q.configDir??($?h1(Q.profileName):L0()),...Q.configContent&&{OPENCODE_CONFIG_CONTENT:Q.configContent},...$&&{OCX_CONTEXT:"1"},...$&&Q.ocxBin&&{OCX_BIN:Q.ocxBin},...Q.profileName&&{OCX_PROFILE:Q.profileName}}}function EG(Q){Q.command("oc").alias("opencode").description("Launch OpenCode with resolved configuration").option("-p, --profile <name>","Use specific profile").option("--no-rename","Disable terminal/tmux window renaming").allowUnknownOption().allowExcessArguments(!0).action(async($,Y)=>{try{await zA(Y.args,$)}catch(q){s(q)}})}async function zA(Q,$){let Y=process.cwd(),q=await e0.create(Y,{profile:$.profile}),J=q.resolve(),X=q.getProfile();if(J.profileName)_.info(`Using profile: ${J.profileName}`);let H=X?.ocx,G=$.rename!==!1&&H?.renameWindow!==!1;if(J.profileName){let w=Z8(J.profileName);if(!await Bun.file(w).exists())_.warn(`No opencode.jsonc found at ${w}. Create one to customize OpenCode settings.`)}let K=J.opencode;if(J.profileName)K=await JA({mergedConfig:J.opencode,profileConfig:X?.opencode??{},projectDir:Y,profileDir:h1(J.profileName)});let W=Array.isArray(K.instructions)?K.instructions:[],z=[...J.instructions,...W],B=XA(z),Z=B.length>0||Object.keys(K).length>0?{...K,instructions:B.length>0?B:void 0}:void 0,M=null,V=null,U=null,R=null,I=null,g=()=>{if(M)M.kill("SIGINT");else I=130},N=()=>{if(M)M.kill("SIGTERM");else I=143},x=()=>{if(G)u6()};try{if(process.on("SIGINT",g),process.on("SIGTERM",N),process.on("exit",x),I!==null){R=I;return}if(J.profileName)V=await NG({projectDir:Y,profileDir:h1(J.profileName)});if(I!==null){R=I;return}if(G){VG();let l=await BG(Y);if(I!==null){R=I;return}UG(AG(Y,J.profileName??"default",l))}if(I!==null){R=I;return}let w=HA({configBin:H?.bin,envBin:process.env.OPENCODE_BIN}),b=Boolean(J.profileName),D=b?GA({configuredBin:w,cwd:Y}):w,r=b?KA({cwd:Y,inheritedOcxBin:process.env.OCX_BIN}):void 0,n=Z?JSON.stringify(Z):void 0;try{M=Bun.spawn({cmd:[D,...Q],cwd:Y,env:WA({baseEnv:process.env,profileName:J.profileName??void 0,ocxBin:r,opencodeBin:D,configDir:V?.path,configContent:n}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(l){throw p("spawn",`Failed to launch OpenCode binary "${w}": ${l instanceof Error?l.message:String(l)}`)}R=await M.exited}catch(w){U=w instanceof Error?w:p("spawn",`OpenCode process failed: ${String(w)}`)}finally{if(process.off("SIGINT",g),process.off("SIGTERM",N),process.off("exit",x),G)u6();if(V)try{await V.cleanup()}catch(w){if(U!==null||I!==null||R!==null&&R!==0)_.warn(`Cleanup warning: ${w instanceof Error?w.message:String(w)}`);else U=w instanceof Error?w:p("cleanup",`Failed to remove temporary merged config directory: ${String(w)}`)}}if(U)throw U;if(R!==null)process.exit(R)}var kG=A(()=>{D0();D2();W0();I3();t();_G();u1();c1();k8();LG();TG()});import{existsSync as i9}from"fs";import{mkdir as i6,mkdtemp as BA,rename as _A,rm as vG,writeFile as ZA}from"fs/promises";import{dirname as PG,join as X7,relative as MA}from"path";function xG(Q,$,Y){let q=Y instanceof Error?Y.message:String(Y);return`${Q} "${$}" (${q})`}function fG(Q,$){let[Y,q]=$.split("/");if(!Y||!q)return;return`${g1(Q)}/components/${q}.json`}function CG(Q){if(!Q)return null;let[$,Y,...q]=Q.split("/");if(!$||!Y||q.length>0)return null;return{registryName:$,componentName:Y}}function UA(Q,$){if(!Q)return{};let Y;try{let H=new URL(Q),G=H.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(G?.[1])Y=decodeURIComponent(G[1]);else{let K=H.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(K?.[1])Y=decodeURIComponent(K[1])}}catch{}let q=g1(Q),J,X=-1;for(let[H,G]of Object.entries($)){let K=g1(G.url);if(!(q===K||q.startsWith(`${K}/`))||K.length<=X)continue;J=H,X=K.length}return{registryName:J,componentName:Y}}function VA(Q){let $=Q.depRefs[0]??`${Q.namespace}/${Q.component}`,Y={...Q.profileRegistries,...Q.profileRegistries[Q.namespace]?{}:{[Q.namespace]:{url:Q.registryUrl}}},q=Q.error.registryName,J=Q.error.qualifiedName,X=CG(J);if(!q&&X)q=X.registryName;let H=X?.componentName,G=J&&!X&&!J.includes("/")?J:void 0,K=UA(Q.error.url,Y);if(!q&&K.registryName)q=K.registryName;let W=H??G??K.componentName;if((!J||!X)&&q&&W)J=`${q}/${W}`;if(!J)J=$;if(!q)q=CG(J)?.registryName??Q.namespace;let z=Y[q]?.url||(q===Q.namespace?Q.registryUrl:void 0);return{registryName:q,qualifiedName:J,fallbackUrl:Q.error.url||(z?fG(z,J):void 0)}}function yG(Q,$){let Y=Q.phase??$.fallbackPhase,q=Q.url??$.fallbackUrl,J=[`phase: ${Y}`,`qualifiedName: ${$.qualifiedName}`,`registryContext: ${$.registryContext}`,`registryName: ${$.registryName}`,...q?[`url: ${q}`]:[]];return new I1(`${Q.message} (${J.join(", ")})`,{url:q,status:Q.status,statusText:Q.statusText,phase:Y,qualifiedName:$.qualifiedName,registryContext:$.registryContext,registryName:$.registryName})}function hG(Q,$){if(!Q.startsWith(".opencode/"))throw new L(`Invalid embedded target "${Q}": expected .opencode/ prefix for embedded profile files.`);let Y=Q.slice(10);if(!Y)throw new L(`Invalid embedded target "${Q}": missing path after .opencode/ prefix.`);let q;try{q=V0($,Y)}catch(X){if(X instanceof e1)throw new L(`Invalid embedded target "${Q}": ${X.message}`);throw X}let J=MA($,q).replace(/\\/g,"/");if(J==="."||J==="")throw new L(`Invalid embedded target "${Q}": target must resolve to a file path.`);return J}async function n6(Q){let{namespace:$,component:Y,profileName:q,registryUrl:J,quiet:X}=Q;if(!a0.safeParse(q).success)throw new L(`Invalid profile name: "${q}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let G;if($)G=$;else throw new L(`Registry name is required for URL-based profile installs.
173
172
 
174
- Use a qualified component reference (e.g., 'my-registry/${U}') or specify --name to provide a registry alias.`);let I=p$(Q),X=`${z}/${U}`;if(g0(I))throw new t$(`Profile "${Q}" already exists. Remove it first with 'ocx profile rm ${Q} --global'.`);let G=J?null:V$({text:`Fetching ${X}...`});G?.start();let j;try{j=await c_(v,U)}catch(k){if(G?.fail(`Failed to fetch ${X}`),k instanceof E$)throw BH(k,{registryContext:"source",registryName:z,qualifiedName:X,fallbackPhase:"packument-fetch",fallbackUrl:VH(v,X)});if(k instanceof B$)throw new B$(`Profile component "${X}" not found in registry.
173
+ Use a qualified component reference (e.g., 'my-registry/${Y}') or specify --name to provide a registry alias.`);let K=h1(q),W=`${G}/${Y}`;if(i9(K))throw new n1(`Profile "${q}" already exists. Remove it first with 'ocx profile rm ${q} --global'.`);let B=X?null:Z1({text:`Fetching ${W}...`});B?.start();let Z;try{Z=await I2(J,Y)}catch(w){if(B?.fail(`Failed to fetch ${W}`),w instanceof I1)throw yG(w,{registryContext:"source",registryName:G,qualifiedName:W,fallbackPhase:"packument-fetch",fallbackUrl:fG(J,W)});if(w instanceof B1)throw new B1(`Profile component "${W}" not found in registry.
175
174
 
176
- Check the component name and ensure the registry is configured.`);throw k}if(j.type!=="profile")throw G?.fail("Invalid component type"),new M(`Component "${X}" is type "${j.type}", not "profile".
175
+ Check the component name and ensure the registry is configured.`);throw w}if(Z.type!=="profile")throw B?.fail("Invalid component type"),new L(`Component "${W}" is type "${Z.type}", not "profile".
177
176
 
178
- Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let H=G1(j);G?.succeed(`Fetched ${X}`);let Z=J?null:V$({text:"Downloading profile files..."});Z?.start();let V=[],S=[];for(let k of H.files){let O=await V1(v,U,k.path),w={path:k.path,target:k.target,content:Buffer.from(O)};if(k.target.startsWith(".opencode/"))S.push(w);else V.push(w)}Z?.succeed(`Downloaded ${H.files.length} files`);let T=w6();await EY(T,{recursive:!0,mode:448});let r=await xk(u8(T,".staging-")),A=!1,u=!1;try{let k=J?null:V$({text:"Writing profile files..."});k?.start();let O=new Map;for(let o of V){let Q$=w0(o.target,r),D$=u8(r,Q$);L1(O,{absolutePath:D$,relativePath:Q$,content:o.content,source:`${U}:${o.path}`})}for(let o of S){let Q$=ZH(o.target,r),D$=w0(Q$,r),x=u8(r,D$);L1(O,{absolutePath:x,relativePath:D$,content:o.content,source:`${U}:${o.path}`})}for(let o of O.values()){let Q$=o.absolutePath,D$=HH(Q$);if(!g0(D$))await EY(D$,{recursive:!0});await yk(Q$,o.content)}k?.succeed(`Wrote ${O.size} profile files`),await x4(r,{version:1,root:I,installed:{}});let w=J?null:V$({text:"Moving to profile directory..."});w?.start();let v$=HH(I);if(!g0(v$))await EY(v$,{recursive:!0,mode:448});if(await uk(r,I),A=!0,w?.succeed("Profile installed"),j.dependencies.length>0){let o=J?null:V$({text:"Installing dependencies..."});o?.start();let Q$=j.dependencies.map((x)=>x.includes("/")?x:`${z}/${x}`),D$={};try{let x=u8(I,"ocx.jsonc");if(g0(x)){let h=await Bun.file(x).text(),I$=x$(h),$$=V6.safeParse(I$);if($$.success)D$=$$.data.registries??{};else if(q4(I$)&&"registries"in I$)throw new n(`Invalid registries in profile "${Q}": ${$$.error.message}`)}await ZY(Q$,{profile:Q,quiet:J},{cwd:I,getRegistries:()=>D$,getComponentPath:()=>""}),o?.succeed(`Installed ${j.dependencies.length} dependencies`)}catch(x){if(o?.fail("Failed to install dependencies"),x instanceof E$){let t=mk({error:x,depRefs:Q$,namespace:z,component:U,registryUrl:v,profileRegistries:D$});throw BH(x,{registryContext:"dependency",registryName:t.registryName,qualifiedName:t.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:t.fallbackUrl})}throw x}}if(u=!0,!J){W.info(""),W.success(`Installed profile "${Q}" from ${X}`),W.info(""),W.info("Profile contents:");for(let o of V)W.info(` ${o.target}`);for(let o of S){let Q$=ZH(o.target,I);W.info(` ${Q$}`)}}}catch(k){let O=[];try{if(g0(r))await KH(r,{recursive:!0})}catch(w){O.push(WH("Profile add rollback cleanup warning: failed to remove staging directory",r,w))}if(A&&!u)try{if(g0(I))await KH(I,{recursive:!0,force:!0})}catch(w){O.push(WH("Profile add rollback cleanup warning: failed to remove promoted profile",I,w))}if(!J)for(let w of O)W.warn(w);throw k}}var DH=b(()=>{c4();Z4();_8();D1();X4();M0();o4();FJ();z$();i$();X1();G8();e4();VY()});function gk($){if(!$?.trim())throw new M("--source value cannot be empty");let _=$.trim();if((_.match(/\//g)||[]).length!==1)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);let[Q,v]=_.split("/").map((J)=>J.trim());if(!Q||!v)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);return{namespace:Q,component:v}}async function hk(){let $="global ocx config";try{let _=await YG();$=_.path;let U=_.content,Q=x$(U,[],{allowTrailingComma:!0});return V6.parse(Q)}catch(_){if(_ instanceof i6)throw _;if(_ instanceof Error)throw new n(`Failed to parse global config at "${$}": ${_.message}
177
+ Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let M=d8(Z);B?.succeed(`Fetched ${W}`);let V=X?null:Z1({text:"Downloading profile files..."});V?.start();let U=[],R=[];for(let w of M.files){let b=await r8(J,Y,w.path),D={path:w.path,target:w.target,content:Buffer.from(b)};if(w.target.startsWith(".opencode/"))R.push(D);else U.push(D)}V?.succeed(`Downloaded ${M.files.length} files`);let I=_8();await i6(I,{recursive:!0,mode:448});let g=await BA(X7(I,".staging-")),N=!1,x=!1;try{let w=X?null:Z1({text:"Writing profile files..."});w?.start();let b=new Map;for(let n of U){let l=R9(n.target,g),M1=X7(g,l);Q9(b,{absolutePath:M1,relativePath:l,content:n.content,source:`${Y}:${n.path}`})}for(let n of R){let l=hG(n.target,g),M1=R9(l,g),S=X7(g,M1);Q9(b,{absolutePath:S,relativePath:M1,content:n.content,source:`${Y}:${n.path}`})}for(let n of b.values()){let l=n.absolutePath,M1=PG(l);if(!i9(M1))await i6(M1,{recursive:!0});await ZA(l,n.content)}w?.succeed(`Wrote ${b.size} profile files`),await N0(g,{version:1,root:K,installed:{}});let D=X?null:Z1({text:"Moving to profile directory..."});D?.start();let r=PG(K);if(!i9(r))await i6(r,{recursive:!0,mode:448});if(await _A(g,K),N=!0,D?.succeed("Profile installed"),Z.dependencies.length>0){let n=X?null:Z1({text:"Installing dependencies..."});n?.start();let l=Z.dependencies.map((S)=>S.includes("/")?S:`${G}/${S}`),M1={};try{let S=X7(K,"ocx.jsonc");if(i9(S)){let C=await Bun.file(S).text(),e=O1(C),o=W8.safeParse(e);if(o.success)M1=o.data.registries??{};else if(J0(e)&&"registries"in e)throw new h(`Invalid registries in profile "${q}": ${o.error.message}`)}await k6(l,{profile:q,quiet:X},{cwd:K,getRegistries:()=>M1,getComponentPath:()=>""}),n?.succeed(`Installed ${Z.dependencies.length} dependencies`)}catch(S){if(n?.fail("Failed to install dependencies"),S instanceof I1){let d=VA({error:S,depRefs:l,namespace:G,component:Y,registryUrl:J,profileRegistries:M1});throw yG(S,{registryContext:"dependency",registryName:d.registryName,qualifiedName:d.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:d.fallbackUrl})}throw S}}if(x=!0,!X){_.info(""),_.success(`Installed profile "${q}" from ${W}`),_.info(""),_.info("Profile contents:");for(let n of U)_.info(` ${n.target}`);for(let n of R){let l=hG(n.target,K);_.info(` ${l}`)}}}catch(w){let b=[];try{if(i9(g))await vG(g,{recursive:!0})}catch(D){b.push(xG("Profile add rollback cleanup warning: failed to remove staging directory",g,D))}if(N&&!x)try{if(i9(K))await vG(K,{recursive:!0,force:!0})}catch(D){b.push(xG("Profile add rollback cleanup warning: failed to remove promoted profile",K,D))}if(!X)for(let D of b)_.warn(D);throw w}}var uG=A(()=>{D0();W0();D3();a8();q0();b9();g0();m4();t();c1();g8();P3();l0();v6()});function AA(Q){if(!Q?.trim())throw new L("--source value cannot be empty");let $=Q.trim();if(($.match(/\//g)||[]).length!==1)throw new L(`Invalid --source format: "${Q}". Expected: namespace/component`);let[q,J]=$.split("/").map((X)=>X.trim());if(!q||!J)throw new L(`Invalid --source format: "${Q}". Expected: namespace/component`);return{namespace:q,component:J}}async function LA(){let Q="global ocx config";try{let $=await IJ();Q=$.path;let Y=$.content,q=O1(Y,[],{allowTrailingComma:!0});return W8.parse(q)}catch($){if($ instanceof v8)throw $;if($ instanceof Error)throw new h(`Failed to parse global config at "${Q}": ${$.message}
179
178
 
180
- Check the file for syntax errors or run: ocx config edit --global`);throw _}}async function ck($){let _;try{_=await hk()}catch(Q){if(Q instanceof i6)throw new n(`Registry "${$}" is not configured globally.
179
+ Check the file for syntax errors or run: ocx config edit --global`);throw $}}async function FA(Q){let $;try{$=await LA()}catch(q){if(q instanceof v8)throw new h(`Registry "${Q}" is not configured globally.
181
180
 
182
181
  Profile installation requires global registry configuration.
183
- ${Q.message}
184
- Run: ocx registry add <url> --name ${$} --global`);throw Q}let U=_.registries[$];if(!U)throw new n(`Registry "${$}" is not configured globally.
182
+ ${q.message}
183
+ Run: ocx registry add <url> --name ${Q} --global`);throw q}let Y=$.registries[Q];if(!Y)throw new h(`Registry "${Q}" is not configured globally.
185
184
 
186
185
  Profile installation requires global registry configuration.
187
- Run: ocx registry add <url> --name ${$} --global`);return{config:_,registryUrl:U.url}}function MH($){$.command("add <name>").description("Create a new profile (--global required), clone from existing, or install from registry").option("--clone <profile>","Clone from existing global profile").option("--source <namespace/component>","Install from registry (requires --global)").option("--from <url>","Ephemeral registry URL for --source (does not persist)").option("-g, --global","Create global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").addHelpText("after",`
186
+ Run: ocx registry add <url> --name ${Q} --global`);return{config:$,registryUrl:Y.url}}function mG(Q){Q.command("add <name>").description("Create a new profile (--global required), clone from existing, or install from registry").option("--clone <profile>","Clone from existing global profile").option("--source <namespace/component>","Install from registry (requires --global)").option("--from <url>","Ephemeral registry URL for --source (does not persist)").option("-g, --global","Create global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").addHelpText("after",`
188
187
  Examples:
189
188
  $ ocx profile add work --global # Create global profile (~/.config/opencode/profiles/work/)
190
189
  $ ocx profile add work --clone dev --global # Clone from existing global profile
191
190
  $ ocx profile add work --source kdco/minimal --global # Install from configured registry
192
191
  $ ocx profile add work --source kdco/minimal --from http://r.com --global # Install from ephemeral registry
193
- `).action(async(_,U)=>{try{let Q=await lk(_,U);if(U.json)O$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function lk($,_){let U=_.json===!0;if(_.clone&&(_.source||_.from))throw new M(`--clone cannot be used with --source or --from.
192
+ `).action(async($,Y)=>{try{let q=await jA($,Y);if(Y.json)F1({success:!0,data:q})}catch(q){s(q,{json:Y.json})}})}async function jA(Q,$){let Y=$.json===!0;if($.clone&&($.source||$.from))throw new L(`--clone cannot be used with --source or --from.
194
193
 
195
194
  Use one of:
196
195
  ocx profile add <name> --clone <profile> --global # Clone existing profile
197
- ocx profile add <name> --source <ns/comp> --global # Install from registry`);if(_.from&&!_.source){let J=_.from.trim(),Y=J.startsWith("http://")||J.startsWith("https://");if((J.match(/\//g)||[]).length===1&&!Y)throw new M(`Invalid option: --from requires --source.
196
+ ocx profile add <name> --source <ns/comp> --global # Install from registry`);if($.from&&!$.source){let X=$.from.trim(),H=X.startsWith("http://")||X.startsWith("https://");if((X.match(/\//g)||[]).length===1&&!H)throw new L(`Invalid option: --from requires --source.
198
197
 
199
198
  Migration: The --from option now only accepts registry URLs.
200
199
  Use --source for namespace/component references:
201
200
 
202
- ocx profile add ${$} --source ${J} --global`);if(Y){let I;try{let X=new URL(J),q=X.pathname.split("/").filter(Boolean);if(q.length>=2){let G=q.slice(-2).join("/");X.pathname=q.slice(0,-2).join("/")||"/";let j=X.toString().replace(/\/$/,"");I=`Migration: Separate the registry URL and component:
201
+ ocx profile add ${Q} --source ${X} --global`);if(H){let K;try{let W=new URL(X),z=W.pathname.split("/").filter(Boolean);if(z.length>=2){let B=z.slice(-2).join("/");W.pathname=z.slice(0,-2).join("/")||"/";let Z=W.toString().replace(/\/$/,"");K=`Migration: Separate the registry URL and component:
203
202
 
204
- ocx profile add ${$} --source ${G} --from ${j} --global`}else I=`Migration: Separate the registry URL and component:
203
+ ocx profile add ${Q} --source ${B} --from ${Z} --global`}else K=`Migration: Separate the registry URL and component:
205
204
 
206
- ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}catch{I=`Migration: Separate the registry URL and component:
205
+ ocx profile add ${Q} --source <namespace/component> --from <registry-url> --global`}catch{K=`Migration: Separate the registry URL and component:
207
206
 
208
- ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}throw new M(`Invalid option: --from requires --source.
207
+ ocx profile add ${Q} --source <namespace/component> --from <registry-url> --global`}throw new L(`Invalid option: --from requires --source.
209
208
 
210
- ${I}`)}throw new M(`Invalid option: --from requires --source.
209
+ ${K}`)}throw new L(`Invalid option: --from requires --source.
211
210
 
212
211
  Did you mean to clone a profile?
213
212
 
214
- ocx profile add ${$} --clone ${J} --global`)}if(_.source&&!_.global)throw new M(`--source requires --global flag.
213
+ ocx profile add ${Q} --clone ${X} --global`)}if($.source&&!$.global)throw new L(`--source requires --global flag.
215
214
 
216
215
  Profile installation from registries is only supported for global profiles:
217
216
 
218
- ocx profile add ${$} --source ${_.source} --global`);if(_.from){let J=_.from.trim();try{let Y=new URL(J);if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw new M(`Invalid --from value: "${_.from}".
217
+ ocx profile add ${Q} --source ${$.source} --global`);if($.from){let X=$.from.trim();try{let H=new URL(X);if(H.protocol!=="http:"&&H.protocol!=="https:")throw new L(`Invalid --from value: "${$.from}".
219
218
 
220
219
  --from must be a registry URL with http:// or https:// protocol.
221
- For profile cloning, use --clone instead.`);if(!Y.hostname)throw new M(`Invalid --from value: "${_.from}".
220
+ For profile cloning, use --clone instead.`);if(!H.hostname)throw new L(`Invalid --from value: "${$.from}".
222
221
 
223
222
  --from must be a valid registry URL with a hostname.
224
- Example: --from https://registry.example.com`)}catch(Y){if(Y instanceof M)throw Y;throw new M(`Invalid --from value: "${_.from}".
223
+ Example: --from https://registry.example.com`)}catch(H){if(H instanceof L)throw H;throw new L(`Invalid --from value: "${$.from}".
225
224
 
226
225
  --from must be a valid registry URL (http:// or https://).
227
- Example: --from https://registry.example.com`)}}if(!_.global)throw new n(`Local profiles are unsupported. Use --global to create a global profile.
226
+ Example: --from https://registry.example.com`)}}if(!$.global)throw new h(`Local profiles are unsupported. Use --global to create a global profile.
228
227
 
229
- ocx profile add ${$} --global`);let Q="global",v=await h$.requireInitialized();if(_.clone)return await pk(v,$,_.clone,U),{name:$,scope:Q,mode:"clone",cloneFrom:_.clone};if(_.source){let{namespace:J,component:Y}=gk(_.source),z;if(_.from)z=d$(_.from.trim()),await PY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});else z=(await ck(J)).registryUrl,await PY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});return{name:$,scope:Q,mode:"registry",registry:{namespace:J,component:Y,url:z,ephemeral:Boolean(_.from)}}}return await dk(v,$,U),{name:$,scope:Q,mode:"empty"}}async function dk($,_,U){if(await $.exists(_))throw new m6(_,`Remove it first with 'ocx profile rm ${_} --global'.`);if(await $.add(_),!U)W.success(`Created global profile "${_}"`)}async function pk($,_,U,Q){if(await $.exists(_))throw new m6(_,`Remove it first with 'ocx profile rm ${_} --global'.`);try{await $.get(U)}catch(z){if(z instanceof m$)throw new m$(U,`Profile '${U}' not found in global scope.`);if(z instanceof b$)throw z;throw new M(`Failed to load profile '${U}': ${z instanceof Error?z.message:String(z)}`)}await $.add(_);let J=B4(U),Y=B4(_);if(await vG(J,Y),!Q)W.success(`Created global profile "${_}" (cloned from "${U}")`)}var wH=b(()=>{c4();e2();X6();Z4();M0();z$();c$();i$();DH()});function LH($){$.command("list").alias("ls").description("List profiles (use --global; local profiles are unsupported)").option("-g, --global","List global profiles (required \u2014 local profiles are unsupported)").addOption(f4.json()).action(async(_)=>{try{await ik(_)}catch(U){_$(U,{json:_.json})}})}async function ik($){if(!$.global)throw new n(`Local profiles are unsupported. Use --global to list global profiles.
228
+ ocx profile add ${Q} --global`);let q="global",J=await f1.requireInitialized();if($.clone)return await DA(J,Q,$.clone,Y),{name:Q,scope:q,mode:"clone",cloneFrom:$.clone};if($.source){let{namespace:X,component:H}=AA($.source),G;if($.from)G=g1($.from.trim()),await n6({namespace:X,component:H,profileName:Q,registryUrl:G,quiet:Y});else G=(await FA(X)).registryUrl,await n6({namespace:X,component:H,profileName:Q,registryUrl:G,quiet:Y});return{name:Q,scope:q,mode:"registry",registry:{namespace:X,component:H,url:G,ephemeral:Boolean($.from)}}}return await wA(J,Q,Y),{name:Q,scope:q,mode:"empty"}}async function wA(Q,$,Y){if(await Q.exists($))throw new N8($,`Remove it first with 'ocx profile rm ${$} --global'.`);if(await Q.add($),!Y)_.success(`Created global profile "${$}"`)}async function DA(Q,$,Y,q){if(await Q.exists($))throw new N8($,`Remove it first with 'ocx profile rm ${$} --global'.`);try{await Q.get(Y)}catch(G){if(G instanceof C1)throw new C1(Y,`Profile '${Y}' not found in global scope.`);if(G instanceof z1)throw G;throw new L(`Failed to load profile '${Y}': ${G instanceof Error?G.message:String(G)}`)}await Q.add($);let X=K0(Y),H=K0($);if(await jJ(X,H),!q)_.success(`Created global profile "${$}" (cloned from "${Y}")`)}var gG=A(()=>{D0();j3();t0();W0();b9();t();u1();c1();uG()});function cG(Q){Q.command("list").alias("ls").description("List profiles (use --global; local profiles are unsupported)").option("-g, --global","List global profiles (required \u2014 local profiles are unsupported)").addOption(S0.json()).action(async($)=>{try{await OA($)}catch(Y){s(Y,{json:$.json})}})}async function OA(Q){if(!Q.global)throw new h(`Local profiles are unsupported. Use --global to list global profiles.
230
229
 
231
- ocx profile list --global`);let U=await(await h$.requireInitialized()).list();if($.json){console.log(JSON.stringify({profiles:U,initialized:!0},null,2));return}let Q="Global profiles:",v="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(U.length===0){console.log(v);return}console.log(Q);for(let J of U)console.log(` ${J}`)}var kH=b(()=>{X6();z$();c$();a4()});function AH($){$.command("move <old-name> <new-name>").alias("mv").description("Move (rename) a profile (use --global; local profiles are unsupported)").option("-g, --global","Move global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(_,U,Q)=>{try{let v=await nk(_,U,Q);if(Q.json)O$({success:!0,data:v})}catch(v){_$(v,{json:Q.json})}})}async function nk($,_,U){if(!U.global)throw new n(`Local profiles are unsupported. Use --global to move a global profile.
230
+ ocx profile list --global`);let Y=await(await f1.requireInitialized()).list();if(Q.json){console.log(JSON.stringify({profiles:Y,initialized:!0},null,2));return}let q="Global profiles:",J="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(Y.length===0){console.log(J);return}console.log(q);for(let X of Y)console.log(` ${X}`)}var dG=A(()=>{t0();t();u1();d0()});function pG(Q){Q.command("move <old-name> <new-name>").alias("mv").description("Move (rename) a profile (use --global; local profiles are unsupported)").option("-g, --global","Move global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async($,Y,q)=>{try{let J=await IA($,Y,q);if(q.json)F1({success:!0,data:J})}catch(J){s(J,{json:q.json})}})}async function IA(Q,$,Y){if(!Y.global)throw new h(`Local profiles are unsupported. Use --global to move a global profile.
232
231
 
233
- ocx profile move ${$} ${_} --global`);let Q=await h$.requireInitialized(),{warnActiveProfile:v}=await Q.move($,_);if(v&&!U.json)W.warn(`Moving active profile. Update OCX_PROFILE env var to "${_}".`);if(!U.json)W.success(`Moved global profile "${$}" \u2192 "${_}"`);return{from:$,to:_,scope:"global",warnActiveProfile:v}}var FH=b(()=>{X6();z$();c$();i$()});function OH($){$.command("remove <name>").alias("rm").description("Delete a profile (use --global; local profiles are unsupported)").option("-g, --global","Remove global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(_,U)=>{try{let Q=await rk(_,U);if(U.json)O$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function rk($,_){if(!_.global)throw new n(`Local profiles are unsupported. Use --global to remove a global profile.
232
+ ocx profile move ${Q} ${$} --global`);let q=await f1.requireInitialized(),{warnActiveProfile:J}=await q.move(Q,$);if(J&&!Y.json)_.warn(`Moving active profile. Update OCX_PROFILE env var to "${$}".`);if(!Y.json)_.success(`Moved global profile "${Q}" \u2192 "${$}"`);return{from:Q,to:$,scope:"global",warnActiveProfile:J}}var lG=A(()=>{t0();t();u1();c1()});function iG(Q){Q.command("remove <name>").alias("rm").description("Delete a profile (use --global; local profiles are unsupported)").option("-g, --global","Remove global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async($,Y)=>{try{let q=await NA($,Y);if(Y.json)F1({success:!0,data:q})}catch(q){s(q,{json:Y.json})}})}async function NA(Q,$){if(!$.global)throw new h(`Local profiles are unsupported. Use --global to remove a global profile.
234
233
 
235
- ocx profile remove <name> --global`);let U=await h$.requireInitialized();if(!await U.exists($))throw new m$($);if(await U.remove($),!_.json)W.success(`Deleted global profile "${$}"`);return{name:$,scope:"global"}}var NH=b(()=>{X6();z$();c$();i$()});function SH($){$.command("show [name]").description("Display profile contents (use --global; local profiles are unsupported)").option("-g, --global","Show global profile (required \u2014 local profiles are unsupported)").addOption(f4.json()).action(async(_,U)=>{try{await ok(_,U)}catch(Q){_$(Q,{json:U.json})}})}async function ok($,_){if(!_.global)throw new n(`Local profiles are unsupported. Use --global to show a global profile.
234
+ ocx profile remove <name> --global`);let Y=await f1.requireInitialized();if(!await Y.exists(Q))throw new C1(Q);if(await Y.remove(Q),!$.json)_.success(`Deleted global profile "${Q}"`);return{name:Q,scope:"global"}}var nG=A(()=>{t0();t();u1();c1()});function oG(Q){Q.command("show [name]").description("Display profile contents (use --global; local profiles are unsupported)").option("-g, --global","Show global profile (required \u2014 local profiles are unsupported)").addOption(S0.json()).action(async($,Y)=>{try{await TA($,Y)}catch(q){s(q,{json:Y.json})}})}async function TA(Q,$){if(!$.global)throw new h(`Local profiles are unsupported. Use --global to show a global profile.
236
235
 
237
- ocx profile show [name] --global`);let U=await h$.requireInitialized(),Q=$??await U.resolveProfile(),v=await U.get(Q);if(_.json){console.log(JSON.stringify(v,null,2));return}if(console.log(`Profile: ${v.name}`),console.log(`
238
- Files:`),console.log(` ocx.jsonc: ${B4(Q)}`),v.opencode)console.log(` opencode.jsonc: ${L6(Q)}`);if(v.hasAgents)console.log(` AGENTS.md: ${W1(Q)}`);console.log(`
239
- OCX Config:`),console.log(JSON.stringify(v.ocx,null,2))}var TH=b(()=>{X6();Z4();z$();c$();a4()});function RH($){let _=$.command("profile").alias("p").description("Manage profiles (global only)");LH(_),MH(_),OH(_),AH(_),SH(_)}var EH=b(()=>{wH();kH();FH();NH();TH()});import{existsSync as tk}from"fs";import{dirname as PH,join as xH}from"path";async function ak($,_,U){if(U.isLocked?.())throw Error("Registries are locked. Cannot add.");let Q=$.trim();if(!Q)throw new M("Registry URL is required");try{let Z=new URL(Q);if(!["http:","https:"].includes(Z.protocol))throw new M(`Invalid registry URL: ${Q} (must use http or https)`)}catch(Z){if(Z instanceof M)throw Z;throw new M(`Invalid registry URL: ${Q}`)}let v=d$(Q),J=_.name,Y=U.getRegistries(),z=Y[J],I=sk(Y,v),{fetchRegistryIndex:X}=await Promise.resolve().then(() => (D1(),xG));await X(v);let q=z!==void 0,G=I!==null,j=q&&d$(z.url)===v,H=G&&I.name!==J;if(_.dryRun){let Z=[];if(q&&!j)Z.push(`Registry '${J}' already exists with a different URL (${z.url}). Run 'ocx registry remove ${J}' first, then re-add.`);else if(H)Z.push(`URL '${v}' is already registered under name '${I.name}'. Run 'ocx registry remove ${I.name}' first, then re-add.`);let V=q&&!j||H,S=q&&j,T=U.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:S?[]:[{action:"add",target:`registry:${J}`,details:{url:v}}],validation:{passed:!V,warnings:Z.length>0?Z:void 0},summary:V?`Would fail: conflict detected for registry '${J}'`:S?`Registry '${J}' already configured with same URL (no-op)`:`Would add registry '${J}' to ${T}`}}if(q&&!j)throw new W0(J,z.url,v,U.targetLabel);if(H)throw new W0(J,v,v,U.targetLabel,I.name);if(q&&j)return{name:J,url:v,updated:!1,alreadyConfigured:!0};return await U.setRegistry(J,{url:v}),{name:J,url:v,updated:!1,alreadyConfigured:!1}}function sk($,_){for(let[U,Q]of Object.entries($))if(d$(Q.url)===_)return{name:U,config:Q};return null}async function ek($,_){if(_.isLocked?.())throw Error("Registries are locked. Cannot remove.");let U=_.getRegistries();if(!($ in U))throw Error(`Registry '${$}' not found.`);return await _.removeRegistry($),{removed:$}}function $A($){let _=$.getRegistries(),U=$.isLocked?.()??!1;return{registries:Object.entries(_).map(([v,J])=>({name:v,url:J.url})),locked:U}}async function xY($,_,U){let Q=_.getOptionValueSource("cwd")==="cli";if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");if(Q&&$.profile)throw new M("Cannot use both --cwd and --profile flags");if($.global&&Q)throw new M("Cannot use both --global and --cwd flags");if($.profile){if(Xj($.profile),!await(await h$.requireInitialized()).exists($.profile))throw new m$($.profile);let Y=B4($.profile);if(!tk(Y))throw new n(`Profile '${$.profile}' has no ocx.jsonc. Run 'ocx profile config ${$.profile}' to create it.`);return{scope:"profile",configPath:Y,configDir:PH(Y),targetLabel:`profile '${$.profile}' config`}}if($.global){let J=O4();return{scope:"global",configPath:xH(J,"ocx.jsonc"),configDir:J,targetLabel:"global config"}}let v=d6(U);return{scope:"local",configPath:v.path,configDir:v.exists?PH(v.path):xH(U,".opencode"),targetLabel:"local config"}}function uH($){let _=$.command("registry").description("Manage registries"),U=_.command("add").description("Add a registry").argument("<url>","Registry URL").requiredOption("--name <name>","Registry alias (required, used as lookup key for alias/component refs)").option("--dry-run","Validate registry without adding to config");G6(U),K8(U),Q4(U),U.action(async(J,Y,z)=>{let I;try{let X=Y.cwd??process.cwd();I=await xY(Y,z,X);let{configDir:q,configPath:G}=I,j=await u4(q);if(!j){let V=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${I.targetLabel} not found. ${V}`),process.exit(1)}let H=await ak(J,Y,{getRegistries:()=>j.registries,isLocked:()=>j.lockRegistries??!1,setRegistry:async(V,S)=>{j.registries[V]=S,await r2(q,j,G)},targetLabel:I.targetLabel});if("dryRun"in H&&H.dryRun){S4(H,{json:Y.json,quiet:Y.quiet});return}let Z=H;if(Y.json)O$({success:!0,data:Z});else if(!Y.quiet)if(Z.alreadyConfigured)W.info(`Registry already configured (no changes): ${Z.name}`);else if(Z.updated)W.success(`Updated registry in ${I.targetLabel}: ${Z.name} -> ${Z.url}`);else W.success(`Added registry to ${I.targetLabel}: ${Z.name} -> ${Z.url}`)}catch(X){_$(X,{json:Y.json})}});let Q=_.command("remove").description("Remove a registry").argument("<name>","Registry name");G6(Q),K8(Q),Q4(Q),Q.action(async(J,Y,z)=>{try{let I=Y.cwd??process.cwd(),X=await xY(Y,z,I),q=await u4(X.configDir);if(!q){let j=X.scope==="global"?"Run 'ocx init --global' first.":X.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${X.targetLabel} not found. ${j}`),process.exit(1)}let G=await ek(J,{getRegistries:()=>q.registries,isLocked:()=>q.lockRegistries??!1,removeRegistry:async(j)=>{delete q.registries[j],await r2(X.configDir,q,X.configPath)}});if(Y.json)O$({success:!0,data:G});else if(!Y.quiet)W.success(`Removed registry from ${X.targetLabel}: ${G.removed}`)}catch(I){_$(I,{json:Y.json})}});let v=_.command("list").description("List configured registries");G6(v),K8(v),Q4(v),v.action(async(J,Y)=>{try{let z=J.cwd??process.cwd(),I=await xY(J,Y,z),X=await u4(I.configDir);if(!X){let G=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${J.profile}' to create it.`:"Run 'ocx init' first.";W.warn(`${I.targetLabel} not found. ${G}`);return}let q=$A({getRegistries:()=>X.registries,isLocked:()=>X.lockRegistries??!1});if(J.json)O$({success:!0,data:q});else if(!J.quiet)if(q.registries.length===0)W.info("No registries configured.");else{let G=I.scope==="global"?" (global)":I.scope==="profile"?` (profile '${J.profile}')`:"";W.info(`Configured registries${G}${q.locked?g.yellow(" (locked)"):""}:`);for(let j of q.registries)console.log(` ${g.cyan(j.name)}: ${j.url}`)}}catch(z){_$(z,{json:J.json})}})}var yH=b(()=>{k6();X6();Z4();X4();w1();z$();c$();i$();p6();a4()});function _A($){return $.includes("/")&&!$.includes("::")}function vA($){try{let{namespace:_,component:U}=r4($);return{registryName:_,componentName:U}}catch(_){throw new M(_ instanceof Error?_.message:`Invalid component ref: '${$}'`)}}function UA($,_){return`Ambiguous component reference '${$}'. Found ${_.length} installed matches:
240
- `+_.map((U)=>` - ${U}`).join(`
236
+ ocx profile show [name] --global`);let Y=await f1.requireInitialized(),q=Q??await Y.resolveProfile(),J=await Y.get(q);if($.json){console.log(JSON.stringify(J,null,2));return}if(console.log(`Profile: ${J.name}`),console.log(`
237
+ Files:`),console.log(` ocx.jsonc: ${K0(q)}`),J.opencode)console.log(` opencode.jsonc: ${Z8(q)}`);if(J.hasAgents)console.log(` AGENTS.md: ${n8(q)}`);console.log(`
238
+ OCX Config:`),console.log(JSON.stringify(J.ocx,null,2))}var sG=A(()=>{t0();W0();t();u1();d0()});function rG(Q){let $=Q.command("profile").alias("p").description("Manage profiles (global only)");cG($),mG($),iG($),pG($),oG($)}var aG=A(()=>{gG();dG();lG();nG();sG()});import{existsSync as bA}from"fs";import{dirname as tG,join as eG}from"path";async function RA(Q,$,Y){if(Y.isLocked?.())throw Error("Registries are locked. Cannot add.");let q=Q.trim();if(!q)throw new L("Registry URL is required");try{let V=new URL(q);if(!["http:","https:"].includes(V.protocol))throw new L(`Invalid registry URL: ${q} (must use http or https)`)}catch(V){if(V instanceof L)throw V;throw new L(`Invalid registry URL: ${q}`)}let J=g1(q),X=$.name,H=Y.getRegistries(),G=H[X],K=SA(H,J),{fetchRegistryIndex:W}=await Promise.resolve().then(() => (a8(),aJ));await W(J);let z=G!==void 0,B=K!==null,Z=z&&g1(G.url)===J,M=B&&K.name!==X;if($.dryRun){let V=[];if(z&&!Z)V.push(`Registry '${X}' already exists with a different URL (${G.url}). Run 'ocx registry remove ${X}' first, then re-add.`);else if(M)V.push(`URL '${J}' is already registered under name '${K.name}'. Run 'ocx registry remove ${K.name}' first, then re-add.`);let U=z&&!Z||M,R=z&&Z,I=Y.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:R?[]:[{action:"add",target:`registry:${X}`,details:{url:J}}],validation:{passed:!U,warnings:V.length>0?V:void 0},summary:U?`Would fail: conflict detected for registry '${X}'`:R?`Registry '${X}' already configured with same URL (no-op)`:`Would add registry '${X}' to ${I}`}}if(z&&!Z)throw new w9(X,G.url,J,Y.targetLabel);if(M)throw new w9(X,J,J,Y.targetLabel,K.name);if(z&&Z)return{name:X,url:J,updated:!1,alreadyConfigured:!0};return await Y.setRegistry(X,{url:J}),{name:X,url:J,updated:!1,alreadyConfigured:!1}}function SA(Q,$){for(let[Y,q]of Object.entries(Q))if(g1(q.url)===$)return{name:Y,config:q};return null}async function EA(Q,$){if($.isLocked?.())throw Error("Registries are locked. Cannot remove.");let Y=$.getRegistries();if(!(Q in Y))throw Error(`Registry '${Q}' not found.`);return await $.removeRegistry(Q),{removed:Q}}function kA(Q){let $=Q.getRegistries(),Y=Q.isLocked?.()??!1;return{registries:Object.entries($).map(([J,X])=>({name:J,url:X.url})),locked:Y}}async function o6(Q,$,Y){let q=$.getOptionValueSource("cwd")==="cli";if(Q.global&&Q.profile)throw new L("Cannot use both --global and --profile flags");if(q&&Q.profile)throw new L("Cannot use both --cwd and --profile flags");if(Q.global&&q)throw new L("Cannot use both --global and --cwd flags");if(Q.profile){if(TX(Q.profile),!await(await f1.requireInitialized()).exists(Q.profile))throw new C1(Q.profile);let H=K0(Q.profile);if(!bA(H))throw new h(`Profile '${Q.profile}' has no ocx.jsonc. Run 'ocx profile config ${Q.profile}' to create it.`);return{scope:"profile",configPath:H,configDir:tG(H),targetLabel:`profile '${Q.profile}' config`}}if(Q.global){let X=L0();return{scope:"global",configPath:eG(X,"ocx.jsonc"),configDir:X,targetLabel:"global config"}}let J=E8(Y);return{scope:"local",configPath:J.path,configDir:J.exists?tG(J.path):eG(Y,".opencode"),targetLabel:"local config"}}function QK(Q){let $=Q.command("registry").description("Manage registries"),Y=$.command("add").description("Add a registry").argument("<url>","Registry URL").requiredOption("--name <name>","Registry alias (required, used as lookup key for alias/component refs)").option("--dry-run","Validate registry without adding to config");Q8(Y),C3(Y),Q0(Y),Y.action(async(X,H,G)=>{let K;try{let W=H.cwd??process.cwd();K=await o6(H,G,W);let{configDir:z,configPath:B}=K,Z=await T0(z);if(!Z){let U=K.scope==="global"?"Run 'ocx init --global' first.":K.scope==="profile"?`Run 'ocx profile config ${H.profile}' to create it.`:"Run 'ocx init' first.";_.error(`${K.targetLabel} not found. ${U}`),process.exit(1)}let M=await RA(X,H,{getRegistries:()=>Z.registries,isLocked:()=>Z.lockRegistries??!1,setRegistry:async(U,R)=>{Z.registries[U]=R,await U3(z,Z,B)},targetLabel:K.targetLabel});if("dryRun"in M&&M.dryRun){j0(M,{json:H.json,quiet:H.quiet});return}let V=M;if(H.json)F1({success:!0,data:V});else if(!H.quiet)if(V.alreadyConfigured)_.info(`Registry already configured (no changes): ${V.name}`);else if(V.updated)_.success(`Updated registry in ${K.targetLabel}: ${V.name} -> ${V.url}`);else _.success(`Added registry to ${K.targetLabel}: ${V.name} -> ${V.url}`)}catch(W){s(W,{json:H.json})}});let q=$.command("remove").description("Remove a registry").argument("<name>","Registry name");Q8(q),C3(q),Q0(q),q.action(async(X,H,G)=>{try{let K=H.cwd??process.cwd(),W=await o6(H,G,K),z=await T0(W.configDir);if(!z){let Z=W.scope==="global"?"Run 'ocx init --global' first.":W.scope==="profile"?`Run 'ocx profile config ${H.profile}' to create it.`:"Run 'ocx init' first.";_.error(`${W.targetLabel} not found. ${Z}`),process.exit(1)}let B=await EA(X,{getRegistries:()=>z.registries,isLocked:()=>z.lockRegistries??!1,removeRegistry:async(Z)=>{delete z.registries[Z],await U3(W.configDir,z,W.configPath)}});if(H.json)F1({success:!0,data:B});else if(!H.quiet)_.success(`Removed registry from ${W.targetLabel}: ${B.removed}`)}catch(K){s(K,{json:H.json})}});let J=$.command("list").description("List configured registries");Q8(J),C3(J),Q0(J),J.action(async(X,H)=>{try{let G=X.cwd??process.cwd(),K=await o6(X,H,G),W=await T0(K.configDir);if(!W){let B=K.scope==="global"?"Run 'ocx init --global' first.":K.scope==="profile"?`Run 'ocx profile config ${X.profile}' to create it.`:"Run 'ocx init' first.";_.warn(`${K.targetLabel} not found. ${B}`);return}let z=kA({getRegistries:()=>W.registries,isLocked:()=>W.lockRegistries??!1});if(X.json)F1({success:!0,data:z});else if(!X.quiet)if(z.registries.length===0)_.info("No registries configured.");else{let B=K.scope==="global"?" (global)":K.scope==="profile"?` (profile '${X.profile}')`:"";_.info(`Configured registries${B}${z.locked?P.yellow(" (locked)"):""}:`);for(let Z of z.registries)console.log(` ${P.cyan(Z.name)}: ${Z.url}`)}}catch(G){s(G,{json:X.json})}})}var $K=A(()=>{U8();t0();W0();q0();e8();t();u1();c1();k8();d0()});function vA(Q){return Q.includes("/")&&!Q.includes("::")}function PA(Q){try{let{namespace:$,component:Y}=m0(Q);return{registryName:$,componentName:Y}}catch($){throw new L($ instanceof Error?$.message:`Invalid component ref: '${Q}'`)}}function xA(Q,$){return`Ambiguous component reference '${Q}'. Found ${$.length} installed matches:
239
+ `+$.map((Y)=>` - ${Y}`).join(`
241
240
  `)+`
242
241
 
243
- Use one of the canonical IDs above.`}function QA($){return`Component '${$}' is not installed.
244
- Run 'ocx search --installed' to see installed components.`}function JA($,_){let U=Object.keys(_.installed);if(_.installed[$])return $;if(_A($)){let{registryName:Q,componentName:v}=vA($),J=U.filter((Y)=>{let z=c6(Y);return z.registryName===Q&&z.name===v}).sort();if(J.length===1){let[Y]=J;if(!Y)throw Error("Unexpected empty canonical ID result");return Y}if(J.length>1)throw new M(UA($,J))}throw new B$(QA($))}function y8($,_){return $.map((U)=>JA(U,_))}var uY=b(()=>{o4();z$();T0()});import{realpathSync as CH}from"fs";import{rm as YA}from"fs/promises";import{sep as zA}from"path";function fH($,_,U){let Q=A4($,U),v;try{v=CH(Q)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return{path:U,targetReal:null};if(Y==="ELOOP")throw new M(`Security violation: symlink loop detected at ${U}`);if(Y==="EACCES"||Y==="EPERM")throw new M(`Security violation: cannot verify path ${U}`);throw J}if(v===_)throw new M(`Security violation: cannot delete project root directory (${U})`);if(!v.startsWith(_+zA))throw new M("Security violation: path escapes project directory");return{path:U,targetReal:v}}function IA($,_,U){let Q=fH($,_,U.path);if(!U.targetReal){if(Q.targetReal)throw new M(`Security violation: missing target reappeared during removal (${U.path})`);return null}if(!Q.targetReal)return null;if(Q.targetReal!==U.targetReal)throw new M(`Security violation: target changed during removal (${U.path})`);return Q.targetReal}function XA($){let _=new Set,U=[];for(let Q of $){if(_.has(Q))continue;_.add(Q),U.push(Q)}return U}function mH($){let _=$.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");Q4(_),_.option("-f, --force","Force removal even if files have been modified"),m4(_),_.option("--dry-run","Show what would be removed without making changes").action(async(U,Q)=>{try{await qA(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function qA($,_){let U=_.cwd??process.cwd(),Q=await y4.requireInitialized(U);if($.length===0)throw new M("No components specified. Specify at least one component ID.");let v=await F4(Q.cwd);if(!v||Object.keys(v.installed).length===0)throw new B$("No components installed.");let J=XA(y8($,v)),Y=_.quiet?null:V$({text:"Removing components..."});Y?.start();let z=[],I=[],X=[],q=[],G=!1,j;try{j=CH(Q.cwd)}catch(H){throw new M("Cannot resolve project directory")}try{for(let H of J){let Z=v.installed[H];if(!Z)throw Error(`Resolved component '${H}' was not found in receipt.`);let V=[];for(let T of Z.files){if(!T.path||T.path===".")throw new M(`Invalid file path in receipt for '${H}': path cannot be empty or "."`);try{V.push(fH(Q.cwd,j,T.path))}catch(r){if(r instanceof U4)throw new M(`Security violation in receipt for '${H}': ${r.message}`);throw r}}let S=await d_(Q.cwd,Z);if(!S.intact){G=!0;let T=S.modified.map((r)=>` - ${r}`).join(`
245
- `);if(_.force)q.push(`Component '${H}' has been modified but will be force-removed:
246
- ${T}`);else q.push(`Component '${H}' has been modified. Use --force to remove anyway:
247
- ${T}`)}X.push({canonicalId:H,files:V})}if(_.dryRun){Y?.stop();let H={dryRun:!0,command:"remove",wouldPerform:X.flatMap(({canonicalId:Z,files:V})=>V.map((S)=>({action:"delete",target:S.path,details:{component:Z}}))),validation:{passed:!G||Boolean(_.force),warnings:q.length>0?q:void 0},summary:`${X.length} component(s), ${X.reduce((Z,V)=>Z+V.files.length,0)} file(s) would be removed`};S4(H,{json:_.json,quiet:_.quiet,hints:G&&!_.force?["Add --force to remove modified files"]:void 0});return}if(G&&!_.force){Y?.fail("File integrity check failed");let H;for(let Z of X){let V=v.installed[Z.canonicalId];if(!V)continue;try{let S=await d_(Q.cwd,V);if(!S.intact){H={canonicalId:Z.canonicalId,integrity:S};break}}catch(S){throw new M(`Failed to check integrity for '${Z.canonicalId}': ${S instanceof Error?S.message:String(S)}`)}}if(H){let Z=H.integrity.modified.length>0?`Modified files:
248
- ${H.integrity.modified.map((T)=>` - ${T}`).join(`
249
- `)}`:"",V=H.integrity.missing.length>0?`Missing files:
250
- ${H.integrity.missing.map((T)=>` - ${T}`).join(`
251
- `)}`:"",S=[Z,V].filter(Boolean).join(`
252
- `);throw new M(`Component '${H.canonicalId}' has been modified. Use --force to remove anyway.
253
- ${S}`)}}for(let{canonicalId:H,files:Z}of X){for(let V of Z){let S=IA(Q.cwd,j,V);if(!S){if(_.verbose)W.info(` \u2298 Skipped ${V.path} (not found)`);continue}if(await YA(S,{force:!0}),_.verbose)W.info(` \u2713 Removed ${V.path}`)}delete v.installed[H],z.push(H)}if(await x4(Q.cwd,v),Y?.succeed(`Removed ${z.length} component(s)`),_.json)console.log(JSON.stringify({success:!0,removed:z,notFound:I},null,2));else if(!_.quiet){W.info("");for(let H of z){let Z=c6(H);W.success(`\u2713 Removed ${Z.registryName}/${Z.name}@${Z.revision}`)}W.info(""),W.success(`Done! Removed ${z.length} component(s).`)}}catch(H){throw Y?.fail("Failed to remove components"),H}}var gH=b(()=>{k0();X4();uY();w1();z$();c$();i$();X1();T0();a4();e4()});var cH=N6((hH,C8)=>{(($,_)=>{if(typeof define==="function"&&define.amd)define([],_);else if(typeof C8==="object"&&C8.exports)C8.exports=_();else $.fuzzysort=_()})(hH,($)=>{var _=(F,L)=>{if(!F||!L)return X$;var m=H(F);if(!h(L))L=j(L);var d=m.bitflags;if((d&L._bitflags)!==d)return X$;return V(m,L)},U=(F,L,m)=>{if(!F)return m?.all?Z(L,m):R$;var d=H(F),p=d.bitflags,c=d.containsSpace,f=q(m?.threshold||0),s=m?.limit||I$,i=0,H$=0,G$=L.length;function K4(t6){if(i<s)E1.add(t6),++i;else if(++H$,t6._score>E1.peek()._score)E1.replaceTop(t6)}if(m?.key){var $4=m.key;for(var W$=0;W$<G$;++W$){var J4=L[W$],w$=C(J4,$4);if(!w$)continue;if(!h(w$))w$=j(w$);if((p&w$._bitflags)!==p)continue;var N$=V(d,w$);if(N$===X$)continue;if(N$._score<f)continue;N$.obj=J4,K4(N$)}}else if(m?.keys){var F6=m.keys,T4=F6.length;$:for(var W$=0;W$<G$;++W$){var J4=L[W$];{var _4=0;for(var j$=0;j$<T4;++j$){var $4=F6[j$],w$=C(J4,$4);if(!w$){x[j$]=j4;continue}if(!h(w$))w$=j(w$);x[j$]=w$,_4|=w$._bitflags}if((p&_4)!==p)continue}if(c)for(let L$=0;L$<d.spaceSearches.length;L$++)Q$[L$]=$$;for(var j$=0;j$<T4;++j$){if(w$=x[j$],w$===j4){t[j$]=j4;continue}if(t[j$]=V(d,w$,!1,c),t[j$]===X$){t[j$]=j4;continue}if(c)for(let S$=0;S$<d.spaceSearches.length;S$++){if(D$[S$]>-1000){if(Q$[S$]>$$){var a$=(Q$[S$]+D$[S$])/4;if(a$>Q$[S$])Q$[S$]=a$}}if(D$[S$]>Q$[S$])Q$[S$]=D$[S$]}}if(c){for(let L$=0;L$<d.spaceSearches.length;L$++)if(Q$[L$]===$$)continue $}else{var q$=!1;for(let L$=0;L$<T4;L$++)if(t[L$]._score!==$$){q$=!0;break}if(!q$)continue}var D4=new z(T4);for(let L$=0;L$<T4;L$++)D4[L$]=t[L$];if(c){var r$=0;for(let L$=0;L$<d.spaceSearches.length;L$++)r$+=Q$[L$]}else{var r$=$$;for(let S$=0;S$<T4;S$++){var N$=D4[S$];if(N$._score>-1000){if(r$>$$){var a$=(r$+N$._score)/4;if(a$>r$)r$=a$}}if(N$._score>r$)r$=N$._score}}if(D4.obj=J4,D4._score=r$,m?.scoreFn){if(r$=m.scoreFn(D4),!r$)continue;r$=q(r$),D4._score=r$}if(r$<f)continue;K4(D4)}}else for(var W$=0;W$<G$;++W$){var w$=L[W$];if(!w$)continue;if(!h(w$))w$=j(w$);if((p&w$._bitflags)!==p)continue;var N$=V(d,w$);if(N$===X$)continue;if(N$._score<f)continue;K4(N$)}if(i===0)return R$;var O6=Array(i);for(var W$=i-1;W$>=0;--W$)O6[W$]=E1.poll();return O6.total=i+H$,O6},Q=(F,L="<b>",m="</b>")=>{var d=typeof L==="function"?L:void 0,p=F.target,c=p.length,f=F.indexes,s="",i=0,H$=0,G$=!1,K4=[];for(var $4=0;$4<c;++$4){var W$=p[$4];if(f[H$]===$4){if(++H$,!G$)if(G$=!0,d)K4.push(s),s="";else s+=L;if(H$===f.length){if(d)s+=W$,K4.push(d(s,i++)),s="",K4.push(p.substr($4+1));else s+=W$+m+p.substr($4+1);break}}else if(G$)if(G$=!1,d)K4.push(d(s,i++)),s="";else s+=m;s+=W$}return d?K4:s},v=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";var L=r(F);return I(F,{_targetLower:L._lower,_targetLowerCodes:L.lowerCodes,_bitflags:L.bitflags})},J=()=>{k.clear(),O.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((F,L)=>F-L)}set["indexes"](F){return this._indexes=F}["highlight"](F,L){return Q(this,F,L)}get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}class z extends Array{get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}var I=(F,L)=>{let m=new Y;return m.target=F,m.obj=L.obj??X$,m._score=L._score??$$,m._indexes=L._indexes??[],m._targetLower=L._targetLower??"",m._targetLowerCodes=L._targetLowerCodes??X$,m._nextBeginningIndexes=L._nextBeginningIndexes??X$,m._bitflags=L._bitflags??0,m},X=(F)=>{if(F===$$)return 0;if(F>1)return F;return Math.E**(((-F+1)**0.04307-1)*-2)},q=(F)=>{if(F===0)return $$;if(F>1)return F;return 1-Math.pow(Math.log(F)/-2+1,23.218017181332716)},G=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";F=F.trim();var L=r(F),m=[];if(L.containsSpace){var d=F.split(/\s+/);d=[...new Set(d)];for(var p=0;p<d.length;p++){if(d[p]==="")continue;var c=r(d[p]);m.push({lowerCodes:c.lowerCodes,_lower:d[p].toLowerCase(),containsSpace:!1})}}return{lowerCodes:L.lowerCodes,_lower:L._lower,containsSpace:L.containsSpace,bitflags:L.bitflags,spaceSearches:m}},j=(F)=>{if(F.length>999)return v(F);var L=k.get(F);if(L!==void 0)return L;return L=v(F),k.set(F,L),L},H=(F)=>{if(F.length>999)return G(F);var L=O.get(F);if(L!==void 0)return L;return L=G(F),O.set(F,L),L},Z=(F,L)=>{var m=[];m.total=F.length;var d=L?.limit||I$;if(L?.key)for(var p=0;p<F.length;p++){var c=F[p],f=C(c,L.key);if(f==X$)continue;if(!h(f))f=j(f);var s=I(f.target,{_score:f._score,obj:c});if(m.push(s),m.length>=d)return m}else if(L?.keys)for(var p=0;p<F.length;p++){var c=F[p],i=new z(L.keys.length);for(var H$=L.keys.length-1;H$>=0;--H$){var f=C(c,L.keys[H$]);if(!f){i[H$]=j4;continue}if(!h(f))f=j(f);f._score=$$,f._indexes.len=0,i[H$]=f}if(i.obj=c,i._score=$$,m.push(i),m.length>=d)return m}else for(var p=0;p<F.length;p++){var f=F[p];if(f==X$)continue;if(!h(f))f=j(f);if(f._score=$$,f._indexes.len=0,m.push(f),m.length>=d)return m}return m},V=(F,L,m=!1,d=!1)=>{if(m===!1&&F.containsSpace)return S(F,L,d);var{_lower:p,lowerCodes:c}=F,f=c[0],s=L._targetLowerCodes,i=c.length,H$=s.length,W$=0,G$=0,K4=0;for(;;){var $4=f===s[G$];if($4){if(w[K4++]=G$,++W$,W$===i)break;f=c[W$]}if(++G$,G$>=H$)return X$}var W$=0,J4=!1,w$=0,N$=L._nextBeginningIndexes;if(N$===X$)N$=L._nextBeginningIndexes=u(L.target);G$=w[0]===0?0:N$[w[0]-1];var F6=0;if(G$!==H$)for(;;)if(G$>=H$){if(W$<=0)break;if(++F6,F6>200)break;--W$;var T4=v$[--w$];G$=N$[T4]}else{var $4=c[W$]===s[G$];if($4){if(v$[w$++]=G$,++W$,W$===i){J4=!0;break}++G$}else G$=N$[G$]}var _4=i<=1?-1:L._targetLower.indexOf(p,w[0]),j$=!!~_4,a$=!j$?!1:_4===0||L._nextBeginningIndexes[_4-1]===_4;if(j$&&!a$)for(var q$=0;q$<N$.length;q$=N$[q$]){if(q$<=_4)continue;for(var D4=0;D4<i;D4++)if(c[D4]!==L._targetLowerCodes[q$+D4])break;if(D4===i){_4=q$,a$=!0;break}}var r$=(L$)=>{var S$=0,oY=0;for(var K6=1;K6<i;++K6)if(L$[K6]-L$[K6-1]!==1)S$-=L$[K6],++oY;var gW=L$[i-1]-L$[0]-(i-1);if(S$-=(12+gW)*oY,L$[0]!==0)S$-=L$[0]*L$[0]*0.2;if(!J4)S$*=1000;else{var r8=1;for(var K6=N$[0];K6<H$;K6=N$[K6])++r8;if(r8>24)S$*=(r8-24)*10}if(S$-=(H$-i)/2,j$)S$/=1+i*i*1;if(a$)S$/=1+i*i*1;return S$-=(H$-i)/2,S$};if(!J4){if(j$)for(var q$=0;q$<i;++q$)w[q$]=_4+q$;var O6=w,t6=r$(O6)}else if(a$){for(var q$=0;q$<i;++q$)w[q$]=_4+q$;var O6=w,t6=r$(w)}else var O6=v$,t6=r$(v$);L._score=t6;for(var q$=0;q$<i;++q$)L._indexes[q$]=O6[q$];L._indexes.len=i;let _v=new Y;return _v.target=L.target,_v._score=L._score,_v._indexes=L._indexes,_v},S=(F,L,m)=>{var d=new Set,p=0,c=X$,f=0,s=F.spaceSearches,i=s.length,H$=0,G$=()=>{for(let a$=H$-1;a$>=0;a$--)L._nextBeginningIndexes[o[a$*2+0]]=o[a$*2+1]},K4=!1;for(var j$=0;j$<i;++j$){D$[j$]=$$;var $4=s[j$];if(c=V($4,L),m){if(c===X$)continue;K4=!0}else if(c===X$)return G$(),X$;var W$=j$===i-1;if(!W$){var J4=c._indexes,w$=!0;for(let q$=0;q$<J4.len-1;q$++)if(J4[q$+1]-J4[q$]!==1){w$=!1;break}if(w$){var N$=J4[J4.len-1]+1,F6=L._nextBeginningIndexes[N$-1];for(let q$=N$-1;q$>=0;q$--){if(F6!==L._nextBeginningIndexes[q$])break;L._nextBeginningIndexes[q$]=N$,o[H$*2+0]=q$,o[H$*2+1]=F6,H$++}}}if(p+=c._score/i,D$[j$]=c._score/i,c._indexes[0]<f)p-=(f-c._indexes[0])*2;f=c._indexes[0];for(var T4=0;T4<c._indexes.len;++T4)d.add(c._indexes[T4])}if(m&&!K4)return X$;G$();var _4=V(F,L,!0);if(_4!==X$&&_4._score>p){if(m)for(var j$=0;j$<i;++j$)D$[j$]=_4._score/i;return _4}if(m)c=L;c._score=p;var j$=0;for(let a$ of d)c._indexes[j$++]=a$;return c._indexes.len=j$,c},T=(F)=>F.replace(/\p{Script=Latin}+/gu,(L)=>L.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),r=(F)=>{F=T(F);var L=F.length,m=F.toLowerCase(),d=[],p=0,c=!1;for(var f=0;f<L;++f){var s=d[f]=m.charCodeAt(f);if(s===32){c=!0;continue}var i=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;p|=1<<i}return{lowerCodes:d,bitflags:p,containsSpace:c,_lower:m}},A=(F)=>{var L=F.length,m=[],d=0,p=!1,c=!1;for(var f=0;f<L;++f){var s=F.charCodeAt(f),i=s>=65&&s<=90,H$=i||s>=97&&s<=122||s>=48&&s<=57,G$=i&&!p||!c||!H$;if(p=i,c=H$,G$)m[d++]=f}return m},u=(F)=>{F=T(F);var L=F.length,m=A(F),d=[],p=m[0],c=0;for(var f=0;f<L;++f)if(p>f)d[f]=p;else p=m[++c],d[f]=p===void 0?L:p;return d},k=new Map,O=new Map,w=[],v$=[],o=[],Q$=[],D$=[],x=[],t=[],C=(F,L)=>{var m=F[L];if(m!==void 0)return m;if(typeof L==="function")return L(F);var d=L;if(!Array.isArray(L))d=L.split(".");var p=d.length,c=-1;while(F&&++c<p)F=F[d[c]];return F},h=(F)=>{return typeof F==="object"&&typeof F._bitflags==="number"},I$=1/0,$$=-I$,R$=[];R$.total=0;var X$=null,j4=v(""),n8=(F)=>{var L=[],m=0,d={},p=(c)=>{for(var f=0,s=L[f],i=1;i<m;){var H$=i+1;f=i,H$<m&&L[H$]._score<L[i]._score&&(f=H$),L[f-1>>1]=L[f],i=1+(f<<1)}for(var G$=f-1>>1;f>0&&s._score<L[G$]._score;G$=(f=G$)-1>>1)L[f]=L[G$];L[f]=s};return d.add=(c)=>{var f=m;L[m++]=c;for(var s=f-1>>1;f>0&&c._score<L[s]._score;s=(f=s)-1>>1)L[f]=L[s];L[f]=c},d.poll=(c)=>{if(m!==0){var f=L[0];return L[0]=L[--m],p(),f}},d.peek=(c)=>{if(m!==0)return L[0]},d.replaceTop=(c)=>{L[0]=c,p()},d},E1=n8();return{single:_,go:U,prepare:v,cleanup:J}})});var dH={};s$(dH,{runSearchCore:()=>lH,runSearchCommandAction:()=>GA});async function GA($,_){if(_.installed){let Q=await F4(_.cwd);if(!Q||Object.keys(Q.installed).length===0){if(_.json)O$({success:!0,data:{components:[]}});else W.info("No components installed.");return}let v=Object.entries(Q.installed).map(([J,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(_.json)O$({success:!0,data:{components:v}});else{W.info(`Installed components (${v.length}):`);for(let J of v)console.log(` ${g.cyan(J.name)} ${g.dim(`v${J.version}`)} from ${J.registry}`)}return}let U;if(_.profile){let Q=await q6.create(_.cwd,{profile:_.profile});U={cwd:Q.getCwd(),getRegistries:()=>Q.getRegistries(),getComponentPath:()=>Q.getComponentPath()}}else U=await y4.requireInitialized(_.cwd);await lH($,_,U)}async function lH($,_,U){let Q=U.getRegistries();if(_.verbose)W.info(`Searching in ${Object.keys(Q).length} registries...`);let v=[],J=V$({text:"Searching registries...",quiet:_.quiet||_.verbose});if(!_.json&&!_.verbose)J.start();for(let[z,I]of Object.entries(Q))try{if(_.verbose)W.info(`Fetching index from ${z} (${I.url})...`);let X=await n6(I.url);if(_.verbose)W.info(`Found ${X.components.length} components in ${z}`);for(let q of X.components)v.push({name:`${z}/${q.name}`,description:q.description,type:q.type,registry:z})}catch(X){if(_.verbose)W.warn(`Failed to fetch registry ${z}: ${X instanceof Error?X.message:String(X)}`)}if(!_.json&&!_.verbose)J.stop();let Y=v;if($)Y=yY.default.go($,v,{keys:["name","description"],limit:_.limit}).map((I)=>I.obj);else Y=Y.slice(0,_.limit);if(_.json){O$({success:!0,data:{components:Y}});return}if(Y.length===0){W.info("No components found.");return}W.info(`Found ${Y.length} components:`);for(let z of Y)console.log(` ${g.cyan(z.name)} ${g.dim(`(${z.type})`)} - ${z.description}`)}var yY;var pH=b(()=>{k6();k0();g_();D1();BJ();i$();e4();yY=tY(cH(),1)});function jA($){let _=parseInt($,10);if(Number.isNaN(_)||_<=0)throw new iq("Must be a positive integer");return _}function iH($){let _=$.command("search").alias("list").description("Search for components across registries or list installed").argument("[query]","Search query").option("--installed","List installed components only",!1).option("-p, --profile <name>","Use specific profile").addOption(new M6("--limit <n>","Limit results").default(20).argParser(jA));Q4(_),m4(_),_.action(async(U,Q)=>{try{let{runSearchCommandAction:v}=await Promise.resolve().then(() => (pH(),dH));await v(U,Q)}catch(v){_$(v,{json:Q.json})}})}var nH=b(()=>{a2();c$();a4()});function rH($){let _=["curl","npm","yarn","pnpm","bun"],U=_.find((Q)=>Q===$);if(!U)throw new f$(`Invalid install method: "${$}"
254
- Valid methods: ${_.join(", ")}`);return U}function h0(){if(KA())return"curl";let $=process.argv[1]??"";if(HA($))return"unknown";if(WA($))return"yarn";if(bA($))return"pnpm";if(BA($))return"bun";if(ZA($))return"npm";let _=process.env.npm_config_user_agent??"";if(_.includes("yarn"))return"yarn";if(_.includes("pnpm"))return"pnpm";if(_.includes("bun"))return"bun";if(_.includes("npm"))return"npm";return"unknown"}function f8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var KA=()=>Bun.main.startsWith("/$bunfs/"),HA=($)=>$.includes("/_npx/")||$.includes("/.cache/bunx/")||$.includes("/.pnpm/_temp/"),WA=($)=>$.includes("/.yarn/global")||$.includes("/.config/yarn/global"),bA=($)=>$.includes("/.pnpm/")||$.includes("/pnpm/global"),BA=($)=>$.includes("/.bun/bin")||$.includes("/.bun/install/global"),ZA=($)=>$.includes("/.npm/")||$.includes("/node_modules/");var m8=b(()=>{z$()});import{existsSync as fY,lstatSync as aH,readdirSync as VA,realpathSync as oH,rmSync as DA,unlinkSync as sH}from"fs";import{homedir as eH}from"os";import $6 from"path";function CY($,_=0){O$({success:!0,data:$}),process.exit(_)}function N1($,_,U,Q){let v={success:!1,error:{code:$,message:_,...Q&&{details:Q}},exitCode:U,meta:{timestamp:new Date().toISOString()}};O$(v),process.exit(U)}function mY($){return $ instanceof Error&&"code"in $}function e_($){let _=eH();if(!_)return $;if($===_)return"~";if($.startsWith(_+$6.sep))return`~${$.slice(_.length)}`;return $}function h8($,_){let U=$6.normalize($),Q=$6.normalize(_),v=$6.relative(U,Q);if(v.startsWith("..")||$6.isAbsolute(v))return null;return v}function MA($,_){return h8($,_)!==null}function wA($,_){if(!fY(_))return{contained:!0};try{let U=oH($),Q=oH(_);return{contained:h8(U,Q)!==null}}catch(U){if(mY(U)&&(U.code==="EACCES"||U.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function $W($){try{let _=aH($);if(_.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!_.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(_){if(mY(_)){if(_.code==="ENOENT")return{valid:!1,reason:"not-found"};if(_.code==="EACCES"||_.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function $v($){if(!fY($))return"missing";try{let _=aH($);if(_.isSymbolicLink())return"symlink";if(_.isDirectory())return"directory";return"file"}catch{return"missing"}}function LA($){if(!fY($))return!0;try{return VA($).length===0}catch{return!1}}function tH($){if($.kind==="missing")return"safe";if($.kind==="symlink")return MA($.rootPath,$.absolutePath)?"safe":"forbidden";let _=wA($.rootPath,$.absolutePath);if(_.error)return"error";return _.contained?"safe":"forbidden"}function S1($){return $==="npm"||$==="pnpm"||$==="bun"||$==="yarn"}function c8($){switch($){case"npm":return"npm uninstall -g ocx";case"pnpm":return"pnpm remove -g ocx";case"bun":return"bun remove -g ocx";case"yarn":return"yarn global remove ocx";default:return"npm uninstall -g ocx"}}function gY(){let $=process.env.XDG_CONFIG_HOME||$6.join(eH(),".config");return $6.join($,"opencode")}function _W(){let $=gY(),_=[],U=w6(),Q=h8($,U);if(Q){let z=$v(U);_.push({rootPath:$,relativePath:Q,absolutePath:U,displayPath:e_(U),kind:z,deleteIfEmpty:!1,safetyStatus:tH({rootPath:$,absolutePath:U,kind:z})})}let v=F0(),J=h8($,v);if(J){let z=$v(v);_.push({rootPath:$,relativePath:J,absolutePath:v,displayPath:e_(v),kind:z,deleteIfEmpty:!1,safetyStatus:tH({rootPath:$,absolutePath:v,kind:z})})}let Y=$v($);return _.push({rootPath:$,relativePath:".",absolutePath:$,displayPath:e_($),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),_}function vW(){let $=h0();if(S1($))return null;if($==="curl"){let _=f8(),U=$v(_);return{rootPath:$6.dirname(_),relativePath:$6.basename(_),absolutePath:_,displayPath:e_(_),kind:U,deleteIfEmpty:!1,safetyStatus:U==="missing"?"safe":"safe"}}return null}function kA($){if($.kind==="missing")return{target:$,success:!0,skipped:!0,reason:"not found"};if($.safetyStatus==="forbidden")return{target:$,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if($.deleteIfEmpty&&$.kind==="directory"){if(!LA($.absolutePath))return{target:$,success:!0,skipped:!0,reason:"not empty"}}try{if($.kind==="directory")DA($.absolutePath,{recursive:!0,force:!0});else sH($.absolutePath);return{target:$,success:!0,skipped:!1}}catch(_){let U=_ instanceof Error?_:Error(String(_)),Q=mY(_)&&(_.code==="EACCES"||_.code==="EPERM")?"permission denied":void 0;return{target:$,success:!1,skipped:!1,reason:Q,error:U}}}function UW($){return $.map(kA)}function QW($,_={}){let U={rootPath:$6.dirname($),relativePath:$6.basename($),absolutePath:$,displayPath:e_($),kind:$v($),deleteIfEmpty:!1,safetyStatus:"safe"};if(U.kind==="missing")return{target:U,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!_.suppressOutput)W.info(`To complete uninstall, manually delete: ${U.displayPath}`);return{target:U,success:!0,skipped:!0}}try{return sH($),{target:U,success:!0,skipped:!1}}catch(Q){let v=Q instanceof Error?Q:Error(String(Q));return{target:U,success:!1,skipped:!1,reason:"permission denied",error:v}}}function AA($,_,U){let{dryRunResult:Q,hints:v}=JW($,_,U);S4(Q,{hints:v})}function JW($,_,U){let Q=$.filter((z)=>z.kind!=="missing"),v=[];for(let z of Q)v.push({action:"delete",target:z.displayPath,details:{kind:z.kind,...z.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(_&&_.kind!=="missing")v.push({action:"delete",target:_.displayPath,details:{kind:"binary"}});let J=[];if(S1(U))J.push(`Binary is managed by ${U}. Run: ${c8(U)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:v,validation:{passed:!0},summary:v.length>0?`Would remove ${v.length} item(s)`:"Nothing to remove"},hints:J}}function FA($,_){if($.filter((Q)=>Q.kind!=="missing").length>0||_&&_.kind!=="missing")W.info("Removing OCX files...")}function OA($,_,U){W.break();for(let Q of $){if(Q.skipped){if(Q.reason==="not found")continue;if(Q.reason==="not empty"){W.info(`Kept ${N4.path(Q.target.displayPath)} (not empty)`);continue}if(Q.reason==="permission denied"){W.warn(`Skipped ${N4.path(Q.target.displayPath)} (permission denied)`);continue}if(Q.reason==="containment violation"){W.warn(`Skipped ${N4.path(Q.target.displayPath)} (containment violation)`);continue}}if(Q.success)W.success(`Removed ${N4.path(Q.target.displayPath)}`);else W.error(`Failed to remove ${Q.target.displayPath}: ${Q.error?.message}`)}if(_){if(_.skipped&&_.reason==="not found");else if(_.success&&!_.skipped)W.success(`Removed binary ${N4.path(_.target.displayPath)}`);else if(!_.success)W.error(`Failed to remove binary ${_.target.displayPath}: ${_.error?.message}`)}if(S1(U))W.break(),W.info(`Binary is managed by ${U}. To complete uninstall, run:`),W.log(` ${N4.command(c8(U))}`)}function NA(){W.info("Nothing to remove. OCX is not installed globally.")}function g8($){return{path:$.target.displayPath,kind:$.target.kind,success:$.success,skipped:$.skipped,...$.reason&&{reason:$.reason},...$.error&&{error:$.error.message}}}async function SA($){let _=gY(),U=$W(_);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":return N1("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",n$.SAFETY_ERROR);case"not-directory":return N1("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",n$.SAFETY_ERROR);case"permission":return N1("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",n$.ERROR)}let Q=_W(),v=Q.filter((T)=>T.safetyStatus==="forbidden");if(v.length>0)return N1("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",n$.SAFETY_ERROR,{targets:v.map((T)=>T.displayPath)});let J=Q.filter((T)=>T.safetyStatus==="error");if(J.length>0)return N1("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",n$.ERROR,{targets:J.map((T)=>T.displayPath)});let Y=h0(),z=vW(),I=Q.filter((T)=>T.kind!=="missing"),X=Boolean(z&&z.kind!=="missing"),q=S1(Y);if(I.length===0&&!X&&!q)return CY({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},n$.SUCCESS);if($.dryRun){let{dryRunResult:T,hints:r}=JW(Q,z,Y);return CY({...T,...r.length>0&&{hints:r}},n$.SUCCESS)}let G=UW(Q),j=null;if(z)j=QW(z.absolutePath,{suppressOutput:!0});let H=G.some((T)=>!T.success&&!T.skipped),Z=Boolean(j&&!j.success&&!j.skipped);if(H||Z)return N1("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",n$.ERROR,{configResults:G.map(g8),...j&&{binaryResult:g8(j)}});if(S1(Y))return N1("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${c8(Y)}`,n$.ERROR,{installMethod:Y,command:c8(Y),configResults:G.map(g8),...j&&{binaryResult:g8(j)}});let V=G.filter((T)=>T.success&&!T.skipped).map((T)=>T.target.displayPath),S=G.filter((T)=>T.skipped).map((T)=>({path:T.target.displayPath,reason:T.reason??"skipped"}));if(j){if(j.success&&!j.skipped)V.push(j.target.displayPath);else if(j.skipped)S.push({path:j.target.displayPath,reason:j.reason??"skipped"})}return CY({removed:V,skipped:S,installMethod:Y},n$.SUCCESS)}async function TA($){if($.json){await SA($);return}let _=gY(),U=$W(_);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":W.error("Safety error: Global config root is a symlink. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"not-directory":W.error("Safety error: Global config root is not a directory. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"permission":W.error("Error: Cannot access global config root (permission denied)."),process.exit(n$.ERROR);break}let Q=_W(),v=Q.filter((V)=>V.safetyStatus==="forbidden");if(v.length>0){W.error("Safety error: Target escapes containment boundary:");for(let V of v)W.error(` ${V.displayPath}`);process.exit(n$.SAFETY_ERROR)}let J=Q.filter((V)=>V.safetyStatus==="error");if(J.length>0){W.error("Error: Cannot verify containment for targets (permission/IO error):");for(let V of J)W.error(` ${V.displayPath}`);process.exit(n$.ERROR)}let Y=h0(),z=vW(),I=Q.filter((V)=>V.kind!=="missing"),X=z&&z.kind!=="missing",q=S1(Y);if(I.length===0&&!X&&!q)NA(),process.exit(n$.SUCCESS);if($.dryRun)AA(Q,z,Y),process.exit(n$.SUCCESS);FA(Q,z);let G=UW(Q),j=null;if(z)j=QW(z.absolutePath);OA(G,j,Y);let H=G.some((V)=>!V.success&&!V.skipped),Z=j&&!j.success&&!j.skipped;if(H||Z)process.exit(n$.ERROR);if(S1(Y))process.exit(n$.ERROR);process.exit(n$.SUCCESS)}function YW($){$.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(_)=>{try{await TA(_)}catch(U){_$(U,{json:_.json})}})}var n$;var zW=b(()=>{Z4();m8();w1();c$();i$();n$={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class IW{version="2.0.5"}var XW;var qW=b(()=>{XW=new IW});var jW={};s$(jW,{checkForUpdate:()=>cY,EXPLICIT_UPDATE_TIMEOUT_MS:()=>hY});function GW($){let[_=""]=$.split("-"),U=_.split("."),Q=parseInt(U[0]??"",10),v=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(v)||Number.isNaN(J))return null;return{major:Q,minor:v,patch:J}}function PA($,_){let U=GW($),Q=GW(_);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}async function cY($,_=RA){let Q=($??XW).version||"0.0.0-dev";if(Q==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let J=(await q8(EA,void 0,AbortSignal.timeout(_))).version,Y=PA(J,Q);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:Q,latest:J,updateAvailable:Y>0}}catch(v){if(v instanceof Error){if(v.name==="AbortError"||v.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(v instanceof E$||v.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var RA=200,hY=1e4,EA="ocx";var lY=b(()=>{z$();iJ();qW()});import{chmodSync as xA,existsSync as T1,renameSync as dY,unlinkSync as l8}from"fs";function CA(){let $=process.env.OCX_DOWNLOAD_URL;if($)return $.replace(/\/+$/,"");return yA}function pY($){let _=`${process.arch}-${process.platform}`,U=KW[_];if(!U){let v=Object.keys(KW).join(", ");throw new f$(`Unsupported platform: ${_}
255
- Supported platforms: ${v}`)}return`${CA()}/v${$}/${U}`}async function fA($,_,U={}){let Q=U.quiet?null:V$({text:"Downloading update..."});Q?.start();let v;try{v=await fetch($,{redirect:"follow"})}catch(X){throw Q?.fail("Download failed"),new f$(`Network error: ${X instanceof Error?X.message:String(X)}`)}if(!v.ok)throw Q?.fail("Download failed"),new f$(`Failed to download: HTTP ${v.status} ${v.statusText}`);if(!v.body)throw Q?.fail("Download failed"),new f$("Download failed: Empty response body");let J=v.body.getReader(),Y=Bun.file(_).writer(),z=Number(v.headers.get("content-length")||0),I=0;try{while(!0){let{done:X,value:q}=await J.read();if(X)break;if(await Y.write(q),I+=q.length,z>0&&Q){let G=Math.round(I/z*100);Q.text=`Downloading... ${G}%`}}await Y.end(),Q?.succeed("Download complete")}catch(X){throw Q?.fail("Download failed"),await Y.end(),new f$(`Download interrupted: ${X instanceof Error?X.message:String(X)}`)}}async function HW($,_={}){let U=f8(),Q=`${U}.new.${Date.now()}`,v=pY($);await fA(v,Q,_);try{xA(Q,493)}catch(J){if(T1(Q))l8(Q);throw new f$(`Failed to set permissions: ${J instanceof Error?J.message:String(J)}`)}return{tempPath:Q,execPath:U}}function WW($,_){let U=`${_}.backup`;try{if(T1(_))dY(_,U);if(dY($,_),T1(U))l8(U)}catch(Q){if(T1(U)&&!T1(_))try{dY(U,_)}catch{}if(T1($))try{l8($)}catch{}throw new f$(`Update failed: ${Q instanceof Error?Q.message:String(Q)}`)}}function bW($){if(T1($))try{l8($)}catch{}}var uA="kdcokenny/ocx",yA,KW;var BW=b(()=>{z$();e4();m8();yA=`https://github.com/${uA}/releases/download`,KW={"arm64-darwin":"ocx-darwin-arm64","x64-darwin":"ocx-darwin-x64","arm64-linux":"ocx-linux-arm64","x64-linux":"ocx-linux-x64","x64-win32":"ocx-windows-x64.exe"}});var ZW={};s$(ZW,{notifyUpdated:()=>d8,notifyUpdate:()=>mA,notifyUpToDate:()=>iY});function mA($,_){if(!process.stdout.isTTY)return;console.error(`${g.cyan("info")}: update available - ${g.green(_)} (current: ${g.dim($)})`),console.error(` run ${g.cyan("`ocx self update`")} to upgrade`)}function iY($){console.error(`${g.cyan("info")}: ocx unchanged - ${g.dim($)}`)}function d8($,_){console.error(` ${g.green("ocx updated")} - ${_} (from ${$})`)}var nY=b(()=>{k6()});import{createHash as gA}from"crypto";function cA($){let _=new Map;for(let U of $.split(`
256
- `)){let Q=U.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if(Q?.[1]&&Q[2])_.set(Q[2].trim(),Q[1].toLowerCase())}return _}function lA($){return gA("sha256").update($).digest("hex")}async function VW($){let _=`https://github.com/${hA}/releases/download/v${$}/SHA256SUMS.txt`,U=await fetch(_);if(!U.ok)throw new f$(`Failed to fetch checksums: ${U.status}`);let Q=await U.text();return cA(Q)}async function DW($,_,U){let v=await Bun.file($).arrayBuffer(),J=lA(Buffer.from(v));if(J!==_)throw new I1(U,_,J)}var hA="kdcokenny/ocx";var MW=b(()=>{z$()});var wW={};s$(wW,{runSelfUpdateCommand:()=>iA});async function iA($){let _=$.method?rH($.method):h0(),U=$.json===!0,Q=await cY(void 0,hY);if(!Q.ok)throw new f$(pA[Q.reason]);let{current:v,latest:J,updateAvailable:Y}=Q;if(!Y&&!$.force){if(U)O$({success:!0,data:{current:v,latest:J,method:_,updated:!1}});else iY(v);return}let z=J;switch(_){case"curl":{await nA(v,z,U);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await rA(_,v,z,U);break}}if(U)O$({success:!0,data:{current:v,latest:z,method:_,updated:!0}})}async function nA($,_,U){let v=pY(_).split("/").pop();if(!v)throw new f$("Failed to determine binary filename from download URL");let Y=(await VW(_)).get(v);if(!Y)throw new f$(`Security error: No checksum found for ${v}. Update aborted.`);let{tempPath:z,execPath:I}=await HW(_,{quiet:U});try{await DW(z,Y,v)}catch(X){throw bW(z),X}if(WW(z,I),!U)d8($,_)}async function p8($){let _=Bun.spawn($,{stdout:"pipe",stderr:"pipe"});if(await _.exited!==0){let Q=await new Response(_.stderr).text();throw new f$(`Package manager command failed: ${Q.trim()}`)}}async function rA($,_,U,Q){if(!dA.test(U))throw new f$(`Invalid version format: ${U}`);let v=Q?null:V$({text:`Updating via ${$}...`});v?.start();try{switch($){case"npm":{await p8(["npm","install","-g",`ocx@${U}`]);break}case"yarn":{await p8(["yarn","global","add",`ocx@${U}`]);break}case"pnpm":{await p8(["pnpm","install","-g",`ocx@${U}`]);break}case"bun":{await p8(["bun","install","-g",`ocx@${U}`]);break}case"unknown":throw new f$(`Could not detect install method. Update manually with one of:
242
+ Use one of the canonical IDs above.`}function CA(Q){return`Component '${Q}' is not installed.
243
+ Run 'ocx search --installed' to see installed components.`}function yA(Q,$){let Y=Object.keys($.installed);if($.installed[Q])return Q;if(vA(Q)){let{registryName:q,componentName:J}=PA(Q),X=Y.filter((H)=>{let G=R8(H);return G.registryName===q&&G.name===J}).sort();if(X.length===1){let[H]=X;if(!H)throw Error("Unexpected empty canonical ID result");return H}if(X.length>1)throw new L(xA(Q,X))}throw new B1(CA(Q))}function H7(Q,$){return Q.map((Y)=>yA(Y,$))}var s6=A(()=>{g0();t();y9()});import{realpathSync as YK}from"fs";import{rm as hA}from"fs/promises";import{sep as fA}from"path";function qK(Q,$,Y){let q=V0(Q,Y),J;try{J=YK(q)}catch(X){let H=X.code;if(H==="ENOENT"||H==="ENOTDIR")return{path:Y,targetReal:null};if(H==="ELOOP")throw new L(`Security violation: symlink loop detected at ${Y}`);if(H==="EACCES"||H==="EPERM")throw new L(`Security violation: cannot verify path ${Y}`);throw X}if(J===$)throw new L(`Security violation: cannot delete project root directory (${Y})`);if(!J.startsWith($+fA))throw new L("Security violation: path escapes project directory");return{path:Y,targetReal:J}}function uA(Q,$,Y){let q=qK(Q,$,Y.path);if(!Y.targetReal){if(q.targetReal)throw new L(`Security violation: missing target reappeared during removal (${Y.path})`);return null}if(!q.targetReal)return null;if(q.targetReal!==Y.targetReal)throw new L(`Security violation: target changed during removal (${Y.path})`);return q.targetReal}function mA(Q){let $=new Set,Y=[];for(let q of Q){if($.has(q))continue;$.add(q),Y.push(q)}return Y}function JK(Q){let $=Q.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");Q0($),$.option("-f, --force","Force removal even if files have been modified"),E0($),$.option("--dry-run","Show what would be removed without making changes").action(async(Y,q)=>{try{await gA(Y,q)}catch(J){s(J,{json:q.json})}})}async function gA(Q,$){let Y=$.cwd??process.cwd(),q=await b0.requireInitialized(Y);if(Q.length===0)throw new L("No components specified. Specify at least one component ID.");let J=await A0(q.cwd);if(!J||Object.keys(J.installed).length===0)throw new B1("No components installed.");let X=mA(H7(Q,J)),H=$.quiet?null:Z1({text:"Removing components..."});H?.start();let G=[],K=[],W=[],z=[],B=!1,Z;try{Z=YK(q.cwd)}catch(M){throw new L("Cannot resolve project directory")}try{for(let M of X){let V=J.installed[M];if(!V)throw Error(`Resolved component '${M}' was not found in receipt.`);let U=[];for(let I of V.files){if(!I.path||I.path===".")throw new L(`Invalid file path in receipt for '${M}': path cannot be empty or "."`);try{U.push(qK(q.cwd,Z,I.path))}catch(g){if(g instanceof e1)throw new L(`Security violation in receipt for '${M}': ${g.message}`);throw g}}let R=await T2(q.cwd,V);if(!R.intact){B=!0;let I=R.modified.map((g)=>` - ${g}`).join(`
244
+ `);if($.force)z.push(`Component '${M}' has been modified but will be force-removed:
245
+ ${I}`);else z.push(`Component '${M}' has been modified. Use --force to remove anyway:
246
+ ${I}`)}W.push({canonicalId:M,files:U})}if($.dryRun){H?.stop();let M={dryRun:!0,command:"remove",wouldPerform:W.flatMap(({canonicalId:V,files:U})=>U.map((R)=>({action:"delete",target:R.path,details:{component:V}}))),validation:{passed:!B||Boolean($.force),warnings:z.length>0?z:void 0},summary:`${W.length} component(s), ${W.reduce((V,U)=>V+U.files.length,0)} file(s) would be removed`};j0(M,{json:$.json,quiet:$.quiet,hints:B&&!$.force?["Add --force to remove modified files"]:void 0});return}if(B&&!$.force){H?.fail("File integrity check failed");let M;for(let V of W){let U=J.installed[V.canonicalId];if(!U)continue;try{let R=await T2(q.cwd,U);if(!R.intact){M={canonicalId:V.canonicalId,integrity:R};break}}catch(R){throw new L(`Failed to check integrity for '${V.canonicalId}': ${R instanceof Error?R.message:String(R)}`)}}if(M){let V=M.integrity.modified.length>0?`Modified files:
247
+ ${M.integrity.modified.map((I)=>` - ${I}`).join(`
248
+ `)}`:"",U=M.integrity.missing.length>0?`Missing files:
249
+ ${M.integrity.missing.map((I)=>` - ${I}`).join(`
250
+ `)}`:"",R=[V,U].filter(Boolean).join(`
251
+ `);throw new L(`Component '${M.canonicalId}' has been modified. Use --force to remove anyway.
252
+ ${R}`)}}for(let{canonicalId:M,files:V}of W){for(let U of V){let R=uA(q.cwd,Z,U);if(!R){if($.verbose)_.info(` \u2298 Skipped ${U.path} (not found)`);continue}if(await hA(R,{force:!0}),$.verbose)_.info(` \u2713 Removed ${U.path}`)}delete J.installed[M],G.push(M)}if(await N0(q.cwd,J),H?.succeed(`Removed ${G.length} component(s)`),$.json)console.log(JSON.stringify({success:!0,removed:G,notFound:K},null,2));else if(!$.quiet){_.info("");for(let M of G){let V=R8(M);_.success(`\u2713 Removed ${V.registryName}/${V.name}@${V.revision}`)}_.info(""),_.success(`Done! Removed ${G.length} component(s).`)}}catch(M){throw H?.fail("Failed to remove components"),M}}var XK=A(()=>{E9();q0();s6();e8();t();u1();c1();g8();y9();d0();l0()});var GK=F8((HK,G7)=>{((Q,$)=>{if(typeof define==="function"&&define.amd)define([],$);else if(typeof G7==="object"&&G7.exports)G7.exports=$();else Q.fuzzysort=$()})(HK,(Q)=>{var $=(T,O)=>{if(!T||!O)return $1;var v=M(T);if(!C(O))O=Z(O);var f=v.bitflags;if((f&O._bitflags)!==f)return $1;return U(v,O)},Y=(T,O,v)=>{if(!T)return v?.all?V(O,v):D1;var f=M(T),u=f.bitflags,y=f.containsSpace,k=z(v?.threshold||0),i=v?.limit||e,m=0,G1=0,J1=O.length;function G0(y8){if(m<i)W9.add(y8),++m;else if(++G1,y8._score>W9.peek()._score)W9.replaceTop(y8)}if(v?.key){var r1=v.key;for(var K1=0;K1<J1;++K1){var $0=O[K1],V1=E($0,r1);if(!V1)continue;if(!C(V1))V1=Z(V1);if((u&V1._bitflags)!==u)continue;var j1=U(f,V1);if(j1===$1)continue;if(j1._score<k)continue;j1.obj=$0,G0(j1)}}else if(v?.keys){var A8=v.keys,w0=A8.length;Q:for(var K1=0;K1<J1;++K1){var $0=O[K1];{var a1=0;for(var X1=0;X1<w0;++X1){var r1=A8[X1],V1=E($0,r1);if(!V1){S[X1]=H0;continue}if(!C(V1))V1=Z(V1);S[X1]=V1,a1|=V1._bitflags}if((u&a1)!==u)continue}if(y)for(let A1=0;A1<f.spaceSearches.length;A1++)l[A1]=o;for(var X1=0;X1<w0;++X1){if(V1=S[X1],V1===H0){d[X1]=H0;continue}if(d[X1]=U(f,V1,!1,y),d[X1]===$1){d[X1]=H0;continue}if(y)for(let w1=0;w1<f.spaceSearches.length;w1++){if(M1[w1]>-1000){if(l[w1]>o){var o1=(l[w1]+M1[w1])/4;if(o1>l[w1])l[w1]=o1}}if(M1[w1]>l[w1])l[w1]=M1[w1]}}if(y){for(let A1=0;A1<f.spaceSearches.length;A1++)if(l[A1]===o)continue Q}else{var Y1=!1;for(let A1=0;A1<w0;A1++)if(d[A1]._score!==o){Y1=!0;break}if(!Y1)continue}var _0=new G(w0);for(let A1=0;A1<w0;A1++)_0[A1]=d[A1];if(y){var p1=0;for(let A1=0;A1<f.spaceSearches.length;A1++)p1+=l[A1]}else{var p1=o;for(let w1=0;w1<w0;w1++){var j1=_0[w1];if(j1._score>-1000){if(p1>o){var o1=(p1+j1._score)/4;if(o1>p1)p1=o1}}if(j1._score>p1)p1=j1._score}}if(_0.obj=$0,_0._score=p1,v?.scoreFn){if(p1=v.scoreFn(_0),!p1)continue;p1=z(p1),_0._score=p1}if(p1<k)continue;G0(_0)}}else for(var K1=0;K1<J1;++K1){var V1=O[K1];if(!V1)continue;if(!C(V1))V1=Z(V1);if((u&V1._bitflags)!==u)continue;var j1=U(f,V1);if(j1===$1)continue;if(j1._score<k)continue;G0(j1)}if(m===0)return D1;var L8=Array(m);for(var K1=m-1;K1>=0;--K1)L8[K1]=W9.poll();return L8.total=m+G1,L8},q=(T,O="<b>",v="</b>")=>{var f=typeof O==="function"?O:void 0,u=T.target,y=u.length,k=T.indexes,i="",m=0,G1=0,J1=!1,G0=[];for(var r1=0;r1<y;++r1){var K1=u[r1];if(k[G1]===r1){if(++G1,!J1)if(J1=!0,f)G0.push(i),i="";else i+=O;if(G1===k.length){if(f)i+=K1,G0.push(f(i,m++)),i="",G0.push(u.substr(r1+1));else i+=K1+v+u.substr(r1+1);break}}else if(J1)if(J1=!1,f)G0.push(f(i,m++)),i="";else i+=v;i+=K1}return f?G0:i},J=(T)=>{if(typeof T==="number")T=""+T;else if(typeof T!=="string")T="";var O=g(T);return K(T,{_targetLower:O._lower,_targetLowerCodes:O.lowerCodes,_bitflags:O.bitflags})},X=()=>{w.clear(),b.clear()};class H{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((T,O)=>T-O)}set["indexes"](T){return this._indexes=T}["highlight"](T,O){return q(this,T,O)}get["score"](){return W(this._score)}set["score"](T){this._score=z(T)}}class G extends Array{get["score"](){return W(this._score)}set["score"](T){this._score=z(T)}}var K=(T,O)=>{let v=new H;return v.target=T,v.obj=O.obj??$1,v._score=O._score??o,v._indexes=O._indexes??[],v._targetLower=O._targetLower??"",v._targetLowerCodes=O._targetLowerCodes??$1,v._nextBeginningIndexes=O._nextBeginningIndexes??$1,v._bitflags=O._bitflags??0,v},W=(T)=>{if(T===o)return 0;if(T>1)return T;return Math.E**(((-T+1)**0.04307-1)*-2)},z=(T)=>{if(T===0)return o;if(T>1)return T;return 1-Math.pow(Math.log(T)/-2+1,23.218017181332716)},B=(T)=>{if(typeof T==="number")T=""+T;else if(typeof T!=="string")T="";T=T.trim();var O=g(T),v=[];if(O.containsSpace){var f=T.split(/\s+/);f=[...new Set(f)];for(var u=0;u<f.length;u++){if(f[u]==="")continue;var y=g(f[u]);v.push({lowerCodes:y.lowerCodes,_lower:f[u].toLowerCase(),containsSpace:!1})}}return{lowerCodes:O.lowerCodes,_lower:O._lower,containsSpace:O.containsSpace,bitflags:O.bitflags,spaceSearches:v}},Z=(T)=>{if(T.length>999)return J(T);var O=w.get(T);if(O!==void 0)return O;return O=J(T),w.set(T,O),O},M=(T)=>{if(T.length>999)return B(T);var O=b.get(T);if(O!==void 0)return O;return O=B(T),b.set(T,O),O},V=(T,O)=>{var v=[];v.total=T.length;var f=O?.limit||e;if(O?.key)for(var u=0;u<T.length;u++){var y=T[u],k=E(y,O.key);if(k==$1)continue;if(!C(k))k=Z(k);var i=K(k.target,{_score:k._score,obj:y});if(v.push(i),v.length>=f)return v}else if(O?.keys)for(var u=0;u<T.length;u++){var y=T[u],m=new G(O.keys.length);for(var G1=O.keys.length-1;G1>=0;--G1){var k=E(y,O.keys[G1]);if(!k){m[G1]=H0;continue}if(!C(k))k=Z(k);k._score=o,k._indexes.len=0,m[G1]=k}if(m.obj=y,m._score=o,v.push(m),v.length>=f)return v}else for(var u=0;u<T.length;u++){var k=T[u];if(k==$1)continue;if(!C(k))k=Z(k);if(k._score=o,k._indexes.len=0,v.push(k),v.length>=f)return v}return v},U=(T,O,v=!1,f=!1)=>{if(v===!1&&T.containsSpace)return R(T,O,f);var{_lower:u,lowerCodes:y}=T,k=y[0],i=O._targetLowerCodes,m=y.length,G1=i.length,K1=0,J1=0,G0=0;for(;;){var r1=k===i[J1];if(r1){if(D[G0++]=J1,++K1,K1===m)break;k=y[K1]}if(++J1,J1>=G1)return $1}var K1=0,$0=!1,V1=0,j1=O._nextBeginningIndexes;if(j1===$1)j1=O._nextBeginningIndexes=x(O.target);J1=D[0]===0?0:j1[D[0]-1];var A8=0;if(J1!==G1)for(;;)if(J1>=G1){if(K1<=0)break;if(++A8,A8>200)break;--K1;var w0=r[--V1];J1=j1[w0]}else{var r1=y[K1]===i[J1];if(r1){if(r[V1++]=J1,++K1,K1===m){$0=!0;break}++J1}else J1=j1[J1]}var a1=m<=1?-1:O._targetLower.indexOf(u,D[0]),X1=!!~a1,o1=!X1?!1:a1===0||O._nextBeginningIndexes[a1-1]===a1;if(X1&&!o1)for(var Y1=0;Y1<j1.length;Y1=j1[Y1]){if(Y1<=a1)continue;for(var _0=0;_0<m;_0++)if(y[_0]!==O._targetLowerCodes[Y1+_0])break;if(_0===m){a1=Y1,o1=!0;break}}var p1=(A1)=>{var w1=0,W5=0;for(var $8=1;$8<m;++$8)if(A1[$8]-A1[$8-1]!==1)w1-=A1[$8],++W5;var XW=A1[m-1]-A1[0]-(m-1);if(w1-=(12+XW)*W5,A1[0]!==0)w1-=A1[0]*A1[0]*0.2;if(!$0)w1*=1000;else{var L7=1;for(var $8=j1[0];$8<G1;$8=j1[$8])++L7;if(L7>24)w1*=(L7-24)*10}if(w1-=(G1-m)/2,X1)w1/=1+m*m*1;if(o1)w1/=1+m*m*1;return w1-=(G1-m)/2,w1};if(!$0){if(X1)for(var Y1=0;Y1<m;++Y1)D[Y1]=a1+Y1;var L8=D,y8=p1(L8)}else if(o1){for(var Y1=0;Y1<m;++Y1)D[Y1]=a1+Y1;var L8=D,y8=p1(D)}else var L8=r,y8=p1(r);O._score=y8;for(var Y1=0;Y1<m;++Y1)O._indexes[Y1]=L8[Y1];O._indexes.len=m;let f2=new H;return f2.target=O.target,f2._score=O._score,f2._indexes=O._indexes,f2},R=(T,O,v)=>{var f=new Set,u=0,y=$1,k=0,i=T.spaceSearches,m=i.length,G1=0,J1=()=>{for(let o1=G1-1;o1>=0;o1--)O._nextBeginningIndexes[n[o1*2+0]]=n[o1*2+1]},G0=!1;for(var X1=0;X1<m;++X1){M1[X1]=o;var r1=i[X1];if(y=U(r1,O),v){if(y===$1)continue;G0=!0}else if(y===$1)return J1(),$1;var K1=X1===m-1;if(!K1){var $0=y._indexes,V1=!0;for(let Y1=0;Y1<$0.len-1;Y1++)if($0[Y1+1]-$0[Y1]!==1){V1=!1;break}if(V1){var j1=$0[$0.len-1]+1,A8=O._nextBeginningIndexes[j1-1];for(let Y1=j1-1;Y1>=0;Y1--){if(A8!==O._nextBeginningIndexes[Y1])break;O._nextBeginningIndexes[Y1]=j1,n[G1*2+0]=Y1,n[G1*2+1]=A8,G1++}}}if(u+=y._score/m,M1[X1]=y._score/m,y._indexes[0]<k)u-=(k-y._indexes[0])*2;k=y._indexes[0];for(var w0=0;w0<y._indexes.len;++w0)f.add(y._indexes[w0])}if(v&&!G0)return $1;J1();var a1=U(T,O,!0);if(a1!==$1&&a1._score>u){if(v)for(var X1=0;X1<m;++X1)M1[X1]=a1._score/m;return a1}if(v)y=O;y._score=u;var X1=0;for(let o1 of f)y._indexes[X1++]=o1;return y._indexes.len=X1,y},I=(T)=>T.replace(/\p{Script=Latin}+/gu,(O)=>O.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),g=(T)=>{T=I(T);var O=T.length,v=T.toLowerCase(),f=[],u=0,y=!1;for(var k=0;k<O;++k){var i=f[k]=v.charCodeAt(k);if(i===32){y=!0;continue}var m=i>=97&&i<=122?i-97:i>=48&&i<=57?26:i<=127?30:31;u|=1<<m}return{lowerCodes:f,bitflags:u,containsSpace:y,_lower:v}},N=(T)=>{var O=T.length,v=[],f=0,u=!1,y=!1;for(var k=0;k<O;++k){var i=T.charCodeAt(k),m=i>=65&&i<=90,G1=m||i>=97&&i<=122||i>=48&&i<=57,J1=m&&!u||!y||!G1;if(u=m,y=G1,J1)v[f++]=k}return v},x=(T)=>{T=I(T);var O=T.length,v=N(T),f=[],u=v[0],y=0;for(var k=0;k<O;++k)if(u>k)f[k]=u;else u=v[++y],f[k]=u===void 0?O:u;return f},w=new Map,b=new Map,D=[],r=[],n=[],l=[],M1=[],S=[],d=[],E=(T,O)=>{var v=T[O];if(v!==void 0)return v;if(typeof O==="function")return O(T);var f=O;if(!Array.isArray(O))f=O.split(".");var u=f.length,y=-1;while(T&&++y<u)T=T[f[y]];return T},C=(T)=>{return typeof T==="object"&&typeof T._bitflags==="number"},e=1/0,o=-e,D1=[];D1.total=0;var $1=null,H0=J(""),A7=(T)=>{var O=[],v=0,f={},u=(y)=>{for(var k=0,i=O[k],m=1;m<v;){var G1=m+1;k=m,G1<v&&O[G1]._score<O[m]._score&&(k=G1),O[k-1>>1]=O[k],m=1+(k<<1)}for(var J1=k-1>>1;k>0&&i._score<O[J1]._score;J1=(k=J1)-1>>1)O[k]=O[J1];O[k]=i};return f.add=(y)=>{var k=v;O[v++]=y;for(var i=k-1>>1;k>0&&y._score<O[i]._score;i=(k=i)-1>>1)O[k]=O[i];O[k]=y},f.poll=(y)=>{if(v!==0){var k=O[0];return O[0]=O[--v],u(),k}},f.peek=(y)=>{if(v!==0)return O[0]},f.replaceTop=(y)=>{O[0]=y,u()},f},W9=A7();return{single:$,go:Y,prepare:J,cleanup:X}})});var WK={};Y8(WK,{runSearchCore:()=>KK,runSearchCommandAction:()=>cA});async function cA(Q,$){if($.installed){let q=await A0($.cwd);if(!q||Object.keys(q.installed).length===0){if($.json)F1({success:!0,data:{components:[]}});else _.info("No components installed.");return}let J=Object.entries(q.installed).map(([X,H])=>({name:`${H.registryName}/${H.name}`,registry:H.registryUrl,version:H.revision,installedAt:void 0}));if($.json)F1({success:!0,data:{components:J}});else{_.info(`Installed components (${J.length}):`);for(let X of J)console.log(` ${P.cyan(X.name)} ${P.dim(`v${X.version}`)} from ${X.registry}`)}return}let Y;if($.profile){let q=await e0.create($.cwd,{profile:$.profile});Y={cwd:q.getCwd(),getRegistries:()=>q.getRegistries(),getComponentPath:()=>q.getComponentPath()}}else Y=await b0.requireInitialized($.cwd);await KK(Q,$,Y)}async function KK(Q,$,Y){let q=Y.getRegistries();if($.verbose)_.info(`Searching in ${Object.keys(q).length} registries...`);let J=[],X=Z1({text:"Searching registries...",quiet:$.quiet||$.verbose});if(!$.json&&!$.verbose)X.start();for(let[G,K]of Object.entries(q))try{if($.verbose)_.info(`Fetching index from ${G} (${K.url})...`);let W=await P8(K.url);if($.verbose)_.info(`Found ${W.components.length} components in ${G}`);for(let z of W.components)J.push({name:`${G}/${z.name}`,description:z.description,type:z.type,registry:G})}catch(W){if($.verbose)_.warn(`Failed to fetch registry ${G}: ${W instanceof Error?W.message:String(W)}`)}if(!$.json&&!$.verbose)X.stop();let H=J;if(Q)H=r6.default.go(Q,J,{keys:["name","description"],limit:$.limit}).map((K)=>K.obj);else H=H.slice(0,$.limit);if($.json){F1({success:!0,data:{components:H}});return}if(H.length===0){_.info("No components found.");return}_.info(`Found ${H.length} components:`);for(let G of H)console.log(` ${P.cyan(G.name)} ${P.dim(`(${G.type})`)} - ${G.description}`)}var r6;var zK=A(()=>{U8();E9();D2();a8();k4();c1();l0();r6=z5(GK(),1)});function dA(Q){let $=parseInt(Q,10);if(Number.isNaN($)||$<=0)throw new zJ("Must be a positive integer");return $}function BK(Q){let $=Q.command("search").alias("list").description("Search for components across registries or list installed").argument("[query]","Search query").option("--installed","List installed components only",!1).option("-p, --profile <name>","Use specific profile").addOption(new B8("--limit <n>","Limit results").default(20).argParser(dA));Q0($),E0($),$.action(async(Y,q)=>{try{let{runSearchCommandAction:J}=await Promise.resolve().then(() => (zK(),WK));await J(Y,q)}catch(J){s(J,{json:q.json})}})}var _K=A(()=>{L3();u1();d0()});function ZK(Q){let $=["curl","npm","yarn","pnpm","bun"],Y=$.find((q)=>q===Q);if(!Y)throw new x1(`Invalid install method: "${Q}"
253
+ Valid methods: ${$.join(", ")}`);return Y}function n9(){if(pA())return"curl";let Q=process.argv[1]??"";if(lA(Q))return"unknown";if(iA(Q))return"yarn";if(nA(Q))return"pnpm";if(oA(Q))return"bun";if(sA(Q))return"npm";let $=process.env.npm_config_user_agent??"";if($.includes("yarn"))return"yarn";if($.includes("pnpm"))return"pnpm";if($.includes("bun"))return"bun";if($.includes("npm"))return"npm";return"unknown"}function K7(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var pA=()=>Bun.main.startsWith("/$bunfs/"),lA=(Q)=>Q.includes("/_npx/")||Q.includes("/.cache/bunx/")||Q.includes("/.pnpm/_temp/"),iA=(Q)=>Q.includes("/.yarn/global")||Q.includes("/.config/yarn/global"),nA=(Q)=>Q.includes("/.pnpm/")||Q.includes("/pnpm/global"),oA=(Q)=>Q.includes("/.bun/bin")||Q.includes("/.bun/install/global"),sA=(Q)=>Q.includes("/.npm/")||Q.includes("/node_modules/");var W7=A(()=>{t()});import{existsSync as t6,lstatSync as VK,readdirSync as rA,realpathSync as MK,rmSync as aA,unlinkSync as AK}from"fs";import{homedir as LK}from"os";import i0 from"path";function a6(Q,$=0){F1({success:!0,data:Q}),process.exit($)}function X9(Q,$,Y,q){let J={success:!1,error:{code:Q,message:$,...q&&{details:q}},exitCode:Y,meta:{timestamp:new Date().toISOString()}};F1(J),process.exit(Y)}function e6(Q){return Q instanceof Error&&"code"in Q}function y2(Q){let $=LK();if(!$)return Q;if(Q===$)return"~";if(Q.startsWith($+i0.sep))return`~${Q.slice($.length)}`;return Q}function B7(Q,$){let Y=i0.normalize(Q),q=i0.normalize($),J=i0.relative(Y,q);if(J.startsWith("..")||i0.isAbsolute(J))return null;return J}function tA(Q,$){return B7(Q,$)!==null}function eA(Q,$){if(!t6($))return{contained:!0};try{let Y=MK(Q),q=MK($);return{contained:B7(Y,q)!==null}}catch(Y){if(e6(Y)&&(Y.code==="EACCES"||Y.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function FK(Q){try{let $=VK(Q);if($.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!$.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch($){if(e6($)){if($.code==="ENOENT")return{valid:!1,reason:"not-found"};if($.code==="EACCES"||$.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function h2(Q){if(!t6(Q))return"missing";try{let $=VK(Q);if($.isSymbolicLink())return"symlink";if($.isDirectory())return"directory";return"file"}catch{return"missing"}}function QL(Q){if(!t6(Q))return!0;try{return rA(Q).length===0}catch{return!1}}function UK(Q){if(Q.kind==="missing")return"safe";if(Q.kind==="symlink")return tA(Q.rootPath,Q.absolutePath)?"safe":"forbidden";let $=eA(Q.rootPath,Q.absolutePath);if($.error)return"error";return $.contained?"safe":"forbidden"}function H9(Q){return Q==="npm"||Q==="pnpm"||Q==="bun"||Q==="yarn"}function _7(Q){switch(Q){case"npm":return"npm uninstall -g ocx";case"pnpm":return"pnpm remove -g ocx";case"bun":return"bun remove -g ocx";case"yarn":return"yarn global remove ocx";default:return"npm uninstall -g ocx"}}function Q5(){let Q=process.env.XDG_CONFIG_HOME||i0.join(LK(),".config");return i0.join(Q,"opencode")}function jK(){let Q=Q5(),$=[],Y=_8(),q=B7(Q,Y);if(q){let G=h2(Y);$.push({rootPath:Q,relativePath:q,absolutePath:Y,displayPath:y2(Y),kind:G,deleteIfEmpty:!1,safetyStatus:UK({rootPath:Q,absolutePath:Y,kind:G})})}let J=v9(),X=B7(Q,J);if(X){let G=h2(J);$.push({rootPath:Q,relativePath:X,absolutePath:J,displayPath:y2(J),kind:G,deleteIfEmpty:!1,safetyStatus:UK({rootPath:Q,absolutePath:J,kind:G})})}let H=h2(Q);return $.push({rootPath:Q,relativePath:".",absolutePath:Q,displayPath:y2(Q),kind:H,deleteIfEmpty:!0,safetyStatus:H==="missing"?"safe":"safe"}),$}function wK(){let Q=n9();if(H9(Q))return null;if(Q==="curl"){let $=K7(),Y=h2($);return{rootPath:i0.dirname($),relativePath:i0.basename($),absolutePath:$,displayPath:y2($),kind:Y,deleteIfEmpty:!1,safetyStatus:Y==="missing"?"safe":"safe"}}return null}function $L(Q){if(Q.kind==="missing")return{target:Q,success:!0,skipped:!0,reason:"not found"};if(Q.safetyStatus==="forbidden")return{target:Q,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if(Q.deleteIfEmpty&&Q.kind==="directory"){if(!QL(Q.absolutePath))return{target:Q,success:!0,skipped:!0,reason:"not empty"}}try{if(Q.kind==="directory")aA(Q.absolutePath,{recursive:!0,force:!0});else AK(Q.absolutePath);return{target:Q,success:!0,skipped:!1}}catch($){let Y=$ instanceof Error?$:Error(String($)),q=e6($)&&($.code==="EACCES"||$.code==="EPERM")?"permission denied":void 0;return{target:Q,success:!1,skipped:!1,reason:q,error:Y}}}function DK(Q){return Q.map($L)}function OK(Q,$={}){let Y={rootPath:i0.dirname(Q),relativePath:i0.basename(Q),absolutePath:Q,displayPath:y2(Q),kind:h2(Q),deleteIfEmpty:!1,safetyStatus:"safe"};if(Y.kind==="missing")return{target:Y,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!$.suppressOutput)_.info(`To complete uninstall, manually delete: ${Y.displayPath}`);return{target:Y,success:!0,skipped:!0}}try{return AK(Q),{target:Y,success:!0,skipped:!1}}catch(q){let J=q instanceof Error?q:Error(String(q));return{target:Y,success:!1,skipped:!1,reason:"permission denied",error:J}}}function YL(Q,$,Y){let{dryRunResult:q,hints:J}=IK(Q,$,Y);j0(q,{hints:J})}function IK(Q,$,Y){let q=Q.filter((G)=>G.kind!=="missing"),J=[];for(let G of q)J.push({action:"delete",target:G.displayPath,details:{kind:G.kind,...G.deleteIfEmpty&&{deleteIfEmpty:!0}}});if($&&$.kind!=="missing")J.push({action:"delete",target:$.displayPath,details:{kind:"binary"}});let X=[];if(H9(Y))X.push(`Binary is managed by ${Y}. Run: ${_7(Y)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:J,validation:{passed:!0},summary:J.length>0?`Would remove ${J.length} item(s)`:"Nothing to remove"},hints:X}}function qL(Q,$){if(Q.filter((q)=>q.kind!=="missing").length>0||$&&$.kind!=="missing")_.info("Removing OCX files...")}function JL(Q,$,Y){_.break();for(let q of Q){if(q.skipped){if(q.reason==="not found")continue;if(q.reason==="not empty"){_.info(`Kept ${F0.path(q.target.displayPath)} (not empty)`);continue}if(q.reason==="permission denied"){_.warn(`Skipped ${F0.path(q.target.displayPath)} (permission denied)`);continue}if(q.reason==="containment violation"){_.warn(`Skipped ${F0.path(q.target.displayPath)} (containment violation)`);continue}}if(q.success)_.success(`Removed ${F0.path(q.target.displayPath)}`);else _.error(`Failed to remove ${q.target.displayPath}: ${q.error?.message}`)}if($){if($.skipped&&$.reason==="not found");else if($.success&&!$.skipped)_.success(`Removed binary ${F0.path($.target.displayPath)}`);else if(!$.success)_.error(`Failed to remove binary ${$.target.displayPath}: ${$.error?.message}`)}if(H9(Y))_.break(),_.info(`Binary is managed by ${Y}. To complete uninstall, run:`),_.log(` ${F0.command(_7(Y))}`)}function XL(){_.info("Nothing to remove. OCX is not installed globally.")}function z7(Q){return{path:Q.target.displayPath,kind:Q.target.kind,success:Q.success,skipped:Q.skipped,...Q.reason&&{reason:Q.reason},...Q.error&&{error:Q.error.message}}}async function HL(Q){let $=Q5(),Y=FK($);if(!Y.valid)switch(Y.reason){case"not-found":break;case"symlink":return X9("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",d1.SAFETY_ERROR);case"not-directory":return X9("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",d1.SAFETY_ERROR);case"permission":return X9("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",d1.ERROR)}let q=jK(),J=q.filter((I)=>I.safetyStatus==="forbidden");if(J.length>0)return X9("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",d1.SAFETY_ERROR,{targets:J.map((I)=>I.displayPath)});let X=q.filter((I)=>I.safetyStatus==="error");if(X.length>0)return X9("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",d1.ERROR,{targets:X.map((I)=>I.displayPath)});let H=n9(),G=wK(),K=q.filter((I)=>I.kind!=="missing"),W=Boolean(G&&G.kind!=="missing"),z=H9(H);if(K.length===0&&!W&&!z)return a6({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},d1.SUCCESS);if(Q.dryRun){let{dryRunResult:I,hints:g}=IK(q,G,H);return a6({...I,...g.length>0&&{hints:g}},d1.SUCCESS)}let B=DK(q),Z=null;if(G)Z=OK(G.absolutePath,{suppressOutput:!0});let M=B.some((I)=>!I.success&&!I.skipped),V=Boolean(Z&&!Z.success&&!Z.skipped);if(M||V)return X9("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",d1.ERROR,{configResults:B.map(z7),...Z&&{binaryResult:z7(Z)}});if(H9(H))return X9("UPDATE_ERROR",`Binary is managed by ${H}. Run: ${_7(H)}`,d1.ERROR,{installMethod:H,command:_7(H),configResults:B.map(z7),...Z&&{binaryResult:z7(Z)}});let U=B.filter((I)=>I.success&&!I.skipped).map((I)=>I.target.displayPath),R=B.filter((I)=>I.skipped).map((I)=>({path:I.target.displayPath,reason:I.reason??"skipped"}));if(Z){if(Z.success&&!Z.skipped)U.push(Z.target.displayPath);else if(Z.skipped)R.push({path:Z.target.displayPath,reason:Z.reason??"skipped"})}return a6({removed:U,skipped:R,installMethod:H},d1.SUCCESS)}async function GL(Q){if(Q.json){await HL(Q);return}let $=Q5(),Y=FK($);if(!Y.valid)switch(Y.reason){case"not-found":break;case"symlink":_.error("Safety error: Global config root is a symlink. Aborting."),process.exit(d1.SAFETY_ERROR);break;case"not-directory":_.error("Safety error: Global config root is not a directory. Aborting."),process.exit(d1.SAFETY_ERROR);break;case"permission":_.error("Error: Cannot access global config root (permission denied)."),process.exit(d1.ERROR);break}let q=jK(),J=q.filter((U)=>U.safetyStatus==="forbidden");if(J.length>0){_.error("Safety error: Target escapes containment boundary:");for(let U of J)_.error(` ${U.displayPath}`);process.exit(d1.SAFETY_ERROR)}let X=q.filter((U)=>U.safetyStatus==="error");if(X.length>0){_.error("Error: Cannot verify containment for targets (permission/IO error):");for(let U of X)_.error(` ${U.displayPath}`);process.exit(d1.ERROR)}let H=n9(),G=wK(),K=q.filter((U)=>U.kind!=="missing"),W=G&&G.kind!=="missing",z=H9(H);if(K.length===0&&!W&&!z)XL(),process.exit(d1.SUCCESS);if(Q.dryRun)YL(q,G,H),process.exit(d1.SUCCESS);qL(q,G);let B=DK(q),Z=null;if(G)Z=OK(G.absolutePath);JL(B,Z,H);let M=B.some((U)=>!U.success&&!U.skipped),V=Z&&!Z.success&&!Z.skipped;if(M||V)process.exit(d1.ERROR);if(H9(H))process.exit(d1.ERROR);process.exit(d1.SUCCESS)}function NK(Q){Q.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async($)=>{try{await GL($)}catch(Y){s(Y,{json:$.json})}})}var d1;var TK=A(()=>{W0();W7();e8();u1();c1();d1={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class bK{version="2.0.7"}var RK;var SK=A(()=>{RK=new bK});var kK={};Y8(kK,{checkForUpdate:()=>Y5,EXPLICIT_UPDATE_TIMEOUT_MS:()=>$5});function EK(Q){let[$=""]=Q.split("-"),Y=$.split("."),q=parseInt(Y[0]??"",10),J=parseInt(Y[1]??"",10),X=parseInt(Y[2]??"",10);if(Number.isNaN(q)||Number.isNaN(J)||Number.isNaN(X))return null;return{major:q,minor:J,patch:X}}function zL(Q,$){let Y=EK(Q),q=EK($);if(!Y||!q)return null;if(Y.major!==q.major)return Y.major-q.major;if(Y.minor!==q.minor)return Y.minor-q.minor;return Y.patch-q.patch}async function Y5(Q,$=KL){let q=(Q??RK).version||"0.0.0-dev";if(q==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let X=(await v3(WL,void 0,AbortSignal.timeout($))).version,H=zL(X,q);if(H===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:q,latest:X,updateAvailable:H>0}}catch(J){if(J instanceof Error){if(J.name==="AbortError"||J.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(J instanceof I1||J.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var KL=200,$5=1e4,WL="ocx";var q5=A(()=>{t();X6();SK()});import{chmodSync as BL,existsSync as G9,renameSync as J5,unlinkSync as Z7}from"fs";function ML(){let Q=process.env.OCX_DOWNLOAD_URL;if(Q)return Q.replace(/\/+$/,"");return ZL}function X5(Q){let $=`${process.arch}-${process.platform}`,Y=vK[$];if(!Y){let J=Object.keys(vK).join(", ");throw new x1(`Unsupported platform: ${$}
254
+ Supported platforms: ${J}`)}return`${ML()}/v${Q}/${Y}`}async function UL(Q,$,Y={}){let q=Y.quiet?null:Z1({text:"Downloading update..."});q?.start();let J;try{J=await fetch(Q,{redirect:"follow"})}catch(W){throw q?.fail("Download failed"),new x1(`Network error: ${W instanceof Error?W.message:String(W)}`)}if(!J.ok)throw q?.fail("Download failed"),new x1(`Failed to download: HTTP ${J.status} ${J.statusText}`);if(!J.body)throw q?.fail("Download failed"),new x1("Download failed: Empty response body");let X=J.body.getReader(),H=Bun.file($).writer(),G=Number(J.headers.get("content-length")||0),K=0;try{while(!0){let{done:W,value:z}=await X.read();if(W)break;if(await H.write(z),K+=z.length,G>0&&q){let B=Math.round(K/G*100);q.text=`Downloading... ${B}%`}}await H.end(),q?.succeed("Download complete")}catch(W){throw q?.fail("Download failed"),await H.end(),new x1(`Download interrupted: ${W instanceof Error?W.message:String(W)}`)}}async function PK(Q,$={}){let Y=K7(),q=`${Y}.new.${Date.now()}`,J=X5(Q);await UL(J,q,$);try{BL(q,493)}catch(X){if(G9(q))Z7(q);throw new x1(`Failed to set permissions: ${X instanceof Error?X.message:String(X)}`)}return{tempPath:q,execPath:Y}}function xK(Q,$){let Y=`${$}.backup`;try{if(G9($))J5($,Y);if(J5(Q,$),G9(Y))Z7(Y)}catch(q){if(G9(Y)&&!G9($))try{J5(Y,$)}catch{}if(G9(Q))try{Z7(Q)}catch{}throw new x1(`Update failed: ${q instanceof Error?q.message:String(q)}`)}}function CK(Q){if(G9(Q))try{Z7(Q)}catch{}}var _L="kdcokenny/ocx",ZL,vK;var yK=A(()=>{t();l0();W7();ZL=`https://github.com/${_L}/releases/download`,vK={"arm64-darwin":"ocx-darwin-arm64","x64-darwin":"ocx-darwin-x64","arm64-linux":"ocx-linux-arm64","x64-linux":"ocx-linux-x64","x64-win32":"ocx-windows-x64.exe"}});var hK={};Y8(hK,{notifyUpdated:()=>M7,notifyUpdate:()=>VL,notifyUpToDate:()=>H5});function VL(Q,$){if(!process.stdout.isTTY)return;console.error(`${P.cyan("info")}: update available - ${P.green($)} (current: ${P.dim(Q)})`),console.error(` run ${P.cyan("`ocx self update`")} to upgrade`)}function H5(Q){console.error(`${P.cyan("info")}: ocx unchanged - ${P.dim(Q)}`)}function M7(Q,$){console.error(` ${P.green("ocx updated")} - ${$} (from ${Q})`)}var G5=A(()=>{U8()});import{createHash as AL}from"crypto";function FL(Q){let $=new Map;for(let Y of Q.split(`
255
+ `)){let q=Y.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if(q?.[1]&&q[2])$.set(q[2].trim(),q[1].toLowerCase())}return $}function jL(Q){return AL("sha256").update(Q).digest("hex")}async function fK(Q){let $=`https://github.com/${LL}/releases/download/v${Q}/SHA256SUMS.txt`,Y=await fetch($);if(!Y.ok)throw new x1(`Failed to fetch checksums: ${Y.status}`);let q=await Y.text();return FL(q)}async function uK(Q,$,Y){let J=await Bun.file(Q).arrayBuffer(),X=jL(Buffer.from(J));if(X!==$)throw new m8(Y,$,X)}var LL="kdcokenny/ocx";var mK=A(()=>{t()});var gK={};Y8(gK,{runSelfUpdateCommand:()=>OL});async function OL(Q){let $=Q.method?ZK(Q.method):n9(),Y=Q.json===!0,q=await Y5(void 0,$5);if(!q.ok)throw new x1(DL[q.reason]);let{current:J,latest:X,updateAvailable:H}=q;if(!H&&!Q.force){if(Y)F1({success:!0,data:{current:J,latest:X,method:$,updated:!1}});else H5(J);return}let G=X;switch($){case"curl":{await IL(J,G,Y);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await NL($,J,G,Y);break}}if(Y)F1({success:!0,data:{current:J,latest:G,method:$,updated:!0}})}async function IL(Q,$,Y){let J=X5($).split("/").pop();if(!J)throw new x1("Failed to determine binary filename from download URL");let H=(await fK($)).get(J);if(!H)throw new x1(`Security error: No checksum found for ${J}. Update aborted.`);let{tempPath:G,execPath:K}=await PK($,{quiet:Y});try{await uK(G,H,J)}catch(W){throw CK(G),W}if(xK(G,K),!Y)M7(Q,$)}async function U7(Q){let $=Bun.spawn(Q,{stdout:"pipe",stderr:"pipe"});if(await $.exited!==0){let q=await new Response($.stderr).text();throw new x1(`Package manager command failed: ${q.trim()}`)}}async function NL(Q,$,Y,q){if(!wL.test(Y))throw new x1(`Invalid version format: ${Y}`);let J=q?null:Z1({text:`Updating via ${Q}...`});J?.start();try{switch(Q){case"npm":{await U7(["npm","install","-g",`ocx@${Y}`]);break}case"yarn":{await U7(["yarn","global","add",`ocx@${Y}`]);break}case"pnpm":{await U7(["pnpm","install","-g",`ocx@${Y}`]);break}case"bun":{await U7(["bun","install","-g",`ocx@${Y}`]);break}case"unknown":throw new x1(`Could not detect install method. Update manually with one of:
257
256
  npm install -g ocx@latest
258
257
  pnpm install -g ocx@latest
259
- bun install -g ocx@latest`)}if(v?.succeed(`Updated via ${$}`),!Q)d8(_,U)}catch(J){if(J instanceof f$)throw v?.fail("Update failed"),J;throw v?.fail("Update failed"),new f$(`Failed to run ${$}: ${J instanceof Error?J.message:String(J)}`)}}var dA,pA;var LW=b(()=>{lY();m8();BW();nY();MW();z$();e4();dA=/^\d+\.\d+\.\d+(-[\w.]+)?$/,pA={"dev-version":"Cannot check for updates in development mode. Install via npm for update support.",timeout:"Update check timed out after 10s. Try again or check your network.","network-error":"Cannot reach npm registry. Verify your internet connection.","invalid-response":"Received invalid response from npm registry. Try again later."}});function kW($){$.command("update").description("Update OCX to the latest version").option("-f, --force","Reinstall even if already up to date").option("--method <method>","Override install method detection (curl|npm|pnpm|bun)").option("--json","Output as JSON").action(async(_)=>{try{let{runSelfUpdateCommand:U}=await Promise.resolve().then(() => (LW(),wW));await U(_)}catch(U){_$(U,{json:_.json})}})}var AW=b(()=>{c$()});function FW($){let _=$.command("self").description("Manage the OCX CLI");YW(_),kW(_)}var OW=b(()=>{zW();AW()});import{randomUUID as NW}from"crypto";import{existsSync as R1}from"fs";import{mkdir as oA,rename as tA,rm as i8,stat as aA,writeFile as sA}from"fs/promises";import{dirname as eA,join as $F}from"path";function rY($,_){return`ocx add${_.global?" --global":""} ${$}`}function SW($){return $==="apply"?"Failed to update components":"Failed to check for updates"}function TW($){let _=$.command("update [components...]").description("Update installed components");Q4(_),m4(_),G6(_),_.option("--all","Update all installed components").option("--registry <name>","Update all components from a specific registry").option("--dry-run","Preview changes without applying").action(async(U,Q)=>{try{await _F(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function _F($,_){let U=_.cwd??process.cwd(),Q=_.global?await L0.requireInitialized():await y4.requireInitialized(U);await vF($,_,Q)}async function vF($,_,U,Q){let v=U.getRegistries(),J=U.getComponentPath(),Y=J===""||J===".",z=$.map(QF),I=await F4(U.cwd);if(!I||Object.keys(I.installed).length===0){if($.length>0){let A=$[0];if(!A)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new B$(`Component '${A}' is not installed. Run '${rY(A,_)}' first.`)}throw new B$(`No components installed. Run '${rY("<component>",_)}' first.`)}let X=$.length>0,q=_.all===!0,G=_.registry!==void 0;if(!X&&!q&&!G)throw new M(`Specify components, use --all, or use --registry <name>.
258
+ bun install -g ocx@latest`)}if(J?.succeed(`Updated via ${Q}`),!q)M7($,Y)}catch(X){if(X instanceof x1)throw J?.fail("Update failed"),X;throw J?.fail("Update failed"),new x1(`Failed to run ${Q}: ${X instanceof Error?X.message:String(X)}`)}}var wL,DL;var cK=A(()=>{q5();W7();yK();G5();mK();t();l0();wL=/^\d+\.\d+\.\d+(-[\w.]+)?$/,DL={"dev-version":"Cannot check for updates in development mode. Install via npm for update support.",timeout:"Update check timed out after 10s. Try again or check your network.","network-error":"Cannot reach npm registry. Verify your internet connection.","invalid-response":"Received invalid response from npm registry. Try again later."}});function dK(Q){Q.command("update").description("Update OCX to the latest version").option("-f, --force","Reinstall even if already up to date").option("--method <method>","Override install method detection (curl|npm|pnpm|bun)").option("--json","Output as JSON").action(async($)=>{try{let{runSelfUpdateCommand:Y}=await Promise.resolve().then(() => (cK(),gK));await Y($)}catch(Y){s(Y,{json:$.json})}})}var pK=A(()=>{u1()});function lK(Q){let $=Q.command("self").description("Manage the OCX CLI");NK($),dK($)}var iK=A(()=>{TK();pK()});import{randomUUID as nK}from"crypto";import{existsSync as K9}from"fs";import{mkdir as TL,rename as bL,rm as V7,stat as RL,writeFile as SL}from"fs/promises";import{dirname as EL,join as kL}from"path";function K5(Q,$){return`ocx add${$.global?" --global":""} ${Q}`}function oK(Q){return Q==="apply"?"Failed to update components":"Failed to check for updates"}function sK(Q){let $=Q.command("update [components...]").description("Update installed components");Q0($),E0($),Q8($),$.option("--all","Update all installed components").option("--registry <name>","Update all components from a specific registry").option("--dry-run","Preview changes without applying").action(async(Y,q)=>{try{await vL(Y,q)}catch(J){s(J,{json:q.json})}})}async function vL(Q,$){let Y=$.cwd??process.cwd(),q=$.global?await S9.requireInitialized():await b0.requireInitialized(Y);await PL(Q,$,q)}async function PL(Q,$,Y,q){let J=Y.getRegistries(),X=Y.getComponentPath(),H=X===""||X===".",G=Q.map(CL),K=await A0(Y.cwd);if(!K||Object.keys(K.installed).length===0){if(Q.length>0){let N=Q[0];if(!N)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new B1(`Component '${N}' is not installed. Run '${K5(N,$)}' first.`)}throw new B1(`No components installed. Run '${K5("<component>",$)}' first.`)}let W=Q.length>0,z=$.all===!0,B=$.registry!==void 0;if(!W&&!z&&!B)throw new L(`Specify components, use --all, or use --registry <name>.
260
259
 
261
260
  Examples:
262
261
  ocx update alias/component # Update specific component
263
262
  ocx update --all # Update all installed components
264
- ocx update --registry my-alias # Update all from a registry`);if(q&&X)throw new M(`Cannot specify components with --all.
265
- Use either 'ocx update --all' or 'ocx update <components>'.`);if(G&&X)throw new M(`Cannot specify components with --registry.
266
- Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(q&&G)throw new M(`Cannot use --all with --registry.
267
- Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let j=JF(I,z,_);if(j.length===0){if(G)throw new B$(`No installed components from registry '${_.registry}'.`);throw new B$("No matching components found to update.")}let H=_.quiet?null:V$({text:"Checking for updates..."});H?.start();let Z=null,V="check",S=null,T=[],r=[];try{for(let k of j){let O=k.component,w=I.installed[O];if(!w)throw new B$(`Component '${O}' not found in receipt.`);let{registryName:v$,name:o}=w,Q$=v[v$];if(!Q$)throw new n(`Registry alias '${v$}' not configured. Component '${O}' cannot be updated.`);let x=(await I8(Q$.url,o,void 0)).manifest,t=G1(x),C=[];for(let $$ of t.files){let R$=await V1(Q$.url,o,$$.path);C.push({path:$$.path,content:Buffer.from(R$)})}let h=await j8(C),I$=`sha256:${h}`;if(h===w.hash)T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"up-to-date"});else if(_.dryRun)T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"would-update"});else T.push({qualifiedName:O,oldVersion:w.revision,newVersion:I$,status:"updated"}),r.push({canonicalId:O,component:t,files:C,newHash:h,newVersion:I$,baseUrl:Q$.url,registryName:v$,name:o})}if(H?.succeed(`Checked ${j.length} component(s)`),_.dryRun){YF(T,_);return}if(r.length===0){if(!_.quiet&&!_.json)W.info(""),W.success("All components are up to date.");if(_.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:T},null,2));return}V="apply",Z=_.quiet?null:V$({text:"Updating components..."}),Z?.start();let A=new Map,u=[];for(let k of r){let O=[];for(let w of k.files){let v$=k.component.files.find((D$)=>D$.path===w.path);if(!v$)throw new M(`File "${w.path}" not found in component manifest for "${k.registryName}/${k.name}".`);let o=K1(v$.target,Y,U.cwd),Q$=$F(U.cwd,o);L1(A,{absolutePath:Q$,relativePath:o,content:w.content,source:`${k.registryName}/${k.name}:${v$.path}`}),O.push({resolvedTarget:o,targetPath:Q$,content:w.content})}u.push({update:k,preparedFiles:O})}S=await UF(u,{verbose:_.verbose,quiet:_.quiet,fileOps:Q});for(let k of u){let{update:O,preparedFiles:w}=k,v$=I.installed[O.canonicalId];if(!v$)throw new B$(`Component '${O.canonicalId}' not found in receipt.`);let o=[];for(let Q$ of w)o.push({path:Q$.resolvedTarget,hash:k1(Q$.content)});I.installed[O.canonicalId]={registryUrl:v$.registryUrl,registryName:v$.registryName,name:v$.name,revision:O.newVersion,hash:O.newHash,files:o,installedAt:v$.installedAt,updatedAt:new Date().toISOString(),...O.component.opencode&&{opencode:O.component.opencode}}}if(await x4(U.cwd,I),!S)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await S.commit(),S=null,Z?.succeed(`Updated ${r.length} component(s)`),_.json)console.log(JSON.stringify({success:!0,updated:T.filter((k)=>k.status==="updated"),upToDate:T.filter((k)=>k.status==="up-to-date")},null,2));else if(!_.quiet){W.info("");for(let k of T)if(k.status==="updated")W.info(` \u2713 ${k.qualifiedName} (${k.oldVersion} \u2192 ${k.newVersion})`);else if(k.status==="up-to-date"&&_.verbose)W.info(` \u25CB ${k.qualifiedName} (already up to date)`);W.info(""),W.success(`Done! Updated ${r.length} component(s).`)}}catch(A){if(V==="apply"){if(S)await S.rollback(),S=null;Z?.fail(SW("apply"))}else H?.fail(SW("check"));throw A}}async function UF($,_){let U=[],Q=new Set,v=!1,J=_.fileOps?.rename??tA,Y=async()=>{if(v)return;v=!0;for(let I of Q)try{await i8(I,{force:!0})}catch{}for(let I of[...U].reverse())try{if(I.backupPath){if(R1(I.targetPath))await i8(I.targetPath,{force:!0,recursive:!0});if(R1(I.backupPath))await J(I.backupPath,I.targetPath)}else if(R1(I.targetPath))await i8(I.targetPath,{force:!0,recursive:!0})}catch{}},z=async()=>{if(v)return;v=!0;for(let I of U){if(!I.backupPath)continue;if(R1(I.backupPath))try{await i8(I.backupPath,{force:!0})}catch(X){if(!_.quiet){let q=X instanceof Error?X.message:String(X);W.warn(`Post-update cleanup warning: failed to remove backup "${I.backupPath}" (${q})`)}}}};try{for(let I of $)for(let X of I.preparedFiles){let q=eA(X.targetPath);if(!R1(q))await oA(q,{recursive:!0});if(R1(X.targetPath)){if((await aA(X.targetPath)).isDirectory())throw new M(`Cannot update "${X.resolvedTarget}": target path is a directory.`)}let G=`${X.targetPath}.ocx-update-tmp-${NW()}`;await sA(G,X.content),Q.add(G);let j=null;if(R1(X.targetPath))j=`${X.targetPath}.ocx-update-backup-${NW()}`,await J(X.targetPath,j),U.push({targetPath:X.targetPath,backupPath:j});if(await J(G,X.targetPath),Q.delete(G),!j)U.push({targetPath:X.targetPath,backupPath:null});if(_.verbose)W.info(` \u2713 Updated ${X.resolvedTarget}`)}return{commit:z,rollback:Y}}catch(I){throw await Y(),I}}function QF($){if($.endsWith("@"))throw new n(`Invalid version specifier '${$}'. The trailing '@' has no version.
268
- Use '${$.slice(0,-1)}' to update to the latest version.`);return{component:$}}function JF($,_,U){let Q=Object.keys($.installed);if(U.all)return Q.map((J)=>({component:J}));if(U.registry)return Q.filter((J)=>{return $.installed[J]?.registryName===U.registry}).map((J)=>({component:J}));let v=[];for(let J of _){let Y=J.component;if(!Y.includes("/")){let G=Q.map((j)=>{let H=c6(j);return`${H.registryName}/${H.name}`}).filter((j)=>j.endsWith(`/${Y}`));if(G.length===1)throw new M(`Ambiguous component '${Y}'. Did you mean '${G[0]}'?`);if(G.length>1)throw new M(`Ambiguous component '${Y}'. Found in multiple registries:
269
- `+G.map((j)=>` - ${j}`).join(`
263
+ ocx update --registry my-alias # Update all from a registry`);if(z&&W)throw new L(`Cannot specify components with --all.
264
+ Use either 'ocx update --all' or 'ocx update <components>'.`);if(B&&W)throw new L(`Cannot specify components with --registry.
265
+ Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(z&&B)throw new L(`Cannot use --all with --registry.
266
+ Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let Z=yL(K,G,$);if(Z.length===0){if(B)throw new B1(`No installed components from registry '${$.registry}'.`);throw new B1("No matching components found to update.")}let M=$.quiet?null:Z1({text:"Checking for updates..."});M?.start();let V=null,U="check",R=null,I=[],g=[];try{for(let w of Z){let b=w.component,D=K.installed[b];if(!D)throw new B1(`Component '${b}' not found in receipt.`);let{registryName:r,name:n}=D,l=J[r];if(!l)throw new h(`Registry alias '${r}' not configured. Component '${b}' cannot be updated.`);let S=(await E3(l.url,n,void 0)).manifest,d=d8(S),E=[];for(let o of d.files){let D1=await r8(l.url,n,o.path);E.push({path:o.path,content:Buffer.from(D1)})}let C=await x3(E),e=`sha256:${C}`;if(C===D.hash)I.push({qualifiedName:b,oldVersion:D.revision,newVersion:e,status:"up-to-date"});else if($.dryRun)I.push({qualifiedName:b,oldVersion:D.revision,newVersion:e,status:"would-update"});else I.push({qualifiedName:b,oldVersion:D.revision,newVersion:e,status:"updated"}),g.push({canonicalId:b,component:d,files:E,newHash:C,newVersion:e,baseUrl:l.url,registryName:r,name:n})}if(M?.succeed(`Checked ${Z.length} component(s)`),$.dryRun){hL(I,$);return}if(g.length===0){if(!$.quiet&&!$.json)_.info(""),_.success("All components are up to date.");if($.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:I},null,2));return}U="apply",V=$.quiet?null:Z1({text:"Updating components..."}),V?.start();let N=new Map,x=[];for(let w of g){let b=[];for(let D of w.files){let r=w.component.files.find((M1)=>M1.path===D.path);if(!r)throw new L(`File "${D.path}" not found in component manifest for "${w.registryName}/${w.name}".`);let n=l8(r.target,H,Y.cwd),l=kL(Y.cwd,n);Q9(N,{absolutePath:l,relativePath:n,content:D.content,source:`${w.registryName}/${w.name}:${r.path}`}),b.push({resolvedTarget:n,targetPath:l,content:D.content})}x.push({update:w,preparedFiles:b})}R=await xL(x,{verbose:$.verbose,quiet:$.quiet,fileOps:q});for(let w of x){let{update:b,preparedFiles:D}=w,r=K.installed[b.canonicalId];if(!r)throw new B1(`Component '${b.canonicalId}' not found in receipt.`);let n=[];for(let l of D)n.push({path:l.resolvedTarget,hash:$9(l.content)});K.installed[b.canonicalId]={registryUrl:r.registryUrl,registryName:r.registryName,name:r.name,revision:b.newVersion,hash:b.newHash,files:n,installedAt:r.installedAt,updatedAt:new Date().toISOString(),...b.component.opencode&&{opencode:b.component.opencode}}}if(await N0(Y.cwd,K),!R)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await R.commit(),R=null,V?.succeed(`Updated ${g.length} component(s)`),$.json)console.log(JSON.stringify({success:!0,updated:I.filter((w)=>w.status==="updated"),upToDate:I.filter((w)=>w.status==="up-to-date")},null,2));else if(!$.quiet){_.info("");for(let w of I)if(w.status==="updated")_.info(` \u2713 ${w.qualifiedName} (${w.oldVersion} \u2192 ${w.newVersion})`);else if(w.status==="up-to-date"&&$.verbose)_.info(` \u25CB ${w.qualifiedName} (already up to date)`);_.info(""),_.success(`Done! Updated ${g.length} component(s).`)}}catch(N){if(U==="apply"){if(R)await R.rollback(),R=null;V?.fail(oK("apply"))}else M?.fail(oK("check"));throw N}}async function xL(Q,$){let Y=[],q=new Set,J=!1,X=$.fileOps?.rename??bL,H=async()=>{if(J)return;J=!0;for(let K of q)try{await V7(K,{force:!0})}catch{}for(let K of[...Y].reverse())try{if(K.backupPath){if(K9(K.targetPath))await V7(K.targetPath,{force:!0,recursive:!0});if(K9(K.backupPath))await X(K.backupPath,K.targetPath)}else if(K9(K.targetPath))await V7(K.targetPath,{force:!0,recursive:!0})}catch{}},G=async()=>{if(J)return;J=!0;for(let K of Y){if(!K.backupPath)continue;if(K9(K.backupPath))try{await V7(K.backupPath,{force:!0})}catch(W){if(!$.quiet){let z=W instanceof Error?W.message:String(W);_.warn(`Post-update cleanup warning: failed to remove backup "${K.backupPath}" (${z})`)}}}};try{for(let K of Q)for(let W of K.preparedFiles){let z=EL(W.targetPath);if(!K9(z))await TL(z,{recursive:!0});if(K9(W.targetPath)){if((await RL(W.targetPath)).isDirectory())throw new L(`Cannot update "${W.resolvedTarget}": target path is a directory.`)}let B=`${W.targetPath}.ocx-update-tmp-${nK()}`;await SL(B,W.content),q.add(B);let Z=null;if(K9(W.targetPath))Z=`${W.targetPath}.ocx-update-backup-${nK()}`,await X(W.targetPath,Z),Y.push({targetPath:W.targetPath,backupPath:Z});if(await X(B,W.targetPath),q.delete(B),!Z)Y.push({targetPath:W.targetPath,backupPath:null});if($.verbose)_.info(` \u2713 Updated ${W.resolvedTarget}`)}return{commit:G,rollback:H}}catch(K){throw await H(),K}}function CL(Q){if(Q.endsWith("@"))throw new h(`Invalid version specifier '${Q}'. The trailing '@' has no version.
267
+ Use '${Q.slice(0,-1)}' to update to the latest version.`);return{component:Q}}function yL(Q,$,Y){let q=Object.keys(Q.installed);if(Y.all)return q.map((X)=>({component:X}));if(Y.registry)return q.filter((X)=>{return Q.installed[X]?.registryName===Y.registry}).map((X)=>({component:X}));let J=[];for(let X of $){let H=X.component;if(!H.includes("/")){let B=q.map((Z)=>{let M=R8(Z);return`${M.registryName}/${M.name}`}).filter((Z)=>Z.endsWith(`/${H}`));if(B.length===1)throw new L(`Ambiguous component '${H}'. Did you mean '${B[0]}'?`);if(B.length>1)throw new L(`Ambiguous component '${H}'. Found in multiple registries:
268
+ `+B.map((Z)=>` - ${Z}`).join(`
270
269
  `)+`
271
270
 
272
- Please use a fully qualified name (alias/component).`);throw new M(`Component '${Y}' must include a registry alias (e.g., 'kdco/${Y}').`)}let{namespace:z,component:I}=r4(Y),X=Q.filter((G)=>{let j=c6(G);return j.registryName===z&&j.name===I});if(X.length===0)throw new B$(`Component '${Y}' is not installed.
273
- Run '${rY(Y,U)}' to install it first.`);let q=X[0];if(!q)throw Error("Unexpected: matchingIds has length but first element is undefined");v.push({component:q})}return v}function YF($,_){let U=$.filter((J)=>J.status==="would-update"),v={dryRun:!0,command:"update",wouldPerform:U.map((J)=>({action:"update",target:J.qualifiedName,details:{from:J.oldVersion,to:J.newVersion}})),validation:{passed:!0},summary:U.length>0?`Would update ${U.length} component(s)`:"All components are up to date"};S4(v,{json:_.json,quiet:_.quiet})}var RW=b(()=>{k0();D1();X4();o4();w1();z$();c$();i$();p6();G8();T0();a4();e4()});import{resolve as zF}from"path";function IF($,_){if(_==="not_found")return new B$($);if(_==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function XF($,_){let U=a_($,{schemaErrors:_==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new z1(Q)}function qF($){for(let _ of $)console.log(g.red(` ${_}`))}function EW($){$.command("validate").description("Validate a registry source (for registry authors)").argument("[path]","Registry source directory",".").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--no-duplicate-targets","Skip duplicate target validation").action(async(_,U)=>{try{let Q=zF(U.cwd,_),v=await F8(Q,{skipDuplicateTargets:U.duplicateTargets===!1});if(!v.success){let[J="Registry validation failed"]=v.errors;if(v.failureType==="load"){let z=IF(J,v.loadErrorKind);if(!U.json&&U.quiet){let I=z instanceof b$?z.exitCode:K$.GENERAL;process.exit(I)}throw z}let Y=XF(v.errors,v.failureType==="schema"?"schema":"rules");if(U.json)throw Y;if(!U.quiet)W.error(Y.message),qF(v.errors);process.exit(Y.exitCode)}if(!U.quiet&&!U.json)W.success("\u2713 Registry source is valid");if(U.json)O$({success:!0,data:{valid:!0,errors:[],summary:a_([])}})}catch(Q){if(!U.json&&U.quiet){let v=Q instanceof b$?Q.exitCode:K$.GENERAL;process.exit(v)}_$(Q,{json:U.json})}})}var PW=b(()=>{k6();DY();z$();c$();i$()});function xW($){let _=$.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");Q4(_),m4(_),_.action(async(U,Q)=>{try{await GF(U,Q)}catch(v){_$(v,{json:Q.json})}})}async function GF($,_){let U=_.cwd??process.cwd(),Q=await y4.requireInitialized(U),v=await F4(Q.cwd);if(!v||Object.keys(v.installed).length===0){if(_.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!_.quiet)W.info("No components installed.");return}let J;if($.length>0)J=y8($,v);else J=Object.keys(v.installed);let Y=_.quiet||_.json?null:V$({text:"Verifying components..."});Y?.start();let z=[],I=!1;for(let X of J){let q=v.installed[X];if(!q){if($.length>0)W.warn(`Component '${X}' not found in receipt.`);continue}let G=await d_(Q.cwd,q);if(!G.intact)I=!0;z.push({canonicalId:X,intact:G.intact,modified:G.modified,missing:G.missing})}if(Y?.succeed(`Verified ${z.length} component(s)`),_.json){if(console.log(JSON.stringify({success:!I,verified:z.filter((X)=>X.intact),errors:z.filter((X)=>!X.intact)},null,2)),I)process.exit(K$.CONFLICT);return}if(!_.quiet){W.info("");for(let X of z)if(X.intact){if(_.verbose)W.success(`\u2713 ${X.canonicalId} - all files intact`)}else{W.error(`\u2717 ${X.canonicalId} - integrity check failed`);for(let q of X.modified)W.error(` Modified: ${q}`);for(let q of X.missing)W.error(` Missing: ${q}`)}}if(I){if(!_.quiet)W.info(""),W.warn("Some files have been modified or are missing. Review local changes with git, then run 'ocx update <alias/component>' or 'ocx update --all' to restore.");throw new t$("File integrity check failed for one or more components.")}if(!_.quiet)W.info(""),W.success("All components verified successfully.")}var uW=b(()=>{k0();X4();uY();z$();c$();i$();T0();a4();e4()});function jF(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(_j(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function yW($){$.hook("postAction",async(_,U)=>{if(U.name()==="update"&&U.parent?.name()==="self")return;let Q=U.opts();if(Q.json||Q.quiet)return;if(!jF())return;try{let[{checkForUpdate:v},{notifyUpdate:J}]=await Promise.all([Promise.resolve().then(() => (lY(),jW)),Promise.resolve().then(() => (nY(),ZW))]),Y=await v();if(Y.ok&&Y.updateAvailable)J(Y.current,Y.latest)}catch{}})}var CW=b(()=>{l_()});var fW={};s$(fW,{runCli:()=>HF});async function HF($=process.argv){let _=new nq().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(KF);yK(_),VK(_),TW(_),iH(_),uH(_),AK(_),EW(_),FW(_),xW(_),mH(_),pK(_),RH(_),EK(_),GH(_),yW(_),await _.parseAsync($)}var KF="2.0.5";var mW=b(()=>{a2();VY();FK();PK();fK();nK();jH();EH();yH();gH();nH();OW();RW();PW();uW();CW()});p2();BJ();if(import.meta.main)WF();async function WF(){try{let{runCli:$}=await Promise.resolve().then(() => (mW(),fW));await $()}catch($){let{handleError:_}=await Promise.resolve().then(() => (c$(),vj));_($)}}export{j1 as registrySchema,x_ as packumentSchema,n2 as ocxLockSchema,h6 as ocxConfigSchema,q1 as componentManifestSchema,u_ as buildRegistry};
271
+ Please use a fully qualified name (alias/component).`);throw new L(`Component '${H}' must include a registry alias (e.g., 'kdco/${H}').`)}let{namespace:G,component:K}=m0(H),W=q.filter((B)=>{let Z=R8(B);return Z.registryName===G&&Z.name===K});if(W.length===0)throw new B1(`Component '${H}' is not installed.
272
+ Run '${K5(H,Y)}' to install it first.`);let z=W[0];if(!z)throw Error("Unexpected: matchingIds has length but first element is undefined");J.push({component:z})}return J}function hL(Q,$){let Y=Q.filter((X)=>X.status==="would-update"),J={dryRun:!0,command:"update",wouldPerform:Y.map((X)=>({action:"update",target:X.qualifiedName,details:{from:X.oldVersion,to:X.newVersion}})),validation:{passed:!0},summary:Y.length>0?`Would update ${Y.length} component(s)`:"All components are up to date"};j0(J,{json:$.json,quiet:$.quiet})}var rK=A(()=>{E9();a8();q0();g0();e8();t();u1();c1();k8();P3();y9();d0();l0()});import{resolve as fL}from"path";function uL(Q,$){if($==="not_found")return new B1(Q);if($==="parse_error")return new z1(Q,"CONFIG_ERROR",H1.CONFIG);return new z1(Q,"CONFIG_ERROR",H1.CONFIG)}function mL(Q,$){let Y=P2(Q,{schemaErrors:$==="schema"?Q.length:0}),q={valid:!1,errors:Q,summary:{valid:!1,totalErrors:Y.totalErrors,schemaErrors:Y.schemaErrors,sourceFileErrors:Y.sourceFileErrors,circularDependencyErrors:Y.circularDependencyErrors,duplicateTargetErrors:Y.duplicateTargetErrors,otherErrors:Y.otherErrors}};return new u8(q)}function gL(Q){for(let $ of Q)console.log(P.red(` ${$}`))}function aK(Q){Q.command("validate").description("Validate a registry source (for registry authors)").argument("[path]","Registry source directory",".").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--no-duplicate-targets","Skip duplicate target validation").action(async($,Y)=>{try{let q=fL(Y.cwd,$),J=await o3(q,{skipDuplicateTargets:Y.duplicateTargets===!1});if(!J.success){let[X="Registry validation failed"]=J.errors;if(J.failureType==="load"){let G=uL(X,J.loadErrorKind);if(!Y.json&&Y.quiet){let K=G instanceof z1?G.exitCode:H1.GENERAL;process.exit(K)}throw G}let H=mL(J.errors,J.failureType==="schema"?"schema":"rules");if(Y.json)throw H;if(!Y.quiet)_.error(H.message),gL(J.errors);process.exit(H.exitCode)}if(!Y.quiet&&!Y.json)_.success("\u2713 Registry source is valid");if(Y.json)F1({success:!0,data:{valid:!0,errors:[],summary:P2([])}})}catch(q){if(!Y.json&&Y.quiet){let J=q instanceof z1?q.exitCode:H1.GENERAL;process.exit(J)}s(q,{json:Y.json})}})}var tK=A(()=>{U8();P6();t();u1();c1()});function eK(Q){let $=Q.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");Q0($),E0($),$.action(async(Y,q)=>{try{await cL(Y,q)}catch(J){s(J,{json:q.json})}})}async function cL(Q,$){let Y=$.cwd??process.cwd(),q=await b0.requireInitialized(Y),J=await A0(q.cwd);if(!J||Object.keys(J.installed).length===0){if($.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!$.quiet)_.info("No components installed.");return}let X;if(Q.length>0)X=H7(Q,J);else X=Object.keys(J.installed);let H=$.quiet||$.json?null:Z1({text:"Verifying components..."});H?.start();let G=[],K=!1;for(let W of X){let z=J.installed[W];if(!z){if(Q.length>0)_.warn(`Component '${W}' not found in receipt.`);continue}let B=await T2(q.cwd,z);if(!B.intact)K=!0;G.push({canonicalId:W,intact:B.intact,modified:B.modified,missing:B.missing})}if(H?.succeed(`Verified ${G.length} component(s)`),$.json){if(console.log(JSON.stringify({success:!K,verified:G.filter((W)=>W.intact),errors:G.filter((W)=>!W.intact)},null,2)),K)process.exit(H1.CONFLICT);return}if(!$.quiet){_.info("");for(let W of G)if(W.intact){if($.verbose)_.success(`\u2713 ${W.canonicalId} - all files intact`)}else{_.error(`\u2717 ${W.canonicalId} - integrity check failed`);for(let z of W.modified)_.error(` Modified: ${z}`);for(let z of W.missing)_.error(` Missing: ${z}`)}}if(K){if(!$.quiet)_.info(""),_.warn("Some files have been modified or are missing. Review local changes with git, then run 'ocx update <alias/component>' or 'ocx update --all' to restore.");throw new n1("File integrity check failed for one or more components.")}if(!$.quiet)_.info(""),_.success("All components verified successfully.")}var QW=A(()=>{E9();q0();s6();t();u1();c1();y9();d0();l0()});function dL(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(LX(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function $W(Q){Q.hook("postAction",async($,Y)=>{if(Y.name()==="update"&&Y.parent?.name()==="self")return;let q=Y.opts();if(q.json||q.quiet)return;if(!dL())return;try{let[{checkForUpdate:J},{notifyUpdate:X}]=await Promise.all([Promise.resolve().then(() => (q5(),kK)),Promise.resolve().then(() => (G5(),hK))]),H=await J();if(H.ok&&H.updateAvailable)X(H.current,H.latest)}catch{}})}var YW=A(()=>{N2()});var qW={};Y8(qW,{runCli:()=>lL});async function lL(Q=process.argv){let $=new BJ().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(pL);eH($),yH($),sK($),BK($),QK($),cH($),aK($),lK($),eK($),JK($),KG($),rG($),sH($),EG($),$W($),await $.parseAsync(Q)}var pL="2.0.7";var JW=A(()=>{L3();v6();dH();rH();$G();zG();kG();aG();$K();XK();_K();iK();rK();tK();QW();YW()});_3();k4();if(import.meta.main)iL();async function iL(){try{let{runCli:Q}=await Promise.resolve().then(() => (JW(),qW));await Q()}catch(Q){let{handleError:$}=await Promise.resolve().then(() => (u1(),FX));$(Q)}}export{p8 as registrySchema,M2 as packumentSchema,M3 as ocxLockSchema,b8 as ocxConfigSchema,c8 as componentManifestSchema,U2 as buildRegistry};
274
273
 
275
- //# debugId=742AA5BAD49273B064756E2164756E21
274
+ //# debugId=0928E5313922DFE964756E2164756E21