ocx 2.0.6 → 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 +149 -150
  2. package/package.json +1 -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 rW=Object.create;var{getPrototypeOf:oW,defineProperty:v9,getOwnPropertyNames:tW}=Object;var aW=Object.prototype.hasOwnProperty;var _z=($,v,U)=>{U=$!=null?rW(oW($)):{};let Q=v||!$||!$.__esModule?v9(U,"default",{value:$,enumerable:!0}):U;for(let _ of tW($))if(!aW.call(Q,_))v9(Q,_,{get:()=>$[_],enumerable:!0});return Q};var T6=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var s$=($,v)=>{for(var U in v)v9($,U,{get:v[U],enumerable:!0,configurable:!0,set:(Q)=>v[U]=()=>Q})};var b=($,v)=>()=>($&&(v=$($=0)),v);var P1=import.meta.require;function l0($,v=!1){let U=$.length,Q=0,_="",J=0,Y=16,z=0,I=0,X=0,q=0,G=0;function j(O,g){let w=0,N=0;while(w<O||!g){let L=$.charCodeAt(Q);if(L>=48&&L<=57)N=N*16+L-48;else if(L>=65&&L<=70)N=N*16+L-65+10;else if(L>=97&&L<=102)N=N*16+L-97+10;else break;Q++,w++}if(w<O)N=-1;return N}function H(O){Q=O,_="",J=0,Y=16,G=0}function Z(){let O=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(O,Q);let g=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++;g=Q}else G=3}return $.substring(O,g)}function D(){let O="",g=Q;while(!0){if(Q>=U){O+=$.substring(g,Q),G=2;break}let w=$.charCodeAt(Q);if(w===34){O+=$.substring(g,Q),Q++;break}if(w===92){if(O+=$.substring(g,Q),Q++,Q>=U){G=2;break}switch($.charCodeAt(Q++)){case 34:O+='"';break;case 92:O+="\\";break;case 47:O+="/";break;case 98:O+="\b";break;case 102:O+="\f";break;case 110:O+=`
4
- `;break;case 114:O+="\r";break;case 116:O+="\t";break;case 117:let L=j(4,!0);if(L>=0)O+=String.fromCharCode(L);else G=4;break;default:G=5}g=Q;continue}if(w>=0&&w<=31)if(c0(w)){O+=$.substring(g,Q),G=2;break}else G=6;Q++}return O}function E(){if(_="",G=0,J=Q,I=z,q=X,Q>=U)return J=U,Y=17;let O=$.charCodeAt(Q);if(_9(O)){do Q++,_+=String.fromCharCode(O),O=$.charCodeAt(Q);while(_9(O));return Y=15}if(c0(O)){if(Q++,_+=String.fromCharCode(O),O===13&&$.charCodeAt(Q)===10)Q++,_+=`
5
- `;return z++,X=Q,Y=14}switch(O){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++,_=D(),Y=10;case 47:let g=Q-1;if($.charCodeAt(Q+1)===47){Q+=2;while(Q<U){if(c0($.charCodeAt(Q)))break;Q++}return _=$.substring(g,Q),Y=12}if($.charCodeAt(Q+1)===42){Q+=2;let w=U-1,N=!1;while(Q<w){let L=$.charCodeAt(Q);if(L===42&&$.charCodeAt(Q+1)===47){Q+=2,N=!0;break}if(Q++,c0(L)){if(L===13&&$.charCodeAt(Q)===10)Q++;z++,X=Q}}if(!N)Q++,G=1;return _=$.substring(g,Q),Y=13}return _+=String.fromCharCode(O),Q++,Y=16;case 45:if(_+=String.fromCharCode(O),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 _+=Z(),Y=11;default:while(Q<U&&A(O))Q++,O=$.charCodeAt(Q);if(J!==Q){switch(_=$.substring(J,Q),_){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return _+=String.fromCharCode(O),Q++,Y=16}}function A(O){if(_9(O)||c0(O))return!1;switch(O){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function r(){let O;do O=E();while(O>=12&&O<=15);return O}return{setPosition:H,getPosition:()=>Q,scan:v?r:E,getToken:()=>Y,getTokenValue:()=>_,getTokenOffset:()=>J,getTokenLength:()=>Q-J,getTokenStartLine:()=>I,getTokenStartCharacter:()=>J-q,getTokenError:()=>G}}function _9($){return $===32||$===9}function c0($){return $===10||$===13}function x1($){return $>=48&&$<=57}var Uz;var J2=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"})(Uz||(Uz={}))});var w4,U9,Qz;var Jz=b(()=>{w4=Array(20).fill(0).map(($,v)=>{return" ".repeat(v)}),U9={" ":{"\n":Array(200).fill(0).map(($,v)=>{return`
6
- `+" ".repeat(v)}),"\r":Array(200).fill(0).map(($,v)=>{return"\r"+" ".repeat(v)}),"\r\n":Array(200).fill(0).map(($,v)=>{return`\r
7
- `+" ".repeat(v)})},"\t":{"\n":Array(200).fill(0).map(($,v)=>{return`
8
- `+"\t".repeat(v)}),"\r":Array(200).fill(0).map(($,v)=>{return"\r"+"\t".repeat(v)}),"\r\n":Array(200).fill(0).map(($,v)=>{return`\r
9
- `+"\t".repeat(v)})}},Qz=[`
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 Q9($,v,U){let Q,_,J,Y,z;if(v){Y=v.offset,z=Y+v.length,J=Y;while(J>0&&!d0($,J-1))J--;let w=z;while(w<$.length&&!d0($,w))w++;_=$.substring(J,w),Q=eW(_,U)}else _=$,Q=0,J=0,Y=0,z=$.length;let I=$b(U,$),X=Qz.includes(I),q=0,G=0,j;if(U.insertSpaces)j=w4[U.tabSize||4]??u1(w4[1],U.tabSize||4);else j="\t";let H=j==="\t"?"\t":" ",Z=l0(_,!1),D=!1;function E(){if(q>1)return u1(I,q)+u1(j,Q+G);let w=j.length*(Q+G);if(!X||w>U9[H][I].length)return I+u1(j,Q+G);if(w<=0)return I;return U9[H][I][w]}function A(){let w=Z.scan();q=0;while(w===15||w===14){if(w===14&&U.keepLines)q+=1;else if(w===14)q=1;w=Z.scan()}return D=w===16||Z.getTokenError()!==0,w}let r=[];function O(w,N,L){if(!D&&(!v||N<z&&L>Y)&&$.substring(N,L)!==w)r.push({offset:N,length:L-N,content:w})}let g=A();if(U.keepLines&&q>0)O(u1(I,q),0,0);if(g!==17){let w=Z.getTokenOffset()+J,N=j.length*Q<20&&U.insertSpaces?w4[j.length*Q]:u1(j,Q);O(N,J,w)}while(g!==17){let w=Z.getTokenOffset()+Z.getTokenLength()+J,N=A(),L="",U$=!1;while(q===0&&(N===12||N===13)){let a=Z.getTokenOffset()+J;O(w4[1],w,a),w=Z.getTokenOffset()+Z.getTokenLength()+J,U$=N===12,L=U$?E():"",N=A()}if(N===2){if(g!==1)G--;if(U.keepLines&&q>0||!U.keepLines&&g!==1)L=E();else if(U.keepLines)L=w4[1]}else if(N===4){if(g!==3)G--;if(U.keepLines&&q>0||!U.keepLines&&g!==3)L=E();else if(U.keepLines)L=w4[1]}else{switch(g){case 3:case 1:if(G++,U.keepLines&&q>0||!U.keepLines)L=E();else L=w4[1];break;case 5:if(U.keepLines&&q>0||!U.keepLines)L=E();else L=w4[1];break;case 12:L=E();break;case 13:if(q>0)L=E();else if(!U$)L=w4[1];break;case 6:if(U.keepLines&&q>0)L=E();else if(!U$)L=w4[1];break;case 10:if(U.keepLines&&q>0)L=E();else if(N===6&&!U$)L="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(U.keepLines&&q>0)L=E();else if((N===12||N===13)&&!U$)L=w4[1];else if(N!==5&&N!==17)D=!0;break;case 16:D=!0;break}if(q>0&&(N===12||N===13))L=E()}if(N===17)if(U.keepLines&&q>0)L=E();else L=U.insertFinalNewline?I:"";let $$=Z.getTokenOffset()+J;O(L,w,$$),g=N}return r}function u1($,v){let U="";for(let Q=0;Q<v;Q++)U+=$;return U}function eW($,v){let U=0,Q=0,_=v.tabSize||4;while(U<$.length){let J=$.charAt(U);if(J===w4[1])Q++;else if(J==="\t")Q+=_;else break;U++}return Math.floor(Q/_)}function $b($,v){for(let U=0;U<v.length;U++){let Q=v.charAt(U);if(Q==="\r"){if(U+1<v.length&&v.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($,v){return`\r
17
- `.indexOf($.charAt(v))!==-1}var J9=b(()=>{J2();Jz()});function Yz($,v=[],U=p0.DEFAULT){let Q=null,_=[],J=[];function Y(I){if(Array.isArray(_))_.push(I);else if(Q!==null)_[Q]=I}return z9($,{onObjectBegin:()=>{let I={};Y(I),J.push(_),_=I,Q=null},onObjectProperty:(I)=>{Q=I},onObjectEnd:()=>{_=J.pop()},onArrayBegin:()=>{let I=[];Y(I),J.push(_),_=I,Q=null},onArrayEnd:()=>{_=J.pop()},onLiteralValue:Y,onError:(I,X,q)=>{v.push({error:I,offset:X,length:q})}},U),_[0]}function Y9($,v=[],U=p0.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function _(I){if(Q.type==="property")Q.length=I-Q.offset,Q=Q.parent}function J(I){return Q.children.push(I),I}z9($,{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)=>{_(I+X),Q.length=I+X-Q.offset,Q=Q.parent,_(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,_(I+X)},onLiteralValue:(I,X,q)=>{J({type:_b(I),offset:X,length:q,parent:Q,value:I}),_(X+q)},onSeparator:(I,X,q)=>{if(Q.type==="property"){if(I===":")Q.colonOffset=X;else if(I===",")_(X)}},onError:(I,X,q)=>{v.push({error:I,offset:X,length:q})}},U);let z=Q.children[0];if(z)delete z.parent;return z}function Y2($,v){if(!$)return;let U=$;for(let Q of v)if(typeof Q==="string"){if(U.type!=="object"||!Array.isArray(U.children))return;let _=!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],_=!0;break}if(!_)return}else{let _=Q;if(U.type!=="array"||_<0||!Array.isArray(U.children)||_>=U.children.length)return;U=U.children[_]}return U}function z9($,v,U=p0.DEFAULT){let Q=l0($,!1),_=[],J=0;function Y(y){return y?()=>J===0&&y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function z(y){return y?(h)=>J===0&&y(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function I(y){return y?(h)=>J===0&&y(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>_.slice()):()=>!0}function X(y){return y?()=>{if(J>0)J++;else if(y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>_.slice())===!1)J=1}:()=>!0}function q(y){return y?()=>{if(J>0)J--;if(J===0)y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let G=X(v.onObjectBegin),j=I(v.onObjectProperty),H=q(v.onObjectEnd),Z=X(v.onArrayBegin),D=q(v.onArrayEnd),E=I(v.onLiteralValue),A=z(v.onSeparator),r=Y(v.onComment),O=z(v.onError),g=U&&U.disallowComments,w=U&&U.allowTrailingComma;function N(){while(!0){let y=Q.scan();switch(Q.getTokenError()){case 4:L(14);break;case 5:L(15);break;case 3:L(13);break;case 1:if(!g)L(11);break;case 2:L(12);break;case 6:L(16);break}switch(y){case 12:case 13:if(g)L(10);else r();break;case 16:L(1);break;case 15:case 14:break;default:return y}}}function L(y,h=[],I$=[]){if(O(y),h.length+I$.length>0){let v$=Q.getToken();while(v$!==17){if(h.indexOf(v$)!==-1){N();break}else if(I$.indexOf(v$)!==-1)break;v$=N()}}}function U$(y){let h=Q.getTokenValue();if(y)E(h);else j(h),_.push(h);return N(),!0}function $$(){switch(Q.getToken()){case 11:let y=Q.getTokenValue(),h=Number(y);if(isNaN(h))L(2),h=0;E(h);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return N(),!0}function a(){if(Q.getToken()!==10)return L(3,[],[2,5]),!1;if(U$(!1),Q.getToken()===6){if(A(":"),N(),!o())L(4,[],[2,5])}else L(5,[],[2,5]);return _.pop(),!0}function V$(){G(),N();let y=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!y)L(4,[],[]);if(A(","),N(),Q.getToken()===2&&w)break}else if(y)L(6,[],[]);if(!a())L(4,[],[2,5]);y=!0}if(H(),Q.getToken()!==2)L(7,[2],[]);else N();return!0}function x(){Z(),N();let y=!0,h=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!h)L(4,[],[]);if(A(","),N(),Q.getToken()===4&&w)break}else if(h)L(6,[],[]);if(y)_.push(0),y=!1;else _[_.length-1]++;if(!o())L(4,[],[4,5]);h=!0}if(D(),!y)_.pop();if(Q.getToken()!==4)L(8,[4],[]);else N();return!0}function o(){switch(Q.getToken()){case 3:return x();case 1:return V$();case 10:return U$(!0);default:return $$()}}if(N(),Q.getToken()===17){if(U.allowEmptyContent)return!0;return L(4,[],[]),!1}if(!o())return L(4,[],[]),!1;if(Q.getToken()!==17)L(9,[],[]);return!0}function _b($){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 I9=b(()=>{J2();(function($){$.DEFAULT={allowTrailingComma:!1}})(p0||(p0={}))});function zz($,v,U,Q){let _=v.slice(),Y=Y9($,[]),z=void 0,I=void 0;while(_.length>0)if(I=_.pop(),z=Y2(Y,_),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 s6($,{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=Y2(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 s6($,{offset:G,length:j-G,content:""},Q)}else return s6($,{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 s6($,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 s6($,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,D=z.offset+z.length;j={offset:Z,length:D-2-Z,content:""}}else j={offset:G.offset,length:z.children[q+1].offset-G.offset,content:""};return s6($,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 s6($,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 s6($,v,U){if(!U.formattingOptions)return[v];let Q=z2($,v),_=v.offset,J=v.offset+v.content.length;if(v.length===0||v.content.length===0){while(_>0&&!d0(Q,_-1))_--;while(J<Q.length&&!d0(Q,J))J++}let Y=Q9(Q,{offset:_,length:J-_},{...U.formattingOptions,keepLines:!1});for(let I=Y.length-1;I>=0;I--){let X=Y[I];Q=z2(Q,X),_=Math.min(_,X.offset),J=Math.max(J,X.offset+X.length),J+=X.content.length-X.length}let z=$.length-(Q.length-J)-_;return[{offset:_,length:z,content:Q.substring(_,J)}]}function z2($,v){return $.substring(0,v.offset)+v.content+$.substring(v.offset+v.length)}var Iz=b(()=>{J9();I9()});function _6($){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($,v,U,Q){return zz($,v,U,Q)}function C1($,v){let U=v.slice(0).sort((_,J)=>{let Y=_.offset-J.offset;if(Y===0)return _.length-J.length;return Y}),Q=$.length;for(let _=U.length-1;_>=0;_--){let J=U[_];if(J.offset+J.length<=Q)$=z2($,J);else throw Error("Overlapping edit");Q=J.offset}return $}var Xz,qz,E$,Gz;var E4=b(()=>{J9();Iz();J2();I9();(function($){$[$.None=0]="None",$[$.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=2]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",$[$.InvalidUnicode=4]="InvalidUnicode",$[$.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",$[$.InvalidCharacter=6]="InvalidCharacter"})(Xz||(Xz={}));(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={}));E$=Yz;(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"})(Gz||(Gz={}))});function B($,v,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($),v(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 _=U?.Parent??Object;class J extends _{}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 d$($){if($)Object.assign(i0,$);return i0}var X9,q9,U6,e6,i0;var f1=b(()=>{X9=Object.freeze({status:"aborted"});q9=Symbol("zod_brand");U6=class U6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};e6=class e6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};i0={}});var R={};s$(R,{unwrapMessage:()=>n0,uint8ArrayToHex:()=>Sb,uint8ArrayToBase64url:()=>Fb,uint8ArrayToBase64:()=>Hz,stringifyPrimitive:()=>S,slugify:()=>K9,shallowClone:()=>W9,safeExtend:()=>Mb,required:()=>kb,randomString:()=>Hb,propertyKeyTypes:()=>t0,promiseAllObject:()=>Kb,primitiveTypes:()=>b9,prefixIssues:()=>L4,pick:()=>Zb,partial:()=>Lb,parsedType:()=>T,optionalKeys:()=>B9,omit:()=>Db,objectClone:()=>qb,numKeys:()=>Wb,nullish:()=>R6,normalizeParams:()=>P,mergeDefs:()=>W6,merge:()=>wb,jsonStringifyReplacer:()=>m1,joinValues:()=>V,issue:()=>h1,isPlainObject:()=>P6,isObject:()=>$1,hexToUint8Array:()=>Nb,getSizableOrigin:()=>a0,getParsedType:()=>bb,getLengthableOrigin:()=>s0,getEnumValues:()=>r0,getElementAtPath:()=>jb,floatSafeRemainder:()=>j9,finalizeIssue:()=>H4,extend:()=>Vb,escapeRegex:()=>P4,esc:()=>I2,defineLazy:()=>Y$,createTransparentProxy:()=>Bb,cloneDef:()=>Gb,clone:()=>Y4,cleanRegex:()=>o0,cleanEnum:()=>Ab,captureStackTrace:()=>X2,cached:()=>g1,base64urlToUint8Array:()=>Ob,base64ToUint8Array:()=>Kz,assignProp:()=>E6,assertNotEqual:()=>Yb,assertNever:()=>Ib,assertIs:()=>zb,assertEqual:()=>Jb,assert:()=>Xb,allowsEval:()=>H9,aborted:()=>x6,NUMBER_FORMAT_RANGES:()=>Z9,Class:()=>Wz,BIGINT_FORMAT_RANGES:()=>D9});function Jb($){return $}function Yb($){return $}function zb($){}function Ib($){throw Error("Unexpected value in exhaustive check")}function Xb($){}function r0($){let v=Object.values($).filter((Q)=>typeof Q==="number");return Object.entries($).filter(([Q,_])=>v.indexOf(+Q)===-1).map(([Q,_])=>_)}function V($,v="|"){return $.map((U)=>S(U)).join(v)}function m1($,v){if(typeof v==="bigint")return v.toString();return v}function g1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function R6($){return $===null||$===void 0}function o0($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function j9($,v){let U=($.toString().split(".")[1]||"").length,Q=v.toString(),_=(Q.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(Q)){let I=Q.match(/\d?e-(\d?)/);if(I?.[1])_=Number.parseInt(I[1])}let J=U>_?U:_,Y=Number.parseInt($.toFixed(J).replace(".","")),z=Number.parseInt(v.toFixed(J).replace(".",""));return Y%z/10**J}function Y$($,v,U){let Q=void 0;Object.defineProperty($,v,{get(){if(Q===jz)return;if(Q===void 0)Q=jz,Q=U();return Q},set(_){Object.defineProperty($,v,{value:_})},configurable:!0})}function qb($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function E6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function W6(...$){let v={};for(let U of $){let Q=Object.getOwnPropertyDescriptors(U);Object.assign(v,Q)}return Object.defineProperties({},v)}function Gb($){return W6($._zod.def)}function jb($,v){if(!v)return $;return v.reduce((U,Q)=>U?.[Q],$)}function Kb($){let v=Object.keys($),U=v.map((Q)=>$[Q]);return Promise.all(U).then((Q)=>{let _={};for(let J=0;J<v.length;J++)_[v[J]]=Q[J];return _})}function Hb($=10){let U="";for(let Q=0;Q<$;Q++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function I2($){return JSON.stringify($)}function K9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function $1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function P6($){if($1($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if($1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function W9($){if(P6($))return{...$};if(Array.isArray($))return[...$];return $}function Wb($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}function P4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y4($,v,U){let Q=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)Q._zod.parent=$;return Q}function P($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function Bb($){let v;return new Proxy({},{get(U,Q,_){return v??(v=$()),Reflect.get(v,Q,_)},set(U,Q,_,J){return v??(v=$()),Reflect.set(v,Q,_,J)},has(U,Q){return v??(v=$()),Reflect.has(v,Q)},deleteProperty(U,Q){return v??(v=$()),Reflect.deleteProperty(v,Q)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,Q){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,Q)},defineProperty(U,Q,_){return v??(v=$()),Reflect.defineProperty(v,Q,_)}})}function S($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function B9($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}function Zb($,v){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=W6($._zod.def,{get shape(){let Y={};for(let z in v){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!v[z])continue;Y[z]=U.shape[z]}return E6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Db($,v){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=W6($._zod.def,{get shape(){let Y={...$._zod.def.shape};for(let z in v){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!v[z])continue;delete Y[z]}return E6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Vb($,v){if(!P6(v))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 v)if(Object.getOwnPropertyDescriptor(J,Y)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let _=W6($._zod.def,{get shape(){let J={...$._zod.def.shape,...v};return E6(this,"shape",J),J}});return Y4($,_)}function Mb($,v){if(!P6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=W6($._zod.def,{get shape(){let Q={...$._zod.def.shape,...v};return E6(this,"shape",Q),Q}});return Y4($,U)}function wb($,v){let U=W6($._zod.def,{get shape(){let Q={...$._zod.def.shape,...v._zod.def.shape};return E6(this,"shape",Q),Q},get catchall(){return v._zod.def.catchall},checks:[]});return Y4($,U)}function Lb($,v,U){let _=v._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let Y=W6(v._zod.def,{get shape(){let z=v._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 E6(this,"shape",I),I},checks:[]});return Y4(v,Y)}function kb($,v,U){let Q=W6(v._zod.def,{get shape(){let _=v._zod.def.shape,J={..._};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:_[Y]})}else for(let Y in _)J[Y]=new $({type:"nonoptional",innerType:_[Y]});return E6(this,"shape",J),J}});return Y4(v,Q)}function x6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function L4($,v){return v.map((U)=>{var Q;return(Q=U).path??(Q.path=[]),U.path.unshift($),U})}function n0($){return typeof $==="string"?$:$?.message}function H4($,v,U){let Q={...$,path:$.path??[]};if(!$.message){let _=n0($.inst?._zod.def?.error?.($))??n0(v?.error?.($))??n0(U.customError?.($))??n0(U.localeError?.($))??"Invalid input";Q.message=_}if(delete Q.inst,delete Q.continue,!v?.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 T($){let v=typeof $;switch(v){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 v}function h1(...$){let[v,U,Q]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:Q};return{...v}}function Ab($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function Kz($){let v=atob($),U=new Uint8Array(v.length);for(let Q=0;Q<v.length;Q++)U[Q]=v.charCodeAt(Q);return U}function Hz($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function Ob($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return Kz(v+U)}function Fb($){return Hz($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Nb($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let Q=0;Q<v.length;Q+=2)U[Q/2]=Number.parseInt(v.slice(Q,Q+2),16);return U}function Sb($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class Wz{constructor(...$){}}var jz,X2,H9,bb=($)=>{let v=typeof $;switch(v){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: ${v}`)}},t0,b9,Z9,D9;var l=b(()=>{jz=Symbol("evaluating");X2="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};H9=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"]),b9=new Set(["string","number","bigint","boolean","symbol","undefined"]);Z9={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]},D9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function $v($,v=(U)=>U.message){let U={},Q=[];for(let _ of $.issues)if(_.path.length>0)U[_.path[0]]=U[_.path[0]]||[],U[_.path[0]].push(v(_));else Q.push(v(_));return{formErrors:Q,fieldErrors:U}}function vv($,v=(U)=>U.message){let U={_errors:[]},Q=(_)=>{for(let J of _.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(v(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(v(J));Y=Y[I],z++}}};return Q($),U}function V9($,v=(U)=>U.message){let U={errors:[]},Q=(_,J=[])=>{var Y,z;for(let I of _.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(v(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(v(I));G++}}};return Q($),U}function Bz($){let v=[],U=$.map((Q)=>typeof Q==="object"?Q.key:Q);for(let Q of U)if(typeof Q==="number")v.push(`[${Q}]`);else if(typeof Q==="symbol")v.push(`[${JSON.stringify(String(Q))}]`);else if(/[^\w$]/.test(Q))v.push(`[${JSON.stringify(Q)}]`);else{if(v.length)v.push(".");v.push(Q)}return v.join("")}function M9($){let v=[],U=[...$.issues].sort((Q,_)=>(Q.path??[]).length-(_.path??[]).length);for(let Q of U)if(v.push(`\u2716 ${Q.message}`),Q.path?.length)v.push(` \u2192 at ${Bz(Q.path)}`);return v.join(`
18
- `)}var bz=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,m1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},e0,W4;var w9=b(()=>{f1();l();e0=B("$ZodError",bz),W4=B("$ZodError",bz,{Parent:Error})});var c1=($)=>(v,U,Q,_)=>{let J=Q?Object.assign(Q,{async:!1}):{async:!1},Y=v._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)throw new U6;if(Y.issues.length){let z=new(_?.Err??$)(Y.issues.map((I)=>H4(I,J,d$())));throw X2(z,_?.callee),z}return Y.value},q2,l1=($)=>async(v,U,Q,_)=>{let J=Q?Object.assign(Q,{async:!0}):{async:!0},Y=v._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let z=new(_?.Err??$)(Y.issues.map((I)=>H4(I,J,d$())));throw X2(z,_?.callee),z}return Y.value},G2,d1=($)=>(v,U,Q)=>{let _=Q?{...Q,async:!1}:{async:!1},J=v._zod.run({value:U,issues:[]},_);if(J instanceof Promise)throw new U6;return J.issues.length?{success:!1,error:new($??e0)(J.issues.map((Y)=>H4(Y,_,d$())))}:{success:!0,data:J.value}},L9,p1=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{async:!0}):{async:!0},J=v._zod.run({value:U,issues:[]},_);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Y)=>H4(Y,_,d$())))}:{success:!0,data:J.value}},k9,j2=($)=>(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return c1($)(v,U,_)},Rb,K2=($)=>(v,U,Q)=>{return c1($)(v,U,Q)},Eb,H2=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return l1($)(v,U,_)},Pb,W2=($)=>async(v,U,Q)=>{return l1($)(v,U,Q)},xb,b2=($)=>(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return d1($)(v,U,_)},ub,B2=($)=>(v,U,Q)=>{return d1($)(v,U,Q)},yb,Z2=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return p1($)(v,U,_)},Cb,D2=($)=>async(v,U,Q)=>{return p1($)(v,U,Q)},fb;var A9=b(()=>{f1();w9();l();q2=c1(W4),G2=l1(W4),L9=d1(W4),k9=p1(W4),Rb=j2(W4),Eb=K2(W4),Pb=H2(W4),xb=W2(W4),ub=b2(W4),yb=B2(W4),Cb=Z2(W4),fb=D2(W4)});var x4={};s$(x4,{xid:()=>S9,uuid7:()=>cb,uuid6:()=>hb,uuid4:()=>gb,uuid:()=>v1,uppercase:()=>e9,unicodeEmail:()=>Zz,undefined:()=>a9,ulid:()=>N9,time:()=>d9,string:()=>i9,sha512_hex:()=>XB,sha512_base64url:()=>GB,sha512_base64:()=>qB,sha384_hex:()=>YB,sha384_base64url:()=>IB,sha384_base64:()=>zB,sha256_hex:()=>UB,sha256_base64url:()=>JB,sha256_base64:()=>QB,sha1_hex:()=>$B,sha1_base64url:()=>_B,sha1_base64:()=>vB,rfc5322Email:()=>db,number:()=>_v,null:()=>t9,nanoid:()=>R9,md5_hex:()=>ab,md5_base64url:()=>eb,md5_base64:()=>sb,mac:()=>f9,lowercase:()=>s9,ksuid:()=>T9,ipv6:()=>C9,ipv4:()=>y9,integer:()=>r9,idnEmail:()=>pb,html5Email:()=>lb,hostname:()=>rb,hex:()=>tb,guid:()=>P9,extendedDuration:()=>mb,emoji:()=>u9,email:()=>x9,e164:()=>c9,duration:()=>E9,domain:()=>ob,datetime:()=>p9,date:()=>l9,cuid2:()=>F9,cuid:()=>O9,cidrv6:()=>g9,cidrv4:()=>m9,browserEmail:()=>ib,boolean:()=>o9,bigint:()=>n9,base64url:()=>V2,base64:()=>h9});function u9(){return new RegExp(nb,"u")}function Vz($){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 d9($){return new RegExp(`^${Vz($)}$`)}function p9($){let v=Vz({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Q=`${v}(?:${U.join("|")})`;return new RegExp(`^${Dz}T(?:${Q})$`)}function Uv($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function Qv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var O9,F9,N9,S9,T9,R9,E9,mb,P9,v1=($)=>{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})$`)},gb,hb,cb,x9,lb,db,Zz,pb,ib,nb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",y9,C9,f9=($)=>{let v=P4($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},m9,g9,h9,V2,rb,ob,c9,Dz="(?:(?:\\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])))",l9,i9=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},n9,r9,_v,o9,t9,a9,s9,e9,tb,ab,sb,eb,$B,vB,_B,UB,QB,JB,YB,zB,IB,XB,qB,GB;var M2=b(()=>{l();O9=/^[cC][^\s-]{8,}$/,F9=/^[0-9a-z]+$/,N9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S9=/^[0-9a-vA-V]{20}$/,T9=/^[A-Za-z0-9]{27}$/,R9=/^[a-zA-Z0-9_-]{21}$/,E9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,mb=/^[-+]?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)?)??$/,P9=/^([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})$/,gb=v1(4),hb=v1(6),cb=v1(7),x9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lb=/^[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])?)*$/,db=/^(([^<>()\[\]\\.,;:\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,}))$/,Zz=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,pb=Zz,ib=/^[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])?)*$/;y9=/^(?:(?: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])$/,C9=/^(([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}|:))$/,m9=/^((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])$/,g9=/^(([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])$/,h9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V2=/^[A-Za-z0-9_-]*$/,rb=/^(?=.{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])?)*\.?$/,ob=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,c9=/^\+[1-9]\d{6,14}$/,l9=new RegExp(`^${Dz}$`);n9=/^-?\d+n?$/,r9=/^-?\d+$/,_v=/^-?\d+(?:\.\d+)?$/,o9=/^(?:true|false)$/i,t9=/^null$/i,a9=/^undefined$/i,s9=/^[^A-Z]*$/,e9=/^[^a-z]*$/,tb=/^[0-9a-fA-F]*$/;ab=/^[0-9a-fA-F]{32}$/,sb=Uv(22,"=="),eb=Qv(22),$B=/^[0-9a-fA-F]{40}$/,vB=Uv(27,"="),_B=Qv(27),UB=/^[0-9a-fA-F]{64}$/,QB=Uv(43,"="),JB=Qv(43),YB=/^[0-9a-fA-F]{96}$/,zB=Uv(64,""),IB=Qv(64),XB=/^[0-9a-fA-F]{128}$/,qB=Uv(86,"=="),GB=Qv(86)});function Mz($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues))}var T$,wz,w2,L2,$3,v3,_3,U3,Q3,J3,Y3,z3,I3,i1,X3,q3,G3,j3,K3,H3,W3,b3,B3;var k2=b(()=>{f1();M2();l();T$=B("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),wz={number:"number",bigint:"bigint",object:"date"},w2=B("$ZodCheckLessThan",($,v)=>{T$.init($,v);let U=wz[typeof v.value];$._zod.onattach.push((Q)=>{let _=Q._zod.bag,J=(v.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<J)if(v.inclusive)_.maximum=v.value;else _.exclusiveMaximum=v.value}),$._zod.check=(Q)=>{if(v.inclusive?Q.value<=v.value:Q.value<v.value)return;Q.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:Q.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),L2=B("$ZodCheckGreaterThan",($,v)=>{T$.init($,v);let U=wz[typeof v.value];$._zod.onattach.push((Q)=>{let _=Q._zod.bag,J=(v.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>J)if(v.inclusive)_.minimum=v.value;else _.exclusiveMinimum=v.value}),$._zod.check=(Q)=>{if(v.inclusive?Q.value>=v.value:Q.value>v.value)return;Q.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:Q.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),$3=B("$ZodCheckMultipleOf",($,v)=>{T$.init($,v),$._zod.onattach.push((U)=>{var Q;(Q=U._zod.bag).multipleOf??(Q.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):j9(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),v3=B("$ZodCheckNumberFormat",($,v)=>{T$.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),Q=U?"int":"number",[_,J]=Z9[v.format];$._zod.onattach.push((Y)=>{let z=Y._zod.bag;if(z.format=v.format,z.minimum=_,z.maximum=J,U)z.pattern=r9}),$._zod.check=(Y)=>{let z=Y.value;if(U){if(!Number.isInteger(z)){Y.issues.push({expected:Q,format:v.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:!v.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:!v.abort});return}}if(z<_)Y.issues.push({origin:"number",input:z,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!v.abort});if(z>J)Y.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inclusive:!0,inst:$,continue:!v.abort})}}),_3=B("$ZodCheckBigIntFormat",($,v)=>{T$.init($,v);let[U,Q]=D9[v.format];$._zod.onattach.push((_)=>{let J=_._zod.bag;J.format=v.format,J.minimum=U,J.maximum=Q}),$._zod.check=(_)=>{let J=_.value;if(J<U)_.issues.push({origin:"bigint",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(J>Q)_.issues.push({origin:"bigint",input:J,code:"too_big",maximum:Q,inclusive:!0,inst:$,continue:!v.abort})}}),U3=B("$ZodCheckMaxSize",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)Q._zod.bag.maximum=v.maximum}),$._zod.check=(Q)=>{let _=Q.value;if(_.size<=v.maximum)return;Q.issues.push({origin:a0(_),code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),Q3=B("$ZodCheckMinSize",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)Q._zod.bag.minimum=v.minimum}),$._zod.check=(Q)=>{let _=Q.value;if(_.size>=v.minimum)return;Q.issues.push({origin:a0(_),code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),J3=B("$ZodCheckSizeEquals",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.minimum=v.size,_.maximum=v.size,_.size=v.size}),$._zod.check=(Q)=>{let _=Q.value,J=_.size;if(J===v.size)return;let Y=J>v.size;Q.issues.push({origin:a0(_),...Y?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!v.abort})}}),Y3=B("$ZodCheckMaxLength",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)Q._zod.bag.maximum=v.maximum}),$._zod.check=(Q)=>{let _=Q.value;if(_.length<=v.maximum)return;let Y=s0(_);Q.issues.push({origin:Y,code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),z3=B("$ZodCheckMinLength",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)Q._zod.bag.minimum=v.minimum}),$._zod.check=(Q)=>{let _=Q.value;if(_.length>=v.minimum)return;let Y=s0(_);Q.issues.push({origin:Y,code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),I3=B("$ZodCheckLengthEquals",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.minimum=v.length,_.maximum=v.length,_.length=v.length}),$._zod.check=(Q)=>{let _=Q.value,J=_.length;if(J===v.length)return;let Y=s0(_),z=J>v.length;Q.issues.push({origin:Y,...z?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!v.abort})}}),i1=B("$ZodCheckStringFormat",($,v)=>{var U,Q;if(T$.init($,v),$._zod.onattach.push((_)=>{let J=_._zod.bag;if(J.format=v.format,v.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(_)=>{if(v.pattern.lastIndex=0,v.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:v.format,input:_.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(Q=$._zod).check??(Q.check=()=>{})}),X3=B("$ZodCheckRegex",($,v)=>{i1.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),q3=B("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=s9),i1.init($,v)}),G3=B("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=e9),i1.init($,v)}),j3=B("$ZodCheckIncludes",($,v)=>{T$.init($,v);let U=P4(v.includes),Q=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=Q,$._zod.onattach.push((_)=>{let J=_._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(_)=>{if(_.value.includes(v.includes,v.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:_.value,inst:$,continue:!v.abort})}}),K3=B("$ZodCheckStartsWith",($,v)=>{T$.init($,v);let U=new RegExp(`^${P4(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.startsWith(v.prefix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:Q.value,inst:$,continue:!v.abort})}}),H3=B("$ZodCheckEndsWith",($,v)=>{T$.init($,v);let U=new RegExp(`.*${P4(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.endsWith(v.suffix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:Q.value,inst:$,continue:!v.abort})}});W3=B("$ZodCheckProperty",($,v)=>{T$.init($,v),$._zod.check=(U)=>{let Q=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(Q instanceof Promise)return Q.then((_)=>Mz(_,U,v.property));Mz(Q,U,v.property);return}}),b3=B("$ZodCheckMimeType",($,v)=>{T$.init($,v);let U=new Set(v.mime);$._zod.onattach.push((Q)=>{Q._zod.bag.mime=v.mime}),$._zod.check=(Q)=>{if(U.has(Q.value.type))return;Q.issues.push({code:"invalid_value",values:v.mime,input:Q.value.type,inst:$,continue:!v.abort})}}),B3=B("$ZodCheckOverwrite",($,v)=>{T$.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}})});class A2{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)),_=U.map((J)=>J.slice(Q)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of _)this.content.push(J)}compile(){let $=Function,v=this?.args,Q=[...(this?.content??[""]).map((_)=>` ${_}`)];return new $(...v,Q.join(`
20
- `))}}var Z3;var D3=b(()=>{Z3={major:4,minor:3,patch:6}});function h3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function uz($){if(!V2.test($))return!1;let v=$.replace(/[-_]/g,(Q)=>Q==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return h3(U)}function yz($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[Q]=U;if(!Q)return!1;let _=JSON.parse(atob(Q));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(v&&(!("alg"in _)||_.alg!==v))return!1;return!0}catch{return!1}}function kz($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues));v.value[U]=$.value}function T2($,v,U,Q,_){if($.issues.length){if(_&&!(U in Q))return;v.issues.push(...L4(U,$.issues))}if($.value===void 0){if(U in Q)v.value[U]=void 0}else v.value[U]=$.value}function Cz($){let v=Object.keys($.shape);for(let Q of v)if(!$.shape?.[Q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Q}": expected a Zod schema`);let U=B9($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function fz($,v,U,Q,_,J){let Y=[],z=_.keySet,I=_.catchall._zod,X=I.def.type,q=I.optout==="optional";for(let G in v){if(z.has(G))continue;if(X==="never"){Y.push(G);continue}let j=I.run({value:v[G],issues:[]},Q);if(j instanceof Promise)$.push(j.then((H)=>T2(H,U,G,v,q)));else T2(j,U,G,v,q)}if(Y.length)U.issues.push({code:"unrecognized_keys",keys:Y,input:v,inst:J});if(!$.length)return U;return Promise.all($).then(()=>{return U})}function Az($,v,U,Q){for(let J of $)if(J.issues.length===0)return v.value=J.value,v;let _=$.filter((J)=>!x6(J));if(_.length===1)return v.value=_[0].value,_[0];return v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,d$())))}),v}function Oz($,v,U,Q){let _=$.filter((J)=>J.issues.length===0);if(_.length===1)return v.value=_[0].value,v;if(_.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,d$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:[],inclusive:!1});return v}function V3($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(P6($)&&P6(v)){let U=Object.keys(v),Q=Object.keys($).filter((J)=>U.indexOf(J)!==-1),_={...$,...v};for(let J of Q){let Y=V3($[J],v[J]);if(!Y.valid)return{valid:!1,mergeErrorPath:[J,...Y.mergeErrorPath]};_[J]=Y.data}return{valid:!0,data:_}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Q=0;Q<$.length;Q++){let _=$[Q],J=v[Q],Y=V3(_,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 Fz($,v,U){let Q=new Map,_;for(let z of v.issues)if(z.code==="unrecognized_keys"){_??(_=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&&_)$.issues.push({..._,keys:J});if(x6($))return $;let Y=V3(v.value,U.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}function O2($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues));v.value[U]=$.value}function Nz($,v,U,Q,_,J,Y){if($.issues.length)if(t0.has(typeof Q))U.issues.push(...L4(Q,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:_,inst:J,issues:$.issues.map((z)=>H4(z,Y,d$()))});if(v.issues.length)if(t0.has(typeof Q))U.issues.push(...L4(Q,v.issues));else U.issues.push({origin:"map",code:"invalid_element",input:_,inst:J,key:Q,issues:v.issues.map((z)=>H4(z,Y,d$()))});U.value.set($.value,v.value)}function Sz($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}function Tz($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}function Rz($,v){if($.value===void 0)$.value=v.defaultValue;return $}function Ez($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}function F2($,v,U){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},U)}function N2($,v,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let _=v.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>S2($,J,v.out,U));return S2($,_,v.out,U)}else{let _=v.reverseTransform($.value,$);if(_ instanceof Promise)return _.then((J)=>S2($,J,v.in,U));return S2($,_,v.in,U)}}function S2($,v,U,Q){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:v,issues:$.issues},Q)}function Pz($){return $.value=Object.freeze($.value),$}function xz($,v,U,Q){if(!$){let _={code:"custom",input:U,inst:Q,path:[...Q._zod.def.path??[]],continue:!Q._zod.def.abort};if(Q._zod.def.params)_.params=Q._zod.def.params;v.issues.push(h1(_))}}var e,_1,A$,M3,w3,L3,k3,A3,O3,F3,N3,S3,T3,R3,E3,P3,x3,u3,y3,C3,f3,m3,g3,c3,l3,d3,p3,i3,R2,n3,Jv,E2,r3,o3,t3,a3,s3,e3,$7,v7,_7,U7,mz,Q7,Yv,J7,Y7,z7,P2,I7,X7,q7,G7,j7,K7,H7,x2,W7,b7,B7,Z7,D7,V7,M7,w7,L7,zv,k7,A7,O7,F7,N7,S7;var T7=b(()=>{k2();f1();A9();M2();l();D3();l();e=B("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=Z3;let Q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Q.unshift($);for(let _ of Q)for(let J of _._zod.onattach)J($);if(Q.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(Y,z,I)=>{let X=x6(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 U6;if(q||H instanceof Promise)q=(q??Promise.resolve()).then(async()=>{if(await H,Y.issues.length===j)return;if(!X)X=x6(Y,j)});else{if(Y.issues.length===j)continue;if(!X)X=x6(Y,j)}}if(q)return q.then(()=>{return Y});return Y},J=(Y,z,I)=>{if(x6(Y))return Y.aborted=!0,Y;let X=_(z,Q,I);if(X instanceof Promise){if(I.async===!1)throw new U6;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 U6;return I.then((X)=>_(X,Q,z))}return _(I,Q,z)}}Y$($,"~standard",()=>({validate:(_)=>{try{let J=L9($,_);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return k9($,_).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}))}),_1=B("$ZodString",($,v)=>{e.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??i9($._zod.bag),$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=String(U.value)}catch(_){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),A$=B("$ZodStringFormat",($,v)=>{i1.init($,v),_1.init($,v)}),M3=B("$ZodGUID",($,v)=>{v.pattern??(v.pattern=P9),A$.init($,v)}),w3=B("$ZodUUID",($,v)=>{if(v.version){let Q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(Q===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=v1(Q))}else v.pattern??(v.pattern=v1());A$.init($,v)}),L3=B("$ZodEmail",($,v)=>{v.pattern??(v.pattern=x9),A$.init($,v)}),k3=B("$ZodURL",($,v)=>{A$.init($,v),$._zod.check=(U)=>{try{let Q=U.value.trim(),_=new URL(Q);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(_.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=_.href;else U.value=Q;return}catch(Q){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),A3=B("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=u9()),A$.init($,v)}),O3=B("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=R9),A$.init($,v)}),F3=B("$ZodCUID",($,v)=>{v.pattern??(v.pattern=O9),A$.init($,v)}),N3=B("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=F9),A$.init($,v)}),S3=B("$ZodULID",($,v)=>{v.pattern??(v.pattern=N9),A$.init($,v)}),T3=B("$ZodXID",($,v)=>{v.pattern??(v.pattern=S9),A$.init($,v)}),R3=B("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=T9),A$.init($,v)}),E3=B("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=p9(v)),A$.init($,v)}),P3=B("$ZodISODate",($,v)=>{v.pattern??(v.pattern=l9),A$.init($,v)}),x3=B("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=d9(v)),A$.init($,v)}),u3=B("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=E9),A$.init($,v)}),y3=B("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=y9),A$.init($,v),$._zod.bag.format="ipv4"}),C3=B("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=C9),A$.init($,v),$._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:!v.abort})}}}),f3=B("$ZodMAC",($,v)=>{v.pattern??(v.pattern=f9(v.delimiter)),A$.init($,v),$._zod.bag.format="mac"}),m3=B("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=m9),A$.init($,v)}),g3=B("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=g9),A$.init($,v),$._zod.check=(U)=>{let Q=U.value.split("/");try{if(Q.length!==2)throw Error();let[_,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://[${_}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});c3=B("$ZodBase64",($,v)=>{v.pattern??(v.pattern=h9),A$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(h3(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});l3=B("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=V2),A$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(uz(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),d3=B("$ZodE164",($,v)=>{v.pattern??(v.pattern=c9),A$.init($,v)});p3=B("$ZodJWT",($,v)=>{A$.init($,v),$._zod.check=(U)=>{if(yz(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),i3=B("$ZodCustomStringFormat",($,v)=>{A$.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),R2=B("$ZodNumber",($,v)=>{e.init($,v),$._zod.pattern=$._zod.bag.pattern??_v,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=Number(U.value)}catch(Y){}let _=U.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return U;let J=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:_,inst:$,...J?{received:J}:{}}),U}}),n3=B("$ZodNumberFormat",($,v)=>{v3.init($,v),R2.init($,v)}),Jv=B("$ZodBoolean",($,v)=>{e.init($,v),$._zod.pattern=o9,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(J){}let _=U.value;if(typeof _==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:$}),U}}),E2=B("$ZodBigInt",($,v)=>{e.init($,v),$._zod.pattern=n9,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(_){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),r3=B("$ZodBigIntFormat",($,v)=>{_3.init($,v),E2.init($,v)}),o3=B("$ZodSymbol",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:_,inst:$}),U}}),t3=B("$ZodUndefined",($,v)=>{e.init($,v),$._zod.pattern=a9,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:_,inst:$}),U}}),a3=B("$ZodNull",($,v)=>{e.init($,v),$._zod.pattern=t9,$._zod.values=new Set([null]),$._zod.parse=(U,Q)=>{let _=U.value;if(_===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:_,inst:$}),U}}),s3=B("$ZodAny",($,v)=>{e.init($,v),$._zod.parse=(U)=>U}),e3=B("$ZodUnknown",($,v)=>{e.init($,v),$._zod.parse=(U)=>U}),$7=B("$ZodNever",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),v7=B("$ZodVoid",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:_,inst:$}),U}}),_7=B("$ZodDate",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(z){}let _=U.value,J=_ instanceof Date;if(J&&!Number.isNaN(_.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:_,...J?{received:"Invalid Date"}:{},inst:$}),U}});U7=B("$ZodArray",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(!Array.isArray(_))return U.issues.push({expected:"array",code:"invalid_type",input:_,inst:$}),U;U.value=Array(_.length);let J=[];for(let Y=0;Y<_.length;Y++){let z=_[Y],I=v.element._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)J.push(I.then((X)=>kz(X,U,Y)));else kz(I,U,Y)}if(J.length)return Promise.all(J).then(()=>U);return U}});mz=B("$ZodObject",($,v)=>{if(e.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let z=v.shape;Object.defineProperty(v,"shape",{get:()=>{let I={...z};return Object.defineProperty(v,"shape",{value:I}),I}})}let Q=g1(()=>Cz(v));Y$($._zod,"propValues",()=>{let z=v.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 _=$1,J=v.catchall,Y;$._zod.parse=(z,I)=>{Y??(Y=Q.value);let X=z.value;if(!_(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",D=H._zod.run({value:X[j],issues:[]},I);if(D instanceof Promise)q.push(D.then((E)=>T2(E,z,j,X,Z)));else T2(D,z,j,X,Z)}if(!J)return q.length?Promise.all(q).then(()=>z):z;return fz(q,X,z,I,Q.value,$)}}),Q7=B("$ZodObjectJIT",($,v)=>{mz.init($,v);let U=$._zod.parse,Q=g1(()=>Cz(v)),_=(j)=>{let H=new A2(["shape","payload","ctx"]),Z=Q.value,D=(O)=>{let g=I2(O);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};H.write("const input = payload.value;");let E=Object.create(null),A=0;for(let O of Z.keys)E[O]=`key_${A++}`;H.write("const newResult = {};");for(let O of Z.keys){let g=E[O],w=I2(O),L=j[O]?._zod?.optout==="optional";if(H.write(`const ${g} = ${D(O)};`),L)H.write(`
21
- if (${g}.issues.length) {
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) {
22
21
  if (${w} in input) {
23
- payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
22
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
24
23
  ...iss,
25
24
  path: iss.path ? [${w}, ...iss.path] : [${w}]
26
25
  })));
27
26
  }
28
27
  }
29
28
 
30
- if (${g}.value === undefined) {
29
+ if (${x}.value === undefined) {
31
30
  if (${w} in input) {
32
31
  newResult[${w}] = undefined;
33
32
  }
34
33
  } else {
35
- newResult[${w}] = ${g}.value;
34
+ newResult[${w}] = ${x}.value;
36
35
  }
37
36
 
38
- `);else H.write(`
39
- if (${g}.issues.length) {
40
- payload.issues = payload.issues.concat(${g}.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
41
  path: iss.path ? [${w}, ...iss.path] : [${w}]
43
42
  })));
44
43
  }
45
44
 
46
- if (${g}.value === undefined) {
45
+ if (${x}.value === undefined) {
47
46
  if (${w} in input) {
48
47
  newResult[${w}] = undefined;
49
48
  }
50
49
  } else {
51
- newResult[${w}] = ${g}.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(O,g)=>r(j,O,g)},J,Y=$1,z=!i0.jitless,X=z&&H9.value,q=v.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 fz([],Z,j,H,G,$)}return U(j,H)}});Yv=B("$ZodUnion",($,v)=>{e.init($,v),Y$($._zod,"optin",()=>v.options.some((_)=>_._zod.optin==="optional")?"optional":void 0),Y$($._zod,"optout",()=>v.options.some((_)=>_._zod.optout==="optional")?"optional":void 0),Y$($._zod,"values",()=>{if(v.options.every((_)=>_._zod.values))return new Set(v.options.flatMap((_)=>Array.from(_._zod.values)));return}),Y$($._zod,"pattern",()=>{if(v.options.every((_)=>_._zod.pattern)){let _=v.options.map((J)=>J._zod.pattern);return new RegExp(`^(${_.map((J)=>o0(J.source)).join("|")})$`)}return});let U=v.options.length===1,Q=v.options[0]._zod.run;$._zod.parse=(_,J)=>{if(U)return Q(_,J);let Y=!1,z=[];for(let I of v.options){let X=I._zod.run({value:_.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 Az(z,_,$,J);return Promise.all(z).then((I)=>{return Az(I,_,$,J)})}});J7=B("$ZodXor",($,v)=>{Yv.init($,v),v.inclusive=!1;let U=v.options.length===1,Q=v.options[0]._zod.run;$._zod.parse=(_,J)=>{if(U)return Q(_,J);let Y=!1,z=[];for(let I of v.options){let X=I._zod.run({value:_.value,issues:[]},J);if(X instanceof Promise)z.push(X),Y=!0;else z.push(X)}if(!Y)return Oz(z,_,$,J);return Promise.all(z).then((I)=>{return Oz(I,_,$,J)})}}),Y7=B("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,Yv.init($,v);let U=$._zod.parse;Y$($._zod,"propValues",()=>{let _={};for(let J of v.options){let Y=J._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(J)}"`);for(let[z,I]of Object.entries(Y)){if(!_[z])_[z]=new Set;for(let X of I)_[z].add(X)}}return _});let Q=g1(()=>{let _=v.options,J=new Map;for(let Y of _){let z=Y._zod.propValues?.[v.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${v.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=(_,J)=>{let Y=_.value;if(!$1(Y))return _.issues.push({code:"invalid_type",expected:"object",input:Y,inst:$}),_;let z=Q.value.get(Y?.[v.discriminator]);if(z)return z._zod.run(_,J);if(v.unionFallback)return U(_,J);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:Y,path:[v.discriminator],inst:$}),_}}),z7=B("$ZodIntersection",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value,J=v.left._zod.run({value:_,issues:[]},Q),Y=v.right._zod.run({value:_,issues:[]},Q);if(J instanceof Promise||Y instanceof Promise)return Promise.all([J,Y]).then(([I,X])=>{return Fz(U,I,X)});return Fz(U,J,Y)}});P2=B("$ZodTuple",($,v)=>{e.init($,v);let U=v.items;$._zod.parse=(Q,_)=>{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(!v.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:[]},_);if(G instanceof Promise)Y.push(G.then((j)=>O2(j,Q,X)));else O2(G,Q,X)}if(v.rest){let q=J.slice(U.length);for(let G of q){X++;let j=v.rest._zod.run({value:G,issues:[]},_);if(j instanceof Promise)Y.push(j.then((H)=>O2(H,Q,X)));else O2(j,Q,X)}}if(Y.length)return Promise.all(Y).then(()=>Q);return Q}});I7=B("$ZodRecord",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(!P6(_))return U.issues.push({expected:"record",code:"invalid_type",input:_,inst:$}),U;let J=[],Y=v.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=v.valueType._zod.run({value:_[X],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...L4(X,G.issues));U.value[X]=G.value}));else{if(q.issues.length)U.issues.push(...L4(X,q.issues));U.value[X]=q.value}}let I;for(let X in _)if(!z.has(X))I=I??[],I.push(X);if(I&&I.length>0)U.issues.push({code:"unrecognized_keys",input:_,inst:$,keys:I})}else{U.value={};for(let z of Reflect.ownKeys(_)){if(z==="__proto__")continue;let I=v.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=v.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(v.mode==="loose")U.value[z]=_[z];else U.issues.push({code:"invalid_key",origin:"record",issues:I.issues.map((G)=>H4(G,Q,d$())),input:z,path:[z],inst:$});continue}let q=v.valueType._zod.run({value:_[z],issues:[]},Q);if(q instanceof Promise)J.push(q.then((G)=>{if(G.issues.length)U.issues.push(...L4(z,G.issues));U.value[I.value]=G.value}));else{if(q.issues.length)U.issues.push(...L4(z,q.issues));U.value[I.value]=q.value}}}if(J.length)return Promise.all(J).then(()=>U);return U}}),X7=B("$ZodMap",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(!(_ instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:_,inst:$}),U;let J=[];U.value=new Map;for(let[Y,z]of _){let I=v.keyType._zod.run({value:Y,issues:[]},Q),X=v.valueType._zod.run({value:z,issues:[]},Q);if(I instanceof Promise||X instanceof Promise)J.push(Promise.all([I,X]).then(([q,G])=>{Nz(q,G,U,Y,_,$,Q)}));else Nz(I,X,U,Y,_,$,Q)}if(J.length)return Promise.all(J).then(()=>U);return U}});q7=B("$ZodSet",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(!(_ instanceof Set))return U.issues.push({input:_,inst:$,expected:"set",code:"invalid_type"}),U;let J=[];U.value=new Set;for(let Y of _){let z=v.valueType._zod.run({value:Y,issues:[]},Q);if(z instanceof Promise)J.push(z.then((I)=>Sz(I,U)));else Sz(z,U)}if(J.length)return Promise.all(J).then(()=>U);return U}});G7=B("$ZodEnum",($,v)=>{e.init($,v);let U=r0(v.entries),Q=new Set(U);$._zod.values=Q,$._zod.pattern=new RegExp(`^(${U.filter((_)=>t0.has(typeof _)).map((_)=>typeof _==="string"?P4(_):_.toString()).join("|")})$`),$._zod.parse=(_,J)=>{let Y=_.value;if(Q.has(Y))return _;return _.issues.push({code:"invalid_value",values:U,input:Y,inst:$}),_}}),j7=B("$ZodLiteral",($,v)=>{if(e.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(v.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${v.values.map((Q)=>typeof Q==="string"?P4(Q):Q?P4(Q.toString()):String(Q)).join("|")})$`),$._zod.parse=(Q,_)=>{let J=Q.value;if(U.has(J))return Q;return Q.issues.push({code:"invalid_value",values:v.values,input:J,inst:$}),Q}}),K7=B("$ZodFile",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(_ instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:_,inst:$}),U}}),H7=B("$ZodTransform",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new e6($.constructor.name);let _=v.transform(U.value,U);if(Q.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((Y)=>{return U.value=Y,U});if(_ instanceof Promise)throw new U6;return U.value=_,U}});x2=B("$ZodOptional",($,v)=>{e.init($,v),$._zod.optin="optional",$._zod.optout="optional",Y$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),Y$($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)})?$`):void 0}),$._zod.parse=(U,Q)=>{if(v.innerType._zod.optin==="optional"){let _=v.innerType._zod.run(U,Q);if(_ instanceof Promise)return _.then((J)=>Tz(J,U.value));return Tz(_,U.value)}if(U.value===void 0)return U;return v.innerType._zod.run(U,Q)}}),W7=B("$ZodExactOptional",($,v)=>{x2.init($,v),Y$($._zod,"values",()=>v.innerType._zod.values),Y$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(U,Q)=>{return v.innerType._zod.run(U,Q)}}),b7=B("$ZodNullable",($,v)=>{e.init($,v),Y$($._zod,"optin",()=>v.innerType._zod.optin),Y$($._zod,"optout",()=>v.innerType._zod.optout),Y$($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${o0(U.source)}|null)$`):void 0}),Y$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(U,Q)=>{if(U.value===null)return U;return v.innerType._zod.run(U,Q)}}),B7=B("$ZodDefault",($,v)=>{e.init($,v),$._zod.optin="optional",Y$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return v.innerType._zod.run(U,Q);if(U.value===void 0)return U.value=v.defaultValue,U;let _=v.innerType._zod.run(U,Q);if(_ instanceof Promise)return _.then((J)=>Rz(J,v));return Rz(_,v)}});Z7=B("$ZodPrefault",($,v)=>{e.init($,v),$._zod.optin="optional",Y$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return v.innerType._zod.run(U,Q);if(U.value===void 0)U.value=v.defaultValue;return v.innerType._zod.run(U,Q)}}),D7=B("$ZodNonOptional",($,v)=>{e.init($,v),Y$($._zod,"values",()=>{let U=v.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(_ instanceof Promise)return _.then((J)=>Ez(J,$));return Ez(_,$)}});V7=B("$ZodSuccess",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new e6("ZodSuccess");let _=v.innerType._zod.run(U,Q);if(_ instanceof Promise)return _.then((J)=>{return U.value=J.issues.length===0,U});return U.value=_.issues.length===0,U}}),M7=B("$ZodCatch",($,v)=>{e.init($,v),Y$($._zod,"optin",()=>v.innerType._zod.optin),Y$($._zod,"optout",()=>v.innerType._zod.optout),Y$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return v.innerType._zod.run(U,Q);let _=v.innerType._zod.run(U,Q);if(_ instanceof Promise)return _.then((J)=>{if(U.value=J.value,J.issues.length)U.value=v.catchValue({...U,error:{issues:J.issues.map((Y)=>H4(Y,Q,d$()))},input:U.value}),U.issues=[];return U});if(U.value=_.value,_.issues.length)U.value=v.catchValue({...U,error:{issues:_.issues.map((J)=>H4(J,Q,d$()))},input:U.value}),U.issues=[];return U}}),w7=B("$ZodNaN",($,v)=>{e.init($,v),$._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}}),L7=B("$ZodPipe",($,v)=>{e.init($,v),Y$($._zod,"values",()=>v.in._zod.values),Y$($._zod,"optin",()=>v.in._zod.optin),Y$($._zod,"optout",()=>v.out._zod.optout),Y$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,Q)=>{if(Q.direction==="backward"){let J=v.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>F2(Y,v.in,Q));return F2(J,v.in,Q)}let _=v.in._zod.run(U,Q);if(_ instanceof Promise)return _.then((J)=>F2(J,v.out,Q));return F2(_,v.out,Q)}});zv=B("$ZodCodec",($,v)=>{e.init($,v),Y$($._zod,"values",()=>v.in._zod.values),Y$($._zod,"optin",()=>v.in._zod.optin),Y$($._zod,"optout",()=>v.out._zod.optout),Y$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,Q)=>{if((Q.direction||"forward")==="forward"){let J=v.in._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>N2(Y,v,Q));return N2(J,v,Q)}else{let J=v.out._zod.run(U,Q);if(J instanceof Promise)return J.then((Y)=>N2(Y,v,Q));return N2(J,v,Q)}}});k7=B("$ZodReadonly",($,v)=>{e.init($,v),Y$($._zod,"propValues",()=>v.innerType._zod.propValues),Y$($._zod,"values",()=>v.innerType._zod.values),Y$($._zod,"optin",()=>v.innerType?._zod?.optin),Y$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")return v.innerType._zod.run(U,Q);let _=v.innerType._zod.run(U,Q);if(_ instanceof Promise)return _.then(Pz);return Pz(_)}});A7=B("$ZodTemplateLiteral",($,v)=>{e.init($,v);let U=[];for(let Q of v.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 _=Q._zod.pattern instanceof RegExp?Q._zod.pattern.source:Q._zod.pattern;if(!_)throw Error(`Invalid template literal part: ${Q._zod.traits}`);let J=_.startsWith("^")?1:0,Y=_.endsWith("$")?_.length-1:_.length;U.push(_.slice(J,Y))}else if(Q===null||b9.has(typeof Q))U.push(P4(`${Q}`));else throw Error(`Invalid template literal part: ${Q}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(Q,_)=>{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:v.format??"template_literal",pattern:$._zod.pattern.source}),Q;return Q}}),O7=B("$ZodFunction",($,v)=>{return e.init($,v),$._def=v,$._zod.def=v,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...Q){let _=$._def.input?q2($._def.input,Q):Q,J=Reflect.apply(U,this,_);if($._def.output)return q2($._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 _=$._def.input?await G2($._def.input,Q):Q,J=await Reflect.apply(U,this,_);if($._def.output)return await G2($._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 P2({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})},$}),F7=B("$ZodPromise",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{return Promise.resolve(U.value).then((_)=>v.innerType._zod.run({value:_,issues:[]},Q))}}),N7=B("$ZodLazy",($,v)=>{e.init($,v),Y$($._zod,"innerType",()=>v.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)}}),S7=B("$ZodCustom",($,v)=>{T$.init($,v),e.init($,v),$._zod.parse=(U,Q)=>{return U},$._zod.check=(U)=>{let Q=U.value,_=v.fn(Q);if(_ instanceof Promise)return _.then((J)=>xz(J,U,Q,$));xz(_,U,Q,$);return}})});function R7(){return{localeError:KB()}}var KB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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: ${V(_.values,"|")}`;case"too_big":{let J=_.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 ${_.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${_.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 ${_.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${J} ${_.maximum.toString()}`}case"too_small":{let J=_.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 ${_.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${_.minimum.toString()} ${Y.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${_.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${J} ${_.minimum.toString()}`}case"invalid_format":{let J=_;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 "${_.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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${_.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${_.keys.length>1?"\u0629":""}: ${V(_.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${_.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 ${_.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};var gz=b(()=>{l()});function E7(){return{localeError:HB()}}var HB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${_.expected}, daxil olan ${z}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J}, daxil olan ${z}`}case"invalid_value":if(_.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${S(_.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${_.origin??"d\u0259y\u0259r"} ${J}${_.maximum.toString()} ${Y.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${_.origin??"d\u0259y\u0259r"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${_.origin} ${J}${_.minimum.toString()} ${Y.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${_.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${_.keys.length>1?"lar":""}: ${V(_.keys,", ")}`;case"invalid_key":return`${_.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${_.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};var hz=b(()=>{l()});function cz($,v,U,Q){let _=Math.abs($),J=_%10,Y=_%100;if(Y>=11&&Y<=19)return Q;if(J===1)return v;if(J>=2&&J<=4)return U;return Q}function P7(){return{localeError:WB()}}var WB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y){let z=Number(_.maximum),I=cz(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 ${_.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${_.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 ${_.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y){let z=Number(_.minimum),I=cz(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 ${_.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${Y.verb} ${J}${_.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 ${_.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${_.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${V(_.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${_.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 ${_.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};var lz=b(()=>{l()});function x7(){return{localeError:bB()}}var bB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${_.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(_.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.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 ${_.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${_.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 ${_.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.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 ${_.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${J}${_.minimum.toString()} ${Y.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${_.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${_.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${_.keys.length>1?"\u043E\u0432\u0435":""}: ${V(_.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${_.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 ${_.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};var dz=b(()=>{l()});function u7(){return{localeError:BB()}}var BB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${_.expected}, s'ha rebut ${z}`;return`Tipus inv\xE0lid: s'esperava ${J}, s'ha rebut ${z}`}case"invalid_value":if(_.values.length===1)return`Valor inv\xE0lid: s'esperava ${S(_.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${V(_.values," o ")}`;case"too_big":{let J=_.inclusive?"com a m\xE0xim":"menys de",Y=v(_.origin);if(Y)return`Massa gran: s'esperava que ${_.origin??"el valor"} contingu\xE9s ${J} ${_.maximum.toString()} ${Y.unit??"elements"}`;return`Massa gran: s'esperava que ${_.origin??"el valor"} fos ${J} ${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?"com a m\xEDnim":"m\xE9s de",Y=v(_.origin);if(Y)return`Massa petit: s'esperava que ${_.origin} contingu\xE9s ${J} ${_.minimum.toString()} ${Y.unit}`;return`Massa petit: s'esperava que ${_.origin} fos ${J} ${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${_.divisor}`;case"unrecognized_keys":return`Clau${_.keys.length>1?"s":""} no reconeguda${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${_.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${_.origin}`;default:return"Entrada inv\xE0lida"}}};var pz=b(()=>{l()});function y7(){return{localeError:ZB()}}var ZB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${_.expected}, obdr\u017Eeno ${z}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J}, obdr\u017Eeno ${z}`}case"invalid_value":if(_.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${S(_.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${_.origin??"hodnota"} mus\xED m\xEDt ${J}${_.maximum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${_.origin??"hodnota"} mus\xED b\xFDt ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${_.origin??"hodnota"} mus\xED m\xEDt ${J}${_.minimum.toString()} ${Y.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${_.origin??"hodnota"} mus\xED b\xFDt ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${_.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${V(_.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${_.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${_.origin}`;default:return"Neplatn\xFD vstup"}}};var iz=b(()=>{l()});function C7(){return{localeError:DB()}}var DB=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ugyldigt input: forventede instanceof ${_.expected}, fik ${z}`;return`Ugyldigt input: forventede ${J}, fik ${z}`}case"invalid_value":if(_.values.length===1)return`Ugyldig v\xE6rdi: forventede ${S(_.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin),z=Q[_.origin]??_.origin;if(Y)return`For stor: forventede ${z??"value"} ${Y.verb} ${J} ${_.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor: forventede ${z??"value"} havde ${J} ${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin),z=Q[_.origin]??_.origin;if(Y)return`For lille: forventede ${z} ${Y.verb} ${J} ${_.minimum.toString()} ${Y.unit}`;return`For lille: forventede ${z} havde ${J} ${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${V(_.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${_.origin}`;default:return"Ugyldigt input"}}};var nz=b(()=>{l()});function f7(){return{localeError:VB()}}var VB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${_.expected}, erhalten ${z}`;return`Ung\xFCltige Eingabe: erwartet ${J}, erhalten ${z}`}case"invalid_value":if(_.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${S(_.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Zu gro\xDF: erwartet, dass ${_.origin??"Wert"} ${J}${_.maximum.toString()} ${Y.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${_.origin??"Wert"} ${J}${_.maximum.toString()} ist`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Zu klein: erwartet, dass ${_.origin} ${J}${_.minimum.toString()} ${Y.unit} hat`;return`Zu klein: erwartet, dass ${_.origin} ${J}${_.minimum.toString()} ist`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${_.divisor} sein`;case"unrecognized_keys":return`${_.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${V(_.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${_.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${_.origin}`;default:return"Ung\xFCltige Eingabe"}}};var rz=b(()=>{l()});function Iv(){return{localeError:MB()}}var MB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;return`Invalid input: expected ${J}, received ${z}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${S(_.values[0])}`;return`Invalid option: expected one of ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Too big: expected ${_.origin??"value"} to have ${J}${_.maximum.toString()} ${Y.unit??"elements"}`;return`Too big: expected ${_.origin??"value"} to be ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Too small: expected ${_.origin} to have ${J}${_.minimum.toString()} ${Y.unit}`;return`Too small: expected ${_.origin} to be ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${_.divisor}`;case"unrecognized_keys":return`Unrecognized key${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Invalid key in ${_.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${_.origin}`;default:return"Invalid input"}}};var m7=b(()=>{l()});function g7(){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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${_.expected}, ricevi\u011Dis ${z}`;return`Nevalida enigo: atendi\u011Dis ${J}, ricevi\u011Dis ${z}`}case"invalid_value":if(_.values.length===1)return`Nevalida enigo: atendi\u011Dis ${S(_.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Tro granda: atendi\u011Dis ke ${_.origin??"valoro"} havu ${J}${_.maximum.toString()} ${Y.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${_.origin??"valoro"} havu ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Tro malgranda: atendi\u011Dis ke ${_.origin} havu ${J}${_.minimum.toString()} ${Y.unit}`;return`Tro malgranda: atendi\u011Dis ke ${_.origin} estu ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${_.divisor}`;case"unrecognized_keys":return`Nekonata${_.keys.length>1?"j":""} \u015Dlosilo${_.keys.length>1?"j":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${_.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${_.origin}`;default:return"Nevalida enigo"}}};var oz=b(()=>{l()});function h7(){return{localeError:LB()}}var LB=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${_.expected}, recibido ${z}`;return`Entrada inv\xE1lida: se esperaba ${J}, recibido ${z}`}case"invalid_value":if(_.values.length===1)return`Entrada inv\xE1lida: se esperaba ${S(_.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin),z=Q[_.origin]??_.origin;if(Y)return`Demasiado grande: se esperaba que ${z??"valor"} tuviera ${J}${_.maximum.toString()} ${Y.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${z??"valor"} fuera ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin),z=Q[_.origin]??_.origin;if(Y)return`Demasiado peque\xF1o: se esperaba que ${z} tuviera ${J}${_.minimum.toString()} ${Y.unit}`;return`Demasiado peque\xF1o: se esperaba que ${z} fuera ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${Q[_.origin]??_.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${Q[_.origin]??_.origin}`;default:return"Entrada inv\xE1lida"}}};var tz=b(()=>{l()});function c7(){return{localeError:kB()}}var kB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${_.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(_.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${S(_.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 ${V(_.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${_.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${_.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${_.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${J}${_.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${_.origin} \u0628\u0627\u06CC\u062F ${J}${_.minimum.toString()} ${Y.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${_.origin} \u0628\u0627\u06CC\u062F ${J}${_.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${_.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${V(_.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${_.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 ${_.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};var az=b(()=>{l()});function l7(){return{localeError:AB()}}var AB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Virheellinen tyyppi: odotettiin instanceof ${_.expected}, oli ${z}`;return`Virheellinen tyyppi: odotettiin ${J}, oli ${z}`}case"invalid_value":if(_.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${S(_.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Liian suuri: ${Y.subject} t\xE4ytyy olla ${J}${_.maximum.toString()} ${Y.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Liian pieni: ${Y.subject} t\xE4ytyy olla ${J}${_.minimum.toString()} ${Y.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${_.divisor} monikerta`;case"unrecognized_keys":return`${_.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${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 sz=b(()=>{l()});function d7(){return{localeError:OB()}}var OB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Entr\xE9e invalide : instanceof ${_.expected} attendu, ${z} re\xE7u`;return`Entr\xE9e invalide : ${J} attendu, ${z} re\xE7u`}case"invalid_value":if(_.values.length===1)return`Entr\xE9e invalide : ${S(_.values[0])} attendu`;return`Option invalide : une valeur parmi ${V(_.values,"|")} attendue`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Trop grand : ${_.origin??"valeur"} doit ${Y.verb} ${J}${_.maximum.toString()} ${Y.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${_.origin??"valeur"} doit \xEAtre ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Trop petit : ${_.origin} doit ${Y.verb} ${J}${_.minimum.toString()} ${Y.unit}`;return`Trop petit : ${_.origin} doit \xEAtre ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${_.divisor}`;case"unrecognized_keys":return`Cl\xE9${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${V(_.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${_.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entr\xE9e invalide"}}};var ez=b(()=>{l()});function p7(){return{localeError:FB()}}var FB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Entr\xE9e invalide : attendu instanceof ${_.expected}, re\xE7u ${z}`;return`Entr\xE9e invalide : attendu ${J}, re\xE7u ${z}`}case"invalid_value":if(_.values.length===1)return`Entr\xE9e invalide : attendu ${S(_.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"\u2264":"<",Y=v(_.origin);if(Y)return`Trop grand : attendu que ${_.origin??"la valeur"} ait ${J}${_.maximum.toString()} ${Y.unit}`;return`Trop grand : attendu que ${_.origin??"la valeur"} soit ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?"\u2265":">",Y=v(_.origin);if(Y)return`Trop petit : attendu que ${_.origin} ait ${J}${_.minimum.toString()} ${Y.unit}`;return`Trop petit : attendu que ${_.origin} soit ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${_.divisor}`;case"unrecognized_keys":return`Cl\xE9${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${V(_.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${_.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entr\xE9e invalide"}}};var $I=b(()=>{l()});function i7(){return{localeError:NB()}}var NB=()=>{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"}},v={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},_=(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 v[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=T(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 ${S(X.values[0])}`;let q=X.values.map((H)=>S(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=_(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",D=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 ${D}`.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=_(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 E=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 ${E}`}let D=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 ${D}`.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"}: ${V(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${_(X.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};var vI=b(()=>{l()});function n7(){return{localeError:SB()}}var SB=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${_.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(_.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${S(_.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`T\xFAl nagy: ${_.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${J}${_.maximum.toString()} ${Y.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${_.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${_.origin} m\xE9rete t\xFAl kicsi ${J}${_.minimum.toString()} ${Y.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${_.origin} t\xFAl kicsi ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${_.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${_.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${_.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};var _I=b(()=>{l()});function UI($,v,U){return Math.abs($)===1?v:U}function n1($){if(!$)return"";let v=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],U=$[$.length-1];return $+(v.includes(U)?"\u0576":"\u0568")}function r7(){return{localeError:TB()}}var TB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y){let z=Number(_.maximum),I=UI(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(_.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${_.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(_.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y){let z=Number(_.minimum),I=UI(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(_.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${J}${_.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(_.origin)} \u056C\u056B\u0576\u056B ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${_.keys.length>1?"\u0576\u0565\u0580":""}. ${V(_.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${n1(_.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(_.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};var QI=b(()=>{l()});function o7(){return{localeError:RB()}}var RB=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Input tidak valid: diharapkan instanceof ${_.expected}, diterima ${z}`;return`Input tidak valid: diharapkan ${J}, diterima ${z}`}case"invalid_value":if(_.values.length===1)return`Input tidak valid: diharapkan ${S(_.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Terlalu besar: diharapkan ${_.origin??"value"} memiliki ${J}${_.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: diharapkan ${_.origin??"value"} menjadi ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Terlalu kecil: diharapkan ${_.origin} memiliki ${J}${_.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: diharapkan ${_.origin} menjadi ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${_.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${_.origin}`;default:return"Input tidak valid"}}};var JI=b(()=>{l()});function t7(){return{localeError:EB()}}var EB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera instanceof ${_.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${z} \xFEar sem \xE1 a\xF0 vera ${J}`}case"invalid_value":if(_.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${S(_.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${_.origin??"gildi"} hafi ${J}${_.maximum.toString()} ${Y.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${_.origin??"gildi"} s\xE9 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${_.origin} hafi ${J}${_.minimum.toString()} ${Y.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${_.origin} s\xE9 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${_.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${_.keys.length>1?"ir lyklar":"ur lykill"}: ${V(_.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${_.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${_.origin}`;default:return"Rangt gildi"}}};var YI=b(()=>{l()});function a7(){return{localeError:PB()}}var PB=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Input non valido: atteso instanceof ${_.expected}, ricevuto ${z}`;return`Input non valido: atteso ${J}, ricevuto ${z}`}case"invalid_value":if(_.values.length===1)return`Input non valido: atteso ${S(_.values[0])}`;return`Opzione non valida: atteso uno tra ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Troppo grande: ${_.origin??"valore"} deve avere ${J}${_.maximum.toString()} ${Y.unit??"elementi"}`;return`Troppo grande: ${_.origin??"valore"} deve essere ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Troppo piccolo: ${_.origin} deve avere ${J}${_.minimum.toString()} ${Y.unit}`;return`Troppo piccolo: ${_.origin} deve essere ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${_.divisor}`;case"unrecognized_keys":return`Chiav${_.keys.length>1?"i":"e"} non riconosciut${_.keys.length>1?"e":"a"}: ${V(_.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${_.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${_.origin}`;default:return"Input non valido"}}};var zI=b(()=>{l()});function s7(){return{localeError:xB()}}var xB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${_.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(_.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${S(_.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${V(_.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let J=_.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",Y=v(_.origin);if(Y)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${_.origin??"\u5024"}\u306F${_.maximum.toString()}${Y.unit??"\u8981\u7D20"}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${_.origin??"\u5024"}\u306F${_.maximum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let J=_.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",Y=v(_.origin);if(Y)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${_.origin}\u306F${_.minimum.toString()}${Y.unit}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${_.origin}\u306F${_.minimum.toString()}${J}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${_.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${_.keys.length>1?"\u7FA4":""}: ${V(_.keys,"\u3001")}`;case"invalid_key":return`${_.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${_.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};var II=b(()=>{l()});function e7(){return{localeError:uB()}}var uB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let J=_.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 ${_.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${Y.verb} ${J}${_.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 ${_.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.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 ${_.origin} ${Y.verb} ${J}${_.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 ${_.origin} \u10D8\u10E7\u10DD\u10E1 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.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${_.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${V(_.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${_.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 ${_.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};var XI=b(()=>{l()});function Xv(){return{localeError:yB()}}var yB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${_.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${_.maximum.toString()} ${Y.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${_.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${J} ${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${_.origin} ${J} ${_.minimum.toString()} ${Y.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${_.origin} ${J} ${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${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 ${_.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 ${_.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 $5=b(()=>{l()});function v5(){return Xv()}var qI=b(()=>{$5()});function _5(){return{localeError:CB()}}var CB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${_.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(_.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${S(_.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${V(_.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let J=_.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`${_.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${_.maximum.toString()}${I} ${J}${Y}`;return`${_.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${_.maximum.toString()} ${J}${Y}`}case"too_small":{let J=_.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`${_.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${_.minimum.toString()}${I} ${J}${Y}`;return`${_.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${_.minimum.toString()} ${J}${Y}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${_.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${V(_.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${_.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${_.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};var GI=b(()=>{l()});function jI($){let v=Math.abs($),U=v%10,Q=v%100;if(Q>=11&&Q<=19||U===0)return"many";if(U===1)return"one";return"few"}function U5(){return{localeError:fB()}}var qv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)},fB=()=>{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=$[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Gautas tipas ${z}, o tik\u0117tasi - instanceof ${_.expected}`;return`Gautas tipas ${z}, o tik\u0117tasi - ${J}`}case"invalid_value":if(_.values.length===1)return`Privalo b\u016Bti ${S(_.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${V(_.values,"|")} pasirinkim\u0173`;case"too_big":{let J=Q[_.origin]??_.origin,Y=v(_.origin,jI(Number(_.maximum)),_.inclusive??!1,"smaller");if(Y?.verb)return`${qv(J??_.origin??"reik\u0161m\u0117")} ${Y.verb} ${_.maximum.toString()} ${Y.unit??"element\u0173"}`;let z=_.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${qv(J??_.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${_.maximum.toString()} ${Y?.unit}`}case"too_small":{let J=Q[_.origin]??_.origin,Y=v(_.origin,jI(Number(_.minimum)),_.inclusive??!1,"bigger");if(Y?.verb)return`${qv(J??_.origin??"reik\u0161m\u0117")} ${Y.verb} ${_.minimum.toString()} ${Y.unit??"element\u0173"}`;let z=_.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${qv(J??_.origin??"reik\u0161m\u0117")} turi b\u016Bti ${z} ${_.minimum.toString()} ${Y?.unit}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${_.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${_.keys.length>1?"i":"as"} rakt${_.keys.length>1?"ai":"as"}: ${V(_.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let J=Q[_.origin]??_.origin;return`${qv(J??_.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};var KI=b(()=>{l()});function Q5(){return{localeError:mB()}}var mB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${_.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(_.values.length===1)return`Invalid input: expected ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.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 ${_.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${J}${_.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 ${_.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.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 ${_.origin} \u0434\u0430 \u0438\u043C\u0430 ${J}${_.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 ${_.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`${_.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"}: ${V(_.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${_.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 ${_.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};var HI=b(()=>{l()});function J5(){return{localeError:gB()}}var gB=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Input tidak sah: dijangka instanceof ${_.expected}, diterima ${z}`;return`Input tidak sah: dijangka ${J}, diterima ${z}`}case"invalid_value":if(_.values.length===1)return`Input tidak sah: dijangka ${S(_.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Terlalu besar: dijangka ${_.origin??"nilai"} ${Y.verb} ${J}${_.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: dijangka ${_.origin??"nilai"} adalah ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Terlalu kecil: dijangka ${_.origin} ${Y.verb} ${J}${_.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: dijangka ${_.origin} adalah ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${V(_.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${_.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${_.origin}`;default:return"Input tidak sah"}}};var WI=b(()=>{l()});function Y5(){return{localeError:hB()}}var hB=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ongeldige invoer: verwacht instanceof ${_.expected}, ontving ${z}`;return`Ongeldige invoer: verwacht ${J}, ontving ${z}`}case"invalid_value":if(_.values.length===1)return`Ongeldige invoer: verwacht ${S(_.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin),z=_.origin==="date"?"laat":_.origin==="string"?"lang":"groot";if(Y)return`Te ${z}: verwacht dat ${_.origin??"waarde"} ${J}${_.maximum.toString()} ${Y.unit??"elementen"} ${Y.verb}`;return`Te ${z}: verwacht dat ${_.origin??"waarde"} ${J}${_.maximum.toString()} is`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin),z=_.origin==="date"?"vroeg":_.origin==="string"?"kort":"klein";if(Y)return`Te ${z}: verwacht dat ${_.origin} ${J}${_.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Te ${z}: verwacht dat ${_.origin} ${J}${_.minimum.toString()} is`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${_.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${_.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${_.origin}`;default:return"Ongeldige invoer"}}};var bI=b(()=>{l()});function z5(){return{localeError:cB()}}var cB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ugyldig input: forventet instanceof ${_.expected}, fikk ${z}`;return`Ugyldig input: forventet ${J}, fikk ${z}`}case"invalid_value":if(_.values.length===1)return`Ugyldig verdi: forventet ${S(_.values[0])}`;return`Ugyldig valg: forventet en av ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`For stor(t): forventet ${_.origin??"value"} til \xE5 ha ${J}${_.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor(t): forventet ${_.origin??"value"} til \xE5 ha ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`For lite(n): forventet ${_.origin} til \xE5 ha ${J}${_.minimum.toString()} ${Y.unit}`;return`For lite(n): forventet ${_.origin} til \xE5 ha ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${V(_.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${_.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${_.origin}`;default:return"Ugyldig input"}}};var BI=b(()=>{l()});function I5(){return{localeError:lB()}}var lB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`F\xE2sit giren: umulan instanceof ${_.expected}, al\u0131nan ${z}`;return`F\xE2sit giren: umulan ${J}, al\u0131nan ${z}`}case"invalid_value":if(_.values.length===1)return`F\xE2sit giren: umulan ${S(_.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Fazla b\xFCy\xFCk: ${_.origin??"value"}, ${J}${_.maximum.toString()} ${Y.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${_.origin??"value"}, ${J}${_.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Fazla k\xFC\xE7\xFCk: ${_.origin}, ${J}${_.minimum.toString()} ${Y.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${_.origin}, ${J}${_.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${_.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`${_.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${_.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};var ZI=b(()=>{l()});function X5(){return{localeError:dB()}}var dB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${_.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(_.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${S(_.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${V(_.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${_.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${_.maximum.toString()} ${Y.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${_.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${J}${_.maximum.toString()} \u0648\u064A`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${_.origin} \u0628\u0627\u06CC\u062F ${J}${_.minimum.toString()} ${Y.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${_.origin} \u0628\u0627\u06CC\u062F ${J}${_.minimum.toString()} \u0648\u064A`}case"invalid_format":{let J=_;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]??_.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${_.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${_.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${V(_.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${_.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 ${_.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};var DI=b(()=>{l()});function q5(){return{localeError:pB()}}var pB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${_.expected}, otrzymano ${z}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J}, otrzymano ${z}`}case"invalid_value":if(_.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${S(_.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${_.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${_.maximum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${_.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${_.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${J}${_.minimum.toString()} ${Y.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${_.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${_.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${_.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${_.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};var VI=b(()=>{l()});function G5(){return{localeError:iB()}}var iB=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Tipo inv\xE1lido: esperado instanceof ${_.expected}, recebido ${z}`;return`Tipo inv\xE1lido: esperado ${J}, recebido ${z}`}case"invalid_value":if(_.values.length===1)return`Entrada inv\xE1lida: esperado ${S(_.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Muito grande: esperado que ${_.origin??"valor"} tivesse ${J}${_.maximum.toString()} ${Y.unit??"elementos"}`;return`Muito grande: esperado que ${_.origin??"valor"} fosse ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Muito pequeno: esperado que ${_.origin} tivesse ${J}${_.minimum.toString()} ${Y.unit}`;return`Muito pequeno: esperado que ${_.origin} fosse ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${_.divisor}`;case"unrecognized_keys":return`Chave${_.keys.length>1?"s":""} desconhecida${_.keys.length>1?"s":""}: ${V(_.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${_.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${_.origin}`;default:return"Campo inv\xE1lido"}}};var MI=b(()=>{l()});function wI($,v,U,Q){let _=Math.abs($),J=_%10,Y=_%100;if(Y>=11&&Y<=19)return Q;if(J===1)return v;if(J>=2&&J<=4)return U;return Q}function j5(){return{localeError:nB()}}var nB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y){let z=Number(_.maximum),I=wI(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 ${_.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${_.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 ${_.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y){let z=Number(_.minimum),I=wI(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 ${_.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${J}${_.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 ${_.origin} \u0431\u0443\u0434\u0435\u0442 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${_.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${_.keys.length>1?"\u0438":""}: ${V(_.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${_.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 ${_.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 LI=b(()=>{l()});function K5(){return{localeError:rB()}}var rB=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(_){return $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${_.expected}, prejeto ${z}`;return`Neveljaven vnos: pri\u010Dakovano ${J}, prejeto ${z}`}case"invalid_value":if(_.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${S(_.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Preveliko: pri\u010Dakovano, da bo ${_.origin??"vrednost"} imelo ${J}${_.maximum.toString()} ${Y.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${_.origin??"vrednost"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Premajhno: pri\u010Dakovano, da bo ${_.origin} imelo ${J}${_.minimum.toString()} ${Y.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${_.divisor}`;case"unrecognized_keys":return`Neprepoznan${_.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${V(_.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${_.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${_.origin}`;default:return"Neveljaven vnos"}}};var kI=b(()=>{l()});function H5(){return{localeError:oB()}}var oB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${_.expected}, fick ${z}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${J}, fick ${z}`}case"invalid_value":if(_.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${S(_.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${_.origin??"v\xE4rdet"} att ha ${J}${_.maximum.toString()} ${Y.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${_.origin??"v\xE4rdet"} att ha ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${_.origin??"v\xE4rdet"} att ha ${J}${_.minimum.toString()} ${Y.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${_.origin??"v\xE4rdet"} att ha ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${V(_.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${_.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${_.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};var AI=b(()=>{l()});function W5(){return{localeError:tB()}}var tB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let J=_.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 ${_.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${_.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 ${_.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${J}${_.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let J=_.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 ${_.origin} ${J}${_.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 ${_.origin} ${J}${_.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${_.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${_.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${V(_.keys,", ")}`;case"invalid_key":return`${_.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`${_.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 OI=b(()=>{l()});function b5(){return{localeError:aB()}}var aB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.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: ${_.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${_.maximum.toString()} ${Y.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${_.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${_.maximum.toString()}`}case"too_small":{let J=_.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: ${_.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${_.minimum.toString()} ${Y.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${_.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${J} ${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.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: ${V(_.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${_.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 ${_.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};var FI=b(()=>{l()});function B5(){return{localeError:sB()}}var sB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${_.expected}, al\u0131nan ${z}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${J}, al\u0131nan ${z}`}case"invalid_value":if(_.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${S(_.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\xC7ok b\xFCy\xFCk: beklenen ${_.origin??"de\u011Fer"} ${J}${_.maximum.toString()} ${Y.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${_.origin??"de\u011Fer"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${_.origin} ${J}${_.minimum.toString()} ${Y.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${_.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${_.keys.length>1?"lar":""}: ${V(_.keys,", ")}`;case"invalid_key":return`${_.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${_.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};var NI=b(()=>{l()});function Gv(){return{localeError:eB()}}var eB=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.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 ${_.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(_.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 ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.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 ${_.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${Y.verb} ${J}${_.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 ${_.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${J}${_.maximum.toString()}`}case"too_small":{let J=_.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 ${_.origin} ${Y.verb} ${J}${_.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 ${_.origin} \u0431\u0443\u0434\u0435 ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${_.keys.length>1?"\u0456":""}: ${V(_.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${_.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 ${_.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 Z5=b(()=>{l()});function D5(){return Gv()}var SI=b(()=>{Z5()});function V5(){return{localeError:$Z()}}var $Z=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${_.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(_.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${S(_.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${V(_.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${_.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${J}${_.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: ${_.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${J}${_.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${_.origin} \u06A9\u06D2 ${J}${_.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: ${_.origin} \u06A9\u0627 ${J}${_.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${_.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${_.keys.length>1?"\u0632":""}: ${V(_.keys,"\u060C ")}`;case"invalid_key":return`${_.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${_.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};var TI=b(()=>{l()});function M5(){return{localeError:vZ()}}var vZ=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${_.expected}, qabul qilingan ${z}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${J}, qabul qilingan ${z}`}case"invalid_value":if(_.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${S(_.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Juda katta: kutilgan ${_.origin??"qiymat"} ${J}${_.maximum.toString()} ${Y.unit} ${Y.verb}`;return`Juda katta: kutilgan ${_.origin??"qiymat"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Juda kichik: kutilgan ${_.origin} ${J}${_.minimum.toString()} ${Y.unit} ${Y.verb}`;return`Juda kichik: kutilgan ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${_.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${_.keys.length>1?"lar":""}: ${V(_.keys,", ")}`;case"invalid_key":return`${_.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${_.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};var RI=b(()=>{l()});function w5(){return{localeError:_Z()}}var _Z=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${_.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(_.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${S(_.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 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${_.origin??"gi\xE1 tr\u1ECB"} ${Y.verb} ${J}${_.maximum.toString()} ${Y.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${_.origin??"gi\xE1 tr\u1ECB"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${_.origin} ${Y.verb} ${J}${_.minimum.toString()} ${Y.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${V(_.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${_.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 ${_.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};var EI=b(()=>{l()});function L5(){return{localeError:UZ()}}var UZ=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${_.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(_.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${S(_.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${_.origin??"\u503C"} ${J}${_.maximum.toString()} ${Y.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${_.origin??"\u503C"} ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${_.origin} ${J}${_.minimum.toString()} ${Y.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${_.origin} ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${_.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${V(_.keys,", ")}`;case"invalid_key":return`${_.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${_.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};var PI=b(()=>{l()});function k5(){return{localeError:QZ()}}var QZ=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${_.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(_.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${S(_.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${_.origin??"\u503C"} \u61C9\u70BA ${J}${_.maximum.toString()} ${Y.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${_.origin??"\u503C"} \u61C9\u70BA ${J}${_.maximum.toString()}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${_.origin} \u61C9\u70BA ${J}${_.minimum.toString()} ${Y.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${_.origin} \u61C9\u70BA ${J}${_.minimum.toString()}`}case"invalid_format":{let J=_;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]??_.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${_.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${_.keys.length>1?"\u5011":""}\uFF1A${V(_.keys,"\u3001")}`;case"invalid_key":return`${_.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${_.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};var xI=b(()=>{l()});function A5(){return{localeError:JZ()}}var JZ=()=>{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 $[_]??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(_)=>{switch(_.code){case"invalid_type":{let J=Q[_.expected]??_.expected,Y=T(_.input),z=Q[Y]??Y;if(/^[A-Z]/.test(_.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${_.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(_.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${S(_.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${V(_.values,"|")}`;case"too_big":{let J=_.inclusive?"<=":"<",Y=v(_.origin);if(Y)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${_.origin??"iye"} ${Y.verb} ${J}${_.maximum} ${Y.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${_.maximum}`}case"too_small":{let J=_.inclusive?">=":">",Y=v(_.origin);if(Y)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${_.origin} ${Y.verb} ${J}${_.minimum} ${Y.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${J}${_.minimum}`}case"invalid_format":{let J=_;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]??_.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 ${_.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${V(_.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${_.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 ${_.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};var uI=b(()=>{l()});var jv={};s$(jv,{zhTW:()=>k5,zhCN:()=>L5,yo:()=>A5,vi:()=>w5,uz:()=>M5,ur:()=>V5,uk:()=>Gv,ua:()=>D5,tr:()=>B5,th:()=>b5,ta:()=>W5,sv:()=>H5,sl:()=>K5,ru:()=>j5,pt:()=>G5,ps:()=>X5,pl:()=>q5,ota:()=>I5,no:()=>z5,nl:()=>Y5,ms:()=>J5,mk:()=>Q5,lt:()=>U5,ko:()=>_5,km:()=>Xv,kh:()=>v5,ka:()=>e7,ja:()=>s7,it:()=>a7,is:()=>t7,id:()=>o7,hy:()=>r7,hu:()=>n7,he:()=>i7,frCA:()=>p7,fr:()=>d7,fi:()=>l7,fa:()=>c7,es:()=>h7,eo:()=>g7,en:()=>Iv,de:()=>f7,da:()=>C7,cs:()=>y7,ca:()=>u7,bg:()=>x7,be:()=>P7,az:()=>E7,ar:()=>R7});var O5=b(()=>{gz();hz();lz();dz();pz();iz();nz();rz();m7();oz();tz();az();sz();ez();$I();vI();_I();QI();JI();YI();zI();II();XI();qI();$5();GI();KI();HI();WI();bI();BI();ZI();DI();VI();MI();LI();kI();AI();OI();FI();NI();SI();Z5();TI();RI();EI();PI();xI();uI()});class S5{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let U=v[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 v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let U={...this.get(v)??{}};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 u2(){return new S5}var yI,F5,N5,e$;var Kv=b(()=>{F5=Symbol("ZodOutput"),N5=Symbol("ZodInput");(yI=globalThis).__zod_globalRegistry??(yI.__zod_globalRegistry=u2());e$=globalThis.__zod_globalRegistry});function T5($,v){return new $({type:"string",...P(v)})}function R5($,v){return new $({type:"string",coerce:!0,...P(v)})}function y2($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(v)})}function Hv($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(v)})}function C2($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(v)})}function f2($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(v)})}function m2($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(v)})}function g2($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(v)})}function Wv($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(v)})}function h2($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(v)})}function c2($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(v)})}function l2($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(v)})}function d2($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(v)})}function p2($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(v)})}function i2($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(v)})}function n2($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(v)})}function r2($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(v)})}function o2($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(v)})}function E5($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(v)})}function t2($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(v)})}function a2($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(v)})}function s2($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(v)})}function e2($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(v)})}function $_($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(v)})}function v_($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(v)})}function x5($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(v)})}function u5($,v){return new $({type:"string",format:"date",check:"string_format",...P(v)})}function y5($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(v)})}function C5($,v){return new $({type:"string",format:"duration",check:"string_format",...P(v)})}function f5($,v){return new $({type:"number",checks:[],...P(v)})}function m5($,v){return new $({type:"number",coerce:!0,checks:[],...P(v)})}function g5($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(v)})}function h5($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(v)})}function c5($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(v)})}function l5($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(v)})}function d5($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(v)})}function p5($,v){return new $({type:"boolean",...P(v)})}function i5($,v){return new $({type:"boolean",coerce:!0,...P(v)})}function n5($,v){return new $({type:"bigint",...P(v)})}function r5($,v){return new $({type:"bigint",coerce:!0,...P(v)})}function o5($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(v)})}function t5($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(v)})}function a5($,v){return new $({type:"symbol",...P(v)})}function s5($,v){return new $({type:"undefined",...P(v)})}function e5($,v){return new $({type:"null",...P(v)})}function $U($){return new $({type:"any"})}function vU($){return new $({type:"unknown"})}function _U($,v){return new $({type:"never",...P(v)})}function UU($,v){return new $({type:"void",...P(v)})}function QU($,v){return new $({type:"date",...P(v)})}function JU($,v){return new $({type:"date",coerce:!0,...P(v)})}function YU($,v){return new $({type:"nan",...P(v)})}function Q6($,v){return new w2({check:"less_than",...P(v),value:$,inclusive:!1})}function k4($,v){return new w2({check:"less_than",...P(v),value:$,inclusive:!0})}function J6($,v){return new L2({check:"greater_than",...P(v),value:$,inclusive:!1})}function z4($,v){return new L2({check:"greater_than",...P(v),value:$,inclusive:!0})}function __($){return J6(0,$)}function U_($){return Q6(0,$)}function Q_($){return k4(0,$)}function J_($){return z4(0,$)}function u6($,v){return new $3({check:"multiple_of",...P(v),value:$})}function y6($,v){return new U3({check:"max_size",...P(v),maximum:$})}function Y6($,v){return new Q3({check:"min_size",...P(v),minimum:$})}function U1($,v){return new J3({check:"size_equals",...P(v),size:$})}function Q1($,v){return new Y3({check:"max_length",...P(v),maximum:$})}function b6($,v){return new z3({check:"min_length",...P(v),minimum:$})}function J1($,v){return new I3({check:"length_equals",...P(v),length:$})}function r1($,v){return new X3({check:"string_format",format:"regex",...P(v),pattern:$})}function o1($){return new q3({check:"string_format",format:"lowercase",...P($)})}function t1($){return new G3({check:"string_format",format:"uppercase",...P($)})}function a1($,v){return new j3({check:"string_format",format:"includes",...P(v),includes:$})}function s1($,v){return new K3({check:"string_format",format:"starts_with",...P(v),prefix:$})}function e1($,v){return new H3({check:"string_format",format:"ends_with",...P(v),suffix:$})}function Y_($,v,U){return new W3({check:"property",property:$,schema:v,...P(U)})}function $0($,v){return new b3({check:"mime_type",mime:$,...P(v)})}function d4($){return new B3({check:"overwrite",tx:$})}function v0($){return d4((v)=>v.normalize($))}function _0(){return d4(($)=>$.trim())}function U0(){return d4(($)=>$.toLowerCase())}function Q0(){return d4(($)=>$.toUpperCase())}function J0(){return d4(($)=>K9($))}function zU($,v,U){return new $({type:"array",element:v,...P(U)})}function zZ($,v,U){return new $({type:"union",options:v,...P(U)})}function IZ($,v,U){return new $({type:"union",options:v,inclusive:!1,...P(U)})}function XZ($,v,U,Q){return new $({type:"union",options:U,discriminator:v,...P(Q)})}function qZ($,v,U){return new $({type:"intersection",left:v,right:U})}function GZ($,v,U,Q){let _=U instanceof e;return new $({type:"tuple",items:v,rest:_?U:null,...P(_?Q:U)})}function jZ($,v,U,Q){return new $({type:"record",keyType:v,valueType:U,...P(Q)})}function KZ($,v,U,Q){return new $({type:"map",keyType:v,valueType:U,...P(Q)})}function HZ($,v,U){return new $({type:"set",valueType:v,...P(U)})}function WZ($,v,U){let Q=Array.isArray(v)?Object.fromEntries(v.map((_)=>[_,_])):v;return new $({type:"enum",entries:Q,...P(U)})}function bZ($,v,U){return new $({type:"enum",entries:v,...P(U)})}function BZ($,v,U){return new $({type:"literal",values:Array.isArray(v)?v:[v],...P(U)})}function IU($,v){return new $({type:"file",...P(v)})}function ZZ($,v){return new $({type:"transform",transform:v})}function DZ($,v){return new $({type:"optional",innerType:v})}function VZ($,v){return new $({type:"nullable",innerType:v})}function MZ($,v,U){return new $({type:"default",innerType:v,get defaultValue(){return typeof U==="function"?U():W9(U)}})}function wZ($,v,U){return new $({type:"nonoptional",innerType:v,...P(U)})}function LZ($,v){return new $({type:"success",innerType:v})}function kZ($,v,U){return new $({type:"catch",innerType:v,catchValue:typeof U==="function"?U:()=>U})}function AZ($,v,U){return new $({type:"pipe",in:v,out:U})}function OZ($,v){return new $({type:"readonly",innerType:v})}function FZ($,v,U){return new $({type:"template_literal",parts:v,...P(U)})}function NZ($,v){return new $({type:"lazy",getter:v})}function SZ($,v){return new $({type:"promise",innerType:v})}function XU($,v,U){let Q=P(U);return Q.abort??(Q.abort=!0),new $({type:"custom",check:"custom",fn:v,...Q})}function qU($,v,U){return new $({type:"custom",check:"custom",fn:v,...P(U)})}function GU($){let v=CI((U)=>{return U.addIssue=(Q)=>{if(typeof Q==="string")U.issues.push(h1(Q,U.value,v._zod.def));else{let _=Q;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=U.value),_.inst??(_.inst=v),_.continue??(_.continue=!v._zod.def.abort),U.issues.push(h1(_))}},$(U.value,U)});return v}function CI($,v){let U=new T$({check:"custom",...P(v)});return U._zod.check=$,U}function jU($){let v=new T$({check:"describe"});return v._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,description:$})}],v._zod.check=()=>{},v}function KU($){let v=new T$({check:"meta"});return v._zod.onattach=[(U)=>{let Q=e$.get(U)??{};e$.add(U,{...Q,...$})}],v._zod.check=()=>{},v}function HU($,v){let U=P(v),Q=U.truthy??["true","1","yes","on","y","enabled"],_=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")Q=Q.map((H)=>typeof H==="string"?H.toLowerCase():H),_=_.map((H)=>typeof H==="string"?H.toLowerCase():H);let J=new Set(Q),Y=new Set(_),z=$.Codec??zv,I=$.Boolean??Jv,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 D=H;if(U.case!=="sensitive")D=D.toLowerCase();if(J.has(D))return!0;else if(Y.has(D))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 _[0]||"false"},error:U.error});return j}function Y0($,v,U,Q={}){let _=P(Q),J={...P(Q),check:"string_format",type:"string",format:v,fn:typeof U==="function"?U:(z)=>U.test(z),..._};if(U instanceof RegExp)J.pattern=U;return new $(J)}var P5;var fI=b(()=>{k2();Kv();T7();l();P5={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function C6($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??e$,target:v,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$($,v,U={path:[],schemaPath:[]}){var Q;let _=$._zod.def,J=v.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};v.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(v,Y.schema,q);else{let j=Y.schema,H=v.processors[_.type];if(!H)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);H($,v,j,q)}let G=$._zod.parent;if(G){if(!Y.ref)Y.ref=G;M$(G,v,q),v.seen.get(G).isParent=!0}}let I=v.metadataRegistry.get($);if(I)Object.assign(Y.schema,I);if(v.io==="input"&&I4($))delete Y.schema.examples,delete Y.schema.default;if(v.io==="input"&&Y.schema._prefault)(Q=Y.schema).default??(Q.default=Y.schema._prefault);return delete Y.schema._prefault,v.seen.get($).schema}function f6($,v){let U=$.seen.get(v);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 _=(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}=_(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(v===Y[0]){J(Y);continue}if($.external){let X=$.external.registry.get(Y[0])?.id;if(v!==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 m6($,v){let U=$.seen.get(v);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 D in I){if(D==="$ref"||D==="allOf")continue;if(!(D in X))delete I[D]}if(H.$ref&&j.def)for(let D in I){if(D==="$ref"||D==="allOf")continue;if(D in j.def&&JSON.stringify(I[D])===JSON.stringify(j.def[D]))delete I[D]}}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 _={};if($.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Y=$.external.registry.get(v)?.id;if(!Y)throw Error("Schema is missing an `id` property");_.$id=$.external.uri(Y)}Object.assign(_,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")_.$defs=J;else _.definitions=J;try{let Y=JSON.parse(JSON.stringify(_));return Object.defineProperty(Y,"~standard",{value:{...v["~standard"],jsonSchema:{input:z0(v,"input",$.processors),output:z0(v,"output",$.processors)}},enumerable:!1,writable:!1}),Y}catch(Y){throw Error("Error converting schema to JSON.")}}function I4($,v){let U=v??{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 _ in Q.shape)if(I4(Q.shape[_],U))return!0;return!1}if(Q.type==="union"){for(let _ of Q.options)if(I4(_,U))return!0;return!1}if(Q.type==="tuple"){for(let _ of Q.items)if(I4(_,U))return!0;if(Q.rest&&I4(Q.rest,U))return!0;return!1}return!1}var WU=($,v={})=>(U)=>{let Q=C6({...U,processors:v});return M$($,Q),f6(Q,$),m6(Q,$)},z0=($,v,U={})=>(Q)=>{let{libraryOptions:_,target:J}=Q??{},Y=C6({..._??{},target:J,io:v,processors:U});return M$($,Y),f6(Y,$),m6(Y,$)};var bv=b(()=>{Kv()});function q_($,v){if("_idmap"in $){let Q=$,_=C6({...v,processors:z_}),J={};for(let I of Q._idmap.entries()){let[X,q]=I;M$(q,_)}let Y={},z={registry:Q,uri:v?.uri,defs:J};_.external=z;for(let I of Q._idmap.entries()){let[X,q]=I;f6(_,q),Y[X]=m6(_,q)}if(Object.keys(J).length>0){let I=_.target==="draft-2020-12"?"$defs":"definitions";Y.__shared={[I]:J}}return{schemas:Y}}let U=C6({...v,processors:z_});return M$($,U),f6(U,$),m6(U,$)}var TZ,bU=($,v,U,Q)=>{let _=U;_.type="string";let{minimum:J,maximum:Y,format:z,patterns:I,contentEncoding:X}=$._zod.bag;if(typeof J==="number")_.minLength=J;if(typeof Y==="number")_.maxLength=Y;if(z){if(_.format=TZ[z]??z,_.format==="")delete _.format;if(z==="time")delete _.format}if(X)_.contentEncoding=X;if(I&&I.size>0){let q=[...I];if(q.length===1)_.pattern=q[0].source;else if(q.length>1)_.allOf=[...q.map((G)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},BU=($,v,U,Q)=>{let _=U,{minimum:J,maximum:Y,format:z,multipleOf:I,exclusiveMaximum:X,exclusiveMinimum:q}=$._zod.bag;if(typeof z==="string"&&z.includes("int"))_.type="integer";else _.type="number";if(typeof q==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.minimum=q,_.exclusiveMinimum=!0;else _.exclusiveMinimum=q;if(typeof J==="number"){if(_.minimum=J,typeof q==="number"&&v.target!=="draft-04")if(q>=J)delete _.minimum;else delete _.exclusiveMinimum}if(typeof X==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.maximum=X,_.exclusiveMaximum=!0;else _.exclusiveMaximum=X;if(typeof Y==="number"){if(_.maximum=Y,typeof X==="number"&&v.target!=="draft-04")if(X<=Y)delete _.maximum;else delete _.exclusiveMaximum}if(typeof I==="number")_.multipleOf=I},ZU=($,v,U,Q)=>{U.type="boolean"},DU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},VU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},MU=($,v,U,Q)=>{if(v.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},wU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},LU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},kU=($,v,U,Q)=>{U.not={}},AU=($,v,U,Q)=>{},OU=($,v,U,Q)=>{},FU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},NU=($,v,U,Q)=>{let _=$._zod.def,J=r0(_.entries);if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";U.enum=J},SU=($,v,U,Q)=>{let _=$._zod.def,J=[];for(let Y of _.values)if(Y===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Y==="bigint")if(v.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,v.target==="draft-04"||v.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}},TU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},RU=($,v,U,Q)=>{let _=U,J=$._zod.pattern;if(!J)throw Error("Pattern not found in template literal");_.type="string",_.pattern=J.source},EU=($,v,U,Q)=>{let _=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(_,J);else Object.assign(_,J),_.anyOf=I.map((X)=>({contentMediaType:X}));else Object.assign(_,J)},PU=($,v,U,Q)=>{U.type="boolean"},xU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},uU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},yU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},CU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},fU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},mU=($,v,U,Q)=>{let _=U,J=$._zod.def,{minimum:Y,maximum:z}=$._zod.bag;if(typeof Y==="number")_.minItems=Y;if(typeof z==="number")_.maxItems=z;_.type="array",_.items=M$(J.element,v,{...Q,path:[...Q.path,"items"]})},gU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="object",_.properties={};let Y=J.shape;for(let X in Y)_.properties[X]=M$(Y[X],v,{...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(v.io==="input")return q.optin===void 0;else return q.optout===void 0}));if(I.size>0)_.required=Array.from(I);if(J.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!J.catchall){if(v.io==="output")_.additionalProperties=!1}else if(J.catchall)_.additionalProperties=M$(J.catchall,v,{...Q,path:[...Q.path,"additionalProperties"]})},I_=($,v,U,Q)=>{let _=$._zod.def,J=_.inclusive===!1,Y=_.options.map((z,I)=>M$(z,v,{...Q,path:[...Q.path,J?"oneOf":"anyOf",I]}));if(J)U.oneOf=Y;else U.anyOf=Y},hU=($,v,U,Q)=>{let _=$._zod.def,J=M$(_.left,v,{...Q,path:[...Q.path,"allOf",0]}),Y=M$(_.right,v,{...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},cU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="array";let Y=v.target==="draft-2020-12"?"prefixItems":"items",z=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",I=J.items.map((j,H)=>M$(j,v,{...Q,path:[...Q.path,Y,H]})),X=J.rest?M$(J.rest,v,{...Q,path:[...Q.path,z,...v.target==="openapi-3.0"?[J.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(_.prefixItems=I,X)_.items=X}else if(v.target==="openapi-3.0"){if(_.items={anyOf:I},X)_.items.anyOf.push(X);if(_.minItems=I.length,!X)_.maxItems=I.length}else if(_.items=I,X)_.additionalItems=X;let{minimum:q,maximum:G}=$._zod.bag;if(typeof q==="number")_.minItems=q;if(typeof G==="number")_.maxItems=G},lU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="object";let Y=J.keyType,I=Y._zod.bag?.patterns;if(J.mode==="loose"&&I&&I.size>0){let q=M$(J.valueType,v,{...Q,path:[...Q.path,"patternProperties","*"]});_.patternProperties={};for(let G of I)_.patternProperties[G.source]=q}else{if(v.target==="draft-07"||v.target==="draft-2020-12")_.propertyNames=M$(J.keyType,v,{...Q,path:[...Q.path,"propertyNames"]});_.additionalProperties=M$(J.valueType,v,{...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)_.required=q}},dU=($,v,U,Q)=>{let _=$._zod.def,J=M$(_.innerType,v,Q),Y=v.seen.get($);if(v.target==="openapi-3.0")Y.ref=_.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},pU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},iU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType,U.default=JSON.parse(JSON.stringify(_.defaultValue))},nU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);if(J.ref=_.innerType,v.io==="input")U._prefault=JSON.parse(JSON.stringify(_.defaultValue))},rU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType;let Y;try{Y=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=Y},oU=($,v,U,Q)=>{let _=$._zod.def,J=v.io==="input"?_.in._zod.def.type==="transform"?_.out:_.in:_.out;M$(J,v,Q);let Y=v.seen.get($);Y.ref=J},tU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType,U.readOnly=!0},aU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},X_=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},sU=($,v,U,Q)=>{let _=$._zod.innerType;M$(_,v,Q);let J=v.seen.get($);J.ref=_},z_;var Bv=b(()=>{bv();l();TZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},z_={string:bU,number:BU,boolean:ZU,bigint:DU,symbol:VU,null:MU,undefined:wU,void:LU,never:kU,any:AU,unknown:OU,date:FU,enum:NU,literal:SU,nan:TU,template_literal:RU,file:EU,success:PU,custom:xU,function:uU,transform:yU,map:CU,set:fU,array:mU,object:gU,union:I_,intersection:hU,tuple:cU,record:lU,nullable:dU,nonoptional:pU,default:iU,prefault:nU,catch:rU,pipe:oU,readonly:tU,promise:aU,optional:X_,lazy:sU}});class eU{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 v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=C6({processors:z_,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return M$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}f6(this.ctx,$);let U=m6(this.ctx,$),{"~standard":Q,..._}=U;return _}}var mI=b(()=>{Bv();bv()});var gI={};var hI=()=>{};var B6={};s$(B6,{version:()=>Z3,util:()=>R,treeifyError:()=>V9,toJSONSchema:()=>q_,toDotPath:()=>Bz,safeParseAsync:()=>k9,safeParse:()=>L9,safeEncodeAsync:()=>Cb,safeEncode:()=>ub,safeDecodeAsync:()=>fb,safeDecode:()=>yb,registry:()=>u2,regexes:()=>x4,process:()=>M$,prettifyError:()=>M9,parseAsync:()=>G2,parse:()=>q2,meta:()=>KU,locales:()=>jv,isValidJWT:()=>yz,isValidBase64URL:()=>uz,isValidBase64:()=>h3,initializeContext:()=>C6,globalRegistry:()=>e$,globalConfig:()=>i0,formatError:()=>vv,flattenError:()=>$v,finalize:()=>m6,extractDefs:()=>f6,encodeAsync:()=>Pb,encode:()=>Rb,describe:()=>jU,decodeAsync:()=>xb,decode:()=>Eb,createToJSONSchemaMethod:()=>WU,createStandardJSONSchemaMethod:()=>z0,config:()=>d$,clone:()=>Y4,_xor:()=>IZ,_xid:()=>i2,_void:()=>UU,_uuidv7:()=>g2,_uuidv6:()=>m2,_uuidv4:()=>f2,_uuid:()=>C2,_url:()=>Wv,_uppercase:()=>t1,_unknown:()=>vU,_union:()=>zZ,_undefined:()=>s5,_ulid:()=>p2,_uint64:()=>t5,_uint32:()=>d5,_tuple:()=>GZ,_trim:()=>_0,_transform:()=>ZZ,_toUpperCase:()=>Q0,_toLowerCase:()=>U0,_templateLiteral:()=>FZ,_symbol:()=>a5,_superRefine:()=>GU,_success:()=>LZ,_stringbool:()=>HU,_stringFormat:()=>Y0,_string:()=>T5,_startsWith:()=>s1,_slugify:()=>J0,_size:()=>U1,_set:()=>HZ,_safeParseAsync:()=>p1,_safeParse:()=>d1,_safeEncodeAsync:()=>Z2,_safeEncode:()=>b2,_safeDecodeAsync:()=>D2,_safeDecode:()=>B2,_regex:()=>r1,_refine:()=>qU,_record:()=>jZ,_readonly:()=>OZ,_property:()=>Y_,_promise:()=>SZ,_positive:()=>__,_pipe:()=>AZ,_parseAsync:()=>l1,_parse:()=>c1,_overwrite:()=>d4,_optional:()=>DZ,_number:()=>f5,_nullable:()=>VZ,_null:()=>e5,_normalize:()=>v0,_nonpositive:()=>Q_,_nonoptional:()=>wZ,_nonnegative:()=>J_,_never:()=>_U,_negative:()=>U_,_nativeEnum:()=>bZ,_nanoid:()=>c2,_nan:()=>YU,_multipleOf:()=>u6,_minSize:()=>Y6,_minLength:()=>b6,_min:()=>z4,_mime:()=>$0,_maxSize:()=>y6,_maxLength:()=>Q1,_max:()=>k4,_map:()=>KZ,_mac:()=>E5,_lte:()=>k4,_lt:()=>Q6,_lowercase:()=>o1,_literal:()=>BZ,_length:()=>J1,_lazy:()=>NZ,_ksuid:()=>n2,_jwt:()=>v_,_isoTime:()=>y5,_isoDuration:()=>C5,_isoDateTime:()=>x5,_isoDate:()=>u5,_ipv6:()=>o2,_ipv4:()=>r2,_intersection:()=>qZ,_int64:()=>o5,_int32:()=>l5,_int:()=>g5,_includes:()=>a1,_guid:()=>Hv,_gte:()=>z4,_gt:()=>J6,_float64:()=>c5,_float32:()=>h5,_file:()=>IU,_enum:()=>WZ,_endsWith:()=>e1,_encodeAsync:()=>H2,_encode:()=>j2,_emoji:()=>h2,_email:()=>y2,_e164:()=>$_,_discriminatedUnion:()=>XZ,_default:()=>MZ,_decodeAsync:()=>W2,_decode:()=>K2,_date:()=>QU,_custom:()=>XU,_cuid2:()=>d2,_cuid:()=>l2,_coercedString:()=>R5,_coercedNumber:()=>m5,_coercedDate:()=>JU,_coercedBoolean:()=>i5,_coercedBigint:()=>r5,_cidrv6:()=>a2,_cidrv4:()=>t2,_check:()=>CI,_catch:()=>kZ,_boolean:()=>p5,_bigint:()=>n5,_base64url:()=>e2,_base64:()=>s2,_array:()=>zU,_any:()=>$U,TimePrecision:()=>P5,NEVER:()=>X9,JSONSchemaGenerator:()=>eU,JSONSchema:()=>gI,Doc:()=>A2,$output:()=>F5,$input:()=>N5,$constructor:()=>B,$brand:()=>q9,$ZodXor:()=>J7,$ZodXID:()=>T3,$ZodVoid:()=>v7,$ZodUnknown:()=>e3,$ZodUnion:()=>Yv,$ZodUndefined:()=>t3,$ZodUUID:()=>w3,$ZodURL:()=>k3,$ZodULID:()=>S3,$ZodType:()=>e,$ZodTuple:()=>P2,$ZodTransform:()=>H7,$ZodTemplateLiteral:()=>A7,$ZodSymbol:()=>o3,$ZodSuccess:()=>V7,$ZodStringFormat:()=>A$,$ZodString:()=>_1,$ZodSet:()=>q7,$ZodRegistry:()=>S5,$ZodRecord:()=>I7,$ZodRealError:()=>W4,$ZodReadonly:()=>k7,$ZodPromise:()=>F7,$ZodPrefault:()=>Z7,$ZodPipe:()=>L7,$ZodOptional:()=>x2,$ZodObjectJIT:()=>Q7,$ZodObject:()=>mz,$ZodNumberFormat:()=>n3,$ZodNumber:()=>R2,$ZodNullable:()=>b7,$ZodNull:()=>a3,$ZodNonOptional:()=>D7,$ZodNever:()=>$7,$ZodNanoID:()=>O3,$ZodNaN:()=>w7,$ZodMap:()=>X7,$ZodMAC:()=>f3,$ZodLiteral:()=>j7,$ZodLazy:()=>N7,$ZodKSUID:()=>R3,$ZodJWT:()=>p3,$ZodIntersection:()=>z7,$ZodISOTime:()=>x3,$ZodISODuration:()=>u3,$ZodISODateTime:()=>E3,$ZodISODate:()=>P3,$ZodIPv6:()=>C3,$ZodIPv4:()=>y3,$ZodGUID:()=>M3,$ZodFunction:()=>O7,$ZodFile:()=>K7,$ZodExactOptional:()=>W7,$ZodError:()=>e0,$ZodEnum:()=>G7,$ZodEncodeError:()=>e6,$ZodEmoji:()=>A3,$ZodEmail:()=>L3,$ZodE164:()=>d3,$ZodDiscriminatedUnion:()=>Y7,$ZodDefault:()=>B7,$ZodDate:()=>_7,$ZodCustomStringFormat:()=>i3,$ZodCustom:()=>S7,$ZodCodec:()=>zv,$ZodCheckUpperCase:()=>G3,$ZodCheckStringFormat:()=>i1,$ZodCheckStartsWith:()=>K3,$ZodCheckSizeEquals:()=>J3,$ZodCheckRegex:()=>X3,$ZodCheckProperty:()=>W3,$ZodCheckOverwrite:()=>B3,$ZodCheckNumberFormat:()=>v3,$ZodCheckMultipleOf:()=>$3,$ZodCheckMinSize:()=>Q3,$ZodCheckMinLength:()=>z3,$ZodCheckMimeType:()=>b3,$ZodCheckMaxSize:()=>U3,$ZodCheckMaxLength:()=>Y3,$ZodCheckLowerCase:()=>q3,$ZodCheckLessThan:()=>w2,$ZodCheckLengthEquals:()=>I3,$ZodCheckIncludes:()=>j3,$ZodCheckGreaterThan:()=>L2,$ZodCheckEndsWith:()=>H3,$ZodCheckBigIntFormat:()=>_3,$ZodCheck:()=>T$,$ZodCatch:()=>M7,$ZodCUID2:()=>N3,$ZodCUID:()=>F3,$ZodCIDRv6:()=>g3,$ZodCIDRv4:()=>m3,$ZodBoolean:()=>Jv,$ZodBigIntFormat:()=>r3,$ZodBigInt:()=>E2,$ZodBase64URL:()=>l3,$ZodBase64:()=>c3,$ZodAsyncError:()=>U6,$ZodArray:()=>U7,$ZodAny:()=>s3});var A4=b(()=>{l();M2();O5();Bv();mI();hI();f1();A9();w9();T7();k2();D3();Kv();fI();bv()});var G_={};s$(G_,{uppercase:()=>t1,trim:()=>_0,toUpperCase:()=>Q0,toLowerCase:()=>U0,startsWith:()=>s1,slugify:()=>J0,size:()=>U1,regex:()=>r1,property:()=>Y_,positive:()=>__,overwrite:()=>d4,normalize:()=>v0,nonpositive:()=>Q_,nonnegative:()=>J_,negative:()=>U_,multipleOf:()=>u6,minSize:()=>Y6,minLength:()=>b6,mime:()=>$0,maxSize:()=>y6,maxLength:()=>Q1,lte:()=>k4,lt:()=>Q6,lowercase:()=>o1,length:()=>J1,includes:()=>a1,gte:()=>z4,gt:()=>J6,endsWith:()=>e1});var j_=b(()=>{A4()});var I0={};s$(I0,{time:()=>_Q,duration:()=>UQ,datetime:()=>$Q,date:()=>vQ,ZodISOTime:()=>W_,ZodISODuration:()=>b_,ZodISODateTime:()=>K_,ZodISODate:()=>H_});function $Q($){return x5(K_,$)}function vQ($){return u5(H_,$)}function _Q($){return y5(W_,$)}function UQ($){return C5(b_,$)}var K_,H_,W_,b_;var Zv=b(()=>{A4();Vv();K_=B("ZodISODateTime",($,v)=>{E3.init($,v),O$.init($,v)});H_=B("ZodISODate",($,v)=>{P3.init($,v),O$.init($,v)});W_=B("ZodISOTime",($,v)=>{x3.init($,v),O$.init($,v)});b_=B("ZodISODuration",($,v)=>{u3.init($,v),O$.init($,v)})});var cI=($,v)=>{e0.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>vv($,U)},flatten:{value:(U)=>$v($,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}}})},B_,b4;var QQ=b(()=>{A4();A4();l();B_=B("ZodError",cI),b4=B("ZodError",cI,{Parent:Error})});var JQ,YQ,zQ,IQ,XQ,qQ,GQ,jQ,KQ,HQ,WQ,bQ;var BQ=b(()=>{A4();QQ();JQ=c1(b4),YQ=l1(b4),zQ=d1(b4),IQ=p1(b4),XQ=j2(b4),qQ=K2(b4),GQ=H2(b4),jQ=W2(b4),KQ=b2(b4),HQ=B2(b4),WQ=Z2(b4),bQ=D2(b4)});var Dv={};s$(Dv,{xor:()=>PX,xid:()=>_X,void:()=>FX,uuidv7:()=>rI,uuidv6:()=>nI,uuidv4:()=>iI,uuid:()=>pI,url:()=>oI,unknown:()=>Y1,union:()=>m_,undefined:()=>AX,ulid:()=>vX,uint64:()=>LX,uint32:()=>VX,tuple:()=>uQ,transform:()=>h_,templateLiteral:()=>iX,symbol:()=>kX,superRefine:()=>IJ,success:()=>lX,stringbool:()=>$q,stringFormat:()=>KX,string:()=>Z_,strictObject:()=>RX,set:()=>fX,refine:()=>zJ,record:()=>yQ,readonly:()=>vJ,promise:()=>nX,preprocess:()=>_q,prefault:()=>rQ,pipe:()=>kv,partialRecord:()=>uX,optional:()=>wv,object:()=>TX,number:()=>DQ,nullish:()=>cX,nullable:()=>Lv,null:()=>kQ,nonoptional:()=>oQ,never:()=>f_,nativeEnum:()=>mX,nanoid:()=>sI,nan:()=>dX,meta:()=>sX,map:()=>CX,mac:()=>JX,looseRecord:()=>yX,looseObject:()=>EX,literal:()=>gX,lazy:()=>QJ,ksuid:()=>UX,keyof:()=>SX,jwt:()=>jX,json:()=>vq,ipv6:()=>YX,ipv4:()=>QX,intersection:()=>PQ,int64:()=>wX,int32:()=>DX,int:()=>D_,instanceof:()=>eX,httpUrl:()=>tI,hostname:()=>HX,hex:()=>WX,hash:()=>bX,guid:()=>dI,function:()=>rX,float64:()=>ZX,float32:()=>BX,file:()=>hX,exactOptional:()=>lQ,enum:()=>g_,emoji:()=>aI,email:()=>lI,e164:()=>GX,discriminatedUnion:()=>xX,describe:()=>aX,date:()=>NX,custom:()=>tX,cuid2:()=>$X,cuid:()=>eI,codec:()=>pX,cidrv6:()=>IX,cidrv4:()=>zX,check:()=>oX,catch:()=>sQ,boolean:()=>VQ,bigint:()=>MX,base64url:()=>qX,base64:()=>XX,array:()=>Fv,any:()=>OX,_function:()=>rX,_default:()=>iQ,_ZodString:()=>V_,ZodXor:()=>TQ,ZodXID:()=>F_,ZodVoid:()=>NQ,ZodUnknown:()=>OQ,ZodUnion:()=>Sv,ZodUndefined:()=>wQ,ZodUUID:()=>z6,ZodURL:()=>Av,ZodULID:()=>O_,ZodType:()=>Q$,ZodTuple:()=>xQ,ZodTransform:()=>hQ,ZodTemplateLiteral:()=>_J,ZodSymbol:()=>MQ,ZodSuccess:()=>tQ,ZodStringFormat:()=>O$,ZodString:()=>q0,ZodSet:()=>fQ,ZodRecord:()=>Tv,ZodReadonly:()=>$J,ZodPromise:()=>JJ,ZodPrefault:()=>nQ,ZodPipe:()=>d_,ZodOptional:()=>c_,ZodObject:()=>Nv,ZodNumberFormat:()=>z1,ZodNumber:()=>j0,ZodNullable:()=>dQ,ZodNull:()=>LQ,ZodNonOptional:()=>l_,ZodNever:()=>FQ,ZodNanoID:()=>L_,ZodNaN:()=>eQ,ZodMap:()=>CQ,ZodMAC:()=>ZQ,ZodLiteral:()=>mQ,ZodLazy:()=>UJ,ZodKSUID:()=>N_,ZodJWT:()=>y_,ZodIntersection:()=>EQ,ZodIPv6:()=>T_,ZodIPv4:()=>S_,ZodGUID:()=>Mv,ZodFunction:()=>YJ,ZodFile:()=>gQ,ZodExactOptional:()=>cQ,ZodEnum:()=>X0,ZodEmoji:()=>w_,ZodEmail:()=>M_,ZodE164:()=>u_,ZodDiscriminatedUnion:()=>RQ,ZodDefault:()=>pQ,ZodDate:()=>Ov,ZodCustomStringFormat:()=>G0,ZodCustom:()=>Rv,ZodCodec:()=>p_,ZodCatch:()=>aQ,ZodCUID2:()=>A_,ZodCUID:()=>k_,ZodCIDRv6:()=>E_,ZodCIDRv4:()=>R_,ZodBoolean:()=>K0,ZodBigIntFormat:()=>C_,ZodBigInt:()=>H0,ZodBase64URL:()=>x_,ZodBase64:()=>P_,ZodArray:()=>SQ,ZodAny:()=>AQ});function Z_($){return T5(q0,$)}function lI($){return y2(M_,$)}function dI($){return Hv(Mv,$)}function pI($){return C2(z6,$)}function iI($){return f2(z6,$)}function nI($){return m2(z6,$)}function rI($){return g2(z6,$)}function oI($){return Wv(Av,$)}function tI($){return Wv(Av,{protocol:/^https?$/,hostname:x4.domain,...R.normalizeParams($)})}function aI($){return h2(w_,$)}function sI($){return c2(L_,$)}function eI($){return l2(k_,$)}function $X($){return d2(A_,$)}function vX($){return p2(O_,$)}function _X($){return i2(F_,$)}function UX($){return n2(N_,$)}function QX($){return r2(S_,$)}function JX($){return E5(ZQ,$)}function YX($){return o2(T_,$)}function zX($){return t2(R_,$)}function IX($){return a2(E_,$)}function XX($){return s2(P_,$)}function qX($){return e2(x_,$)}function GX($){return $_(u_,$)}function jX($){return v_(y_,$)}function KX($,v,U={}){return Y0(G0,$,v,U)}function HX($){return Y0(G0,"hostname",x4.hostname,$)}function WX($){return Y0(G0,"hex",x4.hex,$)}function bX($,v){let U=v?.enc??"hex",Q=`${$}_${U}`,_=x4[Q];if(!_)throw Error(`Unrecognized hash format: ${Q}`);return Y0(G0,Q,_,v)}function DQ($){return f5(j0,$)}function D_($){return g5(z1,$)}function BX($){return h5(z1,$)}function ZX($){return c5(z1,$)}function DX($){return l5(z1,$)}function VX($){return d5(z1,$)}function VQ($){return p5(K0,$)}function MX($){return n5(H0,$)}function wX($){return o5(C_,$)}function LX($){return t5(C_,$)}function kX($){return a5(MQ,$)}function AX($){return s5(wQ,$)}function kQ($){return e5(LQ,$)}function OX(){return $U(AQ)}function Y1(){return vU(OQ)}function f_($){return _U(FQ,$)}function FX($){return UU(NQ,$)}function NX($){return QU(Ov,$)}function Fv($,v){return zU(SQ,$,v)}function SX($){let v=$._zod.def.shape;return g_(Object.keys(v))}function TX($,v){let U={type:"object",shape:$??{},...R.normalizeParams(v)};return new Nv(U)}function RX($,v){return new Nv({type:"object",shape:$,catchall:f_(),...R.normalizeParams(v)})}function EX($,v){return new Nv({type:"object",shape:$,catchall:Y1(),...R.normalizeParams(v)})}function m_($,v){return new Sv({type:"union",options:$,...R.normalizeParams(v)})}function PX($,v){return new TQ({type:"union",options:$,inclusive:!1,...R.normalizeParams(v)})}function xX($,v,U){return new RQ({type:"union",options:v,discriminator:$,...R.normalizeParams(U)})}function PQ($,v){return new EQ({type:"intersection",left:$,right:v})}function uQ($,v,U){let Q=v instanceof e,_=Q?U:v;return new xQ({type:"tuple",items:$,rest:Q?v:null,...R.normalizeParams(_)})}function yQ($,v,U){return new Tv({type:"record",keyType:$,valueType:v,...R.normalizeParams(U)})}function uX($,v,U){let Q=Y4($);return Q._zod.values=void 0,new Tv({type:"record",keyType:Q,valueType:v,...R.normalizeParams(U)})}function yX($,v,U){return new Tv({type:"record",keyType:$,valueType:v,mode:"loose",...R.normalizeParams(U)})}function CX($,v,U){return new CQ({type:"map",keyType:$,valueType:v,...R.normalizeParams(U)})}function fX($,v){return new fQ({type:"set",valueType:$,...R.normalizeParams(v)})}function g_($,v){let U=Array.isArray($)?Object.fromEntries($.map((Q)=>[Q,Q])):$;return new X0({type:"enum",entries:U,...R.normalizeParams(v)})}function mX($,v){return new X0({type:"enum",entries:$,...R.normalizeParams(v)})}function gX($,v){return new mQ({type:"literal",values:Array.isArray($)?$:[$],...R.normalizeParams(v)})}function hX($){return IU(gQ,$)}function h_($){return new hQ({type:"transform",transform:$})}function wv($){return new c_({type:"optional",innerType:$})}function lQ($){return new cQ({type:"optional",innerType:$})}function Lv($){return new dQ({type:"nullable",innerType:$})}function cX($){return wv(Lv($))}function iQ($,v){return new pQ({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():R.shallowClone(v)}})}function rQ($,v){return new nQ({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():R.shallowClone(v)}})}function oQ($,v){return new l_({type:"nonoptional",innerType:$,...R.normalizeParams(v)})}function lX($){return new tQ({type:"success",innerType:$})}function sQ($,v){return new aQ({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}function dX($){return YU(eQ,$)}function kv($,v){return new d_({type:"pipe",in:$,out:v})}function pX($,v,U){return new p_({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}function vJ($){return new $J({type:"readonly",innerType:$})}function iX($,v){return new _J({type:"template_literal",parts:$,...R.normalizeParams(v)})}function QJ($){return new UJ({type:"lazy",getter:$})}function nX($){return new JJ({type:"promise",innerType:$})}function rX($){return new YJ({type:"function",input:Array.isArray($?.input)?uQ($?.input):$?.input??Fv(Y1()),output:$?.output??Y1()})}function oX($){let v=new T$({check:"custom"});return v._zod.check=$,v}function tX($,v){return XU(Rv,$??(()=>!0),v)}function zJ($,v={}){return qU(Rv,$,v)}function IJ($){return GU($)}function eX($,v={}){let U=new Rv({type:"custom",check:"custom",fn:(Q)=>Q instanceof $,abort:!0,...R.normalizeParams(v)});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 vq($){let v=QJ(()=>{return m_([Z_($),DQ(),VQ(),kQ(),Fv(v),yQ(Z_(),v)])});return v}function _q($,v){return kv(h_($),v)}var Q$,V_,q0,O$,M_,Mv,z6,Av,w_,L_,k_,A_,O_,F_,N_,S_,ZQ,T_,R_,E_,P_,x_,u_,y_,G0,j0,z1,K0,H0,C_,MQ,wQ,LQ,AQ,OQ,FQ,NQ,Ov,SQ,Nv,Sv,TQ,RQ,EQ,xQ,Tv,CQ,fQ,X0,mQ,gQ,hQ,c_,cQ,dQ,pQ,nQ,l_,tQ,aQ,eQ,d_,p_,$J,_J,UJ,JJ,YJ,Rv,aX,sX,$q=(...$)=>HU({Codec:p_,Boolean:K0,String:q0},...$);var Vv=b(()=>{A4();A4();Bv();bv();j_();Zv();BQ();Q$=B("ZodType",($,v)=>{return e.init($,v),Object.assign($["~standard"],{jsonSchema:{input:z0($,"input"),output:z0($,"output")}}),$.toJSONSchema=WU($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...U)=>{return $.clone(R.mergeDefs(v,{checks:[...v.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)=>JQ($,U,Q,{callee:$.parse}),$.safeParse=(U,Q)=>zQ($,U,Q),$.parseAsync=async(U,Q)=>YQ($,U,Q,{callee:$.parseAsync}),$.safeParseAsync=async(U,Q)=>IQ($,U,Q),$.spa=$.safeParseAsync,$.encode=(U,Q)=>XQ($,U,Q),$.decode=(U,Q)=>qQ($,U,Q),$.encodeAsync=async(U,Q)=>GQ($,U,Q),$.decodeAsync=async(U,Q)=>jQ($,U,Q),$.safeEncode=(U,Q)=>KQ($,U,Q),$.safeDecode=(U,Q)=>HQ($,U,Q),$.safeEncodeAsync=async(U,Q)=>WQ($,U,Q),$.safeDecodeAsync=async(U,Q)=>bQ($,U,Q),$.refine=(U,Q)=>$.check(zJ(U,Q)),$.superRefine=(U)=>$.check(IJ(U)),$.overwrite=(U)=>$.check(d4(U)),$.optional=()=>wv($),$.exactOptional=()=>lQ($),$.nullable=()=>Lv($),$.nullish=()=>wv(Lv($)),$.nonoptional=(U)=>oQ($,U),$.array=()=>Fv($),$.or=(U)=>m_([$,U]),$.and=(U)=>PQ($,U),$.transform=(U)=>kv($,h_(U)),$.default=(U)=>iQ($,U),$.prefault=(U)=>rQ($,U),$.catch=(U)=>sQ($,U),$.pipe=(U)=>kv($,U),$.readonly=()=>vJ($),$.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($),$}),V_=B("_ZodString",($,v)=>{_1.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>bU($,Q,_,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(b6(...Q)),$.max=(...Q)=>$.check(Q1(...Q)),$.length=(...Q)=>$.check(J1(...Q)),$.nonempty=(...Q)=>$.check(b6(1,...Q)),$.lowercase=(Q)=>$.check(o1(Q)),$.uppercase=(Q)=>$.check(t1(Q)),$.trim=()=>$.check(_0()),$.normalize=(...Q)=>$.check(v0(...Q)),$.toLowerCase=()=>$.check(U0()),$.toUpperCase=()=>$.check(Q0()),$.slugify=()=>$.check(J0())}),q0=B("ZodString",($,v)=>{_1.init($,v),V_.init($,v),$.email=(U)=>$.check(y2(M_,U)),$.url=(U)=>$.check(Wv(Av,U)),$.jwt=(U)=>$.check(v_(y_,U)),$.emoji=(U)=>$.check(h2(w_,U)),$.guid=(U)=>$.check(Hv(Mv,U)),$.uuid=(U)=>$.check(C2(z6,U)),$.uuidv4=(U)=>$.check(f2(z6,U)),$.uuidv6=(U)=>$.check(m2(z6,U)),$.uuidv7=(U)=>$.check(g2(z6,U)),$.nanoid=(U)=>$.check(c2(L_,U)),$.guid=(U)=>$.check(Hv(Mv,U)),$.cuid=(U)=>$.check(l2(k_,U)),$.cuid2=(U)=>$.check(d2(A_,U)),$.ulid=(U)=>$.check(p2(O_,U)),$.base64=(U)=>$.check(s2(P_,U)),$.base64url=(U)=>$.check(e2(x_,U)),$.xid=(U)=>$.check(i2(F_,U)),$.ksuid=(U)=>$.check(n2(N_,U)),$.ipv4=(U)=>$.check(r2(S_,U)),$.ipv6=(U)=>$.check(o2(T_,U)),$.cidrv4=(U)=>$.check(t2(R_,U)),$.cidrv6=(U)=>$.check(a2(E_,U)),$.e164=(U)=>$.check($_(u_,U)),$.datetime=(U)=>$.check($Q(U)),$.date=(U)=>$.check(vQ(U)),$.time=(U)=>$.check(_Q(U)),$.duration=(U)=>$.check(UQ(U))});O$=B("ZodStringFormat",($,v)=>{A$.init($,v),V_.init($,v)}),M_=B("ZodEmail",($,v)=>{L3.init($,v),O$.init($,v)});Mv=B("ZodGUID",($,v)=>{M3.init($,v),O$.init($,v)});z6=B("ZodUUID",($,v)=>{w3.init($,v),O$.init($,v)});Av=B("ZodURL",($,v)=>{k3.init($,v),O$.init($,v)});w_=B("ZodEmoji",($,v)=>{A3.init($,v),O$.init($,v)});L_=B("ZodNanoID",($,v)=>{O3.init($,v),O$.init($,v)});k_=B("ZodCUID",($,v)=>{F3.init($,v),O$.init($,v)});A_=B("ZodCUID2",($,v)=>{N3.init($,v),O$.init($,v)});O_=B("ZodULID",($,v)=>{S3.init($,v),O$.init($,v)});F_=B("ZodXID",($,v)=>{T3.init($,v),O$.init($,v)});N_=B("ZodKSUID",($,v)=>{R3.init($,v),O$.init($,v)});S_=B("ZodIPv4",($,v)=>{y3.init($,v),O$.init($,v)});ZQ=B("ZodMAC",($,v)=>{f3.init($,v),O$.init($,v)});T_=B("ZodIPv6",($,v)=>{C3.init($,v),O$.init($,v)});R_=B("ZodCIDRv4",($,v)=>{m3.init($,v),O$.init($,v)});E_=B("ZodCIDRv6",($,v)=>{g3.init($,v),O$.init($,v)});P_=B("ZodBase64",($,v)=>{c3.init($,v),O$.init($,v)});x_=B("ZodBase64URL",($,v)=>{l3.init($,v),O$.init($,v)});u_=B("ZodE164",($,v)=>{d3.init($,v),O$.init($,v)});y_=B("ZodJWT",($,v)=>{p3.init($,v),O$.init($,v)});G0=B("ZodCustomStringFormat",($,v)=>{i3.init($,v),O$.init($,v)});j0=B("ZodNumber",($,v)=>{R2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>BU($,Q,_,J),$.gt=(Q,_)=>$.check(J6(Q,_)),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.lt=(Q,_)=>$.check(Q6(Q,_)),$.lte=(Q,_)=>$.check(k4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_)),$.int=(Q)=>$.check(D_(Q)),$.safe=(Q)=>$.check(D_(Q)),$.positive=(Q)=>$.check(J6(0,Q)),$.nonnegative=(Q)=>$.check(z4(0,Q)),$.negative=(Q)=>$.check(Q6(0,Q)),$.nonpositive=(Q)=>$.check(k4(0,Q)),$.multipleOf=(Q,_)=>$.check(u6(Q,_)),$.step=(Q,_)=>$.check(u6(Q,_)),$.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});z1=B("ZodNumberFormat",($,v)=>{n3.init($,v),j0.init($,v)});K0=B("ZodBoolean",($,v)=>{Jv.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>ZU($,U,Q,_)});H0=B("ZodBigInt",($,v)=>{E2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>DU($,Q,_,J),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.gt=(Q,_)=>$.check(J6(Q,_)),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.lt=(Q,_)=>$.check(Q6(Q,_)),$.lte=(Q,_)=>$.check(k4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_)),$.positive=(Q)=>$.check(J6(BigInt(0),Q)),$.negative=(Q)=>$.check(Q6(BigInt(0),Q)),$.nonpositive=(Q)=>$.check(k4(BigInt(0),Q)),$.nonnegative=(Q)=>$.check(z4(BigInt(0),Q)),$.multipleOf=(Q,_)=>$.check(u6(Q,_));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});C_=B("ZodBigIntFormat",($,v)=>{r3.init($,v),H0.init($,v)});MQ=B("ZodSymbol",($,v)=>{o3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>VU($,U,Q,_)});wQ=B("ZodUndefined",($,v)=>{t3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>wU($,U,Q,_)});LQ=B("ZodNull",($,v)=>{a3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>MU($,U,Q,_)});AQ=B("ZodAny",($,v)=>{s3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>AU($,U,Q,_)});OQ=B("ZodUnknown",($,v)=>{e3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>OU($,U,Q,_)});FQ=B("ZodNever",($,v)=>{$7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>kU($,U,Q,_)});NQ=B("ZodVoid",($,v)=>{v7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>LU($,U,Q,_)});Ov=B("ZodDate",($,v)=>{_7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>FU($,Q,_,J),$.min=(Q,_)=>$.check(z4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});SQ=B("ZodArray",($,v)=>{U7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>mU($,U,Q,_),$.element=v.element,$.min=(U,Q)=>$.check(b6(U,Q)),$.nonempty=(U)=>$.check(b6(1,U)),$.max=(U,Q)=>$.check(Q1(U,Q)),$.length=(U,Q)=>$.check(J1(U,Q)),$.unwrap=()=>$.element});Nv=B("ZodObject",($,v)=>{Q7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>gU($,U,Q,_),R.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>g_(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y1()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y1()}),$.strict=()=>$.clone({...$._zod.def,catchall:f_()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return R.extend($,U)},$.safeExtend=(U)=>{return R.safeExtend($,U)},$.merge=(U)=>R.merge($,U),$.pick=(U)=>R.pick($,U),$.omit=(U)=>R.omit($,U),$.partial=(...U)=>R.partial(c_,$,U[0]),$.required=(...U)=>R.required(l_,$,U[0])});Sv=B("ZodUnion",($,v)=>{Yv.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>I_($,U,Q,_),$.options=v.options});TQ=B("ZodXor",($,v)=>{Sv.init($,v),J7.init($,v),$._zod.processJSONSchema=(U,Q,_)=>I_($,U,Q,_),$.options=v.options});RQ=B("ZodDiscriminatedUnion",($,v)=>{Sv.init($,v),Y7.init($,v)});EQ=B("ZodIntersection",($,v)=>{z7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>hU($,U,Q,_)});xQ=B("ZodTuple",($,v)=>{P2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>cU($,U,Q,_),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});Tv=B("ZodRecord",($,v)=>{I7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>lU($,U,Q,_),$.keyType=v.keyType,$.valueType=v.valueType});CQ=B("ZodMap",($,v)=>{X7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>CU($,U,Q,_),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...U)=>$.check(Y6(...U)),$.nonempty=(U)=>$.check(Y6(1,U)),$.max=(...U)=>$.check(y6(...U)),$.size=(...U)=>$.check(U1(...U))});fQ=B("ZodSet",($,v)=>{q7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>fU($,U,Q,_),$.min=(...U)=>$.check(Y6(...U)),$.nonempty=(U)=>$.check(Y6(1,U)),$.max=(...U)=>$.check(y6(...U)),$.size=(...U)=>$.check(U1(...U))});X0=B("ZodEnum",($,v)=>{G7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>NU($,Q,_,J),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(Q,_)=>{let J={};for(let Y of Q)if(U.has(Y))J[Y]=v.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({...v,checks:[],...R.normalizeParams(_),entries:J})},$.exclude=(Q,_)=>{let J={...v.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({...v,checks:[],...R.normalizeParams(_),entries:J})}});mQ=B("ZodLiteral",($,v)=>{j7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>SU($,U,Q,_),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});gQ=B("ZodFile",($,v)=>{K7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>EU($,U,Q,_),$.min=(U,Q)=>$.check(Y6(U,Q)),$.max=(U,Q)=>$.check(y6(U,Q)),$.mime=(U,Q)=>$.check($0(Array.isArray(U)?U:[U],Q))});hQ=B("ZodTransform",($,v)=>{H7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>yU($,U,Q,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new e6($.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(R.issue(J,U.value,v));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(R.issue(Y))}};let _=v.transform(U.value,U);if(_ instanceof Promise)return _.then((J)=>{return U.value=J,U});return U.value=_,U}});c_=B("ZodOptional",($,v)=>{x2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>X_($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});cQ=B("ZodExactOptional",($,v)=>{W7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>X_($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});dQ=B("ZodNullable",($,v)=>{b7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>dU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});pQ=B("ZodDefault",($,v)=>{B7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>iU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});nQ=B("ZodPrefault",($,v)=>{Z7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>nU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});l_=B("ZodNonOptional",($,v)=>{D7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>pU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});tQ=B("ZodSuccess",($,v)=>{V7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>PU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});aQ=B("ZodCatch",($,v)=>{M7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>rU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});eQ=B("ZodNaN",($,v)=>{w7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>TU($,U,Q,_)});d_=B("ZodPipe",($,v)=>{L7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>oU($,U,Q,_),$.in=v.in,$.out=v.out});p_=B("ZodCodec",($,v)=>{d_.init($,v),zv.init($,v)});$J=B("ZodReadonly",($,v)=>{k7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>tU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});_J=B("ZodTemplateLiteral",($,v)=>{A7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>RU($,U,Q,_)});UJ=B("ZodLazy",($,v)=>{N7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>sU($,U,Q,_),$.unwrap=()=>$._zod.def.getter()});JJ=B("ZodPromise",($,v)=>{F7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>aU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});YJ=B("ZodFunction",($,v)=>{O7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>uU($,U,Q,_)});Rv=B("ZodCustom",($,v)=>{S7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>xU($,U,Q,_)});aX=jU,sX=KU});function xZ($){d$({customError:$})}function uZ(){return d$().customError}var PZ,XJ;var Uq=b(()=>{A4();PZ={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($){})(XJ||(XJ={}))});function CZ($,v){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 v??"draft-2020-12"}function fZ($,v){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 v.rootSchema;let Q=v.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===Q){let _=U[1];if(!_||!v.defs[_])throw Error(`Reference not found: ${$}`);return v.defs[_]}throw Error(`Reference not found: ${$}`)}function Qq($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return u.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 _=$.$ref;if(v.refs.has(_))return v.refs.get(_);if(v.processing.has(_))return u.lazy(()=>{if(!v.refs.has(_))throw Error(`Circular reference not resolved: ${_}`);return v.refs.get(_)});v.processing.add(_);let J=fZ(_,v),Y=_4(J,v);return v.refs.set(_,Y),v.processing.delete(_),Y}if($.enum!==void 0){let _=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&_.length===1&&_[0]===null)return u.null();if(_.length===0)return u.never();if(_.length===1)return u.literal(_[0]);if(_.every((Y)=>typeof Y==="string"))return u.enum(_);let J=_.map((Y)=>u.literal(Y));if(J.length<2)return J[0];return u.union([J[0],J[1],...J.slice(2)])}if($.const!==void 0)return u.literal($.const);let U=$.type;if(Array.isArray(U)){let _=U.map((J)=>{let Y={...$,type:J};return Qq(Y,v)});if(_.length===0)return u.never();if(_.length===1)return _[0];return u.union(_)}if(!U)return u.any();let Q;switch(U){case"string":{let _=u.string();if($.format){let J=$.format;if(J==="email")_=_.check(u.email());else if(J==="uri"||J==="uri-reference")_=_.check(u.url());else if(J==="uuid"||J==="guid")_=_.check(u.uuid());else if(J==="date-time")_=_.check(u.iso.datetime());else if(J==="date")_=_.check(u.iso.date());else if(J==="time")_=_.check(u.iso.time());else if(J==="duration")_=_.check(u.iso.duration());else if(J==="ipv4")_=_.check(u.ipv4());else if(J==="ipv6")_=_.check(u.ipv6());else if(J==="mac")_=_.check(u.mac());else if(J==="cidr")_=_.check(u.cidrv4());else if(J==="cidr-v6")_=_.check(u.cidrv6());else if(J==="base64")_=_.check(u.base64());else if(J==="base64url")_=_.check(u.base64url());else if(J==="e164")_=_.check(u.e164());else if(J==="jwt")_=_.check(u.jwt());else if(J==="emoji")_=_.check(u.emoji());else if(J==="nanoid")_=_.check(u.nanoid());else if(J==="cuid")_=_.check(u.cuid());else if(J==="cuid2")_=_.check(u.cuid2());else if(J==="ulid")_=_.check(u.ulid());else if(J==="xid")_=_.check(u.xid());else if(J==="ksuid")_=_.check(u.ksuid())}if(typeof $.minLength==="number")_=_.min($.minLength);if(typeof $.maxLength==="number")_=_.max($.maxLength);if($.pattern)_=_.regex(new RegExp($.pattern));Q=_;break}case"number":case"integer":{let _=U==="integer"?u.number().int():u.number();if(typeof $.minimum==="number")_=_.min($.minimum);if(typeof $.maximum==="number")_=_.max($.maximum);if(typeof $.exclusiveMinimum==="number")_=_.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")_=_.gt($.minimum);if(typeof $.exclusiveMaximum==="number")_=_.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")_=_.lt($.maximum);if(typeof $.multipleOf==="number")_=_.multipleOf($.multipleOf);Q=_;break}case"boolean":{Q=u.boolean();break}case"null":{Q=u.null();break}case"object":{let _={},J=$.properties||{},Y=new Set($.required||[]);for(let[I,X]of Object.entries(J)){let q=_4(X,v);_[I]=Y.has(I)?q:q.optional()}if($.propertyNames){let I=_4($.propertyNames,v),X=$.additionalProperties&&typeof $.additionalProperties==="object"?_4($.additionalProperties,v):u.any();if(Object.keys(_).length===0){Q=u.record(I,X);break}let q=u.object(_).passthrough(),G=u.looseRecord(I,X);Q=u.intersection(q,G);break}if($.patternProperties){let I=$.patternProperties,X=Object.keys(I),q=[];for(let j of X){let H=_4(I[j],v),Z=u.string().regex(new RegExp(j));q.push(u.looseRecord(Z,H))}let G=[];if(Object.keys(_).length>0)G.push(u.object(_).passthrough());if(G.push(...q),G.length===0)Q=u.object({}).passthrough();else if(G.length===1)Q=G[0];else{let j=u.intersection(G[0],G[1]);for(let H=2;H<G.length;H++)j=u.intersection(j,G[H]);Q=j}break}let z=u.object(_);if($.additionalProperties===!1)Q=z.strict();else if(typeof $.additionalProperties==="object")Q=z.catchall(_4($.additionalProperties,v));else Q=z.passthrough();break}case"array":{let{prefixItems:_,items:J}=$;if(_&&Array.isArray(_)){let Y=_.map((I)=>_4(I,v)),z=J&&typeof J==="object"&&!Array.isArray(J)?_4(J,v):void 0;if(z)Q=u.tuple(Y).rest(z);else Q=u.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(u.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(u.maxLength($.maxItems))}else if(Array.isArray(J)){let Y=J.map((I)=>_4(I,v)),z=$.additionalItems&&typeof $.additionalItems==="object"?_4($.additionalItems,v):void 0;if(z)Q=u.tuple(Y).rest(z);else Q=u.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(u.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(u.maxLength($.maxItems))}else if(J!==void 0){let Y=_4(J,v),z=u.array(Y);if(typeof $.minItems==="number")z=z.min($.minItems);if(typeof $.maxItems==="number")z=z.max($.maxItems);Q=z}else Q=u.array(u.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 _4($,v){if(typeof $==="boolean")return $?u.any():u.never();let U=Qq($,v),Q=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let z=$.anyOf.map((X)=>_4(X,v)),I=u.union(z);U=Q?u.intersection(U,I):I}if($.oneOf&&Array.isArray($.oneOf)){let z=$.oneOf.map((X)=>_4(X,v)),I=u.xor(z);U=Q?u.intersection(U,I):I}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=Q?U:u.any();else{let z=Q?U:_4($.allOf[0],v),I=Q?0:1;for(let X=I;X<$.allOf.length;X++)z=u.intersection(z,_4($.allOf[X],v));U=z}if($.nullable===!0&&v.version==="openapi-3.0")U=u.nullable(U);if($.readOnly===!0)U=u.readonly(U);let _={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let z of J)if(z in $)_[z]=$[z];let Y=["contentEncoding","contentMediaType","contentSchema"];for(let z of Y)if(z in $)_[z]=$[z];for(let z of Object.keys($))if(!yZ.has(z))_[z]=$[z];if(Object.keys(_).length>0)v.registry.add(U,_);return U}function Jq($,v){if(typeof $==="boolean")return $?u.any():u.never();let U=CZ($,v?.defaultTarget),Q=$.$defs||$.definitions||{},_={version:U,defs:Q,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??e$};return _4($,_)}var u,yZ;var Yq=b(()=>{Kv();j_();Zv();Vv();u={...Dv,...G_,iso:I0},yZ=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:()=>mZ,number:()=>gZ,date:()=>lZ,boolean:()=>hZ,bigint:()=>cZ});function mZ($){return R5(q0,$)}function gZ($){return m5(j0,$)}function hZ($){return i5(K0,$)}function cZ($){return r5(H0,$)}function lZ($){return JU(Ov,$)}var zq=b(()=>{A4();Vv()});var K={};s$(K,{xor:()=>PX,xid:()=>_X,void:()=>FX,uuidv7:()=>rI,uuidv6:()=>nI,uuidv4:()=>iI,uuid:()=>pI,util:()=>R,url:()=>oI,uppercase:()=>t1,unknown:()=>Y1,union:()=>m_,undefined:()=>AX,ulid:()=>vX,uint64:()=>LX,uint32:()=>VX,tuple:()=>uQ,trim:()=>_0,treeifyError:()=>V9,transform:()=>h_,toUpperCase:()=>Q0,toLowerCase:()=>U0,toJSONSchema:()=>q_,templateLiteral:()=>iX,symbol:()=>kX,superRefine:()=>IJ,success:()=>lX,stringbool:()=>$q,stringFormat:()=>KX,string:()=>Z_,strictObject:()=>RX,startsWith:()=>s1,slugify:()=>J0,size:()=>U1,setErrorMap:()=>xZ,set:()=>fX,safeParseAsync:()=>IQ,safeParse:()=>zQ,safeEncodeAsync:()=>WQ,safeEncode:()=>KQ,safeDecodeAsync:()=>bQ,safeDecode:()=>HQ,registry:()=>u2,regexes:()=>x4,regex:()=>r1,refine:()=>zJ,record:()=>yQ,readonly:()=>vJ,property:()=>Y_,promise:()=>nX,prettifyError:()=>M9,preprocess:()=>_q,prefault:()=>rQ,positive:()=>__,pipe:()=>kv,partialRecord:()=>uX,parseAsync:()=>YQ,parse:()=>JQ,overwrite:()=>d4,optional:()=>wv,object:()=>TX,number:()=>DQ,nullish:()=>cX,nullable:()=>Lv,null:()=>kQ,normalize:()=>v0,nonpositive:()=>Q_,nonoptional:()=>oQ,nonnegative:()=>J_,never:()=>f_,negative:()=>U_,nativeEnum:()=>mX,nanoid:()=>sI,nan:()=>dX,multipleOf:()=>u6,minSize:()=>Y6,minLength:()=>b6,mime:()=>$0,meta:()=>sX,maxSize:()=>y6,maxLength:()=>Q1,map:()=>CX,mac:()=>JX,lte:()=>k4,lt:()=>Q6,lowercase:()=>o1,looseRecord:()=>yX,looseObject:()=>EX,locales:()=>jv,literal:()=>gX,length:()=>J1,lazy:()=>QJ,ksuid:()=>UX,keyof:()=>SX,jwt:()=>jX,json:()=>vq,iso:()=>I0,ipv6:()=>YX,ipv4:()=>QX,intersection:()=>PQ,int64:()=>wX,int32:()=>DX,int:()=>D_,instanceof:()=>eX,includes:()=>a1,httpUrl:()=>tI,hostname:()=>HX,hex:()=>WX,hash:()=>bX,guid:()=>dI,gte:()=>z4,gt:()=>J6,globalRegistry:()=>e$,getErrorMap:()=>uZ,function:()=>rX,fromJSONSchema:()=>Jq,formatError:()=>vv,float64:()=>ZX,float32:()=>BX,flattenError:()=>$v,file:()=>hX,exactOptional:()=>lQ,enum:()=>g_,endsWith:()=>e1,encodeAsync:()=>GQ,encode:()=>XQ,emoji:()=>aI,email:()=>lI,e164:()=>GX,discriminatedUnion:()=>xX,describe:()=>aX,decodeAsync:()=>jQ,decode:()=>qQ,date:()=>NX,custom:()=>tX,cuid2:()=>$X,cuid:()=>eI,core:()=>B6,config:()=>d$,coerce:()=>qJ,codec:()=>pX,clone:()=>Y4,cidrv6:()=>IX,cidrv4:()=>zX,check:()=>oX,catch:()=>sQ,boolean:()=>VQ,bigint:()=>MX,base64url:()=>qX,base64:()=>XX,array:()=>Fv,any:()=>OX,_function:()=>rX,_default:()=>iQ,_ZodString:()=>V_,ZodXor:()=>TQ,ZodXID:()=>F_,ZodVoid:()=>NQ,ZodUnknown:()=>OQ,ZodUnion:()=>Sv,ZodUndefined:()=>wQ,ZodUUID:()=>z6,ZodURL:()=>Av,ZodULID:()=>O_,ZodType:()=>Q$,ZodTuple:()=>xQ,ZodTransform:()=>hQ,ZodTemplateLiteral:()=>_J,ZodSymbol:()=>MQ,ZodSuccess:()=>tQ,ZodStringFormat:()=>O$,ZodString:()=>q0,ZodSet:()=>fQ,ZodRecord:()=>Tv,ZodRealError:()=>b4,ZodReadonly:()=>$J,ZodPromise:()=>JJ,ZodPrefault:()=>nQ,ZodPipe:()=>d_,ZodOptional:()=>c_,ZodObject:()=>Nv,ZodNumberFormat:()=>z1,ZodNumber:()=>j0,ZodNullable:()=>dQ,ZodNull:()=>LQ,ZodNonOptional:()=>l_,ZodNever:()=>FQ,ZodNanoID:()=>L_,ZodNaN:()=>eQ,ZodMap:()=>CQ,ZodMAC:()=>ZQ,ZodLiteral:()=>mQ,ZodLazy:()=>UJ,ZodKSUID:()=>N_,ZodJWT:()=>y_,ZodIssueCode:()=>PZ,ZodIntersection:()=>EQ,ZodISOTime:()=>W_,ZodISODuration:()=>b_,ZodISODateTime:()=>K_,ZodISODate:()=>H_,ZodIPv6:()=>T_,ZodIPv4:()=>S_,ZodGUID:()=>Mv,ZodFunction:()=>YJ,ZodFirstPartyTypeKind:()=>XJ,ZodFile:()=>gQ,ZodExactOptional:()=>cQ,ZodError:()=>B_,ZodEnum:()=>X0,ZodEmoji:()=>w_,ZodEmail:()=>M_,ZodE164:()=>u_,ZodDiscriminatedUnion:()=>RQ,ZodDefault:()=>pQ,ZodDate:()=>Ov,ZodCustomStringFormat:()=>G0,ZodCustom:()=>Rv,ZodCodec:()=>p_,ZodCatch:()=>aQ,ZodCUID2:()=>A_,ZodCUID:()=>k_,ZodCIDRv6:()=>E_,ZodCIDRv4:()=>R_,ZodBoolean:()=>K0,ZodBigIntFormat:()=>C_,ZodBigInt:()=>H0,ZodBase64URL:()=>x_,ZodBase64:()=>P_,ZodArray:()=>SQ,ZodAny:()=>AQ,TimePrecision:()=>P5,NEVER:()=>X9,$output:()=>F5,$input:()=>N5,$brand:()=>q9});var GJ=b(()=>{A4();A4();m7();A4();Bv();Yq();O5();Zv();Zv();zq();Vv();j_();QQ();BQ();Uq();d$(Iv())});var Z6=b(()=>{GJ();GJ()});var Xq;var Iq=b(()=>{Xq={name:"ocx",version:"2.0.6",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 pZ($){return`https://${Ev}/schemas/v${$}/registry.json`}var Ev="ocx.kdco.dev",qq="kdcokenny/ocx",jJ,KJ,p4=2,i4,Gq;var i_=b(()=>{Iq();jJ=`https://${Ev}/schemas/ocx.json`,KJ=`https://${Ev}/schemas/registry.json`;i4=pZ(p4),Gq=Xq.version});var K$,b$,B$,P$,d,M,I1,t$,X1,f$,n4,m$,g6,W0,r4,b0,HJ;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($,v,U=K$.GENERAL){super($);this.code=v;this.exitCode=U;this.name="OCXError"}};B$=class B$ extends b${constructor($){super($,"NOT_FOUND",K$.NOT_FOUND);this.name="NotFoundError"}};P$=class P$ extends b${url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor($,v){super($,"NETWORK_ERROR",K$.NETWORK);this.name="NetworkError",this.url=v?.url,this.status=v?.status,this.statusText=v?.statusText,this.phase=v?.phase,this.qualifiedName=v?.qualifiedName,this.registryContext=v?.registryContext,this.registryName=v?.registryName}};d=class d 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"}};I1=class I1 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"}};X1=class X1 extends b${component;expected;found;constructor($,v,U){let Q=`Integrity verification failed for "${$}"
57
- Expected: ${v}
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=v;this.found=U;this.name="IntegrityError"}};f$=class f$ extends b${constructor($){super($,"UPDATE_ERROR",K$.GENERAL);this.name="SelfUpdateError"}};n4=class n4 extends b${url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor($,v){super($,"REGISTRY_COMPAT_ERROR",K$.CONFIG);this.name="RegistryCompatibilityError",this.url=v.url,this.issue=v.issue,this.remediation=v.remediation,this.schemaUrl=v.schemaUrl,this.supportedMajor=v.supportedMajor,this.detectedMajor=v.detectedMajor}};m$=class m$ extends b${profile;constructor($,v){let U=v??`Profile "${$}" not found`;super(U,"NOT_FOUND",K$.NOT_FOUND);this.profile=$;this.name="ProfileNotFoundError"}};g6=class g6 extends b${profile;constructor($,v){let U=v?`Profile "${$}" already exists. ${v}`:`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($,v,U,Q,_){let J=Q?` in ${Q}`:"",Y=_!==void 0&&_!==$,z=Y?`Registry URL already registered under name "${_}"${J}.
62
- URL: ${v}
63
- Existing name: ${_}
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 ${_}' first, then re-add with the new name.`:`Registry "${$}" already exists${J}.
67
- Current: ${v}
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=v;this.newUrl=U;this.targetLabel=Q;this.existingName=_;this.name="RegistryExistsError",this.conflictType=Y?"url":"name"}};r4=class r4 extends b${profile;reason;constructor($,v){super(`Invalid profile name "${$}": ${v}`,"VALIDATION_ERROR",K$.GENERAL);this.profile=$;this.reason=v;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"}};HJ=class HJ extends b${profile;localDir;constructor($,v){super(`Local profile directory unsupported: "${v}"
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 "${v}"
75
- ocx profile show ${$} --global`,"CONFIG_ERROR",K$.CONFIG);this.profile=$;this.localDir=v;this.name="LocalProfileUnsupportedError"}}});import*as u4 from"path";function O4($,v){if(v.includes("\x00"))throw new U4("Path contains null bytes",v,"null_byte");if(u4.isAbsolute(v)||u4.win32.isAbsolute(v))throw new U4("Path must be relative",v,"absolute_path");if(/^[a-zA-Z]:/.test(v)||v.startsWith("\\\\"))throw new U4("Path contains Windows absolute",v,"windows_absolute");let U=u4.basename(v).toUpperCase().split(".")[0]??"";if(iZ.has(U))throw new U4("Path uses Windows reserved name",v,"windows_reserved");let _=v.normalize("NFC").replace(/\\/g,"/"),J=u4.resolve($),Y=u4.resolve(J,_),z=u4.relative(J,Y);if(z.startsWith("../")||z.startsWith("..\\")||z===".."||u4.isAbsolute(z))throw new U4("Path escapes base directory",v,"path_traversal");return Y}var U4,iZ;var q1=b(()=>{U4=class U4 extends Error{attemptedPath;reason;constructor($,v,U){super($);this.attemptedPath=v;this.reason=U;this.name="PathValidationError"}};iZ=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 nZ,normalize as Kq}from"path";function o4($){if(!$.includes("/"))throw Error(`Invalid component reference: "${$}". Use format: alias/component`);let v=$.split("/");if(v.length>2)throw Error(`Invalid component reference: "${$}". Too many "/" separators. Use format: alias/component`);let[U,Q]=v;if(!U||!Q)throw Error(`Invalid component reference: "${$}". Both alias and component are required.`);return{namespace:U,component:Q}}function BJ($,v){return`${$}/${v}`}function WJ($){if(nZ($))throw new M(`Invalid path: "${$}" - absolute paths not allowed`);if($.startsWith("~"))throw new M(`Invalid path: "${$}" - home directory paths not allowed`);if(Kq($).startsWith(".."))throw new M(`Invalid path: "${$}" - path traversal not allowed`)}function Lq($){return $}function jq($,v){if(rZ.has($))throw new M(`Target "${$}" is reserved for installer use`);try{O4("/dummy/base",$)}catch(Q){if(Q instanceof U4)throw new M(`Invalid target "${$}": ${Q.message}`);throw Q}if(v!=="profile"){let Q=Kq($);if(Wq.some((J)=>Q===J||Q.startsWith(J)))throw new M(`Target path '${$}' is protected and cannot be overwritten by registry components`)}}function h6($,v){if(typeof $==="string"){WJ($);let U=Lq($);return jq(U,v),{path:$,target:U}}return WJ($.path),WJ($.target),jq($.target,v),$}function kq($){if(typeof $==="string")return{type:"remote",url:$,enabled:!0};return $}function j1($){let v;if($.opencode){let{mcp:U,...Q}=$.opencode;v={...Q,...U&&{mcp:Object.fromEntries(Object.entries(U).map(([_,J])=>[_,kq(J)]))}}}return{...$,files:$.files.map((U)=>h6(U,$.type)),opencode:v}}function Z0($){if($===null||$===void 0||typeof $!=="object")return null;let v=$;if(!Object.hasOwn(v,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${i4}".`,supportedMajor:p4};let Q=v.$schema;if(typeof Q!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:String(Q),supportedMajor:p4};if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};if(Q===KJ)return{issue:"legacy-schema-v1",remediation:`Schema URL "${KJ}" is legacy v1. Use "${i4}" instead.`,schemaUrl:Q,supportedMajor:p4};let _=Q.match(JD);if(!_)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};let J=_[1];if(!J)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};let Y=Number.parseInt(J,10);if(Y!==p4)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${i4}" (v${p4}).`,schemaUrl:Q,supportedMajor:p4,detectedMajor:Y};return null}var lS,n_,bJ,Hq,B0,rZ,Wq,oZ,tZ,bq,Bq,Zq,Dq,aZ,sZ,eZ,$D,vD,_D,UD,QD,Vq,Mq,wq,G1,JD,Pv,K1,xv,ZJ;var t4=b(()=>{Z6();i_();z$();q1();lS=K.string().refine(($)=>$.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine(($)=>{let v=$.slice(4);if(!v)return!1;if(v.includes("..")||v.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),n_=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."}),bJ=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.'});Hq=K.string().refine(($)=>{let v=/^[a-z0-9]+(-[a-z0-9]+)*$/,U=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return v.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"]),rZ=new Set([".ocx","ocx.lock"]),Wq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],oZ=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!Wq.some((v)=>$===v||$.startsWith(v))},{message:"Target path is protected and cannot be overwritten by registry components"}),tZ=K.object({clientId:K.string().optional(),scopes:K.array(K.string()).optional(),authUrl:K.string().optional(),tokenUrl:K.string().optional()}),bq=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(),tZ]).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'"}),Bq=K.union([K.string(),bq]),Zq=K.object({path:K.string().min(1,"File path cannot be empty"),target:K.string().min(1,"Target path cannot be empty")}),Dq=K.union([K.string().min(1,"File path cannot be empty"),Zq]),aZ=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(),sZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),enabled:K.boolean().optional()}).passthrough(),eZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),glob:K.string().optional()}).passthrough(),$D=K.object({description:K.string().optional(),run:K.string().optional()}).passthrough(),vD=K.object({disabled:K.boolean().optional()}).passthrough(),_D=K.object({host:K.string().optional(),port:K.number().optional()}).passthrough(),UD=K.record(K.string(),K.string()),QD=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough(),Vq=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()}),Mq=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"]))])),wq=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(),Bq).optional(),plugin:K.array(K.string()).optional(),tools:K.record(K.string(),K.boolean()).optional(),agent:K.record(K.string(),Vq).optional(),instructions:K.array(K.string()).optional(),permission:Mq.optional(),provider:K.record(K.string(),aZ).optional(),lsp:K.record(K.string(),sZ).optional(),formatter:K.record(K.string(),eZ).optional(),command:K.record(K.string(),$D).optional(),tui:vD.optional(),server:_D.optional(),keybind:UD.optional(),watcher:QD.optional(),auto_update:K.boolean().optional(),auto_compact:K.boolean().optional(),share:K.union([K.boolean(),K.string()]).optional()}),G1=K.object({name:n_,type:B0,description:K.string().min(1).max(1024),files:K.array(Dq).default([]),dependencies:K.array(Hq).default([]),npmDependencies:K.array(K.string()).optional(),npmDevDependencies:K.array(K.string()).optional(),opencode:wq.optional()});JD=new RegExp(`^https://${Ev.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);Pv=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,K1=K.object({$schema:K.string().optional(),name:K.string().min(1,"Registry name cannot be empty"),version:K.string().regex(Pv,{message:"Version must be valid semver"}),author:K.string().min(1,"Author cannot be empty"),opencode:K.string().regex(Pv,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(Pv,{message:"OCX version must be valid semver"}).optional(),components:K.array(G1)}).refine(($)=>{let v=new Set($.components.map((U)=>U.name));for(let U of $.components)for(let Q of U.dependencies)if(!Q.includes("/")&&!v.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."}),xv=K.object({name:n_,"dist-tags":K.object({latest:K.string()}),versions:K.record(K.string(),G1)}),ZJ=K.object({$schema:K.string().optional(),author:K.string(),opencode:K.string().regex(Pv,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(Pv,{message:"OCX version must be valid semver"}).optional(),components:K.array(K.object({name:n_,type:B0,description:K.string()}))})});import{mkdir as DJ}from"fs/promises";import{dirname as YD,join as I6}from"path";async function uv($){let{source:v,out:U}=$,Q=Bun.file(I6(v,"registry.jsonc")),_=Bun.file(I6(v,"registry.json")),J=await Q.exists(),Y=await _.exists();if(!J&&!Y)throw new X6("No registry.jsonc or registry.json found in source directory");let I=await(J?Q:_).text(),X=E$(I,[],{allowTrailingComma:!0}),q=Z0(X);if(q)throw new X6(`Registry schema compatibility failed (${q.issue})`,[q.remediation,...q.schemaUrl!==void 0?[`Invalid $schema: ${q.schemaUrl}`]:[]]);let G=K1.safeParse(X);if(!G.success){let O=G.error.issues.map((g)=>`${g.path.join(".")}: ${g.message}`);throw new X6("Registry validation failed",O)}let j=G.data,H=[];if($.dryRun){let O=[];for(let w of j.components){O.push({action:"create",target:`file:components/${w.name}.json`,details:{type:"packument"}});for(let N of w.files){let L=h6(N,w.type),U$=I6(v,"files",L.path);if(!await Bun.file(U$).exists()){H.push(`${w.name}: Source file not found at ${U$}`);continue}O.push({action:"create",target:`file:components/${w.name}/${L.path}`,details:{source:U$}})}}O.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),O.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let g=O.filter((w)=>w.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:O,validation:{passed:H.length===0,errors:H.length>0?H:void 0},summary:`Would build ${j.components.length} components, ${g} files to ${U}`}}let Z=I6(U,"components");await DJ(Z,{recursive:!0});let D="1.0.0";for(let O of j.components){let g={name:O.name,versions:{[D]:O},"dist-tags":{latest:D}},w=I6(Z,`${O.name}.json`);await Bun.write(w,JSON.stringify(g,null,2));for(let N of O.files){let L=h6(N,O.type),U$=I6(v,"files",L.path),$$=I6(Z,O.name,L.path),a=YD($$);if(!await Bun.file(U$).exists()){H.push(`${O.name}: Source file not found at ${U$}`);continue}await DJ(a,{recursive:!0});let V$=Bun.file(U$);await Bun.write($$,V$)}}if(H.length>0)throw new X6(`Build failed with ${H.length} errors`,H);let E={$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((O)=>({name:O.name,type:O.type,description:O.description}))};await Bun.write(I6(U,"index.json"),JSON.stringify(E,null,2));let A=I6(U,".well-known");await DJ(A,{recursive:!0});let r={registry:"/index.json"};return await Bun.write(I6(A,"ocx.json"),JSON.stringify(r,null,2)),{componentsCount:j.components.length,outputPath:U}}var X6;var r_=b(()=>{E4();t4();X6=class X6 extends Error{errors;constructor($,v=[]){super($);this.errors=v;this.name="BuildRegistryError"}}});import Aq from"path";function Oq($){return Aq.posix.isAbsolute($)||Aq.win32.isAbsolute($)}var Fq=()=>{};var VJ;var MJ=b(()=>{Z6();Fq();VJ=K.string().refine(($)=>!$.includes("\x00"),"Path cannot contain null bytes").refine(($)=>!$.split(/[/\\]/).some((v)=>v===".."),"Path cannot contain '..'").refine(($)=>!Oq($),"Path must be relative, not absolute")});function p$($){return $.trim().replace(/\/+$/,"")}import{existsSync as D0}from"fs";import{mkdir as Sq}from"fs/promises";import D6 from"path";function Cv($,v,U,Q){return`${p$($)}::${v}/${U}@${Q}`}function l6($){if(!$.includes("::"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let[v,U]=$.split("::");if(!U||!v)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 _=U.slice(0,Q),J=U.slice(Q+1);if(!_||!J)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!_.includes("/"))throw Error(`Invalid canonical ID: "${$}". Component must be qualified (registryName/component)`);let[Y,z]=_.split("/");if(!Y||!z)throw Error(`Invalid canonical ID: "${$}". Both registry name and component name are required`);return{registryUrl:p$(v),registryName:Y,name:z,revision:J}}function d6($){let v=D6.join($,Tq,Rq);return{path:v,exists:D0(v)}}async function F4($){let{path:v,exists:U}=d6($);if(!U)return null;let _=await Bun.file(v).text(),J=E$(_,[],{allowTrailingComma:!0});return Pq.parse(J)}async function y4($,v){let U=D6.join($,Tq,Rq);await Sq(D6.dirname(U),{recursive:!0});let Q=JSON.stringify(v,null,2);await Bun.write(U,Q)}function p6($){let v=D6.join($,wJ,yv),U=D6.join($,yv),Q=D0(v),_=D0(U);if(Q&&_)throw Error(`Found ${yv} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${yv})`);if(Q)return{path:v,exists:!0};if(_)return{path:U,exists:!0};return{path:v,exists:!1}}function V0($,v){let U=D6.join($,wJ,Nq),Q=D6.join($,Nq);if(v?.isFlattened){if(D0(Q))return{path:Q,exists:!0};return{path:Q,exists:!1}}if(D0(U))return{path:U,exists:!0};if(D0(Q))return{path:Q,exists:!0};return{path:U,exists:!1}}async function C4($,v={}){let{path:U,exists:Q}=p6($);if(!Q)return null;let J=await Bun.file(U).text();try{let Y=E$(J,[],{allowTrailingComma:!0});return c6.parse(Y)}catch(Y){if(v.emitParseDiagnostics??!0)console.error(`Error parsing ${U}:`,Y);throw Y}}async function a_($,v,U){let Q=U??D6.join($,wJ,yv);await Sq(D6.dirname(Q),{recursive:!0});let _=JSON.stringify(v,null,2);await Bun.write(Q,_)}async function fv($,v){let{path:U,exists:Q}=V0($,v);if(!Q)return null;let J=await Bun.file(U).text(),Y=E$(J,[],{allowTrailingComma:!0});return t_.parse(Y)}var o_,c6,Tq=".ocx",Rq="receipt.jsonc",Eq,Pq,zD,ID,t_,yv="ocx.jsonc",Nq="ocx.lock",wJ=".opencode";var X4=b(()=>{E4();Z6();t4();o_=K.object({url:K.string().url("Registry URL must be a valid URL"),headers:K.record(K.string(),K.string()).optional()}),c6=K.object({$schema:K.string().optional(),profile:K.string().optional(),registries:K.record(K.string(),o_).default({}),lockRegistries:K.boolean().default(!1),skipCompatCheck:K.boolean().default(!1)}),Eq=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()}),Pq=K.object({version:K.literal(1),root:K.string().optional(),installed:K.record(K.string(),Eq).default({})}),zD=K.object({registry:K.string(),version:K.string(),hash:K.string(),files:K.array(K.string()),installedAt:K.string(),updatedAt:K.string().optional()}),ID=K.object({registry:K.string(),component:K.string(),version:K.string().optional(),hash:K.string(),installedAt:K.string()}),t_=K.object({lockVersion:K.literal(1),installedFrom:ID.optional(),installed:K.record(bJ,zD).default({})})});var{Glob:XD}=globalThis.Bun;var xq,V6;var M0=b(()=>{Z6();MJ();X4();xq=K.string().refine(($)=>{try{return new XD($),!0}catch{return!1}},{message:"Invalid glob pattern"}),V6=K.object({$schema:K.string().optional(),bin:K.string().optional(),registries:K.record(K.string(),o_).default({}),componentPath:VJ.optional(),renameWindow:K.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:K.array(xq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:K.array(xq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var LJ=b(()=>{MJ();X4();M0();t4()});var mv=T6((qD)=>{class kJ extends Error{constructor($,v,U){super(U);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=v,this.exitCode=$,this.nestedError=void 0}}class uq extends kJ{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}qD.CommanderError=kJ;qD.InvalidArgumentError=uq});var s_=T6((WD)=>{var{InvalidArgumentError:KD}=mv();class yq{constructor($,v){switch(this.description=v||"",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($,v){if(v===this.defaultValue||!Array.isArray(v))return[$];return v.push($),v}default($,v){return this.defaultValue=$,this.defaultValueDescription=v,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(v,U)=>{if(!this.argChoices.includes(v))throw new KD(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(v,U);return v},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function HD($){let v=$.name()+($.variadic===!0?"...":"");return $.required?"<"+v+">":"["+v+"]"}WD.Argument=yq;WD.humanReadableArgName=HD});var AJ=T6((DD)=>{var{humanReadableArgName:ZD}=s_();class Cq{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 v=$.commands.filter((Q)=>!Q._hidden),U=$._getHelpCommand();if(U&&!U._hidden)v.push(U);if(this.sortSubcommands)v.sort((Q,_)=>{return Q.name().localeCompare(_.name())});return v}compareOptions($,v){let U=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return U($).localeCompare(U(v))}visibleOptions($){let v=$.options.filter((Q)=>!Q.hidden),U=$._getHelpOption();if(U&&!U.hidden){let Q=U.short&&$._findOption(U.short),_=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)v.push($.createOption(U.short,U.description))}if(this.sortOptions)v.sort(this.compareOptions);return v}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let v=[];for(let U=$.parent;U;U=U.parent){let Q=U.options.filter((_)=>!_.hidden);v.push(...Q)}if(this.sortOptions)v.sort(this.compareOptions);return v}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((v)=>{v.description=v.description||$._argsDescription[v.name()]||""});if($.registeredArguments.find((v)=>v.description))return $.registeredArguments;return[]}subcommandTerm($){let v=$.registeredArguments.map((U)=>ZD(U)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(v?" "+v:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,v){return v.visibleCommands($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleSubcommandTerm(v.subcommandTerm(Q))))},0)}longestOptionTermLength($,v){return v.visibleOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleOptionTerm(v.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,v){return v.visibleGlobalOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleOptionTerm(v.optionTerm(Q))))},0)}longestArgumentTermLength($,v){return v.visibleArguments($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleArgumentTerm(v.argumentTerm(Q))))},0)}commandUsage($){let v=$._name;if($._aliases[0])v=v+"|"+$._aliases[0];let U="";for(let Q=$.parent;Q;Q=Q.parent)U=Q.name()+" "+U;return U+v+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let v=[];if($.argChoices)v.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")v.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)v.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)v.push(`env: ${$.envVar}`);if(v.length>0){let U=`(${v.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}argumentDescription($){let v=[];if($.argChoices)v.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0)v.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(v.length>0){let U=`(${v.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}formatItemList($,v,U){if(v.length===0)return[];return[U.styleTitle($),...v,""]}groupItems($,v,U){let Q=new Map;return $.forEach((_)=>{let J=U(_);if(!Q.has(J))Q.set(J,[])}),v.forEach((_)=>{let J=U(_);if(!Q.has(J))Q.set(J,[]);Q.get(J).push(_)}),Q}formatHelp($,v){let U=v.padWidth($,v),Q=v.helpWidth??80;function _(q,G){return v.formatItem(q,U,G,v)}let J=[`${v.styleTitle("Usage:")} ${v.styleUsage(v.commandUsage($))}`,""],Y=v.commandDescription($);if(Y.length>0)J=J.concat([v.boxWrap(v.styleCommandDescription(Y),Q),""]);let z=v.visibleArguments($).map((q)=>{return _(v.styleArgumentTerm(v.argumentTerm(q)),v.styleArgumentDescription(v.argumentDescription(q)))});if(J=J.concat(this.formatItemList("Arguments:",z,v)),this.groupItems($.options,v.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,G)=>{let j=q.map((H)=>{return _(v.styleOptionTerm(v.optionTerm(H)),v.styleOptionDescription(v.optionDescription(H)))});J=J.concat(this.formatItemList(G,j,v))}),v.showGlobalOptions){let q=v.visibleGlobalOptions($).map((G)=>{return _(v.styleOptionTerm(v.optionTerm(G)),v.styleOptionDescription(v.optionDescription(G)))});J=J.concat(this.formatItemList("Global Options:",q,v))}return this.groupItems($.commands,v.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,G)=>{let j=q.map((H)=>{return _(v.styleSubcommandTerm(v.subcommandTerm(H)),v.styleSubcommandDescription(v.subcommandDescription(H)))});J=J.concat(this.formatItemList(G,j,v))}),J.join(`
76
- `)}displayWidth($){return fq($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((v)=>{if(v==="[options]")return this.styleOptionText(v);if(v==="[command]")return this.styleSubcommandText(v);if(v[0]==="["||v[0]==="<")return this.styleArgumentText(v);return this.styleCommandText(v)}).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((v)=>{if(v==="[options]")return this.styleOptionText(v);if(v[0]==="["||v[0]==="<")return this.styleArgumentText(v);return this.styleSubcommandText(v)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,v){return Math.max(v.longestOptionTermLength($,v),v.longestGlobalOptionTermLength($,v),v.longestSubcommandTermLength($,v),v.longestArgumentTermLength($,v))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,v,U,Q){let J=" ".repeat(2);if(!U)return J+$;let Y=$.padEnd(v+$.length-Q.displayWidth($)),z=2,X=(this.helpWidth??80)-v-z-2,q;if(X<this.minWidthToWrap||Q.preformatted(U))q=U;else q=Q.boxWrap(U,X).replace(/\n/g,`
77
- `+" ".repeat(v+z));return J+Y+" ".repeat(z)+q.replace(/\n/g,`
78
- ${J}`)}boxWrap($,v){if(v<this.minWidthToWrap)return $;let U=$.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,_=[];return U.forEach((J)=>{let Y=J.match(Q);if(Y===null){_.push("");return}let z=[Y.shift()],I=this.displayWidth(z[0]);Y.forEach((X)=>{let q=this.displayWidth(X);if(I+q<=v){z.push(X),I+=q;return}_.push(z.join(""));let G=X.trimStart();z=[G],I=this.displayWidth(G)}),_.push(z.join(""))}),_.join(`
79
- `)}}function fq($){let v=/\x1b\[\d*(;\d*)*m/g;return $.replace(v,"")}DD.Help=Cq;DD.stripColor=fq});var OJ=T6((kD)=>{var{InvalidArgumentError:wD}=mv();class gq{constructor($,v){this.flags=$,this.description=v||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let U=LD($);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($,v){return this.defaultValue=$,this.defaultValueDescription=v,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let v=$;if(typeof $==="string")v={[$]:!0};return this.implied=Object.assign(this.implied||{},v),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,v){if(v===this.defaultValue||!Array.isArray(v))return[$];return v.push($),v}choices($){return this.argChoices=$.slice(),this.parseArg=(v,U)=>{if(!this.argChoices.includes(v))throw new wD(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(v,U);return v},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return mq(this.name().replace(/^no-/,""));return mq(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class hq{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((v)=>{if(v.negate)this.negativeOptions.set(v.attributeName(),v);else this.positiveOptions.set(v.attributeName(),v)}),this.negativeOptions.forEach((v,U)=>{if(this.positiveOptions.has(U))this.dualOptions.add(U)})}valueFromOption($,v){let U=v.attributeName();if(!this.dualOptions.has(U))return!0;let Q=this.negativeOptions.get(U).presetArg,_=Q!==void 0?Q:!1;return v.negate===(_===$)}}function mq($){return $.split("-").reduce((v,U)=>{return v+U[0].toUpperCase()+U.slice(1)})}function LD($){let v,U,Q=/^-[^-]$/,_=/^--[^-]/,J=$.split(/[ |,]+/).concat("guard");if(Q.test(J[0]))v=J.shift();if(_.test(J[0]))U=J.shift();if(!v&&Q.test(J[0]))v=J.shift();if(!v&&_.test(J[0]))v=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(_.test(Y))throw Error(`${z}
84
- - too many long flags`);throw Error(`${z}
85
- - unrecognised flag format`)}if(v===void 0&&U===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:v,longFlag:U}}kD.Option=gq;kD.DualOptions=hq});var cq=T6((SD)=>{function FD($,v){if(Math.abs($.length-v.length)>3)return Math.max($.length,v.length);let U=[];for(let Q=0;Q<=$.length;Q++)U[Q]=[Q];for(let Q=0;Q<=v.length;Q++)U[0][Q]=Q;for(let Q=1;Q<=v.length;Q++)for(let _=1;_<=$.length;_++){let J=1;if($[_-1]===v[Q-1])J=0;else J=1;if(U[_][Q]=Math.min(U[_-1][Q]+1,U[_][Q-1]+1,U[_-1][Q-1]+J),_>1&&Q>1&&$[_-1]===v[Q-2]&&$[_-2]===v[Q-1])U[_][Q]=Math.min(U[_][Q],U[_-2][Q-2]+1)}return U[$.length][v.length]}function ND($,v){if(!v||v.length===0)return"";v=Array.from(new Set(v));let U=$.startsWith("--");if(U)$=$.slice(2),v=v.map((Y)=>Y.slice(2));let Q=[],_=3,J=0.4;if(v.forEach((Y)=>{if(Y.length<=1)return;let z=FD($,Y),I=Math.max($.length,Y.length);if((I-z)/I>J){if(z<_)_=z,Q=[Y];else if(z===_)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""}SD.suggestSimilar=ND});var iq=T6((CD)=>{var RD=P1("events").EventEmitter,FJ=P1("child_process"),M6=P1("path"),e_=P1("fs"),Z$=P1("process"),{Argument:ED,humanReadableArgName:PD}=s_(),{CommanderError:NJ}=mv(),{Help:xD,stripColor:uD}=AJ(),{Option:lq,DualOptions:yD}=OJ(),{suggestSimilar:dq}=cq();class TJ extends RD{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:(v)=>Z$.stdout.write(v),writeErr:(v)=>Z$.stderr.write(v),outputError:(v,U)=>U(v),getOutHelpWidth:()=>Z$.stdout.isTTY?Z$.stdout.columns:void 0,getErrHelpWidth:()=>Z$.stderr.isTTY?Z$.stderr.columns:void 0,getOutHasColors:()=>SJ()??(Z$.stdout.isTTY&&Z$.stdout.hasColors?.()),getErrHasColors:()=>SJ()??(Z$.stderr.isTTY&&Z$.stderr.hasColors?.()),stripColor:(v)=>uD(v)},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 v=this;v;v=v.parent)$.push(v);return $}command($,v,U){let Q=v,_=U;if(typeof Q==="object"&&Q!==null)_=Q,Q=null;_=_||{};let[,J,Y]=$.match(/([^ ]+) *(.*)/),z=this.createCommand(J);if(Q)z.description(Q),z._executableHandler=!0;if(_.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!(_.noHelp||_.hidden),z._executableFile=_.executableFile||null,Y)z.arguments(Y);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),Q)return this;return z}createCommand($){return new TJ($)}createHelp(){return Object.assign(new xD,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($,v){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
88
- - specify the name in Command constructor or using .name()`);if(v=v||{},v.isDefault)this._defaultCommandName=$._name;if(v.noHelp||v.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,v){return new ED($,v)}argument($,v,U,Q){let _=this.createArgument($,v);if(typeof U==="function")_.default(Q).argParser(U);else _.default(U);return this.addArgument(_),this}arguments($){return $.trim().split(/ +/).forEach((v)=>{this.argument(v)}),this}addArgument($){let v=this.registeredArguments.slice(-1)[0];if(v?.variadic)throw Error(`only the last argument can be variadic '${v.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($,v){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let U=$??"help [command]",[,Q,_]=U.match(/([^ ]+) *(.*)/),J=v??"display help for command",Y=this.createCommand(Q);if(Y.helpOption(!1),_)Y.arguments(_);if(J)Y.description(J);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||v)this._initCommandGroup(Y);return this}addHelpCommand($,v){if(typeof $!=="object")return this.helpCommand($,v),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($,v){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(v);else this._lifeCycleHooks[$]=[v];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(v)=>{if(v.code!=="commander.executeSubCommandAsync")throw v};return this}_exit($,v,U){if(this._exitCallback)this._exitCallback(new NJ($,v,U));Z$.exit($)}action($){let v=(U)=>{let Q=this.registeredArguments.length,_=U.slice(0,Q);if(this._storeOptionsAsProperties)_[Q]=this;else _[Q]=this.opts();return _.push(this),$.apply(this,_)};return this._actionHandler=v,this}createOption($,v){return new lq($,v)}_callParseArg($,v,U,Q){try{return $.parseArg(v,U)}catch(_){if(_.code==="commander.invalidArgument"){let J=`${Q} ${_.message}`;this.error(J,{exitCode:_.exitCode,code:_.code})}throw _}}_registerOption($){let v=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(v){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 '${v.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let v=(Q)=>{return[Q.name()].concat(Q.aliases())},U=v($).find((Q)=>this._findCommand(Q));if(U){let Q=v(this._findCommand(U)).join("|"),_=v($).join("|");throw Error(`cannot add command '${_}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let v=$.name(),U=$.attributeName();if($.negate){let _=$.long.replace(/^--no-/,"--");if(!this._findOption(_))this.setOptionValueWithSource(U,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(U,$.defaultValue,"default");let Q=(_,J,Y)=>{if(_==null&&$.presetArg!==void 0)_=$.presetArg;let z=this.getOptionValue(U);if(_!==null&&$.parseArg)_=this._callParseArg($,_,z,J);else if(_!==null&&$.variadic)_=$._collectValue(_,z);if(_==null)if($.negate)_=!1;else if($.isBoolean()||$.optional)_=!0;else _="";this.setOptionValueWithSource(U,_,Y)};if(this.on("option:"+v,(_)=>{let J=`error: option '${$.flags}' argument '${_}' is invalid.`;Q(_,J,"cli")}),$.envVar)this.on("optionEnv:"+v,(_)=>{let J=`error: option '${$.flags}' value '${_}' from env '${$.envVar}' is invalid.`;Q(_,J,"env")});return this}_optionEx($,v,U,Q,_){if(typeof v==="object"&&v instanceof lq)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let J=this.createOption(v,U);if(J.makeOptionMandatory(!!$.mandatory),typeof Q==="function")J.default(_).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(_).argParser(Q)}else J.default(Q);return this.addOption(J)}option($,v,U,Q){return this._optionEx({},$,v,U,Q)}requiredOption($,v,U,Q){return this._optionEx({mandatory:!0},$,v,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($,v){return this.setOptionValueWithSource($,v,void 0)}setOptionValueWithSource($,v,U){if(this._storeOptionsAsProperties)this[$]=v;else this._optionValues[$]=v;return this._optionValueSources[$]=U,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let v;return this._getCommandAndAncestors().forEach((U)=>{if(U.getOptionValueSource($)!==void 0)v=U.getOptionValueSource($)}),v}_prepareUserArgs($,v){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(v=v||{},$===void 0&&v.from===void 0){if(Z$.versions?.electron)v.from="electron";let Q=Z$.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))v.from="eval"}if($===void 0)$=Z$.argv;this.rawArgs=$.slice();let U;switch(v.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: '${v.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",U}parse($,v){this._prepareForParse();let U=this._prepareUserArgs($,v);return this._parseCommand([],U),this}async parseAsync($,v){this._prepareForParse();let U=this._prepareUserArgs($,v);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($,v,U){if(e_.existsSync($))return;let Q=v?`searched for local subcommand relative to directory '${v}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${$}' 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(_)}_executeSubCommand($,v){v=v.slice();let U=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function _(X,q){let G=M6.resolve(X,q);if(e_.existsSync(G))return G;if(Q.includes(M6.extname(q)))return;let j=Q.find((H)=>e_.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=e_.realpathSync(this._scriptPath)}catch{X=this._scriptPath}Y=M6.resolve(M6.dirname(X),Y)}if(Y){let X=_(Y,J);if(!X&&!$._executableFile&&this._scriptPath){let q=M6.basename(this._scriptPath,M6.extname(this._scriptPath));if(q!==this._name)X=_(Y,`${q}-${$._name}`)}J=X||J}U=Q.includes(M6.extname(J));let z;if(Z$.platform!=="win32")if(U)v.unshift(J),v=pq(Z$.execArgv).concat(v),z=FJ.spawn(Z$.argv[0],v,{stdio:"inherit"});else z=FJ.spawn(J,v,{stdio:"inherit"});else this._checkForMissingExecutable(J,Y,$._name),v.unshift(J),v=pq(Z$.execArgv).concat(v),z=FJ.spawn(Z$.execPath,v,{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 NJ(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 NJ(1,"commander.executeSubCommandAsync","(error)");q.nestedError=X,I(q)}}),this.runningCommand=z}_dispatchSubcommand($,v,U){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let _;return _=this._chainOrCallSubCommandHook(_,Q,"preSubcommand"),_=this._chainOrCall(_,()=>{if(Q._executableHandler)this._executeSubCommand(Q,v.concat(U));else return Q._parseCommand(v,U)}),_}_dispatchHelpCommand($){if(!$)this.help();let v=this._findCommand($);if(v&&!v._executableHandler)v.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,v)=>{if($.required&&this.args[v]==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,_)=>{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,_,Y)}return J};this._checkNumberOfArguments();let v=[];this.registeredArguments.forEach((U,Q)=>{let _=U.defaultValue;if(U.variadic){if(Q<this.args.length){if(_=this.args.slice(Q),U.parseArg)_=_.reduce((J,Y)=>{return $(U,Y,J)},U.defaultValue)}else if(_===void 0)_=[]}else if(Q<this.args.length){if(_=this.args[Q],U.parseArg)_=$(U,_,U.defaultValue)}v[Q]=_}),this.processedArgs=v}_chainOrCall($,v){if($?.then&&typeof $.then==="function")return $.then(()=>v());return v()}_chainOrCallHooks($,v){let U=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((_)=>_._lifeCycleHooks[v]!==void 0).forEach((_)=>{_._lifeCycleHooks[v].forEach((J)=>{Q.push({hookedCommand:_,callback:J})})}),v==="postAction")Q.reverse();return Q.forEach((_)=>{U=this._chainOrCall(U,()=>{return _.callback(_.hookedCommand,this)})}),U}_chainOrCallSubCommandHook($,v,U){let Q=$;if(this._lifeCycleHooks[U]!==void 0)this._lifeCycleHooks[U].forEach((_)=>{Q=this._chainOrCall(Q,()=>{return _(this,v)})});return Q}_parseCommand($,v){let U=this.parseOptions(v);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(U.operands),v=U.unknown,this.args=$.concat(v),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),v);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(v),this._dispatchSubcommand(this._defaultCommandName,$,v);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])},_=`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(_))Q(),this._processArguments(),this.parent.emit(_,$,v);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,v);if(this.listenerCount("command:*"))this.emit("command:*",$,v);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((v)=>v._name===$||v._aliases.includes($))}_findOption($){return this.options.find((v)=>v.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((v)=>{if(v.mandatory&&$.getOptionValue(v.attributeName())===void 0)$.missingMandatoryOptionValue(v)})})}_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((_)=>U.conflictsWith.includes(_.attributeName()));if(Q)this._conflictingOption(U,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let v=[],U=[],Q=v;function _(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&&(!_(X)||J(X))){this.emit(`option:${Y.name()}`,X);continue}if(Y=null,_(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&&(!_($[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)&&v.length===0&&U.length===0){if(this._findCommand(X)){v.push(X),U.push(...$.slice(I));break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){v.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:v,unknown:U}}opts(){if(this._storeOptionsAsProperties){let $={},v=this.options.length;for(let U=0;U<v;U++){let Q=this.options[U].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,v)=>Object.assign($,v.opts()),{})}error($,v){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=v||{},Q=U.exitCode||1,_=U.code||"commander.error";this._exit(Q,_,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in Z$.env){let v=$.attributeName();if(this.getOptionValue(v)===void 0||["default","config","env"].includes(this.getOptionValueSource(v)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,Z$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new yD(this.options),v=(U)=>{return this.getOptionValue(U)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(U))};this.options.filter((U)=>U.implied!==void 0&&v(U.attributeName())&&$.valueFromOption(this.getOptionValue(U.attributeName()),U)).forEach((U)=>{Object.keys(U.implied).filter((Q)=>!v(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,U.implied[Q],"implied")})})}missingArgument($){let v=`error: missing required argument '${$}'`;this.error(v,{code:"commander.missingArgument"})}optionMissingArgument($){let v=`error: option '${$.flags}' argument missing`;this.error(v,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let v=`error: required option '${$.flags}' not specified`;this.error(v,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,v){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}'`},_=`error: ${Q($)} cannot be used with ${Q(v)}`;this.error(_,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let v="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],_=this;do{let J=_.createHelp().visibleOptions(_).filter((Y)=>Y.long).map((Y)=>Y.long);Q=Q.concat(J),_=_.parent}while(_&&!_._enablePositionalOptions);v=dq($,Q)}let U=`error: unknown option '${$}'${v}`;this.error(U,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let v=this.registeredArguments.length,U=v===1?"":"s",_=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${v} argument${U} but got ${$.length}.`;this.error(_,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],v="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((_)=>{if(Q.push(_.name()),_.alias())Q.push(_.alias())}),v=dq($,Q)}let U=`error: unknown command '${$}'${v}`;this.error(U,{code:"commander.unknownCommand"})}version($,v,U){if($===void 0)return this._version;this._version=$,v=v||"-V, --version",U=U||"output the version number";let Q=this.createOption(v,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($,v){if($===void 0&&v===void 0)return this._description;if(this._description=$,v)this._argsDescription=v;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let v=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)v=this.commands[this.commands.length-1];if($===v._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 v._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((v)=>this.alias(v)),this}usage($){if($===void 0){if(this._usage)return this._usage;let v=this.registeredArguments.map((U)=>{return PD(U)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?v:[]).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=M6.basename($,M6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let v=this.createHelp(),U=this._getOutputContext($);v.prepareContext({error:U.error,helpWidth:U.helpWidth,outputHasColors:U.hasColors});let Q=v.formatHelp(this,v);if(U.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let v=!!$.error,U,Q,_;if(v)U=(Y)=>this._outputConfiguration.writeErr(Y),Q=this._outputConfiguration.getErrHasColors(),_=this._outputConfiguration.getErrHelpWidth();else U=(Y)=>this._outputConfiguration.writeOut(Y),Q=this._outputConfiguration.getOutHasColors(),_=this._outputConfiguration.getOutHelpWidth();return{error:v,write:(Y)=>{if(!Q)Y=this._outputConfiguration.stripColor(Y);return U(Y)},hasColors:Q,helpWidth:_}}outputHelp($){let v;if(typeof $==="function")v=$,$=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 _=this.helpInformation({error:U.error});if(v){if(_=v(_),typeof _!=="string"&&!Buffer.isBuffer(_))throw Error("outputHelp callback must return a string or a Buffer")}if(U.write(_),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",Q))}helpOption($,v){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",v??"display help for command"),$||v)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 v=Number(Z$.exitCode??0);if(v===0&&$&&typeof $!=="function"&&$.error)v=1;this._exit(v,"commander.help","(outputHelp)")}addHelpText($,v){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,(_)=>{let J;if(typeof v==="function")J=v({error:_.error,command:_.command});else J=v;if(J)_.write(`${J}
100
- `)}),this}_outputHelpIfRequested($){let v=this._getHelpOption();if(v&&$.find((Q)=>v.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function pq($){return $.map((v)=>{if(!v.startsWith("--inspect"))return v;let U,Q="127.0.0.1",_="9229",J;if((J=v.match(/^(--inspect(-brk)?)$/))!==null)U=J[1];else if((J=v.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(U=J[1],/^\d+$/.test(J[3]))_=J[3];else Q=J[3];else if((J=v.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)U=J[1],Q=J[3],_=J[4];if(U&&_!=="0")return`${U}=${Q}:${parseInt(_)+1}`;return v})}function SJ(){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}CD.Command=TJ;CD.useColor=SJ});var tq=T6((cD)=>{var{Argument:nq}=s_(),{Command:RJ}=iq(),{CommanderError:gD,InvalidArgumentError:rq}=mv(),{Help:hD}=AJ(),{Option:oq}=OJ();cD.program=new RJ;cD.createCommand=($)=>new RJ($);cD.createOption=($,v)=>new oq($,v);cD.createArgument=($,v)=>new nq($,v);cD.Command=RJ;cD.Option=oq;cD.Argument=nq;cD.Help=hD;cD.CommanderError=gD;cD.InvalidArgumentError=rq;cD.InvalidOptionArgumentError=rq});var aq,uT,yT,CT,fT,mT,sq,gT,eq,hT,w6,cT;var $8=b(()=>{aq=_z(tq(),1),{program:uT,createCommand:yT,createArgument:CT,createOption:fT,CommanderError:mT,InvalidArgumentError:sq,InvalidOptionArgumentError:gT,Command:eq,Argument:hT,Option:w6,Help:cT}=aq.default});import{existsSync as vG,statSync as $V}from"fs";import{join as _G}from"path";function $G($,v){let U=_G($,v);if(!vG(U))return"missing";if(!$V(U).isDirectory())throw new M(`Component root "${v}" exists at "${U}" but is not a directory.`);return"directory"}function UV($,v){let U=$G($,v.singular),Q=$G($,v.plural);if(U==="directory"&&Q==="directory")return v.plural;if(U==="directory")return v.singular;if(Q==="directory")return v.plural;return v.plural}function QV($,v,U,Q,_){if(!_)return;let Y=`${U===Q.plural?Q.singular:Q.plural}/${_}`,z=_G($,Y);if(!vG(z))return;throw new t$(`Cross-root logical collision for "${v}": selected root "${U}" but "${Y}" already exists.`)}function w0($,v){let[U,...Q]=$.split("/");if(!U)return $;let _=_V.get(U);if(!_)return $;let J=UV(v,_),Y=Q.join("/");if(QV(v,$,J,_,Y),!Y)return J;return`${J}/${Y}`}var vV,_V;var EJ=b(()=>{z$();vV={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},_V=new Map(Object.entries(vV).flatMap(([$,v])=>{let U={singular:$,plural:v};return[[$,U],[v,U]]}))});import{stat as JV}from"fs/promises";import{homedir as YV}from"os";import{isAbsolute as zV,join as UG,relative as IV,resolve as QG}from"path";function XV($){let v=$.replace(/\\/g,"/");if(v===v8)return".";if(v.startsWith(PJ))return v.slice(PJ.length);return $}function N4(){let $=process.env.XDG_CONFIG_HOME,v=$&&zV($)?$:UG(YV(),".config");return UG(v,"opencode")}async function JG(){try{return(await JV(N4())).isDirectory()}catch{return!1}}function H1($,v,U){if(v){if(!U)return $;return w0($,U)}let Q=XV($),_=U?QG(U):process.cwd(),J=QG(_,v8),Y;try{Y=O4(J,Q)}catch(X){if(X instanceof U4)throw new M(`Invalid local target "${$}": ${X.message}`);throw X}let z=IV(J,Y).replace(/\\/g,"/");if(z==="."||z==="")return v8;let I=U?w0(z,J):z;return`${PJ}${I}`}var v8=".opencode",PJ;var i6=b(()=>{EJ();z$();q1();PJ=`${v8}/`});class f4{cwd;config;constructor($,v){this.cwd=$,this.config=v}static async requireInitialized($){let v=await C4($);if(!v)throw new d("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new f4($,v)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class L0{cwd;config;constructor($,v){this.cwd=$,this.config=v}static async requireInitialized(){let $=N4();if(!await JG())throw new d("Global config not found. Run 'ocx init --global' first.");let v=await C4($);if(!v)throw new d("Global config not found. Run 'ocx init --global' first.");return new L0($,v)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var k0=b(()=>{X4();z$();i6()});import{rename as YG,symlink as YR,unlink as zG}from"fs/promises";async function A0($,v){let U=`${$}.tmp.${process.pid}`;try{await Bun.write(U,JSON.stringify(v,null,"\t"),{mode:384}),await YG(U,$)}catch(Q){try{await zG(U)}catch{}throw Q}}async function IG($,v){let U=`${v}.tmp.${process.pid}`;try{let _=await Bun.file($).arrayBuffer();await Bun.write(U,_,{mode:384}),await YG(U,v)}catch(Q){try{await zG(U)}catch{}throw Q}}var _8=()=>{};import{existsSync as XG,statSync as qV}from"fs";import{readFile as GV,stat as jV}from"fs/promises";import{homedir as KV}from"os";import g$ from"path";function HV($={}){let v=$.xdgConfigHome??process.env.XDG_CONFIG_HOME;if(v&&v.trim().length>0)return g$.resolve(v);let U=$.homeDir??KV();return g$.resolve(U,".config")}function qG($,v){let U=g$.resolve($),Q=g$.resolve(v),_=g$.relative(U,Q);if(_==="")return!0;if(_==="..")return!1;if(_.startsWith(`..${g$.sep}`))return!1;return!g$.isAbsolute(_)}function U8($={}){return g$.join(HV($),"opencode")}function xJ($,v={}){let U=U8(v);if(!qG(U,$))return"local-project";let Q=g$.join(U,"profiles");if(qG(Q,$))return"global-profile-root";return"global-root"}function L6($={}){return g$.join(U8($),"profiles")}function WV($=process.cwd()){let v=A6($);if(v)return g$.join(v,"profiles");return g$.join($,W1,"profiles")}function h$($){return g$.join(L6(),$)}function GG($,v=process.cwd()){return g$.join(WV(v),$)}function B4($){return g$.join(h$($),"ocx.jsonc")}function k6($){return g$.join(h$($),"opencode.jsonc")}function b1($){return g$.join(h$($),"AGENTS.md")}function A6($){let v=$;while(!0){let U=g$.join(v,W1);if(XG(U)&&qV(U).isDirectory())return U;let Q=g$.join(v,".git");if(XG(Q))return null;let _=g$.dirname(v);if(_===v)return null;v=_}}function O0(){return g$.join(U8(),a4)}async function jG($={}){let v=g$.join(U8($),a4),U;try{U=await jV(v)}catch(Q){let _=Q.code;if(_==="ENOENT"||_==="ENOTDIR")throw new n6("missing",v);throw new n6("read-failed",v,Q instanceof Error?Q.message:String(Q))}if(!U.isFile())throw new n6("not-file",v);try{let Q=await GV(v,"utf8");return{path:v,content:Q}}catch(Q){throw new n6("read-failed",v,Q instanceof Error?Q.message:String(Q))}}var a4="ocx.jsonc",gv="opencode.jsonc",W1=".opencode",n6;var Z4=b(()=>{n6=class n6 extends Error{reason;configPath;constructor($,v,U){let Q=$==="missing"?`Required global config is missing at "${v}".`:$==="not-file"?`Required global config target is not a file: "${v}".`:`Failed to read required global config at "${v}": ${U??"Unknown read error"}`;super(Q);this.reason=$;this.configPath=v;this.name="RequiredGlobalConfigReadError"}}});var q6,WR;var Q8=b(()=>{Z6();M0();q6=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"),WR=K.object({name:q6,ocx:V6,opencode:K.record(K.string(),K.unknown()).optional(),hasAgents:K.boolean()})});import{mkdir as KG,readdir as bV,rename as BV,rm as ZV,stat as uJ}from"fs/promises";function VV($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function HG($,v){let U=[],Q=E$($,U,{allowTrailingComma:!0});if(U.length>0){let _=VV(U);throw new d(`Invalid JSONC in ${v}: ${_}`)}return Q}function MV($,v,U){let Q=V6.safeParse($);if(!Q.success){let _=Q.error.issues[0],J=_?.path.length?_.path.join("."):"root",Y=_?.message??"Invalid profile OCX configuration";throw new d(`Invalid profile "${U}" ocx.jsonc at ${v}: ${J} ${Y}`)}return Q.data}function wV($,v,U){if(!$||typeof $!=="object"||Array.isArray($))throw new d(`Invalid profile "${U}" opencode.jsonc at ${v}: root must be an object`);return $}function WG($,v){if($.trim().length===0)throw new d(`Invalid profile from ${v}: value cannot be empty or whitespace`);return $}class c${cwd;constructor($=process.cwd()){this.cwd=$}get profilesDir(){return L6()}static create($){return new c$($??process.cwd())}static async requireInitialized(){let $=c$.create();if(!await $.isInitialized())throw new b0;return $}async isInitialized(){try{return(await uJ(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new b0}async list(){return await this.ensureInitialized(),(await bV(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter((v)=>v.isDirectory()&&!v.name.startsWith(".")).map((v)=>v.name).sort()}async exists($){let v=h$($);try{return(await uJ(v)).isDirectory()}catch{return!1}}async get($){if(!await this.exists($))throw new m$($);let v=B4($),U=Bun.file(v);if(!await U.exists())throw new d(`Profile "${$}" is missing ocx.jsonc. Expected at: ${v}`);let Q=await U.text(),_=HG(Q,v),J=MV(_,v,$),Y=k6($),z=Bun.file(Y),I;if(await z.exists()){let j=await z.text(),H=HG(j,Y);I=wV(H,Y,$)}let X=b1($),G=await Bun.file(X).exists();return{name:$,ocx:J,opencode:I,hasAgents:G}}async getLayered($,v){let U=GG($,v),Q=!1;try{Q=(await uJ(U)).isDirectory()}catch{Q=!1}if(Q)throw new HJ($,U);return this.get($)}async add($){let v=q6.safeParse($);if(!v.success)throw new r4($,v.error.issues[0]?.message??"Invalid name");if(await this.exists($))throw new g6($);let U=h$($);await KG(U,{recursive:!0,mode:448});let Q=B4($);if(!await Bun.file(Q).exists())await Bun.write(Q,DV,{mode:384});let J=k6($);if(!await Bun.file(J).exists())await A0(J,{});let z=b1($);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=h$($);await ZV(U,{recursive:!0})}async move($,v){let U=q6.safeParse($);if(!U.success)throw new r4($,U.error.issues[0]?.message??"Invalid name");let Q=q6.safeParse(v);if(!Q.success)throw new r4(v,Q.error.issues[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists($))throw new m$($);if($===v)return{warnActiveProfile:!1};if(await this.exists(v))throw new t$(`Cannot move: profile "${v}" already exists. Remove it first with 'ocx profile rm ${v} --global'.`);let _=process.env.OCX_PROFILE===$,J=h$($),Y=h$(v);try{await BV(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 "${v}" already exists. Remove it first with 'ocx profile rm ${v} --global'.`);if(I==="ENOENT")throw new m$($)}throw z}return{warnActiveProfile:_}}async resolveProfile($){if($!==void 0){let Q=WG($,"CLI option --profile");if(!await this.exists(Q))throw new m$(Q);return Q}let v=process.env.OCX_PROFILE;if(v!==void 0){let Q=WG(v,"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 KG(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var bG,DV=`{
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,(_)=>{l
115
114
  ],
116
115
  "include": []
117
116
  }
118
- `;var G6=b(()=>{E4();M0();z$();_8();Z4();Q8();bG={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function BG($,v,U){let Q=(_)=>$(_,...v);return U===void 0?Q:Object.assign(Q,{lazy:U,lazyArgs:v})}var ZG=()=>{};function DG($,v,U){let Q=$.length-v.length;if(Q===0)return $(...v);if(Q===1)return BG($,v,U);throw Error("Wrong number of arguments")}var VG=b(()=>{ZG()});function yJ($){if(typeof $!="object"||!$)return!1;let v=Object.getPrototypeOf($);return v===null||v===Object.prototype}var MG=()=>{};function CJ(...$){return DG(wG,$)}function wG($,v){let U={...$,...v};for(let Q in v){if(!(Q in $))continue;let{[Q]:_}=$;if(!yJ(_))continue;let{[Q]:J}=v;yJ(J)&&(U[Q]=wG(_,J))}return U}var LG=b(()=>{VG();MG()});var kG=b(()=>{LG()});function hv($){let v=$.startsWith("npm:"),U=v?$.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 v?`npm:${I}`:I}let Q=U.indexOf("@");if(Q===-1)return $;let _=U.slice(0,Q);return v?`npm:${_}`:_}function fJ($){let v=new Map;for(let Q=$.length-1;Q>=0;Q--){let _=$[Q],J=hv(_);if(!v.has(J))v.set(J,Q)}let U=[];for(let[Q,_]of $.entries()){let J=hv(_);if(v.get(J)===Q)U.push(_)}return U}function J8($,v){let U=CJ($,v);if(Array.isArray($.plugin)&&Array.isArray(v.plugin))U.plugin=fJ([...$.plugin,...v.plugin]);else if(Array.isArray($.plugin))U.plugin=$.plugin;else if(Array.isArray(v.plugin))U.plugin=v.plugin;if(Array.isArray($.instructions)&&Array.isArray(v.instructions))U.instructions=Array.from(new Set([...$.instructions,...v.instructions]));else if(Array.isArray($.instructions))U.instructions=$.instructions;else if(Array.isArray(v.instructions))U.instructions=v.instructions;return U}var Y8=b(()=>{kG()});import{existsSync as LV,readFileSync as kV}from"fs";import{dirname as AV,isAbsolute as fR,resolve as mJ}from"path";function OV($){let v=mJ($);while(!0){let U=mJ(v,".git");if(LV(U))try{let _=P1("fs").statSync(U);if(_.isDirectory())return v;if(_.isFile()){if(kV(U,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return v}}catch{}let Q=AV(v);if(Q===v)return null;v=Q}}function gJ($){let v=mJ($);return OV(v)??v}var AG=()=>{};import{existsSync as FV}from"fs";import*as B1 from"path";var{Glob:NV}=globalThis.Bun;function OG($){return $.startsWith("http://")||$.startsWith("https://")}function SV($,v){if(OG($))return;if(B1.isAbsolute($)||B1.win32.isAbsolute($))throw new M(`Absolute path not allowed in registry instructions: "${$}" (from ${v})`);if($.startsWith("~"))throw new M(`Home directory path not allowed in registry instructions: "${$}" (from ${v})`);if($.split(/[/\\]/).some((Q)=>Q===".."))throw new M(`Path traversal (..) not allowed in registry instructions: "${$}" (from ${v})`)}function TV($,v,U){if(OG($))return[$];if(SV($,U),$.includes("*")||$.includes("?")||$.includes("[")){let J=new NV($),Y=[];for(let z of J.scanSync(v)){let I=B1.join(v,z);Y.push(I)}return Y}let _=B1.join(v,$);if(!FV(_))throw new M(`Registry instruction file not found: "${$}" (from ${U})
119
- Expected at: ${_}`);return[_]}function FG($,v,U){let Q=[],_=new Set;for(let J of $){let Y=TV(J,v,U);for(let z of Y)if(!_.has(z))_.add(z),Q.push(z)}return Q}var NG=b(()=>{z$()});import{existsSync as Z1,readFileSync as TG,statSync as RV}from"fs";import{homedir as EV}from"os";import{join as m4,relative as RG}from"path";var{Glob:z8}=globalThis.Bun;function PV($){return $==="local-config"||$==="cli"||$==="env"}function hJ($,v){if($.trim().length===0)throw new d(`Invalid profile from ${v}: value cannot be empty or whitespace`);return $}function EG($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function SG($){let v;try{v=TG($,"utf8")}catch(J){let Y=J instanceof Error?J.message:"Unknown read error";throw new d(`Failed to read local config at ${$}: ${Y}`)}let U=[],Q=E$(v,U,{allowTrailingComma:!0});if(U.length>0){let J=EG(U);throw new d(`Invalid JSONC in local config at ${$}: ${J}`)}let _=c6.safeParse(Q);if(!_.success){let J=_.error.issues[0],Y=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid OCX config";throw new d(`Invalid local config at ${$}: ${Y} ${z}`)}return _.data}function xV($){let v;try{v=TG($,"utf8")}catch(_){let J=_ instanceof Error?_.message:"Unknown read error";throw new d(`Failed to read local OpenCode config at ${$}: ${J}`)}let U=[],Q=E$(v,U,{allowTrailingComma:!0});if(U.length>0){let _=EG(U);throw new d(`Invalid JSONC in local OpenCode config at ${$}: ${_}`)}if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new d(`Invalid local OpenCode config at ${$}: root must be an object`);return Q}function yV($,v,U){let Q=[],_=v;while(!0){let J=m4(_,$);if(Z1(J)&&RV(J).isFile()){let z=RG(U,J);Q.push(z)}if(_===U)break;let Y=m4(_,"..");if(Y===_)break;_=Y}return Q}function CV($,v){for(let U of uV){let Q=yV(U,$,v);if(Q.length>0)return Q}return[]}function I8($){return $.startsWith("./")?$.slice(2):$}function fV($,v,U){return $.filter((Q)=>{for(let _ of U)if(new z8(I8(_)).match(Q))return!0;for(let _ of v)if(new z8(I8(_)).match(Q))return!1;return!0})}async function mV($){let v=await F4($);if(!v||Object.keys(v.installed).length===0)return[];let U=[];for(let[Q,_]of Object.entries(v.installed)){if(!_.opencode?.instructions)continue;let J=_.opencode.instructions;if(!Array.isArray(J))continue;let Y=`${_.registryName}/${_.name} (${Q})`,z=FG(J,$,Y);U.push(...z)}return Array.from(new Set(U))}class j6{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor($,v,U,Q,_){this.cwd=$,this.profileName=v,this.profile=U,this.localConfigDir=Q,this.registryInstructions=_}static async create($,v){let U=c$.create($),Q=null,_="none",J=A6($);if(J){let q=m4(J,a4);if(Z1(q)){let G=SG(q);if(G.profile!==void 0)Q=hJ(G.profile,`local config at ${q}`),_="local-config"}}if(Q===null){if(v?.profile!==void 0)Q=hJ(v.profile,"CLI option --profile"),_="cli";else if(process.env.OCX_PROFILE!==void 0)Q=hJ(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),_="env"}let Y=await U.isInitialized();if(PV(_)&&!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,$),_="default"}catch(q){if(!(q instanceof m$)||q.profile!=="default")throw q;Q=null,z=null,_="none"}let I;if(z)I=h$(Q);else if(J)I=m4(J,"..");else I=N4();let X=await mV(I);return new j6($,Q,z,J,X)}resolve(){if(this.cachedConfig)return this.cachedConfig;let $={},v=W1,U={};if(this.profile){if($={...$,...this.profile.ocx.registries},this.profile.ocx.componentPath)v=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 _=this.discoverInstructions();return this.cachedConfig={registries:$,componentPath:v,opencode:U,instructions:_,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let $=new Map,v={},U=W1,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))v[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 _=this.shouldLoadLocalConfig();if(!this.profile&&_&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let z=m4(this.localConfigDir,a4);for(let[I,X]of Object.entries(Y.registries))v[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=m4(this.localConfigDir,gv);for(let I of Object.keys(Y))$.set(`opencode.${I}`,{path:z,source:"local-opencode"})}}let J=this.discoverInstructions();return{registries:v,componentPath:U,opencode:Q,instructions:J,profileName:this.profileName,origins:$}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let v=gJ(this.cwd),U=RG(v,this.localConfigDir),Q=this.profile.ocx.exclude??[],_=this.profile.ocx.include??[];for(let J of _){let Y=new z8(I8(J));if(Y.match(`${U}/`)||Y.match(U))return!0}for(let J of Q){let Y=new z8(I8(J));if(Y.match(`${U}/`)||Y.match(`${U}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let $=m4(this.localConfigDir,a4);if(!Z1($))return null;return{registries:SG($).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let $=m4(this.localConfigDir,gv);if(!Z1($))return null;return xV($)}discoverInstructions(){let $=[],v=N4(),U=m4(v,"AGENTS.md");if(Z1(U))$.push(U);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let q=m4(EV(),".claude","CLAUDE.md");if(Z1(q))$.push(q)}if(this.profile&&this.profileName){let q=m4(h$(this.profileName),"AGENTS.md");if(Z1(q))$.push(q)}let Q=this.loadRegistryInstructions();$.push(...Q);let _=gJ(this.cwd),J=CV(this.cwd,_),Y=this.profile?.ocx.exclude??[],z=this.profile?.ocx.include??[],X=fV(J,Y,z).map((q)=>m4(_,q));return $.push(...X),$}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode($,v){return J8($,v)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var uV;var cv=b(()=>{E4();G6();Z4();Y8();X4();z$();AG();NG();i6();uV=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function q4($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&Object.getPrototypeOf($)===Object.prototype}var mG={};s$(mG,{fetchRegistryIndex:()=>r6,fetchFileContent:()=>D1,fetchComponentVersion:()=>j8,fetchComponent:()=>dv,classifyRegistryIndexIssue:()=>fG,_clearFetcherCacheForTests:()=>oV});import{posix as gV}from"path";function lV($,v){return new n4(`Registry at ${$} uses an incompatible format (${v.issue}). ${v.remediation}`,{url:$,issue:v.issue,remediation:v.remediation,...v.schemaUrl!==void 0&&{schemaUrl:v.schemaUrl},...v.supportedMajor!==void 0&&{supportedMajor:v.supportedMajor},...v.detectedMajor!==void 0&&{detectedMajor:v.detectedMajor}})}function xG($,v){if(typeof $!=="string")throw new M(`Invalid ${v}: expected string, got ${typeof $}`);let U=G8[$]??$,Q=B0.safeParse(U);if(!Q.success)throw new M(`Unsupported component type "${$}" in ${v}. Expected one of: ${B0.options.join(", ")}`);return Q.data}function uG($){return typeof $==="string"&&Object.hasOwn(G8,$)}function q8($){return $.startsWith(".opencode/")||$.startsWith(".opencode\\")}function yG($){if(!q4($)||!Array.isArray($.files))return[];let v=[];for(let[U,Q]of $.files.entries()){if(typeof Q==="string"){if(!q8(Q))continue;v.push({path:`files[${U}]`,target:Q});continue}if(!q4(Q)||typeof Q.target!=="string")continue;if(!q8(Q.target))continue;v.push({path:`files[${U}].target`,target:Q.target})}return v}function dV($){if(!q4($))return[];let v=$.components;if(!Array.isArray(v))return[];let U=[];for(let[Q,_]of v.entries()){if(!q4(_))continue;let J=_.type;if(!uG(J))continue;U.push({path:`components[${Q}].type`,type:J})}return U}function pV($){if(!q4($))return!1;if(typeof $.type==="string"&&$.type.startsWith("ocx:"))return!0;return yG($).length>0}async function iV($){let v=p$($),U=lv.get(v);if(U)return U;try{await r6(v)}catch(_){if(_ instanceof P$||_ instanceof B$)return null;throw _}if(!lv.has(v))return null;let Q=lv.get(v);if(!Q)throw Error(`Missing registry schema mode cache entry for ${v}`);return Q}function PG($,v){if($.includes("\x00"))throw new M(`Unsafe target "${$}" in ${v}: null bytes are not allowed`);if($.includes("%"))throw new M(`Unsafe target "${$}" in ${v}: encoded paths are not allowed`);if($.includes("\\"))throw new M(`Unsafe target "${$}" in ${v}: Windows separators are not allowed`);if($.startsWith("/")||$.startsWith("//")||/^[a-zA-Z]:/.test($))throw new M(`Unsafe target "${$}" in ${v}: absolute paths are not allowed`);let U=$.startsWith(".opencode/")?$.slice(10):$;if(!U)throw new M(`Unsafe target "${$}" in ${v}: missing path after .opencode/`);let Q=U.split("/");if(Q.some((X)=>X.length===0))throw new M(`Unsafe target "${$}" in ${v}: empty path segments are not allowed`);if(Q.some((X)=>X==="."||X===".."))throw new M(`Unsafe target "${$}" in ${v}: traversal segments are not allowed`);let[_,...J]=Q;if(!_)throw new M(`Unsafe target "${$}" in ${v}: missing path root segment`);let z=[hV[_]??_,...J].join("/"),I=gV.normalize(z);if(I!==z)throw new M(`Unsafe target "${$}" in ${v}: path normalization is ambiguous`);if(I==="."||I===".."||I.startsWith("../"))throw new M(`Unsafe target "${$}" in ${v}: target escapes project root`);return I}function nV($,v){if(!q4($))return $;let U={...$};if(Object.hasOwn(U,"type"))U.type=xG(U.type,`${v}.type`);if(Array.isArray(U.files))U.files=U.files.map((Q,_)=>{if(typeof Q==="string"){if(!q8(Q))return Q;return PG(Q,`${v}.files[${_}]`)}if(!q4(Q))return Q;let J=Q.target;if(typeof J!=="string")return Q;if(!q8(J))return Q;return{...Q,target:PG(J,`${v}.files[${_}].target`)}});return U}function rV($,v){if(!q4($))throw new n4(`Registry at ${v} uses legacy schema v1 but does not expose an object index payload.`,{url:v,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 n4(`Registry at ${v} uses legacy schema v1 but the components field is missing or invalid.`,{url:v,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let Q=U.map((_,J)=>{if(!q4(_))throw new M(`Invalid index component at components[${J}]: expected object, got ${typeof _}`);let{name:Y,description:z}=_;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:xG(_.type,`components[${J}].type`),description:z}});return{...$,components:Q}}async function CG($,v,U={}){let Q=X8.get($);if(Q)return Q;let _=U.requestUrl??$,J=(async()=>{let Y={url:_,phase:U.phase},z;try{z=await fetch(_)}catch(X){throw new P$(`Network request failed for ${_}: ${X instanceof Error?X.message:String(X)}`,Y)}if(!z.ok){if(z.status===404)throw new B$(`Not found: ${_}`);throw new P$(`Failed to fetch ${_}: ${z.status} ${z.statusText}`,{...Y,status:z.status,statusText:z.statusText})}let I;try{I=await z.json()}catch(X){throw new P$(`Invalid JSON response from ${_}: ${X instanceof Error?X.message:String(X)}`,Y)}return await v(I)})();return X8.set($,J),J.catch(()=>X8.delete($)),J}function fG($){let v=Z0($);if(!v)return null;return{issue:v.issue,remediation:v.remediation,schemaUrl:v.schemaUrl,supportedMajor:v.supportedMajor,detectedMajor:v.detectedMajor}}async function r6($){let v=p$($),U=`${v}/index.json`;return CG(U,(Q)=>{let _=fG(Q);if(_&&_.issue!=="legacy-schema-v1")throw lV(U,_);let J=Q,Y="v2";if(_?.issue==="legacy-schema-v1"){Y="legacy-v1";try{J=rV(Q,U)}catch(I){if(I instanceof n4)throw I;let X=I instanceof Error?I.message:String(I);throw new n4(`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=dV(J);if(I.length>0){let X=I[0];if(!X)throw Error("Unexpected missing legacy type issue");let q=G8[X.type];throw new n4(`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=ZJ.safeParse(J);if(!z.success)throw new n4(`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 lv.set(v,Y),z.data},{phase:"registry-index-fetch"})}async function dv($,v){return(await j8($,v)).manifest}async function j8($,v,U){let Q=`${p$($)}/components/${v}.json`;return CG(`${Q}#v=${U??"latest"}`,async(_)=>{let J=cV.safeParse(_);if(!J.success)throw new M(`Invalid packument format for "${v}": ${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 "${v}" has no version "${U}". Available: ${j}`)}throw new M(`Component "${v}" has no manifest for latest version ${z}`)}let X=`component "${v}@${z}"`,q=I;if(pV(I))if(await iV($)!=="v2")q=nV(I,X);else{let Z=yG(I)[0];if(Z)throw new M(`Invalid component manifest for "${v}@${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)&&uG(I.type)){let D=G8[I.type];throw new M(`Invalid component manifest for "${v}@${z}": type "${I.type}" is a legacy v1 alias. Use "${D}" for v2 registries.`)}}let G=G1.safeParse(q);if(!G.success)throw new M(`Invalid component manifest for "${v}@${z}": ${G.error.message}`);return{manifest:G.data,version:z}},{phase:"packument-fetch",requestUrl:Q})}async function D1($,v,U){let Q=`${p$($)}/components/${v}/${U}`,_={url:Q,phase:"file-content-fetch",qualifiedName:v},J;try{J=await fetch(Q)}catch(Y){throw new P$(`Network request failed for ${Q}: ${Y instanceof Error?Y.message:String(Y)}`,_)}if(!J.ok)throw new P$(`Failed to fetch file ${U} for ${v} from ${Q}: ${J.status} ${J.statusText}`,{..._,status:J.status,statusText:J.statusText});return J.text()}function oV(){X8.clear(),lv.clear()}var X8,lv,G8,hV,cV;var V1=b(()=>{Z6();t4();z$();X8=new Map,lv=new Map,G8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},hV={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},cV=xv.extend({versions:K.record(K.string(),K.unknown())})});function gG($,v){if($.includes("/"))return o4($);if(v)return{namespace:v,component:$};throw new M(`Component '${$}' must include a registry alias (e.g., 'kdco/${$}')`)}async function hG($,v){let U=new Map,Q=new Set,_=new Set,J=new Set,Y={};async function z(q,G,j=[]){let H=BJ(q,G);if(U.has(H))return;if(Q.has(H)){let A=[...j,H].join(" \u2192 ");throw new M(`Circular dependency detected: ${A}`)}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 D;try{D=await dv(Z.url,G)}catch(A){if(A instanceof P$)throw A;if(A instanceof B$)throw new B$(`Component '${G}' not found in registry '${q}'.`);if(A instanceof b$)throw A;throw new P$(`Failed to fetch component '${G}' from registry '${q}': ${A instanceof Error?A.message:String(A)}`,{url:Z.url})}for(let A of D.dependencies){let r=gG(A,q);await z(r.namespace,r.component,[...j,H])}let E=j1(D);if(U.set(H,{...E,registryName:q,baseUrl:Z.url,qualifiedName:H}),Q.delete(H),D.npmDependencies)for(let A of D.npmDependencies)_.add(A);if(D.npmDevDependencies)for(let A of D.npmDevDependencies)J.add(A);if(E.opencode)Y=J8(Y,E.opencode)}for(let q of v){let G=gG(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(_),npmDevDependencies:Array.from(J),opencode:Y}}var cG=b(()=>{t4();z$();V1();Y8()});import{statSync as tV}from"fs";import{mkdir as lG}from"fs/promises";import D4 from"path";function F0($){try{return tV($).isFile()}catch{return!1}}function K8($){let v=D4.resolve($);if(xJ(v)!=="local-project"){let I=D4.join(v,"opencode.jsonc"),X=D4.join(v,"opencode.json");if(F0(I))return{path:I,exists:!0};if(F0(X))return{path:X,exists:!0};return{path:I,exists:!1}}let _=D4.join(v,lJ,"opencode.jsonc"),J=D4.join(v,lJ,"opencode.json");if(F0(_))return{path:_,exists:!0};if(F0(J))return{path:J,exists:!0};let Y=D4.join(v,"opencode.jsonc"),z=D4.join(v,"opencode.json");if(F0(Y))return{path:Y,exists:!0};if(F0(z))return{path:z,exists:!0};return{path:_,exists:!1}}async function dG($){let{path:v,exists:U}=K8($);if(U)return{path:v,created:!1};return await lG(D4.dirname(v),{recursive:!0}),await Bun.write(v,aV),{path:v,created:!0}}async function dJ($){let{path:v,exists:U}=K8($);if(!U)return null;let _=await Bun.file(v).text();return{config:E$(_,[],{allowTrailingComma:!0}),content:_,path:v}}async function sV($,v){await Bun.write($,v)}function eV($,v){let Q=E$($,[],{allowTrailingComma:!0});for(let _ of v){if(Q===null||Q===void 0)return;if(typeof Q!=="object")return;Q=Q[_]}return Q}function pG($,v,U){if(U===null||U===void 0)return $;if(q4(U)){let _=eV($,v);if(_!==void 0&&(_===null||typeof _!=="object")){let Y=y1($,v,U,cJ);return C1($,Y)}let J=$;for(let[Y,z]of Object.entries(U))J=pG(J,[...v,Y],z);return J}if(Array.isArray(U)){let _=y1($,v,U,cJ);return C1($,_)}let Q=y1($,v,U,cJ);return C1($,Q)}async function pJ($,v){let U=await dJ($),Q,_,J=!1;if(U)Q=U.content,_=U.path;else{Q=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let X=D4.resolve($);_=xJ(X)!=="local-project"?D4.join(X,"opencode.jsonc"):D4.join(X,lJ,"opencode.jsonc"),await lG(D4.dirname(_),{recursive:!0}),J=!0}let Y=Q;Q=pG(Q,[],v);let z=Q!==Y;if(z)await sV(_,Q);return{path:_,created:J,changed:z}}var lJ=".opencode",cJ,aV=`{
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 iJ=b(()=>{E4();Z4();cJ={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
124
- `}}});function iG($){return $.replace(/\r\n/g,`
125
- `).trim()}function nJ($,v){return iG($)===iG(v)}import{existsSync as $M,lstatSync as vM}from"fs";import{rm as _M,unlink as UM}from"fs/promises";import{join as oG}from"path";function tG($,v){let U=[];for(let[Q,_]of Object.entries(v)){let J=$[Q]??null;if(J!==_)U.push({name:Q,from:J,to:_})}return{changed:U.length>0,entries:U}}function aG($,v){let U=oG($,"node_modules"),Q=v.map((_)=>_.name).join(", ");return{action:"delete",target:U,details:{reason:`dependency declarations changed (${Q}); invalidating to force reinstall`,path:U}}}function rG($){if($&&typeof $==="object"&&"code"in $)return String($.code);return"UNKNOWN"}function rJ($){if($ instanceof Error)return $.message;return String($)}function YM($){return new Promise((v)=>setTimeout(v,$))}async function sG($,v){let U=oG($,"node_modules"),Q=v?.rmImpl??((_,J)=>_M(_,J));if(!$M(U))return{success:!0,action:"none"};try{if(vM(U).isSymbolicLink())return await UM(U),{success:!0,action:"unlinked"}}catch(_){let J=rG(_);if(J==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:J,message:rJ(_)}}}for(let _=0;_<=nG;_++)try{return await Q(U,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(J){let Y=rG(J);if(Y==="ENOENT")return{success:!0,action:"none"};if(!QM.has(Y))return{success:!1,action:"failed",error:{code:Y,message:rJ(J)}};if(_<nG)await YM(JM*2**_);else return{success:!1,action:"failed",error:{code:Y,message:rJ(J)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var QM,nG=3,JM=100;var eG=b(()=>{QM=new Set(["EBUSY","ENOTEMPTY"])});function $j($,v){let U=0,Q,_="",J="";for(;U<$.length;U++)if(Q=$[U],_+=Q.open,J+=Q.close,~v.indexOf(Q.close))v=v.replace(Q.rgx,Q.close+Q.open);return _+v+J}function zM($,v){let U={has:$,keys:v};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 x$($,v){let U={open:`\x1B[${$}m`,close:`\x1B[${v}m`,rgx:new RegExp(`\\x1b\\[${v}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?$j(this.keys,Q+""):Q+"";return Q===void 0?zM([$],[U]):k$.enabled?$j([U],Q+""):Q+""}}var oJ,vj,_j,Uj,Qj=!0,k$,m;var O6=b(()=>{if(typeof process<"u")({FORCE_COLOR:oJ,NODE_DISABLE_COLORS:vj,NO_COLOR:_j,TERM:Uj}=process.env||{}),Qj=process.stdout&&process.stdout.isTTY;k$={enabled:!vj&&_j==null&&Uj!=="dumb"&&(oJ!=null&&oJ!=="0"||Qj),reset:x$(0,0),bold:x$(1,22),dim:x$(2,22),italic:x$(3,23),underline:x$(4,24),inverse:x$(7,27),hidden:x$(8,28),strikethrough:x$(9,29),black:x$(30,39),red:x$(31,39),green:x$(32,39),yellow:x$(33,39),blue:x$(34,39),magenta:x$(35,39),cyan:x$(36,39),white:x$(37,39),gray:x$(90,39),grey:x$(90,39),bgBlack:x$(40,49),bgRed:x$(41,49),bgGreen:x$(42,49),bgYellow:x$(43,49),bgBlue:x$(44,49),bgMagenta:x$(45,49),bgCyan:x$(46,49),bgWhite:x$(47,49)};m=k$});function Yj($,v){if($==null||$==="")return v;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 v}var IM,M1,Jj;var pv=b(()=>{IM=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&&!IM),Jj=Boolean(M1&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var N0,W,S4;var i$=b(()=>{O6();pv();if(!Jj)m.enabled=!1;N0={},W={info(...$){if(N0.quiet)return;console.log(m.blue("info"),...$)},success(...$){if(N0.quiet)return;console.log(m.green("\u2713"),...$)},warn(...$){if(N0.quiet)return;console.warn(m.yellow("warn"),...$)},error(...$){console.error(m.red("error"),...$)},debug(...$){if(!N0.verbose)return;console.log(m.gray("debug"),...$)},log(...$){if(N0.quiet)return;console.log(...$)},break(){if(N0.quiet)return;console.log("")}},S4={component:($)=>m.cyan($),path:($)=>m.green($),command:($)=>m.yellow($),url:($)=>m.blue().underline($),error:($)=>m.red($),dim:($)=>m.gray($),bold:($)=>m.bold($)}});function T4($,v={}){if(v.json){console.log(JSON.stringify($,null,2));return}if(v.quiet)return;if(W.info(S4.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=XM($.wouldPerform);for(let[_,J]of Object.entries(Q)){let Y=qM(_);W.info(`Would ${Y} ${J.length} item(s):`);for(let z of J){let I=GM(z.details);W.info(` \u2022 ${S4.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(v.hints&&v.hints.length>0){for(let Q of v.hints)W.info(S4.dim(Q));W.break()}W.info(S4.dim("Run without --dry-run to apply changes."))}function XM($){let v={};for(let U of $){if(!v[U.action])v[U.action]=[];v[U.action]?.push(U)}return v}function qM($){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[$]??$}function GM($){if(!$||Object.keys($).length===0)return"";let v=[];for(let[U,Q]of Object.entries($??{}))if(Q!==void 0&&Q!==null)v.push(`${U}: ${S4.dim(String(Q))}`);return v.length>0?` (${v.join(", ")})`:""}var w1=b(()=>{i$()});var zj={};s$(zj,{wrapAction:()=>jM,handleError:()=>_$});function _$($,v={}){if(v.json){let U=KM($);console.log(JSON.stringify(U,null,2)),process.exit(U.exitCode)}if($ instanceof b$)W.error($.message),process.exit($.exitCode);if($ instanceof B_){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 jM($){return async(...v)=>{try{await $(...v)}catch(U){_$(U)}}}function KM($){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 X1)return{success:!1,error:{code:$.code,message:$.message,details:{component:$.component,expected:$.expected,found:$.found}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof P$){let v={};if($.url)v.url=$.url;if($.status!==void 0)v.status=$.status;if($.statusText)v.statusText=$.statusText;if($.phase)v.phase=$.phase;if($.qualifiedName)v.qualifiedName=$.qualifiedName;if($.registryContext)v.registryContext=$.registryContext;if($.registryName)v.registryName=$.registryName;return{success:!1,error:{code:$.code,message:$.message,...Object.keys(v).length>0&&{details:v}},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 g6)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof r4)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile,reason:$.reason}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof X6)return{success:!1,error:{code:"BUILD_ERROR",message:$.message,details:{errors:$.errors}},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}};if($ instanceof n4){let v={url:$.url,issue:$.issue,remediation:$.remediation};if($.schemaUrl!==void 0)v.schemaUrl=$.schemaUrl;if($.supportedMajor!==void 0)v.supportedMajor=$.supportedMajor;if($.detectedMajor!==void 0)v.detectedMajor=$.detectedMajor;return{success:!1,error:{code:$.code,message:$.message,details:v},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof I1)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 B_)return{success:!1,error:{code:"VALIDATION_ERROR",message:$.issues.map((v)=>`${v.path.join(".")}: ${v.message}`).join("; "),details:{issues:$.issues.map((v)=>({path:v.path.join("."),message:v.message,code:v.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 l$=b(()=>{Z6();r_();z$();i$()});function F$($){console.log(JSON.stringify($,null,2))}function Xj($){if(!$)throw new M("npm package name cannot be empty");if($.length>Ij)throw new M(`npm package name exceeds maximum length of ${Ij} characters: \`${$}\``);if($.includes("..")||$.includes("/./")||$.startsWith("./"))throw new M(`Invalid npm package name - path traversal detected: \`${$}\``);if(!bM.test($))throw new M(`Invalid npm package name: \`${$}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function qj($){if(!$?.trim())throw new M("npm specifier cannot be empty");let v=$.trim();if(!v.startsWith("npm:"))throw new M(`Invalid npm specifier: \`${$}\`. Must start with \`npm:\` prefix.`);let U=v.slice(4);if(!U)throw new M(`Invalid npm specifier: \`${$}\`. Package name is required.`);let Q=U.lastIndexOf("@"),_,J;if(Q>0){let Y=U.slice(0,Q),z=U.slice(Q+1);if(Y.includes("/")||!Y.startsWith("@"))_=Y,J=z||void 0;else throw new M(`Invalid npm specifier: \`${$}\`. Scoped packages must have format @scope/pkg.`)}else _=U;return Xj(_),{type:"npm",name:_,version:J}}function Gj($){return $.trim().startsWith("npm:")}async function tJ($,v){Xj($);let U=$.startsWith("@")?`@${encodeURIComponent($.slice(1))}`:encodeURIComponent($),Q=`${HM}/${U}`;try{let _=v??AbortSignal.timeout(WM),J=await fetch(Q,{signal:_,headers:{Accept:"application/json"}});if(J.status===404)throw new B$(`npm package \`${$}\` not found on registry`);if(!J.ok)throw new P$(`Failed to fetch npm package \`${$}\`: HTTP ${J.status} ${J.statusText}`);return await J.json()}catch(_){if(_ instanceof B$||_ instanceof P$)throw _;if(_ instanceof Error&&(_.name==="AbortError"||_.name==="TimeoutError"))throw new P$(`Request to npm registry timed out for package \`${$}\``);let J=_ instanceof Error?_.message:String(_);throw new P$(`Failed to fetch npm package \`${$}\`: ${J}`)}}function S0($,v){return v?`${$}@${v}`:$}function jj($){let v=[];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"))v.push(`Package name \`${$.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:v}}async function H8($,v,U){let Q=await tJ($,U),_=v??Q["dist-tags"].latest,J=Q.versions[_];if(!J)throw new B$(`Version \`${_}\` not found for npm package \`${$}\``);return J}function Kj($){let v=$.trim(),U=v.lastIndexOf("@");if(U<=0)return v;let Q=v.slice(0,U);if(Q.includes("/")||!Q.startsWith("@"))return Q;return v}var HM="https://registry.npmjs.org",WM=30000,bM,Ij=214;var aJ=b(()=>{z$();bM=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function L1($,v){let U=$.get(v.absolutePath);if(!U){$.set(v.absolutePath,v);return}let Q=U.content.equals(v.content)?"identical content":"different content";throw new t$(`Intra-batch target collision at "${v.relativePath}". Both "${U.source}" and "${v.source}" resolve to this path with ${Q}. Rename one manifest target so each component writes to a unique path.`)}var W8=b(()=>{z$()});import{createHash as BM}from"crypto";import{existsSync as ZM}from"fs";import{join as DM}from"path";function k1($){return BM("sha256").update($).digest("hex")}async function b8($){let v=[...$].sort((Q,_)=>Q.path.localeCompare(_.path)),U=[];for(let Q of v){let _=k1(Q.content);U.push(`${Q.path}:${_}`)}return k1(U.join(`
126
- `))}async function iv($,v){let U=[],Q=[],_=[];for(let J of v.files){let Y=DM($,J.path);if(!ZM(Y)){Q.push(J.path),_.push({path:J.path,status:"missing"});continue}let z=await Bun.file(Y).text();if(k1(z)!==J.hash)U.push(J.path),_.push({path:J.path,status:"modified"});else _.push({path:J.path,status:"intact"})}return{intact:U.length===0&&Q.length===0,modified:U,missing:Q,details:_}}var T0=b(()=>{X4()});function Q4($){return $.addOption(g4.cwd()).addOption(g4.quiet()).addOption(g4.json())}function h4($){return $.addOption(g4.verbose())}function K6($){return $.addOption(g4.global)}function B8($){return $.addOption(g4.profile())}function Hj($){if(!$||$.length===0)throw new r4($,"cannot be empty");if($.length>32)throw new r4($,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test($))throw new r4($,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var g4;var s4=b(()=>{$8();z$();g4={cwd:()=>new w6("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new w6("-q, --quiet","Suppress output"),json:()=>new w6("--json","Output as JSON"),profile:()=>new w6("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new w6("-v, --verbose","Verbose output"),global:new w6("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function wM(){let $=new Map;for(let[v,U]of Object.entries(u$)){for(let[Q,_]of Object.entries(U))u$[Q]={open:`\x1B[${_[0]}m`,close:`\x1B[${_[1]}m`},U[Q]=u$[Q],$.set(_[0],_[1]);Object.defineProperty(u$,v,{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=Wj(),u$.color.ansi256=bj(),u$.color.ansi16m=Bj(),u$.bgColor.ansi=Wj(10),u$.bgColor.ansi256=bj(10),u$.bgColor.ansi16m=Bj(10),Object.defineProperties(u$,{rgbToAnsi256:{value(v,U,Q){if(v===U&&U===Q){if(v<8)return 16;if(v>248)return 231;return Math.round((v-8)/247*24)+232}return 16+36*Math.round(v/255*5)+6*Math.round(U/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(v){let U=/[a-f\d]{6}|[a-f\d]{3}/i.exec(v.toString(16));if(!U)return[0,0,0];let[Q]=U;if(Q.length===3)Q=[...Q].map((J)=>J+J).join("");let _=Number.parseInt(Q,16);return[_>>16&255,_>>8&255,_&255]},enumerable:!1},hexToAnsi256:{value:(v)=>u$.rgbToAnsi256(...u$.hexToRgb(v)),enumerable:!1},ansi256ToAnsi:{value(v){if(v<8)return 30+v;if(v<16)return 90+(v-8);let U,Q,_;if(v>=232)U=((v-232)*10+8)/255,Q=U,_=U;else{v-=16;let z=v%36;U=Math.floor(v/36)/5,Q=Math.floor(z/6)/5,_=z%6/5}let J=Math.max(U,Q,_)*2;if(J===0)return 30;let Y=30+(Math.round(_)<<2|Math.round(Q)<<1|Math.round(U));if(J===2)Y+=60;return Y},enumerable:!1},rgbToAnsi:{value:(v,U,Q)=>u$.ansi256ToAnsi(u$.rgbToAnsi256(v,U,Q)),enumerable:!1},hexToAnsi:{value:(v)=>u$.ansi256ToAnsi(u$.hexToAnsi256(v)),enumerable:!1}}),u$}var Wj=($=0)=>(v)=>`\x1B[${v+$}m`,bj=($=0)=>(v)=>`\x1B[${38+$};5;${v}m`,Bj=($=0)=>(v,U,Q)=>`\x1B[${38+$};2;${v};${U};${Q}m`,u$,sE,VM,MM,eE,LM,e4;var Zj=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]}},sE=Object.keys(u$.modifier),VM=Object.keys(u$.color),MM=Object.keys(u$.bgColor),eE=[...VM,...MM];LM=wM(),e4=LM});import sJ from"process";import kM from"os";import Dj from"tty";function c4($,v=globalThis.Deno?globalThis.Deno.args:sJ.argv){let U=$.startsWith("-")?"":$.length===1?"-":"--",Q=v.indexOf(U+$),_=v.indexOf("--");return Q!==-1&&(_===-1||Q<_)}function AM(){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 OM($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function FM($,{streamIsTTY:v,sniffFlags:U=!0}={}){let Q=AM();if(Q!==void 0)Z8=Q;let _=U?Z8:Q;if(_===0)return 0;if(U){if(c4("color=16m")||c4("color=full")||c4("color=truecolor"))return 3;if(c4("color=256"))return 2}if("TF_BUILD"in y$&&"AGENT_NAME"in y$)return 1;if($&&!v&&_===void 0)return 0;let J=_||0;if(y$.TERM==="dumb")return J;if(sJ.platform==="win32"){let Y=kM.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 Vj($,v={}){let U=FM($,{streamIsTTY:$&&$.isTTY,...v});return OM(U)}var y$,Z8,NM,Mj;var wj=b(()=>{({env:y$}=sJ);if(c4("no-color")||c4("no-colors")||c4("color=false")||c4("color=never"))Z8=0;else if(c4("color")||c4("colors")||c4("color=true")||c4("color=always"))Z8=1;NM={stdout:Vj({isTTY:Dj.isatty(1)}),stderr:Vj({isTTY:Dj.isatty(2)})},Mj=NM});function Lj($,v,U){let Q=$.indexOf(v);if(Q===-1)return $;let _=v.length,J=0,Y="";do Y+=$.slice(J,Q)+v+U,J=Q+_,Q=$.indexOf(v,J);while(Q!==-1);return Y+=$.slice(J),Y}function kj($,v,U,Q){let _=0,J="";do{let Y=$[Q-1]==="\r";J+=$.slice(_,Y?Q-1:Q)+v+(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,_=Q+1,Q=$.indexOf(`
129
- `,_)}while(Q!==-1);return J+=$.slice(_),J}function rv($){return TM($)}var Aj,Oj,eJ,R0,nv,Fj,E0,SM=($,v={})=>{if(v.level&&!(Number.isInteger(v.level)&&v.level>=0&&v.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let U=Aj?Aj.level:0;$.level=v.level===void 0?U:v.level},TM=($)=>{let v=(...U)=>U.join(" ");return SM(v,$),Object.setPrototypeOf(v,rv.prototype),v},$Y=($,v,U,...Q)=>{if($==="rgb"){if(v==="ansi16m")return e4[U].ansi16m(...Q);if(v==="ansi256")return e4[U].ansi256(e4.rgbToAnsi256(...Q));return e4[U].ansi(e4.rgbToAnsi(...Q))}if($==="hex")return $Y("rgb",v,U,...e4.hexToRgb(...Q));return e4[U][$](...Q)},RM,EM,vY=($,v,U)=>{let Q,_;if(U===void 0)Q=$,_=v;else Q=U.openAll+$,_=v+U.closeAll;return{open:$,close:v,openAll:Q,closeAll:_,parent:U}},D8=($,v,U)=>{let Q=(..._)=>PM(Q,_.length===1?""+_[0]:_.join(" "));return Object.setPrototypeOf(Q,EM),Q[eJ]=$,Q[R0]=v,Q[nv]=U,Q},PM=($,v)=>{if($.level<=0||!v)return $[nv]?"":v;let U=$[R0];if(U===void 0)return v;let{openAll:Q,closeAll:_}=U;if(v.includes("\x1B"))while(U!==void 0)v=Lj(v,U.close,U.open),U=U.parent;let J=v.indexOf(`
130
- `);if(J!==-1)v=kj(v,_,Q,J);return Q+v+_},xM,XP,Nj;var Sj=b(()=>{Zj();wj();({stdout:Aj,stderr:Oj}=Mj),eJ=Symbol("GENERATOR"),R0=Symbol("STYLER"),nv=Symbol("IS_EMPTY"),Fj=["ansi","ansi","ansi256","ansi16m"],E0=Object.create(null);Object.setPrototypeOf(rv.prototype,Function.prototype);for(let[$,v]of Object.entries(e4))E0[$]={get(){let U=D8(this,vY(v.open,v.close,this[R0]),this[nv]);return Object.defineProperty(this,$,{value:U}),U}};E0.visible={get(){let $=D8(this,this[R0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};RM=["rgb","hex","ansi256"];for(let $ of RM){E0[$]={get(){let{level:U}=this;return function(...Q){let _=vY($Y($,Fj[U],"color",...Q),e4.color.close,this[R0]);return D8(this,_,this[nv])}}};let v="bg"+$[0].toUpperCase()+$.slice(1);E0[v]={get(){let{level:U}=this;return function(...Q){let _=vY($Y($,Fj[U],"bgColor",...Q),e4.bgColor.close,this[R0]);return D8(this,_,this[nv])}}}}EM=Object.defineProperties(()=>{},{...E0,level:{enumerable:!0,get(){return this[eJ].level},set($){this[eJ].level=$}}});Object.defineProperties(rv.prototype,E0);xM=rv(),XP=rv({level:Oj?Oj.level:0}),Nj=xM});function _Y($,v,{ignoreNonConfigurable:U=!1}={}){let{name:Q}=$;for(let _ of Reflect.ownKeys(v))uM($,v,_,U);return CM($,v),hM($,v,Q),$}var uM=($,v,U,Q)=>{if(U==="length"||U==="prototype")return;if(U==="arguments"||U==="caller")return;let _=Object.getOwnPropertyDescriptor($,U),J=Object.getOwnPropertyDescriptor(v,U);if(!yM(_,J)&&Q)return;Object.defineProperty($,U,J)},yM=function($,v){return $===void 0||$.configurable||$.writable===v.writable&&$.enumerable===v.enumerable&&$.configurable===v.configurable&&($.writable||$.value===v.value)},CM=($,v)=>{let U=Object.getPrototypeOf(v);if(U===Object.getPrototypeOf($))return;Object.setPrototypeOf($,U)},fM=($,v)=>`/* Wrapped ${$}*/
131
- ${v}`,mM,gM,hM=($,v,U)=>{let Q=U===""?"":`with ${U.trim()}() `,_=fM.bind(null,Q,v.toString());Object.defineProperty(_,"name",gM);let{writable:J,enumerable:Y,configurable:z}=mM;Object.defineProperty($,"toString",{value:_,writable:J,enumerable:Y,configurable:z})};var Tj=b(()=>{mM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var V8,Rj=($,v={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let U,Q=0,_=$.displayName||$.name||"<anonymous>",J=function(...Y){if(V8.set(J,++Q),Q===1)U=$.apply(this,Y),$=void 0;else if(v.throw===!0)throw Error(`Function \`${_}\` can only be called once`);return U};return _Y(J,$),V8.set(J,Q),J},Ej;var Pj=b(()=>{Tj();V8=new WeakMap;Rj.callCount=($)=>{if(!V8.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return V8.get($)};Ej=Rj});var A1;var xj=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 uj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(QY[UY])return QY[UY];cM(QY,UY,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,v){this.listeners[$].push(v)}removeListener($,v){let U=this.listeners[$],Q=U.indexOf(v);if(Q===-1)return;if(Q===0&&U.length===1)U.length=0;else U.splice(Q,1)}emit($,v,U){if(this.emitted[$])return!1;this.emitted[$]=!0;let Q=!1;for(let _ of this.listeners[$])Q=_(v,U)===!0||Q;if($==="exit")Q=this.emit("afterExit",v,U)||Q;return Q}}class YY{}var M8=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",UY,QY,cM,lM=($)=>{return{onExit(v,U){return $.onExit(v,U)},load(){return $.load()},unload(){return $.unload()}}},yj,Cj,JY,fj,bP,BP;var mj=b(()=>{xj();UY=Symbol.for("signal-exit emitter"),QY=globalThis,cM=Object.defineProperty.bind(Object);yj=class yj extends YY{onExit(){return()=>{}}load(){}unload(){}};Cj=class Cj extends YY{#J=JY.platform==="win32"?"SIGINT":"SIGHUP";#U=new uj;#_;#$;#Q;#v={};#Y=!1;constructor($){super();this.#_=$,this.#v={};for(let v of A1)this.#v[v]=()=>{let U=this.#_.listeners(v),{count:Q}=this.#U,_=$;if(typeof _.__signal_exit_emitter__==="object"&&typeof _.__signal_exit_emitter__.count==="number")Q+=_.__signal_exit_emitter__.count;if(U.length===Q){this.unload();let J=this.#U.emit("exit",null,v),Y=v==="SIGHUP"?this.#J:v;if(!J)$.kill($.pid,Y)}};this.#Q=$.reallyExit,this.#$=$.emit}onExit($,v){if(!M8(this.#_))return()=>{};if(this.#Y===!1)this.load();let U=v?.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 v=this.#v[$];if(v)this.#_.on($,v)}catch(v){}this.#_.emit=($,...v)=>{return this.#G($,...v)},this.#_.reallyExit=($)=>{return this.#I($)}}unload(){if(!this.#Y)return;this.#Y=!1,A1.forEach(($)=>{let v=this.#v[$];if(!v)throw Error("Listener not defined for signal: "+$);try{this.#_.removeListener($,v)}catch(U){}}),this.#_.emit=this.#$,this.#_.reallyExit=this.#Q,this.#U.count-=1}#I($){if(!M8(this.#_))return 0;return this.#_.exitCode=$||0,this.#U.emit("exit",this.#_.exitCode,null),this.#Q.call(this.#_,this.#_.exitCode)}#G($,...v){let U=this.#$;if($==="exit"&&M8(this.#_)){if(typeof v[0]==="number")this.#_.exitCode=v[0];let Q=U.call(this.#_,$,...v);return this.#U.emit("exit",this.#_.exitCode,null),Q}else return U.call(this.#_,$,...v)}};JY=globalThis.process,{onExit:fj,load:bP,unload:BP}=lM(M8(JY)?new Cj(JY):new yj)});import w8 from"process";var gj,dM,hj;var cj=b(()=>{Pj();mj();gj=w8.stderr.isTTY?w8.stderr:w8.stdout.isTTY?w8.stdout:void 0,dM=gj?Ej(()=>{fj(()=>{gj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},hj=dM});import lj from"process";var L8=!1,P0,zY;var dj=b(()=>{cj();P0={};P0.show=($=lj.stderr)=>{if(!$.isTTY)return;L8=!1,$.write("\x1B[?25h")};P0.hide=($=lj.stderr)=>{if(!$.isTTY)return;hj(),L8=!0,$.write("\x1B[?25l")};P0.toggle=($,v)=>{if($!==void 0)L8=$;if(L8)P0.show(v);else P0.hide(v)};zY=P0});var IY;var pj=b(()=>{IY={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 ov,NP;var ij=b(()=>{pj();ov=IY,NP=Object.keys(IY)});import iM from"tty";var nM,J$=($,v)=>{if(!nM)return(_)=>_;let U=`\x1B[${$}m`,Q=`\x1B[${v}m`;return(_)=>{let J=_+"",Y=J.indexOf(Q);if(Y===-1)return U+J+Q;let z=U,I=0,q=(v===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}},RP,EP,PP,xP,uP,yP,CP,fP,mP,gP,nj,rj,oj,tj,hP,cP,lP,dP,pP,iP,nP,rP,oP,tP,aP,sP,eP,$x,vx,_x,Ux,Qx,Jx,Yx,zx,Ix,Xx,qx,Gx,jx,Kx;var XY=b(()=>{nM=iM?.WriteStream?.prototype?.hasColors?.()??!1,RP=J$(0,0),EP=J$(1,22),PP=J$(2,22),xP=J$(3,23),uP=J$(4,24),yP=J$(53,55),CP=J$(7,27),fP=J$(8,28),mP=J$(9,29),gP=J$(30,39),nj=J$(31,39),rj=J$(32,39),oj=J$(33,39),tj=J$(34,39),hP=J$(35,39),cP=J$(36,39),lP=J$(37,39),dP=J$(90,39),pP=J$(40,49),iP=J$(41,49),nP=J$(42,49),rP=J$(43,49),oP=J$(44,49),tP=J$(45,49),aP=J$(46,49),sP=J$(47,49),eP=J$(100,49),$x=J$(91,39),vx=J$(92,39),_x=J$(93,39),Ux=J$(94,39),Qx=J$(95,39),Jx=J$(96,39),Yx=J$(97,39),zx=J$(101,49),Ix=J$(102,49),Xx=J$(103,49),qx=J$(104,49),Gx=J$(105,49),jx=J$(106,49),Kx=J$(107,49)});var aj=b(()=>{XY();XY()});import sj from"process";function tv(){let{env:$}=sj,{TERM:v,TERM_PROGRAM:U}=$;if(sj.platform!=="win32")return v!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||U==="Terminus-Sublime"||U==="vscode"||v==="xterm-256color"||v==="alacritty"||v==="rxvt-unicode"||v==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qY=()=>{};var O1={};s$(O1,{warning:()=>aM,success:()=>tM,info:()=>oM,error:()=>sM});var k8,oM,tM,aM,sM;var ej=b(()=>{aj();qY();k8=tv(),oM=tj(k8?"\u2139":"i"),tM=rj(k8?"\u2714":"\u221A"),aM=oj(k8?"\u26A0":"\u203C"),sM=nj(k8?"\u2716":"\xD7")});var $K=b(()=>{ej()});function GY({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 jY($){if(typeof $!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(eM,"")}var eM;var vK=b(()=>{eM=GY()});var A8,O8,KY,HY,av;var _K=b(()=>{A8=[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],O8=[12288,12288,65281,65376,65504,65510],KY=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HY=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],av=[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 F8=($,v)=>{let U=0,Q=Math.floor($.length/2)-1;while(U<=Q){let _=Math.floor((U+Q)/2),J=_*2;if(v<$[J])Q=_-1;else if(v>$[J+1])U=_+1;else return!0}return!1};function Iw($){let v=$[0],U=$[1];for(let Q=0;Q<$.length;Q+=2){let _=$[Q],J=$[Q+1];if(UK>=_&&UK<=J)return[_,J];if(J-_>U-v)v=_,U=J}return[v,U]}var $w,vw,_w,Uw,Nx,Sx,Tx,Rx,Qw,Jw,UK=19968,Yw,zw,QK=($)=>{if($<$w||$>vw)return!1;return F8(A8,$)},JK=($)=>{if($<_w||$>Uw)return!1;return F8(O8,$)},YK=($)=>{if($>=Yw&&$<=zw)return!0;if($<Qw||$>Jw)return!1;return F8(av,$)};var zK=b(()=>{_K();$w=A8[0],vw=A8.at(-1),_w=O8[0],Uw=O8.at(-1),Nx=KY[0],Sx=KY.at(-1),Tx=HY[0],Rx=HY.at(-1),Qw=av[0],Jw=av.at(-1),[Yw,zw]=Iw(av)});function Xw($){if(!Number.isSafeInteger($))throw TypeError(`Expected a code point, got \`${typeof $}\`.`)}function WY($,{ambiguousAsWide:v=!1}={}){if(Xw($),JK($)||YK($)||v&&QK($))return 2;return 1}var IK=b(()=>{zK()});function bw($){if($.length>50)return!1;if(Hw.test($))return!0;if($.includes("\u200D")){let v=$.match(Ww);return v!==null&&v.length>=2}return!1}function Bw($){return $.replace(jw,"")}function Zw($){return Gw.test($)}function Dw($,v){let U=0;if($.length>1){for(let Q of $.slice(1))if(Q>="\uFF00"&&Q<="\uFFEF")U+=WY(Q.codePointAt(0),v)}return U}function bY($,v={}){if(typeof $!=="string"||$.length===0)return 0;let{ambiguousIsNarrow:U=!0,countAnsiEscapeCodes:Q=!1}=v,_=$;if(!Q&&(_.includes("\x1B")||_.includes("\x9B")))_=jY(_);if(_.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(_))return _.length;let J=0,Y={ambiguousAsWide:!U};for(let{segment:z}of qw.segment(_)){if(Zw(z))continue;if(Kw.test(z)||bw(z)){J+=2;continue}let I=Bw(z).codePointAt(0);J+=WY(I,Y),J+=Dw(z,Y)}return J}var qw,Gw,jw,Kw,Hw,Ww;var XK=b(()=>{vK();IK();qw=new Intl.Segmenter,Gw=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,jw=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Kw=/^\p{RGI_Emoji}$/v,Hw=/^[\d#*]\u20E3$/,Ww=/\p{Extended_Pictographic}/gu});function BY({stream:$=process.stdout}={}){return Boolean($&&$.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import x0 from"process";class qK{#J=0;#U;#_=!1;#$=!1;#Q=($)=>{if(!$?.length)return;if((typeof $==="string"?$.codePointAt(0):$[0])===Vw)if(x0.listenerCount("SIGINT")>0)x0.emit("SIGINT");else x0.kill(x0.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#v()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#Y()}#v(){let{stdin:$}=x0;if(x0.platform==="win32"||!$?.isTTY||typeof $.setRawMode!=="function"){this.#U=void 0;return}if(this.#U=$,this.#_=$.isPaused(),this.#$=Boolean($.isRaw),$.setRawMode(!0),$.prependListener("data",this.#Q),this.#_)$.resume()}#Y(){if(!this.#U)return;let $=this.#U;if($.off("data",this.#Q),$.isTTY)$.setRawMode?.(this.#$);if(this.#_)$.pause();this.#U=void 0,this.#_=!1,this.#$=!1}}var Vw=3,Mw,ZY;var GK=b(()=>{Mw=new qK,ZY=Object.freeze(Mw)});import sv from"process";import{stripVTControlCharacters as ww}from"util";class jK{#J=0;#U=-1;#_=0;#$;#Q;#v;#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()}#V($,v){if($===void 0||$===null)return"";if(typeof $==="string")return $;if(Buffer.isBuffer($)||ArrayBuffer.isView($)){let U=typeof v==="string"&&v&&v!=="buffer"?v:"utf8";return Buffer.from($).toString(U)}return String($)}#M($){if(!$)return!1;let v=$.at(-1);return v===`
132
- `||v==="\r"}#w(){if(this.#z)return;if(this.#z=setTimeout(()=>{if(this.#z=void 0,this.isSpinning)this.#H()},Lw),typeof this.#z?.unref==="function")this.#z.unref()}#W(){if(this.#z)clearTimeout(this.#z),this.#z=void 0}#b($,v,U,Q){let _=this.#Z(U," "),Y=typeof v==="string"?($?" ":"")+v:"",z=this.#D(Q," ");return _+$+Y+z}constructor($){if(typeof $==="string")$={text:$};if(this.#$={color:"cyan",stream:sv.stderr,discardStdin:!0,hideCursor:!0,...$},this.color=this.#$.color,this.#v=this.#$.stream,typeof this.#$.isEnabled!=="boolean")this.#$.isEnabled=BY({stream:this.#v});if(typeof this.#$.isSilent!=="boolean")this.#$.isSilent=!1;let v=this.#$.interval;if(this.spinner=this.#$.spinner,this.#$.interval=v,this.text=this.#$.text,this.prefixText=this.#$.prefixText,this.suffixText=this.#$.suffixText,this.indent=this.#$.indent,sv.env.NODE_ENV==="test")this._stream=this.#v,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.#v.columns??80,Q=typeof this.#$.prefixText==="function"?"":this.#$.prefixText,_=typeof this.#$.suffixText==="function"?"":this.#$.suffixText,J=typeof Q==="string"&&Q!==""?Q+" ":"",Y=typeof _==="string"&&_!==""?" "+_:"",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((v)=>typeof v!=="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(!tv())this.#Q=ov.line;else if($===void 0)this.#Q=ov.dots;else if($!=="default"&&ov[$])this.#Q=ov[$];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($,v,U=!1){let Q=typeof $==="function"?$():$;if(typeof Q==="string"&&Q!=="")return U?v+Q:Q+v;return""}#Z($=this.#$.prefixText,v=" "){return this.#B($,v,!1)}#D($=this.#$.suffixText,v=" "){return this.#B($,v,!0)}#K($,v){let U=0;for(let Q of ww($).split(`
133
- `))U+=Math.max(1,Math.ceil(bY(Q)/v));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.#_>=this.interval)this.#U=(this.#U+1)%this.#Q.frames.length,this.#_=$;let{frames:v}=this.#Q,U=v[this.#U];if(this.color)U=Nj[this.color](U);let Q=this.#Z(this.#$.prefixText," "),_=typeof this.text==="string"?" "+this.text:"",J=this.#D(this.#$.suffixText," ");return Q+U+_+J}clear(){if(!this.isEnabled||!this.#v.isTTY)return this;return this.#q(()=>{this.#v.cursorTo(0);for(let $=0;$<this.#J;$++){if($>0)this.#v.moveCursor(0,-1);this.#v.clearLine(1)}if(this.#$.indent)this.#v.cursorTo(this.#$.indent)}),this.#J=0,this}#L($){if(!$||this.#I.has($)||!$.isTTY||typeof $.write!=="function")return;if(N8.has($))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let v=$.write;this.#I.set($,v),N8.set($,this),$.write=(U,Q,_)=>this.#O($,v,U,Q,_)}#k(){if(!this.isEnabled||this.#I.size>0)return;let $=new Set([this.#v,sv.stdout,sv.stderr]);for(let v of $)this.#L(v)}#A(){for(let[$,v]of this.#I)if($.write=v,N8.get($)===this)N8.delete($);this.#I.clear()}#O($,v,U,Q,_){if(typeof Q==="function")_=Q,Q=void 0;if(this.#G)return v.call($,U,Q,_);this.clear();let J=this.#V(U,Q),Y=this.#M(J),z=v.call($,U,Q,_);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.#v.isTTY,v=!1;try{if($)this.#q(()=>this.#v.write(kw)),v=!0;this.clear();let U=this.frame(),Q=this.#v.columns??80,_=this.#K(U,Q),J=this.#v.rows;if(J&&J>1&&_>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.#v.write(U))===!1&&this.#v.isTTY)this.#X=()=>{this.#X=void 0,this.#H()},this.#v.once("drain",this.#X);this.#J=this.#K(U,Q)}finally{if(v)this.#q(()=>this.#v.write(Aw))}return this}start($){if($)this.text=$;if(this.isSilent)return this;if(!this.isEnabled){let v=this.text?"-":"",U=" ".repeat(this.#$.indent)+this.#b(v,this.text,this.#$.prefixText,this.#$.suffixText);if(U.trim()!=="")this.#q(()=>this.#v.write(U+`
136
- `));return this}if(this.isSpinning)return this;if(this.#$.hideCursor)zY.hide(this.#v);if(this.#$.discardStdin&&sv.stdin.isTTY)ZY.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.#_=0,this.#W(),this.#A(),this.#X)this.#v.removeListener("drain",this.#X),this.#X=void 0;if(this.isEnabled){if(this.clear(),this.#$.hideCursor)zY.show(this.#v)}if(this.#j)this.#j=!1,ZY.stop();return this}succeed($){return this.stopAndPersist({symbol:O1.success,text:$})}fail($){return this.stopAndPersist({symbol:O1.error,text:$})}warn($){return this.stopAndPersist({symbol:O1.warning,text:$})}info($){return this.stopAndPersist({symbol:O1.info,text:$})}stopAndPersist($={}){if(this.isSilent)return this;let v=$.symbol??" ",U=$.text??this.text,Q=$.prefixText??this.#$.prefixText,_=$.suffixText??this.#$.suffixText,J=this.#b(v,U,Q,_)+`
137
- `;return this.stop(),this.#q(()=>this.#v.write(J)),this}}function DY($){return new jK($)}var Lw=200,kw="\x1B[?2026h",Aw="\x1B[?2026l",N8;var KK=b(()=>{Sj();dj();ij();$K();XK();qY();GK();N8=new Map});function D$($){let v=M1&&!$.quiet;return DY({text:$.text,isSilent:!v})}var $6=b(()=>{KK();pv()});function HK($){let[v=""]=$.split("-"),U=v.split("."),Q=parseInt(U[0]??"",10),_=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(_)||Number.isNaN(J))return null;return{major:Q,minor:_,patch:J}}function Ow($,v){let U=HK($),Q=HK(v);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 WK($,v,U){if(!$)return{compatible:!0};let Q=Ow(v,$);if(Q===null)return{compatible:!0};if(Q>=0)return{compatible:!0};return{compatible:!1,required:$,installed:v,type:U}}function Fw($,v){let U=v.type==="opencode"?"OpenCode":"OCX CLI",Q=v.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
138
- ${m.yellow().bold("\u26A0 WARN")} ${m.yellow("Version compatibility notice")}
139
-
140
- Registry ${m.cyan(`"${$}"`)} requires ${U} ${m.green(v.required)}
141
- You are running ${U} ${m.red(v.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: ${m.dim(Q)}
143
+ consider updating: ${P.dim(q)}
145
144
 
146
- To silence: ${m.dim("--skip-compat-check")} or set ${m.dim('"skipCompatCheck": true')} in ocx.jsonc
147
- `}function bK($){let{registry:v,ocxVersion:U,opencodeVersion:Q}=$,_=[],J=WK(v.ocx,U,"ocx");if(!J.compatible)_.push(J);if(Q){let Y=WK(v.opencode,Q,"opencode");if(!Y.compatible)_.push(Y)}return _}function BK($,v){for(let U of v)W.log(Fw($,U))}var ZK=b(()=>{O6();i$()});import{randomUUID as DK}from"crypto";import{existsSync as l4}from"fs";import{lstat as Nw,mkdir as wY,rename as VY,rm as u0,stat as LK,writeFile as Sw}from"fs/promises";import{dirname as S8,isAbsolute as Tw,join as G4,relative as Rw,resolve as VK}from"path";function Ew($,v){if(!$?.installed)return null;for(let[U,Q]of Object.entries($.installed))if(Q.files?.some((_)=>_.path===v))return U;return null}function MK($){let v=$.split("::")[1];if(!v)return $;return v.split("@")[0]||$}function Pw($){if(!$?.trim())throw new M("Component name cannot be empty");let v=$.trim();if(Gj(v)){let U=qj(v);return{type:"npm",name:U.name,version:U.version}}if(v.includes("/")){let{namespace:U,component:Q}=o4(v);return{type:"registry",namespace:U,component:Q}}return{type:"registry",namespace:"",component:v}}function kK($){let v=$.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(v),h4(v),K6(v),v.action(async(U,Q)=>{try{let _=Q.json?{...Q,quiet:!0,verbose:!1}:Q,J;if(_.profile){let Y=await j6.create(_.cwd??process.cwd(),{profile:_.profile});J={cwd:h$(_.profile),getRegistries:()=>Y.getRegistries(),getComponentPath:()=>Y.getComponentPath()}}else if(_.global)J=await L0.requireInitialized();else J=await f4.requireInitialized(_.cwd??process.cwd());await LY(U,_,J)}catch(_){_$(_,{json:Q.json})}})}async function LY($,v,U){let Q=U.cwd,_=$.map(Pw),J=_.filter((G)=>G.type==="npm"),Y=_.filter((G)=>G.type==="registry"),z=Boolean(v.json&&J.length>0&&Y.length>0),I=z?{...v,json:!1,quiet:!0,verbose:!1}:v,X,q;if(J.length>0)X=await xw(J,I,Q,!z);if(Y.length>0){let G=Y.map((j)=>j.namespace?`${j.namespace}/${j.component}`:j.component);q=await uw(G,I,U,!z)}if(z)F$({success:!0,plugins:X?.plugins??[],installed:q?.installed??[],opencode:q?.opencode??!1,dryRun:Boolean(X?.dryRun||q?.dryRun)})}async function xw($,v,U,Q=!0){let _=v.quiet?null:D$({text:"Validating npm packages..."});_?.start();try{let J=[];for(let H of $)if(await tJ(H.name),!v.trust)try{let Z=await H8(H.name,H.version),D=jj(Z);J.push(...D.warnings)}catch(Z){if(Z instanceof M)throw _?.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(_?.succeed(`Validated ${$.length} npm package(s)`),J.length>0&&!v.quiet){W.info("");for(let H of J)W.warn(H)}let z=(await dJ(U))?.config.plugin??[],I=new Map;for(let H of z){let Z=Kj(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(v.dryRun){let Z={dryRun:!0,command:"add",wouldPerform:$.map((D)=>({action:"add",target:S0(D.name,D.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${$.length} npm plugin(s)`};if(Q||!v.json)T4(Z,{json:v.json,quiet:v.quiet});return{plugins:$.map((D)=>S0(D.name,D.version)),dryRun:!0}}if(await pJ(U,{plugin:G}),!v.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(v.json&&Q)F$({success:!0,plugins:j});return{plugins:j,dryRun:!1}}catch(J){throw _?.fail("Failed to add npm plugins"),J}}async function uw($,v,U,Q=!0){let _=Boolean(v.quiet||v.json),J=U.cwd,Y=!!(v.global||v.profile),z=U.getRegistries(),I=z;if(v.from){let Z=v.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 D=new Set;for(let A of $){let{namespace:r}=o4(A);D.add(r)}if(D.size>1){let A=Array.from(D).join(", ");throw new M(`Mixed registry prefixes in --from call: ${A}.
154
- When using --from, all components must use the same prefix.`)}let E=Array.from(D)[0];if(!E)throw new M("No valid component references provided");await r6(Z),I={...z,[E]:{url:Z}}}let X={version:1,root:J,installed:{}},q=await F4(J);if(q)X=q;let G=_?null:D$({text:"Resolving dependencies..."});G?.start();let j=null,H=null;try{let Z=new Set;for(let x of $){let{namespace:o}=o4(x);Z.add(o)}for(let x of Z){let o=I[x];if(o)await r6(o.url)}let D=await hG(I,$);if(v.verbose){W.info("Install order:");for(let x of D.installOrder)W.info(` - ${x}`)}let E=new Map,A=new Map;for(let x of D.components)if(!A.has(x.registryName))A.set(x.registryName,x.baseUrl);for(let[x,o]of A){let y=await r6(o);E.set(x,y)}if(G?.succeed(`Resolved ${D.components.length} components from ${E.size} registries`),!v.skipCompatCheck&&!_)for(let[x,o]of E){let y=bK({registry:{opencode:o.opencode,ocx:o.ocx},ocxVersion:Gq});BK(x,y)}if(v.dryRun){let x=D.components.map((y)=>({action:"add",target:`${y.registryName}/${y.name}`,details:{type:y.type}}));if(D.npmDependencies.length>0||D.npmDevDependencies.length>0){let y=v.global||v.profile?J:G4(J,".opencode"),I$=[...D.npmDependencies,...D.npmDevDependencies].map((v$)=>{let R$=v$.lastIndexOf("@"),X$=R$>0?v$.slice(0,R$):v$,j4=R$>0?v$.slice(R$+1):"*";return{name:X$,from:null,to:j4}});x.push(aG(y,I$))}let o={dryRun:!0,command:"add",wouldPerform:x,validation:{passed:!0},summary:`Would add ${D.components.length} component(s)`};if(Q||!v.json)T4(o,{json:v.json,quiet:v.quiet});return{installed:D.installOrder,opencode:Boolean(D.opencode),dryRun:!0}}let O=_?null:D$({text:"Fetching components..."});O?.start();let g=[];for(let x of D.components){let o=[];for(let v$ of x.files){let R$=await D1(x.baseUrl,x.name,v$.path);o.push({path:v$.path,content:Buffer.from(R$)})}let y=await b8(o);for(let v$ of x.files){let R$=H1(v$.target,Y,J),X$=G4(J,R$);try{O4(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(([v$,R$])=>p$(R$.registryUrl)===p$(x.baseUrl)&&R$.registryName===x.registryName&&R$.name===x.name);if(h.length>0){let v$=h[0];if(v$){let[R$,X$]=v$;if(X$.hash!==y)throw O?.fail("Integrity check failed"),new X1(R$,X$.hash,y)}}let I$=Cv(x.baseUrl,x.registryName,x.name,`sha256:${y}`);g.push({component:x,files:o,computedHash:y,canonicalId:I$})}O?.succeed(`Fetched ${D.components.length} components`);let w=new Map;for(let{component:x,files:o}of g)for(let y of o){let h=x.files.find((R$)=>R$.path===y.path);if(!h)continue;let I$=H1(h.target,Y,J),v$=G4(J,I$);L1(w,{absolutePath:v$,relativePath:I$,content:y.content,source:`${x.registryName}/${x.name}:${h.path}`})}let N=[];for(let x of w.values()){if(!l4(x.absolutePath))continue;let o=await Bun.file(x.absolutePath).text(),y=x.content.toString("utf-8");if(!nJ(o,y)){let h=Ew(X,x.relativePath);N.push({path:x.relativePath,owningComponent:h})}}if(N.length>0){let x=N.filter((h)=>h.owningComponent!==null),o=N.filter((h)=>h.owningComponent===null);if(!_){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$=MK(h.owningComponent);W.error(` \u2717 ${h.path} (from ${I$})`)}}if(o.length>0){W.error(""),W.error("Files not managed by OCX (resolve manually):");for(let h of o)W.error(` \u2717 ${h.path}`)}W.error("")}let y=`${N.length} file(s) have conflicts.
155
- `;if(x.length>0){let h=new Set(x.filter((I$)=>I$.owningComponent!==null).map((I$)=>MK(I$.owningComponent)));y+=`For OCX-managed files, use 'ocx update ${Array.from(h).join(" ")}' or 'ocx remove ${Array.from(h).join(" ")}'.
156
- `}if(o.length>0)y+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new t$(y.trim())}let L=_?null:D$({text:"Installing components..."});L?.start(),H=await gw({cwd:J,isFlattened:Y,trackOpencodeConfig:Boolean(D.opencode&&Object.keys(D.opencode).length>0),trackNpmManifests:D.npmDependencies.length>0||D.npmDevDependencies.length>0,quiet:v.quiet});let U$=hw({quiet:v.quiet});j=U$;for(let{component:x,files:o,computedHash:y,canonicalId:h}of g){let I$=await cw(x,o,J,Y,U$,{verbose:v.verbose});if(v.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(!E.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 o){let j4=x.files.find((E1)=>E1.path===X$.path);if(!j4)throw Error(`File ${X$.path} not found in component manifest`);let e8=H1(j4.target,Y,J);R$.push({path:e8,hash:k1(X$.content)})}X.installed[h]={registryUrl:x.baseUrl,registryName:x.registryName,name:x.name,revision:`sha256:${y}`,hash:y,files:R$,installedAt:new Date().toISOString(),...x.opencode&&{opencode:x.opencode}}}if(L?.succeed(`Installed ${D.components.length} components`),D.opencode&&Object.keys(D.opencode).length>0){let x=await pJ(J,D.opencode);if(!v.quiet&&x.changed)if(x.created)W.info(`Created ${x.path}`);else W.info(`Updated ${x.path}`)}let $$=D.npmDependencies.length>0,a=D.npmDevDependencies.length>0,V$=v.global||v.profile?G4(J,"package.json"):G4(J,".opencode/package.json");if($$||a){let x=_?null:D$({text:`Updating ${V$}...`});x?.start();try{let o=!!(v.global||v.profile),y=await rw(J,D.npmDependencies,D.npmDevDependencies,{isFlattened:o}),h=D.npmDependencies.length+D.npmDevDependencies.length;if(x?.succeed(`Added ${h} dependencies to ${V$}`),y.changed){let I$=await sG(y.packageDir);if(I$.success&&I$.action!=="none"){if(!_)W.info(`Invalidated ${G4(y.packageDir,"node_modules")} to force reinstall`)}else if(!I$.success){let v$=G4(y.packageDir,"node_modules");W.warn(`Could not invalidate ${v$}: ${I$.error?.message??"unknown error"}. Run \`rm -rf "${v$}"\` manually to force reinstall.`)}}}catch(o){throw x?.fail(`Failed to update ${V$}`),o}}if(await y4(J,X),!j)throw Error("Internal error: missing add write transaction after install phase.");if(await j.commit(),j=null,H?.commit(),H=null,v.json&&Q)F$({success:!0,installed:D.installOrder,opencode:!!D.opencode});else if(!v.quiet)W.info(""),W.success(`Done! Installed ${D.components.length} components.`);return{installed:D.installOrder,opencode:!!D.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 MY($,v,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${v}" (${Q})`}function yw($,v){let U=Rw(v,$);return U!==""&&!U.startsWith("..")&&!Tw(U)}async function Cw($,v){let U=VK($),Q=VK(v);while(yw(U,Q)){let _=!0;try{if(!(await Nw(U)).isDirectory())break}catch(Y){if(Y.code==="ENOENT")_=!1;else throw Y}try{if(_)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=S8(U);if(J===U)break;U=J}}async function fw($){let v;try{v=await LK($)}catch(U){let Q=U.code;if(Q==="ENOENT"||Q==="ENOTDIR")return{path:$,state:"missing",content:""};throw U}if(!v.isFile())return{path:$,state:"non-file",content:""};return{path:$,state:"file",content:await Bun.file($).text()}}async function mw($,v){if($.state==="file"){await wY(S8($.path),{recursive:!0}),await Bun.write($.path,$.content);return}if($.state==="non-file")return;if(l4($.path))await u0($.path,{force:!0,recursive:!0});await Cw(S8($.path),v)}async function gw($){let v=[],U=new Set,Q=!1,_=async(z)=>{if(U.has(z))return;U.add(z),v.push(await fw(z))};if($.trackOpencodeConfig){let z=K8($.cwd).path;await _(z)}if($.trackNpmManifests){let z=$.isFlattened?$.cwd:G4($.cwd,".opencode");if(await _(G4(z,"package.json")),!$.isFlattened)await _(G4(z,".gitignore"))}return await _(d6($.cwd).path),{rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of[...v].reverse())try{await mw(I,$.cwd)}catch(X){z.push(MY("Add rollback cleanup warning: failed to restore",I.path,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:()=>{Q=!0}}}function hw($){let v=[],U=new Set,Q=!1;return{writeFileAtomically:async({targetPath:z,resolvedTarget:I,content:X})=>{let q=S8(z);if(!l4(q))await wY(q,{recursive:!0});if(l4(z)){if((await LK(z)).isDirectory())throw new M(`Cannot install "${I}": target path is a directory.`)}let G=`${z}.ocx-add-tmp-${DK()}`;await Sw(G,X),U.add(G);let j=null;if(l4(z))j=`${z}.ocx-add-backup-${DK()}`,await VY(z,j),v.push({targetPath:z,backupPath:j});if(await VY(G,z),U.delete(G),!j)v.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(MY("Add rollback cleanup warning: failed to remove temp file",I,X))}for(let I of[...v].reverse())try{if(I.backupPath){if(l4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0});if(l4(I.backupPath))await VY(I.backupPath,I.targetPath)}else if(l4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0})}catch(X){z.push(MY("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 v){if(!z.backupPath||!l4(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 cw($,v,U,Q,_,J){let Y={written:[],skipped:[],overwritten:[]};for(let z of v){let I=$.files.find((G)=>G.path===z.path);if(!I)continue;let X=H1(I.target,Q,U),q=G4(U,X);if(l4(q)){let G=await Bun.file(q).text(),j=z.content.toString("utf-8");if(nJ(G,j)){Y.skipped.push(X);continue}Y.overwritten.push(X)}else Y.written.push(X);await _.writeFileAtomically({targetPath:q,resolvedTarget:X,content:z.content})}return Y}function wK($){if(!$?.trim())throw new M(`Invalid npm dependency: expected non-empty string, got "${$}"`);let v=$.trim(),U=v.lastIndexOf("@");if(U>0){let Q=v.slice(0,U),_=v.slice(U+1);if(!_)throw new M(`Invalid npm dependency: missing version after @ in "${$}"`);return{name:Q,version:_}}return{name:v,version:"*"}}function dw($,v){let U={...$.dependencies};for(let Q of v)U[Q.name]=Q.version;return{...$,dependencies:U}}function pw($,v){let U={...$.devDependencies};for(let Q of v)U[Q.name]=Q.version;return{...$,devDependencies:U}}async function iw($){let v=G4($,"package.json");if(!l4(v))return{...lw};try{let U=await Bun.file(v).text();return JSON.parse(U)}catch(U){let Q=U instanceof Error?U.message:String(U);throw new d(`Invalid ${v}: ${Q}`)}}async function nw($){let v=G4($,".gitignore"),U=new Set(["package.json","bun.lock"]),Q=["node_modules"],_=[];if(l4(v))_=(await Bun.file(v).text()).split(`
157
- `).map((Y)=>Y.trim()).filter(Boolean);_=_.filter((J)=>!U.has(J));for(let J of Q)if(!_.includes(J))_.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 rw($,v,U,Q={}){let _=Q.isFlattened?$:G4($,".opencode");if(v.length===0&&U.length===0)return{changed:!1,packageDir:_,delta:[]};await wY(_,{recursive:!0});let J=v.map(wK),Y=U.map(wK),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 iw(_),q={...X.dependencies,...X.devDependencies},G=X;G=dw(G,J),G=pw(G,Y),await Bun.write(G4(_,"package.json"),`${JSON.stringify(G,null,2)}
161
- `);let j={...G.dependencies,...G.devDependencies},H=tG(q,j);if(!Q.isFlattened)await nw(_);return{changed:H.changed,packageDir:_,delta:H.entries}}var lw;var kY=b(()=>{k0();cv();i_();Z4();V1();cG();X4();t4();iJ();eG();w1();z$();l$();i$();aJ();q1();i6();W8();T0();s4();$6();ZK();lw={name:"opencode-plugins",private:!0,type:"module"}});import{join as ow,posix as tw}from"path";function aw($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}async function AK($){let v=Bun.file(`${$}/registry.jsonc`),U=Bun.file(`${$}/registry.json`),Q=await v.exists(),_=await U.exists();if(!Q&&!_)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let J=Q?v:U,Y=Q?"registry.jsonc":"registry.json",z=await J.text(),I=[],X=E$(z,I,{allowTrailingComma:!0});if(I.length>0){let q=aw(I);return{success:!1,error:`Invalid JSONC in ${Y}: ${q}`,errorKind:"parse_error"}}return{success:!0,data:X}}function OK($,v){let U=Z0($);if(U)return{valid:!1,errors:[`Schema compatibility issue: ${U.issue} - ${U.remediation}`]};return sw($,v)}function sw($,v){let U=K1.safeParse($);if(!U.success)return{valid:!1,errors:U.error.issues.map((_)=>`${_.path.join(".")}: ${_.message}`)};return{valid:!0,errors:[],data:U.data}}async function ew($,v){let U=[];for(let Q of $.components)for(let _ of Q.files){let J=h6(_,Q.type),Y=ow(v,"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 $L($){let v=[],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 _=new Set;for(let J of $.components){if(_.has(J.name))continue;let Y=Q(J.name,new Set,_,[]);if(Y){v.push(`Circular dependency detected: ${Y}`);break}}return{valid:v.length===0,errors:v}}function vL($){let v=[],U=new Map,Q=(_)=>{let Y=_.normalize("NFC").replace(/\\/g,"/");return tw.normalize(Y).replace(/^\.\//,"")};for(let _ of $.components)for(let J of _.files){let Y=h6(J,_.type),z=Q(Y.target),I=U.get(z);if(I)v.push(`Duplicate target "${z}" in components "${I.componentName}" and "${_.name}"`);else U.set(z,{componentName:_.name})}return{valid:v.length===0,errors:v}}async function*FK($,v,U={}){let Q=await ew($,v);for(let J of Q.errors)yield J;let _=$L($);for(let J of _.errors)yield J;if(!U.skipDuplicateTargets){let J=vL($);for(let Y of J.errors)yield Y}}var NK=b(()=>{E4();t4()});async function T8($,v={}){let U=await AK($);if(!U.success)return{success:!1,errors:[U.error||"Failed to load registry"],failureType:"load",loadErrorKind:U.errorKind};let Q=OK(U.data,$);if(!Q.valid)return{success:!1,errors:Q.errors,failureType:"schema"};let _=Q.data;if(!_)throw Error("Registry validation succeeded but returned no parsed data");let J=[];for await(let Y of FK(_,$,v))J.push(Y);if(J.length>0)return{success:!1,errors:J,failureType:"rules"};return{success:!0,errors:[],registry:_}}var AY=b(()=>{NK()});function OY($){return{file:$.filter((v)=>v.includes("Source file not found")),circular:$.filter((v)=>v.includes("Circular dependency")),duplicate:$.filter((v)=>v.includes("Duplicate target"))}}function ev($,v={}){let U=OY($),Q=v.schemaErrors??0,_=$.length,J=Math.max(0,_-Q-U.file.length-U.circular.length-U.duplicate.length);return{valid:_===0,totalErrors:_,schemaErrors:Q,sourceFileErrors:U.file.length,circularDependencyErrors:U.circular.length,duplicateTargetErrors:U.duplicate.length,otherErrors:J}}import{relative as _L,resolve as SK}from"path";function UL($,v){if(v==="not_found")return new B$($);if(v==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function QL($,v){let U=ev($,{schemaErrors:v==="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 I1(Q)}function JL($,v){if(v==="schema"){W.error("\u2717 Registry schema");for(let Q of $)console.log(m.red(` ${Q}`));return}let U=OY($);if(U.file.length>0){W.error("\u2717 Source files");for(let Q of U.file)console.log(m.red(` ${Q}`))}if(U.circular.length>0){W.error("\u2717 Circular dependencies");for(let Q of U.circular)console.log(m.red(` ${Q}`))}if(U.duplicate.length>0){W.error("\u2717 Duplicate targets");for(let Q of U.duplicate)console.log(m.red(` ${Q}`))}}function TK($){$.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(v,U)=>{try{let Q=SK(U.cwd,v),_=SK(U.cwd,U.out);if(U.showValidation){let I=!U.json&&!U.quiet;if(I)W.info("Running validation checks...");let X=await T8(Q,{skipDuplicateTargets:!1});if(!X.success){let[q="Registry validation failed"]=X.errors;if(X.failureType==="load")throw UL(q,X.loadErrorKind);let G=X.failureType==="schema"?"schema":"rules",j=QL(X.errors,G);if(U.json)throw j;if(!U.quiet)JL(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=D$({text:"Building registry...",quiet:U.quiet||U.json});if(!U.json)J.start();let Y=await uv({source:Q,out:_,dryRun:U.dryRun});if("dryRun"in Y&&Y.dryRun){if(!U.json)J.stop();T4(Y,{json:U.json,quiet:U.quiet});return}let z=Y;if(!U.json){let I=`Built ${z.componentsCount} components to ${_L(U.cwd,_)}`;if(J.succeed(I),!process.stdout.isTTY)W.success(`Built ${z.componentsCount} components`)}if(U.json)F$({success:!0,data:{components:z.componentsCount,output:z.outputPath}})}catch(Q){if(Q instanceof X6){if(U.json)_$(Q,{json:!0});if(!U.quiet){W.error(Q.message);for(let _ of Q.errors)console.log(m.red(` ${_}`))}process.exit(1)}_$(Q,{json:U.json})}})}var RK=b(()=>{O6();r_();AY();w1();z$();l$();i$();$6()});import{existsSync as EK}from"fs";import{mkdir as YL}from"fs/promises";import{join as FY}from"path";function PK($){$.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(v)=>{try{await zL(v)}catch(U){_$(U)}})}async function zL($){if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");let v;if($.profile){let J=q6.safeParse($.profile);if(!J.success)throw new M(`Invalid profile name "${$.profile}": ${J.error.issues[0]?.message??"Invalid name"}`);if(await c$.requireInitialized(),!await c$.create().exists($.profile))throw new m$($.profile);v=B4($.profile)}else if($.global){if(v=O0(),!EK(v))throw new d(`Global config not found at ${v}.
162
- Run 'ocx init --global' first.`)}else{let J=A6(process.cwd());if(J)v=FY(J,a4);else{let Y=FY(process.cwd(),W1);if(await YL(Y,{recursive:!0}),v=FY(Y,a4),!EK(v)){let z={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write(v,JSON.stringify(z,null,2)),W.info(`Created ${v}`)}}}let U=process.env.EDITOR||process.env.VISUAL||"vi",_=await Bun.spawn([U,v],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(_!==0)throw Error(`Editor exited with code ${_}`)}var xK=b(()=>{G6();Z4();Q8();z$();l$();i$()});function uK($){$.command("show").description("Display resolved configuration for current directory").addOption(g4.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async(v)=>{try{await IL(v)}catch(U){_$(U,{json:v.json})}})}async function IL($){let v=await j6.create(process.cwd(),{profile:$.profile});if($.origin){let Q=v.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(m.bold("Resolved Configuration")),console.log(),Q.profileName){let J=Q.origins.get("profileName");if(console.log(`${m.cyan("Profile:")} ${Q.profileName}`),J)console.log(` ${m.dim(`\u2190 ${J.source}`)}`)}console.log(),console.log(m.cyan("Component Path:"),Q.componentPath);let _=Q.origins.get("componentPath");if(_)console.log(` ${m.dim(`\u2190 ${_.source} (${_.path})`)}`);console.log(),console.log(m.cyan("Registries:"));for(let[J,Y]of Object.entries(Q.registries)){console.log(` ${m.green(J)}: ${Y.url}`);let z=Q.origins.get(`registries.${J}`);if(z)console.log(` ${m.dim(`\u2190 ${z.source} (${z.path})`)}`)}if(Q.instructions.length>0){console.log(),console.log(m.cyan("Instructions:"));for(let J of Q.instructions)console.log(` ${J}`)}if(Object.keys(Q.opencode).length>0){console.log(),console.log(m.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(` ${m.dim(`\u2190 ${Y.source} (${Y.path})`)}`)}}return}let U=v.resolve();if($.json){console.log(JSON.stringify(U,null,2));return}if(console.log(m.bold("Resolved Configuration")),console.log(),U.profileName)console.log(`${m.cyan("Profile:")} ${U.profileName}`);if(console.log(`${m.cyan("Component Path:")} ${U.componentPath}`),console.log(),console.log(m.cyan("Registries:")),Object.keys(U.registries).length===0)console.log(" (none)");else for(let[Q,_]of Object.entries(U.registries))console.log(` ${m.green(Q)}: ${_.url}`);if(U.instructions.length>0){console.log(),console.log(m.cyan("Instructions:"));for(let Q of U.instructions)console.log(` ${Q}`)}}var yK=b(()=>{O6();cv();l$();s4()});function CK($){let v=$.command("config").description("View and edit configuration");uK(v),PK(v)}var fK=b(()=>{xK();yK()});import{existsSync as F1}from"fs";import{cp as XL,mkdir as y0,readdir as mK,readFile as qL,rm as GL,writeFile as NY}from"fs/promises";import{dirname as gK,join as R8}from"path";function hK($){let v=$.command("init").description("Initialize OCX configuration in your project");Q4(v),h4(v),K6(v),v.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 bL(U.registry,U);else if(U.global)await WL(U);else await HL(U)}catch(Q){_$(Q,{json:U.json})}})}async function HL($){let v=$.cwd??process.cwd(),{path:U,exists:Q}=p6(v);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 _=$.quiet?null:D$({text:"Initializing OCX..."});_?.start();try{let J={$schema:jJ,registries:{}},Y=c6.parse(J);await y0(gK(U),{recursive:!0});let z=JSON.stringify(Y,null,2);await NY(U,z,"utf-8");let I=await dG(v);if(_?.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 _?.fail("Failed to initialize"),J}}async function WL($){let v=$.quiet?null:D$({text:"Initializing global profiles..."});v?.start();try{let U=[],Q=[],_=O0();if(F1(_))Q.push("globalConfig");else await y0(gK(_),{recursive:!0,mode:448}),await A0(_,{$schema:jJ,registries:{}}),U.push("globalConfig");let J=L6();if(!F1(J))await y0(J,{recursive:!0,mode:448});let Y=h$("default");if(!F1(Y))await y0(Y,{recursive:!0,mode:448});let z=B4("default");if(F1(z))Q.push("profileOcx");else await A0(z,bG),U.push("profileOcx");let I=k6("default");if(F1(I))Q.push("profileOpencode");else await A0(I,{}),U.push("profileOpencode");let X=b1("default");if(F1(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(v?.succeed("Initialized global profiles"),$.json)console.log(JSON.stringify({success:!0,files:{globalConfig:_,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: ${_}`);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 v?.fail("Failed to initialize"),U}}async function bL($,v){let U=$,Q=v.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 mK(U).catch(()=>[])).some((I)=>!I.startsWith(".")))throw new t$("Directory is not empty. Remove existing files or choose a different directory.");let z=v.quiet?null:D$({text:"Scaffolding registry..."});z?.start();try{if(z)z.text=v.local?"Copying template...":"Fetching template...";if(v.local)await y0(U,{recursive:!0}),await cK(v.local,U);else{let I=v.canary?"main":BL();await DL(U,I,v.verbose)}if(z)z.text="Configuring project...";if(await ML(U,{namespace:Q,author:_}),z?.succeed(`Created registry: ${Q}`),v.json)console.log(JSON.stringify({success:!0,namespace:Q,path:U}));else if(!v.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($,v){await XL($,v,{recursive:!0})}function BL(){return"v2.0.6"}function ZL($){let v=$==="main"?"heads/main":`tags/${$}`;return`https://github.com/${jL}/archive/refs/${v}.tar.gz`}async function DL($,v,U){let Q=ZL(v);if(U)W.info(`Fetching ${Q}`);let _=await fetch(Q);if(!_.ok||!_.body)throw new P$(`Failed to fetch template from ${Q}: ${_.statusText}`);let J=R8($,".ocx-temp");await y0(J,{recursive:!0});try{let Y=R8(J,"template.tar.gz"),z=await _.arrayBuffer();await NY(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 mK(J)).find((H)=>H.startsWith("ocx-"));if(!G)throw Error("Failed to find extracted template directory");let j=R8(J,G,KL);await cK(j,$)}finally{await GL(J,{recursive:!0,force:!0})}}function VL($){return $.split(/[-_\s]+/).map((v)=>v.charAt(0).toUpperCase()+v.slice(1).toLowerCase()).join(" ")}async function ML($,v){let U=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let Q of U){let _=R8($,Q);if(!F1(_))continue;let J=await qL(_).then((Y)=>Y.toString());if(J=J.replace(/my-registry/g,v.namespace),J=J.replace(/My Registry/g,VL(v.namespace)),J=J.replace(/Your Name/g,v.author),Q==="registry.jsonc")if(/"\$schema"\s*:/.test(J))J=J.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${i4}$2`);else J=J.replace(/{/,`{
170
- "$schema": "${i4}",`);await NY(_,J)}}var jL="kdcokenny/ocx",KL="examples/registry-starter";var lK=b(()=>{i_();_8();G6();Z4();X4();iJ();z$();l$();i$();s4();$6()});function wL($,v,U){let Q=$.indexOf("/");if(Q===-1)throw Error(`Invalid legacy key: "${$}". Expected format: alias/component`);let _=$.slice(0,Q),J=$.slice(Q+1);if(!_||!J)throw Error(`Invalid legacy key: "${$}". Both alias and component are required.`);let Y=Cv(U,_,J,v.version),z={registryUrl:U,registryName:_,name:J,revision:v.version,hash:v.hash,files:v.files.map((I)=>({path:I,hash:""})),installedAt:v.installedAt,...v.updatedAt&&{updatedAt:v.updatedAt},owner:{type:"user"}};return[Y,z]}function E8($,v,U){let Q={},_=[],J=Object.keys($.installed).sort();for(let z of J){let I=$.installed[z];if(!I)continue;let X=v.registries[I.registry];if(!X)throw new d(`Registry "${I.registry}" referenced in lock key "${z}" is not configured in ocx.jsonc. Add it before migrating.`);let[q,G]=wL(z,I,X.url);Q[q]=G,_.push({legacyKey:z,canonicalId:q,name:G.name,registryName:G.registryName})}return{receipt:{version:1,...U&&{root:U},installed:Q},components:_}}function dK($){let v=$.registries;if(!v||typeof v!=="object"||Array.isArray(v))return[];let U=[],Q=v;for(let _ of Object.keys(Q).sort()){let J=Q[_];if(!J||typeof J!=="object"||Array.isArray(J))continue;let Y=J;for(let z of LL)if(z in Y)U.push({registry:_,field:z,action:"remove_deprecated"})}return U}var LL;var pK=b(()=>{X4();z$();LL=["version"]});import{existsSync as SY,readdirSync as kL,readFileSync as oK,statSync as AL}from"fs";import{rename as P8,writeFile as OL}from"fs/promises";import{join as iK}from"path";function tK($){$.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(v)=>{try{await NL(v)}catch(U){_$(U,{json:v.json})}})}async function NL($){if($.global){await SL($);return}await hL($,"local",pL($),!1)}async function SL($){let v=$.cwd??N4(),U=TL(v);if(!$.apply){let Y=[],z=new Set;for(let{label:q,path:G}of U){let j=d6(G),H=V0(G,{isFlattened:!0});if(j.exists&&H.exists)z.add(q);try{let Z=await RL(G,!0,{emitWarnings:!$.json&&!$.quiet});Y.push({...Z,target:q})}catch(Z){let D=rK(q,Z);if(Y.push(D),!$.json&&!$.quiet)W.error(`[global:${q}] Preview failed: ${D.error}`)}}let I=nK(Y,"global",!1),X=PL(I);if($.json){if(C0(I,!1),X)process.exit(1);return}if(!$.quiet)cL(Y,I,z);if(X)process.exit(1);return}let Q=[],_=!1;for(let{label:Y,path:z}of U)try{let I=await EL(z,!0);Q.push({...I,target:Y})}catch(I){_=!0;let X=rK(Y,I);if(Q.push(X),!$.json&&!$.quiet)W.error(`[global:${Y}] Migration failed: ${X.error}`)}let J=nK(Q,"global",!0);if($.json){if(C0(J,!0),_)process.exit(1);return}if(!$.quiet)lL(Q,_);if(_)process.exit(1)}function TL($){let v=[];v.push({label:"root",path:$});let U=iK($,"profiles");if(SY(U)&&AL(U).isDirectory()){let _=kL(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:iK(U,J)})}return v}async function RL($,v,U){let Q=U?.emitWarnings??!0,_=TY($),J=d6($),Y=V0($,{isFlattened:v}),z=J.exists&&Y.exists;if(J.exists&&_.length===0&&!z)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!J.exists&&_.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let I=[];if(Y.exists&&!J.exists)try{let X=await fv($,{isFlattened:v}),q=await C4($,{emitParseDiagnostics:Q});if(X&&q)I=E8(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:_}}async function EL($,v){let U=TY($),Q=d6($),_=V0($,{isFlattened:v}),J=Q.exists&&_.exists;if(Q.exists&&U.length===0&&!J)return{status:"already_v2",count:0,components:[],configActions:[]};if(!_.exists&&!Q.exists&&U.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(_.exists&&!Q.exists){let q=await fv($,{isFlattened:v});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 C4($);if(!G)throw new d("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:H}=E8(q,G,$);Y={newReceipt:j,components:H}}let z=Y?.components??[],I=z.length;if(Y){await y4($,Y.newReceipt);let q=x8(_.path);await P8(_.path,q)}if(J){let q=x8(_.path);await P8(_.path,q)}if(U.length>0)await aK($,U);return{status:Y!==null||J||U.length>0?"migrated":"already_v2",count:I,components:z,configActions:U}}function nK($,v,U){let Q=$.some((q)=>q.status==="error"),_=$.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=_?"migrated":"already_v2";else X=_?"preview":"already_v2";return{success:!Q,status:X,scope:v,count:Y,components:z,configActions:I,targets:$}}function PL($){return $.status==="preview_with_errors"}function C0($,v){let U=xL($,v);console.log(JSON.stringify(U,null,2))}function xL($,v){let U=uL($),Q=U.flatMap((_)=>_.blockers??[]);return{...$,lifecycle_status:fL($.status,v),schema_version:FL,blockers:Q,targets:U}}function uL($){return($.targets&&$.targets.length>0?$.targets:[yL($)]).map((U)=>CL(U))}function yL($){return{target:$.scope,status:$.status,count:$.count,components:$.components,configActions:$.configActions,blockers:$.blockers??[]}}function CL($){let v=$.blockers??($.status==="error"?[{code:"MIGRATE_BLOCKER",message:$.error??"Migration blocked",path:$.target}]:[]);return{...$,scope:$.scope??$.target,result:$.result??$.status,blockers:v}}function fL($,v){if(v)return $==="partial_failure"?"apply_failed":"apply_ok";return $==="preview_with_errors"?"preview_blocked":"preview_ok"}function rK($,v){let U=mL(v,$);return{target:$,status:"error",count:0,components:[],configActions:[],error:U.message,blockers:[U]}}function mL($,v){let U=$ instanceof Error?$.message:String($);return{code:gL($,U),message:U,path:v}}function gL($,v){if(typeof $==="object"&&$!==null&&"code"in $){let Q=$.code;if(typeof Q==="string"&&Q.length>0)return Q}let U=v.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 hL($,v,U,Q){let _=TY(U),J=d6(U),Y=V0(U,{isFlattened:Q}),z=J.exists&&Y.exists;if(J.exists&&_.length===0&&!z){let H={success:!0,status:"already_v2",scope:v,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.success(`[${v}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!J.exists&&_.length===0){let H={success:!0,status:"nothing_to_migrate",scope:v,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.info(`[${v}] Nothing to migrate. No legacy ocx.lock found.`);return}let I=null;if(Y.exists&&!J.exists){let H=await fv(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 C4(U);if(!Z)throw new d("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:D,components:E}=E8(H,Z,U);I={newReceipt:D,components:E}}let X=I?.components??[],q=X.length;if(!$.apply){let H={success:!0,status:"preview",scope:v,count:q,components:X,configActions:_};if($.json){C0(H,!1);return}if(!$.quiet){if(q>0){W.info(`[${v}] 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(`[${v}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),W.break();if(_.length>0){W.info(`[${v}] Config normalization: ${_.length} deprecated field(s) would be removed.`);for(let Z of _)W.info(` registries.${Z.registry}.${Z.field} \u2192 remove`);W.break()}if(q===0&&_.length===0&&!z)W.info(`[${v}] Nothing to migrate.`);else W.info("No changes made. Run with --apply to perform migration.")}return}if(I){await y4(U,I.newReceipt);let H=x8(Y.path);if(await P8(Y.path,H),!$.json&&!$.quiet){W.success(`[${v}] 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=x8(Y.path);if(await P8(Y.path,H),!$.json&&!$.quiet)W.success(`[${v}] Removed stale legacy lock (receipt already exists).`),W.info(`Legacy lock backed up to: ${H}`)}if(_.length>0){if(await aK(U,_),!$.json&&!$.quiet){if(I)W.break();W.success(`[${v}] Normalized ${_.length} deprecated config field(s).`);for(let H of _)W.success(` \u2713 registries.${H.registry}.${H.field} removed`)}}let j={success:!0,status:I!==null||z||_.length>0?"migrated":"already_v2",scope:v,count:q,components:X,configActions:_};if($.json){C0(j,!0);return}if(!I&&_.length>0&&!$.quiet)W.break(),W.success(`[${v}] Config normalization complete.`)}function cL($,v,U){if(v.status==="nothing_to_migrate"){W.info("[global] Nothing to migrate across all targets.");return}if(v.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 _=U.has(Q.target),J=dL(Q,_);W.info(` ${Q.target}: ${J}`)}if(W.break(),v.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 lL($,v){W.break();let U=$.filter((J)=>J.status==="migrated"),Q=$.filter((J)=>J.status==="already_v2"||J.status==="nothing_to_migrate"),_=$.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(_.length>0){W.error(`[global] ${_.length} target(s) failed:`);for(let J of _)W.error(` \u2717 ${J.target}: ${J.error}`)}if(v)W.break(),W.error("[global] Migration completed with errors. See above for details.")}function dL($,v){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(v)U.push("legacy lock cleanup pending");if(U.length===0)return"nothing to migrate";return U.join(", ")}function pL($){if($.global)return $.cwd??N4();return $.cwd??process.cwd()}function x8($){let v=`${$}.bak`;if(!SY(v))return v;for(let U=1;U<=100;U++){let Q=`${v}.${U}`;if(!SY(Q))return Q}return`${v}.${Date.now()}`}function TY($){let v=p6($);if(!v.exists)return[];try{let U=oK(v.path,"utf-8"),Q=E$(U,[],{allowTrailingComma:!0});if(!Q||typeof Q!=="object"||Array.isArray(Q))return[];return dK(Q)}catch{return[]}}async function aK($,v){if(v.length===0)return;let U=p6($);if(!U.exists)return;let Q=oK(U.path,"utf-8");for(let _ of v){let J=y1(Q,["registries",_.registry,_.field],void 0,iL);Q=C1(Q,J)}await OL(U.path,Q)}var FL=1,iL;var sK=b(()=>{E4();X4();z$();l$();i$();i6();pK();iL={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
171
- `}}});import{basename as nL,resolve as ry}from"path";function u8(){let{GIT_DIR:$,GIT_WORK_TREE:v,...U}=process.env;return U}async function rL($){let v=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await v.exited===0){let I=(await new Response(v.stdout).text()).trim();if(I)return I}let Q=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:$,env:u8(),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:u8(),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 oL($){let v=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await v.exited!==0)return null;let _=(await new Response(v.stdout).text()).trim();if(!_)return null;return nL(_)}async function eK($){let[v,U]=await Promise.all([oL($),rL($)]);return{repoName:v,branch:U}}var $H=()=>{};import tL from"path";function _H(){return Boolean(process.env.TMUX)}function aL($){if(!_H())return;Bun.spawnSync(["tmux","rename-window",$]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function sL($){if(!M1)return;process.stdout.write(`\x1B]0;${$}\x07`)}function UH($){aL($),sL($)}function QH(){if(y8||!M1)return;process.stdout.write("\x1B[22;2t"),y8=!0}function RY(){if(!y8)return;if(_H())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(M1)process.stdout.write("\x1B[23;2t");y8=!1}function JH($,v,U){let Q=U.repoName??tL.basename($);if(!U.branch)return`ocx[${v}]:${Q}`;let _=U.branch.length>vH?`${U.branch.slice(0,vH-3)}...`:U.branch;return`ocx[${v}]:${Q}/${_}`}var vH=20,y8=!1;var YH=b(()=>{pv()});import{randomUUID as eL}from"crypto";import{copyFile as $k,cp as vk,lstat as t6,mkdir as _k,mkdtemp as Uk,readdir as XH,readFile as Qk,realpath as m0,rename as Jk,rm as Yk,unlink as zk}from"fs/promises";import{tmpdir as Ik}from"os";import{basename as Xk,dirname as xY,isAbsolute as qH,join as F6,relative as uY}from"path";var{Glob:EY}=globalThis.Bun;function t($,v){return new d(`ocx oc ${$} error: ${v}`)}function C$($){if($ instanceof Error)return $.message;return String($)}function Kk($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function f8($){return $.replaceAll("\\","/")}function PY($){return $.startsWith("./")?$.slice(2):$}function yY($,v){let U=uY($,v);if(U.length===0)return!0;return!U.startsWith("..")&&!qH(U)}function Hk($){if($.isFile())return"file";if($.isDirectory())return"directory";if($.isSymbolicLink())return"symlink";return"other"}function $2($){return{entryType:Hk($),device:String($.dev),inode:String($.ino),mode:String($.mode),size:String($.size),mtimeMs:String($.mtimeMs)}}function Wk($,v){return $.entryType===v.entryType&&$.device===v.device&&$.inode===v.inode&&$.mode===v.mode}function bk($,v){return $.size===v.size&&$.mtimeMs===v.mtimeMs}async function f0($){let v;try{v=await t6($.absolutePath)}catch{throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`)}if($.mustRemainDirectory&&!v.isDirectory())throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`);if($.mustRemainFile&&!v.isFile())throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`);let U=$2(v),Q=Wk($.expectedSnapshot,U),J=!($.compareContent??!0)?!0:bk($.expectedSnapshot,U);if(!Q||!J)throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`)}async function C8($,v,U){let _=f8(uY($,v)).split("/").filter((Y)=>Y.length>0),J=$;for(let Y of _){J=F6(J,Y);let z;try{z=await t6(J)}catch(I){if(I.code==="ENOENT")return;throw t("validate",`Failed to inspect overlay destination path (${U}): ${C$(I)}`)}if(z.isSymbolicLink())throw t("validate",`Overlay destination path contains existing symlink (${U})`)}}function zH($,v,U){for(let Q of U)try{new EY(PY(Q))}catch{throw t("validate",`Invalid project overlay policy at ${$}: ${v} contains invalid glob pattern "${Q}"`)}}async function Zk($){if(!$)return{include:[],exclude:[]};let v=F6($,a4),U=await Dk($,v);if(!U)return{include:[],exclude:[]};let Q;try{Q=await Qk(U,"utf8")}catch(X){throw t("read",`Failed to read project overlay policy at ${v}: ${C$(X)}`)}let _=[],J=E$(Q,_,{allowTrailingComma:!0});if(_.length>0)throw t("parse",`Failed to parse project overlay policy at ${v}: ${Kk(_)}`);if(!J||typeof J!=="object"||Array.isArray(J))throw t("validate",`Invalid project overlay policy at ${v}: root must be an object`);let Y=Bk.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 t("validate",`Invalid project overlay policy at ${v}: ${q} ${G}`)}let z=Y.data.include??[],I=Y.data.exclude??[];return zH(v,"include",z),zH(v,"exclude",I),{include:z,exclude:I}}async function Dk($,v){let U;try{U=await t6(v)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw t("read",`Failed to inspect project overlay policy at ${v}: ${C$(J)}`)}if(!U.isSymbolicLink())return v;let Q;try{Q=await m0($)}catch(J){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(J)}`)}let _;try{_=await m0(v)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw t("validate",`Broken symlink in project overlay policy: ${v}`);throw t("read",`Failed to inspect project overlay policy symlink at ${v}: ${C$(J)}`)}if(!yY(Q,_))throw t("validate",`Symlink escapes project overlay policy scope: ${v}`);return _}function Vk($,v){for(let U of v.include)if(new EY(PY(U)).match($))return!0;for(let U of v.exclude)if(new EY(PY(U)).match($))return!1;return!0}function Mk($,v){return $.filter((U)=>Vk(U.overlayRelativePath,v)).map((U)=>({sourcePath:U.sourcePath,destinationRelativePath:U.overlayRelativePath,sourceSnapshot:U.sourceSnapshot}))}async function GH($,v,U){let Q;try{Q=await m0(v)}catch(_){let J=_.code;if(J==="ENOENT"||J==="ENOTDIR")throw t("validate",`Broken symlink in project overlay scope: ${U}`);throw t("read",`Failed to inspect symlink at ${U}: ${C$(_)}`)}if(!yY($,Q))throw t("validate",`Symlink escapes project overlay scope: ${U}`);throw t("validate",`Symlink entries are not supported in project overlay scope: ${U}`)}async function jH($,v,U,Q,_){let J;try{J=await t6(v)}catch(z){throw t("read",`Failed to inspect project overlay path ${U}: ${C$(z)}`)}if(J.isSymbolicLink())await GH($,v,U);let Y=$2(J);if(J.isDirectory()){await _.beforeDirectoryRead?.({absolutePath:v,overlayRelativePath:U});let z;try{z=await XH(v)}catch(I){throw t("read",`Failed to read project overlay directory ${U}: ${C$(I)}`)}z.sort((I,X)=>I.localeCompare(X));for(let I of z){let X=F6(v,I),q=f8(F6(U,I));await jH($,X,q,Q,_)}await f0({absolutePath:v,overlayRelativePath:U,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!J.isFile())return;Q.push({sourcePath:v,overlayRelativePath:f8(U),sourceSnapshot:Y})}async function wk($,v={}){let U;try{U=await m0($)}catch(Y){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(Y)}`)}let Q;try{Q=await t6($)}catch(Y){throw t("validate",`Unable to inspect project overlay root ${$}: ${C$(Y)}`)}if(!Q.isDirectory())throw t("validate",`Project overlay root changed before discovery: ${$}. ${o6}`);let _=$2(Q),J=[];for(let Y of qk){let z=F6($,Y);await v.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:z,projectConfigDir:$}),await f0({absolutePath:$,overlayRelativePath:".opencode",expectedSnapshot:_,phase:"overlay discovery",mustRemainDirectory:!0});let I;try{I=await t6(z)}catch(X){let q=X.code;if(q==="ENOENT"||q==="ENOTDIR")continue;throw t("read",`Failed to inspect project overlay scope ${Y}: ${C$(X)}`)}if(I.isSymbolicLink())await GH(U,z,Y);await jH(U,z,Y,J,v)}return J.sort((Y,z)=>Y.overlayRelativePath.localeCompare(z.overlayRelativePath)),J}function Lk($){let v=xY($),U=Xk($),Q=`${process.pid}-${eL()}`;return F6(v,`.${U}.ocx-tmp-${Q}`)}async function kk($,v){let U=Lk(v);try{await $k($,U),await Jk(U,v)}catch(Q){try{await zk(U)}catch{}throw Q}}async function Ak($,v,U={}){let Q=U.publishAtomically??kk,_;try{_=await t6(v)}catch(Y){throw t("validate",`Unable to inspect merged overlay root ${v}: ${C$(Y)}`)}if(!_.isDirectory())throw t("validate",`Merged overlay root is not a directory: ${v}`);let J=$2(_);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:v,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let z;try{z=O4(v,Y.destinationRelativePath)}catch(G){throw t("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${C$(G)}`)}await C8(v,z,Y.destinationRelativePath);let I=xY(z);await U.beforeDestinationParentCreate?.({operation:Y,destinationPath:z,destinationParentPath:I}),await C8(v,z,Y.destinationRelativePath);try{await _k(I,{recursive:!0})}catch(G){throw t("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}await C8(v,z,Y.destinationRelativePath);let X;try{X=await t6(I)}catch(G){throw t("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${C$(G)}`)}if(!X.isDirectory())throw t("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${o6}`);let q=$2(X);await U.beforeDestinationPublish?.({operation:Y,destinationPath:z,destinationParentPath:I}),await f0({absolutePath:v,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 C8(v,z,Y.destinationRelativePath);try{await Q(Y.sourcePath,z)}catch(G){if(G instanceof d)throw G;throw t("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}}}async function Ok($,v){let U;try{U=await XH($)}catch(Q){throw t("copy",`Failed to read profile directory ${$}: ${C$(Q)}`)}for(let Q of U){let _=F6($,Q),J=F6(v,Q);try{await vk(_,J,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw t("copy",`Failed to copy profile base file ${Q}: ${C$(Y)}`)}}}async function IH($){try{await Yk($,{recursive:!0,force:!0})}catch(v){throw t("cleanup",`Failed to remove temporary merged config directory ${$}: ${C$(v)}`)}}function Fk($,v){let U=f8(uY($,v));if(!U||U===".")throw t("validate",`Overlay source path failed relative parsing: ${v}`);if(U===".."||U.startsWith("../")||qH(U))throw t("validate",`Overlay source path escapes project overlay scope: ${v}`);return U}function Nk($,v){let U=v.map((Q)=>{if(!Q.sourceSnapshot)throw t("validate",`Overlay source snapshot missing for ${Q.destinationRelativePath}. ${o6}`);return{sourceRelativePath:Fk($,Q.sourcePath),destinationRelativePath:Q.destinationRelativePath,sourceSnapshot:Q.sourceSnapshot}});return{version:jk,projectConfigDir:$,operations:U}}function Sk(){return null}async function Tk($){let v=$.manifest.operations.map((U)=>({sourcePath:O4($.manifest.projectConfigDir,U.sourceRelativePath),destinationRelativePath:U.destinationRelativePath,sourceSnapshot:U.sourceSnapshot}));await Ak(v,$.mergedConfigDir,$.copySeams)}async function Rk($){if($.manifest.operations.length===0)return"best-effort-js";let v=$.nativeHelper??Sk();if(v)return await v.applyManifest($.manifest,$.mergedConfigDir),"native-fd";if($.hardeningMode==="native-fd-required")throw t("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${o6}`);return await Tk({manifest:$.manifest,mergedConfigDir:$.mergedConfigDir,copySeams:$.copySeams}),"best-effort-js"}async function Ek($){let v=xY($),U;try{U=await m0(v)}catch(_){throw t("validate",`Unable to resolve project directory ${v}: ${C$(_)}`)}let Q;try{Q=await m0($)}catch(_){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(_)}`)}if(!yY(U,Q))throw t("validate",`Project .opencode root resolves outside project directory: ${$}`);return Q}function Pk($){if($ instanceof d)return $;return t("copy",`Failed to prepare temporary merged config directory: ${C$($)}`)}async function KH($){let v=A6($.projectDir),U=$.hardeningMode??"best-effort-js",Q=null;try{Q=await Uk(F6(Ik(),Gk)),await Ok($.profileDir,Q);let _="best-effort-js";if(v){let Y=await Ek(v),z=await Zk(Y),I=await wk(Y,$.seams?.collection),X=Mk(I,z),q=Nk(Y,X);_=await Rk({manifest:q,mergedConfigDir:Q,hardeningMode:U,copySeams:$.seams?.copy,nativeHelper:$.seams?.nativeHelper})}let J=Q;return{path:J,cleanup:()=>IH(J),hardeningLevel:_}}catch(_){let J=Pk(_);if(Q)try{await IH(Q)}catch(Y){J.message=`${J.message}
172
- Cleanup warning: ${C$(Y)}`}throw J}}var qk,Gk="ocx-oc-merged-",jk=1,o6="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",Bk;var HH=b(()=>{E4();Z6();Z4();z$();q1();qk=["agent","agents","skill","skills"];Bk=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough()});import*as V4 from"path";function m8($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function xk($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function g8($){if($.length===0)return"$";let v="";for(let U of $){if(typeof U==="number"){v+=`[${U}]`;continue}v=v.length===0?U:`${v}.${U}`}return v}function v2($,v,U,Q){if($===void 0)return;if(m8($)){for(let[_,J]of Object.entries($))v2(J,v,[...U,_],Q);return}if(Array.isArray($)){for(let[_,J]of $.entries())v2(J,v,[...U,_],Q);return}Q.set(g8(U),v)}function uk($,v,U,Q){let _=Array.from(new Set([...$,...v])),J=new Map;for(let Y of $)if(!J.has(Y))J.set(Y,"profile");for(let Y of v)if(!J.has(Y))J.set(Y,"local");for(let[Y,z]of _.entries())Q.set(g8([...U,Y]),J.get(z)??"local")}function yk($,v,U,Q){let _=[...$,...v],J=fJ(_),Y=new Map;for(let z=_.length-1;z>=0;z--){let I=_[z];if(!I)continue;let X=hv(I);if(!Y.has(X))Y.set(X,z<$.length?"profile":"local")}for(let[z,I]of J.entries()){let X=hv(I);Q.set(g8([...U,z]),Y.get(X)??"local")}}function WH($,v){return $.length===1&&$[0]===v}function bH($){let{profileValue:v,localValue:U,pathSegments:Q,origins:_}=$;if(U===void 0){v2(v,"profile",Q,_);return}if(v===void 0){v2(U,"local",Q,_);return}if(m8(v)&&m8(U)){let J=new Set([...Object.keys(v),...Object.keys(U)]);for(let Y of J)bH({profileValue:v[Y],localValue:U[Y],pathSegments:[...Q,Y],origins:_});return}if(Array.isArray(v)&&Array.isArray(U)){if(WH(Q,"instructions")){if(v.every((J)=>typeof J==="string")&&U.every((J)=>typeof J==="string")){uk(v,U,Q,_);return}}if(WH(Q,"plugin")){if(v.every((J)=>typeof J==="string")&&U.every((J)=>typeof J==="string")){yk(v,U,Q,_);return}}}v2(U,"local",Q,_)}function Ck($){let v=new Map;return bH({profileValue:$.profileConfig,localValue:$.localConfig,pathSegments:[],origins:v}),v}function fk($){if(!$.startsWith("{file:"))return null;if(!$.endsWith("}"))return null;let v=$.slice(6,-1);return v.length>0?v:null}function mk($){return/^[A-Za-z]:[\\/]/.test($)}function gk($){if($.startsWith("~"))return!1;if(V4.isAbsolute($))return!1;if(mk($))return!1;return!0}function hk($){let v=fk($.value);if(!v)return $.value;let U=g8($.pathSegments);if($.origins.get(U)!=="profile")return $.value;if(!gk(v))return $.value;return`{file:${V4.resolve($.profileDir,v)}}`}function CY($){let{value:v,pathSegments:U,origins:Q,profileDir:_}=$;if(typeof v==="string")return hk({value:v,pathSegments:U,origins:Q,profileDir:_});if(Array.isArray(v))return v.map((J,Y)=>CY({value:J,pathSegments:[...U,Y],origins:Q,profileDir:_}));if(m8(v)){let J={};for(let[Y,z]of Object.entries(v))J[Y]=CY({value:z,pathSegments:[...U,Y],origins:Q,profileDir:_});return J}return v}async function ck($){let v=A6($);if(!v)return{};let U=V4.join(v,gv),Q=Bun.file(U);if(!await Q.exists())return{};let _;try{_=await Q.text()}catch(z){let I=z instanceof Error?z.message:"Unknown read error";throw new d(`Failed to read local OpenCode config at ${U}: ${I}`)}let J=[],Y=E$(_,J,{allowTrailingComma:!0});if(J.length>0){let z=xk(J);throw new d(`Invalid JSONC in local OpenCode config at ${U}: ${z}`)}if(!Y||typeof Y!=="object"||Array.isArray(Y))throw new d(`Invalid local OpenCode config at ${U}: root must be an object`);return Y}async function lk($){let v=await ck($.projectDir),U=Ck({profileConfig:$.profileConfig,localConfig:v});return CY({value:$.mergedConfig,pathSegments:[],origins:U,profileDir:$.profileDir})}function dk($){let v=new Set,U=[];for(let Q=$.length-1;Q>=0;Q--){let _=$[Q];if(!v.has(_))v.add(_),U.unshift(_)}return U}function pk($){return $.configBin??$.envBin??"opencode"}function BH($){return $.includes("/")||$.includes("\\")}function ik($){let{configuredBin:v,cwd:U}=$,Q=$.resolveExecutable??((J)=>Bun.which(J));if(!v.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(BH(v))return V4.isAbsolute(v)?v:V4.resolve(U,v);let _=Q(v);if(!_)throw Error(`OpenCode launcher "${v}" is not available in PATH and cannot be used as OPENCODE_BIN`);return V4.isAbsolute(_)?_:V4.resolve(U,_)}function nk($){let v=$.resolveExecutable??((X)=>Bun.which(X)),U=$.argv??process.argv,Q=$.execPath??process.execPath,_=$.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),J=$.inheritedOcxBin?.trim(),Y=_?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(BH(z))return V4.isAbsolute(z)?z:V4.resolve($.cwd,z);let I=v(z);if(!I)throw Error(`OCX executable "${z}" is not available in PATH and cannot be persisted as OCX_BIN`);return V4.isAbsolute(I)?I:V4.resolve($.cwd,I)}function rk($){let v=Boolean($.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:U,OPENCODE_BIN:Q,OCX_CONTEXT:_,OCX_BIN:J,OCX_PROFILE:Y,...z}=$.baseEnv;return{...z,...$.opencodeBin!==void 0&&{OPENCODE_BIN:$.opencodeBin},...v&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:$.configDir??(v?h$($.profileName):N4()),...$.configContent&&{OPENCODE_CONFIG_CONTENT:$.configContent},...v&&{OCX_CONTEXT:"1"},...v&&$.ocxBin&&{OCX_BIN:$.ocxBin},...$.profileName&&{OCX_PROFILE:$.profileName}}}function ZH($){$.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(v,U)=>{try{await ok(U.args,v)}catch(Q){_$(Q)}})}async function ok($,v){let U=process.cwd(),Q=await j6.create(U,{profile:v.profile}),_=Q.resolve(),J=Q.getProfile();if(_.profileName)W.info(`Using profile: ${_.profileName}`);let Y=J?.ocx,z=v.rename!==!1&&Y?.renameWindow!==!1;if(_.profileName){let w=k6(_.profileName);if(!await Bun.file(w).exists())W.warn(`No opencode.jsonc found at ${w}. Create one to customize OpenCode settings.`)}let I=_.opencode;if(_.profileName)I=await lk({mergedConfig:_.opencode,profileConfig:J?.opencode??{},projectDir:U,profileDir:h$(_.profileName)});let X=Array.isArray(I.instructions)?I.instructions:[],q=[..._.instructions,...X],G=dk(q),j=G.length>0||Object.keys(I).length>0?{...I,instructions:G.length>0?G:void 0}:void 0,H=null,Z=null,D=null,E=null,A=null,r=()=>{if(H)H.kill("SIGINT");else A=130},O=()=>{if(H)H.kill("SIGTERM");else A=143},g=()=>{if(z)RY()};try{if(process.on("SIGINT",r),process.on("SIGTERM",O),process.on("exit",g),A!==null){E=A;return}if(_.profileName)Z=await KH({projectDir:U,profileDir:h$(_.profileName)});if(A!==null){E=A;return}if(z){QH();let a=await eK(U);if(A!==null){E=A;return}UH(JH(U,_.profileName??"default",a))}if(A!==null){E=A;return}let w=pk({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),N=Boolean(_.profileName),L=N?ik({configuredBin:w,cwd:U}):w,U$=N?nk({cwd:U,inheritedOcxBin:process.env.OCX_BIN}):void 0,$$=j?JSON.stringify(j):void 0;try{H=Bun.spawn({cmd:[L,...$],cwd:U,env:rk({baseEnv:process.env,profileName:_.profileName??void 0,ocxBin:U$,opencodeBin:L,configDir:Z?.path,configContent:$$}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(a){throw t("spawn",`Failed to launch OpenCode binary "${w}": ${a instanceof Error?a.message:String(a)}`)}E=await H.exited}catch(w){D=w instanceof Error?w:t("spawn",`OpenCode process failed: ${String(w)}`)}finally{if(process.off("SIGINT",r),process.off("SIGTERM",O),process.off("exit",g),z)RY();if(Z)try{await Z.cleanup()}catch(w){if(D!==null||A!==null||E!==null&&E!==0)W.warn(`Cleanup warning: ${w instanceof Error?w.message:String(w)}`);else D=w instanceof Error?w:t("cleanup",`Failed to remove temporary merged config directory: ${String(w)}`)}}if(D)throw D;if(E!==null)process.exit(E)}var DH=b(()=>{E4();cv();Z4();Y8();z$();$H();l$();i$();i6();YH();HH()});import{existsSync as g0}from"fs";import{mkdir as fY,mkdtemp as tk,rename as ak,rm as VH,writeFile as sk}from"fs/promises";import{dirname as MH,join as h8,relative as ek}from"path";function wH($,v,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${v}" (${Q})`}function OH($,v){let[U,Q]=v.split("/");if(!U||!Q)return;return`${p$($)}/components/${Q}.json`}function LH($){if(!$)return null;let[v,U,...Q]=$.split("/");if(!v||!U||Q.length>0)return null;return{registryName:v,componentName:U}}function $A($,v){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=p$($),_,J=-1;for(let[Y,z]of Object.entries(v)){let I=p$(z.url);if(!(Q===I||Q.startsWith(`${I}/`))||I.length<=J)continue;_=Y,J=I.length}return{registryName:_,componentName:U}}function vA($){let v=$.depRefs[0]??`${$.namespace}/${$.component}`,U={...$.profileRegistries,...$.profileRegistries[$.namespace]?{}:{[$.namespace]:{url:$.registryUrl}}},Q=$.error.registryName,_=$.error.qualifiedName,J=LH(_);if(!Q&&J)Q=J.registryName;let Y=J?.componentName,z=_&&!J&&!_.includes("/")?_:void 0,I=$A($.error.url,U);if(!Q&&I.registryName)Q=I.registryName;let X=Y??z??I.componentName;if((!_||!J)&&Q&&X)_=`${Q}/${X}`;if(!_)_=v;if(!Q)Q=LH(_)?.registryName??$.namespace;let q=U[Q]?.url||(Q===$.namespace?$.registryUrl:void 0);return{registryName:Q,qualifiedName:_,fallbackUrl:$.error.url||(q?OH(q,_):void 0)}}function kH($,v){let U=$.phase??v.fallbackPhase,Q=$.url??v.fallbackUrl,_=[`phase: ${U}`,`qualifiedName: ${v.qualifiedName}`,`registryContext: ${v.registryContext}`,`registryName: ${v.registryName}`,...Q?[`url: ${Q}`]:[]];return new P$(`${$.message} (${_.join(", ")})`,{url:Q,status:$.status,statusText:$.statusText,phase:U,qualifiedName:v.qualifiedName,registryContext:v.registryContext,registryName:v.registryName})}function AH($,v){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=O4(v,U)}catch(J){if(J instanceof U4)throw new M(`Invalid embedded target "${$}": ${J.message}`);throw J}let _=ek(v,Q).replace(/\\/g,"/");if(_==="."||_==="")throw new M(`Invalid embedded target "${$}": target must resolve to a file path.`);return _}async function mY($){let{namespace:v,component:U,profileName:Q,registryUrl:_,quiet:J}=$;if(!q6.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(v)z=v;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=h$(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:D$({text:`Fetching ${X}...`});G?.start();let j;try{j=await dv(_,U)}catch(w){if(G?.fail(`Failed to fetch ${X}`),w instanceof P$)throw kH(w,{registryContext:"source",registryName:z,qualifiedName:X,fallbackPhase:"packument-fetch",fallbackUrl:OH(_,X)});if(w 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 w}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=j1(j);G?.succeed(`Fetched ${X}`);let Z=J?null:D$({text:"Downloading profile files..."});Z?.start();let D=[],E=[];for(let w of H.files){let N=await D1(_,U,w.path),L={path:w.path,target:w.target,content:Buffer.from(N)};if(w.target.startsWith(".opencode/"))E.push(L);else D.push(L)}Z?.succeed(`Downloaded ${H.files.length} files`);let A=L6();await fY(A,{recursive:!0,mode:448});let r=await tk(h8(A,".staging-")),O=!1,g=!1;try{let w=J?null:D$({text:"Writing profile files..."});w?.start();let N=new Map;for(let $$ of D){let a=w0($$.target,r),V$=h8(r,a);L1(N,{absolutePath:V$,relativePath:a,content:$$.content,source:`${U}:${$$.path}`})}for(let $$ of E){let a=AH($$.target,r),V$=w0(a,r),x=h8(r,V$);L1(N,{absolutePath:x,relativePath:V$,content:$$.content,source:`${U}:${$$.path}`})}for(let $$ of N.values()){let a=$$.absolutePath,V$=MH(a);if(!g0(V$))await fY(V$,{recursive:!0});await sk(a,$$.content)}w?.succeed(`Wrote ${N.size} profile files`),await y4(r,{version:1,root:I,installed:{}});let L=J?null:D$({text:"Moving to profile directory..."});L?.start();let U$=MH(I);if(!g0(U$))await fY(U$,{recursive:!0,mode:448});if(await ak(r,I),O=!0,L?.succeed("Profile installed"),j.dependencies.length>0){let $$=J?null:D$({text:"Installing dependencies..."});$$?.start();let a=j.dependencies.map((x)=>x.includes("/")?x:`${z}/${x}`),V$={};try{let x=h8(I,"ocx.jsonc");if(g0(x)){let h=await Bun.file(x).text(),I$=E$(h),v$=V6.safeParse(I$);if(v$.success)V$=v$.data.registries??{};else if(q4(I$)&&"registries"in I$)throw new d(`Invalid registries in profile "${Q}": ${v$.error.message}`)}await LY(a,{profile:Q,quiet:J},{cwd:I,getRegistries:()=>V$,getComponentPath:()=>""}),$$?.succeed(`Installed ${j.dependencies.length} dependencies`)}catch(x){if($$?.fail("Failed to install dependencies"),x instanceof P$){let o=vA({error:x,depRefs:a,namespace:z,component:U,registryUrl:_,profileRegistries:V$});throw kH(x,{registryContext:"dependency",registryName:o.registryName,qualifiedName:o.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:o.fallbackUrl})}throw x}}if(g=!0,!J){W.info(""),W.success(`Installed profile "${Q}" from ${X}`),W.info(""),W.info("Profile contents:");for(let $$ of D)W.info(` ${$$.target}`);for(let $$ of E){let a=AH($$.target,I);W.info(` ${a}`)}}}catch(w){let N=[];try{if(g0(r))await VH(r,{recursive:!0})}catch(L){N.push(wH("Profile add rollback cleanup warning: failed to remove staging directory",r,L))}if(O&&!g)try{if(g0(I))await VH(I,{recursive:!0,force:!0})}catch(L){N.push(wH("Profile add rollback cleanup warning: failed to remove promoted profile",I,L))}if(!J)for(let L of N)W.warn(L);throw w}}var FH=b(()=>{E4();Z4();Q8();V1();X4();M0();t4();EJ();z$();i$();q1();W8();$6();kY()});function _A($){if(!$?.trim())throw new M("--source value cannot be empty");let v=$.trim();if((v.match(/\//g)||[]).length!==1)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);let[Q,_]=v.split("/").map((J)=>J.trim());if(!Q||!_)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);return{namespace:Q,component:_}}async function UA(){let $="global ocx config";try{let v=await jG();$=v.path;let U=v.content,Q=E$(U,[],{allowTrailingComma:!0});return V6.parse(Q)}catch(v){if(v instanceof n6)throw v;if(v instanceof Error)throw new d(`Failed to parse global config at "${$}": ${v.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 v}}async function QA($){let v;try{v=await UA()}catch(Q){if(Q instanceof n6)throw new d(`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=v.registries[$];if(!U)throw new d(`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:v,registryUrl:U.url}}function NH($){$.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(v,U)=>{try{let Q=await JA(v,U);if(U.json)F$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function JA($,v){let U=v.json===!0;if(v.clone&&(v.source||v.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(v.from&&!v.source){let J=v.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(v.source&&!v.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 ${v.source} --global`);if(v.from){let J=v.from.trim();try{let Y=new URL(J);if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw new M(`Invalid --from value: "${v.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: "${v.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: "${v.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(!v.global)throw new d(`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",_=await c$.requireInitialized();if(v.clone)return await zA(_,$,v.clone,U),{name:$,scope:Q,mode:"clone",cloneFrom:v.clone};if(v.source){let{namespace:J,component:Y}=_A(v.source),z;if(v.from)z=p$(v.from.trim()),await mY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});else z=(await QA(J)).registryUrl,await mY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});return{name:$,scope:Q,mode:"registry",registry:{namespace:J,component:Y,url:z,ephemeral:Boolean(v.from)}}}return await YA(_,$,U),{name:$,scope:Q,mode:"empty"}}async function YA($,v,U){if(await $.exists(v))throw new g6(v,`Remove it first with 'ocx profile rm ${v} --global'.`);if(await $.add(v),!U)W.success(`Created global profile "${v}"`)}async function zA($,v,U,Q){if(await $.exists(v))throw new g6(v,`Remove it first with 'ocx profile rm ${v} --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(v);let J=B4(U),Y=B4(v);if(await IG(J,Y),!Q)W.success(`Created global profile "${v}" (cloned from "${U}")`)}var SH=b(()=>{E4();_8();G6();Z4();M0();z$();l$();i$();FH()});function TH($){$.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(g4.json()).action(async(v)=>{try{await IA(v)}catch(U){_$(U,{json:v.json})}})}async function IA($){if(!$.global)throw new d(`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 c$.requireInitialized()).list();if($.json){console.log(JSON.stringify({profiles:U,initialized:!0},null,2));return}let Q="Global profiles:",_="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(U.length===0){console.log(_);return}console.log(Q);for(let J of U)console.log(` ${J}`)}var RH=b(()=>{G6();z$();l$();s4()});function EH($){$.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(v,U,Q)=>{try{let _=await XA(v,U,Q);if(Q.json)F$({success:!0,data:_})}catch(_){_$(_,{json:Q.json})}})}async function XA($,v,U){if(!U.global)throw new d(`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 ${$} ${v} --global`);let Q=await c$.requireInitialized(),{warnActiveProfile:_}=await Q.move($,v);if(_&&!U.json)W.warn(`Moving active profile. Update OCX_PROFILE env var to "${v}".`);if(!U.json)W.success(`Moved global profile "${$}" \u2192 "${v}"`);return{from:$,to:v,scope:"global",warnActiveProfile:_}}var PH=b(()=>{G6();z$();l$();i$()});function xH($){$.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(v,U)=>{try{let Q=await qA(v,U);if(U.json)F$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function qA($,v){if(!v.global)throw new d(`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 c$.requireInitialized();if(!await U.exists($))throw new m$($);if(await U.remove($),!v.json)W.success(`Deleted global profile "${$}"`);return{name:$,scope:"global"}}var uH=b(()=>{G6();z$();l$();i$()});function yH($){$.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(g4.json()).action(async(v,U)=>{try{await GA(v,U)}catch(Q){_$(Q,{json:U.json})}})}async function GA($,v){if(!v.global)throw new d(`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 c$.requireInitialized(),Q=$??await U.resolveProfile(),_=await U.get(Q);if(v.json){console.log(JSON.stringify(_,null,2));return}if(console.log(`Profile: ${_.name}`),console.log(`
238
- Files:`),console.log(` ocx.jsonc: ${B4(Q)}`),_.opencode)console.log(` opencode.jsonc: ${k6(Q)}`);if(_.hasAgents)console.log(` AGENTS.md: ${b1(Q)}`);console.log(`
239
- OCX Config:`),console.log(JSON.stringify(_.ocx,null,2))}var CH=b(()=>{G6();Z4();z$();l$();s4()});function fH($){let v=$.command("profile").alias("p").description("Manage profiles (global only)");TH(v),NH(v),xH(v),EH(v),yH(v)}var mH=b(()=>{SH();RH();PH();uH();CH()});import{existsSync as jA}from"fs";import{dirname as gH,join as hH}from"path";async function KA($,v,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 _=p$(Q),J=v.name,Y=U.getRegistries(),z=Y[J],I=HA(Y,_),{fetchRegistryIndex:X}=await Promise.resolve().then(() => (V1(),mG));await X(_);let q=z!==void 0,G=I!==null,j=q&&p$(z.url)===_,H=G&&I.name!==J;if(v.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 '${_}' is already registered under name '${I.name}'. Run 'ocx registry remove ${I.name}' first, then re-add.`);let D=q&&!j||H,E=q&&j,A=U.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:E?[]:[{action:"add",target:`registry:${J}`,details:{url:_}}],validation:{passed:!D,warnings:Z.length>0?Z:void 0},summary:D?`Would fail: conflict detected for registry '${J}'`:E?`Registry '${J}' already configured with same URL (no-op)`:`Would add registry '${J}' to ${A}`}}if(q&&!j)throw new W0(J,z.url,_,U.targetLabel);if(H)throw new W0(J,_,_,U.targetLabel,I.name);if(q&&j)return{name:J,url:_,updated:!1,alreadyConfigured:!0};return await U.setRegistry(J,{url:_}),{name:J,url:_,updated:!1,alreadyConfigured:!1}}function HA($,v){for(let[U,Q]of Object.entries($))if(p$(Q.url)===v)return{name:U,config:Q};return null}async function WA($,v){if(v.isLocked?.())throw Error("Registries are locked. Cannot remove.");let U=v.getRegistries();if(!($ in U))throw Error(`Registry '${$}' not found.`);return await v.removeRegistry($),{removed:$}}function bA($){let v=$.getRegistries(),U=$.isLocked?.()??!1;return{registries:Object.entries(v).map(([_,J])=>({name:_,url:J.url})),locked:U}}async function gY($,v,U){let Q=v.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(Hj($.profile),!await(await c$.requireInitialized()).exists($.profile))throw new m$($.profile);let Y=B4($.profile);if(!jA(Y))throw new d(`Profile '${$.profile}' has no ocx.jsonc. Run 'ocx profile config ${$.profile}' to create it.`);return{scope:"profile",configPath:Y,configDir:gH(Y),targetLabel:`profile '${$.profile}' config`}}if($.global){let J=N4();return{scope:"global",configPath:hH(J,"ocx.jsonc"),configDir:J,targetLabel:"global config"}}let _=p6(U);return{scope:"local",configPath:_.path,configDir:_.exists?gH(_.path):hH(U,".opencode"),targetLabel:"local config"}}function cH($){let v=$.command("registry").description("Manage registries"),U=v.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");K6(U),B8(U),Q4(U),U.action(async(J,Y,z)=>{let I;try{let X=Y.cwd??process.cwd();I=await gY(Y,z,X);let{configDir:q,configPath:G}=I,j=await C4(q);if(!j){let D=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. ${D}`),process.exit(1)}let H=await KA(J,Y,{getRegistries:()=>j.registries,isLocked:()=>j.lockRegistries??!1,setRegistry:async(D,E)=>{j.registries[D]=E,await a_(q,j,G)},targetLabel:I.targetLabel});if("dryRun"in H&&H.dryRun){T4(H,{json:Y.json,quiet:Y.quiet});return}let Z=H;if(Y.json)F$({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=v.command("remove").description("Remove a registry").argument("<name>","Registry name");K6(Q),B8(Q),Q4(Q),Q.action(async(J,Y,z)=>{try{let I=Y.cwd??process.cwd(),X=await gY(Y,z,I),q=await C4(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 WA(J,{getRegistries:()=>q.registries,isLocked:()=>q.lockRegistries??!1,removeRegistry:async(j)=>{delete q.registries[j],await a_(X.configDir,q,X.configPath)}});if(Y.json)F$({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");K6(_),B8(_),Q4(_),_.action(async(J,Y)=>{try{let z=J.cwd??process.cwd(),I=await gY(J,Y,z),X=await C4(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=bA({getRegistries:()=>X.registries,isLocked:()=>X.lockRegistries??!1});if(J.json)F$({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?m.yellow(" (locked)"):""}:`);for(let j of q.registries)console.log(` ${m.cyan(j.name)}: ${j.url}`)}}catch(z){_$(z,{json:J.json})}})}var lH=b(()=>{O6();G6();Z4();X4();w1();z$();l$();i$();i6();s4()});function BA($){return $.includes("/")&&!$.includes("::")}function ZA($){try{let{namespace:v,component:U}=o4($);return{registryName:v,componentName:U}}catch(v){throw new M(v instanceof Error?v.message:`Invalid component ref: '${$}'`)}}function DA($,v){return`Ambiguous component reference '${$}'. Found ${v.length} installed matches:
240
- `+v.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 VA($){return`Component '${$}' is not installed.
244
- Run 'ocx search --installed' to see installed components.`}function MA($,v){let U=Object.keys(v.installed);if(v.installed[$])return $;if(BA($)){let{registryName:Q,componentName:_}=ZA($),J=U.filter((Y)=>{let z=l6(Y);return z.registryName===Q&&z.name===_}).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(DA($,J))}throw new B$(VA($))}function c8($,v){return $.map((U)=>MA(U,v))}var hY=b(()=>{t4();z$();T0()});import{realpathSync as dH}from"fs";import{rm as wA}from"fs/promises";import{sep as LA}from"path";function pH($,v,U){let Q=O4($,U),_;try{_=dH(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(!_.startsWith(v+LA))throw new M("Security violation: path escapes project directory");return{path:U,targetReal:_}}function kA($,v,U){let Q=pH($,v,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 AA($){let v=new Set,U=[];for(let Q of $){if(v.has(Q))continue;v.add(Q),U.push(Q)}return U}function iH($){let v=$.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");Q4(v),v.option("-f, --force","Force removal even if files have been modified"),h4(v),v.option("--dry-run","Show what would be removed without making changes").action(async(U,Q)=>{try{await OA(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function OA($,v){let U=v.cwd??process.cwd(),Q=await f4.requireInitialized(U);if($.length===0)throw new M("No components specified. Specify at least one component ID.");let _=await F4(Q.cwd);if(!_||Object.keys(_.installed).length===0)throw new B$("No components installed.");let J=AA(c8($,_)),Y=v.quiet?null:D$({text:"Removing components..."});Y?.start();let z=[],I=[],X=[],q=[],G=!1,j;try{j=dH(Q.cwd)}catch(H){throw new M("Cannot resolve project directory")}try{for(let H of J){let Z=_.installed[H];if(!Z)throw Error(`Resolved component '${H}' was not found in receipt.`);let D=[];for(let A of Z.files){if(!A.path||A.path===".")throw new M(`Invalid file path in receipt for '${H}': path cannot be empty or "."`);try{D.push(pH(Q.cwd,j,A.path))}catch(r){if(r instanceof U4)throw new M(`Security violation in receipt for '${H}': ${r.message}`);throw r}}let E=await iv(Q.cwd,Z);if(!E.intact){G=!0;let A=E.modified.map((r)=>` - ${r}`).join(`
245
- `);if(v.force)q.push(`Component '${H}' has been modified but will be force-removed:
246
- ${A}`);else q.push(`Component '${H}' has been modified. Use --force to remove anyway:
247
- ${A}`)}X.push({canonicalId:H,files:D})}if(v.dryRun){Y?.stop();let H={dryRun:!0,command:"remove",wouldPerform:X.flatMap(({canonicalId:Z,files:D})=>D.map((E)=>({action:"delete",target:E.path,details:{component:Z}}))),validation:{passed:!G||Boolean(v.force),warnings:q.length>0?q:void 0},summary:`${X.length} component(s), ${X.reduce((Z,D)=>Z+D.files.length,0)} file(s) would be removed`};T4(H,{json:v.json,quiet:v.quiet,hints:G&&!v.force?["Add --force to remove modified files"]:void 0});return}if(G&&!v.force){Y?.fail("File integrity check failed");let H;for(let Z of X){let D=_.installed[Z.canonicalId];if(!D)continue;try{let E=await iv(Q.cwd,D);if(!E.intact){H={canonicalId:Z.canonicalId,integrity:E};break}}catch(E){throw new M(`Failed to check integrity for '${Z.canonicalId}': ${E instanceof Error?E.message:String(E)}`)}}if(H){let Z=H.integrity.modified.length>0?`Modified files:
248
- ${H.integrity.modified.map((A)=>` - ${A}`).join(`
249
- `)}`:"",D=H.integrity.missing.length>0?`Missing files:
250
- ${H.integrity.missing.map((A)=>` - ${A}`).join(`
251
- `)}`:"",E=[Z,D].filter(Boolean).join(`
252
- `);throw new M(`Component '${H.canonicalId}' has been modified. Use --force to remove anyway.
253
- ${E}`)}}for(let{canonicalId:H,files:Z}of X){for(let D of Z){let E=kA(Q.cwd,j,D);if(!E){if(v.verbose)W.info(` \u2298 Skipped ${D.path} (not found)`);continue}if(await wA(E,{force:!0}),v.verbose)W.info(` \u2713 Removed ${D.path}`)}delete _.installed[H],z.push(H)}if(await y4(Q.cwd,_),Y?.succeed(`Removed ${z.length} component(s)`),v.json)console.log(JSON.stringify({success:!0,removed:z,notFound:I},null,2));else if(!v.quiet){W.info("");for(let H of z){let Z=l6(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 nH=b(()=>{k0();X4();hY();w1();z$();l$();i$();q1();T0();s4();$6()});var oH=T6((rH,l8)=>{(($,v)=>{if(typeof define==="function"&&define.amd)define([],v);else if(typeof l8==="object"&&l8.exports)l8.exports=v();else $.fuzzysort=v()})(rH,($)=>{var v=(F,k)=>{if(!F||!k)return X$;var f=H(F);if(!h(k))k=j(k);var p=f.bitflags;if((p&k._bitflags)!==p)return X$;return D(f,k)},U=(F,k,f)=>{if(!F)return f?.all?Z(k,f):R$;var p=H(F),i=p.bitflags,c=p.containsSpace,C=q(f?.threshold||0),s=f?.limit||I$,n=0,H$=0,G$=k.length;function K4(a6){if(n<s)E1.add(a6),++n;else if(++H$,a6._score>E1.peek()._score)E1.replaceTop(a6)}if(f?.key){var $4=f.key;for(var W$=0;W$<G$;++W$){var J4=k[W$],w$=y(J4,$4);if(!w$)continue;if(!h(w$))w$=j(w$);if((i&w$._bitflags)!==i)continue;var N$=D(p,w$);if(N$===X$)continue;if(N$._score<C)continue;N$.obj=J4,K4(N$)}}else if(f?.keys){var N6=f.keys,R4=N6.length;$:for(var W$=0;W$<G$;++W$){var J4=k[W$];{var v4=0;for(var j$=0;j$<R4;++j$){var $4=N6[j$],w$=y(J4,$4);if(!w$){x[j$]=j4;continue}if(!h(w$))w$=j(w$);x[j$]=w$,v4|=w$._bitflags}if((i&v4)!==i)continue}if(c)for(let L$=0;L$<p.spaceSearches.length;L$++)a[L$]=v$;for(var j$=0;j$<R4;++j$){if(w$=x[j$],w$===j4){o[j$]=j4;continue}if(o[j$]=D(p,w$,!1,c),o[j$]===X$){o[j$]=j4;continue}if(c)for(let S$=0;S$<p.spaceSearches.length;S$++){if(V$[S$]>-1000){if(a[S$]>v$){var a$=(a[S$]+V$[S$])/4;if(a$>a[S$])a[S$]=a$}}if(V$[S$]>a[S$])a[S$]=V$[S$]}}if(c){for(let L$=0;L$<p.spaceSearches.length;L$++)if(a[L$]===v$)continue $}else{var q$=!1;for(let L$=0;L$<R4;L$++)if(o[L$]._score!==v$){q$=!0;break}if(!q$)continue}var M4=new z(R4);for(let L$=0;L$<R4;L$++)M4[L$]=o[L$];if(c){var r$=0;for(let L$=0;L$<p.spaceSearches.length;L$++)r$+=a[L$]}else{var r$=v$;for(let S$=0;S$<R4;S$++){var N$=M4[S$];if(N$._score>-1000){if(r$>v$){var a$=(r$+N$._score)/4;if(a$>r$)r$=a$}}if(N$._score>r$)r$=N$._score}}if(M4.obj=J4,M4._score=r$,f?.scoreFn){if(r$=f.scoreFn(M4),!r$)continue;r$=q(r$),M4._score=r$}if(r$<C)continue;K4(M4)}}else for(var W$=0;W$<G$;++W$){var w$=k[W$];if(!w$)continue;if(!h(w$))w$=j(w$);if((i&w$._bitflags)!==i)continue;var N$=D(p,w$);if(N$===X$)continue;if(N$._score<C)continue;K4(N$)}if(n===0)return R$;var S6=Array(n);for(var W$=n-1;W$>=0;--W$)S6[W$]=E1.poll();return S6.total=n+H$,S6},Q=(F,k="<b>",f="</b>")=>{var p=typeof k==="function"?k:void 0,i=F.target,c=i.length,C=F.indexes,s="",n=0,H$=0,G$=!1,K4=[];for(var $4=0;$4<c;++$4){var W$=i[$4];if(C[H$]===$4){if(++H$,!G$)if(G$=!0,p)K4.push(s),s="";else s+=k;if(H$===C.length){if(p)s+=W$,K4.push(p(s,n++)),s="",K4.push(i.substr($4+1));else s+=W$+f+i.substr($4+1);break}}else if(G$)if(G$=!1,p)K4.push(p(s,n++)),s="";else s+=f;s+=W$}return p?K4:s},_=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";var k=r(F);return I(F,{_targetLower:k._lower,_targetLowerCodes:k.lowerCodes,_bitflags:k.bitflags})},J=()=>{w.clear(),N.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((F,k)=>F-k)}set["indexes"](F){return this._indexes=F}["highlight"](F,k){return Q(this,F,k)}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,k)=>{let f=new Y;return f.target=F,f.obj=k.obj??X$,f._score=k._score??v$,f._indexes=k._indexes??[],f._targetLower=k._targetLower??"",f._targetLowerCodes=k._targetLowerCodes??X$,f._nextBeginningIndexes=k._nextBeginningIndexes??X$,f._bitflags=k._bitflags??0,f},X=(F)=>{if(F===v$)return 0;if(F>1)return F;return Math.E**(((-F+1)**0.04307-1)*-2)},q=(F)=>{if(F===0)return v$;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 k=r(F),f=[];if(k.containsSpace){var p=F.split(/\s+/);p=[...new Set(p)];for(var i=0;i<p.length;i++){if(p[i]==="")continue;var c=r(p[i]);f.push({lowerCodes:c.lowerCodes,_lower:p[i].toLowerCase(),containsSpace:!1})}}return{lowerCodes:k.lowerCodes,_lower:k._lower,containsSpace:k.containsSpace,bitflags:k.bitflags,spaceSearches:f}},j=(F)=>{if(F.length>999)return _(F);var k=w.get(F);if(k!==void 0)return k;return k=_(F),w.set(F,k),k},H=(F)=>{if(F.length>999)return G(F);var k=N.get(F);if(k!==void 0)return k;return k=G(F),N.set(F,k),k},Z=(F,k)=>{var f=[];f.total=F.length;var p=k?.limit||I$;if(k?.key)for(var i=0;i<F.length;i++){var c=F[i],C=y(c,k.key);if(C==X$)continue;if(!h(C))C=j(C);var s=I(C.target,{_score:C._score,obj:c});if(f.push(s),f.length>=p)return f}else if(k?.keys)for(var i=0;i<F.length;i++){var c=F[i],n=new z(k.keys.length);for(var H$=k.keys.length-1;H$>=0;--H$){var C=y(c,k.keys[H$]);if(!C){n[H$]=j4;continue}if(!h(C))C=j(C);C._score=v$,C._indexes.len=0,n[H$]=C}if(n.obj=c,n._score=v$,f.push(n),f.length>=p)return f}else for(var i=0;i<F.length;i++){var C=F[i];if(C==X$)continue;if(!h(C))C=j(C);if(C._score=v$,C._indexes.len=0,f.push(C),f.length>=p)return f}return f},D=(F,k,f=!1,p=!1)=>{if(f===!1&&F.containsSpace)return E(F,k,p);var{_lower:i,lowerCodes:c}=F,C=c[0],s=k._targetLowerCodes,n=c.length,H$=s.length,W$=0,G$=0,K4=0;for(;;){var $4=C===s[G$];if($4){if(L[K4++]=G$,++W$,W$===n)break;C=c[W$]}if(++G$,G$>=H$)return X$}var W$=0,J4=!1,w$=0,N$=k._nextBeginningIndexes;if(N$===X$)N$=k._nextBeginningIndexes=g(k.target);G$=L[0]===0?0:N$[L[0]-1];var N6=0;if(G$!==H$)for(;;)if(G$>=H$){if(W$<=0)break;if(++N6,N6>200)break;--W$;var R4=U$[--w$];G$=N$[R4]}else{var $4=c[W$]===s[G$];if($4){if(U$[w$++]=G$,++W$,W$===n){J4=!0;break}++G$}else G$=N$[G$]}var v4=n<=1?-1:k._targetLower.indexOf(i,L[0]),j$=!!~v4,a$=!j$?!1:v4===0||k._nextBeginningIndexes[v4-1]===v4;if(j$&&!a$)for(var q$=0;q$<N$.length;q$=N$[q$]){if(q$<=v4)continue;for(var M4=0;M4<n;M4++)if(c[M4]!==k._targetLowerCodes[q$+M4])break;if(M4===n){v4=q$,a$=!0;break}}var r$=(L$)=>{var S$=0,vz=0;for(var H6=1;H6<n;++H6)if(L$[H6]-L$[H6-1]!==1)S$-=L$[H6],++vz;var nW=L$[n-1]-L$[0]-(n-1);if(S$-=(12+nW)*vz,L$[0]!==0)S$-=L$[0]*L$[0]*0.2;if(!J4)S$*=1000;else{var $9=1;for(var H6=N$[0];H6<H$;H6=N$[H6])++$9;if($9>24)S$*=($9-24)*10}if(S$-=(H$-n)/2,j$)S$/=1+n*n*1;if(a$)S$/=1+n*n*1;return S$-=(H$-n)/2,S$};if(!J4){if(j$)for(var q$=0;q$<n;++q$)L[q$]=v4+q$;var S6=L,a6=r$(S6)}else if(a$){for(var q$=0;q$<n;++q$)L[q$]=v4+q$;var S6=L,a6=r$(L)}else var S6=U$,a6=r$(U$);k._score=a6;for(var q$=0;q$<n;++q$)k._indexes[q$]=S6[q$];k._indexes.len=n;let Q2=new Y;return Q2.target=k.target,Q2._score=k._score,Q2._indexes=k._indexes,Q2},E=(F,k,f)=>{var p=new Set,i=0,c=X$,C=0,s=F.spaceSearches,n=s.length,H$=0,G$=()=>{for(let a$=H$-1;a$>=0;a$--)k._nextBeginningIndexes[$$[a$*2+0]]=$$[a$*2+1]},K4=!1;for(var j$=0;j$<n;++j$){V$[j$]=v$;var $4=s[j$];if(c=D($4,k),f){if(c===X$)continue;K4=!0}else if(c===X$)return G$(),X$;var W$=j$===n-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,N6=k._nextBeginningIndexes[N$-1];for(let q$=N$-1;q$>=0;q$--){if(N6!==k._nextBeginningIndexes[q$])break;k._nextBeginningIndexes[q$]=N$,$$[H$*2+0]=q$,$$[H$*2+1]=N6,H$++}}}if(i+=c._score/n,V$[j$]=c._score/n,c._indexes[0]<C)i-=(C-c._indexes[0])*2;C=c._indexes[0];for(var R4=0;R4<c._indexes.len;++R4)p.add(c._indexes[R4])}if(f&&!K4)return X$;G$();var v4=D(F,k,!0);if(v4!==X$&&v4._score>i){if(f)for(var j$=0;j$<n;++j$)V$[j$]=v4._score/n;return v4}if(f)c=k;c._score=i;var j$=0;for(let a$ of p)c._indexes[j$++]=a$;return c._indexes.len=j$,c},A=(F)=>F.replace(/\p{Script=Latin}+/gu,(k)=>k.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),r=(F)=>{F=A(F);var k=F.length,f=F.toLowerCase(),p=[],i=0,c=!1;for(var C=0;C<k;++C){var s=p[C]=f.charCodeAt(C);if(s===32){c=!0;continue}var n=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;i|=1<<n}return{lowerCodes:p,bitflags:i,containsSpace:c,_lower:f}},O=(F)=>{var k=F.length,f=[],p=0,i=!1,c=!1;for(var C=0;C<k;++C){var s=F.charCodeAt(C),n=s>=65&&s<=90,H$=n||s>=97&&s<=122||s>=48&&s<=57,G$=n&&!i||!c||!H$;if(i=n,c=H$,G$)f[p++]=C}return f},g=(F)=>{F=A(F);var k=F.length,f=O(F),p=[],i=f[0],c=0;for(var C=0;C<k;++C)if(i>C)p[C]=i;else i=f[++c],p[C]=i===void 0?k:i;return p},w=new Map,N=new Map,L=[],U$=[],$$=[],a=[],V$=[],x=[],o=[],y=(F,k)=>{var f=F[k];if(f!==void 0)return f;if(typeof k==="function")return k(F);var p=k;if(!Array.isArray(k))p=k.split(".");var i=p.length,c=-1;while(F&&++c<i)F=F[p[c]];return F},h=(F)=>{return typeof F==="object"&&typeof F._bitflags==="number"},I$=1/0,v$=-I$,R$=[];R$.total=0;var X$=null,j4=_(""),e8=(F)=>{var k=[],f=0,p={},i=(c)=>{for(var C=0,s=k[C],n=1;n<f;){var H$=n+1;C=n,H$<f&&k[H$]._score<k[n]._score&&(C=H$),k[C-1>>1]=k[C],n=1+(C<<1)}for(var G$=C-1>>1;C>0&&s._score<k[G$]._score;G$=(C=G$)-1>>1)k[C]=k[G$];k[C]=s};return p.add=(c)=>{var C=f;k[f++]=c;for(var s=C-1>>1;C>0&&c._score<k[s]._score;s=(C=s)-1>>1)k[C]=k[s];k[C]=c},p.poll=(c)=>{if(f!==0){var C=k[0];return k[0]=k[--f],i(),C}},p.peek=(c)=>{if(f!==0)return k[0]},p.replaceTop=(c)=>{k[0]=c,i()},p},E1=e8();return{single:v,go:U,prepare:_,cleanup:J}})});var aH={};s$(aH,{runSearchCore:()=>tH,runSearchCommandAction:()=>FA});async function FA($,v){if(v.installed){let Q=await F4(v.cwd);if(!Q||Object.keys(Q.installed).length===0){if(v.json)F$({success:!0,data:{components:[]}});else W.info("No components installed.");return}let _=Object.entries(Q.installed).map(([J,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(v.json)F$({success:!0,data:{components:_}});else{W.info(`Installed components (${_.length}):`);for(let J of _)console.log(` ${m.cyan(J.name)} ${m.dim(`v${J.version}`)} from ${J.registry}`)}return}let U;if(v.profile){let Q=await j6.create(v.cwd,{profile:v.profile});U={cwd:Q.getCwd(),getRegistries:()=>Q.getRegistries(),getComponentPath:()=>Q.getComponentPath()}}else U=await f4.requireInitialized(v.cwd);await tH($,v,U)}async function tH($,v,U){let Q=U.getRegistries();if(v.verbose)W.info(`Searching in ${Object.keys(Q).length} registries...`);let _=[],J=D$({text:"Searching registries...",quiet:v.quiet||v.verbose});if(!v.json&&!v.verbose)J.start();for(let[z,I]of Object.entries(Q))try{if(v.verbose)W.info(`Fetching index from ${z} (${I.url})...`);let X=await r6(I.url);if(v.verbose)W.info(`Found ${X.components.length} components in ${z}`);for(let q of X.components)_.push({name:`${z}/${q.name}`,description:q.description,type:q.type,registry:z})}catch(X){if(v.verbose)W.warn(`Failed to fetch registry ${z}: ${X instanceof Error?X.message:String(X)}`)}if(!v.json&&!v.verbose)J.stop();let Y=_;if($)Y=cY.default.go($,_,{keys:["name","description"],limit:v.limit}).map((I)=>I.obj);else Y=Y.slice(0,v.limit);if(v.json){F$({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(` ${m.cyan(z.name)} ${m.dim(`(${z.type})`)} - ${z.description}`)}var cY;var sH=b(()=>{O6();k0();cv();V1();LJ();i$();$6();cY=_z(oH(),1)});function NA($){let v=parseInt($,10);if(Number.isNaN(v)||v<=0)throw new sq("Must be a positive integer");return v}function eH($){let v=$.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 w6("--limit <n>","Limit results").default(20).argParser(NA));Q4(v),h4(v),v.action(async(U,Q)=>{try{let{runSearchCommandAction:_}=await Promise.resolve().then(() => (sH(),aH));await _(U,Q)}catch(_){_$(_,{json:Q.json})}})}var $W=b(()=>{$8();l$();s4()});function vW($){let v=["curl","npm","yarn","pnpm","bun"],U=v.find((Q)=>Q===$);if(!U)throw new f$(`Invalid install method: "${$}"
254
- Valid methods: ${v.join(", ")}`);return U}function h0(){if(SA())return"curl";let $=process.argv[1]??"";if(TA($))return"unknown";if(RA($))return"yarn";if(EA($))return"pnpm";if(PA($))return"bun";if(xA($))return"npm";let v=process.env.npm_config_user_agent??"";if(v.includes("yarn"))return"yarn";if(v.includes("pnpm"))return"pnpm";if(v.includes("bun"))return"bun";if(v.includes("npm"))return"npm";return"unknown"}function d8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var SA=()=>Bun.main.startsWith("/$bunfs/"),TA=($)=>$.includes("/_npx/")||$.includes("/.cache/bunx/")||$.includes("/.pnpm/_temp/"),RA=($)=>$.includes("/.yarn/global")||$.includes("/.config/yarn/global"),EA=($)=>$.includes("/.pnpm/")||$.includes("/pnpm/global"),PA=($)=>$.includes("/.bun/bin")||$.includes("/.bun/install/global"),xA=($)=>$.includes("/.npm/")||$.includes("/node_modules/");var p8=b(()=>{z$()});import{existsSync as dY,lstatSync as QW,readdirSync as uA,realpathSync as _W,rmSync as yA,unlinkSync as JW}from"fs";import{homedir as YW}from"os";import v6 from"path";function lY($,v=0){F$({success:!0,data:$}),process.exit(v)}function N1($,v,U,Q){let _={success:!1,error:{code:$,message:v,...Q&&{details:Q}},exitCode:U,meta:{timestamp:new Date().toISOString()}};F$(_),process.exit(U)}function pY($){return $ instanceof Error&&"code"in $}function _2($){let v=YW();if(!v)return $;if($===v)return"~";if($.startsWith(v+v6.sep))return`~${$.slice(v.length)}`;return $}function n8($,v){let U=v6.normalize($),Q=v6.normalize(v),_=v6.relative(U,Q);if(_.startsWith("..")||v6.isAbsolute(_))return null;return _}function CA($,v){return n8($,v)!==null}function fA($,v){if(!dY(v))return{contained:!0};try{let U=_W($),Q=_W(v);return{contained:n8(U,Q)!==null}}catch(U){if(pY(U)&&(U.code==="EACCES"||U.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function zW($){try{let v=QW($);if(v.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!v.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(v){if(pY(v)){if(v.code==="ENOENT")return{valid:!1,reason:"not-found"};if(v.code==="EACCES"||v.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function U2($){if(!dY($))return"missing";try{let v=QW($);if(v.isSymbolicLink())return"symlink";if(v.isDirectory())return"directory";return"file"}catch{return"missing"}}function mA($){if(!dY($))return!0;try{return uA($).length===0}catch{return!1}}function UW($){if($.kind==="missing")return"safe";if($.kind==="symlink")return CA($.rootPath,$.absolutePath)?"safe":"forbidden";let v=fA($.rootPath,$.absolutePath);if(v.error)return"error";return v.contained?"safe":"forbidden"}function S1($){return $==="npm"||$==="pnpm"||$==="bun"||$==="yarn"}function r8($){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 iY(){let $=process.env.XDG_CONFIG_HOME||v6.join(YW(),".config");return v6.join($,"opencode")}function IW(){let $=iY(),v=[],U=L6(),Q=n8($,U);if(Q){let z=U2(U);v.push({rootPath:$,relativePath:Q,absolutePath:U,displayPath:_2(U),kind:z,deleteIfEmpty:!1,safetyStatus:UW({rootPath:$,absolutePath:U,kind:z})})}let _=O0(),J=n8($,_);if(J){let z=U2(_);v.push({rootPath:$,relativePath:J,absolutePath:_,displayPath:_2(_),kind:z,deleteIfEmpty:!1,safetyStatus:UW({rootPath:$,absolutePath:_,kind:z})})}let Y=U2($);return v.push({rootPath:$,relativePath:".",absolutePath:$,displayPath:_2($),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),v}function XW(){let $=h0();if(S1($))return null;if($==="curl"){let v=d8(),U=U2(v);return{rootPath:v6.dirname(v),relativePath:v6.basename(v),absolutePath:v,displayPath:_2(v),kind:U,deleteIfEmpty:!1,safetyStatus:U==="missing"?"safe":"safe"}}return null}function gA($){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(!mA($.absolutePath))return{target:$,success:!0,skipped:!0,reason:"not empty"}}try{if($.kind==="directory")yA($.absolutePath,{recursive:!0,force:!0});else JW($.absolutePath);return{target:$,success:!0,skipped:!1}}catch(v){let U=v instanceof Error?v:Error(String(v)),Q=pY(v)&&(v.code==="EACCES"||v.code==="EPERM")?"permission denied":void 0;return{target:$,success:!1,skipped:!1,reason:Q,error:U}}}function qW($){return $.map(gA)}function GW($,v={}){let U={rootPath:v6.dirname($),relativePath:v6.basename($),absolutePath:$,displayPath:_2($),kind:U2($),deleteIfEmpty:!1,safetyStatus:"safe"};if(U.kind==="missing")return{target:U,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!v.suppressOutput)W.info(`To complete uninstall, manually delete: ${U.displayPath}`);return{target:U,success:!0,skipped:!0}}try{return JW($),{target:U,success:!0,skipped:!1}}catch(Q){let _=Q instanceof Error?Q:Error(String(Q));return{target:U,success:!1,skipped:!1,reason:"permission denied",error:_}}}function hA($,v,U){let{dryRunResult:Q,hints:_}=jW($,v,U);T4(Q,{hints:_})}function jW($,v,U){let Q=$.filter((z)=>z.kind!=="missing"),_=[];for(let z of Q)_.push({action:"delete",target:z.displayPath,details:{kind:z.kind,...z.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(v&&v.kind!=="missing")_.push({action:"delete",target:v.displayPath,details:{kind:"binary"}});let J=[];if(S1(U))J.push(`Binary is managed by ${U}. Run: ${r8(U)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:_,validation:{passed:!0},summary:_.length>0?`Would remove ${_.length} item(s)`:"Nothing to remove"},hints:J}}function cA($,v){if($.filter((Q)=>Q.kind!=="missing").length>0||v&&v.kind!=="missing")W.info("Removing OCX files...")}function lA($,v,U){W.break();for(let Q of $){if(Q.skipped){if(Q.reason==="not found")continue;if(Q.reason==="not empty"){W.info(`Kept ${S4.path(Q.target.displayPath)} (not empty)`);continue}if(Q.reason==="permission denied"){W.warn(`Skipped ${S4.path(Q.target.displayPath)} (permission denied)`);continue}if(Q.reason==="containment violation"){W.warn(`Skipped ${S4.path(Q.target.displayPath)} (containment violation)`);continue}}if(Q.success)W.success(`Removed ${S4.path(Q.target.displayPath)}`);else W.error(`Failed to remove ${Q.target.displayPath}: ${Q.error?.message}`)}if(v){if(v.skipped&&v.reason==="not found");else if(v.success&&!v.skipped)W.success(`Removed binary ${S4.path(v.target.displayPath)}`);else if(!v.success)W.error(`Failed to remove binary ${v.target.displayPath}: ${v.error?.message}`)}if(S1(U))W.break(),W.info(`Binary is managed by ${U}. To complete uninstall, run:`),W.log(` ${S4.command(r8(U))}`)}function dA(){W.info("Nothing to remove. OCX is not installed globally.")}function i8($){return{path:$.target.displayPath,kind:$.target.kind,success:$.success,skipped:$.skipped,...$.reason&&{reason:$.reason},...$.error&&{error:$.error.message}}}async function pA($){let v=iY(),U=zW(v);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=IW(),_=Q.filter((A)=>A.safetyStatus==="forbidden");if(_.length>0)return N1("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",n$.SAFETY_ERROR,{targets:_.map((A)=>A.displayPath)});let J=Q.filter((A)=>A.safetyStatus==="error");if(J.length>0)return N1("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",n$.ERROR,{targets:J.map((A)=>A.displayPath)});let Y=h0(),z=XW(),I=Q.filter((A)=>A.kind!=="missing"),X=Boolean(z&&z.kind!=="missing"),q=S1(Y);if(I.length===0&&!X&&!q)return lY({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},n$.SUCCESS);if($.dryRun){let{dryRunResult:A,hints:r}=jW(Q,z,Y);return lY({...A,...r.length>0&&{hints:r}},n$.SUCCESS)}let G=qW(Q),j=null;if(z)j=GW(z.absolutePath,{suppressOutput:!0});let H=G.some((A)=>!A.success&&!A.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(i8),...j&&{binaryResult:i8(j)}});if(S1(Y))return N1("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${r8(Y)}`,n$.ERROR,{installMethod:Y,command:r8(Y),configResults:G.map(i8),...j&&{binaryResult:i8(j)}});let D=G.filter((A)=>A.success&&!A.skipped).map((A)=>A.target.displayPath),E=G.filter((A)=>A.skipped).map((A)=>({path:A.target.displayPath,reason:A.reason??"skipped"}));if(j){if(j.success&&!j.skipped)D.push(j.target.displayPath);else if(j.skipped)E.push({path:j.target.displayPath,reason:j.reason??"skipped"})}return lY({removed:D,skipped:E,installMethod:Y},n$.SUCCESS)}async function iA($){if($.json){await pA($);return}let v=iY(),U=zW(v);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=IW(),_=Q.filter((D)=>D.safetyStatus==="forbidden");if(_.length>0){W.error("Safety error: Target escapes containment boundary:");for(let D of _)W.error(` ${D.displayPath}`);process.exit(n$.SAFETY_ERROR)}let J=Q.filter((D)=>D.safetyStatus==="error");if(J.length>0){W.error("Error: Cannot verify containment for targets (permission/IO error):");for(let D of J)W.error(` ${D.displayPath}`);process.exit(n$.ERROR)}let Y=h0(),z=XW(),I=Q.filter((D)=>D.kind!=="missing"),X=z&&z.kind!=="missing",q=S1(Y);if(I.length===0&&!X&&!q)dA(),process.exit(n$.SUCCESS);if($.dryRun)hA(Q,z,Y),process.exit(n$.SUCCESS);cA(Q,z);let G=qW(Q),j=null;if(z)j=GW(z.absolutePath);lA(G,j,Y);let H=G.some((D)=>!D.success&&!D.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 KW($){$.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(v)=>{try{await iA(v)}catch(U){_$(U,{json:v.json})}})}var n$;var HW=b(()=>{Z4();p8();w1();l$();i$();n$={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class WW{version="2.0.6"}var bW;var BW=b(()=>{bW=new WW});var DW={};s$(DW,{checkForUpdate:()=>rY,EXPLICIT_UPDATE_TIMEOUT_MS:()=>nY});function ZW($){let[v=""]=$.split("-"),U=v.split("."),Q=parseInt(U[0]??"",10),_=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(_)||Number.isNaN(J))return null;return{major:Q,minor:_,patch:J}}function oA($,v){let U=ZW($),Q=ZW(v);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 rY($,v=nA){let Q=($??bW).version||"0.0.0-dev";if(Q==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let J=(await H8(rA,void 0,AbortSignal.timeout(v))).version,Y=oA(J,Q);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:Q,latest:J,updateAvailable:Y>0}}catch(_){if(_ instanceof Error){if(_.name==="AbortError"||_.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(_ instanceof P$||_.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var nA=200,nY=1e4,rA="ocx";var oY=b(()=>{z$();aJ();BW()});import{chmodSync as tA,existsSync as T1,renameSync as tY,unlinkSync as o8}from"fs";function eA(){let $=process.env.OCX_DOWNLOAD_URL;if($)return $.replace(/\/+$/,"");return sA}function aY($){let v=`${process.arch}-${process.platform}`,U=VW[v];if(!U){let _=Object.keys(VW).join(", ");throw new f$(`Unsupported platform: ${v}
255
- Supported platforms: ${_}`)}return`${eA()}/v${$}/${U}`}async function $O($,v,U={}){let Q=U.quiet?null:D$({text:"Downloading update..."});Q?.start();let _;try{_=await fetch($,{redirect:"follow"})}catch(X){throw Q?.fail("Download failed"),new f$(`Network error: ${X instanceof Error?X.message:String(X)}`)}if(!_.ok)throw Q?.fail("Download failed"),new f$(`Failed to download: HTTP ${_.status} ${_.statusText}`);if(!_.body)throw Q?.fail("Download failed"),new f$("Download failed: Empty response body");let J=_.body.getReader(),Y=Bun.file(v).writer(),z=Number(_.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 MW($,v={}){let U=d8(),Q=`${U}.new.${Date.now()}`,_=aY($);await $O(_,Q,v);try{tA(Q,493)}catch(J){if(T1(Q))o8(Q);throw new f$(`Failed to set permissions: ${J instanceof Error?J.message:String(J)}`)}return{tempPath:Q,execPath:U}}function wW($,v){let U=`${v}.backup`;try{if(T1(v))tY(v,U);if(tY($,v),T1(U))o8(U)}catch(Q){if(T1(U)&&!T1(v))try{tY(U,v)}catch{}if(T1($))try{o8($)}catch{}throw new f$(`Update failed: ${Q instanceof Error?Q.message:String(Q)}`)}}function LW($){if(T1($))try{o8($)}catch{}}var aA="kdcokenny/ocx",sA,VW;var kW=b(()=>{z$();$6();p8();sA=`https://github.com/${aA}/releases/download`,VW={"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 AW={};s$(AW,{notifyUpdated:()=>t8,notifyUpdate:()=>vO,notifyUpToDate:()=>sY});function vO($,v){if(!process.stdout.isTTY)return;console.error(`${m.cyan("info")}: update available - ${m.green(v)} (current: ${m.dim($)})`),console.error(` run ${m.cyan("`ocx self update`")} to upgrade`)}function sY($){console.error(`${m.cyan("info")}: ocx unchanged - ${m.dim($)}`)}function t8($,v){console.error(` ${m.green("ocx updated")} - ${v} (from ${$})`)}var eY=b(()=>{O6()});import{createHash as _O}from"crypto";function QO($){let v=new Map;for(let U of $.split(`
256
- `)){let Q=U.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if(Q?.[1]&&Q[2])v.set(Q[2].trim(),Q[1].toLowerCase())}return v}function JO($){return _O("sha256").update($).digest("hex")}async function OW($){let v=`https://github.com/${UO}/releases/download/v${$}/SHA256SUMS.txt`,U=await fetch(v);if(!U.ok)throw new f$(`Failed to fetch checksums: ${U.status}`);let Q=await U.text();return QO(Q)}async function FW($,v,U){let _=await Bun.file($).arrayBuffer(),J=JO(Buffer.from(_));if(J!==v)throw new X1(U,v,J)}var UO="kdcokenny/ocx";var NW=b(()=>{z$()});var SW={};s$(SW,{runSelfUpdateCommand:()=>IO});async function IO($){let v=$.method?vW($.method):h0(),U=$.json===!0,Q=await rY(void 0,nY);if(!Q.ok)throw new f$(zO[Q.reason]);let{current:_,latest:J,updateAvailable:Y}=Q;if(!Y&&!$.force){if(U)F$({success:!0,data:{current:_,latest:J,method:v,updated:!1}});else sY(_);return}let z=J;switch(v){case"curl":{await XO(_,z,U);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await qO(v,_,z,U);break}}if(U)F$({success:!0,data:{current:_,latest:z,method:v,updated:!0}})}async function XO($,v,U){let _=aY(v).split("/").pop();if(!_)throw new f$("Failed to determine binary filename from download URL");let Y=(await OW(v)).get(_);if(!Y)throw new f$(`Security error: No checksum found for ${_}. Update aborted.`);let{tempPath:z,execPath:I}=await MW(v,{quiet:U});try{await FW(z,Y,_)}catch(X){throw LW(z),X}if(wW(z,I),!U)t8($,v)}async function a8($){let v=Bun.spawn($,{stdout:"pipe",stderr:"pipe"});if(await v.exited!==0){let Q=await new Response(v.stderr).text();throw new f$(`Package manager command failed: ${Q.trim()}`)}}async function qO($,v,U,Q){if(!YO.test(U))throw new f$(`Invalid version format: ${U}`);let _=Q?null:D$({text:`Updating via ${$}...`});_?.start();try{switch($){case"npm":{await a8(["npm","install","-g",`ocx@${U}`]);break}case"yarn":{await a8(["yarn","global","add",`ocx@${U}`]);break}case"pnpm":{await a8(["pnpm","install","-g",`ocx@${U}`]);break}case"bun":{await a8(["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(_?.succeed(`Updated via ${$}`),!Q)t8(v,U)}catch(J){if(J instanceof f$)throw _?.fail("Update failed"),J;throw _?.fail("Update failed"),new f$(`Failed to run ${$}: ${J instanceof Error?J.message:String(J)}`)}}var YO,zO;var TW=b(()=>{oY();p8();kW();eY();NW();z$();$6();YO=/^\d+\.\d+\.\d+(-[\w.]+)?$/,zO={"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 RW($){$.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(v)=>{try{let{runSelfUpdateCommand:U}=await Promise.resolve().then(() => (TW(),SW));await U(v)}catch(U){_$(U,{json:v.json})}})}var EW=b(()=>{l$()});function PW($){let v=$.command("self").description("Manage the OCX CLI");KW(v),RW(v)}var xW=b(()=>{HW();EW()});import{randomUUID as uW}from"crypto";import{existsSync as R1}from"fs";import{mkdir as GO,rename as jO,rm as s8,stat as KO,writeFile as HO}from"fs/promises";import{dirname as WO,join as bO}from"path";function $z($,v){return`ocx add${v.global?" --global":""} ${$}`}function yW($){return $==="apply"?"Failed to update components":"Failed to check for updates"}function CW($){let v=$.command("update [components...]").description("Update installed components");Q4(v),h4(v),K6(v),v.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 BO(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function BO($,v){let U=v.cwd??process.cwd(),Q=v.global?await L0.requireInitialized():await f4.requireInitialized(U);await ZO($,v,Q)}async function ZO($,v,U,Q){let _=U.getRegistries(),J=U.getComponentPath(),Y=J===""||J===".",z=$.map(VO),I=await F4(U.cwd);if(!I||Object.keys(I.installed).length===0){if($.length>0){let O=$[0];if(!O)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new B$(`Component '${O}' is not installed. Run '${$z(O,v)}' first.`)}throw new B$(`No components installed. Run '${$z("<component>",v)}' first.`)}let X=$.length>0,q=v.all===!0,G=v.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=MO(I,z,v);if(j.length===0){if(G)throw new B$(`No installed components from registry '${v.registry}'.`);throw new B$("No matching components found to update.")}let H=v.quiet?null:D$({text:"Checking for updates..."});H?.start();let Z=null,D="check",E=null,A=[],r=[];try{for(let w of j){let N=w.component,L=I.installed[N];if(!L)throw new B$(`Component '${N}' not found in receipt.`);let{registryName:U$,name:$$}=L,a=_[U$];if(!a)throw new d(`Registry alias '${U$}' not configured. Component '${N}' cannot be updated.`);let x=(await j8(a.url,$$,void 0)).manifest,o=j1(x),y=[];for(let v$ of o.files){let R$=await D1(a.url,$$,v$.path);y.push({path:v$.path,content:Buffer.from(R$)})}let h=await b8(y),I$=`sha256:${h}`;if(h===L.hash)A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"up-to-date"});else if(v.dryRun)A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"would-update"});else A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"updated"}),r.push({canonicalId:N,component:o,files:y,newHash:h,newVersion:I$,baseUrl:a.url,registryName:U$,name:$$})}if(H?.succeed(`Checked ${j.length} component(s)`),v.dryRun){wO(A,v);return}if(r.length===0){if(!v.quiet&&!v.json)W.info(""),W.success("All components are up to date.");if(v.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:A},null,2));return}D="apply",Z=v.quiet?null:D$({text:"Updating components..."}),Z?.start();let O=new Map,g=[];for(let w of r){let N=[];for(let L of w.files){let U$=w.component.files.find((V$)=>V$.path===L.path);if(!U$)throw new M(`File "${L.path}" not found in component manifest for "${w.registryName}/${w.name}".`);let $$=H1(U$.target,Y,U.cwd),a=bO(U.cwd,$$);L1(O,{absolutePath:a,relativePath:$$,content:L.content,source:`${w.registryName}/${w.name}:${U$.path}`}),N.push({resolvedTarget:$$,targetPath:a,content:L.content})}g.push({update:w,preparedFiles:N})}E=await DO(g,{verbose:v.verbose,quiet:v.quiet,fileOps:Q});for(let w of g){let{update:N,preparedFiles:L}=w,U$=I.installed[N.canonicalId];if(!U$)throw new B$(`Component '${N.canonicalId}' not found in receipt.`);let $$=[];for(let a of L)$$.push({path:a.resolvedTarget,hash:k1(a.content)});I.installed[N.canonicalId]={registryUrl:U$.registryUrl,registryName:U$.registryName,name:U$.name,revision:N.newVersion,hash:N.newHash,files:$$,installedAt:U$.installedAt,updatedAt:new Date().toISOString(),...N.component.opencode&&{opencode:N.component.opencode}}}if(await y4(U.cwd,I),!E)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await E.commit(),E=null,Z?.succeed(`Updated ${r.length} component(s)`),v.json)console.log(JSON.stringify({success:!0,updated:A.filter((w)=>w.status==="updated"),upToDate:A.filter((w)=>w.status==="up-to-date")},null,2));else if(!v.quiet){W.info("");for(let w of A)if(w.status==="updated")W.info(` \u2713 ${w.qualifiedName} (${w.oldVersion} \u2192 ${w.newVersion})`);else if(w.status==="up-to-date"&&v.verbose)W.info(` \u25CB ${w.qualifiedName} (already up to date)`);W.info(""),W.success(`Done! Updated ${r.length} component(s).`)}}catch(O){if(D==="apply"){if(E)await E.rollback(),E=null;Z?.fail(yW("apply"))}else H?.fail(yW("check"));throw O}}async function DO($,v){let U=[],Q=new Set,_=!1,J=v.fileOps?.rename??jO,Y=async()=>{if(_)return;_=!0;for(let I of Q)try{await s8(I,{force:!0})}catch{}for(let I of[...U].reverse())try{if(I.backupPath){if(R1(I.targetPath))await s8(I.targetPath,{force:!0,recursive:!0});if(R1(I.backupPath))await J(I.backupPath,I.targetPath)}else if(R1(I.targetPath))await s8(I.targetPath,{force:!0,recursive:!0})}catch{}},z=async()=>{if(_)return;_=!0;for(let I of U){if(!I.backupPath)continue;if(R1(I.backupPath))try{await s8(I.backupPath,{force:!0})}catch(X){if(!v.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=WO(X.targetPath);if(!R1(q))await GO(q,{recursive:!0});if(R1(X.targetPath)){if((await KO(X.targetPath)).isDirectory())throw new M(`Cannot update "${X.resolvedTarget}": target path is a directory.`)}let G=`${X.targetPath}.ocx-update-tmp-${uW()}`;await HO(G,X.content),Q.add(G);let j=null;if(R1(X.targetPath))j=`${X.targetPath}.ocx-update-backup-${uW()}`,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(v.verbose)W.info(` \u2713 Updated ${X.resolvedTarget}`)}return{commit:z,rollback:Y}}catch(I){throw await Y(),I}}function VO($){if($.endsWith("@"))throw new d(`Invalid version specifier '${$}'. The trailing '@' has no version.
268
- Use '${$.slice(0,-1)}' to update to the latest version.`);return{component:$}}function MO($,v,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 _=[];for(let J of v){let Y=J.component;if(!Y.includes("/")){let G=Q.map((j)=>{let H=l6(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}=o4(Y),X=Q.filter((G)=>{let j=l6(G);return j.registryName===z&&j.name===I});if(X.length===0)throw new B$(`Component '${Y}' is not installed.
273
- Run '${$z(Y,U)}' to install it first.`);let q=X[0];if(!q)throw Error("Unexpected: matchingIds has length but first element is undefined");_.push({component:q})}return _}function wO($,v){let U=$.filter((J)=>J.status==="would-update"),_={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"};T4(_,{json:v.json,quiet:v.quiet})}var fW=b(()=>{k0();V1();X4();t4();w1();z$();l$();i$();i6();W8();T0();s4();$6()});import{resolve as LO}from"path";function kO($,v){if(v==="not_found")return new B$($);if(v==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function AO($,v){let U=ev($,{schemaErrors:v==="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 I1(Q)}function OO($){for(let v of $)console.log(m.red(` ${v}`))}function mW($){$.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(v,U)=>{try{let Q=LO(U.cwd,v),_=await T8(Q,{skipDuplicateTargets:U.duplicateTargets===!1});if(!_.success){let[J="Registry validation failed"]=_.errors;if(_.failureType==="load"){let z=kO(J,_.loadErrorKind);if(!U.json&&U.quiet){let I=z instanceof b$?z.exitCode:K$.GENERAL;process.exit(I)}throw z}let Y=AO(_.errors,_.failureType==="schema"?"schema":"rules");if(U.json)throw Y;if(!U.quiet)W.error(Y.message),OO(_.errors);process.exit(Y.exitCode)}if(!U.quiet&&!U.json)W.success("\u2713 Registry source is valid");if(U.json)F$({success:!0,data:{valid:!0,errors:[],summary:ev([])}})}catch(Q){if(!U.json&&U.quiet){let _=Q instanceof b$?Q.exitCode:K$.GENERAL;process.exit(_)}_$(Q,{json:U.json})}})}var gW=b(()=>{O6();AY();z$();l$();i$()});function hW($){let v=$.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");Q4(v),h4(v),v.action(async(U,Q)=>{try{await FO(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function FO($,v){let U=v.cwd??process.cwd(),Q=await f4.requireInitialized(U),_=await F4(Q.cwd);if(!_||Object.keys(_.installed).length===0){if(v.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!v.quiet)W.info("No components installed.");return}let J;if($.length>0)J=c8($,_);else J=Object.keys(_.installed);let Y=v.quiet||v.json?null:D$({text:"Verifying components..."});Y?.start();let z=[],I=!1;for(let X of J){let q=_.installed[X];if(!q){if($.length>0)W.warn(`Component '${X}' not found in receipt.`);continue}let G=await iv(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)`),v.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(!v.quiet){W.info("");for(let X of z)if(X.intact){if(v.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(!v.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(!v.quiet)W.info(""),W.success("All components verified successfully.")}var cW=b(()=>{k0();X4();hY();z$();l$();i$();T0();s4();$6()});function NO(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(Yj(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function lW($){$.hook("postAction",async(v,U)=>{if(U.name()==="update"&&U.parent?.name()==="self")return;let Q=U.opts();if(Q.json||Q.quiet)return;if(!NO())return;try{let[{checkForUpdate:_},{notifyUpdate:J}]=await Promise.all([Promise.resolve().then(() => (oY(),DW)),Promise.resolve().then(() => (eY(),AW))]),Y=await _();if(Y.ok&&Y.updateAvailable)J(Y.current,Y.latest)}catch{}})}var dW=b(()=>{pv()});var pW={};s$(pW,{runCli:()=>TO});async function TO($=process.argv){let v=new eq().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(SO);hK(v),kK(v),CW(v),eH(v),cH(v),TK(v),mW(v),PW(v),hW(v),iH(v),tK(v),fH(v),CK(v),ZH(v),lW(v),await v.parseAsync($)}var SO="2.0.6";var iW=b(()=>{$8();kY();RK();fK();lK();sK();DH();mH();lH();nH();$W();xW();fW();gW();cW();dW()});r_();LJ();if(import.meta.main)RO();async function RO(){try{let{runCli:$}=await Promise.resolve().then(() => (iW(),pW));await $()}catch($){let{handleError:v}=await Promise.resolve().then(() => (l$(),zj));v($)}}export{K1 as registrySchema,xv as packumentSchema,t_ as ocxLockSchema,c6 as ocxConfigSchema,G1 as componentManifestSchema,uv 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=3988DB7BCAA1BB5964756E2164756E21
274
+ //# debugId=0928E5313922DFE964756E2164756E21