ocx 2.0.4 → 2.0.6
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 +174 -132
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -1,68 +1,107 @@
|
|
|
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 rW=Object.create;var{getPrototypeOf:oW,defineProperty:v9,getOwnPropertyNames:tW}=Object;var aW=Object.prototype.hasOwnProperty;var _z=($,v,U)=>{U=$!=null?rW(oW($)):{};let Q=v||!$||!$.__esModule?v9(U,"default",{value:$,enumerable:!0}):U;for(let _ of tW($))if(!aW.call(Q,_))v9(Q,_,{get:()=>$[_],enumerable:!0});return Q};var T6=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var s$=($,v)=>{for(var U in v)v9($,U,{get:v[U],enumerable:!0,configurable:!0,set:(Q)=>v[U]=()=>Q})};var b=($,v)=>()=>($&&(v=$($=0)),v);var P1=import.meta.require;function l0($,v=!1){let U=$.length,Q=0,_="",J=0,Y=16,z=0,I=0,X=0,q=0,G=0;function j(O,g){let w=0,N=0;while(w<O||!g){let L=$.charCodeAt(Q);if(L>=48&&L<=57)N=N*16+L-48;else if(L>=65&&L<=70)N=N*16+L-65+10;else if(L>=97&&L<=102)N=N*16+L-97+10;else break;Q++,w++}if(w<O)N=-1;return N}function H(O){Q=O,_="",J=0,Y=16,G=0}function Z(){let O=Q;if($.charCodeAt(Q)===48)Q++;else{Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}if(Q<$.length&&$.charCodeAt(Q)===46)if(Q++,Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++}else return G=3,$.substring(O,Q);let g=Q;if(Q<$.length&&($.charCodeAt(Q)===69||$.charCodeAt(Q)===101)){if(Q++,Q<$.length&&$.charCodeAt(Q)===43||$.charCodeAt(Q)===45)Q++;if(Q<$.length&&x1($.charCodeAt(Q))){Q++;while(Q<$.length&&x1($.charCodeAt(Q)))Q++;g=Q}else G=3}return $.substring(O,g)}function D(){let O="",g=Q;while(!0){if(Q>=U){O+=$.substring(g,Q),G=2;break}let w=$.charCodeAt(Q);if(w===34){O+=$.substring(g,Q),Q++;break}if(w===92){if(O+=$.substring(g,Q),Q++,Q>=U){G=2;break}switch($.charCodeAt(Q++)){case 34:O+='"';break;case 92:O+="\\";break;case 47:O+="/";break;case 98:O+="\b";break;case 102:O+="\f";break;case 110:O+=`
|
|
4
|
+
`;break;case 114:O+="\r";break;case 116:O+="\t";break;case 117:let L=j(4,!0);if(L>=0)O+=String.fromCharCode(L);else G=4;break;default:G=5}g=Q;continue}if(w>=0&&w<=31)if(c0(w)){O+=$.substring(g,Q),G=2;break}else G=6;Q++}return O}function E(){if(_="",G=0,J=Q,I=z,q=X,Q>=U)return J=U,Y=17;let O=$.charCodeAt(Q);if(_9(O)){do Q++,_+=String.fromCharCode(O),O=$.charCodeAt(Q);while(_9(O));return Y=15}if(c0(O)){if(Q++,_+=String.fromCharCode(O),O===13&&$.charCodeAt(Q)===10)Q++,_+=`
|
|
5
|
+
`;return z++,X=Q,Y=14}switch(O){case 123:return Q++,Y=1;case 125:return Q++,Y=2;case 91:return Q++,Y=3;case 93:return Q++,Y=4;case 58:return Q++,Y=6;case 44:return Q++,Y=5;case 34:return Q++,_=D(),Y=10;case 47:let g=Q-1;if($.charCodeAt(Q+1)===47){Q+=2;while(Q<U){if(c0($.charCodeAt(Q)))break;Q++}return _=$.substring(g,Q),Y=12}if($.charCodeAt(Q+1)===42){Q+=2;let w=U-1,N=!1;while(Q<w){let L=$.charCodeAt(Q);if(L===42&&$.charCodeAt(Q+1)===47){Q+=2,N=!0;break}if(Q++,c0(L)){if(L===13&&$.charCodeAt(Q)===10)Q++;z++,X=Q}}if(!N)Q++,G=1;return _=$.substring(g,Q),Y=13}return _+=String.fromCharCode(O),Q++,Y=16;case 45:if(_+=String.fromCharCode(O),Q++,Q===U||!x1($.charCodeAt(Q)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return _+=Z(),Y=11;default:while(Q<U&&A(O))Q++,O=$.charCodeAt(Q);if(J!==Q){switch(_=$.substring(J,Q),_){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return _+=String.fromCharCode(O),Q++,Y=16}}function A(O){if(_9(O)||c0(O))return!1;switch(O){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function r(){let O;do O=E();while(O>=12&&O<=15);return O}return{setPosition:H,getPosition:()=>Q,scan:v?r:E,getToken:()=>Y,getTokenValue:()=>_,getTokenOffset:()=>J,getTokenLength:()=>Q-J,getTokenStartLine:()=>I,getTokenStartCharacter:()=>J-q,getTokenError:()=>G}}function _9($){return $===32||$===9}function c0($){return $===10||$===13}function x1($){return $>=48&&$<=57}var Uz;var J2=b(()=>{(function($){$[$.lineFeed=10]="lineFeed",$[$.carriageReturn=13]="carriageReturn",$[$.space=32]="space",$[$._0=48]="_0",$[$._1=49]="_1",$[$._2=50]="_2",$[$._3=51]="_3",$[$._4=52]="_4",$[$._5=53]="_5",$[$._6=54]="_6",$[$._7=55]="_7",$[$._8=56]="_8",$[$._9=57]="_9",$[$.a=97]="a",$[$.b=98]="b",$[$.c=99]="c",$[$.d=100]="d",$[$.e=101]="e",$[$.f=102]="f",$[$.g=103]="g",$[$.h=104]="h",$[$.i=105]="i",$[$.j=106]="j",$[$.k=107]="k",$[$.l=108]="l",$[$.m=109]="m",$[$.n=110]="n",$[$.o=111]="o",$[$.p=112]="p",$[$.q=113]="q",$[$.r=114]="r",$[$.s=115]="s",$[$.t=116]="t",$[$.u=117]="u",$[$.v=118]="v",$[$.w=119]="w",$[$.x=120]="x",$[$.y=121]="y",$[$.z=122]="z",$[$.A=65]="A",$[$.B=66]="B",$[$.C=67]="C",$[$.D=68]="D",$[$.E=69]="E",$[$.F=70]="F",$[$.G=71]="G",$[$.H=72]="H",$[$.I=73]="I",$[$.J=74]="J",$[$.K=75]="K",$[$.L=76]="L",$[$.M=77]="M",$[$.N=78]="N",$[$.O=79]="O",$[$.P=80]="P",$[$.Q=81]="Q",$[$.R=82]="R",$[$.S=83]="S",$[$.T=84]="T",$[$.U=85]="U",$[$.V=86]="V",$[$.W=87]="W",$[$.X=88]="X",$[$.Y=89]="Y",$[$.Z=90]="Z",$[$.asterisk=42]="asterisk",$[$.backslash=92]="backslash",$[$.closeBrace=125]="closeBrace",$[$.closeBracket=93]="closeBracket",$[$.colon=58]="colon",$[$.comma=44]="comma",$[$.dot=46]="dot",$[$.doubleQuote=34]="doubleQuote",$[$.minus=45]="minus",$[$.openBrace=123]="openBrace",$[$.openBracket=91]="openBracket",$[$.plus=43]="plus",$[$.slash=47]="slash",$[$.formFeed=12]="formFeed",$[$.tab=9]="tab"})(Uz||(Uz={}))});var w4,U9,Qz;var Jz=b(()=>{w4=Array(20).fill(0).map(($,v)=>{return" ".repeat(v)}),U9={" ":{"\n":Array(200).fill(0).map(($,v)=>{return`
|
|
6
|
+
`+" ".repeat(v)}),"\r":Array(200).fill(0).map(($,v)=>{return"\r"+" ".repeat(v)}),"\r\n":Array(200).fill(0).map(($,v)=>{return`\r
|
|
7
|
+
`+" ".repeat(v)})},"\t":{"\n":Array(200).fill(0).map(($,v)=>{return`
|
|
8
|
+
`+"\t".repeat(v)}),"\r":Array(200).fill(0).map(($,v)=>{return"\r"+"\t".repeat(v)}),"\r\n":Array(200).fill(0).map(($,v)=>{return`\r
|
|
9
|
+
`+"\t".repeat(v)})}},Qz=[`
|
|
10
10
|
`,"\r",`\r
|
|
11
|
-
`]});function
|
|
11
|
+
`]});function Q9($,v,U){let Q,_,J,Y,z;if(v){Y=v.offset,z=Y+v.length,J=Y;while(J>0&&!d0($,J-1))J--;let w=z;while(w<$.length&&!d0($,w))w++;_=$.substring(J,w),Q=eW(_,U)}else _=$,Q=0,J=0,Y=0,z=$.length;let I=$b(U,$),X=Qz.includes(I),q=0,G=0,j;if(U.insertSpaces)j=w4[U.tabSize||4]??u1(w4[1],U.tabSize||4);else j="\t";let H=j==="\t"?"\t":" ",Z=l0(_,!1),D=!1;function E(){if(q>1)return u1(I,q)+u1(j,Q+G);let w=j.length*(Q+G);if(!X||w>U9[H][I].length)return I+u1(j,Q+G);if(w<=0)return I;return U9[H][I][w]}function A(){let w=Z.scan();q=0;while(w===15||w===14){if(w===14&&U.keepLines)q+=1;else if(w===14)q=1;w=Z.scan()}return D=w===16||Z.getTokenError()!==0,w}let r=[];function O(w,N,L){if(!D&&(!v||N<z&&L>Y)&&$.substring(N,L)!==w)r.push({offset:N,length:L-N,content:w})}let g=A();if(U.keepLines&&q>0)O(u1(I,q),0,0);if(g!==17){let w=Z.getTokenOffset()+J,N=j.length*Q<20&&U.insertSpaces?w4[j.length*Q]:u1(j,Q);O(N,J,w)}while(g!==17){let w=Z.getTokenOffset()+Z.getTokenLength()+J,N=A(),L="",U$=!1;while(q===0&&(N===12||N===13)){let a=Z.getTokenOffset()+J;O(w4[1],w,a),w=Z.getTokenOffset()+Z.getTokenLength()+J,U$=N===12,L=U$?E():"",N=A()}if(N===2){if(g!==1)G--;if(U.keepLines&&q>0||!U.keepLines&&g!==1)L=E();else if(U.keepLines)L=w4[1]}else if(N===4){if(g!==3)G--;if(U.keepLines&&q>0||!U.keepLines&&g!==3)L=E();else if(U.keepLines)L=w4[1]}else{switch(g){case 3:case 1:if(G++,U.keepLines&&q>0||!U.keepLines)L=E();else L=w4[1];break;case 5:if(U.keepLines&&q>0||!U.keepLines)L=E();else L=w4[1];break;case 12:L=E();break;case 13:if(q>0)L=E();else if(!U$)L=w4[1];break;case 6:if(U.keepLines&&q>0)L=E();else if(!U$)L=w4[1];break;case 10:if(U.keepLines&&q>0)L=E();else if(N===6&&!U$)L="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(U.keepLines&&q>0)L=E();else if((N===12||N===13)&&!U$)L=w4[1];else if(N!==5&&N!==17)D=!0;break;case 16:D=!0;break}if(q>0&&(N===12||N===13))L=E()}if(N===17)if(U.keepLines&&q>0)L=E();else L=U.insertFinalNewline?I:"";let $$=Z.getTokenOffset()+J;O(L,w,$$),g=N}return r}function u1($,v){let U="";for(let Q=0;Q<v;Q++)U+=$;return U}function eW($,v){let U=0,Q=0,_=v.tabSize||4;while(U<$.length){let J=$.charAt(U);if(J===w4[1])Q++;else if(J==="\t")Q+=_;else break;U++}return Math.floor(Q/_)}function $b($,v){for(let U=0;U<v.length;U++){let Q=v.charAt(U);if(Q==="\r"){if(U+1<v.length&&v.charAt(U+1)===`
|
|
12
12
|
`)return`\r
|
|
13
|
-
`;return"\r"}else if(
|
|
13
|
+
`;return"\r"}else if(Q===`
|
|
14
14
|
`)return`
|
|
15
|
-
`}return
|
|
16
|
-
`}function
|
|
17
|
-
`.indexOf(D.charAt(F))!==-1}var B1=V(()=>{m3();B7()});function $7(D,F=[],B=q3.DEFAULT){let $=null,_=[],Q=[];function Y(H){if(Array.isArray(_))_.push(H);else if($!==null)_[$]=H}return _1(D,{onObjectBegin:()=>{let H={};Y(H),Q.push(_),_=H,$=null},onObjectProperty:(H)=>{$=H},onObjectEnd:()=>{_=Q.pop()},onArrayBegin:()=>{let H=[];Y(H),Q.push(_),_=H,$=null},onArrayEnd:()=>{_=Q.pop()},onLiteralValue:Y,onError:(H,J,X)=>{F.push({error:H,offset:J,length:X})}},B),_[0]}function $1(D,F=[],B=q3.DEFAULT){let $={type:"array",offset:-1,length:-1,children:[],parent:void 0};function _(H){if($.type==="property")$.length=H-$.offset,$=$.parent}function Q(H){return $.children.push(H),H}_1(D,{onObjectBegin:(H)=>{$=Q({type:"object",offset:H,length:-1,parent:$,children:[]})},onObjectProperty:(H,J,X)=>{$=Q({type:"property",offset:J,length:-1,parent:$,children:[]}),$.children.push({type:"string",value:H,offset:J,length:X,parent:$})},onObjectEnd:(H,J)=>{_(H+J),$.length=H+J-$.offset,$=$.parent,_(H+J)},onArrayBegin:(H,J)=>{$=Q({type:"array",offset:H,length:-1,parent:$,children:[]})},onArrayEnd:(H,J)=>{$.length=H+J-$.offset,$=$.parent,_(H+J)},onLiteralValue:(H,J,X)=>{Q({type:X_(H),offset:J,length:X,parent:$,value:H}),_(J+X)},onSeparator:(H,J,X)=>{if($.type==="property"){if(H===":")$.colonOffset=J;else if(H===",")_(J)}},onError:(H,J,X)=>{F.push({error:H,offset:J,length:X})}},B);let q=$.children[0];if(q)delete q.parent;return q}function g3(D,F){if(!D)return;let B=D;for(let $ of F)if(typeof $==="string"){if(B.type!=="object"||!Array.isArray(B.children))return;let _=!1;for(let Q of B.children)if(Array.isArray(Q.children)&&Q.children[0].value===$&&Q.children.length===2){B=Q.children[1],_=!0;break}if(!_)return}else{let _=$;if(B.type!=="array"||_<0||!Array.isArray(B.children)||_>=B.children.length)return;B=B.children[_]}return B}function _1(D,F,B=q3.DEFAULT){let $=Q3(D,!1),_=[],Q=0;function Y(v){return v?()=>Q===0&&v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function q(v){return v?(f)=>Q===0&&v(f,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function H(v){return v?(f)=>Q===0&&v(f,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>_.slice()):()=>!0}function J(v){return v?()=>{if(Q>0)Q++;else if(v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>_.slice())===!1)Q=1}:()=>!0}function X(v){return v?()=>{if(Q>0)Q--;if(Q===0)v($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter())}:()=>!0}let z=J(F.onObjectBegin),M=H(F.onObjectProperty),A=X(F.onObjectEnd),K=J(F.onArrayBegin),j=X(F.onArrayEnd),S=H(F.onLiteralValue),R=q(F.onSeparator),s=Y(F.onComment),N=q(F.onError),y=B&&B.disallowComments,O=B&&B.allowTrailingComma;function b(){while(!0){let v=$.scan();switch($.getTokenError()){case 4:L(14);break;case 5:L(15);break;case 3:L(13);break;case 1:if(!y)L(11);break;case 2:L(12);break;case 6:L(16);break}switch(v){case 12:case 13:if(y)L(10);else s();break;case 16:L(1);break;case 15:case 14:break;default:return v}}}function L(v,f=[],_D=[]){if(N(v),f.length+_D.length>0){let r=$.getToken();while(r!==17){if(f.indexOf(r)!==-1){b();break}else if(_D.indexOf(r)!==-1)break;r=b()}}}function e(v){let f=$.getTokenValue();if(v)S(f);else M(f),_.push(f);return b(),!0}function p(){switch($.getToken()){case 11:let v=$.getTokenValue(),f=Number(v);if(isNaN(f))L(2),f=0;S(f);break;case 7:S(null);break;case 8:S(!0);break;case 9:S(!1);break;default:return!1}return b(),!0}function FD(){if($.getToken()!==10)return L(3,[],[2,5]),!1;if(e(!1),$.getToken()===6){if(R(":"),b(),!i())L(4,[],[2,5])}else L(5,[],[2,5]);return _.pop(),!0}function KD(){z(),b();let v=!1;while($.getToken()!==2&&$.getToken()!==17){if($.getToken()===5){if(!v)L(4,[],[]);if(R(","),b(),$.getToken()===2&&O)break}else if(v)L(6,[],[]);if(!FD())L(4,[],[2,5]);v=!0}if(A(),$.getToken()!==2)L(7,[2],[]);else b();return!0}function k(){K(),b();let v=!0,f=!1;while($.getToken()!==4&&$.getToken()!==17){if($.getToken()===5){if(!f)L(4,[],[]);if(R(","),b(),$.getToken()===4&&O)break}else if(f)L(6,[],[]);if(v)_.push(0),v=!1;else _[_.length-1]++;if(!i())L(4,[],[4,5]);f=!0}if(j(),!v)_.pop();if($.getToken()!==4)L(8,[4],[]);else b();return!0}function i(){switch($.getToken()){case 3:return k();case 1:return KD();case 10:return e(!0);default:return p()}}if(b(),$.getToken()===17){if(B.allowEmptyContent)return!0;return L(4,[],[]),!1}if(!i())return L(4,[],[]),!1;if($.getToken()!==17)L(9,[],[]);return!0}function X_(D){switch(typeof D){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!D)return"null";else if(Array.isArray(D))return"array";return"object"}default:return"null"}}var q3;var Q1=V(()=>{m3();(function(D){D.DEFAULT={allowTrailingComma:!1}})(q3||(q3={}))});function _7(D,F,B,$){let _=F.slice(),Y=$1(D,[]),q=void 0,H=void 0;while(_.length>0)if(H=_.pop(),q=g3(Y,_),q===void 0&&B!==void 0)if(typeof H==="string")B={[H]:B};else B=[B];else break;if(!q){if(B===void 0)throw Error("Can not delete in empty document");return P2(D,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(B)},$)}else if(q.type==="object"&&typeof H==="string"&&Array.isArray(q.children)){let J=g3(q,[H]);if(J!==void 0)if(B===void 0){if(!J.parent)throw Error("Malformed AST");let X=q.children.indexOf(J.parent),z,M=J.parent.offset+J.parent.length;if(X>0){let A=q.children[X-1];z=A.offset+A.length}else if(z=q.offset+1,q.children.length>1)M=q.children[1].offset;return P2(D,{offset:z,length:M-z,content:""},$)}else return P2(D,{offset:J.offset,length:J.length,content:JSON.stringify(B)},$);else{if(B===void 0)return[];let X=`${JSON.stringify(H)}: ${JSON.stringify(B)}`,z=$.getInsertionIndex?$.getInsertionIndex(q.children.map((A)=>A.children[0].value)):q.children.length,M;if(z>0){let A=q.children[z-1];M={offset:A.offset+A.length,length:0,content:","+X}}else if(q.children.length===0)M={offset:q.offset+1,length:0,content:X};else M={offset:q.offset+1,length:0,content:X+","};return P2(D,M,$)}}else if(q.type==="array"&&typeof H==="number"&&Array.isArray(q.children)){let J=H;if(J===-1){let X=`${JSON.stringify(B)}`,z;if(q.children.length===0)z={offset:q.offset+1,length:0,content:X};else{let M=q.children[q.children.length-1];z={offset:M.offset+M.length,length:0,content:","+X}}return P2(D,z,$)}else if(B===void 0&&q.children.length>=0){let X=H,z=q.children[X],M;if(q.children.length===1)M={offset:q.offset+1,length:q.length-2,content:""};else if(q.children.length-1===X){let A=q.children[X-1],K=A.offset+A.length,j=q.offset+q.length;M={offset:K,length:j-2-K,content:""}}else M={offset:z.offset,length:q.children[X+1].offset-z.offset,content:""};return P2(D,M,$)}else if(B!==void 0){let X,z=`${JSON.stringify(B)}`;if(!$.isArrayInsertion&&q.children.length>H){let M=q.children[H];X={offset:M.offset,length:M.length,content:z}}else if(q.children.length===0||H===0)X={offset:q.offset+1,length:0,content:q.children.length===0?z:z+","};else{let M=H>q.children.length?q.children.length:H,A=q.children[M-1];X={offset:A.offset+A.length,length:0,content:","+z}}return P2(D,X,$)}else throw Error(`Can not ${B===void 0?"remove":$.isArrayInsertion?"insert":"modify"} Array index ${J} as length is not sufficient`)}else throw Error(`Can not add ${typeof H!=="number"?"index":"property"} to parent of type ${q.type}`)}function P2(D,F,B){if(!B.formattingOptions)return[F];let $=d3(D,F),_=F.offset,Q=F.offset+F.content.length;if(F.length===0||F.content.length===0){while(_>0&&!Y3($,_-1))_--;while(Q<$.length&&!Y3($,Q))Q++}let Y=F1($,{offset:_,length:Q-_},{...B.formattingOptions,keepLines:!1});for(let H=Y.length-1;H>=0;H--){let J=Y[H];$=d3($,J),_=Math.min(_,J.offset),Q=Math.max(Q,J.offset+J.length),Q+=J.content.length-J.length}let q=D.length-($.length-Q)-_;return[{offset:_,length:q,content:$.substring(_,Q)}]}function d3(D,F){return D.substring(0,F.offset)+F.content+D.substring(F.offset+F.length)}var Q7=V(()=>{B1();Q1()});function K2(D){switch(D){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 AF(D,F,B,$){return _7(D,F,B,$)}function jF(D,F){let B=F.slice(0).sort((_,Q)=>{let Y=_.offset-Q.offset;if(Y===0)return _.length-Q.length;return Y}),$=D.length;for(let _=B.length-1;_>=0;_--){let Q=B[_];if(Q.offset+Q.length<=$)D=d3(D,Q);else throw Error("Overlapping edit");$=Q.offset}return D}var Y7,q7,ND,H7;var b0=V(()=>{B1();Q7();m3();Q1();(function(D){D[D.None=0]="None",D[D.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",D[D.UnexpectedEndOfString=2]="UnexpectedEndOfString",D[D.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",D[D.InvalidUnicode=4]="InvalidUnicode",D[D.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",D[D.InvalidCharacter=6]="InvalidCharacter"})(Y7||(Y7={}));(function(D){D[D.OpenBraceToken=1]="OpenBraceToken",D[D.CloseBraceToken=2]="CloseBraceToken",D[D.OpenBracketToken=3]="OpenBracketToken",D[D.CloseBracketToken=4]="CloseBracketToken",D[D.CommaToken=5]="CommaToken",D[D.ColonToken=6]="ColonToken",D[D.NullKeyword=7]="NullKeyword",D[D.TrueKeyword=8]="TrueKeyword",D[D.FalseKeyword=9]="FalseKeyword",D[D.StringLiteral=10]="StringLiteral",D[D.NumericLiteral=11]="NumericLiteral",D[D.LineCommentTrivia=12]="LineCommentTrivia",D[D.BlockCommentTrivia=13]="BlockCommentTrivia",D[D.LineBreakTrivia=14]="LineBreakTrivia",D[D.Trivia=15]="Trivia",D[D.Unknown=16]="Unknown",D[D.EOF=17]="EOF"})(q7||(q7={}));ND=$7;(function(D){D[D.InvalidSymbol=1]="InvalidSymbol",D[D.InvalidNumberFormat=2]="InvalidNumberFormat",D[D.PropertyNameExpected=3]="PropertyNameExpected",D[D.ValueExpected=4]="ValueExpected",D[D.ColonExpected=5]="ColonExpected",D[D.CommaExpected=6]="CommaExpected",D[D.CloseBraceExpected=7]="CloseBraceExpected",D[D.CloseBracketExpected=8]="CloseBracketExpected",D[D.EndOfFileExpected=9]="EndOfFileExpected",D[D.InvalidCommentToken=10]="InvalidCommentToken",D[D.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",D[D.UnexpectedEndOfString=12]="UnexpectedEndOfString",D[D.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",D[D.InvalidUnicode=14]="InvalidUnicode",D[D.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",D[D.InvalidCharacter=16]="InvalidCharacter"})(H7||(H7={}))});var QD,Y1,I,l0=(D)=>{switch(typeof D){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(D)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":if(Array.isArray(D))return I.array;if(D===null)return I.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return I.promise;if(typeof Map<"u"&&D instanceof Map)return I.map;if(typeof Set<"u"&&D instanceof Set)return I.set;if(typeof Date<"u"&&D instanceof Date)return I.date;return I.object;default:return I.unknown}};var H3=V(()=>{(function(D){D.assertEqual=(_)=>{};function F(_){}D.assertIs=F;function B(_){throw Error()}D.assertNever=B,D.arrayToEnum=(_)=>{let Q={};for(let Y of _)Q[Y]=Y;return Q},D.getValidEnumValues=(_)=>{let Q=D.objectKeys(_).filter((q)=>typeof _[_[q]]!=="number"),Y={};for(let q of Q)Y[q]=_[q];return D.objectValues(Y)},D.objectValues=(_)=>{return D.objectKeys(_).map(function(Q){return _[Q]})},D.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let Q=[];for(let Y in _)if(Object.prototype.hasOwnProperty.call(_,Y))Q.push(Y);return Q},D.find=(_,Q)=>{for(let Y of _)if(Q(Y))return Y;return},D.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&Number.isFinite(_)&&Math.floor(_)===_;function $(_,Q=" | "){return _.map((Y)=>typeof Y==="string"?`'${Y}'`:Y).join(Q)}D.joinValues=$,D.jsonStringifyReplacer=(_,Q)=>{if(typeof Q==="bigint")return Q.toString();return Q}})(QD||(QD={}));(function(D){D.mergeShapes=(F,B)=>{return{...F,...B}}})(Y1||(Y1={}));I=QD.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var Z,z_=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")},lD;var c3=V(()=>{H3();Z=QD.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);lD=class lD extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=(B)=>{this.issues=[...this.issues,B]},this.addIssues=(B=[])=>{this.issues=[...this.issues,...B]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(_){return _.message},B={_errors:[]},$=(_)=>{for(let Q of _.issues)if(Q.code==="invalid_union")Q.unionErrors.map($);else if(Q.code==="invalid_return_type")$(Q.returnTypeError);else if(Q.code==="invalid_arguments")$(Q.argumentsError);else if(Q.path.length===0)B._errors.push(F(Q));else{let Y=B,q=0;while(q<Q.path.length){let H=Q.path[q];if(q!==Q.path.length-1)Y[H]=Y[H]||{_errors:[]};else Y[H]=Y[H]||{_errors:[]},Y[H]._errors.push(F(Q));Y=Y[H],q++}}};return $(this),B}static assert(D){if(!(D instanceof lD))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,QD.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},B=[];for(let $ of this.issues)if($.path.length>0){let _=$.path[0];F[_]=F[_]||[],F[_].push(D($))}else B.push(D($));return{formErrors:B,fieldErrors:F}}get formErrors(){return this.flatten()}};lD.create=(D)=>{return new lD(D)}});var M_=(D,F)=>{let B;switch(D.code){case Z.invalid_type:if(D.received===I.undefined)B="Required";else B=`Expected ${D.expected}, received ${D.received}`;break;case Z.invalid_literal:B=`Invalid literal value, expected ${JSON.stringify(D.expected,QD.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:B=`Unrecognized key(s) in object: ${QD.joinValues(D.keys,", ")}`;break;case Z.invalid_union:B="Invalid input";break;case Z.invalid_union_discriminator:B=`Invalid discriminator value. Expected ${QD.joinValues(D.options)}`;break;case Z.invalid_enum_value:B=`Invalid enum value. Expected ${QD.joinValues(D.options)}, received '${D.received}'`;break;case Z.invalid_arguments:B="Invalid function arguments";break;case Z.invalid_return_type:B="Invalid function return type";break;case Z.invalid_date:B="Invalid date";break;case Z.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if(B=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")B=`${B} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)B=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)B=`Invalid input: must end with "${D.validation.endsWith}"`;else QD.assertNever(D.validation);else if(D.validation!=="regex")B=`Invalid ${D.validation}`;else B="Invalid";break;case Z.too_small:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")B=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else B="Invalid input";break;case Z.too_big:if(D.type==="array")B=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")B=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")B=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")B=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")B=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else B="Invalid input";break;case Z.custom:B="Invalid input";break;case Z.invalid_intersection_types:B="Intersection results could not be merged";break;case Z.not_multiple_of:B=`Number must be a multiple of ${D.multipleOf}`;break;case Z.not_finite:B="Number must be finite";break;default:B=F.defaultError,QD.assertNever(D)}return{message:B}},B2;var q1=V(()=>{c3();H3();B2=M_});function A_(D){J7=D}function KF(){return J7}var J7;var l3=V(()=>{q1();J7=B2});function T(D,F){let B=KF(),$=J3({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,B,B===B2?void 0:B2].filter((_)=>!!_)});D.common.issues.push($)}class pD{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let B=[];for(let $ of F){if($.status==="aborted")return l;if($.status==="dirty")D.dirty();B.push($.value)}return{status:D.value,value:B}}static async mergeObjectAsync(D,F){let B=[];for(let $ of F){let _=await $.key,Q=await $.value;B.push({key:_,value:Q})}return pD.mergeObjectSync(D,B)}static mergeObjectSync(D,F){let B={};for(let $ of F){let{key:_,value:Q}=$;if(_.status==="aborted")return l;if(Q.status==="aborted")return l;if(_.status==="dirty")D.dirty();if(Q.status==="dirty")D.dirty();if(_.value!=="__proto__"&&(typeof Q.value<"u"||$.alwaysSet))B[_.value]=Q.value}return{status:D.value,value:B}}}var J3=(D)=>{let{data:F,path:B,errorMaps:$,issueData:_}=D,Q=[...B,..._.path||[]],Y={..._,path:Q};if(_.message!==void 0)return{..._,path:Q,message:_.message};let q="",H=$.filter((J)=>!!J).slice().reverse();for(let J of H)q=J(Y,{data:F,defaultError:q}).message;return{..._,path:Q,message:q}},j_,l,y2=(D)=>({status:"dirty",value:D}),aD=(D)=>({status:"valid",value:D}),p3=(D)=>D.status==="aborted",i3=(D)=>D.status==="dirty",U2=(D)=>D.status==="valid",UF=(D)=>typeof Promise<"u"&&D instanceof Promise;var H1=V(()=>{l3();q1();j_=[];l=Object.freeze({status:"aborted"})});var X7=()=>{};var x;var W7=V(()=>{(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(x||(x={}))});class S0{constructor(D,F,B,$){this._cachedPath=[],this.parent=D,this.data=F,this._path=B,this._key=$}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function DD(D){if(!D)return{};let{errorMap:F,invalid_type_error:B,required_error:$,description:_}=D;if(F&&(B||$))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:_};return{errorMap:(Y,q)=>{let{message:H}=D;if(Y.code==="invalid_enum_value")return{message:H??q.defaultError};if(typeof q.data>"u")return{message:H??$??q.defaultError};if(Y.code!=="invalid_type")return{message:q.defaultError};return{message:H??B??q.defaultError}},description:_}}class BD{get description(){return this._def.description}_getType(D){return l0(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:l0(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new pD,ctx:{common:D.parent.common,data:D.data,parsedType:l0(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(UF(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let B=this.safeParse(D,F);if(B.success)return B.data;throw B.error}safeParse(D,F){let B={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:l0(D)},$=this._parseSync({data:D,path:B.path,parent:B});return G7(B,$)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:l0(D)};if(!this["~standard"].async)try{let B=this._parseSync({data:D,path:[],parent:F});return U2(B)?{value:B.value}:{issues:F.common.issues}}catch(B){if(B?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then((B)=>U2(B)?{value:B.value}:{issues:F.common.issues})}async parseAsync(D,F){let B=await this.safeParseAsync(D,F);if(B.success)return B.data;throw B.error}async safeParseAsync(D,F){let B={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:l0(D)},$=this._parse({data:D,path:B.path,parent:B}),_=await(UF($)?$:Promise.resolve($));return G7(B,_)}refine(D,F){let B=($)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F($);else return F};return this._refinement(($,_)=>{let Q=D($),Y=()=>_.addIssue({code:Z.custom,...B($)});if(typeof Promise<"u"&&Q instanceof Promise)return Q.then((q)=>{if(!q)return Y(),!1;else return!0});if(!Q)return Y(),!1;else return!0})}refinement(D,F){return this._refinement((B,$)=>{if(!D(B))return $.addIssue(typeof F==="function"?F(B,$):F),!1;else return!0})}_refinement(D){return new k0({schema:this,typeName:n.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return N0.create(this,this._def)}nullable(){return _2.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return R0.create(this)}promise(){return m2.create(this,this._def)}or(D){return bF.create([this,D],this._def)}and(D){return ZF.create(this,D,this._def)}transform(D){return new k0({...DD(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new kF({...DD(this._def),innerType:this,defaultValue:F,typeName:n.ZodDefault})}brand(){return new s3({typeName:n.ZodBranded,type:this,...DD(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new IF({...DD(this._def),innerType:this,catchValue:F,typeName:n.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return A3.create(this,D)}readonly(){return TF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function A7(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let B=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${B}`}function C_(D){return new RegExp(`^${A7(D)}$`)}function j7(D){let F=`${M7}T${A7(D)}`,B=[];if(B.push(D.local?"Z?":"Z"),D.offset)B.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${B.join("|")})`,new RegExp(`^${F}$`)}function u_(D,F){if((F==="v4"||!F)&&R_.test(D))return!0;if((F==="v6"||!F)&&S_.test(D))return!0;return!1}function P_(D,F){if(!w_.test(D))return!1;try{let[B]=D.split(".");if(!B)return!1;let $=B.replace(/-/g,"+").replace(/_/g,"/").padEnd(B.length+(4-B.length%4)%4,"="),_=JSON.parse(atob($));if(typeof _!=="object"||_===null)return!1;if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(F&&_.alg!==F)return!1;return!0}catch{return!1}}function y_(D,F){if((F==="v4"||!F)&&N_.test(D))return!0;if((F==="v6"||!F)&&k_.test(D))return!0;return!1}function x_(D,F){let B=(D.toString().split(".")[1]||"").length,$=(F.toString().split(".")[1]||"").length,_=B>$?B:$,Q=Number.parseInt(D.toFixed(_).replace(".","")),Y=Number.parseInt(F.toFixed(_).replace(".",""));return Q%Y/10**_}function VF(D){if(D instanceof ID){let F={};for(let B in D.shape){let $=D.shape[B];F[B]=N0.create(VF($))}return new ID({...D._def,shape:()=>F})}else if(D instanceof R0)return new R0({...D._def,type:VF(D.element)});else if(D instanceof N0)return N0.create(VF(D.unwrap()));else if(D instanceof _2)return _2.create(VF(D.unwrap()));else if(D instanceof i0)return i0.create(D.items.map((F)=>VF(F)));else return D}function X1(D,F){let B=l0(D),$=l0(F);if(D===F)return{valid:!0,data:D};else if(B===I.object&&$===I.object){let _=QD.objectKeys(F),Q=QD.objectKeys(D).filter((q)=>_.indexOf(q)!==-1),Y={...D,...F};for(let q of Q){let H=X1(D[q],F[q]);if(!H.valid)return{valid:!1};Y[q]=H.data}return{valid:!0,data:Y}}else if(B===I.array&&$===I.array){if(D.length!==F.length)return{valid:!1};let _=[];for(let Q=0;Q<D.length;Q++){let Y=D[Q],q=F[Q],H=X1(Y,q);if(!H.valid)return{valid:!1};_.push(H.data)}return{valid:!0,data:_}}else if(B===I.date&&$===I.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}function K7(D,F){return new w2({values:D,typeName:n.ZodEnum,...DD(F)})}function z7(D,F){let B=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof B==="string"?{message:B}:B}function U7(D,F={},B){if(D)return f2.create().superRefine(($,_)=>{let Q=D($);if(Q instanceof Promise)return Q.then((Y)=>{if(!Y){let q=z7(F,$),H=q.fatal??B??!0;_.addIssue({code:"custom",...q,fatal:H})}});if(!Q){let Y=z7(F,$),q=Y.fatal??B??!0;_.addIssue({code:"custom",...Y,fatal:q})}return});return f2.create()}var G7=(D,F)=>{if(U2(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let B=new lD(D.common.issues);return this._error=B,this._error}}}},K_,U_,V_,E_,L_,w_,O_,b_,Z_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",J1,R_,N_,S_,k_,I_,T_,M7="((\\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])))",v_,Z0,E2,L2,LF,x2,X3,wF,OF,f2,V2,p0,W3,R0,ID,bF,$2=(D)=>{if(D instanceof RF)return $2(D.schema);else if(D instanceof k0)return $2(D.innerType());else if(D instanceof NF)return[D.value];else if(D instanceof w2)return D.options;else if(D instanceof SF)return QD.objectValues(D.enum);else if(D instanceof kF)return $2(D._def.innerType);else if(D instanceof wF)return[void 0];else if(D instanceof OF)return[null];else if(D instanceof N0)return[void 0,...$2(D.unwrap())];else if(D instanceof _2)return[null,...$2(D.unwrap())];else if(D instanceof s3)return $2(D.unwrap());else if(D instanceof TF)return $2(D.unwrap());else if(D instanceof IF)return $2(D._def.innerType);else return[]},n3,ZF,i0,G3,z3,h2,EF,RF,NF,w2,SF,m2,k0,N0,_2,kF,IF,M3,f_,s3,A3,TF,h_,n,m_=(D,F={message:`Input not instance of ${D.name}`})=>U7((B)=>B instanceof D,F),V7,E7,g_,d_,L7,c_,l_,p_,i_,n_,s_,a_,o_,r_,t_,e_,DQ,FQ,BQ,$Q,_Q,QQ,YQ,qQ,HQ,JQ,XQ,WQ,GQ,zQ,MQ,AQ,jQ,KQ,UQ=()=>V7().optional(),VQ=()=>E7().optional(),EQ=()=>L7().optional(),LQ,wQ;var w7=V(()=>{c3();l3();W7();H1();H3();K_=/^c[^\s-]{8,}$/i,U_=/^[0-9a-z]+$/,V_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,E_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L_=/^[a-z0-9_-]{21}$/i,w_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,O_=/^[-+]?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)?)??$/,b_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R_=/^(?:(?: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])$/,N_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,S_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,k_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,I_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,v_=new RegExp(`^${M7}$`);Z0=class Z0 extends BD{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==I.string){let _=this._getOrReturnCtx(D);return T(_,{code:Z.invalid_type,expected:I.string,received:_.parsedType}),l}let B=new pD,$=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if(D.data.length<_.value)$=this._getOrReturnCtx(D,$),T($,{code:Z.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="max"){if(D.data.length>_.value)$=this._getOrReturnCtx(D,$),T($,{code:Z.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),B.dirty()}else if(_.kind==="length"){let Q=D.data.length>_.value,Y=D.data.length<_.value;if(Q||Y){if($=this._getOrReturnCtx(D,$),Q)T($,{code:Z.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(Y)T($,{code:Z.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});B.dirty()}}else if(_.kind==="email"){if(!b_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"email",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="emoji"){if(!J1)J1=new RegExp(Z_,"u");if(!J1.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"emoji",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="uuid"){if(!E_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"uuid",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="nanoid"){if(!L_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"nanoid",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid"){if(!K_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"cuid",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cuid2"){if(!U_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"cuid2",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ulid"){if(!V_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"ulid",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="url")try{new URL(D.data)}catch{$=this._getOrReturnCtx(D,$),T($,{validation:"url",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"regex",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="trim")D.data=D.data.trim();else if(_.kind==="includes"){if(!D.data.includes(_.value,_.position))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),B.dirty()}else if(_.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(_.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(_.kind==="startsWith"){if(!D.data.startsWith(_.value))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:{startsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="endsWith"){if(!D.data.endsWith(_.value))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:{endsWith:_.value},message:_.message}),B.dirty()}else if(_.kind==="datetime"){if(!j7(_).test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:"datetime",message:_.message}),B.dirty()}else if(_.kind==="date"){if(!v_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:"date",message:_.message}),B.dirty()}else if(_.kind==="time"){if(!C_(_).test(D.data))$=this._getOrReturnCtx(D,$),T($,{code:Z.invalid_string,validation:"time",message:_.message}),B.dirty()}else if(_.kind==="duration"){if(!O_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"duration",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="ip"){if(!u_(D.data,_.version))$=this._getOrReturnCtx(D,$),T($,{validation:"ip",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="jwt"){if(!P_(D.data,_.alg))$=this._getOrReturnCtx(D,$),T($,{validation:"jwt",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="cidr"){if(!y_(D.data,_.version))$=this._getOrReturnCtx(D,$),T($,{validation:"cidr",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64"){if(!I_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"base64",code:Z.invalid_string,message:_.message}),B.dirty()}else if(_.kind==="base64url"){if(!T_.test(D.data))$=this._getOrReturnCtx(D,$),T($,{validation:"base64url",code:Z.invalid_string,message:_.message}),B.dirty()}else QD.assertNever(_);return{status:B.value,value:D.data}}_regex(D,F,B){return this.refinement(($)=>D.test($),{validation:F,code:Z.invalid_string,...x.errToObj(B)})}_addCheck(D){return new Z0({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...x.errToObj(D)})}url(D){return this._addCheck({kind:"url",...x.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...x.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...x.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...x.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...x.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...x.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...x.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...x.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...x.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...x.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...x.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...x.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...x.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...x.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...x.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...x.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...x.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...x.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...x.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...x.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...x.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...x.errToObj(F)})}nonempty(D){return this.min(1,x.errToObj(D))}trim(){return new Z0({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Z0({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Z0({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};Z0.create=(D)=>{return new Z0({checks:[],typeName:n.ZodString,coerce:D?.coerce??!1,...DD(D)})};E2=class E2 extends BD{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==I.number){let _=this._getOrReturnCtx(D);return T(_,{code:Z.invalid_type,expected:I.number,received:_.parsedType}),l}let B=void 0,$=new pD;for(let _ of this._def.checks)if(_.kind==="int"){if(!QD.isInteger(D.data))B=this._getOrReturnCtx(D,B),T(B,{code:Z.invalid_type,expected:"integer",received:"float",message:_.message}),$.dirty()}else if(_.kind==="min"){if(_.inclusive?D.data<_.value:D.data<=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:Z.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),$.dirty()}else if(_.kind==="max"){if(_.inclusive?D.data>_.value:D.data>=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:Z.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),$.dirty()}else if(_.kind==="multipleOf"){if(x_(D.data,_.value)!==0)B=this._getOrReturnCtx(D,B),T(B,{code:Z.not_multiple_of,multipleOf:_.value,message:_.message}),$.dirty()}else if(_.kind==="finite"){if(!Number.isFinite(D.data))B=this._getOrReturnCtx(D,B),T(B,{code:Z.not_finite,message:_.message}),$.dirty()}else QD.assertNever(_);return{status:$.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,x.toString(F))}gt(D,F){return this.setLimit("min",D,!1,x.toString(F))}lte(D,F){return this.setLimit("max",D,!0,x.toString(F))}lt(D,F){return this.setLimit("max",D,!1,x.toString(F))}setLimit(D,F,B,$){return new E2({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:x.toString($)}]})}_addCheck(D){return new E2({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:x.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:x.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:x.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&QD.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let B of this._def.checks)if(B.kind==="finite"||B.kind==="int"||B.kind==="multipleOf")return!0;else if(B.kind==="min"){if(F===null||B.value>F)F=B.value}else if(B.kind==="max"){if(D===null||B.value<D)D=B.value}return Number.isFinite(F)&&Number.isFinite(D)}};E2.create=(D)=>{return new E2({checks:[],typeName:n.ZodNumber,coerce:D?.coerce||!1,...DD(D)})};L2=class L2 extends BD{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==I.bigint)return this._getInvalidInput(D);let B=void 0,$=new pD;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?D.data<_.value:D.data<=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:Z.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),$.dirty()}else if(_.kind==="max"){if(_.inclusive?D.data>_.value:D.data>=_.value)B=this._getOrReturnCtx(D,B),T(B,{code:Z.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),$.dirty()}else if(_.kind==="multipleOf"){if(D.data%_.value!==BigInt(0))B=this._getOrReturnCtx(D,B),T(B,{code:Z.not_multiple_of,multipleOf:_.value,message:_.message}),$.dirty()}else QD.assertNever(_);return{status:$.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return T(F,{code:Z.invalid_type,expected:I.bigint,received:F.parsedType}),l}gte(D,F){return this.setLimit("min",D,!0,x.toString(F))}gt(D,F){return this.setLimit("min",D,!1,x.toString(F))}lte(D,F){return this.setLimit("max",D,!0,x.toString(F))}lt(D,F){return this.setLimit("max",D,!1,x.toString(F))}setLimit(D,F,B,$){return new L2({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:B,message:x.toString($)}]})}_addCheck(D){return new L2({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:x.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};L2.create=(D)=>{return new L2({checks:[],typeName:n.ZodBigInt,coerce:D?.coerce??!1,...DD(D)})};LF=class LF extends BD{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==I.boolean){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.boolean,received:B.parsedType}),l}return aD(D.data)}};LF.create=(D)=>{return new LF({typeName:n.ZodBoolean,coerce:D?.coerce||!1,...DD(D)})};x2=class x2 extends BD{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==I.date){let _=this._getOrReturnCtx(D);return T(_,{code:Z.invalid_type,expected:I.date,received:_.parsedType}),l}if(Number.isNaN(D.data.getTime())){let _=this._getOrReturnCtx(D);return T(_,{code:Z.invalid_date}),l}let B=new pD,$=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if(D.data.getTime()<_.value)$=this._getOrReturnCtx(D,$),T($,{code:Z.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),B.dirty()}else if(_.kind==="max"){if(D.data.getTime()>_.value)$=this._getOrReturnCtx(D,$),T($,{code:Z.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),B.dirty()}else QD.assertNever(_);return{status:B.value,value:new Date(D.data.getTime())}}_addCheck(D){return new x2({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:x.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:x.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}};x2.create=(D)=>{return new x2({checks:[],coerce:D?.coerce||!1,typeName:n.ZodDate,...DD(D)})};X3=class X3 extends BD{_parse(D){if(this._getType(D)!==I.symbol){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.symbol,received:B.parsedType}),l}return aD(D.data)}};X3.create=(D)=>{return new X3({typeName:n.ZodSymbol,...DD(D)})};wF=class wF extends BD{_parse(D){if(this._getType(D)!==I.undefined){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.undefined,received:B.parsedType}),l}return aD(D.data)}};wF.create=(D)=>{return new wF({typeName:n.ZodUndefined,...DD(D)})};OF=class OF extends BD{_parse(D){if(this._getType(D)!==I.null){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.null,received:B.parsedType}),l}return aD(D.data)}};OF.create=(D)=>{return new OF({typeName:n.ZodNull,...DD(D)})};f2=class f2 extends BD{constructor(){super(...arguments);this._any=!0}_parse(D){return aD(D.data)}};f2.create=(D)=>{return new f2({typeName:n.ZodAny,...DD(D)})};V2=class V2 extends BD{constructor(){super(...arguments);this._unknown=!0}_parse(D){return aD(D.data)}};V2.create=(D)=>{return new V2({typeName:n.ZodUnknown,...DD(D)})};p0=class p0 extends BD{_parse(D){let F=this._getOrReturnCtx(D);return T(F,{code:Z.invalid_type,expected:I.never,received:F.parsedType}),l}};p0.create=(D)=>{return new p0({typeName:n.ZodNever,...DD(D)})};W3=class W3 extends BD{_parse(D){if(this._getType(D)!==I.undefined){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.void,received:B.parsedType}),l}return aD(D.data)}};W3.create=(D)=>{return new W3({typeName:n.ZodVoid,...DD(D)})};R0=class R0 extends BD{_parse(D){let{ctx:F,status:B}=this._processInputParams(D),$=this._def;if(F.parsedType!==I.array)return T(F,{code:Z.invalid_type,expected:I.array,received:F.parsedType}),l;if($.exactLength!==null){let Q=F.data.length>$.exactLength.value,Y=F.data.length<$.exactLength.value;if(Q||Y)T(F,{code:Q?Z.too_big:Z.too_small,minimum:Y?$.exactLength.value:void 0,maximum:Q?$.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:$.exactLength.message}),B.dirty()}if($.minLength!==null){if(F.data.length<$.minLength.value)T(F,{code:Z.too_small,minimum:$.minLength.value,type:"array",inclusive:!0,exact:!1,message:$.minLength.message}),B.dirty()}if($.maxLength!==null){if(F.data.length>$.maxLength.value)T(F,{code:Z.too_big,maximum:$.maxLength.value,type:"array",inclusive:!0,exact:!1,message:$.maxLength.message}),B.dirty()}if(F.common.async)return Promise.all([...F.data].map((Q,Y)=>{return $.type._parseAsync(new S0(F,Q,F.path,Y))})).then((Q)=>{return pD.mergeArray(B,Q)});let _=[...F.data].map((Q,Y)=>{return $.type._parseSync(new S0(F,Q,F.path,Y))});return pD.mergeArray(B,_)}get element(){return this._def.type}min(D,F){return new R0({...this._def,minLength:{value:D,message:x.toString(F)}})}max(D,F){return new R0({...this._def,maxLength:{value:D,message:x.toString(F)}})}length(D,F){return new R0({...this._def,exactLength:{value:D,message:x.toString(F)}})}nonempty(D){return this.min(1,D)}};R0.create=(D,F)=>{return new R0({type:D,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...DD(F)})};ID=class ID extends BD{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=QD.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==I.object){let H=this._getOrReturnCtx(D);return T(H,{code:Z.invalid_type,expected:I.object,received:H.parsedType}),l}let{status:B,ctx:$}=this._processInputParams(D),{shape:_,keys:Q}=this._getCached(),Y=[];if(!(this._def.catchall instanceof p0&&this._def.unknownKeys==="strip")){for(let H in $.data)if(!Q.includes(H))Y.push(H)}let q=[];for(let H of Q){let J=_[H],X=$.data[H];q.push({key:{status:"valid",value:H},value:J._parse(new S0($,X,$.path,H)),alwaysSet:H in $.data})}if(this._def.catchall instanceof p0){let H=this._def.unknownKeys;if(H==="passthrough")for(let J of Y)q.push({key:{status:"valid",value:J},value:{status:"valid",value:$.data[J]}});else if(H==="strict"){if(Y.length>0)T($,{code:Z.unrecognized_keys,keys:Y}),B.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let J of Y){let X=$.data[J];q.push({key:{status:"valid",value:J},value:H._parse(new S0($,X,$.path,J)),alwaysSet:J in $.data})}}if($.common.async)return Promise.resolve().then(async()=>{let H=[];for(let J of q){let X=await J.key,z=await J.value;H.push({key:X,value:z,alwaysSet:J.alwaysSet})}return H}).then((H)=>{return pD.mergeObjectSync(B,H)});else return pD.mergeObjectSync(B,q)}get shape(){return this._def.shape()}strict(D){return x.errToObj,new ID({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,B)=>{let $=this._def.errorMap?.(F,B).message??B.defaultError;if(F.code==="unrecognized_keys")return{message:x.errToObj(D).message??$};return{message:$}}}:{}})}strip(){return new ID({...this._def,unknownKeys:"strip"})}passthrough(){return new ID({...this._def,unknownKeys:"passthrough"})}extend(D){return new ID({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new ID({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:n.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new ID({...this._def,catchall:D})}pick(D){let F={};for(let B of QD.objectKeys(D))if(D[B]&&this.shape[B])F[B]=this.shape[B];return new ID({...this._def,shape:()=>F})}omit(D){let F={};for(let B of QD.objectKeys(this.shape))if(!D[B])F[B]=this.shape[B];return new ID({...this._def,shape:()=>F})}deepPartial(){return VF(this)}partial(D){let F={};for(let B of QD.objectKeys(this.shape)){let $=this.shape[B];if(D&&!D[B])F[B]=$;else F[B]=$.optional()}return new ID({...this._def,shape:()=>F})}required(D){let F={};for(let B of QD.objectKeys(this.shape))if(D&&!D[B])F[B]=this.shape[B];else{let _=this.shape[B];while(_ instanceof N0)_=_._def.innerType;F[B]=_}return new ID({...this._def,shape:()=>F})}keyof(){return K7(QD.objectKeys(this.shape))}};ID.create=(D,F)=>{return new ID({shape:()=>D,unknownKeys:"strip",catchall:p0.create(),typeName:n.ZodObject,...DD(F)})};ID.strictCreate=(D,F)=>{return new ID({shape:()=>D,unknownKeys:"strict",catchall:p0.create(),typeName:n.ZodObject,...DD(F)})};ID.lazycreate=(D,F)=>{return new ID({shape:D,unknownKeys:"strip",catchall:p0.create(),typeName:n.ZodObject,...DD(F)})};bF=class bF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=this._def.options;function $(_){for(let Y of _)if(Y.result.status==="valid")return Y.result;for(let Y of _)if(Y.result.status==="dirty")return F.common.issues.push(...Y.ctx.common.issues),Y.result;let Q=_.map((Y)=>new lD(Y.ctx.common.issues));return T(F,{code:Z.invalid_union,unionErrors:Q}),l}if(F.common.async)return Promise.all(B.map(async(_)=>{let Q={...F,common:{...F.common,issues:[]},parent:null};return{result:await _._parseAsync({data:F.data,path:F.path,parent:Q}),ctx:Q}})).then($);else{let _=void 0,Q=[];for(let q of B){let H={...F,common:{...F.common,issues:[]},parent:null},J=q._parseSync({data:F.data,path:F.path,parent:H});if(J.status==="valid")return J;else if(J.status==="dirty"&&!_)_={result:J,ctx:H};if(H.common.issues.length)Q.push(H.common.issues)}if(_)return F.common.issues.push(..._.ctx.common.issues),_.result;let Y=Q.map((q)=>new lD(q));return T(F,{code:Z.invalid_union,unionErrors:Y}),l}}get options(){return this._def.options}};bF.create=(D,F)=>{return new bF({options:D,typeName:n.ZodUnion,...DD(F)})};n3=class n3 extends BD{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.object)return T(F,{code:Z.invalid_type,expected:I.object,received:F.parsedType}),l;let B=this.discriminator,$=F.data[B],_=this.optionsMap.get($);if(!_)return T(F,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[B]}),l;if(F.common.async)return _._parseAsync({data:F.data,path:F.path,parent:F});else return _._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,B){let $=new Map;for(let _ of F){let Q=$2(_.shape[D]);if(!Q.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let Y of Q){if($.has(Y))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(Y)}`);$.set(Y,_)}}return new n3({typeName:n.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:$,...DD(B)})}};ZF=class ZF extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D),$=(_,Q)=>{if(p3(_)||p3(Q))return l;let Y=X1(_.value,Q.value);if(!Y.valid)return T(B,{code:Z.invalid_intersection_types}),l;if(i3(_)||i3(Q))F.dirty();return{status:F.value,value:Y.data}};if(B.common.async)return Promise.all([this._def.left._parseAsync({data:B.data,path:B.path,parent:B}),this._def.right._parseAsync({data:B.data,path:B.path,parent:B})]).then(([_,Q])=>$(_,Q));else return $(this._def.left._parseSync({data:B.data,path:B.path,parent:B}),this._def.right._parseSync({data:B.data,path:B.path,parent:B}))}};ZF.create=(D,F,B)=>{return new ZF({left:D,right:F,typeName:n.ZodIntersection,...DD(B)})};i0=class i0 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.array)return T(B,{code:Z.invalid_type,expected:I.array,received:B.parsedType}),l;if(B.data.length<this._def.items.length)return T(B,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l;if(!this._def.rest&&B.data.length>this._def.items.length)T(B,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let _=[...B.data].map((Q,Y)=>{let q=this._def.items[Y]||this._def.rest;if(!q)return null;return q._parse(new S0(B,Q,B.path,Y))}).filter((Q)=>!!Q);if(B.common.async)return Promise.all(_).then((Q)=>{return pD.mergeArray(F,Q)});else return pD.mergeArray(F,_)}get items(){return this._def.items}rest(D){return new i0({...this._def,rest:D})}};i0.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new i0({items:D,typeName:n.ZodTuple,rest:null,...DD(F)})};G3=class G3 extends BD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.object)return T(B,{code:Z.invalid_type,expected:I.object,received:B.parsedType}),l;let $=[],_=this._def.keyType,Q=this._def.valueType;for(let Y in B.data)$.push({key:_._parse(new S0(B,Y,B.path,Y)),value:Q._parse(new S0(B,B.data[Y],B.path,Y)),alwaysSet:Y in B.data});if(B.common.async)return pD.mergeObjectAsync(F,$);else return pD.mergeObjectSync(F,$)}get element(){return this._def.valueType}static create(D,F,B){if(F instanceof BD)return new G3({keyType:D,valueType:F,typeName:n.ZodRecord,...DD(B)});return new G3({keyType:Z0.create(),valueType:D,typeName:n.ZodRecord,...DD(F)})}};z3=class z3 extends BD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.map)return T(B,{code:Z.invalid_type,expected:I.map,received:B.parsedType}),l;let $=this._def.keyType,_=this._def.valueType,Q=[...B.data.entries()].map(([Y,q],H)=>{return{key:$._parse(new S0(B,Y,B.path,[H,"key"])),value:_._parse(new S0(B,q,B.path,[H,"value"]))}});if(B.common.async){let Y=new Map;return Promise.resolve().then(async()=>{for(let q of Q){let H=await q.key,J=await q.value;if(H.status==="aborted"||J.status==="aborted")return l;if(H.status==="dirty"||J.status==="dirty")F.dirty();Y.set(H.value,J.value)}return{status:F.value,value:Y}})}else{let Y=new Map;for(let q of Q){let{key:H,value:J}=q;if(H.status==="aborted"||J.status==="aborted")return l;if(H.status==="dirty"||J.status==="dirty")F.dirty();Y.set(H.value,J.value)}return{status:F.value,value:Y}}}};z3.create=(D,F,B)=>{return new z3({valueType:F,keyType:D,typeName:n.ZodMap,...DD(B)})};h2=class h2 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.parsedType!==I.set)return T(B,{code:Z.invalid_type,expected:I.set,received:B.parsedType}),l;let $=this._def;if($.minSize!==null){if(B.data.size<$.minSize.value)T(B,{code:Z.too_small,minimum:$.minSize.value,type:"set",inclusive:!0,exact:!1,message:$.minSize.message}),F.dirty()}if($.maxSize!==null){if(B.data.size>$.maxSize.value)T(B,{code:Z.too_big,maximum:$.maxSize.value,type:"set",inclusive:!0,exact:!1,message:$.maxSize.message}),F.dirty()}let _=this._def.valueType;function Q(q){let H=new Set;for(let J of q){if(J.status==="aborted")return l;if(J.status==="dirty")F.dirty();H.add(J.value)}return{status:F.value,value:H}}let Y=[...B.data.values()].map((q,H)=>_._parse(new S0(B,q,B.path,H)));if(B.common.async)return Promise.all(Y).then((q)=>Q(q));else return Q(Y)}min(D,F){return new h2({...this._def,minSize:{value:D,message:x.toString(F)}})}max(D,F){return new h2({...this._def,maxSize:{value:D,message:x.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}};h2.create=(D,F)=>{return new h2({valueType:D,minSize:null,maxSize:null,typeName:n.ZodSet,...DD(F)})};EF=class EF extends BD{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.function)return T(F,{code:Z.invalid_type,expected:I.function,received:F.parsedType}),l;function B(Y,q){return J3({data:Y,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,KF(),B2].filter((H)=>!!H),issueData:{code:Z.invalid_arguments,argumentsError:q}})}function $(Y,q){return J3({data:Y,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,KF(),B2].filter((H)=>!!H),issueData:{code:Z.invalid_return_type,returnTypeError:q}})}let _={errorMap:F.common.contextualErrorMap},Q=F.data;if(this._def.returns instanceof m2){let Y=this;return aD(async function(...q){let H=new lD([]),J=await Y._def.args.parseAsync(q,_).catch((M)=>{throw H.addIssue(B(q,M)),H}),X=await Reflect.apply(Q,this,J);return await Y._def.returns._def.type.parseAsync(X,_).catch((M)=>{throw H.addIssue($(X,M)),H})})}else{let Y=this;return aD(function(...q){let H=Y._def.args.safeParse(q,_);if(!H.success)throw new lD([B(q,H.error)]);let J=Reflect.apply(Q,this,H.data),X=Y._def.returns.safeParse(J,_);if(!X.success)throw new lD([$(J,X.error)]);return X.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new EF({...this._def,args:i0.create(D).rest(V2.create())})}returns(D){return new EF({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,B){return new EF({args:D?D:i0.create([]).rest(V2.create()),returns:F||V2.create(),typeName:n.ZodFunction,...DD(B)})}};RF=class RF extends BD{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}};RF.create=(D,F)=>{return new RF({getter:D,typeName:n.ZodLazy,...DD(F)})};NF=class NF extends BD{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return T(F,{received:F.data,code:Z.invalid_literal,expected:this._def.value}),l}return{status:"valid",value:D.data}}get value(){return this._def.value}};NF.create=(D,F)=>{return new NF({value:D,typeName:n.ZodLiteral,...DD(F)})};w2=class w2 extends BD{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),B=this._def.values;return T(F,{expected:QD.joinValues(B),received:F.parsedType,code:Z.invalid_type}),l}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),B=this._def.values;return T(F,{received:F.data,code:Z.invalid_enum_value,options:B}),l}return aD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return w2.create(D,{...this._def,...F})}exclude(D,F=this._def){return w2.create(this.options.filter((B)=>!D.includes(B)),{...this._def,...F})}};w2.create=K7;SF=class SF extends BD{_parse(D){let F=QD.getValidEnumValues(this._def.values),B=this._getOrReturnCtx(D);if(B.parsedType!==I.string&&B.parsedType!==I.number){let $=QD.objectValues(F);return T(B,{expected:QD.joinValues($),received:B.parsedType,code:Z.invalid_type}),l}if(!this._cache)this._cache=new Set(QD.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let $=QD.objectValues(F);return T(B,{received:B.data,code:Z.invalid_enum_value,options:$}),l}return aD(D.data)}get enum(){return this._def.values}};SF.create=(D,F)=>{return new SF({values:D,typeName:n.ZodNativeEnum,...DD(F)})};m2=class m2 extends BD{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==I.promise&&F.common.async===!1)return T(F,{code:Z.invalid_type,expected:I.promise,received:F.parsedType}),l;let B=F.parsedType===I.promise?F.data:Promise.resolve(F.data);return aD(B.then(($)=>{return this._def.type.parseAsync($,{path:F.path,errorMap:F.common.contextualErrorMap})}))}};m2.create=(D,F)=>{return new m2({type:D,typeName:n.ZodPromise,...DD(F)})};k0=class k0 extends BD{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:B}=this._processInputParams(D),$=this._def.effect||null,_={addIssue:(Q)=>{if(T(B,Q),Q.fatal)F.abort();else F.dirty()},get path(){return B.path}};if(_.addIssue=_.addIssue.bind(_),$.type==="preprocess"){let Q=$.transform(B.data,_);if(B.common.async)return Promise.resolve(Q).then(async(Y)=>{if(F.value==="aborted")return l;let q=await this._def.schema._parseAsync({data:Y,path:B.path,parent:B});if(q.status==="aborted")return l;if(q.status==="dirty")return y2(q.value);if(F.value==="dirty")return y2(q.value);return q});else{if(F.value==="aborted")return l;let Y=this._def.schema._parseSync({data:Q,path:B.path,parent:B});if(Y.status==="aborted")return l;if(Y.status==="dirty")return y2(Y.value);if(F.value==="dirty")return y2(Y.value);return Y}}if($.type==="refinement"){let Q=(Y)=>{let q=$.refinement(Y,_);if(B.common.async)return Promise.resolve(q);if(q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Y};if(B.common.async===!1){let Y=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(Y.status==="aborted")return l;if(Y.status==="dirty")F.dirty();return Q(Y.value),{status:F.value,value:Y.value}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((Y)=>{if(Y.status==="aborted")return l;if(Y.status==="dirty")F.dirty();return Q(Y.value).then(()=>{return{status:F.value,value:Y.value}})})}if($.type==="transform")if(B.common.async===!1){let Q=this._def.schema._parseSync({data:B.data,path:B.path,parent:B});if(!U2(Q))return l;let Y=$.transform(Q.value,_);if(Y instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:Y}}else return this._def.schema._parseAsync({data:B.data,path:B.path,parent:B}).then((Q)=>{if(!U2(Q))return l;return Promise.resolve($.transform(Q.value,_)).then((Y)=>({status:F.value,value:Y}))});QD.assertNever($)}};k0.create=(D,F,B)=>{return new k0({schema:D,typeName:n.ZodEffects,effect:F,...DD(B)})};k0.createWithPreprocess=(D,F,B)=>{return new k0({schema:F,effect:{type:"preprocess",transform:D},typeName:n.ZodEffects,...DD(B)})};N0=class N0 extends BD{_parse(D){if(this._getType(D)===I.undefined)return aD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};N0.create=(D,F)=>{return new N0({innerType:D,typeName:n.ZodOptional,...DD(F)})};_2=class _2 extends BD{_parse(D){if(this._getType(D)===I.null)return aD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};_2.create=(D,F)=>{return new _2({innerType:D,typeName:n.ZodNullable,...DD(F)})};kF=class kF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;if(F.parsedType===I.undefined)B=this._def.defaultValue();return this._def.innerType._parse({data:B,path:F.path,parent:F})}removeDefault(){return this._def.innerType}};kF.create=(D,F)=>{return new kF({innerType:D,typeName:n.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...DD(F)})};IF=class IF extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B={...F,common:{...F.common,issues:[]}},$=this._def.innerType._parse({data:B.data,path:B.path,parent:{...B}});if(UF($))return $.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new lD(B.common.issues)},input:B.data})}});else return{status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new lD(B.common.issues)},input:B.data})}}removeCatch(){return this._def.innerType}};IF.create=(D,F)=>{return new IF({innerType:D,typeName:n.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...DD(F)})};M3=class M3 extends BD{_parse(D){if(this._getType(D)!==I.nan){let B=this._getOrReturnCtx(D);return T(B,{code:Z.invalid_type,expected:I.nan,received:B.parsedType}),l}return{status:"valid",value:D.data}}};M3.create=(D)=>{return new M3({typeName:n.ZodNaN,...DD(D)})};f_=Symbol("zod_brand");s3=class s3 extends BD{_parse(D){let{ctx:F}=this._processInputParams(D),B=F.data;return this._def.type._parse({data:B,path:F.path,parent:F})}unwrap(){return this._def.type}};A3=class A3 extends BD{_parse(D){let{status:F,ctx:B}=this._processInputParams(D);if(B.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:B.data,path:B.path,parent:B});if(_.status==="aborted")return l;if(_.status==="dirty")return F.dirty(),y2(_.value);else return this._def.out._parseAsync({data:_.value,path:B.path,parent:B})})();else{let $=this._def.in._parseSync({data:B.data,path:B.path,parent:B});if($.status==="aborted")return l;if($.status==="dirty")return F.dirty(),{status:"dirty",value:$.value};else return this._def.out._parseSync({data:$.value,path:B.path,parent:B})}}static create(D,F){return new A3({in:D,out:F,typeName:n.ZodPipeline})}};TF=class TF extends BD{_parse(D){let F=this._def.innerType._parse(D),B=($)=>{if(U2($))$.value=Object.freeze($.value);return $};return UF(F)?F.then(($)=>B($)):B(F)}unwrap(){return this._def.innerType}};TF.create=(D,F)=>{return new TF({innerType:D,typeName:n.ZodReadonly,...DD(F)})};h_={object:ID.lazycreate};(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(n||(n={}));V7=Z0.create,E7=E2.create,g_=M3.create,d_=L2.create,L7=LF.create,c_=x2.create,l_=X3.create,p_=wF.create,i_=OF.create,n_=f2.create,s_=V2.create,a_=p0.create,o_=W3.create,r_=R0.create,t_=ID.create,e_=ID.strictCreate,DQ=bF.create,FQ=n3.create,BQ=ZF.create,$Q=i0.create,_Q=G3.create,QQ=z3.create,YQ=h2.create,qQ=EF.create,HQ=RF.create,JQ=NF.create,XQ=w2.create,WQ=SF.create,GQ=m2.create,zQ=k0.create,MQ=N0.create,AQ=_2.create,jQ=k0.createWithPreprocess,KQ=A3.create,LQ={string:(D)=>Z0.create({...D,coerce:!0}),number:(D)=>E2.create({...D,coerce:!0}),boolean:(D)=>LF.create({...D,coerce:!0}),bigint:(D)=>L2.create({...D,coerce:!0}),date:(D)=>x2.create({...D,coerce:!0})},wQ=l});var G={};j2(G,{void:()=>o_,util:()=>QD,unknown:()=>s_,union:()=>DQ,undefined:()=>p_,tuple:()=>$Q,transformer:()=>zQ,symbol:()=>l_,string:()=>V7,strictObject:()=>e_,setErrorMap:()=>A_,set:()=>YQ,record:()=>_Q,quotelessJson:()=>z_,promise:()=>GQ,preprocess:()=>jQ,pipeline:()=>KQ,ostring:()=>UQ,optional:()=>MQ,onumber:()=>VQ,oboolean:()=>EQ,objectUtil:()=>Y1,object:()=>t_,number:()=>E7,nullable:()=>AQ,null:()=>i_,never:()=>a_,nativeEnum:()=>WQ,nan:()=>g_,map:()=>QQ,makeIssue:()=>J3,literal:()=>JQ,lazy:()=>HQ,late:()=>h_,isValid:()=>U2,isDirty:()=>i3,isAsync:()=>UF,isAborted:()=>p3,intersection:()=>BQ,instanceof:()=>m_,getParsedType:()=>l0,getErrorMap:()=>KF,function:()=>qQ,enum:()=>XQ,effect:()=>zQ,discriminatedUnion:()=>FQ,defaultErrorMap:()=>B2,datetimeRegex:()=>j7,date:()=>c_,custom:()=>U7,coerce:()=>LQ,boolean:()=>L7,bigint:()=>d_,array:()=>r_,any:()=>n_,addIssueToContext:()=>T,ZodVoid:()=>W3,ZodUnknown:()=>V2,ZodUnion:()=>bF,ZodUndefined:()=>wF,ZodType:()=>BD,ZodTuple:()=>i0,ZodTransformer:()=>k0,ZodSymbol:()=>X3,ZodString:()=>Z0,ZodSet:()=>h2,ZodSchema:()=>BD,ZodRecord:()=>G3,ZodReadonly:()=>TF,ZodPromise:()=>m2,ZodPipeline:()=>A3,ZodParsedType:()=>I,ZodOptional:()=>N0,ZodObject:()=>ID,ZodNumber:()=>E2,ZodNullable:()=>_2,ZodNull:()=>OF,ZodNever:()=>p0,ZodNativeEnum:()=>SF,ZodNaN:()=>M3,ZodMap:()=>z3,ZodLiteral:()=>NF,ZodLazy:()=>RF,ZodIssueCode:()=>Z,ZodIntersection:()=>ZF,ZodFunction:()=>EF,ZodFirstPartyTypeKind:()=>n,ZodError:()=>lD,ZodEnum:()=>w2,ZodEffects:()=>k0,ZodDiscriminatedUnion:()=>n3,ZodDefault:()=>kF,ZodDate:()=>x2,ZodCatch:()=>IF,ZodBranded:()=>s3,ZodBoolean:()=>LF,ZodBigInt:()=>L2,ZodArray:()=>R0,ZodAny:()=>f2,Schema:()=>BD,ParseStatus:()=>pD,OK:()=>aD,NEVER:()=>wQ,INVALID:()=>l,EMPTY_PATH:()=>j_,DIRTY:()=>y2,BRAND:()=>f_});var W1=V(()=>{l3();H1();X7();H3();w7();c3()});var Q2=V(()=>{W1();W1()});var b7;var O7=V(()=>{b7={name:"ocx",version:"2.0.4",description:"OCX CLI - ShadCN-style registry for OpenCode extensions. Install agents, plugins, skills, and MCP servers.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.0",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^8.2.0",remeda:"^2.33.0",zod:"^3.24.0"},devDependencies:{"@types/bun":"latest"}}});function bQ(D){return`https://${j3}/schemas/v${D}/registry.json`}var j3="ocx.kdco.dev",Z7="kdcokenny/ocx",G1,z1,I0=2,T0,R7;var a3=V(()=>{O7();G1=`https://${j3}/schemas/ocx.json`,z1=`https://${j3}/schemas/registry.json`;T0=bQ(I0),R7=b7.version});var XD,zD,MD,ZD,c,U,g2,dD,d2,vD,v0,CD,O2,vF,C0,CF,M1;var $D=V(()=>{XD={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};zD=class zD extends Error{code;exitCode;constructor(D,F,B=XD.GENERAL){super(D);this.code=F;this.exitCode=B;this.name="OCXError"}};MD=class MD extends zD{constructor(D){super(D,"NOT_FOUND",XD.NOT_FOUND);this.name="NotFoundError"}};ZD=class ZD extends zD{url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor(D,F){super(D,"NETWORK_ERROR",XD.NETWORK);this.name="NetworkError",this.url=F?.url,this.status=F?.status,this.statusText=F?.statusText,this.phase=F?.phase,this.qualifiedName=F?.qualifiedName,this.registryContext=F?.registryContext,this.registryName=F?.registryName}};c=class c extends zD{constructor(D){super(D,"CONFIG_ERROR",XD.CONFIG);this.name="ConfigError"}};U=class U extends zD{constructor(D){super(D,"VALIDATION_ERROR",XD.GENERAL);this.name="ValidationError"}};g2=class g2 extends zD{details;constructor(D){super("Registry validation failed","VALIDATION_FAILED",XD.CONFIG);this.details=D;this.name="ValidationFailedError"}};dD=class dD extends zD{constructor(D){super(D,"CONFLICT",XD.CONFLICT);this.name="ConflictError"}};d2=class d2 extends zD{component;expected;found;constructor(D,F,B){let $=`Integrity verification failed for "${D}"
|
|
18
|
-
Expected: ${F}
|
|
19
|
-
|
|
15
|
+
`}return $&&$.eol||`
|
|
16
|
+
`}function d0($,v){return`\r
|
|
17
|
+
`.indexOf($.charAt(v))!==-1}var J9=b(()=>{J2();Jz()});function Yz($,v=[],U=p0.DEFAULT){let Q=null,_=[],J=[];function Y(I){if(Array.isArray(_))_.push(I);else if(Q!==null)_[Q]=I}return z9($,{onObjectBegin:()=>{let I={};Y(I),J.push(_),_=I,Q=null},onObjectProperty:(I)=>{Q=I},onObjectEnd:()=>{_=J.pop()},onArrayBegin:()=>{let I=[];Y(I),J.push(_),_=I,Q=null},onArrayEnd:()=>{_=J.pop()},onLiteralValue:Y,onError:(I,X,q)=>{v.push({error:I,offset:X,length:q})}},U),_[0]}function Y9($,v=[],U=p0.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function _(I){if(Q.type==="property")Q.length=I-Q.offset,Q=Q.parent}function J(I){return Q.children.push(I),I}z9($,{onObjectBegin:(I)=>{Q=J({type:"object",offset:I,length:-1,parent:Q,children:[]})},onObjectProperty:(I,X,q)=>{Q=J({type:"property",offset:X,length:-1,parent:Q,children:[]}),Q.children.push({type:"string",value:I,offset:X,length:q,parent:Q})},onObjectEnd:(I,X)=>{_(I+X),Q.length=I+X-Q.offset,Q=Q.parent,_(I+X)},onArrayBegin:(I,X)=>{Q=J({type:"array",offset:I,length:-1,parent:Q,children:[]})},onArrayEnd:(I,X)=>{Q.length=I+X-Q.offset,Q=Q.parent,_(I+X)},onLiteralValue:(I,X,q)=>{J({type:_b(I),offset:X,length:q,parent:Q,value:I}),_(X+q)},onSeparator:(I,X,q)=>{if(Q.type==="property"){if(I===":")Q.colonOffset=X;else if(I===",")_(X)}},onError:(I,X,q)=>{v.push({error:I,offset:X,length:q})}},U);let z=Q.children[0];if(z)delete z.parent;return z}function Y2($,v){if(!$)return;let U=$;for(let Q of v)if(typeof Q==="string"){if(U.type!=="object"||!Array.isArray(U.children))return;let _=!1;for(let J of U.children)if(Array.isArray(J.children)&&J.children[0].value===Q&&J.children.length===2){U=J.children[1],_=!0;break}if(!_)return}else{let _=Q;if(U.type!=="array"||_<0||!Array.isArray(U.children)||_>=U.children.length)return;U=U.children[_]}return U}function z9($,v,U=p0.DEFAULT){let Q=l0($,!1),_=[],J=0;function Y(y){return y?()=>J===0&&y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function z(y){return y?(h)=>J===0&&y(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function I(y){return y?(h)=>J===0&&y(h,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>_.slice()):()=>!0}function X(y){return y?()=>{if(J>0)J++;else if(y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>_.slice())===!1)J=1}:()=>!0}function q(y){return y?()=>{if(J>0)J--;if(J===0)y(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let G=X(v.onObjectBegin),j=I(v.onObjectProperty),H=q(v.onObjectEnd),Z=X(v.onArrayBegin),D=q(v.onArrayEnd),E=I(v.onLiteralValue),A=z(v.onSeparator),r=Y(v.onComment),O=z(v.onError),g=U&&U.disallowComments,w=U&&U.allowTrailingComma;function N(){while(!0){let y=Q.scan();switch(Q.getTokenError()){case 4:L(14);break;case 5:L(15);break;case 3:L(13);break;case 1:if(!g)L(11);break;case 2:L(12);break;case 6:L(16);break}switch(y){case 12:case 13:if(g)L(10);else r();break;case 16:L(1);break;case 15:case 14:break;default:return y}}}function L(y,h=[],I$=[]){if(O(y),h.length+I$.length>0){let v$=Q.getToken();while(v$!==17){if(h.indexOf(v$)!==-1){N();break}else if(I$.indexOf(v$)!==-1)break;v$=N()}}}function U$(y){let h=Q.getTokenValue();if(y)E(h);else j(h),_.push(h);return N(),!0}function $$(){switch(Q.getToken()){case 11:let y=Q.getTokenValue(),h=Number(y);if(isNaN(h))L(2),h=0;E(h);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return N(),!0}function a(){if(Q.getToken()!==10)return L(3,[],[2,5]),!1;if(U$(!1),Q.getToken()===6){if(A(":"),N(),!o())L(4,[],[2,5])}else L(5,[],[2,5]);return _.pop(),!0}function V$(){G(),N();let y=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!y)L(4,[],[]);if(A(","),N(),Q.getToken()===2&&w)break}else if(y)L(6,[],[]);if(!a())L(4,[],[2,5]);y=!0}if(H(),Q.getToken()!==2)L(7,[2],[]);else N();return!0}function x(){Z(),N();let y=!0,h=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!h)L(4,[],[]);if(A(","),N(),Q.getToken()===4&&w)break}else if(h)L(6,[],[]);if(y)_.push(0),y=!1;else _[_.length-1]++;if(!o())L(4,[],[4,5]);h=!0}if(D(),!y)_.pop();if(Q.getToken()!==4)L(8,[4],[]);else N();return!0}function o(){switch(Q.getToken()){case 3:return x();case 1:return V$();case 10:return U$(!0);default:return $$()}}if(N(),Q.getToken()===17){if(U.allowEmptyContent)return!0;return L(4,[],[]),!1}if(!o())return L(4,[],[]),!1;if(Q.getToken()!==17)L(9,[],[]);return!0}function _b($){switch(typeof $){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!$)return"null";else if(Array.isArray($))return"array";return"object"}default:return"null"}}var p0;var I9=b(()=>{J2();(function($){$.DEFAULT={allowTrailingComma:!1}})(p0||(p0={}))});function zz($,v,U,Q){let _=v.slice(),Y=Y9($,[]),z=void 0,I=void 0;while(_.length>0)if(I=_.pop(),z=Y2(Y,_),z===void 0&&U!==void 0)if(typeof I==="string")U={[I]:U};else U=[U];else break;if(!z){if(U===void 0)throw Error("Can not delete in empty document");return s6($,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(U)},Q)}else if(z.type==="object"&&typeof I==="string"&&Array.isArray(z.children)){let X=Y2(z,[I]);if(X!==void 0)if(U===void 0){if(!X.parent)throw Error("Malformed AST");let q=z.children.indexOf(X.parent),G,j=X.parent.offset+X.parent.length;if(q>0){let H=z.children[q-1];G=H.offset+H.length}else if(G=z.offset+1,z.children.length>1)j=z.children[1].offset;return s6($,{offset:G,length:j-G,content:""},Q)}else return s6($,{offset:X.offset,length:X.length,content:JSON.stringify(U)},Q);else{if(U===void 0)return[];let q=`${JSON.stringify(I)}: ${JSON.stringify(U)}`,G=Q.getInsertionIndex?Q.getInsertionIndex(z.children.map((H)=>H.children[0].value)):z.children.length,j;if(G>0){let H=z.children[G-1];j={offset:H.offset+H.length,length:0,content:","+q}}else if(z.children.length===0)j={offset:z.offset+1,length:0,content:q};else j={offset:z.offset+1,length:0,content:q+","};return s6($,j,Q)}}else if(z.type==="array"&&typeof I==="number"&&Array.isArray(z.children)){let X=I;if(X===-1){let q=`${JSON.stringify(U)}`,G;if(z.children.length===0)G={offset:z.offset+1,length:0,content:q};else{let j=z.children[z.children.length-1];G={offset:j.offset+j.length,length:0,content:","+q}}return s6($,G,Q)}else if(U===void 0&&z.children.length>=0){let q=I,G=z.children[q],j;if(z.children.length===1)j={offset:z.offset+1,length:z.length-2,content:""};else if(z.children.length-1===q){let H=z.children[q-1],Z=H.offset+H.length,D=z.offset+z.length;j={offset:Z,length:D-2-Z,content:""}}else j={offset:G.offset,length:z.children[q+1].offset-G.offset,content:""};return s6($,j,Q)}else if(U!==void 0){let q,G=`${JSON.stringify(U)}`;if(!Q.isArrayInsertion&&z.children.length>I){let j=z.children[I];q={offset:j.offset,length:j.length,content:G}}else if(z.children.length===0||I===0)q={offset:z.offset+1,length:0,content:z.children.length===0?G:G+","};else{let j=I>z.children.length?z.children.length:I,H=z.children[j-1];q={offset:H.offset+H.length,length:0,content:","+G}}return s6($,q,Q)}else throw Error(`Can not ${U===void 0?"remove":Q.isArrayInsertion?"insert":"modify"} Array index ${X} as length is not sufficient`)}else throw Error(`Can not add ${typeof I!=="number"?"index":"property"} to parent of type ${z.type}`)}function s6($,v,U){if(!U.formattingOptions)return[v];let Q=z2($,v),_=v.offset,J=v.offset+v.content.length;if(v.length===0||v.content.length===0){while(_>0&&!d0(Q,_-1))_--;while(J<Q.length&&!d0(Q,J))J++}let Y=Q9(Q,{offset:_,length:J-_},{...U.formattingOptions,keepLines:!1});for(let I=Y.length-1;I>=0;I--){let X=Y[I];Q=z2(Q,X),_=Math.min(_,X.offset),J=Math.max(J,X.offset+X.length),J+=X.content.length-X.length}let z=$.length-(Q.length-J)-_;return[{offset:_,length:z,content:Q.substring(_,J)}]}function z2($,v){return $.substring(0,v.offset)+v.content+$.substring(v.offset+v.length)}var Iz=b(()=>{J9();I9()});function _6($){switch($){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function y1($,v,U,Q){return zz($,v,U,Q)}function C1($,v){let U=v.slice(0).sort((_,J)=>{let Y=_.offset-J.offset;if(Y===0)return _.length-J.length;return Y}),Q=$.length;for(let _=U.length-1;_>=0;_--){let J=U[_];if(J.offset+J.length<=Q)$=z2($,J);else throw Error("Overlapping edit");Q=J.offset}return $}var Xz,qz,E$,Gz;var E4=b(()=>{J9();Iz();J2();I9();(function($){$[$.None=0]="None",$[$.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=2]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",$[$.InvalidUnicode=4]="InvalidUnicode",$[$.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",$[$.InvalidCharacter=6]="InvalidCharacter"})(Xz||(Xz={}));(function($){$[$.OpenBraceToken=1]="OpenBraceToken",$[$.CloseBraceToken=2]="CloseBraceToken",$[$.OpenBracketToken=3]="OpenBracketToken",$[$.CloseBracketToken=4]="CloseBracketToken",$[$.CommaToken=5]="CommaToken",$[$.ColonToken=6]="ColonToken",$[$.NullKeyword=7]="NullKeyword",$[$.TrueKeyword=8]="TrueKeyword",$[$.FalseKeyword=9]="FalseKeyword",$[$.StringLiteral=10]="StringLiteral",$[$.NumericLiteral=11]="NumericLiteral",$[$.LineCommentTrivia=12]="LineCommentTrivia",$[$.BlockCommentTrivia=13]="BlockCommentTrivia",$[$.LineBreakTrivia=14]="LineBreakTrivia",$[$.Trivia=15]="Trivia",$[$.Unknown=16]="Unknown",$[$.EOF=17]="EOF"})(qz||(qz={}));E$=Yz;(function($){$[$.InvalidSymbol=1]="InvalidSymbol",$[$.InvalidNumberFormat=2]="InvalidNumberFormat",$[$.PropertyNameExpected=3]="PropertyNameExpected",$[$.ValueExpected=4]="ValueExpected",$[$.ColonExpected=5]="ColonExpected",$[$.CommaExpected=6]="CommaExpected",$[$.CloseBraceExpected=7]="CloseBraceExpected",$[$.CloseBracketExpected=8]="CloseBracketExpected",$[$.EndOfFileExpected=9]="EndOfFileExpected",$[$.InvalidCommentToken=10]="InvalidCommentToken",$[$.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",$[$.UnexpectedEndOfString=12]="UnexpectedEndOfString",$[$.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",$[$.InvalidUnicode=14]="InvalidUnicode",$[$.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",$[$.InvalidCharacter=16]="InvalidCharacter"})(Gz||(Gz={}))});function B($,v,U){function Q(z,I){if(!z._zod)Object.defineProperty(z,"_zod",{value:{def:I,constr:Y,traits:new Set},enumerable:!1});if(z._zod.traits.has($))return;z._zod.traits.add($),v(z,I);let X=Y.prototype,q=Object.keys(X);for(let G=0;G<q.length;G++){let j=q[G];if(!(j in z))z[j]=X[j].bind(z)}}let _=U?.Parent??Object;class J extends _{}Object.defineProperty(J,"name",{value:$});function Y(z){var I;let X=U?.Parent?new J:this;Q(X,z),(I=X._zod).deferred??(I.deferred=[]);for(let q of X._zod.deferred)q();return X}return Object.defineProperty(Y,"init",{value:Q}),Object.defineProperty(Y,Symbol.hasInstance,{value:(z)=>{if(U?.Parent&&z instanceof U.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(Y,"name",{value:$}),Y}function d$($){if($)Object.assign(i0,$);return i0}var X9,q9,U6,e6,i0;var f1=b(()=>{X9=Object.freeze({status:"aborted"});q9=Symbol("zod_brand");U6=class U6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};e6=class e6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};i0={}});var R={};s$(R,{unwrapMessage:()=>n0,uint8ArrayToHex:()=>Sb,uint8ArrayToBase64url:()=>Fb,uint8ArrayToBase64:()=>Hz,stringifyPrimitive:()=>S,slugify:()=>K9,shallowClone:()=>W9,safeExtend:()=>Mb,required:()=>kb,randomString:()=>Hb,propertyKeyTypes:()=>t0,promiseAllObject:()=>Kb,primitiveTypes:()=>b9,prefixIssues:()=>L4,pick:()=>Zb,partial:()=>Lb,parsedType:()=>T,optionalKeys:()=>B9,omit:()=>Db,objectClone:()=>qb,numKeys:()=>Wb,nullish:()=>R6,normalizeParams:()=>P,mergeDefs:()=>W6,merge:()=>wb,jsonStringifyReplacer:()=>m1,joinValues:()=>V,issue:()=>h1,isPlainObject:()=>P6,isObject:()=>$1,hexToUint8Array:()=>Nb,getSizableOrigin:()=>a0,getParsedType:()=>bb,getLengthableOrigin:()=>s0,getEnumValues:()=>r0,getElementAtPath:()=>jb,floatSafeRemainder:()=>j9,finalizeIssue:()=>H4,extend:()=>Vb,escapeRegex:()=>P4,esc:()=>I2,defineLazy:()=>Y$,createTransparentProxy:()=>Bb,cloneDef:()=>Gb,clone:()=>Y4,cleanRegex:()=>o0,cleanEnum:()=>Ab,captureStackTrace:()=>X2,cached:()=>g1,base64urlToUint8Array:()=>Ob,base64ToUint8Array:()=>Kz,assignProp:()=>E6,assertNotEqual:()=>Yb,assertNever:()=>Ib,assertIs:()=>zb,assertEqual:()=>Jb,assert:()=>Xb,allowsEval:()=>H9,aborted:()=>x6,NUMBER_FORMAT_RANGES:()=>Z9,Class:()=>Wz,BIGINT_FORMAT_RANGES:()=>D9});function Jb($){return $}function Yb($){return $}function zb($){}function Ib($){throw Error("Unexpected value in exhaustive check")}function Xb($){}function r0($){let v=Object.values($).filter((Q)=>typeof Q==="number");return Object.entries($).filter(([Q,_])=>v.indexOf(+Q)===-1).map(([Q,_])=>_)}function V($,v="|"){return $.map((U)=>S(U)).join(v)}function m1($,v){if(typeof v==="bigint")return v.toString();return v}function g1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function R6($){return $===null||$===void 0}function o0($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function j9($,v){let U=($.toString().split(".")[1]||"").length,Q=v.toString(),_=(Q.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(Q)){let I=Q.match(/\d?e-(\d?)/);if(I?.[1])_=Number.parseInt(I[1])}let J=U>_?U:_,Y=Number.parseInt($.toFixed(J).replace(".","")),z=Number.parseInt(v.toFixed(J).replace(".",""));return Y%z/10**J}function Y$($,v,U){let Q=void 0;Object.defineProperty($,v,{get(){if(Q===jz)return;if(Q===void 0)Q=jz,Q=U();return Q},set(_){Object.defineProperty($,v,{value:_})},configurable:!0})}function qb($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function E6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function W6(...$){let v={};for(let U of $){let Q=Object.getOwnPropertyDescriptors(U);Object.assign(v,Q)}return Object.defineProperties({},v)}function Gb($){return W6($._zod.def)}function jb($,v){if(!v)return $;return v.reduce((U,Q)=>U?.[Q],$)}function Kb($){let v=Object.keys($),U=v.map((Q)=>$[Q]);return Promise.all(U).then((Q)=>{let _={};for(let J=0;J<v.length;J++)_[v[J]]=Q[J];return _})}function Hb($=10){let U="";for(let Q=0;Q<$;Q++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function I2($){return JSON.stringify($)}function K9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function $1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function P6($){if($1($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if($1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function W9($){if(P6($))return{...$};if(Array.isArray($))return[...$];return $}function Wb($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}function P4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Y4($,v,U){let Q=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)Q._zod.parent=$;return Q}function P($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function Bb($){let v;return new Proxy({},{get(U,Q,_){return v??(v=$()),Reflect.get(v,Q,_)},set(U,Q,_,J){return v??(v=$()),Reflect.set(v,Q,_,J)},has(U,Q){return v??(v=$()),Reflect.has(v,Q)},deleteProperty(U,Q){return v??(v=$()),Reflect.deleteProperty(v,Q)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,Q){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,Q)},defineProperty(U,Q,_){return v??(v=$()),Reflect.defineProperty(v,Q,_)}})}function S($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function B9($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}function Zb($,v){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let J=W6($._zod.def,{get shape(){let Y={};for(let z in v){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!v[z])continue;Y[z]=U.shape[z]}return E6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Db($,v){let U=$._zod.def,Q=U.checks;if(Q&&Q.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let J=W6($._zod.def,{get shape(){let Y={...$._zod.def.shape};for(let z in v){if(!(z in U.shape))throw Error(`Unrecognized key: "${z}"`);if(!v[z])continue;delete Y[z]}return E6(this,"shape",Y),Y},checks:[]});return Y4($,J)}function Vb($,v){if(!P6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let J=$._zod.def.shape;for(let Y in v)if(Object.getOwnPropertyDescriptor(J,Y)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let _=W6($._zod.def,{get shape(){let J={...$._zod.def.shape,...v};return E6(this,"shape",J),J}});return Y4($,_)}function Mb($,v){if(!P6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=W6($._zod.def,{get shape(){let Q={...$._zod.def.shape,...v};return E6(this,"shape",Q),Q}});return Y4($,U)}function wb($,v){let U=W6($._zod.def,{get shape(){let Q={...$._zod.def.shape,...v._zod.def.shape};return E6(this,"shape",Q),Q},get catchall(){return v._zod.def.catchall},checks:[]});return Y4($,U)}function Lb($,v,U){let _=v._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let Y=W6(v._zod.def,{get shape(){let z=v._zod.def.shape,I={...z};if(U)for(let X in U){if(!(X in z))throw Error(`Unrecognized key: "${X}"`);if(!U[X])continue;I[X]=$?new $({type:"optional",innerType:z[X]}):z[X]}else for(let X in z)I[X]=$?new $({type:"optional",innerType:z[X]}):z[X];return E6(this,"shape",I),I},checks:[]});return Y4(v,Y)}function kb($,v,U){let Q=W6(v._zod.def,{get shape(){let _=v._zod.def.shape,J={..._};if(U)for(let Y in U){if(!(Y in J))throw Error(`Unrecognized key: "${Y}"`);if(!U[Y])continue;J[Y]=new $({type:"nonoptional",innerType:_[Y]})}else for(let Y in _)J[Y]=new $({type:"nonoptional",innerType:_[Y]});return E6(this,"shape",J),J}});return Y4(v,Q)}function x6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function L4($,v){return v.map((U)=>{var Q;return(Q=U).path??(Q.path=[]),U.path.unshift($),U})}function n0($){return typeof $==="string"?$:$?.message}function H4($,v,U){let Q={...$,path:$.path??[]};if(!$.message){let _=n0($.inst?._zod.def?.error?.($))??n0(v?.error?.($))??n0(U.customError?.($))??n0(U.localeError?.($))??"Invalid input";Q.message=_}if(delete Q.inst,delete Q.continue,!v?.reportInput)delete Q.input;return Q}function a0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function s0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function T($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function h1(...$){let[v,U,Q]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:Q};return{...v}}function Ab($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function Kz($){let v=atob($),U=new Uint8Array(v.length);for(let Q=0;Q<v.length;Q++)U[Q]=v.charCodeAt(Q);return U}function Hz($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function Ob($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return Kz(v+U)}function Fb($){return Hz($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Nb($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let Q=0;Q<v.length;Q+=2)U[Q/2]=Number.parseInt(v.slice(Q,Q+2),16);return U}function Sb($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class Wz{constructor(...$){}}var jz,X2,H9,bb=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},t0,b9,Z9,D9;var l=b(()=>{jz=Symbol("evaluating");X2="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};H9=g1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});t0=new Set(["string","number","symbol"]),b9=new Set(["string","number","bigint","boolean","symbol","undefined"]);Z9={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},D9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function $v($,v=(U)=>U.message){let U={},Q=[];for(let _ of $.issues)if(_.path.length>0)U[_.path[0]]=U[_.path[0]]||[],U[_.path[0]].push(v(_));else Q.push(v(_));return{formErrors:Q,fieldErrors:U}}function vv($,v=(U)=>U.message){let U={_errors:[]},Q=(_)=>{for(let J of _.issues)if(J.code==="invalid_union"&&J.errors.length)J.errors.map((Y)=>Q({issues:Y}));else if(J.code==="invalid_key")Q({issues:J.issues});else if(J.code==="invalid_element")Q({issues:J.issues});else if(J.path.length===0)U._errors.push(v(J));else{let Y=U,z=0;while(z<J.path.length){let I=J.path[z];if(z!==J.path.length-1)Y[I]=Y[I]||{_errors:[]};else Y[I]=Y[I]||{_errors:[]},Y[I]._errors.push(v(J));Y=Y[I],z++}}};return Q($),U}function V9($,v=(U)=>U.message){let U={errors:[]},Q=(_,J=[])=>{var Y,z;for(let I of _.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((X)=>Q({issues:X},I.path));else if(I.code==="invalid_key")Q({issues:I.issues},I.path);else if(I.code==="invalid_element")Q({issues:I.issues},I.path);else{let X=[...J,...I.path];if(X.length===0){U.errors.push(v(I));continue}let q=U,G=0;while(G<X.length){let j=X[G],H=G===X.length-1;if(typeof j==="string")q.properties??(q.properties={}),(Y=q.properties)[j]??(Y[j]={errors:[]}),q=q.properties[j];else q.items??(q.items=[]),(z=q.items)[j]??(z[j]={errors:[]}),q=q.items[j];if(H)q.errors.push(v(I));G++}}};return Q($),U}function Bz($){let v=[],U=$.map((Q)=>typeof Q==="object"?Q.key:Q);for(let Q of U)if(typeof Q==="number")v.push(`[${Q}]`);else if(typeof Q==="symbol")v.push(`[${JSON.stringify(String(Q))}]`);else if(/[^\w$]/.test(Q))v.push(`[${JSON.stringify(Q)}]`);else{if(v.length)v.push(".");v.push(Q)}return v.join("")}function M9($){let v=[],U=[...$.issues].sort((Q,_)=>(Q.path??[]).length-(_.path??[]).length);for(let Q of U)if(v.push(`\u2716 ${Q.message}`),Q.path?.length)v.push(` \u2192 at ${Bz(Q.path)}`);return v.join(`
|
|
18
|
+
`)}var bz=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,m1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},e0,W4;var w9=b(()=>{f1();l();e0=B("$ZodError",bz),W4=B("$ZodError",bz,{Parent:Error})});var c1=($)=>(v,U,Q,_)=>{let J=Q?Object.assign(Q,{async:!1}):{async:!1},Y=v._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)throw new U6;if(Y.issues.length){let z=new(_?.Err??$)(Y.issues.map((I)=>H4(I,J,d$())));throw X2(z,_?.callee),z}return Y.value},q2,l1=($)=>async(v,U,Q,_)=>{let J=Q?Object.assign(Q,{async:!0}):{async:!0},Y=v._zod.run({value:U,issues:[]},J);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let z=new(_?.Err??$)(Y.issues.map((I)=>H4(I,J,d$())));throw X2(z,_?.callee),z}return Y.value},G2,d1=($)=>(v,U,Q)=>{let _=Q?{...Q,async:!1}:{async:!1},J=v._zod.run({value:U,issues:[]},_);if(J instanceof Promise)throw new U6;return J.issues.length?{success:!1,error:new($??e0)(J.issues.map((Y)=>H4(Y,_,d$())))}:{success:!0,data:J.value}},L9,p1=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{async:!0}):{async:!0},J=v._zod.run({value:U,issues:[]},_);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((Y)=>H4(Y,_,d$())))}:{success:!0,data:J.value}},k9,j2=($)=>(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return c1($)(v,U,_)},Rb,K2=($)=>(v,U,Q)=>{return c1($)(v,U,Q)},Eb,H2=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return l1($)(v,U,_)},Pb,W2=($)=>async(v,U,Q)=>{return l1($)(v,U,Q)},xb,b2=($)=>(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return d1($)(v,U,_)},ub,B2=($)=>(v,U,Q)=>{return d1($)(v,U,Q)},yb,Z2=($)=>async(v,U,Q)=>{let _=Q?Object.assign(Q,{direction:"backward"}):{direction:"backward"};return p1($)(v,U,_)},Cb,D2=($)=>async(v,U,Q)=>{return p1($)(v,U,Q)},fb;var A9=b(()=>{f1();w9();l();q2=c1(W4),G2=l1(W4),L9=d1(W4),k9=p1(W4),Rb=j2(W4),Eb=K2(W4),Pb=H2(W4),xb=W2(W4),ub=b2(W4),yb=B2(W4),Cb=Z2(W4),fb=D2(W4)});var x4={};s$(x4,{xid:()=>S9,uuid7:()=>cb,uuid6:()=>hb,uuid4:()=>gb,uuid:()=>v1,uppercase:()=>e9,unicodeEmail:()=>Zz,undefined:()=>a9,ulid:()=>N9,time:()=>d9,string:()=>i9,sha512_hex:()=>XB,sha512_base64url:()=>GB,sha512_base64:()=>qB,sha384_hex:()=>YB,sha384_base64url:()=>IB,sha384_base64:()=>zB,sha256_hex:()=>UB,sha256_base64url:()=>JB,sha256_base64:()=>QB,sha1_hex:()=>$B,sha1_base64url:()=>_B,sha1_base64:()=>vB,rfc5322Email:()=>db,number:()=>_v,null:()=>t9,nanoid:()=>R9,md5_hex:()=>ab,md5_base64url:()=>eb,md5_base64:()=>sb,mac:()=>f9,lowercase:()=>s9,ksuid:()=>T9,ipv6:()=>C9,ipv4:()=>y9,integer:()=>r9,idnEmail:()=>pb,html5Email:()=>lb,hostname:()=>rb,hex:()=>tb,guid:()=>P9,extendedDuration:()=>mb,emoji:()=>u9,email:()=>x9,e164:()=>c9,duration:()=>E9,domain:()=>ob,datetime:()=>p9,date:()=>l9,cuid2:()=>F9,cuid:()=>O9,cidrv6:()=>g9,cidrv4:()=>m9,browserEmail:()=>ib,boolean:()=>o9,bigint:()=>n9,base64url:()=>V2,base64:()=>h9});function u9(){return new RegExp(nb,"u")}function Vz($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function d9($){return new RegExp(`^${Vz($)}$`)}function p9($){let v=Vz({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Q=`${v}(?:${U.join("|")})`;return new RegExp(`^${Dz}T(?:${Q})$`)}function Uv($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function Qv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var O9,F9,N9,S9,T9,R9,E9,mb,P9,v1=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},gb,hb,cb,x9,lb,db,Zz,pb,ib,nb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",y9,C9,f9=($)=>{let v=P4($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},m9,g9,h9,V2,rb,ob,c9,Dz="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",l9,i9=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},n9,r9,_v,o9,t9,a9,s9,e9,tb,ab,sb,eb,$B,vB,_B,UB,QB,JB,YB,zB,IB,XB,qB,GB;var M2=b(()=>{l();O9=/^[cC][^\s-]{8,}$/,F9=/^[0-9a-z]+$/,N9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S9=/^[0-9a-vA-V]{20}$/,T9=/^[A-Za-z0-9]{27}$/,R9=/^[a-zA-Z0-9_-]{21}$/,E9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,mb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,P9=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gb=v1(4),hb=v1(6),cb=v1(7),x9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,db=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Zz=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,pb=Zz,ib=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;y9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,C9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,m9=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,g9=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,h9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V2=/^[A-Za-z0-9_-]*$/,rb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ob=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,c9=/^\+[1-9]\d{6,14}$/,l9=new RegExp(`^${Dz}$`);n9=/^-?\d+n?$/,r9=/^-?\d+$/,_v=/^-?\d+(?:\.\d+)?$/,o9=/^(?:true|false)$/i,t9=/^null$/i,a9=/^undefined$/i,s9=/^[^A-Z]*$/,e9=/^[^a-z]*$/,tb=/^[0-9a-fA-F]*$/;ab=/^[0-9a-fA-F]{32}$/,sb=Uv(22,"=="),eb=Qv(22),$B=/^[0-9a-fA-F]{40}$/,vB=Uv(27,"="),_B=Qv(27),UB=/^[0-9a-fA-F]{64}$/,QB=Uv(43,"="),JB=Qv(43),YB=/^[0-9a-fA-F]{96}$/,zB=Uv(64,""),IB=Qv(64),XB=/^[0-9a-fA-F]{128}$/,qB=Uv(86,"=="),GB=Qv(86)});function Mz($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues))}var T$,wz,w2,L2,$3,v3,_3,U3,Q3,J3,Y3,z3,I3,i1,X3,q3,G3,j3,K3,H3,W3,b3,B3;var k2=b(()=>{f1();M2();l();T$=B("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),wz={number:"number",bigint:"bigint",object:"date"},w2=B("$ZodCheckLessThan",($,v)=>{T$.init($,v);let U=wz[typeof v.value];$._zod.onattach.push((Q)=>{let _=Q._zod.bag,J=(v.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<J)if(v.inclusive)_.maximum=v.value;else _.exclusiveMaximum=v.value}),$._zod.check=(Q)=>{if(v.inclusive?Q.value<=v.value:Q.value<v.value)return;Q.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:Q.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),L2=B("$ZodCheckGreaterThan",($,v)=>{T$.init($,v);let U=wz[typeof v.value];$._zod.onattach.push((Q)=>{let _=Q._zod.bag,J=(v.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>J)if(v.inclusive)_.minimum=v.value;else _.exclusiveMinimum=v.value}),$._zod.check=(Q)=>{if(v.inclusive?Q.value>=v.value:Q.value>v.value)return;Q.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:Q.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),$3=B("$ZodCheckMultipleOf",($,v)=>{T$.init($,v),$._zod.onattach.push((U)=>{var Q;(Q=U._zod.bag).multipleOf??(Q.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):j9(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),v3=B("$ZodCheckNumberFormat",($,v)=>{T$.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),Q=U?"int":"number",[_,J]=Z9[v.format];$._zod.onattach.push((Y)=>{let z=Y._zod.bag;if(z.format=v.format,z.minimum=_,z.maximum=J,U)z.pattern=r9}),$._zod.check=(Y)=>{let z=Y.value;if(U){if(!Number.isInteger(z)){Y.issues.push({expected:Q,format:v.format,code:"invalid_type",continue:!1,input:z,inst:$});return}if(!Number.isSafeInteger(z)){if(z>0)Y.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!v.abort});else Y.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Q,inclusive:!0,continue:!v.abort});return}}if(z<_)Y.issues.push({origin:"number",input:z,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!v.abort});if(z>J)Y.issues.push({origin:"number",input:z,code:"too_big",maximum:J,inclusive:!0,inst:$,continue:!v.abort})}}),_3=B("$ZodCheckBigIntFormat",($,v)=>{T$.init($,v);let[U,Q]=D9[v.format];$._zod.onattach.push((_)=>{let J=_._zod.bag;J.format=v.format,J.minimum=U,J.maximum=Q}),$._zod.check=(_)=>{let J=_.value;if(J<U)_.issues.push({origin:"bigint",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(J>Q)_.issues.push({origin:"bigint",input:J,code:"too_big",maximum:Q,inclusive:!0,inst:$,continue:!v.abort})}}),U3=B("$ZodCheckMaxSize",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)Q._zod.bag.maximum=v.maximum}),$._zod.check=(Q)=>{let _=Q.value;if(_.size<=v.maximum)return;Q.issues.push({origin:a0(_),code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),Q3=B("$ZodCheckMinSize",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)Q._zod.bag.minimum=v.minimum}),$._zod.check=(Q)=>{let _=Q.value;if(_.size>=v.minimum)return;Q.issues.push({origin:a0(_),code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),J3=B("$ZodCheckSizeEquals",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.size!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.minimum=v.size,_.maximum=v.size,_.size=v.size}),$._zod.check=(Q)=>{let _=Q.value,J=_.size;if(J===v.size)return;let Y=J>v.size;Q.issues.push({origin:a0(_),...Y?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!v.abort})}}),Y3=B("$ZodCheckMaxLength",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)Q._zod.bag.maximum=v.maximum}),$._zod.check=(Q)=>{let _=Q.value;if(_.length<=v.maximum)return;let Y=s0(_);Q.issues.push({origin:Y,code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),z3=B("$ZodCheckMinLength",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)Q._zod.bag.minimum=v.minimum}),$._zod.check=(Q)=>{let _=Q.value;if(_.length>=v.minimum)return;let Y=s0(_);Q.issues.push({origin:Y,code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),I3=B("$ZodCheckLengthEquals",($,v)=>{var U;T$.init($,v),(U=$._zod.def).when??(U.when=(Q)=>{let _=Q.value;return!R6(_)&&_.length!==void 0}),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.minimum=v.length,_.maximum=v.length,_.length=v.length}),$._zod.check=(Q)=>{let _=Q.value,J=_.length;if(J===v.length)return;let Y=s0(_),z=J>v.length;Q.issues.push({origin:Y,...z?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:Q.value,inst:$,continue:!v.abort})}}),i1=B("$ZodCheckStringFormat",($,v)=>{var U,Q;if(T$.init($,v),$._zod.onattach.push((_)=>{let J=_._zod.bag;if(J.format=v.format,v.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(_)=>{if(v.pattern.lastIndex=0,v.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:v.format,input:_.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(Q=$._zod).check??(Q.check=()=>{})}),X3=B("$ZodCheckRegex",($,v)=>{i1.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),q3=B("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=s9),i1.init($,v)}),G3=B("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=e9),i1.init($,v)}),j3=B("$ZodCheckIncludes",($,v)=>{T$.init($,v);let U=P4(v.includes),Q=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=Q,$._zod.onattach.push((_)=>{let J=_._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Q)}),$._zod.check=(_)=>{if(_.value.includes(v.includes,v.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:_.value,inst:$,continue:!v.abort})}}),K3=B("$ZodCheckStartsWith",($,v)=>{T$.init($,v);let U=new RegExp(`^${P4(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.startsWith(v.prefix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:Q.value,inst:$,continue:!v.abort})}}),H3=B("$ZodCheckEndsWith",($,v)=>{T$.init($,v);let U=new RegExp(`.*${P4(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((Q)=>{let _=Q._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(Q)=>{if(Q.value.endsWith(v.suffix))return;Q.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:Q.value,inst:$,continue:!v.abort})}});W3=B("$ZodCheckProperty",($,v)=>{T$.init($,v),$._zod.check=(U)=>{let Q=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(Q instanceof Promise)return Q.then((_)=>Mz(_,U,v.property));Mz(Q,U,v.property);return}}),b3=B("$ZodCheckMimeType",($,v)=>{T$.init($,v);let U=new Set(v.mime);$._zod.onattach.push((Q)=>{Q._zod.bag.mime=v.mime}),$._zod.check=(Q)=>{if(U.has(Q.value.type))return;Q.issues.push({code:"invalid_value",values:v.mime,input:Q.value.type,inst:$,continue:!v.abort})}}),B3=B("$ZodCheckOverwrite",($,v)=>{T$.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}})});class A2{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
|
|
19
|
+
`).filter((J)=>J),Q=Math.min(...U.map((J)=>J.length-J.trimStart().length)),_=U.map((J)=>J.slice(Q)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of _)this.content.push(J)}compile(){let $=Function,v=this?.args,Q=[...(this?.content??[""]).map((_)=>` ${_}`)];return new $(...v,Q.join(`
|
|
20
|
+
`))}}var Z3;var D3=b(()=>{Z3={major:4,minor:3,patch:6}});function h3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function uz($){if(!V2.test($))return!1;let v=$.replace(/[-_]/g,(Q)=>Q==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return h3(U)}function yz($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[Q]=U;if(!Q)return!1;let _=JSON.parse(atob(Q));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(v&&(!("alg"in _)||_.alg!==v))return!1;return!0}catch{return!1}}function kz($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues));v.value[U]=$.value}function T2($,v,U,Q,_){if($.issues.length){if(_&&!(U in Q))return;v.issues.push(...L4(U,$.issues))}if($.value===void 0){if(U in Q)v.value[U]=void 0}else v.value[U]=$.value}function Cz($){let v=Object.keys($.shape);for(let Q of v)if(!$.shape?.[Q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Q}": expected a Zod schema`);let U=B9($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function fz($,v,U,Q,_,J){let Y=[],z=_.keySet,I=_.catchall._zod,X=I.def.type,q=I.optout==="optional";for(let G in v){if(z.has(G))continue;if(X==="never"){Y.push(G);continue}let j=I.run({value:v[G],issues:[]},Q);if(j instanceof Promise)$.push(j.then((H)=>T2(H,U,G,v,q)));else T2(j,U,G,v,q)}if(Y.length)U.issues.push({code:"unrecognized_keys",keys:Y,input:v,inst:J});if(!$.length)return U;return Promise.all($).then(()=>{return U})}function Az($,v,U,Q){for(let J of $)if(J.issues.length===0)return v.value=J.value,v;let _=$.filter((J)=>!x6(J));if(_.length===1)return v.value=_[0].value,_[0];return v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,d$())))}),v}function Oz($,v,U,Q){let _=$.filter((J)=>J.issues.length===0);if(_.length===1)return v.value=_[0].value,v;if(_.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((J)=>J.issues.map((Y)=>H4(Y,Q,d$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:[],inclusive:!1});return v}function V3($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(P6($)&&P6(v)){let U=Object.keys(v),Q=Object.keys($).filter((J)=>U.indexOf(J)!==-1),_={...$,...v};for(let J of Q){let Y=V3($[J],v[J]);if(!Y.valid)return{valid:!1,mergeErrorPath:[J,...Y.mergeErrorPath]};_[J]=Y.data}return{valid:!0,data:_}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Q=0;Q<$.length;Q++){let _=$[Q],J=v[Q],Y=V3(_,J);if(!Y.valid)return{valid:!1,mergeErrorPath:[Q,...Y.mergeErrorPath]};U.push(Y.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Fz($,v,U){let Q=new Map,_;for(let z of v.issues)if(z.code==="unrecognized_keys"){_??(_=z);for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).l=!0}}else $.issues.push(z);for(let z of U.issues)if(z.code==="unrecognized_keys")for(let I of z.keys){if(!Q.has(I))Q.set(I,{});Q.get(I).r=!0}else $.issues.push(z);let J=[...Q].filter(([,z])=>z.l&&z.r).map(([z])=>z);if(J.length&&_)$.issues.push({..._,keys:J});if(x6($))return $;let Y=V3(v.value,U.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}function O2($,v,U){if($.issues.length)v.issues.push(...L4(U,$.issues));v.value[U]=$.value}function Nz($,v,U,Q,_,J,Y){if($.issues.length)if(t0.has(typeof Q))U.issues.push(...L4(Q,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:_,inst:J,issues:$.issues.map((z)=>H4(z,Y,d$()))});if(v.issues.length)if(t0.has(typeof Q))U.issues.push(...L4(Q,v.issues));else U.issues.push({origin:"map",code:"invalid_element",input:_,inst:J,key:Q,issues:v.issues.map((z)=>H4(z,Y,d$()))});U.value.set($.value,v.value)}function Sz($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}function Tz($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}function Rz($,v){if($.value===void 0)$.value=v.defaultValue;return $}function Ez($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}function F2($,v,U){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},U)}function N2($,v,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let _=v.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>S2($,J,v.out,U));return S2($,_,v.out,U)}else{let _=v.reverseTransform($.value,$);if(_ instanceof Promise)return _.then((J)=>S2($,J,v.in,U));return S2($,_,v.in,U)}}function S2($,v,U,Q){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:v,issues:$.issues},Q)}function Pz($){return $.value=Object.freeze($.value),$}function xz($,v,U,Q){if(!$){let _={code:"custom",input:U,inst:Q,path:[...Q._zod.def.path??[]],continue:!Q._zod.def.abort};if(Q._zod.def.params)_.params=Q._zod.def.params;v.issues.push(h1(_))}}var e,_1,A$,M3,w3,L3,k3,A3,O3,F3,N3,S3,T3,R3,E3,P3,x3,u3,y3,C3,f3,m3,g3,c3,l3,d3,p3,i3,R2,n3,Jv,E2,r3,o3,t3,a3,s3,e3,$7,v7,_7,U7,mz,Q7,Yv,J7,Y7,z7,P2,I7,X7,q7,G7,j7,K7,H7,x2,W7,b7,B7,Z7,D7,V7,M7,w7,L7,zv,k7,A7,O7,F7,N7,S7;var T7=b(()=>{k2();f1();A9();M2();l();D3();l();e=B("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=Z3;let Q=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Q.unshift($);for(let _ of Q)for(let J of _._zod.onattach)J($);if(Q.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(Y,z,I)=>{let X=x6(Y),q;for(let G of z){if(G._zod.def.when){if(!G._zod.def.when(Y))continue}else if(X)continue;let j=Y.issues.length,H=G._zod.check(Y);if(H instanceof Promise&&I?.async===!1)throw new U6;if(q||H instanceof Promise)q=(q??Promise.resolve()).then(async()=>{if(await H,Y.issues.length===j)return;if(!X)X=x6(Y,j)});else{if(Y.issues.length===j)continue;if(!X)X=x6(Y,j)}}if(q)return q.then(()=>{return Y});return Y},J=(Y,z,I)=>{if(x6(Y))return Y.aborted=!0,Y;let X=_(z,Q,I);if(X instanceof Promise){if(I.async===!1)throw new U6;return X.then((q)=>$._zod.parse(q,I))}return $._zod.parse(X,I)};$._zod.run=(Y,z)=>{if(z.skipChecks)return $._zod.parse(Y,z);if(z.direction==="backward"){let X=$._zod.parse({value:Y.value,issues:[]},{...z,skipChecks:!0});if(X instanceof Promise)return X.then((q)=>{return J(q,Y,z)});return J(X,Y,z)}let I=$._zod.parse(Y,z);if(I instanceof Promise){if(z.async===!1)throw new U6;return I.then((X)=>_(X,Q,z))}return _(I,Q,z)}}Y$($,"~standard",()=>({validate:(_)=>{try{let J=L9($,_);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return k9($,_).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}))}),_1=B("$ZodString",($,v)=>{e.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??i9($._zod.bag),$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=String(U.value)}catch(_){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),A$=B("$ZodStringFormat",($,v)=>{i1.init($,v),_1.init($,v)}),M3=B("$ZodGUID",($,v)=>{v.pattern??(v.pattern=P9),A$.init($,v)}),w3=B("$ZodUUID",($,v)=>{if(v.version){let Q={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(Q===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=v1(Q))}else v.pattern??(v.pattern=v1());A$.init($,v)}),L3=B("$ZodEmail",($,v)=>{v.pattern??(v.pattern=x9),A$.init($,v)}),k3=B("$ZodURL",($,v)=>{A$.init($,v),$._zod.check=(U)=>{try{let Q=U.value.trim(),_=new URL(Q);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(_.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=_.href;else U.value=Q;return}catch(Q){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),A3=B("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=u9()),A$.init($,v)}),O3=B("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=R9),A$.init($,v)}),F3=B("$ZodCUID",($,v)=>{v.pattern??(v.pattern=O9),A$.init($,v)}),N3=B("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=F9),A$.init($,v)}),S3=B("$ZodULID",($,v)=>{v.pattern??(v.pattern=N9),A$.init($,v)}),T3=B("$ZodXID",($,v)=>{v.pattern??(v.pattern=S9),A$.init($,v)}),R3=B("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=T9),A$.init($,v)}),E3=B("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=p9(v)),A$.init($,v)}),P3=B("$ZodISODate",($,v)=>{v.pattern??(v.pattern=l9),A$.init($,v)}),x3=B("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=d9(v)),A$.init($,v)}),u3=B("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=E9),A$.init($,v)}),y3=B("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=y9),A$.init($,v),$._zod.bag.format="ipv4"}),C3=B("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=C9),A$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!v.abort})}}}),f3=B("$ZodMAC",($,v)=>{v.pattern??(v.pattern=f9(v.delimiter)),A$.init($,v),$._zod.bag.format="mac"}),m3=B("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=m9),A$.init($,v)}),g3=B("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=g9),A$.init($,v),$._zod.check=(U)=>{let Q=U.value.split("/");try{if(Q.length!==2)throw Error();let[_,J]=Q;if(!J)throw Error();let Y=Number(J);if(`${Y}`!==J)throw Error();if(Y<0||Y>128)throw Error();new URL(`http://[${_}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});c3=B("$ZodBase64",($,v)=>{v.pattern??(v.pattern=h9),A$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(h3(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});l3=B("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=V2),A$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(uz(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),d3=B("$ZodE164",($,v)=>{v.pattern??(v.pattern=c9),A$.init($,v)});p3=B("$ZodJWT",($,v)=>{A$.init($,v),$._zod.check=(U)=>{if(yz(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),i3=B("$ZodCustomStringFormat",($,v)=>{A$.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),R2=B("$ZodNumber",($,v)=>{e.init($,v),$._zod.pattern=$._zod.bag.pattern??_v,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=Number(U.value)}catch(Y){}let _=U.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return U;let J=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:_,inst:$,...J?{received:J}:{}}),U}}),n3=B("$ZodNumberFormat",($,v)=>{v3.init($,v),R2.init($,v)}),Jv=B("$ZodBoolean",($,v)=>{e.init($,v),$._zod.pattern=o9,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(J){}let _=U.value;if(typeof _==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:$}),U}}),E2=B("$ZodBigInt",($,v)=>{e.init($,v),$._zod.pattern=n9,$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(_){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),r3=B("$ZodBigIntFormat",($,v)=>{_3.init($,v),E2.init($,v)}),o3=B("$ZodSymbol",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:_,inst:$}),U}}),t3=B("$ZodUndefined",($,v)=>{e.init($,v),$._zod.pattern=a9,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:_,inst:$}),U}}),a3=B("$ZodNull",($,v)=>{e.init($,v),$._zod.pattern=t9,$._zod.values=new Set([null]),$._zod.parse=(U,Q)=>{let _=U.value;if(_===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:_,inst:$}),U}}),s3=B("$ZodAny",($,v)=>{e.init($,v),$._zod.parse=(U)=>U}),e3=B("$ZodUnknown",($,v)=>{e.init($,v),$._zod.parse=(U)=>U}),$7=B("$ZodNever",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),v7=B("$ZodVoid",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:_,inst:$}),U}}),_7=B("$ZodDate",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(z){}let _=U.value,J=_ instanceof Date;if(J&&!Number.isNaN(_.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:_,...J?{received:"Invalid Date"}:{},inst:$}),U}});U7=B("$ZodArray",($,v)=>{e.init($,v),$._zod.parse=(U,Q)=>{let _=U.value;if(!Array.isArray(_))return U.issues.push({expected:"array",code:"invalid_type",input:_,inst:$}),U;U.value=Array(_.length);let J=[];for(let Y=0;Y<_.length;Y++){let z=_[Y],I=v.element._zod.run({value:z,issues:[]},Q);if(I instanceof Promise)J.push(I.then((X)=>kz(X,U,Y)));else kz(I,U,Y)}if(J.length)return Promise.all(J).then(()=>U);return U}});mz=B("$ZodObject",($,v)=>{if(e.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let z=v.shape;Object.defineProperty(v,"shape",{get:()=>{let I={...z};return Object.defineProperty(v,"shape",{value:I}),I}})}let Q=g1(()=>Cz(v));Y$($._zod,"propValues",()=>{let z=v.shape,I={};for(let X in z){let q=z[X]._zod;if(q.values){I[X]??(I[X]=new Set);for(let G of q.values)I[X].add(G)}}return I});let _=$1,J=v.catchall,Y;$._zod.parse=(z,I)=>{Y??(Y=Q.value);let X=z.value;if(!_(X))return z.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),z;z.value={};let q=[],G=Y.shape;for(let j of Y.keys){let H=G[j],Z=H._zod.optout==="optional",D=H._zod.run({value:X[j],issues:[]},I);if(D instanceof Promise)q.push(D.then((E)=>T2(E,z,j,X,Z)));else T2(D,z,j,X,Z)}if(!J)return q.length?Promise.all(q).then(()=>z):z;return fz(q,X,z,I,Q.value,$)}}),Q7=B("$ZodObjectJIT",($,v)=>{mz.init($,v);let U=$._zod.parse,Q=g1(()=>Cz(v)),_=(j)=>{let H=new A2(["shape","payload","ctx"]),Z=Q.value,D=(O)=>{let g=I2(O);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};H.write("const input = payload.value;");let E=Object.create(null),A=0;for(let O of Z.keys)E[O]=`key_${A++}`;H.write("const newResult = {};");for(let O of Z.keys){let g=E[O],w=I2(O),L=j[O]?._zod?.optout==="optional";if(H.write(`const ${g} = ${D(O)};`),L)H.write(`
|
|
21
|
+
if (${g}.issues.length) {
|
|
22
|
+
if (${w} in input) {
|
|
23
|
+
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${g}.value === undefined) {
|
|
31
|
+
if (${w} in input) {
|
|
32
|
+
newResult[${w}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${w}] = ${g}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`);else H.write(`
|
|
39
|
+
if (${g}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (${g}.value === undefined) {
|
|
47
|
+
if (${w} in input) {
|
|
48
|
+
newResult[${w}] = undefined;
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
newResult[${w}] = ${g}.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
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>
|
|
55
|
+
|
|
56
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Y of $.seen.entries()){let z=Y[1];if(v===Y[0]){J(Y);continue}if($.external){let X=$.external.registry.get(Y[0])?.id;if(v!==Y[0]&&X){J(Y);continue}}if($.metadataRegistry.get(Y[0])?.id){J(Y);continue}if(z.cycle){J(Y);continue}if(z.count>1){if($.reused==="ref"){J(Y);continue}}}}function m6($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Q=(Y)=>{let z=$.seen.get(Y);if(z.ref===null)return;let I=z.def??z.schema,X={...I},q=z.ref;if(z.ref=null,q){Q(q);let j=$.seen.get(q),H=j.schema;if(H.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))I.allOf=I.allOf??[],I.allOf.push(H);else Object.assign(I,H);if(Object.assign(I,X),Y._zod.parent===q)for(let D in I){if(D==="$ref"||D==="allOf")continue;if(!(D in X))delete I[D]}if(H.$ref&&j.def)for(let D in I){if(D==="$ref"||D==="allOf")continue;if(D in j.def&&JSON.stringify(I[D])===JSON.stringify(j.def[D]))delete I[D]}}let G=Y._zod.parent;if(G&&G!==q){Q(G);let j=$.seen.get(G);if(j?.schema.$ref){if(I.$ref=j.schema.$ref,j.def)for(let H in I){if(H==="$ref"||H==="allOf")continue;if(H in j.def&&JSON.stringify(I[H])===JSON.stringify(j.def[H]))delete I[H]}}}$.override({zodSchema:Y,jsonSchema:I,path:z.path??[]})};for(let Y of[...$.seen.entries()].reverse())Q(Y[0]);let _={};if($.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Y=$.external.registry.get(v)?.id;if(!Y)throw Error("Schema is missing an `id` property");_.$id=$.external.uri(Y)}Object.assign(_,U.def??U.schema);let J=$.external?.defs??{};for(let Y of $.seen.entries()){let z=Y[1];if(z.def&&z.defId)J[z.defId]=z.def}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")_.$defs=J;else _.definitions=J;try{let Y=JSON.parse(JSON.stringify(_));return Object.defineProperty(Y,"~standard",{value:{...v["~standard"],jsonSchema:{input:z0(v,"input",$.processors),output:z0(v,"output",$.processors)}},enumerable:!1,writable:!1}),Y}catch(Y){throw Error("Error converting schema to JSON.")}}function I4($,v){let U=v??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let Q=$._zod.def;if(Q.type==="transform")return!0;if(Q.type==="array")return I4(Q.element,U);if(Q.type==="set")return I4(Q.valueType,U);if(Q.type==="lazy")return I4(Q.getter(),U);if(Q.type==="promise"||Q.type==="optional"||Q.type==="nonoptional"||Q.type==="nullable"||Q.type==="readonly"||Q.type==="default"||Q.type==="prefault")return I4(Q.innerType,U);if(Q.type==="intersection")return I4(Q.left,U)||I4(Q.right,U);if(Q.type==="record"||Q.type==="map")return I4(Q.keyType,U)||I4(Q.valueType,U);if(Q.type==="pipe")return I4(Q.in,U)||I4(Q.out,U);if(Q.type==="object"){for(let _ in Q.shape)if(I4(Q.shape[_],U))return!0;return!1}if(Q.type==="union"){for(let _ of Q.options)if(I4(_,U))return!0;return!1}if(Q.type==="tuple"){for(let _ of Q.items)if(I4(_,U))return!0;if(Q.rest&&I4(Q.rest,U))return!0;return!1}return!1}var WU=($,v={})=>(U)=>{let Q=C6({...U,processors:v});return M$($,Q),f6(Q,$),m6(Q,$)},z0=($,v,U={})=>(Q)=>{let{libraryOptions:_,target:J}=Q??{},Y=C6({..._??{},target:J,io:v,processors:U});return M$($,Y),f6(Y,$),m6(Y,$)};var bv=b(()=>{Kv()});function q_($,v){if("_idmap"in $){let Q=$,_=C6({...v,processors:z_}),J={};for(let I of Q._idmap.entries()){let[X,q]=I;M$(q,_)}let Y={},z={registry:Q,uri:v?.uri,defs:J};_.external=z;for(let I of Q._idmap.entries()){let[X,q]=I;f6(_,q),Y[X]=m6(_,q)}if(Object.keys(J).length>0){let I=_.target==="draft-2020-12"?"$defs":"definitions";Y.__shared={[I]:J}}return{schemas:Y}}let U=C6({...v,processors:z_});return M$($,U),f6(U,$),m6(U,$)}var TZ,bU=($,v,U,Q)=>{let _=U;_.type="string";let{minimum:J,maximum:Y,format:z,patterns:I,contentEncoding:X}=$._zod.bag;if(typeof J==="number")_.minLength=J;if(typeof Y==="number")_.maxLength=Y;if(z){if(_.format=TZ[z]??z,_.format==="")delete _.format;if(z==="time")delete _.format}if(X)_.contentEncoding=X;if(I&&I.size>0){let q=[...I];if(q.length===1)_.pattern=q[0].source;else if(q.length>1)_.allOf=[...q.map((G)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},BU=($,v,U,Q)=>{let _=U,{minimum:J,maximum:Y,format:z,multipleOf:I,exclusiveMaximum:X,exclusiveMinimum:q}=$._zod.bag;if(typeof z==="string"&&z.includes("int"))_.type="integer";else _.type="number";if(typeof q==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.minimum=q,_.exclusiveMinimum=!0;else _.exclusiveMinimum=q;if(typeof J==="number"){if(_.minimum=J,typeof q==="number"&&v.target!=="draft-04")if(q>=J)delete _.minimum;else delete _.exclusiveMinimum}if(typeof X==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.maximum=X,_.exclusiveMaximum=!0;else _.exclusiveMaximum=X;if(typeof Y==="number"){if(_.maximum=Y,typeof X==="number"&&v.target!=="draft-04")if(X<=Y)delete _.maximum;else delete _.exclusiveMaximum}if(typeof I==="number")_.multipleOf=I},ZU=($,v,U,Q)=>{U.type="boolean"},DU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},VU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},MU=($,v,U,Q)=>{if(v.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},wU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},LU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},kU=($,v,U,Q)=>{U.not={}},AU=($,v,U,Q)=>{},OU=($,v,U,Q)=>{},FU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},NU=($,v,U,Q)=>{let _=$._zod.def,J=r0(_.entries);if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";U.enum=J},SU=($,v,U,Q)=>{let _=$._zod.def,J=[];for(let Y of _.values)if(Y===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof Y==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else J.push(Number(Y));else J.push(Y);if(J.length===0);else if(J.length===1){let Y=J[0];if(U.type=Y===null?"null":typeof Y,v.target==="draft-04"||v.target==="openapi-3.0")U.enum=[Y];else U.const=Y}else{if(J.every((Y)=>typeof Y==="number"))U.type="number";if(J.every((Y)=>typeof Y==="string"))U.type="string";if(J.every((Y)=>typeof Y==="boolean"))U.type="boolean";if(J.every((Y)=>Y===null))U.type="null";U.enum=J}},TU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},RU=($,v,U,Q)=>{let _=U,J=$._zod.pattern;if(!J)throw Error("Pattern not found in template literal");_.type="string",_.pattern=J.source},EU=($,v,U,Q)=>{let _=U,J={type:"string",format:"binary",contentEncoding:"binary"},{minimum:Y,maximum:z,mime:I}=$._zod.bag;if(Y!==void 0)J.minLength=Y;if(z!==void 0)J.maxLength=z;if(I)if(I.length===1)J.contentMediaType=I[0],Object.assign(_,J);else Object.assign(_,J),_.anyOf=I.map((X)=>({contentMediaType:X}));else Object.assign(_,J)},PU=($,v,U,Q)=>{U.type="boolean"},xU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},uU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},yU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},CU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},fU=($,v,U,Q)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},mU=($,v,U,Q)=>{let _=U,J=$._zod.def,{minimum:Y,maximum:z}=$._zod.bag;if(typeof Y==="number")_.minItems=Y;if(typeof z==="number")_.maxItems=z;_.type="array",_.items=M$(J.element,v,{...Q,path:[...Q.path,"items"]})},gU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="object",_.properties={};let Y=J.shape;for(let X in Y)_.properties[X]=M$(Y[X],v,{...Q,path:[...Q.path,"properties",X]});let z=new Set(Object.keys(Y)),I=new Set([...z].filter((X)=>{let q=J.shape[X]._zod;if(v.io==="input")return q.optin===void 0;else return q.optout===void 0}));if(I.size>0)_.required=Array.from(I);if(J.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!J.catchall){if(v.io==="output")_.additionalProperties=!1}else if(J.catchall)_.additionalProperties=M$(J.catchall,v,{...Q,path:[...Q.path,"additionalProperties"]})},I_=($,v,U,Q)=>{let _=$._zod.def,J=_.inclusive===!1,Y=_.options.map((z,I)=>M$(z,v,{...Q,path:[...Q.path,J?"oneOf":"anyOf",I]}));if(J)U.oneOf=Y;else U.anyOf=Y},hU=($,v,U,Q)=>{let _=$._zod.def,J=M$(_.left,v,{...Q,path:[...Q.path,"allOf",0]}),Y=M$(_.right,v,{...Q,path:[...Q.path,"allOf",1]}),z=(X)=>("allOf"in X)&&Object.keys(X).length===1,I=[...z(J)?J.allOf:[J],...z(Y)?Y.allOf:[Y]];U.allOf=I},cU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="array";let Y=v.target==="draft-2020-12"?"prefixItems":"items",z=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",I=J.items.map((j,H)=>M$(j,v,{...Q,path:[...Q.path,Y,H]})),X=J.rest?M$(J.rest,v,{...Q,path:[...Q.path,z,...v.target==="openapi-3.0"?[J.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(_.prefixItems=I,X)_.items=X}else if(v.target==="openapi-3.0"){if(_.items={anyOf:I},X)_.items.anyOf.push(X);if(_.minItems=I.length,!X)_.maxItems=I.length}else if(_.items=I,X)_.additionalItems=X;let{minimum:q,maximum:G}=$._zod.bag;if(typeof q==="number")_.minItems=q;if(typeof G==="number")_.maxItems=G},lU=($,v,U,Q)=>{let _=U,J=$._zod.def;_.type="object";let Y=J.keyType,I=Y._zod.bag?.patterns;if(J.mode==="loose"&&I&&I.size>0){let q=M$(J.valueType,v,{...Q,path:[...Q.path,"patternProperties","*"]});_.patternProperties={};for(let G of I)_.patternProperties[G.source]=q}else{if(v.target==="draft-07"||v.target==="draft-2020-12")_.propertyNames=M$(J.keyType,v,{...Q,path:[...Q.path,"propertyNames"]});_.additionalProperties=M$(J.valueType,v,{...Q,path:[...Q.path,"additionalProperties"]})}let X=Y._zod.values;if(X){let q=[...X].filter((G)=>typeof G==="string"||typeof G==="number");if(q.length>0)_.required=q}},dU=($,v,U,Q)=>{let _=$._zod.def,J=M$(_.innerType,v,Q),Y=v.seen.get($);if(v.target==="openapi-3.0")Y.ref=_.innerType,U.nullable=!0;else U.anyOf=[J,{type:"null"}]},pU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},iU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType,U.default=JSON.parse(JSON.stringify(_.defaultValue))},nU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);if(J.ref=_.innerType,v.io==="input")U._prefault=JSON.parse(JSON.stringify(_.defaultValue))},rU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType;let Y;try{Y=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=Y},oU=($,v,U,Q)=>{let _=$._zod.def,J=v.io==="input"?_.in._zod.def.type==="transform"?_.out:_.in:_.out;M$(J,v,Q);let Y=v.seen.get($);Y.ref=J},tU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType,U.readOnly=!0},aU=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},X_=($,v,U,Q)=>{let _=$._zod.def;M$(_.innerType,v,Q);let J=v.seen.get($);J.ref=_.innerType},sU=($,v,U,Q)=>{let _=$._zod.innerType;M$(_,v,Q);let J=v.seen.get($);J.ref=_},z_;var Bv=b(()=>{bv();l();TZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},z_={string:bU,number:BU,boolean:ZU,bigint:DU,symbol:VU,null:MU,undefined:wU,void:LU,never:kU,any:AU,unknown:OU,date:FU,enum:NU,literal:SU,nan:TU,template_literal:RU,file:EU,success:PU,custom:xU,function:uU,transform:yU,map:CU,set:fU,array:mU,object:gU,union:I_,intersection:hU,tuple:cU,record:lU,nullable:dU,nonoptional:pU,default:iU,prefault:nU,catch:rU,pipe:oU,readonly:tU,promise:aU,optional:X_,lazy:sU}});class eU{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=C6({processors:z_,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return M$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}f6(this.ctx,$);let U=m6(this.ctx,$),{"~standard":Q,..._}=U;return _}}var mI=b(()=>{Bv();bv()});var gI={};var hI=()=>{};var B6={};s$(B6,{version:()=>Z3,util:()=>R,treeifyError:()=>V9,toJSONSchema:()=>q_,toDotPath:()=>Bz,safeParseAsync:()=>k9,safeParse:()=>L9,safeEncodeAsync:()=>Cb,safeEncode:()=>ub,safeDecodeAsync:()=>fb,safeDecode:()=>yb,registry:()=>u2,regexes:()=>x4,process:()=>M$,prettifyError:()=>M9,parseAsync:()=>G2,parse:()=>q2,meta:()=>KU,locales:()=>jv,isValidJWT:()=>yz,isValidBase64URL:()=>uz,isValidBase64:()=>h3,initializeContext:()=>C6,globalRegistry:()=>e$,globalConfig:()=>i0,formatError:()=>vv,flattenError:()=>$v,finalize:()=>m6,extractDefs:()=>f6,encodeAsync:()=>Pb,encode:()=>Rb,describe:()=>jU,decodeAsync:()=>xb,decode:()=>Eb,createToJSONSchemaMethod:()=>WU,createStandardJSONSchemaMethod:()=>z0,config:()=>d$,clone:()=>Y4,_xor:()=>IZ,_xid:()=>i2,_void:()=>UU,_uuidv7:()=>g2,_uuidv6:()=>m2,_uuidv4:()=>f2,_uuid:()=>C2,_url:()=>Wv,_uppercase:()=>t1,_unknown:()=>vU,_union:()=>zZ,_undefined:()=>s5,_ulid:()=>p2,_uint64:()=>t5,_uint32:()=>d5,_tuple:()=>GZ,_trim:()=>_0,_transform:()=>ZZ,_toUpperCase:()=>Q0,_toLowerCase:()=>U0,_templateLiteral:()=>FZ,_symbol:()=>a5,_superRefine:()=>GU,_success:()=>LZ,_stringbool:()=>HU,_stringFormat:()=>Y0,_string:()=>T5,_startsWith:()=>s1,_slugify:()=>J0,_size:()=>U1,_set:()=>HZ,_safeParseAsync:()=>p1,_safeParse:()=>d1,_safeEncodeAsync:()=>Z2,_safeEncode:()=>b2,_safeDecodeAsync:()=>D2,_safeDecode:()=>B2,_regex:()=>r1,_refine:()=>qU,_record:()=>jZ,_readonly:()=>OZ,_property:()=>Y_,_promise:()=>SZ,_positive:()=>__,_pipe:()=>AZ,_parseAsync:()=>l1,_parse:()=>c1,_overwrite:()=>d4,_optional:()=>DZ,_number:()=>f5,_nullable:()=>VZ,_null:()=>e5,_normalize:()=>v0,_nonpositive:()=>Q_,_nonoptional:()=>wZ,_nonnegative:()=>J_,_never:()=>_U,_negative:()=>U_,_nativeEnum:()=>bZ,_nanoid:()=>c2,_nan:()=>YU,_multipleOf:()=>u6,_minSize:()=>Y6,_minLength:()=>b6,_min:()=>z4,_mime:()=>$0,_maxSize:()=>y6,_maxLength:()=>Q1,_max:()=>k4,_map:()=>KZ,_mac:()=>E5,_lte:()=>k4,_lt:()=>Q6,_lowercase:()=>o1,_literal:()=>BZ,_length:()=>J1,_lazy:()=>NZ,_ksuid:()=>n2,_jwt:()=>v_,_isoTime:()=>y5,_isoDuration:()=>C5,_isoDateTime:()=>x5,_isoDate:()=>u5,_ipv6:()=>o2,_ipv4:()=>r2,_intersection:()=>qZ,_int64:()=>o5,_int32:()=>l5,_int:()=>g5,_includes:()=>a1,_guid:()=>Hv,_gte:()=>z4,_gt:()=>J6,_float64:()=>c5,_float32:()=>h5,_file:()=>IU,_enum:()=>WZ,_endsWith:()=>e1,_encodeAsync:()=>H2,_encode:()=>j2,_emoji:()=>h2,_email:()=>y2,_e164:()=>$_,_discriminatedUnion:()=>XZ,_default:()=>MZ,_decodeAsync:()=>W2,_decode:()=>K2,_date:()=>QU,_custom:()=>XU,_cuid2:()=>d2,_cuid:()=>l2,_coercedString:()=>R5,_coercedNumber:()=>m5,_coercedDate:()=>JU,_coercedBoolean:()=>i5,_coercedBigint:()=>r5,_cidrv6:()=>a2,_cidrv4:()=>t2,_check:()=>CI,_catch:()=>kZ,_boolean:()=>p5,_bigint:()=>n5,_base64url:()=>e2,_base64:()=>s2,_array:()=>zU,_any:()=>$U,TimePrecision:()=>P5,NEVER:()=>X9,JSONSchemaGenerator:()=>eU,JSONSchema:()=>gI,Doc:()=>A2,$output:()=>F5,$input:()=>N5,$constructor:()=>B,$brand:()=>q9,$ZodXor:()=>J7,$ZodXID:()=>T3,$ZodVoid:()=>v7,$ZodUnknown:()=>e3,$ZodUnion:()=>Yv,$ZodUndefined:()=>t3,$ZodUUID:()=>w3,$ZodURL:()=>k3,$ZodULID:()=>S3,$ZodType:()=>e,$ZodTuple:()=>P2,$ZodTransform:()=>H7,$ZodTemplateLiteral:()=>A7,$ZodSymbol:()=>o3,$ZodSuccess:()=>V7,$ZodStringFormat:()=>A$,$ZodString:()=>_1,$ZodSet:()=>q7,$ZodRegistry:()=>S5,$ZodRecord:()=>I7,$ZodRealError:()=>W4,$ZodReadonly:()=>k7,$ZodPromise:()=>F7,$ZodPrefault:()=>Z7,$ZodPipe:()=>L7,$ZodOptional:()=>x2,$ZodObjectJIT:()=>Q7,$ZodObject:()=>mz,$ZodNumberFormat:()=>n3,$ZodNumber:()=>R2,$ZodNullable:()=>b7,$ZodNull:()=>a3,$ZodNonOptional:()=>D7,$ZodNever:()=>$7,$ZodNanoID:()=>O3,$ZodNaN:()=>w7,$ZodMap:()=>X7,$ZodMAC:()=>f3,$ZodLiteral:()=>j7,$ZodLazy:()=>N7,$ZodKSUID:()=>R3,$ZodJWT:()=>p3,$ZodIntersection:()=>z7,$ZodISOTime:()=>x3,$ZodISODuration:()=>u3,$ZodISODateTime:()=>E3,$ZodISODate:()=>P3,$ZodIPv6:()=>C3,$ZodIPv4:()=>y3,$ZodGUID:()=>M3,$ZodFunction:()=>O7,$ZodFile:()=>K7,$ZodExactOptional:()=>W7,$ZodError:()=>e0,$ZodEnum:()=>G7,$ZodEncodeError:()=>e6,$ZodEmoji:()=>A3,$ZodEmail:()=>L3,$ZodE164:()=>d3,$ZodDiscriminatedUnion:()=>Y7,$ZodDefault:()=>B7,$ZodDate:()=>_7,$ZodCustomStringFormat:()=>i3,$ZodCustom:()=>S7,$ZodCodec:()=>zv,$ZodCheckUpperCase:()=>G3,$ZodCheckStringFormat:()=>i1,$ZodCheckStartsWith:()=>K3,$ZodCheckSizeEquals:()=>J3,$ZodCheckRegex:()=>X3,$ZodCheckProperty:()=>W3,$ZodCheckOverwrite:()=>B3,$ZodCheckNumberFormat:()=>v3,$ZodCheckMultipleOf:()=>$3,$ZodCheckMinSize:()=>Q3,$ZodCheckMinLength:()=>z3,$ZodCheckMimeType:()=>b3,$ZodCheckMaxSize:()=>U3,$ZodCheckMaxLength:()=>Y3,$ZodCheckLowerCase:()=>q3,$ZodCheckLessThan:()=>w2,$ZodCheckLengthEquals:()=>I3,$ZodCheckIncludes:()=>j3,$ZodCheckGreaterThan:()=>L2,$ZodCheckEndsWith:()=>H3,$ZodCheckBigIntFormat:()=>_3,$ZodCheck:()=>T$,$ZodCatch:()=>M7,$ZodCUID2:()=>N3,$ZodCUID:()=>F3,$ZodCIDRv6:()=>g3,$ZodCIDRv4:()=>m3,$ZodBoolean:()=>Jv,$ZodBigIntFormat:()=>r3,$ZodBigInt:()=>E2,$ZodBase64URL:()=>l3,$ZodBase64:()=>c3,$ZodAsyncError:()=>U6,$ZodArray:()=>U7,$ZodAny:()=>s3});var A4=b(()=>{l();M2();O5();Bv();mI();hI();f1();A9();w9();T7();k2();D3();Kv();fI();bv()});var G_={};s$(G_,{uppercase:()=>t1,trim:()=>_0,toUpperCase:()=>Q0,toLowerCase:()=>U0,startsWith:()=>s1,slugify:()=>J0,size:()=>U1,regex:()=>r1,property:()=>Y_,positive:()=>__,overwrite:()=>d4,normalize:()=>v0,nonpositive:()=>Q_,nonnegative:()=>J_,negative:()=>U_,multipleOf:()=>u6,minSize:()=>Y6,minLength:()=>b6,mime:()=>$0,maxSize:()=>y6,maxLength:()=>Q1,lte:()=>k4,lt:()=>Q6,lowercase:()=>o1,length:()=>J1,includes:()=>a1,gte:()=>z4,gt:()=>J6,endsWith:()=>e1});var j_=b(()=>{A4()});var I0={};s$(I0,{time:()=>_Q,duration:()=>UQ,datetime:()=>$Q,date:()=>vQ,ZodISOTime:()=>W_,ZodISODuration:()=>b_,ZodISODateTime:()=>K_,ZodISODate:()=>H_});function $Q($){return x5(K_,$)}function vQ($){return u5(H_,$)}function _Q($){return y5(W_,$)}function UQ($){return C5(b_,$)}var K_,H_,W_,b_;var Zv=b(()=>{A4();Vv();K_=B("ZodISODateTime",($,v)=>{E3.init($,v),O$.init($,v)});H_=B("ZodISODate",($,v)=>{P3.init($,v),O$.init($,v)});W_=B("ZodISOTime",($,v)=>{x3.init($,v),O$.init($,v)});b_=B("ZodISODuration",($,v)=>{u3.init($,v),O$.init($,v)})});var cI=($,v)=>{e0.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>vv($,U)},flatten:{value:(U)=>$v($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,m1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,m1,2)}},isEmpty:{get(){return $.issues.length===0}}})},B_,b4;var QQ=b(()=>{A4();A4();l();B_=B("ZodError",cI),b4=B("ZodError",cI,{Parent:Error})});var JQ,YQ,zQ,IQ,XQ,qQ,GQ,jQ,KQ,HQ,WQ,bQ;var BQ=b(()=>{A4();QQ();JQ=c1(b4),YQ=l1(b4),zQ=d1(b4),IQ=p1(b4),XQ=j2(b4),qQ=K2(b4),GQ=H2(b4),jQ=W2(b4),KQ=b2(b4),HQ=B2(b4),WQ=Z2(b4),bQ=D2(b4)});var Dv={};s$(Dv,{xor:()=>PX,xid:()=>_X,void:()=>FX,uuidv7:()=>rI,uuidv6:()=>nI,uuidv4:()=>iI,uuid:()=>pI,url:()=>oI,unknown:()=>Y1,union:()=>m_,undefined:()=>AX,ulid:()=>vX,uint64:()=>LX,uint32:()=>VX,tuple:()=>uQ,transform:()=>h_,templateLiteral:()=>iX,symbol:()=>kX,superRefine:()=>IJ,success:()=>lX,stringbool:()=>$q,stringFormat:()=>KX,string:()=>Z_,strictObject:()=>RX,set:()=>fX,refine:()=>zJ,record:()=>yQ,readonly:()=>vJ,promise:()=>nX,preprocess:()=>_q,prefault:()=>rQ,pipe:()=>kv,partialRecord:()=>uX,optional:()=>wv,object:()=>TX,number:()=>DQ,nullish:()=>cX,nullable:()=>Lv,null:()=>kQ,nonoptional:()=>oQ,never:()=>f_,nativeEnum:()=>mX,nanoid:()=>sI,nan:()=>dX,meta:()=>sX,map:()=>CX,mac:()=>JX,looseRecord:()=>yX,looseObject:()=>EX,literal:()=>gX,lazy:()=>QJ,ksuid:()=>UX,keyof:()=>SX,jwt:()=>jX,json:()=>vq,ipv6:()=>YX,ipv4:()=>QX,intersection:()=>PQ,int64:()=>wX,int32:()=>DX,int:()=>D_,instanceof:()=>eX,httpUrl:()=>tI,hostname:()=>HX,hex:()=>WX,hash:()=>bX,guid:()=>dI,function:()=>rX,float64:()=>ZX,float32:()=>BX,file:()=>hX,exactOptional:()=>lQ,enum:()=>g_,emoji:()=>aI,email:()=>lI,e164:()=>GX,discriminatedUnion:()=>xX,describe:()=>aX,date:()=>NX,custom:()=>tX,cuid2:()=>$X,cuid:()=>eI,codec:()=>pX,cidrv6:()=>IX,cidrv4:()=>zX,check:()=>oX,catch:()=>sQ,boolean:()=>VQ,bigint:()=>MX,base64url:()=>qX,base64:()=>XX,array:()=>Fv,any:()=>OX,_function:()=>rX,_default:()=>iQ,_ZodString:()=>V_,ZodXor:()=>TQ,ZodXID:()=>F_,ZodVoid:()=>NQ,ZodUnknown:()=>OQ,ZodUnion:()=>Sv,ZodUndefined:()=>wQ,ZodUUID:()=>z6,ZodURL:()=>Av,ZodULID:()=>O_,ZodType:()=>Q$,ZodTuple:()=>xQ,ZodTransform:()=>hQ,ZodTemplateLiteral:()=>_J,ZodSymbol:()=>MQ,ZodSuccess:()=>tQ,ZodStringFormat:()=>O$,ZodString:()=>q0,ZodSet:()=>fQ,ZodRecord:()=>Tv,ZodReadonly:()=>$J,ZodPromise:()=>JJ,ZodPrefault:()=>nQ,ZodPipe:()=>d_,ZodOptional:()=>c_,ZodObject:()=>Nv,ZodNumberFormat:()=>z1,ZodNumber:()=>j0,ZodNullable:()=>dQ,ZodNull:()=>LQ,ZodNonOptional:()=>l_,ZodNever:()=>FQ,ZodNanoID:()=>L_,ZodNaN:()=>eQ,ZodMap:()=>CQ,ZodMAC:()=>ZQ,ZodLiteral:()=>mQ,ZodLazy:()=>UJ,ZodKSUID:()=>N_,ZodJWT:()=>y_,ZodIntersection:()=>EQ,ZodIPv6:()=>T_,ZodIPv4:()=>S_,ZodGUID:()=>Mv,ZodFunction:()=>YJ,ZodFile:()=>gQ,ZodExactOptional:()=>cQ,ZodEnum:()=>X0,ZodEmoji:()=>w_,ZodEmail:()=>M_,ZodE164:()=>u_,ZodDiscriminatedUnion:()=>RQ,ZodDefault:()=>pQ,ZodDate:()=>Ov,ZodCustomStringFormat:()=>G0,ZodCustom:()=>Rv,ZodCodec:()=>p_,ZodCatch:()=>aQ,ZodCUID2:()=>A_,ZodCUID:()=>k_,ZodCIDRv6:()=>E_,ZodCIDRv4:()=>R_,ZodBoolean:()=>K0,ZodBigIntFormat:()=>C_,ZodBigInt:()=>H0,ZodBase64URL:()=>x_,ZodBase64:()=>P_,ZodArray:()=>SQ,ZodAny:()=>AQ});function Z_($){return T5(q0,$)}function lI($){return y2(M_,$)}function dI($){return Hv(Mv,$)}function pI($){return C2(z6,$)}function iI($){return f2(z6,$)}function nI($){return m2(z6,$)}function rI($){return g2(z6,$)}function oI($){return Wv(Av,$)}function tI($){return Wv(Av,{protocol:/^https?$/,hostname:x4.domain,...R.normalizeParams($)})}function aI($){return h2(w_,$)}function sI($){return c2(L_,$)}function eI($){return l2(k_,$)}function $X($){return d2(A_,$)}function vX($){return p2(O_,$)}function _X($){return i2(F_,$)}function UX($){return n2(N_,$)}function QX($){return r2(S_,$)}function JX($){return E5(ZQ,$)}function YX($){return o2(T_,$)}function zX($){return t2(R_,$)}function IX($){return a2(E_,$)}function XX($){return s2(P_,$)}function qX($){return e2(x_,$)}function GX($){return $_(u_,$)}function jX($){return v_(y_,$)}function KX($,v,U={}){return Y0(G0,$,v,U)}function HX($){return Y0(G0,"hostname",x4.hostname,$)}function WX($){return Y0(G0,"hex",x4.hex,$)}function bX($,v){let U=v?.enc??"hex",Q=`${$}_${U}`,_=x4[Q];if(!_)throw Error(`Unrecognized hash format: ${Q}`);return Y0(G0,Q,_,v)}function DQ($){return f5(j0,$)}function D_($){return g5(z1,$)}function BX($){return h5(z1,$)}function ZX($){return c5(z1,$)}function DX($){return l5(z1,$)}function VX($){return d5(z1,$)}function VQ($){return p5(K0,$)}function MX($){return n5(H0,$)}function wX($){return o5(C_,$)}function LX($){return t5(C_,$)}function kX($){return a5(MQ,$)}function AX($){return s5(wQ,$)}function kQ($){return e5(LQ,$)}function OX(){return $U(AQ)}function Y1(){return vU(OQ)}function f_($){return _U(FQ,$)}function FX($){return UU(NQ,$)}function NX($){return QU(Ov,$)}function Fv($,v){return zU(SQ,$,v)}function SX($){let v=$._zod.def.shape;return g_(Object.keys(v))}function TX($,v){let U={type:"object",shape:$??{},...R.normalizeParams(v)};return new Nv(U)}function RX($,v){return new Nv({type:"object",shape:$,catchall:f_(),...R.normalizeParams(v)})}function EX($,v){return new Nv({type:"object",shape:$,catchall:Y1(),...R.normalizeParams(v)})}function m_($,v){return new Sv({type:"union",options:$,...R.normalizeParams(v)})}function PX($,v){return new TQ({type:"union",options:$,inclusive:!1,...R.normalizeParams(v)})}function xX($,v,U){return new RQ({type:"union",options:v,discriminator:$,...R.normalizeParams(U)})}function PQ($,v){return new EQ({type:"intersection",left:$,right:v})}function uQ($,v,U){let Q=v instanceof e,_=Q?U:v;return new xQ({type:"tuple",items:$,rest:Q?v:null,...R.normalizeParams(_)})}function yQ($,v,U){return new Tv({type:"record",keyType:$,valueType:v,...R.normalizeParams(U)})}function uX($,v,U){let Q=Y4($);return Q._zod.values=void 0,new Tv({type:"record",keyType:Q,valueType:v,...R.normalizeParams(U)})}function yX($,v,U){return new Tv({type:"record",keyType:$,valueType:v,mode:"loose",...R.normalizeParams(U)})}function CX($,v,U){return new CQ({type:"map",keyType:$,valueType:v,...R.normalizeParams(U)})}function fX($,v){return new fQ({type:"set",valueType:$,...R.normalizeParams(v)})}function g_($,v){let U=Array.isArray($)?Object.fromEntries($.map((Q)=>[Q,Q])):$;return new X0({type:"enum",entries:U,...R.normalizeParams(v)})}function mX($,v){return new X0({type:"enum",entries:$,...R.normalizeParams(v)})}function gX($,v){return new mQ({type:"literal",values:Array.isArray($)?$:[$],...R.normalizeParams(v)})}function hX($){return IU(gQ,$)}function h_($){return new hQ({type:"transform",transform:$})}function wv($){return new c_({type:"optional",innerType:$})}function lQ($){return new cQ({type:"optional",innerType:$})}function Lv($){return new dQ({type:"nullable",innerType:$})}function cX($){return wv(Lv($))}function iQ($,v){return new pQ({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():R.shallowClone(v)}})}function rQ($,v){return new nQ({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():R.shallowClone(v)}})}function oQ($,v){return new l_({type:"nonoptional",innerType:$,...R.normalizeParams(v)})}function lX($){return new tQ({type:"success",innerType:$})}function sQ($,v){return new aQ({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}function dX($){return YU(eQ,$)}function kv($,v){return new d_({type:"pipe",in:$,out:v})}function pX($,v,U){return new p_({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}function vJ($){return new $J({type:"readonly",innerType:$})}function iX($,v){return new _J({type:"template_literal",parts:$,...R.normalizeParams(v)})}function QJ($){return new UJ({type:"lazy",getter:$})}function nX($){return new JJ({type:"promise",innerType:$})}function rX($){return new YJ({type:"function",input:Array.isArray($?.input)?uQ($?.input):$?.input??Fv(Y1()),output:$?.output??Y1()})}function oX($){let v=new T$({check:"custom"});return v._zod.check=$,v}function tX($,v){return XU(Rv,$??(()=>!0),v)}function zJ($,v={}){return qU(Rv,$,v)}function IJ($){return GU($)}function eX($,v={}){let U=new Rv({type:"custom",check:"custom",fn:(Q)=>Q instanceof $,abort:!0,...R.normalizeParams(v)});return U._zod.bag.Class=$,U._zod.check=(Q)=>{if(!(Q.value instanceof $))Q.issues.push({code:"invalid_type",expected:$.name,input:Q.value,inst:U,path:[...U._zod.def.path??[]]})},U}function vq($){let v=QJ(()=>{return m_([Z_($),DQ(),VQ(),kQ(),Fv(v),yQ(Z_(),v)])});return v}function _q($,v){return kv(h_($),v)}var Q$,V_,q0,O$,M_,Mv,z6,Av,w_,L_,k_,A_,O_,F_,N_,S_,ZQ,T_,R_,E_,P_,x_,u_,y_,G0,j0,z1,K0,H0,C_,MQ,wQ,LQ,AQ,OQ,FQ,NQ,Ov,SQ,Nv,Sv,TQ,RQ,EQ,xQ,Tv,CQ,fQ,X0,mQ,gQ,hQ,c_,cQ,dQ,pQ,nQ,l_,tQ,aQ,eQ,d_,p_,$J,_J,UJ,JJ,YJ,Rv,aX,sX,$q=(...$)=>HU({Codec:p_,Boolean:K0,String:q0},...$);var Vv=b(()=>{A4();A4();Bv();bv();j_();Zv();BQ();Q$=B("ZodType",($,v)=>{return e.init($,v),Object.assign($["~standard"],{jsonSchema:{input:z0($,"input"),output:z0($,"output")}}),$.toJSONSchema=WU($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...U)=>{return $.clone(R.mergeDefs(v,{checks:[...v.checks??[],...U.map((Q)=>typeof Q==="function"?{_zod:{check:Q,def:{check:"custom"},onattach:[]}}:Q)]}),{parent:!0})},$.with=$.check,$.clone=(U,Q)=>Y4($,U,Q),$.brand=()=>$,$.register=(U,Q)=>{return U.add($,Q),$},$.parse=(U,Q)=>JQ($,U,Q,{callee:$.parse}),$.safeParse=(U,Q)=>zQ($,U,Q),$.parseAsync=async(U,Q)=>YQ($,U,Q,{callee:$.parseAsync}),$.safeParseAsync=async(U,Q)=>IQ($,U,Q),$.spa=$.safeParseAsync,$.encode=(U,Q)=>XQ($,U,Q),$.decode=(U,Q)=>qQ($,U,Q),$.encodeAsync=async(U,Q)=>GQ($,U,Q),$.decodeAsync=async(U,Q)=>jQ($,U,Q),$.safeEncode=(U,Q)=>KQ($,U,Q),$.safeDecode=(U,Q)=>HQ($,U,Q),$.safeEncodeAsync=async(U,Q)=>WQ($,U,Q),$.safeDecodeAsync=async(U,Q)=>bQ($,U,Q),$.refine=(U,Q)=>$.check(zJ(U,Q)),$.superRefine=(U)=>$.check(IJ(U)),$.overwrite=(U)=>$.check(d4(U)),$.optional=()=>wv($),$.exactOptional=()=>lQ($),$.nullable=()=>Lv($),$.nullish=()=>wv(Lv($)),$.nonoptional=(U)=>oQ($,U),$.array=()=>Fv($),$.or=(U)=>m_([$,U]),$.and=(U)=>PQ($,U),$.transform=(U)=>kv($,h_(U)),$.default=(U)=>iQ($,U),$.prefault=(U)=>rQ($,U),$.catch=(U)=>sQ($,U),$.pipe=(U)=>kv($,U),$.readonly=()=>vJ($),$.describe=(U)=>{let Q=$.clone();return e$.add(Q,{description:U}),Q},Object.defineProperty($,"description",{get(){return e$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return e$.get($);let Q=$.clone();return e$.add(Q,U[0]),Q},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(U)=>U($),$}),V_=B("_ZodString",($,v)=>{_1.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>bU($,Q,_,J);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...Q)=>$.check(r1(...Q)),$.includes=(...Q)=>$.check(a1(...Q)),$.startsWith=(...Q)=>$.check(s1(...Q)),$.endsWith=(...Q)=>$.check(e1(...Q)),$.min=(...Q)=>$.check(b6(...Q)),$.max=(...Q)=>$.check(Q1(...Q)),$.length=(...Q)=>$.check(J1(...Q)),$.nonempty=(...Q)=>$.check(b6(1,...Q)),$.lowercase=(Q)=>$.check(o1(Q)),$.uppercase=(Q)=>$.check(t1(Q)),$.trim=()=>$.check(_0()),$.normalize=(...Q)=>$.check(v0(...Q)),$.toLowerCase=()=>$.check(U0()),$.toUpperCase=()=>$.check(Q0()),$.slugify=()=>$.check(J0())}),q0=B("ZodString",($,v)=>{_1.init($,v),V_.init($,v),$.email=(U)=>$.check(y2(M_,U)),$.url=(U)=>$.check(Wv(Av,U)),$.jwt=(U)=>$.check(v_(y_,U)),$.emoji=(U)=>$.check(h2(w_,U)),$.guid=(U)=>$.check(Hv(Mv,U)),$.uuid=(U)=>$.check(C2(z6,U)),$.uuidv4=(U)=>$.check(f2(z6,U)),$.uuidv6=(U)=>$.check(m2(z6,U)),$.uuidv7=(U)=>$.check(g2(z6,U)),$.nanoid=(U)=>$.check(c2(L_,U)),$.guid=(U)=>$.check(Hv(Mv,U)),$.cuid=(U)=>$.check(l2(k_,U)),$.cuid2=(U)=>$.check(d2(A_,U)),$.ulid=(U)=>$.check(p2(O_,U)),$.base64=(U)=>$.check(s2(P_,U)),$.base64url=(U)=>$.check(e2(x_,U)),$.xid=(U)=>$.check(i2(F_,U)),$.ksuid=(U)=>$.check(n2(N_,U)),$.ipv4=(U)=>$.check(r2(S_,U)),$.ipv6=(U)=>$.check(o2(T_,U)),$.cidrv4=(U)=>$.check(t2(R_,U)),$.cidrv6=(U)=>$.check(a2(E_,U)),$.e164=(U)=>$.check($_(u_,U)),$.datetime=(U)=>$.check($Q(U)),$.date=(U)=>$.check(vQ(U)),$.time=(U)=>$.check(_Q(U)),$.duration=(U)=>$.check(UQ(U))});O$=B("ZodStringFormat",($,v)=>{A$.init($,v),V_.init($,v)}),M_=B("ZodEmail",($,v)=>{L3.init($,v),O$.init($,v)});Mv=B("ZodGUID",($,v)=>{M3.init($,v),O$.init($,v)});z6=B("ZodUUID",($,v)=>{w3.init($,v),O$.init($,v)});Av=B("ZodURL",($,v)=>{k3.init($,v),O$.init($,v)});w_=B("ZodEmoji",($,v)=>{A3.init($,v),O$.init($,v)});L_=B("ZodNanoID",($,v)=>{O3.init($,v),O$.init($,v)});k_=B("ZodCUID",($,v)=>{F3.init($,v),O$.init($,v)});A_=B("ZodCUID2",($,v)=>{N3.init($,v),O$.init($,v)});O_=B("ZodULID",($,v)=>{S3.init($,v),O$.init($,v)});F_=B("ZodXID",($,v)=>{T3.init($,v),O$.init($,v)});N_=B("ZodKSUID",($,v)=>{R3.init($,v),O$.init($,v)});S_=B("ZodIPv4",($,v)=>{y3.init($,v),O$.init($,v)});ZQ=B("ZodMAC",($,v)=>{f3.init($,v),O$.init($,v)});T_=B("ZodIPv6",($,v)=>{C3.init($,v),O$.init($,v)});R_=B("ZodCIDRv4",($,v)=>{m3.init($,v),O$.init($,v)});E_=B("ZodCIDRv6",($,v)=>{g3.init($,v),O$.init($,v)});P_=B("ZodBase64",($,v)=>{c3.init($,v),O$.init($,v)});x_=B("ZodBase64URL",($,v)=>{l3.init($,v),O$.init($,v)});u_=B("ZodE164",($,v)=>{d3.init($,v),O$.init($,v)});y_=B("ZodJWT",($,v)=>{p3.init($,v),O$.init($,v)});G0=B("ZodCustomStringFormat",($,v)=>{i3.init($,v),O$.init($,v)});j0=B("ZodNumber",($,v)=>{R2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>BU($,Q,_,J),$.gt=(Q,_)=>$.check(J6(Q,_)),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.lt=(Q,_)=>$.check(Q6(Q,_)),$.lte=(Q,_)=>$.check(k4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_)),$.int=(Q)=>$.check(D_(Q)),$.safe=(Q)=>$.check(D_(Q)),$.positive=(Q)=>$.check(J6(0,Q)),$.nonnegative=(Q)=>$.check(z4(0,Q)),$.negative=(Q)=>$.check(Q6(0,Q)),$.nonpositive=(Q)=>$.check(k4(0,Q)),$.multipleOf=(Q,_)=>$.check(u6(Q,_)),$.step=(Q,_)=>$.check(u6(Q,_)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});z1=B("ZodNumberFormat",($,v)=>{n3.init($,v),j0.init($,v)});K0=B("ZodBoolean",($,v)=>{Jv.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>ZU($,U,Q,_)});H0=B("ZodBigInt",($,v)=>{E2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>DU($,Q,_,J),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.gt=(Q,_)=>$.check(J6(Q,_)),$.gte=(Q,_)=>$.check(z4(Q,_)),$.min=(Q,_)=>$.check(z4(Q,_)),$.lt=(Q,_)=>$.check(Q6(Q,_)),$.lte=(Q,_)=>$.check(k4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_)),$.positive=(Q)=>$.check(J6(BigInt(0),Q)),$.negative=(Q)=>$.check(Q6(BigInt(0),Q)),$.nonpositive=(Q)=>$.check(k4(BigInt(0),Q)),$.nonnegative=(Q)=>$.check(z4(BigInt(0),Q)),$.multipleOf=(Q,_)=>$.check(u6(Q,_));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});C_=B("ZodBigIntFormat",($,v)=>{r3.init($,v),H0.init($,v)});MQ=B("ZodSymbol",($,v)=>{o3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>VU($,U,Q,_)});wQ=B("ZodUndefined",($,v)=>{t3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>wU($,U,Q,_)});LQ=B("ZodNull",($,v)=>{a3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>MU($,U,Q,_)});AQ=B("ZodAny",($,v)=>{s3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>AU($,U,Q,_)});OQ=B("ZodUnknown",($,v)=>{e3.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>OU($,U,Q,_)});FQ=B("ZodNever",($,v)=>{$7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>kU($,U,Q,_)});NQ=B("ZodVoid",($,v)=>{v7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>LU($,U,Q,_)});Ov=B("ZodDate",($,v)=>{_7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>FU($,Q,_,J),$.min=(Q,_)=>$.check(z4(Q,_)),$.max=(Q,_)=>$.check(k4(Q,_));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});SQ=B("ZodArray",($,v)=>{U7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>mU($,U,Q,_),$.element=v.element,$.min=(U,Q)=>$.check(b6(U,Q)),$.nonempty=(U)=>$.check(b6(1,U)),$.max=(U,Q)=>$.check(Q1(U,Q)),$.length=(U,Q)=>$.check(J1(U,Q)),$.unwrap=()=>$.element});Nv=B("ZodObject",($,v)=>{Q7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>gU($,U,Q,_),R.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>g_(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y1()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y1()}),$.strict=()=>$.clone({...$._zod.def,catchall:f_()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return R.extend($,U)},$.safeExtend=(U)=>{return R.safeExtend($,U)},$.merge=(U)=>R.merge($,U),$.pick=(U)=>R.pick($,U),$.omit=(U)=>R.omit($,U),$.partial=(...U)=>R.partial(c_,$,U[0]),$.required=(...U)=>R.required(l_,$,U[0])});Sv=B("ZodUnion",($,v)=>{Yv.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>I_($,U,Q,_),$.options=v.options});TQ=B("ZodXor",($,v)=>{Sv.init($,v),J7.init($,v),$._zod.processJSONSchema=(U,Q,_)=>I_($,U,Q,_),$.options=v.options});RQ=B("ZodDiscriminatedUnion",($,v)=>{Sv.init($,v),Y7.init($,v)});EQ=B("ZodIntersection",($,v)=>{z7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>hU($,U,Q,_)});xQ=B("ZodTuple",($,v)=>{P2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>cU($,U,Q,_),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});Tv=B("ZodRecord",($,v)=>{I7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>lU($,U,Q,_),$.keyType=v.keyType,$.valueType=v.valueType});CQ=B("ZodMap",($,v)=>{X7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>CU($,U,Q,_),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...U)=>$.check(Y6(...U)),$.nonempty=(U)=>$.check(Y6(1,U)),$.max=(...U)=>$.check(y6(...U)),$.size=(...U)=>$.check(U1(...U))});fQ=B("ZodSet",($,v)=>{q7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>fU($,U,Q,_),$.min=(...U)=>$.check(Y6(...U)),$.nonempty=(U)=>$.check(Y6(1,U)),$.max=(...U)=>$.check(y6(...U)),$.size=(...U)=>$.check(U1(...U))});X0=B("ZodEnum",($,v)=>{G7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(Q,_,J)=>NU($,Q,_,J),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(Q,_)=>{let J={};for(let Y of Q)if(U.has(Y))J[Y]=v.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({...v,checks:[],...R.normalizeParams(_),entries:J})},$.exclude=(Q,_)=>{let J={...v.entries};for(let Y of Q)if(U.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new X0({...v,checks:[],...R.normalizeParams(_),entries:J})}});mQ=B("ZodLiteral",($,v)=>{j7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>SU($,U,Q,_),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});gQ=B("ZodFile",($,v)=>{K7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>EU($,U,Q,_),$.min=(U,Q)=>$.check(Y6(U,Q)),$.max=(U,Q)=>$.check(y6(U,Q)),$.mime=(U,Q)=>$.check($0(Array.isArray(U)?U:[U],Q))});hQ=B("ZodTransform",($,v)=>{H7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>yU($,U,Q,_),$._zod.parse=(U,Q)=>{if(Q.direction==="backward")throw new e6($.constructor.name);U.addIssue=(J)=>{if(typeof J==="string")U.issues.push(R.issue(J,U.value,v));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=U.value),Y.inst??(Y.inst=$),U.issues.push(R.issue(Y))}};let _=v.transform(U.value,U);if(_ instanceof Promise)return _.then((J)=>{return U.value=J,U});return U.value=_,U}});c_=B("ZodOptional",($,v)=>{x2.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>X_($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});cQ=B("ZodExactOptional",($,v)=>{W7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>X_($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});dQ=B("ZodNullable",($,v)=>{b7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>dU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});pQ=B("ZodDefault",($,v)=>{B7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>iU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});nQ=B("ZodPrefault",($,v)=>{Z7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>nU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});l_=B("ZodNonOptional",($,v)=>{D7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>pU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});tQ=B("ZodSuccess",($,v)=>{V7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>PU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});aQ=B("ZodCatch",($,v)=>{M7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>rU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});eQ=B("ZodNaN",($,v)=>{w7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>TU($,U,Q,_)});d_=B("ZodPipe",($,v)=>{L7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>oU($,U,Q,_),$.in=v.in,$.out=v.out});p_=B("ZodCodec",($,v)=>{d_.init($,v),zv.init($,v)});$J=B("ZodReadonly",($,v)=>{k7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>tU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});_J=B("ZodTemplateLiteral",($,v)=>{A7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>RU($,U,Q,_)});UJ=B("ZodLazy",($,v)=>{N7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>sU($,U,Q,_),$.unwrap=()=>$._zod.def.getter()});JJ=B("ZodPromise",($,v)=>{F7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>aU($,U,Q,_),$.unwrap=()=>$._zod.def.innerType});YJ=B("ZodFunction",($,v)=>{O7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>uU($,U,Q,_)});Rv=B("ZodCustom",($,v)=>{S7.init($,v),Q$.init($,v),$._zod.processJSONSchema=(U,Q,_)=>xU($,U,Q,_)});aX=jU,sX=KU});function xZ($){d$({customError:$})}function uZ(){return d$().customError}var PZ,XJ;var Uq=b(()=>{A4();PZ={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function($){})(XJ||(XJ={}))});function CZ($,v){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function fZ($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return v.rootSchema;let Q=v.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===Q){let _=U[1];if(!_||!v.defs[_])throw Error(`Reference not found: ${$}`);return v.defs[_]}throw Error(`Reference not found: ${$}`)}function Qq($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return u.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let _=$.$ref;if(v.refs.has(_))return v.refs.get(_);if(v.processing.has(_))return u.lazy(()=>{if(!v.refs.has(_))throw Error(`Circular reference not resolved: ${_}`);return v.refs.get(_)});v.processing.add(_);let J=fZ(_,v),Y=_4(J,v);return v.refs.set(_,Y),v.processing.delete(_),Y}if($.enum!==void 0){let _=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&_.length===1&&_[0]===null)return u.null();if(_.length===0)return u.never();if(_.length===1)return u.literal(_[0]);if(_.every((Y)=>typeof Y==="string"))return u.enum(_);let J=_.map((Y)=>u.literal(Y));if(J.length<2)return J[0];return u.union([J[0],J[1],...J.slice(2)])}if($.const!==void 0)return u.literal($.const);let U=$.type;if(Array.isArray(U)){let _=U.map((J)=>{let Y={...$,type:J};return Qq(Y,v)});if(_.length===0)return u.never();if(_.length===1)return _[0];return u.union(_)}if(!U)return u.any();let Q;switch(U){case"string":{let _=u.string();if($.format){let J=$.format;if(J==="email")_=_.check(u.email());else if(J==="uri"||J==="uri-reference")_=_.check(u.url());else if(J==="uuid"||J==="guid")_=_.check(u.uuid());else if(J==="date-time")_=_.check(u.iso.datetime());else if(J==="date")_=_.check(u.iso.date());else if(J==="time")_=_.check(u.iso.time());else if(J==="duration")_=_.check(u.iso.duration());else if(J==="ipv4")_=_.check(u.ipv4());else if(J==="ipv6")_=_.check(u.ipv6());else if(J==="mac")_=_.check(u.mac());else if(J==="cidr")_=_.check(u.cidrv4());else if(J==="cidr-v6")_=_.check(u.cidrv6());else if(J==="base64")_=_.check(u.base64());else if(J==="base64url")_=_.check(u.base64url());else if(J==="e164")_=_.check(u.e164());else if(J==="jwt")_=_.check(u.jwt());else if(J==="emoji")_=_.check(u.emoji());else if(J==="nanoid")_=_.check(u.nanoid());else if(J==="cuid")_=_.check(u.cuid());else if(J==="cuid2")_=_.check(u.cuid2());else if(J==="ulid")_=_.check(u.ulid());else if(J==="xid")_=_.check(u.xid());else if(J==="ksuid")_=_.check(u.ksuid())}if(typeof $.minLength==="number")_=_.min($.minLength);if(typeof $.maxLength==="number")_=_.max($.maxLength);if($.pattern)_=_.regex(new RegExp($.pattern));Q=_;break}case"number":case"integer":{let _=U==="integer"?u.number().int():u.number();if(typeof $.minimum==="number")_=_.min($.minimum);if(typeof $.maximum==="number")_=_.max($.maximum);if(typeof $.exclusiveMinimum==="number")_=_.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")_=_.gt($.minimum);if(typeof $.exclusiveMaximum==="number")_=_.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")_=_.lt($.maximum);if(typeof $.multipleOf==="number")_=_.multipleOf($.multipleOf);Q=_;break}case"boolean":{Q=u.boolean();break}case"null":{Q=u.null();break}case"object":{let _={},J=$.properties||{},Y=new Set($.required||[]);for(let[I,X]of Object.entries(J)){let q=_4(X,v);_[I]=Y.has(I)?q:q.optional()}if($.propertyNames){let I=_4($.propertyNames,v),X=$.additionalProperties&&typeof $.additionalProperties==="object"?_4($.additionalProperties,v):u.any();if(Object.keys(_).length===0){Q=u.record(I,X);break}let q=u.object(_).passthrough(),G=u.looseRecord(I,X);Q=u.intersection(q,G);break}if($.patternProperties){let I=$.patternProperties,X=Object.keys(I),q=[];for(let j of X){let H=_4(I[j],v),Z=u.string().regex(new RegExp(j));q.push(u.looseRecord(Z,H))}let G=[];if(Object.keys(_).length>0)G.push(u.object(_).passthrough());if(G.push(...q),G.length===0)Q=u.object({}).passthrough();else if(G.length===1)Q=G[0];else{let j=u.intersection(G[0],G[1]);for(let H=2;H<G.length;H++)j=u.intersection(j,G[H]);Q=j}break}let z=u.object(_);if($.additionalProperties===!1)Q=z.strict();else if(typeof $.additionalProperties==="object")Q=z.catchall(_4($.additionalProperties,v));else Q=z.passthrough();break}case"array":{let{prefixItems:_,items:J}=$;if(_&&Array.isArray(_)){let Y=_.map((I)=>_4(I,v)),z=J&&typeof J==="object"&&!Array.isArray(J)?_4(J,v):void 0;if(z)Q=u.tuple(Y).rest(z);else Q=u.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(u.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(u.maxLength($.maxItems))}else if(Array.isArray(J)){let Y=J.map((I)=>_4(I,v)),z=$.additionalItems&&typeof $.additionalItems==="object"?_4($.additionalItems,v):void 0;if(z)Q=u.tuple(Y).rest(z);else Q=u.tuple(Y);if(typeof $.minItems==="number")Q=Q.check(u.minLength($.minItems));if(typeof $.maxItems==="number")Q=Q.check(u.maxLength($.maxItems))}else if(J!==void 0){let Y=_4(J,v),z=u.array(Y);if(typeof $.minItems==="number")z=z.min($.minItems);if(typeof $.maxItems==="number")z=z.max($.maxItems);Q=z}else Q=u.array(u.any());break}default:throw Error(`Unsupported type: ${U}`)}if($.description)Q=Q.describe($.description);if($.default!==void 0)Q=Q.default($.default);return Q}function _4($,v){if(typeof $==="boolean")return $?u.any():u.never();let U=Qq($,v),Q=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let z=$.anyOf.map((X)=>_4(X,v)),I=u.union(z);U=Q?u.intersection(U,I):I}if($.oneOf&&Array.isArray($.oneOf)){let z=$.oneOf.map((X)=>_4(X,v)),I=u.xor(z);U=Q?u.intersection(U,I):I}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=Q?U:u.any();else{let z=Q?U:_4($.allOf[0],v),I=Q?0:1;for(let X=I;X<$.allOf.length;X++)z=u.intersection(z,_4($.allOf[X],v));U=z}if($.nullable===!0&&v.version==="openapi-3.0")U=u.nullable(U);if($.readOnly===!0)U=u.readonly(U);let _={},J=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let z of J)if(z in $)_[z]=$[z];let Y=["contentEncoding","contentMediaType","contentSchema"];for(let z of Y)if(z in $)_[z]=$[z];for(let z of Object.keys($))if(!yZ.has(z))_[z]=$[z];if(Object.keys(_).length>0)v.registry.add(U,_);return U}function Jq($,v){if(typeof $==="boolean")return $?u.any():u.never();let U=CZ($,v?.defaultTarget),Q=$.$defs||$.definitions||{},_={version:U,defs:Q,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??e$};return _4($,_)}var u,yZ;var Yq=b(()=>{Kv();j_();Zv();Vv();u={...Dv,...G_,iso:I0},yZ=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var qJ={};s$(qJ,{string:()=>mZ,number:()=>gZ,date:()=>lZ,boolean:()=>hZ,bigint:()=>cZ});function mZ($){return R5(q0,$)}function gZ($){return m5(j0,$)}function hZ($){return i5(K0,$)}function cZ($){return r5(H0,$)}function lZ($){return JU(Ov,$)}var zq=b(()=>{A4();Vv()});var K={};s$(K,{xor:()=>PX,xid:()=>_X,void:()=>FX,uuidv7:()=>rI,uuidv6:()=>nI,uuidv4:()=>iI,uuid:()=>pI,util:()=>R,url:()=>oI,uppercase:()=>t1,unknown:()=>Y1,union:()=>m_,undefined:()=>AX,ulid:()=>vX,uint64:()=>LX,uint32:()=>VX,tuple:()=>uQ,trim:()=>_0,treeifyError:()=>V9,transform:()=>h_,toUpperCase:()=>Q0,toLowerCase:()=>U0,toJSONSchema:()=>q_,templateLiteral:()=>iX,symbol:()=>kX,superRefine:()=>IJ,success:()=>lX,stringbool:()=>$q,stringFormat:()=>KX,string:()=>Z_,strictObject:()=>RX,startsWith:()=>s1,slugify:()=>J0,size:()=>U1,setErrorMap:()=>xZ,set:()=>fX,safeParseAsync:()=>IQ,safeParse:()=>zQ,safeEncodeAsync:()=>WQ,safeEncode:()=>KQ,safeDecodeAsync:()=>bQ,safeDecode:()=>HQ,registry:()=>u2,regexes:()=>x4,regex:()=>r1,refine:()=>zJ,record:()=>yQ,readonly:()=>vJ,property:()=>Y_,promise:()=>nX,prettifyError:()=>M9,preprocess:()=>_q,prefault:()=>rQ,positive:()=>__,pipe:()=>kv,partialRecord:()=>uX,parseAsync:()=>YQ,parse:()=>JQ,overwrite:()=>d4,optional:()=>wv,object:()=>TX,number:()=>DQ,nullish:()=>cX,nullable:()=>Lv,null:()=>kQ,normalize:()=>v0,nonpositive:()=>Q_,nonoptional:()=>oQ,nonnegative:()=>J_,never:()=>f_,negative:()=>U_,nativeEnum:()=>mX,nanoid:()=>sI,nan:()=>dX,multipleOf:()=>u6,minSize:()=>Y6,minLength:()=>b6,mime:()=>$0,meta:()=>sX,maxSize:()=>y6,maxLength:()=>Q1,map:()=>CX,mac:()=>JX,lte:()=>k4,lt:()=>Q6,lowercase:()=>o1,looseRecord:()=>yX,looseObject:()=>EX,locales:()=>jv,literal:()=>gX,length:()=>J1,lazy:()=>QJ,ksuid:()=>UX,keyof:()=>SX,jwt:()=>jX,json:()=>vq,iso:()=>I0,ipv6:()=>YX,ipv4:()=>QX,intersection:()=>PQ,int64:()=>wX,int32:()=>DX,int:()=>D_,instanceof:()=>eX,includes:()=>a1,httpUrl:()=>tI,hostname:()=>HX,hex:()=>WX,hash:()=>bX,guid:()=>dI,gte:()=>z4,gt:()=>J6,globalRegistry:()=>e$,getErrorMap:()=>uZ,function:()=>rX,fromJSONSchema:()=>Jq,formatError:()=>vv,float64:()=>ZX,float32:()=>BX,flattenError:()=>$v,file:()=>hX,exactOptional:()=>lQ,enum:()=>g_,endsWith:()=>e1,encodeAsync:()=>GQ,encode:()=>XQ,emoji:()=>aI,email:()=>lI,e164:()=>GX,discriminatedUnion:()=>xX,describe:()=>aX,decodeAsync:()=>jQ,decode:()=>qQ,date:()=>NX,custom:()=>tX,cuid2:()=>$X,cuid:()=>eI,core:()=>B6,config:()=>d$,coerce:()=>qJ,codec:()=>pX,clone:()=>Y4,cidrv6:()=>IX,cidrv4:()=>zX,check:()=>oX,catch:()=>sQ,boolean:()=>VQ,bigint:()=>MX,base64url:()=>qX,base64:()=>XX,array:()=>Fv,any:()=>OX,_function:()=>rX,_default:()=>iQ,_ZodString:()=>V_,ZodXor:()=>TQ,ZodXID:()=>F_,ZodVoid:()=>NQ,ZodUnknown:()=>OQ,ZodUnion:()=>Sv,ZodUndefined:()=>wQ,ZodUUID:()=>z6,ZodURL:()=>Av,ZodULID:()=>O_,ZodType:()=>Q$,ZodTuple:()=>xQ,ZodTransform:()=>hQ,ZodTemplateLiteral:()=>_J,ZodSymbol:()=>MQ,ZodSuccess:()=>tQ,ZodStringFormat:()=>O$,ZodString:()=>q0,ZodSet:()=>fQ,ZodRecord:()=>Tv,ZodRealError:()=>b4,ZodReadonly:()=>$J,ZodPromise:()=>JJ,ZodPrefault:()=>nQ,ZodPipe:()=>d_,ZodOptional:()=>c_,ZodObject:()=>Nv,ZodNumberFormat:()=>z1,ZodNumber:()=>j0,ZodNullable:()=>dQ,ZodNull:()=>LQ,ZodNonOptional:()=>l_,ZodNever:()=>FQ,ZodNanoID:()=>L_,ZodNaN:()=>eQ,ZodMap:()=>CQ,ZodMAC:()=>ZQ,ZodLiteral:()=>mQ,ZodLazy:()=>UJ,ZodKSUID:()=>N_,ZodJWT:()=>y_,ZodIssueCode:()=>PZ,ZodIntersection:()=>EQ,ZodISOTime:()=>W_,ZodISODuration:()=>b_,ZodISODateTime:()=>K_,ZodISODate:()=>H_,ZodIPv6:()=>T_,ZodIPv4:()=>S_,ZodGUID:()=>Mv,ZodFunction:()=>YJ,ZodFirstPartyTypeKind:()=>XJ,ZodFile:()=>gQ,ZodExactOptional:()=>cQ,ZodError:()=>B_,ZodEnum:()=>X0,ZodEmoji:()=>w_,ZodEmail:()=>M_,ZodE164:()=>u_,ZodDiscriminatedUnion:()=>RQ,ZodDefault:()=>pQ,ZodDate:()=>Ov,ZodCustomStringFormat:()=>G0,ZodCustom:()=>Rv,ZodCodec:()=>p_,ZodCatch:()=>aQ,ZodCUID2:()=>A_,ZodCUID:()=>k_,ZodCIDRv6:()=>E_,ZodCIDRv4:()=>R_,ZodBoolean:()=>K0,ZodBigIntFormat:()=>C_,ZodBigInt:()=>H0,ZodBase64URL:()=>x_,ZodBase64:()=>P_,ZodArray:()=>SQ,ZodAny:()=>AQ,TimePrecision:()=>P5,NEVER:()=>X9,$output:()=>F5,$input:()=>N5,$brand:()=>q9});var GJ=b(()=>{A4();A4();m7();A4();Bv();Yq();O5();Zv();Zv();zq();Vv();j_();QQ();BQ();Uq();d$(Iv())});var Z6=b(()=>{GJ();GJ()});var Xq;var Iq=b(()=>{Xq={name:"ocx",version:"2.0.6",description:"OCX CLI - OpenCode extension manager with portable, isolated profiles. Your setup, anywhere.",author:"kdcokenny",license:"MIT",type:"module",main:"./dist/index.js",bin:{ocx:"./dist/index.js"},files:["dist/index.js"],publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/kdcokenny/ocx.git"},homepage:"https://github.com/kdcokenny/ocx#readme",bugs:{url:"https://github.com/kdcokenny/ocx/issues"},keywords:["opencode","cli","extensions","agents","plugins","mcp","shadcn","registry"],engines:{node:">=18"},scripts:{build:"bun run scripts/build.ts","build:binary":"bun run scripts/build-binary.ts","release:tag":"bun run scripts/release-tag.ts",check:"bun check:biome && bun check:types","check:biome":"biome check .","check:types":"tsc --noEmit",dev:"bun run src/index.ts",prepublishOnly:"bun run build",test:"bun test"},dependencies:{commander:"^14.0.3",fuzzysort:"^3.1.0","jsonc-parser":"3.3.1",kleur:"^4.1.5",ora:"^9.3.0",remeda:"^2.33.7",zod:"^4.3.6"},devDependencies:{"@types/bun":"^1.3.11"}}});function pZ($){return`https://${Ev}/schemas/v${$}/registry.json`}var Ev="ocx.kdco.dev",qq="kdcokenny/ocx",jJ,KJ,p4=2,i4,Gq;var i_=b(()=>{Iq();jJ=`https://${Ev}/schemas/ocx.json`,KJ=`https://${Ev}/schemas/registry.json`;i4=pZ(p4),Gq=Xq.version});var K$,b$,B$,P$,d,M,I1,t$,X1,f$,n4,m$,g6,W0,r4,b0,HJ;var z$=b(()=>{K$={SUCCESS:0,GENERAL:1,NOT_FOUND:66,NETWORK:69,CONFIG:78,INTEGRITY:65,CONFLICT:6};b$=class b$ extends Error{code;exitCode;constructor($,v,U=K$.GENERAL){super($);this.code=v;this.exitCode=U;this.name="OCXError"}};B$=class B$ extends b${constructor($){super($,"NOT_FOUND",K$.NOT_FOUND);this.name="NotFoundError"}};P$=class P$ extends b${url;status;statusText;phase;qualifiedName;registryContext;registryName;constructor($,v){super($,"NETWORK_ERROR",K$.NETWORK);this.name="NetworkError",this.url=v?.url,this.status=v?.status,this.statusText=v?.statusText,this.phase=v?.phase,this.qualifiedName=v?.qualifiedName,this.registryContext=v?.registryContext,this.registryName=v?.registryName}};d=class d extends b${constructor($){super($,"CONFIG_ERROR",K$.CONFIG);this.name="ConfigError"}};M=class M extends b${constructor($){super($,"VALIDATION_ERROR",K$.GENERAL);this.name="ValidationError"}};I1=class I1 extends b${details;constructor($){super("Registry validation failed","VALIDATION_FAILED",K$.CONFIG);this.details=$;this.name="ValidationFailedError"}};t$=class t$ extends b${constructor($){super($,"CONFLICT",K$.CONFLICT);this.name="ConflictError"}};X1=class X1 extends b${component;expected;found;constructor($,v,U){let Q=`Integrity verification failed for "${$}"
|
|
57
|
+
Expected: ${v}
|
|
58
|
+
Found: ${U}
|
|
20
59
|
|
|
21
60
|
The registry content has changed since this component was locked.
|
|
22
|
-
Use 'ocx update ${
|
|
23
|
-
URL: ${
|
|
61
|
+
Use 'ocx update ${$}' to intentionally update this component.`;super(Q,"INTEGRITY_ERROR",K$.INTEGRITY);this.component=$;this.expected=v;this.found=U;this.name="IntegrityError"}};f$=class f$ extends b${constructor($){super($,"UPDATE_ERROR",K$.GENERAL);this.name="SelfUpdateError"}};n4=class n4 extends b${url;issue;remediation;schemaUrl;supportedMajor;detectedMajor;constructor($,v){super($,"REGISTRY_COMPAT_ERROR",K$.CONFIG);this.name="RegistryCompatibilityError",this.url=v.url,this.issue=v.issue,this.remediation=v.remediation,this.schemaUrl=v.schemaUrl,this.supportedMajor=v.supportedMajor,this.detectedMajor=v.detectedMajor}};m$=class m$ extends b${profile;constructor($,v){let U=v??`Profile "${$}" not found`;super(U,"NOT_FOUND",K$.NOT_FOUND);this.profile=$;this.name="ProfileNotFoundError"}};g6=class g6 extends b${profile;constructor($,v){let U=v?`Profile "${$}" already exists. ${v}`:`Profile "${$}" already exists.`;super(U,"CONFLICT",K$.CONFLICT);this.profile=$;this.name="ProfileExistsError"}};W0=class W0 extends b${registryName;existingUrl;newUrl;targetLabel;existingName;conflictType;constructor($,v,U,Q,_){let J=Q?` in ${Q}`:"",Y=_!==void 0&&_!==$,z=Y?`Registry URL already registered under name "${_}"${J}.
|
|
62
|
+
URL: ${v}
|
|
24
63
|
Existing name: ${_}
|
|
25
|
-
Requested name: ${
|
|
64
|
+
Requested name: ${$}
|
|
26
65
|
|
|
27
|
-
Run 'ocx registry remove ${_}' first, then re-add with the new name.`:`Registry "${
|
|
28
|
-
Current: ${
|
|
29
|
-
New: ${
|
|
66
|
+
Run 'ocx registry remove ${_}' first, then re-add with the new name.`:`Registry "${$}" already exists${J}.
|
|
67
|
+
Current: ${v}
|
|
68
|
+
New: ${U}
|
|
30
69
|
|
|
31
|
-
Run 'ocx registry remove ${
|
|
70
|
+
Run 'ocx registry remove ${$}' first, then re-add with the new URL.`;super(z,"CONFLICT",K$.CONFLICT);this.registryName=$;this.existingUrl=v;this.newUrl=U;this.targetLabel=Q;this.existingName=_;this.name="RegistryExistsError",this.conflictType=Y?"url":"name"}};r4=class r4 extends b${profile;reason;constructor($,v){super(`Invalid profile name "${$}": ${v}`,"VALIDATION_ERROR",K$.GENERAL);this.profile=$;this.reason=v;this.name="InvalidProfileNameError"}};b0=class b0 extends b${constructor(){super("Profiles not initialized. Run 'ocx init --global' first.","NOT_FOUND",K$.NOT_FOUND);this.name="ProfilesNotInitializedError"}};HJ=class HJ extends b${profile;localDir;constructor($,v){super(`Local profile directory unsupported: "${v}"
|
|
32
71
|
|
|
33
72
|
Local profiles are not supported. Profiles must be global only.
|
|
34
73
|
Remove the local profile directory and use global profiles instead:
|
|
35
|
-
rm -rf "${
|
|
36
|
-
ocx profile show ${D} --global`,"CONFIG_ERROR",XD.CONFIG);this.profile=D;this.localDir=F;this.name="LocalProfileUnsupportedError"}}});import*as A0 from"path";function J0(D,F){if(F.includes("\x00"))throw new oD("Path contains null bytes",F,"null_byte");if(A0.isAbsolute(F)||A0.win32.isAbsolute(F))throw new oD("Path must be relative",F,"absolute_path");if(/^[a-zA-Z]:/.test(F)||F.startsWith("\\\\"))throw new oD("Path contains Windows absolute",F,"windows_absolute");let B=A0.basename(F).toUpperCase().split(".")[0]??"";if(ZQ.has(B))throw new oD("Path uses Windows reserved name",F,"windows_reserved");let _=F.normalize("NFC").replace(/\\/g,"/"),Q=A0.resolve(D),Y=A0.resolve(Q,_),q=A0.relative(Q,Y);if(q.startsWith("../")||q.startsWith("..\\")||q===".."||A0.isAbsolute(q))throw new oD("Path escapes base directory",F,"path_traversal");return Y}var oD,ZQ;var c2=V(()=>{oD=class oD extends Error{attemptedPath;reason;constructor(D,F,B){super(D);this.attemptedPath=F;this.reason=B;this.name="PathValidationError"}};ZQ=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 RQ,normalize as S7}from"path";function u0(D){if(!D.includes("/"))throw Error(`Invalid component reference: "${D}". Use format: alias/component`);let F=D.split("/");if(F.length>2)throw Error(`Invalid component reference: "${D}". Too many "/" separators. Use format: alias/component`);let[B,$]=F;if(!B||!$)throw Error(`Invalid component reference: "${D}". Both alias and component are required.`);return{namespace:B,component:$}}function K1(D,F){return`${D}/${F}`}function A1(D){if(RQ(D))throw new U(`Invalid path: "${D}" - absolute paths not allowed`);if(D.startsWith("~"))throw new U(`Invalid path: "${D}" - home directory paths not allowed`);if(S7(D).startsWith(".."))throw new U(`Invalid path: "${D}" - path traversal not allowed`)}function f7(D){return D}function N7(D,F){if(NQ.has(D))throw new U(`Target "${D}" is reserved for installer use`);try{J0("/dummy/base",D)}catch($){if($ instanceof oD)throw new U(`Invalid target "${D}": ${$.message}`);throw $}if(F!=="profile"){let $=S7(D);if(I7.some((Q)=>$===Q||$.startsWith(Q)))throw new U(`Target path '${D}' is protected and cannot be overwritten by registry components`)}}function b2(D,F){if(typeof D==="string"){A1(D);let B=f7(D);return N7(B,F),{path:D,target:B}}return A1(D.path),A1(D.target),N7(D.target,F),D}function h7(D){if(typeof D==="string")return{type:"remote",url:D,enabled:!0};return D}function p2(D){let F;if(D.opencode){let{mcp:B,...$}=D.opencode;F={...$,...B&&{mcp:Object.fromEntries(Object.entries(B).map(([_,Q])=>[_,h7(Q)]))}}}return{...D,files:D.files.map((B)=>b2(B,D.type)),opencode:F}}function PF(D){if(D===null||D===void 0||typeof D!=="object")return null;let F=D;if(!Object.hasOwn(F,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${T0}".`,supportedMajor:I0};let $=F.$schema;if(typeof $!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:String($),supportedMajor:I0};if(!$)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};if($===z1)return{issue:"legacy-schema-v1",remediation:`Schema URL "${z1}" is legacy v1. Use "${T0}" instead.`,schemaUrl:$,supportedMajor:I0};let _=$.match(fQ);if(!_)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};let Q=_[1];if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${T0}".`,schemaUrl:$,supportedMajor:I0};let Y=Number.parseInt(Q,10);if(Y!==I0)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${T0}" (v${I0}).`,schemaUrl:$,supportedMajor:I0,detectedMajor:Y};return null}var Nz,o3,j1,k7,uF,NQ,I7,SQ,kQ,T7,v7,C7,u7,IQ,TQ,vQ,CQ,uQ,PQ,yQ,xQ,P7,y7,x7,l2,fQ,K3,i2,U3,U1;var P0=V(()=>{Q2();a3();$D();c2();Nz=G.string().refine((D)=>D.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine((D)=>{let F=D.slice(4);if(!F)return!1;if(F.includes("..")||F.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),o3=G.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."}),j1=G.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.'});k7=G.string().refine((D)=>{let F=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return F.test(D)||B.test(D)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),uF=G.enum(["agent","skill","plugin","command","tool","bundle","profile"]),NQ=new Set([".ocx","ocx.lock"]),I7=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],SQ=G.string().min(1,"Target path cannot be empty").refine((D)=>{if(D.startsWith("/")||/^[a-zA-Z]:/.test(D))return!1;if(D.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine((D)=>{return!I7.some((F)=>D===F||D.startsWith(F))},{message:"Target path is protected and cannot be overwritten by registry components"}),kQ=G.object({clientId:G.string().optional(),scopes:G.array(G.string()).optional(),authUrl:G.string().optional(),tokenUrl:G.string().optional()}),T7=G.object({type:G.enum(["remote","local"]),url:G.string().optional(),command:G.union([G.string(),G.array(G.string())]).optional(),environment:G.record(G.string()).optional(),headers:G.record(G.string()).optional(),oauth:G.union([G.boolean(),kQ]).optional(),enabled:G.boolean().default(!0)}).refine((D)=>{if(D.type==="remote"&&!D.url)return!1;if(D.type==="local"&&!D.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),v7=G.union([G.string(),T7]),C7=G.object({path:G.string().min(1,"File path cannot be empty"),target:G.string().min(1,"Target path cannot be empty")}),u7=G.union([G.string().min(1,"File path cannot be empty"),C7]),IQ=G.object({api:G.string().optional(),headers:G.record(G.string()).optional(),env:G.record(G.string()).optional(),enabled:G.boolean().optional()}).passthrough(),TQ=G.object({command:G.union([G.string(),G.array(G.string())]).optional(),enabled:G.boolean().optional()}).passthrough(),vQ=G.object({command:G.union([G.string(),G.array(G.string())]).optional(),glob:G.string().optional()}).passthrough(),CQ=G.object({description:G.string().optional(),run:G.string().optional()}).passthrough(),uQ=G.object({disabled:G.boolean().optional()}).passthrough(),PQ=G.object({host:G.string().optional(),port:G.number().optional()}).passthrough(),yQ=G.record(G.string()),xQ=G.object({include:G.array(G.string()).optional(),exclude:G.array(G.string()).optional()}).passthrough(),P7=G.object({model:G.string().optional(),description:G.string().optional(),steps:G.number().int().positive().optional(),maxSteps:G.number().int().positive().optional(),mode:G.enum(["primary","subagent","all"]).optional(),tools:G.record(G.boolean()).optional(),temperature:G.number().optional(),top_p:G.number().optional(),prompt:G.string().optional(),permission:G.record(G.union([G.enum(["ask","allow","deny"]),G.record(G.enum(["ask","allow","deny"]))])).optional(),color:G.string().optional(),disable:G.boolean().optional(),options:G.record(G.any()).optional()}),y7=G.object({bash:G.union([G.enum(["ask","allow","deny"]),G.record(G.enum(["ask","allow","deny"]))]).optional(),edit:G.union([G.enum(["ask","allow","deny"]),G.record(G.enum(["ask","allow","deny"]))]).optional(),mcp:G.record(G.enum(["ask","allow","deny"])).optional()}).catchall(G.union([G.enum(["ask","allow","deny"]),G.record(G.enum(["ask","allow","deny"]))])),x7=G.object({$schema:G.string().optional(),theme:G.string().optional(),logLevel:G.string().optional(),username:G.string().optional(),model:G.string().optional(),small_model:G.string().optional(),default_agent:G.string().optional(),mcp:G.record(v7).optional(),plugin:G.array(G.string()).optional(),tools:G.record(G.boolean()).optional(),agent:G.record(P7).optional(),instructions:G.array(G.string()).optional(),permission:y7.optional(),provider:G.record(IQ).optional(),lsp:G.record(TQ).optional(),formatter:G.record(vQ).optional(),command:G.record(CQ).optional(),tui:uQ.optional(),server:PQ.optional(),keybind:yQ.optional(),watcher:xQ.optional(),auto_update:G.boolean().optional(),auto_compact:G.boolean().optional(),share:G.union([G.boolean(),G.string()]).optional()}),l2=G.object({name:o3,type:uF,description:G.string().min(1).max(1024),files:G.array(u7).default([]),dependencies:G.array(k7).default([]),npmDependencies:G.array(G.string()).optional(),npmDevDependencies:G.array(G.string()).optional(),opencode:x7.optional()});fQ=new RegExp(`^https://${j3.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);K3=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,i2=G.object({$schema:G.string().optional(),name:G.string().min(1,"Registry name cannot be empty"),version:G.string().regex(K3,{message:"Version must be valid semver"}),author:G.string().min(1,"Author cannot be empty"),opencode:G.string().regex(K3,{message:"OpenCode version must be valid semver"}).optional(),ocx:G.string().regex(K3,{message:"OCX version must be valid semver"}).optional(),components:G.array(l2)}).refine((D)=>{let F=new Set(D.components.map((B)=>B.name));for(let B of D.components)for(let $ of B.dependencies)if(!$.includes("/")&&!F.has($))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."}),U3=G.object({name:o3,"dist-tags":G.object({latest:G.string()}),versions:G.record(l2)}),U1=G.object({$schema:G.string().optional(),author:G.string(),opencode:G.string().regex(K3,{message:"OpenCode version must be valid semver"}).optional(),ocx:G.string().regex(K3,{message:"OCX version must be valid semver"}).optional(),components:G.array(G.object({name:o3,type:uF,description:G.string()}))})});import{mkdir as V1}from"fs/promises";import{dirname as hQ,join as n0}from"path";async function V3(D){let{source:F,out:B}=D,$=Bun.file(n0(F,"registry.jsonc")),_=Bun.file(n0(F,"registry.json")),Q=await $.exists(),Y=await _.exists();if(!Q&&!Y)throw new s0("No registry.jsonc or registry.json found in source directory");let H=await(Q?$:_).text(),J=ND(H,[],{allowTrailingComma:!0}),X=PF(J);if(X)throw new s0(`Registry schema compatibility failed (${X.issue})`,[X.remediation,...X.schemaUrl!==void 0?[`Invalid $schema: ${X.schemaUrl}`]:[]]);let z=i2.safeParse(J);if(!z.success){let N=z.error.errors.map((y)=>`${y.path.join(".")}: ${y.message}`);throw new s0("Registry validation failed",N)}let M=z.data,A=[];if(D.dryRun){let N=[];for(let O of M.components){N.push({action:"create",target:`file:components/${O.name}.json`,details:{type:"packument"}});for(let b of O.files){let L=b2(b,O.type),e=n0(F,"files",L.path);if(!await Bun.file(e).exists()){A.push(`${O.name}: Source file not found at ${e}`);continue}N.push({action:"create",target:`file:components/${O.name}/${L.path}`,details:{source:e}})}}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 y=N.filter((O)=>O.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:N,validation:{passed:A.length===0,errors:A.length>0?A:void 0},summary:`Would build ${M.components.length} components, ${y} files to ${B}`}}let K=n0(B,"components");await V1(K,{recursive:!0});let j="1.0.0";for(let N of M.components){let y={name:N.name,versions:{[j]:N},"dist-tags":{latest:j}},O=n0(K,`${N.name}.json`);await Bun.write(O,JSON.stringify(y,null,2));for(let b of N.files){let L=b2(b,N.type),e=n0(F,"files",L.path),p=n0(K,N.name,L.path),FD=hQ(p);if(!await Bun.file(e).exists()){A.push(`${N.name}: Source file not found at ${e}`);continue}await V1(FD,{recursive:!0});let KD=Bun.file(e);await Bun.write(p,KD)}}if(A.length>0)throw new s0(`Build failed with ${A.length} errors`,A);let S={$schema:M.$schema,name:M.name,version:M.version,author:M.author,...M.opencode&&{opencode:M.opencode},...M.ocx&&{ocx:M.ocx},components:M.components.map((N)=>({name:N.name,type:N.type,description:N.description}))};await Bun.write(n0(B,"index.json"),JSON.stringify(S,null,2));let R=n0(B,".well-known");await V1(R,{recursive:!0});let s={registry:"/index.json"};return await Bun.write(n0(R,"ocx.json"),JSON.stringify(s,null,2)),{componentsCount:M.components.length,outputPath:B}}var s0;var r3=V(()=>{b0();P0();s0=class s0 extends Error{errors;constructor(D,F=[]){super(D);this.errors=F;this.name="BuildRegistryError"}}});import m7 from"path";function g7(D){return m7.posix.isAbsolute(D)||m7.win32.isAbsolute(D)}var d7=()=>{};var E1;var L1=V(()=>{Q2();d7();E1=G.string().refine((D)=>!D.includes("\x00"),"Path cannot contain null bytes").refine((D)=>!D.split(/[/\\]/).some((F)=>F===".."),"Path cannot contain '..'").refine((D)=>!g7(D),"Path must be relative, not absolute")});function xD(D){return D.trim().replace(/\/+$/,"")}import{existsSync as yF}from"fs";import{mkdir as l7}from"fs/promises";import Y2 from"path";function L3(D,F,B,$){return`${xD(D)}::${F}/${B}@${$}`}function R2(D){if(!D.includes("::"))throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);let[F,B]=D.split("::");if(!B||!F)throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);if(!B.includes("@"))throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);let $=B.indexOf("@");if($===-1)throw Error(`Invalid canonical ID: missing revision in ${D}`);let _=B.slice(0,$),Q=B.slice($+1);if(!_||!Q)throw Error(`Invalid canonical ID: "${D}". Expected format: registryUrl::registryName/component@revision`);if(!_.includes("/"))throw Error(`Invalid canonical ID: "${D}". Component must be qualified (registryName/component)`);let[Y,q]=_.split("/");if(!Y||!q)throw Error(`Invalid canonical ID: "${D}". Both registry name and component name are required`);return{registryUrl:xD(F),registryName:Y,name:q,revision:Q}}function N2(D){let F=Y2.join(D,p7,i7);return{path:F,exists:yF(F)}}async function X0(D){let{path:F,exists:B}=N2(D);if(!B)return null;let _=await Bun.file(F).text(),Q=ND(_,[],{allowTrailingComma:!0});return s7.parse(Q)}async function j0(D,F){let B=Y2.join(D,p7,i7);await l7(Y2.dirname(B),{recursive:!0});let $=JSON.stringify(F,null,2);await Bun.write(B,$)}function S2(D){let F=Y2.join(D,w1,E3),B=Y2.join(D,E3),$=yF(F),_=yF(B);if($&&_)throw Error(`Found ${E3} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${E3})`);if($)return{path:F,exists:!0};if(_)return{path:B,exists:!0};return{path:F,exists:!1}}function xF(D,F){let B=Y2.join(D,w1,c7),$=Y2.join(D,c7);if(F?.isFlattened){if(yF($))return{path:$,exists:!0};return{path:$,exists:!1}}if(yF(B))return{path:B,exists:!0};if(yF($))return{path:$,exists:!0};return{path:B,exists:!1}}async function K0(D,F={}){let{path:B,exists:$}=S2(D);if(!$)return null;let Q=await Bun.file(B).text();try{let Y=ND(Q,[],{allowTrailingComma:!0});return Z2.parse(Y)}catch(Y){if(F.emitParseDiagnostics??!0)console.error(`Error parsing ${B}:`,Y);throw Y}}async function D8(D,F,B){let $=B??Y2.join(D,w1,E3);await l7(Y2.dirname($),{recursive:!0});let _=JSON.stringify(F,null,2);await Bun.write($,_)}async function w3(D,F){let{path:B,exists:$}=xF(D,F);if(!$)return null;let Q=await Bun.file(B).text(),Y=ND(Q,[],{allowTrailingComma:!0});return e3.parse(Y)}var t3,Z2,p7=".ocx",i7="receipt.jsonc",n7,s7,mQ,gQ,e3,E3="ocx.jsonc",c7="ocx.lock",w1=".opencode";var eD=V(()=>{b0();Q2();P0();t3=G.object({url:G.string().url("Registry URL must be a valid URL"),headers:G.record(G.string()).optional()}),Z2=G.object({$schema:G.string().optional(),profile:G.string().optional(),registries:G.record(t3).default({}),lockRegistries:G.boolean().default(!1),skipCompatCheck:G.boolean().default(!1)}),n7=G.object({registryUrl:G.string(),registryName:G.string(),name:G.string(),revision:G.string(),hash:G.string(),files:G.array(G.object({path:G.string(),hash:G.string()})),installedAt:G.string(),updatedAt:G.string().optional(),owner:G.object({type:G.enum(["user","profile","system"]),id:G.string().optional()}).optional(),opencode:G.record(G.unknown()).optional()}),s7=G.object({version:G.literal(1),root:G.string().optional(),installed:G.record(G.string(),n7).default({})}),mQ=G.object({registry:G.string(),version:G.string(),hash:G.string(),files:G.array(G.string()),installedAt:G.string(),updatedAt:G.string().optional()}),gQ=G.object({registry:G.string(),component:G.string(),version:G.string().optional(),hash:G.string(),installedAt:G.string()}),e3=G.object({lockVersion:G.literal(1),installedFrom:gQ.optional(),installed:G.record(j1,mQ).default({})})});var{Glob:dQ}=globalThis.Bun;var a7,q2;var fF=V(()=>{Q2();L1();eD();a7=G.string().refine((D)=>{try{return new dQ(D),!0}catch{return!1}},{message:"Invalid glob pattern"}),q2=G.object({$schema:G.string().optional(),bin:G.string().optional(),registries:G.record(t3).default({}),componentPath:E1.optional(),renameWindow:G.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:G.array(a7).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:G.array(a7).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var O1=V(()=>{L1();eD();fF();P0()});var O3=c0((cQ)=>{class b1 extends Error{constructor(D,F,B){super(B);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class o7 extends b1{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}cQ.CommanderError=b1;cQ.InvalidArgumentError=o7});var F8=c0((sQ)=>{var{InvalidArgumentError:iQ}=O3();class r7{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,B)=>{if(!this.argChoices.includes(F))throw new iQ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,B);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function nQ(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}sQ.Argument=r7;sQ.humanReadableArgName=nQ});var Z1=c0((tQ)=>{var{humanReadableArgName:rQ}=F8();class t7{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter(($)=>!$._hidden),B=D._getHelpCommand();if(B&&!B._hidden)F.push(B);if(this.sortSubcommands)F.sort(($,_)=>{return $.name().localeCompare(_.name())});return F}compareOptions(D,F){let B=($)=>{return $.short?$.short.replace(/^-/,""):$.long.replace(/^--/,"")};return B(D).localeCompare(B(F))}visibleOptions(D){let F=D.options.filter(($)=>!$.hidden),B=D._getHelpOption();if(B&&!B.hidden){let $=B.short&&D._findOption(B.short),_=B.long&&D._findOption(B.long);if(!$&&!_)F.push(B);else if(B.long&&!_)F.push(D.createOption(B.long,B.description));else if(B.short&&!$)F.push(D.createOption(B.short,B.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let B=D.parent;B;B=B.parent){let $=B.options.filter((_)=>!_.hidden);F.push(...$)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map((B)=>rQ(B)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm($))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleOptionTerm(F.optionTerm($))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleOptionTerm(F.optionTerm($))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((B,$)=>{return Math.max(B,this.displayWidth(F.styleArgumentTerm(F.argumentTerm($))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let B="";for(let $=D.parent;$;$=$.parent)B=$.name()+" "+B;return B+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((B)=>JSON.stringify(B)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let B=`(${F.join(", ")})`;if(D.description)return`${D.description} ${B}`;return B}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((B)=>JSON.stringify(B)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let B=`(${F.join(", ")})`;if(D.description)return`${D.description} ${B}`;return B}return D.description}formatItemList(D,F,B){if(F.length===0)return[];return[B.styleTitle(D),...F,""]}groupItems(D,F,B){let $=new Map;return D.forEach((_)=>{let Q=B(_);if(!$.has(Q))$.set(Q,[])}),F.forEach((_)=>{let Q=B(_);if(!$.has(Q))$.set(Q,[]);$.get(Q).push(_)}),$}formatHelp(D,F){let B=F.padWidth(D,F),$=F.helpWidth??80;function _(X,z){return F.formatItem(X,B,z,F)}let Q=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],Y=F.commandDescription(D);if(Y.length>0)Q=Q.concat([F.boxWrap(F.styleCommandDescription(Y),$),""]);let q=F.visibleArguments(D).map((X)=>{return _(F.styleArgumentTerm(F.argumentTerm(X)),F.styleArgumentDescription(F.argumentDescription(X)))});if(Q=Q.concat(this.formatItemList("Arguments:",q,F)),this.groupItems(D.options,F.visibleOptions(D),(X)=>X.helpGroupHeading??"Options:").forEach((X,z)=>{let M=X.map((A)=>{return _(F.styleOptionTerm(F.optionTerm(A)),F.styleOptionDescription(F.optionDescription(A)))});Q=Q.concat(this.formatItemList(z,M,F))}),F.showGlobalOptions){let X=F.visibleGlobalOptions(D).map((z)=>{return _(F.styleOptionTerm(F.optionTerm(z)),F.styleOptionDescription(F.optionDescription(z)))});Q=Q.concat(this.formatItemList("Global Options:",X,F))}return this.groupItems(D.commands,F.visibleCommands(D),(X)=>X.helpGroup()||"Commands:").forEach((X,z)=>{let M=X.map((A)=>{return _(F.styleSubcommandTerm(F.subcommandTerm(A)),F.styleSubcommandDescription(F.subcommandDescription(A)))});Q=Q.concat(this.formatItemList(z,M,F))}),Q.join(`
|
|
37
|
-
`)}displayWidth(
|
|
38
|
-
`+" ".repeat(
|
|
39
|
-
${
|
|
40
|
-
`)}}function
|
|
74
|
+
rm -rf "${v}"
|
|
75
|
+
ocx profile show ${$} --global`,"CONFIG_ERROR",K$.CONFIG);this.profile=$;this.localDir=v;this.name="LocalProfileUnsupportedError"}}});import*as u4 from"path";function O4($,v){if(v.includes("\x00"))throw new U4("Path contains null bytes",v,"null_byte");if(u4.isAbsolute(v)||u4.win32.isAbsolute(v))throw new U4("Path must be relative",v,"absolute_path");if(/^[a-zA-Z]:/.test(v)||v.startsWith("\\\\"))throw new U4("Path contains Windows absolute",v,"windows_absolute");let U=u4.basename(v).toUpperCase().split(".")[0]??"";if(iZ.has(U))throw new U4("Path uses Windows reserved name",v,"windows_reserved");let _=v.normalize("NFC").replace(/\\/g,"/"),J=u4.resolve($),Y=u4.resolve(J,_),z=u4.relative(J,Y);if(z.startsWith("../")||z.startsWith("..\\")||z===".."||u4.isAbsolute(z))throw new U4("Path escapes base directory",v,"path_traversal");return Y}var U4,iZ;var q1=b(()=>{U4=class U4 extends Error{attemptedPath;reason;constructor($,v,U){super($);this.attemptedPath=v;this.reason=U;this.name="PathValidationError"}};iZ=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"])});import{isAbsolute as nZ,normalize as Kq}from"path";function o4($){if(!$.includes("/"))throw Error(`Invalid component reference: "${$}". Use format: alias/component`);let v=$.split("/");if(v.length>2)throw Error(`Invalid component reference: "${$}". Too many "/" separators. Use format: alias/component`);let[U,Q]=v;if(!U||!Q)throw Error(`Invalid component reference: "${$}". Both alias and component are required.`);return{namespace:U,component:Q}}function BJ($,v){return`${$}/${v}`}function WJ($){if(nZ($))throw new M(`Invalid path: "${$}" - absolute paths not allowed`);if($.startsWith("~"))throw new M(`Invalid path: "${$}" - home directory paths not allowed`);if(Kq($).startsWith(".."))throw new M(`Invalid path: "${$}" - path traversal not allowed`)}function Lq($){return $}function jq($,v){if(rZ.has($))throw new M(`Target "${$}" is reserved for installer use`);try{O4("/dummy/base",$)}catch(Q){if(Q instanceof U4)throw new M(`Invalid target "${$}": ${Q.message}`);throw Q}if(v!=="profile"){let Q=Kq($);if(Wq.some((J)=>Q===J||Q.startsWith(J)))throw new M(`Target path '${$}' is protected and cannot be overwritten by registry components`)}}function h6($,v){if(typeof $==="string"){WJ($);let U=Lq($);return jq(U,v),{path:$,target:U}}return WJ($.path),WJ($.target),jq($.target,v),$}function kq($){if(typeof $==="string")return{type:"remote",url:$,enabled:!0};return $}function j1($){let v;if($.opencode){let{mcp:U,...Q}=$.opencode;v={...Q,...U&&{mcp:Object.fromEntries(Object.entries(U).map(([_,J])=>[_,kq(J)]))}}}return{...$,files:$.files.map((U)=>h6(U,$.type)),opencode:v}}function Z0($){if($===null||$===void 0||typeof $!=="object")return null;let v=$;if(!Object.hasOwn(v,"$schema"))return{issue:"legacy-schema-v1",remediation:`This registry uses legacy schema v1 (missing $schema). Set "$schema" to "${i4}".`,supportedMajor:p4};let Q=v.$schema;if(typeof Q!=="string")return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:String(Q),supportedMajor:p4};if(!Q)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};if(Q===KJ)return{issue:"legacy-schema-v1",remediation:`Schema URL "${KJ}" is legacy v1. Use "${i4}" instead.`,schemaUrl:Q,supportedMajor:p4};let _=Q.match(JD);if(!_)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};let J=_[1];if(!J)return{issue:"invalid-schema-url",remediation:`Registry $schema must be a canonical URL like "${i4}".`,schemaUrl:Q,supportedMajor:p4};let Y=Number.parseInt(J,10);if(Y!==p4)return{issue:"unsupported-schema-version",remediation:`Schema major v${Y} is unsupported. Use "${i4}" (v${p4}).`,schemaUrl:Q,supportedMajor:p4,detectedMajor:Y};return null}var lS,n_,bJ,Hq,B0,rZ,Wq,oZ,tZ,bq,Bq,Zq,Dq,aZ,sZ,eZ,$D,vD,_D,UD,QD,Vq,Mq,wq,G1,JD,Pv,K1,xv,ZJ;var t4=b(()=>{Z6();i_();z$();q1();lS=K.string().refine(($)=>$.startsWith("npm:"),{message:'npm specifier must start with "npm:" prefix'}).refine(($)=>{let v=$.slice(4);if(!v)return!1;if(v.includes("..")||v.includes("/./"))return!1;return!0},{message:"Invalid npm specifier format"}),n_=K.string().min(1,"Name cannot be empty").max(64,"Name cannot exceed 64 characters").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Must be lowercase alphanumeric with single hyphen separators (e.g., 'my-component', 'my-plugin'). Cannot start/end with hyphen or have consecutive hyphens."}),bJ=K.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/,{message:'Must be in format "alias/component" (e.g., "kdco/researcher"). Both parts must be lowercase alphanumeric with hyphens.'});Hq=K.string().refine(($)=>{let v=/^[a-z0-9]+(-[a-z0-9]+)*$/,U=/^[a-z0-9]+(-[a-z0-9]+)*\/[a-z0-9]+(-[a-z0-9]+)*$/;return v.test($)||U.test($)},{message:'Dependency must be either a bare name (e.g., "utils") or qualified (e.g., "acme/utils")'}),B0=K.enum(["agent","skill","plugin","command","tool","bundle","profile"]),rZ=new Set([".ocx","ocx.lock"]),Wq=[".ocx/","ocx.jsonc","package.json",".git/",".env","node_modules/"],oZ=K.string().min(1,"Target path cannot be empty").refine(($)=>{if($.startsWith("/")||/^[a-zA-Z]:/.test($))return!1;if($.includes("\x00"))return!1;return!0},{message:"Target path must be relative and safe (no absolute paths or null bytes)"}).refine(($)=>{return!Wq.some((v)=>$===v||$.startsWith(v))},{message:"Target path is protected and cannot be overwritten by registry components"}),tZ=K.object({clientId:K.string().optional(),scopes:K.array(K.string()).optional(),authUrl:K.string().optional(),tokenUrl:K.string().optional()}),bq=K.object({type:K.enum(["remote","local"]),url:K.string().optional(),command:K.union([K.string(),K.array(K.string())]).optional(),environment:K.record(K.string(),K.string()).optional(),headers:K.record(K.string(),K.string()).optional(),oauth:K.union([K.boolean(),tZ]).optional(),enabled:K.boolean().default(!0)}).refine(($)=>{if($.type==="remote"&&!$.url)return!1;if($.type==="local"&&!$.command)return!1;return!0},{message:"Remote MCP servers require 'url', local servers require 'command'"}),Bq=K.union([K.string(),bq]),Zq=K.object({path:K.string().min(1,"File path cannot be empty"),target:K.string().min(1,"Target path cannot be empty")}),Dq=K.union([K.string().min(1,"File path cannot be empty"),Zq]),aZ=K.object({api:K.string().optional(),headers:K.record(K.string(),K.string()).optional(),env:K.record(K.string(),K.string()).optional(),enabled:K.boolean().optional()}).passthrough(),sZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),enabled:K.boolean().optional()}).passthrough(),eZ=K.object({command:K.union([K.string(),K.array(K.string())]).optional(),glob:K.string().optional()}).passthrough(),$D=K.object({description:K.string().optional(),run:K.string().optional()}).passthrough(),vD=K.object({disabled:K.boolean().optional()}).passthrough(),_D=K.object({host:K.string().optional(),port:K.number().optional()}).passthrough(),UD=K.record(K.string(),K.string()),QD=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough(),Vq=K.object({model:K.string().optional(),description:K.string().optional(),steps:K.number().int().positive().optional(),maxSteps:K.number().int().positive().optional(),mode:K.enum(["primary","subagent","all"]).optional(),tools:K.record(K.string(),K.boolean()).optional(),temperature:K.number().optional(),top_p:K.number().optional(),prompt:K.string().optional(),permission:K.record(K.string(),K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])).optional(),color:K.string().optional(),disable:K.boolean().optional(),options:K.record(K.string(),K.any()).optional()}),Mq=K.object({bash:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),edit:K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))]).optional(),mcp:K.record(K.string(),K.enum(["ask","allow","deny"])).optional()}).catchall(K.union([K.enum(["ask","allow","deny"]),K.record(K.string(),K.enum(["ask","allow","deny"]))])),wq=K.object({$schema:K.string().optional(),theme:K.string().optional(),logLevel:K.string().optional(),username:K.string().optional(),model:K.string().optional(),small_model:K.string().optional(),default_agent:K.string().optional(),mcp:K.record(K.string(),Bq).optional(),plugin:K.array(K.string()).optional(),tools:K.record(K.string(),K.boolean()).optional(),agent:K.record(K.string(),Vq).optional(),instructions:K.array(K.string()).optional(),permission:Mq.optional(),provider:K.record(K.string(),aZ).optional(),lsp:K.record(K.string(),sZ).optional(),formatter:K.record(K.string(),eZ).optional(),command:K.record(K.string(),$D).optional(),tui:vD.optional(),server:_D.optional(),keybind:UD.optional(),watcher:QD.optional(),auto_update:K.boolean().optional(),auto_compact:K.boolean().optional(),share:K.union([K.boolean(),K.string()]).optional()}),G1=K.object({name:n_,type:B0,description:K.string().min(1).max(1024),files:K.array(Dq).default([]),dependencies:K.array(Hq).default([]),npmDependencies:K.array(K.string()).optional(),npmDevDependencies:K.array(K.string()).optional(),opencode:wq.optional()});JD=new RegExp(`^https://${Ev.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}/schemas/v([1-9]\\d*)/registry\\.json$`);Pv=/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/,K1=K.object({$schema:K.string().optional(),name:K.string().min(1,"Registry name cannot be empty"),version:K.string().regex(Pv,{message:"Version must be valid semver"}),author:K.string().min(1,"Author cannot be empty"),opencode:K.string().regex(Pv,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(Pv,{message:"OCX version must be valid semver"}).optional(),components:K.array(G1)}).refine(($)=>{let v=new Set($.components.map((U)=>U.name));for(let U of $.components)for(let Q of U.dependencies)if(!Q.includes("/")&&!v.has(Q))return!1;return!0},{message:"Bare dependencies must reference components that exist in the registry. Use qualified references (e.g., 'other-registry/component') for cross-registry dependencies."}),xv=K.object({name:n_,"dist-tags":K.object({latest:K.string()}),versions:K.record(K.string(),G1)}),ZJ=K.object({$schema:K.string().optional(),author:K.string(),opencode:K.string().regex(Pv,{message:"OpenCode version must be valid semver"}).optional(),ocx:K.string().regex(Pv,{message:"OCX version must be valid semver"}).optional(),components:K.array(K.object({name:n_,type:B0,description:K.string()}))})});import{mkdir as DJ}from"fs/promises";import{dirname as YD,join as I6}from"path";async function uv($){let{source:v,out:U}=$,Q=Bun.file(I6(v,"registry.jsonc")),_=Bun.file(I6(v,"registry.json")),J=await Q.exists(),Y=await _.exists();if(!J&&!Y)throw new X6("No registry.jsonc or registry.json found in source directory");let I=await(J?Q:_).text(),X=E$(I,[],{allowTrailingComma:!0}),q=Z0(X);if(q)throw new X6(`Registry schema compatibility failed (${q.issue})`,[q.remediation,...q.schemaUrl!==void 0?[`Invalid $schema: ${q.schemaUrl}`]:[]]);let G=K1.safeParse(X);if(!G.success){let O=G.error.issues.map((g)=>`${g.path.join(".")}: ${g.message}`);throw new X6("Registry validation failed",O)}let j=G.data,H=[];if($.dryRun){let O=[];for(let w of j.components){O.push({action:"create",target:`file:components/${w.name}.json`,details:{type:"packument"}});for(let N of w.files){let L=h6(N,w.type),U$=I6(v,"files",L.path);if(!await Bun.file(U$).exists()){H.push(`${w.name}: Source file not found at ${U$}`);continue}O.push({action:"create",target:`file:components/${w.name}/${L.path}`,details:{source:U$}})}}O.push({action:"create",target:"file:index.json",details:{type:"registry index"}}),O.push({action:"create",target:"file:.well-known/ocx.json",details:{type:"discovery file"}});let g=O.filter((w)=>w.action==="create").length;return{dryRun:!0,command:"build",wouldPerform:O,validation:{passed:H.length===0,errors:H.length>0?H:void 0},summary:`Would build ${j.components.length} components, ${g} files to ${U}`}}let Z=I6(U,"components");await DJ(Z,{recursive:!0});let D="1.0.0";for(let O of j.components){let g={name:O.name,versions:{[D]:O},"dist-tags":{latest:D}},w=I6(Z,`${O.name}.json`);await Bun.write(w,JSON.stringify(g,null,2));for(let N of O.files){let L=h6(N,O.type),U$=I6(v,"files",L.path),$$=I6(Z,O.name,L.path),a=YD($$);if(!await Bun.file(U$).exists()){H.push(`${O.name}: Source file not found at ${U$}`);continue}await DJ(a,{recursive:!0});let V$=Bun.file(U$);await Bun.write($$,V$)}}if(H.length>0)throw new X6(`Build failed with ${H.length} errors`,H);let E={$schema:j.$schema,name:j.name,version:j.version,author:j.author,...j.opencode&&{opencode:j.opencode},...j.ocx&&{ocx:j.ocx},components:j.components.map((O)=>({name:O.name,type:O.type,description:O.description}))};await Bun.write(I6(U,"index.json"),JSON.stringify(E,null,2));let A=I6(U,".well-known");await DJ(A,{recursive:!0});let r={registry:"/index.json"};return await Bun.write(I6(A,"ocx.json"),JSON.stringify(r,null,2)),{componentsCount:j.components.length,outputPath:U}}var X6;var r_=b(()=>{E4();t4();X6=class X6 extends Error{errors;constructor($,v=[]){super($);this.errors=v;this.name="BuildRegistryError"}}});import Aq from"path";function Oq($){return Aq.posix.isAbsolute($)||Aq.win32.isAbsolute($)}var Fq=()=>{};var VJ;var MJ=b(()=>{Z6();Fq();VJ=K.string().refine(($)=>!$.includes("\x00"),"Path cannot contain null bytes").refine(($)=>!$.split(/[/\\]/).some((v)=>v===".."),"Path cannot contain '..'").refine(($)=>!Oq($),"Path must be relative, not absolute")});function p$($){return $.trim().replace(/\/+$/,"")}import{existsSync as D0}from"fs";import{mkdir as Sq}from"fs/promises";import D6 from"path";function Cv($,v,U,Q){return`${p$($)}::${v}/${U}@${Q}`}function l6($){if(!$.includes("::"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let[v,U]=$.split("::");if(!U||!v)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!U.includes("@"))throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);let Q=U.indexOf("@");if(Q===-1)throw Error(`Invalid canonical ID: missing revision in ${$}`);let _=U.slice(0,Q),J=U.slice(Q+1);if(!_||!J)throw Error(`Invalid canonical ID: "${$}". Expected format: registryUrl::registryName/component@revision`);if(!_.includes("/"))throw Error(`Invalid canonical ID: "${$}". Component must be qualified (registryName/component)`);let[Y,z]=_.split("/");if(!Y||!z)throw Error(`Invalid canonical ID: "${$}". Both registry name and component name are required`);return{registryUrl:p$(v),registryName:Y,name:z,revision:J}}function d6($){let v=D6.join($,Tq,Rq);return{path:v,exists:D0(v)}}async function F4($){let{path:v,exists:U}=d6($);if(!U)return null;let _=await Bun.file(v).text(),J=E$(_,[],{allowTrailingComma:!0});return Pq.parse(J)}async function y4($,v){let U=D6.join($,Tq,Rq);await Sq(D6.dirname(U),{recursive:!0});let Q=JSON.stringify(v,null,2);await Bun.write(U,Q)}function p6($){let v=D6.join($,wJ,yv),U=D6.join($,yv),Q=D0(v),_=D0(U);if(Q&&_)throw Error(`Found ${yv} in both .opencode/ and project root. Please consolidate to one location (recommended: .opencode/${yv})`);if(Q)return{path:v,exists:!0};if(_)return{path:U,exists:!0};return{path:v,exists:!1}}function V0($,v){let U=D6.join($,wJ,Nq),Q=D6.join($,Nq);if(v?.isFlattened){if(D0(Q))return{path:Q,exists:!0};return{path:Q,exists:!1}}if(D0(U))return{path:U,exists:!0};if(D0(Q))return{path:Q,exists:!0};return{path:U,exists:!1}}async function C4($,v={}){let{path:U,exists:Q}=p6($);if(!Q)return null;let J=await Bun.file(U).text();try{let Y=E$(J,[],{allowTrailingComma:!0});return c6.parse(Y)}catch(Y){if(v.emitParseDiagnostics??!0)console.error(`Error parsing ${U}:`,Y);throw Y}}async function a_($,v,U){let Q=U??D6.join($,wJ,yv);await Sq(D6.dirname(Q),{recursive:!0});let _=JSON.stringify(v,null,2);await Bun.write(Q,_)}async function fv($,v){let{path:U,exists:Q}=V0($,v);if(!Q)return null;let J=await Bun.file(U).text(),Y=E$(J,[],{allowTrailingComma:!0});return t_.parse(Y)}var o_,c6,Tq=".ocx",Rq="receipt.jsonc",Eq,Pq,zD,ID,t_,yv="ocx.jsonc",Nq="ocx.lock",wJ=".opencode";var X4=b(()=>{E4();Z6();t4();o_=K.object({url:K.string().url("Registry URL must be a valid URL"),headers:K.record(K.string(),K.string()).optional()}),c6=K.object({$schema:K.string().optional(),profile:K.string().optional(),registries:K.record(K.string(),o_).default({}),lockRegistries:K.boolean().default(!1),skipCompatCheck:K.boolean().default(!1)}),Eq=K.object({registryUrl:K.string(),registryName:K.string(),name:K.string(),revision:K.string(),hash:K.string(),files:K.array(K.object({path:K.string(),hash:K.string()})),installedAt:K.string(),updatedAt:K.string().optional(),owner:K.object({type:K.enum(["user","profile","system"]),id:K.string().optional()}).optional(),opencode:K.record(K.string(),K.unknown()).optional()}),Pq=K.object({version:K.literal(1),root:K.string().optional(),installed:K.record(K.string(),Eq).default({})}),zD=K.object({registry:K.string(),version:K.string(),hash:K.string(),files:K.array(K.string()),installedAt:K.string(),updatedAt:K.string().optional()}),ID=K.object({registry:K.string(),component:K.string(),version:K.string().optional(),hash:K.string(),installedAt:K.string()}),t_=K.object({lockVersion:K.literal(1),installedFrom:ID.optional(),installed:K.record(bJ,zD).default({})})});var{Glob:XD}=globalThis.Bun;var xq,V6;var M0=b(()=>{Z6();MJ();X4();xq=K.string().refine(($)=>{try{return new XD($),!0}catch{return!1}},{message:"Invalid glob pattern"}),V6=K.object({$schema:K.string().optional(),bin:K.string().optional(),registries:K.record(K.string(),o_).default({}),componentPath:VJ.optional(),renameWindow:K.boolean().default(!0).describe("Set terminal/tmux window name when launching OpenCode"),exclude:K.array(xq).default(["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"]).describe("Glob patterns for project files to exclude from OpenCode discovery"),include:K.array(xq).default([]).describe("Glob patterns for project files to include (overrides exclude)")})});var LJ=b(()=>{MJ();X4();M0();t4()});var mv=T6((qD)=>{class kJ extends Error{constructor($,v,U){super(U);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=v,this.exitCode=$,this.nestedError=void 0}}class uq extends kJ{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}qD.CommanderError=kJ;qD.InvalidArgumentError=uq});var s_=T6((WD)=>{var{InvalidArgumentError:KD}=mv();class yq{constructor($,v){switch(this.description=v||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,v){if(v===this.defaultValue||!Array.isArray(v))return[$];return v.push($),v}default($,v){return this.defaultValue=$,this.defaultValueDescription=v,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(v,U)=>{if(!this.argChoices.includes(v))throw new KD(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(v,U);return v},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function HD($){let v=$.name()+($.variadic===!0?"...":"");return $.required?"<"+v+">":"["+v+"]"}WD.Argument=yq;WD.humanReadableArgName=HD});var AJ=T6((DD)=>{var{humanReadableArgName:ZD}=s_();class Cq{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let v=$.commands.filter((Q)=>!Q._hidden),U=$._getHelpCommand();if(U&&!U._hidden)v.push(U);if(this.sortSubcommands)v.sort((Q,_)=>{return Q.name().localeCompare(_.name())});return v}compareOptions($,v){let U=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return U($).localeCompare(U(v))}visibleOptions($){let v=$.options.filter((Q)=>!Q.hidden),U=$._getHelpOption();if(U&&!U.hidden){let Q=U.short&&$._findOption(U.short),_=U.long&&$._findOption(U.long);if(!Q&&!_)v.push(U);else if(U.long&&!_)v.push($.createOption(U.long,U.description));else if(U.short&&!Q)v.push($.createOption(U.short,U.description))}if(this.sortOptions)v.sort(this.compareOptions);return v}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let v=[];for(let U=$.parent;U;U=U.parent){let Q=U.options.filter((_)=>!_.hidden);v.push(...Q)}if(this.sortOptions)v.sort(this.compareOptions);return v}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((v)=>{v.description=v.description||$._argsDescription[v.name()]||""});if($.registeredArguments.find((v)=>v.description))return $.registeredArguments;return[]}subcommandTerm($){let v=$.registeredArguments.map((U)=>ZD(U)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(v?" "+v:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,v){return v.visibleCommands($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleSubcommandTerm(v.subcommandTerm(Q))))},0)}longestOptionTermLength($,v){return v.visibleOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleOptionTerm(v.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,v){return v.visibleGlobalOptions($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleOptionTerm(v.optionTerm(Q))))},0)}longestArgumentTermLength($,v){return v.visibleArguments($).reduce((U,Q)=>{return Math.max(U,this.displayWidth(v.styleArgumentTerm(v.argumentTerm(Q))))},0)}commandUsage($){let v=$._name;if($._aliases[0])v=v+"|"+$._aliases[0];let U="";for(let Q=$.parent;Q;Q=Q.parent)U=Q.name()+" "+U;return U+v+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let v=[];if($.argChoices)v.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")v.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)v.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)v.push(`env: ${$.envVar}`);if(v.length>0){let U=`(${v.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}argumentDescription($){let v=[];if($.argChoices)v.push(`choices: ${$.argChoices.map((U)=>JSON.stringify(U)).join(", ")}`);if($.defaultValue!==void 0)v.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(v.length>0){let U=`(${v.join(", ")})`;if($.description)return`${$.description} ${U}`;return U}return $.description}formatItemList($,v,U){if(v.length===0)return[];return[U.styleTitle($),...v,""]}groupItems($,v,U){let Q=new Map;return $.forEach((_)=>{let J=U(_);if(!Q.has(J))Q.set(J,[])}),v.forEach((_)=>{let J=U(_);if(!Q.has(J))Q.set(J,[]);Q.get(J).push(_)}),Q}formatHelp($,v){let U=v.padWidth($,v),Q=v.helpWidth??80;function _(q,G){return v.formatItem(q,U,G,v)}let J=[`${v.styleTitle("Usage:")} ${v.styleUsage(v.commandUsage($))}`,""],Y=v.commandDescription($);if(Y.length>0)J=J.concat([v.boxWrap(v.styleCommandDescription(Y),Q),""]);let z=v.visibleArguments($).map((q)=>{return _(v.styleArgumentTerm(v.argumentTerm(q)),v.styleArgumentDescription(v.argumentDescription(q)))});if(J=J.concat(this.formatItemList("Arguments:",z,v)),this.groupItems($.options,v.visibleOptions($),(q)=>q.helpGroupHeading??"Options:").forEach((q,G)=>{let j=q.map((H)=>{return _(v.styleOptionTerm(v.optionTerm(H)),v.styleOptionDescription(v.optionDescription(H)))});J=J.concat(this.formatItemList(G,j,v))}),v.showGlobalOptions){let q=v.visibleGlobalOptions($).map((G)=>{return _(v.styleOptionTerm(v.optionTerm(G)),v.styleOptionDescription(v.optionDescription(G)))});J=J.concat(this.formatItemList("Global Options:",q,v))}return this.groupItems($.commands,v.visibleCommands($),(q)=>q.helpGroup()||"Commands:").forEach((q,G)=>{let j=q.map((H)=>{return _(v.styleSubcommandTerm(v.subcommandTerm(H)),v.styleSubcommandDescription(v.subcommandDescription(H)))});J=J.concat(this.formatItemList(G,j,v))}),J.join(`
|
|
76
|
+
`)}displayWidth($){return fq($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((v)=>{if(v==="[options]")return this.styleOptionText(v);if(v==="[command]")return this.styleSubcommandText(v);if(v[0]==="["||v[0]==="<")return this.styleArgumentText(v);return this.styleCommandText(v)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((v)=>{if(v==="[options]")return this.styleOptionText(v);if(v[0]==="["||v[0]==="<")return this.styleArgumentText(v);return this.styleSubcommandText(v)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,v){return Math.max(v.longestOptionTermLength($,v),v.longestGlobalOptionTermLength($,v),v.longestSubcommandTermLength($,v),v.longestArgumentTermLength($,v))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,v,U,Q){let J=" ".repeat(2);if(!U)return J+$;let Y=$.padEnd(v+$.length-Q.displayWidth($)),z=2,X=(this.helpWidth??80)-v-z-2,q;if(X<this.minWidthToWrap||Q.preformatted(U))q=U;else q=Q.boxWrap(U,X).replace(/\n/g,`
|
|
77
|
+
`+" ".repeat(v+z));return J+Y+" ".repeat(z)+q.replace(/\n/g,`
|
|
78
|
+
${J}`)}boxWrap($,v){if(v<this.minWidthToWrap)return $;let U=$.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,_=[];return U.forEach((J)=>{let Y=J.match(Q);if(Y===null){_.push("");return}let z=[Y.shift()],I=this.displayWidth(z[0]);Y.forEach((X)=>{let q=this.displayWidth(X);if(I+q<=v){z.push(X),I+=q;return}_.push(z.join(""));let G=X.trimStart();z=[G],I=this.displayWidth(G)}),_.push(z.join(""))}),_.join(`
|
|
79
|
+
`)}}function fq($){let v=/\x1b\[\d*(;\d*)*m/g;return $.replace(v,"")}DD.Help=Cq;DD.stripColor=fq});var OJ=T6((kD)=>{var{InvalidArgumentError:wD}=mv();class gq{constructor($,v){this.flags=$,this.description=v||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let U=LD($);if(this.short=U.shortFlag,this.long=U.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,v){return this.defaultValue=$,this.defaultValueDescription=v,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let v=$;if(typeof $==="string")v={[$]:!0};return this.implied=Object.assign(this.implied||{},v),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,v){if(v===this.defaultValue||!Array.isArray(v))return[$];return v.push($),v}choices($){return this.argChoices=$.slice(),this.parseArg=(v,U)=>{if(!this.argChoices.includes(v))throw new wD(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(v,U);return v},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return mq(this.name().replace(/^no-/,""));return mq(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class hq{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((v)=>{if(v.negate)this.negativeOptions.set(v.attributeName(),v);else this.positiveOptions.set(v.attributeName(),v)}),this.negativeOptions.forEach((v,U)=>{if(this.positiveOptions.has(U))this.dualOptions.add(U)})}valueFromOption($,v){let U=v.attributeName();if(!this.dualOptions.has(U))return!0;let Q=this.negativeOptions.get(U).presetArg,_=Q!==void 0?Q:!1;return v.negate===(_===$)}}function mq($){return $.split("-").reduce((v,U)=>{return v+U[0].toUpperCase()+U.slice(1)})}function LD($){let v,U,Q=/^-[^-]$/,_=/^--[^-]/,J=$.split(/[ |,]+/).concat("guard");if(Q.test(J[0]))v=J.shift();if(_.test(J[0]))U=J.shift();if(!v&&Q.test(J[0]))v=J.shift();if(!v&&_.test(J[0]))v=U,U=J.shift();if(J[0].startsWith("-")){let Y=J[0],z=`option creation failed due to '${Y}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Y))throw Error(`${z}
|
|
41
80
|
- a short flag is a single dash and a single character
|
|
42
81
|
- either use a single dash and a single character (for a short flag)
|
|
43
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(
|
|
44
|
-
- too many short flags`);if(_.test(Y))throw Error(`${
|
|
45
|
-
- too many long flags`);throw Error(`${
|
|
46
|
-
- unrecognised flag format`)}if(
|
|
47
|
-
(Did you mean one of ${
|
|
48
|
-
(Did you mean ${
|
|
49
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
50
|
-
Expecting one of '${
|
|
51
|
-
- already used by option '${
|
|
52
|
-
- 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(
|
|
53
|
-
- if '${
|
|
82
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Q.test(Y))throw Error(`${z}
|
|
83
|
+
- too many short flags`);if(_.test(Y))throw Error(`${z}
|
|
84
|
+
- too many long flags`);throw Error(`${z}
|
|
85
|
+
- unrecognised flag format`)}if(v===void 0&&U===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:v,longFlag:U}}kD.Option=gq;kD.DualOptions=hq});var cq=T6((SD)=>{function FD($,v){if(Math.abs($.length-v.length)>3)return Math.max($.length,v.length);let U=[];for(let Q=0;Q<=$.length;Q++)U[Q]=[Q];for(let Q=0;Q<=v.length;Q++)U[0][Q]=Q;for(let Q=1;Q<=v.length;Q++)for(let _=1;_<=$.length;_++){let J=1;if($[_-1]===v[Q-1])J=0;else J=1;if(U[_][Q]=Math.min(U[_-1][Q]+1,U[_][Q-1]+1,U[_-1][Q-1]+J),_>1&&Q>1&&$[_-1]===v[Q-2]&&$[_-2]===v[Q-1])U[_][Q]=Math.min(U[_][Q],U[_-2][Q-2]+1)}return U[$.length][v.length]}function ND($,v){if(!v||v.length===0)return"";v=Array.from(new Set(v));let U=$.startsWith("--");if(U)$=$.slice(2),v=v.map((Y)=>Y.slice(2));let Q=[],_=3,J=0.4;if(v.forEach((Y)=>{if(Y.length<=1)return;let z=FD($,Y),I=Math.max($.length,Y.length);if((I-z)/I>J){if(z<_)_=z,Q=[Y];else if(z===_)Q.push(Y)}}),Q.sort((Y,z)=>Y.localeCompare(z)),U)Q=Q.map((Y)=>`--${Y}`);if(Q.length>1)return`
|
|
86
|
+
(Did you mean one of ${Q.join(", ")}?)`;if(Q.length===1)return`
|
|
87
|
+
(Did you mean ${Q[0]}?)`;return""}SD.suggestSimilar=ND});var iq=T6((CD)=>{var RD=P1("events").EventEmitter,FJ=P1("child_process"),M6=P1("path"),e_=P1("fs"),Z$=P1("process"),{Argument:ED,humanReadableArgName:PD}=s_(),{CommanderError:NJ}=mv(),{Help:xD,stripColor:uD}=AJ(),{Option:lq,DualOptions:yD}=OJ(),{suggestSimilar:dq}=cq();class TJ extends RD{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(v)=>Z$.stdout.write(v),writeErr:(v)=>Z$.stderr.write(v),outputError:(v,U)=>U(v),getOutHelpWidth:()=>Z$.stdout.isTTY?Z$.stdout.columns:void 0,getErrHelpWidth:()=>Z$.stderr.isTTY?Z$.stderr.columns:void 0,getOutHasColors:()=>SJ()??(Z$.stdout.isTTY&&Z$.stdout.hasColors?.()),getErrHasColors:()=>SJ()??(Z$.stderr.isTTY&&Z$.stderr.hasColors?.()),stripColor:(v)=>uD(v)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let v=this;v;v=v.parent)$.push(v);return $}command($,v,U){let Q=v,_=U;if(typeof Q==="object"&&Q!==null)_=Q,Q=null;_=_||{};let[,J,Y]=$.match(/([^ ]+) *(.*)/),z=this.createCommand(J);if(Q)z.description(Q),z._executableHandler=!0;if(_.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!(_.noHelp||_.hidden),z._executableFile=_.executableFile||null,Y)z.arguments(Y);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),Q)return this;return z}createCommand($){return new TJ($)}createHelp(){return Object.assign(new xD,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,v){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
|
|
88
|
+
- specify the name in Command constructor or using .name()`);if(v=v||{},v.isDefault)this._defaultCommandName=$._name;if(v.noHelp||v.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,v){return new ED($,v)}argument($,v,U,Q){let _=this.createArgument($,v);if(typeof U==="function")_.default(Q).argParser(U);else _.default(U);return this.addArgument(_),this}arguments($){return $.trim().split(/ +/).forEach((v)=>{this.argument(v)}),this}addArgument($){let v=this.registeredArguments.slice(-1)[0];if(v?.variadic)throw Error(`only the last argument can be variadic '${v.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,v){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let U=$??"help [command]",[,Q,_]=U.match(/([^ ]+) *(.*)/),J=v??"display help for command",Y=this.createCommand(Q);if(Y.helpOption(!1),_)Y.arguments(_);if(J)Y.description(J);if(this._addImplicitHelpCommand=!0,this._helpCommand=Y,$||v)this._initCommandGroup(Y);return this}addHelpCommand($,v){if(typeof $!=="object")return this.helpCommand($,v),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,v){let U=["preSubcommand","preAction","postAction"];if(!U.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
|
|
89
|
+
Expecting one of '${U.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(v);else this._lifeCycleHooks[$]=[v];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(v)=>{if(v.code!=="commander.executeSubCommandAsync")throw v};return this}_exit($,v,U){if(this._exitCallback)this._exitCallback(new NJ($,v,U));Z$.exit($)}action($){let v=(U)=>{let Q=this.registeredArguments.length,_=U.slice(0,Q);if(this._storeOptionsAsProperties)_[Q]=this;else _[Q]=this.opts();return _.push(this),$.apply(this,_)};return this._actionHandler=v,this}createOption($,v){return new lq($,v)}_callParseArg($,v,U,Q){try{return $.parseArg(v,U)}catch(_){if(_.code==="commander.invalidArgument"){let J=`${Q} ${_.message}`;this.error(J,{exitCode:_.exitCode,code:_.code})}throw _}}_registerOption($){let v=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(v){let U=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${U}'
|
|
90
|
+
- already used by option '${v.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let v=(Q)=>{return[Q.name()].concat(Q.aliases())},U=v($).find((Q)=>this._findCommand(Q));if(U){let Q=v(this._findCommand(U)).join("|"),_=v($).join("|");throw Error(`cannot add command '${_}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let v=$.name(),U=$.attributeName();if($.negate){let _=$.long.replace(/^--no-/,"--");if(!this._findOption(_))this.setOptionValueWithSource(U,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(U,$.defaultValue,"default");let Q=(_,J,Y)=>{if(_==null&&$.presetArg!==void 0)_=$.presetArg;let z=this.getOptionValue(U);if(_!==null&&$.parseArg)_=this._callParseArg($,_,z,J);else if(_!==null&&$.variadic)_=$._collectValue(_,z);if(_==null)if($.negate)_=!1;else if($.isBoolean()||$.optional)_=!0;else _="";this.setOptionValueWithSource(U,_,Y)};if(this.on("option:"+v,(_)=>{let J=`error: option '${$.flags}' argument '${_}' is invalid.`;Q(_,J,"cli")}),$.envVar)this.on("optionEnv:"+v,(_)=>{let J=`error: option '${$.flags}' value '${_}' from env '${$.envVar}' is invalid.`;Q(_,J,"env")});return this}_optionEx($,v,U,Q,_){if(typeof v==="object"&&v instanceof lq)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let J=this.createOption(v,U);if(J.makeOptionMandatory(!!$.mandatory),typeof Q==="function")J.default(_).argParser(Q);else if(Q instanceof RegExp){let Y=Q;Q=(z,I)=>{let X=Y.exec(z);return X?X[0]:I},J.default(_).argParser(Q)}else J.default(Q);return this.addOption(J)}option($,v,U,Q){return this._optionEx({},$,v,U,Q)}requiredOption($,v,U,Q){return this._optionEx({mandatory:!0},$,v,U,Q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,v){return this.setOptionValueWithSource($,v,void 0)}setOptionValueWithSource($,v,U){if(this._storeOptionsAsProperties)this[$]=v;else this._optionValues[$]=v;return this._optionValueSources[$]=U,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let v;return this._getCommandAndAncestors().forEach((U)=>{if(U.getOptionValueSource($)!==void 0)v=U.getOptionValueSource($)}),v}_prepareUserArgs($,v){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(v=v||{},$===void 0&&v.from===void 0){if(Z$.versions?.electron)v.from="electron";let Q=Z$.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))v.from="eval"}if($===void 0)$=Z$.argv;this.rawArgs=$.slice();let U;switch(v.from){case void 0:case"node":this._scriptPath=$[1],U=$.slice(2);break;case"electron":if(Z$.defaultApp)this._scriptPath=$[1],U=$.slice(2);else U=$.slice(1);break;case"user":U=$.slice(0);break;case"eval":U=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${v.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",U}parse($,v){this._prepareForParse();let U=this._prepareUserArgs($,v);return this._parseCommand([],U),this}async parseAsync($,v){this._prepareForParse();let U=this._prepareUserArgs($,v);return await this._parseCommand([],U),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
91
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,v,U){if(e_.existsSync($))return;let Q=v?`searched for local subcommand relative to directory '${v}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${$}' does not exist
|
|
92
|
+
- if '${U}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
54
93
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
55
|
-
- ${
|
|
94
|
+
- ${Q}`;throw Error(_)}_executeSubCommand($,v){v=v.slice();let U=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function _(X,q){let G=M6.resolve(X,q);if(e_.existsSync(G))return G;if(Q.includes(M6.extname(q)))return;let j=Q.find((H)=>e_.existsSync(`${G}${H}`));if(j)return`${G}${j}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=$._executableFile||`${this._name}-${$._name}`,Y=this._executableDir||"";if(this._scriptPath){let X;try{X=e_.realpathSync(this._scriptPath)}catch{X=this._scriptPath}Y=M6.resolve(M6.dirname(X),Y)}if(Y){let X=_(Y,J);if(!X&&!$._executableFile&&this._scriptPath){let q=M6.basename(this._scriptPath,M6.extname(this._scriptPath));if(q!==this._name)X=_(Y,`${q}-${$._name}`)}J=X||J}U=Q.includes(M6.extname(J));let z;if(Z$.platform!=="win32")if(U)v.unshift(J),v=pq(Z$.execArgv).concat(v),z=FJ.spawn(Z$.argv[0],v,{stdio:"inherit"});else z=FJ.spawn(J,v,{stdio:"inherit"});else this._checkForMissingExecutable(J,Y,$._name),v.unshift(J),v=pq(Z$.execArgv).concat(v),z=FJ.spawn(Z$.execPath,v,{stdio:"inherit"});if(!z.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{Z$.on(q,()=>{if(z.killed===!1&&z.exitCode===null)z.kill(q)})});let I=this._exitCallback;z.on("close",(X)=>{if(X=X??1,!I)Z$.exit(X);else I(new NJ(X,"commander.executeSubCommandAsync","(close)"))}),z.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(J,Y,$._name);else if(X.code==="EACCES")throw Error(`'${J}' not executable`);if(!I)Z$.exit(1);else{let q=new NJ(1,"commander.executeSubCommandAsync","(error)");q.nestedError=X,I(q)}}),this.runningCommand=z}_dispatchSubcommand($,v,U){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let _;return _=this._chainOrCallSubCommandHook(_,Q,"preSubcommand"),_=this._chainOrCall(_,()=>{if(Q._executableHandler)this._executeSubCommand(Q,v.concat(U));else return Q._parseCommand(v,U)}),_}_dispatchHelpCommand($){if(!$)this.help();let v=this._findCommand($);if(v&&!v._executableHandler)v.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,v)=>{if($.required&&this.args[v]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(U,Q,_)=>{let J=Q;if(Q!==null&&U.parseArg){let Y=`error: command-argument value '${Q}' is invalid for argument '${U.name()}'.`;J=this._callParseArg(U,Q,_,Y)}return J};this._checkNumberOfArguments();let v=[];this.registeredArguments.forEach((U,Q)=>{let _=U.defaultValue;if(U.variadic){if(Q<this.args.length){if(_=this.args.slice(Q),U.parseArg)_=_.reduce((J,Y)=>{return $(U,Y,J)},U.defaultValue)}else if(_===void 0)_=[]}else if(Q<this.args.length){if(_=this.args[Q],U.parseArg)_=$(U,_,U.defaultValue)}v[Q]=_}),this.processedArgs=v}_chainOrCall($,v){if($?.then&&typeof $.then==="function")return $.then(()=>v());return v()}_chainOrCallHooks($,v){let U=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((_)=>_._lifeCycleHooks[v]!==void 0).forEach((_)=>{_._lifeCycleHooks[v].forEach((J)=>{Q.push({hookedCommand:_,callback:J})})}),v==="postAction")Q.reverse();return Q.forEach((_)=>{U=this._chainOrCall(U,()=>{return _.callback(_.hookedCommand,this)})}),U}_chainOrCallSubCommandHook($,v,U){let Q=$;if(this._lifeCycleHooks[U]!==void 0)this._lifeCycleHooks[U].forEach((_)=>{Q=this._chainOrCall(Q,()=>{return _(this,v)})});return Q}_parseCommand($,v){let U=this.parseOptions(v);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(U.operands),v=U.unknown,this.args=$.concat(v),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),v);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(v),this._dispatchSubcommand(this._defaultCommandName,$,v);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(U.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(U.unknown.length>0)this.unknownOption(U.unknown[0])},_=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let J;if(J=this._chainOrCallHooks(J,"preAction"),J=this._chainOrCall(J,()=>this._actionHandler(this.processedArgs)),this.parent)J=this._chainOrCall(J,()=>{this.parent.emit(_,$,v)});return J=this._chainOrCallHooks(J,"postAction"),J}if(this.parent?.listenerCount(_))Q(),this._processArguments(),this.parent.emit(_,$,v);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,v);if(this.listenerCount("command:*"))this.emit("command:*",$,v);else if(this.commands.length)this.unknownCommand();else Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((v)=>v._name===$||v._aliases.includes($))}_findOption($){return this.options.find((v)=>v.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((v)=>{if(v.mandatory&&$.getOptionValue(v.attributeName())===void 0)$.missingMandatoryOptionValue(v)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((U)=>{let Q=U.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});$.filter((U)=>U.conflictsWith.length>0).forEach((U)=>{let Q=$.find((_)=>U.conflictsWith.includes(_.attributeName()));if(Q)this._conflictingOption(U,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let v=[],U=[],Q=v;function _(X){return X.length>1&&X[0]==="-"}let J=(X)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(X))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Y=null,z=null,I=0;while(I<$.length||z){let X=z??$[I++];if(z=null,X==="--"){if(Q===U)Q.push(X);Q.push(...$.slice(I));break}if(Y&&(!_(X)||J(X))){this.emit(`option:${Y.name()}`,X);continue}if(Y=null,_(X)){let q=this._findOption(X);if(q){if(q.required){let G=$[I++];if(G===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,G)}else if(q.optional){let G=null;if(I<$.length&&(!_($[I])||J($[I])))G=$[I++];this.emit(`option:${q.name()}`,G)}else this.emit(`option:${q.name()}`);Y=q.variadic?q:null;continue}}if(X.length>2&&X[0]==="-"&&X[1]!=="-"){let q=this._findOption(`-${X[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,X.slice(2));else this.emit(`option:${q.name()}`),z=`-${X.slice(2)}`;continue}}if(/^--[^=]+=/.test(X)){let q=X.indexOf("="),G=this._findOption(X.slice(0,q));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,X.slice(q+1));continue}}if(Q===v&&_(X)&&!(this.commands.length===0&&J(X)))Q=U;if((this._enablePositionalOptions||this._passThroughOptions)&&v.length===0&&U.length===0){if(this._findCommand(X)){v.push(X),U.push(...$.slice(I));break}else if(this._getHelpCommand()&&X===this._getHelpCommand().name()){v.push(X,...$.slice(I));break}else if(this._defaultCommandName){U.push(X,...$.slice(I));break}}if(this._passThroughOptions){Q.push(X,...$.slice(I));break}Q.push(X)}return{operands:v,unknown:U}}opts(){if(this._storeOptionsAsProperties){let $={},v=this.options.length;for(let U=0;U<v;U++){let Q=this.options[U].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,v)=>Object.assign($,v.opts()),{})}error($,v){if(this._outputConfiguration.outputError(`${$}
|
|
56
95
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
57
96
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
58
|
-
`),this.outputHelp({error:!0});let
|
|
59
|
-
`),this._exit(0,"commander.version"
|
|
60
|
-
Expecting one of '${
|
|
61
|
-
`)}),this}_outputHelpIfRequested(
|
|
97
|
+
`),this.outputHelp({error:!0});let U=v||{},Q=U.exitCode||1,_=U.code||"commander.error";this._exit(Q,_,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in Z$.env){let v=$.attributeName();if(this.getOptionValue(v)===void 0||["default","config","env"].includes(this.getOptionValueSource(v)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,Z$.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new yD(this.options),v=(U)=>{return this.getOptionValue(U)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(U))};this.options.filter((U)=>U.implied!==void 0&&v(U.attributeName())&&$.valueFromOption(this.getOptionValue(U.attributeName()),U)).forEach((U)=>{Object.keys(U.implied).filter((Q)=>!v(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,U.implied[Q],"implied")})})}missingArgument($){let v=`error: missing required argument '${$}'`;this.error(v,{code:"commander.missingArgument"})}optionMissingArgument($){let v=`error: option '${$.flags}' argument missing`;this.error(v,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let v=`error: required option '${$.flags}' not specified`;this.error(v,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,v){let U=(J)=>{let Y=J.attributeName(),z=this.getOptionValue(Y),I=this.options.find((q)=>q.negate&&Y===q.attributeName()),X=this.options.find((q)=>!q.negate&&Y===q.attributeName());if(I&&(I.presetArg===void 0&&z===!1||I.presetArg!==void 0&&z===I.presetArg))return I;return X||J},Q=(J)=>{let Y=U(J),z=Y.attributeName();if(this.getOptionValueSource(z)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},_=`error: ${Q($)} cannot be used with ${Q(v)}`;this.error(_,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let v="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],_=this;do{let J=_.createHelp().visibleOptions(_).filter((Y)=>Y.long).map((Y)=>Y.long);Q=Q.concat(J),_=_.parent}while(_&&!_._enablePositionalOptions);v=dq($,Q)}let U=`error: unknown option '${$}'${v}`;this.error(U,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let v=this.registeredArguments.length,U=v===1?"":"s",_=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${v} argument${U} but got ${$.length}.`;this.error(_,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],v="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((_)=>{if(Q.push(_.name()),_.alias())Q.push(_.alias())}),v=dq($,Q)}let U=`error: unknown command '${$}'${v}`;this.error(U,{code:"commander.unknownCommand"})}version($,v,U){if($===void 0)return this._version;this._version=$,v=v||"-V, --version",U=U||"output the version number";let Q=this.createOption(v,U);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${$}
|
|
98
|
+
`),this._exit(0,"commander.version",$)}),this}description($,v){if($===void 0&&v===void 0)return this._description;if(this._description=$,v)this._argsDescription=v;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let v=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)v=this.commands[this.commands.length-1];if($===v._name)throw Error("Command alias can't be the same as its name");let U=this.parent?._findCommand($);if(U){let Q=[U.name()].concat(U.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${Q}'`)}return v._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((v)=>this.alias(v)),this}usage($){if($===void 0){if(this._usage)return this._usage;let v=this.registeredArguments.map((U)=>{return PD(U)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?v:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=M6.basename($,M6.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let v=this.createHelp(),U=this._getOutputContext($);v.prepareContext({error:U.error,helpWidth:U.helpWidth,outputHasColors:U.hasColors});let Q=v.formatHelp(this,v);if(U.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let v=!!$.error,U,Q,_;if(v)U=(Y)=>this._outputConfiguration.writeErr(Y),Q=this._outputConfiguration.getErrHasColors(),_=this._outputConfiguration.getErrHelpWidth();else U=(Y)=>this._outputConfiguration.writeOut(Y),Q=this._outputConfiguration.getOutHasColors(),_=this._outputConfiguration.getOutHelpWidth();return{error:v,write:(Y)=>{if(!Q)Y=this._outputConfiguration.stripColor(Y);return U(Y)},hasColors:Q,helpWidth:_}}outputHelp($){let v;if(typeof $==="function")v=$,$=void 0;let U=this._getOutputContext($),Q={error:U.error,write:U.write,command:this};this._getCommandAndAncestors().reverse().forEach((J)=>J.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let _=this.helpInformation({error:U.error});if(v){if(_=v(_),typeof _!=="string"&&!Buffer.isBuffer(_))throw Error("outputHelp callback must return a string or a Buffer")}if(U.write(_),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",Q))}helpOption($,v){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",v??"display help for command"),$||v)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let v=Number(Z$.exitCode??0);if(v===0&&$&&typeof $!=="function"&&$.error)v=1;this._exit(v,"commander.help","(outputHelp)")}addHelpText($,v){let U=["beforeAll","before","after","afterAll"];if(!U.includes($))throw Error(`Unexpected value for position to addHelpText.
|
|
99
|
+
Expecting one of '${U.join("', '")}'`);let Q=`${$}Help`;return this.on(Q,(_)=>{let J;if(typeof v==="function")J=v({error:_.error,command:_.command});else J=v;if(J)_.write(`${J}
|
|
100
|
+
`)}),this}_outputHelpIfRequested($){let v=this._getHelpOption();if(v&&$.find((Q)=>v.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function pq($){return $.map((v)=>{if(!v.startsWith("--inspect"))return v;let U,Q="127.0.0.1",_="9229",J;if((J=v.match(/^(--inspect(-brk)?)$/))!==null)U=J[1];else if((J=v.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(U=J[1],/^\d+$/.test(J[3]))_=J[3];else Q=J[3];else if((J=v.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)U=J[1],Q=J[3],_=J[4];if(U&&_!=="0")return`${U}=${Q}:${parseInt(_)+1}`;return v})}function SJ(){if(Z$.env.NO_COLOR||Z$.env.FORCE_COLOR==="0"||Z$.env.FORCE_COLOR==="false")return!1;if(Z$.env.FORCE_COLOR||Z$.env.CLICOLOR_FORCE!==void 0)return!0;return}CD.Command=TJ;CD.useColor=SJ});var tq=T6((cD)=>{var{Argument:nq}=s_(),{Command:RJ}=iq(),{CommanderError:gD,InvalidArgumentError:rq}=mv(),{Help:hD}=AJ(),{Option:oq}=OJ();cD.program=new RJ;cD.createCommand=($)=>new RJ($);cD.createOption=($,v)=>new oq($,v);cD.createArgument=($,v)=>new nq($,v);cD.Command=RJ;cD.Option=oq;cD.Argument=nq;cD.Help=hD;cD.CommanderError=gD;cD.InvalidArgumentError=rq;cD.InvalidOptionArgumentError=rq});var aq,uT,yT,CT,fT,mT,sq,gT,eq,hT,w6,cT;var $8=b(()=>{aq=_z(tq(),1),{program:uT,createCommand:yT,createArgument:CT,createOption:fT,CommanderError:mT,InvalidArgumentError:sq,InvalidOptionArgumentError:gT,Command:eq,Argument:hT,Option:w6,Help:cT}=aq.default});import{existsSync as vG,statSync as $V}from"fs";import{join as _G}from"path";function $G($,v){let U=_G($,v);if(!vG(U))return"missing";if(!$V(U).isDirectory())throw new M(`Component root "${v}" exists at "${U}" but is not a directory.`);return"directory"}function UV($,v){let U=$G($,v.singular),Q=$G($,v.plural);if(U==="directory"&&Q==="directory")return v.plural;if(U==="directory")return v.singular;if(Q==="directory")return v.plural;return v.plural}function QV($,v,U,Q,_){if(!_)return;let Y=`${U===Q.plural?Q.singular:Q.plural}/${_}`,z=_G($,Y);if(!vG(z))return;throw new t$(`Cross-root logical collision for "${v}": selected root "${U}" but "${Y}" already exists.`)}function w0($,v){let[U,...Q]=$.split("/");if(!U)return $;let _=_V.get(U);if(!_)return $;let J=UV(v,_),Y=Q.join("/");if(QV(v,$,J,_,Y),!Y)return J;return`${J}/${Y}`}var vV,_V;var EJ=b(()=>{z$();vV={agent:"agents",command:"commands",plugin:"plugins",skill:"skills",tool:"tools",bundle:"bundles",profile:"profiles"},_V=new Map(Object.entries(vV).flatMap(([$,v])=>{let U={singular:$,plural:v};return[[$,U],[v,U]]}))});import{stat as JV}from"fs/promises";import{homedir as YV}from"os";import{isAbsolute as zV,join as UG,relative as IV,resolve as QG}from"path";function XV($){let v=$.replace(/\\/g,"/");if(v===v8)return".";if(v.startsWith(PJ))return v.slice(PJ.length);return $}function N4(){let $=process.env.XDG_CONFIG_HOME,v=$&&zV($)?$:UG(YV(),".config");return UG(v,"opencode")}async function JG(){try{return(await JV(N4())).isDirectory()}catch{return!1}}function H1($,v,U){if(v){if(!U)return $;return w0($,U)}let Q=XV($),_=U?QG(U):process.cwd(),J=QG(_,v8),Y;try{Y=O4(J,Q)}catch(X){if(X instanceof U4)throw new M(`Invalid local target "${$}": ${X.message}`);throw X}let z=IV(J,Y).replace(/\\/g,"/");if(z==="."||z==="")return v8;let I=U?w0(z,J):z;return`${PJ}${I}`}var v8=".opencode",PJ;var i6=b(()=>{EJ();z$();q1();PJ=`${v8}/`});class f4{cwd;config;constructor($,v){this.cwd=$,this.config=v}static async requireInitialized($){let v=await C4($);if(!v)throw new d("No ocx.jsonc found in .opencode/ or project root. Run 'ocx init' first.");return new f4($,v)}getRegistries(){return this.config.registries}getComponentPath(){return".opencode"}}class L0{cwd;config;constructor($,v){this.cwd=$,this.config=v}static async requireInitialized(){let $=N4();if(!await JG())throw new d("Global config not found. Run 'ocx init --global' first.");let v=await C4($);if(!v)throw new d("Global config not found. Run 'ocx init --global' first.");return new L0($,v)}getRegistries(){return this.config?.registries??{}}getComponentPath(){return""}}var k0=b(()=>{X4();z$();i6()});import{rename as YG,symlink as YR,unlink as zG}from"fs/promises";async function A0($,v){let U=`${$}.tmp.${process.pid}`;try{await Bun.write(U,JSON.stringify(v,null,"\t"),{mode:384}),await YG(U,$)}catch(Q){try{await zG(U)}catch{}throw Q}}async function IG($,v){let U=`${v}.tmp.${process.pid}`;try{let _=await Bun.file($).arrayBuffer();await Bun.write(U,_,{mode:384}),await YG(U,v)}catch(Q){try{await zG(U)}catch{}throw Q}}var _8=()=>{};import{existsSync as XG,statSync as qV}from"fs";import{readFile as GV,stat as jV}from"fs/promises";import{homedir as KV}from"os";import g$ from"path";function HV($={}){let v=$.xdgConfigHome??process.env.XDG_CONFIG_HOME;if(v&&v.trim().length>0)return g$.resolve(v);let U=$.homeDir??KV();return g$.resolve(U,".config")}function qG($,v){let U=g$.resolve($),Q=g$.resolve(v),_=g$.relative(U,Q);if(_==="")return!0;if(_==="..")return!1;if(_.startsWith(`..${g$.sep}`))return!1;return!g$.isAbsolute(_)}function U8($={}){return g$.join(HV($),"opencode")}function xJ($,v={}){let U=U8(v);if(!qG(U,$))return"local-project";let Q=g$.join(U,"profiles");if(qG(Q,$))return"global-profile-root";return"global-root"}function L6($={}){return g$.join(U8($),"profiles")}function WV($=process.cwd()){let v=A6($);if(v)return g$.join(v,"profiles");return g$.join($,W1,"profiles")}function h$($){return g$.join(L6(),$)}function GG($,v=process.cwd()){return g$.join(WV(v),$)}function B4($){return g$.join(h$($),"ocx.jsonc")}function k6($){return g$.join(h$($),"opencode.jsonc")}function b1($){return g$.join(h$($),"AGENTS.md")}function A6($){let v=$;while(!0){let U=g$.join(v,W1);if(XG(U)&&qV(U).isDirectory())return U;let Q=g$.join(v,".git");if(XG(Q))return null;let _=g$.dirname(v);if(_===v)return null;v=_}}function O0(){return g$.join(U8(),a4)}async function jG($={}){let v=g$.join(U8($),a4),U;try{U=await jV(v)}catch(Q){let _=Q.code;if(_==="ENOENT"||_==="ENOTDIR")throw new n6("missing",v);throw new n6("read-failed",v,Q instanceof Error?Q.message:String(Q))}if(!U.isFile())throw new n6("not-file",v);try{let Q=await GV(v,"utf8");return{path:v,content:Q}}catch(Q){throw new n6("read-failed",v,Q instanceof Error?Q.message:String(Q))}}var a4="ocx.jsonc",gv="opencode.jsonc",W1=".opencode",n6;var Z4=b(()=>{n6=class n6 extends Error{reason;configPath;constructor($,v,U){let Q=$==="missing"?`Required global config is missing at "${v}".`:$==="not-file"?`Required global config target is not a file: "${v}".`:`Failed to read required global config at "${v}": ${U??"Unknown read error"}`;super(Q);this.reason=$;this.configPath=v;this.name="RequiredGlobalConfigReadError"}}});var q6,WR;var Q8=b(()=>{Z6();M0();q6=K.string().min(1,"Profile name is required").max(32,"Profile name must be 32 characters or less").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Profile name must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens"),WR=K.object({name:q6,ocx:V6,opencode:K.record(K.string(),K.unknown()).optional(),hasAgents:K.boolean()})});import{mkdir as KG,readdir as bV,rename as BV,rm as ZV,stat as uJ}from"fs/promises";function VV($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function HG($,v){let U=[],Q=E$($,U,{allowTrailingComma:!0});if(U.length>0){let _=VV(U);throw new d(`Invalid JSONC in ${v}: ${_}`)}return Q}function MV($,v,U){let Q=V6.safeParse($);if(!Q.success){let _=Q.error.issues[0],J=_?.path.length?_.path.join("."):"root",Y=_?.message??"Invalid profile OCX configuration";throw new d(`Invalid profile "${U}" ocx.jsonc at ${v}: ${J} ${Y}`)}return Q.data}function wV($,v,U){if(!$||typeof $!=="object"||Array.isArray($))throw new d(`Invalid profile "${U}" opencode.jsonc at ${v}: root must be an object`);return $}function WG($,v){if($.trim().length===0)throw new d(`Invalid profile from ${v}: value cannot be empty or whitespace`);return $}class c${cwd;constructor($=process.cwd()){this.cwd=$}get profilesDir(){return L6()}static create($){return new c$($??process.cwd())}static async requireInitialized(){let $=c$.create();if(!await $.isInitialized())throw new b0;return $}async isInitialized(){try{return(await uJ(this.profilesDir)).isDirectory()}catch{return!1}}async ensureInitialized(){if(!await this.isInitialized())throw new b0}async list(){return await this.ensureInitialized(),(await bV(this.profilesDir,{withFileTypes:!0,encoding:"utf8"})).filter((v)=>v.isDirectory()&&!v.name.startsWith(".")).map((v)=>v.name).sort()}async exists($){let v=h$($);try{return(await uJ(v)).isDirectory()}catch{return!1}}async get($){if(!await this.exists($))throw new m$($);let v=B4($),U=Bun.file(v);if(!await U.exists())throw new d(`Profile "${$}" is missing ocx.jsonc. Expected at: ${v}`);let Q=await U.text(),_=HG(Q,v),J=MV(_,v,$),Y=k6($),z=Bun.file(Y),I;if(await z.exists()){let j=await z.text(),H=HG(j,Y);I=wV(H,Y,$)}let X=b1($),G=await Bun.file(X).exists();return{name:$,ocx:J,opencode:I,hasAgents:G}}async getLayered($,v){let U=GG($,v),Q=!1;try{Q=(await uJ(U)).isDirectory()}catch{Q=!1}if(Q)throw new HJ($,U);return this.get($)}async add($){let v=q6.safeParse($);if(!v.success)throw new r4($,v.error.issues[0]?.message??"Invalid name");if(await this.exists($))throw new g6($);let U=h$($);await KG(U,{recursive:!0,mode:448});let Q=B4($);if(!await Bun.file(Q).exists())await Bun.write(Q,DV,{mode:384});let J=k6($);if(!await Bun.file(J).exists())await A0(J,{});let z=b1($);if(!await Bun.file(z).exists()){let X=`# Profile Instructions
|
|
62
101
|
|
|
63
102
|
<!-- Add your custom instructions for this profile here -->
|
|
64
|
-
<!-- These will be included when running \`ocx opencode -p ${
|
|
65
|
-
`;await Bun.write(
|
|
103
|
+
<!-- These will be included when running \`ocx opencode -p ${$}\` -->
|
|
104
|
+
`;await Bun.write(z,X,{mode:384})}}async remove($){if(!await this.exists($))throw new m$($);if((await this.list()).length<=1)throw Error("Cannot delete the last profile. At least one profile must exist.");let U=h$($);await ZV(U,{recursive:!0})}async move($,v){let U=q6.safeParse($);if(!U.success)throw new r4($,U.error.issues[0]?.message??"Invalid name");let Q=q6.safeParse(v);if(!Q.success)throw new r4(v,Q.error.issues[0]?.message??"Invalid name");if(await this.ensureInitialized(),!await this.exists($))throw new m$($);if($===v)return{warnActiveProfile:!1};if(await this.exists(v))throw new t$(`Cannot move: profile "${v}" already exists. Remove it first with 'ocx profile rm ${v} --global'.`);let _=process.env.OCX_PROFILE===$,J=h$($),Y=h$(v);try{await BV(J,Y)}catch(z){if(z instanceof Error&&"code"in z){let I=z.code;if(I==="EEXIST"||I==="ENOTEMPTY")throw new t$(`Cannot move: profile "${v}" already exists. Remove it first with 'ocx profile rm ${v} --global'.`);if(I==="ENOENT")throw new m$($)}throw z}return{warnActiveProfile:_}}async resolveProfile($){if($!==void 0){let Q=WG($,"CLI option --profile");if(!await this.exists(Q))throw new m$(Q);return Q}let v=process.env.OCX_PROFILE;if(v!==void 0){let Q=WG(v,"environment variable OCX_PROFILE");if(!await this.exists(Q))throw new m$(Q);return Q}let U="default";if(!await this.exists(U))throw new m$(U);return U}async initialize(){await KG(this.profilesDir,{recursive:!0,mode:448}),await this.add("default")}}var bG,DV=`{
|
|
66
105
|
"$schema": "https://ocx.kdco.dev/schemas/profile.json",
|
|
67
106
|
"registries": {},
|
|
68
107
|
"renameWindow": true,
|
|
@@ -76,158 +115,161 @@ Expecting one of '${B.join("', '")}'`);let $=`${D}Help`;return this.on($,(_)=>{l
|
|
|
76
115
|
],
|
|
77
116
|
"include": []
|
|
78
117
|
}
|
|
79
|
-
`;var
|
|
80
|
-
Expected at: ${_}`);return[_]}function c9(D,F,B){let $=[],_=new Set;for(let Q of D){let Y=Xq(Q,F,B);for(let q of Y)if(!_.has(q))_.add(q),$.push(q)}return $}var l9=V(()=>{$D()});import{existsSync as t2,readFileSync as i9,statSync as Wq}from"fs";import{homedir as Gq}from"os";import{join as V0,relative as n9}from"path";var{Glob:J8}=globalThis.Bun;function zq(D){return D==="local-config"||D==="cli"||D==="env"}function d1(D,F){if(D.trim().length===0)throw new c(`Invalid profile from ${F}: value cannot be empty or whitespace`);return D}function s9(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}function p9(D){let F;try{F=i9(D,"utf8")}catch(Q){let Y=Q instanceof Error?Q.message:"Unknown read error";throw new c(`Failed to read local config at ${D}: ${Y}`)}let B=[],$=ND(F,B,{allowTrailingComma:!0});if(B.length>0){let Q=s9(B);throw new c(`Invalid JSONC in local config at ${D}: ${Q}`)}let _=Z2.safeParse($);if(!_.success){let Q=_.error.issues[0],Y=Q?.path.length?Q.path.join("."):"root",q=Q?.message??"Invalid OCX config";throw new c(`Invalid local config at ${D}: ${Y} ${q}`)}return _.data}function Mq(D){let F;try{F=i9(D,"utf8")}catch(_){let Q=_ instanceof Error?_.message:"Unknown read error";throw new c(`Failed to read local OpenCode config at ${D}: ${Q}`)}let B=[],$=ND(F,B,{allowTrailingComma:!0});if(B.length>0){let _=s9(B);throw new c(`Invalid JSONC in local OpenCode config at ${D}: ${_}`)}if(!$||typeof $!=="object"||Array.isArray($))throw new c(`Invalid local OpenCode config at ${D}: root must be an object`);return $}function jq(D,F,B){let $=[],_=F;while(!0){let Q=V0(_,D);if(t2(Q)&&Wq(Q).isFile()){let q=n9(B,Q);$.push(q)}if(_===B)break;let Y=V0(_,"..");if(Y===_)break;_=Y}return $}function Kq(D,F){for(let B of Aq){let $=jq(B,D,F);if($.length>0)return $}return[]}function X8(D){return D.startsWith("./")?D.slice(2):D}function Uq(D,F,B){return D.filter(($)=>{for(let _ of B)if(new J8(X8(_)).match($))return!0;for(let _ of F)if(new J8(X8(_)).match($))return!1;return!0})}async function Vq(D){let F=await X0(D);if(!F||Object.keys(F.installed).length===0)return[];let B=[];for(let[$,_]of Object.entries(F.installed)){if(!_.opencode?.instructions)continue;let Q=_.opencode.instructions;if(!Array.isArray(Q))continue;let Y=`${_.registryName}/${_.name} (${$})`,q=c9(Q,D,Y);B.push(...q)}return Array.from(new Set(B))}class r0{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor(D,F,B,$,_){this.cwd=D,this.profileName=F,this.profile=B,this.localConfigDir=$,this.registryInstructions=_}static async create(D,F){let B=PD.create(D),$=null,_="none",Q=o2(D);if(Q){let X=V0(Q,y0);if(t2(X)){let z=p9(X);if(z.profile!==void 0)$=d1(z.profile,`local config at ${X}`),_="local-config"}}if($===null){if(F?.profile!==void 0)$=d1(F.profile,"CLI option --profile"),_="cli";else if(process.env.OCX_PROFILE!==void 0)$=d1(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),_="env"}let Y=await B.isInitialized();if(zq(_)&&!Y)throw new CF;let q=null;if(Y)if($!==null)q=await B.getLayered($,D);else try{$=await B.resolveProfile(),q=await B.getLayered($,D),_="default"}catch(X){if(!(X instanceof CD)||X.profile!=="default")throw X;$=null,q=null,_="none"}let H;if(q)H=fD($);else if(Q)H=V0(Q,"..");else H=W0();let J=await Vq(H);return new r0(D,$,q,Q,J)}resolve(){if(this.cachedConfig)return this.cachedConfig;let D={},F=s2,B={};if(this.profile){if(D={...D,...this.profile.ocx.registries},this.profile.ocx.componentPath)F=this.profile.ocx.componentPath;if(this.profile.opencode)B=this.mergeOpencode(B,this.profile.opencode)}let $=this.shouldLoadLocalConfig();if(!this.profile&&$&&this.localConfigDir){let Q=this.loadLocalOcxConfig();if(Q)D=Q.registries}if(this.localConfigDir){let Q=this.loadLocalOpencodeConfig();if(Q)B=this.mergeOpencode(B,Q)}let _=this.discoverInstructions();return this.cachedConfig={registries:D,componentPath:F,opencode:B,instructions:_,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let D=new Map,F={},B=s2,$={};if(D.set("componentPath",{path:"",source:"default"}),this.profile){let Y=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[q,H]of Object.entries(this.profile.ocx.registries))F[q]=H,D.set(`registries.${q}`,{path:Y,source:"global-profile"});if(this.profile.ocx.componentPath)B=this.profile.ocx.componentPath,D.set("componentPath",{path:Y,source:"global-profile"});if(this.profile.opencode){$=this.mergeOpencode($,this.profile.opencode);let q=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let H of Object.keys(this.profile.opencode))D.set(`opencode.${H}`,{path:q,source:"global-profile"})}}let _=this.shouldLoadLocalConfig();if(!this.profile&&_&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let q=V0(this.localConfigDir,y0);for(let[H,J]of Object.entries(Y.registries))F[H]=J,D.set(`registries.${H}`,{path:q,source:"local-config"})}}if(this.localConfigDir){let Y=this.loadLocalOpencodeConfig();if(Y){$=this.mergeOpencode($,Y);let q=V0(this.localConfigDir,u1);for(let H of Object.keys(Y))D.set(`opencode.${H}`,{path:q,source:"local-opencode"})}}let Q=this.discoverInstructions();return{registries:F,componentPath:B,opencode:$,instructions:Q,profileName:this.profileName,origins:D}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let F=g1(this.cwd),B=n9(F,this.localConfigDir),$=this.profile.ocx.exclude??[],_=this.profile.ocx.include??[];for(let Q of _){let Y=new J8(X8(Q));if(Y.match(`${B}/`)||Y.match(B))return!0}for(let Q of $){let Y=new J8(X8(Q));if(Y.match(`${B}/`)||Y.match(`${B}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let D=V0(this.localConfigDir,y0);if(!t2(D))return null;return{registries:p9(D).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let D=V0(this.localConfigDir,u1);if(!t2(D))return null;return Mq(D)}discoverInstructions(){let D=[],F=W0(),B=V0(F,"AGENTS.md");if(t2(B))D.push(B);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let X=V0(Gq(),".claude","CLAUDE.md");if(t2(X))D.push(X)}if(this.profile&&this.profileName){let X=V0(fD(this.profileName),"AGENTS.md");if(t2(X))D.push(X)}let $=this.loadRegistryInstructions();D.push(...$);let _=g1(this.cwd),Q=Kq(this.cwd,_),Y=this.profile?.ocx.exclude??[],q=this.profile?.ocx.include??[],J=Uq(Q,Y,q).map((X)=>V0(_,X));return D.push(...J),D}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode(D,F){return H8(D,F)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var Aq;var b3=V(()=>{b0();o0();Q0();h1();eD();$D();g9();l9();k2();Aq=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function D0(D){return typeof D==="object"&&D!==null&&!Array.isArray(D)&&Object.getPrototypeOf(D)===Object.prototype}var F4={};j2(F4,{fetchRegistryIndex:()=>T2,fetchFileContent:()=>e2,fetchComponentVersion:()=>M8,fetchComponent:()=>R3,classifyRegistryIndexIssue:()=>D4,_clearFetcherCacheForTests:()=>kq});import{posix as Eq}from"path";function Oq(D,F){return new v0(`Registry at ${D} uses an incompatible format (${F.issue}). ${F.remediation}`,{url:D,issue:F.issue,remediation:F.remediation,...F.schemaUrl!==void 0&&{schemaUrl:F.schemaUrl},...F.supportedMajor!==void 0&&{supportedMajor:F.supportedMajor},...F.detectedMajor!==void 0&&{detectedMajor:F.detectedMajor}})}function o9(D,F){if(typeof D!=="string")throw new U(`Invalid ${F}: expected string, got ${typeof D}`);let B=z8[D]??D,$=uF.safeParse(B);if(!$.success)throw new U(`Unsupported component type "${D}" in ${F}. Expected one of: ${uF.options.join(", ")}`);return $.data}function r9(D){return typeof D==="string"&&Object.hasOwn(z8,D)}function G8(D){return D.startsWith(".opencode/")||D.startsWith(".opencode\\")}function t9(D){if(!D0(D)||!Array.isArray(D.files))return[];let F=[];for(let[B,$]of D.files.entries()){if(typeof $==="string"){if(!G8($))continue;F.push({path:`files[${B}]`,target:$});continue}if(!D0($)||typeof $.target!=="string")continue;if(!G8($.target))continue;F.push({path:`files[${B}].target`,target:$.target})}return F}function bq(D){if(!D0(D))return[];let F=D.components;if(!Array.isArray(F))return[];let B=[];for(let[$,_]of F.entries()){if(!D0(_))continue;let Q=_.type;if(!r9(Q))continue;B.push({path:`components[${$}].type`,type:Q})}return B}function Zq(D){if(!D0(D))return!1;if(typeof D.type==="string"&&D.type.startsWith("ocx:"))return!0;return t9(D).length>0}async function Rq(D){let F=xD(D),B=Z3.get(F);if(B)return B;try{await T2(F)}catch(_){if(_ instanceof ZD||_ instanceof MD)return null;throw _}if(!Z3.has(F))return null;let $=Z3.get(F);if(!$)throw Error(`Missing registry schema mode cache entry for ${F}`);return $}function a9(D,F){if(D.includes("\x00"))throw new U(`Unsafe target "${D}" in ${F}: null bytes are not allowed`);if(D.includes("%"))throw new U(`Unsafe target "${D}" in ${F}: encoded paths are not allowed`);if(D.includes("\\"))throw new U(`Unsafe target "${D}" in ${F}: Windows separators are not allowed`);if(D.startsWith("/")||D.startsWith("//")||/^[a-zA-Z]:/.test(D))throw new U(`Unsafe target "${D}" in ${F}: absolute paths are not allowed`);let B=D.startsWith(".opencode/")?D.slice(10):D;if(!B)throw new U(`Unsafe target "${D}" in ${F}: missing path after .opencode/`);let $=B.split("/");if($.some((J)=>J.length===0))throw new U(`Unsafe target "${D}" in ${F}: empty path segments are not allowed`);if($.some((J)=>J==="."||J===".."))throw new U(`Unsafe target "${D}" in ${F}: traversal segments are not allowed`);let[_,...Q]=$;if(!_)throw new U(`Unsafe target "${D}" in ${F}: missing path root segment`);let q=[Lq[_]??_,...Q].join("/"),H=Eq.normalize(q);if(H!==q)throw new U(`Unsafe target "${D}" in ${F}: path normalization is ambiguous`);if(H==="."||H===".."||H.startsWith("../"))throw new U(`Unsafe target "${D}" in ${F}: target escapes project root`);return H}function Nq(D,F){if(!D0(D))return D;let B={...D};if(Object.hasOwn(B,"type"))B.type=o9(B.type,`${F}.type`);if(Array.isArray(B.files))B.files=B.files.map(($,_)=>{if(typeof $==="string"){if(!G8($))return $;return a9($,`${F}.files[${_}]`)}if(!D0($))return $;let Q=$.target;if(typeof Q!=="string")return $;if(!G8(Q))return $;return{...$,target:a9(Q,`${F}.files[${_}].target`)}});return B}function Sq(D,F){if(!D0(D))throw new v0(`Registry at ${F} uses legacy schema v1 but does not expose an object index payload.`,{url:F,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let B=D.components;if(!Array.isArray(B))throw new v0(`Registry at ${F} uses legacy schema v1 but the components field is missing or invalid.`,{url:F,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let $=B.map((_,Q)=>{if(!D0(_))throw new U(`Invalid index component at components[${Q}]: expected object, got ${typeof _}`);let{name:Y,description:q}=_;if(typeof Y!=="string")throw new U(`Invalid index component name at components[${Q}].name`);if(typeof q!=="string")throw new U(`Invalid index component description at components[${Q}].description`);return{name:Y,type:o9(_.type,`components[${Q}].type`),description:q}});return{...D,components:$}}async function e9(D,F,B={}){let $=W8.get(D);if($)return $;let _=B.requestUrl??D,Q=(async()=>{let Y={url:_,phase:B.phase},q;try{q=await fetch(_)}catch(J){throw new ZD(`Network request failed for ${_}: ${J instanceof Error?J.message:String(J)}`,Y)}if(!q.ok){if(q.status===404)throw new MD(`Not found: ${_}`);throw new ZD(`Failed to fetch ${_}: ${q.status} ${q.statusText}`,{...Y,status:q.status,statusText:q.statusText})}let H;try{H=await q.json()}catch(J){throw new ZD(`Invalid JSON response from ${_}: ${J instanceof Error?J.message:String(J)}`,Y)}return await F(H)})();return W8.set(D,Q),Q.catch(()=>W8.delete(D)),Q}function D4(D){let F=PF(D);if(!F)return null;return{issue:F.issue,remediation:F.remediation,schemaUrl:F.schemaUrl,supportedMajor:F.supportedMajor,detectedMajor:F.detectedMajor}}async function T2(D){let F=xD(D),B=`${F}/index.json`;return e9(B,($)=>{let _=D4($);if(_&&_.issue!=="legacy-schema-v1")throw Oq(B,_);let Q=$,Y="v2";if(_?.issue==="legacy-schema-v1"){Y="legacy-v1";try{Q=Sq($,B)}catch(H){if(H instanceof v0)throw H;let J=H instanceof Error?H.message:String(H);throw new v0(`Registry at ${B} uses legacy schema v1 but cannot be adapted safely. ${J}`,{url:B,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let H=bq(Q);if(H.length>0){let J=H[0];if(!J)throw Error("Unexpected missing legacy type issue");let X=z8[J.type];throw new v0(`Registry at ${B} uses legacy component type "${J.type}" in ${J.path}. Use "${X}" for v2 registries.`,{url:B,issue:"invalid-format",remediation:`Replace legacy type "${J.type}" with canonical "${X}" in v2 manifests.`})}}let q=U1.safeParse(Q);if(!q.success)throw new v0(`Registry at ${B} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${q.error.message}`,{url:B,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${q.error.message}`});return Z3.set(F,Y),q.data},{phase:"registry-index-fetch"})}async function R3(D,F){return(await M8(D,F)).manifest}async function M8(D,F,B){let $=`${xD(D)}/components/${F}.json`;return e9(`${$}#v=${B??"latest"}`,async(_)=>{let Q=wq.safeParse(_);if(!Q.success)throw new U(`Invalid packument format for "${F}": ${Q.error.message}`);let Y=Q.data,q=B??Y["dist-tags"].latest,H=Y.versions[q];if(!H){if(B){let M=Object.keys(Y.versions).join(", ");throw new U(`Component "${F}" has no version "${B}". Available: ${M}`)}throw new U(`Component "${F}" has no manifest for latest version ${q}`)}let J=`component "${F}@${q}"`,X=H;if(Zq(H))if(await Rq(D)!=="v2")X=Nq(H,J);else{let K=t9(H)[0];if(K)throw new U(`Invalid component manifest for "${F}@${q}": target "${K.target}" at ${K.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(D0(H)&&r9(H.type)){let j=z8[H.type];throw new U(`Invalid component manifest for "${F}@${q}": type "${H.type}" is a legacy v1 alias. Use "${j}" for v2 registries.`)}}let z=l2.safeParse(X);if(!z.success)throw new U(`Invalid component manifest for "${F}@${q}": ${z.error.message}`);return{manifest:z.data,version:q}},{phase:"packument-fetch",requestUrl:$})}async function e2(D,F,B){let $=`${xD(D)}/components/${F}/${B}`,_={url:$,phase:"file-content-fetch",qualifiedName:F},Q;try{Q=await fetch($)}catch(Y){throw new ZD(`Network request failed for ${$}: ${Y instanceof Error?Y.message:String(Y)}`,_)}if(!Q.ok)throw new ZD(`Failed to fetch file ${B} for ${F} from ${$}: ${Q.status} ${Q.statusText}`,{..._,status:Q.status,statusText:Q.statusText});return Q.text()}function kq(){W8.clear(),Z3.clear()}var W8,Z3,z8,Lq,wq;var DF=V(()=>{Q2();P0();$D();W8=new Map,Z3=new Map,z8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},Lq={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},wq=U3.extend({versions:G.record(G.unknown())})});function B4(D,F){if(D.includes("/"))return u0(D);if(F)return{namespace:F,component:D};throw new U(`Component '${D}' must include a registry alias (e.g., 'kdco/${D}')`)}async function $4(D,F){let B=new Map,$=new Set,_=new Set,Q=new Set,Y={};async function q(X,z,M=[]){let A=K1(X,z);if(B.has(A))return;if($.has(A)){let R=[...M,A].join(" \u2192 ");throw new U(`Circular dependency detected: ${R}`)}$.add(A);let K=D[X];if(!K)throw new MD(`Registry alias '${X}' not found. Add it with 'ocx registry add <url> --name ${X}'.`);let j;try{j=await R3(K.url,z)}catch(R){if(R instanceof ZD)throw R;if(R instanceof MD)throw new MD(`Component '${z}' not found in registry '${X}'.`);if(R instanceof zD)throw R;throw new ZD(`Failed to fetch component '${z}' from registry '${X}': ${R instanceof Error?R.message:String(R)}`,{url:K.url})}for(let R of j.dependencies){let s=B4(R,X);await q(s.namespace,s.component,[...M,A])}let S=p2(j);if(B.set(A,{...S,registryName:X,baseUrl:K.url,qualifiedName:A}),$.delete(A),j.npmDependencies)for(let R of j.npmDependencies)_.add(R);if(j.npmDevDependencies)for(let R of j.npmDevDependencies)Q.add(R);if(S.opencode)Y=H8(Y,S.opencode)}for(let X of F){let z=B4(X);await q(z.namespace,z.component)}let H=Array.from(B.values()),J=Array.from(B.keys());return{components:H,installOrder:J,npmDependencies:Array.from(_),npmDevDependencies:Array.from(Q),opencode:Y}}var _4=V(()=>{P0();$D();DF();h1()});import{statSync as Iq}from"fs";import{mkdir as Q4}from"fs/promises";import Y0 from"path";function lF(D){try{return Iq(D).isFile()}catch{return!1}}function A8(D){let F=Y0.resolve(D);if(P1(F)!=="local-project"){let H=Y0.join(F,"opencode.jsonc"),J=Y0.join(F,"opencode.json");if(lF(H))return{path:H,exists:!0};if(lF(J))return{path:J,exists:!0};return{path:H,exists:!1}}let _=Y0.join(F,l1,"opencode.jsonc"),Q=Y0.join(F,l1,"opencode.json");if(lF(_))return{path:_,exists:!0};if(lF(Q))return{path:Q,exists:!0};let Y=Y0.join(F,"opencode.jsonc"),q=Y0.join(F,"opencode.json");if(lF(Y))return{path:Y,exists:!0};if(lF(q))return{path:q,exists:!0};return{path:_,exists:!1}}async function Y4(D){let{path:F,exists:B}=A8(D);if(B)return{path:F,created:!1};return await Q4(Y0.dirname(F),{recursive:!0}),await Bun.write(F,Tq),{path:F,created:!0}}async function p1(D){let{path:F,exists:B}=A8(D);if(!B)return null;let _=await Bun.file(F).text();return{config:ND(_,[],{allowTrailingComma:!0}),content:_,path:F}}async function vq(D,F){await Bun.write(D,F)}function Cq(D,F){let $=ND(D,[],{allowTrailingComma:!0});for(let _ of F){if($===null||$===void 0)return;if(typeof $!=="object")return;$=$[_]}return $}function q4(D,F,B){if(B===null||B===void 0)return D;if(D0(B)){let _=Cq(D,F);if(_!==void 0&&(_===null||typeof _!=="object")){let Y=AF(D,F,B,c1);return jF(D,Y)}let Q=D;for(let[Y,q]of Object.entries(B))Q=q4(Q,[...F,Y],q);return Q}if(Array.isArray(B)){let _=AF(D,F,B,c1);return jF(D,_)}let $=AF(D,F,B,c1);return jF(D,$)}async function i1(D,F){let B=await p1(D),$,_,Q=!1;if(B)$=B.content,_=B.path;else{$=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let J=Y0.resolve(D);_=P1(J)!=="local-project"?Y0.join(J,"opencode.jsonc"):Y0.join(J,l1,"opencode.jsonc"),await Q4(Y0.dirname(_),{recursive:!0}),Q=!0}let Y=$;$=q4($,[],F);let q=$!==Y;if(q)await vq(_,$);return{path:_,created:Q,changed:q}}var l1=".opencode",c1,Tq=`{
|
|
118
|
+
`;var G6=b(()=>{E4();M0();z$();_8();Z4();Q8();bG={$schema:"https://ocx.kdco.dev/schemas/profile.json",registries:{},renameWindow:!0,exclude:["**/CLAUDE.md","**/CONTEXT.md","**/.opencode/**","**/opencode.jsonc","**/opencode.json"],include:[]}});function BG($,v,U){let Q=(_)=>$(_,...v);return U===void 0?Q:Object.assign(Q,{lazy:U,lazyArgs:v})}var ZG=()=>{};function DG($,v,U){let Q=$.length-v.length;if(Q===0)return $(...v);if(Q===1)return BG($,v,U);throw Error("Wrong number of arguments")}var VG=b(()=>{ZG()});function yJ($){if(typeof $!="object"||!$)return!1;let v=Object.getPrototypeOf($);return v===null||v===Object.prototype}var MG=()=>{};function CJ(...$){return DG(wG,$)}function wG($,v){let U={...$,...v};for(let Q in v){if(!(Q in $))continue;let{[Q]:_}=$;if(!yJ(_))continue;let{[Q]:J}=v;yJ(J)&&(U[Q]=wG(_,J))}return U}var LG=b(()=>{VG();MG()});var kG=b(()=>{LG()});function hv($){let v=$.startsWith("npm:"),U=v?$.slice(4):$;if(!U)return $;if(U.startsWith("@")){let J=U.indexOf("/");if(J===-1)return $;let z=U.slice(J+1).indexOf("@");if(z===-1)return $;let I=U.slice(0,J+1+z);return v?`npm:${I}`:I}let Q=U.indexOf("@");if(Q===-1)return $;let _=U.slice(0,Q);return v?`npm:${_}`:_}function fJ($){let v=new Map;for(let Q=$.length-1;Q>=0;Q--){let _=$[Q],J=hv(_);if(!v.has(J))v.set(J,Q)}let U=[];for(let[Q,_]of $.entries()){let J=hv(_);if(v.get(J)===Q)U.push(_)}return U}function J8($,v){let U=CJ($,v);if(Array.isArray($.plugin)&&Array.isArray(v.plugin))U.plugin=fJ([...$.plugin,...v.plugin]);else if(Array.isArray($.plugin))U.plugin=$.plugin;else if(Array.isArray(v.plugin))U.plugin=v.plugin;if(Array.isArray($.instructions)&&Array.isArray(v.instructions))U.instructions=Array.from(new Set([...$.instructions,...v.instructions]));else if(Array.isArray($.instructions))U.instructions=$.instructions;else if(Array.isArray(v.instructions))U.instructions=v.instructions;return U}var Y8=b(()=>{kG()});import{existsSync as LV,readFileSync as kV}from"fs";import{dirname as AV,isAbsolute as fR,resolve as mJ}from"path";function OV($){let v=mJ($);while(!0){let U=mJ(v,".git");if(LV(U))try{let _=P1("fs").statSync(U);if(_.isDirectory())return v;if(_.isFile()){if(kV(U,"utf8").match(/^gitdir:\s*(.+)$/m)?.[1])return v}}catch{}let Q=AV(v);if(Q===v)return null;v=Q}}function gJ($){let v=mJ($);return OV(v)??v}var AG=()=>{};import{existsSync as FV}from"fs";import*as B1 from"path";var{Glob:NV}=globalThis.Bun;function OG($){return $.startsWith("http://")||$.startsWith("https://")}function SV($,v){if(OG($))return;if(B1.isAbsolute($)||B1.win32.isAbsolute($))throw new M(`Absolute path not allowed in registry instructions: "${$}" (from ${v})`);if($.startsWith("~"))throw new M(`Home directory path not allowed in registry instructions: "${$}" (from ${v})`);if($.split(/[/\\]/).some((Q)=>Q===".."))throw new M(`Path traversal (..) not allowed in registry instructions: "${$}" (from ${v})`)}function TV($,v,U){if(OG($))return[$];if(SV($,U),$.includes("*")||$.includes("?")||$.includes("[")){let J=new NV($),Y=[];for(let z of J.scanSync(v)){let I=B1.join(v,z);Y.push(I)}return Y}let _=B1.join(v,$);if(!FV(_))throw new M(`Registry instruction file not found: "${$}" (from ${U})
|
|
119
|
+
Expected at: ${_}`);return[_]}function FG($,v,U){let Q=[],_=new Set;for(let J of $){let Y=TV(J,v,U);for(let z of Y)if(!_.has(z))_.add(z),Q.push(z)}return Q}var NG=b(()=>{z$()});import{existsSync as Z1,readFileSync as TG,statSync as RV}from"fs";import{homedir as EV}from"os";import{join as m4,relative as RG}from"path";var{Glob:z8}=globalThis.Bun;function PV($){return $==="local-config"||$==="cli"||$==="env"}function hJ($,v){if($.trim().length===0)throw new d(`Invalid profile from ${v}: value cannot be empty or whitespace`);return $}function EG($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function SG($){let v;try{v=TG($,"utf8")}catch(J){let Y=J instanceof Error?J.message:"Unknown read error";throw new d(`Failed to read local config at ${$}: ${Y}`)}let U=[],Q=E$(v,U,{allowTrailingComma:!0});if(U.length>0){let J=EG(U);throw new d(`Invalid JSONC in local config at ${$}: ${J}`)}let _=c6.safeParse(Q);if(!_.success){let J=_.error.issues[0],Y=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid OCX config";throw new d(`Invalid local config at ${$}: ${Y} ${z}`)}return _.data}function xV($){let v;try{v=TG($,"utf8")}catch(_){let J=_ instanceof Error?_.message:"Unknown read error";throw new d(`Failed to read local OpenCode config at ${$}: ${J}`)}let U=[],Q=E$(v,U,{allowTrailingComma:!0});if(U.length>0){let _=EG(U);throw new d(`Invalid JSONC in local OpenCode config at ${$}: ${_}`)}if(!Q||typeof Q!=="object"||Array.isArray(Q))throw new d(`Invalid local OpenCode config at ${$}: root must be an object`);return Q}function yV($,v,U){let Q=[],_=v;while(!0){let J=m4(_,$);if(Z1(J)&&RV(J).isFile()){let z=RG(U,J);Q.push(z)}if(_===U)break;let Y=m4(_,"..");if(Y===_)break;_=Y}return Q}function CV($,v){for(let U of uV){let Q=yV(U,$,v);if(Q.length>0)return Q}return[]}function I8($){return $.startsWith("./")?$.slice(2):$}function fV($,v,U){return $.filter((Q)=>{for(let _ of U)if(new z8(I8(_)).match(Q))return!0;for(let _ of v)if(new z8(I8(_)).match(Q))return!1;return!0})}async function mV($){let v=await F4($);if(!v||Object.keys(v.installed).length===0)return[];let U=[];for(let[Q,_]of Object.entries(v.installed)){if(!_.opencode?.instructions)continue;let J=_.opencode.instructions;if(!Array.isArray(J))continue;let Y=`${_.registryName}/${_.name} (${Q})`,z=FG(J,$,Y);U.push(...z)}return Array.from(new Set(U))}class j6{cwd;profileName;profile;localConfigDir;registryInstructions;cachedConfig=null;constructor($,v,U,Q,_){this.cwd=$,this.profileName=v,this.profile=U,this.localConfigDir=Q,this.registryInstructions=_}static async create($,v){let U=c$.create($),Q=null,_="none",J=A6($);if(J){let q=m4(J,a4);if(Z1(q)){let G=SG(q);if(G.profile!==void 0)Q=hJ(G.profile,`local config at ${q}`),_="local-config"}}if(Q===null){if(v?.profile!==void 0)Q=hJ(v.profile,"CLI option --profile"),_="cli";else if(process.env.OCX_PROFILE!==void 0)Q=hJ(process.env.OCX_PROFILE,"environment variable OCX_PROFILE"),_="env"}let Y=await U.isInitialized();if(PV(_)&&!Y)throw new b0;let z=null;if(Y)if(Q!==null)z=await U.getLayered(Q,$);else try{Q=await U.resolveProfile(),z=await U.getLayered(Q,$),_="default"}catch(q){if(!(q instanceof m$)||q.profile!=="default")throw q;Q=null,z=null,_="none"}let I;if(z)I=h$(Q);else if(J)I=m4(J,"..");else I=N4();let X=await mV(I);return new j6($,Q,z,J,X)}resolve(){if(this.cachedConfig)return this.cachedConfig;let $={},v=W1,U={};if(this.profile){if($={...$,...this.profile.ocx.registries},this.profile.ocx.componentPath)v=this.profile.ocx.componentPath;if(this.profile.opencode)U=this.mergeOpencode(U,this.profile.opencode)}let Q=this.shouldLoadLocalConfig();if(!this.profile&&Q&&this.localConfigDir){let J=this.loadLocalOcxConfig();if(J)$=J.registries}if(this.localConfigDir){let J=this.loadLocalOpencodeConfig();if(J)U=this.mergeOpencode(U,J)}let _=this.discoverInstructions();return this.cachedConfig={registries:$,componentPath:v,opencode:U,instructions:_,profileName:this.profileName},this.cachedConfig}resolveWithOrigin(){let $=new Map,v={},U=W1,Q={};if($.set("componentPath",{path:"",source:"default"}),this.profile){let Y=`~/.config/opencode/profiles/${this.profileName}/ocx.jsonc`;for(let[z,I]of Object.entries(this.profile.ocx.registries))v[z]=I,$.set(`registries.${z}`,{path:Y,source:"global-profile"});if(this.profile.ocx.componentPath)U=this.profile.ocx.componentPath,$.set("componentPath",{path:Y,source:"global-profile"});if(this.profile.opencode){Q=this.mergeOpencode(Q,this.profile.opencode);let z=`~/.config/opencode/profiles/${this.profileName}/opencode.jsonc`;for(let I of Object.keys(this.profile.opencode))$.set(`opencode.${I}`,{path:z,source:"global-profile"})}}let _=this.shouldLoadLocalConfig();if(!this.profile&&_&&this.localConfigDir){let Y=this.loadLocalOcxConfig();if(Y){let z=m4(this.localConfigDir,a4);for(let[I,X]of Object.entries(Y.registries))v[I]=X,$.set(`registries.${I}`,{path:z,source:"local-config"})}}if(this.localConfigDir){let Y=this.loadLocalOpencodeConfig();if(Y){Q=this.mergeOpencode(Q,Y);let z=m4(this.localConfigDir,gv);for(let I of Object.keys(Y))$.set(`opencode.${I}`,{path:z,source:"local-opencode"})}}let J=this.discoverInstructions();return{registries:v,componentPath:U,opencode:Q,instructions:J,profileName:this.profileName,origins:$}}shouldLoadLocalConfig(){if(!this.profile?.ocx.exclude)return!0;if(!this.localConfigDir)return!0;let v=gJ(this.cwd),U=RG(v,this.localConfigDir),Q=this.profile.ocx.exclude??[],_=this.profile.ocx.include??[];for(let J of _){let Y=new z8(I8(J));if(Y.match(`${U}/`)||Y.match(U))return!0}for(let J of Q){let Y=new z8(I8(J));if(Y.match(`${U}/`)||Y.match(`${U}/**`))return!1}return!0}loadLocalOcxConfig(){if(!this.localConfigDir)return null;let $=m4(this.localConfigDir,a4);if(!Z1($))return null;return{registries:SG($).registries}}loadLocalOpencodeConfig(){if(!this.localConfigDir)return null;let $=m4(this.localConfigDir,gv);if(!Z1($))return null;return xV($)}discoverInstructions(){let $=[],v=N4(),U=m4(v,"AGENTS.md");if(Z1(U))$.push(U);else if(!process.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT){let q=m4(EV(),".claude","CLAUDE.md");if(Z1(q))$.push(q)}if(this.profile&&this.profileName){let q=m4(h$(this.profileName),"AGENTS.md");if(Z1(q))$.push(q)}let Q=this.loadRegistryInstructions();$.push(...Q);let _=gJ(this.cwd),J=CV(this.cwd,_),Y=this.profile?.ocx.exclude??[],z=this.profile?.ocx.include??[],X=fV(J,Y,z).map((q)=>m4(_,q));return $.push(...X),$}loadRegistryInstructions(){return this.registryInstructions}mergeOpencode($,v){return J8($,v)}getRegistries(){return this.resolve().registries}getComponentPath(){return this.resolve().componentPath}getProfileName(){return this.profileName}getCwd(){return this.cwd}getProfile(){return this.profile}}var uV;var cv=b(()=>{E4();G6();Z4();Y8();X4();z$();AG();NG();i6();uV=["AGENTS.md","CLAUDE.md","CONTEXT.md"]});function q4($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&Object.getPrototypeOf($)===Object.prototype}var mG={};s$(mG,{fetchRegistryIndex:()=>r6,fetchFileContent:()=>D1,fetchComponentVersion:()=>j8,fetchComponent:()=>dv,classifyRegistryIndexIssue:()=>fG,_clearFetcherCacheForTests:()=>oV});import{posix as gV}from"path";function lV($,v){return new n4(`Registry at ${$} uses an incompatible format (${v.issue}). ${v.remediation}`,{url:$,issue:v.issue,remediation:v.remediation,...v.schemaUrl!==void 0&&{schemaUrl:v.schemaUrl},...v.supportedMajor!==void 0&&{supportedMajor:v.supportedMajor},...v.detectedMajor!==void 0&&{detectedMajor:v.detectedMajor}})}function xG($,v){if(typeof $!=="string")throw new M(`Invalid ${v}: expected string, got ${typeof $}`);let U=G8[$]??$,Q=B0.safeParse(U);if(!Q.success)throw new M(`Unsupported component type "${$}" in ${v}. Expected one of: ${B0.options.join(", ")}`);return Q.data}function uG($){return typeof $==="string"&&Object.hasOwn(G8,$)}function q8($){return $.startsWith(".opencode/")||$.startsWith(".opencode\\")}function yG($){if(!q4($)||!Array.isArray($.files))return[];let v=[];for(let[U,Q]of $.files.entries()){if(typeof Q==="string"){if(!q8(Q))continue;v.push({path:`files[${U}]`,target:Q});continue}if(!q4(Q)||typeof Q.target!=="string")continue;if(!q8(Q.target))continue;v.push({path:`files[${U}].target`,target:Q.target})}return v}function dV($){if(!q4($))return[];let v=$.components;if(!Array.isArray(v))return[];let U=[];for(let[Q,_]of v.entries()){if(!q4(_))continue;let J=_.type;if(!uG(J))continue;U.push({path:`components[${Q}].type`,type:J})}return U}function pV($){if(!q4($))return!1;if(typeof $.type==="string"&&$.type.startsWith("ocx:"))return!0;return yG($).length>0}async function iV($){let v=p$($),U=lv.get(v);if(U)return U;try{await r6(v)}catch(_){if(_ instanceof P$||_ instanceof B$)return null;throw _}if(!lv.has(v))return null;let Q=lv.get(v);if(!Q)throw Error(`Missing registry schema mode cache entry for ${v}`);return Q}function PG($,v){if($.includes("\x00"))throw new M(`Unsafe target "${$}" in ${v}: null bytes are not allowed`);if($.includes("%"))throw new M(`Unsafe target "${$}" in ${v}: encoded paths are not allowed`);if($.includes("\\"))throw new M(`Unsafe target "${$}" in ${v}: Windows separators are not allowed`);if($.startsWith("/")||$.startsWith("//")||/^[a-zA-Z]:/.test($))throw new M(`Unsafe target "${$}" in ${v}: absolute paths are not allowed`);let U=$.startsWith(".opencode/")?$.slice(10):$;if(!U)throw new M(`Unsafe target "${$}" in ${v}: missing path after .opencode/`);let Q=U.split("/");if(Q.some((X)=>X.length===0))throw new M(`Unsafe target "${$}" in ${v}: empty path segments are not allowed`);if(Q.some((X)=>X==="."||X===".."))throw new M(`Unsafe target "${$}" in ${v}: traversal segments are not allowed`);let[_,...J]=Q;if(!_)throw new M(`Unsafe target "${$}" in ${v}: missing path root segment`);let z=[hV[_]??_,...J].join("/"),I=gV.normalize(z);if(I!==z)throw new M(`Unsafe target "${$}" in ${v}: path normalization is ambiguous`);if(I==="."||I===".."||I.startsWith("../"))throw new M(`Unsafe target "${$}" in ${v}: target escapes project root`);return I}function nV($,v){if(!q4($))return $;let U={...$};if(Object.hasOwn(U,"type"))U.type=xG(U.type,`${v}.type`);if(Array.isArray(U.files))U.files=U.files.map((Q,_)=>{if(typeof Q==="string"){if(!q8(Q))return Q;return PG(Q,`${v}.files[${_}]`)}if(!q4(Q))return Q;let J=Q.target;if(typeof J!=="string")return Q;if(!q8(J))return Q;return{...Q,target:PG(J,`${v}.files[${_}].target`)}});return U}function rV($,v){if(!q4($))throw new n4(`Registry at ${v} uses legacy schema v1 but does not expose an object index payload.`,{url:v,issue:"legacy-schema-v1",remediation:"Publish an object index with author/components fields, or upgrade to schema v2."});let U=$.components;if(!Array.isArray(U))throw new n4(`Registry at ${v} uses legacy schema v1 but the components field is missing or invalid.`,{url:v,issue:"legacy-schema-v1",remediation:"Ensure the legacy index has a components array, or upgrade to schema v2."});let Q=U.map((_,J)=>{if(!q4(_))throw new M(`Invalid index component at components[${J}]: expected object, got ${typeof _}`);let{name:Y,description:z}=_;if(typeof Y!=="string")throw new M(`Invalid index component name at components[${J}].name`);if(typeof z!=="string")throw new M(`Invalid index component description at components[${J}].description`);return{name:Y,type:xG(_.type,`components[${J}].type`),description:z}});return{...$,components:Q}}async function CG($,v,U={}){let Q=X8.get($);if(Q)return Q;let _=U.requestUrl??$,J=(async()=>{let Y={url:_,phase:U.phase},z;try{z=await fetch(_)}catch(X){throw new P$(`Network request failed for ${_}: ${X instanceof Error?X.message:String(X)}`,Y)}if(!z.ok){if(z.status===404)throw new B$(`Not found: ${_}`);throw new P$(`Failed to fetch ${_}: ${z.status} ${z.statusText}`,{...Y,status:z.status,statusText:z.statusText})}let I;try{I=await z.json()}catch(X){throw new P$(`Invalid JSON response from ${_}: ${X instanceof Error?X.message:String(X)}`,Y)}return await v(I)})();return X8.set($,J),J.catch(()=>X8.delete($)),J}function fG($){let v=Z0($);if(!v)return null;return{issue:v.issue,remediation:v.remediation,schemaUrl:v.schemaUrl,supportedMajor:v.supportedMajor,detectedMajor:v.detectedMajor}}async function r6($){let v=p$($),U=`${v}/index.json`;return CG(U,(Q)=>{let _=fG(Q);if(_&&_.issue!=="legacy-schema-v1")throw lV(U,_);let J=Q,Y="v2";if(_?.issue==="legacy-schema-v1"){Y="legacy-v1";try{J=rV(Q,U)}catch(I){if(I instanceof n4)throw I;let X=I instanceof Error?I.message:String(I);throw new n4(`Registry at ${U} uses legacy schema v1 but cannot be adapted safely. ${X}`,{url:U,issue:"invalid-format",remediation:"Fix the legacy payload shape (types/descriptions/components) or upgrade the registry to v2."})}}else{let I=dV(J);if(I.length>0){let X=I[0];if(!X)throw Error("Unexpected missing legacy type issue");let q=G8[X.type];throw new n4(`Registry at ${U} uses legacy component type "${X.type}" in ${X.path}. Use "${q}" for v2 registries.`,{url:U,issue:"invalid-format",remediation:`Replace legacy type "${X.type}" with canonical "${q}" in v2 manifests.`})}}let z=ZJ.safeParse(J);if(!z.success)throw new n4(`Registry at ${U} returned an unrecognized index format. Ensure it follows the OCX registry specification. Schema error: ${z.error.message}`,{url:U,issue:"invalid-format",remediation:`Ensure the registry index follows the OCX registry specification. Schema error: ${z.error.message}`});return lv.set(v,Y),z.data},{phase:"registry-index-fetch"})}async function dv($,v){return(await j8($,v)).manifest}async function j8($,v,U){let Q=`${p$($)}/components/${v}.json`;return CG(`${Q}#v=${U??"latest"}`,async(_)=>{let J=cV.safeParse(_);if(!J.success)throw new M(`Invalid packument format for "${v}": ${J.error.message}`);let Y=J.data,z=U??Y["dist-tags"].latest,I=Y.versions[z];if(!I){if(U){let j=Object.keys(Y.versions).join(", ");throw new M(`Component "${v}" has no version "${U}". Available: ${j}`)}throw new M(`Component "${v}" has no manifest for latest version ${z}`)}let X=`component "${v}@${z}"`,q=I;if(pV(I))if(await iV($)!=="v2")q=nV(I,X);else{let Z=yG(I)[0];if(Z)throw new M(`Invalid component manifest for "${v}@${z}": target "${Z.target}" at ${Z.path} uses a legacy .opencode/ prefix. For v2 registries, use canonical root-relative targets like "plugins/...", "profiles/...", "agents/...", "skills/...", or "commands/..." (without .opencode/).`);if(q4(I)&&uG(I.type)){let D=G8[I.type];throw new M(`Invalid component manifest for "${v}@${z}": type "${I.type}" is a legacy v1 alias. Use "${D}" for v2 registries.`)}}let G=G1.safeParse(q);if(!G.success)throw new M(`Invalid component manifest for "${v}@${z}": ${G.error.message}`);return{manifest:G.data,version:z}},{phase:"packument-fetch",requestUrl:Q})}async function D1($,v,U){let Q=`${p$($)}/components/${v}/${U}`,_={url:Q,phase:"file-content-fetch",qualifiedName:v},J;try{J=await fetch(Q)}catch(Y){throw new P$(`Network request failed for ${Q}: ${Y instanceof Error?Y.message:String(Y)}`,_)}if(!J.ok)throw new P$(`Failed to fetch file ${U} for ${v} from ${Q}: ${J.status} ${J.statusText}`,{..._,status:J.status,statusText:J.statusText});return J.text()}function oV(){X8.clear(),lv.clear()}var X8,lv,G8,hV,cV;var V1=b(()=>{Z6();t4();z$();X8=new Map,lv=new Map,G8={"ocx:agent":"agent","ocx:skill":"skill","ocx:plugin":"plugin","ocx:command":"command","ocx:tool":"tool","ocx:bundle":"bundle","ocx:profile":"profile"},hV={agent:"agents",skill:"skills",plugin:"plugins",command:"commands",tool:"tools",bundle:"bundles",profile:"profiles",philosophy:"tools"},cV=xv.extend({versions:K.record(K.string(),K.unknown())})});function gG($,v){if($.includes("/"))return o4($);if(v)return{namespace:v,component:$};throw new M(`Component '${$}' must include a registry alias (e.g., 'kdco/${$}')`)}async function hG($,v){let U=new Map,Q=new Set,_=new Set,J=new Set,Y={};async function z(q,G,j=[]){let H=BJ(q,G);if(U.has(H))return;if(Q.has(H)){let A=[...j,H].join(" \u2192 ");throw new M(`Circular dependency detected: ${A}`)}Q.add(H);let Z=$[q];if(!Z)throw new B$(`Registry alias '${q}' not found. Add it with 'ocx registry add <url> --name ${q}'.`);let D;try{D=await dv(Z.url,G)}catch(A){if(A instanceof P$)throw A;if(A instanceof B$)throw new B$(`Component '${G}' not found in registry '${q}'.`);if(A instanceof b$)throw A;throw new P$(`Failed to fetch component '${G}' from registry '${q}': ${A instanceof Error?A.message:String(A)}`,{url:Z.url})}for(let A of D.dependencies){let r=gG(A,q);await z(r.namespace,r.component,[...j,H])}let E=j1(D);if(U.set(H,{...E,registryName:q,baseUrl:Z.url,qualifiedName:H}),Q.delete(H),D.npmDependencies)for(let A of D.npmDependencies)_.add(A);if(D.npmDevDependencies)for(let A of D.npmDevDependencies)J.add(A);if(E.opencode)Y=J8(Y,E.opencode)}for(let q of v){let G=gG(q);await z(G.namespace,G.component)}let I=Array.from(U.values()),X=Array.from(U.keys());return{components:I,installOrder:X,npmDependencies:Array.from(_),npmDevDependencies:Array.from(J),opencode:Y}}var cG=b(()=>{t4();z$();V1();Y8()});import{statSync as tV}from"fs";import{mkdir as lG}from"fs/promises";import D4 from"path";function F0($){try{return tV($).isFile()}catch{return!1}}function K8($){let v=D4.resolve($);if(xJ(v)!=="local-project"){let I=D4.join(v,"opencode.jsonc"),X=D4.join(v,"opencode.json");if(F0(I))return{path:I,exists:!0};if(F0(X))return{path:X,exists:!0};return{path:I,exists:!1}}let _=D4.join(v,lJ,"opencode.jsonc"),J=D4.join(v,lJ,"opencode.json");if(F0(_))return{path:_,exists:!0};if(F0(J))return{path:J,exists:!0};let Y=D4.join(v,"opencode.jsonc"),z=D4.join(v,"opencode.json");if(F0(Y))return{path:Y,exists:!0};if(F0(z))return{path:z,exists:!0};return{path:_,exists:!1}}async function dG($){let{path:v,exists:U}=K8($);if(U)return{path:v,created:!1};return await lG(D4.dirname(v),{recursive:!0}),await Bun.write(v,aV),{path:v,created:!0}}async function dJ($){let{path:v,exists:U}=K8($);if(!U)return null;let _=await Bun.file(v).text();return{config:E$(_,[],{allowTrailingComma:!0}),content:_,path:v}}async function sV($,v){await Bun.write($,v)}function eV($,v){let Q=E$($,[],{allowTrailingComma:!0});for(let _ of v){if(Q===null||Q===void 0)return;if(typeof Q!=="object")return;Q=Q[_]}return Q}function pG($,v,U){if(U===null||U===void 0)return $;if(q4(U)){let _=eV($,v);if(_!==void 0&&(_===null||typeof _!=="object")){let Y=y1($,v,U,cJ);return C1($,Y)}let J=$;for(let[Y,z]of Object.entries(U))J=pG(J,[...v,Y],z);return J}if(Array.isArray(U)){let _=y1($,v,U,cJ);return C1($,_)}let Q=y1($,v,U,cJ);return C1($,Q)}async function pJ($,v){let U=await dJ($),Q,_,J=!1;if(U)Q=U.content,_=U.path;else{Q=JSON.stringify({$schema:"https://opencode.ai/config.json"},null,"\t");let X=D4.resolve($);_=xJ(X)!=="local-project"?D4.join(X,"opencode.jsonc"):D4.join(X,lJ,"opencode.jsonc"),await lG(D4.dirname(_),{recursive:!0}),J=!0}let Y=Q;Q=pG(Q,[],v);let z=Q!==Y;if(z)await sV(_,Q);return{path:_,created:J,changed:z}}var lJ=".opencode",cJ,aV=`{
|
|
81
120
|
"$schema": "https://opencode.ai/config.json"
|
|
82
121
|
// Add MCP servers, tools, plugins here
|
|
83
122
|
}
|
|
84
|
-
`;var
|
|
85
|
-
`}}});function
|
|
86
|
-
`).trim()}function s1(D,F){return H4(D)===H4(F)}import{existsSync as uq,lstatSync as Pq}from"fs";import{rm as yq,unlink as xq}from"fs/promises";import{join as W4}from"path";function G4(D,F){let B=[];for(let[$,_]of Object.entries(F)){let Q=D[$]??null;if(Q!==_)B.push({name:$,from:Q,to:_})}return{changed:B.length>0,entries:B}}function z4(D,F){let B=W4(D,"node_modules"),$=F.map((_)=>_.name).join(", ");return{action:"delete",target:B,details:{reason:`dependency declarations changed (${$}); invalidating to force reinstall`,path:B}}}function X4(D){if(D&&typeof D==="object"&&"code"in D)return String(D.code);return"UNKNOWN"}function a1(D){if(D instanceof Error)return D.message;return String(D)}function mq(D){return new Promise((F)=>setTimeout(F,D))}async function M4(D,F){let B=W4(D,"node_modules"),$=F?.rmImpl??((_,Q)=>yq(_,Q));if(!uq(B))return{success:!0,action:"none"};try{if(Pq(B).isSymbolicLink())return await xq(B),{success:!0,action:"unlinked"}}catch(_){let Q=X4(_);if(Q==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:Q,message:a1(_)}}}for(let _=0;_<=J4;_++)try{return await $(B,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(Q){let Y=X4(Q);if(Y==="ENOENT")return{success:!0,action:"none"};if(!fq.has(Y))return{success:!1,action:"failed",error:{code:Y,message:a1(Q)}};if(_<J4)await mq(hq*2**_);else return{success:!1,action:"failed",error:{code:Y,message:a1(Q)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var fq,J4=3,hq=100;var A4=V(()=>{fq=new Set(["EBUSY","ENOTEMPTY"])});function j4(D,F){let B=0,$,_="",Q="";for(;B<D.length;B++)if($=D[B],_+=$.open,Q+=$.close,~F.indexOf($.close))F=F.replace($.rgx,$.close+$.open);return _+F+Q}function gq(D,F){let B={has:D,keys:F};return B.reset=ED.reset.bind(B),B.bold=ED.bold.bind(B),B.dim=ED.dim.bind(B),B.italic=ED.italic.bind(B),B.underline=ED.underline.bind(B),B.inverse=ED.inverse.bind(B),B.hidden=ED.hidden.bind(B),B.strikethrough=ED.strikethrough.bind(B),B.black=ED.black.bind(B),B.red=ED.red.bind(B),B.green=ED.green.bind(B),B.yellow=ED.yellow.bind(B),B.blue=ED.blue.bind(B),B.magenta=ED.magenta.bind(B),B.cyan=ED.cyan.bind(B),B.white=ED.white.bind(B),B.gray=ED.gray.bind(B),B.grey=ED.grey.bind(B),B.bgBlack=ED.bgBlack.bind(B),B.bgRed=ED.bgRed.bind(B),B.bgGreen=ED.bgGreen.bind(B),B.bgYellow=ED.bgYellow.bind(B),B.bgBlue=ED.bgBlue.bind(B),B.bgMagenta=ED.bgMagenta.bind(B),B.bgCyan=ED.bgCyan.bind(B),B.bgWhite=ED.bgWhite.bind(B),B}function RD(D,F){let B={open:`\x1B[${D}m`,close:`\x1B[${F}m`,rgx:new RegExp(`\\x1b\\[${F}m`,"g")};return function($){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf(D)||(this.has.push(D),this.keys.push(B)),$===void 0?this:ED.enabled?j4(this.keys,$+""):$+"";return $===void 0?gq([D],[B]):ED.enabled?j4([B],$+""):$+""}}var o1,K4,U4,V4,E4=!0,ED,P;var G2=V(()=>{if(typeof process<"u")({FORCE_COLOR:o1,NODE_DISABLE_COLORS:K4,NO_COLOR:U4,TERM:V4}=process.env||{}),E4=process.stdout&&process.stdout.isTTY;ED={enabled:!K4&&U4==null&&V4!=="dumb"&&(o1!=null&&o1!=="0"||E4),reset:RD(0,0),bold:RD(1,22),dim:RD(2,22),italic:RD(3,23),underline:RD(4,24),inverse:RD(7,27),hidden:RD(8,28),strikethrough:RD(9,29),black:RD(30,39),red:RD(31,39),green:RD(32,39),yellow:RD(33,39),blue:RD(34,39),magenta:RD(35,39),cyan:RD(36,39),white:RD(37,39),gray:RD(90,39),grey:RD(90,39),bgBlack:RD(40,49),bgRed:RD(41,49),bgGreen:RD(42,49),bgYellow:RD(43,49),bgBlue:RD(44,49),bgMagenta:RD(45,49),bgCyan:RD(46,49),bgWhite:RD(47,49)};P=ED});function w4(D,F){if(D==null||D==="")return F;let B=D.trim().toLowerCase();if(B==="true"||B==="1"||B==="yes"||B==="on")return!0;if(B==="false"||B==="0"||B==="no"||B==="off")return!1;return F}var dq,FF,L4;var N3=V(()=>{dq=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),FF=Boolean(process.stdout.isTTY&&!dq),L4=Boolean(FF&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var pF,W,G0;var hD=V(()=>{G2();N3();if(!L4)P.enabled=!1;pF={},W={info(...D){if(pF.quiet)return;console.log(P.blue("info"),...D)},success(...D){if(pF.quiet)return;console.log(P.green("\u2713"),...D)},warn(...D){if(pF.quiet)return;console.warn(P.yellow("warn"),...D)},error(...D){console.error(P.red("error"),...D)},debug(...D){if(!pF.verbose)return;console.log(P.gray("debug"),...D)},log(...D){if(pF.quiet)return;console.log(...D)},break(){if(pF.quiet)return;console.log("")}},G0={component:(D)=>P.cyan(D),path:(D)=>P.green(D),command:(D)=>P.yellow(D),url:(D)=>P.blue().underline(D),error:(D)=>P.red(D),dim:(D)=>P.gray(D),bold:(D)=>P.bold(D)}});function z0(D,F={}){if(F.json){console.log(JSON.stringify(D,null,2));return}if(F.quiet)return;if(W.info(G0.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),W.break(),D.wouldPerform.length===0)W.info("No actions would be performed.");else{let $=cq(D.wouldPerform);for(let[_,Q]of Object.entries($)){let Y=lq(_);W.info(`Would ${Y} ${Q.length} item(s):`);for(let q of Q){let H=pq(q.details);W.info(` \u2022 ${G0.component(q.target)}${H}`)}W.break()}}if(D.summary)W.info(D.summary),W.break();if(D.validation.errors&&D.validation.errors.length>0){W.error("Would fail with errors:");for(let $ of D.validation.errors)W.error(` \u2022 ${$}`);W.break()}if(D.validation.warnings&&D.validation.warnings.length>0){W.warn("Warnings:");for(let $ of D.validation.warnings)W.warn(` \u2022 ${$}`);W.break()}if(F.hints&&F.hints.length>0){for(let $ of F.hints)W.info(G0.dim($));W.break()}W.info(G0.dim("Run without --dry-run to apply changes."))}function cq(D){let F={};for(let B of D){if(!F[B.action])F[B.action]=[];F[B.action]?.push(B)}return F}function lq(D){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[D]??D}function pq(D){if(!D||Object.keys(D).length===0)return"";let F=[];for(let[B,$]of Object.entries(D??{}))if($!==void 0&&$!==null)F.push(`${B}: ${G0.dim(String($))}`);return F.length>0?` (${F.join(", ")})`:""}var BF=V(()=>{hD()});var O4={};j2(O4,{wrapAction:()=>iq,handleError:()=>t});function t(D,F={}){if(F.json){let B=nq(D);console.log(JSON.stringify(B,null,2)),process.exit(B.exitCode)}if(D instanceof zD)W.error(D.message),process.exit(D.exitCode);if(D instanceof lD){W.error("Validation failed:");for(let B of D.issues){let $=B.path.join(".");W.error(` ${$}: ${B.message}`)}process.exit(XD.CONFIG)}if(D instanceof Error){if(W.error(D.message),process.env.DEBUG)console.error(D.stack)}else W.error("An unknown error occurred");process.exit(XD.GENERAL)}function iq(D){return async(...F)=>{try{await D(...F)}catch(B){t(B)}}}function nq(D){if(D instanceof vF)return{success:!1,error:{code:D.code,message:D.message,details:{conflictType:D.conflictType,registryName:D.registryName,existingUrl:D.existingUrl,newUrl:D.newUrl,...D.targetLabel&&{targetLabel:D.targetLabel},...D.existingName&&{existingName:D.existingName}}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof d2)return{success:!1,error:{code:D.code,message:D.message,details:{component:D.component,expected:D.expected,found:D.found}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof ZD){let F={};if(D.url)F.url=D.url;if(D.status!==void 0)F.status=D.status;if(D.statusText)F.statusText=D.statusText;if(D.phase)F.phase=D.phase;if(D.qualifiedName)F.qualifiedName=D.qualifiedName;if(D.registryContext)F.registryContext=D.registryContext;if(D.registryName)F.registryName=D.registryName;return{success:!1,error:{code:D.code,message:D.message,...Object.keys(F).length>0&&{details:F}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}}}if(D instanceof CD)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof O2)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof C0)return{success:!1,error:{code:D.code,message:D.message,details:{profile:D.profile,reason:D.reason}},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof s0)return{success:!1,error:{code:"BUILD_ERROR",message:D.message,details:{errors:D.errors}},exitCode:XD.GENERAL,meta:{timestamp:new Date().toISOString()}};if(D instanceof v0){let F={url:D.url,issue:D.issue,remediation:D.remediation};if(D.schemaUrl!==void 0)F.schemaUrl=D.schemaUrl;if(D.supportedMajor!==void 0)F.supportedMajor=D.supportedMajor;if(D.detectedMajor!==void 0)F.detectedMajor=D.detectedMajor;return{success:!1,error:{code:D.code,message:D.message,details:F},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}}}if(D instanceof g2)return{success:!1,error:{code:D.code,message:D.message,details:D.details},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof zD)return{success:!1,error:{code:D.code,message:D.message},exitCode:D.exitCode,meta:{timestamp:new Date().toISOString()}};if(D instanceof lD)return{success:!1,error:{code:"VALIDATION_ERROR",message:D.issues.map((F)=>`${F.path.join(".")}: ${F.message}`).join("; "),details:{issues:D.issues.map((F)=>({path:F.path.join("."),message:F.message,code:F.code}))}},exitCode:XD.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:D instanceof Error?D.message:"An unknown error occurred"},exitCode:XD.GENERAL,meta:{timestamp:new Date().toISOString()}}}var yD=V(()=>{Q2();r3();$D();hD()});function LD(D){console.log(JSON.stringify(D,null,2))}function Z4(D){if(!D)throw new U("npm package name cannot be empty");if(D.length>b4)throw new U(`npm package name exceeds maximum length of ${b4} characters: \`${D}\``);if(D.includes("..")||D.includes("/./")||D.startsWith("./"))throw new U(`Invalid npm package name - path traversal detected: \`${D}\``);if(!oq.test(D))throw new U(`Invalid npm package name: \`${D}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function R4(D){if(!D?.trim())throw new U("npm specifier cannot be empty");let F=D.trim();if(!F.startsWith("npm:"))throw new U(`Invalid npm specifier: \`${D}\`. Must start with \`npm:\` prefix.`);let B=F.slice(4);if(!B)throw new U(`Invalid npm specifier: \`${D}\`. Package name is required.`);let $=B.lastIndexOf("@"),_,Q;if($>0){let Y=B.slice(0,$),q=B.slice($+1);if(Y.includes("/")||!Y.startsWith("@"))_=Y,Q=q||void 0;else throw new U(`Invalid npm specifier: \`${D}\`. Scoped packages must have format @scope/pkg.`)}else _=B;return Z4(_),{type:"npm",name:_,version:Q}}function N4(D){return D.trim().startsWith("npm:")}async function r1(D,F){Z4(D);let B=D.startsWith("@")?`@${encodeURIComponent(D.slice(1))}`:encodeURIComponent(D),$=`${sq}/${B}`;try{let _=F??AbortSignal.timeout(aq),Q=await fetch($,{signal:_,headers:{Accept:"application/json"}});if(Q.status===404)throw new MD(`npm package \`${D}\` not found on registry`);if(!Q.ok)throw new ZD(`Failed to fetch npm package \`${D}\`: HTTP ${Q.status} ${Q.statusText}`);return await Q.json()}catch(_){if(_ instanceof MD||_ instanceof ZD)throw _;if(_ instanceof Error&&(_.name==="AbortError"||_.name==="TimeoutError"))throw new ZD(`Request to npm registry timed out for package \`${D}\``);let Q=_ instanceof Error?_.message:String(_);throw new ZD(`Failed to fetch npm package \`${D}\`: ${Q}`)}}function iF(D,F){return F?`${D}@${F}`:D}function S4(D){let F=[];if(D.type!=="module")throw new U(`Package \`${D.name}\` is not an ESM module (missing "type": "module" in package.json)`);let B=Boolean(D.main),$=D.exports!==void 0;if(!B&&!$)throw new U(`Package \`${D.name}\` has no entry point (missing "main" or "exports")`);if(!D.name.includes("opencode"))F.push(`Package name \`${D.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:F}}async function j8(D,F,B){let $=await r1(D,B),_=F??$["dist-tags"].latest,Q=$.versions[_];if(!Q)throw new MD(`Version \`${_}\` not found for npm package \`${D}\``);return Q}function k4(D){let F=D.trim(),B=F.lastIndexOf("@");if(B<=0)return F;let $=F.slice(0,B);if($.includes("/")||!$.startsWith("@"))return $;return F}var sq="https://registry.npmjs.org",aq=30000,oq,b4=214;var t1=V(()=>{$D();oq=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function $F(D,F){let B=D.get(F.absolutePath);if(!B){D.set(F.absolutePath,F);return}let $=B.content.equals(F.content)?"identical content":"different content";throw new dD(`Intra-batch target collision at "${F.relativePath}". Both "${B.source}" and "${F.source}" resolve to this path with ${$}. Rename one manifest target so each component writes to a unique path.`)}var K8=V(()=>{$D()});import{createHash as rq}from"crypto";import{existsSync as tq}from"fs";import{join as eq}from"path";function _F(D){return rq("sha256").update(D).digest("hex")}async function U8(D){let F=[...D].sort(($,_)=>$.path.localeCompare(_.path)),B=[];for(let $ of F){let _=_F($.content);B.push(`${$.path}:${_}`)}return _F(B.join(`
|
|
87
|
-
`))}async function
|
|
123
|
+
`;var iJ=b(()=>{E4();Z4();cJ={formattingOptions:{tabSize:2,insertSpaces:!1,eol:`
|
|
124
|
+
`}}});function iG($){return $.replace(/\r\n/g,`
|
|
125
|
+
`).trim()}function nJ($,v){return iG($)===iG(v)}import{existsSync as $M,lstatSync as vM}from"fs";import{rm as _M,unlink as UM}from"fs/promises";import{join as oG}from"path";function tG($,v){let U=[];for(let[Q,_]of Object.entries(v)){let J=$[Q]??null;if(J!==_)U.push({name:Q,from:J,to:_})}return{changed:U.length>0,entries:U}}function aG($,v){let U=oG($,"node_modules"),Q=v.map((_)=>_.name).join(", ");return{action:"delete",target:U,details:{reason:`dependency declarations changed (${Q}); invalidating to force reinstall`,path:U}}}function rG($){if($&&typeof $==="object"&&"code"in $)return String($.code);return"UNKNOWN"}function rJ($){if($ instanceof Error)return $.message;return String($)}function YM($){return new Promise((v)=>setTimeout(v,$))}async function sG($,v){let U=oG($,"node_modules"),Q=v?.rmImpl??((_,J)=>_M(_,J));if(!$M(U))return{success:!0,action:"none"};try{if(vM(U).isSymbolicLink())return await UM(U),{success:!0,action:"unlinked"}}catch(_){let J=rG(_);if(J==="ENOENT")return{success:!0,action:"none"};return{success:!1,action:"failed",error:{code:J,message:rJ(_)}}}for(let _=0;_<=nG;_++)try{return await Q(U,{recursive:!0,force:!0}),{success:!0,action:"removed"}}catch(J){let Y=rG(J);if(Y==="ENOENT")return{success:!0,action:"none"};if(!QM.has(Y))return{success:!1,action:"failed",error:{code:Y,message:rJ(J)}};if(_<nG)await YM(JM*2**_);else return{success:!1,action:"failed",error:{code:Y,message:rJ(J)}}}return{success:!1,action:"failed",error:{code:"UNKNOWN",message:"exhausted retries"}}}var QM,nG=3,JM=100;var eG=b(()=>{QM=new Set(["EBUSY","ENOTEMPTY"])});function $j($,v){let U=0,Q,_="",J="";for(;U<$.length;U++)if(Q=$[U],_+=Q.open,J+=Q.close,~v.indexOf(Q.close))v=v.replace(Q.rgx,Q.close+Q.open);return _+v+J}function zM($,v){let U={has:$,keys:v};return U.reset=k$.reset.bind(U),U.bold=k$.bold.bind(U),U.dim=k$.dim.bind(U),U.italic=k$.italic.bind(U),U.underline=k$.underline.bind(U),U.inverse=k$.inverse.bind(U),U.hidden=k$.hidden.bind(U),U.strikethrough=k$.strikethrough.bind(U),U.black=k$.black.bind(U),U.red=k$.red.bind(U),U.green=k$.green.bind(U),U.yellow=k$.yellow.bind(U),U.blue=k$.blue.bind(U),U.magenta=k$.magenta.bind(U),U.cyan=k$.cyan.bind(U),U.white=k$.white.bind(U),U.gray=k$.gray.bind(U),U.grey=k$.grey.bind(U),U.bgBlack=k$.bgBlack.bind(U),U.bgRed=k$.bgRed.bind(U),U.bgGreen=k$.bgGreen.bind(U),U.bgYellow=k$.bgYellow.bind(U),U.bgBlue=k$.bgBlue.bind(U),U.bgMagenta=k$.bgMagenta.bind(U),U.bgCyan=k$.bgCyan.bind(U),U.bgWhite=k$.bgWhite.bind(U),U}function x$($,v){let U={open:`\x1B[${$}m`,close:`\x1B[${v}m`,rgx:new RegExp(`\\x1b\\[${v}m`,"g")};return function(Q){if(this!==void 0&&this.has!==void 0)return!!~this.has.indexOf($)||(this.has.push($),this.keys.push(U)),Q===void 0?this:k$.enabled?$j(this.keys,Q+""):Q+"";return Q===void 0?zM([$],[U]):k$.enabled?$j([U],Q+""):Q+""}}var oJ,vj,_j,Uj,Qj=!0,k$,m;var O6=b(()=>{if(typeof process<"u")({FORCE_COLOR:oJ,NODE_DISABLE_COLORS:vj,NO_COLOR:_j,TERM:Uj}=process.env||{}),Qj=process.stdout&&process.stdout.isTTY;k$={enabled:!vj&&_j==null&&Uj!=="dumb"&&(oJ!=null&&oJ!=="0"||Qj),reset:x$(0,0),bold:x$(1,22),dim:x$(2,22),italic:x$(3,23),underline:x$(4,24),inverse:x$(7,27),hidden:x$(8,28),strikethrough:x$(9,29),black:x$(30,39),red:x$(31,39),green:x$(32,39),yellow:x$(33,39),blue:x$(34,39),magenta:x$(35,39),cyan:x$(36,39),white:x$(37,39),gray:x$(90,39),grey:x$(90,39),bgBlack:x$(40,49),bgRed:x$(41,49),bgGreen:x$(42,49),bgYellow:x$(43,49),bgBlue:x$(44,49),bgMagenta:x$(45,49),bgCyan:x$(46,49),bgWhite:x$(47,49)};m=k$});function Yj($,v){if($==null||$==="")return v;let U=$.trim().toLowerCase();if(U==="true"||U==="1"||U==="yes"||U==="on")return!0;if(U==="false"||U==="0"||U==="no"||U==="off")return!1;return v}var IM,M1,Jj;var pv=b(()=>{IM=Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.JENKINS_URL||process.env.BUILDKITE),M1=Boolean(process.stdout.isTTY&&!IM),Jj=Boolean(M1&&process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0)});var N0,W,S4;var i$=b(()=>{O6();pv();if(!Jj)m.enabled=!1;N0={},W={info(...$){if(N0.quiet)return;console.log(m.blue("info"),...$)},success(...$){if(N0.quiet)return;console.log(m.green("\u2713"),...$)},warn(...$){if(N0.quiet)return;console.warn(m.yellow("warn"),...$)},error(...$){console.error(m.red("error"),...$)},debug(...$){if(!N0.verbose)return;console.log(m.gray("debug"),...$)},log(...$){if(N0.quiet)return;console.log(...$)},break(){if(N0.quiet)return;console.log("")}},S4={component:($)=>m.cyan($),path:($)=>m.green($),command:($)=>m.yellow($),url:($)=>m.blue().underline($),error:($)=>m.red($),dim:($)=>m.gray($),bold:($)=>m.bold($)}});function T4($,v={}){if(v.json){console.log(JSON.stringify($,null,2));return}if(v.quiet)return;if(W.info(S4.dim("\uD83D\uDD0D DRY RUN: No changes will be made")),W.break(),$.wouldPerform.length===0)W.info("No actions would be performed.");else{let Q=XM($.wouldPerform);for(let[_,J]of Object.entries(Q)){let Y=qM(_);W.info(`Would ${Y} ${J.length} item(s):`);for(let z of J){let I=GM(z.details);W.info(` \u2022 ${S4.component(z.target)}${I}`)}W.break()}}if($.summary)W.info($.summary),W.break();if($.validation.errors&&$.validation.errors.length>0){W.error("Would fail with errors:");for(let Q of $.validation.errors)W.error(` \u2022 ${Q}`);W.break()}if($.validation.warnings&&$.validation.warnings.length>0){W.warn("Warnings:");for(let Q of $.validation.warnings)W.warn(` \u2022 ${Q}`);W.break()}if(v.hints&&v.hints.length>0){for(let Q of v.hints)W.info(S4.dim(Q));W.break()}W.info(S4.dim("Run without --dry-run to apply changes."))}function XM($){let v={};for(let U of $){if(!v[U.action])v[U.action]=[];v[U.action]?.push(U)}return v}function qM($){return{add:"add",remove:"remove",delete:"delete",update:"update",create:"create",modify:"modify"}[$]??$}function GM($){if(!$||Object.keys($).length===0)return"";let v=[];for(let[U,Q]of Object.entries($??{}))if(Q!==void 0&&Q!==null)v.push(`${U}: ${S4.dim(String(Q))}`);return v.length>0?` (${v.join(", ")})`:""}var w1=b(()=>{i$()});var zj={};s$(zj,{wrapAction:()=>jM,handleError:()=>_$});function _$($,v={}){if(v.json){let U=KM($);console.log(JSON.stringify(U,null,2)),process.exit(U.exitCode)}if($ instanceof b$)W.error($.message),process.exit($.exitCode);if($ instanceof B_){W.error("Validation failed:");for(let U of $.issues){let Q=U.path.join(".");W.error(` ${Q}: ${U.message}`)}process.exit(K$.CONFIG)}if($ instanceof Error){if(W.error($.message),process.env.DEBUG)console.error($.stack)}else W.error("An unknown error occurred");process.exit(K$.GENERAL)}function jM($){return async(...v)=>{try{await $(...v)}catch(U){_$(U)}}}function KM($){if($ instanceof W0)return{success:!1,error:{code:$.code,message:$.message,details:{conflictType:$.conflictType,registryName:$.registryName,existingUrl:$.existingUrl,newUrl:$.newUrl,...$.targetLabel&&{targetLabel:$.targetLabel},...$.existingName&&{existingName:$.existingName}}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof X1)return{success:!1,error:{code:$.code,message:$.message,details:{component:$.component,expected:$.expected,found:$.found}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof P$){let v={};if($.url)v.url=$.url;if($.status!==void 0)v.status=$.status;if($.statusText)v.statusText=$.statusText;if($.phase)v.phase=$.phase;if($.qualifiedName)v.qualifiedName=$.qualifiedName;if($.registryContext)v.registryContext=$.registryContext;if($.registryName)v.registryName=$.registryName;return{success:!1,error:{code:$.code,message:$.message,...Object.keys(v).length>0&&{details:v}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof m$)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof g6)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof r4)return{success:!1,error:{code:$.code,message:$.message,details:{profile:$.profile,reason:$.reason}},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof X6)return{success:!1,error:{code:"BUILD_ERROR",message:$.message,details:{errors:$.errors}},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}};if($ instanceof n4){let v={url:$.url,issue:$.issue,remediation:$.remediation};if($.schemaUrl!==void 0)v.schemaUrl=$.schemaUrl;if($.supportedMajor!==void 0)v.supportedMajor=$.supportedMajor;if($.detectedMajor!==void 0)v.detectedMajor=$.detectedMajor;return{success:!1,error:{code:$.code,message:$.message,details:v},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}}}if($ instanceof I1)return{success:!1,error:{code:$.code,message:$.message,details:$.details},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof b$)return{success:!1,error:{code:$.code,message:$.message},exitCode:$.exitCode,meta:{timestamp:new Date().toISOString()}};if($ instanceof B_)return{success:!1,error:{code:"VALIDATION_ERROR",message:$.issues.map((v)=>`${v.path.join(".")}: ${v.message}`).join("; "),details:{issues:$.issues.map((v)=>({path:v.path.join("."),message:v.message,code:v.code}))}},exitCode:K$.CONFIG,meta:{timestamp:new Date().toISOString()}};return{success:!1,error:{code:"UNKNOWN_ERROR",message:$ instanceof Error?$.message:"An unknown error occurred"},exitCode:K$.GENERAL,meta:{timestamp:new Date().toISOString()}}}var l$=b(()=>{Z6();r_();z$();i$()});function F$($){console.log(JSON.stringify($,null,2))}function Xj($){if(!$)throw new M("npm package name cannot be empty");if($.length>Ij)throw new M(`npm package name exceeds maximum length of ${Ij} characters: \`${$}\``);if($.includes("..")||$.includes("/./")||$.startsWith("./"))throw new M(`Invalid npm package name - path traversal detected: \`${$}\``);if(!bM.test($))throw new M(`Invalid npm package name: \`${$}\`. Must be lowercase, start with alphanumeric, and contain only letters, numbers, hyphens, dots, or underscores.`)}function qj($){if(!$?.trim())throw new M("npm specifier cannot be empty");let v=$.trim();if(!v.startsWith("npm:"))throw new M(`Invalid npm specifier: \`${$}\`. Must start with \`npm:\` prefix.`);let U=v.slice(4);if(!U)throw new M(`Invalid npm specifier: \`${$}\`. Package name is required.`);let Q=U.lastIndexOf("@"),_,J;if(Q>0){let Y=U.slice(0,Q),z=U.slice(Q+1);if(Y.includes("/")||!Y.startsWith("@"))_=Y,J=z||void 0;else throw new M(`Invalid npm specifier: \`${$}\`. Scoped packages must have format @scope/pkg.`)}else _=U;return Xj(_),{type:"npm",name:_,version:J}}function Gj($){return $.trim().startsWith("npm:")}async function tJ($,v){Xj($);let U=$.startsWith("@")?`@${encodeURIComponent($.slice(1))}`:encodeURIComponent($),Q=`${HM}/${U}`;try{let _=v??AbortSignal.timeout(WM),J=await fetch(Q,{signal:_,headers:{Accept:"application/json"}});if(J.status===404)throw new B$(`npm package \`${$}\` not found on registry`);if(!J.ok)throw new P$(`Failed to fetch npm package \`${$}\`: HTTP ${J.status} ${J.statusText}`);return await J.json()}catch(_){if(_ instanceof B$||_ instanceof P$)throw _;if(_ instanceof Error&&(_.name==="AbortError"||_.name==="TimeoutError"))throw new P$(`Request to npm registry timed out for package \`${$}\``);let J=_ instanceof Error?_.message:String(_);throw new P$(`Failed to fetch npm package \`${$}\`: ${J}`)}}function S0($,v){return v?`${$}@${v}`:$}function jj($){let v=[];if($.type!=="module")throw new M(`Package \`${$.name}\` is not an ESM module (missing "type": "module" in package.json)`);let U=Boolean($.main),Q=$.exports!==void 0;if(!U&&!Q)throw new M(`Package \`${$.name}\` has no entry point (missing "main" or "exports")`);if(!$.name.includes("opencode"))v.push(`Package name \`${$.name}\` doesn't contain "opencode" - this may not be an OpenCode plugin`);return{valid:!0,warnings:v}}async function H8($,v,U){let Q=await tJ($,U),_=v??Q["dist-tags"].latest,J=Q.versions[_];if(!J)throw new B$(`Version \`${_}\` not found for npm package \`${$}\``);return J}function Kj($){let v=$.trim(),U=v.lastIndexOf("@");if(U<=0)return v;let Q=v.slice(0,U);if(Q.includes("/")||!Q.startsWith("@"))return Q;return v}var HM="https://registry.npmjs.org",WM=30000,bM,Ij=214;var aJ=b(()=>{z$();bM=/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/});function L1($,v){let U=$.get(v.absolutePath);if(!U){$.set(v.absolutePath,v);return}let Q=U.content.equals(v.content)?"identical content":"different content";throw new t$(`Intra-batch target collision at "${v.relativePath}". Both "${U.source}" and "${v.source}" resolve to this path with ${Q}. Rename one manifest target so each component writes to a unique path.`)}var W8=b(()=>{z$()});import{createHash as BM}from"crypto";import{existsSync as ZM}from"fs";import{join as DM}from"path";function k1($){return BM("sha256").update($).digest("hex")}async function b8($){let v=[...$].sort((Q,_)=>Q.path.localeCompare(_.path)),U=[];for(let Q of v){let _=k1(Q.content);U.push(`${Q.path}:${_}`)}return k1(U.join(`
|
|
126
|
+
`))}async function iv($,v){let U=[],Q=[],_=[];for(let J of v.files){let Y=DM($,J.path);if(!ZM(Y)){Q.push(J.path),_.push({path:J.path,status:"missing"});continue}let z=await Bun.file(Y).text();if(k1(z)!==J.hash)U.push(J.path),_.push({path:J.path,status:"modified"});else _.push({path:J.path,status:"intact"})}return{intact:U.length===0&&Q.length===0,modified:U,missing:Q,details:_}}var T0=b(()=>{X4()});function Q4($){return $.addOption(g4.cwd()).addOption(g4.quiet()).addOption(g4.json())}function h4($){return $.addOption(g4.verbose())}function K6($){return $.addOption(g4.global)}function B8($){return $.addOption(g4.profile())}function Hj($){if(!$||$.length===0)throw new r4($,"cannot be empty");if($.length>32)throw new r4($,"must be 32 characters or less");if(!/^[a-zA-Z][a-zA-Z0-9._-]*$/.test($))throw new r4($,"must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens")}var g4;var s4=b(()=>{$8();z$();g4={cwd:()=>new w6("--cwd <path>","Working directory").default(process.cwd()),quiet:()=>new w6("-q, --quiet","Suppress output"),json:()=>new w6("--json","Output as JSON"),profile:()=>new w6("-p, --profile <name>","Target a specific profile's config"),verbose:()=>new w6("-v, --verbose","Verbose output"),global:new w6("-g, --global","Install to global OpenCode config (~/.config/opencode)")}});function wM(){let $=new Map;for(let[v,U]of Object.entries(u$)){for(let[Q,_]of Object.entries(U))u$[Q]={open:`\x1B[${_[0]}m`,close:`\x1B[${_[1]}m`},U[Q]=u$[Q],$.set(_[0],_[1]);Object.defineProperty(u$,v,{value:U,enumerable:!1})}return Object.defineProperty(u$,"codes",{value:$,enumerable:!1}),u$.color.close="\x1B[39m",u$.bgColor.close="\x1B[49m",u$.color.ansi=Wj(),u$.color.ansi256=bj(),u$.color.ansi16m=Bj(),u$.bgColor.ansi=Wj(10),u$.bgColor.ansi256=bj(10),u$.bgColor.ansi16m=Bj(10),Object.defineProperties(u$,{rgbToAnsi256:{value(v,U,Q){if(v===U&&U===Q){if(v<8)return 16;if(v>248)return 231;return Math.round((v-8)/247*24)+232}return 16+36*Math.round(v/255*5)+6*Math.round(U/255*5)+Math.round(Q/255*5)},enumerable:!1},hexToRgb:{value(v){let U=/[a-f\d]{6}|[a-f\d]{3}/i.exec(v.toString(16));if(!U)return[0,0,0];let[Q]=U;if(Q.length===3)Q=[...Q].map((J)=>J+J).join("");let _=Number.parseInt(Q,16);return[_>>16&255,_>>8&255,_&255]},enumerable:!1},hexToAnsi256:{value:(v)=>u$.rgbToAnsi256(...u$.hexToRgb(v)),enumerable:!1},ansi256ToAnsi:{value(v){if(v<8)return 30+v;if(v<16)return 90+(v-8);let U,Q,_;if(v>=232)U=((v-232)*10+8)/255,Q=U,_=U;else{v-=16;let z=v%36;U=Math.floor(v/36)/5,Q=Math.floor(z/6)/5,_=z%6/5}let J=Math.max(U,Q,_)*2;if(J===0)return 30;let Y=30+(Math.round(_)<<2|Math.round(Q)<<1|Math.round(U));if(J===2)Y+=60;return Y},enumerable:!1},rgbToAnsi:{value:(v,U,Q)=>u$.ansi256ToAnsi(u$.rgbToAnsi256(v,U,Q)),enumerable:!1},hexToAnsi:{value:(v)=>u$.ansi256ToAnsi(u$.hexToAnsi256(v)),enumerable:!1}}),u$}var Wj=($=0)=>(v)=>`\x1B[${v+$}m`,bj=($=0)=>(v)=>`\x1B[${38+$};5;${v}m`,Bj=($=0)=>(v,U,Q)=>`\x1B[${38+$};2;${v};${U};${Q}m`,u$,sE,VM,MM,eE,LM,e4;var Zj=b(()=>{u$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},sE=Object.keys(u$.modifier),VM=Object.keys(u$.color),MM=Object.keys(u$.bgColor),eE=[...VM,...MM];LM=wM(),e4=LM});import sJ from"process";import kM from"os";import Dj from"tty";function c4($,v=globalThis.Deno?globalThis.Deno.args:sJ.argv){let U=$.startsWith("-")?"":$.length===1?"-":"--",Q=v.indexOf(U+$),_=v.indexOf("--");return Q!==-1&&(_===-1||Q<_)}function AM(){if("FORCE_COLOR"in y$){if(y$.FORCE_COLOR==="true")return 1;if(y$.FORCE_COLOR==="false")return 0;return y$.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(y$.FORCE_COLOR,10),3)}}function OM($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function FM($,{streamIsTTY:v,sniffFlags:U=!0}={}){let Q=AM();if(Q!==void 0)Z8=Q;let _=U?Z8:Q;if(_===0)return 0;if(U){if(c4("color=16m")||c4("color=full")||c4("color=truecolor"))return 3;if(c4("color=256"))return 2}if("TF_BUILD"in y$&&"AGENT_NAME"in y$)return 1;if($&&!v&&_===void 0)return 0;let J=_||0;if(y$.TERM==="dumb")return J;if(sJ.platform==="win32"){let Y=kM.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in y$){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Y)=>(Y in y$)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Y)=>(Y in y$))||y$.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in y$)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(y$.TEAMCITY_VERSION)?1:0;if(y$.COLORTERM==="truecolor")return 3;if(y$.TERM==="xterm-kitty")return 3;if(y$.TERM==="xterm-ghostty")return 3;if(y$.TERM==="wezterm")return 3;if("TERM_PROGRAM"in y$){let Y=Number.parseInt((y$.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(y$.TERM_PROGRAM){case"iTerm.app":return Y>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(y$.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(y$.TERM))return 1;if("COLORTERM"in y$)return 1;return J}function Vj($,v={}){let U=FM($,{streamIsTTY:$&&$.isTTY,...v});return OM(U)}var y$,Z8,NM,Mj;var wj=b(()=>{({env:y$}=sJ);if(c4("no-color")||c4("no-colors")||c4("color=false")||c4("color=never"))Z8=0;else if(c4("color")||c4("colors")||c4("color=true")||c4("color=always"))Z8=1;NM={stdout:Vj({isTTY:Dj.isatty(1)}),stderr:Vj({isTTY:Dj.isatty(2)})},Mj=NM});function Lj($,v,U){let Q=$.indexOf(v);if(Q===-1)return $;let _=v.length,J=0,Y="";do Y+=$.slice(J,Q)+v+U,J=Q+_,Q=$.indexOf(v,J);while(Q!==-1);return Y+=$.slice(J),Y}function kj($,v,U,Q){let _=0,J="";do{let Y=$[Q-1]==="\r";J+=$.slice(_,Y?Q-1:Q)+v+(Y?`\r
|
|
88
127
|
`:`
|
|
89
|
-
`)+
|
|
90
|
-
`,_)}while(
|
|
91
|
-
`);if(
|
|
92
|
-
${F}`,VH,EH,LH=(D,F,B)=>{let $=B===""?"":`with ${B.trim()}() `,_=UH.bind(null,$,F.toString());Object.defineProperty(_,"name",EH);let{writable:Q,enumerable:Y,configurable:q}=VH;Object.defineProperty(D,"toString",{value:_,writable:Q,enumerable:Y,configurable:q})};var l4=V(()=>{VH=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),EH=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var w8,p4=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let B,$=0,_=D.displayName||D.name||"<anonymous>",Q=function(...Y){if(w8.set(Q,++$),$===1)B=D.apply(this,Y),D=void 0;else if(F.throw===!0)throw Error(`Function \`${_}\` can only be called once`);return B};return _6(Q,D),w8.set(Q,$),Q},i4;var n4=V(()=>{l4();w8=new WeakMap;p4.callCount=(D)=>{if(!w8.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return w8.get(D)};i4=p4});var QF;var s4=V(()=>{QF=[];QF.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")QF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")QF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class a4{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Y6[Q6])return Y6[Q6];wH(Y6,Q6,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let B=this.listeners[D],$=B.indexOf(F);if($===-1)return;if($===0&&B.length===1)B.length=0;else B.splice($,1)}emit(D,F,B){if(this.emitted[D])return!1;this.emitted[D]=!0;let $=!1;for(let _ of this.listeners[D])$=_(F,B)===!0||$;if(D==="exit")$=this.emit("afterExit",F,B)||$;return $}}class H6{}var O8=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",Q6,Y6,wH,OH=(D)=>{return{onExit(F,B){return D.onExit(F,B)},load(){return D.load()},unload(){return D.unload()}}},o4,r4,q6,t4,DK,FK;var e4=V(()=>{s4();Q6=Symbol.for("signal-exit emitter"),Y6=globalThis,wH=Object.defineProperty.bind(Object);o4=class o4 extends H6{onExit(){return()=>{}}load(){}unload(){}};r4=class r4 extends H6{#Y=q6.platform==="win32"?"SIGINT":"SIGHUP";#B=new a4;#D;#_;#G;#F={};#Q=!1;constructor(D){super();this.#D=D,this.#F={};for(let F of QF)this.#F[F]=()=>{let B=this.#D.listeners(F),{count:$}=this.#B,_=D;if(typeof _.__signal_exit_emitter__==="object"&&typeof _.__signal_exit_emitter__.count==="number")$+=_.__signal_exit_emitter__.count;if(B.length===$){this.unload();let Q=this.#B.emit("exit",null,F),Y=F==="SIGHUP"?this.#Y:F;if(!Q)D.kill(D.pid,Y)}};this.#G=D.reallyExit,this.#_=D.emit}onExit(D,F){if(!O8(this.#D))return()=>{};if(this.#Q===!1)this.load();let B=F?.alwaysLast?"afterExit":"exit";return this.#B.on(B,D),()=>{if(this.#B.removeListener(B,D),this.#B.listeners.exit.length===0&&this.#B.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Q)return;this.#Q=!0,this.#B.count+=1;for(let D of QF)try{let F=this.#F[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#z(D,...F)},this.#D.reallyExit=(D)=>{return this.#$(D)}}unload(){if(!this.#Q)return;this.#Q=!1,QF.forEach((D)=>{let F=this.#F[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch(B){}}),this.#D.emit=this.#_,this.#D.reallyExit=this.#G,this.#B.count-=1}#$(D){if(!O8(this.#D))return 0;return this.#D.exitCode=D||0,this.#B.emit("exit",this.#D.exitCode,null),this.#G.call(this.#D,this.#D.exitCode)}#z(D,...F){let B=this.#_;if(D==="exit"&&O8(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let $=B.call(this.#D,D,...F);return this.#B.emit("exit",this.#D.exitCode,null),$}else return B.call(this.#D,D,...F)}};q6=globalThis.process,{onExit:t4,load:DK,unload:FK}=OH(O8(q6)?new r4(q6):new o4)});import b8 from"process";var DB,bH,FB;var BB=V(()=>{n4();e4();DB=b8.stderr.isTTY?b8.stderr:b8.stdout.isTTY?b8.stdout:void 0,bH=DB?i4(()=>{t4(()=>{DB.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},FB=bH});import $B from"process";var Z8=!1,oF,J6;var _B=V(()=>{BB();oF={};oF.show=(D=$B.stderr)=>{if(!D.isTTY)return;Z8=!1,D.write("\x1B[?25h")};oF.hide=(D=$B.stderr)=>{if(!D.isTTY)return;FB(),Z8=!0,D.write("\x1B[?25l")};oF.toggle=(D,F)=>{if(D!==void 0)Z8=D;if(Z8)oF.show(F);else oF.hide(F)};J6=oF});var QB=c0((XK,ZH)=>{ZH.exports={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"]},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"]},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","-"]},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 ","\u2764\uFE0F "]},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 "]}}});var X6=c0((WK,qB)=>{var R8=Object.assign({},QB()),YB=Object.keys(R8);Object.defineProperty(R8,"random",{get(){let D=Math.floor(Math.random()*YB.length),F=YB[D];return R8[F]}});qB.exports=R8});import m0 from"process";function W6(){if(m0.platform!=="win32")return m0.env.TERM!=="linux";return Boolean(m0.env.CI)||Boolean(m0.env.WT_SESSION)||Boolean(m0.env.TERMINUS_SUBLIME)||m0.env.ConEmuTask==="{cmd::Cmder}"||m0.env.TERM_PROGRAM==="Terminus-Sublime"||m0.env.TERM_PROGRAM==="vscode"||m0.env.TERM==="xterm-256color"||m0.env.TERM==="alacritty"||m0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var HB=()=>{};var RH,NH,SH,T3;var JB=V(()=>{$6();HB();RH={info:h0.blue("\u2139"),success:h0.green("\u2714"),warning:h0.yellow("\u26A0"),error:h0.red("\u2716")},NH={info:h0.blue("i"),success:h0.green("\u221A"),warning:h0.yellow("\u203C"),error:h0.red("\xD7")},SH=W6()?RH:NH,T3=SH});function G6({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}function v3(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(kH,"")}var kH;var z6=V(()=>{kH=G6()});function XB(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function WB(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function GB(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}var zB=()=>{};function IH(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function MB(D,{ambiguousAsWide:F=!1}={}){if(IH(D),WB(D)||GB(D)||F&&XB(D))return 2;return 1}var AB=V(()=>{zB()});var jB=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g};function M6(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:B=!0,countAnsiEscapeCodes:$=!1}=F;if(!$)D=v3(D);if(D.length===0)return 0;let _=0,Q={ambiguousAsWide:!B};for(let{segment:Y}of TH.segment(D)){let q=Y.codePointAt(0);if(q<=31||q>=127&&q<=159)continue;if(q>=8203&&q<=8207||q===65279)continue;if(q>=768&&q<=879||q>=6832&&q<=6911||q>=7616&&q<=7679||q>=8400&&q<=8447||q>=65056&&q<=65071)continue;if(q>=55296&&q<=57343)continue;if(q>=65024&&q<=65039)continue;if(vH.test(Y))continue;if(jB().test(Y)){_+=2;continue}_+=MB(q,Q)}return _}var TH,vH;var KB=V(()=>{z6();AB();TH=new Intl.Segmenter,vH=/^\p{Default_Ignorable_Code_Point}$/u});function A6({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import UB from"process";function j6(){let{env:D}=UB,{TERM:F,TERM_PROGRAM:B}=D;if(UB.platform!=="win32")return F!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||B==="Terminus-Sublime"||B==="vscode"||F==="xterm-256color"||F==="alacritty"||F==="rxvt-unicode"||F==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var VB=()=>{};import e0 from"process";class EB{#Y=0;start(){if(this.#Y++,this.#Y===1)this.#B()}stop(){if(this.#Y<=0)throw Error("`stop` called more times than `start`");if(this.#Y--,this.#Y===0)this.#D()}#B(){if(e0.platform==="win32"||!e0.stdin.isTTY)return;e0.stdin.setRawMode(!0),e0.stdin.on("data",this.#_),e0.stdin.resume()}#D(){if(!e0.stdin.isTTY)return;e0.stdin.off("data",this.#_),e0.stdin.pause(),e0.stdin.setRawMode(!1)}#_(D){if(D[0]===CH)e0.emit("SIGINT")}}var CH=3,uH,K6;var LB=V(()=>{uH=new EB,K6=uH});import N8 from"process";class wB{#Y=0;#B=!1;#D=0;#_=-1;#G=0;#F;#Q;#$;#z;#A;#J;#X;#W;#j;#q;#H;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#F={color:"cyan",stream:N8.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#F.color,this.spinner=this.#F.spinner,this.#A=this.#F.interval,this.#$=this.#F.stream,this.#J=typeof this.#F.isEnabled==="boolean"?this.#F.isEnabled:A6({stream:this.#$}),this.#X=typeof this.#F.isSilent==="boolean"?this.#F.isSilent:!1,this.text=this.#F.text,this.prefixText=this.#F.prefixText,this.suffixText=this.#F.suffixText,this.indent=this.#F.indent,N8.env.NODE_ENV==="test")this._stream=this.#$,this._isEnabled=this.#J,Object.defineProperty(this,"_linesToClear",{get(){return this.#Y},set(F){this.#Y=F}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#_}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#W}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#W=D,this.#M()}get interval(){return this.#A??this.#Q.interval??100}get spinner(){return this.#Q}set spinner(D){if(this.#_=-1,this.#A=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#Q=D}else if(!j6())this.#Q=C3.default.line;else if(D===void 0)this.#Q=C3.default.dots;else if(D!=="default"&&C3.default[D])this.#Q=C3.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#j}set text(D=""){this.#j=D,this.#M()}get prefixText(){return this.#q}set prefixText(D=""){this.#q=D,this.#M()}get suffixText(){return this.#H}set suffixText(D=""){this.#H=D,this.#M()}get isSpinning(){return this.#z!==void 0}#K(D=this.#q,F=" "){if(typeof D==="string"&&D!=="")return D+F;if(typeof D==="function")return D()+F;return""}#U(D=this.#H,F=" "){if(typeof D==="string"&&D!=="")return F+D;if(typeof D==="function")return F+D();return""}#M(){let D=this.#$.columns??80,F=this.#K(this.#q,"-"),B=this.#U(this.#H,"-"),$=" ".repeat(this.#W)+F+"--"+this.#j+"--"+B;this.#D=0;for(let _ of v3($).split(`
|
|
93
|
-
|
|
94
|
-
`);return this}if(this
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
128
|
+
`)+U,_=Q+1,Q=$.indexOf(`
|
|
129
|
+
`,_)}while(Q!==-1);return J+=$.slice(_),J}function rv($){return TM($)}var Aj,Oj,eJ,R0,nv,Fj,E0,SM=($,v={})=>{if(v.level&&!(Number.isInteger(v.level)&&v.level>=0&&v.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let U=Aj?Aj.level:0;$.level=v.level===void 0?U:v.level},TM=($)=>{let v=(...U)=>U.join(" ");return SM(v,$),Object.setPrototypeOf(v,rv.prototype),v},$Y=($,v,U,...Q)=>{if($==="rgb"){if(v==="ansi16m")return e4[U].ansi16m(...Q);if(v==="ansi256")return e4[U].ansi256(e4.rgbToAnsi256(...Q));return e4[U].ansi(e4.rgbToAnsi(...Q))}if($==="hex")return $Y("rgb",v,U,...e4.hexToRgb(...Q));return e4[U][$](...Q)},RM,EM,vY=($,v,U)=>{let Q,_;if(U===void 0)Q=$,_=v;else Q=U.openAll+$,_=v+U.closeAll;return{open:$,close:v,openAll:Q,closeAll:_,parent:U}},D8=($,v,U)=>{let Q=(..._)=>PM(Q,_.length===1?""+_[0]:_.join(" "));return Object.setPrototypeOf(Q,EM),Q[eJ]=$,Q[R0]=v,Q[nv]=U,Q},PM=($,v)=>{if($.level<=0||!v)return $[nv]?"":v;let U=$[R0];if(U===void 0)return v;let{openAll:Q,closeAll:_}=U;if(v.includes("\x1B"))while(U!==void 0)v=Lj(v,U.close,U.open),U=U.parent;let J=v.indexOf(`
|
|
130
|
+
`);if(J!==-1)v=kj(v,_,Q,J);return Q+v+_},xM,XP,Nj;var Sj=b(()=>{Zj();wj();({stdout:Aj,stderr:Oj}=Mj),eJ=Symbol("GENERATOR"),R0=Symbol("STYLER"),nv=Symbol("IS_EMPTY"),Fj=["ansi","ansi","ansi256","ansi16m"],E0=Object.create(null);Object.setPrototypeOf(rv.prototype,Function.prototype);for(let[$,v]of Object.entries(e4))E0[$]={get(){let U=D8(this,vY(v.open,v.close,this[R0]),this[nv]);return Object.defineProperty(this,$,{value:U}),U}};E0.visible={get(){let $=D8(this,this[R0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};RM=["rgb","hex","ansi256"];for(let $ of RM){E0[$]={get(){let{level:U}=this;return function(...Q){let _=vY($Y($,Fj[U],"color",...Q),e4.color.close,this[R0]);return D8(this,_,this[nv])}}};let v="bg"+$[0].toUpperCase()+$.slice(1);E0[v]={get(){let{level:U}=this;return function(...Q){let _=vY($Y($,Fj[U],"bgColor",...Q),e4.bgColor.close,this[R0]);return D8(this,_,this[nv])}}}}EM=Object.defineProperties(()=>{},{...E0,level:{enumerable:!0,get(){return this[eJ].level},set($){this[eJ].level=$}}});Object.defineProperties(rv.prototype,E0);xM=rv(),XP=rv({level:Oj?Oj.level:0}),Nj=xM});function _Y($,v,{ignoreNonConfigurable:U=!1}={}){let{name:Q}=$;for(let _ of Reflect.ownKeys(v))uM($,v,_,U);return CM($,v),hM($,v,Q),$}var uM=($,v,U,Q)=>{if(U==="length"||U==="prototype")return;if(U==="arguments"||U==="caller")return;let _=Object.getOwnPropertyDescriptor($,U),J=Object.getOwnPropertyDescriptor(v,U);if(!yM(_,J)&&Q)return;Object.defineProperty($,U,J)},yM=function($,v){return $===void 0||$.configurable||$.writable===v.writable&&$.enumerable===v.enumerable&&$.configurable===v.configurable&&($.writable||$.value===v.value)},CM=($,v)=>{let U=Object.getPrototypeOf(v);if(U===Object.getPrototypeOf($))return;Object.setPrototypeOf($,U)},fM=($,v)=>`/* Wrapped ${$}*/
|
|
131
|
+
${v}`,mM,gM,hM=($,v,U)=>{let Q=U===""?"":`with ${U.trim()}() `,_=fM.bind(null,Q,v.toString());Object.defineProperty(_,"name",gM);let{writable:J,enumerable:Y,configurable:z}=mM;Object.defineProperty($,"toString",{value:_,writable:J,enumerable:Y,configurable:z})};var Tj=b(()=>{mM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var V8,Rj=($,v={})=>{if(typeof $!=="function")throw TypeError("Expected a function");let U,Q=0,_=$.displayName||$.name||"<anonymous>",J=function(...Y){if(V8.set(J,++Q),Q===1)U=$.apply(this,Y),$=void 0;else if(v.throw===!0)throw Error(`Function \`${_}\` can only be called once`);return U};return _Y(J,$),V8.set(J,Q),J},Ej;var Pj=b(()=>{Tj();V8=new WeakMap;Rj.callCount=($)=>{if(!V8.has($))throw Error(`The given function \`${$.name}\` is not wrapped by the \`onetime\` package`);return V8.get($)};Ej=Rj});var A1;var xj=b(()=>{A1=[];A1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")A1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")A1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class uj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(QY[UY])return QY[UY];cM(QY,UY,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,v){this.listeners[$].push(v)}removeListener($,v){let U=this.listeners[$],Q=U.indexOf(v);if(Q===-1)return;if(Q===0&&U.length===1)U.length=0;else U.splice(Q,1)}emit($,v,U){if(this.emitted[$])return!1;this.emitted[$]=!0;let Q=!1;for(let _ of this.listeners[$])Q=_(v,U)===!0||Q;if($==="exit")Q=this.emit("afterExit",v,U)||Q;return Q}}class YY{}var M8=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",UY,QY,cM,lM=($)=>{return{onExit(v,U){return $.onExit(v,U)},load(){return $.load()},unload(){return $.unload()}}},yj,Cj,JY,fj,bP,BP;var mj=b(()=>{xj();UY=Symbol.for("signal-exit emitter"),QY=globalThis,cM=Object.defineProperty.bind(Object);yj=class yj extends YY{onExit(){return()=>{}}load(){}unload(){}};Cj=class Cj extends YY{#J=JY.platform==="win32"?"SIGINT":"SIGHUP";#U=new uj;#_;#$;#Q;#v={};#Y=!1;constructor($){super();this.#_=$,this.#v={};for(let v of A1)this.#v[v]=()=>{let U=this.#_.listeners(v),{count:Q}=this.#U,_=$;if(typeof _.__signal_exit_emitter__==="object"&&typeof _.__signal_exit_emitter__.count==="number")Q+=_.__signal_exit_emitter__.count;if(U.length===Q){this.unload();let J=this.#U.emit("exit",null,v),Y=v==="SIGHUP"?this.#J:v;if(!J)$.kill($.pid,Y)}};this.#Q=$.reallyExit,this.#$=$.emit}onExit($,v){if(!M8(this.#_))return()=>{};if(this.#Y===!1)this.load();let U=v?.alwaysLast?"afterExit":"exit";return this.#U.on(U,$),()=>{if(this.#U.removeListener(U,$),this.#U.listeners.exit.length===0&&this.#U.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#U.count+=1;for(let $ of A1)try{let v=this.#v[$];if(v)this.#_.on($,v)}catch(v){}this.#_.emit=($,...v)=>{return this.#G($,...v)},this.#_.reallyExit=($)=>{return this.#I($)}}unload(){if(!this.#Y)return;this.#Y=!1,A1.forEach(($)=>{let v=this.#v[$];if(!v)throw Error("Listener not defined for signal: "+$);try{this.#_.removeListener($,v)}catch(U){}}),this.#_.emit=this.#$,this.#_.reallyExit=this.#Q,this.#U.count-=1}#I($){if(!M8(this.#_))return 0;return this.#_.exitCode=$||0,this.#U.emit("exit",this.#_.exitCode,null),this.#Q.call(this.#_,this.#_.exitCode)}#G($,...v){let U=this.#$;if($==="exit"&&M8(this.#_)){if(typeof v[0]==="number")this.#_.exitCode=v[0];let Q=U.call(this.#_,$,...v);return this.#U.emit("exit",this.#_.exitCode,null),Q}else return U.call(this.#_,$,...v)}};JY=globalThis.process,{onExit:fj,load:bP,unload:BP}=lM(M8(JY)?new Cj(JY):new yj)});import w8 from"process";var gj,dM,hj;var cj=b(()=>{Pj();mj();gj=w8.stderr.isTTY?w8.stderr:w8.stdout.isTTY?w8.stdout:void 0,dM=gj?Ej(()=>{fj(()=>{gj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},hj=dM});import lj from"process";var L8=!1,P0,zY;var dj=b(()=>{cj();P0={};P0.show=($=lj.stderr)=>{if(!$.isTTY)return;L8=!1,$.write("\x1B[?25h")};P0.hide=($=lj.stderr)=>{if(!$.isTTY)return;hj(),L8=!0,$.write("\x1B[?25l")};P0.toggle=($,v)=>{if($!==void 0)L8=$;if(L8)P0.show(v);else P0.hide(v)};zY=P0});var IY;var pj=b(()=>{IY={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\uD83D\uDC97 "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","\xBA> ~~~~~~~~~~~~~~~~~","(\xBA> ~~~~~~~~~~~~~~~~","((\xBA> ~~~~~~~~~~~~~~~","<((\xBA> ~~~~~~~~~~~~~~","><((\xBA> ~~~~~~~~~~~~~"," ><((\xBA> ~~~~~~~~~~~~","~ ><((\xBA> ~~~~~~~~~~~","~~ <>((\xBA> ~~~~~~~~~~","~~~ ><((\xBA> ~~~~~~~~~","~~~~ <>((\xBA> ~~~~~~~~","~~~~~ ><((\xBA> ~~~~~~~","~~~~~~ <>((\xBA> ~~~~~~","~~~~~~~ ><((\xBA> ~~~~~","~~~~~~~~ <>((\xBA> ~~~~","~~~~~~~~~ ><((\xBA> ~~~","~~~~~~~~~~ <>((\xBA> ~~","~~~~~~~~~~~ ><((\xBA> ~","~~~~~~~~~~~~ <>((\xBA> ","~~~~~~~~~~~~~ ><((\xBA>","~~~~~~~~~~~~~~ <>((\xBA","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}}});var ov,NP;var ij=b(()=>{pj();ov=IY,NP=Object.keys(IY)});import iM from"tty";var nM,J$=($,v)=>{if(!nM)return(_)=>_;let U=`\x1B[${$}m`,Q=`\x1B[${v}m`;return(_)=>{let J=_+"",Y=J.indexOf(Q);if(Y===-1)return U+J+Q;let z=U,I=0,q=(v===22?Q:"")+U;while(Y!==-1)z+=J.slice(I,Y)+q,I=Y+Q.length,Y=J.indexOf(Q,I);return z+=J.slice(I)+Q,z}},RP,EP,PP,xP,uP,yP,CP,fP,mP,gP,nj,rj,oj,tj,hP,cP,lP,dP,pP,iP,nP,rP,oP,tP,aP,sP,eP,$x,vx,_x,Ux,Qx,Jx,Yx,zx,Ix,Xx,qx,Gx,jx,Kx;var XY=b(()=>{nM=iM?.WriteStream?.prototype?.hasColors?.()??!1,RP=J$(0,0),EP=J$(1,22),PP=J$(2,22),xP=J$(3,23),uP=J$(4,24),yP=J$(53,55),CP=J$(7,27),fP=J$(8,28),mP=J$(9,29),gP=J$(30,39),nj=J$(31,39),rj=J$(32,39),oj=J$(33,39),tj=J$(34,39),hP=J$(35,39),cP=J$(36,39),lP=J$(37,39),dP=J$(90,39),pP=J$(40,49),iP=J$(41,49),nP=J$(42,49),rP=J$(43,49),oP=J$(44,49),tP=J$(45,49),aP=J$(46,49),sP=J$(47,49),eP=J$(100,49),$x=J$(91,39),vx=J$(92,39),_x=J$(93,39),Ux=J$(94,39),Qx=J$(95,39),Jx=J$(96,39),Yx=J$(97,39),zx=J$(101,49),Ix=J$(102,49),Xx=J$(103,49),qx=J$(104,49),Gx=J$(105,49),jx=J$(106,49),Kx=J$(107,49)});var aj=b(()=>{XY();XY()});import sj from"process";function tv(){let{env:$}=sj,{TERM:v,TERM_PROGRAM:U}=$;if(sj.platform!=="win32")return v!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||U==="Terminus-Sublime"||U==="vscode"||v==="xterm-256color"||v==="alacritty"||v==="rxvt-unicode"||v==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qY=()=>{};var O1={};s$(O1,{warning:()=>aM,success:()=>tM,info:()=>oM,error:()=>sM});var k8,oM,tM,aM,sM;var ej=b(()=>{aj();qY();k8=tv(),oM=tj(k8?"\u2139":"i"),tM=rj(k8?"\u2714":"\u221A"),aM=oj(k8?"\u26A0":"\u203C"),sM=nj(k8?"\u2716":"\xD7")});var $K=b(()=>{ej()});function GY({onlyFirst:$=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",$?void 0:"g")}function jY($){if(typeof $!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(eM,"")}var eM;var vK=b(()=>{eM=GY()});var A8,O8,KY,HY,av;var _K=b(()=>{A8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],O8=[12288,12288,65281,65376,65504,65510],KY=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HY=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],av=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var F8=($,v)=>{let U=0,Q=Math.floor($.length/2)-1;while(U<=Q){let _=Math.floor((U+Q)/2),J=_*2;if(v<$[J])Q=_-1;else if(v>$[J+1])U=_+1;else return!0}return!1};function Iw($){let v=$[0],U=$[1];for(let Q=0;Q<$.length;Q+=2){let _=$[Q],J=$[Q+1];if(UK>=_&&UK<=J)return[_,J];if(J-_>U-v)v=_,U=J}return[v,U]}var $w,vw,_w,Uw,Nx,Sx,Tx,Rx,Qw,Jw,UK=19968,Yw,zw,QK=($)=>{if($<$w||$>vw)return!1;return F8(A8,$)},JK=($)=>{if($<_w||$>Uw)return!1;return F8(O8,$)},YK=($)=>{if($>=Yw&&$<=zw)return!0;if($<Qw||$>Jw)return!1;return F8(av,$)};var zK=b(()=>{_K();$w=A8[0],vw=A8.at(-1),_w=O8[0],Uw=O8.at(-1),Nx=KY[0],Sx=KY.at(-1),Tx=HY[0],Rx=HY.at(-1),Qw=av[0],Jw=av.at(-1),[Yw,zw]=Iw(av)});function Xw($){if(!Number.isSafeInteger($))throw TypeError(`Expected a code point, got \`${typeof $}\`.`)}function WY($,{ambiguousAsWide:v=!1}={}){if(Xw($),JK($)||YK($)||v&&QK($))return 2;return 1}var IK=b(()=>{zK()});function bw($){if($.length>50)return!1;if(Hw.test($))return!0;if($.includes("\u200D")){let v=$.match(Ww);return v!==null&&v.length>=2}return!1}function Bw($){return $.replace(jw,"")}function Zw($){return Gw.test($)}function Dw($,v){let U=0;if($.length>1){for(let Q of $.slice(1))if(Q>="\uFF00"&&Q<="\uFFEF")U+=WY(Q.codePointAt(0),v)}return U}function bY($,v={}){if(typeof $!=="string"||$.length===0)return 0;let{ambiguousIsNarrow:U=!0,countAnsiEscapeCodes:Q=!1}=v,_=$;if(!Q&&(_.includes("\x1B")||_.includes("\x9B")))_=jY(_);if(_.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(_))return _.length;let J=0,Y={ambiguousAsWide:!U};for(let{segment:z}of qw.segment(_)){if(Zw(z))continue;if(Kw.test(z)||bw(z)){J+=2;continue}let I=Bw(z).codePointAt(0);J+=WY(I,Y),J+=Dw(z,Y)}return J}var qw,Gw,jw,Kw,Hw,Ww;var XK=b(()=>{vK();IK();qw=new Intl.Segmenter,Gw=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,jw=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Kw=/^\p{RGI_Emoji}$/v,Hw=/^[\d#*]\u20E3$/,Ww=/\p{Extended_Pictographic}/gu});function BY({stream:$=process.stdout}={}){return Boolean($&&$.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import x0 from"process";class qK{#J=0;#U;#_=!1;#$=!1;#Q=($)=>{if(!$?.length)return;if((typeof $==="string"?$.codePointAt(0):$[0])===Vw)if(x0.listenerCount("SIGINT")>0)x0.emit("SIGINT");else x0.kill(x0.pid,"SIGINT")};start(){if(this.#J++,this.#J===1)this.#v()}stop(){if(this.#J===0)return;if(--this.#J===0)this.#Y()}#v(){let{stdin:$}=x0;if(x0.platform==="win32"||!$?.isTTY||typeof $.setRawMode!=="function"){this.#U=void 0;return}if(this.#U=$,this.#_=$.isPaused(),this.#$=Boolean($.isRaw),$.setRawMode(!0),$.prependListener("data",this.#Q),this.#_)$.resume()}#Y(){if(!this.#U)return;let $=this.#U;if($.off("data",this.#Q),$.isTTY)$.setRawMode?.(this.#$);if(this.#_)$.pause();this.#U=void 0,this.#_=!1,this.#$=!1}}var Vw=3,Mw,ZY;var GK=b(()=>{Mw=new qK,ZY=Object.freeze(Mw)});import sv from"process";import{stripVTControlCharacters as ww}from"util";class jK{#J=0;#U=-1;#_=0;#$;#Q;#v;#Y;#I=new Map;#G=!1;#X;#z;#j=!1;color;#q($){this.#G=!0;try{return $()}finally{this.#G=!1}}#H(){if(this.isSpinning)this.render()}#V($,v){if($===void 0||$===null)return"";if(typeof $==="string")return $;if(Buffer.isBuffer($)||ArrayBuffer.isView($)){let U=typeof v==="string"&&v&&v!=="buffer"?v:"utf8";return Buffer.from($).toString(U)}return String($)}#M($){if(!$)return!1;let v=$.at(-1);return v===`
|
|
132
|
+
`||v==="\r"}#w(){if(this.#z)return;if(this.#z=setTimeout(()=>{if(this.#z=void 0,this.isSpinning)this.#H()},Lw),typeof this.#z?.unref==="function")this.#z.unref()}#W(){if(this.#z)clearTimeout(this.#z),this.#z=void 0}#b($,v,U,Q){let _=this.#Z(U," "),Y=typeof v==="string"?($?" ":"")+v:"",z=this.#D(Q," ");return _+$+Y+z}constructor($){if(typeof $==="string")$={text:$};if(this.#$={color:"cyan",stream:sv.stderr,discardStdin:!0,hideCursor:!0,...$},this.color=this.#$.color,this.#v=this.#$.stream,typeof this.#$.isEnabled!=="boolean")this.#$.isEnabled=BY({stream:this.#v});if(typeof this.#$.isSilent!=="boolean")this.#$.isSilent=!1;let v=this.#$.interval;if(this.spinner=this.#$.spinner,this.#$.interval=v,this.text=this.#$.text,this.prefixText=this.#$.prefixText,this.suffixText=this.#$.suffixText,this.indent=this.#$.indent,sv.env.NODE_ENV==="test")this._stream=this.#v,this._isEnabled=this.#$.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set(U){this.#J=U}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#U}}),Object.defineProperty(this,"_lineCount",{get(){let U=this.#v.columns??80,Q=typeof this.#$.prefixText==="function"?"":this.#$.prefixText,_=typeof this.#$.suffixText==="function"?"":this.#$.suffixText,J=typeof Q==="string"&&Q!==""?Q+" ":"",Y=typeof _==="string"&&_!==""?" "+_:"",z="-",I=" ".repeat(this.#$.indent)+J+"-"+(typeof this.#$.text==="string"?" "+this.#$.text:"")+Y;return this.#K(I,U)}})}get indent(){return this.#$.indent}set indent($=0){if(!($>=0&&Number.isInteger($)))throw Error("The `indent` option must be an integer from 0 and up");this.#$.indent=$}get interval(){return this.#$.interval??this.#Q.interval??100}get spinner(){return this.#Q}set spinner($){if(this.#U=-1,this.#$.interval=void 0,typeof $==="object"){if(!Array.isArray($.frames)||$.frames.length===0||$.frames.some((v)=>typeof v!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if($.interval!==void 0&&!(Number.isInteger($.interval)&&$.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#Q=$}else if(!tv())this.#Q=ov.line;else if($===void 0)this.#Q=ov.dots;else if($!=="default"&&ov[$])this.#Q=ov[$];else throw Error(`There is no built-in spinner named '${$}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#$.text}set text($=""){this.#$.text=$}get prefixText(){return this.#$.prefixText}set prefixText($=""){this.#$.prefixText=$}get suffixText(){return this.#$.suffixText}set suffixText($=""){this.#$.suffixText=$}get isSpinning(){return this.#Y!==void 0}#B($,v,U=!1){let Q=typeof $==="function"?$():$;if(typeof Q==="string"&&Q!=="")return U?v+Q:Q+v;return""}#Z($=this.#$.prefixText,v=" "){return this.#B($,v,!1)}#D($=this.#$.suffixText,v=" "){return this.#B($,v,!0)}#K($,v){let U=0;for(let Q of ww($).split(`
|
|
133
|
+
`))U+=Math.max(1,Math.ceil(bY(Q)/v));return U}get isEnabled(){return this.#$.isEnabled&&!this.#$.isSilent}set isEnabled($){if(typeof $!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#$.isEnabled=$}get isSilent(){return this.#$.isSilent}set isSilent($){if(typeof $!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#$.isSilent=$}frame(){let $=Date.now();if(this.#U===-1||$-this.#_>=this.interval)this.#U=(this.#U+1)%this.#Q.frames.length,this.#_=$;let{frames:v}=this.#Q,U=v[this.#U];if(this.color)U=Nj[this.color](U);let Q=this.#Z(this.#$.prefixText," "),_=typeof this.text==="string"?" "+this.text:"",J=this.#D(this.#$.suffixText," ");return Q+U+_+J}clear(){if(!this.isEnabled||!this.#v.isTTY)return this;return this.#q(()=>{this.#v.cursorTo(0);for(let $=0;$<this.#J;$++){if($>0)this.#v.moveCursor(0,-1);this.#v.clearLine(1)}if(this.#$.indent)this.#v.cursorTo(this.#$.indent)}),this.#J=0,this}#L($){if(!$||this.#I.has($)||!$.isTTY||typeof $.write!=="function")return;if(N8.has($))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let v=$.write;this.#I.set($,v),N8.set($,this),$.write=(U,Q,_)=>this.#O($,v,U,Q,_)}#k(){if(!this.isEnabled||this.#I.size>0)return;let $=new Set([this.#v,sv.stdout,sv.stderr]);for(let v of $)this.#L(v)}#A(){for(let[$,v]of this.#I)if($.write=v,N8.get($)===this)N8.delete($);this.#I.clear()}#O($,v,U,Q,_){if(typeof Q==="function")_=Q,Q=void 0;if(this.#G)return v.call($,U,Q,_);this.clear();let J=this.#V(U,Q),Y=this.#M(J),z=v.call($,U,Q,_);if(Y)this.#W();else if(J.length>0)this.#w();if(this.isSpinning&&!this.#z)this.render();return z}render(){if(!this.isEnabled||this.#X||this.#z)return this;let $=this.#v.isTTY,v=!1;try{if($)this.#q(()=>this.#v.write(kw)),v=!0;this.clear();let U=this.frame(),Q=this.#v.columns??80,_=this.#K(U,Q),J=this.#v.rows;if(J&&J>1&&_>J){let z=U.split(`
|
|
134
|
+
`),I=J-1;U=[...z.slice(0,I),"... (content truncated to fit terminal)"].join(`
|
|
135
|
+
`)}if(this.#q(()=>this.#v.write(U))===!1&&this.#v.isTTY)this.#X=()=>{this.#X=void 0,this.#H()},this.#v.once("drain",this.#X);this.#J=this.#K(U,Q)}finally{if(v)this.#q(()=>this.#v.write(Aw))}return this}start($){if($)this.text=$;if(this.isSilent)return this;if(!this.isEnabled){let v=this.text?"-":"",U=" ".repeat(this.#$.indent)+this.#b(v,this.text,this.#$.prefixText,this.#$.suffixText);if(U.trim()!=="")this.#q(()=>this.#v.write(U+`
|
|
136
|
+
`));return this}if(this.isSpinning)return this;if(this.#$.hideCursor)zY.hide(this.#v);if(this.#$.discardStdin&&sv.stdin.isTTY)ZY.start(),this.#j=!0;return this.#k(),this.render(),this.#Y=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#Y),this.#Y=void 0,this.#U=-1,this.#_=0,this.#W(),this.#A(),this.#X)this.#v.removeListener("drain",this.#X),this.#X=void 0;if(this.isEnabled){if(this.clear(),this.#$.hideCursor)zY.show(this.#v)}if(this.#j)this.#j=!1,ZY.stop();return this}succeed($){return this.stopAndPersist({symbol:O1.success,text:$})}fail($){return this.stopAndPersist({symbol:O1.error,text:$})}warn($){return this.stopAndPersist({symbol:O1.warning,text:$})}info($){return this.stopAndPersist({symbol:O1.info,text:$})}stopAndPersist($={}){if(this.isSilent)return this;let v=$.symbol??" ",U=$.text??this.text,Q=$.prefixText??this.#$.prefixText,_=$.suffixText??this.#$.suffixText,J=this.#b(v,U,Q,_)+`
|
|
137
|
+
`;return this.stop(),this.#q(()=>this.#v.write(J)),this}}function DY($){return new jK($)}var Lw=200,kw="\x1B[?2026h",Aw="\x1B[?2026l",N8;var KK=b(()=>{Sj();dj();ij();$K();XK();qY();GK();N8=new Map});function D$($){let v=M1&&!$.quiet;return DY({text:$.text,isSilent:!v})}var $6=b(()=>{KK();pv()});function HK($){let[v=""]=$.split("-"),U=v.split("."),Q=parseInt(U[0]??"",10),_=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(_)||Number.isNaN(J))return null;return{major:Q,minor:_,patch:J}}function Ow($,v){let U=HK($),Q=HK(v);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}function WK($,v,U){if(!$)return{compatible:!0};let Q=Ow(v,$);if(Q===null)return{compatible:!0};if(Q>=0)return{compatible:!0};return{compatible:!1,required:$,installed:v,type:U}}function Fw($,v){let U=v.type==="opencode"?"OpenCode":"OCX CLI",Q=v.type==="opencode"?"Update OpenCode to the latest version":"bun update -g ocx";return`
|
|
138
|
+
${m.yellow().bold("\u26A0 WARN")} ${m.yellow("Version compatibility notice")}
|
|
139
|
+
|
|
140
|
+
Registry ${m.cyan(`"${$}"`)} requires ${U} ${m.green(v.required)}
|
|
141
|
+
You are running ${U} ${m.red(v.installed)}
|
|
100
142
|
|
|
101
143
|
This may work fine, but if you encounter issues,
|
|
102
|
-
consider updating: ${
|
|
144
|
+
consider updating: ${m.dim(Q)}
|
|
103
145
|
|
|
104
|
-
To silence: ${
|
|
105
|
-
`}function
|
|
146
|
+
To silence: ${m.dim("--skip-compat-check")} or set ${m.dim('"skipCompatCheck": true')} in ocx.jsonc
|
|
147
|
+
`}function bK($){let{registry:v,ocxVersion:U,opencodeVersion:Q}=$,_=[],J=WK(v.ocx,U,"ocx");if(!J.compatible)_.push(J);if(Q){let Y=WK(v.opencode,Q,"opencode");if(!Y.compatible)_.push(Y)}return _}function BK($,v){for(let U of v)W.log(Fw($,U))}var ZK=b(()=>{O6();i$()});import{randomUUID as DK}from"crypto";import{existsSync as l4}from"fs";import{lstat as Nw,mkdir as wY,rename as VY,rm as u0,stat as LK,writeFile as Sw}from"fs/promises";import{dirname as S8,isAbsolute as Tw,join as G4,relative as Rw,resolve as VK}from"path";function Ew($,v){if(!$?.installed)return null;for(let[U,Q]of Object.entries($.installed))if(Q.files?.some((_)=>_.path===v))return U;return null}function MK($){let v=$.split("::")[1];if(!v)return $;return v.split("@")[0]||$}function Pw($){if(!$?.trim())throw new M("Component name cannot be empty");let v=$.trim();if(Gj(v)){let U=qj(v);return{type:"npm",name:U.name,version:U.version}}if(v.includes("/")){let{namespace:U,component:Q}=o4(v);return{type:"registry",namespace:U,component:Q}}return{type:"registry",namespace:"",component:v}}function kK($){let v=$.command("add").description(`Add components or npm plugins to your project.
|
|
106
148
|
|
|
107
149
|
Registry components: ocx add alias/component
|
|
108
|
-
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)");
|
|
150
|
+
npm plugins: ocx add npm:package-name[@version]`).argument("<components...>","Components to install (alias/component or npm:package[@version])").option("--dry-run","Show what would be installed without making changes").option("--skip-compat-check","Skip version compatibility checks").option("--trust","Skip npm plugin validation (for packages that don't follow conventions)").option("-p, --profile <name>","Use specific profile").option("--from <url>","Use ephemeral registry (does not persist)");Q4(v),h4(v),K6(v),v.action(async(U,Q)=>{try{let _=Q.json?{...Q,quiet:!0,verbose:!1}:Q,J;if(_.profile){let Y=await j6.create(_.cwd??process.cwd(),{profile:_.profile});J={cwd:h$(_.profile),getRegistries:()=>Y.getRegistries(),getComponentPath:()=>Y.getComponentPath()}}else if(_.global)J=await L0.requireInitialized();else J=await f4.requireInitialized(_.cwd??process.cwd());await LY(U,_,J)}catch(_){_$(_,{json:Q.json})}})}async function LY($,v,U){let Q=U.cwd,_=$.map(Pw),J=_.filter((G)=>G.type==="npm"),Y=_.filter((G)=>G.type==="registry"),z=Boolean(v.json&&J.length>0&&Y.length>0),I=z?{...v,json:!1,quiet:!0,verbose:!1}:v,X,q;if(J.length>0)X=await xw(J,I,Q,!z);if(Y.length>0){let G=Y.map((j)=>j.namespace?`${j.namespace}/${j.component}`:j.component);q=await uw(G,I,U,!z)}if(z)F$({success:!0,plugins:X?.plugins??[],installed:q?.installed??[],opencode:q?.opencode??!1,dryRun:Boolean(X?.dryRun||q?.dryRun)})}async function xw($,v,U,Q=!0){let _=v.quiet?null:D$({text:"Validating npm packages..."});_?.start();try{let J=[];for(let H of $)if(await tJ(H.name),!v.trust)try{let Z=await H8(H.name,H.version),D=jj(Z);J.push(...D.warnings)}catch(Z){if(Z instanceof M)throw _?.fail("Plugin validation failed"),new M(`${Z.message}
|
|
109
151
|
hint OpenCode plugins must be ESM modules with an entry point
|
|
110
|
-
hint Use \`--trust\` to add anyway`);throw
|
|
111
|
-
Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let
|
|
112
|
-
When using --from, all components must use the same prefix.`)}let
|
|
113
|
-
`;if(
|
|
114
|
-
`}if(
|
|
115
|
-
`).map((Y)=>Y.trim()).filter(Boolean);_=_.filter((
|
|
152
|
+
hint Use \`--trust\` to add anyway`);throw Z}if(_?.succeed(`Validated ${$.length} npm package(s)`),J.length>0&&!v.quiet){W.info("");for(let H of J)W.warn(H)}let z=(await dJ(U))?.config.plugin??[],I=new Map;for(let H of z){let Z=Kj(H);I.set(Z,H)}let X=[],q=[];for(let H of $)if(I.get(H.name))q.push(H.name);else X.push(S0(H.name,H.version));if(q.length>0)throw new t$(`Plugin(s) already exist in opencode.json: ${q.join(", ")}.
|
|
153
|
+
Remove the existing entry manually or use 'ocx update' if it's an installed component.`);let G=[...I.values(),...X];if(v.dryRun){let Z={dryRun:!0,command:"add",wouldPerform:$.map((D)=>({action:"add",target:S0(D.name,D.version),details:{type:"npm plugin"}})),validation:{passed:!0},summary:`Would add ${$.length} npm plugin(s)`};if(Q||!v.json)T4(Z,{json:v.json,quiet:v.quiet});return{plugins:$.map((D)=>S0(D.name,D.version)),dryRun:!0}}if(await pJ(U,{plugin:G}),!v.quiet){W.info(""),W.success(`Added ${$.length} npm plugin(s) to opencode.json`);for(let H of $)W.info(` \u2713 ${S0(H.name,H.version)}`)}let j=$.map((H)=>S0(H.name,H.version));if(v.json&&Q)F$({success:!0,plugins:j});return{plugins:j,dryRun:!1}}catch(J){throw _?.fail("Failed to add npm plugins"),J}}async function uw($,v,U,Q=!0){let _=Boolean(v.quiet||v.json),J=U.cwd,Y=!!(v.global||v.profile),z=U.getRegistries(),I=z;if(v.from){let Z=v.from.trim();if(!Z)throw new M("--from URL cannot be empty");try{new URL(Z)}catch{throw new M(`Invalid --from URL: ${Z}`)}let D=new Set;for(let A of $){let{namespace:r}=o4(A);D.add(r)}if(D.size>1){let A=Array.from(D).join(", ");throw new M(`Mixed registry prefixes in --from call: ${A}.
|
|
154
|
+
When using --from, all components must use the same prefix.`)}let E=Array.from(D)[0];if(!E)throw new M("No valid component references provided");await r6(Z),I={...z,[E]:{url:Z}}}let X={version:1,root:J,installed:{}},q=await F4(J);if(q)X=q;let G=_?null:D$({text:"Resolving dependencies..."});G?.start();let j=null,H=null;try{let Z=new Set;for(let x of $){let{namespace:o}=o4(x);Z.add(o)}for(let x of Z){let o=I[x];if(o)await r6(o.url)}let D=await hG(I,$);if(v.verbose){W.info("Install order:");for(let x of D.installOrder)W.info(` - ${x}`)}let E=new Map,A=new Map;for(let x of D.components)if(!A.has(x.registryName))A.set(x.registryName,x.baseUrl);for(let[x,o]of A){let y=await r6(o);E.set(x,y)}if(G?.succeed(`Resolved ${D.components.length} components from ${E.size} registries`),!v.skipCompatCheck&&!_)for(let[x,o]of E){let y=bK({registry:{opencode:o.opencode,ocx:o.ocx},ocxVersion:Gq});BK(x,y)}if(v.dryRun){let x=D.components.map((y)=>({action:"add",target:`${y.registryName}/${y.name}`,details:{type:y.type}}));if(D.npmDependencies.length>0||D.npmDevDependencies.length>0){let y=v.global||v.profile?J:G4(J,".opencode"),I$=[...D.npmDependencies,...D.npmDevDependencies].map((v$)=>{let R$=v$.lastIndexOf("@"),X$=R$>0?v$.slice(0,R$):v$,j4=R$>0?v$.slice(R$+1):"*";return{name:X$,from:null,to:j4}});x.push(aG(y,I$))}let o={dryRun:!0,command:"add",wouldPerform:x,validation:{passed:!0},summary:`Would add ${D.components.length} component(s)`};if(Q||!v.json)T4(o,{json:v.json,quiet:v.quiet});return{installed:D.installOrder,opencode:Boolean(D.opencode),dryRun:!0}}let O=_?null:D$({text:"Fetching components..."});O?.start();let g=[];for(let x of D.components){let o=[];for(let v$ of x.files){let R$=await D1(x.baseUrl,x.name,v$.path);o.push({path:v$.path,content:Buffer.from(R$)})}let y=await b8(o);for(let v$ of x.files){let R$=H1(v$.target,Y,J),X$=G4(J,R$);try{O4(J,R$)}catch(j4){if(j4 instanceof U4)throw new M(`Invalid path "${X$}": ${j4.message}`);throw j4}}let h=Object.entries(X.installed).filter(([v$,R$])=>p$(R$.registryUrl)===p$(x.baseUrl)&&R$.registryName===x.registryName&&R$.name===x.name);if(h.length>0){let v$=h[0];if(v$){let[R$,X$]=v$;if(X$.hash!==y)throw O?.fail("Integrity check failed"),new X1(R$,X$.hash,y)}}let I$=Cv(x.baseUrl,x.registryName,x.name,`sha256:${y}`);g.push({component:x,files:o,computedHash:y,canonicalId:I$})}O?.succeed(`Fetched ${D.components.length} components`);let w=new Map;for(let{component:x,files:o}of g)for(let y of o){let h=x.files.find((R$)=>R$.path===y.path);if(!h)continue;let I$=H1(h.target,Y,J),v$=G4(J,I$);L1(w,{absolutePath:v$,relativePath:I$,content:y.content,source:`${x.registryName}/${x.name}:${h.path}`})}let N=[];for(let x of w.values()){if(!l4(x.absolutePath))continue;let o=await Bun.file(x.absolutePath).text(),y=x.content.toString("utf-8");if(!nJ(o,y)){let h=Ew(X,x.relativePath);N.push({path:x.relativePath,owningComponent:h})}}if(N.length>0){let x=N.filter((h)=>h.owningComponent!==null),o=N.filter((h)=>h.owningComponent===null);if(!_){if(W.error(""),W.error("File conflicts detected:"),x.length>0){W.error(""),W.error("Files from installed components (use 'ocx update' or 'ocx remove'):");for(let h of x)if(h.owningComponent){let I$=MK(h.owningComponent);W.error(` \u2717 ${h.path} (from ${I$})`)}}if(o.length>0){W.error(""),W.error("Files not managed by OCX (resolve manually):");for(let h of o)W.error(` \u2717 ${h.path}`)}W.error("")}let y=`${N.length} file(s) have conflicts.
|
|
155
|
+
`;if(x.length>0){let h=new Set(x.filter((I$)=>I$.owningComponent!==null).map((I$)=>MK(I$.owningComponent)));y+=`For OCX-managed files, use 'ocx update ${Array.from(h).join(" ")}' or 'ocx remove ${Array.from(h).join(" ")}'.
|
|
156
|
+
`}if(o.length>0)y+="For unmanaged files, resolve conflicts manually by renaming or removing them.";throw new t$(y.trim())}let L=_?null:D$({text:"Installing components..."});L?.start(),H=await gw({cwd:J,isFlattened:Y,trackOpencodeConfig:Boolean(D.opencode&&Object.keys(D.opencode).length>0),trackNpmManifests:D.npmDependencies.length>0||D.npmDevDependencies.length>0,quiet:v.quiet});let U$=hw({quiet:v.quiet});j=U$;for(let{component:x,files:o,computedHash:y,canonicalId:h}of g){let I$=await cw(x,o,J,Y,U$,{verbose:v.verbose});if(v.verbose){for(let X$ of I$.skipped)W.info(` \u25CB Skipped ${X$} (unchanged)`);for(let X$ of I$.overwritten)W.info(` \u2713 Overwrote ${X$}`);for(let X$ of I$.written)W.info(` \u2713 Wrote ${X$}`)}if(!E.get(x.registryName))throw new M(`Registry index not found for "${x.registryName}". This is an internal error - please report it at https://github.com/${qq}/issues`);let R$=[];for(let X$ of o){let j4=x.files.find((E1)=>E1.path===X$.path);if(!j4)throw Error(`File ${X$.path} not found in component manifest`);let e8=H1(j4.target,Y,J);R$.push({path:e8,hash:k1(X$.content)})}X.installed[h]={registryUrl:x.baseUrl,registryName:x.registryName,name:x.name,revision:`sha256:${y}`,hash:y,files:R$,installedAt:new Date().toISOString(),...x.opencode&&{opencode:x.opencode}}}if(L?.succeed(`Installed ${D.components.length} components`),D.opencode&&Object.keys(D.opencode).length>0){let x=await pJ(J,D.opencode);if(!v.quiet&&x.changed)if(x.created)W.info(`Created ${x.path}`);else W.info(`Updated ${x.path}`)}let $$=D.npmDependencies.length>0,a=D.npmDevDependencies.length>0,V$=v.global||v.profile?G4(J,"package.json"):G4(J,".opencode/package.json");if($$||a){let x=_?null:D$({text:`Updating ${V$}...`});x?.start();try{let o=!!(v.global||v.profile),y=await rw(J,D.npmDependencies,D.npmDevDependencies,{isFlattened:o}),h=D.npmDependencies.length+D.npmDevDependencies.length;if(x?.succeed(`Added ${h} dependencies to ${V$}`),y.changed){let I$=await sG(y.packageDir);if(I$.success&&I$.action!=="none"){if(!_)W.info(`Invalidated ${G4(y.packageDir,"node_modules")} to force reinstall`)}else if(!I$.success){let v$=G4(y.packageDir,"node_modules");W.warn(`Could not invalidate ${v$}: ${I$.error?.message??"unknown error"}. Run \`rm -rf "${v$}"\` manually to force reinstall.`)}}}catch(o){throw x?.fail(`Failed to update ${V$}`),o}}if(await y4(J,X),!j)throw Error("Internal error: missing add write transaction after install phase.");if(await j.commit(),j=null,H?.commit(),H=null,v.json&&Q)F$({success:!0,installed:D.installOrder,opencode:!!D.opencode});else if(!v.quiet)W.info(""),W.success(`Done! Installed ${D.components.length} components.`);return{installed:D.installOrder,opencode:!!D.opencode,dryRun:!1}}catch(Z){if(j)await j.rollback(),j=null;if(H)await H.rollback(),H=null;if(G&&!G.isSpinning);else G?.fail("Failed to add components");throw Z}}function MY($,v,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${v}" (${Q})`}function yw($,v){let U=Rw(v,$);return U!==""&&!U.startsWith("..")&&!Tw(U)}async function Cw($,v){let U=VK($),Q=VK(v);while(yw(U,Q)){let _=!0;try{if(!(await Nw(U)).isDirectory())break}catch(Y){if(Y.code==="ENOENT")_=!1;else throw Y}try{if(_)await u0(U,{recursive:!1})}catch(Y){let z=Y.code;if(z==="ENOENT");else if(z==="ENOTEMPTY"||z==="EEXIST"||z==="EBUSY")break;else if(z==="ENOTDIR")break;else throw Y}let J=S8(U);if(J===U)break;U=J}}async function fw($){let v;try{v=await LK($)}catch(U){let Q=U.code;if(Q==="ENOENT"||Q==="ENOTDIR")return{path:$,state:"missing",content:""};throw U}if(!v.isFile())return{path:$,state:"non-file",content:""};return{path:$,state:"file",content:await Bun.file($).text()}}async function mw($,v){if($.state==="file"){await wY(S8($.path),{recursive:!0}),await Bun.write($.path,$.content);return}if($.state==="non-file")return;if(l4($.path))await u0($.path,{force:!0,recursive:!0});await Cw(S8($.path),v)}async function gw($){let v=[],U=new Set,Q=!1,_=async(z)=>{if(U.has(z))return;U.add(z),v.push(await fw(z))};if($.trackOpencodeConfig){let z=K8($.cwd).path;await _(z)}if($.trackNpmManifests){let z=$.isFlattened?$.cwd:G4($.cwd,".opencode");if(await _(G4(z,"package.json")),!$.isFlattened)await _(G4(z,".gitignore"))}return await _(d6($.cwd).path),{rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of[...v].reverse())try{await mw(I,$.cwd)}catch(X){z.push(MY("Add rollback cleanup warning: failed to restore",I.path,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:()=>{Q=!0}}}function hw($){let v=[],U=new Set,Q=!1;return{writeFileAtomically:async({targetPath:z,resolvedTarget:I,content:X})=>{let q=S8(z);if(!l4(q))await wY(q,{recursive:!0});if(l4(z)){if((await LK(z)).isDirectory())throw new M(`Cannot install "${I}": target path is a directory.`)}let G=`${z}.ocx-add-tmp-${DK()}`;await Sw(G,X),U.add(G);let j=null;if(l4(z))j=`${z}.ocx-add-backup-${DK()}`,await VY(z,j),v.push({targetPath:z,backupPath:j});if(await VY(G,z),U.delete(G),!j)v.push({targetPath:z,backupPath:null})},rollback:async()=>{if(Q)return;Q=!0;let z=[];for(let I of U)try{await u0(I,{force:!0})}catch(X){z.push(MY("Add rollback cleanup warning: failed to remove temp file",I,X))}for(let I of[...v].reverse())try{if(I.backupPath){if(l4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0});if(l4(I.backupPath))await VY(I.backupPath,I.targetPath)}else if(l4(I.targetPath))await u0(I.targetPath,{force:!0,recursive:!0})}catch(X){z.push(MY("Add rollback cleanup warning: failed to restore target",I.targetPath,X))}if(!$.quiet)for(let I of z)W.warn(I)},commit:async()=>{if(Q)return;Q=!0;for(let z of v){if(!z.backupPath||!l4(z.backupPath))continue;try{await u0(z.backupPath,{force:!0})}catch(I){if(!$.quiet){let X=I instanceof Error?I.message:String(I);W.warn(`Post-add cleanup warning: failed to remove backup "${z.backupPath}" (${X})`)}}}}}}async function cw($,v,U,Q,_,J){let Y={written:[],skipped:[],overwritten:[]};for(let z of v){let I=$.files.find((G)=>G.path===z.path);if(!I)continue;let X=H1(I.target,Q,U),q=G4(U,X);if(l4(q)){let G=await Bun.file(q).text(),j=z.content.toString("utf-8");if(nJ(G,j)){Y.skipped.push(X);continue}Y.overwritten.push(X)}else Y.written.push(X);await _.writeFileAtomically({targetPath:q,resolvedTarget:X,content:z.content})}return Y}function wK($){if(!$?.trim())throw new M(`Invalid npm dependency: expected non-empty string, got "${$}"`);let v=$.trim(),U=v.lastIndexOf("@");if(U>0){let Q=v.slice(0,U),_=v.slice(U+1);if(!_)throw new M(`Invalid npm dependency: missing version after @ in "${$}"`);return{name:Q,version:_}}return{name:v,version:"*"}}function dw($,v){let U={...$.dependencies};for(let Q of v)U[Q.name]=Q.version;return{...$,dependencies:U}}function pw($,v){let U={...$.devDependencies};for(let Q of v)U[Q.name]=Q.version;return{...$,devDependencies:U}}async function iw($){let v=G4($,"package.json");if(!l4(v))return{...lw};try{let U=await Bun.file(v).text();return JSON.parse(U)}catch(U){let Q=U instanceof Error?U.message:String(U);throw new d(`Invalid ${v}: ${Q}`)}}async function nw($){let v=G4($,".gitignore"),U=new Set(["package.json","bun.lock"]),Q=["node_modules"],_=[];if(l4(v))_=(await Bun.file(v).text()).split(`
|
|
157
|
+
`).map((Y)=>Y.trim()).filter(Boolean);_=_.filter((J)=>!U.has(J));for(let J of Q)if(!_.includes(J))_.push(J);await Bun.write(v,`${_.join(`
|
|
116
158
|
`)}
|
|
117
|
-
`)}async function
|
|
118
|
-
A package cannot be in both fields. Remove from one list manually before adding.`);let
|
|
119
|
-
`);let
|
|
120
|
-
Run 'ocx init --global' first.`)}else{let
|
|
159
|
+
`)}async function rw($,v,U,Q={}){let _=Q.isFlattened?$:G4($,".opencode");if(v.length===0&&U.length===0)return{changed:!1,packageDir:_,delta:[]};await wY(_,{recursive:!0});let J=v.map(wK),Y=U.map(wK),z=new Set(J.map((Z)=>Z.name)),I=Y.filter((Z)=>z.has(Z.name));if(I.length>0)throw new t$(`Package(s) appear in both dependencies and devDependencies: ${I.map((Z)=>Z.name).join(", ")}.
|
|
160
|
+
A package cannot be in both fields. Remove from one list manually before adding.`);let X=await iw(_),q={...X.dependencies,...X.devDependencies},G=X;G=dw(G,J),G=pw(G,Y),await Bun.write(G4(_,"package.json"),`${JSON.stringify(G,null,2)}
|
|
161
|
+
`);let j={...G.dependencies,...G.devDependencies},H=tG(q,j);if(!Q.isFlattened)await nw(_);return{changed:H.changed,packageDir:_,delta:H.entries}}var lw;var kY=b(()=>{k0();cv();i_();Z4();V1();cG();X4();t4();iJ();eG();w1();z$();l$();i$();aJ();q1();i6();W8();T0();s4();$6();ZK();lw={name:"opencode-plugins",private:!0,type:"module"}});import{join as ow,posix as tw}from"path";function aw($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}async function AK($){let v=Bun.file(`${$}/registry.jsonc`),U=Bun.file(`${$}/registry.json`),Q=await v.exists(),_=await U.exists();if(!Q&&!_)return{success:!1,error:"No registry.jsonc or registry.json found in source directory",errorKind:"not_found"};let J=Q?v:U,Y=Q?"registry.jsonc":"registry.json",z=await J.text(),I=[],X=E$(z,I,{allowTrailingComma:!0});if(I.length>0){let q=aw(I);return{success:!1,error:`Invalid JSONC in ${Y}: ${q}`,errorKind:"parse_error"}}return{success:!0,data:X}}function OK($,v){let U=Z0($);if(U)return{valid:!1,errors:[`Schema compatibility issue: ${U.issue} - ${U.remediation}`]};return sw($,v)}function sw($,v){let U=K1.safeParse($);if(!U.success)return{valid:!1,errors:U.error.issues.map((_)=>`${_.path.join(".")}: ${_.message}`)};return{valid:!0,errors:[],data:U.data}}async function ew($,v){let U=[];for(let Q of $.components)for(let _ of Q.files){let J=h6(_,Q.type),Y=ow(v,"files",J.path);if(!await Bun.file(Y).exists())U.push(`${Q.name}: Source file not found at ${J.path}`)}return{valid:U.length===0,errors:U}}function $L($){let v=[],U=new Map($.components.map((J)=>[J.name,J]));function Q(J,Y,z,I){if(Y.has(J))return[...I,J].join(" -> ");if(z.has(J))return null;let X=U.get(J);if(!X)return null;Y.add(J),I.push(J);for(let q of X.dependencies){if(q.includes("/"))continue;let G=Q(q,Y,z,I);if(G)return G}return Y.delete(J),z.add(J),I.pop(),null}let _=new Set;for(let J of $.components){if(_.has(J.name))continue;let Y=Q(J.name,new Set,_,[]);if(Y){v.push(`Circular dependency detected: ${Y}`);break}}return{valid:v.length===0,errors:v}}function vL($){let v=[],U=new Map,Q=(_)=>{let Y=_.normalize("NFC").replace(/\\/g,"/");return tw.normalize(Y).replace(/^\.\//,"")};for(let _ of $.components)for(let J of _.files){let Y=h6(J,_.type),z=Q(Y.target),I=U.get(z);if(I)v.push(`Duplicate target "${z}" in components "${I.componentName}" and "${_.name}"`);else U.set(z,{componentName:_.name})}return{valid:v.length===0,errors:v}}async function*FK($,v,U={}){let Q=await ew($,v);for(let J of Q.errors)yield J;let _=$L($);for(let J of _.errors)yield J;if(!U.skipDuplicateTargets){let J=vL($);for(let Y of J.errors)yield Y}}var NK=b(()=>{E4();t4()});async function T8($,v={}){let U=await AK($);if(!U.success)return{success:!1,errors:[U.error||"Failed to load registry"],failureType:"load",loadErrorKind:U.errorKind};let Q=OK(U.data,$);if(!Q.valid)return{success:!1,errors:Q.errors,failureType:"schema"};let _=Q.data;if(!_)throw Error("Registry validation succeeded but returned no parsed data");let J=[];for await(let Y of FK(_,$,v))J.push(Y);if(J.length>0)return{success:!1,errors:J,failureType:"rules"};return{success:!0,errors:[],registry:_}}var AY=b(()=>{NK()});function OY($){return{file:$.filter((v)=>v.includes("Source file not found")),circular:$.filter((v)=>v.includes("Circular dependency")),duplicate:$.filter((v)=>v.includes("Duplicate target"))}}function ev($,v={}){let U=OY($),Q=v.schemaErrors??0,_=$.length,J=Math.max(0,_-Q-U.file.length-U.circular.length-U.duplicate.length);return{valid:_===0,totalErrors:_,schemaErrors:Q,sourceFileErrors:U.file.length,circularDependencyErrors:U.circular.length,duplicateTargetErrors:U.duplicate.length,otherErrors:J}}import{relative as _L,resolve as SK}from"path";function UL($,v){if(v==="not_found")return new B$($);if(v==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function QL($,v){let U=ev($,{schemaErrors:v==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new I1(Q)}function JL($,v){if(v==="schema"){W.error("\u2717 Registry schema");for(let Q of $)console.log(m.red(` ${Q}`));return}let U=OY($);if(U.file.length>0){W.error("\u2717 Source files");for(let Q of U.file)console.log(m.red(` ${Q}`))}if(U.circular.length>0){W.error("\u2717 Circular dependencies");for(let Q of U.circular)console.log(m.red(` ${Q}`))}if(U.duplicate.length>0){W.error("\u2717 Duplicate targets");for(let Q of U.duplicate)console.log(m.red(` ${Q}`))}}function TK($){$.command("build").description("Build a registry from source (for registry authors)").argument("[path]","Registry source directory",".").option("--out <dir>","Output directory","./dist").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--dry-run","Validate and show what would be built").option("--show-validation","Display validation results before building",!1).action(async(v,U)=>{try{let Q=SK(U.cwd,v),_=SK(U.cwd,U.out);if(U.showValidation){let I=!U.json&&!U.quiet;if(I)W.info("Running validation checks...");let X=await T8(Q,{skipDuplicateTargets:!1});if(!X.success){let[q="Registry validation failed"]=X.errors;if(X.failureType==="load")throw UL(q,X.loadErrorKind);let G=X.failureType==="schema"?"schema":"rules",j=QL(X.errors,G);if(U.json)throw j;if(!U.quiet)JL(X.errors,G);process.exit(j.exitCode)}if(I)W.success("\u2713 Schema compatibility and structure"),W.success("\u2713 Source files"),W.success("\u2713 No circular dependencies"),W.success("\u2713 No duplicate targets"),console.log("")}let J=D$({text:"Building registry...",quiet:U.quiet||U.json});if(!U.json)J.start();let Y=await uv({source:Q,out:_,dryRun:U.dryRun});if("dryRun"in Y&&Y.dryRun){if(!U.json)J.stop();T4(Y,{json:U.json,quiet:U.quiet});return}let z=Y;if(!U.json){let I=`Built ${z.componentsCount} components to ${_L(U.cwd,_)}`;if(J.succeed(I),!process.stdout.isTTY)W.success(`Built ${z.componentsCount} components`)}if(U.json)F$({success:!0,data:{components:z.componentsCount,output:z.outputPath}})}catch(Q){if(Q instanceof X6){if(U.json)_$(Q,{json:!0});if(!U.quiet){W.error(Q.message);for(let _ of Q.errors)console.log(m.red(` ${_}`))}process.exit(1)}_$(Q,{json:U.json})}})}var RK=b(()=>{O6();r_();AY();w1();z$();l$();i$();$6()});import{existsSync as EK}from"fs";import{mkdir as YL}from"fs/promises";import{join as FY}from"path";function PK($){$.command("edit").description("Open configuration file in editor").option("-g, --global","Edit global ocx.jsonc").option("-p, --profile <name>","Edit specific profile's config").action(async(v)=>{try{await zL(v)}catch(U){_$(U)}})}async function zL($){if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");let v;if($.profile){let J=q6.safeParse($.profile);if(!J.success)throw new M(`Invalid profile name "${$.profile}": ${J.error.issues[0]?.message??"Invalid name"}`);if(await c$.requireInitialized(),!await c$.create().exists($.profile))throw new m$($.profile);v=B4($.profile)}else if($.global){if(v=O0(),!EK(v))throw new d(`Global config not found at ${v}.
|
|
162
|
+
Run 'ocx init --global' first.`)}else{let J=A6(process.cwd());if(J)v=FY(J,a4);else{let Y=FY(process.cwd(),W1);if(await YL(Y,{recursive:!0}),v=FY(Y,a4),!EK(v)){let z={$schema:"https://ocx.kdco.dev/schemas/ocx.json",registries:{}};await Bun.write(v,JSON.stringify(z,null,2)),W.info(`Created ${v}`)}}}let U=process.env.EDITOR||process.env.VISUAL||"vi",_=await Bun.spawn([U,v],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;if(_!==0)throw Error(`Editor exited with code ${_}`)}var xK=b(()=>{G6();Z4();Q8();z$();l$();i$()});function uK($){$.command("show").description("Display resolved configuration for current directory").addOption(g4.json()).option("--origin","Show where each setting came from").option("-p, --profile <name>","Use specific profile").action(async(v)=>{try{await IL(v)}catch(U){_$(U,{json:v.json})}})}async function IL($){let v=await j6.create(process.cwd(),{profile:$.profile});if($.origin){let Q=v.resolveWithOrigin();if($.json){let J={};for(let[Y,z]of Q.origins)J[Y]=z;console.log(JSON.stringify({...Q,origins:J},null,2));return}if(console.log(m.bold("Resolved Configuration")),console.log(),Q.profileName){let J=Q.origins.get("profileName");if(console.log(`${m.cyan("Profile:")} ${Q.profileName}`),J)console.log(` ${m.dim(`\u2190 ${J.source}`)}`)}console.log(),console.log(m.cyan("Component Path:"),Q.componentPath);let _=Q.origins.get("componentPath");if(_)console.log(` ${m.dim(`\u2190 ${_.source} (${_.path})`)}`);console.log(),console.log(m.cyan("Registries:"));for(let[J,Y]of Object.entries(Q.registries)){console.log(` ${m.green(J)}: ${Y.url}`);let z=Q.origins.get(`registries.${J}`);if(z)console.log(` ${m.dim(`\u2190 ${z.source} (${z.path})`)}`)}if(Q.instructions.length>0){console.log(),console.log(m.cyan("Instructions:"));for(let J of Q.instructions)console.log(` ${J}`)}if(Object.keys(Q.opencode).length>0){console.log(),console.log(m.cyan("OpenCode Config:"));for(let J of Object.keys(Q.opencode)){let Y=Q.origins.get(`opencode.${J}`);if(console.log(` ${J}:`,JSON.stringify(Q.opencode[J])),Y)console.log(` ${m.dim(`\u2190 ${Y.source} (${Y.path})`)}`)}}return}let U=v.resolve();if($.json){console.log(JSON.stringify(U,null,2));return}if(console.log(m.bold("Resolved Configuration")),console.log(),U.profileName)console.log(`${m.cyan("Profile:")} ${U.profileName}`);if(console.log(`${m.cyan("Component Path:")} ${U.componentPath}`),console.log(),console.log(m.cyan("Registries:")),Object.keys(U.registries).length===0)console.log(" (none)");else for(let[Q,_]of Object.entries(U.registries))console.log(` ${m.green(Q)}: ${_.url}`);if(U.instructions.length>0){console.log(),console.log(m.cyan("Instructions:"));for(let Q of U.instructions)console.log(` ${Q}`)}}var yK=b(()=>{O6();cv();l$();s4()});function CK($){let v=$.command("config").description("View and edit configuration");uK(v),PK(v)}var fK=b(()=>{xK();yK()});import{existsSync as F1}from"fs";import{cp as XL,mkdir as y0,readdir as mK,readFile as qL,rm as GL,writeFile as NY}from"fs/promises";import{dirname as gK,join as R8}from"path";function hK($){let v=$.command("init").description("Initialize OCX configuration in your project");Q4(v),h4(v),K6(v),v.option("--registry <path>","Scaffold a new OCX registry project at path").option("--namespace <name>","Registry namespace (e.g., my-org)").option("--author <name>","Author name for the registry").option("--canary","Use canary (main branch) instead of latest release").option("--local <path>","Use local template directory instead of fetching").action(async(U)=>{try{if(U.registry)await bL(U.registry,U);else if(U.global)await WL(U);else await HL(U)}catch(Q){_$(Q,{json:U.json})}})}async function HL($){let v=$.cwd??process.cwd(),{path:U,exists:Q}=p6(v);if(Q)throw new t$(`ocx.jsonc already exists at ${U}
|
|
121
163
|
|
|
122
164
|
To reset, delete the config and run init again:
|
|
123
|
-
rm ${
|
|
165
|
+
rm ${U} && ocx init`);let _=$.quiet?null:D$({text:"Initializing OCX..."});_?.start();try{let J={$schema:jJ,registries:{}},Y=c6.parse(J);await y0(gK(U),{recursive:!0});let z=JSON.stringify(Y,null,2);await NY(U,z,"utf-8");let I=await dG(v);if(_?.succeed("Initialized OCX configuration"),$.json)console.log(JSON.stringify({success:!0,path:U,opencodePath:I.path,opencodeCreated:I.created}));else if(!$.quiet){if(W.info(`Created ${U}`),I.created)W.info(`Created ${I.path}`);W.info(""),W.info("Next steps:"),W.info(" 1. Add a registry: ocx registry add <url>"),W.info(" 2. Install components: ocx add <component>")}}catch(J){throw _?.fail("Failed to initialize"),J}}async function WL($){let v=$.quiet?null:D$({text:"Initializing global profiles..."});v?.start();try{let U=[],Q=[],_=O0();if(F1(_))Q.push("globalConfig");else await y0(gK(_),{recursive:!0,mode:448}),await A0(_,{$schema:jJ,registries:{}}),U.push("globalConfig");let J=L6();if(!F1(J))await y0(J,{recursive:!0,mode:448});let Y=h$("default");if(!F1(Y))await y0(Y,{recursive:!0,mode:448});let z=B4("default");if(F1(z))Q.push("profileOcx");else await A0(z,bG),U.push("profileOcx");let I=k6("default");if(F1(I))Q.push("profileOpencode");else await A0(I,{}),U.push("profileOpencode");let X=b1("default");if(F1(X))Q.push("profileAgents");else await Bun.write(X,`# Profile Instructions
|
|
124
166
|
|
|
125
167
|
<!-- Add your custom instructions for this profile here -->
|
|
126
168
|
<!-- These will be included when running \`ocx opencode -p default\` -->
|
|
127
|
-
`,{mode:384}),
|
|
128
|
-
"$schema": "${T0}",`);await N6(_,Q)}}var wJ="kdcokenny/ocx",OJ="examples/registry-starter";var eB=V(()=>{a3();Q8();o0();Q0();eD();n1();$D();yD();hD();x0();g0()});function vJ(D,F,B){let $=D.indexOf("/");if($===-1)throw Error(`Invalid legacy key: "${D}". Expected format: alias/component`);let _=D.slice(0,$),Q=D.slice($+1);if(!_||!Q)throw Error(`Invalid legacy key: "${D}". Both alias and component are required.`);let Y=L3(B,_,Q,F.version),q={registryUrl:B,registryName:_,name:Q,revision:F.version,hash:F.hash,files:F.files.map((H)=>({path:H,hash:""})),installedAt:F.installedAt,...F.updatedAt&&{updatedAt:F.updatedAt},owner:{type:"user"}};return[Y,q]}function T8(D,F,B){let $={},_=[],Q=Object.keys(D.installed).sort();for(let q of Q){let H=D.installed[q];if(!H)continue;let J=F.registries[H.registry];if(!J)throw new c(`Registry "${H.registry}" referenced in lock key "${q}" is not configured in ocx.jsonc. Add it before migrating.`);let[X,z]=vJ(q,H,J.url);$[X]=z,_.push({legacyKey:q,canonicalId:X,name:z.name,registryName:z.registryName})}return{receipt:{version:1,...B&&{root:B},installed:$},components:_}}function D5(D){let F=D.registries;if(!F||typeof F!=="object"||Array.isArray(F))return[];let B=[],$=F;for(let _ of Object.keys($).sort()){let Q=$[_];if(!Q||typeof Q!=="object"||Array.isArray(Q))continue;let Y=Q;for(let q of CJ)if(q in Y)B.push({registry:_,field:q,action:"remove_deprecated"})}return B}var CJ;var F5=V(()=>{eD();$D();CJ=["version"]});import{existsSync as S6,readdirSync as uJ,readFileSync as Q5,statSync as PJ}from"fs";import{rename as v8,writeFile as yJ}from"fs/promises";import{join as B5}from"path";function Y5(D){D.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(F)=>{try{await fJ(F)}catch(B){t(B,{json:F.json})}})}async function fJ(D){if(D.global){await hJ(D);return}await rJ(D,"local",FX(D),!1)}async function hJ(D){let F=D.cwd??W0(),B=mJ(F);if(!D.apply){let Y=[],q=new Set;for(let{label:X,path:z}of B){let M=N2(z),A=xF(z,{isFlattened:!0});if(M.exists&&A.exists)q.add(X);try{let K=await gJ(z,!0,{emitWarnings:!D.json&&!D.quiet});Y.push({...K,target:X})}catch(K){let j=_5(X,K);if(Y.push(j),!D.json&&!D.quiet)W.error(`[global:${X}] Preview failed: ${j.error}`)}}let H=$5(Y,"global",!1),J=cJ(H);if(D.json){if(eF(H,!1),J)process.exit(1);return}if(!D.quiet)tJ(Y,H,q);if(J)process.exit(1);return}let $=[],_=!1;for(let{label:Y,path:q}of B)try{let H=await dJ(q,!0);$.push({...H,target:Y})}catch(H){_=!0;let J=_5(Y,H);if($.push(J),!D.json&&!D.quiet)W.error(`[global:${Y}] Migration failed: ${J.error}`)}let Q=$5($,"global",!0);if(D.json){if(eF(Q,!0),_)process.exit(1);return}if(!D.quiet)eJ($,_);if(_)process.exit(1)}function mJ(D){let F=[];F.push({label:"root",path:D});let B=B5(D,"profiles");if(S6(B)&&PJ(B).isDirectory()){let _=uJ(B,{withFileTypes:!0}).filter((Q)=>Q.isDirectory()&&!Q.name.startsWith(".")).map((Q)=>Q.name).sort();for(let Q of _)F.push({label:`profile:${Q}`,path:B5(B,Q)})}return F}async function gJ(D,F,B){let $=B?.emitWarnings??!0,_=k6(D),Q=N2(D),Y=xF(D,{isFlattened:F}),q=Q.exists&&Y.exists;if(Q.exists&&_.length===0&&!q)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!Q.exists&&_.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let H=[];if(Y.exists&&!Q.exists)try{let J=await w3(D,{isFlattened:F}),X=await K0(D,{emitParseDiagnostics:$});if(J&&X)H=T8(J,X,D).components}catch{if($)W.warn(`[preview] Could not parse lock/config at "${D}"; component count may be incomplete.`)}return{status:"preview",count:H.length,components:H,configActions:_}}async function dJ(D,F){let B=k6(D),$=N2(D),_=xF(D,{isFlattened:F}),Q=$.exists&&_.exists;if($.exists&&B.length===0&&!Q)return{status:"already_v2",count:0,components:[],configActions:[]};if(!_.exists&&!$.exists&&B.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(_.exists&&!$.exists){let X=await w3(D,{isFlattened:F});if(!X)throw new U("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let z=await K0(D);if(!z)throw new c("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:M,components:A}=T8(X,z,D);Y={newReceipt:M,components:A}}let q=Y?.components??[],H=q.length;if(Y){await j0(D,Y.newReceipt);let X=C8(_.path);await v8(_.path,X)}if(Q){let X=C8(_.path);await v8(_.path,X)}if(B.length>0)await q5(D,B);return{status:Y!==null||Q||B.length>0?"migrated":"already_v2",count:H,components:q,configActions:B}}function $5(D,F,B){let $=D.some((X)=>X.status==="error"),_=D.some((X)=>X.status==="migrated"||X.status==="preview"),Q=D.every((X)=>X.status==="already_v2"||X.status==="nothing_to_migrate"),Y=D.reduce((X,z)=>X+z.count,0),q=D.flatMap((X)=>X.components),H=D.flatMap((X)=>X.configActions),J;if($)J=B?"partial_failure":"preview_with_errors";else if(Q)J=D.every((z)=>z.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(B)J=_?"migrated":"already_v2";else J=_?"preview":"already_v2";return{success:!$,status:J,scope:F,count:Y,components:q,configActions:H,targets:D}}function cJ(D){return D.status==="preview_with_errors"}function eF(D,F){let B=lJ(D,F);console.log(JSON.stringify(B,null,2))}function lJ(D,F){let B=pJ(D),$=B.flatMap((_)=>_.blockers??[]);return{...D,lifecycle_status:sJ(D.status,F),schema_version:xJ,blockers:$,targets:B}}function pJ(D){return(D.targets&&D.targets.length>0?D.targets:[iJ(D)]).map((B)=>nJ(B))}function iJ(D){return{target:D.scope,status:D.status,count:D.count,components:D.components,configActions:D.configActions,blockers:D.blockers??[]}}function nJ(D){let F=D.blockers??(D.status==="error"?[{code:"MIGRATE_BLOCKER",message:D.error??"Migration blocked",path:D.target}]:[]);return{...D,scope:D.scope??D.target,result:D.result??D.status,blockers:F}}function sJ(D,F){if(F)return D==="partial_failure"?"apply_failed":"apply_ok";return D==="preview_with_errors"?"preview_blocked":"preview_ok"}function _5(D,F){let B=aJ(F,D);return{target:D,status:"error",count:0,components:[],configActions:[],error:B.message,blockers:[B]}}function aJ(D,F){let B=D instanceof Error?D.message:String(D);return{code:oJ(D,B),message:B,path:F}}function oJ(D,F){if(typeof D==="object"&&D!==null&&"code"in D){let $=D.code;if(typeof $==="string"&&$.length>0)return $}let B=F.toLowerCase();if(B.includes("ocx.jsonc")||B.includes("registry"))return"CONFIG_ERROR";if(B.includes("parse")||B.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function rJ(D,F,B,$){let _=k6(B),Q=N2(B),Y=xF(B,{isFlattened:$}),q=Q.exists&&Y.exists;if(Q.exists&&_.length===0&&!q){let A={success:!0,status:"already_v2",scope:F,count:0,components:[],configActions:[]};if(D.json){eF(A,Boolean(D.apply));return}if(!D.quiet)W.success(`[${F}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!Q.exists&&_.length===0){let A={success:!0,status:"nothing_to_migrate",scope:F,count:0,components:[],configActions:[]};if(D.json){eF(A,Boolean(D.apply));return}if(!D.quiet)W.info(`[${F}] Nothing to migrate. No legacy ocx.lock found.`);return}let H=null;if(Y.exists&&!Q.exists){let A=await w3(B,{isFlattened:$});if(!A)throw new U("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let K=await K0(B);if(!K)throw new c("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:S}=T8(A,K,B);H={newReceipt:j,components:S}}let J=H?.components??[],X=J.length;if(!D.apply){let A={success:!0,status:"preview",scope:F,count:X,components:J,configActions:_};if(D.json){eF(A,!1);return}if(!D.quiet){if(X>0){W.info(`[${F}] Migration preview: ${X} component(s) would be migrated.`),W.break();for(let K of J)W.info(` ${K.legacyKey} \u2192 ${K.canonicalId}`);W.break()}if(q)W.info(`[${F}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),W.break();if(_.length>0){W.info(`[${F}] Config normalization: ${_.length} deprecated field(s) would be removed.`);for(let K of _)W.info(` registries.${K.registry}.${K.field} \u2192 remove`);W.break()}if(X===0&&_.length===0&&!q)W.info(`[${F}] Nothing to migrate.`);else W.info("No changes made. Run with --apply to perform migration.")}return}if(H){await j0(B,H.newReceipt);let A=C8(Y.path);if(await v8(Y.path,A),!D.json&&!D.quiet){W.success(`[${F}] Migrated ${X} component(s) to receipt format (.ocx/receipt.jsonc).`),W.break();for(let K of J)W.success(` \u2713 ${K.legacyKey} \u2192 ${K.canonicalId}`);W.break(),W.info(`Legacy lock backed up to: ${A}`)}}if(q){let A=C8(Y.path);if(await v8(Y.path,A),!D.json&&!D.quiet)W.success(`[${F}] Removed stale legacy lock (receipt already exists).`),W.info(`Legacy lock backed up to: ${A}`)}if(_.length>0){if(await q5(B,_),!D.json&&!D.quiet){if(H)W.break();W.success(`[${F}] Normalized ${_.length} deprecated config field(s).`);for(let A of _)W.success(` \u2713 registries.${A.registry}.${A.field} removed`)}}let M={success:!0,status:H!==null||q||_.length>0?"migrated":"already_v2",scope:F,count:X,components:J,configActions:_};if(D.json){eF(M,!0);return}if(!H&&_.length>0&&!D.quiet)W.break(),W.success(`[${F}] Config normalization complete.`)}function tJ(D,F,B){if(F.status==="nothing_to_migrate"){W.info("[global] Nothing to migrate across all targets.");return}if(F.status==="already_v2"){W.success("[global] All targets already migrated.");return}W.info(`[global] Migration preview across ${D.length} target(s):`),W.break();for(let $ of D){let _=B.has($.target),Q=DX($,_);W.info(` ${$.target}: ${Q}`)}if(W.break(),F.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 eJ(D,F){W.break();let B=D.filter((Q)=>Q.status==="migrated"),$=D.filter((Q)=>Q.status==="already_v2"||Q.status==="nothing_to_migrate"),_=D.filter((Q)=>Q.status==="error");if(B.length>0){W.success(`[global] Migrated ${B.length} target(s):`);for(let Q of B)W.success(` \u2713 ${Q.target}`)}if($.length>0)W.info(`[global] ${$.length} target(s) already up to date.`);if(_.length>0){W.error(`[global] ${_.length} target(s) failed:`);for(let Q of _)W.error(` \u2717 ${Q.target}: ${Q.error}`)}if(F)W.break(),W.error("[global] Migration completed with errors. See above for details.")}function DX(D,F){if(D.status==="error")return"error";if(D.status==="already_v2")return"already migrated";if(D.status==="nothing_to_migrate")return"nothing to migrate";let B=[];if(D.count>0)B.push(`${D.count} component(s) to migrate`);if(D.configActions.length>0)B.push(`${D.configActions.length} config field(s) to normalize`);if(F)B.push("legacy lock cleanup pending");if(B.length===0)return"nothing to migrate";return B.join(", ")}function FX(D){if(D.global)return D.cwd??W0();return D.cwd??process.cwd()}function C8(D){let F=`${D}.bak`;if(!S6(F))return F;for(let B=1;B<=100;B++){let $=`${F}.${B}`;if(!S6($))return $}return`${F}.${Date.now()}`}function k6(D){let F=S2(D);if(!F.exists)return[];try{let B=Q5(F.path,"utf-8"),$=ND(B,[],{allowTrailingComma:!0});if(!$||typeof $!=="object"||Array.isArray($))return[];return D5($)}catch{return[]}}async function q5(D,F){if(F.length===0)return;let B=S2(D);if(!B.exists)return;let $=Q5(B.path,"utf-8");for(let _ of F){let Q=AF($,["registries",_.registry,_.field],void 0,BX);$=jF($,Q)}await yJ(B.path,$)}var xJ=1,BX;var H5=V(()=>{b0();eD();$D();yD();hD();k2();F5();BX={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
129
|
-
`}}});import{basename as $X,resolve as hV}from"path";function u8(){let{GIT_DIR:D,GIT_WORK_TREE:F,...B}=process.env;return B}async function _X(D){let F=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:D,env:u8(),stdout:"pipe",stderr:"pipe"});if(await F.exited===0){let H=(await new Response(F.stdout).text()).trim();if(H)return H}let $=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:D,env:u8(),stdout:"pipe",stderr:"pipe"});if(await $.exited===0){let H=(await new Response($.stdout).text()).trim();if(H)return H}let Q=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:D,env:u8(),stdout:"pipe",stderr:"pipe"});if(await Q.exited===0){let H=(await new Response(Q.stdout).text()).trim();if(H)return H}return null}async function QX(D){let F=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:D,env:u8(),stdout:"pipe",stderr:"pipe"});if(await F.exited!==0)return null;let _=(await new Response(F.stdout).text()).trim();if(!_)return null;return $X(_)}async function J5(D){let[F,B]=await Promise.all([QX(D),_X(D)]);return{repoName:F,branch:B}}var X5=()=>{};import YX from"path";function G5(){return Boolean(process.env.TMUX)}function qX(D){if(!G5())return;Bun.spawnSync(["tmux","rename-window",D]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function HX(D){if(!FF)return;process.stdout.write(`\x1B]0;${D}\x07`)}function z5(D){qX(D),HX(D)}function M5(){if(P8||!FF)return;process.stdout.write("\x1B[22;2t"),P8=!0}function I6(){if(!P8)return;if(G5())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(FF)process.stdout.write("\x1B[23;2t");P8=!1}function A5(D,F,B){let $=B.repoName??YX.basename(D);if(!B.branch)return`ocx[${F}]:${$}`;let _=B.branch.length>W5?`${B.branch.slice(0,W5-3)}...`:B.branch;return`ocx[${F}]:${$}/${_}`}var W5=20,P8=!1;var j5=V(()=>{N3()});import{randomUUID as JX}from"crypto";import{copyFile as XX,cp as WX,lstat as C2,mkdir as GX,mkdtemp as zX,readdir as V5,readFile as MX,realpath as F3,rename as AX,rm as jX,unlink as KX}from"fs/promises";import{tmpdir as UX}from"os";import{basename as VX,dirname as C6,isAbsolute as E5,join as z2,relative as u6}from"path";var{Glob:T6}=globalThis.Bun;function a(D,F){return new c(`ocx oc ${D} error: ${F}`)}function TD(D){if(D instanceof Error)return D.message;return String(D)}function OX(D){if(D.length===0)return"Unknown parse error";let F=D[0];if(!F)return"Unknown parse error";return`${K2(F.error)} at offset ${F.offset}`}function x8(D){return D.replaceAll("\\","/")}function v6(D){return D.startsWith("./")?D.slice(2):D}function P6(D,F){let B=u6(D,F);if(B.length===0)return!0;return!B.startsWith("..")&&!E5(B)}function bX(D){if(D.isFile())return"file";if(D.isDirectory())return"directory";if(D.isSymbolicLink())return"symlink";return"other"}function P3(D){return{entryType:bX(D),device:String(D.dev),inode:String(D.ino),mode:String(D.mode),size:String(D.size),mtimeMs:String(D.mtimeMs)}}function ZX(D,F){return D.entryType===F.entryType&&D.device===F.device&&D.inode===F.inode&&D.mode===F.mode}function RX(D,F){return D.size===F.size&&D.mtimeMs===F.mtimeMs}async function D3(D){let F;try{F=await C2(D.absolutePath)}catch{throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`)}if(D.mustRemainDirectory&&!F.isDirectory())throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`);if(D.mustRemainFile&&!F.isFile())throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`);let B=P3(F),$=ZX(D.expectedSnapshot,B),Q=!(D.compareContent??!0)?!0:RX(D.expectedSnapshot,B);if(!$||!Q)throw a("validate",`Overlay path changed during ${D.phase}: ${D.overlayRelativePath}. ${v2}`)}async function y8(D,F,B){let _=x8(u6(D,F)).split("/").filter((Y)=>Y.length>0),Q=D;for(let Y of _){Q=z2(Q,Y);let q;try{q=await C2(Q)}catch(H){if(H.code==="ENOENT")return;throw a("validate",`Failed to inspect overlay destination path (${B}): ${TD(H)}`)}if(q.isSymbolicLink())throw a("validate",`Overlay destination path contains existing symlink (${B})`)}}function K5(D,F,B){for(let $ of B)try{new T6(v6($))}catch{throw a("validate",`Invalid project overlay policy at ${D}: ${F} contains invalid glob pattern "${$}"`)}}async function SX(D){if(!D)return{include:[],exclude:[]};let F=z2(D,y0),B=await kX(D,F);if(!B)return{include:[],exclude:[]};let $;try{$=await MX(B,"utf8")}catch(J){throw a("read",`Failed to read project overlay policy at ${F}: ${TD(J)}`)}let _=[],Q=ND($,_,{allowTrailingComma:!0});if(_.length>0)throw a("parse",`Failed to parse project overlay policy at ${F}: ${OX(_)}`);if(!Q||typeof Q!=="object"||Array.isArray(Q))throw a("validate",`Invalid project overlay policy at ${F}: root must be an object`);let Y=NX.safeParse(Q);if(!Y.success){let J=Y.error.issues[0],X=J?.path.length?J.path.join("."):"root",z=J?.message??"Invalid project overlay policy";throw a("validate",`Invalid project overlay policy at ${F}: ${X} ${z}`)}let q=Y.data.include??[],H=Y.data.exclude??[];return K5(F,"include",q),K5(F,"exclude",H),{include:q,exclude:H}}async function kX(D,F){let B;try{B=await C2(F)}catch(Q){let Y=Q.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw a("read",`Failed to inspect project overlay policy at ${F}: ${TD(Q)}`)}if(!B.isSymbolicLink())return F;let $;try{$=await F3(D)}catch(Q){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(Q)}`)}let _;try{_=await F3(F)}catch(Q){let Y=Q.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw a("validate",`Broken symlink in project overlay policy: ${F}`);throw a("read",`Failed to inspect project overlay policy symlink at ${F}: ${TD(Q)}`)}if(!P6($,_))throw a("validate",`Symlink escapes project overlay policy scope: ${F}`);return _}function IX(D,F){for(let B of F.include)if(new T6(v6(B)).match(D))return!0;for(let B of F.exclude)if(new T6(v6(B)).match(D))return!1;return!0}function TX(D,F){return D.filter((B)=>IX(B.overlayRelativePath,F)).map((B)=>({sourcePath:B.sourcePath,destinationRelativePath:B.overlayRelativePath,sourceSnapshot:B.sourceSnapshot}))}async function L5(D,F,B){let $;try{$=await F3(F)}catch(_){let Q=_.code;if(Q==="ENOENT"||Q==="ENOTDIR")throw a("validate",`Broken symlink in project overlay scope: ${B}`);throw a("read",`Failed to inspect symlink at ${B}: ${TD(_)}`)}if(!P6(D,$))throw a("validate",`Symlink escapes project overlay scope: ${B}`);throw a("validate",`Symlink entries are not supported in project overlay scope: ${B}`)}async function w5(D,F,B,$,_){let Q;try{Q=await C2(F)}catch(q){throw a("read",`Failed to inspect project overlay path ${B}: ${TD(q)}`)}if(Q.isSymbolicLink())await L5(D,F,B);let Y=P3(Q);if(Q.isDirectory()){await _.beforeDirectoryRead?.({absolutePath:F,overlayRelativePath:B});let q;try{q=await V5(F)}catch(H){throw a("read",`Failed to read project overlay directory ${B}: ${TD(H)}`)}q.sort((H,J)=>H.localeCompare(J));for(let H of q){let J=z2(F,H),X=x8(z2(B,H));await w5(D,J,X,$,_)}await D3({absolutePath:F,overlayRelativePath:B,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!Q.isFile())return;$.push({sourcePath:F,overlayRelativePath:x8(B),sourceSnapshot:Y})}async function vX(D,F={}){let B;try{B=await F3(D)}catch(Y){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(Y)}`)}let $;try{$=await C2(D)}catch(Y){throw a("validate",`Unable to inspect project overlay root ${D}: ${TD(Y)}`)}if(!$.isDirectory())throw a("validate",`Project overlay root changed before discovery: ${D}. ${v2}`);let _=P3($),Q=[];for(let Y of EX){let q=z2(D,Y);await F.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:q,projectConfigDir:D}),await D3({absolutePath:D,overlayRelativePath:".opencode",expectedSnapshot:_,phase:"overlay discovery",mustRemainDirectory:!0});let H;try{H=await C2(q)}catch(J){let X=J.code;if(X==="ENOENT"||X==="ENOTDIR")continue;throw a("read",`Failed to inspect project overlay scope ${Y}: ${TD(J)}`)}if(H.isSymbolicLink())await L5(B,q,Y);await w5(B,q,Y,Q,F)}return Q.sort((Y,q)=>Y.overlayRelativePath.localeCompare(q.overlayRelativePath)),Q}function CX(D){let F=C6(D),B=VX(D),$=`${process.pid}-${JX()}`;return z2(F,`.${B}.ocx-tmp-${$}`)}async function uX(D,F){let B=CX(F);try{await XX(D,B),await AX(B,F)}catch($){try{await KX(B)}catch{}throw $}}async function PX(D,F,B={}){let $=B.publishAtomically??uX,_;try{_=await C2(F)}catch(Y){throw a("validate",`Unable to inspect merged overlay root ${F}: ${TD(Y)}`)}if(!_.isDirectory())throw a("validate",`Merged overlay root is not a directory: ${F}`);let Q=P3(_);for(let Y of D){if(await B.beforeSourceVerification?.(Y),Y.sourceSnapshot)await D3({absolutePath:Y.sourcePath,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:Y.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await D3({absolutePath:F,overlayRelativePath:".merged",expectedSnapshot:Q,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let q;try{q=J0(F,Y.destinationRelativePath)}catch(z){throw a("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${TD(z)}`)}await y8(F,q,Y.destinationRelativePath);let H=C6(q);await B.beforeDestinationParentCreate?.({operation:Y,destinationPath:q,destinationParentPath:H}),await y8(F,q,Y.destinationRelativePath);try{await GX(H,{recursive:!0})}catch(z){throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${TD(z)}`)}await y8(F,q,Y.destinationRelativePath);let J;try{J=await C2(H)}catch(z){throw a("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${TD(z)}`)}if(!J.isDirectory())throw a("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${v2}`);let X=P3(J);await B.beforeDestinationPublish?.({operation:Y,destinationPath:q,destinationParentPath:H}),await D3({absolutePath:F,overlayRelativePath:".merged",expectedSnapshot:Q,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await D3({absolutePath:H,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:X,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await y8(F,q,Y.destinationRelativePath);try{await $(Y.sourcePath,q)}catch(z){if(z instanceof c)throw z;throw a("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${TD(z)}`)}}}async function yX(D,F){let B;try{B=await V5(D)}catch($){throw a("copy",`Failed to read profile directory ${D}: ${TD($)}`)}for(let $ of B){let _=z2(D,$),Q=z2(F,$);try{await WX(_,Q,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw a("copy",`Failed to copy profile base file ${$}: ${TD(Y)}`)}}}async function U5(D){try{await jX(D,{recursive:!0,force:!0})}catch(F){throw a("cleanup",`Failed to remove temporary merged config directory ${D}: ${TD(F)}`)}}function xX(D,F){let B=x8(u6(D,F));if(!B||B===".")throw a("validate",`Overlay source path failed relative parsing: ${F}`);if(B===".."||B.startsWith("../")||E5(B))throw a("validate",`Overlay source path escapes project overlay scope: ${F}`);return B}function fX(D,F){let B=F.map(($)=>{if(!$.sourceSnapshot)throw a("validate",`Overlay source snapshot missing for ${$.destinationRelativePath}. ${v2}`);return{sourceRelativePath:xX(D,$.sourcePath),destinationRelativePath:$.destinationRelativePath,sourceSnapshot:$.sourceSnapshot}});return{version:wX,projectConfigDir:D,operations:B}}function hX(){return null}async function mX(D){let F=D.manifest.operations.map((B)=>({sourcePath:J0(D.manifest.projectConfigDir,B.sourceRelativePath),destinationRelativePath:B.destinationRelativePath,sourceSnapshot:B.sourceSnapshot}));await PX(F,D.mergedConfigDir,D.copySeams)}async function gX(D){if(D.manifest.operations.length===0)return"best-effort-js";let F=D.nativeHelper??hX();if(F)return await F.applyManifest(D.manifest,D.mergedConfigDir),"native-fd";if(D.hardeningMode==="native-fd-required")throw a("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${v2}`);return await mX({manifest:D.manifest,mergedConfigDir:D.mergedConfigDir,copySeams:D.copySeams}),"best-effort-js"}async function dX(D){let F=C6(D),B;try{B=await F3(F)}catch(_){throw a("validate",`Unable to resolve project directory ${F}: ${TD(_)}`)}let $;try{$=await F3(D)}catch(_){throw a("validate",`Unable to resolve project config directory ${D}: ${TD(_)}`)}if(!P6(B,$))throw a("validate",`Project .opencode root resolves outside project directory: ${D}`);return $}function cX(D){if(D instanceof c)return D;return a("copy",`Failed to prepare temporary merged config directory: ${TD(D)}`)}async function O5(D){let F=o2(D.projectDir),B=D.hardeningMode??"best-effort-js",$=null;try{$=await zX(z2(UX(),LX)),await yX(D.profileDir,$);let _="best-effort-js";if(F){let Y=await dX(F),q=await SX(Y),H=await vX(Y,D.seams?.collection),J=TX(H,q),X=fX(Y,J);_=await gX({manifest:X,mergedConfigDir:$,hardeningMode:B,copySeams:D.seams?.copy,nativeHelper:D.seams?.nativeHelper})}let Q=$;return{path:Q,cleanup:()=>U5(Q),hardeningLevel:_}}catch(_){let Q=cX(_);if($)try{await U5($)}catch(Y){Q.message=`${Q.message}
|
|
130
|
-
Cleanup warning: ${TD(Y)}`}throw Q}}var EX,LX="ocx-oc-merged-",wX=1,v2="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",NX;var b5=V(()=>{b0();Q2();Q0();$D();c2();EX=["agent","agents","skill","skills"];NX=G.object({include:G.array(G.string()).optional(),exclude:G.array(G.string()).optional()}).passthrough()});import*as D2 from"path";function lX(D){let F=new Set,B=[];for(let $=D.length-1;$>=0;$--){let _=D[$];if(!F.has(_))F.add(_),B.unshift(_)}return B}function pX(D){return D.configBin??D.envBin??"opencode"}function Z5(D){return D.includes("/")||D.includes("\\")}function iX(D){let{configuredBin:F,cwd:B}=D,$=D.resolveExecutable??((Q)=>Bun.which(Q));if(!F.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(Z5(F))return D2.isAbsolute(F)?F:D2.resolve(B,F);let _=$(F);if(!_)throw Error(`OpenCode launcher "${F}" is not available in PATH and cannot be used as OPENCODE_BIN`);return D2.isAbsolute(_)?_:D2.resolve(B,_)}function nX(D){let F=D.resolveExecutable??((J)=>Bun.which(J)),B=D.argv??process.argv,$=D.execPath??process.execPath,_=D.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),Q=D.inheritedOcxBin?.trim(),Y=_?$:B[1],q=Q&&Q.length>0?Q:Y;if(!q?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(Z5(q))return D2.isAbsolute(q)?q:D2.resolve(D.cwd,q);let H=F(q);if(!H)throw Error(`OCX executable "${q}" is not available in PATH and cannot be persisted as OCX_BIN`);return D2.isAbsolute(H)?H:D2.resolve(D.cwd,H)}function sX(D){let F=Boolean(D.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:B,OPENCODE_BIN:$,OCX_CONTEXT:_,OCX_BIN:Q,OCX_PROFILE:Y,...q}=D.baseEnv;return{...q,...D.opencodeBin!==void 0&&{OPENCODE_BIN:D.opencodeBin},...F&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:D.configDir??(F?fD(D.profileName):W0()),...D.configContent&&{OPENCODE_CONFIG_CONTENT:D.configContent},...F&&{OCX_CONTEXT:"1"},...F&&D.ocxBin&&{OCX_BIN:D.ocxBin},...D.profileName&&{OCX_PROFILE:D.profileName}}}function R5(D){D.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(F,B)=>{try{await aX(B.args,F)}catch($){t($)}})}async function aX(D,F){let B=process.cwd(),$=await r0.create(B,{profile:F.profile}),_=$.resolve(),Q=$.getProfile();if(_.profileName)W.info(`Using profile: ${_.profileName}`);let Y=Q?.ocx,q=F.rename!==!1&&Y?.renameWindow!==!1;if(_.profileName){let y=W2(_.profileName);if(!await Bun.file(y).exists())W.warn(`No opencode.jsonc found at ${y}. Create one to customize OpenCode settings.`)}let H=Array.isArray(_.opencode.instructions)?_.opencode.instructions:[],J=[..._.instructions,...H],X=lX(J),z=X.length>0||Object.keys(_.opencode).length>0?{..._.opencode,instructions:X.length>0?X:void 0}:void 0,M=null,A=null,K=null,j=null,S=null,R=()=>{if(M)M.kill("SIGINT");else S=130},s=()=>{if(M)M.kill("SIGTERM");else S=143},N=()=>{if(q)I6()};try{if(process.on("SIGINT",R),process.on("SIGTERM",s),process.on("exit",N),S!==null){j=S;return}if(_.profileName)A=await O5({projectDir:B,profileDir:fD(_.profileName)});if(S!==null){j=S;return}if(q){M5();let p=await J5(B);if(S!==null){j=S;return}z5(A5(B,_.profileName??"default",p))}if(S!==null){j=S;return}let y=pX({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),O=Boolean(_.profileName),b=O?iX({configuredBin:y,cwd:B}):y,L=O?nX({cwd:B,inheritedOcxBin:process.env.OCX_BIN}):void 0,e=z?JSON.stringify(z):void 0;try{M=Bun.spawn({cmd:[b,...D],cwd:B,env:sX({baseEnv:process.env,profileName:_.profileName??void 0,ocxBin:L,opencodeBin:b,configDir:A?.path,configContent:e}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(p){throw a("spawn",`Failed to launch OpenCode binary "${y}": ${p instanceof Error?p.message:String(p)}`)}j=await M.exited}catch(y){K=y instanceof Error?y:a("spawn",`OpenCode process failed: ${String(y)}`)}finally{if(process.off("SIGINT",R),process.off("SIGTERM",s),process.off("exit",N),q)I6();if(A)try{await A.cleanup()}catch(y){if(K!==null||S!==null||j!==null&&j!==0)W.warn(`Cleanup warning: ${y instanceof Error?y.message:String(y)}`);else K=y instanceof Error?y:a("cleanup",`Failed to remove temporary merged config directory: ${String(y)}`)}}if(K)throw K;if(j!==null)process.exit(j)}var N5=V(()=>{b3();Q0();X5();yD();hD();k2();j5();b5()});import{existsSync as B3}from"fs";import{mkdir as y6,mkdtemp as oX,rename as rX,rm as S5,writeFile as tX}from"fs/promises";import{dirname as k5,join as f8,relative as eX}from"path";function I5(D,F,B){let $=B instanceof Error?B.message:String(B);return`${D} "${F}" (${$})`}function u5(D,F){let[B,$]=F.split("/");if(!B||!$)return;return`${xD(D)}/components/${$}.json`}function T5(D){if(!D)return null;let[F,B,...$]=D.split("/");if(!F||!B||$.length>0)return null;return{registryName:F,componentName:B}}function DW(D,F){if(!D)return{};let B;try{let Y=new URL(D),q=Y.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(q?.[1])B=decodeURIComponent(q[1]);else{let H=Y.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(H?.[1])B=decodeURIComponent(H[1])}}catch{}let $=xD(D),_,Q=-1;for(let[Y,q]of Object.entries(F)){let H=xD(q.url);if(!($===H||$.startsWith(`${H}/`))||H.length<=Q)continue;_=Y,Q=H.length}return{registryName:_,componentName:B}}function FW(D){let F=D.depRefs[0]??`${D.namespace}/${D.component}`,B={...D.profileRegistries,...D.profileRegistries[D.namespace]?{}:{[D.namespace]:{url:D.registryUrl}}},$=D.error.registryName,_=D.error.qualifiedName,Q=T5(_);if(!$&&Q)$=Q.registryName;let Y=Q?.componentName,q=_&&!Q&&!_.includes("/")?_:void 0,H=DW(D.error.url,B);if(!$&&H.registryName)$=H.registryName;let J=Y??q??H.componentName;if((!_||!Q)&&$&&J)_=`${$}/${J}`;if(!_)_=F;if(!$)$=T5(_)?.registryName??D.namespace;let X=B[$]?.url||($===D.namespace?D.registryUrl:void 0);return{registryName:$,qualifiedName:_,fallbackUrl:D.error.url||(X?u5(X,_):void 0)}}function v5(D,F){let B=D.phase??F.fallbackPhase,$=D.url??F.fallbackUrl,_=[`phase: ${B}`,`qualifiedName: ${F.qualifiedName}`,`registryContext: ${F.registryContext}`,`registryName: ${F.registryName}`,...$?[`url: ${$}`]:[]];return new ZD(`${D.message} (${_.join(", ")})`,{url:$,status:D.status,statusText:D.statusText,phase:B,qualifiedName:F.qualifiedName,registryContext:F.registryContext,registryName:F.registryName})}function C5(D,F){if(!D.startsWith(".opencode/"))throw new U(`Invalid embedded target "${D}": expected .opencode/ prefix for embedded profile files.`);let B=D.slice(10);if(!B)throw new U(`Invalid embedded target "${D}": missing path after .opencode/ prefix.`);let $;try{$=J0(F,B)}catch(Q){if(Q instanceof oD)throw new U(`Invalid embedded target "${D}": ${Q.message}`);throw Q}let _=eX(F,$).replace(/\\/g,"/");if(_==="."||_==="")throw new U(`Invalid embedded target "${D}": target must resolve to a file path.`);return _}async function x6(D){let{namespace:F,component:B,profileName:$,registryUrl:_,quiet:Q}=D;if(!a0.safeParse($).success)throw new U(`Invalid profile name: "${$}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let q;if(F)q=F;else throw new U(`Registry name is required for URL-based profile installs.
|
|
169
|
+
`,{mode:384}),U.push("profileAgents");if(v?.succeed("Initialized global profiles"),$.json)console.log(JSON.stringify({success:!0,files:{globalConfig:_,profileOcx:z,profileOpencode:I,profileAgents:X},created:U,existed:Q}));else if(!$.quiet)if(U.length>0){for(let q of U){if(q==="globalConfig")W.info(`Created global config: ${_}`);if(q==="profileOcx")W.info(`Created profile config: ${z}`);if(q==="profileOpencode")W.info(`Created profile opencode config: ${I}`);if(q==="profileAgents")W.info(`Created profile instructions: ${X}`)}W.info(""),W.info("Next steps:"),W.info(" 1. Edit your profile config: ocx config edit -p default"),W.info(" 2. Add registries: ocx registry add <url> --name <name> --global"),W.info(" 3. Launch OpenCode: ocx opencode"),W.info(" 4. Create more profiles: ocx profile add <name> --global")}else W.info("Global profiles already initialized (all files exist)")}catch(U){throw v?.fail("Failed to initialize"),U}}async function bL($,v){let U=$,Q=v.namespace??"my-registry",_=v.author??"Your Name";if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(Q))throw new M("Invalid namespace format: must start with letter/number, use hyphens only between segments (e.g., 'my-registry')");if((await mK(U).catch(()=>[])).some((I)=>!I.startsWith(".")))throw new t$("Directory is not empty. Remove existing files or choose a different directory.");let z=v.quiet?null:D$({text:"Scaffolding registry..."});z?.start();try{if(z)z.text=v.local?"Copying template...":"Fetching template...";if(v.local)await y0(U,{recursive:!0}),await cK(v.local,U);else{let I=v.canary?"main":BL();await DL(U,I,v.verbose)}if(z)z.text="Configuring project...";if(await ML(U,{namespace:Q,author:_}),z?.succeed(`Created registry: ${Q}`),v.json)console.log(JSON.stringify({success:!0,namespace:Q,path:U}));else if(!v.quiet)W.info(""),W.info("Next steps:"),W.info(" 1. bun install"),W.info(" 2. Edit registry.jsonc with your components"),W.info(" 3. bun run build"),W.info(""),W.info("Deploy to:"),W.info(" Cloudflare: bunx wrangler deploy"),W.info(" Vercel: vercel"),W.info(" Netlify: netlify deploy")}catch(I){throw z?.fail("Failed to scaffold registry"),I}}async function cK($,v){await XL($,v,{recursive:!0})}function BL(){return"v2.0.6"}function ZL($){let v=$==="main"?"heads/main":`tags/${$}`;return`https://github.com/${jL}/archive/refs/${v}.tar.gz`}async function DL($,v,U){let Q=ZL(v);if(U)W.info(`Fetching ${Q}`);let _=await fetch(Q);if(!_.ok||!_.body)throw new P$(`Failed to fetch template from ${Q}: ${_.statusText}`);let J=R8($,".ocx-temp");await y0(J,{recursive:!0});try{let Y=R8(J,"template.tar.gz"),z=await _.arrayBuffer();await NY(Y,Buffer.from(z));let I=Bun.spawn(["tar","-xzf",Y,"-C",J],{stdout:"ignore",stderr:"pipe"});if(await I.exited!==0){let H=await new Response(I.stderr).text();throw Error(`Failed to extract template: ${H}`)}let G=(await mK(J)).find((H)=>H.startsWith("ocx-"));if(!G)throw Error("Failed to find extracted template directory");let j=R8(J,G,KL);await cK(j,$)}finally{await GL(J,{recursive:!0,force:!0})}}function VL($){return $.split(/[-_\s]+/).map((v)=>v.charAt(0).toUpperCase()+v.slice(1).toLowerCase()).join(" ")}async function ML($,v){let U=["registry.jsonc","package.json","wrangler.jsonc","README.md","AGENTS.md"];for(let Q of U){let _=R8($,Q);if(!F1(_))continue;let J=await qL(_).then((Y)=>Y.toString());if(J=J.replace(/my-registry/g,v.namespace),J=J.replace(/My Registry/g,VL(v.namespace)),J=J.replace(/Your Name/g,v.author),Q==="registry.jsonc")if(/"\$schema"\s*:/.test(J))J=J.replace(/("\$schema"\s*:\s*")[^"]*(")/,`$1${i4}$2`);else J=J.replace(/{/,`{
|
|
170
|
+
"$schema": "${i4}",`);await NY(_,J)}}var jL="kdcokenny/ocx",KL="examples/registry-starter";var lK=b(()=>{i_();_8();G6();Z4();X4();iJ();z$();l$();i$();s4();$6()});function wL($,v,U){let Q=$.indexOf("/");if(Q===-1)throw Error(`Invalid legacy key: "${$}". Expected format: alias/component`);let _=$.slice(0,Q),J=$.slice(Q+1);if(!_||!J)throw Error(`Invalid legacy key: "${$}". Both alias and component are required.`);let Y=Cv(U,_,J,v.version),z={registryUrl:U,registryName:_,name:J,revision:v.version,hash:v.hash,files:v.files.map((I)=>({path:I,hash:""})),installedAt:v.installedAt,...v.updatedAt&&{updatedAt:v.updatedAt},owner:{type:"user"}};return[Y,z]}function E8($,v,U){let Q={},_=[],J=Object.keys($.installed).sort();for(let z of J){let I=$.installed[z];if(!I)continue;let X=v.registries[I.registry];if(!X)throw new d(`Registry "${I.registry}" referenced in lock key "${z}" is not configured in ocx.jsonc. Add it before migrating.`);let[q,G]=wL(z,I,X.url);Q[q]=G,_.push({legacyKey:z,canonicalId:q,name:G.name,registryName:G.registryName})}return{receipt:{version:1,...U&&{root:U},installed:Q},components:_}}function dK($){let v=$.registries;if(!v||typeof v!=="object"||Array.isArray(v))return[];let U=[],Q=v;for(let _ of Object.keys(Q).sort()){let J=Q[_];if(!J||typeof J!=="object"||Array.isArray(J))continue;let Y=J;for(let z of LL)if(z in Y)U.push({registry:_,field:z,action:"remove_deprecated"})}return U}var LL;var pK=b(()=>{X4();z$();LL=["version"]});import{existsSync as SY,readdirSync as kL,readFileSync as oK,statSync as AL}from"fs";import{rename as P8,writeFile as OL}from"fs/promises";import{join as iK}from"path";function tK($){$.command("migrate").description("Migrate legacy ocx.lock to receipt format (.ocx/receipt.jsonc)").option("--global","Migrate global config scope (includes profiles)").option("--apply","Apply migration (default is dry-run preview)").option("--json","Output as JSON").option("-q, --quiet","Suppress output").option("--cwd <path>","Working directory").action(async(v)=>{try{await NL(v)}catch(U){_$(U,{json:v.json})}})}async function NL($){if($.global){await SL($);return}await hL($,"local",pL($),!1)}async function SL($){let v=$.cwd??N4(),U=TL(v);if(!$.apply){let Y=[],z=new Set;for(let{label:q,path:G}of U){let j=d6(G),H=V0(G,{isFlattened:!0});if(j.exists&&H.exists)z.add(q);try{let Z=await RL(G,!0,{emitWarnings:!$.json&&!$.quiet});Y.push({...Z,target:q})}catch(Z){let D=rK(q,Z);if(Y.push(D),!$.json&&!$.quiet)W.error(`[global:${q}] Preview failed: ${D.error}`)}}let I=nK(Y,"global",!1),X=PL(I);if($.json){if(C0(I,!1),X)process.exit(1);return}if(!$.quiet)cL(Y,I,z);if(X)process.exit(1);return}let Q=[],_=!1;for(let{label:Y,path:z}of U)try{let I=await EL(z,!0);Q.push({...I,target:Y})}catch(I){_=!0;let X=rK(Y,I);if(Q.push(X),!$.json&&!$.quiet)W.error(`[global:${Y}] Migration failed: ${X.error}`)}let J=nK(Q,"global",!0);if($.json){if(C0(J,!0),_)process.exit(1);return}if(!$.quiet)lL(Q,_);if(_)process.exit(1)}function TL($){let v=[];v.push({label:"root",path:$});let U=iK($,"profiles");if(SY(U)&&AL(U).isDirectory()){let _=kL(U,{withFileTypes:!0}).filter((J)=>J.isDirectory()&&!J.name.startsWith(".")).map((J)=>J.name).sort();for(let J of _)v.push({label:`profile:${J}`,path:iK(U,J)})}return v}async function RL($,v,U){let Q=U?.emitWarnings??!0,_=TY($),J=d6($),Y=V0($,{isFlattened:v}),z=J.exists&&Y.exists;if(J.exists&&_.length===0&&!z)return{status:"already_v2",count:0,components:[],configActions:[]};if(!Y.exists&&!J.exists&&_.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let I=[];if(Y.exists&&!J.exists)try{let X=await fv($,{isFlattened:v}),q=await C4($,{emitParseDiagnostics:Q});if(X&&q)I=E8(X,q,$).components}catch{if(Q)W.warn(`[preview] Could not parse lock/config at "${$}"; component count may be incomplete.`)}return{status:"preview",count:I.length,components:I,configActions:_}}async function EL($,v){let U=TY($),Q=d6($),_=V0($,{isFlattened:v}),J=Q.exists&&_.exists;if(Q.exists&&U.length===0&&!J)return{status:"already_v2",count:0,components:[],configActions:[]};if(!_.exists&&!Q.exists&&U.length===0)return{status:"nothing_to_migrate",count:0,components:[],configActions:[]};let Y=null;if(_.exists&&!Q.exists){let q=await fv($,{isFlattened:v});if(!q)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let G=await C4($);if(!G)throw new d("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:j,components:H}=E8(q,G,$);Y={newReceipt:j,components:H}}let z=Y?.components??[],I=z.length;if(Y){await y4($,Y.newReceipt);let q=x8(_.path);await P8(_.path,q)}if(J){let q=x8(_.path);await P8(_.path,q)}if(U.length>0)await aK($,U);return{status:Y!==null||J||U.length>0?"migrated":"already_v2",count:I,components:z,configActions:U}}function nK($,v,U){let Q=$.some((q)=>q.status==="error"),_=$.some((q)=>q.status==="migrated"||q.status==="preview"),J=$.every((q)=>q.status==="already_v2"||q.status==="nothing_to_migrate"),Y=$.reduce((q,G)=>q+G.count,0),z=$.flatMap((q)=>q.components),I=$.flatMap((q)=>q.configActions),X;if(Q)X=U?"partial_failure":"preview_with_errors";else if(J)X=$.every((G)=>G.status==="nothing_to_migrate")?"nothing_to_migrate":"already_v2";else if(U)X=_?"migrated":"already_v2";else X=_?"preview":"already_v2";return{success:!Q,status:X,scope:v,count:Y,components:z,configActions:I,targets:$}}function PL($){return $.status==="preview_with_errors"}function C0($,v){let U=xL($,v);console.log(JSON.stringify(U,null,2))}function xL($,v){let U=uL($),Q=U.flatMap((_)=>_.blockers??[]);return{...$,lifecycle_status:fL($.status,v),schema_version:FL,blockers:Q,targets:U}}function uL($){return($.targets&&$.targets.length>0?$.targets:[yL($)]).map((U)=>CL(U))}function yL($){return{target:$.scope,status:$.status,count:$.count,components:$.components,configActions:$.configActions,blockers:$.blockers??[]}}function CL($){let v=$.blockers??($.status==="error"?[{code:"MIGRATE_BLOCKER",message:$.error??"Migration blocked",path:$.target}]:[]);return{...$,scope:$.scope??$.target,result:$.result??$.status,blockers:v}}function fL($,v){if(v)return $==="partial_failure"?"apply_failed":"apply_ok";return $==="preview_with_errors"?"preview_blocked":"preview_ok"}function rK($,v){let U=mL(v,$);return{target:$,status:"error",count:0,components:[],configActions:[],error:U.message,blockers:[U]}}function mL($,v){let U=$ instanceof Error?$.message:String($);return{code:gL($,U),message:U,path:v}}function gL($,v){if(typeof $==="object"&&$!==null&&"code"in $){let Q=$.code;if(typeof Q==="string"&&Q.length>0)return Q}let U=v.toLowerCase();if(U.includes("ocx.jsonc")||U.includes("registry"))return"CONFIG_ERROR";if(U.includes("parse")||U.includes("invalid"))return"VALIDATION_ERROR";return"MIGRATE_BLOCKER"}async function hL($,v,U,Q){let _=TY(U),J=d6(U),Y=V0(U,{isFlattened:Q}),z=J.exists&&Y.exists;if(J.exists&&_.length===0&&!z){let H={success:!0,status:"already_v2",scope:v,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.success(`[${v}] Already migrated to receipt format (.ocx/receipt.jsonc).`);return}if(!Y.exists&&!J.exists&&_.length===0){let H={success:!0,status:"nothing_to_migrate",scope:v,count:0,components:[],configActions:[]};if($.json){C0(H,Boolean($.apply));return}if(!$.quiet)W.info(`[${v}] Nothing to migrate. No legacy ocx.lock found.`);return}let I=null;if(Y.exists&&!J.exists){let H=await fv(U,{isFlattened:Q});if(!H)throw new M("Failed to parse ocx.lock. The lock file exists but could not be read or contains invalid data.");let Z=await C4(U);if(!Z)throw new d("No ocx.jsonc found. The config is required to resolve registry URLs during migration.");let{receipt:D,components:E}=E8(H,Z,U);I={newReceipt:D,components:E}}let X=I?.components??[],q=X.length;if(!$.apply){let H={success:!0,status:"preview",scope:v,count:q,components:X,configActions:_};if($.json){C0(H,!1);return}if(!$.quiet){if(q>0){W.info(`[${v}] Migration preview: ${q} component(s) would be migrated.`),W.break();for(let Z of X)W.info(` ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break()}if(z)W.info(`[${v}] Legacy ocx.lock would be backed up and removed (receipt already exists).`),W.break();if(_.length>0){W.info(`[${v}] Config normalization: ${_.length} deprecated field(s) would be removed.`);for(let Z of _)W.info(` registries.${Z.registry}.${Z.field} \u2192 remove`);W.break()}if(q===0&&_.length===0&&!z)W.info(`[${v}] Nothing to migrate.`);else W.info("No changes made. Run with --apply to perform migration.")}return}if(I){await y4(U,I.newReceipt);let H=x8(Y.path);if(await P8(Y.path,H),!$.json&&!$.quiet){W.success(`[${v}] Migrated ${q} component(s) to receipt format (.ocx/receipt.jsonc).`),W.break();for(let Z of X)W.success(` \u2713 ${Z.legacyKey} \u2192 ${Z.canonicalId}`);W.break(),W.info(`Legacy lock backed up to: ${H}`)}}if(z){let H=x8(Y.path);if(await P8(Y.path,H),!$.json&&!$.quiet)W.success(`[${v}] Removed stale legacy lock (receipt already exists).`),W.info(`Legacy lock backed up to: ${H}`)}if(_.length>0){if(await aK(U,_),!$.json&&!$.quiet){if(I)W.break();W.success(`[${v}] Normalized ${_.length} deprecated config field(s).`);for(let H of _)W.success(` \u2713 registries.${H.registry}.${H.field} removed`)}}let j={success:!0,status:I!==null||z||_.length>0?"migrated":"already_v2",scope:v,count:q,components:X,configActions:_};if($.json){C0(j,!0);return}if(!I&&_.length>0&&!$.quiet)W.break(),W.success(`[${v}] Config normalization complete.`)}function cL($,v,U){if(v.status==="nothing_to_migrate"){W.info("[global] Nothing to migrate across all targets.");return}if(v.status==="already_v2"){W.success("[global] All targets already migrated.");return}W.info(`[global] Migration preview across ${$.length} target(s):`),W.break();for(let Q of $){let _=U.has(Q.target),J=dL(Q,_);W.info(` ${Q.target}: ${J}`)}if(W.break(),v.status==="preview_with_errors")W.warn("[global] Preview completed with errors on some targets. See above for details."),W.info("No changes made. Run with --apply to perform migration.");else W.info("No changes made. Run with --apply to perform migration.")}function lL($,v){W.break();let U=$.filter((J)=>J.status==="migrated"),Q=$.filter((J)=>J.status==="already_v2"||J.status==="nothing_to_migrate"),_=$.filter((J)=>J.status==="error");if(U.length>0){W.success(`[global] Migrated ${U.length} target(s):`);for(let J of U)W.success(` \u2713 ${J.target}`)}if(Q.length>0)W.info(`[global] ${Q.length} target(s) already up to date.`);if(_.length>0){W.error(`[global] ${_.length} target(s) failed:`);for(let J of _)W.error(` \u2717 ${J.target}: ${J.error}`)}if(v)W.break(),W.error("[global] Migration completed with errors. See above for details.")}function dL($,v){if($.status==="error")return"error";if($.status==="already_v2")return"already migrated";if($.status==="nothing_to_migrate")return"nothing to migrate";let U=[];if($.count>0)U.push(`${$.count} component(s) to migrate`);if($.configActions.length>0)U.push(`${$.configActions.length} config field(s) to normalize`);if(v)U.push("legacy lock cleanup pending");if(U.length===0)return"nothing to migrate";return U.join(", ")}function pL($){if($.global)return $.cwd??N4();return $.cwd??process.cwd()}function x8($){let v=`${$}.bak`;if(!SY(v))return v;for(let U=1;U<=100;U++){let Q=`${v}.${U}`;if(!SY(Q))return Q}return`${v}.${Date.now()}`}function TY($){let v=p6($);if(!v.exists)return[];try{let U=oK(v.path,"utf-8"),Q=E$(U,[],{allowTrailingComma:!0});if(!Q||typeof Q!=="object"||Array.isArray(Q))return[];return dK(Q)}catch{return[]}}async function aK($,v){if(v.length===0)return;let U=p6($);if(!U.exists)return;let Q=oK(U.path,"utf-8");for(let _ of v){let J=y1(Q,["registries",_.registry,_.field],void 0,iL);Q=C1(Q,J)}await OL(U.path,Q)}var FL=1,iL;var sK=b(()=>{E4();X4();z$();l$();i$();i6();pK();iL={formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
171
|
+
`}}});import{basename as nL,resolve as ry}from"path";function u8(){let{GIT_DIR:$,GIT_WORK_TREE:v,...U}=process.env;return U}async function rL($){let v=Bun.spawn(["git","symbolic-ref","--short","HEAD"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await v.exited===0){let I=(await new Response(v.stdout).text()).trim();if(I)return I}let Q=Bun.spawn(["git","describe","--tags","--exact-match","HEAD"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await Q.exited===0){let I=(await new Response(Q.stdout).text()).trim();if(I)return I}let J=Bun.spawn(["git","rev-parse","--short","HEAD"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await J.exited===0){let I=(await new Response(J.stdout).text()).trim();if(I)return I}return null}async function oL($){let v=Bun.spawn(["git","rev-parse","--show-toplevel"],{cwd:$,env:u8(),stdout:"pipe",stderr:"pipe"});if(await v.exited!==0)return null;let _=(await new Response(v.stdout).text()).trim();if(!_)return null;return nL(_)}async function eK($){let[v,U]=await Promise.all([oL($),rL($)]);return{repoName:v,branch:U}}var $H=()=>{};import tL from"path";function _H(){return Boolean(process.env.TMUX)}function aL($){if(!_H())return;Bun.spawnSync(["tmux","rename-window",$]),Bun.spawnSync(["tmux","set-window-option","automatic-rename","off"])}function sL($){if(!M1)return;process.stdout.write(`\x1B]0;${$}\x07`)}function UH($){aL($),sL($)}function QH(){if(y8||!M1)return;process.stdout.write("\x1B[22;2t"),y8=!0}function RY(){if(!y8)return;if(_H())Bun.spawnSync(["tmux","set-window-option","automatic-rename","on"]);if(M1)process.stdout.write("\x1B[23;2t");y8=!1}function JH($,v,U){let Q=U.repoName??tL.basename($);if(!U.branch)return`ocx[${v}]:${Q}`;let _=U.branch.length>vH?`${U.branch.slice(0,vH-3)}...`:U.branch;return`ocx[${v}]:${Q}/${_}`}var vH=20,y8=!1;var YH=b(()=>{pv()});import{randomUUID as eL}from"crypto";import{copyFile as $k,cp as vk,lstat as t6,mkdir as _k,mkdtemp as Uk,readdir as XH,readFile as Qk,realpath as m0,rename as Jk,rm as Yk,unlink as zk}from"fs/promises";import{tmpdir as Ik}from"os";import{basename as Xk,dirname as xY,isAbsolute as qH,join as F6,relative as uY}from"path";var{Glob:EY}=globalThis.Bun;function t($,v){return new d(`ocx oc ${$} error: ${v}`)}function C$($){if($ instanceof Error)return $.message;return String($)}function Kk($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function f8($){return $.replaceAll("\\","/")}function PY($){return $.startsWith("./")?$.slice(2):$}function yY($,v){let U=uY($,v);if(U.length===0)return!0;return!U.startsWith("..")&&!qH(U)}function Hk($){if($.isFile())return"file";if($.isDirectory())return"directory";if($.isSymbolicLink())return"symlink";return"other"}function $2($){return{entryType:Hk($),device:String($.dev),inode:String($.ino),mode:String($.mode),size:String($.size),mtimeMs:String($.mtimeMs)}}function Wk($,v){return $.entryType===v.entryType&&$.device===v.device&&$.inode===v.inode&&$.mode===v.mode}function bk($,v){return $.size===v.size&&$.mtimeMs===v.mtimeMs}async function f0($){let v;try{v=await t6($.absolutePath)}catch{throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`)}if($.mustRemainDirectory&&!v.isDirectory())throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`);if($.mustRemainFile&&!v.isFile())throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`);let U=$2(v),Q=Wk($.expectedSnapshot,U),J=!($.compareContent??!0)?!0:bk($.expectedSnapshot,U);if(!Q||!J)throw t("validate",`Overlay path changed during ${$.phase}: ${$.overlayRelativePath}. ${o6}`)}async function C8($,v,U){let _=f8(uY($,v)).split("/").filter((Y)=>Y.length>0),J=$;for(let Y of _){J=F6(J,Y);let z;try{z=await t6(J)}catch(I){if(I.code==="ENOENT")return;throw t("validate",`Failed to inspect overlay destination path (${U}): ${C$(I)}`)}if(z.isSymbolicLink())throw t("validate",`Overlay destination path contains existing symlink (${U})`)}}function zH($,v,U){for(let Q of U)try{new EY(PY(Q))}catch{throw t("validate",`Invalid project overlay policy at ${$}: ${v} contains invalid glob pattern "${Q}"`)}}async function Zk($){if(!$)return{include:[],exclude:[]};let v=F6($,a4),U=await Dk($,v);if(!U)return{include:[],exclude:[]};let Q;try{Q=await Qk(U,"utf8")}catch(X){throw t("read",`Failed to read project overlay policy at ${v}: ${C$(X)}`)}let _=[],J=E$(Q,_,{allowTrailingComma:!0});if(_.length>0)throw t("parse",`Failed to parse project overlay policy at ${v}: ${Kk(_)}`);if(!J||typeof J!=="object"||Array.isArray(J))throw t("validate",`Invalid project overlay policy at ${v}: root must be an object`);let Y=Bk.safeParse(J);if(!Y.success){let X=Y.error.issues[0],q=X?.path.length?X.path.join("."):"root",G=X?.message??"Invalid project overlay policy";throw t("validate",`Invalid project overlay policy at ${v}: ${q} ${G}`)}let z=Y.data.include??[],I=Y.data.exclude??[];return zH(v,"include",z),zH(v,"exclude",I),{include:z,exclude:I}}async function Dk($,v){let U;try{U=await t6(v)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return null;throw t("read",`Failed to inspect project overlay policy at ${v}: ${C$(J)}`)}if(!U.isSymbolicLink())return v;let Q;try{Q=await m0($)}catch(J){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(J)}`)}let _;try{_=await m0(v)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")throw t("validate",`Broken symlink in project overlay policy: ${v}`);throw t("read",`Failed to inspect project overlay policy symlink at ${v}: ${C$(J)}`)}if(!yY(Q,_))throw t("validate",`Symlink escapes project overlay policy scope: ${v}`);return _}function Vk($,v){for(let U of v.include)if(new EY(PY(U)).match($))return!0;for(let U of v.exclude)if(new EY(PY(U)).match($))return!1;return!0}function Mk($,v){return $.filter((U)=>Vk(U.overlayRelativePath,v)).map((U)=>({sourcePath:U.sourcePath,destinationRelativePath:U.overlayRelativePath,sourceSnapshot:U.sourceSnapshot}))}async function GH($,v,U){let Q;try{Q=await m0(v)}catch(_){let J=_.code;if(J==="ENOENT"||J==="ENOTDIR")throw t("validate",`Broken symlink in project overlay scope: ${U}`);throw t("read",`Failed to inspect symlink at ${U}: ${C$(_)}`)}if(!yY($,Q))throw t("validate",`Symlink escapes project overlay scope: ${U}`);throw t("validate",`Symlink entries are not supported in project overlay scope: ${U}`)}async function jH($,v,U,Q,_){let J;try{J=await t6(v)}catch(z){throw t("read",`Failed to inspect project overlay path ${U}: ${C$(z)}`)}if(J.isSymbolicLink())await GH($,v,U);let Y=$2(J);if(J.isDirectory()){await _.beforeDirectoryRead?.({absolutePath:v,overlayRelativePath:U});let z;try{z=await XH(v)}catch(I){throw t("read",`Failed to read project overlay directory ${U}: ${C$(I)}`)}z.sort((I,X)=>I.localeCompare(X));for(let I of z){let X=F6(v,I),q=f8(F6(U,I));await jH($,X,q,Q,_)}await f0({absolutePath:v,overlayRelativePath:U,expectedSnapshot:Y,phase:"overlay discovery",mustRemainDirectory:!0});return}if(!J.isFile())return;Q.push({sourcePath:v,overlayRelativePath:f8(U),sourceSnapshot:Y})}async function wk($,v={}){let U;try{U=await m0($)}catch(Y){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(Y)}`)}let Q;try{Q=await t6($)}catch(Y){throw t("validate",`Unable to inspect project overlay root ${$}: ${C$(Y)}`)}if(!Q.isDirectory())throw t("validate",`Project overlay root changed before discovery: ${$}. ${o6}`);let _=$2(Q),J=[];for(let Y of qk){let z=F6($,Y);await v.beforeScopeInspect?.({scope:Y,scopeAbsolutePath:z,projectConfigDir:$}),await f0({absolutePath:$,overlayRelativePath:".opencode",expectedSnapshot:_,phase:"overlay discovery",mustRemainDirectory:!0});let I;try{I=await t6(z)}catch(X){let q=X.code;if(q==="ENOENT"||q==="ENOTDIR")continue;throw t("read",`Failed to inspect project overlay scope ${Y}: ${C$(X)}`)}if(I.isSymbolicLink())await GH(U,z,Y);await jH(U,z,Y,J,v)}return J.sort((Y,z)=>Y.overlayRelativePath.localeCompare(z.overlayRelativePath)),J}function Lk($){let v=xY($),U=Xk($),Q=`${process.pid}-${eL()}`;return F6(v,`.${U}.ocx-tmp-${Q}`)}async function kk($,v){let U=Lk(v);try{await $k($,U),await Jk(U,v)}catch(Q){try{await zk(U)}catch{}throw Q}}async function Ak($,v,U={}){let Q=U.publishAtomically??kk,_;try{_=await t6(v)}catch(Y){throw t("validate",`Unable to inspect merged overlay root ${v}: ${C$(Y)}`)}if(!_.isDirectory())throw t("validate",`Merged overlay root is not a directory: ${v}`);let J=$2(_);for(let Y of $){if(await U.beforeSourceVerification?.(Y),Y.sourceSnapshot)await f0({absolutePath:Y.sourcePath,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:Y.sourceSnapshot,phase:"overlay source verification",mustRemainFile:!0});await f0({absolutePath:v,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination verification",mustRemainDirectory:!0,compareContent:!1});let z;try{z=O4(v,Y.destinationRelativePath)}catch(G){throw t("validate",`Overlay destination path is invalid (${Y.destinationRelativePath}): ${C$(G)}`)}await C8(v,z,Y.destinationRelativePath);let I=xY(z);await U.beforeDestinationParentCreate?.({operation:Y,destinationPath:z,destinationParentPath:I}),await C8(v,z,Y.destinationRelativePath);try{await _k(I,{recursive:!0})}catch(G){throw t("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}await C8(v,z,Y.destinationRelativePath);let X;try{X=await t6(I)}catch(G){throw t("validate",`Failed to inspect overlay destination parent (${Y.destinationRelativePath}): ${C$(G)}`)}if(!X.isDirectory())throw t("validate",`Overlay destination parent changed before publish (${Y.destinationRelativePath}). ${o6}`);let q=$2(X);await U.beforeDestinationPublish?.({operation:Y,destinationPath:z,destinationParentPath:I}),await f0({absolutePath:v,overlayRelativePath:".merged",expectedSnapshot:J,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await f0({absolutePath:I,overlayRelativePath:Y.destinationRelativePath,expectedSnapshot:q,phase:"overlay destination publish",mustRemainDirectory:!0,compareContent:!1}),await C8(v,z,Y.destinationRelativePath);try{await Q(Y.sourcePath,z)}catch(G){if(G instanceof d)throw G;throw t("copy",`Failed to copy overlay file ${Y.destinationRelativePath}: ${C$(G)}`)}}}async function Ok($,v){let U;try{U=await XH($)}catch(Q){throw t("copy",`Failed to read profile directory ${$}: ${C$(Q)}`)}for(let Q of U){let _=F6($,Q),J=F6(v,Q);try{await vk(_,J,{recursive:!0,force:!0,errorOnExist:!1})}catch(Y){throw t("copy",`Failed to copy profile base file ${Q}: ${C$(Y)}`)}}}async function IH($){try{await Yk($,{recursive:!0,force:!0})}catch(v){throw t("cleanup",`Failed to remove temporary merged config directory ${$}: ${C$(v)}`)}}function Fk($,v){let U=f8(uY($,v));if(!U||U===".")throw t("validate",`Overlay source path failed relative parsing: ${v}`);if(U===".."||U.startsWith("../")||qH(U))throw t("validate",`Overlay source path escapes project overlay scope: ${v}`);return U}function Nk($,v){let U=v.map((Q)=>{if(!Q.sourceSnapshot)throw t("validate",`Overlay source snapshot missing for ${Q.destinationRelativePath}. ${o6}`);return{sourceRelativePath:Fk($,Q.sourcePath),destinationRelativePath:Q.destinationRelativePath,sourceSnapshot:Q.sourceSnapshot}});return{version:jk,projectConfigDir:$,operations:U}}function Sk(){return null}async function Tk($){let v=$.manifest.operations.map((U)=>({sourcePath:O4($.manifest.projectConfigDir,U.sourceRelativePath),destinationRelativePath:U.destinationRelativePath,sourceSnapshot:U.sourceSnapshot}));await Ak(v,$.mergedConfigDir,$.copySeams)}async function Rk($){if($.manifest.operations.length===0)return"best-effort-js";let v=$.nativeHelper??Sk();if(v)return await v.applyManifest($.manifest,$.mergedConfigDir),"native-fd";if($.hardeningMode==="native-fd-required")throw t("validate",`Native fd helper required for overlay merge, but none is available in this Bun/Node runtime. ${o6}`);return await Tk({manifest:$.manifest,mergedConfigDir:$.mergedConfigDir,copySeams:$.copySeams}),"best-effort-js"}async function Ek($){let v=xY($),U;try{U=await m0(v)}catch(_){throw t("validate",`Unable to resolve project directory ${v}: ${C$(_)}`)}let Q;try{Q=await m0($)}catch(_){throw t("validate",`Unable to resolve project config directory ${$}: ${C$(_)}`)}if(!yY(U,Q))throw t("validate",`Project .opencode root resolves outside project directory: ${$}`);return Q}function Pk($){if($ instanceof d)return $;return t("copy",`Failed to prepare temporary merged config directory: ${C$($)}`)}async function KH($){let v=A6($.projectDir),U=$.hardeningMode??"best-effort-js",Q=null;try{Q=await Uk(F6(Ik(),Gk)),await Ok($.profileDir,Q);let _="best-effort-js";if(v){let Y=await Ek(v),z=await Zk(Y),I=await wk(Y,$.seams?.collection),X=Mk(I,z),q=Nk(Y,X);_=await Rk({manifest:q,mergedConfigDir:Q,hardeningMode:U,copySeams:$.seams?.copy,nativeHelper:$.seams?.nativeHelper})}let J=Q;return{path:J,cleanup:()=>IH(J),hardeningLevel:_}}catch(_){let J=Pk(_);if(Q)try{await IH(Q)}catch(Y){J.message=`${J.message}
|
|
172
|
+
Cleanup warning: ${C$(Y)}`}throw J}}var qk,Gk="ocx-oc-merged-",jk=1,o6="Full TOCTOU/symlink-swap hardening requires an fd-based native helper transaction.",Bk;var HH=b(()=>{E4();Z6();Z4();z$();q1();qk=["agent","agents","skill","skills"];Bk=K.object({include:K.array(K.string()).optional(),exclude:K.array(K.string()).optional()}).passthrough()});import*as V4 from"path";function m8($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function xk($){if($.length===0)return"Unknown parse error";let v=$[0];if(!v)return"Unknown parse error";return`${_6(v.error)} at offset ${v.offset}`}function g8($){if($.length===0)return"$";let v="";for(let U of $){if(typeof U==="number"){v+=`[${U}]`;continue}v=v.length===0?U:`${v}.${U}`}return v}function v2($,v,U,Q){if($===void 0)return;if(m8($)){for(let[_,J]of Object.entries($))v2(J,v,[...U,_],Q);return}if(Array.isArray($)){for(let[_,J]of $.entries())v2(J,v,[...U,_],Q);return}Q.set(g8(U),v)}function uk($,v,U,Q){let _=Array.from(new Set([...$,...v])),J=new Map;for(let Y of $)if(!J.has(Y))J.set(Y,"profile");for(let Y of v)if(!J.has(Y))J.set(Y,"local");for(let[Y,z]of _.entries())Q.set(g8([...U,Y]),J.get(z)??"local")}function yk($,v,U,Q){let _=[...$,...v],J=fJ(_),Y=new Map;for(let z=_.length-1;z>=0;z--){let I=_[z];if(!I)continue;let X=hv(I);if(!Y.has(X))Y.set(X,z<$.length?"profile":"local")}for(let[z,I]of J.entries()){let X=hv(I);Q.set(g8([...U,z]),Y.get(X)??"local")}}function WH($,v){return $.length===1&&$[0]===v}function bH($){let{profileValue:v,localValue:U,pathSegments:Q,origins:_}=$;if(U===void 0){v2(v,"profile",Q,_);return}if(v===void 0){v2(U,"local",Q,_);return}if(m8(v)&&m8(U)){let J=new Set([...Object.keys(v),...Object.keys(U)]);for(let Y of J)bH({profileValue:v[Y],localValue:U[Y],pathSegments:[...Q,Y],origins:_});return}if(Array.isArray(v)&&Array.isArray(U)){if(WH(Q,"instructions")){if(v.every((J)=>typeof J==="string")&&U.every((J)=>typeof J==="string")){uk(v,U,Q,_);return}}if(WH(Q,"plugin")){if(v.every((J)=>typeof J==="string")&&U.every((J)=>typeof J==="string")){yk(v,U,Q,_);return}}}v2(U,"local",Q,_)}function Ck($){let v=new Map;return bH({profileValue:$.profileConfig,localValue:$.localConfig,pathSegments:[],origins:v}),v}function fk($){if(!$.startsWith("{file:"))return null;if(!$.endsWith("}"))return null;let v=$.slice(6,-1);return v.length>0?v:null}function mk($){return/^[A-Za-z]:[\\/]/.test($)}function gk($){if($.startsWith("~"))return!1;if(V4.isAbsolute($))return!1;if(mk($))return!1;return!0}function hk($){let v=fk($.value);if(!v)return $.value;let U=g8($.pathSegments);if($.origins.get(U)!=="profile")return $.value;if(!gk(v))return $.value;return`{file:${V4.resolve($.profileDir,v)}}`}function CY($){let{value:v,pathSegments:U,origins:Q,profileDir:_}=$;if(typeof v==="string")return hk({value:v,pathSegments:U,origins:Q,profileDir:_});if(Array.isArray(v))return v.map((J,Y)=>CY({value:J,pathSegments:[...U,Y],origins:Q,profileDir:_}));if(m8(v)){let J={};for(let[Y,z]of Object.entries(v))J[Y]=CY({value:z,pathSegments:[...U,Y],origins:Q,profileDir:_});return J}return v}async function ck($){let v=A6($);if(!v)return{};let U=V4.join(v,gv),Q=Bun.file(U);if(!await Q.exists())return{};let _;try{_=await Q.text()}catch(z){let I=z instanceof Error?z.message:"Unknown read error";throw new d(`Failed to read local OpenCode config at ${U}: ${I}`)}let J=[],Y=E$(_,J,{allowTrailingComma:!0});if(J.length>0){let z=xk(J);throw new d(`Invalid JSONC in local OpenCode config at ${U}: ${z}`)}if(!Y||typeof Y!=="object"||Array.isArray(Y))throw new d(`Invalid local OpenCode config at ${U}: root must be an object`);return Y}async function lk($){let v=await ck($.projectDir),U=Ck({profileConfig:$.profileConfig,localConfig:v});return CY({value:$.mergedConfig,pathSegments:[],origins:U,profileDir:$.profileDir})}function dk($){let v=new Set,U=[];for(let Q=$.length-1;Q>=0;Q--){let _=$[Q];if(!v.has(_))v.add(_),U.unshift(_)}return U}function pk($){return $.configBin??$.envBin??"opencode"}function BH($){return $.includes("/")||$.includes("\\")}function ik($){let{configuredBin:v,cwd:U}=$,Q=$.resolveExecutable??((J)=>Bun.which(J));if(!v.trim())throw Error("OpenCode launcher is empty and cannot be resolved to a stable path");if(BH(v))return V4.isAbsolute(v)?v:V4.resolve(U,v);let _=Q(v);if(!_)throw Error(`OpenCode launcher "${v}" is not available in PATH and cannot be used as OPENCODE_BIN`);return V4.isAbsolute(_)?_:V4.resolve(U,_)}function nk($){let v=$.resolveExecutable??((X)=>Bun.which(X)),U=$.argv??process.argv,Q=$.execPath??process.execPath,_=$.isCompiledBinary??(typeof Bun<"u"&&typeof Bun.main==="string"&&Bun.main.startsWith("/$bunfs/")),J=$.inheritedOcxBin?.trim(),Y=_?Q:U[1],z=J&&J.length>0?J:Y;if(!z?.trim())throw Error("OCX executable path is empty and cannot be resolved from the current process");if(BH(z))return V4.isAbsolute(z)?z:V4.resolve($.cwd,z);let I=v(z);if(!I)throw Error(`OCX executable "${z}" is not available in PATH and cannot be persisted as OCX_BIN`);return V4.isAbsolute(I)?I:V4.resolve($.cwd,I)}function rk($){let v=Boolean($.profileName),{OPENCODE_DISABLE_PROJECT_CONFIG:U,OPENCODE_BIN:Q,OCX_CONTEXT:_,OCX_BIN:J,OCX_PROFILE:Y,...z}=$.baseEnv;return{...z,...$.opencodeBin!==void 0&&{OPENCODE_BIN:$.opencodeBin},...v&&{OPENCODE_DISABLE_PROJECT_CONFIG:"true"},OPENCODE_CONFIG_DIR:$.configDir??(v?h$($.profileName):N4()),...$.configContent&&{OPENCODE_CONFIG_CONTENT:$.configContent},...v&&{OCX_CONTEXT:"1"},...v&&$.ocxBin&&{OCX_BIN:$.ocxBin},...$.profileName&&{OCX_PROFILE:$.profileName}}}function ZH($){$.command("oc").alias("opencode").description("Launch OpenCode with resolved configuration").option("-p, --profile <name>","Use specific profile").option("--no-rename","Disable terminal/tmux window renaming").allowUnknownOption().allowExcessArguments(!0).action(async(v,U)=>{try{await ok(U.args,v)}catch(Q){_$(Q)}})}async function ok($,v){let U=process.cwd(),Q=await j6.create(U,{profile:v.profile}),_=Q.resolve(),J=Q.getProfile();if(_.profileName)W.info(`Using profile: ${_.profileName}`);let Y=J?.ocx,z=v.rename!==!1&&Y?.renameWindow!==!1;if(_.profileName){let w=k6(_.profileName);if(!await Bun.file(w).exists())W.warn(`No opencode.jsonc found at ${w}. Create one to customize OpenCode settings.`)}let I=_.opencode;if(_.profileName)I=await lk({mergedConfig:_.opencode,profileConfig:J?.opencode??{},projectDir:U,profileDir:h$(_.profileName)});let X=Array.isArray(I.instructions)?I.instructions:[],q=[..._.instructions,...X],G=dk(q),j=G.length>0||Object.keys(I).length>0?{...I,instructions:G.length>0?G:void 0}:void 0,H=null,Z=null,D=null,E=null,A=null,r=()=>{if(H)H.kill("SIGINT");else A=130},O=()=>{if(H)H.kill("SIGTERM");else A=143},g=()=>{if(z)RY()};try{if(process.on("SIGINT",r),process.on("SIGTERM",O),process.on("exit",g),A!==null){E=A;return}if(_.profileName)Z=await KH({projectDir:U,profileDir:h$(_.profileName)});if(A!==null){E=A;return}if(z){QH();let a=await eK(U);if(A!==null){E=A;return}UH(JH(U,_.profileName??"default",a))}if(A!==null){E=A;return}let w=pk({configBin:Y?.bin,envBin:process.env.OPENCODE_BIN}),N=Boolean(_.profileName),L=N?ik({configuredBin:w,cwd:U}):w,U$=N?nk({cwd:U,inheritedOcxBin:process.env.OCX_BIN}):void 0,$$=j?JSON.stringify(j):void 0;try{H=Bun.spawn({cmd:[L,...$],cwd:U,env:rk({baseEnv:process.env,profileName:_.profileName??void 0,ocxBin:U$,opencodeBin:L,configDir:Z?.path,configContent:$$}),stdin:"inherit",stdout:"inherit",stderr:"inherit"})}catch(a){throw t("spawn",`Failed to launch OpenCode binary "${w}": ${a instanceof Error?a.message:String(a)}`)}E=await H.exited}catch(w){D=w instanceof Error?w:t("spawn",`OpenCode process failed: ${String(w)}`)}finally{if(process.off("SIGINT",r),process.off("SIGTERM",O),process.off("exit",g),z)RY();if(Z)try{await Z.cleanup()}catch(w){if(D!==null||A!==null||E!==null&&E!==0)W.warn(`Cleanup warning: ${w instanceof Error?w.message:String(w)}`);else D=w instanceof Error?w:t("cleanup",`Failed to remove temporary merged config directory: ${String(w)}`)}}if(D)throw D;if(E!==null)process.exit(E)}var DH=b(()=>{E4();cv();Z4();Y8();z$();$H();l$();i$();i6();YH();HH()});import{existsSync as g0}from"fs";import{mkdir as fY,mkdtemp as tk,rename as ak,rm as VH,writeFile as sk}from"fs/promises";import{dirname as MH,join as h8,relative as ek}from"path";function wH($,v,U){let Q=U instanceof Error?U.message:String(U);return`${$} "${v}" (${Q})`}function OH($,v){let[U,Q]=v.split("/");if(!U||!Q)return;return`${p$($)}/components/${Q}.json`}function LH($){if(!$)return null;let[v,U,...Q]=$.split("/");if(!v||!U||Q.length>0)return null;return{registryName:v,componentName:U}}function $A($,v){if(!$)return{};let U;try{let Y=new URL($),z=Y.pathname.match(/(?:^|\/)components\/([^/]+)\.json$/);if(z?.[1])U=decodeURIComponent(z[1]);else{let I=Y.pathname.match(/(?:^|\/)components\/([^/]+)\/.+$/);if(I?.[1])U=decodeURIComponent(I[1])}}catch{}let Q=p$($),_,J=-1;for(let[Y,z]of Object.entries(v)){let I=p$(z.url);if(!(Q===I||Q.startsWith(`${I}/`))||I.length<=J)continue;_=Y,J=I.length}return{registryName:_,componentName:U}}function vA($){let v=$.depRefs[0]??`${$.namespace}/${$.component}`,U={...$.profileRegistries,...$.profileRegistries[$.namespace]?{}:{[$.namespace]:{url:$.registryUrl}}},Q=$.error.registryName,_=$.error.qualifiedName,J=LH(_);if(!Q&&J)Q=J.registryName;let Y=J?.componentName,z=_&&!J&&!_.includes("/")?_:void 0,I=$A($.error.url,U);if(!Q&&I.registryName)Q=I.registryName;let X=Y??z??I.componentName;if((!_||!J)&&Q&&X)_=`${Q}/${X}`;if(!_)_=v;if(!Q)Q=LH(_)?.registryName??$.namespace;let q=U[Q]?.url||(Q===$.namespace?$.registryUrl:void 0);return{registryName:Q,qualifiedName:_,fallbackUrl:$.error.url||(q?OH(q,_):void 0)}}function kH($,v){let U=$.phase??v.fallbackPhase,Q=$.url??v.fallbackUrl,_=[`phase: ${U}`,`qualifiedName: ${v.qualifiedName}`,`registryContext: ${v.registryContext}`,`registryName: ${v.registryName}`,...Q?[`url: ${Q}`]:[]];return new P$(`${$.message} (${_.join(", ")})`,{url:Q,status:$.status,statusText:$.statusText,phase:U,qualifiedName:v.qualifiedName,registryContext:v.registryContext,registryName:v.registryName})}function AH($,v){if(!$.startsWith(".opencode/"))throw new M(`Invalid embedded target "${$}": expected .opencode/ prefix for embedded profile files.`);let U=$.slice(10);if(!U)throw new M(`Invalid embedded target "${$}": missing path after .opencode/ prefix.`);let Q;try{Q=O4(v,U)}catch(J){if(J instanceof U4)throw new M(`Invalid embedded target "${$}": ${J.message}`);throw J}let _=ek(v,Q).replace(/\\/g,"/");if(_==="."||_==="")throw new M(`Invalid embedded target "${$}": target must resolve to a file path.`);return _}async function mY($){let{namespace:v,component:U,profileName:Q,registryUrl:_,quiet:J}=$;if(!q6.safeParse(Q).success)throw new M(`Invalid profile name: "${Q}". Profile names must start with a letter and contain only alphanumeric characters, dots, underscores, or hyphens.`);let z;if(v)z=v;else throw new M(`Registry name is required for URL-based profile installs.
|
|
131
173
|
|
|
132
|
-
Use a qualified component reference (e.g., 'my-registry/${
|
|
174
|
+
Use a qualified component reference (e.g., 'my-registry/${U}') or specify --name to provide a registry alias.`);let I=h$(Q),X=`${z}/${U}`;if(g0(I))throw new t$(`Profile "${Q}" already exists. Remove it first with 'ocx profile rm ${Q} --global'.`);let G=J?null:D$({text:`Fetching ${X}...`});G?.start();let j;try{j=await dv(_,U)}catch(w){if(G?.fail(`Failed to fetch ${X}`),w instanceof P$)throw kH(w,{registryContext:"source",registryName:z,qualifiedName:X,fallbackPhase:"packument-fetch",fallbackUrl:OH(_,X)});if(w instanceof B$)throw new B$(`Profile component "${X}" not found in registry.
|
|
133
175
|
|
|
134
|
-
Check the component name and ensure the registry is configured.`);throw
|
|
176
|
+
Check the component name and ensure the registry is configured.`);throw w}if(j.type!=="profile")throw G?.fail("Invalid component type"),new M(`Component "${X}" is type "${j.type}", not "profile".
|
|
135
177
|
|
|
136
|
-
Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let
|
|
178
|
+
Only profile components can be installed with 'ocx profile add --source <ns/comp> --global'.`);let H=j1(j);G?.succeed(`Fetched ${X}`);let Z=J?null:D$({text:"Downloading profile files..."});Z?.start();let D=[],E=[];for(let w of H.files){let N=await D1(_,U,w.path),L={path:w.path,target:w.target,content:Buffer.from(N)};if(w.target.startsWith(".opencode/"))E.push(L);else D.push(L)}Z?.succeed(`Downloaded ${H.files.length} files`);let A=L6();await fY(A,{recursive:!0,mode:448});let r=await tk(h8(A,".staging-")),O=!1,g=!1;try{let w=J?null:D$({text:"Writing profile files..."});w?.start();let N=new Map;for(let $$ of D){let a=w0($$.target,r),V$=h8(r,a);L1(N,{absolutePath:V$,relativePath:a,content:$$.content,source:`${U}:${$$.path}`})}for(let $$ of E){let a=AH($$.target,r),V$=w0(a,r),x=h8(r,V$);L1(N,{absolutePath:x,relativePath:V$,content:$$.content,source:`${U}:${$$.path}`})}for(let $$ of N.values()){let a=$$.absolutePath,V$=MH(a);if(!g0(V$))await fY(V$,{recursive:!0});await sk(a,$$.content)}w?.succeed(`Wrote ${N.size} profile files`),await y4(r,{version:1,root:I,installed:{}});let L=J?null:D$({text:"Moving to profile directory..."});L?.start();let U$=MH(I);if(!g0(U$))await fY(U$,{recursive:!0,mode:448});if(await ak(r,I),O=!0,L?.succeed("Profile installed"),j.dependencies.length>0){let $$=J?null:D$({text:"Installing dependencies..."});$$?.start();let a=j.dependencies.map((x)=>x.includes("/")?x:`${z}/${x}`),V$={};try{let x=h8(I,"ocx.jsonc");if(g0(x)){let h=await Bun.file(x).text(),I$=E$(h),v$=V6.safeParse(I$);if(v$.success)V$=v$.data.registries??{};else if(q4(I$)&&"registries"in I$)throw new d(`Invalid registries in profile "${Q}": ${v$.error.message}`)}await LY(a,{profile:Q,quiet:J},{cwd:I,getRegistries:()=>V$,getComponentPath:()=>""}),$$?.succeed(`Installed ${j.dependencies.length} dependencies`)}catch(x){if($$?.fail("Failed to install dependencies"),x instanceof P$){let o=vA({error:x,depRefs:a,namespace:z,component:U,registryUrl:_,profileRegistries:V$});throw kH(x,{registryContext:"dependency",registryName:o.registryName,qualifiedName:o.qualifiedName,fallbackPhase:"packument-fetch",fallbackUrl:o.fallbackUrl})}throw x}}if(g=!0,!J){W.info(""),W.success(`Installed profile "${Q}" from ${X}`),W.info(""),W.info("Profile contents:");for(let $$ of D)W.info(` ${$$.target}`);for(let $$ of E){let a=AH($$.target,I);W.info(` ${a}`)}}}catch(w){let N=[];try{if(g0(r))await VH(r,{recursive:!0})}catch(L){N.push(wH("Profile add rollback cleanup warning: failed to remove staging directory",r,L))}if(O&&!g)try{if(g0(I))await VH(I,{recursive:!0,force:!0})}catch(L){N.push(wH("Profile add rollback cleanup warning: failed to remove promoted profile",I,L))}if(!J)for(let L of N)W.warn(L);throw w}}var FH=b(()=>{E4();Z4();Q8();V1();X4();M0();t4();EJ();z$();i$();q1();W8();$6();kY()});function _A($){if(!$?.trim())throw new M("--source value cannot be empty");let v=$.trim();if((v.match(/\//g)||[]).length!==1)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);let[Q,_]=v.split("/").map((J)=>J.trim());if(!Q||!_)throw new M(`Invalid --source format: "${$}". Expected: namespace/component`);return{namespace:Q,component:_}}async function UA(){let $="global ocx config";try{let v=await jG();$=v.path;let U=v.content,Q=E$(U,[],{allowTrailingComma:!0});return V6.parse(Q)}catch(v){if(v instanceof n6)throw v;if(v instanceof Error)throw new d(`Failed to parse global config at "${$}": ${v.message}
|
|
137
179
|
|
|
138
|
-
Check the file for syntax errors or run: ocx config edit --global`);throw
|
|
180
|
+
Check the file for syntax errors or run: ocx config edit --global`);throw v}}async function QA($){let v;try{v=await UA()}catch(Q){if(Q instanceof n6)throw new d(`Registry "${$}" is not configured globally.
|
|
139
181
|
|
|
140
182
|
Profile installation requires global registry configuration.
|
|
141
|
-
${
|
|
142
|
-
Run: ocx registry add <url> --name ${
|
|
183
|
+
${Q.message}
|
|
184
|
+
Run: ocx registry add <url> --name ${$} --global`);throw Q}let U=v.registries[$];if(!U)throw new d(`Registry "${$}" is not configured globally.
|
|
143
185
|
|
|
144
186
|
Profile installation requires global registry configuration.
|
|
145
|
-
Run: ocx registry add <url> --name ${
|
|
187
|
+
Run: ocx registry add <url> --name ${$} --global`);return{config:v,registryUrl:U.url}}function NH($){$.command("add <name>").description("Create a new profile (--global required), clone from existing, or install from registry").option("--clone <profile>","Clone from existing global profile").option("--source <namespace/component>","Install from registry (requires --global)").option("--from <url>","Ephemeral registry URL for --source (does not persist)").option("-g, --global","Create global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").addHelpText("after",`
|
|
146
188
|
Examples:
|
|
147
189
|
$ ocx profile add work --global # Create global profile (~/.config/opencode/profiles/work/)
|
|
148
190
|
$ ocx profile add work --clone dev --global # Clone from existing global profile
|
|
149
191
|
$ ocx profile add work --source kdco/minimal --global # Install from configured registry
|
|
150
192
|
$ ocx profile add work --source kdco/minimal --from http://r.com --global # Install from ephemeral registry
|
|
151
|
-
`).action(async(
|
|
193
|
+
`).action(async(v,U)=>{try{let Q=await JA(v,U);if(U.json)F$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function JA($,v){let U=v.json===!0;if(v.clone&&(v.source||v.from))throw new M(`--clone cannot be used with --source or --from.
|
|
152
194
|
|
|
153
195
|
Use one of:
|
|
154
196
|
ocx profile add <name> --clone <profile> --global # Clone existing profile
|
|
155
|
-
ocx profile add <name> --source <ns/comp> --global # Install from registry`);if(
|
|
197
|
+
ocx profile add <name> --source <ns/comp> --global # Install from registry`);if(v.from&&!v.source){let J=v.from.trim(),Y=J.startsWith("http://")||J.startsWith("https://");if((J.match(/\//g)||[]).length===1&&!Y)throw new M(`Invalid option: --from requires --source.
|
|
156
198
|
|
|
157
199
|
Migration: The --from option now only accepts registry URLs.
|
|
158
200
|
Use --source for namespace/component references:
|
|
159
201
|
|
|
160
|
-
ocx profile add ${
|
|
202
|
+
ocx profile add ${$} --source ${J} --global`);if(Y){let I;try{let X=new URL(J),q=X.pathname.split("/").filter(Boolean);if(q.length>=2){let G=q.slice(-2).join("/");X.pathname=q.slice(0,-2).join("/")||"/";let j=X.toString().replace(/\/$/,"");I=`Migration: Separate the registry URL and component:
|
|
161
203
|
|
|
162
|
-
ocx profile add ${
|
|
204
|
+
ocx profile add ${$} --source ${G} --from ${j} --global`}else I=`Migration: Separate the registry URL and component:
|
|
163
205
|
|
|
164
|
-
ocx profile add ${
|
|
206
|
+
ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}catch{I=`Migration: Separate the registry URL and component:
|
|
165
207
|
|
|
166
|
-
ocx profile add ${
|
|
208
|
+
ocx profile add ${$} --source <namespace/component> --from <registry-url> --global`}throw new M(`Invalid option: --from requires --source.
|
|
167
209
|
|
|
168
|
-
${
|
|
210
|
+
${I}`)}throw new M(`Invalid option: --from requires --source.
|
|
169
211
|
|
|
170
212
|
Did you mean to clone a profile?
|
|
171
213
|
|
|
172
|
-
ocx profile add ${
|
|
214
|
+
ocx profile add ${$} --clone ${J} --global`)}if(v.source&&!v.global)throw new M(`--source requires --global flag.
|
|
173
215
|
|
|
174
216
|
Profile installation from registries is only supported for global profiles:
|
|
175
217
|
|
|
176
|
-
ocx profile add ${
|
|
218
|
+
ocx profile add ${$} --source ${v.source} --global`);if(v.from){let J=v.from.trim();try{let Y=new URL(J);if(Y.protocol!=="http:"&&Y.protocol!=="https:")throw new M(`Invalid --from value: "${v.from}".
|
|
177
219
|
|
|
178
220
|
--from must be a registry URL with http:// or https:// protocol.
|
|
179
|
-
For profile cloning, use --clone instead.`);if(!Y.hostname)throw new
|
|
221
|
+
For profile cloning, use --clone instead.`);if(!Y.hostname)throw new M(`Invalid --from value: "${v.from}".
|
|
180
222
|
|
|
181
223
|
--from must be a valid registry URL with a hostname.
|
|
182
|
-
Example: --from https://registry.example.com`)}catch(Y){if(Y instanceof
|
|
224
|
+
Example: --from https://registry.example.com`)}catch(Y){if(Y instanceof M)throw Y;throw new M(`Invalid --from value: "${v.from}".
|
|
183
225
|
|
|
184
226
|
--from must be a valid registry URL (http:// or https://).
|
|
185
|
-
Example: --from https://registry.example.com`)}}if(!
|
|
227
|
+
Example: --from https://registry.example.com`)}}if(!v.global)throw new d(`Local profiles are unsupported. Use --global to create a global profile.
|
|
186
228
|
|
|
187
|
-
ocx profile add ${
|
|
229
|
+
ocx profile add ${$} --global`);let Q="global",_=await c$.requireInitialized();if(v.clone)return await zA(_,$,v.clone,U),{name:$,scope:Q,mode:"clone",cloneFrom:v.clone};if(v.source){let{namespace:J,component:Y}=_A(v.source),z;if(v.from)z=p$(v.from.trim()),await mY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});else z=(await QA(J)).registryUrl,await mY({namespace:J,component:Y,profileName:$,registryUrl:z,quiet:U});return{name:$,scope:Q,mode:"registry",registry:{namespace:J,component:Y,url:z,ephemeral:Boolean(v.from)}}}return await YA(_,$,U),{name:$,scope:Q,mode:"empty"}}async function YA($,v,U){if(await $.exists(v))throw new g6(v,`Remove it first with 'ocx profile rm ${v} --global'.`);if(await $.add(v),!U)W.success(`Created global profile "${v}"`)}async function zA($,v,U,Q){if(await $.exists(v))throw new g6(v,`Remove it first with 'ocx profile rm ${v} --global'.`);try{await $.get(U)}catch(z){if(z instanceof m$)throw new m$(U,`Profile '${U}' not found in global scope.`);if(z instanceof b$)throw z;throw new M(`Failed to load profile '${U}': ${z instanceof Error?z.message:String(z)}`)}await $.add(v);let J=B4(U),Y=B4(v);if(await IG(J,Y),!Q)W.success(`Created global profile "${v}" (cloned from "${U}")`)}var SH=b(()=>{E4();_8();G6();Z4();M0();z$();l$();i$();FH()});function TH($){$.command("list").alias("ls").description("List profiles (use --global; local profiles are unsupported)").option("-g, --global","List global profiles (required \u2014 local profiles are unsupported)").addOption(g4.json()).action(async(v)=>{try{await IA(v)}catch(U){_$(U,{json:v.json})}})}async function IA($){if(!$.global)throw new d(`Local profiles are unsupported. Use --global to list global profiles.
|
|
188
230
|
|
|
189
|
-
ocx profile list --global`);let
|
|
231
|
+
ocx profile list --global`);let U=await(await c$.requireInitialized()).list();if($.json){console.log(JSON.stringify({profiles:U,initialized:!0},null,2));return}let Q="Global profiles:",_="No global profiles found. Run 'ocx profile add <name> --global' to create one.";if(U.length===0){console.log(_);return}console.log(Q);for(let J of U)console.log(` ${J}`)}var RH=b(()=>{G6();z$();l$();s4()});function EH($){$.command("move <old-name> <new-name>").alias("mv").description("Move (rename) a profile (use --global; local profiles are unsupported)").option("-g, --global","Move global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(v,U,Q)=>{try{let _=await XA(v,U,Q);if(Q.json)F$({success:!0,data:_})}catch(_){_$(_,{json:Q.json})}})}async function XA($,v,U){if(!U.global)throw new d(`Local profiles are unsupported. Use --global to move a global profile.
|
|
190
232
|
|
|
191
|
-
ocx profile move ${
|
|
233
|
+
ocx profile move ${$} ${v} --global`);let Q=await c$.requireInitialized(),{warnActiveProfile:_}=await Q.move($,v);if(_&&!U.json)W.warn(`Moving active profile. Update OCX_PROFILE env var to "${v}".`);if(!U.json)W.success(`Moved global profile "${$}" \u2192 "${v}"`);return{from:$,to:v,scope:"global",warnActiveProfile:_}}var PH=b(()=>{G6();z$();l$();i$()});function xH($){$.command("remove <name>").alias("rm").description("Delete a profile (use --global; local profiles are unsupported)").option("-g, --global","Remove global profile (required \u2014 local profiles are unsupported)").option("--json","Output as JSON").action(async(v,U)=>{try{let Q=await qA(v,U);if(U.json)F$({success:!0,data:Q})}catch(Q){_$(Q,{json:U.json})}})}async function qA($,v){if(!v.global)throw new d(`Local profiles are unsupported. Use --global to remove a global profile.
|
|
192
234
|
|
|
193
|
-
ocx profile remove <name> --global`);let
|
|
235
|
+
ocx profile remove <name> --global`);let U=await c$.requireInitialized();if(!await U.exists($))throw new m$($);if(await U.remove($),!v.json)W.success(`Deleted global profile "${$}"`);return{name:$,scope:"global"}}var uH=b(()=>{G6();z$();l$();i$()});function yH($){$.command("show [name]").description("Display profile contents (use --global; local profiles are unsupported)").option("-g, --global","Show global profile (required \u2014 local profiles are unsupported)").addOption(g4.json()).action(async(v,U)=>{try{await GA(v,U)}catch(Q){_$(Q,{json:U.json})}})}async function GA($,v){if(!v.global)throw new d(`Local profiles are unsupported. Use --global to show a global profile.
|
|
194
236
|
|
|
195
|
-
ocx profile show [name] --global`);let
|
|
196
|
-
Files:`),console.log(` ocx.jsonc: ${
|
|
197
|
-
OCX Config:`),console.log(JSON.stringify(_.ocx,null,2))}var
|
|
198
|
-
`+
|
|
237
|
+
ocx profile show [name] --global`);let U=await c$.requireInitialized(),Q=$??await U.resolveProfile(),_=await U.get(Q);if(v.json){console.log(JSON.stringify(_,null,2));return}if(console.log(`Profile: ${_.name}`),console.log(`
|
|
238
|
+
Files:`),console.log(` ocx.jsonc: ${B4(Q)}`),_.opencode)console.log(` opencode.jsonc: ${k6(Q)}`);if(_.hasAgents)console.log(` AGENTS.md: ${b1(Q)}`);console.log(`
|
|
239
|
+
OCX Config:`),console.log(JSON.stringify(_.ocx,null,2))}var CH=b(()=>{G6();Z4();z$();l$();s4()});function fH($){let v=$.command("profile").alias("p").description("Manage profiles (global only)");TH(v),NH(v),xH(v),EH(v),yH(v)}var mH=b(()=>{SH();RH();PH();uH();CH()});import{existsSync as jA}from"fs";import{dirname as gH,join as hH}from"path";async function KA($,v,U){if(U.isLocked?.())throw Error("Registries are locked. Cannot add.");let Q=$.trim();if(!Q)throw new M("Registry URL is required");try{let Z=new URL(Q);if(!["http:","https:"].includes(Z.protocol))throw new M(`Invalid registry URL: ${Q} (must use http or https)`)}catch(Z){if(Z instanceof M)throw Z;throw new M(`Invalid registry URL: ${Q}`)}let _=p$(Q),J=v.name,Y=U.getRegistries(),z=Y[J],I=HA(Y,_),{fetchRegistryIndex:X}=await Promise.resolve().then(() => (V1(),mG));await X(_);let q=z!==void 0,G=I!==null,j=q&&p$(z.url)===_,H=G&&I.name!==J;if(v.dryRun){let Z=[];if(q&&!j)Z.push(`Registry '${J}' already exists with a different URL (${z.url}). Run 'ocx registry remove ${J}' first, then re-add.`);else if(H)Z.push(`URL '${_}' is already registered under name '${I.name}'. Run 'ocx registry remove ${I.name}' first, then re-add.`);let D=q&&!j||H,E=q&&j,A=U.targetLabel||"config";return{dryRun:!0,command:"registry add",wouldPerform:E?[]:[{action:"add",target:`registry:${J}`,details:{url:_}}],validation:{passed:!D,warnings:Z.length>0?Z:void 0},summary:D?`Would fail: conflict detected for registry '${J}'`:E?`Registry '${J}' already configured with same URL (no-op)`:`Would add registry '${J}' to ${A}`}}if(q&&!j)throw new W0(J,z.url,_,U.targetLabel);if(H)throw new W0(J,_,_,U.targetLabel,I.name);if(q&&j)return{name:J,url:_,updated:!1,alreadyConfigured:!0};return await U.setRegistry(J,{url:_}),{name:J,url:_,updated:!1,alreadyConfigured:!1}}function HA($,v){for(let[U,Q]of Object.entries($))if(p$(Q.url)===v)return{name:U,config:Q};return null}async function WA($,v){if(v.isLocked?.())throw Error("Registries are locked. Cannot remove.");let U=v.getRegistries();if(!($ in U))throw Error(`Registry '${$}' not found.`);return await v.removeRegistry($),{removed:$}}function bA($){let v=$.getRegistries(),U=$.isLocked?.()??!1;return{registries:Object.entries(v).map(([_,J])=>({name:_,url:J.url})),locked:U}}async function gY($,v,U){let Q=v.getOptionValueSource("cwd")==="cli";if($.global&&$.profile)throw new M("Cannot use both --global and --profile flags");if(Q&&$.profile)throw new M("Cannot use both --cwd and --profile flags");if($.global&&Q)throw new M("Cannot use both --global and --cwd flags");if($.profile){if(Hj($.profile),!await(await c$.requireInitialized()).exists($.profile))throw new m$($.profile);let Y=B4($.profile);if(!jA(Y))throw new d(`Profile '${$.profile}' has no ocx.jsonc. Run 'ocx profile config ${$.profile}' to create it.`);return{scope:"profile",configPath:Y,configDir:gH(Y),targetLabel:`profile '${$.profile}' config`}}if($.global){let J=N4();return{scope:"global",configPath:hH(J,"ocx.jsonc"),configDir:J,targetLabel:"global config"}}let _=p6(U);return{scope:"local",configPath:_.path,configDir:_.exists?gH(_.path):hH(U,".opencode"),targetLabel:"local config"}}function cH($){let v=$.command("registry").description("Manage registries"),U=v.command("add").description("Add a registry").argument("<url>","Registry URL").requiredOption("--name <name>","Registry alias (required, used as lookup key for alias/component refs)").option("--dry-run","Validate registry without adding to config");K6(U),B8(U),Q4(U),U.action(async(J,Y,z)=>{let I;try{let X=Y.cwd??process.cwd();I=await gY(Y,z,X);let{configDir:q,configPath:G}=I,j=await C4(q);if(!j){let D=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${I.targetLabel} not found. ${D}`),process.exit(1)}let H=await KA(J,Y,{getRegistries:()=>j.registries,isLocked:()=>j.lockRegistries??!1,setRegistry:async(D,E)=>{j.registries[D]=E,await a_(q,j,G)},targetLabel:I.targetLabel});if("dryRun"in H&&H.dryRun){T4(H,{json:Y.json,quiet:Y.quiet});return}let Z=H;if(Y.json)F$({success:!0,data:Z});else if(!Y.quiet)if(Z.alreadyConfigured)W.info(`Registry already configured (no changes): ${Z.name}`);else if(Z.updated)W.success(`Updated registry in ${I.targetLabel}: ${Z.name} -> ${Z.url}`);else W.success(`Added registry to ${I.targetLabel}: ${Z.name} -> ${Z.url}`)}catch(X){_$(X,{json:Y.json})}});let Q=v.command("remove").description("Remove a registry").argument("<name>","Registry name");K6(Q),B8(Q),Q4(Q),Q.action(async(J,Y,z)=>{try{let I=Y.cwd??process.cwd(),X=await gY(Y,z,I),q=await C4(X.configDir);if(!q){let j=X.scope==="global"?"Run 'ocx init --global' first.":X.scope==="profile"?`Run 'ocx profile config ${Y.profile}' to create it.`:"Run 'ocx init' first.";W.error(`${X.targetLabel} not found. ${j}`),process.exit(1)}let G=await WA(J,{getRegistries:()=>q.registries,isLocked:()=>q.lockRegistries??!1,removeRegistry:async(j)=>{delete q.registries[j],await a_(X.configDir,q,X.configPath)}});if(Y.json)F$({success:!0,data:G});else if(!Y.quiet)W.success(`Removed registry from ${X.targetLabel}: ${G.removed}`)}catch(I){_$(I,{json:Y.json})}});let _=v.command("list").description("List configured registries");K6(_),B8(_),Q4(_),_.action(async(J,Y)=>{try{let z=J.cwd??process.cwd(),I=await gY(J,Y,z),X=await C4(I.configDir);if(!X){let G=I.scope==="global"?"Run 'ocx init --global' first.":I.scope==="profile"?`Run 'ocx profile config ${J.profile}' to create it.`:"Run 'ocx init' first.";W.warn(`${I.targetLabel} not found. ${G}`);return}let q=bA({getRegistries:()=>X.registries,isLocked:()=>X.lockRegistries??!1});if(J.json)F$({success:!0,data:q});else if(!J.quiet)if(q.registries.length===0)W.info("No registries configured.");else{let G=I.scope==="global"?" (global)":I.scope==="profile"?` (profile '${J.profile}')`:"";W.info(`Configured registries${G}${q.locked?m.yellow(" (locked)"):""}:`);for(let j of q.registries)console.log(` ${m.cyan(j.name)}: ${j.url}`)}}catch(z){_$(z,{json:J.json})}})}var lH=b(()=>{O6();G6();Z4();X4();w1();z$();l$();i$();i6();s4()});function BA($){return $.includes("/")&&!$.includes("::")}function ZA($){try{let{namespace:v,component:U}=o4($);return{registryName:v,componentName:U}}catch(v){throw new M(v instanceof Error?v.message:`Invalid component ref: '${$}'`)}}function DA($,v){return`Ambiguous component reference '${$}'. Found ${v.length} installed matches:
|
|
240
|
+
`+v.map((U)=>` - ${U}`).join(`
|
|
199
241
|
`)+`
|
|
200
242
|
|
|
201
|
-
Use one of the canonical IDs above.`}function
|
|
202
|
-
Run 'ocx search --installed' to see installed components.`}function
|
|
203
|
-
`);if(
|
|
204
|
-
${
|
|
205
|
-
${
|
|
206
|
-
${
|
|
207
|
-
`)}`:"",
|
|
208
|
-
${
|
|
209
|
-
`)}`:"",
|
|
210
|
-
`);throw new
|
|
211
|
-
${S}`)}}for(let{canonicalId:A,files:K}of J){for(let j of K){let S=bW($.cwd,M,j);if(!S){if(F.verbose)W.info(` \u2298 Skipped ${j.path} (not found)`);continue}if(await wW(S,{force:!0}),F.verbose)W.info(` \u2713 Removed ${j.path}`)}delete _.installed[A],q.push(A)}if(await j0($.cwd,_),Y?.succeed(`Removed ${q.length} component(s)`),F.json)console.log(JSON.stringify({success:!0,removed:q,notFound:H},null,2));else if(!F.quiet){W.info("");for(let A of q){let K=R2(A);W.success(`\u2713 Removed ${K.registryName}/${K.name}@${K.revision}`)}W.info(""),W.success(`Done! Removed ${q.length} component(s).`)}}catch(A){throw Y?.fail("Failed to remove components"),A}}var F$=V(()=>{gF();eD();h6();BF();$D();yD();hD();c2();nF();x0();g0()});var $$=c0((B$,m8)=>{((D,F)=>{if(typeof define==="function"&&define.amd)define([],F);else if(typeof m8==="object"&&m8.exports)m8.exports=F();else D.fuzzysort=F()})(B$,(D)=>{var F=(w,E)=>{if(!w||!E)return YD;var u=A(w);if(!f(E))E=M(E);var m=u.bitflags;if((m&E._bitflags)!==m)return YD;return j(u,E)},B=(w,E,u)=>{if(!w)return u?.all?K(E,u):bD;var m=A(w),g=m.bitflags,h=m.containsSpace,C=X(u?.threshold||0),o=u?.limit||_D,d=0,WD=0,HD=E.length;function $0(u2){if(d<o)WF.add(u2),++d;else if(++WD,u2._score>WF.peek()._score)WF.replaceTop(u2)}if(u?.key){var nD=u.key;for(var GD=0;GD<HD;++GD){var tD=E[GD],UD=v(tD,nD);if(!UD)continue;if(!f(UD))UD=M(UD);if((g&UD._bitflags)!==g)continue;var wD=j(m,UD);if(wD===YD)continue;if(wD._score<C)continue;wD.obj=tD,$0(wD)}}else if(u?.keys){var M2=u.keys,M0=M2.length;D:for(var GD=0;GD<HD;++GD){var tD=E[GD];{var sD=0;for(var JD=0;JD<M0;++JD){var nD=M2[JD],UD=v(tD,nD);if(!UD){k[JD]=B0;continue}if(!f(UD))UD=M(UD);k[JD]=UD,sD|=UD._bitflags}if((g&sD)!==g)continue}if(h)for(let VD=0;VD<m.spaceSearches.length;VD++)FD[VD]=r;for(var JD=0;JD<M0;++JD){if(UD=k[JD],UD===B0){i[JD]=B0;continue}if(i[JD]=j(m,UD,!1,h),i[JD]===YD){i[JD]=B0;continue}if(h)for(let OD=0;OD<m.spaceSearches.length;OD++){if(KD[OD]>-1000){if(FD[OD]>r){var cD=(FD[OD]+KD[OD])/4;if(cD>FD[OD])FD[OD]=cD}}if(KD[OD]>FD[OD])FD[OD]=KD[OD]}}if(h){for(let VD=0;VD<m.spaceSearches.length;VD++)if(FD[VD]===r)continue D}else{var qD=!1;for(let VD=0;VD<M0;VD++)if(i[VD]._score!==r){qD=!0;break}if(!qD)continue}var q0=new q(M0);for(let VD=0;VD<M0;VD++)q0[VD]=i[VD];if(h){var gD=0;for(let VD=0;VD<m.spaceSearches.length;VD++)gD+=FD[VD]}else{var gD=r;for(let OD=0;OD<M0;OD++){var wD=q0[OD];if(wD._score>-1000){if(gD>r){var cD=(gD+wD._score)/4;if(cD>gD)gD=cD}}if(wD._score>gD)gD=wD._score}}if(q0.obj=tD,q0._score=gD,u?.scoreFn){if(gD=u.scoreFn(q0),!gD)continue;gD=X(gD),q0._score=gD}if(gD<C)continue;$0(q0)}}else for(var GD=0;GD<HD;++GD){var UD=E[GD];if(!UD)continue;if(!f(UD))UD=M(UD);if((g&UD._bitflags)!==g)continue;var wD=j(m,UD);if(wD===YD)continue;if(wD._score<C)continue;$0(wD)}if(d===0)return bD;var A2=Array(d);for(var GD=d-1;GD>=0;--GD)A2[GD]=WF.poll();return A2.total=d+WD,A2},$=(w,E="<b>",u="</b>")=>{var m=typeof E==="function"?E:void 0,g=w.target,h=g.length,C=w.indexes,o="",d=0,WD=0,HD=!1,$0=[];for(var nD=0;nD<h;++nD){var GD=g[nD];if(C[WD]===nD){if(++WD,!HD)if(HD=!0,m)$0.push(o),o="";else o+=E;if(WD===C.length){if(m)o+=GD,$0.push(m(o,d++)),o="",$0.push(g.substr(nD+1));else o+=GD+u+g.substr(nD+1);break}}else if(HD)if(HD=!1,m)$0.push(m(o,d++)),o="";else o+=u;o+=GD}return m?$0:o},_=(w)=>{if(typeof w==="number")w=""+w;else if(typeof w!=="string")w="";var E=s(w);return H(w,{_targetLower:E._lower,_targetLowerCodes:E.lowerCodes,_bitflags:E.bitflags})},Q=()=>{O.clear(),b.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((w,E)=>w-E)}set["indexes"](w){return this._indexes=w}["highlight"](w,E){return $(this,w,E)}get["score"](){return J(this._score)}set["score"](w){this._score=X(w)}}class q extends Array{get["score"](){return J(this._score)}set["score"](w){this._score=X(w)}}var H=(w,E)=>{let u=new Y;return u.target=w,u.obj=E.obj??YD,u._score=E._score??r,u._indexes=E._indexes??[],u._targetLower=E._targetLower??"",u._targetLowerCodes=E._targetLowerCodes??YD,u._nextBeginningIndexes=E._nextBeginningIndexes??YD,u._bitflags=E._bitflags??0,u},J=(w)=>{if(w===r)return 0;if(w>1)return w;return Math.E**(((-w+1)**0.04307-1)*-2)},X=(w)=>{if(w===0)return r;if(w>1)return w;return 1-Math.pow(Math.log(w)/-2+1,23.218017181332716)},z=(w)=>{if(typeof w==="number")w=""+w;else if(typeof w!=="string")w="";w=w.trim();var E=s(w),u=[];if(E.containsSpace){var m=w.split(/\s+/);m=[...new Set(m)];for(var g=0;g<m.length;g++){if(m[g]==="")continue;var h=s(m[g]);u.push({lowerCodes:h.lowerCodes,_lower:m[g].toLowerCase(),containsSpace:!1})}}return{lowerCodes:E.lowerCodes,_lower:E._lower,containsSpace:E.containsSpace,bitflags:E.bitflags,spaceSearches:u}},M=(w)=>{if(w.length>999)return _(w);var E=O.get(w);if(E!==void 0)return E;return E=_(w),O.set(w,E),E},A=(w)=>{if(w.length>999)return z(w);var E=b.get(w);if(E!==void 0)return E;return E=z(w),b.set(w,E),E},K=(w,E)=>{var u=[];u.total=w.length;var m=E?.limit||_D;if(E?.key)for(var g=0;g<w.length;g++){var h=w[g],C=v(h,E.key);if(C==YD)continue;if(!f(C))C=M(C);var o=H(C.target,{_score:C._score,obj:h});if(u.push(o),u.length>=m)return u}else if(E?.keys)for(var g=0;g<w.length;g++){var h=w[g],d=new q(E.keys.length);for(var WD=E.keys.length-1;WD>=0;--WD){var C=v(h,E.keys[WD]);if(!C){d[WD]=B0;continue}if(!f(C))C=M(C);C._score=r,C._indexes.len=0,d[WD]=C}if(d.obj=h,d._score=r,u.push(d),u.length>=m)return u}else for(var g=0;g<w.length;g++){var C=w[g];if(C==YD)continue;if(!f(C))C=M(C);if(C._score=r,C._indexes.len=0,u.push(C),u.length>=m)return u}return u},j=(w,E,u=!1,m=!1)=>{if(u===!1&&w.containsSpace)return S(w,E,m);var{_lower:g,lowerCodes:h}=w,C=h[0],o=E._targetLowerCodes,d=h.length,WD=o.length,GD=0,HD=0,$0=0;for(;;){var nD=C===o[HD];if(nD){if(L[$0++]=HD,++GD,GD===d)break;C=h[GD]}if(++HD,HD>=WD)return YD}var GD=0,tD=!1,UD=0,wD=E._nextBeginningIndexes;if(wD===YD)wD=E._nextBeginningIndexes=y(E.target);HD=L[0]===0?0:wD[L[0]-1];var M2=0;if(HD!==WD)for(;;)if(HD>=WD){if(GD<=0)break;if(++M2,M2>200)break;--GD;var M0=e[--UD];HD=wD[M0]}else{var nD=h[GD]===o[HD];if(nD){if(e[UD++]=HD,++GD,GD===d){tD=!0;break}++HD}else HD=wD[HD]}var sD=d<=1?-1:E._targetLower.indexOf(g,L[0]),JD=!!~sD,cD=!JD?!1:sD===0||E._nextBeginningIndexes[sD-1]===sD;if(JD&&!cD)for(var qD=0;qD<wD.length;qD=wD[qD]){if(qD<=sD)continue;for(var q0=0;q0<d;q0++)if(h[q0]!==E._targetLowerCodes[qD+q0])break;if(q0===d){sD=qD,cD=!0;break}}var gD=(VD)=>{var OD=0,e6=0;for(var F2=1;F2<d;++F2)if(VD[F2]-VD[F2-1]!==1)OD-=VD[F2],++e6;var F_=VD[d-1]-VD[0]-(d-1);if(OD-=(12+F_)*e6,VD[0]!==0)OD-=VD[0]*VD[0]*0.2;if(!tD)OD*=1000;else{var r8=1;for(var F2=wD[0];F2<WD;F2=wD[F2])++r8;if(r8>24)OD*=(r8-24)*10}if(OD-=(WD-d)/2,JD)OD/=1+d*d*1;if(cD)OD/=1+d*d*1;return OD-=(WD-d)/2,OD};if(!tD){if(JD)for(var qD=0;qD<d;++qD)L[qD]=sD+qD;var A2=L,u2=gD(A2)}else if(cD){for(var qD=0;qD<d;++qD)L[qD]=sD+qD;var A2=L,u2=gD(L)}else var A2=e,u2=gD(e);E._score=u2;for(var qD=0;qD<d;++qD)E._indexes[qD]=A2[qD];E._indexes.len=d;let f3=new Y;return f3.target=E.target,f3._score=E._score,f3._indexes=E._indexes,f3},S=(w,E,u)=>{var m=new Set,g=0,h=YD,C=0,o=w.spaceSearches,d=o.length,WD=0,HD=()=>{for(let cD=WD-1;cD>=0;cD--)E._nextBeginningIndexes[p[cD*2+0]]=p[cD*2+1]},$0=!1;for(var JD=0;JD<d;++JD){KD[JD]=r;var nD=o[JD];if(h=j(nD,E),u){if(h===YD)continue;$0=!0}else if(h===YD)return HD(),YD;var GD=JD===d-1;if(!GD){var tD=h._indexes,UD=!0;for(let qD=0;qD<tD.len-1;qD++)if(tD[qD+1]-tD[qD]!==1){UD=!1;break}if(UD){var wD=tD[tD.len-1]+1,M2=E._nextBeginningIndexes[wD-1];for(let qD=wD-1;qD>=0;qD--){if(M2!==E._nextBeginningIndexes[qD])break;E._nextBeginningIndexes[qD]=wD,p[WD*2+0]=qD,p[WD*2+1]=M2,WD++}}}if(g+=h._score/d,KD[JD]=h._score/d,h._indexes[0]<C)g-=(C-h._indexes[0])*2;C=h._indexes[0];for(var M0=0;M0<h._indexes.len;++M0)m.add(h._indexes[M0])}if(u&&!$0)return YD;HD();var sD=j(w,E,!0);if(sD!==YD&&sD._score>g){if(u)for(var JD=0;JD<d;++JD)KD[JD]=sD._score/d;return sD}if(u)h=E;h._score=g;var JD=0;for(let cD of m)h._indexes[JD++]=cD;return h._indexes.len=JD,h},R=(w)=>w.replace(/\p{Script=Latin}+/gu,(E)=>E.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),s=(w)=>{w=R(w);var E=w.length,u=w.toLowerCase(),m=[],g=0,h=!1;for(var C=0;C<E;++C){var o=m[C]=u.charCodeAt(C);if(o===32){h=!0;continue}var d=o>=97&&o<=122?o-97:o>=48&&o<=57?26:o<=127?30:31;g|=1<<d}return{lowerCodes:m,bitflags:g,containsSpace:h,_lower:u}},N=(w)=>{var E=w.length,u=[],m=0,g=!1,h=!1;for(var C=0;C<E;++C){var o=w.charCodeAt(C),d=o>=65&&o<=90,WD=d||o>=97&&o<=122||o>=48&&o<=57,HD=d&&!g||!h||!WD;if(g=d,h=WD,HD)u[m++]=C}return u},y=(w)=>{w=R(w);var E=w.length,u=N(w),m=[],g=u[0],h=0;for(var C=0;C<E;++C)if(g>C)m[C]=g;else g=u[++h],m[C]=g===void 0?E:g;return m},O=new Map,b=new Map,L=[],e=[],p=[],FD=[],KD=[],k=[],i=[],v=(w,E)=>{var u=w[E];if(u!==void 0)return u;if(typeof E==="function")return E(w);var m=E;if(!Array.isArray(E))m=E.split(".");var g=m.length,h=-1;while(w&&++h<g)w=w[m[h]];return w},f=(w)=>{return typeof w==="object"&&typeof w._bitflags==="number"},_D=1/0,r=-_D,bD=[];bD.total=0;var YD=null,B0=_(""),o8=(w)=>{var E=[],u=0,m={},g=(h)=>{for(var C=0,o=E[C],d=1;d<u;){var WD=d+1;C=d,WD<u&&E[WD]._score<E[d]._score&&(C=WD),E[C-1>>1]=E[C],d=1+(C<<1)}for(var HD=C-1>>1;C>0&&o._score<E[HD]._score;HD=(C=HD)-1>>1)E[C]=E[HD];E[C]=o};return m.add=(h)=>{var C=u;E[u++]=h;for(var o=C-1>>1;C>0&&h._score<E[o]._score;o=(C=o)-1>>1)E[C]=E[o];E[C]=h},m.poll=(h)=>{if(u!==0){var C=E[0];return E[0]=E[--u],g(),C}},m.peek=(h)=>{if(u!==0)return E[0]},m.replaceTop=(h)=>{E[0]=h,g()},m},WF=o8();return{single:F,go:B,prepare:_,cleanup:Q}})});var Q$={};j2(Q$,{runSearchCore:()=>_$,runSearchCommandAction:()=>NW});async function NW(D,F){if(F.installed){let $=await X0(F.cwd);if(!$||Object.keys($.installed).length===0){if(F.json)LD({success:!0,data:{components:[]}});else W.info("No components installed.");return}let _=Object.entries($.installed).map(([Q,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(F.json)LD({success:!0,data:{components:_}});else{W.info(`Installed components (${_.length}):`);for(let Q of _)console.log(` ${P.cyan(Q.name)} ${P.dim(`v${Q.version}`)} from ${Q.registry}`)}return}let B;if(F.profile){let $=await r0.create(F.cwd,{profile:F.profile});B={cwd:$.getCwd(),getRegistries:()=>$.getRegistries(),getComponentPath:()=>$.getComponentPath()}}else B=await U0.requireInitialized(F.cwd);await _$(D,F,B)}async function _$(D,F,B){let $=B.getRegistries();if(F.verbose)W.info(`Searching in ${Object.keys($).length} registries...`);let _=[],Q=jD({text:"Searching registries...",quiet:F.quiet||F.verbose});if(!F.json&&!F.verbose)Q.start();for(let[q,H]of Object.entries($))try{if(F.verbose)W.info(`Fetching index from ${q} (${H.url})...`);let J=await T2(H.url);if(F.verbose)W.info(`Found ${J.components.length} components in ${q}`);for(let X of J.components)_.push({name:`${q}/${X.name}`,description:X.description,type:X.type,registry:q})}catch(J){if(F.verbose)W.warn(`Failed to fetch registry ${q}: ${J instanceof Error?J.message:String(J)}`)}if(!F.json&&!F.verbose)Q.stop();let Y=_;if(D)Y=m6.default.go(D,_,{keys:["name","description"],limit:F.limit}).map((H)=>H.obj);else Y=Y.slice(0,F.limit);if(F.json){LD({success:!0,data:{components:Y}});return}if(Y.length===0){W.info("No components found.");return}W.info(`Found ${Y.length} components:`);for(let q of Y)console.log(` ${P.cyan(q.name)} ${P.dim(`(${q.type})`)} - ${q.description}`)}var m6;var Y$=V(()=>{G2();gF();b3();DF();O1();hD();g0();m6=h3($$(),1)});function SW(D){let F=parseInt(D,10);if(Number.isNaN(F)||F<=0)throw new z9("Must be a positive integer");return F}function q$(D){let F=D.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 J2("--limit <n>","Limit results").default(20).argParser(SW));rD(F),L0(F),F.action(async(B,$)=>{try{let{runSearchCommandAction:_}=await Promise.resolve().then(() => (Y$(),Q$));await _(B,$)}catch(_){t(_,{json:$.json})}})}var H$=V(()=>{$8();yD();x0()});function J$(D){let F=["curl","npm","yarn","pnpm","bun"],B=F.find(($)=>$===D);if(!B)throw new vD(`Invalid install method: "${D}"
|
|
212
|
-
Valid methods: ${F.join(", ")}`);return B}function $3(){if(kW())return"curl";let D=process.argv[1]??"";if(IW(D))return"unknown";if(TW(D))return"yarn";if(vW(D))return"pnpm";if(CW(D))return"bun";if(uW(D))return"npm";let F=process.env.npm_config_user_agent??"";if(F.includes("yarn"))return"yarn";if(F.includes("pnpm"))return"pnpm";if(F.includes("bun"))return"bun";if(F.includes("npm"))return"npm";return"unknown"}function g8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var kW=()=>Bun.main.startsWith("/$bunfs/"),IW=(D)=>D.includes("/_npx/")||D.includes("/.cache/bunx/")||D.includes("/.pnpm/_temp/"),TW=(D)=>D.includes("/.yarn/global")||D.includes("/.config/yarn/global"),vW=(D)=>D.includes("/.pnpm/")||D.includes("/pnpm/global"),CW=(D)=>D.includes("/.bun/bin")||D.includes("/.bun/install/global"),uW=(D)=>D.includes("/.npm/")||D.includes("/node_modules/");var d8=V(()=>{$D()});import{existsSync as d6,lstatSync as G$,readdirSync as PW,realpathSync as X$,rmSync as yW,unlinkSync as z$}from"fs";import{homedir as M$}from"os";import d0 from"path";function g6(D,F=0){LD({success:!0,data:D}),process.exit(F)}function qF(D,F,B,$){let _={success:!1,error:{code:D,message:F,...$&&{details:$}},exitCode:B,meta:{timestamp:new Date().toISOString()}};LD(_),process.exit(B)}function c6(D){return D instanceof Error&&"code"in D}function y3(D){let F=M$();if(!F)return D;if(D===F)return"~";if(D.startsWith(F+d0.sep))return`~${D.slice(F.length)}`;return D}function l8(D,F){let B=d0.normalize(D),$=d0.normalize(F),_=d0.relative(B,$);if(_.startsWith("..")||d0.isAbsolute(_))return null;return _}function xW(D,F){return l8(D,F)!==null}function fW(D,F){if(!d6(F))return{contained:!0};try{let B=X$(D),$=X$(F);return{contained:l8(B,$)!==null}}catch(B){if(c6(B)&&(B.code==="EACCES"||B.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function A$(D){try{let F=G$(D);if(F.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!F.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(F){if(c6(F)){if(F.code==="ENOENT")return{valid:!1,reason:"not-found"};if(F.code==="EACCES"||F.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function x3(D){if(!d6(D))return"missing";try{let F=G$(D);if(F.isSymbolicLink())return"symlink";if(F.isDirectory())return"directory";return"file"}catch{return"missing"}}function hW(D){if(!d6(D))return!0;try{return PW(D).length===0}catch{return!1}}function W$(D){if(D.kind==="missing")return"safe";if(D.kind==="symlink")return xW(D.rootPath,D.absolutePath)?"safe":"forbidden";let F=fW(D.rootPath,D.absolutePath);if(F.error)return"error";return F.contained?"safe":"forbidden"}function HF(D){return D==="npm"||D==="pnpm"||D==="bun"||D==="yarn"}function p8(D){switch(D){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 l6(){let D=process.env.XDG_CONFIG_HOME||d0.join(M$(),".config");return d0.join(D,"opencode")}function j$(){let D=l6(),F=[],B=X2(),$=l8(D,B);if($){let q=x3(B);F.push({rootPath:D,relativePath:$,absolutePath:B,displayPath:y3(B),kind:q,deleteIfEmpty:!1,safetyStatus:W$({rootPath:D,absolutePath:B,kind:q})})}let _=cF(),Q=l8(D,_);if(Q){let q=x3(_);F.push({rootPath:D,relativePath:Q,absolutePath:_,displayPath:y3(_),kind:q,deleteIfEmpty:!1,safetyStatus:W$({rootPath:D,absolutePath:_,kind:q})})}let Y=x3(D);return F.push({rootPath:D,relativePath:".",absolutePath:D,displayPath:y3(D),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),F}function K$(){let D=$3();if(HF(D))return null;if(D==="curl"){let F=g8(),B=x3(F);return{rootPath:d0.dirname(F),relativePath:d0.basename(F),absolutePath:F,displayPath:y3(F),kind:B,deleteIfEmpty:!1,safetyStatus:B==="missing"?"safe":"safe"}}return null}function mW(D){if(D.kind==="missing")return{target:D,success:!0,skipped:!0,reason:"not found"};if(D.safetyStatus==="forbidden")return{target:D,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if(D.deleteIfEmpty&&D.kind==="directory"){if(!hW(D.absolutePath))return{target:D,success:!0,skipped:!0,reason:"not empty"}}try{if(D.kind==="directory")yW(D.absolutePath,{recursive:!0,force:!0});else z$(D.absolutePath);return{target:D,success:!0,skipped:!1}}catch(F){let B=F instanceof Error?F:Error(String(F)),$=c6(F)&&(F.code==="EACCES"||F.code==="EPERM")?"permission denied":void 0;return{target:D,success:!1,skipped:!1,reason:$,error:B}}}function U$(D){return D.map(mW)}function V$(D,F={}){let B={rootPath:d0.dirname(D),relativePath:d0.basename(D),absolutePath:D,displayPath:y3(D),kind:x3(D),deleteIfEmpty:!1,safetyStatus:"safe"};if(B.kind==="missing")return{target:B,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!F.suppressOutput)W.info(`To complete uninstall, manually delete: ${B.displayPath}`);return{target:B,success:!0,skipped:!0}}try{return z$(D),{target:B,success:!0,skipped:!1}}catch($){let _=$ instanceof Error?$:Error(String($));return{target:B,success:!1,skipped:!1,reason:"permission denied",error:_}}}function gW(D,F,B){let{dryRunResult:$,hints:_}=E$(D,F,B);z0($,{hints:_})}function E$(D,F,B){let $=D.filter((q)=>q.kind!=="missing"),_=[];for(let q of $)_.push({action:"delete",target:q.displayPath,details:{kind:q.kind,...q.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(F&&F.kind!=="missing")_.push({action:"delete",target:F.displayPath,details:{kind:"binary"}});let Q=[];if(HF(B))Q.push(`Binary is managed by ${B}. Run: ${p8(B)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:_,validation:{passed:!0},summary:_.length>0?`Would remove ${_.length} item(s)`:"Nothing to remove"},hints:Q}}function dW(D,F){if(D.filter(($)=>$.kind!=="missing").length>0||F&&F.kind!=="missing")W.info("Removing OCX files...")}function cW(D,F,B){W.break();for(let $ of D){if($.skipped){if($.reason==="not found")continue;if($.reason==="not empty"){W.info(`Kept ${G0.path($.target.displayPath)} (not empty)`);continue}if($.reason==="permission denied"){W.warn(`Skipped ${G0.path($.target.displayPath)} (permission denied)`);continue}if($.reason==="containment violation"){W.warn(`Skipped ${G0.path($.target.displayPath)} (containment violation)`);continue}}if($.success)W.success(`Removed ${G0.path($.target.displayPath)}`);else W.error(`Failed to remove ${$.target.displayPath}: ${$.error?.message}`)}if(F){if(F.skipped&&F.reason==="not found");else if(F.success&&!F.skipped)W.success(`Removed binary ${G0.path(F.target.displayPath)}`);else if(!F.success)W.error(`Failed to remove binary ${F.target.displayPath}: ${F.error?.message}`)}if(HF(B))W.break(),W.info(`Binary is managed by ${B}. To complete uninstall, run:`),W.log(` ${G0.command(p8(B))}`)}function lW(){W.info("Nothing to remove. OCX is not installed globally.")}function c8(D){return{path:D.target.displayPath,kind:D.target.kind,success:D.success,skipped:D.skipped,...D.reason&&{reason:D.reason},...D.error&&{error:D.error.message}}}async function pW(D){let F=l6(),B=A$(F);if(!B.valid)switch(B.reason){case"not-found":break;case"symlink":return qF("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",mD.SAFETY_ERROR);case"not-directory":return qF("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",mD.SAFETY_ERROR);case"permission":return qF("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",mD.ERROR)}let $=j$(),_=$.filter((R)=>R.safetyStatus==="forbidden");if(_.length>0)return qF("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",mD.SAFETY_ERROR,{targets:_.map((R)=>R.displayPath)});let Q=$.filter((R)=>R.safetyStatus==="error");if(Q.length>0)return qF("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",mD.ERROR,{targets:Q.map((R)=>R.displayPath)});let Y=$3(),q=K$(),H=$.filter((R)=>R.kind!=="missing"),J=Boolean(q&&q.kind!=="missing"),X=HF(Y);if(H.length===0&&!J&&!X)return g6({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},mD.SUCCESS);if(D.dryRun){let{dryRunResult:R,hints:s}=E$($,q,Y);return g6({...R,...s.length>0&&{hints:s}},mD.SUCCESS)}let z=U$($),M=null;if(q)M=V$(q.absolutePath,{suppressOutput:!0});let A=z.some((R)=>!R.success&&!R.skipped),K=Boolean(M&&!M.success&&!M.skipped);if(A||K)return qF("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",mD.ERROR,{configResults:z.map(c8),...M&&{binaryResult:c8(M)}});if(HF(Y))return qF("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${p8(Y)}`,mD.ERROR,{installMethod:Y,command:p8(Y),configResults:z.map(c8),...M&&{binaryResult:c8(M)}});let j=z.filter((R)=>R.success&&!R.skipped).map((R)=>R.target.displayPath),S=z.filter((R)=>R.skipped).map((R)=>({path:R.target.displayPath,reason:R.reason??"skipped"}));if(M){if(M.success&&!M.skipped)j.push(M.target.displayPath);else if(M.skipped)S.push({path:M.target.displayPath,reason:M.reason??"skipped"})}return g6({removed:j,skipped:S,installMethod:Y},mD.SUCCESS)}async function iW(D){if(D.json){await pW(D);return}let F=l6(),B=A$(F);if(!B.valid)switch(B.reason){case"not-found":break;case"symlink":W.error("Safety error: Global config root is a symlink. Aborting."),process.exit(mD.SAFETY_ERROR);break;case"not-directory":W.error("Safety error: Global config root is not a directory. Aborting."),process.exit(mD.SAFETY_ERROR);break;case"permission":W.error("Error: Cannot access global config root (permission denied)."),process.exit(mD.ERROR);break}let $=j$(),_=$.filter((j)=>j.safetyStatus==="forbidden");if(_.length>0){W.error("Safety error: Target escapes containment boundary:");for(let j of _)W.error(` ${j.displayPath}`);process.exit(mD.SAFETY_ERROR)}let Q=$.filter((j)=>j.safetyStatus==="error");if(Q.length>0){W.error("Error: Cannot verify containment for targets (permission/IO error):");for(let j of Q)W.error(` ${j.displayPath}`);process.exit(mD.ERROR)}let Y=$3(),q=K$(),H=$.filter((j)=>j.kind!=="missing"),J=q&&q.kind!=="missing",X=HF(Y);if(H.length===0&&!J&&!X)lW(),process.exit(mD.SUCCESS);if(D.dryRun)gW($,q,Y),process.exit(mD.SUCCESS);dW($,q);let z=U$($),M=null;if(q)M=V$(q.absolutePath);cW(z,M,Y);let A=z.some((j)=>!j.success&&!j.skipped),K=M&&!M.success&&!M.skipped;if(A||K)process.exit(mD.ERROR);if(HF(Y))process.exit(mD.ERROR);process.exit(mD.SUCCESS)}function L$(D){D.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(F)=>{try{await iW(F)}catch(B){t(B,{json:F.json})}})}var mD;var w$=V(()=>{Q0();d8();BF();yD();hD();mD={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class O${version="2.0.4"}var b$;var Z$=V(()=>{b$=new O$});var N$={};j2(N$,{checkForUpdate:()=>i6,EXPLICIT_UPDATE_TIMEOUT_MS:()=>p6});function R$(D){let[F=""]=D.split("-"),B=F.split("."),$=parseInt(B[0]??"",10),_=parseInt(B[1]??"",10),Q=parseInt(B[2]??"",10);if(Number.isNaN($)||Number.isNaN(_)||Number.isNaN(Q))return null;return{major:$,minor:_,patch:Q}}function aW(D,F){let B=R$(D),$=R$(F);if(!B||!$)return null;if(B.major!==$.major)return B.major-$.major;if(B.minor!==$.minor)return B.minor-$.minor;return B.patch-$.patch}async function i6(D,F=nW){let $=(D??b$).version||"0.0.0-dev";if($==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let Q=(await j8(sW,void 0,AbortSignal.timeout(F))).version,Y=aW(Q,$);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:$,latest:Q,updateAvailable:Y>0}}catch(_){if(_ instanceof Error){if(_.name==="AbortError"||_.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(_ instanceof ZD||_.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var nW=200,p6=1e4,sW="ocx";var n6=V(()=>{$D();t1();Z$()});import{chmodSync as oW,existsSync as JF,renameSync as s6,unlinkSync as i8}from"fs";function eW(){let D=process.env.OCX_DOWNLOAD_URL;if(D)return D.replace(/\/+$/,"");return tW}function a6(D){let F=`${process.arch}-${process.platform}`,B=S$[F];if(!B){let _=Object.keys(S$).join(", ");throw new vD(`Unsupported platform: ${F}
|
|
213
|
-
Supported platforms: ${_}`)}return`${
|
|
214
|
-
`)){let
|
|
243
|
+
Use one of the canonical IDs above.`}function VA($){return`Component '${$}' is not installed.
|
|
244
|
+
Run 'ocx search --installed' to see installed components.`}function MA($,v){let U=Object.keys(v.installed);if(v.installed[$])return $;if(BA($)){let{registryName:Q,componentName:_}=ZA($),J=U.filter((Y)=>{let z=l6(Y);return z.registryName===Q&&z.name===_}).sort();if(J.length===1){let[Y]=J;if(!Y)throw Error("Unexpected empty canonical ID result");return Y}if(J.length>1)throw new M(DA($,J))}throw new B$(VA($))}function c8($,v){return $.map((U)=>MA(U,v))}var hY=b(()=>{t4();z$();T0()});import{realpathSync as dH}from"fs";import{rm as wA}from"fs/promises";import{sep as LA}from"path";function pH($,v,U){let Q=O4($,U),_;try{_=dH(Q)}catch(J){let Y=J.code;if(Y==="ENOENT"||Y==="ENOTDIR")return{path:U,targetReal:null};if(Y==="ELOOP")throw new M(`Security violation: symlink loop detected at ${U}`);if(Y==="EACCES"||Y==="EPERM")throw new M(`Security violation: cannot verify path ${U}`);throw J}if(_===v)throw new M(`Security violation: cannot delete project root directory (${U})`);if(!_.startsWith(v+LA))throw new M("Security violation: path escapes project directory");return{path:U,targetReal:_}}function kA($,v,U){let Q=pH($,v,U.path);if(!U.targetReal){if(Q.targetReal)throw new M(`Security violation: missing target reappeared during removal (${U.path})`);return null}if(!Q.targetReal)return null;if(Q.targetReal!==U.targetReal)throw new M(`Security violation: target changed during removal (${U.path})`);return Q.targetReal}function AA($){let v=new Set,U=[];for(let Q of $){if(v.has(Q))continue;v.add(Q),U.push(Q)}return U}function iH($){let v=$.command("remove").description("Remove installed components").argument("<components...>","Component refs to remove (canonical ID or alias/component)");Q4(v),v.option("-f, --force","Force removal even if files have been modified"),h4(v),v.option("--dry-run","Show what would be removed without making changes").action(async(U,Q)=>{try{await OA(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function OA($,v){let U=v.cwd??process.cwd(),Q=await f4.requireInitialized(U);if($.length===0)throw new M("No components specified. Specify at least one component ID.");let _=await F4(Q.cwd);if(!_||Object.keys(_.installed).length===0)throw new B$("No components installed.");let J=AA(c8($,_)),Y=v.quiet?null:D$({text:"Removing components..."});Y?.start();let z=[],I=[],X=[],q=[],G=!1,j;try{j=dH(Q.cwd)}catch(H){throw new M("Cannot resolve project directory")}try{for(let H of J){let Z=_.installed[H];if(!Z)throw Error(`Resolved component '${H}' was not found in receipt.`);let D=[];for(let A of Z.files){if(!A.path||A.path===".")throw new M(`Invalid file path in receipt for '${H}': path cannot be empty or "."`);try{D.push(pH(Q.cwd,j,A.path))}catch(r){if(r instanceof U4)throw new M(`Security violation in receipt for '${H}': ${r.message}`);throw r}}let E=await iv(Q.cwd,Z);if(!E.intact){G=!0;let A=E.modified.map((r)=>` - ${r}`).join(`
|
|
245
|
+
`);if(v.force)q.push(`Component '${H}' has been modified but will be force-removed:
|
|
246
|
+
${A}`);else q.push(`Component '${H}' has been modified. Use --force to remove anyway:
|
|
247
|
+
${A}`)}X.push({canonicalId:H,files:D})}if(v.dryRun){Y?.stop();let H={dryRun:!0,command:"remove",wouldPerform:X.flatMap(({canonicalId:Z,files:D})=>D.map((E)=>({action:"delete",target:E.path,details:{component:Z}}))),validation:{passed:!G||Boolean(v.force),warnings:q.length>0?q:void 0},summary:`${X.length} component(s), ${X.reduce((Z,D)=>Z+D.files.length,0)} file(s) would be removed`};T4(H,{json:v.json,quiet:v.quiet,hints:G&&!v.force?["Add --force to remove modified files"]:void 0});return}if(G&&!v.force){Y?.fail("File integrity check failed");let H;for(let Z of X){let D=_.installed[Z.canonicalId];if(!D)continue;try{let E=await iv(Q.cwd,D);if(!E.intact){H={canonicalId:Z.canonicalId,integrity:E};break}}catch(E){throw new M(`Failed to check integrity for '${Z.canonicalId}': ${E instanceof Error?E.message:String(E)}`)}}if(H){let Z=H.integrity.modified.length>0?`Modified files:
|
|
248
|
+
${H.integrity.modified.map((A)=>` - ${A}`).join(`
|
|
249
|
+
`)}`:"",D=H.integrity.missing.length>0?`Missing files:
|
|
250
|
+
${H.integrity.missing.map((A)=>` - ${A}`).join(`
|
|
251
|
+
`)}`:"",E=[Z,D].filter(Boolean).join(`
|
|
252
|
+
`);throw new M(`Component '${H.canonicalId}' has been modified. Use --force to remove anyway.
|
|
253
|
+
${E}`)}}for(let{canonicalId:H,files:Z}of X){for(let D of Z){let E=kA(Q.cwd,j,D);if(!E){if(v.verbose)W.info(` \u2298 Skipped ${D.path} (not found)`);continue}if(await wA(E,{force:!0}),v.verbose)W.info(` \u2713 Removed ${D.path}`)}delete _.installed[H],z.push(H)}if(await y4(Q.cwd,_),Y?.succeed(`Removed ${z.length} component(s)`),v.json)console.log(JSON.stringify({success:!0,removed:z,notFound:I},null,2));else if(!v.quiet){W.info("");for(let H of z){let Z=l6(H);W.success(`\u2713 Removed ${Z.registryName}/${Z.name}@${Z.revision}`)}W.info(""),W.success(`Done! Removed ${z.length} component(s).`)}}catch(H){throw Y?.fail("Failed to remove components"),H}}var nH=b(()=>{k0();X4();hY();w1();z$();l$();i$();q1();T0();s4();$6()});var oH=T6((rH,l8)=>{(($,v)=>{if(typeof define==="function"&&define.amd)define([],v);else if(typeof l8==="object"&&l8.exports)l8.exports=v();else $.fuzzysort=v()})(rH,($)=>{var v=(F,k)=>{if(!F||!k)return X$;var f=H(F);if(!h(k))k=j(k);var p=f.bitflags;if((p&k._bitflags)!==p)return X$;return D(f,k)},U=(F,k,f)=>{if(!F)return f?.all?Z(k,f):R$;var p=H(F),i=p.bitflags,c=p.containsSpace,C=q(f?.threshold||0),s=f?.limit||I$,n=0,H$=0,G$=k.length;function K4(a6){if(n<s)E1.add(a6),++n;else if(++H$,a6._score>E1.peek()._score)E1.replaceTop(a6)}if(f?.key){var $4=f.key;for(var W$=0;W$<G$;++W$){var J4=k[W$],w$=y(J4,$4);if(!w$)continue;if(!h(w$))w$=j(w$);if((i&w$._bitflags)!==i)continue;var N$=D(p,w$);if(N$===X$)continue;if(N$._score<C)continue;N$.obj=J4,K4(N$)}}else if(f?.keys){var N6=f.keys,R4=N6.length;$:for(var W$=0;W$<G$;++W$){var J4=k[W$];{var v4=0;for(var j$=0;j$<R4;++j$){var $4=N6[j$],w$=y(J4,$4);if(!w$){x[j$]=j4;continue}if(!h(w$))w$=j(w$);x[j$]=w$,v4|=w$._bitflags}if((i&v4)!==i)continue}if(c)for(let L$=0;L$<p.spaceSearches.length;L$++)a[L$]=v$;for(var j$=0;j$<R4;++j$){if(w$=x[j$],w$===j4){o[j$]=j4;continue}if(o[j$]=D(p,w$,!1,c),o[j$]===X$){o[j$]=j4;continue}if(c)for(let S$=0;S$<p.spaceSearches.length;S$++){if(V$[S$]>-1000){if(a[S$]>v$){var a$=(a[S$]+V$[S$])/4;if(a$>a[S$])a[S$]=a$}}if(V$[S$]>a[S$])a[S$]=V$[S$]}}if(c){for(let L$=0;L$<p.spaceSearches.length;L$++)if(a[L$]===v$)continue $}else{var q$=!1;for(let L$=0;L$<R4;L$++)if(o[L$]._score!==v$){q$=!0;break}if(!q$)continue}var M4=new z(R4);for(let L$=0;L$<R4;L$++)M4[L$]=o[L$];if(c){var r$=0;for(let L$=0;L$<p.spaceSearches.length;L$++)r$+=a[L$]}else{var r$=v$;for(let S$=0;S$<R4;S$++){var N$=M4[S$];if(N$._score>-1000){if(r$>v$){var a$=(r$+N$._score)/4;if(a$>r$)r$=a$}}if(N$._score>r$)r$=N$._score}}if(M4.obj=J4,M4._score=r$,f?.scoreFn){if(r$=f.scoreFn(M4),!r$)continue;r$=q(r$),M4._score=r$}if(r$<C)continue;K4(M4)}}else for(var W$=0;W$<G$;++W$){var w$=k[W$];if(!w$)continue;if(!h(w$))w$=j(w$);if((i&w$._bitflags)!==i)continue;var N$=D(p,w$);if(N$===X$)continue;if(N$._score<C)continue;K4(N$)}if(n===0)return R$;var S6=Array(n);for(var W$=n-1;W$>=0;--W$)S6[W$]=E1.poll();return S6.total=n+H$,S6},Q=(F,k="<b>",f="</b>")=>{var p=typeof k==="function"?k:void 0,i=F.target,c=i.length,C=F.indexes,s="",n=0,H$=0,G$=!1,K4=[];for(var $4=0;$4<c;++$4){var W$=i[$4];if(C[H$]===$4){if(++H$,!G$)if(G$=!0,p)K4.push(s),s="";else s+=k;if(H$===C.length){if(p)s+=W$,K4.push(p(s,n++)),s="",K4.push(i.substr($4+1));else s+=W$+f+i.substr($4+1);break}}else if(G$)if(G$=!1,p)K4.push(p(s,n++)),s="";else s+=f;s+=W$}return p?K4:s},_=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";var k=r(F);return I(F,{_targetLower:k._lower,_targetLowerCodes:k.lowerCodes,_bitflags:k.bitflags})},J=()=>{w.clear(),N.clear()};class Y{get["indexes"](){return this._indexes.slice(0,this._indexes.len).sort((F,k)=>F-k)}set["indexes"](F){return this._indexes=F}["highlight"](F,k){return Q(this,F,k)}get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}class z extends Array{get["score"](){return X(this._score)}set["score"](F){this._score=q(F)}}var I=(F,k)=>{let f=new Y;return f.target=F,f.obj=k.obj??X$,f._score=k._score??v$,f._indexes=k._indexes??[],f._targetLower=k._targetLower??"",f._targetLowerCodes=k._targetLowerCodes??X$,f._nextBeginningIndexes=k._nextBeginningIndexes??X$,f._bitflags=k._bitflags??0,f},X=(F)=>{if(F===v$)return 0;if(F>1)return F;return Math.E**(((-F+1)**0.04307-1)*-2)},q=(F)=>{if(F===0)return v$;if(F>1)return F;return 1-Math.pow(Math.log(F)/-2+1,23.218017181332716)},G=(F)=>{if(typeof F==="number")F=""+F;else if(typeof F!=="string")F="";F=F.trim();var k=r(F),f=[];if(k.containsSpace){var p=F.split(/\s+/);p=[...new Set(p)];for(var i=0;i<p.length;i++){if(p[i]==="")continue;var c=r(p[i]);f.push({lowerCodes:c.lowerCodes,_lower:p[i].toLowerCase(),containsSpace:!1})}}return{lowerCodes:k.lowerCodes,_lower:k._lower,containsSpace:k.containsSpace,bitflags:k.bitflags,spaceSearches:f}},j=(F)=>{if(F.length>999)return _(F);var k=w.get(F);if(k!==void 0)return k;return k=_(F),w.set(F,k),k},H=(F)=>{if(F.length>999)return G(F);var k=N.get(F);if(k!==void 0)return k;return k=G(F),N.set(F,k),k},Z=(F,k)=>{var f=[];f.total=F.length;var p=k?.limit||I$;if(k?.key)for(var i=0;i<F.length;i++){var c=F[i],C=y(c,k.key);if(C==X$)continue;if(!h(C))C=j(C);var s=I(C.target,{_score:C._score,obj:c});if(f.push(s),f.length>=p)return f}else if(k?.keys)for(var i=0;i<F.length;i++){var c=F[i],n=new z(k.keys.length);for(var H$=k.keys.length-1;H$>=0;--H$){var C=y(c,k.keys[H$]);if(!C){n[H$]=j4;continue}if(!h(C))C=j(C);C._score=v$,C._indexes.len=0,n[H$]=C}if(n.obj=c,n._score=v$,f.push(n),f.length>=p)return f}else for(var i=0;i<F.length;i++){var C=F[i];if(C==X$)continue;if(!h(C))C=j(C);if(C._score=v$,C._indexes.len=0,f.push(C),f.length>=p)return f}return f},D=(F,k,f=!1,p=!1)=>{if(f===!1&&F.containsSpace)return E(F,k,p);var{_lower:i,lowerCodes:c}=F,C=c[0],s=k._targetLowerCodes,n=c.length,H$=s.length,W$=0,G$=0,K4=0;for(;;){var $4=C===s[G$];if($4){if(L[K4++]=G$,++W$,W$===n)break;C=c[W$]}if(++G$,G$>=H$)return X$}var W$=0,J4=!1,w$=0,N$=k._nextBeginningIndexes;if(N$===X$)N$=k._nextBeginningIndexes=g(k.target);G$=L[0]===0?0:N$[L[0]-1];var N6=0;if(G$!==H$)for(;;)if(G$>=H$){if(W$<=0)break;if(++N6,N6>200)break;--W$;var R4=U$[--w$];G$=N$[R4]}else{var $4=c[W$]===s[G$];if($4){if(U$[w$++]=G$,++W$,W$===n){J4=!0;break}++G$}else G$=N$[G$]}var v4=n<=1?-1:k._targetLower.indexOf(i,L[0]),j$=!!~v4,a$=!j$?!1:v4===0||k._nextBeginningIndexes[v4-1]===v4;if(j$&&!a$)for(var q$=0;q$<N$.length;q$=N$[q$]){if(q$<=v4)continue;for(var M4=0;M4<n;M4++)if(c[M4]!==k._targetLowerCodes[q$+M4])break;if(M4===n){v4=q$,a$=!0;break}}var r$=(L$)=>{var S$=0,vz=0;for(var H6=1;H6<n;++H6)if(L$[H6]-L$[H6-1]!==1)S$-=L$[H6],++vz;var nW=L$[n-1]-L$[0]-(n-1);if(S$-=(12+nW)*vz,L$[0]!==0)S$-=L$[0]*L$[0]*0.2;if(!J4)S$*=1000;else{var $9=1;for(var H6=N$[0];H6<H$;H6=N$[H6])++$9;if($9>24)S$*=($9-24)*10}if(S$-=(H$-n)/2,j$)S$/=1+n*n*1;if(a$)S$/=1+n*n*1;return S$-=(H$-n)/2,S$};if(!J4){if(j$)for(var q$=0;q$<n;++q$)L[q$]=v4+q$;var S6=L,a6=r$(S6)}else if(a$){for(var q$=0;q$<n;++q$)L[q$]=v4+q$;var S6=L,a6=r$(L)}else var S6=U$,a6=r$(U$);k._score=a6;for(var q$=0;q$<n;++q$)k._indexes[q$]=S6[q$];k._indexes.len=n;let Q2=new Y;return Q2.target=k.target,Q2._score=k._score,Q2._indexes=k._indexes,Q2},E=(F,k,f)=>{var p=new Set,i=0,c=X$,C=0,s=F.spaceSearches,n=s.length,H$=0,G$=()=>{for(let a$=H$-1;a$>=0;a$--)k._nextBeginningIndexes[$$[a$*2+0]]=$$[a$*2+1]},K4=!1;for(var j$=0;j$<n;++j$){V$[j$]=v$;var $4=s[j$];if(c=D($4,k),f){if(c===X$)continue;K4=!0}else if(c===X$)return G$(),X$;var W$=j$===n-1;if(!W$){var J4=c._indexes,w$=!0;for(let q$=0;q$<J4.len-1;q$++)if(J4[q$+1]-J4[q$]!==1){w$=!1;break}if(w$){var N$=J4[J4.len-1]+1,N6=k._nextBeginningIndexes[N$-1];for(let q$=N$-1;q$>=0;q$--){if(N6!==k._nextBeginningIndexes[q$])break;k._nextBeginningIndexes[q$]=N$,$$[H$*2+0]=q$,$$[H$*2+1]=N6,H$++}}}if(i+=c._score/n,V$[j$]=c._score/n,c._indexes[0]<C)i-=(C-c._indexes[0])*2;C=c._indexes[0];for(var R4=0;R4<c._indexes.len;++R4)p.add(c._indexes[R4])}if(f&&!K4)return X$;G$();var v4=D(F,k,!0);if(v4!==X$&&v4._score>i){if(f)for(var j$=0;j$<n;++j$)V$[j$]=v4._score/n;return v4}if(f)c=k;c._score=i;var j$=0;for(let a$ of p)c._indexes[j$++]=a$;return c._indexes.len=j$,c},A=(F)=>F.replace(/\p{Script=Latin}+/gu,(k)=>k.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),r=(F)=>{F=A(F);var k=F.length,f=F.toLowerCase(),p=[],i=0,c=!1;for(var C=0;C<k;++C){var s=p[C]=f.charCodeAt(C);if(s===32){c=!0;continue}var n=s>=97&&s<=122?s-97:s>=48&&s<=57?26:s<=127?30:31;i|=1<<n}return{lowerCodes:p,bitflags:i,containsSpace:c,_lower:f}},O=(F)=>{var k=F.length,f=[],p=0,i=!1,c=!1;for(var C=0;C<k;++C){var s=F.charCodeAt(C),n=s>=65&&s<=90,H$=n||s>=97&&s<=122||s>=48&&s<=57,G$=n&&!i||!c||!H$;if(i=n,c=H$,G$)f[p++]=C}return f},g=(F)=>{F=A(F);var k=F.length,f=O(F),p=[],i=f[0],c=0;for(var C=0;C<k;++C)if(i>C)p[C]=i;else i=f[++c],p[C]=i===void 0?k:i;return p},w=new Map,N=new Map,L=[],U$=[],$$=[],a=[],V$=[],x=[],o=[],y=(F,k)=>{var f=F[k];if(f!==void 0)return f;if(typeof k==="function")return k(F);var p=k;if(!Array.isArray(k))p=k.split(".");var i=p.length,c=-1;while(F&&++c<i)F=F[p[c]];return F},h=(F)=>{return typeof F==="object"&&typeof F._bitflags==="number"},I$=1/0,v$=-I$,R$=[];R$.total=0;var X$=null,j4=_(""),e8=(F)=>{var k=[],f=0,p={},i=(c)=>{for(var C=0,s=k[C],n=1;n<f;){var H$=n+1;C=n,H$<f&&k[H$]._score<k[n]._score&&(C=H$),k[C-1>>1]=k[C],n=1+(C<<1)}for(var G$=C-1>>1;C>0&&s._score<k[G$]._score;G$=(C=G$)-1>>1)k[C]=k[G$];k[C]=s};return p.add=(c)=>{var C=f;k[f++]=c;for(var s=C-1>>1;C>0&&c._score<k[s]._score;s=(C=s)-1>>1)k[C]=k[s];k[C]=c},p.poll=(c)=>{if(f!==0){var C=k[0];return k[0]=k[--f],i(),C}},p.peek=(c)=>{if(f!==0)return k[0]},p.replaceTop=(c)=>{k[0]=c,i()},p},E1=e8();return{single:v,go:U,prepare:_,cleanup:J}})});var aH={};s$(aH,{runSearchCore:()=>tH,runSearchCommandAction:()=>FA});async function FA($,v){if(v.installed){let Q=await F4(v.cwd);if(!Q||Object.keys(Q.installed).length===0){if(v.json)F$({success:!0,data:{components:[]}});else W.info("No components installed.");return}let _=Object.entries(Q.installed).map(([J,Y])=>({name:`${Y.registryName}/${Y.name}`,registry:Y.registryUrl,version:Y.revision,installedAt:void 0}));if(v.json)F$({success:!0,data:{components:_}});else{W.info(`Installed components (${_.length}):`);for(let J of _)console.log(` ${m.cyan(J.name)} ${m.dim(`v${J.version}`)} from ${J.registry}`)}return}let U;if(v.profile){let Q=await j6.create(v.cwd,{profile:v.profile});U={cwd:Q.getCwd(),getRegistries:()=>Q.getRegistries(),getComponentPath:()=>Q.getComponentPath()}}else U=await f4.requireInitialized(v.cwd);await tH($,v,U)}async function tH($,v,U){let Q=U.getRegistries();if(v.verbose)W.info(`Searching in ${Object.keys(Q).length} registries...`);let _=[],J=D$({text:"Searching registries...",quiet:v.quiet||v.verbose});if(!v.json&&!v.verbose)J.start();for(let[z,I]of Object.entries(Q))try{if(v.verbose)W.info(`Fetching index from ${z} (${I.url})...`);let X=await r6(I.url);if(v.verbose)W.info(`Found ${X.components.length} components in ${z}`);for(let q of X.components)_.push({name:`${z}/${q.name}`,description:q.description,type:q.type,registry:z})}catch(X){if(v.verbose)W.warn(`Failed to fetch registry ${z}: ${X instanceof Error?X.message:String(X)}`)}if(!v.json&&!v.verbose)J.stop();let Y=_;if($)Y=cY.default.go($,_,{keys:["name","description"],limit:v.limit}).map((I)=>I.obj);else Y=Y.slice(0,v.limit);if(v.json){F$({success:!0,data:{components:Y}});return}if(Y.length===0){W.info("No components found.");return}W.info(`Found ${Y.length} components:`);for(let z of Y)console.log(` ${m.cyan(z.name)} ${m.dim(`(${z.type})`)} - ${z.description}`)}var cY;var sH=b(()=>{O6();k0();cv();V1();LJ();i$();$6();cY=_z(oH(),1)});function NA($){let v=parseInt($,10);if(Number.isNaN(v)||v<=0)throw new sq("Must be a positive integer");return v}function eH($){let v=$.command("search").alias("list").description("Search for components across registries or list installed").argument("[query]","Search query").option("--installed","List installed components only",!1).option("-p, --profile <name>","Use specific profile").addOption(new w6("--limit <n>","Limit results").default(20).argParser(NA));Q4(v),h4(v),v.action(async(U,Q)=>{try{let{runSearchCommandAction:_}=await Promise.resolve().then(() => (sH(),aH));await _(U,Q)}catch(_){_$(_,{json:Q.json})}})}var $W=b(()=>{$8();l$();s4()});function vW($){let v=["curl","npm","yarn","pnpm","bun"],U=v.find((Q)=>Q===$);if(!U)throw new f$(`Invalid install method: "${$}"
|
|
254
|
+
Valid methods: ${v.join(", ")}`);return U}function h0(){if(SA())return"curl";let $=process.argv[1]??"";if(TA($))return"unknown";if(RA($))return"yarn";if(EA($))return"pnpm";if(PA($))return"bun";if(xA($))return"npm";let v=process.env.npm_config_user_agent??"";if(v.includes("yarn"))return"yarn";if(v.includes("pnpm"))return"pnpm";if(v.includes("bun"))return"bun";if(v.includes("npm"))return"npm";return"unknown"}function d8(){if(typeof Bun<"u"&&Bun.main.startsWith("/$bunfs/"))return process.execPath;return process.argv[1]??process.execPath}var SA=()=>Bun.main.startsWith("/$bunfs/"),TA=($)=>$.includes("/_npx/")||$.includes("/.cache/bunx/")||$.includes("/.pnpm/_temp/"),RA=($)=>$.includes("/.yarn/global")||$.includes("/.config/yarn/global"),EA=($)=>$.includes("/.pnpm/")||$.includes("/pnpm/global"),PA=($)=>$.includes("/.bun/bin")||$.includes("/.bun/install/global"),xA=($)=>$.includes("/.npm/")||$.includes("/node_modules/");var p8=b(()=>{z$()});import{existsSync as dY,lstatSync as QW,readdirSync as uA,realpathSync as _W,rmSync as yA,unlinkSync as JW}from"fs";import{homedir as YW}from"os";import v6 from"path";function lY($,v=0){F$({success:!0,data:$}),process.exit(v)}function N1($,v,U,Q){let _={success:!1,error:{code:$,message:v,...Q&&{details:Q}},exitCode:U,meta:{timestamp:new Date().toISOString()}};F$(_),process.exit(U)}function pY($){return $ instanceof Error&&"code"in $}function _2($){let v=YW();if(!v)return $;if($===v)return"~";if($.startsWith(v+v6.sep))return`~${$.slice(v.length)}`;return $}function n8($,v){let U=v6.normalize($),Q=v6.normalize(v),_=v6.relative(U,Q);if(_.startsWith("..")||v6.isAbsolute(_))return null;return _}function CA($,v){return n8($,v)!==null}function fA($,v){if(!dY(v))return{contained:!0};try{let U=_W($),Q=_W(v);return{contained:n8(U,Q)!==null}}catch(U){if(pY(U)&&(U.code==="EACCES"||U.code==="EPERM"))return{contained:!1,error:"permission"};return{contained:!1,error:"io"}}}function zW($){try{let v=QW($);if(v.isSymbolicLink())return{valid:!1,reason:"symlink"};if(!v.isDirectory())return{valid:!1,reason:"not-directory"};return{valid:!0}}catch(v){if(pY(v)){if(v.code==="ENOENT")return{valid:!1,reason:"not-found"};if(v.code==="EACCES"||v.code==="EPERM")return{valid:!1,reason:"permission"}}return{valid:!1,reason:"permission"}}}function U2($){if(!dY($))return"missing";try{let v=QW($);if(v.isSymbolicLink())return"symlink";if(v.isDirectory())return"directory";return"file"}catch{return"missing"}}function mA($){if(!dY($))return!0;try{return uA($).length===0}catch{return!1}}function UW($){if($.kind==="missing")return"safe";if($.kind==="symlink")return CA($.rootPath,$.absolutePath)?"safe":"forbidden";let v=fA($.rootPath,$.absolutePath);if(v.error)return"error";return v.contained?"safe":"forbidden"}function S1($){return $==="npm"||$==="pnpm"||$==="bun"||$==="yarn"}function r8($){switch($){case"npm":return"npm uninstall -g ocx";case"pnpm":return"pnpm remove -g ocx";case"bun":return"bun remove -g ocx";case"yarn":return"yarn global remove ocx";default:return"npm uninstall -g ocx"}}function iY(){let $=process.env.XDG_CONFIG_HOME||v6.join(YW(),".config");return v6.join($,"opencode")}function IW(){let $=iY(),v=[],U=L6(),Q=n8($,U);if(Q){let z=U2(U);v.push({rootPath:$,relativePath:Q,absolutePath:U,displayPath:_2(U),kind:z,deleteIfEmpty:!1,safetyStatus:UW({rootPath:$,absolutePath:U,kind:z})})}let _=O0(),J=n8($,_);if(J){let z=U2(_);v.push({rootPath:$,relativePath:J,absolutePath:_,displayPath:_2(_),kind:z,deleteIfEmpty:!1,safetyStatus:UW({rootPath:$,absolutePath:_,kind:z})})}let Y=U2($);return v.push({rootPath:$,relativePath:".",absolutePath:$,displayPath:_2($),kind:Y,deleteIfEmpty:!0,safetyStatus:Y==="missing"?"safe":"safe"}),v}function XW(){let $=h0();if(S1($))return null;if($==="curl"){let v=d8(),U=U2(v);return{rootPath:v6.dirname(v),relativePath:v6.basename(v),absolutePath:v,displayPath:_2(v),kind:U,deleteIfEmpty:!1,safetyStatus:U==="missing"?"safe":"safe"}}return null}function gA($){if($.kind==="missing")return{target:$,success:!0,skipped:!0,reason:"not found"};if($.safetyStatus==="forbidden")return{target:$,success:!1,skipped:!0,reason:"containment violation",error:Error("Target escapes containment boundary")};if($.deleteIfEmpty&&$.kind==="directory"){if(!mA($.absolutePath))return{target:$,success:!0,skipped:!0,reason:"not empty"}}try{if($.kind==="directory")yA($.absolutePath,{recursive:!0,force:!0});else JW($.absolutePath);return{target:$,success:!0,skipped:!1}}catch(v){let U=v instanceof Error?v:Error(String(v)),Q=pY(v)&&(v.code==="EACCES"||v.code==="EPERM")?"permission denied":void 0;return{target:$,success:!1,skipped:!1,reason:Q,error:U}}}function qW($){return $.map(gA)}function GW($,v={}){let U={rootPath:v6.dirname($),relativePath:v6.basename($),absolutePath:$,displayPath:_2($),kind:U2($),deleteIfEmpty:!1,safetyStatus:"safe"};if(U.kind==="missing")return{target:U,success:!0,skipped:!0,reason:"not found"};if(process.platform==="win32"){if(!v.suppressOutput)W.info(`To complete uninstall, manually delete: ${U.displayPath}`);return{target:U,success:!0,skipped:!0}}try{return JW($),{target:U,success:!0,skipped:!1}}catch(Q){let _=Q instanceof Error?Q:Error(String(Q));return{target:U,success:!1,skipped:!1,reason:"permission denied",error:_}}}function hA($,v,U){let{dryRunResult:Q,hints:_}=jW($,v,U);T4(Q,{hints:_})}function jW($,v,U){let Q=$.filter((z)=>z.kind!=="missing"),_=[];for(let z of Q)_.push({action:"delete",target:z.displayPath,details:{kind:z.kind,...z.deleteIfEmpty&&{deleteIfEmpty:!0}}});if(v&&v.kind!=="missing")_.push({action:"delete",target:v.displayPath,details:{kind:"binary"}});let J=[];if(S1(U))J.push(`Binary is managed by ${U}. Run: ${r8(U)}`);return{dryRunResult:{dryRun:!0,command:"self uninstall",wouldPerform:_,validation:{passed:!0},summary:_.length>0?`Would remove ${_.length} item(s)`:"Nothing to remove"},hints:J}}function cA($,v){if($.filter((Q)=>Q.kind!=="missing").length>0||v&&v.kind!=="missing")W.info("Removing OCX files...")}function lA($,v,U){W.break();for(let Q of $){if(Q.skipped){if(Q.reason==="not found")continue;if(Q.reason==="not empty"){W.info(`Kept ${S4.path(Q.target.displayPath)} (not empty)`);continue}if(Q.reason==="permission denied"){W.warn(`Skipped ${S4.path(Q.target.displayPath)} (permission denied)`);continue}if(Q.reason==="containment violation"){W.warn(`Skipped ${S4.path(Q.target.displayPath)} (containment violation)`);continue}}if(Q.success)W.success(`Removed ${S4.path(Q.target.displayPath)}`);else W.error(`Failed to remove ${Q.target.displayPath}: ${Q.error?.message}`)}if(v){if(v.skipped&&v.reason==="not found");else if(v.success&&!v.skipped)W.success(`Removed binary ${S4.path(v.target.displayPath)}`);else if(!v.success)W.error(`Failed to remove binary ${v.target.displayPath}: ${v.error?.message}`)}if(S1(U))W.break(),W.info(`Binary is managed by ${U}. To complete uninstall, run:`),W.log(` ${S4.command(r8(U))}`)}function dA(){W.info("Nothing to remove. OCX is not installed globally.")}function i8($){return{path:$.target.displayPath,kind:$.target.kind,success:$.success,skipped:$.skipped,...$.reason&&{reason:$.reason},...$.error&&{error:$.error.message}}}async function pA($){let v=iY(),U=zW(v);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":return N1("VALIDATION_ERROR","Safety error: Global config root is a symlink. Aborting.",n$.SAFETY_ERROR);case"not-directory":return N1("VALIDATION_ERROR","Safety error: Global config root is not a directory. Aborting.",n$.SAFETY_ERROR);case"permission":return N1("PERMISSION_ERROR","Error: Cannot access global config root (permission denied).",n$.ERROR)}let Q=IW(),_=Q.filter((A)=>A.safetyStatus==="forbidden");if(_.length>0)return N1("VALIDATION_ERROR","Safety error: Target escapes containment boundary.",n$.SAFETY_ERROR,{targets:_.map((A)=>A.displayPath)});let J=Q.filter((A)=>A.safetyStatus==="error");if(J.length>0)return N1("PERMISSION_ERROR","Error: Cannot verify containment for targets (permission/IO error).",n$.ERROR,{targets:J.map((A)=>A.displayPath)});let Y=h0(),z=XW(),I=Q.filter((A)=>A.kind!=="missing"),X=Boolean(z&&z.kind!=="missing"),q=S1(Y);if(I.length===0&&!X&&!q)return lY({message:"Nothing to remove. OCX is not installed globally.",removed:[],skipped:[]},n$.SUCCESS);if($.dryRun){let{dryRunResult:A,hints:r}=jW(Q,z,Y);return lY({...A,...r.length>0&&{hints:r}},n$.SUCCESS)}let G=qW(Q),j=null;if(z)j=GW(z.absolutePath,{suppressOutput:!0});let H=G.some((A)=>!A.success&&!A.skipped),Z=Boolean(j&&!j.success&&!j.skipped);if(H||Z)return N1("PERMISSION_ERROR","Failed to remove one or more uninstall targets.",n$.ERROR,{configResults:G.map(i8),...j&&{binaryResult:i8(j)}});if(S1(Y))return N1("UPDATE_ERROR",`Binary is managed by ${Y}. Run: ${r8(Y)}`,n$.ERROR,{installMethod:Y,command:r8(Y),configResults:G.map(i8),...j&&{binaryResult:i8(j)}});let D=G.filter((A)=>A.success&&!A.skipped).map((A)=>A.target.displayPath),E=G.filter((A)=>A.skipped).map((A)=>({path:A.target.displayPath,reason:A.reason??"skipped"}));if(j){if(j.success&&!j.skipped)D.push(j.target.displayPath);else if(j.skipped)E.push({path:j.target.displayPath,reason:j.reason??"skipped"})}return lY({removed:D,skipped:E,installMethod:Y},n$.SUCCESS)}async function iA($){if($.json){await pA($);return}let v=iY(),U=zW(v);if(!U.valid)switch(U.reason){case"not-found":break;case"symlink":W.error("Safety error: Global config root is a symlink. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"not-directory":W.error("Safety error: Global config root is not a directory. Aborting."),process.exit(n$.SAFETY_ERROR);break;case"permission":W.error("Error: Cannot access global config root (permission denied)."),process.exit(n$.ERROR);break}let Q=IW(),_=Q.filter((D)=>D.safetyStatus==="forbidden");if(_.length>0){W.error("Safety error: Target escapes containment boundary:");for(let D of _)W.error(` ${D.displayPath}`);process.exit(n$.SAFETY_ERROR)}let J=Q.filter((D)=>D.safetyStatus==="error");if(J.length>0){W.error("Error: Cannot verify containment for targets (permission/IO error):");for(let D of J)W.error(` ${D.displayPath}`);process.exit(n$.ERROR)}let Y=h0(),z=XW(),I=Q.filter((D)=>D.kind!=="missing"),X=z&&z.kind!=="missing",q=S1(Y);if(I.length===0&&!X&&!q)dA(),process.exit(n$.SUCCESS);if($.dryRun)hA(Q,z,Y),process.exit(n$.SUCCESS);cA(Q,z);let G=qW(Q),j=null;if(z)j=GW(z.absolutePath);lA(G,j,Y);let H=G.some((D)=>!D.success&&!D.skipped),Z=j&&!j.success&&!j.skipped;if(H||Z)process.exit(n$.ERROR);if(S1(Y))process.exit(n$.ERROR);process.exit(n$.SUCCESS)}function KW($){$.command("uninstall").description("Remove OCX global configuration and binary").option("--dry-run","Preview what would be removed").option("--json","Output as JSON").action(async(v)=>{try{await iA(v)}catch(U){_$(U,{json:v.json})}})}var n$;var HW=b(()=>{Z4();p8();w1();l$();i$();n$={SUCCESS:0,ERROR:1,SAFETY_ERROR:2}});class WW{version="2.0.6"}var bW;var BW=b(()=>{bW=new WW});var DW={};s$(DW,{checkForUpdate:()=>rY,EXPLICIT_UPDATE_TIMEOUT_MS:()=>nY});function ZW($){let[v=""]=$.split("-"),U=v.split("."),Q=parseInt(U[0]??"",10),_=parseInt(U[1]??"",10),J=parseInt(U[2]??"",10);if(Number.isNaN(Q)||Number.isNaN(_)||Number.isNaN(J))return null;return{major:Q,minor:_,patch:J}}function oA($,v){let U=ZW($),Q=ZW(v);if(!U||!Q)return null;if(U.major!==Q.major)return U.major-Q.major;if(U.minor!==Q.minor)return U.minor-Q.minor;return U.patch-Q.patch}async function rY($,v=nA){let Q=($??bW).version||"0.0.0-dev";if(Q==="0.0.0-dev")return{ok:!1,reason:"dev-version"};try{let J=(await H8(rA,void 0,AbortSignal.timeout(v))).version,Y=oA(J,Q);if(Y===null)return{ok:!1,reason:"invalid-response"};return{ok:!0,current:Q,latest:J,updateAvailable:Y>0}}catch(_){if(_ instanceof Error){if(_.name==="AbortError"||_.name==="TimeoutError")return{ok:!1,reason:"timeout"};if(_ instanceof P$||_.name==="NetworkError")return{ok:!1,reason:"network-error"}}return{ok:!1,reason:"invalid-response"}}}var nA=200,nY=1e4,rA="ocx";var oY=b(()=>{z$();aJ();BW()});import{chmodSync as tA,existsSync as T1,renameSync as tY,unlinkSync as o8}from"fs";function eA(){let $=process.env.OCX_DOWNLOAD_URL;if($)return $.replace(/\/+$/,"");return sA}function aY($){let v=`${process.arch}-${process.platform}`,U=VW[v];if(!U){let _=Object.keys(VW).join(", ");throw new f$(`Unsupported platform: ${v}
|
|
255
|
+
Supported platforms: ${_}`)}return`${eA()}/v${$}/${U}`}async function $O($,v,U={}){let Q=U.quiet?null:D$({text:"Downloading update..."});Q?.start();let _;try{_=await fetch($,{redirect:"follow"})}catch(X){throw Q?.fail("Download failed"),new f$(`Network error: ${X instanceof Error?X.message:String(X)}`)}if(!_.ok)throw Q?.fail("Download failed"),new f$(`Failed to download: HTTP ${_.status} ${_.statusText}`);if(!_.body)throw Q?.fail("Download failed"),new f$("Download failed: Empty response body");let J=_.body.getReader(),Y=Bun.file(v).writer(),z=Number(_.headers.get("content-length")||0),I=0;try{while(!0){let{done:X,value:q}=await J.read();if(X)break;if(await Y.write(q),I+=q.length,z>0&&Q){let G=Math.round(I/z*100);Q.text=`Downloading... ${G}%`}}await Y.end(),Q?.succeed("Download complete")}catch(X){throw Q?.fail("Download failed"),await Y.end(),new f$(`Download interrupted: ${X instanceof Error?X.message:String(X)}`)}}async function MW($,v={}){let U=d8(),Q=`${U}.new.${Date.now()}`,_=aY($);await $O(_,Q,v);try{tA(Q,493)}catch(J){if(T1(Q))o8(Q);throw new f$(`Failed to set permissions: ${J instanceof Error?J.message:String(J)}`)}return{tempPath:Q,execPath:U}}function wW($,v){let U=`${v}.backup`;try{if(T1(v))tY(v,U);if(tY($,v),T1(U))o8(U)}catch(Q){if(T1(U)&&!T1(v))try{tY(U,v)}catch{}if(T1($))try{o8($)}catch{}throw new f$(`Update failed: ${Q instanceof Error?Q.message:String(Q)}`)}}function LW($){if(T1($))try{o8($)}catch{}}var aA="kdcokenny/ocx",sA,VW;var kW=b(()=>{z$();$6();p8();sA=`https://github.com/${aA}/releases/download`,VW={"arm64-darwin":"ocx-darwin-arm64","x64-darwin":"ocx-darwin-x64","arm64-linux":"ocx-linux-arm64","x64-linux":"ocx-linux-x64","x64-win32":"ocx-windows-x64.exe"}});var AW={};s$(AW,{notifyUpdated:()=>t8,notifyUpdate:()=>vO,notifyUpToDate:()=>sY});function vO($,v){if(!process.stdout.isTTY)return;console.error(`${m.cyan("info")}: update available - ${m.green(v)} (current: ${m.dim($)})`),console.error(` run ${m.cyan("`ocx self update`")} to upgrade`)}function sY($){console.error(`${m.cyan("info")}: ocx unchanged - ${m.dim($)}`)}function t8($,v){console.error(` ${m.green("ocx updated")} - ${v} (from ${$})`)}var eY=b(()=>{O6()});import{createHash as _O}from"crypto";function QO($){let v=new Map;for(let U of $.split(`
|
|
256
|
+
`)){let Q=U.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/);if(Q?.[1]&&Q[2])v.set(Q[2].trim(),Q[1].toLowerCase())}return v}function JO($){return _O("sha256").update($).digest("hex")}async function OW($){let v=`https://github.com/${UO}/releases/download/v${$}/SHA256SUMS.txt`,U=await fetch(v);if(!U.ok)throw new f$(`Failed to fetch checksums: ${U.status}`);let Q=await U.text();return QO(Q)}async function FW($,v,U){let _=await Bun.file($).arrayBuffer(),J=JO(Buffer.from(_));if(J!==v)throw new X1(U,v,J)}var UO="kdcokenny/ocx";var NW=b(()=>{z$()});var SW={};s$(SW,{runSelfUpdateCommand:()=>IO});async function IO($){let v=$.method?vW($.method):h0(),U=$.json===!0,Q=await rY(void 0,nY);if(!Q.ok)throw new f$(zO[Q.reason]);let{current:_,latest:J,updateAvailable:Y}=Q;if(!Y&&!$.force){if(U)F$({success:!0,data:{current:_,latest:J,method:v,updated:!1}});else sY(_);return}let z=J;switch(v){case"curl":{await XO(_,z,U);break}case"npm":case"pnpm":case"bun":case"yarn":case"unknown":{await qO(v,_,z,U);break}}if(U)F$({success:!0,data:{current:_,latest:z,method:v,updated:!0}})}async function XO($,v,U){let _=aY(v).split("/").pop();if(!_)throw new f$("Failed to determine binary filename from download URL");let Y=(await OW(v)).get(_);if(!Y)throw new f$(`Security error: No checksum found for ${_}. Update aborted.`);let{tempPath:z,execPath:I}=await MW(v,{quiet:U});try{await FW(z,Y,_)}catch(X){throw LW(z),X}if(wW(z,I),!U)t8($,v)}async function a8($){let v=Bun.spawn($,{stdout:"pipe",stderr:"pipe"});if(await v.exited!==0){let Q=await new Response(v.stderr).text();throw new f$(`Package manager command failed: ${Q.trim()}`)}}async function qO($,v,U,Q){if(!YO.test(U))throw new f$(`Invalid version format: ${U}`);let _=Q?null:D$({text:`Updating via ${$}...`});_?.start();try{switch($){case"npm":{await a8(["npm","install","-g",`ocx@${U}`]);break}case"yarn":{await a8(["yarn","global","add",`ocx@${U}`]);break}case"pnpm":{await a8(["pnpm","install","-g",`ocx@${U}`]);break}case"bun":{await a8(["bun","install","-g",`ocx@${U}`]);break}case"unknown":throw new f$(`Could not detect install method. Update manually with one of:
|
|
215
257
|
npm install -g ocx@latest
|
|
216
258
|
pnpm install -g ocx@latest
|
|
217
|
-
bun install -g ocx@latest`)}if(_?.succeed(`Updated via ${
|
|
259
|
+
bun install -g ocx@latest`)}if(_?.succeed(`Updated via ${$}`),!Q)t8(v,U)}catch(J){if(J instanceof f$)throw _?.fail("Update failed"),J;throw _?.fail("Update failed"),new f$(`Failed to run ${$}: ${J instanceof Error?J.message:String(J)}`)}}var YO,zO;var TW=b(()=>{oY();p8();kW();eY();NW();z$();$6();YO=/^\d+\.\d+\.\d+(-[\w.]+)?$/,zO={"dev-version":"Cannot check for updates in development mode. Install via npm for update support.",timeout:"Update check timed out after 10s. Try again or check your network.","network-error":"Cannot reach npm registry. Verify your internet connection.","invalid-response":"Received invalid response from npm registry. Try again later."}});function RW($){$.command("update").description("Update OCX to the latest version").option("-f, --force","Reinstall even if already up to date").option("--method <method>","Override install method detection (curl|npm|pnpm|bun)").option("--json","Output as JSON").action(async(v)=>{try{let{runSelfUpdateCommand:U}=await Promise.resolve().then(() => (TW(),SW));await U(v)}catch(U){_$(U,{json:v.json})}})}var EW=b(()=>{l$()});function PW($){let v=$.command("self").description("Manage the OCX CLI");KW(v),RW(v)}var xW=b(()=>{HW();EW()});import{randomUUID as uW}from"crypto";import{existsSync as R1}from"fs";import{mkdir as GO,rename as jO,rm as s8,stat as KO,writeFile as HO}from"fs/promises";import{dirname as WO,join as bO}from"path";function $z($,v){return`ocx add${v.global?" --global":""} ${$}`}function yW($){return $==="apply"?"Failed to update components":"Failed to check for updates"}function CW($){let v=$.command("update [components...]").description("Update installed components");Q4(v),h4(v),K6(v),v.option("--all","Update all installed components").option("--registry <name>","Update all components from a specific registry").option("--dry-run","Preview changes without applying").action(async(U,Q)=>{try{await BO(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function BO($,v){let U=v.cwd??process.cwd(),Q=v.global?await L0.requireInitialized():await f4.requireInitialized(U);await ZO($,v,Q)}async function ZO($,v,U,Q){let _=U.getRegistries(),J=U.getComponentPath(),Y=J===""||J===".",z=$.map(VO),I=await F4(U.cwd);if(!I||Object.keys(I.installed).length===0){if($.length>0){let O=$[0];if(!O)throw Error("Unexpected: component name missing despite non-empty componentNames");throw new B$(`Component '${O}' is not installed. Run '${$z(O,v)}' first.`)}throw new B$(`No components installed. Run '${$z("<component>",v)}' first.`)}let X=$.length>0,q=v.all===!0,G=v.registry!==void 0;if(!X&&!q&&!G)throw new M(`Specify components, use --all, or use --registry <name>.
|
|
218
260
|
|
|
219
261
|
Examples:
|
|
220
262
|
ocx update alias/component # Update specific component
|
|
221
263
|
ocx update --all # Update all installed components
|
|
222
|
-
ocx update --registry my-alias # Update all from a registry`);if(X
|
|
223
|
-
Use either 'ocx update --all' or 'ocx update <components>'.`);if(
|
|
224
|
-
Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(
|
|
225
|
-
Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let
|
|
226
|
-
Use '${
|
|
227
|
-
`+
|
|
264
|
+
ocx update --registry my-alias # Update all from a registry`);if(q&&X)throw new M(`Cannot specify components with --all.
|
|
265
|
+
Use either 'ocx update --all' or 'ocx update <components>'.`);if(G&&X)throw new M(`Cannot specify components with --registry.
|
|
266
|
+
Use either 'ocx update --registry <name>' or 'ocx update <components>'.`);if(q&&G)throw new M(`Cannot use --all with --registry.
|
|
267
|
+
Use either 'ocx update --all' or 'ocx update --registry <name>'.`);let j=MO(I,z,v);if(j.length===0){if(G)throw new B$(`No installed components from registry '${v.registry}'.`);throw new B$("No matching components found to update.")}let H=v.quiet?null:D$({text:"Checking for updates..."});H?.start();let Z=null,D="check",E=null,A=[],r=[];try{for(let w of j){let N=w.component,L=I.installed[N];if(!L)throw new B$(`Component '${N}' not found in receipt.`);let{registryName:U$,name:$$}=L,a=_[U$];if(!a)throw new d(`Registry alias '${U$}' not configured. Component '${N}' cannot be updated.`);let x=(await j8(a.url,$$,void 0)).manifest,o=j1(x),y=[];for(let v$ of o.files){let R$=await D1(a.url,$$,v$.path);y.push({path:v$.path,content:Buffer.from(R$)})}let h=await b8(y),I$=`sha256:${h}`;if(h===L.hash)A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"up-to-date"});else if(v.dryRun)A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"would-update"});else A.push({qualifiedName:N,oldVersion:L.revision,newVersion:I$,status:"updated"}),r.push({canonicalId:N,component:o,files:y,newHash:h,newVersion:I$,baseUrl:a.url,registryName:U$,name:$$})}if(H?.succeed(`Checked ${j.length} component(s)`),v.dryRun){wO(A,v);return}if(r.length===0){if(!v.quiet&&!v.json)W.info(""),W.success("All components are up to date.");if(v.json)console.log(JSON.stringify({success:!0,updated:[],upToDate:A},null,2));return}D="apply",Z=v.quiet?null:D$({text:"Updating components..."}),Z?.start();let O=new Map,g=[];for(let w of r){let N=[];for(let L of w.files){let U$=w.component.files.find((V$)=>V$.path===L.path);if(!U$)throw new M(`File "${L.path}" not found in component manifest for "${w.registryName}/${w.name}".`);let $$=H1(U$.target,Y,U.cwd),a=bO(U.cwd,$$);L1(O,{absolutePath:a,relativePath:$$,content:L.content,source:`${w.registryName}/${w.name}:${U$.path}`}),N.push({resolvedTarget:$$,targetPath:a,content:L.content})}g.push({update:w,preparedFiles:N})}E=await DO(g,{verbose:v.verbose,quiet:v.quiet,fileOps:Q});for(let w of g){let{update:N,preparedFiles:L}=w,U$=I.installed[N.canonicalId];if(!U$)throw new B$(`Component '${N.canonicalId}' not found in receipt.`);let $$=[];for(let a of L)$$.push({path:a.resolvedTarget,hash:k1(a.content)});I.installed[N.canonicalId]={registryUrl:U$.registryUrl,registryName:U$.registryName,name:U$.name,revision:N.newVersion,hash:N.newHash,files:$$,installedAt:U$.installedAt,updatedAt:new Date().toISOString(),...N.component.opencode&&{opencode:N.component.opencode}}}if(await y4(U.cwd,I),!E)throw Error("Internal error: missing applied write transaction after update apply phase.");if(await E.commit(),E=null,Z?.succeed(`Updated ${r.length} component(s)`),v.json)console.log(JSON.stringify({success:!0,updated:A.filter((w)=>w.status==="updated"),upToDate:A.filter((w)=>w.status==="up-to-date")},null,2));else if(!v.quiet){W.info("");for(let w of A)if(w.status==="updated")W.info(` \u2713 ${w.qualifiedName} (${w.oldVersion} \u2192 ${w.newVersion})`);else if(w.status==="up-to-date"&&v.verbose)W.info(` \u25CB ${w.qualifiedName} (already up to date)`);W.info(""),W.success(`Done! Updated ${r.length} component(s).`)}}catch(O){if(D==="apply"){if(E)await E.rollback(),E=null;Z?.fail(yW("apply"))}else H?.fail(yW("check"));throw O}}async function DO($,v){let U=[],Q=new Set,_=!1,J=v.fileOps?.rename??jO,Y=async()=>{if(_)return;_=!0;for(let I of Q)try{await s8(I,{force:!0})}catch{}for(let I of[...U].reverse())try{if(I.backupPath){if(R1(I.targetPath))await s8(I.targetPath,{force:!0,recursive:!0});if(R1(I.backupPath))await J(I.backupPath,I.targetPath)}else if(R1(I.targetPath))await s8(I.targetPath,{force:!0,recursive:!0})}catch{}},z=async()=>{if(_)return;_=!0;for(let I of U){if(!I.backupPath)continue;if(R1(I.backupPath))try{await s8(I.backupPath,{force:!0})}catch(X){if(!v.quiet){let q=X instanceof Error?X.message:String(X);W.warn(`Post-update cleanup warning: failed to remove backup "${I.backupPath}" (${q})`)}}}};try{for(let I of $)for(let X of I.preparedFiles){let q=WO(X.targetPath);if(!R1(q))await GO(q,{recursive:!0});if(R1(X.targetPath)){if((await KO(X.targetPath)).isDirectory())throw new M(`Cannot update "${X.resolvedTarget}": target path is a directory.`)}let G=`${X.targetPath}.ocx-update-tmp-${uW()}`;await HO(G,X.content),Q.add(G);let j=null;if(R1(X.targetPath))j=`${X.targetPath}.ocx-update-backup-${uW()}`,await J(X.targetPath,j),U.push({targetPath:X.targetPath,backupPath:j});if(await J(G,X.targetPath),Q.delete(G),!j)U.push({targetPath:X.targetPath,backupPath:null});if(v.verbose)W.info(` \u2713 Updated ${X.resolvedTarget}`)}return{commit:z,rollback:Y}}catch(I){throw await Y(),I}}function VO($){if($.endsWith("@"))throw new d(`Invalid version specifier '${$}'. The trailing '@' has no version.
|
|
268
|
+
Use '${$.slice(0,-1)}' to update to the latest version.`);return{component:$}}function MO($,v,U){let Q=Object.keys($.installed);if(U.all)return Q.map((J)=>({component:J}));if(U.registry)return Q.filter((J)=>{return $.installed[J]?.registryName===U.registry}).map((J)=>({component:J}));let _=[];for(let J of v){let Y=J.component;if(!Y.includes("/")){let G=Q.map((j)=>{let H=l6(j);return`${H.registryName}/${H.name}`}).filter((j)=>j.endsWith(`/${Y}`));if(G.length===1)throw new M(`Ambiguous component '${Y}'. Did you mean '${G[0]}'?`);if(G.length>1)throw new M(`Ambiguous component '${Y}'. Found in multiple registries:
|
|
269
|
+
`+G.map((j)=>` - ${j}`).join(`
|
|
228
270
|
`)+`
|
|
229
271
|
|
|
230
|
-
Please use a fully qualified name (alias/component).`);throw new
|
|
231
|
-
Run '${
|
|
272
|
+
Please use a fully qualified name (alias/component).`);throw new M(`Component '${Y}' must include a registry alias (e.g., 'kdco/${Y}').`)}let{namespace:z,component:I}=o4(Y),X=Q.filter((G)=>{let j=l6(G);return j.registryName===z&&j.name===I});if(X.length===0)throw new B$(`Component '${Y}' is not installed.
|
|
273
|
+
Run '${$z(Y,U)}' to install it first.`);let q=X[0];if(!q)throw Error("Unexpected: matchingIds has length but first element is undefined");_.push({component:q})}return _}function wO($,v){let U=$.filter((J)=>J.status==="would-update"),_={dryRun:!0,command:"update",wouldPerform:U.map((J)=>({action:"update",target:J.qualifiedName,details:{from:J.oldVersion,to:J.newVersion}})),validation:{passed:!0},summary:U.length>0?`Would update ${U.length} component(s)`:"All components are up to date"};T4(_,{json:v.json,quiet:v.quiet})}var fW=b(()=>{k0();V1();X4();t4();w1();z$();l$();i$();i6();W8();T0();s4();$6()});import{resolve as LO}from"path";function kO($,v){if(v==="not_found")return new B$($);if(v==="parse_error")return new b$($,"CONFIG_ERROR",K$.CONFIG);return new b$($,"CONFIG_ERROR",K$.CONFIG)}function AO($,v){let U=ev($,{schemaErrors:v==="schema"?$.length:0}),Q={valid:!1,errors:$,summary:{valid:!1,totalErrors:U.totalErrors,schemaErrors:U.schemaErrors,sourceFileErrors:U.sourceFileErrors,circularDependencyErrors:U.circularDependencyErrors,duplicateTargetErrors:U.duplicateTargetErrors,otherErrors:U.otherErrors}};return new I1(Q)}function OO($){for(let v of $)console.log(m.red(` ${v}`))}function mW($){$.command("validate").description("Validate a registry source (for registry authors)").argument("[path]","Registry source directory",".").option("--cwd <path>","Working directory",process.cwd()).option("--json","Output as JSON",!1).option("-q, --quiet","Suppress output",!1).option("--no-duplicate-targets","Skip duplicate target validation").action(async(v,U)=>{try{let Q=LO(U.cwd,v),_=await T8(Q,{skipDuplicateTargets:U.duplicateTargets===!1});if(!_.success){let[J="Registry validation failed"]=_.errors;if(_.failureType==="load"){let z=kO(J,_.loadErrorKind);if(!U.json&&U.quiet){let I=z instanceof b$?z.exitCode:K$.GENERAL;process.exit(I)}throw z}let Y=AO(_.errors,_.failureType==="schema"?"schema":"rules");if(U.json)throw Y;if(!U.quiet)W.error(Y.message),OO(_.errors);process.exit(Y.exitCode)}if(!U.quiet&&!U.json)W.success("\u2713 Registry source is valid");if(U.json)F$({success:!0,data:{valid:!0,errors:[],summary:ev([])}})}catch(Q){if(!U.json&&U.quiet){let _=Q instanceof b$?Q.exitCode:K$.GENERAL;process.exit(_)}_$(Q,{json:U.json})}})}var gW=b(()=>{O6();AY();z$();l$();i$()});function hW($){let v=$.command("verify").description("Verify integrity of installed components").argument("[components...]","Components to verify (optional, verifies all if omitted)");Q4(v),h4(v),v.action(async(U,Q)=>{try{await FO(U,Q)}catch(_){_$(_,{json:Q.json})}})}async function FO($,v){let U=v.cwd??process.cwd(),Q=await f4.requireInitialized(U),_=await F4(Q.cwd);if(!_||Object.keys(_.installed).length===0){if(v.json)console.log(JSON.stringify({success:!0,verified:[],errors:[]},null,2));else if(!v.quiet)W.info("No components installed.");return}let J;if($.length>0)J=c8($,_);else J=Object.keys(_.installed);let Y=v.quiet||v.json?null:D$({text:"Verifying components..."});Y?.start();let z=[],I=!1;for(let X of J){let q=_.installed[X];if(!q){if($.length>0)W.warn(`Component '${X}' not found in receipt.`);continue}let G=await iv(Q.cwd,q);if(!G.intact)I=!0;z.push({canonicalId:X,intact:G.intact,modified:G.modified,missing:G.missing})}if(Y?.succeed(`Verified ${z.length} component(s)`),v.json){if(console.log(JSON.stringify({success:!I,verified:z.filter((X)=>X.intact),errors:z.filter((X)=>!X.intact)},null,2)),I)process.exit(K$.CONFLICT);return}if(!v.quiet){W.info("");for(let X of z)if(X.intact){if(v.verbose)W.success(`\u2713 ${X.canonicalId} - all files intact`)}else{W.error(`\u2717 ${X.canonicalId} - integrity check failed`);for(let q of X.modified)W.error(` Modified: ${q}`);for(let q of X.missing)W.error(` Missing: ${q}`)}}if(I){if(!v.quiet)W.info(""),W.warn("Some files have been modified or are missing. Review local changes with git, then run 'ocx update <alias/component>' or 'ocx update --all' to restore.");throw new t$("File integrity check failed for one or more components.")}if(!v.quiet)W.info(""),W.success("All components verified successfully.")}var cW=b(()=>{k0();X4();hY();z$();l$();i$();T0();s4();$6()});function NO(){if(process.env.OCX_SELF_UPDATE==="off")return!1;if(Yj(process.env.OCX_NO_UPDATE_CHECK,!1))return!1;if(process.env.CI)return!1;if(!process.stdout.isTTY)return!1;return!0}function lW($){$.hook("postAction",async(v,U)=>{if(U.name()==="update"&&U.parent?.name()==="self")return;let Q=U.opts();if(Q.json||Q.quiet)return;if(!NO())return;try{let[{checkForUpdate:_},{notifyUpdate:J}]=await Promise.all([Promise.resolve().then(() => (oY(),DW)),Promise.resolve().then(() => (eY(),AW))]),Y=await _();if(Y.ok&&Y.updateAvailable)J(Y.current,Y.latest)}catch{}})}var dW=b(()=>{pv()});var pW={};s$(pW,{runCli:()=>TO});async function TO($=process.argv){let v=new eq().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(SO);hK(v),kK(v),CW(v),eH(v),cH(v),TK(v),mW(v),PW(v),hW(v),iH(v),tK(v),fH(v),CK(v),ZH(v),lW(v),await v.parseAsync($)}var SO="2.0.6";var iW=b(()=>{$8();kY();RK();fK();lK();sK();DH();mH();lH();nH();$W();xW();fW();gW();cW();dW()});r_();LJ();if(import.meta.main)RO();async function RO(){try{let{runCli:$}=await Promise.resolve().then(() => (iW(),pW));await $()}catch($){let{handleError:v}=await Promise.resolve().then(() => (l$(),zj));v($)}}export{K1 as registrySchema,xv as packumentSchema,t_ as ocxLockSchema,c6 as ocxConfigSchema,G1 as componentManifestSchema,uv as buildRegistry};
|
|
232
274
|
|
|
233
|
-
//# debugId=
|
|
275
|
+
//# debugId=3988DB7BCAA1BB5964756E2164756E21
|