ocx 2.0.6 → 2.0.8
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.
- package/dist/index.js +149 -150
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -1,107 +1,106 @@
|
|
|
1
1
|
#!/usr/bin/env -S bun --no-env-file
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
4
|
-
`;break;case 114:
|
|
5
|
-
`;return
|
|
6
|
-
`+" ".repeat(
|
|
7
|
-
`+" ".repeat(
|
|
8
|
-
`+"\t".repeat(
|
|
9
|
-
`+"\t".repeat(
|
|
3
|
+
var KW=Object.create;var{getPrototypeOf:WW,defineProperty:F7,getOwnPropertyNames:zW}=Object;var BW=Object.prototype.hasOwnProperty;var B5=(Q,$,Y)=>{Y=Q!=null?KW(WW(Q)):{};let q=$||!Q||!Q.__esModule?F7(Y,"default",{value:Q,enumerable:!0}):Y;for(let J of zW(Q))if(!BW.call(q,J))F7(q,J,{get:()=>Q[J],enumerable:!0});return q};var L8=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports);var F8=(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 c(){let N;do N=R();while(N>=12&&N<=15);return N}return{setPosition:M,getPosition:()=>q,scan:$?c: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 _5;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"})(_5||(_5={}))});var Z0,w7,Z5;var M5=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($)})}},Z5=[`
|
|
10
10
|
`,"\r",`\r
|
|
11
|
-
`]});function
|
|
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=ZW(J,Y)}else J=Q,q=0,X=0,H=0,G=Q.length;let K=MW(Y,Q),W=Z5.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 c=[];function N(w,b,D){if(!U&&(!$||b<G&&D>H)&&Q.substring(b,D)!==w)c.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="",l=!1;while(z===0&&(b===12||b===13)){let r=V.getTokenOffset()+X;N(Z0[1],w,r),w=V.getTokenOffset()+V.getTokenLength()+X,l=b===12,D=l?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(!l)D=Z0[1];break;case 6:if(Y.keepLines&&z>0)D=R();else if(!l)D=Z0[1];break;case 10:if(Y.keepLines&&z>0)D=R();else if(b===6&&!l)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)&&!l)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 i=V.getTokenOffset()+X;N(D,w,i),x=b}return c}function _9(Q,$){let Y="";for(let q=0;q<$;q++)Y+=Q;return Y}function ZW(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 MW(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(
|
|
13
|
+
`;return"\r"}else if(q===`
|
|
14
14
|
`)return`
|
|
15
|
-
`}return
|
|
16
|
-
`}function
|
|
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();M5()});function U5(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:VW(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),c=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 c();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 l(E){let C=q.getTokenValue();if(E)R(C);else Z(C),J.push(C);return b(),!0}function i(){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 r(){if(q.getToken()!==10)return D(3,[],[2,5]),!1;if(l(!1),q.getToken()===6){if(I(":"),b(),!u())D(4,[],[2,5])}else D(5,[],[2,5]);return J.pop(),!0}function J1(){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(!r())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(!u())D(4,[],[4,5]);C=!0}if(U(),!E)J.pop();if(q.getToken()!==4)D(8,[4],[]);else b();return!0}function u(){switch(q.getToken()){case 3:return S();case 1:return J1();case 10:return l(!0);default:return i()}}if(b(),q.getToken()===17){if(Y.allowEmptyContent)return!0;return D(4,[],[]),!1}if(!u())return D(4,[],[]),!1;if(q.getToken()!==17)D(9,[],[]);return!0}function VW(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 V5(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 A5=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 V5(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 L5,F5,O1,j5;var D0=A(()=>{O7();A5();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"})(L5||(L5={}));(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"})(F5||(F5={}));O1=U5;(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"})(j5||(j5={}))});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 WF,zF,Y8,t9,c2;var U9=A(()=>{WF=Object.freeze({status:"aborted"});zF=Symbol("zod_brand");Y8=class Y8 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 z1={};F8(z1,{unwrapMessage:()=>e9,uint8ArrayToHex:()=>dW,uint8ArrayToBase64url:()=>gW,uint8ArrayToBase64:()=>b5,stringifyPrimitive:()=>i2,slugify:()=>S7,shallowClone:()=>D5,safeExtend:()=>CW,required:()=>fW,randomString:()=>RW,propertyKeyTypes:()=>k7,promiseAllObject:()=>bW,primitiveTypes:()=>O5,prefixIssues:()=>X8,pick:()=>vW,partial:()=>hW,parsedType:()=>x7,optionalKeys:()=>v7,omit:()=>PW,objectClone:()=>IW,numKeys:()=>SW,nullish:()=>Y2,normalizeParams:()=>d,mergeDefs:()=>q8,merge:()=>yW,jsonStringifyReplacer:()=>A9,joinValues:()=>d2,issue:()=>L9,isPlainObject:()=>w8,isObject:()=>V9,hexToUint8Array:()=>cW,getSizableOrigin:()=>N5,getParsedType:()=>EW,getLengthableOrigin:()=>J2,getEnumValues:()=>Q2,getElementAtPath:()=>TW,floatSafeRemainder:()=>R7,finalizeIssue:()=>x0,extend:()=>xW,escapeRegex:()=>J8,esc:()=>p2,defineLazy:()=>U1,createTransparentProxy:()=>kW,cloneDef:()=>NW,clone:()=>P0,cleanRegex:()=>q2,cleanEnum:()=>uW,captureStackTrace:()=>l2,cached:()=>$2,base64urlToUint8Array:()=>mW,base64ToUint8Array:()=>T5,assignProp:()=>j8,assertNotEqual:()=>jW,assertNever:()=>DW,assertIs:()=>wW,assertEqual:()=>FW,assert:()=>OW,allowsEval:()=>E7,aborted:()=>D8,NUMBER_FORMAT_RANGES:()=>P7,Class:()=>R5,BIGINT_FORMAT_RANGES:()=>I5});function FW(Q){return Q}function jW(Q){return Q}function wW(Q){}function DW(Q){throw Error("Unexpected value in exhaustive check")}function OW(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===w5)return;if(q===void 0)q=w5,q=Y();return q},set(J){Object.defineProperty(Q,$,{value:J})},configurable:!0})}function IW(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 q8(...Q){let $={};for(let Y of Q){let q=Object.getOwnPropertyDescriptors(Y);Object.assign($,q)}return Object.defineProperties({},$)}function NW(Q){return q8(Q._zod.def)}function TW(Q,$){if(!$)return Q;return $.reduce((Y,q)=>Y?.[q],Q)}function bW(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 RW(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 D5(Q){if(w8(Q))return{...Q};if(Array.isArray(Q))return[...Q];return Q}function SW(Q){let $=0;for(let Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))$++;return $}function J8(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 d(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 kW(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 vW(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=q8(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 PW(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=q8(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 xW(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=q8(Q._zod.def,{get shape(){let X={...Q._zod.def.shape,...$};return j8(this,"shape",X),X}});return P0(Q,J)}function CW(Q,$){if(!w8($))throw Error("Invalid input to safeExtend: expected a plain object");let Y=q8(Q._zod.def,{get shape(){let q={...Q._zod.def.shape,...$};return j8(this,"shape",q),q}});return P0(Q,Y)}function yW(Q,$){let Y=q8(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 hW(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=q8($._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 fW(Q,$,Y){let q=q8($._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 X8(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 N5(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 uW(Q){return Object.entries(Q).filter(([$,Y])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function T5(Q){let $=atob(Q),Y=new Uint8Array($.length);for(let q=0;q<$.length;q++)Y[q]=$.charCodeAt(q);return Y}function b5(Q){let $="";for(let Y=0;Y<Q.length;Y++)$+=String.fromCharCode(Q[Y]);return btoa($)}function mW(Q){let $=Q.replace(/-/g,"+").replace(/_/g,"/"),Y="=".repeat((4-$.length%4)%4);return T5($+Y)}function gW(Q){return b5(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function cW(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 dW(Q){return Array.from(Q).map(($)=>$.toString(16).padStart(2,"0")).join("")}class R5{constructor(...Q){}}var w5,l2,E7,EW=(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,O5,P7,I5;var C0=A(()=>{w5=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"]),O5=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]},I5={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function E5(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 k5(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 S5=(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",S5),C7=j("$ZodError",S5,{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 Y8;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 Y8;return X.issues.length?{success:!1,error:new(Q??n2)(X.issues.map((H)=>x0(H,J,O0())))}:{success:!0,data:X.value}},v5,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}},P5,x5=(Q)=>($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return o2(Q)($,Y,J)},C5=(Q)=>($,Y,q)=>{return o2(Q)($,Y,q)},y5=(Q)=>async($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return s2(Q)($,Y,J)},h5=(Q)=>async($,Y,q)=>{return s2(Q)($,Y,q)},f5=(Q)=>($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return X2(Q)($,Y,J)},u5=(Q)=>($,Y,q)=>{return X2(Q)($,Y,q)},m5=(Q)=>async($,Y,q)=>{let J=q?Object.assign(q,{direction:"backward"}):{direction:"backward"};return H2(Q)($,Y,J)},g5=(Q)=>async($,Y,q)=>{return H2(Q)($,Y,q)};var h7=A(()=>{U9();y7();C0();v5=X2(C7),P5=H2(C7)});function a5(){return new RegExp(lW,"u")}function HQ(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 GQ(Q){return new RegExp(`^${HQ(Q)}$`)}function KQ(Q){let $=HQ({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(`^${JQ}T(?:${q})$`)}var c5,d5,p5,l5,i5,n5,o5,s5,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})$`)},r5,lW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",t5,e5,QQ,$Q,YQ,u7,qQ,JQ="(?:(?:\\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])))",XQ,WQ=(Q)=>{let $=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},zQ,r2,BQ,_Q,ZQ;var t2=A(()=>{c5=/^[cC][^\s-]{8,}$/,d5=/^[0-9a-z]+$/,p5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l5=/^[0-9a-vA-V]{20}$/,i5=/^[A-Za-z0-9]{27}$/,n5=/^[a-zA-Z0-9_-]{21}$/,o5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,s5=/^([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})$/,r5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;t5=/^(?:(?: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])$/,e5=/^(([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}|:))$/,QQ=/^((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])$/,$Q=/^(([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])$/,YQ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u7=/^[A-Za-z0-9_-]*$/,qQ=/^\+[1-9]\d{6,14}$/,XQ=new RegExp(`^${JQ}$`);zQ=/^-?\d+$/,r2=/^-?\d+(?:\.\d+)?$/,BQ=/^(?:true|false)$/i,_Q=/^[^A-Z]*$/,ZQ=/^[^a-z]*$/});var s1,MQ,m7,g7,UQ,VQ,AQ,LQ,FQ,G2,jQ,wQ,DQ,OQ,IQ,NQ,TQ;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=[])}),MQ={number:"number",bigint:"bigint",object:"date"},m7=j("$ZodCheckLessThan",(Q,$)=>{s1.init(Q,$);let Y=MQ[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=MQ[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})}}),UQ=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})}}),VQ=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=zQ}),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})}}),AQ=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})}}),LQ=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})}}),FQ=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=()=>{})}),jQ=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})}}),wQ=j("$ZodCheckLowerCase",(Q,$)=>{$.pattern??($.pattern=_Q),G2.init(Q,$)}),DQ=j("$ZodCheckUpperCase",(Q,$)=>{$.pattern??($.pattern=ZQ),G2.init(Q,$)}),OQ=j("$ZodCheckIncludes",(Q,$)=>{s1.init(Q,$);let Y=J8($.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})}}),IQ=j("$ZodCheckStartsWith",(Q,$)=>{s1.init(Q,$);let Y=new RegExp(`^${J8($.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})}}),NQ=j("$ZodCheckEndsWith",(Q,$)=>{s1.init(Q,$);let Y=new RegExp(`.*${J8($.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})}}),TQ=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 RQ;var d7=A(()=>{RQ={major:4,minor:3,patch:6}});function Y$(Q){if(Q==="")return!0;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}function iW(Q){if(!u7.test(Q))return!1;let $=Q.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),Y=$.padEnd(Math.ceil($.length/4)*4,"=");return Y$(Y)}function nW(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 SQ(Q,$,Y){if(Q.issues.length)$.issues.push(...X8(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(...X8(Y,Q.issues))}if(Q.value===void 0){if(Y in q)$.value[Y]=void 0}else $.value[Y]=Q.value}function Z$(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 M$(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 EQ(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 kQ(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 vQ(Q,$){if(Q.issues.length&&$===void 0)return{issues:[],value:void 0};return Q}function PQ(Q,$){if(Q.value===void 0)Q.value=$.defaultValue;return Q}function xQ(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 CQ(Q){return Q.value=Object.freeze(Q.value),Q}function yQ(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,hQ,fQ,uQ,mQ,gQ,cQ,dQ,pQ,lQ,iQ,nQ,oQ,sQ,rQ,aQ,tQ,eQ,Q$,$$,q$,J$,X$,H$,l7,G$,K$,W$,z$,B$,_$,oW,U$,V$,A$,L$,F$,j$,w$,i7,D$,O$,I$,N$,T$,b$,R$,S$,E$;var k$=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=RQ;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 Y8;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 Y8;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 Y8;return K.then((W)=>J(W,q,G))}return J(K,q,G)}}U1(Q,"~standard",()=>({validate:(J)=>{try{let X=v5(Q,J);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return P5(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()??WQ(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,$)}),hQ=j("$ZodGUID",(Q,$)=>{$.pattern??($.pattern=s5),b1.init(Q,$)}),fQ=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,$)}),uQ=j("$ZodEmail",(Q,$)=>{$.pattern??($.pattern=r5),b1.init(Q,$)}),mQ=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})}}}),gQ=j("$ZodEmoji",(Q,$)=>{$.pattern??($.pattern=a5()),b1.init(Q,$)}),cQ=j("$ZodNanoID",(Q,$)=>{$.pattern??($.pattern=n5),b1.init(Q,$)}),dQ=j("$ZodCUID",(Q,$)=>{$.pattern??($.pattern=c5),b1.init(Q,$)}),pQ=j("$ZodCUID2",(Q,$)=>{$.pattern??($.pattern=d5),b1.init(Q,$)}),lQ=j("$ZodULID",(Q,$)=>{$.pattern??($.pattern=p5),b1.init(Q,$)}),iQ=j("$ZodXID",(Q,$)=>{$.pattern??($.pattern=l5),b1.init(Q,$)}),nQ=j("$ZodKSUID",(Q,$)=>{$.pattern??($.pattern=i5),b1.init(Q,$)}),oQ=j("$ZodISODateTime",(Q,$)=>{$.pattern??($.pattern=KQ($)),b1.init(Q,$)}),sQ=j("$ZodISODate",(Q,$)=>{$.pattern??($.pattern=XQ),b1.init(Q,$)}),rQ=j("$ZodISOTime",(Q,$)=>{$.pattern??($.pattern=GQ($)),b1.init(Q,$)}),aQ=j("$ZodISODuration",(Q,$)=>{$.pattern??($.pattern=o5),b1.init(Q,$)}),tQ=j("$ZodIPv4",(Q,$)=>{$.pattern??($.pattern=t5),b1.init(Q,$),Q._zod.bag.format="ipv4"}),eQ=j("$ZodIPv6",(Q,$)=>{$.pattern??($.pattern=e5),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})}}}),Q$=j("$ZodCIDRv4",(Q,$)=>{$.pattern??($.pattern=QQ),b1.init(Q,$)}),$$=j("$ZodCIDRv6",(Q,$)=>{$.pattern??($.pattern=$Q),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})}}});q$=j("$ZodBase64",(Q,$)=>{$.pattern??($.pattern=YQ),b1.init(Q,$),Q._zod.bag.contentEncoding="base64",Q._zod.check=(Y)=>{if(Y$(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64",input:Y.value,inst:Q,continue:!$.abort})}});J$=j("$ZodBase64URL",(Q,$)=>{$.pattern??($.pattern=u7),b1.init(Q,$),Q._zod.bag.contentEncoding="base64url",Q._zod.check=(Y)=>{if(iW(Y.value))return;Y.issues.push({code:"invalid_format",format:"base64url",input:Y.value,inst:Q,continue:!$.abort})}}),X$=j("$ZodE164",(Q,$)=>{$.pattern??($.pattern=qQ),b1.init(Q,$)});H$=j("$ZodJWT",(Q,$)=>{b1.init(Q,$),Q._zod.check=(Y)=>{if(nW(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}}),G$=j("$ZodNumberFormat",(Q,$)=>{VQ.init(Q,$),l7.init(Q,$)}),K$=j("$ZodBoolean",(Q,$)=>{T1.init(Q,$),Q._zod.pattern=BQ,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}}),W$=j("$ZodAny",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y)=>Y}),z$=j("$ZodUnknown",(Q,$)=>{T1.init(Q,$),Q._zod.parse=(Y)=>Y}),B$=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}});_$=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)=>SQ(W,Y,H)));else SQ(K,Y,H)}if(X.length)return Promise.all(X).then(()=>Y);return Y}});oW=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(()=>Z$($));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 M$(z,W,G,K,q.value,Q)}}),U$=j("$ZodObjectJIT",(Q,$)=>{oW.init(Q,$);let Y=Q._zod.parse,q=$2(()=>Z$($)),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(${
|
|
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 (${
|
|
29
|
+
if (${x}.value === undefined) {
|
|
31
30
|
if (${w} in input) {
|
|
32
31
|
newResult[${w}] = undefined;
|
|
33
32
|
}
|
|
34
33
|
} else {
|
|
35
|
-
newResult[${w}] = ${
|
|
34
|
+
newResult[${w}] = ${x}.value;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
`);else
|
|
39
|
-
if (${
|
|
40
|
-
payload.issues = payload.issues.concat(${
|
|
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 (${
|
|
45
|
+
if (${x}.value === undefined) {
|
|
47
46
|
if (${w} in input) {
|
|
48
47
|
newResult[${w}] = undefined;
|
|
49
48
|
}
|
|
50
49
|
} else {
|
|
51
|
-
newResult[${w}] = ${
|
|
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 c=M.compile();return(N,x)=>c(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 M$([],V,Z,M,B,Q)}return Y(Z,M)}});V$=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 EQ(G,J,Q,X);return Promise.all(G).then((K)=>{return EQ(K,J,Q,X)})}}),A$=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 kQ(Y,K,W)});return kQ(Y,X,H)}});L$=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(...X8(W,B.issues));Y.value[W]=B.value}));else{if(z.issues.length)Y.issues.push(...X8(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(...X8(G,B.issues));Y.value[K.value]=B.value}));else{if(z.issues.length)Y.issues.push(...X8(G,z.issues));Y.value[K.value]=z.value}}}if(X.length)return Promise.all(X).then(()=>Y);return Y}}),F$=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"?J8(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}}),j$=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"?J8(q):q?J8(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}}),w$=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 Y8;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)=>vQ(X,Y.value));return vQ(J,Y.value)}if(Y.value===void 0)return Y;return $.innerType._zod.run(Y,q)}}),D$=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)}}),O$=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)}}),I$=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)=>PQ(X,$));return PQ(J,$)}});N$=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)}}),T$=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)=>xQ(X,Q));return xQ(J,Q)}});b$=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}}),R$=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)}});S$=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(CQ);return CQ(J)}});E$=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)=>yQ(X,Y,q,Q));yQ(J,Y,q,Q);return}})});function n7(){return{localeError:sW()}}var sW=()=>{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 v$=A(()=>{C0()});var o7=()=>{};class C${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 rW(){return new C$}var x$,RF,SF,f8;var s7=A(()=>{RF=Symbol("ZodOutput"),SF=Symbol("ZodInput");(x$=globalThis).__zod_globalRegistry??(x$.__zod_globalRegistry=rW());f8=globalThis.__zod_globalRegistry});function y$(Q,$){return new Q({type:"string",...d($)})}function h$(Q,$){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...d($)})}function r7(Q,$){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...d($)})}function f$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...d($)})}function u$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...d($)})}function m$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...d($)})}function g$(Q,$){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...d($)})}function c$(Q,$){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...d($)})}function d$(Q,$){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...d($)})}function p$(Q,$){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...d($)})}function l$(Q,$){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...d($)})}function i$(Q,$){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...d($)})}function n$(Q,$){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...d($)})}function o$(Q,$){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...d($)})}function s$(Q,$){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...d($)})}function r$(Q,$){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...d($)})}function a$(Q,$){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...d($)})}function t$(Q,$){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...d($)})}function e$(Q,$){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...d($)})}function QY(Q,$){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...d($)})}function $Y(Q,$){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...d($)})}function YY(Q,$){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...d($)})}function qY(Q,$){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...d($)})}function JY(Q,$){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...d($)})}function XY(Q,$){return new Q({type:"string",format:"date",check:"string_format",...d($)})}function HY(Q,$){return new Q({type:"string",format:"time",check:"string_format",precision:null,...d($)})}function GY(Q,$){return new Q({type:"string",format:"duration",check:"string_format",...d($)})}function KY(Q,$){return new Q({type:"number",checks:[],...d($)})}function WY(Q,$){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...d($)})}function zY(Q,$){return new Q({type:"boolean",...d($)})}function BY(Q){return new Q({type:"any"})}function _Y(Q){return new Q({type:"unknown"})}function ZY(Q,$){return new Q({type:"never",...d($)})}function q3(Q,$){return new m7({check:"less_than",...d($),value:Q,inclusive:!1})}function K2(Q,$){return new m7({check:"less_than",...d($),value:Q,inclusive:!0})}function J3(Q,$){return new g7({check:"greater_than",...d($),value:Q,inclusive:!1})}function W2(Q,$){return new g7({check:"greater_than",...d($),value:Q,inclusive:!0})}function X3(Q,$){return new UQ({check:"multiple_of",...d($),value:Q})}function H3(Q,$){return new AQ({check:"max_length",...d($),maximum:Q})}function F9(Q,$){return new LQ({check:"min_length",...d($),minimum:Q})}function G3(Q,$){return new FQ({check:"length_equals",...d($),length:Q})}function a7(Q,$){return new jQ({check:"string_format",format:"regex",...d($),pattern:Q})}function t7(Q){return new wQ({check:"string_format",format:"lowercase",...d(Q)})}function e7(Q){return new DQ({check:"string_format",format:"uppercase",...d(Q)})}function Q4(Q,$){return new OQ({check:"string_format",format:"includes",...d($),includes:Q})}function $4(Q,$){return new IQ({check:"string_format",format:"starts_with",...d($),prefix:Q})}function Y4(Q,$){return new NQ({check:"string_format",format:"ends_with",...d($),suffix:Q})}function O8(Q){return new TQ({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 MY(Q,$,Y){return new Q({type:"array",element:$,...d(Y)})}function UY(Q,$,Y){return new Q({type:"custom",check:"custom",fn:$,...d(Y)})}function VY(Q){let $=aW((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 aW(Q,$){let Y=new s1({check:"custom",...d($)});return Y._zod.check=Q,Y}var AY=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: ${
|
|
58
|
-
Found: ${
|
|
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 LY=(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 tW,FY=(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=tW[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}))]}},jY=(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},wY=(Q,$,Y,q)=>{Y.type="boolean"},DY=(Q,$,Y,q)=>{Y.not={}},OY=(Q,$,Y,q)=>{},IY=(Q,$,Y,q)=>{},NY=(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},TY=(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}},bY=(Q,$,Y,q)=>{if($.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},RY=(Q,$,Y,q)=>{if($.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},SY=(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"]})},EY=(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"]})},kY=(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},vY=(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},PY=(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}},xY=(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"}]},CY=(Q,$,Y,q)=>{let J=Q._zod.def;m1(J.innerType,$,q);let X=$.seen.get(Q);X.ref=J.innerType},yY=(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))},hY=(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))},fY=(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},uY=(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},mY=(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 gY=A(()=>{K3();C0();tW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""}});var cY=()=>{};var o0=A(()=>{C0();t2();o7();cY();U9();h7();y7();k$();e2();d7();s7();AY();K3()});var _4=A(()=>{o0()});function dY(Q){return JY(Xz,Q)}function pY(Q){return XY(Hz,Q)}function lY(Q){return HY(Gz,Q)}function iY(Q){return GY(Kz,Q)}var Xz,Hz,Gz,Kz;var Z4=A(()=>{o0();M4();Xz=j("ZodISODateTime",(Q,$)=>{oQ.init(Q,$),S1.init(Q,$)});Hz=j("ZodISODate",(Q,$)=>{sQ.init(Q,$),S1.init(Q,$)});Gz=j("ZodISOTime",(Q,$)=>{rQ.init(Q,$),S1.init(Q,$)});Kz=j("ZodISODuration",(Q,$)=>{aQ.init(Q,$),S1.init(Q,$)})});var oY=(Q,$)=>{n2.init(Q,$),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(Y)=>k5(Q,Y)},flatten:{value:(Y)=>E5(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",oY),M0=j("ZodError",oY,{Parent:Error})});var sY,rY,aY,tY,eY,Qq,$q,Yq,qq,Jq,Xq,Hq;var A4=A(()=>{o0();V4();sY=o2(M0),rY=s2(M0),aY=X2(M0),tY=H2(M0),eY=x5(M0),Qq=C5(M0),$q=y5(M0),Yq=h5(M0),qq=f5(M0),Jq=u5(M0),Xq=m5(M0),Hq=g5(M0)});function F(Q){return y$(Bz,Q)}function j9(Q){return KY(Zq,Q)}function Kq(Q){return WY(Sz,Q)}function i1(Q){return zY(Ez,Q)}function Mq(){return BY(kz)}function I8(){return _Y(vz)}function xz(Q){return ZY(Pz,Q)}function R1(Q,$){return MY(Cz,Q,$)}function Q1(Q,$){let Y={type:"object",shape:Q??{},...z1.normalizeParams($)};return new yz(Y)}function U0(Q,$){return new hz({type:"union",options:Q,...z1.normalizeParams($)})}function uz(Q,$){return new fz({type:"intersection",left:Q,right:$})}function q1(Q,$,Y){return new mz({type:"record",keyType:Q,valueType:$,...z1.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,...z1.normalizeParams($)})}function F4(Q,$){return new gz({type:"literal",values:Array.isArray(Q)?Q:[Q],...z1.normalizeParams($)})}function dz(Q){return new cz({type:"transform",transform:Q})}function Wq(Q){return new Uq({type:"optional",innerType:Q})}function lz(Q){return new pz({type:"optional",innerType:Q})}function zq(Q){return new iz({type:"nullable",innerType:Q})}function oz(Q,$){return new nz({type:"default",innerType:Q,get defaultValue(){return typeof $==="function"?$():z1.shallowClone($)}})}function rz(Q,$){return new sz({type:"prefault",innerType:Q,get defaultValue(){return typeof $==="function"?$():z1.shallowClone($)}})}function az(Q,$){return new Vq({type:"nonoptional",innerType:Q,...z1.normalizeParams($)})}function ez(Q,$){return new tz({type:"catch",innerType:Q,catchValue:typeof $==="function"?$:()=>$})}function Bq(Q,$){return new QB({type:"pipe",in:Q,out:$})}function YB(Q){return new $B({type:"readonly",innerType:Q})}function JB(Q,$={}){return UY(qB,Q,$)}function XB(Q){return VY(Q)}var E1,_q,Bz,S1,_z,Gq,W3,Zz,Mz,Uz,Vz,Az,Lz,Fz,jz,wz,Dz,Oz,Iz,Nz,Tz,bz,Rz,Zq,Sz,Ez,kz,vz,Pz,Cz,yz,hz,fz,mz,L4,gz,cz,Uq,pz,iz,nz,sz,Vq,tz,QB,$B,qB;var M4=A(()=>{o0();o0();gY();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=LY(Q,{}),Q.def=$,Q.type=$.type,Object.defineProperty(Q,"_def",{value:$}),Q.check=(...Y)=>{return Q.clone(z1.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)=>sY(Q,Y,q,{callee:Q.parse}),Q.safeParse=(Y,q)=>aY(Q,Y,q),Q.parseAsync=async(Y,q)=>rY(Q,Y,q,{callee:Q.parseAsync}),Q.safeParseAsync=async(Y,q)=>tY(Q,Y,q),Q.spa=Q.safeParseAsync,Q.encode=(Y,q)=>eY(Q,Y,q),Q.decode=(Y,q)=>Qq(Q,Y,q),Q.encodeAsync=async(Y,q)=>$q(Q,Y,q),Q.decodeAsync=async(Y,q)=>Yq(Q,Y,q),Q.safeEncode=(Y,q)=>qq(Q,Y,q),Q.safeDecode=(Y,q)=>Jq(Q,Y,q),Q.safeEncodeAsync=async(Y,q)=>Xq(Q,Y,q),Q.safeDecodeAsync=async(Y,q)=>Hq(Q,Y,q),Q.refine=(Y,q)=>Q.check(JB(Y,q)),Q.superRefine=(Y)=>Q.check(XB(Y)),Q.overwrite=(Y)=>Q.check(O8(Y)),Q.optional=()=>Wq(Q),Q.exactOptional=()=>lz(Q),Q.nullable=()=>zq(Q),Q.nullish=()=>Wq(zq(Q)),Q.nonoptional=(Y)=>az(Q,Y),Q.array=()=>R1(Q),Q.or=(Y)=>U0([Q,Y]),Q.and=(Y)=>uz(Q,Y),Q.transform=(Y)=>Bq(Q,dz(Y)),Q.default=(Y)=>oz(Q,Y),Q.prefault=(Y)=>rz(Q,Y),Q.catch=(Y)=>ez(Q,Y),Q.pipe=(Y)=>Bq(Q,Y),Q.readonly=()=>YB(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}),_q=j("_ZodString",(Q,$)=>{Y3.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>FY(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())}),Bz=j("ZodString",(Q,$)=>{Y3.init(Q,$),_q.init(Q,$),Q.email=(Y)=>Q.check(h$(_z,Y)),Q.url=(Y)=>Q.check(c$(Zz,Y)),Q.jwt=(Y)=>Q.check(qY(Rz,Y)),Q.emoji=(Y)=>Q.check(d$(Mz,Y)),Q.guid=(Y)=>Q.check(r7(Gq,Y)),Q.uuid=(Y)=>Q.check(f$(W3,Y)),Q.uuidv4=(Y)=>Q.check(u$(W3,Y)),Q.uuidv6=(Y)=>Q.check(m$(W3,Y)),Q.uuidv7=(Y)=>Q.check(g$(W3,Y)),Q.nanoid=(Y)=>Q.check(p$(Uz,Y)),Q.guid=(Y)=>Q.check(r7(Gq,Y)),Q.cuid=(Y)=>Q.check(l$(Vz,Y)),Q.cuid2=(Y)=>Q.check(i$(Az,Y)),Q.ulid=(Y)=>Q.check(n$(Lz,Y)),Q.base64=(Y)=>Q.check(QY(Nz,Y)),Q.base64url=(Y)=>Q.check($Y(Tz,Y)),Q.xid=(Y)=>Q.check(o$(Fz,Y)),Q.ksuid=(Y)=>Q.check(s$(jz,Y)),Q.ipv4=(Y)=>Q.check(r$(wz,Y)),Q.ipv6=(Y)=>Q.check(a$(Dz,Y)),Q.cidrv4=(Y)=>Q.check(t$(Oz,Y)),Q.cidrv6=(Y)=>Q.check(e$(Iz,Y)),Q.e164=(Y)=>Q.check(YY(bz,Y)),Q.datetime=(Y)=>Q.check(dY(Y)),Q.date=(Y)=>Q.check(pY(Y)),Q.time=(Y)=>Q.check(lY(Y)),Q.duration=(Y)=>Q.check(iY(Y))});S1=j("ZodStringFormat",(Q,$)=>{b1.init(Q,$),_q.init(Q,$)}),_z=j("ZodEmail",(Q,$)=>{uQ.init(Q,$),S1.init(Q,$)}),Gq=j("ZodGUID",(Q,$)=>{hQ.init(Q,$),S1.init(Q,$)}),W3=j("ZodUUID",(Q,$)=>{fQ.init(Q,$),S1.init(Q,$)}),Zz=j("ZodURL",(Q,$)=>{mQ.init(Q,$),S1.init(Q,$)}),Mz=j("ZodEmoji",(Q,$)=>{gQ.init(Q,$),S1.init(Q,$)}),Uz=j("ZodNanoID",(Q,$)=>{cQ.init(Q,$),S1.init(Q,$)}),Vz=j("ZodCUID",(Q,$)=>{dQ.init(Q,$),S1.init(Q,$)}),Az=j("ZodCUID2",(Q,$)=>{pQ.init(Q,$),S1.init(Q,$)}),Lz=j("ZodULID",(Q,$)=>{lQ.init(Q,$),S1.init(Q,$)}),Fz=j("ZodXID",(Q,$)=>{iQ.init(Q,$),S1.init(Q,$)}),jz=j("ZodKSUID",(Q,$)=>{nQ.init(Q,$),S1.init(Q,$)}),wz=j("ZodIPv4",(Q,$)=>{tQ.init(Q,$),S1.init(Q,$)}),Dz=j("ZodIPv6",(Q,$)=>{eQ.init(Q,$),S1.init(Q,$)}),Oz=j("ZodCIDRv4",(Q,$)=>{Q$.init(Q,$),S1.init(Q,$)}),Iz=j("ZodCIDRv6",(Q,$)=>{$$.init(Q,$),S1.init(Q,$)}),Nz=j("ZodBase64",(Q,$)=>{q$.init(Q,$),S1.init(Q,$)}),Tz=j("ZodBase64URL",(Q,$)=>{J$.init(Q,$),S1.init(Q,$)}),bz=j("ZodE164",(Q,$)=>{X$.init(Q,$),S1.init(Q,$)}),Rz=j("ZodJWT",(Q,$)=>{H$.init(Q,$),S1.init(Q,$)}),Zq=j("ZodNumber",(Q,$)=>{l7.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>jY(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(Kq(q)),Q.safe=(q)=>Q.check(Kq(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});Sz=j("ZodNumberFormat",(Q,$)=>{G$.init(Q,$),Zq.init(Q,$)});Ez=j("ZodBoolean",(Q,$)=>{K$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>wY(Q,Y,q,J)});kz=j("ZodAny",(Q,$)=>{W$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>OY(Q,Y,q,J)});vz=j("ZodUnknown",(Q,$)=>{z$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>IY(Q,Y,q,J)});Pz=j("ZodNever",(Q,$)=>{B$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>DY(Q,Y,q,J)});Cz=j("ZodArray",(Q,$)=>{_$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>SY(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});yz=j("ZodObject",(Q,$)=>{U$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>EY(Q,Y,q,J),z1.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:xz()}),Q.strip=()=>Q.clone({...Q._zod.def,catchall:void 0}),Q.extend=(Y)=>{return z1.extend(Q,Y)},Q.safeExtend=(Y)=>{return z1.safeExtend(Q,Y)},Q.merge=(Y)=>z1.merge(Q,Y),Q.pick=(Y)=>z1.pick(Q,Y),Q.omit=(Y)=>z1.omit(Q,Y),Q.partial=(...Y)=>z1.partial(Uq,Q,Y[0]),Q.required=(...Y)=>z1.required(Vq,Q,Y[0])});hz=j("ZodUnion",(Q,$)=>{V$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>kY(Q,Y,q,J),Q.options=$.options});fz=j("ZodIntersection",(Q,$)=>{A$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>vY(Q,Y,q,J)});mz=j("ZodRecord",(Q,$)=>{L$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>PY(Q,Y,q,J),Q.keyType=$.keyType,Q.valueType=$.valueType});L4=j("ZodEnum",(Q,$)=>{F$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(q,J,X)=>NY(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:[],...z1.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:[],...z1.normalizeParams(J),entries:X})}});gz=j("ZodLiteral",(Q,$)=>{j$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>TY(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]}})});cz=j("ZodTransform",(Q,$)=>{w$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>RY(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(z1.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(z1.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}});Uq=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});pz=j("ZodExactOptional",(Q,$)=>{D$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>B4(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});iz=j("ZodNullable",(Q,$)=>{O$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>xY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});nz=j("ZodDefault",(Q,$)=>{I$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>yY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});sz=j("ZodPrefault",(Q,$)=>{N$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>hY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});Vq=j("ZodNonOptional",(Q,$)=>{T$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>CY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});tz=j("ZodCatch",(Q,$)=>{b$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>fY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});QB=j("ZodPipe",(Q,$)=>{R$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>uY(Q,Y,q,J),Q.in=$.in,Q.out=$.out});$B=j("ZodReadonly",(Q,$)=>{S$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>mY(Q,Y,q,J),Q.unwrap=()=>Q._zod.def.innerType});qB=j("ZodCustom",(Q,$)=>{E$.init(Q,$),E1.init(Q,$),Q._zod.processJSONSchema=(Y,q,J)=>bY(Q,Y,q,J)})});var Aq;var Lq=A(()=>{(function(Q){})(Aq||(Aq={}))});var Fq=()=>{};var jq=A(()=>{o0();o0();v$();o7();Z4();Fq();M4();_4();V4();A4();Lq();O0(n7())});var H8=A(()=>{jq()});var Dq;var wq=A(()=>{Dq={name:"ocx",version:"2.0.8",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:{bun:">=1.2.0"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts","build:binary:all":"bun run scripts/build-binary.ts --all","build:binary:windows":"bun run scripts/build-binary.ts --target=windows-x64 && bun run scripts/build-binary.ts --target=windows-x64-baseline","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","test:binary-smoke":"OCX_DIST_TESTS=1 bun test tests/binary-smoke.test.ts"},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 KB(Q){return`https://${_2}/schemas/v${Q}/registry.json`}var _2="ocx.kdco.dev",Oq="kdcokenny/ocx",j4,w4,y0=2,h0,Iq;var z3=A(()=>{wq();j4=`https://${_2}/schemas/ocx.json`,w4=`https://${_2}/schemas/registry.json`;h0=KB(y0),Iq=Dq.version});var G1,B1,_1,I1,h,L,u8,n1,m8,x1,f0,C1,N8,w9,u0,D9,D4;var t=A(()=>{G1={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};B1=class B1 extends Error{code;exitCode;constructor(Q,$,Y=G1.GENERAL){super(Q);this.code=$;this.exitCode=Y;this.name="OCXError"}};_1=class _1 extends B1{constructor(Q){super(Q,"NOT_FOUND",G1.NOT_FOUND);this.name="NotFoundError"}};I1=class I1 extends B1{url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor(Q,$){super(Q,"NETWORK_ERROR",G1.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 B1{constructor(Q){super(Q,"CONFIG_ERROR",G1.CONFIG);this.name="ConfigError"}};L=class L extends B1{constructor(Q){super(Q,"VALIDATION_ERROR",G1.GENERAL);this.name="ValidationError"}};u8=class u8 extends B1{details;constructor(Q){super("Registry validation failed","VALIDATION_FAILED",G1.CONFIG);this.details=Q;this.name="ValidationFailedError"}};n1=class n1 extends B1{constructor(Q){super(Q,"CONFLICT",G1.CONFLICT);this.name="ConflictError"}};m8=class m8 extends B1{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 ${
|
|
62
|
-
URL: ${
|
|
63
|
-
Existing name: ${
|
|
64
|
-
Requested name: ${
|
|
60
|
+
Use 'ocx update ${Q}' to intentionally update this component.`;super(q,"INTEGRITY_ERROR",G1.INTEGRITY);this.component=Q;this.expected=$;this.found=Y;this.name="IntegrityError"}};x1=class x1 extends B1{constructor(Q){super(Q,"UPDATE_ERROR",G1.GENERAL);this.name="SelfUpdateError"}};f0=class f0 extends B1{url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor(Q,$){super(Q,"REGISTRY_COMPAT_ERROR",G1.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 B1{profile;constructor(Q,$){let Y=$??`Profile "${Q}" not found`;super(Y,"NOT_FOUND",G1.NOT_FOUND);this.profile=Q;this.name="ProfileNotFoundError"}};N8=class N8 extends B1{profile;constructor(Q,$){let Y=$?`Profile "${Q}" already exists. ${$}`:`Profile "${Q}" already exists.`;super(Y,"CONFLICT",G1.CONFLICT);this.profile=Q;this.name="ProfileExistsError"}};w9=class w9 extends B1{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 ${
|
|
67
|
-
Current: ${
|
|
68
|
-
New: ${
|
|
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 ${
|
|
69
|
+
Run 'ocx registry remove ${Q}' first, then re-add with the new URL.`;super(G,"CONFLICT",G1.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 B1{profile;reason;constructor(Q,$){super(`Invalid profile name "${Q}": ${$}`,"VALIDATION_ERROR",G1.GENERAL);this.profile=Q;this.reason=$;this.name="InvalidProfileNameError"}};D9=class D9 extends B1{constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",G1.NOT_FOUND);this.name="ProfilesNotInitializedError"}};D4=class D4 extends B1{profile;localDir;constructor(Q,$){super(`Local profile directory unsupported: "${$}"
|
|
71
70
|
|
|
72
71
|
Local profiles are not supported. Profiles must be global only.
|
|
73
72
|
Remove the local profile directory and use global profiles instead:
|
|
74
|
-
rm -rf "${
|
|
75
|
-
ocx profile show ${$} --global`,"CONFIG_ERROR",K$.CONFIG);this.profile=$;this.localDir=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(
|
|
77
|
-
`+" ".repeat(
|
|
78
|
-
${
|
|
79
|
-
`)}}function
|
|
73
|
+
rm -rf "${$}"
|
|
74
|
+
ocx profile show ${Q} --global`,"CONFIG_ERROR",G1.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(WB.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,WB;var g8=A(()=>{e1=class e1 extends Error{attemptedPath;reason;constructor(Q,$,Y){super(Q);this.attemptedPath=$;this.reason=Y;this.name="PathValidationError"}};WB=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 zB,normalize as Tq}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(zB(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(Tq(Q).startsWith(".."))throw new L(`Invalid path: "${Q}" - path traversal not allowed`)}function yq(Q){return Q}function Nq(Q,$){if(BB.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=Tq(Q);if(Rq.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=yq(Q);return Nq(Y,$),{path:Q,target:Y}}return O4(Q.path),O4(Q.target),Nq(Q.target,$),Q}function hq(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,hq(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(DB);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 xw,B3,I4,bq,O9,BB,Rq,_B,ZB,Sq,Eq,kq,vq,MB,UB,VB,AB,LB,FB,jB,wB,Pq,xq,Cq,c8,DB,Z2,p8,M2,T4;var g0=A(()=>{H8();z3();t();g8();xw=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.'});bq=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"]),BB=new Set([".ocx","ocx.lock"]),Rq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],_B=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!Rq.some(($)=>Q===$||Q.startsWith($))},{message:"Target path is protected and cannot be overwritten by registry components"}),ZB=Q1({clientId:F().optional(),scopes:R1(F()).optional(),authUrl:F().optional(),tokenUrl:F().optional()}),Sq=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(),ZB]).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'"}),Eq=U0([F(),Sq]),kq=Q1({path:F().min(1,"File path cannot be empty"),target:F().min(1,"Target path cannot be empty")}),vq=U0([F().min(1,"File path cannot be empty"),kq]),MB=Q1({api:F().optional(),headers:q1(F(),F()).optional(),env:q1(F(),F()).optional(),enabled:i1().optional()}).passthrough(),UB=Q1({command:U0([F(),R1(F())]).optional(),enabled:i1().optional()}).passthrough(),VB=Q1({command:U0([F(),R1(F())]).optional(),glob:F().optional()}).passthrough(),AB=Q1({description:F().optional(),run:F().optional()}).passthrough(),LB=Q1({disabled:i1().optional()}).passthrough(),FB=Q1({host:F().optional(),port:j9().optional()}).passthrough(),jB=q1(F(),F()),wB=Q1({include:R1(F()).optional(),exclude:R1(F()).optional()}).passthrough(),Pq=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(),Mq()).optional()}),xq=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"]))])),Cq=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(),Eq).optional(),plugin:R1(F()).optional(),tools:q1(F(),i1()).optional(),agent:q1(F(),Pq).optional(),instructions:R1(F()).optional(),permission:xq.optional(),provider:q1(F(),MB).optional(),lsp:q1(F(),UB).optional(),formatter:q1(F(),VB).optional(),command:q1(F(),AB).optional(),tui:LB.optional(),server:FB.optional(),keybind:jB.optional(),watcher:wB.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(vq).default([]),dependencies:R1(bq).default([]),npmDependencies:R1(F()).optional(),npmDevDependencies:R1(F()).optional(),opencode:Cq.optional()});DB=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 OB,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),l=s0($,"files",D.path);if(!await Bun.file(l).exists()){M.push(`${w.name}: Source file not found at ${l}`);continue}N.push({action:"create",target:`file:components/${w.name}/${D.path}`,details:{source:l}})}}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),l=s0($,"files",D.path),i=s0(V,N.name,D.path),r=OB(i);if(!await Bun.file(l).exists()){M.push(`${N.name}: Source file not found at ${l}`);continue}await b4(r,{recursive:!0});let J1=Bun.file(l);await Bun.write(i,J1)}}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 c={registry:"/index.json"};return await Bun.write(s0(I,"ocx.json"),JSON.stringify(c,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 fq from"path";function uq(Q){return fq.posix.isAbsolute(Q)||fq.win32.isAbsolute(Q)}var mq=()=>{};var R4;var S4=A(()=>{H8();mq();R4=F().refine((Q)=>!Q.includes("\x00"),"Path cannot contain null bytes").refine((Q)=>!Q.split(/[/\\]/).some(($)=>$===".."),"Path cannot contain '..'").refine((Q)=>!uq(Q),"Path must be relative, not absolute")});function g1(Q){return Q.trim().replace(/\/+$/,"")}import{existsSync as N9}from"fs";import{mkdir as cq}from"fs/promises";import G8 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 $=G8.join(Q,dq,pq);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 iq.parse(X)}async function N0(Q,$){let Y=G8.join(Q,dq,pq);await cq(G8.dirname(Y),{recursive:!0});let q=JSON.stringify($,null,2);await Bun.write(Y,q)}function E8(Q){let $=G8.join(Q,E4,V2),Y=G8.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=G8.join(Q,E4,gq),q=G8.join(Q,gq);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??G8.join(Q,E4,V2);await cq(G8.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,dq=".ocx",pq="receipt.jsonc",lq,iq,IB,NB,M3,V2="ocx.jsonc",gq="ocx.lock",E4=".opencode";var q0=A(()=>{D0();H8();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)}),lq=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()}),iq=Q1({version:F4(1),root:F().optional(),installed:q1(F(),lq).default({})}),IB=Q1({registry:F(),version:F(),hash:F(),files:R1(F()),installedAt:F(),updatedAt:F().optional()}),NB=Q1({registry:F(),component:F(),version:F().optional(),hash:F(),installedAt:F()}),M3=Q1({lockVersion:F4(1),installedFrom:NB.optional(),installed:q1(I4,IB).default({})})});var{Glob:TB}=globalThis.Bun;var nq,K8;var b9=A(()=>{H8();S4();q0();nq=F().refine((Q)=>{try{return new TB(Q),!0}catch{return!1}},{message:"Invalid glob pattern"}),K8=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(nq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:R1(nq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var k4=A(()=>{S4();q0();b9();g0()});function oq(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 bB(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?oq(this.keys,q+""):q+"";return q===void 0?bB([Q],[Y]):L1.enabled?oq([Y],q+""):q+""}}var v4,sq,rq,aq,tq=!0,L1,P;var W8=A(()=>{if(typeof process<"u")({FORCE_COLOR:v4,NODE_DISABLE_COLORS:sq,NO_COLOR:rq,TERM:aq}=process.env||{}),tq=process.stdout&&process.stdout.isTTY;L1={enabled:!sq&&rq==null&&aq!=="dumb"&&(v4!=null&&v4!=="0"||tq),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 QJ(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 RB,l8,eq;var F2=A(()=>{RB=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),l8=Boolean(process.stdout.isTTY&&!RB),eq=Boolean(l8&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var R9,_,L0;var c1=A(()=>{W8();F2();if(!eq)P.enabled=!1;R9={},_={info(...Q){if(R9.quiet)return;console.log(P.blue("info"),...Q)},success(...Q){if(R9.quiet)return;console.log(P.green("\u2713"),...Q)},warn(...Q){if(R9.quiet)return;console.warn(P.yellow("warn"),...Q)},error(...Q){console.error(P.red("error"),...Q)},debug(...Q){if(!R9.verbose)return;console.log(P.gray("debug"),...Q)},log(...Q){if(R9.quiet)return;console.log(...Q)},break(){if(R9.quiet)return;console.log("")}},L0={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 s(Q,$={}){if($.json){let Y=SB(Q);console.log(JSON.stringify(Y,null,2)),process.exit(Y.exitCode)}if(Q instanceof B1)_.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(G1.CONFIG)}if(Q instanceof Error){if(_.error(Q.message),process.env.DEBUG)console.error(Q.stack)}else _.error("An unknown error occurred");process.exit(G1.GENERAL)}function SB(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:G1.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 B1)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:G1.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:Q instanceof Error?Q.message:"An unknown error occurred"},exitCode:G1.GENERAL,meta:{timestamp:new Date().toISOString()}}}var y1=A(()=>{H8();_3();t();c1()});var j2=L8((EB)=>{class P4 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 $J extends P4{constructor(Q){super(1,"commander.invalidArgument",Q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}EB.CommanderError=P4;EB.InvalidArgumentError=$J});var V3=L8((CB)=>{var{InvalidArgumentError:PB}=j2();class YJ{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 PB(`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 xB(Q){let $=Q.name()+(Q.variadic===!0?"...":"");return Q.required?"<"+$+">":"["+$+"]"}CB.Argument=YJ;CB.humanReadableArgName=xB});var x4=L8((uB)=>{var{humanReadableArgName:fB}=V3();class qJ{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)=>fB(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 JJ(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 JJ(Q){let $=/\x1b\[\d*(;\d*)*m/g;return Q.replace($,"")}uB.Help=qJ;uB.stripColor=JJ});var C4=L8((pB)=>{var{InvalidArgumentError:cB}=j2();class HJ{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=dB(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 cB(`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 XJ(this.name().replace(/^no-/,""));return XJ(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 GJ{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 XJ(Q){return Q.split("-").reduce(($,Y)=>{return $+Y[0].toUpperCase()+Y.slice(1)})}function dB(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(
|
|
83
|
-
- too many short flags`);if(
|
|
84
|
-
- too many long flags`);throw Error(`${
|
|
85
|
-
- unrecognised flag format`)}if(
|
|
86
|
-
(Did you mean one of ${
|
|
87
|
-
(Did you mean ${
|
|
88
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
89
|
-
Expecting one of '${
|
|
90
|
-
- already used by option '${
|
|
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(
|
|
92
|
-
- if '${
|
|
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}}pB.Option=HJ;pB.DualOptions=GJ});var KJ=L8((sB)=>{function nB(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 oB(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=nB(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""}sB.suggestSimilar=oB});var _J=L8((q_)=>{var aB=z9("events").EventEmitter,y4=z9("child_process"),z8=z9("path"),A3=z9("fs"),Z1=z9("process"),{Argument:tB,humanReadableArgName:eB}=V3(),{CommanderError:h4}=j2(),{Help:Q_,stripColor:$_}=x4(),{Option:WJ,DualOptions:Y_}=C4(),{suggestSimilar:zJ}=KJ();class u4 extends aB{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:($)=>Z1.stdout.write($),writeErr:($)=>Z1.stderr.write($),outputError:($,Y)=>Y($),getOutHelpWidth:()=>Z1.stdout.isTTY?Z1.stdout.columns:void 0,getErrHelpWidth:()=>Z1.stderr.isTTY?Z1.stderr.columns:void 0,getOutHasColors:()=>f4()??(Z1.stdout.isTTY&&Z1.stdout.hasColors?.()),getErrHasColors:()=>f4()??(Z1.stderr.isTTY&&Z1.stderr.hasColors?.()),stripColor:($)=>$_($)},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 u4(Q)}createHelp(){return Object.assign(new Q_,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 tB(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 h4(Q,$,Y));Z1.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 WJ(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 WJ)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(Z1.versions?.electron)$.from="electron";let q=Z1.execArgv??[];if(q.includes("-e")||q.includes("--eval")||q.includes("-p")||q.includes("--print"))$.from="eval"}if(Q===void 0)Q=Z1.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(Z1.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
|
-
- ${
|
|
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(Z1.platform!=="win32")if(Y)$.unshift(X),$=BJ(Z1.execArgv).concat($),G=y4.spawn(Z1.argv[0],$,{stdio:"inherit"});else G=y4.spawn(X,$,{stdio:"inherit"});else this._checkForMissingExecutable(X,H,Q._name),$.unshift(X),$=BJ(Z1.execArgv).concat($),G=y4.spawn(Z1.execPath,$,{stdio:"inherit"});if(!G.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((z)=>{Z1.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)Z1.exit(W);else K(new h4(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)Z1.exit(1);else{let z=new h4(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
|
|
98
|
-
`),this._exit(0,"commander.version"
|
|
99
|
-
Expecting one of '${
|
|
100
|
-
`)}),this}_outputHelpIfRequested(
|
|
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 Z1.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()}`,Z1.env[Q.envVar]);else this.emit(`optionEnv:${Q.name()}`)}})}_parseOptionsImplied(){let Q=new Y_(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);$=zJ(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())}),$=zJ(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 eB(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(Z1.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 BJ(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 f4(){if(Z1.env.NO_COLOR||Z1.env.FORCE_COLOR==="0"||Z1.env.FORCE_COLOR==="false")return!1;if(Z1.env.FORCE_COLOR||Z1.env.CLICOLOR_FORCE!==void 0)return!0;return}q_.Command=u4;q_.useColor=f4});var VJ=L8((K_)=>{var{Argument:ZJ}=V3(),{Command:m4}=_J(),{CommanderError:H_,InvalidArgumentError:MJ}=j2(),{Help:G_}=x4(),{Option:UJ}=C4();K_.program=new m4;K_.createCommand=(Q)=>new m4(Q);K_.createOption=(Q,$)=>new UJ(Q,$);K_.createArgument=(Q,$)=>new ZJ(Q,$);K_.Command=m4;K_.Option=UJ;K_.Argument=ZJ;K_.Help=G_;K_.CommanderError=H_;K_.InvalidArgumentError=MJ;K_.InvalidOptionArgumentError=MJ});var AJ,yD,hD,fD,uD,mD,LJ,gD,FJ,cD,B8,dD;var L3=A(()=>{AJ=B5(VJ(),1),{program:yD,createCommand:hD,createArgument:fD,createOption:uD,CommanderError:mD,InvalidArgumentError:LJ,InvalidOptionArgumentError:gD,Command:FJ,Argument:cD,Option:B8,Help:dD}=AJ.default});import{existsSync as wJ,statSync as j_}from"fs";import{join as DJ}from"path";function jJ(Q,$){let Y=DJ(Q,$);if(!wJ(Y))return"missing";if(!j_(Y).isDirectory())throw new L(`Component root "${$}" exists at "${Y}" but is not a directory.`);return"directory"}function O_(Q,$){let Y=jJ(Q,$.singular),q=jJ(Q,$.plural);if(Y==="directory"&&q==="directory")return $.plural;if(Y==="directory")return $.singular;if(q==="directory")return $.plural;return $.plural}function I_(Q,$,Y,q,J){if(!J)return;let H=`${Y===q.plural?q.singular:q.plural}/${J}`,G=DJ(Q,H);if(!wJ(G))return;throw new n1(`Cross-root logical collision for "${$}": selected root "${Y}" but "${H}" already exists.`)}function S9(Q,$){let[Y,...q]=Q.split("/");if(!Y)return Q;let J=D_.get(Y);if(!J)return Q;let X=O_($,J),H=q.join("/");if(I_($,Q,X,J,H),!H)return X;return`${X}/${H}`}var w_,D_;var g4=A(()=>{t();w_={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},D_=new Map(Object.entries(w_).flatMap(([Q,$])=>{let Y={singular:Q,plural:$};return[[Q,Y],[$,Y]]}))});import{stat as N_}from"fs/promises";import{homedir as T_}from"os";import{isAbsolute as b_,join as OJ,relative as R_,resolve as IJ}from"path";function S_(Q){let $=Q.replace(/\\/g,"/");if($===F3)return".";if($.startsWith(c4))return $.slice(c4.length);return Q}function F0(){let Q=process.env.XDG_CONFIG_HOME,$=Q&&b_(Q)?Q:OJ(T_(),".config");return OJ($,"opencode")}async function NJ(){try{return(await N_(F0())).isDirectory()}catch{return!1}}function i8(Q,$,Y){if($){if(!Y)return Q;return S9(Q,Y)}let q=S_(Q),J=Y?IJ(Y):process.cwd(),X=IJ(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=R_(X,H).replace(/\\/g,"/");if(G==="."||G==="")return F3;let K=Y?S9(G,X):G;return`${c4}${K}`}var F3=".opencode",c4;var k8=A(()=>{g4();t();g8();c4=`${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 E9{cwd;config;constructor(Q,$){this.cwd=Q,this.config=$}static async requireInitialized(){let Q=F0();if(!await NJ())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 E9(Q,$)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var k9=A(()=>{q0();t();k8()});import{rename as TJ,symlink as GO,unlink as bJ}from"fs/promises";async function v9(Q,$){let Y=`${Q}.tmp.${process.pid}`;try{await Bun.write(Y,JSON.stringify($,null,"\t"),{mode:384}),await TJ(Y,Q)}catch(q){try{await bJ(Y)}catch{}throw q}}async function RJ(Q,$){let Y=`${$}.tmp.${process.pid}`;try{let J=await Bun.file(Q).arrayBuffer();await Bun.write(Y,J,{mode:384}),await TJ(Y,$)}catch(q){try{await bJ(Y)}catch{}throw q}}var j3=()=>{};import{existsSync as SJ,statSync as E_}from"fs";import{readFile as k_,stat as v_}from"fs/promises";import{homedir as P_}from"os";import h1 from"path";function x_(Q={}){let $=Q.xdgConfigHome??process.env.XDG_CONFIG_HOME;if($&&$.trim().length>0)return h1.resolve($);let Y=Q.homeDir??P_();return h1.resolve(Y,".config")}function EJ(Q,$){let Y=h1.resolve(Q),q=h1.resolve($),J=h1.relative(Y,q);if(J==="")return!0;if(J==="..")return!1;if(J.startsWith(`..${h1.sep}`))return!1;return!h1.isAbsolute(J)}function w3(Q={}){return h1.join(x_(Q),"opencode")}function d4(Q,$={}){let Y=w3($);if(!EJ(Y,Q))return"local-project";let q=h1.join(Y,"profiles");if(EJ(q,Q))return"global-profile-root";return"global-root"}function _8(Q={}){return h1.join(w3(Q),"profiles")}function C_(Q=process.cwd()){let $=M8(Q);if($)return h1.join($,"profiles");return h1.join(Q,n8,"profiles")}function f1(Q){return h1.join(_8(),Q)}function kJ(Q,$=process.cwd()){return h1.join(C_($),Q)}function K0(Q){return h1.join(f1(Q),"ocx.jsonc")}function Z8(Q){return h1.join(f1(Q),"opencode.jsonc")}function o8(Q){return h1.join(f1(Q),"AGENTS.md")}function M8(Q){let $=Q;while(!0){let Y=h1.join($,n8);if(SJ(Y)&&E_(Y).isDirectory())return Y;let q=h1.join($,".git");if(SJ(q))return null;let J=h1.dirname($);if(J===$)return null;$=J}}function P9(){return h1.join(w3(),c0)}async function vJ(Q={}){let $=h1.join(w3(Q),c0),Y;try{Y=await v_($)}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 k_($,"utf8");return{path:$,content:q}}catch(q){throw new v8("read-failed",$,q instanceof Error?q.message:String(q))}}var c0="ocx.jsonc",w2="opencode.jsonc",n8=".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,VO;var D3=A(()=>{H8();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"),VO=Q1({name:a0,ocx:K8,opencode:q1(F(),I8()).optional(),hasAgents:i1()})});import{mkdir as PJ,readdir as y_,rename as h_,rm as f_,stat as p4}from"fs/promises";function m_(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function xJ(Q,$){let Y=[],q=O1(Q,Y,{allowTrailingComma:!0});if(Y.length>0){let J=m_(Y);throw new h(`Invalid JSONC in ${$}: ${J}`)}return q}function g_(Q,$,Y){let q=K8.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 c_(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 CJ(Q,$){if(Q.trim().length===0)throw new h(`Invalid profile from ${$}: value cannot be empty or whitespace`);return Q}class u1{cwd;constructor(Q=process.cwd()){this.cwd=Q}get profilesDir(){return _8()}static create(Q){return new u1(Q??process.cwd())}static async requireInitialized(){let Q=u1.create();if(!await Q.isInitialized())throw new D9;return Q}async isInitialized(){try{return(await p4(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new D9}async list(){return await this.ensureInitialized(),(await y_(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter(($)=>$.isDirectory()&&!$.name.startsWith(".")).map(($)=>$.name).sort()}async exists(Q){let $=f1(Q);try{return(await p4($)).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=xJ(q,$),X=g_(J,$,Q),H=Z8(Q),G=Bun.file(H),K;if(await G.exists()){let Z=await G.text(),M=xJ(Z,H);K=c_(M,H,Q)}let W=o8(Q),B=await Bun.file(W).exists();return{name:Q,ocx:X,opencode:K,hasAgents:B}}async getLayered(Q,$){let Y=kJ(Q,$),q=!1;try{q=(await p4(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=f1(Q);await PJ(Y,{recursive:!0,mode:448});let q=K0(Q);if(!await Bun.file(q).exists())await Bun.write(q,u_,{mode:384});let X=Z8(Q);if(!await Bun.file(X).exists())await v9(X,{});let G=o8(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(
|
|
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=f1(Q);await f_(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=f1(Q),H=f1($);try{await h_(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=CJ(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=CJ($,"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 PJ(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var yJ,u_=`{
|
|
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
|
|
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();yJ={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function hJ(Q,$,Y){let q=(J)=>Q(J,...$);return Y===void 0?q:Object.assign(q,{lazy:Y,lazyArgs:$})}var fJ=()=>{};function uJ(Q,$,Y){let q=Q.length-$.length;if(q===0)return Q(...$);if(q===1)return hJ(Q,$,Y);throw Error("Wrong number of arguments")}var mJ=A(()=>{fJ()});function l4(Q){if(typeof Q!="object"||!Q)return!1;let $=Object.getPrototypeOf(Q);return $===null||$===Object.prototype}var gJ=()=>{};function i4(...Q){return uJ(cJ,Q)}function cJ(Q,$){let Y={...Q,...$};for(let q in $){if(!(q in Q))continue;let{[q]:J}=Q;if(!l4(J))continue;let{[q]:X}=$;l4(X)&&(Y[q]=cJ(J,X))}return Y}var dJ=A(()=>{mJ();gJ()});var pJ=A(()=>{dJ()});function D2(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 n4(Q){let $=new Map;for(let q=Q.length-1;q>=0;q--){let J=Q[q],X=D2(J);if(!$.has(X))$.set(X,q)}let Y=[];for(let[q,J]of Q.entries()){let X=D2(J);if($.get(X)===q)Y.push(J)}return Y}function O3(Q,$){let Y=i4(Q,$);if(Array.isArray(Q.plugin)&&Array.isArray($.plugin))Y.plugin=n4([...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(()=>{pJ()});import{existsSync as d_,readFileSync as p_}from"fs";import{dirname as l_,isAbsolute as uO,resolve as o4}from"path";function i_(Q){let $=o4(Q);while(!0){let Y=o4($,".git");if(d_(Y))try{let J=z9("fs").statSync(Y);if(J.isDirectory())return $;if(J.isFile()){if(p_(Y,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return $}}catch{}let q=l_($);if(q===$)return null;$=q}}function s4(Q){let $=o4(Q);return i_($)??$}var lJ=()=>{};import{existsSync as n_}from"fs";import*as s8 from"path";var{Glob:o_}=globalThis.Bun;function iJ(Q){return Q.startsWith("http://")||Q.startsWith("https://")}function s_(Q,$){if(iJ(Q))return;if(s8.isAbsolute(Q)||s8.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 r_(Q,$,Y){if(iJ(Q))return[Q];if(s_(Q,Y),Q.includes("*")||Q.includes("?")||Q.includes("[")){let X=new o_(Q),H=[];for(let G of X.scanSync($)){let K=s8.join($,G);H.push(K)}return H}let J=s8.join($,Q);if(!n_(J))throw new L(`Registry instruction file not found: "${Q}" (from ${Y})
|
|
118
|
+
Expected at: ${J}`);return[J]}function nJ(Q,$,Y){let q=[],J=new Set;for(let X of Q){let H=r_(X,$,Y);for(let G of H)if(!J.has(G))J.add(G),q.push(G)}return q}var oJ=A(()=>{t()});import{existsSync as r8,readFileSync as rJ,statSync as a_}from"fs";import{homedir as t_}from"os";import{join as R0,relative as aJ}from"path";var{Glob:N3}=globalThis.Bun;function e_(Q){return Q==="local-config"||Q==="cli"||Q==="env"}function r4(Q,$){if(Q.trim().length===0)throw new h(`Invalid profile from ${$}: value cannot be empty or whitespace`);return Q}function tJ(Q){if(Q.length===0)return"Unknown parse error";let $=Q[0];if(!$)return"Unknown parse error";return`${n0($.error)} at offset ${$.offset}`}function sJ(Q){let $;try{$=rJ(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=tJ(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 QZ(Q){let $;try{$=rJ(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=tJ(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 YZ(Q,$,Y){let q=[],J=$;while(!0){let X=R0(J,Q);if(r8(X)&&a_(X).isFile()){let G=aJ(Y,X);q.push(G)}if(J===Y)break;let H=R0(J,"..");if(H===J)break;J=H}return q}function qZ(Q,$){for(let Y of $Z){let q=YZ(Y,Q,$);if(q.length>0)return q}return[]}function T3(Q){return Q.startsWith("./")?Q.slice(2):Q}function JZ(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 XZ(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=nJ(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=u1.create(Q),q=null,J="none",X=M8(Q);if(X){let z=R0(X,c0);if(r8(z)){let B=sJ(z);if(B.profile!==void 0)q=r4(B.profile,`local config at ${z}`),J="local-config"}}if(q===null){if($?.profile!==void 0)q=r4($.profile,"CLI option --profile"),J="cli";else if(process.env.OCX_PROFILE!==void 0)q=r4(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),J="env"}let H=await Y.isInitialized();if(e_(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=f1(q);else if(X)K=R0(X,"..");else K=F0();let W=await XZ(K);return new e0(Q,q,G,X,W)}resolve(){if(this.cachedConfig)return this.cachedConfig;let Q={},$=n8,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=n8,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,w2);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 $=s4(this.cwd),Y=aJ($,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(!r8(Q))return null;return{registries:sJ(Q).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let Q=R0(this.localConfigDir,w2);if(!r8(Q))return null;return QZ(Q)}discoverInstructions(){let Q=[],$=F0(),Y=R0($,"AGENTS.md");if(r8(Y))Q.push(Y);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let z=R0(t_(),".claude","CLAUDE.md");if(r8(z))Q.push(z)}if(this.profile&&this.profileName){let z=R0(f1(this.profileName),"AGENTS.md");if(r8(z))Q.push(z)}let q=this.loadRegistryInstructions();Q.push(...q);let J=s4(this.cwd),X=qZ(this.cwd,J),H=this.profile?.ocx.exclude??[],G=this.profile?.ocx.include??[],W=JZ(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 $Z;var O2=A(()=>{D0();t0();W0();I3();q0();t();lJ();oJ();k8();$Z=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function J0(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)&&Object.getPrototypeOf(Q)===Object.prototype}var XX={};F8(XX,{fetchRegistryIndex:()=>P8,fetchFileContent:()=>a8,fetchComponentVersion:()=>E3,fetchComponent:()=>N2,classifyRegistryIndexIssue:()=>JX,_clearFetcherCacheForTests:()=>UZ});import{posix as HZ}from"path";function WZ(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 QX(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 $X(Q){return typeof Q==="string"&&Object.hasOwn(S3,Q)}function R3(Q){return Q.startsWith(".opencode/")||Q.startsWith(".opencode\\")}function YX(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 zZ(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(!$X(X))continue;Y.push({path:`components[${q}].type`,type:X})}return Y}function BZ(Q){if(!J0(Q))return!1;if(typeof Q.type==="string"&&Q.type.startsWith("ocx:"))return!0;return YX(Q).length>0}async function _Z(Q){let $=g1(Q),Y=I2.get($);if(Y)return Y;try{await P8($)}catch(J){if(J instanceof I1||J instanceof _1)return null;throw J}if(!I2.has($))return null;let q=I2.get($);if(!q)throw Error(`Missing registry schema mode cache entry for ${$}`);return q}function eJ(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=[GZ[J]??J,...X].join("/"),K=HZ.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 ZZ(Q,$){if(!J0(Q))return Q;let Y={...Q};if(Object.hasOwn(Y,"type"))Y.type=QX(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 eJ(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:eJ(X,`${$}.files[${J}].target`)}});return Y}function MZ(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:QX(J.type,`components[${X}].type`),description:G}});return{...Q,components:q}}async function qX(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 _1(`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 JX(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 qX(Y,(q)=>{let J=JX(q);if(J&&J.issue!=="legacy-schema-v1")throw WZ(Y,J);let X=q,H="v2";if(J?.issue==="legacy-schema-v1"){H="legacy-v1";try{X=MZ(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=zZ(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 I2.set($,H),G.data},{phase:"registry-index-fetch"})}async function N2(Q,$){return(await E3(Q,$)).manifest}async function E3(Q,$,Y){let q=`${g1(Q)}/components/${$}.json`;return qX(`${q}#v=${Y??"latest"}`,async(J)=>{let X=KZ.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(BZ(K))if(await _Z(Q)!=="v2")z=ZZ(K,W);else{let V=YX(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)&&$X(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 a8(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 UZ(){b3.clear(),I2.clear()}var b3,I2,S3,GZ,KZ;var t8=A(()=>{H8();g0();t();b3=new Map,I2=new Map,S3={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},GZ={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},KZ=M2.extend({versions:q1(F(),I8())})});function HX(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 GX(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 _1(`Registry alias '${z}' not found. Add it with 'ocx registry add <url> --name ${z}'.`);let U;try{U=await N2(V.url,B)}catch(I){if(I instanceof I1)throw I;if(I instanceof _1)throw new _1(`Component '${B}' not found in registry '${z}'.`);if(I instanceof B1)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 c=HX(I,z);await G(c.namespace,c.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=HX(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 KX=A(()=>{g0();t();t8();I3()});import{statSync as VZ}from"fs";import{mkdir as WX}from"fs/promises";import z0 from"path";function x9(Q){try{return VZ(Q).isFile()}catch{return!1}}function k3(Q){let $=z0.resolve(Q);if(d4($)!=="local-project"){let K=z0.join($,"opencode.jsonc"),W=z0.join($,"opencode.json");if(x9(K))return{path:K,exists:!0};if(x9(W))return{path:W,exists:!0};return{path:K,exists:!1}}let J=z0.join($,t4,"opencode.jsonc"),X=z0.join($,t4,"opencode.json");if(x9(J))return{path:J,exists:!0};if(x9(X))return{path:X,exists:!0};let H=z0.join($,"opencode.jsonc"),G=z0.join($,"opencode.json");if(x9(H))return{path:H,exists:!0};if(x9(G))return{path:G,exists:!0};return{path:J,exists:!1}}async function zX(Q){let{path:$,exists:Y}=k3(Q);if(Y)return{path:$,created:!1};return await WX(z0.dirname($),{recursive:!0}),await Bun.write($,AZ),{path:$,created:!0}}async function e4(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 LZ(Q,$){await Bun.write(Q,$)}function FZ(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 BX(Q,$,Y){if(Y===null||Y===void 0)return Q;if(J0(Y)){let J=FZ(Q,$);if(J!==void 0&&(J===null||typeof J!=="object")){let H=Z9(Q,$,Y,a4);return M9(Q,H)}let X=Q;for(let[H,G]of Object.entries(Y))X=BX(X,[...$,H],G);return X}if(Array.isArray(Y)){let J=Z9(Q,$,Y,a4);return M9(Q,J)}let q=Z9(Q,$,Y,a4);return M9(Q,q)}async function Q6(Q,$){let Y=await e4(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=d4(W)!=="local-project"?z0.join(W,"opencode.jsonc"):z0.join(W,t4,"opencode.jsonc"),await WX(z0.dirname(J),{recursive:!0}),X=!0}let H=q;q=BX(q,[],$);let G=q!==H;if(G)await LZ(J,q);return{path:J,created:X,changed:G}}var t4=".opencode",a4,AZ=`{
|
|
120
119
|
"$schema": "https://opencode.ai/config.json"
|
|
121
120
|
// Add MCP servers, tools, plugins here
|
|
122
121
|
}
|
|
123
|
-
`;var
|
|
124
|
-
`}}});function
|
|
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
|
|
122
|
+
`;var $6=A(()=>{D0();W0();a4={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
|
|
123
|
+
`}}});function _X(Q){return Q.replace(/\r\n/g,`
|
|
124
|
+
`).trim()}function Y6(Q,$){return _X(Q)===_X($)}import{existsSync as jZ,lstatSync as wZ}from"fs";import{rm as DZ,unlink as OZ}from"fs/promises";import{join as UX}from"path";function VX(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 AX(Q,$){let Y=UX(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 MX(Q){if(Q&&typeof Q==="object"&&"code"in Q)return String(Q.code);return"UNKNOWN"}function q6(Q){if(Q instanceof Error)return Q.message;return String(Q)}function TZ(Q){return new Promise(($)=>setTimeout($,Q))}async function LX(Q,$){let Y=UX(Q,"node_modules"),q=$?.rmImpl??((J,X)=>DZ(J,X));if(!jZ(Y))return{success:!0,action:"none"};try{if(wZ(Y).isSymbolicLink())return await OZ(Y),{success:!0,action:"unlinked"}}catch(J){let X=MX(J);if(X==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:X,message:q6(J)}}}for(let J=0;J<=ZX;J++)try{return await q(Y,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(X){let H=MX(X);if(H==="ENOENT")return{success:!0,action:"none"};if(!IZ.has(H))return{success:!1,action:"failed",error:{code:H,message:q6(X)}};if(J<ZX)await TZ(NZ*2**J);else return{success:!1,action:"failed",error:{code:H,message:q6(X)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var IZ,ZX=3,NZ=100;var FX=A(()=>{IZ=new Set(["EBUSY","ENOTEMPTY"])});function j0(Q,$={}){if($.json){console.log(JSON.stringify(Q,null,2));return}if($.quiet)return;if(_.info(L0.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),_.break(),Q.wouldPerform.length===0)_.info("No actions would be performed.");else{let q=bZ(Q.wouldPerform);for(let[J,X]of Object.entries(q)){let H=RZ(J);_.info(`Would ${H} ${X.length} item(s):`);for(let G of X){let K=SZ(G.details);_.info(` \u2022 ${L0.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(L0.dim(q));_.break()}_.info(L0.dim("Run without --dry-run to apply changes."))}function bZ(Q){let $={};for(let Y of Q){if(!$[Y.action])$[Y.action]=[];$[Y.action]?.push(Y)}return $}function RZ(Q){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[Q]??Q}function SZ(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}: ${L0.dim(String(q))}`);return $.length>0?` (${$.join(", ")})`:""}var e8=A(()=>{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(!vZ.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=`${EZ}/${Y}`;try{let J=$??AbortSignal.timeout(kZ),X=await fetch(q,{signal:J,headers:{Accept:"application/json"}});if(X.status===404)throw new _1(`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 _1||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 _1(`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 EZ="https://registry.npmjs.org",kZ=30000,vZ,jX=214;var X6=A(()=>{t();vZ=/^(?:@[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 PZ}from"crypto";import{existsSync as xZ}from"fs";import{join as CZ}from"path";function $9(Q){return PZ("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=CZ(Q,X.path);if(!xZ(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 fZ(){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,pI,yZ,hZ,lI,uZ,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]}},pI=Object.keys(k1.modifier),yZ=Object.keys(k1.color),hZ=Object.keys(k1.bgColor),lI=[...yZ,...hZ];uZ=fZ(),p0=uZ});import H6 from"process";import mZ 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 gZ(){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 cZ(Q){if(Q===0)return!1;return{level:Q,hasBasic:!0,has256:Q>=2,has16m:Q>=3}}function dZ(Q,{streamIsTTY:$,sniffFlags:Y=!0}={}){let q=gZ();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=mZ.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=dZ(Q,{streamIsTTY:Q&&Q.isTTY,...$});return cZ(Y)}var v1,y3,pZ,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;pZ={stdout:vX({isTTY:kX.isatty(1)}),stderr:vX({isTTY:kX.isatty(2)})},PX=pZ});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
|
-
`)+
|
|
129
|
-
`,
|
|
130
|
-
`);if(
|
|
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
|
-
|
|
133
|
-
`))
|
|
134
|
-
`),
|
|
135
|
-
`)}if(this.#
|
|
136
|
-
`));return this}if(this.isSpinning)return this;if(this
|
|
137
|
-
`;return this.stop(),this.#
|
|
138
|
-
${
|
|
139
|
-
|
|
140
|
-
Registry ${
|
|
141
|
-
You are running ${
|
|
127
|
+
`)+Y,J=q+1,q=Q.indexOf(`
|
|
128
|
+
`,J)}while(q!==-1);return X+=Q.slice(J),X}function R2(Q){return iZ(Q)}var hX,fX,G6,h9,b2,uX,f9,lZ=(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},iZ=(Q)=>{let $=(...Y)=>Y.join(" ");return lZ($,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)},nZ,oZ,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)=>sZ(q,J.length===1?""+J[0]:J.join(" "));return Object.setPrototypeOf(q,oZ),q[G6]=Q,q[h9]=$,q[b2]=Y,q},sZ=(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},rZ,$N,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}};nZ=["rgb","hex","ansi256"];for(let Q of nZ){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])}}}}oZ=Object.defineProperties(()=>{},{...f9,level:{enumerable:!0,get(){return this[G6].level},set(Q){this[G6].level=Q}}});Object.defineProperties(R2.prototype,f9);rZ=R2(),$N=R2({level:fX?fX.level:0}),mX=rZ});function z6(Q,$,{ignoreNonConfigurable:Y=!1}={}){let{name:q}=Q;for(let J of Reflect.ownKeys($))aZ(Q,$,J,Y);return eZ(Q,$),qM(Q,$,q),Q}var aZ=(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(!tZ(J,X)&&q)return;Object.defineProperty(Q,Y,X)},tZ=function(Q,$){return Q===void 0||Q.configurable||Q.writable===$.writable&&Q.enumerable===$.enumerable&&Q.configurable===$.configurable&&(Q.writable||Q.value===$.value)},eZ=(Q,$)=>{let Y=Object.getPrototypeOf($);if(Y===Object.getPrototypeOf(Q))return;Object.setPrototypeOf(Q,Y)},QM=(Q,$)=>`/* Wrapped ${Q}*/
|
|
130
|
+
${$}`,$M,YM,qM=(Q,$,Y)=>{let q=Y===""?"":`with ${Y.trim()}() `,J=QM.bind(null,q,$.toString());Object.defineProperty(J,"name",YM);let{writable:X,enumerable:H,configurable:G}=$M;Object.defineProperty(Q,"toString",{value:J,writable:X,enumerable:H,configurable:G})};var cX=A(()=>{$M=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),YM=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];JM(_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,JM,XM=(Q)=>{return{onExit($,Y){return Q.onExit($,Y)},load(){return Q.load()},unload(){return Q.unload()}}},oX,sX,Z6,rX,KN,WN;var aX=A(()=>{iX();B6=Symbol.for("signal-exit emitter"),_6=globalThis,JM=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:KN,unload:WN}=XM(u3(Z6)?new sX(Z6):new oX)});import m3 from"process";var tX,HM,eX;var QH=A(()=>{lX();aX();tX=m3.stderr.isTTY?m3.stderr:m3.stdout.isTTY?m3.stdout:void 0,HM=tX?pX(()=>{rX(()=>{tX.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},eX=HM});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,jN;var JH=A(()=>{qH();S2=V6,jN=Object.keys(V6)});import KM from"tty";var WM,a=(Q,$)=>{if(!WM)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}},ON,IN,NN,TN,bN,RN,SN,EN,kN,vN,XH,HH,GH,KH,PN,xN,CN,yN,hN,fN,uN,mN,gN,cN,dN,pN,lN,iN,nN,oN,sN,rN,aN,tN,eN,QT,$T,YT,qT,JT,XT;var A6=A(()=>{WM=KM?.WriteStream?.prototype?.hasColors?.()??!1,ON=a(0,0),IN=a(1,22),NN=a(2,22),TN=a(3,23),bN=a(4,24),RN=a(53,55),SN=a(7,27),EN=a(8,28),kN=a(9,29),vN=a(30,39),XH=a(31,39),HH=a(32,39),GH=a(33,39),KH=a(34,39),PN=a(35,39),xN=a(36,39),CN=a(37,39),yN=a(90,39),hN=a(40,49),fN=a(41,49),uN=a(42,49),mN=a(43,49),gN=a(44,49),cN=a(45,49),dN=a(46,49),pN=a(47,49),lN=a(100,49),iN=a(91,39),nN=a(92,39),oN=a(93,39),sN=a(94,39),rN=a(95,39),aN=a(96,39),tN=a(97,39),eN=a(101,49),QT=a(102,49),$T=a(103,49),YT=a(104,49),qT=a(105,49),JT=a(106,49),XT=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={};F8(q9,{warning:()=>ZM,success:()=>_M,info:()=>BM,error:()=>MM});var c3,BM,_M,ZM,MM;var BH=A(()=>{WH();L6();c3=E2(),BM=KH(c3?"\u2139":"i"),_M=HH(c3?"\u2714":"\u221A"),ZM=GH(c3?"\u26A0":"\u203C"),MM=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(UM,"")}var UM;var ZH=A(()=>{UM=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 IM(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 VM,AM,LM,FM,jT,wT,DT,OT,jM,wM,UH=19968,DM,OM,VH=(Q)=>{if(Q<VM||Q>AM)return!1;return l3(d3,Q)},AH=(Q)=>{if(Q<LM||Q>FM)return!1;return l3(p3,Q)},LH=(Q)=>{if(Q>=DM&&Q<=OM)return!0;if(Q<jM||Q>wM)return!1;return l3(k2,Q)};var FH=A(()=>{MH();VM=d3[0],AM=d3.at(-1),LM=p3[0],FM=p3.at(-1),jT=w6[0],wT=w6.at(-1),DT=D6[0],OT=D6.at(-1),jM=k2[0],wM=k2.at(-1),[DM,OM]=IM(k2)});function NM(Q){if(!Number.isSafeInteger(Q))throw TypeError(`Expected a code point, got \`${typeof Q}\`.`)}function O6(Q,{ambiguousAsWide:$=!1}={}){if(NM(Q),AH(Q)||LH(Q)||$&&VH(Q))return 2;return 1}var jH=A(()=>{FH()});function vM(Q){if(Q.length>50)return!1;if(EM.test(Q))return!0;if(Q.includes("\u200D")){let $=Q.match(kM);return $!==null&&$.length>=2}return!1}function PM(Q){return Q.replace(RM,"")}function xM(Q){return bM.test(Q)}function CM(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 TM.segment(J)){if(xM(G))continue;if(SM.test(G)||vM(G)){X+=2;continue}let K=PM(G).codePointAt(0);X+=O6(K,H),X+=CM(G,H)}return X}var TM,bM,RM,SM,EM,kM;var wH=A(()=>{ZH();jH();TM=new Intl.Segmenter,bM=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,RM=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,SM=/^\p{RGI_Emoji}$/v,EM=/^[\d#*]\u20E3$/,kM=/\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])===yM)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 yM=3,hM,T6;var OH=A(()=>{hM=new DH,T6=Object.freeze(hM)});import v2 from"process";import{stripVTControlCharacters as fM}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()},uM),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 fM(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(mM)),$=!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(gM))}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 uM=200,mM="\x1B[?2026h",gM="\x1B[?2026l",i3;var NH=A(()=>{gX();YH();JH();_H();wH();L6();OH();i3=new Map});function M1(Q){let $=l8&&!Q.quiet;return b6({text:Q.text,isSilent:!$})}var l0=A(()=>{NH();F2()});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 cM(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=cM($,Q);if(q===null)return{compatible:!0};if(q>=0)return{compatible:!0};return{compatible:!1,required:Q,installed:$,type:Y}}function dM(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: ${
|
|
143
|
+
consider updating: ${P.dim(q)}
|
|
145
144
|
|
|
146
|
-
To silence: ${
|
|
147
|
-
`}function
|
|
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(dM(Q,Y))}var EH=A(()=>{W8();c1()});import{randomUUID as kH}from"crypto";import{existsSync as v0}from"fs";import{lstat as pM,mkdir as E6,rename as R6,rm as g9,stat as CH,writeFile as lM}from"fs/promises";import{dirname as n3,isAbsolute as iM,join as X0,relative as nM,resolve as vH}from"path";function oM(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 sM(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)");
|
|
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:f1(J.profile),getRegistries:()=>H.getRegistries(),getComponentPath:()=>H.getComponentPath()}}else if(J.global)X=await E9.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(sM),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 rM(X,K,q,!G);if(H.length>0){let B=H.map((Z)=>Z.namespace?`${Z.namespace}/${Z.component}`:Z.component);z=await aM(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 rM(Q,$,Y,q=!0){let J=$.quiet?null:M1({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
|
|
153
|
-
Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let
|
|
154
|
-
When using --from, all components must use the same prefix.`)}let
|
|
155
|
-
`;if(
|
|
156
|
-
`}if(
|
|
157
|
-
`).map((
|
|
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 e4(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 Q6(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 aM(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:c}=m0(I);U.add(c)}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:M1({text:"Resolving dependencies..."});B?.start();let Z=null,M=null;try{let V=new Set;for(let S of Q){let{namespace:u}=m0(S);V.add(u)}for(let S of V){let u=K[S];if(u)await P8(u.url)}let U=await GX(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,u]of I){let E=await P8(u);R.set(S,E)}if(B?.succeed(`Resolved ${U.components.length} components from ${R.size} registries`),!$.skipCompatCheck&&!J)for(let[S,u]of R){let E=RH({registry:{opencode:u.opencode,ocx:u.ocx},ocxVersion:Iq});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(AX(E,e))}let u={dryRun:!0,command:"add",wouldPerform:S,validation:{passed:!0},summary:`Would add ${U.components.length} component(s)`};if(q||!$.json)j0(u,{json:$.json,quiet:$.quiet});return{installed:U.installOrder,opencode:Boolean(U.opencode),dryRun:!0}}let N=J?null:M1({text:"Fetching components..."});N?.start();let x=[];for(let S of U.components){let u=[];for(let o of S.files){let D1=await a8(S.baseUrl,S.name,o.path);u.push({path:o.path,content:Buffer.from(D1)})}let E=await x3(u);for(let o of S.files){let D1=i8(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:u,computedHash:E,canonicalId:e})}N?.succeed(`Fetched ${U.components.length} components`);let w=new Map;for(let{component:S,files:u}of x)for(let E of u){let C=S.files.find((D1)=>D1.path===E.path);if(!C)continue;let e=i8(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 u=await Bun.file(S.absolutePath).text(),E=S.content.toString("utf-8");if(!Y6(u,E)){let C=oM(W,S.relativePath);b.push({path:S.relativePath,owningComponent:C})}}if(b.length>0){let S=b.filter((C)=>C.owningComponent!==null),u=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(u.length>0){_.error(""),_.error("Files not managed by OCX (resolve manually):");for(let C of u)_.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(u.length>0)E+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new n1(E.trim())}let D=J?null:M1({text:"Installing components..."});D?.start(),M=await YU({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 l=qU({quiet:$.quiet});Z=l;for(let{component:S,files:u,computedHash:E,canonicalId:C}of x){let e=await JU(S,u,X,H,l,{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/${Oq}/issues`);let D1=[];for(let $1 of u){let H0=S.files.find((W9)=>W9.path===$1.path);if(!H0)throw Error(`File ${$1.path} not found in component manifest`);let A7=i8(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 Q6(X,U.opencode);if(!$.quiet&&S.changed)if(S.created)_.info(`Created ${S.path}`);else _.info(`Updated ${S.path}`)}let i=U.npmDependencies.length>0,r=U.npmDevDependencies.length>0,J1=$.global||$.profile?X0(X,"package.json"):X0(X,".opencode/package.json");if(i||r){let S=J?null:M1({text:`Updating ${J1}...`});S?.start();try{let u=!!($.global||$.profile),E=await zU(X,U.npmDependencies,U.npmDevDependencies,{isFlattened:u}),C=U.npmDependencies.length+U.npmDevDependencies.length;if(S?.succeed(`Added ${C} dependencies to ${J1}`),E.changed){let e=await LX(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(u){throw S?.fail(`Failed to update ${J1}`),u}}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 tM(Q,$){let Y=nM($,Q);return Y!==""&&!Y.startsWith("..")&&!iM(Y)}async function eM(Q,$){let Y=vH(Q),q=vH($);while(tM(Y,q)){let J=!0;try{if(!(await pM(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 QU(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 $U(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 eM(n3(Q.path),$)}async function YU(Q){let $=[],Y=new Set,q=!1,J=async(G)=>{if(Y.has(G))return;Y.add(G),$.push(await QU(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 $U(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 qU(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 lM(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 JU(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=i8(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(Y6(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 HU(Q,$){let Y={...Q.dependencies};for(let q of $)Y[q.name]=q.version;return{...Q,dependencies:Y}}function GU(Q,$){let Y={...Q.devDependencies};for(let q of $)Y[q.name]=q.version;return{...Q,devDependencies:Y}}async function KU(Q){let $=X0(Q,"package.json");if(!v0($))return{...XU};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 WU(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
|
|
160
|
-
A package cannot be in both fields. Remove from one list manually before adding.`);let
|
|
161
|
-
`);let
|
|
162
|
-
Run 'ocx init --global' first.`)}else{let
|
|
158
|
+
`)}async function zU(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 KU(J),z={...W.dependencies,...W.devDependencies},B=W;B=HU(B,X),B=GU(B,H),await Bun.write(X0(J,"package.json"),`${JSON.stringify(B,null,2)}
|
|
160
|
+
`);let Z={...B.dependencies,...B.devDependencies},M=VX(z,Z);if(!q.isFlattened)await WU(J);return{changed:M.changed,packageDir:J,delta:M.entries}}var XU;var v6=A(()=>{k9();O2();z3();W0();t8();KX();q0();g0();$6();FX();e8();t();y1();c1();X6();g8();k8();P3();y9();d0();l0();EH();XU={name:"opencode-plugins",private:!0,type:"module"}});import{join as BU,posix as _U}from"path";function ZU(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=ZU(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 MU(Q,$)}function MU(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 UU(Q,$){let Y=[];for(let q of Q.components)for(let J of q.files){let X=T8(J,q.type),H=BU($,"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 VU(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 AU(Q){let $=[],Y=new Map,q=(J)=>{let H=J.normalize("NFC").replace(/\\/g,"/");return _U.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 UU(Q,$);for(let X of q.errors)yield X;let J=VU(Q);for(let X of J.errors)yield X;if(!Y.skipDuplicateTargets){let X=AU(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 LU,resolve as gH}from"path";function FU(Q,$){if($==="not_found")return new _1(Q);if($==="parse_error")return new B1(Q,"CONFIG_ERROR",G1.CONFIG);return new B1(Q,"CONFIG_ERROR",G1.CONFIG)}function jU(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 wU(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 FU(z,W.loadErrorKind);let B=W.failureType==="schema"?"schema":"rules",Z=jU(W.errors,B);if(Y.json)throw Z;if(!Y.quiet)wU(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=M1({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 ${LU(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(()=>{W8();_3();P6();e8();t();y1();c1();l0()});import{existsSync as pH}from"fs";import{mkdir as DU}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 OU($)}catch(Y){s(Y)}})}async function OU(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 u1.requireInitialized(),!await u1.create().exists(Q.profile))throw new C1(Q.profile);$=K0(Q.profile)}else if(Q.global){if($=P9(),!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(),n8);if(await DU(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();y1();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 IU($)}catch(Y){s(Y,{json:$.json})}})}async function IU(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(()=>{W8();O2();y1();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 NU,mkdir as c9,readdir as aH,readFile as TU,rm as bU,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 vU(Y.registry,Y);else if(Y.global)await kU(Y);else await EU(Y)}catch(q){s(q,{json:Y.json})}})}async function EU(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 ${
|
|
164
|
+
rm ${Y} && ocx init`);let J=Q.quiet?null:M1({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 zX($);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 kU(Q){let $=Q.quiet?null:M1({text:"Initializing global profiles..."});$?.start();try{let Y=[],q=[],J=P9();if(J9(J))q.push("globalConfig");else await c9(tH(J),{recursive:!0,mode:448}),await v9(J,{$schema:j4,registries:{}}),Y.push("globalConfig");let X=_8();if(!J9(X))await c9(X,{recursive:!0,mode:448});let H=f1("default");if(!J9(H))await c9(H,{recursive:!0,mode:448});let G=K0("default");if(J9(G))q.push("profileOcx");else await v9(G,yJ),Y.push("profileOcx");let K=Z8("default");if(J9(K))q.push("profileOpencode");else await v9(K,{}),Y.push("profileOpencode");let W=o8("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}),
|
|
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 vU(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:M1({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":PU();await CU(Y,K,$.verbose)}if(G)G.text="Configuring project...";if(await hU(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 NU(Q,$,{recursive:!0})}function PU(){return"v2.0.8"}function xU(Q){let $=Q==="main"?"heads/main":`tags/${Q}`;return`https://github.com/${RU}/archive/refs/${$}.tar.gz`}async function CU(Q,$,Y){let q=xU($);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,SU);await QG(Z,Q)}finally{await bU(X,{recursive:!0,force:!0})}}function yU(Q){return Q.split(/[-_\s]+/).map(($)=>$.charAt(0).toUpperCase()+$.slice(1).toLowerCase()).join(" ")}async function hU(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 TU(J).then((H)=>H.toString());if(X=X.replace(/my-registry/g,$.namespace),X=X.replace(/My Registry/g,yU($.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 RU="kdcokenny/ocx",SU="examples/registry-starter";var $G=A(()=>{z3();j3();t0();W0();q0();$6();t();y1();c1();d0();l0()});function fU(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]=fU(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 uU)if(G in H)Y.push({registry:J,field:G,action:"remove_deprecated"})}return Y}var uU;var qG=A(()=>{q0();t();uU=["version"]});import{existsSync as h6,readdirSync as mU,readFileSync as GG,statSync as gU}from"fs";import{rename as a3,writeFile as cU}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 pU($)}catch(Y){s(Y,{json:$.json})}})}async function pU(Q){if(Q.global){await lU(Q);return}await qV(Q,"local",GV(Q),!1)}async function lU(Q){let $=Q.cwd??F0(),Y=iU($);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 nU(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=sU(K);if(Q.json){if(d9(K,!1),W)process.exit(1);return}if(!Q.quiet)JV(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 oU(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)XV(q,J);if(J)process.exit(1)}function iU(Q){let $=[];$.push({label:"root",path:Q});let Y=JG(Q,"profiles");if(h6(Y)&&gU(Y).isDirectory()){let J=mU(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 nU(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 oU(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 sU(Q){return Q.status==="preview_with_errors"}function d9(Q,$){let Y=rU(Q,$);console.log(JSON.stringify(Y,null,2))}function rU(Q,$){let Y=aU(Q),q=Y.flatMap((J)=>J.blockers??[]);return{...Q,lifecycle_status:QV(Q.status,$),schema_version:dU,blockers:q,targets:Y}}function aU(Q){return(Q.targets&&Q.targets.length>0?Q.targets:[tU(Q)]).map((Y)=>eU(Y))}function tU(Q){return{target:Q.scope,status:Q.status,count:Q.count,components:Q.components,configActions:Q.configActions,blockers:Q.blockers??[]}}function eU(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 QV(Q,$){if($)return Q==="partial_failure"?"apply_failed":"apply_ok";return Q==="preview_with_errors"?"preview_blocked":"preview_ok"}function HG(Q,$){let Y=$V($,Q);return{target:Q,status:"error",count:0,components:[],configActions:[],error:Y.message,blockers:[Y]}}function $V(Q,$){let Y=Q instanceof Error?Q.message:String(Q);return{code:YV(Q,Y),message:Y,path:$}}function YV(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 qV(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 JV(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=HV(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 XV(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 HV(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 GV(Q){if(Q.global)return Q.cwd??F0();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,KV);q=M9(q,X)}await cU(Y.path,q)}var dU=1,KV;var zG=A(()=>{D0();q0();t();y1();c1();k8();qG();KV={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
170
|
+
`}}});import{basename as WV,resolve as mR}from"path";function e3(){let{GIT_DIR:Q,GIT_WORK_TREE:$,...Y}=process.env;return Y}async function zV(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 BV(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 WV(J)}async function BG(Q){let[$,Y]=await Promise.all([BV(Q),zV(Q)]);return{repoName:$,branch:Y}}var _G=()=>{};import _V from"path";function ZV(Q){return Q<=31||Q>=127&&Q<=159}function MG(){return Boolean(process.env.TMUX)}function MV(Q){if(!MG())return;Bun.spawnSync(["tmux","rename-window",Q]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function UV(Q){if(!u6())return;let $=VV(Q);if(!$)return;process.stdout.write(`\x1B]0;${$}\x07`)}function VV(Q){let $="";for(let Y of Q){let q=Y.codePointAt(0);if(q===void 0)continue;$+=ZV(q)?" ":Y}return $.trim()}function u6(){return l8}function UG(Q){MV(Q),UV(Q)}function VG(){if(Q7||!l8)return;process.stdout.write("\x1B[22;2t"),Q7=!0}function m6(){if(!Q7)return;if(MG())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(l8)process.stdout.write("\x1B[23;2t");Q7=!1}function AG(Q,$,Y){let q=Y.repoName??_V.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(()=>{F2()});import{randomUUID as AV}from"crypto";import{copyFile as LV,cp as FV,lstat as C8,mkdir as jV,mkdtemp as wV,readdir as wG,readFile as DV,realpath as l9,rename as OV,rm as IV,unlink as NV}from"fs/promises";import{tmpdir as TV}from"os";import{basename as bV,dirname as d6,isAbsolute as DG,join as U8,relative as p6}from"path";var{Glob:g6}=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 kV(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 c6(Q){return Q.startsWith("./")?Q.slice(2):Q}function l6(Q,$){let Y=p6(Q,$);if(Y.length===0)return!0;return!Y.startsWith("..")&&!DG(Y)}function vV(Q){if(Q.isFile())return"file";if(Q.isDirectory())return"directory";if(Q.isSymbolicLink())return"symlink";return"other"}function x2(Q){return{entryType:vV(Q),device:String(Q.dev),inode:String(Q.ino),mode:String(Q.mode),size:String(Q.size),mtimeMs:String(Q.mtimeMs)}}function PV(Q,$){return Q.entryType===$.entryType&&Q.device===$.device&&Q.inode===$.inode&&Q.mode===$.mode}function xV(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=PV(Q.expectedSnapshot,Y),X=!(Q.compareContent??!0)?!0:xV(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(p6(Q,$)).split("/").filter((H)=>H.length>0),X=Q;for(let H of J){X=U8(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 g6(c6(q))}catch{throw p("validate",`Invalid project overlay policy at ${Q}: ${$} contains invalid glob pattern "${q}"`)}}async function yV(Q){if(!Q)return{include:[],exclude:[]};let $=U8(Q,c0),Y=await hV(Q,$);if(!Y)return{include:[],exclude:[]};let q;try{q=await DV(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 ${$}: ${kV(J)}`);if(!X||typeof X!=="object"||Array.isArray(X))throw p("validate",`Invalid project overlay policy at ${$}: root must be an object`);let H=CV.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 hV(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(!l6(q,J))throw p("validate",`Symlink escapes project overlay policy scope: ${$}`);return J}function fV(Q,$){for(let Y of $.include)if(new g6(c6(Y)).match(Q))return!0;for(let Y of $.exclude)if(new g6(c6(Y)).match(Q))return!1;return!0}function uV(Q,$){return Q.filter((Y)=>fV(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(!l6(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=U8($,K),z=Y7(U8(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 mV(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 RV){let G=U8(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 gV(Q){let $=d6(Q),Y=bV(Q),q=`${process.pid}-${AV()}`;return U8($,`.${Y}.ocx-tmp-${q}`)}async function cV(Q,$){let Y=gV($);try{await LV(Q,Y),await OV(Y,$)}catch(q){try{await NV(Y)}catch{}throw q}}async function dV(Q,$,Y={}){let q=Y.publishAtomically??cV,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=d6(G);await Y.beforeDestinationParentCreate?.({operation:H,destinationPath:G,destinationParentPath:K}),await $7($,G,H.destinationRelativePath);try{await jV(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 pV(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=U8(Q,q),X=U8($,q);try{await FV(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 IV(Q,{recursive:!0,force:!0})}catch($){throw p("cleanup",`Failed to remove temporary merged config directory ${Q}: ${P1($)}`)}}function lV(Q,$){let Y=Y7(p6(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 iV(Q,$){let Y=$.map((q)=>{if(!q.sourceSnapshot)throw p("validate",`Overlay source snapshot missing for ${q.destinationRelativePath}. ${x8}`);return{sourceRelativePath:lV(Q,q.sourcePath),destinationRelativePath:q.destinationRelativePath,sourceSnapshot:q.sourceSnapshot}});return{version:EV,projectConfigDir:Q,operations:Y}}function nV(){return null}async function oV(Q){let $=Q.manifest.operations.map((Y)=>({sourcePath:V0(Q.manifest.projectConfigDir,Y.sourceRelativePath),destinationRelativePath:Y.destinationRelativePath,sourceSnapshot:Y.sourceSnapshot}));await dV($,Q.mergedConfigDir,Q.copySeams)}async function sV(Q){if(Q.manifest.operations.length===0)return"best-effort-js";let $=Q.nativeHelper??nV();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 oV({manifest:Q.manifest,mergedConfigDir:Q.mergedConfigDir,copySeams:Q.copySeams}),"best-effort-js"}async function rV(Q){let $=d6(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(!l6(Y,q))throw p("validate",`Project .opencode root resolves outside project directory: ${Q}`);return q}function aV(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 wV(U8(TV(),SV)),await pV(Q.profileDir,q);let J="best-effort-js";if($){let H=await rV($),G=await yV(H),K=await mV(H,Q.seams?.collection),W=uV(K,G),z=iV(H,W);J=await sV({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=aV(J);if(q)try{await jG(q)}catch(H){X.message=`${X.message}
|
|
171
|
+
Cleanup warning: ${P1(H)}`}throw X}}var RV,SV="ocx-oc-merged-",EV=1,x8="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",CV;var TG=A(()=>{D0();H8();W0();t();g8();RV=["agent","agents","skill","skills"];CV=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 tV(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 eV(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 QA(Q,$,Y,q){let J=[...Q,...$],X=n4(J),H=new Map;for(let G=J.length-1;G>=0;G--){let K=J[G];if(!K)continue;let W=D2(K);if(!H.has(W))H.set(W,G<Q.length?"profile":"local")}for(let[G,K]of X.entries()){let W=D2(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")){eV($,Y,q,J);return}}if(bG(q,"plugin")){if($.every((X)=>typeof X==="string")&&Y.every((X)=>typeof X==="string")){QA($,Y,q,J);return}}}C2(Y,"local",q,J)}function $A(Q){let $=new Map;return RG({profileValue:Q.profileConfig,localValue:Q.localConfig,pathSegments:[],origins:$}),$}function YA(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 JA(Q){if(Q.startsWith("~"))return!1;if(B0.isAbsolute(Q))return!1;if(qA(Q))return!1;return!0}function XA(Q){let $=YA(Q.value);if(!$)return Q.value;let Y=J7(Q.pathSegments);if(Q.origins.get(Y)!=="profile")return Q.value;if(!JA($))return Q.value;return`{file:${B0.resolve(Q.profileDir,$)}}`}function i6(Q){let{value:$,pathSegments:Y,origins:q,profileDir:J}=Q;if(typeof $==="string")return XA({value:$,pathSegments:Y,origins:q,profileDir:J});if(Array.isArray($))return $.map((X,H)=>i6({value:X,pathSegments:[...Y,H],origins:q,profileDir:J}));if(q7($)){let X={};for(let[H,G]of Object.entries($))X[H]=i6({value:G,pathSegments:[...Y,H],origins:q,profileDir:J});return X}return $}async function HA(Q){let $=M8(Q);if(!$)return{};let Y=B0.join($,w2),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=tV(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 GA(Q){let $=await HA(Q.projectDir),Y=$A({profileConfig:Q.profileConfig,localConfig:$});return i6({value:Q.mergedConfig,pathSegments:[],origins:Y,profileDir:Q.profileDir})}function KA(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 WA(Q){return Q.configBin??Q.envBin??"opencode"}function SG(Q){return Q.includes("/")||Q.includes("\\")}function zA(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 BA(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 _A(Q){let $=Boolean(Q.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:Y,OPENCODE_BIN:q,OCX_CONTEXT:J,OCX_BIN:X,OCX_PROFILE:H,OCX_TITLE_CONTEXT:G,...K}=Q.baseEnv;return{...K,...Q.opencodeBin!==void 0&&{OPENCODE_BIN:Q.opencodeBin},...$&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:Q.configDir??($?f1(Q.profileName):F0()),...Q.configContent&&{OPENCODE_CONFIG_CONTENT:Q.configContent},...$&&{OCX_CONTEXT:"1"},...$&&Q.ocxBin&&{OCX_BIN:Q.ocxBin},...Q.profileName&&{OCX_PROFILE:Q.profileName},...Q.titleContext&&{OCX_TITLE_CONTEXT:JSON.stringify(Q.titleContext)}}}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 GA({mergedConfig:J.opencode,profileConfig:X?.opencode??{},projectDir:Y,profileDir:f1(J.profileName)});let W=Array.isArray(K.instructions)?K.instructions:[],z=[...J.instructions,...W],B=KA(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,c=()=>{if(M)M.kill("SIGINT");else I=130},N=()=>{if(M)M.kill("SIGTERM");else I=143},x=()=>{if(G)m6()};try{if(process.on("SIGINT",c),process.on("SIGTERM",N),process.on("exit",x),I!==null){R=I;return}if(J.profileName)V=await NG({projectDir:Y,profileDir:f1(J.profileName)});if(I!==null){R=I;return}let w=G?await BG(Y):{repoName:null,branch:null};if(I!==null){R=I;return}let b=AG(Y,J.profileName??"default",w),D={mayWriteOscTitle:G&&u6(),baseTitle:b};if(G)VG(),UG(b);if(I!==null){R=I;return}let l=WA({configBin:H?.bin,envBin:process.env.OPENCODE_BIN}),i=Boolean(J.profileName),r=i?zA({configuredBin:l,cwd:Y}):l,J1=i?BA({cwd:Y,inheritedOcxBin:process.env.OCX_BIN}):void 0,S=Z?JSON.stringify(Z):void 0;try{M=Bun.spawn({cmd:[r,...Q],cwd:Y,env:_A({baseEnv:process.env,profileName:J.profileName??void 0,ocxBin:J1,opencodeBin:r,configDir:V?.path,configContent:S,titleContext:D}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(u){throw p("spawn",`Failed to launch OpenCode binary "${l}": ${u instanceof Error?u.message:String(u)}`)}R=await M.exited}catch(w){U=w instanceof Error?w:p("spawn",`OpenCode process failed: ${String(w)}`)}finally{if(process.off("SIGINT",c),process.off("SIGTERM",N),process.off("exit",x),G)m6();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();O2();W0();I3();t();_G();y1();c1();k8();LG();TG()});import{existsSync as i9}from"fs";import{mkdir as n6,mkdtemp as MA,rename as UA,rm as vG,writeFile as VA}from"fs/promises";import{dirname as PG,join as X7,relative as AA}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 LA(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 FA(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=LA(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=AA($,q).replace(/\\/g,"/");if(J==="."||J==="")throw new L(`Invalid embedded target "${Q}": target must resolve to a file path.`);return J}async function o6(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/${
|
|
173
|
+
Use a qualified component reference (e.g., 'my-registry/${Y}') or specify --name to provide a registry alias.`);let K=f1(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:M1({text:`Fetching ${W}...`});B?.start();let Z;try{Z=await N2(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 _1)throw new _1(`Profile component "${W}" not found in registry.
|
|
175
174
|
|
|
176
|
-
Check the component name and ensure the registry is configured.`);throw w}if(
|
|
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
|
|
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:M1({text:"Downloading profile files..."});V?.start();let U=[],R=[];for(let w of M.files){let b=await a8(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 n6(I,{recursive:!0,mode:448});let c=await MA(X7(I,".staging-")),N=!1,x=!1;try{let w=X?null:M1({text:"Writing profile files..."});w?.start();let b=new Map;for(let i of U){let r=S9(i.target,c),J1=X7(c,r);Q9(b,{absolutePath:J1,relativePath:r,content:i.content,source:`${Y}:${i.path}`})}for(let i of R){let r=hG(i.target,c),J1=S9(r,c),S=X7(c,J1);Q9(b,{absolutePath:S,relativePath:J1,content:i.content,source:`${Y}:${i.path}`})}for(let i of b.values()){let r=i.absolutePath,J1=PG(r);if(!i9(J1))await n6(J1,{recursive:!0});await VA(r,i.content)}w?.succeed(`Wrote ${b.size} profile files`),await N0(c,{version:1,root:K,installed:{}});let D=X?null:M1({text:"Moving to profile directory..."});D?.start();let l=PG(K);if(!i9(l))await n6(l,{recursive:!0,mode:448});if(await UA(c,K),N=!0,D?.succeed("Profile installed"),Z.dependencies.length>0){let i=X?null:M1({text:"Installing dependencies..."});i?.start();let r=Z.dependencies.map((S)=>S.includes("/")?S:`${G}/${S}`),J1={};try{let S=X7(K,"ocx.jsonc");if(i9(S)){let C=await Bun.file(S).text(),e=O1(C),o=K8.safeParse(e);if(o.success)J1=o.data.registries??{};else if(J0(e)&&"registries"in e)throw new h(`Invalid registries in profile "${q}": ${o.error.message}`)}await k6(r,{profile:q,quiet:X},{cwd:K,getRegistries:()=>J1,getComponentPath:()=>""}),i?.succeed(`Installed ${Z.dependencies.length} dependencies`)}catch(S){if(i?.fail("Failed to install dependencies"),S instanceof I1){let u=FA({error:S,depRefs:r,namespace:G,component:Y,registryUrl:J,profileRegistries:J1});throw yG(S,{registryContext:"dependency",registryName:u.registryName,qualifiedName:u.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:u.fallbackUrl})}throw S}}if(x=!0,!X){_.info(""),_.success(`Installed profile "${q}" from ${W}`),_.info(""),_.info("Profile contents:");for(let i of U)_.info(` ${i.target}`);for(let i of R){let r=hG(i.target,K);_.info(` ${r}`)}}}catch(w){let b=[];try{if(i9(c))await vG(c,{recursive:!0})}catch(D){b.push(xG("Profile add rollback cleanup warning: failed to remove staging directory",c,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();t8();q0();b9();g0();g4();t();c1();g8();P3();l0();v6()});function jA(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 wA(){let Q="global ocx config";try{let $=await vJ();Q=$.path;let Y=$.content,q=O1(Y,[],{allowTrailingComma:!0});return K8.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
|
|
179
|
+
Check the file for syntax errors or run: ocx config edit --global`);throw $}}async function DA(Q){let $;try{$=await wA()}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
|
-
${
|
|
184
|
-
Run: ocx registry add <url> --name ${
|
|
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 ${
|
|
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(
|
|
192
|
+
`).action(async($,Y)=>{try{let q=await OA($,Y);if(Y.json)F1({success:!0,data:q})}catch(q){s(q,{json:Y.json})}})}async function OA(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(
|
|
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 ${
|
|
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 ${
|
|
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 ${
|
|
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 ${
|
|
207
|
+
ocx profile add ${Q} --source <namespace/component> --from <registry-url> --global`}throw new L(`Invalid option: --from requires --source.
|
|
209
208
|
|
|
210
|
-
${
|
|
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 ${
|
|
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 ${
|
|
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(!
|
|
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(
|
|
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(
|
|
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 ${
|
|
228
|
+
ocx profile add ${Q} --global`);let q="global",J=await u1.requireInitialized();if($.clone)return await NA(J,Q,$.clone,Y),{name:Q,scope:q,mode:"clone",cloneFrom:$.clone};if($.source){let{namespace:X,component:H}=jA($.source),G;if($.from)G=g1($.from.trim()),await o6({namespace:X,component:H,profileName:Q,registryUrl:G,quiet:Y});else G=(await DA(X)).registryUrl,await o6({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 IA(J,Q,Y),{name:Q,scope:q,mode:"empty"}}async function IA(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 NA(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 B1)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 RJ(X,H),!q)_.success(`Created global profile "${$}" (cloned from "${Y}")`)}var gG=A(()=>{D0();j3();t0();W0();b9();t();y1();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 TA($)}catch(Y){s(Y,{json:$.json})}})}async function TA(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
|
|
230
|
+
ocx profile list --global`);let Y=await(await u1.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();y1();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 bA($,Y,q);if(q.json)F1({success:!0,data:J})}catch(J){s(J,{json:q.json})}})}async function bA(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 ${
|
|
232
|
+
ocx profile move ${Q} ${$} --global`);let q=await u1.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();y1();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 RA($,Y);if(Y.json)F1({success:!0,data:q})}catch(q){s(q,{json:Y.json})}})}async function RA(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
|
|
234
|
+
ocx profile remove <name> --global`);let Y=await u1.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();y1();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 SA($,Y)}catch(q){s(q,{json:Y.json})}})}async function SA(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
|
|
238
|
-
Files:`),console.log(` ocx.jsonc: ${
|
|
239
|
-
OCX Config:`),console.log(JSON.stringify(
|
|
240
|
-
|
|
236
|
+
ocx profile show [name] --global`);let Y=await u1.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: ${o8(q)}`);console.log(`
|
|
238
|
+
OCX Config:`),console.log(JSON.stringify(J.ocx,null,2))}var sG=A(()=>{t0();W0();t();y1();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 EA}from"fs";import{dirname as tG,join as eG}from"path";async function kA(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=vA(H,J),{fetchRegistryIndex:W}=await Promise.resolve().then(() => (t8(),XX));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 vA(Q,$){for(let[Y,q]of Object.entries(Q))if(g1(q.url)===$)return{name:Y,config:q};return null}async function PA(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 xA(Q){let $=Q.getRegistries(),Y=Q.isLocked?.()??!1;return{registries:Object.entries($).map(([J,X])=>({name:J,url:X.url})),locked:Y}}async function s6(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 u1.requireInitialized()).exists(Q.profile))throw new C1(Q.profile);let H=K0(Q.profile);if(!EA(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=F0();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 s6(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 kA(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 s6(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 PA(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 s6(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=xA({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(()=>{W8();t0();W0();q0();e8();t();y1();c1();k8();d0()});function CA(Q){return Q.includes("/")&&!Q.includes("::")}function yA(Q){try{let{namespace:$,component:Y}=m0(Q);return{registryName:$,componentName:Y}}catch($){throw new L($ instanceof Error?$.message:`Invalid component ref: '${Q}'`)}}function hA(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
|
|
244
|
-
Run 'ocx search --installed' to see installed components.`}function
|
|
245
|
-
`);if(
|
|
246
|
-
${
|
|
247
|
-
${
|
|
248
|
-
${
|
|
249
|
-
`)}`:"",
|
|
250
|
-
${
|
|
251
|
-
`)}`:"",
|
|
252
|
-
`);throw new
|
|
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: ${
|
|
256
|
-
`)){let
|
|
242
|
+
Use one of the canonical IDs above.`}function fA(Q){return`Component '${Q}' is not installed.
|
|
243
|
+
Run 'ocx search --installed' to see installed components.`}function uA(Q,$){let Y=Object.keys($.installed);if($.installed[Q])return Q;if(CA(Q)){let{registryName:q,componentName:J}=yA(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(hA(Q,X))}throw new _1(fA(Q))}function H7(Q,$){return Q.map((Y)=>uA(Y,$))}var r6=A(()=>{g0();t();y9()});import{realpathSync as YK}from"fs";import{rm as mA}from"fs/promises";import{sep as gA}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($+gA))throw new L("Security violation: path escapes project directory");return{path:Y,targetReal:J}}function cA(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 dA(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 pA(Y,q)}catch(J){s(J,{json:q.json})}})}async function pA(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 _1("No components installed.");let X=dA(H7(Q,J)),H=$.quiet?null:M1({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(c){if(c instanceof e1)throw new L(`Security violation in receipt for '${M}': ${c.message}`);throw c}}let R=await T2(q.cwd,V);if(!R.intact){B=!0;let I=R.modified.map((c)=>` - ${c}`).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=cA(q.cwd,Z,U);if(!R){if($.verbose)_.info(` \u2298 Skipped ${U.path} (not found)`);continue}if(await mA(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(()=>{k9();q0();r6();e8();t();y1();c1();g8();y9();d0();l0()});var GK=L8((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),m=f.bitflags,y=f.containsSpace,k=z(v?.threshold||0),n=v?.limit||e,g=0,K1=0,X1=O.length;function G0(y8){if(g<n)W9.add(y8),++g;else if(++K1,y8._score>W9.peek()._score)W9.replaceTop(y8)}if(v?.key){var r1=v.key;for(var W1=0;W1<X1;++W1){var $0=O[W1],V1=E($0,r1);if(!V1)continue;if(!C(V1))V1=Z(V1);if((m&V1._bitflags)!==m)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 V8=v.keys,w0=V8.length;Q:for(var W1=0;W1<X1;++W1){var $0=O[W1];{var a1=0;for(var H1=0;H1<w0;++H1){var r1=V8[H1],V1=E($0,r1);if(!V1){S[H1]=H0;continue}if(!C(V1))V1=Z(V1);S[H1]=V1,a1|=V1._bitflags}if((m&a1)!==m)continue}if(y)for(let A1=0;A1<f.spaceSearches.length;A1++)r[A1]=o;for(var H1=0;H1<w0;++H1){if(V1=S[H1],V1===H0){u[H1]=H0;continue}if(u[H1]=U(f,V1,!1,y),u[H1]===$1){u[H1]=H0;continue}if(y)for(let w1=0;w1<f.spaceSearches.length;w1++){if(J1[w1]>-1000){if(r[w1]>o){var o1=(r[w1]+J1[w1])/4;if(o1>r[w1])r[w1]=o1}}if(J1[w1]>r[w1])r[w1]=J1[w1]}}if(y){for(let A1=0;A1<f.spaceSearches.length;A1++)if(r[A1]===o)continue Q}else{var Y1=!1;for(let A1=0;A1<w0;A1++)if(u[A1]._score!==o){Y1=!0;break}if(!Y1)continue}var _0=new G(w0);for(let A1=0;A1<w0;A1++)_0[A1]=u[A1];if(y){var p1=0;for(let A1=0;A1<f.spaceSearches.length;A1++)p1+=r[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 W1=0;W1<X1;++W1){var V1=O[W1];if(!V1)continue;if(!C(V1))V1=Z(V1);if((m&V1._bitflags)!==m)continue;var j1=U(f,V1);if(j1===$1)continue;if(j1._score<k)continue;G0(j1)}if(g===0)return D1;var A8=Array(g);for(var W1=g-1;W1>=0;--W1)A8[W1]=W9.poll();return A8.total=g+K1,A8},q=(T,O="<b>",v="</b>")=>{var f=typeof O==="function"?O:void 0,m=T.target,y=m.length,k=T.indexes,n="",g=0,K1=0,X1=!1,G0=[];for(var r1=0;r1<y;++r1){var W1=m[r1];if(k[K1]===r1){if(++K1,!X1)if(X1=!0,f)G0.push(n),n="";else n+=O;if(K1===k.length){if(f)n+=W1,G0.push(f(n,g++)),n="",G0.push(m.substr(r1+1));else n+=W1+v+m.substr(r1+1);break}}else if(X1)if(X1=!1,f)G0.push(f(n,g++)),n="";else n+=v;n+=W1}return f?G0:n},J=(T)=>{if(typeof T==="number")T=""+T;else if(typeof T!=="string")T="";var O=c(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=c(T),v=[];if(O.containsSpace){var f=T.split(/\s+/);f=[...new Set(f)];for(var m=0;m<f.length;m++){if(f[m]==="")continue;var y=c(f[m]);v.push({lowerCodes:y.lowerCodes,_lower:f[m].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 m=0;m<T.length;m++){var y=T[m],k=E(y,O.key);if(k==$1)continue;if(!C(k))k=Z(k);var n=K(k.target,{_score:k._score,obj:y});if(v.push(n),v.length>=f)return v}else if(O?.keys)for(var m=0;m<T.length;m++){var y=T[m],g=new G(O.keys.length);for(var K1=O.keys.length-1;K1>=0;--K1){var k=E(y,O.keys[K1]);if(!k){g[K1]=H0;continue}if(!C(k))k=Z(k);k._score=o,k._indexes.len=0,g[K1]=k}if(g.obj=y,g._score=o,v.push(g),v.length>=f)return v}else for(var m=0;m<T.length;m++){var k=T[m];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:m,lowerCodes:y}=T,k=y[0],n=O._targetLowerCodes,g=y.length,K1=n.length,W1=0,X1=0,G0=0;for(;;){var r1=k===n[X1];if(r1){if(D[G0++]=X1,++W1,W1===g)break;k=y[W1]}if(++X1,X1>=K1)return $1}var W1=0,$0=!1,V1=0,j1=O._nextBeginningIndexes;if(j1===$1)j1=O._nextBeginningIndexes=x(O.target);X1=D[0]===0?0:j1[D[0]-1];var V8=0;if(X1!==K1)for(;;)if(X1>=K1){if(W1<=0)break;if(++V8,V8>200)break;--W1;var w0=l[--V1];X1=j1[w0]}else{var r1=y[W1]===n[X1];if(r1){if(l[V1++]=X1,++W1,W1===g){$0=!0;break}++X1}else X1=j1[X1]}var a1=g<=1?-1:O._targetLower.indexOf(m,D[0]),H1=!!~a1,o1=!H1?!1:a1===0||O._nextBeginningIndexes[a1-1]===a1;if(H1&&!o1)for(var Y1=0;Y1<j1.length;Y1=j1[Y1]){if(Y1<=a1)continue;for(var _0=0;_0<g;_0++)if(y[_0]!==O._targetLowerCodes[Y1+_0])break;if(_0===g){a1=Y1,o1=!0;break}}var p1=(A1)=>{var w1=0,z5=0;for(var $8=1;$8<g;++$8)if(A1[$8]-A1[$8-1]!==1)w1-=A1[$8],++z5;var GW=A1[g-1]-A1[0]-(g-1);if(w1-=(12+GW)*z5,A1[0]!==0)w1-=A1[0]*A1[0]*0.2;if(!$0)w1*=1000;else{var L7=1;for(var $8=j1[0];$8<K1;$8=j1[$8])++L7;if(L7>24)w1*=(L7-24)*10}if(w1-=(K1-g)/2,H1)w1/=1+g*g*1;if(o1)w1/=1+g*g*1;return w1-=(K1-g)/2,w1};if(!$0){if(H1)for(var Y1=0;Y1<g;++Y1)D[Y1]=a1+Y1;var A8=D,y8=p1(A8)}else if(o1){for(var Y1=0;Y1<g;++Y1)D[Y1]=a1+Y1;var A8=D,y8=p1(D)}else var A8=l,y8=p1(l);O._score=y8;for(var Y1=0;Y1<g;++Y1)O._indexes[Y1]=A8[Y1];O._indexes.len=g;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,m=0,y=$1,k=0,n=T.spaceSearches,g=n.length,K1=0,X1=()=>{for(let o1=K1-1;o1>=0;o1--)O._nextBeginningIndexes[i[o1*2+0]]=i[o1*2+1]},G0=!1;for(var H1=0;H1<g;++H1){J1[H1]=o;var r1=n[H1];if(y=U(r1,O),v){if(y===$1)continue;G0=!0}else if(y===$1)return X1(),$1;var W1=H1===g-1;if(!W1){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,V8=O._nextBeginningIndexes[j1-1];for(let Y1=j1-1;Y1>=0;Y1--){if(V8!==O._nextBeginningIndexes[Y1])break;O._nextBeginningIndexes[Y1]=j1,i[K1*2+0]=Y1,i[K1*2+1]=V8,K1++}}}if(m+=y._score/g,J1[H1]=y._score/g,y._indexes[0]<k)m-=(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;X1();var a1=U(T,O,!0);if(a1!==$1&&a1._score>m){if(v)for(var H1=0;H1<g;++H1)J1[H1]=a1._score/g;return a1}if(v)y=O;y._score=m;var H1=0;for(let o1 of f)y._indexes[H1++]=o1;return y._indexes.len=H1,y},I=(T)=>T.replace(/\p{Script=Latin}+/gu,(O)=>O.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),c=(T)=>{T=I(T);var O=T.length,v=T.toLowerCase(),f=[],m=0,y=!1;for(var k=0;k<O;++k){var n=f[k]=v.charCodeAt(k);if(n===32){y=!0;continue}var g=n>=97&&n<=122?n-97:n>=48&&n<=57?26:n<=127?30:31;m|=1<<g}return{lowerCodes:f,bitflags:m,containsSpace:y,_lower:v}},N=(T)=>{var O=T.length,v=[],f=0,m=!1,y=!1;for(var k=0;k<O;++k){var n=T.charCodeAt(k),g=n>=65&&n<=90,K1=g||n>=97&&n<=122||n>=48&&n<=57,X1=g&&!m||!y||!K1;if(m=g,y=K1,X1)v[f++]=k}return v},x=(T)=>{T=I(T);var O=T.length,v=N(T),f=[],m=v[0],y=0;for(var k=0;k<O;++k)if(m>k)f[k]=m;else m=v[++y],f[k]=m===void 0?O:m;return f},w=new Map,b=new Map,D=[],l=[],i=[],r=[],J1=[],S=[],u=[],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 m=f.length,y=-1;while(T&&++y<m)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={},m=(y)=>{for(var k=0,n=O[k],g=1;g<v;){var K1=g+1;k=g,K1<v&&O[K1]._score<O[g]._score&&(k=K1),O[k-1>>1]=O[k],g=1+(k<<1)}for(var X1=k-1>>1;k>0&&n._score<O[X1]._score;X1=(k=X1)-1>>1)O[k]=O[X1];O[k]=n};return f.add=(y)=>{var k=v;O[v++]=y;for(var n=k-1>>1;k>0&&y._score<O[n]._score;n=(k=n)-1>>1)O[k]=O[n];O[k]=y},f.poll=(y)=>{if(v!==0){var k=O[0];return O[0]=O[--v],m(),k}},f.peek=(y)=>{if(v!==0)return O[0]},f.replaceTop=(y)=>{O[0]=y,m()},f},W9=A7();return{single:$,go:Y,prepare:J,cleanup:X}})});var WK={};F8(WK,{runSearchCore:()=>KK,runSearchCommandAction:()=>lA});async function lA(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=M1({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=a6.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 a6;var zK=A(()=>{W8();k9();O2();t8();k4();c1();l0();a6=B5(GK(),1)});function iA(Q){let $=parseInt(Q,10);if(Number.isNaN($)||$<=0)throw new LJ("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(iA));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();y1();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(nA())return"curl";let Q=process.argv[1]??"";if(oA(Q))return"unknown";if(sA(Q))return"yarn";if(rA(Q))return"pnpm";if(aA(Q))return"bun";if(tA(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 nA=()=>Bun.main.startsWith("/$bunfs/"),oA=(Q)=>Q.includes("/_npx/")||Q.includes("/.cache/bunx/")||Q.includes("/.pnpm/_temp/"),sA=(Q)=>Q.includes("/.yarn/global")||Q.includes("/.config/yarn/global"),rA=(Q)=>Q.includes("/.pnpm/")||Q.includes("/pnpm/global"),aA=(Q)=>Q.includes("/.bun/bin")||Q.includes("/.bun/install/global"),tA=(Q)=>Q.includes("/.npm/")||Q.includes("/node_modules/");var W7=A(()=>{t()});import{existsSync as e6,lstatSync as VK,readdirSync as eA,realpathSync as MK,rmSync as QL,unlinkSync as AK}from"fs";import{homedir as LK}from"os";import i0 from"path";function t6(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 Q5(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 $L(Q,$){return B7(Q,$)!==null}function YL(Q,$){if(!e6($))return{contained:!0};try{let Y=MK(Q),q=MK($);return{contained:B7(Y,q)!==null}}catch(Y){if(Q5(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(Q5($)){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(!e6(Q))return"missing";try{let $=VK(Q);if($.isSymbolicLink())return"symlink";if($.isDirectory())return"directory";return"file"}catch{return"missing"}}function qL(Q){if(!e6(Q))return!0;try{return eA(Q).length===0}catch{return!1}}function UK(Q){if(Q.kind==="missing")return"safe";if(Q.kind==="symlink")return $L(Q.rootPath,Q.absolutePath)?"safe":"forbidden";let $=YL(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 $5(){let Q=process.env.XDG_CONFIG_HOME||i0.join(LK(),".config");return i0.join(Q,"opencode")}function jK(){let Q=$5(),$=[],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=P9(),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 JL(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")QL(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=Q5($)&&($.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(JL)}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 XL(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 HL(Q,$){if(Q.filter((q)=>q.kind!=="missing").length>0||$&&$.kind!=="missing")_.info("Removing OCX files...")}function GL(Q,$,Y){_.break();for(let q of Q){if(q.skipped){if(q.reason==="not found")continue;if(q.reason==="not empty"){_.info(`Kept ${L0.path(q.target.displayPath)} (not empty)`);continue}if(q.reason==="permission denied"){_.warn(`Skipped ${L0.path(q.target.displayPath)} (permission denied)`);continue}if(q.reason==="containment violation"){_.warn(`Skipped ${L0.path(q.target.displayPath)} (containment violation)`);continue}}if(q.success)_.success(`Removed ${L0.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 ${L0.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(` ${L0.command(_7(Y))}`)}function KL(){_.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 WL(Q){let $=$5(),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 t6({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},d1.SUCCESS);if(Q.dryRun){let{dryRunResult:I,hints:c}=IK(q,G,H);return t6({...I,...c.length>0&&{hints:c}},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 t6({removed:U,skipped:R,installMethod:H},d1.SUCCESS)}async function zL(Q){if(Q.json){await WL(Q);return}let $=$5(),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)KL(),process.exit(d1.SUCCESS);if(Q.dryRun)XL(q,G,H),process.exit(d1.SUCCESS);HL(q,G);let B=DK(q),Z=null;if(G)Z=OK(G.absolutePath);GL(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 zL($)}catch(Y){s(Y,{json:$.json})}})}var d1;var TK=A(()=>{W0();W7();e8();y1();c1();d1={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class bK{version="2.0.8"}var RK;var SK=A(()=>{RK=new bK});var kK={};F8(kK,{checkForUpdate:()=>q5,EXPLICIT_UPDATE_TIMEOUT_MS:()=>Y5});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 q5(Q,$=BL){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(_L,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 BL=200,Y5=1e4,_L="ocx";var J5=A(()=>{t();X6();SK()});import{chmodSync as ML,existsSync as G9,renameSync as X5,unlinkSync as Z7}from"fs";function AL(){let Q=process.env.OCX_DOWNLOAD_URL;if(Q)return Q.replace(/\/+$/,"");return VL}function H5(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`${AL()}/v${Q}/${Y}`}async function LL(Q,$,Y={}){let q=Y.quiet?null:M1({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=H5(Q);await LL(J,q,$);try{ML(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($))X5($,Y);if(X5(Q,$),G9(Y))Z7(Y)}catch(q){if(G9(Y)&&!G9($))try{X5(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 UL="kdcokenny/ocx",VL,vK;var yK=A(()=>{t();l0();W7();VL=`https://github.com/${UL}/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={};F8(hK,{notifyUpdated:()=>M7,notifyUpdate:()=>FL,notifyUpToDate:()=>G5});function FL(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 G5(Q){console.error(`${P.cyan("info")}: ocx unchanged - ${P.dim(Q)}`)}function M7(Q,$){console.error(` ${P.green("ocx updated")} - ${$} (from ${Q})`)}var K5=A(()=>{W8()});import{createHash as jL}from"crypto";function DL(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 OL(Q){return jL("sha256").update(Q).digest("hex")}async function fK(Q){let $=`https://github.com/${wL}/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 DL(q)}async function uK(Q,$,Y){let J=await Bun.file(Q).arrayBuffer(),X=OL(Buffer.from(J));if(X!==$)throw new m8(Y,$,X)}var wL="kdcokenny/ocx";var mK=A(()=>{t()});var gK={};F8(gK,{runSelfUpdateCommand:()=>TL});async function TL(Q){let $=Q.method?ZK(Q.method):n9(),Y=Q.json===!0,q=await q5(void 0,Y5);if(!q.ok)throw new x1(NL[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 G5(J);return}let G=X;switch($){case"curl":{await bL(J,G,Y);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await RL($,J,G,Y);break}}if(Y)F1({success:!0,data:{current:J,latest:G,method:$,updated:!0}})}async function bL(Q,$,Y){let J=H5($).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 RL(Q,$,Y,q){if(!IL.test(Y))throw new x1(`Invalid version format: ${Y}`);let J=q?null:M1({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(
|
|
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 IL,NL;var cK=A(()=>{J5();W7();yK();K5();mK();t();l0();IL=/^\d+\.\d+\.\d+(-[\w.]+)?$/,NL={"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(()=>{y1()});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 SL,rename as EL,rm as V7,stat as kL,writeFile as vL}from"fs/promises";import{dirname as PL,join as xL}from"path";function W5(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 CL(Y,q)}catch(J){s(J,{json:q.json})}})}async function CL(Q,$){let Y=$.cwd??process.cwd(),q=$.global?await E9.requireInitialized():await b0.requireInitialized(Y);await yL(Q,$,q)}async function yL(Q,$,Y,q){let J=Y.getRegistries(),X=Y.getComponentPath(),H=X===""||X===".",G=Q.map(fL),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 _1(`Component '${N}' is not installed. Run '${W5(N,$)}' first.`)}throw new _1(`No components installed. Run '${W5("<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(
|
|
265
|
-
Use either 'ocx update --all' or 'ocx update <components>'.`);if(
|
|
266
|
-
Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(
|
|
267
|
-
Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let
|
|
268
|
-
Use '${
|
|
269
|
-
`+
|
|
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=uL(K,G,$);if(Z.length===0){if(B)throw new _1(`No installed components from registry '${$.registry}'.`);throw new _1("No matching components found to update.")}let M=$.quiet?null:M1({text:"Checking for updates..."});M?.start();let V=null,U="check",R=null,I=[],c=[];try{for(let w of Z){let b=w.component,D=K.installed[b];if(!D)throw new _1(`Component '${b}' not found in receipt.`);let{registryName:l,name:i}=D,r=J[l];if(!r)throw new h(`Registry alias '${l}' not configured. Component '${b}' cannot be updated.`);let S=(await E3(r.url,i,void 0)).manifest,u=d8(S),E=[];for(let o of u.files){let D1=await a8(r.url,i,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"}),c.push({canonicalId:b,component:u,files:E,newHash:C,newVersion:e,baseUrl:r.url,registryName:l,name:i})}if(M?.succeed(`Checked ${Z.length} component(s)`),$.dryRun){mL(I,$);return}if(c.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:M1({text:"Updating components..."}),V?.start();let N=new Map,x=[];for(let w of c){let b=[];for(let D of w.files){let l=w.component.files.find((J1)=>J1.path===D.path);if(!l)throw new L(`File "${D.path}" not found in component manifest for "${w.registryName}/${w.name}".`);let i=i8(l.target,H,Y.cwd),r=xL(Y.cwd,i);Q9(N,{absolutePath:r,relativePath:i,content:D.content,source:`${w.registryName}/${w.name}:${l.path}`}),b.push({resolvedTarget:i,targetPath:r,content:D.content})}x.push({update:w,preparedFiles:b})}R=await hL(x,{verbose:$.verbose,quiet:$.quiet,fileOps:q});for(let w of x){let{update:b,preparedFiles:D}=w,l=K.installed[b.canonicalId];if(!l)throw new _1(`Component '${b.canonicalId}' not found in receipt.`);let i=[];for(let r of D)i.push({path:r.resolvedTarget,hash:$9(r.content)});K.installed[b.canonicalId]={registryUrl:l.registryUrl,registryName:l.registryName,name:l.name,revision:b.newVersion,hash:b.newHash,files:i,installedAt:l.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 ${c.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 ${c.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 hL(Q,$){let Y=[],q=new Set,J=!1,X=$.fileOps?.rename??EL,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=PL(W.targetPath);if(!K9(z))await SL(z,{recursive:!0});if(K9(W.targetPath)){if((await kL(W.targetPath)).isDirectory())throw new L(`Cannot update "${W.resolvedTarget}": target path is a directory.`)}let B=`${W.targetPath}.ocx-update-tmp-${nK()}`;await vL(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 fL(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 uL(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
|
|
273
|
-
Run '${
|
|
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 _1(`Component '${H}' is not installed.
|
|
272
|
+
Run '${W5(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 mL(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(()=>{k9();t8();q0();g0();e8();t();y1();c1();k8();P3();y9();d0();l0()});import{resolve as gL}from"path";function cL(Q,$){if($==="not_found")return new _1(Q);if($==="parse_error")return new B1(Q,"CONFIG_ERROR",G1.CONFIG);return new B1(Q,"CONFIG_ERROR",G1.CONFIG)}function dL(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 pL(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=gL(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=cL(X,J.loadErrorKind);if(!Y.json&&Y.quiet){let K=G instanceof B1?G.exitCode:G1.GENERAL;process.exit(K)}throw G}let H=dL(J.errors,J.failureType==="schema"?"schema":"rules");if(Y.json)throw H;if(!Y.quiet)_.error(H.message),pL(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 B1?q.exitCode:G1.GENERAL;process.exit(J)}s(q,{json:Y.json})}})}var tK=A(()=>{W8();P6();t();y1();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 lL(Y,q)}catch(J){s(J,{json:q.json})}})}async function lL(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:M1({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(G1.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(()=>{k9();q0();r6();t();y1();c1();y9();d0();l0()});function iL(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(QJ(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(!iL())return;try{let[{checkForUpdate:J},{notifyUpdate:X}]=await Promise.all([Promise.resolve().then(() => (J5(),kK)),Promise.resolve().then(() => (K5(),hK))]),H=await J();if(H.ok&&H.updateAvailable)X(H.current,H.latest)}catch{}})}var YW=A(()=>{F2()});async function qW(Q=process.argv){let $=new FJ().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(nL);if(eH($),yH($),sK($),BK($),QK($),cH($),aK($),lK($),eK($),JK($),KG($),rG($),sH($),EG($),$W($),Q.length<=2){process.stdout.write($.helpInformation());return}await $.parseAsync(Q)}var nL="2.0.8";var JW=A(()=>{L3();v6();dH();rH();$G();zG();kG();aG();$K();XK();_K();iK();rK();tK();QW();YW()});var XW={};F8(XW,{runCliEntryPoint:()=>oL});async function oL(Q=process.argv){try{await qW(Q)}catch($){s($)}}var HW=A(()=>{y1();JW()});_3();k4();if(import.meta.main)sL();async function sL(){let{runCliEntryPoint:Q}=await Promise.resolve().then(() => (HW(),XW));await Q()}export{p8 as registrySchema,M2 as packumentSchema,M3 as ocxLockSchema,b8 as ocxConfigSchema,c8 as componentManifestSchema,U2 as buildRegistry};
|
|
274
273
|
|
|
275
|
-
//# debugId=
|
|
274
|
+
//# debugId=036B4B03B684F1B764756E2164756E21
|