@sazabi/cli 0.26.1-dev.g09eed0e → 0.26.1-dev.g6c33d95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -102,7 +102,7 @@ ${og("OPTIONS")}`,I+=`
102
102
 
103
103
  `)}a.write("payload.value = newResult;"),a.write("return payload;");let Y=a.compile();return(T,H)=>Y(E,T,H)},o,e=Me,I=!hc.jitless,B=I&&BN.value,c=t.catchall,C;A._zod.parse=(E,a)=>{C??(C=i.value);let y=E.value;if(!e(y))return E.issues.push({expected:"object",code:"invalid_type",input:y,inst:A}),E;if(I&&B&&a?.async===!1&&a.jitless!==!0){if(!o)o=n(t.shape);if(E=o(E,a),!c)return E;return kv([],y,E,a,C,A)}return g(E,a)}});Sc=k("$ZodUnion",(A,t)=>{NA.init(A,t),TA(A._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),TA(A._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),TA(A._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),TA(A._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((o)=>o._zod.pattern);return new RegExp(`^(${n.map((o)=>Ec(o.source)).join("|")})$`)}return});let g=t.options.length===1,i=t.options[0]._zod.run;A._zod.parse=(n,o)=>{if(g)return i(n,o);let e=!1,I=[];for(let h of t.options){let B=h._zod.run({value:n.value,issues:[]},o);if(B instanceof Promise)I.push(B),e=!0;else{if(B.issues.length===0)return B;I.push(B)}}if(!e)return yv(I,n,A,o);return Promise.all(I).then((h)=>{return yv(h,n,A,o)})}});tU=k("$ZodXor",(A,t)=>{Sc.init(A,t),t.inclusive=!1;let g=t.options.length===1,i=t.options[0]._zod.run;A._zod.parse=(n,o)=>{if(g)return i(n,o);let e=!1,I=[];for(let h of t.options){let B=h._zod.run({value:n.value,issues:[]},o);if(B instanceof Promise)I.push(B),e=!0;else I.push(B)}if(!e)return wv(I,n,A,o);return Promise.all(I).then((h)=>{return wv(h,n,A,o)})}}),gU=k("$ZodDiscriminatedUnion",(A,t)=>{t.inclusive=!1,Sc.init(A,t);let g=A._zod.parse;TA(A._zod,"propValues",()=>{let n={};for(let o of t.options){let e=o._zod.propValues;if(!e||Object.keys(e).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[I,h]of Object.entries(e)){if(!n[I])n[I]=new Set;for(let B of h)n[I].add(B)}}return n});let i=dQ(()=>{let n=t.options,o=new Map;for(let e of n){let I=e._zod.propValues?.[t.discriminator];if(!I||I.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(e)}"`);for(let h of I){if(o.has(h))throw Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,e)}}return o});A._zod.parse=(n,o)=>{let e=n.value;if(!Me(e))return n.issues.push({code:"invalid_type",expected:"object",input:e,inst:A}),n;let I=i.value.get(e?.[t.discriminator]);if(I)return I._zod.run(n,o);if(t.unionFallback)return g(n,o);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:e,path:[t.discriminator],inst:A}),n}}),nU=k("$ZodIntersection",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value,o=t.left._zod.run({value:n,issues:[]},i),e=t.right._zod.run({value:n,issues:[]},i);if(o instanceof Promise||e instanceof Promise)return Promise.all([o,e]).then(([h,B])=>{return Dv(g,h,B)});return Dv(g,o,e)}});Cr=k("$ZodTuple",(A,t)=>{NA.init(A,t);let g=t.items;A._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:A,expected:"tuple",code:"invalid_type"}),i;i.value=[];let e=[],I=[...g].reverse().findIndex((c)=>c._zod.optin!=="optional"),h=I===-1?0:g.length-I;if(!t.rest){let c=o.length>g.length,C=o.length<h-1;if(c||C)return i.issues.push({...c?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:o,inst:A,origin:"array"}),i}let B=-1;for(let c of g){if(B++,B>=o.length){if(B>=h)continue}let C=c._zod.run({value:o[B],issues:[]},n);if(C instanceof Promise)e.push(C.then((E)=>or(E,i,B)));else or(C,i,B)}if(t.rest){let c=o.slice(g.length);for(let C of c){B++;let E=t.rest._zod.run({value:C,issues:[]},n);if(E instanceof Promise)e.push(E.then((a)=>or(a,i,B)));else or(E,i,B)}}if(e.length)return Promise.all(e).then(()=>i);return i}});iU=k("$ZodRecord",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!yo(n))return g.issues.push({expected:"record",code:"invalid_type",input:n,inst:A}),g;let o=[],e=t.keyType._zod.values;if(e){g.value={};let I=new Set;for(let B of e)if(typeof B==="string"||typeof B==="number"||typeof B==="symbol"){I.add(typeof B==="number"?B.toString():B);let c=t.valueType._zod.run({value:n[B],issues:[]},i);if(c instanceof Promise)o.push(c.then((C)=>{if(C.issues.length)g.issues.push(..._g(B,C.issues));g.value[B]=C.value}));else{if(c.issues.length)g.issues.push(..._g(B,c.issues));g.value[B]=c.value}}let h;for(let B in n)if(!I.has(B))h=h??[],h.push(B);if(h&&h.length>0)g.issues.push({code:"unrecognized_keys",input:n,inst:A,keys:h})}else{g.value={};for(let I of Reflect.ownKeys(n)){if(I==="__proto__")continue;let h=t.keyType._zod.run({value:I,issues:[]},i);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof I==="string"&&bc.test(I)&&h.issues.length){let C=t.keyType._zod.run({value:Number(I),issues:[]},i);if(C instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(C.issues.length===0)h=C}if(h.issues.length){if(t.mode==="loose")g.value[I]=n[I];else g.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map((C)=>kg(C,i,Ft())),input:I,path:[I],inst:A});continue}let c=t.valueType._zod.run({value:n[I],issues:[]},i);if(c instanceof Promise)o.push(c.then((C)=>{if(C.issues.length)g.issues.push(..._g(I,C.issues));g.value[h.value]=C.value}));else{if(c.issues.length)g.issues.push(..._g(I,c.issues));g.value[h.value]=c.value}}}if(o.length)return Promise.all(o).then(()=>g);return g}}),oU=k("$ZodMap",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!(n instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:n,inst:A}),g;let o=[];g.value=new Map;for(let[e,I]of n){let h=t.keyType._zod.run({value:e,issues:[]},i),B=t.valueType._zod.run({value:I,issues:[]},i);if(h instanceof Promise||B instanceof Promise)o.push(Promise.all([h,B]).then(([c,C])=>{uv(c,C,g,e,n,A,i)}));else uv(h,B,g,e,n,A,i)}if(o.length)return Promise.all(o).then(()=>g);return g}});eU=k("$ZodSet",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!(n instanceof Set))return g.issues.push({input:n,inst:A,expected:"set",code:"invalid_type"}),g;let o=[];g.value=new Set;for(let e of n){let I=t.valueType._zod.run({value:e,issues:[]},i);if(I instanceof Promise)o.push(I.then((h)=>bv(h,g)));else bv(I,g)}if(o.length)return Promise.all(o).then(()=>g);return g}});QU=k("$ZodEnum",(A,t)=>{NA.init(A,t);let g=Cc(t.entries),i=new Set(g);A._zod.values=i,A._zod.pattern=new RegExp(`^(${g.filter((n)=>ac.has(typeof n)).map((n)=>typeof n==="string"?an(n):n.toString()).join("|")})$`),A._zod.parse=(n,o)=>{let e=n.value;if(i.has(e))return n;return n.issues.push({code:"invalid_value",values:g,input:e,inst:A}),n}}),IU=k("$ZodLiteral",(A,t)=>{if(NA.init(A,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(t.values);A._zod.values=g,A._zod.pattern=new RegExp(`^(${t.values.map((i)=>typeof i==="string"?an(i):i?an(i.toString()):String(i)).join("|")})$`),A._zod.parse=(i,n)=>{let o=i.value;if(g.has(o))return i;return i.issues.push({code:"invalid_value",values:t.values,input:o,inst:A}),i}}),hU=k("$ZodFile",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(n instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:n,inst:A}),g}}),BU=k("$ZodTransform",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new Fe(A.constructor.name);let n=t.transform(g.value,g);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((e)=>{return g.value=e,g});if(n instanceof Promise)throw new ti;return g.value=n,g}});Er=k("$ZodOptional",(A,t)=>{NA.init(A,t),A._zod.optin="optional",A._zod.optout="optional",TA(A._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0}),TA(A._zod,"pattern",()=>{let g=t.innerType._zod.pattern;return g?new RegExp(`^(${Ec(g.source)})?$`):void 0}),A._zod.parse=(g,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>lv(o,g.value));return lv(n,g.value)}if(g.value===void 0)return g;return t.innerType._zod.run(g,i)}}),cU=k("$ZodExactOptional",(A,t)=>{Er.init(A,t),TA(A._zod,"values",()=>t.innerType._zod.values),TA(A._zod,"pattern",()=>t.innerType._zod.pattern),A._zod.parse=(g,i)=>{return t.innerType._zod.run(g,i)}}),CU=k("$ZodNullable",(A,t)=>{NA.init(A,t),TA(A._zod,"optin",()=>t.innerType._zod.optin),TA(A._zod,"optout",()=>t.innerType._zod.optout),TA(A._zod,"pattern",()=>{let g=t.innerType._zod.pattern;return g?new RegExp(`^(${Ec(g.source)}|null)$`):void 0}),TA(A._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0}),A._zod.parse=(g,i)=>{if(g.value===null)return g;return t.innerType._zod.run(g,i)}}),EU=k("$ZodDefault",(A,t)=>{NA.init(A,t),A._zod.optin="optional",TA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);if(g.value===void 0)return g.value=t.defaultValue,g;let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>Nv(o,t));return Nv(n,t)}});aU=k("$ZodPrefault",(A,t)=>{NA.init(A,t),A._zod.optin="optional",TA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);if(g.value===void 0)g.value=t.defaultValue;return t.innerType._zod.run(g,i)}}),rU=k("$ZodNonOptional",(A,t)=>{NA.init(A,t),TA(A._zod,"values",()=>{let g=t.innerType._zod.values;return g?new Set([...g].filter((i)=>i!==void 0)):void 0}),A._zod.parse=(g,i)=>{let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>Uv(o,A));return Uv(n,A)}});yU=k("$ZodSuccess",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new Fe("ZodSuccess");let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>{return g.value=o.issues.length===0,g});return g.value=n.issues.length===0,g}}),wU=k("$ZodCatch",(A,t)=>{NA.init(A,t),TA(A._zod,"optin",()=>t.innerType._zod.optin),TA(A._zod,"optout",()=>t.innerType._zod.optout),TA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>{if(g.value=o.value,o.issues.length)g.value=t.catchValue({...g,error:{issues:o.issues.map((e)=>kg(e,i,Ft()))},input:g.value}),g.issues=[];return g});if(g.value=n.value,n.issues.length)g.value=t.catchValue({...g,error:{issues:n.issues.map((o)=>kg(o,i,Ft()))},input:g.value}),g.issues=[];return g}}),DU=k("$ZodNaN",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{if(typeof g.value!=="number"||!Number.isNaN(g.value))return g.issues.push({input:g.value,inst:A,expected:"nan",code:"invalid_type"}),g;return g}}),uU=k("$ZodPipe",(A,t)=>{NA.init(A,t),TA(A._zod,"values",()=>t.in._zod.values),TA(A._zod,"optin",()=>t.in._zod.optin),TA(A._zod,"optout",()=>t.out._zod.optout),TA(A._zod,"propValues",()=>t.in._zod.propValues),A._zod.parse=(g,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(g,i);if(o instanceof Promise)return o.then((e)=>er(e,t.in,i));return er(o,t.in,i)}let n=t.in._zod.run(g,i);if(n instanceof Promise)return n.then((o)=>er(o,t.out,i));return er(n,t.out,i)}});Lc=k("$ZodCodec",(A,t)=>{NA.init(A,t),TA(A._zod,"values",()=>t.in._zod.values),TA(A._zod,"optin",()=>t.in._zod.optin),TA(A._zod,"optout",()=>t.out._zod.optout),TA(A._zod,"propValues",()=>t.in._zod.propValues),A._zod.parse=(g,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(g,i);if(o instanceof Promise)return o.then((e)=>Qr(e,t,i));return Qr(o,t,i)}else{let o=t.out._zod.run(g,i);if(o instanceof Promise)return o.then((e)=>Qr(e,t,i));return Qr(o,t,i)}}});bU=k("$ZodReadonly",(A,t)=>{NA.init(A,t),TA(A._zod,"propValues",()=>t.innerType._zod.propValues),TA(A._zod,"values",()=>t.innerType._zod.values),TA(A._zod,"optin",()=>t.innerType?._zod?.optin),TA(A._zod,"optout",()=>t.innerType?._zod?.optout),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then(Sv);return Sv(n)}});lU=k("$ZodTemplateLiteral",(A,t)=>{NA.init(A,t);let g=[];for(let i of t.parts)if(typeof i==="object"&&i!==null){if(!i._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;g.push(n.slice(o,e))}else if(i===null||CN.has(typeof i))g.push(an(`${i}`));else throw Error(`Invalid template literal part: ${i}`);A._zod.pattern=new RegExp(`^${g.join("")}$`),A._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:A,expected:"string",code:"invalid_type"}),i;if(A._zod.pattern.lastIndex=0,!A._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:A,code:"invalid_format",format:t.format??"template_literal",pattern:A._zod.pattern.source}),i;return i}}),NU=k("$ZodFunction",(A,t)=>{return NA.init(A,t),A._def=t,A._zod.def=t,A.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(...i){let n=A._def.input?Va(A._def.input,i):i,o=Reflect.apply(g,this,n);if(A._def.output)return Va(A._def.output,o);return o}},A.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(...i){let n=A._def.input?await Ha(A._def.input,i):i,o=await Reflect.apply(g,this,n);if(A._def.output)return await Ha(A._def.output,o);return o}},A._zod.parse=(g,i)=>{if(typeof g.value!=="function")return g.issues.push({code:"invalid_type",expected:"function",input:g.value,inst:A}),g;if(A._def.output&&A._def.output._zod.def.type==="promise")g.value=A.implementAsync(g.value);else g.value=A.implement(g.value);return g},A.input=(...g)=>{let i=A.constructor;if(Array.isArray(g[0]))return new i({type:"function",input:new Cr({type:"tuple",items:g[0],rest:g[1]}),output:A._def.output});return new i({type:"function",input:g[0],output:A._def.output})},A.output=(g)=>{return new A.constructor({type:"function",input:A._def.input,output:g})},A}),UU=k("$ZodPromise",(A,t)=>{NA.init(A,t),A._zod.parse=(g,i)=>{return Promise.resolve(g.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}}),SU=k("$ZodLazy",(A,t)=>{NA.init(A,t),TA(A._zod,"innerType",()=>t.getter()),TA(A._zod,"pattern",()=>A._zod.innerType?._zod?.pattern),TA(A._zod,"propValues",()=>A._zod.innerType?._zod?.propValues),TA(A._zod,"optin",()=>A._zod.innerType?._zod?.optin??void 0),TA(A._zod,"optout",()=>A._zod.innerType?._zod?.optout??void 0),A._zod.parse=(g,i)=>{return A._zod.innerType._zod.run(g,i)}}),LU=k("$ZodCustom",(A,t)=>{ht.init(A,t),NA.init(A,t),A._zod.parse=(g,i)=>{return g},A._zod.check=(g)=>{let i=g.value,n=t.fn(i);if(n instanceof Promise)return n.then((o)=>Lv(o,g,i,A));Lv(n,g,i,A);return}})});function MU(){return{localeError:pDA()}}var pDA=()=>{let A={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return A[n]??null}let g={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${I}`;return`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${I}`}case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${X(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${e.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${e.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if(o.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`;if(o.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`;if(o.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`;return`${g[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${J(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};var Gv=r(()=>{BA()});function YU(){return{localeError:AuA()}}var AuA=()=>{let A={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${I}`;return`Yanlış dəyər: gözlənilən ${o}, daxil olan ${I}`}case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${X(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${e.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${e.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`;if(o.format==="ends_with")return`Yanlış mətn: "${o.suffix}" ilə bitməlidir`;if(o.format==="includes")return`Yanlış mətn: "${o.includes}" daxil olmalıdır`;if(o.format==="regex")return`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${g[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var Tv=r(()=>{BA()});function Jv(A,t,g,i){let n=Math.abs(A),o=n%10,e=n%100;if(e>=11&&e<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return g;return i}function kU(){return{localeError:tuA()}}var tuA=()=>{let A={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return A[n]??null}let g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},i={nan:"NaN",number:"лік",array:"масіў"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${I}`;return`Няправільны ўвод: чакаўся ${o}, атрымана ${I}`}case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${X(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e){let I=Number(n.maximum),h=Jv(I,e.unit.one,e.unit.few,e.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${e.verb} ${o}${n.maximum.toString()} ${h}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e){let I=Number(n.minimum),h=Jv(I,e.unit.one,e.unit.few,e.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${e.verb} ${o}${n.minimum.toString()} ${h}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${o.prefix}"`;if(o.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${o.suffix}"`;if(o.format==="includes")return`Няправільны радок: павінен змяшчаць "${o.includes}"`;if(o.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`;return`Няправільны ${g[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${J(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};var Pv=r(()=>{BA()});function $U(){return{localeError:guA()}}var guA=()=>{let A={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(n){return A[n]??null}let g={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},i={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Невалиден вход: очакван instanceof ${n.expected}, получен ${I}`;return`Невалиден вход: очакван ${o}, получен ${I}`}case"invalid_value":if(n.values.length===1)return`Невалиден вход: очакван ${X(n.values[0])}`;return`Невалидна опция: очаквано едно от ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${o}${n.maximum.toString()} ${e.unit??"елемента"}`;return`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Твърде малко: очаква се ${n.origin} да съдържа ${o}${n.minimum.toString()} ${e.unit}`;return`Твърде малко: очаква се ${n.origin} да бъде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let e="Невалиден";if(o.format==="emoji")e="Невалидно";if(o.format==="datetime")e="Невалидно";if(o.format==="date")e="Невалидна";if(o.format==="time")e="Невалидно";if(o.format==="duration")e="Невалидна";return`${e} ${g[o.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};var Rv=r(()=>{BA()});function GU(){return{localeError:nuA()}}var nuA=()=>{let A={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return A[n]??null}let g={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${I}`;return`Tipus invàlid: s'esperava ${o}, s'ha rebut ${I}`}case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${X(n.values[0])}`;return`Opció invàlida: s'esperava una de ${J(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",e=t(n.origin);if(e)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${e.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",e=t(n.origin);if(e)return`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${e.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Format invàlid: ha de començar amb "${o.prefix}"`;if(o.format==="ends_with")return`Format invàlid: ha d'acabar amb "${o.suffix}"`;if(o.format==="includes")return`Format invàlid: ha d'incloure "${o.includes}"`;if(o.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${o.pattern}`;return`Format invàlid per a ${g[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};var fv=r(()=>{BA()});function TU(){return{localeError:iuA()}}var iuA=()=>{let A={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return A[n]??null}let g={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${I}`;return`Neplatný vstup: očekáváno ${o}, obdrženo ${I}`}case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${X(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${e.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${e.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neplatný řetězec: musí začínat na "${o.prefix}"`;if(o.format==="ends_with")return`Neplatný řetězec: musí končit na "${o.suffix}"`;if(o.format==="includes")return`Neplatný řetězec: musí obsahovat "${o.includes}"`;if(o.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`;return`Neplatný formát ${g[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${J(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};var Ov=r(()=>{BA()});function JU(){return{localeError:ouA()}}var ouA=()=>{let A={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return A[n]??null}let g={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ugyldigt input: forventede instanceof ${n.expected}, fik ${I}`;return`Ugyldigt input: forventede ${o}, fik ${I}`}case"invalid_value":if(n.values.length===1)return`Ugyldig værdi: forventede ${X(n.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin),I=i[n.origin]??n.origin;if(e)return`For stor: forventede ${I??"value"} ${e.verb} ${o} ${n.maximum.toString()} ${e.unit??"elementer"}`;return`For stor: forventede ${I??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin),I=i[n.origin]??n.origin;if(e)return`For lille: forventede ${I} ${e.verb} ${o} ${n.minimum.toString()} ${e.unit}`;return`For lille: forventede ${I} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: skal starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: skal ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: skal indeholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: skal matche mønsteret ${o.pattern}`;return`Ugyldig ${g[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${J(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};var zv=r(()=>{BA()});function PU(){return{localeError:euA()}}var euA=()=>{let A={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 t(n){return A[n]??null}let g={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"},i={nan:"NaN",number:"Zahl",array:"Array"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${I}`;return`Ungültige Eingabe: erwartet ${o}, erhalten ${I}`}case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${X(n.values[0])}`;return`Ungültige Option: erwartet eine von ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${e.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${e.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ungültiger String: muss mit "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ungültiger String: muss mit "${o.suffix}" enden`;if(o.format==="includes")return`Ungültiger String: muss "${o.includes}" enthalten`;if(o.format==="regex")return`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`;return`Ungültig: ${g[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${J(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};var vv=r(()=>{BA()});function Fc(){return{localeError:QuA()}}var QuA=()=>{let A={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 t(n){return A[n]??null}let g={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"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;return`Invalid input: expected ${o}, received ${I}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${X(n.values[0])}`;return`Invalid option: expected one of ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${e.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${e.unit}`;return`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Invalid string: must start with "${o.prefix}"`;if(o.format==="ends_with")return`Invalid string: must end with "${o.suffix}"`;if(o.format==="includes")return`Invalid string: must include "${o.includes}"`;if(o.format==="regex")return`Invalid string: must match pattern ${o.pattern}`;return`Invalid ${g[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};var RU=r(()=>{BA()});function fU(){return{localeError:IuA()}}var IuA=()=>{let A={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return A[n]??null}let g={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${I}`;return`Nevalida enigo: atendiĝis ${o}, riceviĝis ${I}`}case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendiĝis ${X(n.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${e.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${e.unit}`;return`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`;if(o.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`;if(o.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${o.includes}"`;if(o.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`;return`Nevalida ${g[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};var mv=r(()=>{BA()});function OU(){return{localeError:huA()}}var huA=()=>{let A={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return A[n]??null}let g={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${I}`;return`Entrada inválida: se esperaba ${o}, recibido ${I}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${X(n.values[0])}`;return`Opción inválida: se esperaba una de ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin),I=i[n.origin]??n.origin;if(e)return`Demasiado grande: se esperaba que ${I??"valor"} tuviera ${o}${n.maximum.toString()} ${e.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${I??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin),I=i[n.origin]??n.origin;if(e)return`Demasiado pequeño: se esperaba que ${I} tuviera ${o}${n.minimum.toString()} ${e.unit}`;return`Demasiado pequeño: se esperaba que ${I} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cadena inválida: debe comenzar con "${o.prefix}"`;if(o.format==="ends_with")return`Cadena inválida: debe terminar en "${o.suffix}"`;if(o.format==="includes")return`Cadena inválida: debe incluir "${o.includes}"`;if(o.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${o.pattern}`;return`Inválido ${g[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i[n.origin]??n.origin}`;default:return"Entrada inválida"}}};var Wv=r(()=>{BA()});function zU(){return{localeError:BuA()}}var BuA=()=>{let A={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return A[n]??null}let g={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},i={nan:"NaN",number:"عدد",array:"آرایه"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${I} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${I} دریافت شد`}case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: می‌بایست ${X(n.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${J(n.values,"|")} می‌بود`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${e.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${e.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`رشته نامعتبر: باید با "${o.prefix}" شروع شود`;if(o.format==="ends_with")return`رشته نامعتبر: باید با "${o.suffix}" تمام شود`;if(o.format==="includes")return`رشته نامعتبر: باید شامل "${o.includes}" باشد`;if(o.format==="regex")return`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`;return`${g[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${J(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};var Zv=r(()=>{BA()});function vU(){return{localeError:cuA()}}var cuA=()=>{let A={string:{unit:"merkkiä",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äivämäärän"}};function t(n){return A[n]??null}let g={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${I}`;return`Virheellinen tyyppi: odotettiin ${o}, oli ${I}`}case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${X(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Liian suuri: ${e.subject} täytyy olla ${o}${n.maximum.toString()} ${e.unit}`.trim();return`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Liian pieni: ${e.subject} täytyy olla ${o}${n.minimum.toString()} ${e.unit}`.trim();return`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${o.prefix}"`;if(o.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${o.suffix}"`;if(o.format==="includes")return`Virheellinen syöte: täytyy sisältää "${o.includes}"`;if(o.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`;return`Virheellinen ${g[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${J(n.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öte"}}};var Vv=r(()=>{BA()});function mU(){return{localeError:CuA()}}var CuA=()=>{let A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return A[n]??null}let g={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN",number:"nombre",array:"tableau"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : instanceof ${n.expected} attendu, ${I} reçu`;return`Entrée invalide : ${o} attendu, ${I} reçu`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${X(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${J(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Trop grand : ${n.origin??"valeur"} doit ${e.verb} ${o}${n.maximum.toString()} ${e.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Trop petit : ${n.origin} doit ${e.verb} ${o}${n.minimum.toString()} ${e.unit}`;return`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${o.pattern}`;return`${g[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${J(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var Hv=r(()=>{BA()});function WU(){return{localeError:EuA()}}var EuA=()=>{let A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return A[n]??null}let g={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : attendu instanceof ${n.expected}, reçu ${I}`;return`Entrée invalide : attendu ${o}, reçu ${I}`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${X(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",e=t(n.origin);if(e)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${e.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",e=t(n.origin);if(e)return`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${e.unit}`;return`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au motif ${o.pattern}`;return`${g[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${J(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var Xv=r(()=>{BA()});function ZU(){return{localeError:auA()}}var auA=()=>{let A={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},g=(B)=>B?A[B]:void 0,i=(B)=>{let c=g(B);if(c)return c.label;return B??A.unknown.label},n=(B)=>`ה${i(B)}`,o=(B)=>{return(g(B)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},e=(B)=>{if(!B)return null;return t[B]??null},I={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",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:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},h={nan:"NaN"};return(B)=>{switch(B.code){case"invalid_type":{let c=B.expected,C=h[c??""]??i(c),E=K(B.input),a=h[E]??A[E]?.label??E;if(/^[A-Z]/.test(B.expected))return`קלט לא תקין: צריך להיות instanceof ${B.expected}, התקבל ${a}`;return`קלט לא תקין: צריך להיות ${C}, התקבל ${a}`}case"invalid_value":{if(B.values.length===1)return`ערך לא תקין: הערך חייב להיות ${X(B.values[0])}`;let c=B.values.map((a)=>X(a));if(B.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${c[0]} או ${c[1]}`;let C=c[c.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${c.slice(0,-1).join(", ")} או ${C}`}case"too_big":{let c=e(B.origin),C=n(B.origin??"value");if(B.origin==="string")return`${c?.longLabel??"ארוך"} מדי: ${C} צריכה להכיל ${B.maximum.toString()} ${c?.unit??""} ${B.inclusive?"או פחות":"לכל היותר"}`.trim();if(B.origin==="number"){let y=B.inclusive?`קטן או שווה ל-${B.maximum}`:`קטן מ-${B.maximum}`;return`גדול מדי: ${C} צריך להיות ${y}`}if(B.origin==="array"||B.origin==="set"){let y=B.origin==="set"?"צריכה":"צריך",w=B.inclusive?`${B.maximum} ${c?.unit??""} או פחות`:`פחות מ-${B.maximum} ${c?.unit??""}`;return`גדול מדי: ${C} ${y} להכיל ${w}`.trim()}let E=B.inclusive?"<=":"<",a=o(B.origin??"value");if(c?.unit)return`${c.longLabel} מדי: ${C} ${a} ${E}${B.maximum.toString()} ${c.unit}`;return`${c?.longLabel??"גדול"} מדי: ${C} ${a} ${E}${B.maximum.toString()}`}case"too_small":{let c=e(B.origin),C=n(B.origin??"value");if(B.origin==="string")return`${c?.shortLabel??"קצר"} מדי: ${C} צריכה להכיל ${B.minimum.toString()} ${c?.unit??""} ${B.inclusive?"או יותר":"לפחות"}`.trim();if(B.origin==="number"){let y=B.inclusive?`גדול או שווה ל-${B.minimum}`:`גדול מ-${B.minimum}`;return`קטן מדי: ${C} צריך להיות ${y}`}if(B.origin==="array"||B.origin==="set"){let y=B.origin==="set"?"צריכה":"צריך";if(B.minimum===1&&B.inclusive){let l=B.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${C} ${y} להכיל ${l}`}let w=B.inclusive?`${B.minimum} ${c?.unit??""} או יותר`:`יותר מ-${B.minimum} ${c?.unit??""}`;return`קטן מדי: ${C} ${y} להכיל ${w}`.trim()}let E=B.inclusive?">=":">",a=o(B.origin??"value");if(c?.unit)return`${c.shortLabel} מדי: ${C} ${a} ${E}${B.minimum.toString()} ${c.unit}`;return`${c?.shortLabel??"קטן"} מדי: ${C} ${a} ${E}${B.minimum.toString()}`}case"invalid_format":{let c=B;if(c.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${c.prefix}"`;if(c.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${c.suffix}"`;if(c.format==="includes")return`המחרוזת חייבת לכלול "${c.includes}"`;if(c.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${c.pattern}`;let C=I[c.format],E=C?.label??c.format,y=(C?.gender??"m")==="f"?"תקינה":"תקין";return`${E} לא ${y}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${B.divisor}`;case"unrecognized_keys":return`מפתח${B.keys.length>1?"ות":""} לא מזוה${B.keys.length>1?"ים":"ה"}: ${J(B.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(B.origin??"array")}`;default:return"קלט לא תקין"}}};var jv=r(()=>{BA()});function VU(){return{localeError:ruA()}}var ruA=()=>{let A={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return A[n]??null}let g={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"szám",array:"tömb"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${I}`;return`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${I}`}case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${X(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${e.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${e.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`;if(o.format==="ends_with")return`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`;if(o.format==="includes")return`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`;if(o.format==="regex")return`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`;return`Érvénytelen ${g[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};var Kv=r(()=>{BA()});function _v(A,t,g){return Math.abs(A)===1?t:g}function oI(A){if(!A)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],g=A[A.length-1];return A+(t.includes(g)?"ն":"ը")}function HU(){return{localeError:yuA()}}var yuA=()=>{let A={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(n){return A[n]??null}let g={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},i={nan:"NaN",number:"թիվ",array:"զանգված"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${I}`;return`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${I}`}case"invalid_value":if(n.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${X(n.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e){let I=Number(n.maximum),h=_v(I,e.unit.one,e.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${oI(n.origin??"արժեք")} կունենա ${o}${n.maximum.toString()} ${h}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${oI(n.origin??"արժեք")} լինի ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e){let I=Number(n.minimum),h=_v(I,e.unit.one,e.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${oI(n.origin)} կունենա ${o}${n.minimum.toString()} ${h}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${oI(n.origin)} լինի ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`;if(o.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`;if(o.format==="includes")return`Սխալ տող․ պետք է պարունակի "${o.includes}"`;if(o.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`;return`Սխալ ${g[o.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${J(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${oI(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${oI(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var xv=r(()=>{BA()});function XU(){return{localeError:wuA()}}var wuA=()=>{let A={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${I}`;return`Input tidak valid: diharapkan ${o}, diterima ${I}`}case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${X(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${e.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${e.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak valid: harus dimulai dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak valid: harus berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak valid: harus menyertakan "${o.includes}"`;if(o.format==="regex")return`String tidak valid: harus sesuai pola ${o.pattern}`;return`${g[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};var sv=r(()=>{BA()});function jU(){return{localeError:DuA()}}var DuA=()=>{let A={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(n){return A[n]??null}let g={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"númer",array:"fylki"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Rangt gildi: Þú slóst inn ${I} þar sem á að vera instanceof ${n.expected}`;return`Rangt gildi: Þú slóst inn ${I} þar sem á að vera ${o}`}case"invalid_value":if(n.values.length===1)return`Rangt gildi: gert ráð fyrir ${X(n.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${e.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${o}${n.minimum.toString()} ${e.unit}`;return`Of lítið: gert er ráð fyrir að ${n.origin} sé ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ógildur strengur: verður að byrja á "${o.prefix}"`;if(o.format==="ends_with")return`Ógildur strengur: verður að enda á "${o.suffix}"`;if(o.format==="includes")return`Ógildur strengur: verður að innihalda "${o.includes}"`;if(o.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`;return`Rangt ${g[o.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${J(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};var qv=r(()=>{BA()});function KU(){return{localeError:uuA()}}var uuA=()=>{let A={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN",number:"numero",array:"vettore"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Input non valido: atteso instanceof ${n.expected}, ricevuto ${I}`;return`Input non valido: atteso ${o}, ricevuto ${I}`}case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${X(n.values[0])}`;return`Opzione non valida: atteso uno tra ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${e.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${e.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Stringa non valida: deve iniziare con "${o.prefix}"`;if(o.format==="ends_with")return`Stringa non valida: deve terminare con "${o.suffix}"`;if(o.format==="includes")return`Stringa non valida: deve includere "${o.includes}"`;if(o.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${o.pattern}`;return`Invalid ${g[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${J(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};var dv=r(()=>{BA()});function _U(){return{localeError:buA()}}var buA=()=>{let A={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return A[n]??null}let g={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},i={nan:"NaN",number:"数値",array:"配列"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`無効な入力: instanceof ${n.expected}が期待されましたが、${I}が入力されました`;return`無効な入力: ${o}が期待されましたが、${I}が入力されました`}case"invalid_value":if(n.values.length===1)return`無効な入力: ${X(n.values[0])}が期待されました`;return`無効な選択: ${J(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",e=t(n.origin);if(e)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${e.unit??"要素"}${o}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",e=t(n.origin);if(e)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${e.unit}${o}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無効な文字列: "${o.prefix}"で始まる必要があります`;if(o.format==="ends_with")return`無効な文字列: "${o.suffix}"で終わる必要があります`;if(o.format==="includes")return`無効な文字列: "${o.includes}"を含む必要があります`;if(o.format==="regex")return`無効な文字列: パターン${o.pattern}に一致する必要があります`;return`無効な${g[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${J(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};var pv=r(()=>{BA()});function xU(){return{localeError:luA()}}var luA=()=>{let A={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(n){return A[n]??null}let g={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},i={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${I}`;return`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${I}`}case"invalid_value":if(n.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${X(n.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${J(n.values,"|")}-დან`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${e.verb} ${o}${n.maximum.toString()} ${e.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${e.verb} ${o}${n.minimum.toString()} ${e.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`;if(o.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`;if(o.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`;if(o.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`;return`არასწორი ${g[o.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${J(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};var A1=r(()=>{BA()});function Mc(){return{localeError:NuA()}}var NuA=()=>{let A={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return A[n]??null}let g={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${I}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${I}`}case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${X(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${e.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${e.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`;if(o.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`;if(o.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`;if(o.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`;return`មិនត្រឹមត្រូវ៖ ${g[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${J(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var sU=r(()=>{BA()});function qU(){return Mc()}var t1=r(()=>{sU()});function dU(){return{localeError:UuA()}}var UuA=()=>{let A={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return A[n]??null}let g={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${I}입니다`;return`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${I}입니다`}case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${X(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${J(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",e=o==="미만"?"이어야 합니다":"여야 합니다",I=t(n.origin),h=I?.unit??"요소";if(I)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${h} ${o}${e}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${e}`}case"too_small":{let o=n.inclusive?"이상":"초과",e=o==="이상"?"이어야 합니다":"여야 합니다",I=t(n.origin),h=I?.unit??"요소";if(I)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${h} ${o}${e}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${e}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`;if(o.format==="ends_with")return`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`;if(o.format==="includes")return`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`;if(o.format==="regex")return`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${g[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${J(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};var g1=r(()=>{BA()});function n1(A){let t=Math.abs(A),g=t%10,i=t%100;if(i>=11&&i<=19||g===0)return"many";if(g===1)return"one";return"few"}function pU(){return{localeError:SuA()}}var Yc=(A)=>{return A.charAt(0).toUpperCase()+A.slice(1)},SuA=()=>{let A={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(n,o,e,I){let h=A[n]??null;if(h===null)return h;return{unit:h.unit[o],verb:h.verb[I][e?"inclusive":"notInclusive"]}}let g={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Gautas tipas ${I}, o tikėtasi - instanceof ${n.expected}`;return`Gautas tipas ${I}, o tikėtasi - ${o}`}case"invalid_value":if(n.values.length===1)return`Privalo būti ${X(n.values[0])}`;return`Privalo būti vienas iš ${J(n.values,"|")} pasirinkimų`;case"too_big":{let o=i[n.origin]??n.origin,e=t(n.origin,n1(Number(n.maximum)),n.inclusive??!1,"smaller");if(e?.verb)return`${Yc(o??n.origin??"reikšmė")} ${e.verb} ${n.maximum.toString()} ${e.unit??"elementų"}`;let I=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Yc(o??n.origin??"reikšmė")} turi būti ${I} ${n.maximum.toString()} ${e?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,e=t(n.origin,n1(Number(n.minimum)),n.inclusive??!1,"bigger");if(e?.verb)return`${Yc(o??n.origin??"reikšmė")} ${e.verb} ${n.minimum.toString()} ${e.unit??"elementų"}`;let I=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Yc(o??n.origin??"reikšmė")} turi būti ${I} ${n.minimum.toString()} ${e?.unit}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Eilutė privalo prasidėti "${o.prefix}"`;if(o.format==="ends_with")return`Eilutė privalo pasibaigti "${o.suffix}"`;if(o.format==="includes")return`Eilutė privalo įtraukti "${o.includes}"`;if(o.format==="regex")return`Eilutė privalo atitikti ${o.pattern}`;return`Neteisingas ${g[o.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${J(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${Yc(o??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var i1=r(()=>{BA()});function AS(){return{localeError:LuA()}}var LuA=()=>{let A={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return A[n]??null}let g={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},i={nan:"NaN",number:"број",array:"низа"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Грешен внес: се очекува instanceof ${n.expected}, примено ${I}`;return`Грешен внес: се очекува ${o}, примено ${I}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${X(n.values[0])}`;return`Грешана опција: се очекува една ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${e.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${e.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неважечка низа: мора да започнува со "${o.prefix}"`;if(o.format==="ends_with")return`Неважечка низа: мора да завршува со "${o.suffix}"`;if(o.format==="includes")return`Неважечка низа: мора да вклучува "${o.includes}"`;if(o.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${o.pattern}`;return`Invalid ${g[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${J(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};var o1=r(()=>{BA()});function tS(){return{localeError:FuA()}}var FuA=()=>{let A={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN",number:"nombor"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${I}`;return`Input tidak sah: dijangka ${o}, diterima ${I}`}case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${X(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${e.verb} ${o}${n.maximum.toString()} ${e.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Terlalu kecil: dijangka ${n.origin} ${e.verb} ${o}${n.minimum.toString()} ${e.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak sah: mesti bermula dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak sah: mesti mengandungi "${o.includes}"`;if(o.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${o.pattern}`;return`${g[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${J(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};var e1=r(()=>{BA()});function gS(){return{localeError:MuA()}}var MuA=()=>{let A={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN",number:"getal"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${I}`;return`Ongeldige invoer: verwacht ${o}, ontving ${I}`}case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${X(n.values[0])}`;return`Ongeldige optie: verwacht één van ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin),I=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";if(e)return`Te ${I}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${e.unit??"elementen"} ${e.verb}`;return`Te ${I}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin),I=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";if(e)return`Te ${I}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${e.unit} ${e.verb}`;return`Te ${I}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ongeldige tekst: moet met "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ongeldige tekst: moet op "${o.suffix}" eindigen`;if(o.format==="includes")return`Ongeldige tekst: moet "${o.includes}" bevatten`;if(o.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`;return`Ongeldig: ${g[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};var Q1=r(()=>{BA()});function nS(){return{localeError:YuA()}}var YuA=()=>{let A={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return A[n]??null}let g={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åde",ipv6:"IPv6-område",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"},i={nan:"NaN",number:"tall",array:"liste"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ugyldig input: forventet instanceof ${n.expected}, fikk ${I}`;return`Ugyldig input: forventet ${o}, fikk ${I}`}case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${X(n.values[0])}`;return`Ugyldig valg: forventet en av ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${e.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${e.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: må starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: må ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: må inneholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: må matche mønsteret ${o.pattern}`;return`Ugyldig ${g[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${J(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};var I1=r(()=>{BA()});function iS(){return{localeError:kuA()}}var kuA=()=>{let A={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return A[n]??null}let g={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Fâsit giren: umulan instanceof ${n.expected}, alınan ${I}`;return`Fâsit giren: umulan ${o}, alınan ${I}`}case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${X(n.values[0])}`;return`Fâsit tercih: mûteberler ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${e.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${e.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Fâsit metin: "${o.prefix}" ile başlamalı.`;if(o.format==="ends_with")return`Fâsit metin: "${o.suffix}" ile bitmeli.`;if(o.format==="includes")return`Fâsit metin: "${o.includes}" ihtivâ etmeli.`;if(o.format==="regex")return`Fâsit metin: ${o.pattern} nakşına uymalı.`;return`Fâsit ${g[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var h1=r(()=>{BA()});function oS(){return{localeError:$uA()}}var $uA=()=>{let A={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return A[n]??null}let g={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},i={nan:"NaN",number:"عدد",array:"ارې"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${I} ترلاسه شو`;return`ناسم ورودي: باید ${o} وای, مګر ${I} ترلاسه شو`}case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${X(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${J(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${e.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${e.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ناسم متن: باید د "${o.prefix}" سره پیل شي`;if(o.format==="ends_with")return`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`;if(o.format==="includes")return`ناسم متن: باید "${o.includes}" ولري`;if(o.format==="regex")return`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`;return`${g[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${J(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};var B1=r(()=>{BA()});function eS(){return{localeError:GuA()}}var GuA=()=>{let A={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return A[n]??null}let g={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},i={nan:"NaN",number:"liczba",array:"tablica"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${I}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${I}`}case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${X(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${e.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${e.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`;if(o.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`;if(o.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`;if(o.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`;return`Nieprawidłow(y/a/e) ${g[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var c1=r(()=>{BA()});function QS(){return{localeError:TuA()}}var TuA=()=>{let A={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return A[n]??null}let g={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"número",null:"nulo"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Tipo inválido: esperado instanceof ${n.expected}, recebido ${I}`;return`Tipo inválido: esperado ${o}, recebido ${I}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${X(n.values[0])}`;return`Opção inválida: esperada uma das ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${e.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${e.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Texto inválido: deve começar com "${o.prefix}"`;if(o.format==="ends_with")return`Texto inválido: deve terminar com "${o.suffix}"`;if(o.format==="includes")return`Texto inválido: deve incluir "${o.includes}"`;if(o.format==="regex")return`Texto inválido: deve corresponder ao padrão ${o.pattern}`;return`${g[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};var C1=r(()=>{BA()});function E1(A,t,g,i){let n=Math.abs(A),o=n%10,e=n%100;if(e>=11&&e<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return g;return i}function IS(){return{localeError:JuA()}}var JuA=()=>{let A={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return A[n]??null}let g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},i={nan:"NaN",number:"число",array:"массив"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${I}`;return`Неверный ввод: ожидалось ${o}, получено ${I}`}case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${X(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e){let I=Number(n.maximum),h=E1(I,e.unit.one,e.unit.few,e.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${h}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e){let I=Number(n.minimum),h=E1(I,e.unit.one,e.unit.few,e.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${h}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неверная строка: должна начинаться с "${o.prefix}"`;if(o.format==="ends_with")return`Неверная строка: должна заканчиваться на "${o.suffix}"`;if(o.format==="includes")return`Неверная строка: должна содержать "${o.includes}"`;if(o.format==="regex")return`Неверная строка: должна соответствовать шаблону ${o.pattern}`;return`Неверный ${g[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};var a1=r(()=>{BA()});function hS(){return{localeError:PuA()}}var PuA=()=>{let A={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return A[n]??null}let g={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"število",array:"tabela"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${I}`;return`Neveljaven vnos: pričakovano ${o}, prejeto ${I}`}case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${X(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${e.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${e.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neveljaven niz: mora se začeti z "${o.prefix}"`;if(o.format==="ends_with")return`Neveljaven niz: mora se končati z "${o.suffix}"`;if(o.format==="includes")return`Neveljaven niz: mora vsebovati "${o.includes}"`;if(o.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`;return`Neveljaven ${g[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${J(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};var r1=r(()=>{BA()});function BS(){return{localeError:RuA()}}var RuA=()=>{let A={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return A[n]??null}let g={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${I}`;return`Ogiltig inmatning: förväntat ${o}, fick ${I}`}case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${X(n.values[0])}`;return`Ogiltigt val: förväntade en av ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${e.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${e.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ogiltig sträng: måste börja med "${o.prefix}"`;if(o.format==="ends_with")return`Ogiltig sträng: måste sluta med "${o.suffix}"`;if(o.format==="includes")return`Ogiltig sträng: måste innehålla "${o.includes}"`;if(o.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`;return`Ogiltig(t) ${g[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${J(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};var y1=r(()=>{BA()});function cS(){return{localeError:fuA()}}var fuA=()=>{let A={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return A[n]??null}let g={regex:"உள்ளீடு",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:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${I}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${I}`}case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${X(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${J(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${e.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${e.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`;if(o.format==="ends_with")return`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`;if(o.format==="includes")return`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`;if(o.format==="regex")return`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${g[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var w1=r(()=>{BA()});function CS(){return{localeError:OuA()}}var OuA=()=>{let A={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return A[n]??null}let g={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${I}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${I}`}case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${X(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",e=t(n.origin);if(e)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${e.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",e=t(n.origin);if(e)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${e.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`;if(o.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`;if(o.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`;if(o.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`;return`รูปแบบไม่ถูกต้อง: ${g[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${J(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var D1=r(()=>{BA()});function ES(){return{localeError:zuA()}}var zuA=()=>{let A={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return A[n]??null}let g={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${I}`;return`Geçersiz değer: beklenen ${o}, alınan ${I}`}case"invalid_value":if(n.values.length===1)return`Geçersiz değer: beklenen ${X(n.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${e.unit??"öğe"}`;return`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${e.unit}`;return`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Geçersiz metin: "${o.prefix}" ile başlamalı`;if(o.format==="ends_with")return`Geçersiz metin: "${o.suffix}" ile bitmeli`;if(o.format==="includes")return`Geçersiz metin: "${o.includes}" içermeli`;if(o.format==="regex")return`Geçersiz metin: ${o.pattern} desenine uymalı`;return`Geçersiz ${g[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var u1=r(()=>{BA()});function kc(){return{localeError:vuA()}}var vuA=()=>{let A={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return A[n]??null}let g={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},i={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${I}`;return`Неправильні вхідні дані: очікується ${o}, отримано ${I}`}case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${X(n.values[0])}`;return`Неправильна опція: очікується одне з ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Занадто велике: очікується, що ${n.origin??"значення"} ${e.verb} ${o}${n.maximum.toString()} ${e.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Занадто мале: очікується, що ${n.origin} ${e.verb} ${o}${n.minimum.toString()} ${e.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неправильний рядок: повинен починатися з "${o.prefix}"`;if(o.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`;if(o.format==="includes")return`Неправильний рядок: повинен містити "${o.includes}"`;if(o.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`;return`Неправильний ${g[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${J(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};var aS=r(()=>{BA()});function rS(){return kc()}var b1=r(()=>{aS()});function yS(){return{localeError:muA()}}var muA=()=>{let A={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return A[n]??null}let g={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${I} موصول ہوا`;return`غلط ان پٹ: ${o} متوقع تھا، ${I} موصول ہوا`}case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${X(n.values[0])} متوقع تھا`;return`غلط آپشن: ${J(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${e.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${e.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`;if(o.format==="ends_with")return`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`;if(o.format==="includes")return`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`;if(o.format==="regex")return`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`;return`غلط ${g[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${J(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var l1=r(()=>{BA()});function wS(){return{localeError:WuA()}}var WuA=()=>{let A={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(n){return A[n]??null}let g={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"},i={nan:"NaN",number:"raqam",array:"massiv"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${I}`;return`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${I}`}case"invalid_value":if(n.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${X(n.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${e.unit} ${e.verb}`;return`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${e.unit} ${e.verb}`;return`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`;if(o.format==="ends_with")return`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`;if(o.format==="includes")return`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`;if(o.format==="regex")return`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${g[o.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var N1=r(()=>{BA()});function DS(){return{localeError:ZuA()}}var ZuA=()=>{let A={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return A[n]??null}let g={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},i={nan:"NaN",number:"số",array:"mảng"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${I}`;return`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${I}`}case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${X(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${e.verb} ${o}${n.maximum.toString()} ${e.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Quá nhỏ: mong đợi ${n.origin} ${e.verb} ${o}${n.minimum.toString()} ${e.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`;if(o.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`;if(o.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`;if(o.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`;return`${g[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${J(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};var U1=r(()=>{BA()});function uS(){return{localeError:VuA()}}var VuA=()=>{let A={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return A[n]??null}let g={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},i={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`无效输入:期望 instanceof ${n.expected},实际接收 ${I}`;return`无效输入:期望 ${o},实际接收 ${I}`}case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${X(n.values[0])}`;return`无效选项:期望以下之一 ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${e.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${e.unit}`;return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`无效字符串:必须以 "${o.prefix}" 开头`;if(o.format==="ends_with")return`无效字符串:必须以 "${o.suffix}" 结尾`;if(o.format==="includes")return`无效字符串:必须包含 "${o.includes}"`;if(o.format==="regex")return`无效字符串:必须满足正则表达式 ${o.pattern}`;return`无效${g[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${J(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};var S1=r(()=>{BA()});function bS(){return{localeError:HuA()}}var HuA=()=>{let A={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return A[n]??null}let g={regex:"輸入",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:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${I}`;return`無效的輸入值:預期為 ${o},但收到 ${I}`}case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${X(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${e.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${e.unit}`;return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無效的字串:必須以 "${o.prefix}" 開頭`;if(o.format==="ends_with")return`無效的字串:必須以 "${o.suffix}" 結尾`;if(o.format==="includes")return`無效的字串:必須包含 "${o.includes}"`;if(o.format==="regex")return`無效的字串:必須符合格式 ${o.pattern}`;return`無效的 ${g[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${J(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};var L1=r(()=>{BA()});function lS(){return{localeError:XuA()}}var XuA=()=>{let A={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return A[n]??null}let g={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},i={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,e=K(n.input),I=i[e]??e;if(/^[A-Z]/.test(n.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${I}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${I}`}case"invalid_value":if(n.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${X(n.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${J(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",e=t(n.origin);if(e)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${e.verb} ${o}${n.maximum} ${e.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",e=t(n.origin);if(e)return`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${e.verb} ${o}${n.minimum} ${e.unit}`;return`Kéré ju: a ní láti jẹ́ ${o}${n.minimum}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`;if(o.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`;if(o.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`;if(o.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`;return`Aṣìṣe: ${g[o.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${J(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var F1=r(()=>{BA()});var $c={};dn($c,{zhTW:()=>bS,zhCN:()=>uS,yo:()=>lS,vi:()=>DS,uz:()=>wS,ur:()=>yS,uk:()=>kc,ua:()=>rS,tr:()=>ES,th:()=>CS,ta:()=>cS,sv:()=>BS,sl:()=>hS,ru:()=>IS,pt:()=>QS,ps:()=>oS,pl:()=>eS,ota:()=>iS,no:()=>nS,nl:()=>gS,ms:()=>tS,mk:()=>AS,lt:()=>pU,ko:()=>dU,km:()=>Mc,kh:()=>qU,ka:()=>xU,ja:()=>_U,it:()=>KU,is:()=>jU,id:()=>XU,hy:()=>HU,hu:()=>VU,he:()=>ZU,frCA:()=>WU,fr:()=>mU,fi:()=>vU,fa:()=>zU,es:()=>OU,eo:()=>fU,en:()=>Fc,de:()=>PU,da:()=>JU,cs:()=>TU,ca:()=>GU,bg:()=>$U,be:()=>kU,az:()=>YU,ar:()=>MU});var NS=r(()=>{Gv();Tv();Pv();Rv();fv();Ov();zv();vv();RU();mv();Wv();Zv();Vv();Hv();Xv();jv();Kv();xv();sv();qv();dv();pv();A1();t1();sU();g1();i1();o1();e1();Q1();I1();h1();B1();c1();C1();a1();r1();y1();w1();D1();u1();b1();aS();l1();N1();U1();S1();L1();F1()});class LS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(A,...t){let g=t[0];if(this._map.set(A,g),g&&typeof g==="object"&&"id"in g)this._idmap.set(g.id,A);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(A){let t=this._map.get(A);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(A),this}get(A){let t=A._zod.parent;if(t){let g={...this.get(t)??{}};delete g.id;let i={...g,...this._map.get(A)};return Object.keys(i).length?i:void 0}return this._map.get(A)}has(A){return this._map.has(A)}}function ar(){return new LS}var M1,US,SS,xt;var Gc=r(()=>{US=Symbol("ZodOutput"),SS=Symbol("ZodInput");(M1=globalThis).__zod_globalRegistry??(M1.__zod_globalRegistry=ar());xt=globalThis.__zod_globalRegistry});function FS(A,t){return new A({type:"string",...s(t)})}function MS(A,t){return new A({type:"string",coerce:!0,...s(t)})}function rr(A,t){return new A({type:"string",format:"email",check:"string_format",abort:!1,...s(t)})}function Tc(A,t){return new A({type:"string",format:"guid",check:"string_format",abort:!1,...s(t)})}function yr(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,...s(t)})}function wr(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...s(t)})}function Dr(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...s(t)})}function ur(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...s(t)})}function Jc(A,t){return new A({type:"string",format:"url",check:"string_format",abort:!1,...s(t)})}function br(A,t){return new A({type:"string",format:"emoji",check:"string_format",abort:!1,...s(t)})}function lr(A,t){return new A({type:"string",format:"nanoid",check:"string_format",abort:!1,...s(t)})}function Nr(A,t){return new A({type:"string",format:"cuid",check:"string_format",abort:!1,...s(t)})}function Ur(A,t){return new A({type:"string",format:"cuid2",check:"string_format",abort:!1,...s(t)})}function Sr(A,t){return new A({type:"string",format:"ulid",check:"string_format",abort:!1,...s(t)})}function Lr(A,t){return new A({type:"string",format:"xid",check:"string_format",abort:!1,...s(t)})}function Fr(A,t){return new A({type:"string",format:"ksuid",check:"string_format",abort:!1,...s(t)})}function Mr(A,t){return new A({type:"string",format:"ipv4",check:"string_format",abort:!1,...s(t)})}function Yr(A,t){return new A({type:"string",format:"ipv6",check:"string_format",abort:!1,...s(t)})}function YS(A,t){return new A({type:"string",format:"mac",check:"string_format",abort:!1,...s(t)})}function kr(A,t){return new A({type:"string",format:"cidrv4",check:"string_format",abort:!1,...s(t)})}function $r(A,t){return new A({type:"string",format:"cidrv6",check:"string_format",abort:!1,...s(t)})}function Gr(A,t){return new A({type:"string",format:"base64",check:"string_format",abort:!1,...s(t)})}function Tr(A,t){return new A({type:"string",format:"base64url",check:"string_format",abort:!1,...s(t)})}function Jr(A,t){return new A({type:"string",format:"e164",check:"string_format",abort:!1,...s(t)})}function Pr(A,t){return new A({type:"string",format:"jwt",check:"string_format",abort:!1,...s(t)})}function $S(A,t){return new A({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...s(t)})}function GS(A,t){return new A({type:"string",format:"date",check:"string_format",...s(t)})}function TS(A,t){return new A({type:"string",format:"time",check:"string_format",precision:null,...s(t)})}function JS(A,t){return new A({type:"string",format:"duration",check:"string_format",...s(t)})}function PS(A,t){return new A({type:"number",checks:[],...s(t)})}function RS(A,t){return new A({type:"number",coerce:!0,checks:[],...s(t)})}function fS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"safeint",...s(t)})}function OS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"float32",...s(t)})}function zS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"float64",...s(t)})}function vS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"int32",...s(t)})}function mS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"uint32",...s(t)})}function WS(A,t){return new A({type:"boolean",...s(t)})}function ZS(A,t){return new A({type:"boolean",coerce:!0,...s(t)})}function VS(A,t){return new A({type:"bigint",...s(t)})}function HS(A,t){return new A({type:"bigint",coerce:!0,...s(t)})}function XS(A,t){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...s(t)})}function jS(A,t){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...s(t)})}function KS(A,t){return new A({type:"symbol",...s(t)})}function _S(A,t){return new A({type:"undefined",...s(t)})}function xS(A,t){return new A({type:"null",...s(t)})}function sS(A){return new A({type:"any"})}function qS(A){return new A({type:"unknown"})}function dS(A,t){return new A({type:"never",...s(t)})}function pS(A,t){return new A({type:"void",...s(t)})}function AL(A,t){return new A({type:"date",...s(t)})}function tL(A,t){return new A({type:"date",coerce:!0,...s(t)})}function gL(A,t){return new A({type:"nan",...s(t)})}function gi(A,t){return new tr({check:"less_than",...s(t),value:A,inclusive:!1})}function xg(A,t){return new tr({check:"less_than",...s(t),value:A,inclusive:!0})}function ni(A,t){return new gr({check:"greater_than",...s(t),value:A,inclusive:!1})}function Dg(A,t){return new gr({check:"greater_than",...s(t),value:A,inclusive:!0})}function Rr(A){return ni(0,A)}function fr(A){return gi(0,A)}function Or(A){return xg(0,A)}function zr(A){return Dg(0,A)}function Do(A,t){return new sN({check:"multiple_of",...s(t),value:A})}function uo(A,t){return new pN({check:"max_size",...s(t),maximum:A})}function ii(A,t){return new A0({check:"min_size",...s(t),minimum:A})}function $e(A,t){return new t0({check:"size_equals",...s(t),size:A})}function Ge(A,t){return new g0({check:"max_length",...s(t),maximum:A})}function Oi(A,t){return new n0({check:"min_length",...s(t),minimum:A})}function Te(A,t){return new i0({check:"length_equals",...s(t),length:A})}function eI(A,t){return new o0({check:"string_format",format:"regex",...s(t),pattern:A})}function QI(A){return new e0({check:"string_format",format:"lowercase",...s(A)})}function II(A){return new Q0({check:"string_format",format:"uppercase",...s(A)})}function hI(A,t){return new I0({check:"string_format",format:"includes",...s(t),includes:A})}function BI(A,t){return new h0({check:"string_format",format:"starts_with",...s(t),prefix:A})}function cI(A,t){return new B0({check:"string_format",format:"ends_with",...s(t),suffix:A})}function vr(A,t,g){return new c0({check:"property",property:A,schema:t,...s(g)})}function CI(A,t){return new C0({check:"mime_type",mime:A,...s(t)})}function fn(A){return new E0({check:"overwrite",tx:A})}function EI(A){return fn((t)=>t.normalize(A))}function aI(){return fn((A)=>A.trim())}function rI(){return fn((A)=>A.toLowerCase())}function yI(){return fn((A)=>A.toUpperCase())}function wI(){return fn((A)=>hN(A))}function nL(A,t,g){return new A({type:"array",element:t,...s(g)})}function KuA(A,t,g){return new A({type:"union",options:t,...s(g)})}function _uA(A,t,g){return new A({type:"union",options:t,inclusive:!1,...s(g)})}function xuA(A,t,g,i){return new A({type:"union",options:g,discriminator:t,...s(i)})}function suA(A,t,g){return new A({type:"intersection",left:t,right:g})}function quA(A,t,g,i){let n=g instanceof NA;return new A({type:"tuple",items:t,rest:n?g:null,...s(n?i:g)})}function duA(A,t,g,i){return new A({type:"record",keyType:t,valueType:g,...s(i)})}function puA(A,t,g,i){return new A({type:"map",keyType:t,valueType:g,...s(i)})}function AbA(A,t,g){return new A({type:"set",valueType:t,...s(g)})}function tbA(A,t,g){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new A({type:"enum",entries:i,...s(g)})}function gbA(A,t,g){return new A({type:"enum",entries:t,...s(g)})}function nbA(A,t,g){return new A({type:"literal",values:Array.isArray(t)?t:[t],...s(g)})}function iL(A,t){return new A({type:"file",...s(t)})}function ibA(A,t){return new A({type:"transform",transform:t})}function obA(A,t){return new A({type:"optional",innerType:t})}function ebA(A,t){return new A({type:"nullable",innerType:t})}function QbA(A,t,g){return new A({type:"default",innerType:t,get defaultValue(){return typeof g==="function"?g():cN(g)}})}function IbA(A,t,g){return new A({type:"nonoptional",innerType:t,...s(g)})}function hbA(A,t){return new A({type:"success",innerType:t})}function BbA(A,t,g){return new A({type:"catch",innerType:t,catchValue:typeof g==="function"?g:()=>g})}function cbA(A,t,g){return new A({type:"pipe",in:t,out:g})}function CbA(A,t){return new A({type:"readonly",innerType:t})}function EbA(A,t,g){return new A({type:"template_literal",parts:t,...s(g)})}function abA(A,t){return new A({type:"lazy",getter:t})}function rbA(A,t){return new A({type:"promise",innerType:t})}function oL(A,t,g){let i=s(g);return i.abort??(i.abort=!0),new A({type:"custom",check:"custom",fn:t,...i})}function eL(A,t,g){return new A({type:"custom",check:"custom",fn:t,...s(g)})}function QL(A){let t=Y1((g)=>{return g.addIssue=(i)=>{if(typeof i==="string")g.issues.push(pQ(i,g.value,t._zod.def));else{let n=i;if(n.fatal)n.continue=!1;n.code??(n.code="custom"),n.input??(n.input=g.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),g.issues.push(pQ(n))}},A(g.value,g)});return t}function Y1(A,t){let g=new ht({check:"custom",...s(t)});return g._zod.check=A,g}function IL(A){let t=new ht({check:"describe"});return t._zod.onattach=[(g)=>{let i=xt.get(g)??{};xt.add(g,{...i,description:A})}],t._zod.check=()=>{},t}function hL(A){let t=new ht({check:"meta"});return t._zod.onattach=[(g)=>{let i=xt.get(g)??{};xt.add(g,{...i,...A})}],t._zod.check=()=>{},t}function BL(A,t){let g=s(t),i=g.truthy??["true","1","yes","on","y","enabled"],n=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")i=i.map((a)=>typeof a==="string"?a.toLowerCase():a),n=n.map((a)=>typeof a==="string"?a.toLowerCase():a);let o=new Set(i),e=new Set(n),I=A.Codec??Lc,h=A.Boolean??Uc,c=new(A.String??ke)({type:"string",error:g.error}),C=new h({type:"boolean",error:g.error}),E=new I({type:"pipe",in:c,out:C,transform:(a,y)=>{let w=a;if(g.case!=="sensitive")w=w.toLowerCase();if(o.has(w))return!0;else if(e.has(w))return!1;else return y.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...e],input:y.value,inst:E,continue:!1}),{}},reverseTransform:(a,y)=>{if(a===!0)return i[0]||"true";else return n[0]||"false"},error:g.error});return E}function DI(A,t,g,i={}){let n=s(i),o={...s(i),check:"string_format",type:"string",format:t,fn:typeof g==="function"?g:(I)=>g.test(I),...n};if(g instanceof RegExp)o.pattern=g;return new A(o)}var kS;var k1=r(()=>{nr();Gc();FU();BA();kS={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function bo(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:A.processors??{},metadataRegistry:A?.metadata??xt,target:t,unrepresentable:A?.unrepresentable??"throw",override:A?.override??(()=>{}),io:A?.io??"output",counter:0,seen:new Map,cycles:A?.cycles??"ref",reused:A?.reused??"inline",external:A?.external??void 0}}function sA(A,t,g={path:[],schemaPath:[]}){var i;let n=A._zod.def,o=t.seen.get(A);if(o){if(o.count++,g.schemaPath.includes(A))o.cycle=g.path;return o.schema}let e={schema:{},count:1,cycle:void 0,path:g.path};t.seen.set(A,e);let I=A._zod.toJSONSchema?.();if(I)e.schema=I;else{let c={...g,schemaPath:[...g.schemaPath,A],path:g.path};if(A._zod.processJSONSchema)A._zod.processJSONSchema(t,e.schema,c);else{let E=e.schema,a=t.processors[n.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);a(A,t,E,c)}let C=A._zod.parent;if(C){if(!e.ref)e.ref=C;sA(C,t,c),t.seen.get(C).isParent=!0}}let h=t.metadataRegistry.get(A);if(h)Object.assign(e.schema,h);if(t.io==="input"&&ug(A))delete e.schema.examples,delete e.schema.default;if(t.io==="input"&&e.schema._prefault)(i=e.schema).default??(i.default=e.schema._prefault);return delete e.schema._prefault,t.seen.get(A).schema}function lo(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let e of A.seen.entries()){let I=A.metadataRegistry.get(e[0])?.id;if(I){let h=i.get(I);if(h&&h!==e[0])throw Error(`Duplicate schema id "${I}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(I,e[0])}}let n=(e)=>{let I=A.target==="draft-2020-12"?"$defs":"definitions";if(A.external){let C=A.external.registry.get(e[0])?.id,E=A.external.uri??((y)=>y);if(C)return{ref:E(C)};let a=e[1].defId??e[1].schema.id??`schema${A.counter++}`;return e[1].defId=a,{defId:a,ref:`${E("__shared")}#/${I}/${a}`}}if(e[1]===g)return{ref:"#"};let B=`${"#"}/${I}/`,c=e[1].schema.id??`__schema${A.counter++}`;return{defId:c,ref:B+c}},o=(e)=>{if(e[1].schema.$ref)return;let I=e[1],{ref:h,defId:B}=n(e);if(I.def={...I.schema},B)I.defId=B;let c=I.schema;for(let C in c)delete c[C];c.$ref=h};if(A.cycles==="throw")for(let e of A.seen.entries()){let I=e[1];if(I.cycle)throw Error(`Cycle detected: #/${I.cycle?.join("/")}/<root>
104
104
 
105
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let e of A.seen.entries()){let I=e[1];if(t===e[0]){o(e);continue}if(A.external){let B=A.external.registry.get(e[0])?.id;if(t!==e[0]&&B){o(e);continue}}if(A.metadataRegistry.get(e[0])?.id){o(e);continue}if(I.cycle){o(e);continue}if(I.count>1){if(A.reused==="ref"){o(e);continue}}}}function No(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(e)=>{let I=A.seen.get(e);if(I.ref===null)return;let h=I.def??I.schema,B={...h},c=I.ref;if(I.ref=null,c){i(c);let E=A.seen.get(c),a=E.schema;if(a.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0"))h.allOf=h.allOf??[],h.allOf.push(a);else Object.assign(h,a);if(Object.assign(h,B),e._zod.parent===c)for(let w in h){if(w==="$ref"||w==="allOf")continue;if(!(w in B))delete h[w]}if(a.$ref&&E.def)for(let w in h){if(w==="$ref"||w==="allOf")continue;if(w in E.def&&JSON.stringify(h[w])===JSON.stringify(E.def[w]))delete h[w]}}let C=e._zod.parent;if(C&&C!==c){i(C);let E=A.seen.get(C);if(E?.schema.$ref){if(h.$ref=E.schema.$ref,E.def)for(let a in h){if(a==="$ref"||a==="allOf")continue;if(a in E.def&&JSON.stringify(h[a])===JSON.stringify(E.def[a]))delete h[a]}}}A.override({zodSchema:e,jsonSchema:h,path:I.path??[]})};for(let e of[...A.seen.entries()].reverse())i(e[0]);let n={};if(A.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(A.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(A.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(A.target==="openapi-3.0");if(A.external?.uri){let e=A.external.registry.get(t)?.id;if(!e)throw Error("Schema is missing an `id` property");n.$id=A.external.uri(e)}Object.assign(n,g.def??g.schema);let o=A.external?.defs??{};for(let e of A.seen.entries()){let I=e[1];if(I.def&&I.defId)o[I.defId]=I.def}if(A.external);else if(Object.keys(o).length>0)if(A.target==="draft-2020-12")n.$defs=o;else n.definitions=o;try{let e=JSON.parse(JSON.stringify(n));return Object.defineProperty(e,"~standard",{value:{...t["~standard"],jsonSchema:{input:uI(t,"input",A.processors),output:uI(t,"output",A.processors)}},enumerable:!1,writable:!1}),e}catch(e){throw Error("Error converting schema to JSON.")}}function ug(A,t){let g=t??{seen:new Set};if(g.seen.has(A))return!1;g.seen.add(A);let i=A._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ug(i.element,g);if(i.type==="set")return ug(i.valueType,g);if(i.type==="lazy")return ug(i.getter(),g);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ug(i.innerType,g);if(i.type==="intersection")return ug(i.left,g)||ug(i.right,g);if(i.type==="record"||i.type==="map")return ug(i.keyType,g)||ug(i.valueType,g);if(i.type==="pipe")return ug(i.in,g)||ug(i.out,g);if(i.type==="object"){for(let n in i.shape)if(ug(i.shape[n],g))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(ug(n,g))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(ug(n,g))return!0;if(i.rest&&ug(i.rest,g))return!0;return!1}return!1}var cL=(A,t={})=>(g)=>{let i=bo({...g,processors:t});return sA(A,i),lo(i,A),No(i,A)},uI=(A,t,g={})=>(i)=>{let{libraryOptions:n,target:o}=i??{},e=bo({...n??{},target:o,io:t,processors:g});return sA(A,e),lo(e,A),No(e,A)};var Pc=r(()=>{Gc()});function Vr(A,t){if("_idmap"in A){let i=A,n=bo({...t,processors:mr}),o={};for(let h of i._idmap.entries()){let[B,c]=h;sA(c,n)}let e={},I={registry:i,uri:t?.uri,defs:o};n.external=I;for(let h of i._idmap.entries()){let[B,c]=h;lo(n,c),e[B]=No(n,c)}if(Object.keys(o).length>0){let h=n.target==="draft-2020-12"?"$defs":"definitions";e.__shared={[h]:o}}return{schemas:e}}let g=bo({...t,processors:mr});return sA(A,g),lo(g,A),No(g,A)}var ybA,CL=(A,t,g,i)=>{let n=g;n.type="string";let{minimum:o,maximum:e,format:I,patterns:h,contentEncoding:B}=A._zod.bag;if(typeof o==="number")n.minLength=o;if(typeof e==="number")n.maxLength=e;if(I){if(n.format=ybA[I]??I,n.format==="")delete n.format;if(I==="time")delete n.format}if(B)n.contentEncoding=B;if(h&&h.size>0){let c=[...h];if(c.length===1)n.pattern=c[0].source;else if(c.length>1)n.allOf=[...c.map((C)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:C.source}))]}},EL=(A,t,g,i)=>{let n=g,{minimum:o,maximum:e,format:I,multipleOf:h,exclusiveMaximum:B,exclusiveMinimum:c}=A._zod.bag;if(typeof I==="string"&&I.includes("int"))n.type="integer";else n.type="number";if(typeof c==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.minimum=c,n.exclusiveMinimum=!0;else n.exclusiveMinimum=c;if(typeof o==="number"){if(n.minimum=o,typeof c==="number"&&t.target!=="draft-04")if(c>=o)delete n.minimum;else delete n.exclusiveMinimum}if(typeof B==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.maximum=B,n.exclusiveMaximum=!0;else n.exclusiveMaximum=B;if(typeof e==="number"){if(n.maximum=e,typeof B==="number"&&t.target!=="draft-04")if(B<=e)delete n.maximum;else delete n.exclusiveMaximum}if(typeof h==="number")n.multipleOf=h},aL=(A,t,g,i)=>{g.type="boolean"},rL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},yL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},wL=(A,t,g,i)=>{if(t.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},DL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},uL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},bL=(A,t,g,i)=>{g.not={}},lL=(A,t,g,i)=>{},NL=(A,t,g,i)=>{},UL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},SL=(A,t,g,i)=>{let n=A._zod.def,o=Cc(n.entries);if(o.every((e)=>typeof e==="number"))g.type="number";if(o.every((e)=>typeof e==="string"))g.type="string";g.enum=o},LL=(A,t,g,i)=>{let n=A._zod.def,o=[];for(let e of n.values)if(e===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(o.length===0);else if(o.length===1){let e=o[0];if(g.type=e===null?"null":typeof e,t.target==="draft-04"||t.target==="openapi-3.0")g.enum=[e];else g.const=e}else{if(o.every((e)=>typeof e==="number"))g.type="number";if(o.every((e)=>typeof e==="string"))g.type="string";if(o.every((e)=>typeof e==="boolean"))g.type="boolean";if(o.every((e)=>e===null))g.type="null";g.enum=o}},FL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},ML=(A,t,g,i)=>{let n=g,o=A._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},YL=(A,t,g,i)=>{let n=g,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:e,maximum:I,mime:h}=A._zod.bag;if(e!==void 0)o.minLength=e;if(I!==void 0)o.maxLength=I;if(h)if(h.length===1)o.contentMediaType=h[0],Object.assign(n,o);else Object.assign(n,o),n.anyOf=h.map((B)=>({contentMediaType:B}));else Object.assign(n,o)},kL=(A,t,g,i)=>{g.type="boolean"},$L=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},GL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},TL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},JL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},PL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},RL=(A,t,g,i)=>{let n=g,o=A._zod.def,{minimum:e,maximum:I}=A._zod.bag;if(typeof e==="number")n.minItems=e;if(typeof I==="number")n.maxItems=I;n.type="array",n.items=sA(o.element,t,{...i,path:[...i.path,"items"]})},fL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="object",n.properties={};let e=o.shape;for(let B in e)n.properties[B]=sA(e[B],t,{...i,path:[...i.path,"properties",B]});let I=new Set(Object.keys(e)),h=new Set([...I].filter((B)=>{let c=o.shape[B]._zod;if(t.io==="input")return c.optin===void 0;else return c.optout===void 0}));if(h.size>0)n.required=Array.from(h);if(o.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!o.catchall){if(t.io==="output")n.additionalProperties=!1}else if(o.catchall)n.additionalProperties=sA(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},Wr=(A,t,g,i)=>{let n=A._zod.def,o=n.inclusive===!1,e=n.options.map((I,h)=>sA(I,t,{...i,path:[...i.path,o?"oneOf":"anyOf",h]}));if(o)g.oneOf=e;else g.anyOf=e},OL=(A,t,g,i)=>{let n=A._zod.def,o=sA(n.left,t,{...i,path:[...i.path,"allOf",0]}),e=sA(n.right,t,{...i,path:[...i.path,"allOf",1]}),I=(B)=>("allOf"in B)&&Object.keys(B).length===1,h=[...I(o)?o.allOf:[o],...I(e)?e.allOf:[e]];g.allOf=h},zL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="array";let e=t.target==="draft-2020-12"?"prefixItems":"items",I=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",h=o.items.map((E,a)=>sA(E,t,{...i,path:[...i.path,e,a]})),B=o.rest?sA(o.rest,t,{...i,path:[...i.path,I,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=h,B)n.items=B}else if(t.target==="openapi-3.0"){if(n.items={anyOf:h},B)n.items.anyOf.push(B);if(n.minItems=h.length,!B)n.maxItems=h.length}else if(n.items=h,B)n.additionalItems=B;let{minimum:c,maximum:C}=A._zod.bag;if(typeof c==="number")n.minItems=c;if(typeof C==="number")n.maxItems=C},vL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="object";let e=o.keyType,h=e._zod.bag?.patterns;if(o.mode==="loose"&&h&&h.size>0){let c=sA(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let C of h)n.patternProperties[C.source]=c}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=sA(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=sA(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let B=e._zod.values;if(B){let c=[...B].filter((C)=>typeof C==="string"||typeof C==="number");if(c.length>0)n.required=c}},mL=(A,t,g,i)=>{let n=A._zod.def,o=sA(n.innerType,t,i),e=t.seen.get(A);if(t.target==="openapi-3.0")e.ref=n.innerType,g.nullable=!0;else g.anyOf=[o,{type:"null"}]},WL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},ZL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType,g.default=JSON.parse(JSON.stringify(n.defaultValue))},VL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);if(o.ref=n.innerType,t.io==="input")g._prefault=JSON.parse(JSON.stringify(n.defaultValue))},HL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType;let e;try{e=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=e},XL=(A,t,g,i)=>{let n=A._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;sA(o,t,i);let e=t.seen.get(A);e.ref=o},jL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType,g.readOnly=!0},KL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},Zr=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},_L=(A,t,g,i)=>{let n=A._zod.innerType;sA(n,t,i);let o=t.seen.get(A);o.ref=n},mr;var Rc=r(()=>{Pc();BA();ybA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mr={string:CL,number:EL,boolean:aL,bigint:rL,symbol:yL,null:wL,undefined:DL,void:uL,never:bL,any:lL,unknown:NL,date:UL,enum:SL,literal:LL,nan:FL,template_literal:ML,file:YL,success:kL,custom:$L,function:GL,transform:TL,map:JL,set:PL,array:RL,object:fL,union:Wr,intersection:OL,tuple:zL,record:vL,nullable:mL,nonoptional:WL,default:ZL,prefault:VL,catch:HL,pipe:XL,readonly:jL,promise:KL,optional:Zr,lazy:_L}});class xL{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(A){this.ctx.counter=A}get seen(){return this.ctx.seen}constructor(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=bo({processors:mr,target:t,...A?.metadata&&{metadata:A.metadata},...A?.unrepresentable&&{unrepresentable:A.unrepresentable},...A?.override&&{override:A.override},...A?.io&&{io:A.io}})}process(A,t={path:[],schemaPath:[]}){return sA(A,this.ctx,t)}emit(A,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}lo(this.ctx,A);let g=No(this.ctx,A),{"~standard":i,...n}=g;return n}}var $1=r(()=>{Rc();Pc()});var G1={};var T1=()=>{};var zi={};dn(zi,{version:()=>a0,util:()=>_,treeifyError:()=>yN,toJSONSchema:()=>Vr,toDotPath:()=>Iv,safeParseAsync:()=>bN,safeParse:()=>uN,safeEncodeAsync:()=>UDA,safeEncode:()=>lDA,safeDecodeAsync:()=>SDA,safeDecode:()=>NDA,registry:()=>ar,regexes:()=>rn,process:()=>sA,prettifyError:()=>wN,parseAsync:()=>Ha,parse:()=>Va,meta:()=>hL,locales:()=>$c,isValidJWT:()=>Mv,isValidBase64URL:()=>Fv,isValidBase64:()=>O0,initializeContext:()=>bo,globalRegistry:()=>xt,globalConfig:()=>hc,formatError:()=>uc,flattenError:()=>Dc,finalize:()=>No,extractDefs:()=>lo,encodeAsync:()=>uDA,encode:()=>wDA,describe:()=>IL,decodeAsync:()=>bDA,decode:()=>DDA,createToJSONSchemaMethod:()=>cL,createStandardJSONSchemaMethod:()=>uI,config:()=>Ft,clone:()=>wg,_xor:()=>_uA,_xid:()=>Lr,_void:()=>pS,_uuidv7:()=>ur,_uuidv6:()=>Dr,_uuidv4:()=>wr,_uuid:()=>yr,_url:()=>Jc,_uppercase:()=>II,_unknown:()=>qS,_union:()=>KuA,_undefined:()=>_S,_ulid:()=>Sr,_uint64:()=>jS,_uint32:()=>mS,_tuple:()=>quA,_trim:()=>aI,_transform:()=>ibA,_toUpperCase:()=>yI,_toLowerCase:()=>rI,_templateLiteral:()=>EbA,_symbol:()=>KS,_superRefine:()=>QL,_success:()=>hbA,_stringbool:()=>BL,_stringFormat:()=>DI,_string:()=>FS,_startsWith:()=>BI,_slugify:()=>wI,_size:()=>$e,_set:()=>AbA,_safeParseAsync:()=>nI,_safeParse:()=>gI,_safeEncodeAsync:()=>qa,_safeEncode:()=>xa,_safeDecodeAsync:()=>da,_safeDecode:()=>sa,_regex:()=>eI,_refine:()=>eL,_record:()=>duA,_readonly:()=>CbA,_property:()=>vr,_promise:()=>rbA,_positive:()=>Rr,_pipe:()=>cbA,_parseAsync:()=>tI,_parse:()=>AI,_overwrite:()=>fn,_optional:()=>obA,_number:()=>PS,_nullable:()=>ebA,_null:()=>xS,_normalize:()=>EI,_nonpositive:()=>Or,_nonoptional:()=>IbA,_nonnegative:()=>zr,_never:()=>dS,_negative:()=>fr,_nativeEnum:()=>gbA,_nanoid:()=>lr,_nan:()=>gL,_multipleOf:()=>Do,_minSize:()=>ii,_minLength:()=>Oi,_min:()=>Dg,_mime:()=>CI,_maxSize:()=>uo,_maxLength:()=>Ge,_max:()=>xg,_map:()=>puA,_mac:()=>YS,_lte:()=>xg,_lt:()=>gi,_lowercase:()=>QI,_literal:()=>nbA,_length:()=>Te,_lazy:()=>abA,_ksuid:()=>Fr,_jwt:()=>Pr,_isoTime:()=>TS,_isoDuration:()=>JS,_isoDateTime:()=>$S,_isoDate:()=>GS,_ipv6:()=>Yr,_ipv4:()=>Mr,_intersection:()=>suA,_int64:()=>XS,_int32:()=>vS,_int:()=>fS,_includes:()=>hI,_guid:()=>Tc,_gte:()=>Dg,_gt:()=>ni,_float64:()=>zS,_float32:()=>OS,_file:()=>iL,_enum:()=>tbA,_endsWith:()=>cI,_encodeAsync:()=>Ka,_encode:()=>Xa,_emoji:()=>br,_email:()=>rr,_e164:()=>Jr,_discriminatedUnion:()=>xuA,_default:()=>QbA,_decodeAsync:()=>_a,_decode:()=>ja,_date:()=>AL,_custom:()=>oL,_cuid2:()=>Ur,_cuid:()=>Nr,_coercedString:()=>MS,_coercedNumber:()=>RS,_coercedDate:()=>tL,_coercedBoolean:()=>ZS,_coercedBigint:()=>HS,_cidrv6:()=>$r,_cidrv4:()=>kr,_check:()=>Y1,_catch:()=>BbA,_boolean:()=>WS,_bigint:()=>VS,_base64url:()=>Tr,_base64:()=>Gr,_array:()=>nL,_any:()=>sS,TimePrecision:()=>kS,NEVER:()=>Bc,JSONSchemaGenerator:()=>xL,JSONSchema:()=>G1,Doc:()=>ir,$output:()=>US,$input:()=>SS,$constructor:()=>k,$brand:()=>eN,$ZodXor:()=>tU,$ZodXID:()=>F0,$ZodVoid:()=>q0,$ZodUnknown:()=>x0,$ZodUnion:()=>Sc,$ZodUndefined:()=>j0,$ZodUUID:()=>D0,$ZodURL:()=>b0,$ZodULID:()=>L0,$ZodType:()=>NA,$ZodTuple:()=>Cr,$ZodTransform:()=>BU,$ZodTemplateLiteral:()=>lU,$ZodSymbol:()=>X0,$ZodSuccess:()=>yU,$ZodStringFormat:()=>ot,$ZodString:()=>ke,$ZodSet:()=>eU,$ZodRegistry:()=>LS,$ZodRecord:()=>iU,$ZodRealError:()=>$g,$ZodReadonly:()=>bU,$ZodPromise:()=>UU,$ZodPrefault:()=>aU,$ZodPipe:()=>uU,$ZodOptional:()=>Er,$ZodObjectJIT:()=>AU,$ZodObject:()=>$v,$ZodNumberFormat:()=>V0,$ZodNumber:()=>Br,$ZodNullable:()=>CU,$ZodNull:()=>K0,$ZodNonOptional:()=>rU,$ZodNever:()=>s0,$ZodNanoID:()=>N0,$ZodNaN:()=>DU,$ZodMap:()=>oU,$ZodMAC:()=>P0,$ZodLiteral:()=>IU,$ZodLazy:()=>SU,$ZodKSUID:()=>M0,$ZodJWT:()=>W0,$ZodIntersection:()=>nU,$ZodISOTime:()=>$0,$ZodISODuration:()=>G0,$ZodISODateTime:()=>Y0,$ZodISODate:()=>k0,$ZodIPv6:()=>J0,$ZodIPv4:()=>T0,$ZodGUID:()=>w0,$ZodFunction:()=>NU,$ZodFile:()=>hU,$ZodExactOptional:()=>cU,$ZodError:()=>wc,$ZodEnum:()=>QU,$ZodEncodeError:()=>Fe,$ZodEmoji:()=>l0,$ZodEmail:()=>u0,$ZodE164:()=>m0,$ZodDiscriminatedUnion:()=>gU,$ZodDefault:()=>EU,$ZodDate:()=>d0,$ZodCustomStringFormat:()=>Z0,$ZodCustom:()=>LU,$ZodCodec:()=>Lc,$ZodCheckUpperCase:()=>Q0,$ZodCheckStringFormat:()=>iI,$ZodCheckStartsWith:()=>h0,$ZodCheckSizeEquals:()=>t0,$ZodCheckRegex:()=>o0,$ZodCheckProperty:()=>c0,$ZodCheckOverwrite:()=>E0,$ZodCheckNumberFormat:()=>qN,$ZodCheckMultipleOf:()=>sN,$ZodCheckMinSize:()=>A0,$ZodCheckMinLength:()=>n0,$ZodCheckMimeType:()=>C0,$ZodCheckMaxSize:()=>pN,$ZodCheckMaxLength:()=>g0,$ZodCheckLowerCase:()=>e0,$ZodCheckLessThan:()=>tr,$ZodCheckLengthEquals:()=>i0,$ZodCheckIncludes:()=>I0,$ZodCheckGreaterThan:()=>gr,$ZodCheckEndsWith:()=>B0,$ZodCheckBigIntFormat:()=>dN,$ZodCheck:()=>ht,$ZodCatch:()=>wU,$ZodCUID2:()=>S0,$ZodCUID:()=>U0,$ZodCIDRv6:()=>f0,$ZodCIDRv4:()=>R0,$ZodBoolean:()=>Uc,$ZodBigIntFormat:()=>H0,$ZodBigInt:()=>cr,$ZodBase64URL:()=>v0,$ZodBase64:()=>z0,$ZodAsyncError:()=>ti,$ZodArray:()=>p0,$ZodAny:()=>_0});var sg=r(()=>{BA();Ar();NS();Rc();$1();T1();sQ();lN();DN();FU();nr();r0();Gc();k1();Pc()});var Hr={};dn(Hr,{uppercase:()=>II,trim:()=>aI,toUpperCase:()=>yI,toLowerCase:()=>rI,startsWith:()=>BI,slugify:()=>wI,size:()=>$e,regex:()=>eI,property:()=>vr,positive:()=>Rr,overwrite:()=>fn,normalize:()=>EI,nonpositive:()=>Or,nonnegative:()=>zr,negative:()=>fr,multipleOf:()=>Do,minSize:()=>ii,minLength:()=>Oi,mime:()=>CI,maxSize:()=>uo,maxLength:()=>Ge,lte:()=>xg,lt:()=>gi,lowercase:()=>QI,length:()=>Te,includes:()=>hI,gte:()=>Dg,gt:()=>ni,endsWith:()=>cI});var Xr=r(()=>{sg()});var Uo={};dn(Uo,{time:()=>dL,duration:()=>pL,datetime:()=>sL,date:()=>qL,ZodISOTime:()=>_r,ZodISODuration:()=>xr,ZodISODateTime:()=>jr,ZodISODate:()=>Kr});function sL(A){return $S(jr,A)}function qL(A){return GS(Kr,A)}function dL(A){return TS(_r,A)}function pL(A){return JS(xr,A)}var jr,Kr,_r,xr;var fc=r(()=>{sg();zc();jr=k("ZodISODateTime",(A,t)=>{Y0.init(A,t),et.init(A,t)});Kr=k("ZodISODate",(A,t)=>{k0.init(A,t),et.init(A,t)});_r=k("ZodISOTime",(A,t)=>{$0.init(A,t),et.init(A,t)});xr=k("ZodISODuration",(A,t)=>{G0.init(A,t),et.init(A,t)})});var J1=(A,t)=>{wc.init(A,t),A.name="ZodError",Object.defineProperties(A,{format:{value:(g)=>uc(A,g)},flatten:{value:(g)=>Dc(A,g)},addIssue:{value:(g)=>{A.issues.push(g),A.message=JSON.stringify(A.issues,qQ,2)}},addIssues:{value:(g)=>{A.issues.push(...g),A.message=JSON.stringify(A.issues,qQ,2)}},isEmpty:{get(){return A.issues.length===0}}})},DbA,Gg;var AF=r(()=>{sg();sg();BA();DbA=k("ZodError",J1),Gg=k("ZodError",J1,{Parent:Error})});var tF,gF,nF,iF,oF,eF,QF,IF,hF,BF,cF,CF;var EF=r(()=>{sg();AF();tF=AI(Gg),gF=tI(Gg),nF=gI(Gg),iF=nI(Gg),oF=Xa(Gg),eF=ja(Gg),QF=Ka(Gg),IF=_a(Gg),hF=xa(Gg),BF=sa(Gg),cF=qa(Gg),CF=da(Gg)});var Oc={};dn(Oc,{xor:()=>b2,xid:()=>j1,void:()=>y2,uuidv7:()=>v1,uuidv6:()=>z1,uuidv4:()=>O1,uuid:()=>f1,url:()=>pr,unknown:()=>Qt,union:()=>It,undefined:()=>r2,ulid:()=>X1,uint64:()=>E2,uint32:()=>B2,tuple:()=>MF,transform:()=>Dy,templateLiteral:()=>G2,symbol:()=>a2,superRefine:()=>pF,success:()=>Y2,stringbool:()=>z2,stringFormat:()=>n2,string:()=>F,strictObject:()=>u2,set:()=>S2,refine:()=>dF,record:()=>pA,readonly:()=>jF,promise:()=>T2,preprocess:()=>sc,prefault:()=>vF,pipe:()=>Wc,partialRecord:()=>l2,optional:()=>Bt,object:()=>p,number:()=>vA,nullish:()=>M2,nullable:()=>mc,null:()=>Vc,nonoptional:()=>mF,never:()=>wy,nativeEnum:()=>L2,nanoid:()=>Z1,nan:()=>k2,meta:()=>f2,map:()=>U2,mac:()=>x1,looseRecord:()=>N2,looseObject:()=>Mt,literal:()=>QA,lazy:()=>xF,ksuid:()=>K1,keyof:()=>D2,jwt:()=>g2,json:()=>v2,ipv6:()=>s1,ipv4:()=>_1,intersection:()=>FI,int64:()=>C2,int32:()=>h2,int:()=>sr,instanceof:()=>O2,httpUrl:()=>m1,hostname:()=>i2,hex:()=>o2,hash:()=>e2,guid:()=>R1,function:()=>J2,float64:()=>I2,float32:()=>Q2,file:()=>F2,exactOptional:()=>PF,enum:()=>st,emoji:()=>W1,email:()=>P1,e164:()=>t2,discriminatedUnion:()=>Kc,describe:()=>R2,date:()=>w2,custom:()=>Uy,cuid2:()=>H1,cuid:()=>V1,codec:()=>$2,cidrv6:()=>d1,cidrv4:()=>q1,check:()=>P2,catch:()=>VF,boolean:()=>qA,bigint:()=>c2,base64url:()=>A2,base64:()=>p1,array:()=>q,any:()=>yy,_function:()=>J2,_default:()=>OF,_ZodString:()=>qr,ZodXor:()=>UF,ZodXID:()=>oy,ZodVoid:()=>lF,ZodUnknown:()=>uF,ZodUnion:()=>jc,ZodUndefined:()=>yF,ZodUUID:()=>oi,ZodURL:()=>Zc,ZodULID:()=>iy,ZodType:()=>kA,ZodTuple:()=>FF,ZodTransform:()=>TF,ZodTemplateLiteral:()=>KF,ZodSymbol:()=>rF,ZodSuccess:()=>WF,ZodStringFormat:()=>et,ZodString:()=>lI,ZodSet:()=>kF,ZodRecord:()=>_c,ZodReadonly:()=>XF,ZodPromise:()=>sF,ZodPrefault:()=>zF,ZodPipe:()=>ly,ZodOptional:()=>uy,ZodObject:()=>Xc,ZodNumberFormat:()=>Je,ZodNumber:()=>UI,ZodNullable:()=>RF,ZodNull:()=>wF,ZodNonOptional:()=>by,ZodNever:()=>bF,ZodNanoID:()=>ty,ZodNaN:()=>HF,ZodMap:()=>YF,ZodMAC:()=>aF,ZodLiteral:()=>$F,ZodLazy:()=>_F,ZodKSUID:()=>ey,ZodJWT:()=>ay,ZodIntersection:()=>LF,ZodIPv6:()=>Iy,ZodIPv4:()=>Qy,ZodGUID:()=>vc,ZodFunction:()=>qF,ZodFile:()=>GF,ZodExactOptional:()=>JF,ZodEnum:()=>bI,ZodEmoji:()=>Ay,ZodEmail:()=>dr,ZodE164:()=>Ey,ZodDiscriminatedUnion:()=>SF,ZodDefault:()=>fF,ZodDate:()=>Hc,ZodCustomStringFormat:()=>NI,ZodCustom:()=>xc,ZodCodec:()=>Ny,ZodCatch:()=>ZF,ZodCUID2:()=>ny,ZodCUID:()=>gy,ZodCIDRv6:()=>By,ZodCIDRv4:()=>hy,ZodBoolean:()=>SI,ZodBigIntFormat:()=>ry,ZodBigInt:()=>LI,ZodBase64URL:()=>Cy,ZodBase64:()=>cy,ZodArray:()=>NF,ZodAny:()=>DF});function F(A){return FS(lI,A)}function P1(A){return rr(dr,A)}function R1(A){return Tc(vc,A)}function f1(A){return yr(oi,A)}function O1(A){return wr(oi,A)}function z1(A){return Dr(oi,A)}function v1(A){return ur(oi,A)}function pr(A){return Jc(Zc,A)}function m1(A){return Jc(Zc,{protocol:/^https?$/,hostname:rn.domain,..._.normalizeParams(A)})}function W1(A){return br(Ay,A)}function Z1(A){return lr(ty,A)}function V1(A){return Nr(gy,A)}function H1(A){return Ur(ny,A)}function X1(A){return Sr(iy,A)}function j1(A){return Lr(oy,A)}function K1(A){return Fr(ey,A)}function _1(A){return Mr(Qy,A)}function x1(A){return YS(aF,A)}function s1(A){return Yr(Iy,A)}function q1(A){return kr(hy,A)}function d1(A){return $r(By,A)}function p1(A){return Gr(cy,A)}function A2(A){return Tr(Cy,A)}function t2(A){return Jr(Ey,A)}function g2(A){return Pr(ay,A)}function n2(A,t,g={}){return DI(NI,A,t,g)}function i2(A){return DI(NI,"hostname",rn.hostname,A)}function o2(A){return DI(NI,"hex",rn.hex,A)}function e2(A,t){let g=t?.enc??"hex",i=`${A}_${g}`,n=rn[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return DI(NI,i,n,t)}function vA(A){return PS(UI,A)}function sr(A){return fS(Je,A)}function Q2(A){return OS(Je,A)}function I2(A){return zS(Je,A)}function h2(A){return vS(Je,A)}function B2(A){return mS(Je,A)}function qA(A){return WS(SI,A)}function c2(A){return VS(LI,A)}function C2(A){return XS(ry,A)}function E2(A){return jS(ry,A)}function a2(A){return KS(rF,A)}function r2(A){return _S(yF,A)}function Vc(A){return xS(wF,A)}function yy(){return sS(DF)}function Qt(){return qS(uF)}function wy(A){return dS(bF,A)}function y2(A){return pS(lF,A)}function w2(A){return AL(Hc,A)}function q(A,t){return nL(NF,A,t)}function D2(A){let t=A._zod.def.shape;return st(Object.keys(t))}function p(A,t){let g={type:"object",shape:A??{},..._.normalizeParams(t)};return new Xc(g)}function u2(A,t){return new Xc({type:"object",shape:A,catchall:wy(),..._.normalizeParams(t)})}function Mt(A,t){return new Xc({type:"object",shape:A,catchall:Qt(),..._.normalizeParams(t)})}function It(A,t){return new jc({type:"union",options:A,..._.normalizeParams(t)})}function b2(A,t){return new UF({type:"union",options:A,inclusive:!1,..._.normalizeParams(t)})}function Kc(A,t,g){return new SF({type:"union",options:t,discriminator:A,..._.normalizeParams(g)})}function FI(A,t){return new LF({type:"intersection",left:A,right:t})}function MF(A,t,g){let i=t instanceof NA,n=i?g:t;return new FF({type:"tuple",items:A,rest:i?t:null,..._.normalizeParams(n)})}function pA(A,t,g){return new _c({type:"record",keyType:A,valueType:t,..._.normalizeParams(g)})}function l2(A,t,g){let i=wg(A);return i._zod.values=void 0,new _c({type:"record",keyType:i,valueType:t,..._.normalizeParams(g)})}function N2(A,t,g){return new _c({type:"record",keyType:A,valueType:t,mode:"loose",..._.normalizeParams(g)})}function U2(A,t,g){return new YF({type:"map",keyType:A,valueType:t,..._.normalizeParams(g)})}function S2(A,t){return new kF({type:"set",valueType:A,..._.normalizeParams(t)})}function st(A,t){let g=Array.isArray(A)?Object.fromEntries(A.map((i)=>[i,i])):A;return new bI({type:"enum",entries:g,..._.normalizeParams(t)})}function L2(A,t){return new bI({type:"enum",entries:A,..._.normalizeParams(t)})}function QA(A,t){return new $F({type:"literal",values:Array.isArray(A)?A:[A],..._.normalizeParams(t)})}function F2(A){return iL(GF,A)}function Dy(A){return new TF({type:"transform",transform:A})}function Bt(A){return new uy({type:"optional",innerType:A})}function PF(A){return new JF({type:"optional",innerType:A})}function mc(A){return new RF({type:"nullable",innerType:A})}function M2(A){return Bt(mc(A))}function OF(A,t){return new fF({type:"default",innerType:A,get defaultValue(){return typeof t==="function"?t():_.shallowClone(t)}})}function vF(A,t){return new zF({type:"prefault",innerType:A,get defaultValue(){return typeof t==="function"?t():_.shallowClone(t)}})}function mF(A,t){return new by({type:"nonoptional",innerType:A,..._.normalizeParams(t)})}function Y2(A){return new WF({type:"success",innerType:A})}function VF(A,t){return new ZF({type:"catch",innerType:A,catchValue:typeof t==="function"?t:()=>t})}function k2(A){return gL(HF,A)}function Wc(A,t){return new ly({type:"pipe",in:A,out:t})}function $2(A,t,g){return new Ny({type:"pipe",in:A,out:t,transform:g.decode,reverseTransform:g.encode})}function jF(A){return new XF({type:"readonly",innerType:A})}function G2(A,t){return new KF({type:"template_literal",parts:A,..._.normalizeParams(t)})}function xF(A){return new _F({type:"lazy",getter:A})}function T2(A){return new sF({type:"promise",innerType:A})}function J2(A){return new qF({type:"function",input:Array.isArray(A?.input)?MF(A?.input):A?.input??q(Qt()),output:A?.output??Qt()})}function P2(A){let t=new ht({check:"custom"});return t._zod.check=A,t}function Uy(A,t){return oL(xc,A??(()=>!0),t)}function dF(A,t={}){return eL(xc,A,t)}function pF(A){return QL(A)}function O2(A,t={}){let g=new xc({type:"custom",check:"custom",fn:(i)=>i instanceof A,abort:!0,..._.normalizeParams(t)});return g._zod.bag.Class=A,g._zod.check=(i)=>{if(!(i.value instanceof A))i.issues.push({code:"invalid_type",expected:A.name,input:i.value,inst:g,path:[...g._zod.def.path??[]]})},g}function v2(A){let t=xF(()=>{return It([F(A),vA(),qA(),Vc(),q(t),pA(F(),t)])});return t}function sc(A,t){return Wc(Dy(A),t)}var kA,qr,lI,et,dr,vc,oi,Zc,Ay,ty,gy,ny,iy,oy,ey,Qy,aF,Iy,hy,By,cy,Cy,Ey,ay,NI,UI,Je,SI,LI,ry,rF,yF,wF,DF,uF,bF,lF,Hc,NF,Xc,jc,UF,SF,LF,FF,_c,YF,kF,bI,$F,GF,TF,uy,JF,RF,fF,zF,by,WF,ZF,HF,ly,Ny,XF,KF,_F,sF,qF,xc,R2,f2,z2=(...A)=>BL({Codec:Ny,Boolean:SI,String:lI},...A);var zc=r(()=>{sg();sg();Rc();Pc();Xr();fc();EF();kA=k("ZodType",(A,t)=>{return NA.init(A,t),Object.assign(A["~standard"],{jsonSchema:{input:uI(A,"input"),output:uI(A,"output")}}),A.toJSONSchema=cL(A,{}),A.def=t,A.type=t.type,Object.defineProperty(A,"_def",{value:t}),A.check=(...g)=>{return A.clone(_.mergeDefs(t,{checks:[...t.checks??[],...g.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},A.with=A.check,A.clone=(g,i)=>wg(A,g,i),A.brand=()=>A,A.register=(g,i)=>{return g.add(A,i),A},A.parse=(g,i)=>tF(A,g,i,{callee:A.parse}),A.safeParse=(g,i)=>nF(A,g,i),A.parseAsync=async(g,i)=>gF(A,g,i,{callee:A.parseAsync}),A.safeParseAsync=async(g,i)=>iF(A,g,i),A.spa=A.safeParseAsync,A.encode=(g,i)=>oF(A,g,i),A.decode=(g,i)=>eF(A,g,i),A.encodeAsync=async(g,i)=>QF(A,g,i),A.decodeAsync=async(g,i)=>IF(A,g,i),A.safeEncode=(g,i)=>hF(A,g,i),A.safeDecode=(g,i)=>BF(A,g,i),A.safeEncodeAsync=async(g,i)=>cF(A,g,i),A.safeDecodeAsync=async(g,i)=>CF(A,g,i),A.refine=(g,i)=>A.check(dF(g,i)),A.superRefine=(g)=>A.check(pF(g)),A.overwrite=(g)=>A.check(fn(g)),A.optional=()=>Bt(A),A.exactOptional=()=>PF(A),A.nullable=()=>mc(A),A.nullish=()=>Bt(mc(A)),A.nonoptional=(g)=>mF(A,g),A.array=()=>q(A),A.or=(g)=>It([A,g]),A.and=(g)=>FI(A,g),A.transform=(g)=>Wc(A,Dy(g)),A.default=(g)=>OF(A,g),A.prefault=(g)=>vF(A,g),A.catch=(g)=>VF(A,g),A.pipe=(g)=>Wc(A,g),A.readonly=()=>jF(A),A.describe=(g)=>{let i=A.clone();return xt.add(i,{description:g}),i},Object.defineProperty(A,"description",{get(){return xt.get(A)?.description},configurable:!0}),A.meta=(...g)=>{if(g.length===0)return xt.get(A);let i=A.clone();return xt.add(i,g[0]),i},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=(g)=>g(A),A}),qr=k("_ZodString",(A,t)=>{ke.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>CL(A,i,n,o);let g=A._zod.bag;A.format=g.format??null,A.minLength=g.minimum??null,A.maxLength=g.maximum??null,A.regex=(...i)=>A.check(eI(...i)),A.includes=(...i)=>A.check(hI(...i)),A.startsWith=(...i)=>A.check(BI(...i)),A.endsWith=(...i)=>A.check(cI(...i)),A.min=(...i)=>A.check(Oi(...i)),A.max=(...i)=>A.check(Ge(...i)),A.length=(...i)=>A.check(Te(...i)),A.nonempty=(...i)=>A.check(Oi(1,...i)),A.lowercase=(i)=>A.check(QI(i)),A.uppercase=(i)=>A.check(II(i)),A.trim=()=>A.check(aI()),A.normalize=(...i)=>A.check(EI(...i)),A.toLowerCase=()=>A.check(rI()),A.toUpperCase=()=>A.check(yI()),A.slugify=()=>A.check(wI())}),lI=k("ZodString",(A,t)=>{ke.init(A,t),qr.init(A,t),A.email=(g)=>A.check(rr(dr,g)),A.url=(g)=>A.check(Jc(Zc,g)),A.jwt=(g)=>A.check(Pr(ay,g)),A.emoji=(g)=>A.check(br(Ay,g)),A.guid=(g)=>A.check(Tc(vc,g)),A.uuid=(g)=>A.check(yr(oi,g)),A.uuidv4=(g)=>A.check(wr(oi,g)),A.uuidv6=(g)=>A.check(Dr(oi,g)),A.uuidv7=(g)=>A.check(ur(oi,g)),A.nanoid=(g)=>A.check(lr(ty,g)),A.guid=(g)=>A.check(Tc(vc,g)),A.cuid=(g)=>A.check(Nr(gy,g)),A.cuid2=(g)=>A.check(Ur(ny,g)),A.ulid=(g)=>A.check(Sr(iy,g)),A.base64=(g)=>A.check(Gr(cy,g)),A.base64url=(g)=>A.check(Tr(Cy,g)),A.xid=(g)=>A.check(Lr(oy,g)),A.ksuid=(g)=>A.check(Fr(ey,g)),A.ipv4=(g)=>A.check(Mr(Qy,g)),A.ipv6=(g)=>A.check(Yr(Iy,g)),A.cidrv4=(g)=>A.check(kr(hy,g)),A.cidrv6=(g)=>A.check($r(By,g)),A.e164=(g)=>A.check(Jr(Ey,g)),A.datetime=(g)=>A.check(sL(g)),A.date=(g)=>A.check(qL(g)),A.time=(g)=>A.check(dL(g)),A.duration=(g)=>A.check(pL(g))});et=k("ZodStringFormat",(A,t)=>{ot.init(A,t),qr.init(A,t)}),dr=k("ZodEmail",(A,t)=>{u0.init(A,t),et.init(A,t)});vc=k("ZodGUID",(A,t)=>{w0.init(A,t),et.init(A,t)});oi=k("ZodUUID",(A,t)=>{D0.init(A,t),et.init(A,t)});Zc=k("ZodURL",(A,t)=>{b0.init(A,t),et.init(A,t)});Ay=k("ZodEmoji",(A,t)=>{l0.init(A,t),et.init(A,t)});ty=k("ZodNanoID",(A,t)=>{N0.init(A,t),et.init(A,t)});gy=k("ZodCUID",(A,t)=>{U0.init(A,t),et.init(A,t)});ny=k("ZodCUID2",(A,t)=>{S0.init(A,t),et.init(A,t)});iy=k("ZodULID",(A,t)=>{L0.init(A,t),et.init(A,t)});oy=k("ZodXID",(A,t)=>{F0.init(A,t),et.init(A,t)});ey=k("ZodKSUID",(A,t)=>{M0.init(A,t),et.init(A,t)});Qy=k("ZodIPv4",(A,t)=>{T0.init(A,t),et.init(A,t)});aF=k("ZodMAC",(A,t)=>{P0.init(A,t),et.init(A,t)});Iy=k("ZodIPv6",(A,t)=>{J0.init(A,t),et.init(A,t)});hy=k("ZodCIDRv4",(A,t)=>{R0.init(A,t),et.init(A,t)});By=k("ZodCIDRv6",(A,t)=>{f0.init(A,t),et.init(A,t)});cy=k("ZodBase64",(A,t)=>{z0.init(A,t),et.init(A,t)});Cy=k("ZodBase64URL",(A,t)=>{v0.init(A,t),et.init(A,t)});Ey=k("ZodE164",(A,t)=>{m0.init(A,t),et.init(A,t)});ay=k("ZodJWT",(A,t)=>{W0.init(A,t),et.init(A,t)});NI=k("ZodCustomStringFormat",(A,t)=>{Z0.init(A,t),et.init(A,t)});UI=k("ZodNumber",(A,t)=>{Br.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>EL(A,i,n,o),A.gt=(i,n)=>A.check(ni(i,n)),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.lt=(i,n)=>A.check(gi(i,n)),A.lte=(i,n)=>A.check(xg(i,n)),A.max=(i,n)=>A.check(xg(i,n)),A.int=(i)=>A.check(sr(i)),A.safe=(i)=>A.check(sr(i)),A.positive=(i)=>A.check(ni(0,i)),A.nonnegative=(i)=>A.check(Dg(0,i)),A.negative=(i)=>A.check(gi(0,i)),A.nonpositive=(i)=>A.check(xg(0,i)),A.multipleOf=(i,n)=>A.check(Do(i,n)),A.step=(i,n)=>A.check(Do(i,n)),A.finite=()=>A;let g=A._zod.bag;A.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),A.isFinite=!0,A.format=g.format??null});Je=k("ZodNumberFormat",(A,t)=>{V0.init(A,t),UI.init(A,t)});SI=k("ZodBoolean",(A,t)=>{Uc.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>aL(A,g,i,n)});LI=k("ZodBigInt",(A,t)=>{cr.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>rL(A,i,n,o),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.gt=(i,n)=>A.check(ni(i,n)),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.lt=(i,n)=>A.check(gi(i,n)),A.lte=(i,n)=>A.check(xg(i,n)),A.max=(i,n)=>A.check(xg(i,n)),A.positive=(i)=>A.check(ni(BigInt(0),i)),A.negative=(i)=>A.check(gi(BigInt(0),i)),A.nonpositive=(i)=>A.check(xg(BigInt(0),i)),A.nonnegative=(i)=>A.check(Dg(BigInt(0),i)),A.multipleOf=(i,n)=>A.check(Do(i,n));let g=A._zod.bag;A.minValue=g.minimum??null,A.maxValue=g.maximum??null,A.format=g.format??null});ry=k("ZodBigIntFormat",(A,t)=>{H0.init(A,t),LI.init(A,t)});rF=k("ZodSymbol",(A,t)=>{X0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>yL(A,g,i,n)});yF=k("ZodUndefined",(A,t)=>{j0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>DL(A,g,i,n)});wF=k("ZodNull",(A,t)=>{K0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wL(A,g,i,n)});DF=k("ZodAny",(A,t)=>{_0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>lL(A,g,i,n)});uF=k("ZodUnknown",(A,t)=>{x0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>NL(A,g,i,n)});bF=k("ZodNever",(A,t)=>{s0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>bL(A,g,i,n)});lF=k("ZodVoid",(A,t)=>{q0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>uL(A,g,i,n)});Hc=k("ZodDate",(A,t)=>{d0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>UL(A,i,n,o),A.min=(i,n)=>A.check(Dg(i,n)),A.max=(i,n)=>A.check(xg(i,n));let g=A._zod.bag;A.minDate=g.minimum?new Date(g.minimum):null,A.maxDate=g.maximum?new Date(g.maximum):null});NF=k("ZodArray",(A,t)=>{p0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>RL(A,g,i,n),A.element=t.element,A.min=(g,i)=>A.check(Oi(g,i)),A.nonempty=(g)=>A.check(Oi(1,g)),A.max=(g,i)=>A.check(Ge(g,i)),A.length=(g,i)=>A.check(Te(g,i)),A.unwrap=()=>A.element});Xc=k("ZodObject",(A,t)=>{AU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>fL(A,g,i,n),_.defineLazy(A,"shape",()=>{return t.shape}),A.keyof=()=>st(Object.keys(A._zod.def.shape)),A.catchall=(g)=>A.clone({...A._zod.def,catchall:g}),A.passthrough=()=>A.clone({...A._zod.def,catchall:Qt()}),A.loose=()=>A.clone({...A._zod.def,catchall:Qt()}),A.strict=()=>A.clone({...A._zod.def,catchall:wy()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=(g)=>{return _.extend(A,g)},A.safeExtend=(g)=>{return _.safeExtend(A,g)},A.merge=(g)=>_.merge(A,g),A.pick=(g)=>_.pick(A,g),A.omit=(g)=>_.omit(A,g),A.partial=(...g)=>_.partial(uy,A,g[0]),A.required=(...g)=>_.required(by,A,g[0])});jc=k("ZodUnion",(A,t)=>{Sc.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Wr(A,g,i,n),A.options=t.options});UF=k("ZodXor",(A,t)=>{jc.init(A,t),tU.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Wr(A,g,i,n),A.options=t.options});SF=k("ZodDiscriminatedUnion",(A,t)=>{jc.init(A,t),gU.init(A,t)});LF=k("ZodIntersection",(A,t)=>{nU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>OL(A,g,i,n)});FF=k("ZodTuple",(A,t)=>{Cr.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>zL(A,g,i,n),A.rest=(g)=>A.clone({...A._zod.def,rest:g})});_c=k("ZodRecord",(A,t)=>{iU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>vL(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType});YF=k("ZodMap",(A,t)=>{oU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>JL(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType,A.min=(...g)=>A.check(ii(...g)),A.nonempty=(g)=>A.check(ii(1,g)),A.max=(...g)=>A.check(uo(...g)),A.size=(...g)=>A.check($e(...g))});kF=k("ZodSet",(A,t)=>{eU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>PL(A,g,i,n),A.min=(...g)=>A.check(ii(...g)),A.nonempty=(g)=>A.check(ii(1,g)),A.max=(...g)=>A.check(uo(...g)),A.size=(...g)=>A.check($e(...g))});bI=k("ZodEnum",(A,t)=>{QU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>SL(A,i,n,o),A.enum=t.entries,A.options=Object.values(t.entries);let g=new Set(Object.keys(t.entries));A.extract=(i,n)=>{let o={};for(let e of i)if(g.has(e))o[e]=t.entries[e];else throw Error(`Key ${e} not found in enum`);return new bI({...t,checks:[],..._.normalizeParams(n),entries:o})},A.exclude=(i,n)=>{let o={...t.entries};for(let e of i)if(g.has(e))delete o[e];else throw Error(`Key ${e} not found in enum`);return new bI({...t,checks:[],..._.normalizeParams(n),entries:o})}});$F=k("ZodLiteral",(A,t)=>{IU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>LL(A,g,i,n),A.values=new Set(t.values),Object.defineProperty(A,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});GF=k("ZodFile",(A,t)=>{hU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>YL(A,g,i,n),A.min=(g,i)=>A.check(ii(g,i)),A.max=(g,i)=>A.check(uo(g,i)),A.mime=(g,i)=>A.check(CI(Array.isArray(g)?g:[g],i))});TF=k("ZodTransform",(A,t)=>{BU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>TL(A,g,i,n),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new Fe(A.constructor.name);g.addIssue=(o)=>{if(typeof o==="string")g.issues.push(_.issue(o,g.value,t));else{let e=o;if(e.fatal)e.continue=!1;e.code??(e.code="custom"),e.input??(e.input=g.value),e.inst??(e.inst=A),g.issues.push(_.issue(e))}};let n=t.transform(g.value,g);if(n instanceof Promise)return n.then((o)=>{return g.value=o,g});return g.value=n,g}});uy=k("ZodOptional",(A,t)=>{Er.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Zr(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});JF=k("ZodExactOptional",(A,t)=>{cU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Zr(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});RF=k("ZodNullable",(A,t)=>{CU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>mL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});fF=k("ZodDefault",(A,t)=>{EU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ZL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});zF=k("ZodPrefault",(A,t)=>{aU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>VL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});by=k("ZodNonOptional",(A,t)=>{rU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>WL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});WF=k("ZodSuccess",(A,t)=>{yU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>kL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});ZF=k("ZodCatch",(A,t)=>{wU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>HL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});HF=k("ZodNaN",(A,t)=>{DU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>FL(A,g,i,n)});ly=k("ZodPipe",(A,t)=>{uU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>XL(A,g,i,n),A.in=t.in,A.out=t.out});Ny=k("ZodCodec",(A,t)=>{ly.init(A,t),Lc.init(A,t)});XF=k("ZodReadonly",(A,t)=>{bU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>jL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});KF=k("ZodTemplateLiteral",(A,t)=>{lU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ML(A,g,i,n)});_F=k("ZodLazy",(A,t)=>{SU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>_L(A,g,i,n),A.unwrap=()=>A._zod.def.getter()});sF=k("ZodPromise",(A,t)=>{UU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>KL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});qF=k("ZodFunction",(A,t)=>{NU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>GL(A,g,i,n)});xc=k("ZodCustom",(A,t)=>{LU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>$L(A,g,i,n)});R2=IL,f2=hL});function bbA(A){Ft({customError:A})}function lbA(){return Ft().customError}var tM,AM;var m2=r(()=>{sg();tM={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(A){})(AM||(AM={}))});function UbA(A,t){let g=A.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function SbA(A,t){if(!A.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=A.slice(1).split("/").filter(Boolean);if(g.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===i){let n=g[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${A}`);return t.defs[n]}throw Error(`Reference not found: ${A}`)}function W2(A,t){if(A.not!==void 0){if(typeof A.not==="object"&&Object.keys(A.not).length===0)return tA.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(A.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(A.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(A.if!==void 0||A.then!==void 0||A.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(A.dependentSchemas!==void 0||A.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(A.$ref){let n=A.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return tA.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=SbA(n,t),e=Ig(o,t);return t.refs.set(n,e),t.processing.delete(n),e}if(A.enum!==void 0){let n=A.enum;if(t.version==="openapi-3.0"&&A.nullable===!0&&n.length===1&&n[0]===null)return tA.null();if(n.length===0)return tA.never();if(n.length===1)return tA.literal(n[0]);if(n.every((e)=>typeof e==="string"))return tA.enum(n);let o=n.map((e)=>tA.literal(e));if(o.length<2)return o[0];return tA.union([o[0],o[1],...o.slice(2)])}if(A.const!==void 0)return tA.literal(A.const);let g=A.type;if(Array.isArray(g)){let n=g.map((o)=>{let e={...A,type:o};return W2(e,t)});if(n.length===0)return tA.never();if(n.length===1)return n[0];return tA.union(n)}if(!g)return tA.any();let i;switch(g){case"string":{let n=tA.string();if(A.format){let o=A.format;if(o==="email")n=n.check(tA.email());else if(o==="uri"||o==="uri-reference")n=n.check(tA.url());else if(o==="uuid"||o==="guid")n=n.check(tA.uuid());else if(o==="date-time")n=n.check(tA.iso.datetime());else if(o==="date")n=n.check(tA.iso.date());else if(o==="time")n=n.check(tA.iso.time());else if(o==="duration")n=n.check(tA.iso.duration());else if(o==="ipv4")n=n.check(tA.ipv4());else if(o==="ipv6")n=n.check(tA.ipv6());else if(o==="mac")n=n.check(tA.mac());else if(o==="cidr")n=n.check(tA.cidrv4());else if(o==="cidr-v6")n=n.check(tA.cidrv6());else if(o==="base64")n=n.check(tA.base64());else if(o==="base64url")n=n.check(tA.base64url());else if(o==="e164")n=n.check(tA.e164());else if(o==="jwt")n=n.check(tA.jwt());else if(o==="emoji")n=n.check(tA.emoji());else if(o==="nanoid")n=n.check(tA.nanoid());else if(o==="cuid")n=n.check(tA.cuid());else if(o==="cuid2")n=n.check(tA.cuid2());else if(o==="ulid")n=n.check(tA.ulid());else if(o==="xid")n=n.check(tA.xid());else if(o==="ksuid")n=n.check(tA.ksuid())}if(typeof A.minLength==="number")n=n.min(A.minLength);if(typeof A.maxLength==="number")n=n.max(A.maxLength);if(A.pattern)n=n.regex(new RegExp(A.pattern));i=n;break}case"number":case"integer":{let n=g==="integer"?tA.number().int():tA.number();if(typeof A.minimum==="number")n=n.min(A.minimum);if(typeof A.maximum==="number")n=n.max(A.maximum);if(typeof A.exclusiveMinimum==="number")n=n.gt(A.exclusiveMinimum);else if(A.exclusiveMinimum===!0&&typeof A.minimum==="number")n=n.gt(A.minimum);if(typeof A.exclusiveMaximum==="number")n=n.lt(A.exclusiveMaximum);else if(A.exclusiveMaximum===!0&&typeof A.maximum==="number")n=n.lt(A.maximum);if(typeof A.multipleOf==="number")n=n.multipleOf(A.multipleOf);i=n;break}case"boolean":{i=tA.boolean();break}case"null":{i=tA.null();break}case"object":{let n={},o=A.properties||{},e=new Set(A.required||[]);for(let[h,B]of Object.entries(o)){let c=Ig(B,t);n[h]=e.has(h)?c:c.optional()}if(A.propertyNames){let h=Ig(A.propertyNames,t),B=A.additionalProperties&&typeof A.additionalProperties==="object"?Ig(A.additionalProperties,t):tA.any();if(Object.keys(n).length===0){i=tA.record(h,B);break}let c=tA.object(n).passthrough(),C=tA.looseRecord(h,B);i=tA.intersection(c,C);break}if(A.patternProperties){let h=A.patternProperties,B=Object.keys(h),c=[];for(let E of B){let a=Ig(h[E],t),y=tA.string().regex(new RegExp(E));c.push(tA.looseRecord(y,a))}let C=[];if(Object.keys(n).length>0)C.push(tA.object(n).passthrough());if(C.push(...c),C.length===0)i=tA.object({}).passthrough();else if(C.length===1)i=C[0];else{let E=tA.intersection(C[0],C[1]);for(let a=2;a<C.length;a++)E=tA.intersection(E,C[a]);i=E}break}let I=tA.object(n);if(A.additionalProperties===!1)i=I.strict();else if(typeof A.additionalProperties==="object")i=I.catchall(Ig(A.additionalProperties,t));else i=I.passthrough();break}case"array":{let{prefixItems:n,items:o}=A;if(n&&Array.isArray(n)){let e=n.map((h)=>Ig(h,t)),I=o&&typeof o==="object"&&!Array.isArray(o)?Ig(o,t):void 0;if(I)i=tA.tuple(e).rest(I);else i=tA.tuple(e);if(typeof A.minItems==="number")i=i.check(tA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(tA.maxLength(A.maxItems))}else if(Array.isArray(o)){let e=o.map((h)=>Ig(h,t)),I=A.additionalItems&&typeof A.additionalItems==="object"?Ig(A.additionalItems,t):void 0;if(I)i=tA.tuple(e).rest(I);else i=tA.tuple(e);if(typeof A.minItems==="number")i=i.check(tA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(tA.maxLength(A.maxItems))}else if(o!==void 0){let e=Ig(o,t),I=tA.array(e);if(typeof A.minItems==="number")I=I.min(A.minItems);if(typeof A.maxItems==="number")I=I.max(A.maxItems);i=I}else i=tA.array(tA.any());break}default:throw Error(`Unsupported type: ${g}`)}if(A.description)i=i.describe(A.description);if(A.default!==void 0)i=i.default(A.default);return i}function Ig(A,t){if(typeof A==="boolean")return A?tA.any():tA.never();let g=W2(A,t),i=A.type||A.enum!==void 0||A.const!==void 0;if(A.anyOf&&Array.isArray(A.anyOf)){let I=A.anyOf.map((B)=>Ig(B,t)),h=tA.union(I);g=i?tA.intersection(g,h):h}if(A.oneOf&&Array.isArray(A.oneOf)){let I=A.oneOf.map((B)=>Ig(B,t)),h=tA.xor(I);g=i?tA.intersection(g,h):h}if(A.allOf&&Array.isArray(A.allOf))if(A.allOf.length===0)g=i?g:tA.any();else{let I=i?g:Ig(A.allOf[0],t),h=i?0:1;for(let B=h;B<A.allOf.length;B++)I=tA.intersection(I,Ig(A.allOf[B],t));g=I}if(A.nullable===!0&&t.version==="openapi-3.0")g=tA.nullable(g);if(A.readOnly===!0)g=tA.readonly(g);let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let I of o)if(I in A)n[I]=A[I];let e=["contentEncoding","contentMediaType","contentSchema"];for(let I of e)if(I in A)n[I]=A[I];for(let I of Object.keys(A))if(!NbA.has(I))n[I]=A[I];if(Object.keys(n).length>0)t.registry.add(g,n);return g}function Z2(A,t){if(typeof A==="boolean")return A?tA.any():tA.never();let g=UbA(A,t?.defaultTarget),i=A.$defs||A.definitions||{},n={version:g,defs:i,refs:new Map,processing:new Set,rootSchema:A,registry:t?.registry??xt};return Ig(A,n)}var tA,NbA;var V2=r(()=>{Gc();Xr();fc();zc();tA={...Oc,...Hr,iso:Uo},NbA=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 qc={};dn(qc,{string:()=>LbA,number:()=>FbA,date:()=>kbA,boolean:()=>MbA,bigint:()=>YbA});function LbA(A){return MS(lI,A)}function FbA(A){return RS(UI,A)}function MbA(A){return ZS(SI,A)}function YbA(A){return HS(LI,A)}function kbA(A){return tL(Hc,A)}var H2=r(()=>{sg();zc()});var Q={};dn(Q,{xor:()=>b2,xid:()=>j1,void:()=>y2,uuidv7:()=>v1,uuidv6:()=>z1,uuidv4:()=>O1,uuid:()=>f1,util:()=>_,url:()=>pr,uppercase:()=>II,unknown:()=>Qt,union:()=>It,undefined:()=>r2,ulid:()=>X1,uint64:()=>E2,uint32:()=>B2,tuple:()=>MF,trim:()=>aI,treeifyError:()=>yN,transform:()=>Dy,toUpperCase:()=>yI,toLowerCase:()=>rI,toJSONSchema:()=>Vr,templateLiteral:()=>G2,symbol:()=>a2,superRefine:()=>pF,success:()=>Y2,stringbool:()=>z2,stringFormat:()=>n2,string:()=>F,strictObject:()=>u2,startsWith:()=>BI,slugify:()=>wI,size:()=>$e,setErrorMap:()=>bbA,set:()=>S2,safeParseAsync:()=>iF,safeParse:()=>nF,safeEncodeAsync:()=>cF,safeEncode:()=>hF,safeDecodeAsync:()=>CF,safeDecode:()=>BF,registry:()=>ar,regexes:()=>rn,regex:()=>eI,refine:()=>dF,record:()=>pA,readonly:()=>jF,property:()=>vr,promise:()=>T2,prettifyError:()=>wN,preprocess:()=>sc,prefault:()=>vF,positive:()=>Rr,pipe:()=>Wc,partialRecord:()=>l2,parseAsync:()=>gF,parse:()=>tF,overwrite:()=>fn,optional:()=>Bt,object:()=>p,number:()=>vA,nullish:()=>M2,nullable:()=>mc,null:()=>Vc,normalize:()=>EI,nonpositive:()=>Or,nonoptional:()=>mF,nonnegative:()=>zr,never:()=>wy,negative:()=>fr,nativeEnum:()=>L2,nanoid:()=>Z1,nan:()=>k2,multipleOf:()=>Do,minSize:()=>ii,minLength:()=>Oi,mime:()=>CI,meta:()=>f2,maxSize:()=>uo,maxLength:()=>Ge,map:()=>U2,mac:()=>x1,lte:()=>xg,lt:()=>gi,lowercase:()=>QI,looseRecord:()=>N2,looseObject:()=>Mt,locales:()=>$c,literal:()=>QA,length:()=>Te,lazy:()=>xF,ksuid:()=>K1,keyof:()=>D2,jwt:()=>g2,json:()=>v2,iso:()=>Uo,ipv6:()=>s1,ipv4:()=>_1,intersection:()=>FI,int64:()=>C2,int32:()=>h2,int:()=>sr,instanceof:()=>O2,includes:()=>hI,httpUrl:()=>m1,hostname:()=>i2,hex:()=>o2,hash:()=>e2,guid:()=>R1,gte:()=>Dg,gt:()=>ni,globalRegistry:()=>xt,getErrorMap:()=>lbA,function:()=>J2,fromJSONSchema:()=>Z2,formatError:()=>uc,float64:()=>I2,float32:()=>Q2,flattenError:()=>Dc,file:()=>F2,exactOptional:()=>PF,enum:()=>st,endsWith:()=>cI,encodeAsync:()=>QF,encode:()=>oF,emoji:()=>W1,email:()=>P1,e164:()=>t2,discriminatedUnion:()=>Kc,describe:()=>R2,decodeAsync:()=>IF,decode:()=>eF,date:()=>w2,custom:()=>Uy,cuid2:()=>H1,cuid:()=>V1,core:()=>zi,config:()=>Ft,coerce:()=>qc,codec:()=>$2,clone:()=>wg,cidrv6:()=>d1,cidrv4:()=>q1,check:()=>P2,catch:()=>VF,boolean:()=>qA,bigint:()=>c2,base64url:()=>A2,base64:()=>p1,array:()=>q,any:()=>yy,_function:()=>J2,_default:()=>OF,_ZodString:()=>qr,ZodXor:()=>UF,ZodXID:()=>oy,ZodVoid:()=>lF,ZodUnknown:()=>uF,ZodUnion:()=>jc,ZodUndefined:()=>yF,ZodUUID:()=>oi,ZodURL:()=>Zc,ZodULID:()=>iy,ZodType:()=>kA,ZodTuple:()=>FF,ZodTransform:()=>TF,ZodTemplateLiteral:()=>KF,ZodSymbol:()=>rF,ZodSuccess:()=>WF,ZodStringFormat:()=>et,ZodString:()=>lI,ZodSet:()=>kF,ZodRecord:()=>_c,ZodRealError:()=>Gg,ZodReadonly:()=>XF,ZodPromise:()=>sF,ZodPrefault:()=>zF,ZodPipe:()=>ly,ZodOptional:()=>uy,ZodObject:()=>Xc,ZodNumberFormat:()=>Je,ZodNumber:()=>UI,ZodNullable:()=>RF,ZodNull:()=>wF,ZodNonOptional:()=>by,ZodNever:()=>bF,ZodNanoID:()=>ty,ZodNaN:()=>HF,ZodMap:()=>YF,ZodMAC:()=>aF,ZodLiteral:()=>$F,ZodLazy:()=>_F,ZodKSUID:()=>ey,ZodJWT:()=>ay,ZodIssueCode:()=>tM,ZodIntersection:()=>LF,ZodISOTime:()=>_r,ZodISODuration:()=>xr,ZodISODateTime:()=>jr,ZodISODate:()=>Kr,ZodIPv6:()=>Iy,ZodIPv4:()=>Qy,ZodGUID:()=>vc,ZodFunction:()=>qF,ZodFirstPartyTypeKind:()=>AM,ZodFile:()=>GF,ZodExactOptional:()=>JF,ZodError:()=>DbA,ZodEnum:()=>bI,ZodEmoji:()=>Ay,ZodEmail:()=>dr,ZodE164:()=>Ey,ZodDiscriminatedUnion:()=>SF,ZodDefault:()=>fF,ZodDate:()=>Hc,ZodCustomStringFormat:()=>NI,ZodCustom:()=>xc,ZodCodec:()=>Ny,ZodCatch:()=>ZF,ZodCUID2:()=>ny,ZodCUID:()=>gy,ZodCIDRv6:()=>By,ZodCIDRv4:()=>hy,ZodBoolean:()=>SI,ZodBigIntFormat:()=>ry,ZodBigInt:()=>LI,ZodBase64URL:()=>Cy,ZodBase64:()=>cy,ZodArray:()=>NF,ZodAny:()=>DF,TimePrecision:()=>kS,NEVER:()=>Bc,$output:()=>US,$input:()=>SS,$brand:()=>eN});var Sy=r(()=>{sg();sg();RU();sg();Rc();V2();NS();fc();fc();H2();zc();Xr();AF();EF();m2();Ft(Fc())});var JA=r(()=>{Sy();Sy()});var X2,j2,K2,_2,x2,s2,q2,d2,p2,Am,tm,gm,nm,gM,$bA,nM,im,GbA,iM="cursor",oM="GET",eM="control",QM="[DONE]";var om=r(()=>{JA();X2=Q.object({type:Q.literal("run_started"),runId:Q.string().describe("Server-assigned run ID for the started run.")}),j2=Q.object({type:Q.literal("message_started"),messageId:Q.string().describe("Server-assigned assistant message ID for this run.")}),K2=Q.object({type:Q.literal("text_chunk"),messageId:Q.string().describe("Assistant message the chunk belongs to."),content:Q.string().describe("Incremental text delta to append.")}),_2=Q.object({type:Q.literal("reasoning_chunk"),messageId:Q.string().describe("Assistant message the chunk belongs to."),content:Q.string().describe("Incremental reasoning delta to append.")}),x2=Q.object({type:Q.literal("text_complete"),messageId:Q.string().describe("Assistant message that completed."),content:Q.string().describe("Full assistant text for the message.")}),s2=Q.object({type:Q.literal("reasoning_complete"),messageId:Q.string().describe("Assistant message that completed."),content:Q.string().describe("Full reasoning text for the message.")}),q2=Q.object({type:Q.literal("tool_call_pending"),toolCallId:Q.string().describe("Stable identifier for the tool call."),name:Q.string().describe("Name of the tool being called.")}),d2=Q.object({type:Q.literal("tool_call_start"),toolCallId:Q.string().describe("Stable identifier for the tool call."),name:Q.string().describe("Name of the tool being called."),params:Q.unknown().describe("Resolved tool input params.")}),p2=Q.object({type:Q.literal("tool_call_complete"),toolCallId:Q.string().describe("Stable identifier for the tool call."),status:Q.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:Q.unknown().optional().describe("Tool output, when available."),durationMs:Q.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),Am=Q.object({type:Q.literal("artifact"),name:Q.string().describe("Artifact kind (for example table, timeseries)."),data:Q.unknown().describe("Artifact payload; shape depends on name."),toolCallId:Q.string().describe("Tool call that produced the artifact.")}),tm=Q.object({type:Q.literal("error"),message:Q.string().describe("Human-readable error message."),name:Q.string().optional().describe("Optional error class/name.")}),gm=Q.object({type:Q.literal("stream_reset"),messageId:Q.string().describe("Assistant message whose content to reset.")}),nm=Q.object({type:Q.literal("disconnected")}),gM=Q.discriminatedUnion("type",[X2,j2,K2,_2,x2,s2,q2,d2,p2,Am,tm,gm,nm]),$bA=Q.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),nM=Q.object({streamNextOffset:Q.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),im=Q.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),GbA=Q.object({cursor:im.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var S=(A)=>{let t={operationId:A.operationId,backend:A.backend,pagination:A.pagination,async:A.async,examples:A.examples??[]};return{...A,contract:sz.$meta(t).route({method:A.route.method,path:A.route.path,tags:A.route.tags,operationId:A.operationId,summary:A.summary,description:A.description,successStatus:A.route.successStatus,successDescription:A.route.successDescription,deprecated:A.route.deprecated,inputStructure:A.route.inputStructure}).input(A.input).output(A.output)}};var em=r(()=>{gN()});var Qm=r(()=>{em()});var KA=r(()=>{Qm()});var pc,hm,Bm,cm,Cm,Em,am,rm,ym,wm,TbA,cM,Dm,Ly,Fy,MI,My,Yy,um,bm,ky,lm,Nm,YI,IM,JbA,Um,Sm,Lm,PbA,Fm,Mm,Ym,CM,km,$m,Gm,$y,Gy,Ty,Jy,AC,Tm,hM,Jm,tC,EM,Pm,Rm,RbA,fbA,aM,fm,Om,zm,vm,mm,Wm,Zm,rM,Py,Ry,fy,Oy,yM,Vm,BM,dc,wM,ObA,zy,Hm,Xm,jm,Km,Im,_m,xm,sm,vy,my,qm,DM,dm,pm,AW,tW,gW,Wy,Zy,zbA;var uM=r(()=>{JA();KA();pc=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),description:Q.string().nullable(),origin:Q.enum(["user_declared","code_detected","log_observed"]),lifecycle:Q.enum(["active","retired","merged"]),observationState:Q.enum(["observed","stale","unobserved"]),registryRevision:Q.number().int().nonnegative(),canonicalComponentId:Q.string().uuid(),mergedIntoComponentId:Q.string().uuid().nullable(),currentStatus:Q.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:Q.string().datetime(),lastSeenAt:Q.string().datetime(),deletedAt:Q.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:Q.string().datetime().nullable(),retirementReason:Q.string().nullable(),legacyStateUnknown:Q.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),hm=Q.object({projectId:Q.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),Bm=Q.object({components:Q.array(pc),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cm=Q.object({componentId:Q.string().uuid().describe("Component ID to retrieve.")}),Cm=Q.object({component:pc}),Em=Q.object({projectId:Q.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:Q.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:Q.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:Q.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),am=Q.object({component:pc}),rm=Q.object({componentId:Q.string().uuid().describe("Active component ID to rename."),name:Q.string().trim().min(1,"Name is required"),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),ym=Q.object({component:pc}),wm=Q.object({componentId:Q.string().uuid().describe("Component ID to deregister."),reason:Q.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),TbA=Q.object({openIssueIds:Q.array(Q.string().uuid()),activeComponentIssueIds:Q.array(Q.string().uuid()),automationBindingIds:Q.array(Q.string().uuid()),notificationRuleIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),observationIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid()),externalIncidentIds:Q.array(Q.string().uuid()),authorizedDeliveryIds:Q.array(Q.string().uuid()),authorizedAutomationRunIds:Q.array(Q.string().uuid())}),cM=Q.object({requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),canonicalComponentName:Q.string(),lifecycle:Q.enum(["active","retired"]),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),requiresCanonicalGroupConfirmation:Q.boolean(),recommendationScopeEnabled:Q.literal(!1),dependents:TbA,counts:Q.record(Q.string(),Q.number().int().nonnegative())}),Dm=Q.discriminatedUnion("status",[Q.object({status:Q.literal("observation_withdrawn"),componentId:Q.string().uuid(),sourceType:Q.literal("secret_key"),withdrawn:Q.boolean()}),Q.object({status:Q.literal("retirement_confirmation_required"),preview:cM})]),Ly=S({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:hm,output:Bm,pagination:"cursor",async:"sync"}),Fy=S({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:cm,output:Cm,pagination:"none",async:"sync"}),MI=S({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:Em,output:am,pagination:"none",async:"sync"}),My=S({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:wm,output:Dm,pagination:"none",async:"sync"}),Yy=S({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:rm,output:ym,pagination:"none",async:"sync"}),um=Q.object({componentId:Q.string().uuid().describe("Component whose owning team to set."),teamId:Q.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),bm=Q.object({componentId:Q.string().uuid().describe("Component that was updated."),teamId:Q.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),ky=S({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:um,output:bm,pagination:"none",async:"sync"}),lm=Q.object({componentId:Q.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),Nm=Q.object({preview:cM}),YI=Q.record(Q.string().uuid(),Q.number().int().nonnegative()),IM=Q.object({id:Q.string().uuid(),rowRevision:Q.number().int().nonnegative()}),JbA=Q.object({notificationRules:Q.array(IM),automationBindings:Q.array(IM),relationships:Q.array(IM)}),Um=Q.object({componentId:Q.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:YI.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:Q.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),Sm=Q.object({operationId:Q.string().uuid(),status:Q.enum(["committed","complete","followup_failed"]),requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),counts:Q.record(Q.string(),Q.number().int().nonnegative()),authorizedDeliveryIds:Q.array(Q.string().uuid()),authorizedAutomationRunIds:Q.array(Q.string().uuid()),manualExternalIncidentIds:Q.array(Q.string().uuid()),issueAutomationSuppressions:Q.number().int().nonnegative(),outboxEffectCount:Q.number().int().nonnegative(),manifest:JbA,followups:Q.record(Q.string(),Q.unknown()).optional()}),Lm=Q.object({result:Sm}),PbA=Q.object({notificationRuleIds:Q.array(Q.string().uuid()),automationBindingIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid())}),Fm=Q.object({componentId:Q.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:Q.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),Mm=Q.object({requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),canonicalComponentName:Q.string(),retirementOperationId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:YI,eligible:PbA}),Ym=Q.object({preview:Mm}),CM=Q.object({notificationRuleIds:Q.array(Q.string().uuid()).default([]),automationBindingIds:Q.array(Q.string().uuid()).default([]),recommendationScopeIds:Q.array(Q.string().uuid()).default([]),relationshipIds:Q.array(Q.string().uuid()).default([])}),km=Q.object({componentId:Q.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:Q.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:YI.describe("Exact canonical-group revisions returned by restorationPreview."),selections:CM.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),$m=Q.object({operationId:Q.string().uuid(),status:Q.literal("complete"),requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),restored:CM}),Gm=Q.object({result:$m}),$y=S({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:lm,output:Nm,pagination:"none",async:"sync"}),Gy=S({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:Um,output:Lm,pagination:"none",async:"sync"}),Ty=S({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:Fm,output:Ym,pagination:"none",async:"sync"}),Jy=S({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:km,output:Gm,pagination:"none",async:"sync"}),AC=Q.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),Tm=Q.enum(["observed","stale","unobserved"]),hM=Q.object({originalComponentId:Q.string().uuid(),effectiveComponentId:Q.string().uuid(),name:Q.string(),lifecycle:Q.enum(["active","retired","merged"]),observationState:Tm}),Jm=Q.object({id:Q.string().uuid(),source:hM,target:hM,relationshipType:AC,createdAt:Q.string().datetime(),endedAt:Q.string().datetime().nullable(),endReason:Q.string().nullable(),rowRevision:Q.number().int().nonnegative()}),tC=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),EM=Q.object({sourceComponentId:Q.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:Q.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:AC}),Pm=tC.extend({includeHistorical:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("Include historically ended relationships.")}),Rm=Q.object({relationships:Q.array(Jm)}),RbA=Q.object({ruleId:Q.string().uuid(),ruleGroupId:Q.string().uuid().nullable(),ownerComponentId:Q.string().uuid(),destinationIds:Q.array(Q.string().uuid()),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),fbA=Q.object({bindingId:Q.string().uuid(),automationId:Q.string().uuid(),ownerComponentId:Q.string().uuid(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),aM=Q.object({notificationRules:Q.array(RbA),automationBindings:Q.array(fbA)}),fm=EM.extend({action:Q.enum(["add","remove"]),organizationId:Q.string(),projectId:Q.string().uuid(),relationshipId:Q.string().uuid().nullable(),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),policyImpact:aM,confirmationRequired:Q.boolean()}),Om=tC.merge(EM).extend({action:Q.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),zm=Q.object({preview:fm}),vm=tC.merge(EM).extend({requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:Q.string().trim().min(1,"Reason cannot be empty"),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),confirmPolicyImpact:Q.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),mm=vm,Wm=vm,Zm=Q.object({action:Q.enum(["add","remove"]),relationshipId:Q.string().uuid(),sourceComponentId:Q.string().uuid(),targetComponentId:Q.string().uuid(),relationshipType:AC,policyImpact:aM}),rM=Q.object({result:Zm}),Py=S({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:Pm,output:Rm,pagination:"none",async:"sync"}),Ry=S({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:Om,output:zm,pagination:"none",async:"sync"}),fy=S({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:mm,output:rM,pagination:"none",async:"sync"}),Oy=S({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:Wm,output:rM,pagination:"none",async:"sync"}),yM=Q.enum(["suspend","move"]),Vm=Q.object({disposition:yM,beforeComponentIds:Q.array(Q.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:Q.array(Q.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),BM=Q.object({kind:Q.enum(["notification_rule","automation_binding"]),policyId:Q.string().uuid(),sourceRowRevision:Q.number().int().nonnegative(),sourceComponentId:Q.string().uuid(),equivalentPolicyId:Q.string().uuid().nullable(),equivalent:Q.boolean(),defaultDisposition:Q.enum(["deduplicate","suspend"]),allowedDispositions:Q.array(yM),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),dc=Q.object({kind:Q.enum(["notification_rule","automation_binding"]),policyId:Q.string().uuid(),ownerComponentId:Q.string().uuid(),rowRevision:Q.number().int().nonnegative(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),wM=Q.object({relationshipId:Q.string().uuid(),action:Q.enum(["rewire","close_self","close_duplicate"]),relationshipType:AC,beforeSourceComponentId:Q.string().uuid(),beforeTargetComponentId:Q.string().uuid(),afterSourceComponentId:Q.string().uuid(),afterTargetComponentId:Q.string().uuid(),survivingRelationshipId:Q.string().uuid().nullable(),beforeRowRevision:Q.number().int().nonnegative(),afterRowRevision:Q.number().int().nonnegative().nullable()}),ObA=Q.object({openIssueIds:Q.array(Q.string().uuid()),componentIssueIds:Q.array(Q.string().uuid()),observationIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),nameIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid())}),zy=Q.object({sourceComponentId:Q.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:Q.string().uuid().describe("Active terminal component that becomes the canonical target.")}),Hm=tC.merge(zy),Xm=zy.extend({organizationId:Q.string(),projectId:Q.string().uuid(),sourceGroupComponentIds:Q.array(Q.string().uuid()),targetGroupComponentIds:Q.array(Q.string().uuid()),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:YI,inventory:ObA,notificationPolicies:Q.array(BM),automationBindings:Q.array(BM),notificationScopeChanges:Q.array(dc),automationScopeChanges:Q.array(dc),relationshipChanges:Q.array(wM),recommendationScopeEnabled:Q.literal(!1),dependentCount:Q.number().int().nonnegative(),ordinaryTransactionLimit:Q.number().int().positive(),operatorAssistanceRequired:Q.boolean(),confirmationRequired:Q.boolean()}),jm=Q.object({preview:Xm}),Km=tC.merge(zy).extend({requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:YI.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:Q.record(Q.string().uuid(),Vm).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:Q.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),Im=Q.object({policyId:Q.string().uuid(),action:Q.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:Q.string().uuid().nullable(),beforeRowRevision:Q.number().int().nonnegative(),afterRowRevision:Q.number().int().nonnegative(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),_m=Q.object({componentRevisions:YI,redirectedComponentIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),movedAliasIds:Q.array(Q.string().uuid()),historicalDisplayIds:Q.array(Q.string().uuid()),relationshipChanges:Q.array(wM),notificationPolicies:Q.array(Im),automationBindings:Q.array(Im),notificationScopeChanges:Q.array(dc),automationScopeChanges:Q.array(dc),recommendationScopeIds:Q.array(Q.string().uuid())}),xm=zy.extend({operationId:Q.string().uuid(),status:Q.literal("complete"),affectedComponentIds:Q.array(Q.string().uuid()),manifest:_m}),sm=Q.object({result:xm}),vy=S({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:Hm,output:jm,pagination:"none",async:"sync"}),my=S({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:Km,output:sm,pagination:"none",async:"sync"}),qm=Q.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),DM=Q.object({id:Q.string().uuid(),componentId:Q.string().uuid(),projectId:Q.string().uuid(),severity:qm,summary:Q.string().describe("Human-readable summary of the status-page issue."),startedAt:Q.string().datetime().describe("When the incident began affecting the component."),resolvedAt:Q.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),dm=Q.object({projectId:Q.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:Q.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),pm=Q.object({incidents:Q.array(DM),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AW=Q.object({timestamp:Q.string().datetime(),status:Q.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),tW=Q.object({componentId:Q.string().uuid().describe("Component to build the timeline for."),windowStart:Q.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:Q.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),gW=Q.object({componentId:Q.string().uuid(),windowStart:Q.string().datetime(),windowEnd:Q.string().datetime(),timeline:Q.array(AW),incidents:Q.array(DM)}),Wy=S({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:dm,output:pm,pagination:"cursor",async:"sync"}),Zy=S({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:tW,output:gW,pagination:"none",async:"sync"}),zbA={list:Ly.contract,get:Fy.contract,register:MI.contract,deregister:My.contract,rename:Yy.contract,assignTeam:ky.contract,retirementPreview:$y.contract,retire:Gy.contract,restorationPreview:Ty.contract,restore:Jy.contract,mergePreview:vy.contract,merge:my.contract,relationships:{list:Py.contract,preview:Ry.contract,add:fy.contract,remove:Oy.contract},incidents:{list:Wy.contract},timeline:Zy.contract}});var Vy,bM,nW,iW,lM,oW,eW,QW,NM,IW,hW,BW,UM,cW,CW,SM;var LM=r(()=>{JA();KA();Vy=["github","google","microsoft","linear","bitbucket","slack"],bM=Q.enum(Vy),nW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted."),provider:bM.describe("Connected-account provider to connect.")}),iW=Q.object({url:Q.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:Q.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:Q.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),lM=S({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:nW,output:iW,pagination:"none",async:"sync"}),oW=Q.enum(["pending","completed","failed","expired"]),eW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:Q.string().uuid().describe("Connect attempt ID to poll.")}),QW=Q.object({status:oW.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:Q.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),NM=S({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:eW,output:QW,pagination:"none",async:"sync"}),IW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted.")}),hW=Q.object({provider:Q.string().describe("Provider identifier."),externalName:Q.string().nullable().describe("Display name from the provider."),externalLogin:Q.string().nullable().describe("Username or login from the provider."),connectedAt:Q.string().datetime().nullable().describe("When the account was connected."),authMode:Q.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:Q.boolean().describe("Whether the token is expired and a reconnect is required.")}),BW=Q.object({accounts:Q.array(hW)}),UM=S({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:IW,output:BW,pagination:"none",async:"sync"}),cW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted."),provider:bM.describe("Provider to disconnect.")}),CW=Q.object({success:Q.literal(!0)}),SM=S({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:cW,output:CW,pagination:"none",async:"sync"})});var Pe,FM,EW,aW,vbA,mbA,WbA,rW,gC,ZbA,VbA,HbA,XbA,jbA,KbA,_bA,xbA,sbA,qbA,dbA,pbA,MM,YM,kM,$M,GM,TM,AlA,tlA,glA,nlA,JM,PM,ilA,olA,elA,QlA,RM,Eht;var yW=r(()=>{JA();KA();Pe=Q.string().uuid().describe("Automation ID."),FM=Q.enum(["running","succeeded","failed","timed_out","cancelled"]),EW=Q.object({id:Q.string().uuid(),automationRunKey:Q.string(),status:FM,startedAt:Q.string().datetime(),completedAt:Q.string().datetime().nullable(),durationMs:Q.number().int().nullable(),exitCode:Q.number().int().nullable()}),aW=EW.extend({scheduledAt:Q.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:Q.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:Q.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),vbA=aW.extend({automationId:Q.string().uuid().describe("Automation that owns this run.")}),mbA=Q.enum(["script","log_match"]),WbA=Q.enum(["expression_matched"]),rW=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),kind:mbA.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:Q.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:Q.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),logMatchExpressionId:Q.string().uuid().nullable().describe("Log-match expression bound to this automation. Null for script automations."),signalType:WbA.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:Q.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:Q.boolean(),cronExpression:Q.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:Q.string(),timeoutSeconds:Q.number().int().nullable(),health:Q.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:EW.nullable(),successRate:Q.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:Q.number().int().describe("Total runs over the last 7 days."),failedRunCount:Q.number().int().describe("Failed or timed-out runs over the last 7 days.")}),gC=rW.extend({createdAt:Q.string().datetime(),updatedAt:Q.string().datetime(),recordedHistoryStartsAt:Q.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:Q.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:Q.boolean().describe("Whether the caller may enable or disable this automation.")}),ZbA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:Q.string().optional().describe("Case-insensitive partial match on automation name."),status:Q.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:Q.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:Q.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:Q.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),VbA=Q.object({automations:Q.array(rW),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),HbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),XbA=Q.object({automation:gC}),jbA=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().min(1).max(200).describe("Automation name."),description:Q.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:Q.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:Q.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:Q.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:Q.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:Q.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:Q.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:Q.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((A,t)=>{let g=A.scriptId!=null,i=A.script!=null,n=A.expressionId!=null;if(Number(g)+Number(i)+Number(n)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(n){if(A.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(A.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(A.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!A.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),KbA=Q.object({automation:gC}),_bA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:Q.string().min(1).max(200).optional().describe("New automation name."),description:Q.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:Q.string().optional().describe("New cron schedule."),timezone:Q.string().optional().describe("New IANA timezone."),timeoutSeconds:Q.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),xbA=Q.object({automation:gC}),sbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),qbA=Q.object({automation:gC}),dbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),pbA=Q.object({automation:gC}),MM=S({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:ZbA,output:VbA,pagination:"cursor",async:"sync"}),YM=S({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:HbA,output:XbA,pagination:"none",async:"sync"}),kM=S({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a log-match investigation bound to an expression (see logMatchExpressions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:jbA,output:KbA,pagination:"none",async:"sync"}),$M=S({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:_bA,output:xbA,pagination:"none",async:"sync"}),GM=S({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:sbA,output:qbA,pagination:"none",async:"sync"}),TM=S({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:dbA,output:pbA,pagination:"none",async:"sync"}),AlA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:Q.union([FM,Q.array(FM)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),tlA=Q.object({runs:Q.array(aW),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:Q.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),glA=Q.object({automationId:Pe,runId:Q.string().uuid().describe("Automation run ID."),projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),nlA=Q.object({run:vbA}),JM=S({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:AlA,output:tlA,pagination:"cursor",async:"sync"}),PM=S({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:glA,output:nlA,pagination:"none",async:"sync"}),ilA=Q.enum(["queued","running","succeeded","failed","timed_out"]),olA=Q.object({stdout:Q.string().describe("Captured standard output for the run."),stderr:Q.string().describe("Captured standard error for the run."),exitCode:Q.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:ilA.describe("Execution status of the run's captured command."),truncated:Q.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:Q.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:Q.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:Q.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),elA=Q.object({automationId:Pe,runId:Q.string().uuid().describe("Automation run ID."),projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),QlA=Q.object({logs:olA}),RM=S({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:elA,output:QlA,pagination:"none",async:"sync"}),Eht={list:MM.contract,get:YM.contract,create:kM.contract,update:$M.contract,enable:GM.contract,disable:TM.contract,runs:{list:JM.contract,get:PM.contract,logs:RM.contract}}});var IlA,hlA,wW,BlA,clA,ClA,ElA,alA,rlA,ylA,wlA,DlA,ulA,blA,llA,NlA,UlA,OM,zM,vM,mM,ei,DW,fM,WM,SlA,uW,LlA,FlA,MlA,YlA,klA,$lA,GlA,TlA,JlA,PlA,RlA,flA,OlA,zlA,vlA,mlA,WlA,ZlA,ZM,VM,HM,XM,jM,KM,_M,xM,sM,qM,wht;var bW=r(()=>{JA();KA();IlA=Q.enum(["logs_ingested_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),hlA=Q.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),wW=Q.object({startsAt:Q.string().datetime(),endsAt:Q.string().datetime(),billableStartsAt:Q.string().datetime()}),BlA=Q.object({subscriptionChargeAmount:Q.string(),creditDeficitAmount:Q.string(),creditDeficitChargeAmount:Q.string(),totalAmount:Q.string(),currency:Q.string()}),clA=Q.object({billingSubscriptionChangeId:Q.string(),effectiveAt:Q.string().datetime(),planSlug:Q.string().nullable(),planName:Q.string().nullable(),price:Q.string().nullable(),currency:Q.string().nullable(),targetCreditBalance:Q.string().nullable()}),ClA=Q.object({id:Q.string(),status:Q.string(),billingPlanId:Q.string(),priceBookId:Q.string(),cycleType:Q.string()}),ElA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted.")}),alA=Q.object({status:Q.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:Q.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:Q.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:Q.string().nullable(),scheduledAttemptsMade:Q.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:Q.string().datetime().nullable(),billingInvoiceId:Q.string().nullable(),hostedInvoiceUrl:Q.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),rlA=Q.object({billingModel:Q.enum(["credit-balance-v1"]),billable:Q.boolean(),nonBillableReason:Q.string().nullable(),status:Q.string(),planName:Q.string().nullable(),planSlug:Q.string().nullable(),currency:Q.string().nullable(),currentBalance:Q.string().nullable(),targetCreditBalance:Q.string().nullable(),currentCycle:wW.nullable(),currentPeriodEstimate:BlA.nullable(),pendingDowngrade:clA.nullable(),subscription:ClA.nullable(),collection:alA}),ylA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted."),cycle:Q.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),wlA=Q.object({dimension:IlA,totalQuantity:Q.string(),ratedQuantity:Q.string(),creditsConsumed:Q.string(),sourceBreakdown:Q.record(Q.string(),Q.string())}),DlA=Q.object({cycle:wW.nullable(),usage:Q.array(wlA)}),ulA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:Q.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),blA=Q.object({id:Q.string(),transactionType:hlA,creditDelta:Q.string(),balanceAfter:Q.string(),occurredAt:Q.string().datetime(),billingInvoiceId:Q.string().nullable()}),llA=Q.object({items:Q.array(blA),pagination:Q.object({page:Q.number(),limit:Q.number(),total:Q.number(),totalPages:Q.number(),hasNext:Q.boolean(),hasPrev:Q.boolean()}).describe("Pagination metadata for the transaction list.")}),NlA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization whose outstanding balance to retry. Auto-filled from CLI and SDK context when omitted."),idempotencyKey:Q.string().uuid().describe("Client-generated UUID. Repeating a request with the same key returns the retry already in flight instead of charging again.")}),UlA=Q.object({accepted:Q.literal(!0),workflowId:Q.string().describe("Durable retry execution id; poll `billing.getSummary` for the outcome."),runId:Q.string()}),OM=S({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:ElA,output:rlA,pagination:"none",async:"sync"}),zM=S({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:ylA,output:DlA,pagination:"none",async:"sync"}),vM=S({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:ulA,output:llA,pagination:"page",async:"sync"}),mM=S({operationId:"billing.retryOutstandingBalance",description:"Re-attempt payment of the organization's outstanding negative-balance settlement invoice with the saved payment method. Requires `billing:manage` for user credentials or an organization-scoped API key. Poll `billing.getSummary` (`collection`) for the outcome.",backend:"api",route:{method:"POST",path:"/billing/outstanding-balance/retry",tags:["Billing"]},input:NlA,output:UlA,pagination:"none",async:"sync"}),ei=Q.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),DW=Q.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),fM=DW.refine((A)=>{let[,t=""]=A.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places"),WM=Q.string().trim().min(1).max(100),SlA=Q.object({organizationId:ei}),uW=Q.object({supported:Q.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:Q.boolean(),triggerCreditBalance:Q.string(),topUpAmount:Q.string(),cycleSpendingLimit:Q.string(),currency:Q.string(),creditsToGrant:Q.string().nullable(),status:Q.string()}),LlA=Q.object({organizationId:ei,enabled:Q.boolean(),triggerCreditBalance:DW,topUpAmount:fM,cycleSpendingLimit:fM}),FlA=Q.object({organizationId:ei,amount:fM.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:Q.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),MlA=Q.object({status:Q.enum(["paid","pending_payment","failed"]),billingInvoiceId:Q.string(),topUpAmount:Q.string(),creditsToGrant:Q.string(),currency:Q.string()}),YlA=Q.object({organizationId:ei}),klA=Q.object({slug:Q.string(),billingModel:Q.string(),name:Q.string(),description:Q.string(),bestFor:Q.string().nullable(),price:Q.string(),currency:Q.string(),targetCreditBalance:Q.string().nullable(),logsIncludedBytes:Q.string(),inputTokensIncluded:Q.string(),outputTokensIncluded:Q.string()}),$lA=Q.object({billingModel:Q.string(),currentPlanSlug:Q.string().nullable(),hasActiveStripeBilling:Q.boolean(),plans:Q.array(klA)}),GlA=Q.object({organizationId:ei,planSlug:WM}),TlA=Q.object({type:Q.enum(["upgrade","downgrade"]),effectiveAt:Q.string().datetime(),currency:Q.string(),currentPlanSlug:Q.string(),targetPlanSlug:Q.string(),currentPlanName:Q.string(),targetPlanName:Q.string(),currentPlanPrice:Q.string(),targetPlanPrice:Q.string(),currentTargetCreditBalance:Q.string(),targetCreditBalance:Q.string(),creditDeficitAmount:Q.string(),creditDeficitChargeAmount:Q.string(),additionalCreditPrice:Q.string(),immediateChargeAmount:Q.string(),subscriptionChargeAmount:Q.string(),proratedCreditGrantAmount:Q.string(),remainingCycleFraction:Q.string(),nextCycleChargeAmount:Q.string()}),JlA=Q.object({organizationId:ei,planSlug:WM}),PlA=Q.object({billingSubscriptionChangeId:Q.string(),billingSubscriptionId:Q.string(),status:Q.string(),type:Q.string(),effectiveAt:Q.string().datetime(),invoiceId:Q.string().nullable(),creditDeficitAmount:Q.string().optional(),creditDeficitChargeAmount:Q.string().optional(),creditTopUpAmount:Q.string().optional(),immediateChargeAmount:Q.string().optional(),subscriptionChargeAmount:Q.string().optional(),proratedCreditGrantAmount:Q.string().optional()}),RlA=Q.object({organizationId:ei,planSlug:WM}),flA=Q.object({sessionId:Q.string(),checkoutUrl:Q.string().url()}),OlA=Q.object({organizationId:ei,sessionId:Q.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),zlA=Q.object({status:Q.enum(["pending","active","expired"])}),vlA=Q.object({organizationId:ei}),mlA=Q.object({portalUrl:Q.string().url()}),WlA=Q.object({organizationId:ei}),ZlA=Q.object({hasPaymentMethod:Q.boolean(),brand:Q.string().nullable(),last4:Q.string().nullable(),display:Q.string().nullable()}),ZM=S({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:SlA,output:uW,pagination:"none",async:"sync"}),VM=S({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:LlA,output:uW,pagination:"none",async:"sync"}),HM=S({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:FlA,output:MlA,pagination:"none",async:"sync"}),XM=S({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:YlA,output:$lA,pagination:"none",async:"sync"}),jM=S({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:GlA,output:TlA,pagination:"none",async:"sync"}),KM=S({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:JlA,output:PlA,pagination:"none",async:"sync"}),_M=S({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:RlA,output:flA,pagination:"none",async:"sync"}),xM=S({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:OlA,output:zlA,pagination:"none",async:"sync"}),sM=S({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:vlA,output:mlA,pagination:"none",async:"sync"}),qM=S({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:WlA,output:ZlA,pagination:"none",async:"sync"}),wht={getSummary:OM.contract,getUsage:zM.contract,listTransactions:vM.contract,retryOutstandingBalance:mM.contract,getAutoTopUp:ZM.contract,updateAutoTopUp:VM.contract,purchaseCredits:HM.contract,listPlans:XM.contract,previewPlanChange:jM.contract,changePlan:KM.contract,createCheckoutSession:_M.contract,getCheckoutSessionStatus:xM.contract,createPortalSession:sM.contract,getPaymentMethod:qM.contract}});var VlA,nC,HlA,XlA,jlA,KlA,_lA,xlA,iC,lW,slA,qlA,NW,dlA,plA,UW,ANA,tNA,SW,gNA,nNA,LW,iNA,oNA,FW,eNA,QNA,INA,MW,hNA,BNA,YW,cNA,CNA,kW,dM,$W,GW,TW,JW,PW,RW,oC,fW,ENA,OW,aNA,zW,vW,rNA,yNA,mW,wNA,WW,DNA,uNA,ZW;var VW=r(()=>{JA();KA();VlA=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],nC=Q.enum(VlA),HlA=Q.enum(["oauth","app_installation","api_key"]),XlA=Q.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),jlA=Q.enum(["pending","connected","error","revoked"]),KlA=Q.enum(["healthy","unhealthy","unknown"]),_lA=Q.object({name:Q.string().describe("Field name used as the JSON key in `credentials`."),label:Q.string().describe("Human-readable field label."),required:Q.boolean().describe("Whether the field is required."),secret:Q.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:Q.string().nullable().describe("Optional hint for the field's expected value.")}),xlA=Q.object({id:nC.describe("Integration provider identifier."),name:Q.string().describe("Human-readable display name."),description:Q.string().describe("Short description of the provider."),authType:HlA.describe("Auth flow used to connect this provider."),capabilities:Q.array(XlA).describe("Capabilities the provider exposes once connected."),connectionCount:Q.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:Q.array(_lA).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:Q.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),iC=Q.object({id:Q.string().uuid(),provider:nC,displayName:Q.string().nullable(),status:jlA,isActive:Q.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:Q.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:Q.record(Q.string(),Q.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:KlA,healthMessage:Q.string().nullable(),healthCheckedAt:Q.string().datetime().nullable(),healthConsecutiveFailures:Q.number().int(),connectedBy:Q.string().nullable(),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),lW=Q.object({organizationEnabled:Q.boolean().describe("Stored organization-wide policy."),connectionEnabled:Q.boolean().describe("Stored connection policy."),effectiveEnabled:Q.boolean().describe("True only when both stored policies are enabled.")}),slA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted.")}),qlA=Q.object({providers:Q.array(xlA)}),NW=S({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:slA,output:qlA,pagination:"none",async:"sync"}),dlA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted."),provider:nC.optional().describe("Filter connections by provider.")}),plA=Q.object({connections:Q.array(iC)}),UW=S({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:dlA,output:plA,pagination:"none",async:"sync"}),ANA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to fetch.")}),tNA=Q.object({connection:iC}),SW=S({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:ANA,output:tNA,pagination:"none",async:"sync"}),gNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:nC.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:Q.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:Q.record(Q.string(),Q.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),nNA=Q.object({connection:iC}),LW=S({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:gNA,output:nNA,pagination:"none",async:"sync"}),iNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:nC.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:Q.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:Q.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),oNA=Q.object({url:Q.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:Q.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:Q.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),FW=S({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:iNA,output:oNA,pagination:"none",async:"sync"}),eNA=Q.enum(["pending","completed","not_connected","failed","expired"]),QNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:Q.string().uuid().describe("Connect attempt ID to poll.")}),INA=Q.object({status:eNA.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:Q.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:iC.optional().describe("The created connection when status is `completed`.")}),MW=S({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:QNA,output:INA,pagination:"none",async:"sync"}),hNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to disconnect.")}),BNA=Q.object({success:Q.literal(!0)}),YW=S({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:hNA,output:BNA,pagination:"none",async:"sync"}),cNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to update."),credentials:Q.record(Q.string(),Q.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),CNA=Q.object({connection:iC}),kW=S({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:cNA,output:CNA,pagination:"none",async:"sync"}),dM=Q.object({organizationId:Q.string().min(1).optional()}),$W=Q.object({organizationEnabled:Q.boolean(),effectiveEnabled:Q.boolean()}),GW=dM.extend({connectionId:Q.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),TW=S({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:dM,output:$W,pagination:"none",async:"sync"}),JW=S({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:dM.extend({enabled:Q.boolean()}),output:$W,pagination:"none",async:"sync"}),PW=S({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:GW,output:lW,pagination:"none",async:"sync"}),RW=S({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:GW.extend({enabled:Q.boolean()}),output:lW,pagination:"none",async:"sync"}),oC=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),fW=Q.object({connectionId:Q.string().uuid(),defaultProjectId:Q.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:Q.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:Q.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),ENA=oC,OW=S({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:ENA,output:fW,pagination:"none",async:"sync"}),aNA=oC.extend({defaultProjectId:Q.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:Q.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:Q.boolean().optional().describe("Omit to leave unchanged.")}),zW=S({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:aNA,output:fW,pagination:"none",async:"sync"}),vW=Q.object({connectionId:Q.string().uuid(),slackChannelId:Q.string().min(1),slackChannelName:Q.string().min(1),projectId:Q.string().uuid()}),rNA=oC,yNA=Q.object({mappings:Q.array(vW)}),mW=S({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:rNA,output:yNA,pagination:"none",async:"sync"}),wNA=oC.extend({slackChannelId:Q.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:Q.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:Q.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),WW=S({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:wNA,output:vW,pagination:"none",async:"sync"}),DNA=oC.extend({slackChannelId:Q.string().min(1)}),uNA=Q.object({success:Q.boolean()}),ZW=S({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:DNA,output:uNA,pagination:"none",async:"sync"})});var On,bNA,lNA,HW,Hy,Xy,XW,pM,jW,AY,KW,_W,NNA,UNA,xW,sW,qW,dW,pW,A4,t4,g4,n4,i4,o4,e4,Q4,I4,h4,kI,jy,Ky,_y,xy,sy,qy,dy,py,Aw,tw,SNA;var tY=r(()=>{JA();KA();On=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),description:Q.string().nullable(),status:Q.enum(["open","resolved","ignored"]),severity:Q.enum(["low","medium","high","critical"]),componentId:Q.string().uuid().nullable(),createdAt:Q.string().datetime(),resolvedAt:Q.string().datetime().nullable(),mutedAt:Q.string().datetime().nullable(),muteHitCount:Q.number().int().nonnegative(),lastActivityAt:Q.string().datetime().nullable(),lastDeliveredAt:Q.string().datetime().nullable(),locked:Q.boolean(),redacted:Q.boolean()}),bNA=Q.object({channelId:Q.string().nullable(),channelName:Q.string().nullable(),threadTs:Q.string().nullable(),permalink:Q.string().nullable(),workspaceName:Q.string().nullable()}),lNA=On.extend({slackChannels:Q.array(bNA)}),HW=On.extend({delivery:Q.record(Q.string(),Q.unknown()).nullable().optional()}),Hy=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:Q.string().trim().min(1,"contentMdx cannot be empty").describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence)."),severity:Q.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:Q.string().uuid().describe("Required UUID of a registered component this issue belongs to. Every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:Q.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began.")}),Xy=Hy.superRefine((A,t)=>{if(A.statusStartedAt&&!A.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),XW=Q.object({issue:On,duplicateIssueId:Q.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),pM=Q.object({projectId:Q.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Q.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:Q.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:Q.string().uuid().optional().describe("Filter by component ID.")}),jW=Q.object({issues:Q.array(On),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AY=pM.extend({name:Q.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),KW=Q.object({issues:Q.array(HW),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_W=AY.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),NNA=Q.object({open:Q.number().int().nonnegative(),resolved:Q.number().int().nonnegative(),ignored:Q.number().int().nonnegative()}),UNA=Q.object({low:Q.number().int().nonnegative(),medium:Q.number().int().nonnegative(),high:Q.number().int().nonnegative(),critical:Q.number().int().nonnegative()}),xW=Q.object({total:Q.number().int().nonnegative(),byStatus:NNA,bySeverity:UNA,filters:Q.object({name:Q.string().nullable(),status:Q.enum(["open","resolved","ignored"]).nullable(),severity:Q.enum(["low","medium","high","critical"]).nullable(),componentId:Q.string().uuid().nullable()})}),sW=Q.object({issueId:Q.string().uuid().describe("Issue ID to retrieve.")}),qW=Q.object({issue:lNA}),dW=Q.object({issueId:Q.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:Q.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),pW=Q.object({issue:On}),A4=Q.object({issueId:Q.string().uuid().describe("Issue ID to ignore.")}),t4=Q.object({issue:On}),g4=Q.object({issueId:Q.string().uuid().describe("Issue ID to reopen.")}),n4=Q.object({issue:On}),i4=Q.object({issueId:Q.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:Q.string().uuid().describe("Active canonical component that will own the reopened issue.")}),o4=Q.object({issue:On,sourceComponentId:Q.string().uuid(),targetComponentId:Q.string().uuid()}),e4=Q.object({issueId:Q.string().uuid().describe("Issue ID to mute.")}),Q4=Q.object({issue:On}),I4=Q.object({issueId:Q.string().uuid().describe("Issue ID to unmute.")}),h4=Q.object({issue:On}),kI=S({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:Xy,output:XW,pagination:"none",async:"sync"}),jy=S({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:pM,output:jW,pagination:"cursor",async:"sync"}),Ky=S({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:AY,output:KW,pagination:"cursor",async:"sync"}),_y=S({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:_W,output:xW,pagination:"none",async:"sync"}),xy=S({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:sW,output:qW,pagination:"none",async:"sync"}),sy=S({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:dW,output:pW,pagination:"none",async:"sync"}),qy=S({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:A4,output:t4,pagination:"none",async:"sync"}),dy=S({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:g4,output:n4,pagination:"none",async:"sync"}),py=S({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:i4,output:o4,pagination:"none",async:"sync"}),Aw=S({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:e4,output:Q4,pagination:"none",async:"sync"}),tw=S({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:I4,output:h4,pagination:"none",async:"sync"}),SNA={count:_y.contract,create:kI.contract,list:jy.contract,search:Ky.contract,get:xy.contract,resolve:sy.contract,ignore:qy.contract,reopen:dy.contract,reassignAndReopen:py.contract,mute:Aw.contract,unmute:tw.contract}});var gY,B4,gw,nw,c4,C4,E4,a4,iw,nY,r4,y4,w4,D4,u4,b4,l4,N4,U4,S4,L4,F4,$I,GI,TI,JI,PI,ow,ew,Qw,Iw,hw,LNA,FNA;var iY=r(()=>{JA();KA();gY=/^[a-zA-Z0-9\s\-_]+$/,B4=Q.object({id:Q.string().uuid(),name:Q.string(),expiresAt:Q.string().datetime().nullable(),lastUsedAt:Q.string().datetime().nullable(),createdAt:Q.string().datetime()}),gw=B4.extend({projectId:Q.string().uuid(),dataSourceConnectionId:Q.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:Q.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),nw=B4.extend({projectId:Q.string().uuid().nullable()}),c4=Q.object({projectId:Q.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),C4=Q.object({publicKeys:Q.array(gw),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),E4=Q.object({secretKeys:Q.array(nw),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a4=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:Q.string().uuid().describe("Key ID to fetch.")}),iw=Q.object({publicKey:gw}),nY=Q.object({secretKey:nw}),r4=Q.object({publicKey:gw.extend({value:Q.string()})}),y4=Q.object({projectId:Q.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),w4=Q.object({secretKey:nw.extend({value:Q.string()})}),D4=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:Q.string().uuid().describe("Key ID to update."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:Q.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),u4=Q.object({params:Q.object({keyId:Q.string().uuid().describe("Public key ID to deactivate.")}),query:Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),b4=iw,l4=Q.void(),N4=Q.object({limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),U4=Q.object({keyId:Q.string().uuid().describe("Key ID to fetch.")}),S4=Q.object({projectId:Q.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:Q.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),L4=Q.object({keyId:Q.string().uuid().describe("Key ID to update."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:Q.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),F4=Q.object({params:Q.object({keyId:Q.string().uuid().describe("Key ID to delete.")})}).transform(({params:A})=>({...A})),$I=S({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:c4,output:C4,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),GI=S({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:a4,output:iw,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),TI=S({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:y4,output:r4,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),JI=S({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:D4,output:iw,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),PI=S({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:u4,output:b4,pagination:"none",async:"sync"}),ow=S({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:N4,output:E4,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),ew=S({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:U4,output:nY,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Qw=S({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:S4,output:w4,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),Iw=S({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:L4,output:nY,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),hw=S({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:F4,output:l4,pagination:"none",async:"sync"}),LNA={list:$I.contract,get:GI.contract,ensureLogForwarding:TI.contract,update:JI.contract,deactivate:PI.contract},FNA={list:ow.contract,get:ew.contract,create:Qw.contract,update:Iw.contract,delete:hw.contract}});var oY,M4,eY,eC,MNA,YNA,kNA,$NA,GNA,TNA,JNA,PNA,RNA,fNA,QY,IY,hY,BY,cY,$ht;var Y4=r(()=>{JA();KA();oY=Q.string().uuid().describe("Log match expression ID."),M4=Q.string().min(1).max(200).describe("Human-readable expression name."),eY=Q.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),eC=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),expression:eY,enabled:Q.boolean(),compiledVersion:Q.number().int(),linkedAutomationIds:Q.array(Q.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),MNA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list expressions for. Auto-filled from CLI and SDK context when omitted.")}),YNA=Q.object({expressions:Q.array(eC)}),kNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),$NA=Q.object({expression:eC}),GNA=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:M4,expression:eY,enabled:Q.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),TNA=Q.object({expression:eC}),JNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:M4.optional(),expression:eY.optional(),enabled:Q.boolean().optional().describe("Whether the expression is enabled.")}),PNA=Q.object({expression:eC}),RNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),fNA=Q.object({expression:eC}),QY=S({operationId:"logMatchExpressions.list",description:"List CEL log-match expressions in a project.",backend:"api",route:{method:"GET",path:"/log-match-expressions",tags:["Log match expressions"]},input:MNA,output:YNA,pagination:"none",async:"sync"}),IY=S({operationId:"logMatchExpressions.get",description:"Get a single log-match expression by ID.",backend:"api",route:{method:"GET",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:kNA,output:$NA,pagination:"none",async:"sync"}),hY=S({operationId:"logMatchExpressions.create",description:"Create a CEL log-match expression for a project.",backend:"api",route:{method:"POST",path:"/log-match-expressions",successStatus:201,tags:["Log match expressions"]},input:GNA,output:TNA,pagination:"none",async:"sync"}),BY=S({operationId:"logMatchExpressions.update",description:"Update a log-match expression's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:JNA,output:PNA,pagination:"none",async:"sync"}),cY=S({operationId:"logMatchExpressions.disable",description:"Disable a log-match expression so it stops matching logs.",backend:"api",route:{method:"POST",path:"/log-match-expressions/{expressionId}/disable",tags:["Log match expressions"]},input:RNA,output:fNA,pagination:"none",async:"sync"}),$ht={list:QY.contract,get:IY.contract,create:hY.contract,update:BY.contract,disable:cY.contract}});var $4="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var k4=()=>{};var T4=`---
105
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let e of A.seen.entries()){let I=e[1];if(t===e[0]){o(e);continue}if(A.external){let B=A.external.registry.get(e[0])?.id;if(t!==e[0]&&B){o(e);continue}}if(A.metadataRegistry.get(e[0])?.id){o(e);continue}if(I.cycle){o(e);continue}if(I.count>1){if(A.reused==="ref"){o(e);continue}}}}function No(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(e)=>{let I=A.seen.get(e);if(I.ref===null)return;let h=I.def??I.schema,B={...h},c=I.ref;if(I.ref=null,c){i(c);let E=A.seen.get(c),a=E.schema;if(a.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0"))h.allOf=h.allOf??[],h.allOf.push(a);else Object.assign(h,a);if(Object.assign(h,B),e._zod.parent===c)for(let w in h){if(w==="$ref"||w==="allOf")continue;if(!(w in B))delete h[w]}if(a.$ref&&E.def)for(let w in h){if(w==="$ref"||w==="allOf")continue;if(w in E.def&&JSON.stringify(h[w])===JSON.stringify(E.def[w]))delete h[w]}}let C=e._zod.parent;if(C&&C!==c){i(C);let E=A.seen.get(C);if(E?.schema.$ref){if(h.$ref=E.schema.$ref,E.def)for(let a in h){if(a==="$ref"||a==="allOf")continue;if(a in E.def&&JSON.stringify(h[a])===JSON.stringify(E.def[a]))delete h[a]}}}A.override({zodSchema:e,jsonSchema:h,path:I.path??[]})};for(let e of[...A.seen.entries()].reverse())i(e[0]);let n={};if(A.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(A.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(A.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(A.target==="openapi-3.0");if(A.external?.uri){let e=A.external.registry.get(t)?.id;if(!e)throw Error("Schema is missing an `id` property");n.$id=A.external.uri(e)}Object.assign(n,g.def??g.schema);let o=A.external?.defs??{};for(let e of A.seen.entries()){let I=e[1];if(I.def&&I.defId)o[I.defId]=I.def}if(A.external);else if(Object.keys(o).length>0)if(A.target==="draft-2020-12")n.$defs=o;else n.definitions=o;try{let e=JSON.parse(JSON.stringify(n));return Object.defineProperty(e,"~standard",{value:{...t["~standard"],jsonSchema:{input:uI(t,"input",A.processors),output:uI(t,"output",A.processors)}},enumerable:!1,writable:!1}),e}catch(e){throw Error("Error converting schema to JSON.")}}function ug(A,t){let g=t??{seen:new Set};if(g.seen.has(A))return!1;g.seen.add(A);let i=A._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ug(i.element,g);if(i.type==="set")return ug(i.valueType,g);if(i.type==="lazy")return ug(i.getter(),g);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ug(i.innerType,g);if(i.type==="intersection")return ug(i.left,g)||ug(i.right,g);if(i.type==="record"||i.type==="map")return ug(i.keyType,g)||ug(i.valueType,g);if(i.type==="pipe")return ug(i.in,g)||ug(i.out,g);if(i.type==="object"){for(let n in i.shape)if(ug(i.shape[n],g))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(ug(n,g))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(ug(n,g))return!0;if(i.rest&&ug(i.rest,g))return!0;return!1}return!1}var cL=(A,t={})=>(g)=>{let i=bo({...g,processors:t});return sA(A,i),lo(i,A),No(i,A)},uI=(A,t,g={})=>(i)=>{let{libraryOptions:n,target:o}=i??{},e=bo({...n??{},target:o,io:t,processors:g});return sA(A,e),lo(e,A),No(e,A)};var Pc=r(()=>{Gc()});function Vr(A,t){if("_idmap"in A){let i=A,n=bo({...t,processors:mr}),o={};for(let h of i._idmap.entries()){let[B,c]=h;sA(c,n)}let e={},I={registry:i,uri:t?.uri,defs:o};n.external=I;for(let h of i._idmap.entries()){let[B,c]=h;lo(n,c),e[B]=No(n,c)}if(Object.keys(o).length>0){let h=n.target==="draft-2020-12"?"$defs":"definitions";e.__shared={[h]:o}}return{schemas:e}}let g=bo({...t,processors:mr});return sA(A,g),lo(g,A),No(g,A)}var ybA,CL=(A,t,g,i)=>{let n=g;n.type="string";let{minimum:o,maximum:e,format:I,patterns:h,contentEncoding:B}=A._zod.bag;if(typeof o==="number")n.minLength=o;if(typeof e==="number")n.maxLength=e;if(I){if(n.format=ybA[I]??I,n.format==="")delete n.format;if(I==="time")delete n.format}if(B)n.contentEncoding=B;if(h&&h.size>0){let c=[...h];if(c.length===1)n.pattern=c[0].source;else if(c.length>1)n.allOf=[...c.map((C)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:C.source}))]}},EL=(A,t,g,i)=>{let n=g,{minimum:o,maximum:e,format:I,multipleOf:h,exclusiveMaximum:B,exclusiveMinimum:c}=A._zod.bag;if(typeof I==="string"&&I.includes("int"))n.type="integer";else n.type="number";if(typeof c==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.minimum=c,n.exclusiveMinimum=!0;else n.exclusiveMinimum=c;if(typeof o==="number"){if(n.minimum=o,typeof c==="number"&&t.target!=="draft-04")if(c>=o)delete n.minimum;else delete n.exclusiveMinimum}if(typeof B==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.maximum=B,n.exclusiveMaximum=!0;else n.exclusiveMaximum=B;if(typeof e==="number"){if(n.maximum=e,typeof B==="number"&&t.target!=="draft-04")if(B<=e)delete n.maximum;else delete n.exclusiveMaximum}if(typeof h==="number")n.multipleOf=h},aL=(A,t,g,i)=>{g.type="boolean"},rL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},yL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},wL=(A,t,g,i)=>{if(t.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},DL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},uL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},bL=(A,t,g,i)=>{g.not={}},lL=(A,t,g,i)=>{},NL=(A,t,g,i)=>{},UL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},SL=(A,t,g,i)=>{let n=A._zod.def,o=Cc(n.entries);if(o.every((e)=>typeof e==="number"))g.type="number";if(o.every((e)=>typeof e==="string"))g.type="string";g.enum=o},LL=(A,t,g,i)=>{let n=A._zod.def,o=[];for(let e of n.values)if(e===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(o.length===0);else if(o.length===1){let e=o[0];if(g.type=e===null?"null":typeof e,t.target==="draft-04"||t.target==="openapi-3.0")g.enum=[e];else g.const=e}else{if(o.every((e)=>typeof e==="number"))g.type="number";if(o.every((e)=>typeof e==="string"))g.type="string";if(o.every((e)=>typeof e==="boolean"))g.type="boolean";if(o.every((e)=>e===null))g.type="null";g.enum=o}},FL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},ML=(A,t,g,i)=>{let n=g,o=A._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},YL=(A,t,g,i)=>{let n=g,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:e,maximum:I,mime:h}=A._zod.bag;if(e!==void 0)o.minLength=e;if(I!==void 0)o.maxLength=I;if(h)if(h.length===1)o.contentMediaType=h[0],Object.assign(n,o);else Object.assign(n,o),n.anyOf=h.map((B)=>({contentMediaType:B}));else Object.assign(n,o)},kL=(A,t,g,i)=>{g.type="boolean"},$L=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},GL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},TL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},JL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},PL=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},RL=(A,t,g,i)=>{let n=g,o=A._zod.def,{minimum:e,maximum:I}=A._zod.bag;if(typeof e==="number")n.minItems=e;if(typeof I==="number")n.maxItems=I;n.type="array",n.items=sA(o.element,t,{...i,path:[...i.path,"items"]})},fL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="object",n.properties={};let e=o.shape;for(let B in e)n.properties[B]=sA(e[B],t,{...i,path:[...i.path,"properties",B]});let I=new Set(Object.keys(e)),h=new Set([...I].filter((B)=>{let c=o.shape[B]._zod;if(t.io==="input")return c.optin===void 0;else return c.optout===void 0}));if(h.size>0)n.required=Array.from(h);if(o.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!o.catchall){if(t.io==="output")n.additionalProperties=!1}else if(o.catchall)n.additionalProperties=sA(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},Wr=(A,t,g,i)=>{let n=A._zod.def,o=n.inclusive===!1,e=n.options.map((I,h)=>sA(I,t,{...i,path:[...i.path,o?"oneOf":"anyOf",h]}));if(o)g.oneOf=e;else g.anyOf=e},OL=(A,t,g,i)=>{let n=A._zod.def,o=sA(n.left,t,{...i,path:[...i.path,"allOf",0]}),e=sA(n.right,t,{...i,path:[...i.path,"allOf",1]}),I=(B)=>("allOf"in B)&&Object.keys(B).length===1,h=[...I(o)?o.allOf:[o],...I(e)?e.allOf:[e]];g.allOf=h},zL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="array";let e=t.target==="draft-2020-12"?"prefixItems":"items",I=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",h=o.items.map((E,a)=>sA(E,t,{...i,path:[...i.path,e,a]})),B=o.rest?sA(o.rest,t,{...i,path:[...i.path,I,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=h,B)n.items=B}else if(t.target==="openapi-3.0"){if(n.items={anyOf:h},B)n.items.anyOf.push(B);if(n.minItems=h.length,!B)n.maxItems=h.length}else if(n.items=h,B)n.additionalItems=B;let{minimum:c,maximum:C}=A._zod.bag;if(typeof c==="number")n.minItems=c;if(typeof C==="number")n.maxItems=C},vL=(A,t,g,i)=>{let n=g,o=A._zod.def;n.type="object";let e=o.keyType,h=e._zod.bag?.patterns;if(o.mode==="loose"&&h&&h.size>0){let c=sA(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let C of h)n.patternProperties[C.source]=c}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=sA(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=sA(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let B=e._zod.values;if(B){let c=[...B].filter((C)=>typeof C==="string"||typeof C==="number");if(c.length>0)n.required=c}},mL=(A,t,g,i)=>{let n=A._zod.def,o=sA(n.innerType,t,i),e=t.seen.get(A);if(t.target==="openapi-3.0")e.ref=n.innerType,g.nullable=!0;else g.anyOf=[o,{type:"null"}]},WL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},ZL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType,g.default=JSON.parse(JSON.stringify(n.defaultValue))},VL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);if(o.ref=n.innerType,t.io==="input")g._prefault=JSON.parse(JSON.stringify(n.defaultValue))},HL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType;let e;try{e=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=e},XL=(A,t,g,i)=>{let n=A._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;sA(o,t,i);let e=t.seen.get(A);e.ref=o},jL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType,g.readOnly=!0},KL=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},Zr=(A,t,g,i)=>{let n=A._zod.def;sA(n.innerType,t,i);let o=t.seen.get(A);o.ref=n.innerType},_L=(A,t,g,i)=>{let n=A._zod.innerType;sA(n,t,i);let o=t.seen.get(A);o.ref=n},mr;var Rc=r(()=>{Pc();BA();ybA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mr={string:CL,number:EL,boolean:aL,bigint:rL,symbol:yL,null:wL,undefined:DL,void:uL,never:bL,any:lL,unknown:NL,date:UL,enum:SL,literal:LL,nan:FL,template_literal:ML,file:YL,success:kL,custom:$L,function:GL,transform:TL,map:JL,set:PL,array:RL,object:fL,union:Wr,intersection:OL,tuple:zL,record:vL,nullable:mL,nonoptional:WL,default:ZL,prefault:VL,catch:HL,pipe:XL,readonly:jL,promise:KL,optional:Zr,lazy:_L}});class xL{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(A){this.ctx.counter=A}get seen(){return this.ctx.seen}constructor(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=bo({processors:mr,target:t,...A?.metadata&&{metadata:A.metadata},...A?.unrepresentable&&{unrepresentable:A.unrepresentable},...A?.override&&{override:A.override},...A?.io&&{io:A.io}})}process(A,t={path:[],schemaPath:[]}){return sA(A,this.ctx,t)}emit(A,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}lo(this.ctx,A);let g=No(this.ctx,A),{"~standard":i,...n}=g;return n}}var $1=r(()=>{Rc();Pc()});var G1={};var T1=()=>{};var zi={};dn(zi,{version:()=>a0,util:()=>_,treeifyError:()=>yN,toJSONSchema:()=>Vr,toDotPath:()=>Iv,safeParseAsync:()=>bN,safeParse:()=>uN,safeEncodeAsync:()=>UDA,safeEncode:()=>lDA,safeDecodeAsync:()=>SDA,safeDecode:()=>NDA,registry:()=>ar,regexes:()=>rn,process:()=>sA,prettifyError:()=>wN,parseAsync:()=>Ha,parse:()=>Va,meta:()=>hL,locales:()=>$c,isValidJWT:()=>Mv,isValidBase64URL:()=>Fv,isValidBase64:()=>O0,initializeContext:()=>bo,globalRegistry:()=>xt,globalConfig:()=>hc,formatError:()=>uc,flattenError:()=>Dc,finalize:()=>No,extractDefs:()=>lo,encodeAsync:()=>uDA,encode:()=>wDA,describe:()=>IL,decodeAsync:()=>bDA,decode:()=>DDA,createToJSONSchemaMethod:()=>cL,createStandardJSONSchemaMethod:()=>uI,config:()=>Ft,clone:()=>wg,_xor:()=>_uA,_xid:()=>Lr,_void:()=>pS,_uuidv7:()=>ur,_uuidv6:()=>Dr,_uuidv4:()=>wr,_uuid:()=>yr,_url:()=>Jc,_uppercase:()=>II,_unknown:()=>qS,_union:()=>KuA,_undefined:()=>_S,_ulid:()=>Sr,_uint64:()=>jS,_uint32:()=>mS,_tuple:()=>quA,_trim:()=>aI,_transform:()=>ibA,_toUpperCase:()=>yI,_toLowerCase:()=>rI,_templateLiteral:()=>EbA,_symbol:()=>KS,_superRefine:()=>QL,_success:()=>hbA,_stringbool:()=>BL,_stringFormat:()=>DI,_string:()=>FS,_startsWith:()=>BI,_slugify:()=>wI,_size:()=>$e,_set:()=>AbA,_safeParseAsync:()=>nI,_safeParse:()=>gI,_safeEncodeAsync:()=>qa,_safeEncode:()=>xa,_safeDecodeAsync:()=>da,_safeDecode:()=>sa,_regex:()=>eI,_refine:()=>eL,_record:()=>duA,_readonly:()=>CbA,_property:()=>vr,_promise:()=>rbA,_positive:()=>Rr,_pipe:()=>cbA,_parseAsync:()=>tI,_parse:()=>AI,_overwrite:()=>fn,_optional:()=>obA,_number:()=>PS,_nullable:()=>ebA,_null:()=>xS,_normalize:()=>EI,_nonpositive:()=>Or,_nonoptional:()=>IbA,_nonnegative:()=>zr,_never:()=>dS,_negative:()=>fr,_nativeEnum:()=>gbA,_nanoid:()=>lr,_nan:()=>gL,_multipleOf:()=>Do,_minSize:()=>ii,_minLength:()=>Oi,_min:()=>Dg,_mime:()=>CI,_maxSize:()=>uo,_maxLength:()=>Ge,_max:()=>xg,_map:()=>puA,_mac:()=>YS,_lte:()=>xg,_lt:()=>gi,_lowercase:()=>QI,_literal:()=>nbA,_length:()=>Te,_lazy:()=>abA,_ksuid:()=>Fr,_jwt:()=>Pr,_isoTime:()=>TS,_isoDuration:()=>JS,_isoDateTime:()=>$S,_isoDate:()=>GS,_ipv6:()=>Yr,_ipv4:()=>Mr,_intersection:()=>suA,_int64:()=>XS,_int32:()=>vS,_int:()=>fS,_includes:()=>hI,_guid:()=>Tc,_gte:()=>Dg,_gt:()=>ni,_float64:()=>zS,_float32:()=>OS,_file:()=>iL,_enum:()=>tbA,_endsWith:()=>cI,_encodeAsync:()=>Ka,_encode:()=>Xa,_emoji:()=>br,_email:()=>rr,_e164:()=>Jr,_discriminatedUnion:()=>xuA,_default:()=>QbA,_decodeAsync:()=>_a,_decode:()=>ja,_date:()=>AL,_custom:()=>oL,_cuid2:()=>Ur,_cuid:()=>Nr,_coercedString:()=>MS,_coercedNumber:()=>RS,_coercedDate:()=>tL,_coercedBoolean:()=>ZS,_coercedBigint:()=>HS,_cidrv6:()=>$r,_cidrv4:()=>kr,_check:()=>Y1,_catch:()=>BbA,_boolean:()=>WS,_bigint:()=>VS,_base64url:()=>Tr,_base64:()=>Gr,_array:()=>nL,_any:()=>sS,TimePrecision:()=>kS,NEVER:()=>Bc,JSONSchemaGenerator:()=>xL,JSONSchema:()=>G1,Doc:()=>ir,$output:()=>US,$input:()=>SS,$constructor:()=>k,$brand:()=>eN,$ZodXor:()=>tU,$ZodXID:()=>F0,$ZodVoid:()=>q0,$ZodUnknown:()=>x0,$ZodUnion:()=>Sc,$ZodUndefined:()=>j0,$ZodUUID:()=>D0,$ZodURL:()=>b0,$ZodULID:()=>L0,$ZodType:()=>NA,$ZodTuple:()=>Cr,$ZodTransform:()=>BU,$ZodTemplateLiteral:()=>lU,$ZodSymbol:()=>X0,$ZodSuccess:()=>yU,$ZodStringFormat:()=>ot,$ZodString:()=>ke,$ZodSet:()=>eU,$ZodRegistry:()=>LS,$ZodRecord:()=>iU,$ZodRealError:()=>$g,$ZodReadonly:()=>bU,$ZodPromise:()=>UU,$ZodPrefault:()=>aU,$ZodPipe:()=>uU,$ZodOptional:()=>Er,$ZodObjectJIT:()=>AU,$ZodObject:()=>$v,$ZodNumberFormat:()=>V0,$ZodNumber:()=>Br,$ZodNullable:()=>CU,$ZodNull:()=>K0,$ZodNonOptional:()=>rU,$ZodNever:()=>s0,$ZodNanoID:()=>N0,$ZodNaN:()=>DU,$ZodMap:()=>oU,$ZodMAC:()=>P0,$ZodLiteral:()=>IU,$ZodLazy:()=>SU,$ZodKSUID:()=>M0,$ZodJWT:()=>W0,$ZodIntersection:()=>nU,$ZodISOTime:()=>$0,$ZodISODuration:()=>G0,$ZodISODateTime:()=>Y0,$ZodISODate:()=>k0,$ZodIPv6:()=>J0,$ZodIPv4:()=>T0,$ZodGUID:()=>w0,$ZodFunction:()=>NU,$ZodFile:()=>hU,$ZodExactOptional:()=>cU,$ZodError:()=>wc,$ZodEnum:()=>QU,$ZodEncodeError:()=>Fe,$ZodEmoji:()=>l0,$ZodEmail:()=>u0,$ZodE164:()=>m0,$ZodDiscriminatedUnion:()=>gU,$ZodDefault:()=>EU,$ZodDate:()=>d0,$ZodCustomStringFormat:()=>Z0,$ZodCustom:()=>LU,$ZodCodec:()=>Lc,$ZodCheckUpperCase:()=>Q0,$ZodCheckStringFormat:()=>iI,$ZodCheckStartsWith:()=>h0,$ZodCheckSizeEquals:()=>t0,$ZodCheckRegex:()=>o0,$ZodCheckProperty:()=>c0,$ZodCheckOverwrite:()=>E0,$ZodCheckNumberFormat:()=>qN,$ZodCheckMultipleOf:()=>sN,$ZodCheckMinSize:()=>A0,$ZodCheckMinLength:()=>n0,$ZodCheckMimeType:()=>C0,$ZodCheckMaxSize:()=>pN,$ZodCheckMaxLength:()=>g0,$ZodCheckLowerCase:()=>e0,$ZodCheckLessThan:()=>tr,$ZodCheckLengthEquals:()=>i0,$ZodCheckIncludes:()=>I0,$ZodCheckGreaterThan:()=>gr,$ZodCheckEndsWith:()=>B0,$ZodCheckBigIntFormat:()=>dN,$ZodCheck:()=>ht,$ZodCatch:()=>wU,$ZodCUID2:()=>S0,$ZodCUID:()=>U0,$ZodCIDRv6:()=>f0,$ZodCIDRv4:()=>R0,$ZodBoolean:()=>Uc,$ZodBigIntFormat:()=>H0,$ZodBigInt:()=>cr,$ZodBase64URL:()=>v0,$ZodBase64:()=>z0,$ZodAsyncError:()=>ti,$ZodArray:()=>p0,$ZodAny:()=>_0});var sg=r(()=>{BA();Ar();NS();Rc();$1();T1();sQ();lN();DN();FU();nr();r0();Gc();k1();Pc()});var Hr={};dn(Hr,{uppercase:()=>II,trim:()=>aI,toUpperCase:()=>yI,toLowerCase:()=>rI,startsWith:()=>BI,slugify:()=>wI,size:()=>$e,regex:()=>eI,property:()=>vr,positive:()=>Rr,overwrite:()=>fn,normalize:()=>EI,nonpositive:()=>Or,nonnegative:()=>zr,negative:()=>fr,multipleOf:()=>Do,minSize:()=>ii,minLength:()=>Oi,mime:()=>CI,maxSize:()=>uo,maxLength:()=>Ge,lte:()=>xg,lt:()=>gi,lowercase:()=>QI,length:()=>Te,includes:()=>hI,gte:()=>Dg,gt:()=>ni,endsWith:()=>cI});var Xr=r(()=>{sg()});var Uo={};dn(Uo,{time:()=>dL,duration:()=>pL,datetime:()=>sL,date:()=>qL,ZodISOTime:()=>_r,ZodISODuration:()=>xr,ZodISODateTime:()=>jr,ZodISODate:()=>Kr});function sL(A){return $S(jr,A)}function qL(A){return GS(Kr,A)}function dL(A){return TS(_r,A)}function pL(A){return JS(xr,A)}var jr,Kr,_r,xr;var fc=r(()=>{sg();zc();jr=k("ZodISODateTime",(A,t)=>{Y0.init(A,t),et.init(A,t)});Kr=k("ZodISODate",(A,t)=>{k0.init(A,t),et.init(A,t)});_r=k("ZodISOTime",(A,t)=>{$0.init(A,t),et.init(A,t)});xr=k("ZodISODuration",(A,t)=>{G0.init(A,t),et.init(A,t)})});var J1=(A,t)=>{wc.init(A,t),A.name="ZodError",Object.defineProperties(A,{format:{value:(g)=>uc(A,g)},flatten:{value:(g)=>Dc(A,g)},addIssue:{value:(g)=>{A.issues.push(g),A.message=JSON.stringify(A.issues,qQ,2)}},addIssues:{value:(g)=>{A.issues.push(...g),A.message=JSON.stringify(A.issues,qQ,2)}},isEmpty:{get(){return A.issues.length===0}}})},DbA,Gg;var AF=r(()=>{sg();sg();BA();DbA=k("ZodError",J1),Gg=k("ZodError",J1,{Parent:Error})});var tF,gF,nF,iF,oF,eF,QF,IF,hF,BF,cF,CF;var EF=r(()=>{sg();AF();tF=AI(Gg),gF=tI(Gg),nF=gI(Gg),iF=nI(Gg),oF=Xa(Gg),eF=ja(Gg),QF=Ka(Gg),IF=_a(Gg),hF=xa(Gg),BF=sa(Gg),cF=qa(Gg),CF=da(Gg)});var Oc={};dn(Oc,{xor:()=>b2,xid:()=>j1,void:()=>y2,uuidv7:()=>v1,uuidv6:()=>z1,uuidv4:()=>O1,uuid:()=>f1,url:()=>pr,unknown:()=>Qt,union:()=>It,undefined:()=>r2,ulid:()=>X1,uint64:()=>E2,uint32:()=>B2,tuple:()=>MF,transform:()=>Dy,templateLiteral:()=>G2,symbol:()=>a2,superRefine:()=>pF,success:()=>Y2,stringbool:()=>z2,stringFormat:()=>n2,string:()=>F,strictObject:()=>u2,set:()=>S2,refine:()=>dF,record:()=>pA,readonly:()=>jF,promise:()=>T2,preprocess:()=>sc,prefault:()=>vF,pipe:()=>Wc,partialRecord:()=>l2,optional:()=>Bt,object:()=>p,number:()=>vA,nullish:()=>M2,nullable:()=>mc,null:()=>Vc,nonoptional:()=>mF,never:()=>wy,nativeEnum:()=>L2,nanoid:()=>Z1,nan:()=>k2,meta:()=>f2,map:()=>U2,mac:()=>x1,looseRecord:()=>N2,looseObject:()=>Mt,literal:()=>QA,lazy:()=>xF,ksuid:()=>K1,keyof:()=>D2,jwt:()=>g2,json:()=>v2,ipv6:()=>s1,ipv4:()=>_1,intersection:()=>FI,int64:()=>C2,int32:()=>h2,int:()=>sr,instanceof:()=>O2,httpUrl:()=>m1,hostname:()=>i2,hex:()=>o2,hash:()=>e2,guid:()=>R1,function:()=>J2,float64:()=>I2,float32:()=>Q2,file:()=>F2,exactOptional:()=>PF,enum:()=>st,emoji:()=>W1,email:()=>P1,e164:()=>t2,discriminatedUnion:()=>Kc,describe:()=>R2,date:()=>w2,custom:()=>Uy,cuid2:()=>H1,cuid:()=>V1,codec:()=>$2,cidrv6:()=>d1,cidrv4:()=>q1,check:()=>P2,catch:()=>VF,boolean:()=>qA,bigint:()=>c2,base64url:()=>A2,base64:()=>p1,array:()=>q,any:()=>yy,_function:()=>J2,_default:()=>OF,_ZodString:()=>qr,ZodXor:()=>UF,ZodXID:()=>oy,ZodVoid:()=>lF,ZodUnknown:()=>uF,ZodUnion:()=>jc,ZodUndefined:()=>yF,ZodUUID:()=>oi,ZodURL:()=>Zc,ZodULID:()=>iy,ZodType:()=>kA,ZodTuple:()=>FF,ZodTransform:()=>TF,ZodTemplateLiteral:()=>KF,ZodSymbol:()=>rF,ZodSuccess:()=>WF,ZodStringFormat:()=>et,ZodString:()=>lI,ZodSet:()=>kF,ZodRecord:()=>_c,ZodReadonly:()=>XF,ZodPromise:()=>sF,ZodPrefault:()=>zF,ZodPipe:()=>ly,ZodOptional:()=>uy,ZodObject:()=>Xc,ZodNumberFormat:()=>Je,ZodNumber:()=>UI,ZodNullable:()=>RF,ZodNull:()=>wF,ZodNonOptional:()=>by,ZodNever:()=>bF,ZodNanoID:()=>ty,ZodNaN:()=>HF,ZodMap:()=>YF,ZodMAC:()=>aF,ZodLiteral:()=>$F,ZodLazy:()=>_F,ZodKSUID:()=>ey,ZodJWT:()=>ay,ZodIntersection:()=>LF,ZodIPv6:()=>Iy,ZodIPv4:()=>Qy,ZodGUID:()=>vc,ZodFunction:()=>qF,ZodFile:()=>GF,ZodExactOptional:()=>JF,ZodEnum:()=>bI,ZodEmoji:()=>Ay,ZodEmail:()=>dr,ZodE164:()=>Ey,ZodDiscriminatedUnion:()=>SF,ZodDefault:()=>fF,ZodDate:()=>Hc,ZodCustomStringFormat:()=>NI,ZodCustom:()=>xc,ZodCodec:()=>Ny,ZodCatch:()=>ZF,ZodCUID2:()=>ny,ZodCUID:()=>gy,ZodCIDRv6:()=>By,ZodCIDRv4:()=>hy,ZodBoolean:()=>SI,ZodBigIntFormat:()=>ry,ZodBigInt:()=>LI,ZodBase64URL:()=>Cy,ZodBase64:()=>cy,ZodArray:()=>NF,ZodAny:()=>DF});function F(A){return FS(lI,A)}function P1(A){return rr(dr,A)}function R1(A){return Tc(vc,A)}function f1(A){return yr(oi,A)}function O1(A){return wr(oi,A)}function z1(A){return Dr(oi,A)}function v1(A){return ur(oi,A)}function pr(A){return Jc(Zc,A)}function m1(A){return Jc(Zc,{protocol:/^https?$/,hostname:rn.domain,..._.normalizeParams(A)})}function W1(A){return br(Ay,A)}function Z1(A){return lr(ty,A)}function V1(A){return Nr(gy,A)}function H1(A){return Ur(ny,A)}function X1(A){return Sr(iy,A)}function j1(A){return Lr(oy,A)}function K1(A){return Fr(ey,A)}function _1(A){return Mr(Qy,A)}function x1(A){return YS(aF,A)}function s1(A){return Yr(Iy,A)}function q1(A){return kr(hy,A)}function d1(A){return $r(By,A)}function p1(A){return Gr(cy,A)}function A2(A){return Tr(Cy,A)}function t2(A){return Jr(Ey,A)}function g2(A){return Pr(ay,A)}function n2(A,t,g={}){return DI(NI,A,t,g)}function i2(A){return DI(NI,"hostname",rn.hostname,A)}function o2(A){return DI(NI,"hex",rn.hex,A)}function e2(A,t){let g=t?.enc??"hex",i=`${A}_${g}`,n=rn[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return DI(NI,i,n,t)}function vA(A){return PS(UI,A)}function sr(A){return fS(Je,A)}function Q2(A){return OS(Je,A)}function I2(A){return zS(Je,A)}function h2(A){return vS(Je,A)}function B2(A){return mS(Je,A)}function qA(A){return WS(SI,A)}function c2(A){return VS(LI,A)}function C2(A){return XS(ry,A)}function E2(A){return jS(ry,A)}function a2(A){return KS(rF,A)}function r2(A){return _S(yF,A)}function Vc(A){return xS(wF,A)}function yy(){return sS(DF)}function Qt(){return qS(uF)}function wy(A){return dS(bF,A)}function y2(A){return pS(lF,A)}function w2(A){return AL(Hc,A)}function q(A,t){return nL(NF,A,t)}function D2(A){let t=A._zod.def.shape;return st(Object.keys(t))}function p(A,t){let g={type:"object",shape:A??{},..._.normalizeParams(t)};return new Xc(g)}function u2(A,t){return new Xc({type:"object",shape:A,catchall:wy(),..._.normalizeParams(t)})}function Mt(A,t){return new Xc({type:"object",shape:A,catchall:Qt(),..._.normalizeParams(t)})}function It(A,t){return new jc({type:"union",options:A,..._.normalizeParams(t)})}function b2(A,t){return new UF({type:"union",options:A,inclusive:!1,..._.normalizeParams(t)})}function Kc(A,t,g){return new SF({type:"union",options:t,discriminator:A,..._.normalizeParams(g)})}function FI(A,t){return new LF({type:"intersection",left:A,right:t})}function MF(A,t,g){let i=t instanceof NA,n=i?g:t;return new FF({type:"tuple",items:A,rest:i?t:null,..._.normalizeParams(n)})}function pA(A,t,g){return new _c({type:"record",keyType:A,valueType:t,..._.normalizeParams(g)})}function l2(A,t,g){let i=wg(A);return i._zod.values=void 0,new _c({type:"record",keyType:i,valueType:t,..._.normalizeParams(g)})}function N2(A,t,g){return new _c({type:"record",keyType:A,valueType:t,mode:"loose",..._.normalizeParams(g)})}function U2(A,t,g){return new YF({type:"map",keyType:A,valueType:t,..._.normalizeParams(g)})}function S2(A,t){return new kF({type:"set",valueType:A,..._.normalizeParams(t)})}function st(A,t){let g=Array.isArray(A)?Object.fromEntries(A.map((i)=>[i,i])):A;return new bI({type:"enum",entries:g,..._.normalizeParams(t)})}function L2(A,t){return new bI({type:"enum",entries:A,..._.normalizeParams(t)})}function QA(A,t){return new $F({type:"literal",values:Array.isArray(A)?A:[A],..._.normalizeParams(t)})}function F2(A){return iL(GF,A)}function Dy(A){return new TF({type:"transform",transform:A})}function Bt(A){return new uy({type:"optional",innerType:A})}function PF(A){return new JF({type:"optional",innerType:A})}function mc(A){return new RF({type:"nullable",innerType:A})}function M2(A){return Bt(mc(A))}function OF(A,t){return new fF({type:"default",innerType:A,get defaultValue(){return typeof t==="function"?t():_.shallowClone(t)}})}function vF(A,t){return new zF({type:"prefault",innerType:A,get defaultValue(){return typeof t==="function"?t():_.shallowClone(t)}})}function mF(A,t){return new by({type:"nonoptional",innerType:A,..._.normalizeParams(t)})}function Y2(A){return new WF({type:"success",innerType:A})}function VF(A,t){return new ZF({type:"catch",innerType:A,catchValue:typeof t==="function"?t:()=>t})}function k2(A){return gL(HF,A)}function Wc(A,t){return new ly({type:"pipe",in:A,out:t})}function $2(A,t,g){return new Ny({type:"pipe",in:A,out:t,transform:g.decode,reverseTransform:g.encode})}function jF(A){return new XF({type:"readonly",innerType:A})}function G2(A,t){return new KF({type:"template_literal",parts:A,..._.normalizeParams(t)})}function xF(A){return new _F({type:"lazy",getter:A})}function T2(A){return new sF({type:"promise",innerType:A})}function J2(A){return new qF({type:"function",input:Array.isArray(A?.input)?MF(A?.input):A?.input??q(Qt()),output:A?.output??Qt()})}function P2(A){let t=new ht({check:"custom"});return t._zod.check=A,t}function Uy(A,t){return oL(xc,A??(()=>!0),t)}function dF(A,t={}){return eL(xc,A,t)}function pF(A){return QL(A)}function O2(A,t={}){let g=new xc({type:"custom",check:"custom",fn:(i)=>i instanceof A,abort:!0,..._.normalizeParams(t)});return g._zod.bag.Class=A,g._zod.check=(i)=>{if(!(i.value instanceof A))i.issues.push({code:"invalid_type",expected:A.name,input:i.value,inst:g,path:[...g._zod.def.path??[]]})},g}function v2(A){let t=xF(()=>{return It([F(A),vA(),qA(),Vc(),q(t),pA(F(),t)])});return t}function sc(A,t){return Wc(Dy(A),t)}var kA,qr,lI,et,dr,vc,oi,Zc,Ay,ty,gy,ny,iy,oy,ey,Qy,aF,Iy,hy,By,cy,Cy,Ey,ay,NI,UI,Je,SI,LI,ry,rF,yF,wF,DF,uF,bF,lF,Hc,NF,Xc,jc,UF,SF,LF,FF,_c,YF,kF,bI,$F,GF,TF,uy,JF,RF,fF,zF,by,WF,ZF,HF,ly,Ny,XF,KF,_F,sF,qF,xc,R2,f2,z2=(...A)=>BL({Codec:Ny,Boolean:SI,String:lI},...A);var zc=r(()=>{sg();sg();Rc();Pc();Xr();fc();EF();kA=k("ZodType",(A,t)=>{return NA.init(A,t),Object.assign(A["~standard"],{jsonSchema:{input:uI(A,"input"),output:uI(A,"output")}}),A.toJSONSchema=cL(A,{}),A.def=t,A.type=t.type,Object.defineProperty(A,"_def",{value:t}),A.check=(...g)=>{return A.clone(_.mergeDefs(t,{checks:[...t.checks??[],...g.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},A.with=A.check,A.clone=(g,i)=>wg(A,g,i),A.brand=()=>A,A.register=(g,i)=>{return g.add(A,i),A},A.parse=(g,i)=>tF(A,g,i,{callee:A.parse}),A.safeParse=(g,i)=>nF(A,g,i),A.parseAsync=async(g,i)=>gF(A,g,i,{callee:A.parseAsync}),A.safeParseAsync=async(g,i)=>iF(A,g,i),A.spa=A.safeParseAsync,A.encode=(g,i)=>oF(A,g,i),A.decode=(g,i)=>eF(A,g,i),A.encodeAsync=async(g,i)=>QF(A,g,i),A.decodeAsync=async(g,i)=>IF(A,g,i),A.safeEncode=(g,i)=>hF(A,g,i),A.safeDecode=(g,i)=>BF(A,g,i),A.safeEncodeAsync=async(g,i)=>cF(A,g,i),A.safeDecodeAsync=async(g,i)=>CF(A,g,i),A.refine=(g,i)=>A.check(dF(g,i)),A.superRefine=(g)=>A.check(pF(g)),A.overwrite=(g)=>A.check(fn(g)),A.optional=()=>Bt(A),A.exactOptional=()=>PF(A),A.nullable=()=>mc(A),A.nullish=()=>Bt(mc(A)),A.nonoptional=(g)=>mF(A,g),A.array=()=>q(A),A.or=(g)=>It([A,g]),A.and=(g)=>FI(A,g),A.transform=(g)=>Wc(A,Dy(g)),A.default=(g)=>OF(A,g),A.prefault=(g)=>vF(A,g),A.catch=(g)=>VF(A,g),A.pipe=(g)=>Wc(A,g),A.readonly=()=>jF(A),A.describe=(g)=>{let i=A.clone();return xt.add(i,{description:g}),i},Object.defineProperty(A,"description",{get(){return xt.get(A)?.description},configurable:!0}),A.meta=(...g)=>{if(g.length===0)return xt.get(A);let i=A.clone();return xt.add(i,g[0]),i},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=(g)=>g(A),A}),qr=k("_ZodString",(A,t)=>{ke.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>CL(A,i,n,o);let g=A._zod.bag;A.format=g.format??null,A.minLength=g.minimum??null,A.maxLength=g.maximum??null,A.regex=(...i)=>A.check(eI(...i)),A.includes=(...i)=>A.check(hI(...i)),A.startsWith=(...i)=>A.check(BI(...i)),A.endsWith=(...i)=>A.check(cI(...i)),A.min=(...i)=>A.check(Oi(...i)),A.max=(...i)=>A.check(Ge(...i)),A.length=(...i)=>A.check(Te(...i)),A.nonempty=(...i)=>A.check(Oi(1,...i)),A.lowercase=(i)=>A.check(QI(i)),A.uppercase=(i)=>A.check(II(i)),A.trim=()=>A.check(aI()),A.normalize=(...i)=>A.check(EI(...i)),A.toLowerCase=()=>A.check(rI()),A.toUpperCase=()=>A.check(yI()),A.slugify=()=>A.check(wI())}),lI=k("ZodString",(A,t)=>{ke.init(A,t),qr.init(A,t),A.email=(g)=>A.check(rr(dr,g)),A.url=(g)=>A.check(Jc(Zc,g)),A.jwt=(g)=>A.check(Pr(ay,g)),A.emoji=(g)=>A.check(br(Ay,g)),A.guid=(g)=>A.check(Tc(vc,g)),A.uuid=(g)=>A.check(yr(oi,g)),A.uuidv4=(g)=>A.check(wr(oi,g)),A.uuidv6=(g)=>A.check(Dr(oi,g)),A.uuidv7=(g)=>A.check(ur(oi,g)),A.nanoid=(g)=>A.check(lr(ty,g)),A.guid=(g)=>A.check(Tc(vc,g)),A.cuid=(g)=>A.check(Nr(gy,g)),A.cuid2=(g)=>A.check(Ur(ny,g)),A.ulid=(g)=>A.check(Sr(iy,g)),A.base64=(g)=>A.check(Gr(cy,g)),A.base64url=(g)=>A.check(Tr(Cy,g)),A.xid=(g)=>A.check(Lr(oy,g)),A.ksuid=(g)=>A.check(Fr(ey,g)),A.ipv4=(g)=>A.check(Mr(Qy,g)),A.ipv6=(g)=>A.check(Yr(Iy,g)),A.cidrv4=(g)=>A.check(kr(hy,g)),A.cidrv6=(g)=>A.check($r(By,g)),A.e164=(g)=>A.check(Jr(Ey,g)),A.datetime=(g)=>A.check(sL(g)),A.date=(g)=>A.check(qL(g)),A.time=(g)=>A.check(dL(g)),A.duration=(g)=>A.check(pL(g))});et=k("ZodStringFormat",(A,t)=>{ot.init(A,t),qr.init(A,t)}),dr=k("ZodEmail",(A,t)=>{u0.init(A,t),et.init(A,t)});vc=k("ZodGUID",(A,t)=>{w0.init(A,t),et.init(A,t)});oi=k("ZodUUID",(A,t)=>{D0.init(A,t),et.init(A,t)});Zc=k("ZodURL",(A,t)=>{b0.init(A,t),et.init(A,t)});Ay=k("ZodEmoji",(A,t)=>{l0.init(A,t),et.init(A,t)});ty=k("ZodNanoID",(A,t)=>{N0.init(A,t),et.init(A,t)});gy=k("ZodCUID",(A,t)=>{U0.init(A,t),et.init(A,t)});ny=k("ZodCUID2",(A,t)=>{S0.init(A,t),et.init(A,t)});iy=k("ZodULID",(A,t)=>{L0.init(A,t),et.init(A,t)});oy=k("ZodXID",(A,t)=>{F0.init(A,t),et.init(A,t)});ey=k("ZodKSUID",(A,t)=>{M0.init(A,t),et.init(A,t)});Qy=k("ZodIPv4",(A,t)=>{T0.init(A,t),et.init(A,t)});aF=k("ZodMAC",(A,t)=>{P0.init(A,t),et.init(A,t)});Iy=k("ZodIPv6",(A,t)=>{J0.init(A,t),et.init(A,t)});hy=k("ZodCIDRv4",(A,t)=>{R0.init(A,t),et.init(A,t)});By=k("ZodCIDRv6",(A,t)=>{f0.init(A,t),et.init(A,t)});cy=k("ZodBase64",(A,t)=>{z0.init(A,t),et.init(A,t)});Cy=k("ZodBase64URL",(A,t)=>{v0.init(A,t),et.init(A,t)});Ey=k("ZodE164",(A,t)=>{m0.init(A,t),et.init(A,t)});ay=k("ZodJWT",(A,t)=>{W0.init(A,t),et.init(A,t)});NI=k("ZodCustomStringFormat",(A,t)=>{Z0.init(A,t),et.init(A,t)});UI=k("ZodNumber",(A,t)=>{Br.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>EL(A,i,n,o),A.gt=(i,n)=>A.check(ni(i,n)),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.lt=(i,n)=>A.check(gi(i,n)),A.lte=(i,n)=>A.check(xg(i,n)),A.max=(i,n)=>A.check(xg(i,n)),A.int=(i)=>A.check(sr(i)),A.safe=(i)=>A.check(sr(i)),A.positive=(i)=>A.check(ni(0,i)),A.nonnegative=(i)=>A.check(Dg(0,i)),A.negative=(i)=>A.check(gi(0,i)),A.nonpositive=(i)=>A.check(xg(0,i)),A.multipleOf=(i,n)=>A.check(Do(i,n)),A.step=(i,n)=>A.check(Do(i,n)),A.finite=()=>A;let g=A._zod.bag;A.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),A.isFinite=!0,A.format=g.format??null});Je=k("ZodNumberFormat",(A,t)=>{V0.init(A,t),UI.init(A,t)});SI=k("ZodBoolean",(A,t)=>{Uc.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>aL(A,g,i,n)});LI=k("ZodBigInt",(A,t)=>{cr.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>rL(A,i,n,o),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.gt=(i,n)=>A.check(ni(i,n)),A.gte=(i,n)=>A.check(Dg(i,n)),A.min=(i,n)=>A.check(Dg(i,n)),A.lt=(i,n)=>A.check(gi(i,n)),A.lte=(i,n)=>A.check(xg(i,n)),A.max=(i,n)=>A.check(xg(i,n)),A.positive=(i)=>A.check(ni(BigInt(0),i)),A.negative=(i)=>A.check(gi(BigInt(0),i)),A.nonpositive=(i)=>A.check(xg(BigInt(0),i)),A.nonnegative=(i)=>A.check(Dg(BigInt(0),i)),A.multipleOf=(i,n)=>A.check(Do(i,n));let g=A._zod.bag;A.minValue=g.minimum??null,A.maxValue=g.maximum??null,A.format=g.format??null});ry=k("ZodBigIntFormat",(A,t)=>{H0.init(A,t),LI.init(A,t)});rF=k("ZodSymbol",(A,t)=>{X0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>yL(A,g,i,n)});yF=k("ZodUndefined",(A,t)=>{j0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>DL(A,g,i,n)});wF=k("ZodNull",(A,t)=>{K0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wL(A,g,i,n)});DF=k("ZodAny",(A,t)=>{_0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>lL(A,g,i,n)});uF=k("ZodUnknown",(A,t)=>{x0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>NL(A,g,i,n)});bF=k("ZodNever",(A,t)=>{s0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>bL(A,g,i,n)});lF=k("ZodVoid",(A,t)=>{q0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>uL(A,g,i,n)});Hc=k("ZodDate",(A,t)=>{d0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>UL(A,i,n,o),A.min=(i,n)=>A.check(Dg(i,n)),A.max=(i,n)=>A.check(xg(i,n));let g=A._zod.bag;A.minDate=g.minimum?new Date(g.minimum):null,A.maxDate=g.maximum?new Date(g.maximum):null});NF=k("ZodArray",(A,t)=>{p0.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>RL(A,g,i,n),A.element=t.element,A.min=(g,i)=>A.check(Oi(g,i)),A.nonempty=(g)=>A.check(Oi(1,g)),A.max=(g,i)=>A.check(Ge(g,i)),A.length=(g,i)=>A.check(Te(g,i)),A.unwrap=()=>A.element});Xc=k("ZodObject",(A,t)=>{AU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>fL(A,g,i,n),_.defineLazy(A,"shape",()=>{return t.shape}),A.keyof=()=>st(Object.keys(A._zod.def.shape)),A.catchall=(g)=>A.clone({...A._zod.def,catchall:g}),A.passthrough=()=>A.clone({...A._zod.def,catchall:Qt()}),A.loose=()=>A.clone({...A._zod.def,catchall:Qt()}),A.strict=()=>A.clone({...A._zod.def,catchall:wy()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=(g)=>{return _.extend(A,g)},A.safeExtend=(g)=>{return _.safeExtend(A,g)},A.merge=(g)=>_.merge(A,g),A.pick=(g)=>_.pick(A,g),A.omit=(g)=>_.omit(A,g),A.partial=(...g)=>_.partial(uy,A,g[0]),A.required=(...g)=>_.required(by,A,g[0])});jc=k("ZodUnion",(A,t)=>{Sc.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Wr(A,g,i,n),A.options=t.options});UF=k("ZodXor",(A,t)=>{jc.init(A,t),tU.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Wr(A,g,i,n),A.options=t.options});SF=k("ZodDiscriminatedUnion",(A,t)=>{jc.init(A,t),gU.init(A,t)});LF=k("ZodIntersection",(A,t)=>{nU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>OL(A,g,i,n)});FF=k("ZodTuple",(A,t)=>{Cr.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>zL(A,g,i,n),A.rest=(g)=>A.clone({...A._zod.def,rest:g})});_c=k("ZodRecord",(A,t)=>{iU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>vL(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType});YF=k("ZodMap",(A,t)=>{oU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>JL(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType,A.min=(...g)=>A.check(ii(...g)),A.nonempty=(g)=>A.check(ii(1,g)),A.max=(...g)=>A.check(uo(...g)),A.size=(...g)=>A.check($e(...g))});kF=k("ZodSet",(A,t)=>{eU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>PL(A,g,i,n),A.min=(...g)=>A.check(ii(...g)),A.nonempty=(g)=>A.check(ii(1,g)),A.max=(...g)=>A.check(uo(...g)),A.size=(...g)=>A.check($e(...g))});bI=k("ZodEnum",(A,t)=>{QU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(i,n,o)=>SL(A,i,n,o),A.enum=t.entries,A.options=Object.values(t.entries);let g=new Set(Object.keys(t.entries));A.extract=(i,n)=>{let o={};for(let e of i)if(g.has(e))o[e]=t.entries[e];else throw Error(`Key ${e} not found in enum`);return new bI({...t,checks:[],..._.normalizeParams(n),entries:o})},A.exclude=(i,n)=>{let o={...t.entries};for(let e of i)if(g.has(e))delete o[e];else throw Error(`Key ${e} not found in enum`);return new bI({...t,checks:[],..._.normalizeParams(n),entries:o})}});$F=k("ZodLiteral",(A,t)=>{IU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>LL(A,g,i,n),A.values=new Set(t.values),Object.defineProperty(A,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});GF=k("ZodFile",(A,t)=>{hU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>YL(A,g,i,n),A.min=(g,i)=>A.check(ii(g,i)),A.max=(g,i)=>A.check(uo(g,i)),A.mime=(g,i)=>A.check(CI(Array.isArray(g)?g:[g],i))});TF=k("ZodTransform",(A,t)=>{BU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>TL(A,g,i,n),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new Fe(A.constructor.name);g.addIssue=(o)=>{if(typeof o==="string")g.issues.push(_.issue(o,g.value,t));else{let e=o;if(e.fatal)e.continue=!1;e.code??(e.code="custom"),e.input??(e.input=g.value),e.inst??(e.inst=A),g.issues.push(_.issue(e))}};let n=t.transform(g.value,g);if(n instanceof Promise)return n.then((o)=>{return g.value=o,g});return g.value=n,g}});uy=k("ZodOptional",(A,t)=>{Er.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Zr(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});JF=k("ZodExactOptional",(A,t)=>{cU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Zr(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});RF=k("ZodNullable",(A,t)=>{CU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>mL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});fF=k("ZodDefault",(A,t)=>{EU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ZL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});zF=k("ZodPrefault",(A,t)=>{aU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>VL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});by=k("ZodNonOptional",(A,t)=>{rU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>WL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});WF=k("ZodSuccess",(A,t)=>{yU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>kL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});ZF=k("ZodCatch",(A,t)=>{wU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>HL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});HF=k("ZodNaN",(A,t)=>{DU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>FL(A,g,i,n)});ly=k("ZodPipe",(A,t)=>{uU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>XL(A,g,i,n),A.in=t.in,A.out=t.out});Ny=k("ZodCodec",(A,t)=>{ly.init(A,t),Lc.init(A,t)});XF=k("ZodReadonly",(A,t)=>{bU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>jL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});KF=k("ZodTemplateLiteral",(A,t)=>{lU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ML(A,g,i,n)});_F=k("ZodLazy",(A,t)=>{SU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>_L(A,g,i,n),A.unwrap=()=>A._zod.def.getter()});sF=k("ZodPromise",(A,t)=>{UU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>KL(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});qF=k("ZodFunction",(A,t)=>{NU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>GL(A,g,i,n)});xc=k("ZodCustom",(A,t)=>{LU.init(A,t),kA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>$L(A,g,i,n)});R2=IL,f2=hL});function bbA(A){Ft({customError:A})}function lbA(){return Ft().customError}var tM,AM;var m2=r(()=>{sg();tM={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(A){})(AM||(AM={}))});function UbA(A,t){let g=A.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function SbA(A,t){if(!A.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=A.slice(1).split("/").filter(Boolean);if(g.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===i){let n=g[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${A}`);return t.defs[n]}throw Error(`Reference not found: ${A}`)}function W2(A,t){if(A.not!==void 0){if(typeof A.not==="object"&&Object.keys(A.not).length===0)return tA.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(A.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(A.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(A.if!==void 0||A.then!==void 0||A.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(A.dependentSchemas!==void 0||A.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(A.$ref){let n=A.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return tA.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=SbA(n,t),e=Ig(o,t);return t.refs.set(n,e),t.processing.delete(n),e}if(A.enum!==void 0){let n=A.enum;if(t.version==="openapi-3.0"&&A.nullable===!0&&n.length===1&&n[0]===null)return tA.null();if(n.length===0)return tA.never();if(n.length===1)return tA.literal(n[0]);if(n.every((e)=>typeof e==="string"))return tA.enum(n);let o=n.map((e)=>tA.literal(e));if(o.length<2)return o[0];return tA.union([o[0],o[1],...o.slice(2)])}if(A.const!==void 0)return tA.literal(A.const);let g=A.type;if(Array.isArray(g)){let n=g.map((o)=>{let e={...A,type:o};return W2(e,t)});if(n.length===0)return tA.never();if(n.length===1)return n[0];return tA.union(n)}if(!g)return tA.any();let i;switch(g){case"string":{let n=tA.string();if(A.format){let o=A.format;if(o==="email")n=n.check(tA.email());else if(o==="uri"||o==="uri-reference")n=n.check(tA.url());else if(o==="uuid"||o==="guid")n=n.check(tA.uuid());else if(o==="date-time")n=n.check(tA.iso.datetime());else if(o==="date")n=n.check(tA.iso.date());else if(o==="time")n=n.check(tA.iso.time());else if(o==="duration")n=n.check(tA.iso.duration());else if(o==="ipv4")n=n.check(tA.ipv4());else if(o==="ipv6")n=n.check(tA.ipv6());else if(o==="mac")n=n.check(tA.mac());else if(o==="cidr")n=n.check(tA.cidrv4());else if(o==="cidr-v6")n=n.check(tA.cidrv6());else if(o==="base64")n=n.check(tA.base64());else if(o==="base64url")n=n.check(tA.base64url());else if(o==="e164")n=n.check(tA.e164());else if(o==="jwt")n=n.check(tA.jwt());else if(o==="emoji")n=n.check(tA.emoji());else if(o==="nanoid")n=n.check(tA.nanoid());else if(o==="cuid")n=n.check(tA.cuid());else if(o==="cuid2")n=n.check(tA.cuid2());else if(o==="ulid")n=n.check(tA.ulid());else if(o==="xid")n=n.check(tA.xid());else if(o==="ksuid")n=n.check(tA.ksuid())}if(typeof A.minLength==="number")n=n.min(A.minLength);if(typeof A.maxLength==="number")n=n.max(A.maxLength);if(A.pattern)n=n.regex(new RegExp(A.pattern));i=n;break}case"number":case"integer":{let n=g==="integer"?tA.number().int():tA.number();if(typeof A.minimum==="number")n=n.min(A.minimum);if(typeof A.maximum==="number")n=n.max(A.maximum);if(typeof A.exclusiveMinimum==="number")n=n.gt(A.exclusiveMinimum);else if(A.exclusiveMinimum===!0&&typeof A.minimum==="number")n=n.gt(A.minimum);if(typeof A.exclusiveMaximum==="number")n=n.lt(A.exclusiveMaximum);else if(A.exclusiveMaximum===!0&&typeof A.maximum==="number")n=n.lt(A.maximum);if(typeof A.multipleOf==="number")n=n.multipleOf(A.multipleOf);i=n;break}case"boolean":{i=tA.boolean();break}case"null":{i=tA.null();break}case"object":{let n={},o=A.properties||{},e=new Set(A.required||[]);for(let[h,B]of Object.entries(o)){let c=Ig(B,t);n[h]=e.has(h)?c:c.optional()}if(A.propertyNames){let h=Ig(A.propertyNames,t),B=A.additionalProperties&&typeof A.additionalProperties==="object"?Ig(A.additionalProperties,t):tA.any();if(Object.keys(n).length===0){i=tA.record(h,B);break}let c=tA.object(n).passthrough(),C=tA.looseRecord(h,B);i=tA.intersection(c,C);break}if(A.patternProperties){let h=A.patternProperties,B=Object.keys(h),c=[];for(let E of B){let a=Ig(h[E],t),y=tA.string().regex(new RegExp(E));c.push(tA.looseRecord(y,a))}let C=[];if(Object.keys(n).length>0)C.push(tA.object(n).passthrough());if(C.push(...c),C.length===0)i=tA.object({}).passthrough();else if(C.length===1)i=C[0];else{let E=tA.intersection(C[0],C[1]);for(let a=2;a<C.length;a++)E=tA.intersection(E,C[a]);i=E}break}let I=tA.object(n);if(A.additionalProperties===!1)i=I.strict();else if(typeof A.additionalProperties==="object")i=I.catchall(Ig(A.additionalProperties,t));else i=I.passthrough();break}case"array":{let{prefixItems:n,items:o}=A;if(n&&Array.isArray(n)){let e=n.map((h)=>Ig(h,t)),I=o&&typeof o==="object"&&!Array.isArray(o)?Ig(o,t):void 0;if(I)i=tA.tuple(e).rest(I);else i=tA.tuple(e);if(typeof A.minItems==="number")i=i.check(tA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(tA.maxLength(A.maxItems))}else if(Array.isArray(o)){let e=o.map((h)=>Ig(h,t)),I=A.additionalItems&&typeof A.additionalItems==="object"?Ig(A.additionalItems,t):void 0;if(I)i=tA.tuple(e).rest(I);else i=tA.tuple(e);if(typeof A.minItems==="number")i=i.check(tA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(tA.maxLength(A.maxItems))}else if(o!==void 0){let e=Ig(o,t),I=tA.array(e);if(typeof A.minItems==="number")I=I.min(A.minItems);if(typeof A.maxItems==="number")I=I.max(A.maxItems);i=I}else i=tA.array(tA.any());break}default:throw Error(`Unsupported type: ${g}`)}if(A.description)i=i.describe(A.description);if(A.default!==void 0)i=i.default(A.default);return i}function Ig(A,t){if(typeof A==="boolean")return A?tA.any():tA.never();let g=W2(A,t),i=A.type||A.enum!==void 0||A.const!==void 0;if(A.anyOf&&Array.isArray(A.anyOf)){let I=A.anyOf.map((B)=>Ig(B,t)),h=tA.union(I);g=i?tA.intersection(g,h):h}if(A.oneOf&&Array.isArray(A.oneOf)){let I=A.oneOf.map((B)=>Ig(B,t)),h=tA.xor(I);g=i?tA.intersection(g,h):h}if(A.allOf&&Array.isArray(A.allOf))if(A.allOf.length===0)g=i?g:tA.any();else{let I=i?g:Ig(A.allOf[0],t),h=i?0:1;for(let B=h;B<A.allOf.length;B++)I=tA.intersection(I,Ig(A.allOf[B],t));g=I}if(A.nullable===!0&&t.version==="openapi-3.0")g=tA.nullable(g);if(A.readOnly===!0)g=tA.readonly(g);let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let I of o)if(I in A)n[I]=A[I];let e=["contentEncoding","contentMediaType","contentSchema"];for(let I of e)if(I in A)n[I]=A[I];for(let I of Object.keys(A))if(!NbA.has(I))n[I]=A[I];if(Object.keys(n).length>0)t.registry.add(g,n);return g}function Z2(A,t){if(typeof A==="boolean")return A?tA.any():tA.never();let g=UbA(A,t?.defaultTarget),i=A.$defs||A.definitions||{},n={version:g,defs:i,refs:new Map,processing:new Set,rootSchema:A,registry:t?.registry??xt};return Ig(A,n)}var tA,NbA;var V2=r(()=>{Gc();Xr();fc();zc();tA={...Oc,...Hr,iso:Uo},NbA=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 qc={};dn(qc,{string:()=>LbA,number:()=>FbA,date:()=>kbA,boolean:()=>MbA,bigint:()=>YbA});function LbA(A){return MS(lI,A)}function FbA(A){return RS(UI,A)}function MbA(A){return ZS(SI,A)}function YbA(A){return HS(LI,A)}function kbA(A){return tL(Hc,A)}var H2=r(()=>{sg();zc()});var Q={};dn(Q,{xor:()=>b2,xid:()=>j1,void:()=>y2,uuidv7:()=>v1,uuidv6:()=>z1,uuidv4:()=>O1,uuid:()=>f1,util:()=>_,url:()=>pr,uppercase:()=>II,unknown:()=>Qt,union:()=>It,undefined:()=>r2,ulid:()=>X1,uint64:()=>E2,uint32:()=>B2,tuple:()=>MF,trim:()=>aI,treeifyError:()=>yN,transform:()=>Dy,toUpperCase:()=>yI,toLowerCase:()=>rI,toJSONSchema:()=>Vr,templateLiteral:()=>G2,symbol:()=>a2,superRefine:()=>pF,success:()=>Y2,stringbool:()=>z2,stringFormat:()=>n2,string:()=>F,strictObject:()=>u2,startsWith:()=>BI,slugify:()=>wI,size:()=>$e,setErrorMap:()=>bbA,set:()=>S2,safeParseAsync:()=>iF,safeParse:()=>nF,safeEncodeAsync:()=>cF,safeEncode:()=>hF,safeDecodeAsync:()=>CF,safeDecode:()=>BF,registry:()=>ar,regexes:()=>rn,regex:()=>eI,refine:()=>dF,record:()=>pA,readonly:()=>jF,property:()=>vr,promise:()=>T2,prettifyError:()=>wN,preprocess:()=>sc,prefault:()=>vF,positive:()=>Rr,pipe:()=>Wc,partialRecord:()=>l2,parseAsync:()=>gF,parse:()=>tF,overwrite:()=>fn,optional:()=>Bt,object:()=>p,number:()=>vA,nullish:()=>M2,nullable:()=>mc,null:()=>Vc,normalize:()=>EI,nonpositive:()=>Or,nonoptional:()=>mF,nonnegative:()=>zr,never:()=>wy,negative:()=>fr,nativeEnum:()=>L2,nanoid:()=>Z1,nan:()=>k2,multipleOf:()=>Do,minSize:()=>ii,minLength:()=>Oi,mime:()=>CI,meta:()=>f2,maxSize:()=>uo,maxLength:()=>Ge,map:()=>U2,mac:()=>x1,lte:()=>xg,lt:()=>gi,lowercase:()=>QI,looseRecord:()=>N2,looseObject:()=>Mt,locales:()=>$c,literal:()=>QA,length:()=>Te,lazy:()=>xF,ksuid:()=>K1,keyof:()=>D2,jwt:()=>g2,json:()=>v2,iso:()=>Uo,ipv6:()=>s1,ipv4:()=>_1,intersection:()=>FI,int64:()=>C2,int32:()=>h2,int:()=>sr,instanceof:()=>O2,includes:()=>hI,httpUrl:()=>m1,hostname:()=>i2,hex:()=>o2,hash:()=>e2,guid:()=>R1,gte:()=>Dg,gt:()=>ni,globalRegistry:()=>xt,getErrorMap:()=>lbA,function:()=>J2,fromJSONSchema:()=>Z2,formatError:()=>uc,float64:()=>I2,float32:()=>Q2,flattenError:()=>Dc,file:()=>F2,exactOptional:()=>PF,enum:()=>st,endsWith:()=>cI,encodeAsync:()=>QF,encode:()=>oF,emoji:()=>W1,email:()=>P1,e164:()=>t2,discriminatedUnion:()=>Kc,describe:()=>R2,decodeAsync:()=>IF,decode:()=>eF,date:()=>w2,custom:()=>Uy,cuid2:()=>H1,cuid:()=>V1,core:()=>zi,config:()=>Ft,coerce:()=>qc,codec:()=>$2,clone:()=>wg,cidrv6:()=>d1,cidrv4:()=>q1,check:()=>P2,catch:()=>VF,boolean:()=>qA,bigint:()=>c2,base64url:()=>A2,base64:()=>p1,array:()=>q,any:()=>yy,_function:()=>J2,_default:()=>OF,_ZodString:()=>qr,ZodXor:()=>UF,ZodXID:()=>oy,ZodVoid:()=>lF,ZodUnknown:()=>uF,ZodUnion:()=>jc,ZodUndefined:()=>yF,ZodUUID:()=>oi,ZodURL:()=>Zc,ZodULID:()=>iy,ZodType:()=>kA,ZodTuple:()=>FF,ZodTransform:()=>TF,ZodTemplateLiteral:()=>KF,ZodSymbol:()=>rF,ZodSuccess:()=>WF,ZodStringFormat:()=>et,ZodString:()=>lI,ZodSet:()=>kF,ZodRecord:()=>_c,ZodRealError:()=>Gg,ZodReadonly:()=>XF,ZodPromise:()=>sF,ZodPrefault:()=>zF,ZodPipe:()=>ly,ZodOptional:()=>uy,ZodObject:()=>Xc,ZodNumberFormat:()=>Je,ZodNumber:()=>UI,ZodNullable:()=>RF,ZodNull:()=>wF,ZodNonOptional:()=>by,ZodNever:()=>bF,ZodNanoID:()=>ty,ZodNaN:()=>HF,ZodMap:()=>YF,ZodMAC:()=>aF,ZodLiteral:()=>$F,ZodLazy:()=>_F,ZodKSUID:()=>ey,ZodJWT:()=>ay,ZodIssueCode:()=>tM,ZodIntersection:()=>LF,ZodISOTime:()=>_r,ZodISODuration:()=>xr,ZodISODateTime:()=>jr,ZodISODate:()=>Kr,ZodIPv6:()=>Iy,ZodIPv4:()=>Qy,ZodGUID:()=>vc,ZodFunction:()=>qF,ZodFirstPartyTypeKind:()=>AM,ZodFile:()=>GF,ZodExactOptional:()=>JF,ZodError:()=>DbA,ZodEnum:()=>bI,ZodEmoji:()=>Ay,ZodEmail:()=>dr,ZodE164:()=>Ey,ZodDiscriminatedUnion:()=>SF,ZodDefault:()=>fF,ZodDate:()=>Hc,ZodCustomStringFormat:()=>NI,ZodCustom:()=>xc,ZodCodec:()=>Ny,ZodCatch:()=>ZF,ZodCUID2:()=>ny,ZodCUID:()=>gy,ZodCIDRv6:()=>By,ZodCIDRv4:()=>hy,ZodBoolean:()=>SI,ZodBigIntFormat:()=>ry,ZodBigInt:()=>LI,ZodBase64URL:()=>Cy,ZodBase64:()=>cy,ZodArray:()=>NF,ZodAny:()=>DF,TimePrecision:()=>kS,NEVER:()=>Bc,$output:()=>US,$input:()=>SS,$brand:()=>eN});var Sy=r(()=>{sg();sg();RU();sg();Rc();V2();NS();fc();fc();H2();zc();Xr();AF();EF();m2();Ft(Fc())});var JA=r(()=>{Sy();Sy()});var X2,j2,K2,_2,x2,s2,q2,d2,p2,Am,tm,gm,nm,gM,$bA,nM,im,GbA,iM="cursor",oM="GET",eM="control",QM="[DONE]";var om=r(()=>{JA();X2=Q.object({type:Q.literal("run_started"),runId:Q.string().describe("Server-assigned run ID for the started run.")}),j2=Q.object({type:Q.literal("message_started"),messageId:Q.string().describe("Server-assigned assistant message ID for this run.")}),K2=Q.object({type:Q.literal("text_chunk"),messageId:Q.string().describe("Assistant message the chunk belongs to."),content:Q.string().describe("Incremental text delta to append.")}),_2=Q.object({type:Q.literal("reasoning_chunk"),messageId:Q.string().describe("Assistant message the chunk belongs to."),content:Q.string().describe("Incremental reasoning delta to append.")}),x2=Q.object({type:Q.literal("text_complete"),messageId:Q.string().describe("Assistant message that completed."),content:Q.string().describe("Full assistant text for the message.")}),s2=Q.object({type:Q.literal("reasoning_complete"),messageId:Q.string().describe("Assistant message that completed."),content:Q.string().describe("Full reasoning text for the message.")}),q2=Q.object({type:Q.literal("tool_call_pending"),toolCallId:Q.string().describe("Stable identifier for the tool call."),name:Q.string().describe("Name of the tool being called.")}),d2=Q.object({type:Q.literal("tool_call_start"),toolCallId:Q.string().describe("Stable identifier for the tool call."),name:Q.string().describe("Name of the tool being called."),params:Q.unknown().describe("Resolved tool input params.")}),p2=Q.object({type:Q.literal("tool_call_complete"),toolCallId:Q.string().describe("Stable identifier for the tool call."),status:Q.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:Q.unknown().optional().describe("Tool output, when available."),durationMs:Q.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),Am=Q.object({type:Q.literal("artifact"),name:Q.string().describe("Artifact kind (for example table, timeseries)."),data:Q.unknown().describe("Artifact payload; shape depends on name."),toolCallId:Q.string().describe("Tool call that produced the artifact.")}),tm=Q.object({type:Q.literal("error"),message:Q.string().describe("Human-readable error message."),name:Q.string().optional().describe("Optional error class/name.")}),gm=Q.object({type:Q.literal("stream_reset"),messageId:Q.string().describe("Assistant message whose content to reset.")}),nm=Q.object({type:Q.literal("disconnected")}),gM=Q.discriminatedUnion("type",[X2,j2,K2,_2,x2,s2,q2,d2,p2,Am,tm,gm,nm]),$bA=Q.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),nM=Q.object({streamNextOffset:Q.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),im=Q.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),GbA=Q.object({cursor:im.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var S=(A)=>{let t={operationId:A.operationId,backend:A.backend,pagination:A.pagination,async:A.async,examples:A.examples??[]};return{...A,contract:sz.$meta(t).route({method:A.route.method,path:A.route.path,tags:A.route.tags,operationId:A.operationId,summary:A.summary,description:A.description,successStatus:A.route.successStatus,successDescription:A.route.successDescription,deprecated:A.route.deprecated,inputStructure:A.route.inputStructure}).input(A.input).output(A.output)}};var em=r(()=>{gN()});var Qm=r(()=>{em()});var KA=r(()=>{Qm()});var pc,hm,Bm,cm,Cm,Em,am,rm,ym,wm,TbA,cM,Dm,Ly,Fy,MI,My,Yy,um,bm,ky,lm,Nm,YI,IM,JbA,Um,Sm,Lm,PbA,Fm,Mm,Ym,CM,km,$m,Gm,$y,Gy,Ty,Jy,AC,Tm,hM,Jm,tC,EM,Pm,Rm,RbA,fbA,aM,fm,Om,zm,vm,mm,Wm,Zm,rM,Py,Ry,fy,Oy,yM,Vm,BM,dc,wM,ObA,zy,Hm,Xm,jm,Km,Im,_m,xm,sm,vy,my,qm,DM,dm,pm,AW,tW,gW,Wy,Zy,zbA;var uM=r(()=>{JA();KA();pc=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),description:Q.string().nullable(),origin:Q.enum(["user_declared","code_detected","log_observed"]),lifecycle:Q.enum(["active","retired","merged"]),observationState:Q.enum(["observed","stale","unobserved"]),registryRevision:Q.number().int().nonnegative(),canonicalComponentId:Q.string().uuid(),mergedIntoComponentId:Q.string().uuid().nullable(),currentStatus:Q.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:Q.string().datetime(),lastSeenAt:Q.string().datetime(),deletedAt:Q.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:Q.string().datetime().nullable(),retirementReason:Q.string().nullable(),legacyStateUnknown:Q.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),hm=Q.object({projectId:Q.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),Bm=Q.object({components:Q.array(pc),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cm=Q.object({componentId:Q.string().uuid().describe("Component ID to retrieve.")}),Cm=Q.object({component:pc}),Em=Q.object({projectId:Q.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:Q.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:Q.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:Q.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),am=Q.object({component:pc}),rm=Q.object({componentId:Q.string().uuid().describe("Active component ID to rename."),name:Q.string().trim().min(1,"Name is required"),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),ym=Q.object({component:pc}),wm=Q.object({componentId:Q.string().uuid().describe("Component ID to deregister."),reason:Q.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),TbA=Q.object({openIssueIds:Q.array(Q.string().uuid()),activeComponentIssueIds:Q.array(Q.string().uuid()),automationBindingIds:Q.array(Q.string().uuid()),notificationRuleIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),observationIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid()),externalIncidentIds:Q.array(Q.string().uuid()),authorizedDeliveryIds:Q.array(Q.string().uuid()),authorizedAutomationRunIds:Q.array(Q.string().uuid())}),cM=Q.object({requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),canonicalComponentName:Q.string(),lifecycle:Q.enum(["active","retired"]),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),requiresCanonicalGroupConfirmation:Q.boolean(),recommendationScopeEnabled:Q.literal(!1),dependents:TbA,counts:Q.record(Q.string(),Q.number().int().nonnegative())}),Dm=Q.discriminatedUnion("status",[Q.object({status:Q.literal("observation_withdrawn"),componentId:Q.string().uuid(),sourceType:Q.literal("secret_key"),withdrawn:Q.boolean()}),Q.object({status:Q.literal("retirement_confirmation_required"),preview:cM})]),Ly=S({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:hm,output:Bm,pagination:"cursor",async:"sync"}),Fy=S({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:cm,output:Cm,pagination:"none",async:"sync"}),MI=S({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:Em,output:am,pagination:"none",async:"sync"}),My=S({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:wm,output:Dm,pagination:"none",async:"sync"}),Yy=S({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:rm,output:ym,pagination:"none",async:"sync"}),um=Q.object({componentId:Q.string().uuid().describe("Component whose owning team to set."),teamId:Q.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),bm=Q.object({componentId:Q.string().uuid().describe("Component that was updated."),teamId:Q.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),ky=S({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:um,output:bm,pagination:"none",async:"sync"}),lm=Q.object({componentId:Q.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),Nm=Q.object({preview:cM}),YI=Q.record(Q.string().uuid(),Q.number().int().nonnegative()),IM=Q.object({id:Q.string().uuid(),rowRevision:Q.number().int().nonnegative()}),JbA=Q.object({notificationRules:Q.array(IM),automationBindings:Q.array(IM),relationships:Q.array(IM)}),Um=Q.object({componentId:Q.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:YI.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:Q.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),Sm=Q.object({operationId:Q.string().uuid(),status:Q.enum(["committed","complete","followup_failed"]),requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),counts:Q.record(Q.string(),Q.number().int().nonnegative()),authorizedDeliveryIds:Q.array(Q.string().uuid()),authorizedAutomationRunIds:Q.array(Q.string().uuid()),manualExternalIncidentIds:Q.array(Q.string().uuid()),issueAutomationSuppressions:Q.number().int().nonnegative(),outboxEffectCount:Q.number().int().nonnegative(),manifest:JbA,followups:Q.record(Q.string(),Q.unknown()).optional()}),Lm=Q.object({result:Sm}),PbA=Q.object({notificationRuleIds:Q.array(Q.string().uuid()),automationBindingIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid())}),Fm=Q.object({componentId:Q.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:Q.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),Mm=Q.object({requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),canonicalComponentName:Q.string(),retirementOperationId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:YI,eligible:PbA}),Ym=Q.object({preview:Mm}),CM=Q.object({notificationRuleIds:Q.array(Q.string().uuid()).default([]),automationBindingIds:Q.array(Q.string().uuid()).default([]),recommendationScopeIds:Q.array(Q.string().uuid()).default([]),relationshipIds:Q.array(Q.string().uuid()).default([])}),km=Q.object({componentId:Q.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:Q.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:YI.describe("Exact canonical-group revisions returned by restorationPreview."),selections:CM.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),$m=Q.object({operationId:Q.string().uuid(),status:Q.literal("complete"),requestedComponentId:Q.string().uuid(),canonicalComponentId:Q.string().uuid(),affectedComponentIds:Q.array(Q.string().uuid()),restored:CM}),Gm=Q.object({result:$m}),$y=S({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:lm,output:Nm,pagination:"none",async:"sync"}),Gy=S({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:Um,output:Lm,pagination:"none",async:"sync"}),Ty=S({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:Fm,output:Ym,pagination:"none",async:"sync"}),Jy=S({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:km,output:Gm,pagination:"none",async:"sync"}),AC=Q.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),Tm=Q.enum(["observed","stale","unobserved"]),hM=Q.object({originalComponentId:Q.string().uuid(),effectiveComponentId:Q.string().uuid(),name:Q.string(),lifecycle:Q.enum(["active","retired","merged"]),observationState:Tm}),Jm=Q.object({id:Q.string().uuid(),source:hM,target:hM,relationshipType:AC,createdAt:Q.string().datetime(),endedAt:Q.string().datetime().nullable(),endReason:Q.string().nullable(),rowRevision:Q.number().int().nonnegative()}),tC=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),EM=Q.object({sourceComponentId:Q.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:Q.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:AC}),Pm=tC.extend({includeHistorical:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("Include historically ended relationships.")}),Rm=Q.object({relationships:Q.array(Jm)}),RbA=Q.object({ruleId:Q.string().uuid(),ruleGroupId:Q.string().uuid().nullable(),ownerComponentId:Q.string().uuid(),destinationIds:Q.array(Q.string().uuid()),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),fbA=Q.object({bindingId:Q.string().uuid(),automationId:Q.string().uuid(),ownerComponentId:Q.string().uuid(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),aM=Q.object({notificationRules:Q.array(RbA),automationBindings:Q.array(fbA)}),fm=EM.extend({action:Q.enum(["add","remove"]),organizationId:Q.string(),projectId:Q.string().uuid(),relationshipId:Q.string().uuid().nullable(),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),policyImpact:aM,confirmationRequired:Q.boolean()}),Om=tC.merge(EM).extend({action:Q.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),zm=Q.object({preview:fm}),vm=tC.merge(EM).extend({requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:Q.string().trim().min(1,"Reason cannot be empty"),componentRevisions:Q.record(Q.string().uuid(),Q.number().int().nonnegative()),confirmPolicyImpact:Q.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),mm=vm,Wm=vm,Zm=Q.object({action:Q.enum(["add","remove"]),relationshipId:Q.string().uuid(),sourceComponentId:Q.string().uuid(),targetComponentId:Q.string().uuid(),relationshipType:AC,policyImpact:aM}),rM=Q.object({result:Zm}),Py=S({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:Pm,output:Rm,pagination:"none",async:"sync"}),Ry=S({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:Om,output:zm,pagination:"none",async:"sync"}),fy=S({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:mm,output:rM,pagination:"none",async:"sync"}),Oy=S({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:Wm,output:rM,pagination:"none",async:"sync"}),yM=Q.enum(["suspend","move"]),Vm=Q.object({disposition:yM,beforeComponentIds:Q.array(Q.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:Q.array(Q.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),BM=Q.object({kind:Q.enum(["notification_rule","automation_binding"]),policyId:Q.string().uuid(),sourceRowRevision:Q.number().int().nonnegative(),sourceComponentId:Q.string().uuid(),equivalentPolicyId:Q.string().uuid().nullable(),equivalent:Q.boolean(),defaultDisposition:Q.enum(["deduplicate","suspend"]),allowedDispositions:Q.array(yM),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),dc=Q.object({kind:Q.enum(["notification_rule","automation_binding"]),policyId:Q.string().uuid(),ownerComponentId:Q.string().uuid(),rowRevision:Q.number().int().nonnegative(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),wM=Q.object({relationshipId:Q.string().uuid(),action:Q.enum(["rewire","close_self","close_duplicate"]),relationshipType:AC,beforeSourceComponentId:Q.string().uuid(),beforeTargetComponentId:Q.string().uuid(),afterSourceComponentId:Q.string().uuid(),afterTargetComponentId:Q.string().uuid(),survivingRelationshipId:Q.string().uuid().nullable(),beforeRowRevision:Q.number().int().nonnegative(),afterRowRevision:Q.number().int().nonnegative().nullable()}),ObA=Q.object({openIssueIds:Q.array(Q.string().uuid()),componentIssueIds:Q.array(Q.string().uuid()),observationIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),nameIds:Q.array(Q.string().uuid()),relationshipIds:Q.array(Q.string().uuid()),recommendationScopeIds:Q.array(Q.string().uuid())}),zy=Q.object({sourceComponentId:Q.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:Q.string().uuid().describe("Active terminal component that becomes the canonical target.")}),Hm=tC.merge(zy),Xm=zy.extend({organizationId:Q.string(),projectId:Q.string().uuid(),sourceGroupComponentIds:Q.array(Q.string().uuid()),targetGroupComponentIds:Q.array(Q.string().uuid()),affectedComponentIds:Q.array(Q.string().uuid()),componentRevisions:YI,inventory:ObA,notificationPolicies:Q.array(BM),automationBindings:Q.array(BM),notificationScopeChanges:Q.array(dc),automationScopeChanges:Q.array(dc),relationshipChanges:Q.array(wM),recommendationScopeEnabled:Q.literal(!1),dependentCount:Q.number().int().nonnegative(),ordinaryTransactionLimit:Q.number().int().positive(),operatorAssistanceRequired:Q.boolean(),confirmationRequired:Q.boolean()}),jm=Q.object({preview:Xm}),Km=tC.merge(zy).extend({requestId:Q.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:Q.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:YI.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:Q.record(Q.string().uuid(),Vm).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:Q.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),Im=Q.object({policyId:Q.string().uuid(),action:Q.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:Q.string().uuid().nullable(),beforeRowRevision:Q.number().int().nonnegative(),afterRowRevision:Q.number().int().nonnegative(),beforeComponentIds:Q.array(Q.string().uuid()),afterComponentIds:Q.array(Q.string().uuid())}),_m=Q.object({componentRevisions:YI,redirectedComponentIds:Q.array(Q.string().uuid()),dataSourceMappingIds:Q.array(Q.string().uuid()),movedAliasIds:Q.array(Q.string().uuid()),historicalDisplayIds:Q.array(Q.string().uuid()),relationshipChanges:Q.array(wM),notificationPolicies:Q.array(Im),automationBindings:Q.array(Im),notificationScopeChanges:Q.array(dc),automationScopeChanges:Q.array(dc),recommendationScopeIds:Q.array(Q.string().uuid())}),xm=zy.extend({operationId:Q.string().uuid(),status:Q.literal("complete"),affectedComponentIds:Q.array(Q.string().uuid()),manifest:_m}),sm=Q.object({result:xm}),vy=S({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:Hm,output:jm,pagination:"none",async:"sync"}),my=S({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:Km,output:sm,pagination:"none",async:"sync"}),qm=Q.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),DM=Q.object({id:Q.string().uuid(),componentId:Q.string().uuid(),projectId:Q.string().uuid(),severity:qm,summary:Q.string().describe("Human-readable summary of the status-page issue."),startedAt:Q.string().datetime().describe("When the incident began affecting the component."),resolvedAt:Q.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),dm=Q.object({projectId:Q.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:Q.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),pm=Q.object({incidents:Q.array(DM),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AW=Q.object({timestamp:Q.string().datetime(),status:Q.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),tW=Q.object({componentId:Q.string().uuid().describe("Component to build the timeline for."),windowStart:Q.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:Q.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),gW=Q.object({componentId:Q.string().uuid(),windowStart:Q.string().datetime(),windowEnd:Q.string().datetime(),timeline:Q.array(AW),incidents:Q.array(DM)}),Wy=S({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:dm,output:pm,pagination:"cursor",async:"sync"}),Zy=S({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:tW,output:gW,pagination:"none",async:"sync"}),zbA={list:Ly.contract,get:Fy.contract,register:MI.contract,deregister:My.contract,rename:Yy.contract,assignTeam:ky.contract,retirementPreview:$y.contract,retire:Gy.contract,restorationPreview:Ty.contract,restore:Jy.contract,mergePreview:vy.contract,merge:my.contract,relationships:{list:Py.contract,preview:Ry.contract,add:fy.contract,remove:Oy.contract},incidents:{list:Wy.contract},timeline:Zy.contract}});var Vy,bM,nW,iW,lM,oW,eW,QW,NM,IW,hW,BW,UM,cW,CW,SM;var LM=r(()=>{JA();KA();Vy=["github","google","microsoft","linear","bitbucket","slack"],bM=Q.enum(Vy),nW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted."),provider:bM.describe("Connected-account provider to connect.")}),iW=Q.object({url:Q.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:Q.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:Q.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),lM=S({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:nW,output:iW,pagination:"none",async:"sync"}),oW=Q.enum(["pending","completed","failed","expired"]),eW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:Q.string().uuid().describe("Connect attempt ID to poll.")}),QW=Q.object({status:oW.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:Q.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),NM=S({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:eW,output:QW,pagination:"none",async:"sync"}),IW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted.")}),hW=Q.object({provider:Q.string().describe("Provider identifier."),externalName:Q.string().nullable().describe("Display name from the provider."),externalLogin:Q.string().nullable().describe("Username or login from the provider."),connectedAt:Q.string().datetime().nullable().describe("When the account was connected."),authMode:Q.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:Q.boolean().describe("Whether the token is expired and a reconnect is required.")}),BW=Q.object({accounts:Q.array(hW)}),UM=S({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:IW,output:BW,pagination:"none",async:"sync"}),cW=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted."),provider:bM.describe("Provider to disconnect.")}),CW=Q.object({success:Q.literal(!0)}),SM=S({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:cW,output:CW,pagination:"none",async:"sync"})});var Pe,FM,EW,aW,vbA,mbA,WbA,rW,gC,ZbA,VbA,HbA,XbA,jbA,KbA,_bA,xbA,sbA,qbA,dbA,pbA,MM,YM,kM,$M,GM,TM,AlA,tlA,glA,nlA,JM,PM,ilA,olA,elA,QlA,RM,Eht;var yW=r(()=>{JA();KA();Pe=Q.string().uuid().describe("Automation ID."),FM=Q.enum(["running","succeeded","failed","timed_out","cancelled"]),EW=Q.object({id:Q.string().uuid(),automationRunKey:Q.string(),status:FM,startedAt:Q.string().datetime(),completedAt:Q.string().datetime().nullable(),durationMs:Q.number().int().nullable(),exitCode:Q.number().int().nullable()}),aW=EW.extend({scheduledAt:Q.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:Q.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:Q.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),vbA=aW.extend({automationId:Q.string().uuid().describe("Automation that owns this run.")}),mbA=Q.enum(["script","log_match"]),WbA=Q.enum(["expression_matched"]),rW=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),kind:mbA.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:Q.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:Q.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),logMatchExpressionId:Q.string().uuid().nullable().describe("Log-match expression bound to this automation. Null for script automations."),signalType:WbA.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:Q.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:Q.boolean(),cronExpression:Q.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:Q.string(),timeoutSeconds:Q.number().int().nullable(),health:Q.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:EW.nullable(),successRate:Q.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:Q.number().int().describe("Total runs over the last 7 days."),failedRunCount:Q.number().int().describe("Failed or timed-out runs over the last 7 days.")}),gC=rW.extend({createdAt:Q.string().datetime(),updatedAt:Q.string().datetime(),recordedHistoryStartsAt:Q.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:Q.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:Q.boolean().describe("Whether the caller may enable or disable this automation.")}),ZbA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:Q.string().optional().describe("Case-insensitive partial match on automation name."),status:Q.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:Q.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:Q.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:Q.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),VbA=Q.object({automations:Q.array(rW),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),HbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),XbA=Q.object({automation:gC}),jbA=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().min(1).max(200).describe("Automation name."),description:Q.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:Q.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:Q.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:Q.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:Q.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:Q.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:Q.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:Q.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((A,t)=>{let g=A.scriptId!=null,i=A.script!=null,n=A.expressionId!=null;if(Number(g)+Number(i)+Number(n)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(n){if(A.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(A.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(A.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!A.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),KbA=Q.object({automation:gC}),_bA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:Q.string().min(1).max(200).optional().describe("New automation name."),description:Q.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:Q.string().optional().describe("New cron schedule."),timezone:Q.string().optional().describe("New IANA timezone."),timeoutSeconds:Q.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),xbA=Q.object({automation:gC}),sbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),qbA=Q.object({automation:gC}),dbA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),pbA=Q.object({automation:gC}),MM=S({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:ZbA,output:VbA,pagination:"cursor",async:"sync"}),YM=S({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:HbA,output:XbA,pagination:"none",async:"sync"}),kM=S({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a log-match investigation bound to an expression (see logMatchExpressions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:jbA,output:KbA,pagination:"none",async:"sync"}),$M=S({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:_bA,output:xbA,pagination:"none",async:"sync"}),GM=S({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:sbA,output:qbA,pagination:"none",async:"sync"}),TM=S({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:dbA,output:pbA,pagination:"none",async:"sync"}),AlA=Q.object({automationId:Pe,projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:Q.union([FM,Q.array(FM)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),tlA=Q.object({runs:Q.array(aW),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:Q.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),glA=Q.object({automationId:Pe,runId:Q.string().uuid().describe("Automation run ID."),projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),nlA=Q.object({run:vbA}),JM=S({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:AlA,output:tlA,pagination:"cursor",async:"sync"}),PM=S({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:glA,output:nlA,pagination:"none",async:"sync"}),ilA=Q.enum(["queued","running","succeeded","failed","timed_out"]),olA=Q.object({stdout:Q.string().describe("Captured standard output for the run."),stderr:Q.string().describe("Captured standard error for the run."),exitCode:Q.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:ilA.describe("Execution status of the run's captured command."),truncated:Q.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:Q.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:Q.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:Q.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),elA=Q.object({automationId:Pe,runId:Q.string().uuid().describe("Automation run ID."),projectId:Q.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),QlA=Q.object({logs:olA}),RM=S({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:elA,output:QlA,pagination:"none",async:"sync"}),Eht={list:MM.contract,get:YM.contract,create:kM.contract,update:$M.contract,enable:GM.contract,disable:TM.contract,runs:{list:JM.contract,get:PM.contract,logs:RM.contract}}});var IlA,hlA,wW,BlA,clA,ClA,ElA,alA,rlA,ylA,wlA,DlA,ulA,blA,llA,NlA,UlA,OM,zM,vM,mM,ei,DW,fM,WM,SlA,uW,LlA,FlA,MlA,YlA,klA,$lA,GlA,TlA,JlA,PlA,RlA,flA,OlA,zlA,vlA,mlA,WlA,ZlA,ZM,VM,HM,XM,jM,KM,_M,xM,sM,qM,wht;var bW=r(()=>{JA();KA();IlA=Q.enum(["logs_ingested_bytes","logs_accepted_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),hlA=Q.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),wW=Q.object({startsAt:Q.string().datetime(),endsAt:Q.string().datetime(),billableStartsAt:Q.string().datetime()}),BlA=Q.object({subscriptionChargeAmount:Q.string(),creditDeficitAmount:Q.string(),creditDeficitChargeAmount:Q.string(),totalAmount:Q.string(),currency:Q.string()}),clA=Q.object({billingSubscriptionChangeId:Q.string(),effectiveAt:Q.string().datetime(),planSlug:Q.string().nullable(),planName:Q.string().nullable(),price:Q.string().nullable(),currency:Q.string().nullable(),targetCreditBalance:Q.string().nullable()}),ClA=Q.object({id:Q.string(),status:Q.string(),billingPlanId:Q.string(),priceBookId:Q.string(),cycleType:Q.string()}),ElA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted.")}),alA=Q.object({status:Q.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:Q.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:Q.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:Q.string().nullable(),scheduledAttemptsMade:Q.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:Q.string().datetime().nullable(),billingInvoiceId:Q.string().nullable(),hostedInvoiceUrl:Q.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),rlA=Q.object({billingModel:Q.enum(["credit-balance-v1"]),billable:Q.boolean(),nonBillableReason:Q.string().nullable(),status:Q.string(),planName:Q.string().nullable(),planSlug:Q.string().nullable(),currency:Q.string().nullable(),currentBalance:Q.string().nullable(),targetCreditBalance:Q.string().nullable(),currentCycle:wW.nullable(),currentPeriodEstimate:BlA.nullable(),pendingDowngrade:clA.nullable(),subscription:ClA.nullable(),collection:alA}),ylA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted."),cycle:Q.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),wlA=Q.object({dimension:IlA,totalQuantity:Q.string(),ratedQuantity:Q.string(),creditsConsumed:Q.string(),sourceBreakdown:Q.record(Q.string(),Q.string())}),DlA=Q.object({cycle:wW.nullable(),usage:Q.array(wlA)}),ulA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:Q.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),blA=Q.object({id:Q.string(),transactionType:hlA,creditDelta:Q.string(),balanceAfter:Q.string(),occurredAt:Q.string().datetime(),billingInvoiceId:Q.string().nullable()}),llA=Q.object({items:Q.array(blA),pagination:Q.object({page:Q.number(),limit:Q.number(),total:Q.number(),totalPages:Q.number(),hasNext:Q.boolean(),hasPrev:Q.boolean()}).describe("Pagination metadata for the transaction list.")}),NlA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization whose outstanding balance to retry. Auto-filled from CLI and SDK context when omitted."),idempotencyKey:Q.string().uuid().describe("Client-generated UUID. Repeating a request with the same key returns the retry already in flight instead of charging again.")}),UlA=Q.object({accepted:Q.literal(!0),workflowId:Q.string().describe("Durable retry execution id; poll `billing.getSummary` for the outcome."),runId:Q.string()}),OM=S({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:ElA,output:rlA,pagination:"none",async:"sync"}),zM=S({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:ylA,output:DlA,pagination:"none",async:"sync"}),vM=S({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:ulA,output:llA,pagination:"page",async:"sync"}),mM=S({operationId:"billing.retryOutstandingBalance",description:"Re-attempt payment of the organization's outstanding negative-balance settlement invoice with the saved payment method. Requires `billing:manage` for user credentials or an organization-scoped API key. Poll `billing.getSummary` (`collection`) for the outcome.",backend:"api",route:{method:"POST",path:"/billing/outstanding-balance/retry",tags:["Billing"]},input:NlA,output:UlA,pagination:"none",async:"sync"}),ei=Q.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),DW=Q.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),fM=DW.refine((A)=>{let[,t=""]=A.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places"),WM=Q.string().trim().min(1).max(100),SlA=Q.object({organizationId:ei}),uW=Q.object({supported:Q.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:Q.boolean(),triggerCreditBalance:Q.string(),topUpAmount:Q.string(),cycleSpendingLimit:Q.string(),currency:Q.string(),creditsToGrant:Q.string().nullable(),status:Q.string()}),LlA=Q.object({organizationId:ei,enabled:Q.boolean(),triggerCreditBalance:DW,topUpAmount:fM,cycleSpendingLimit:fM}),FlA=Q.object({organizationId:ei,amount:fM.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:Q.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),MlA=Q.object({status:Q.enum(["paid","pending_payment","failed"]),billingInvoiceId:Q.string(),topUpAmount:Q.string(),creditsToGrant:Q.string(),currency:Q.string()}),YlA=Q.object({organizationId:ei}),klA=Q.object({slug:Q.string(),billingModel:Q.string(),name:Q.string(),description:Q.string(),bestFor:Q.string().nullable(),price:Q.string(),currency:Q.string(),targetCreditBalance:Q.string().nullable(),logsIncludedBytes:Q.string(),inputTokensIncluded:Q.string(),outputTokensIncluded:Q.string()}),$lA=Q.object({billingModel:Q.string(),currentPlanSlug:Q.string().nullable(),hasActiveStripeBilling:Q.boolean(),plans:Q.array(klA)}),GlA=Q.object({organizationId:ei,planSlug:WM}),TlA=Q.object({type:Q.enum(["upgrade","downgrade"]),effectiveAt:Q.string().datetime(),currency:Q.string(),currentPlanSlug:Q.string(),targetPlanSlug:Q.string(),currentPlanName:Q.string(),targetPlanName:Q.string(),currentPlanPrice:Q.string(),targetPlanPrice:Q.string(),currentTargetCreditBalance:Q.string(),targetCreditBalance:Q.string(),creditDeficitAmount:Q.string(),creditDeficitChargeAmount:Q.string(),additionalCreditPrice:Q.string(),immediateChargeAmount:Q.string(),subscriptionChargeAmount:Q.string(),proratedCreditGrantAmount:Q.string(),remainingCycleFraction:Q.string(),nextCycleChargeAmount:Q.string()}),JlA=Q.object({organizationId:ei,planSlug:WM}),PlA=Q.object({billingSubscriptionChangeId:Q.string(),billingSubscriptionId:Q.string(),status:Q.string(),type:Q.string(),effectiveAt:Q.string().datetime(),invoiceId:Q.string().nullable(),creditDeficitAmount:Q.string().optional(),creditDeficitChargeAmount:Q.string().optional(),creditTopUpAmount:Q.string().optional(),immediateChargeAmount:Q.string().optional(),subscriptionChargeAmount:Q.string().optional(),proratedCreditGrantAmount:Q.string().optional()}),RlA=Q.object({organizationId:ei,planSlug:WM}),flA=Q.object({sessionId:Q.string(),checkoutUrl:Q.string().url()}),OlA=Q.object({organizationId:ei,sessionId:Q.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),zlA=Q.object({status:Q.enum(["pending","active","expired"])}),vlA=Q.object({organizationId:ei}),mlA=Q.object({portalUrl:Q.string().url()}),WlA=Q.object({organizationId:ei}),ZlA=Q.object({hasPaymentMethod:Q.boolean(),brand:Q.string().nullable(),last4:Q.string().nullable(),display:Q.string().nullable()}),ZM=S({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:SlA,output:uW,pagination:"none",async:"sync"}),VM=S({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:LlA,output:uW,pagination:"none",async:"sync"}),HM=S({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:FlA,output:MlA,pagination:"none",async:"sync"}),XM=S({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:YlA,output:$lA,pagination:"none",async:"sync"}),jM=S({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:GlA,output:TlA,pagination:"none",async:"sync"}),KM=S({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:JlA,output:PlA,pagination:"none",async:"sync"}),_M=S({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:RlA,output:flA,pagination:"none",async:"sync"}),xM=S({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:OlA,output:zlA,pagination:"none",async:"sync"}),sM=S({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:vlA,output:mlA,pagination:"none",async:"sync"}),qM=S({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:WlA,output:ZlA,pagination:"none",async:"sync"}),wht={getSummary:OM.contract,getUsage:zM.contract,listTransactions:vM.contract,retryOutstandingBalance:mM.contract,getAutoTopUp:ZM.contract,updateAutoTopUp:VM.contract,purchaseCredits:HM.contract,listPlans:XM.contract,previewPlanChange:jM.contract,changePlan:KM.contract,createCheckoutSession:_M.contract,getCheckoutSessionStatus:xM.contract,createPortalSession:sM.contract,getPaymentMethod:qM.contract}});var VlA,nC,HlA,XlA,jlA,KlA,_lA,xlA,iC,lW,slA,qlA,NW,dlA,plA,UW,ANA,tNA,SW,gNA,nNA,LW,iNA,oNA,FW,eNA,QNA,INA,MW,hNA,BNA,YW,cNA,CNA,kW,dM,$W,GW,TW,JW,PW,RW,oC,fW,ENA,OW,aNA,zW,vW,rNA,yNA,mW,wNA,WW,DNA,uNA,ZW;var VW=r(()=>{JA();KA();VlA=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],nC=Q.enum(VlA),HlA=Q.enum(["oauth","app_installation","api_key"]),XlA=Q.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),jlA=Q.enum(["pending","connected","error","revoked"]),KlA=Q.enum(["healthy","unhealthy","unknown"]),_lA=Q.object({name:Q.string().describe("Field name used as the JSON key in `credentials`."),label:Q.string().describe("Human-readable field label."),required:Q.boolean().describe("Whether the field is required."),secret:Q.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:Q.string().nullable().describe("Optional hint for the field's expected value.")}),xlA=Q.object({id:nC.describe("Integration provider identifier."),name:Q.string().describe("Human-readable display name."),description:Q.string().describe("Short description of the provider."),authType:HlA.describe("Auth flow used to connect this provider."),capabilities:Q.array(XlA).describe("Capabilities the provider exposes once connected."),connectionCount:Q.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:Q.array(_lA).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:Q.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),iC=Q.object({id:Q.string().uuid(),provider:nC,displayName:Q.string().nullable(),status:jlA,isActive:Q.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:Q.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:Q.record(Q.string(),Q.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:KlA,healthMessage:Q.string().nullable(),healthCheckedAt:Q.string().datetime().nullable(),healthConsecutiveFailures:Q.number().int(),connectedBy:Q.string().nullable(),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),lW=Q.object({organizationEnabled:Q.boolean().describe("Stored organization-wide policy."),connectionEnabled:Q.boolean().describe("Stored connection policy."),effectiveEnabled:Q.boolean().describe("True only when both stored policies are enabled.")}),slA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted.")}),qlA=Q.object({providers:Q.array(xlA)}),NW=S({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:slA,output:qlA,pagination:"none",async:"sync"}),dlA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted."),provider:nC.optional().describe("Filter connections by provider.")}),plA=Q.object({connections:Q.array(iC)}),UW=S({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:dlA,output:plA,pagination:"none",async:"sync"}),ANA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to fetch.")}),tNA=Q.object({connection:iC}),SW=S({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:ANA,output:tNA,pagination:"none",async:"sync"}),gNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:nC.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:Q.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:Q.record(Q.string(),Q.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),nNA=Q.object({connection:iC}),LW=S({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:gNA,output:nNA,pagination:"none",async:"sync"}),iNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:nC.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:Q.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:Q.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),oNA=Q.object({url:Q.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:Q.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:Q.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),FW=S({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:iNA,output:oNA,pagination:"none",async:"sync"}),eNA=Q.enum(["pending","completed","not_connected","failed","expired"]),QNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:Q.string().uuid().describe("Connect attempt ID to poll.")}),INA=Q.object({status:eNA.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:Q.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:iC.optional().describe("The created connection when status is `completed`.")}),MW=S({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:QNA,output:INA,pagination:"none",async:"sync"}),hNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to disconnect.")}),BNA=Q.object({success:Q.literal(!0)}),YW=S({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:hNA,output:BNA,pagination:"none",async:"sync"}),cNA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Connection ID to update."),credentials:Q.record(Q.string(),Q.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),CNA=Q.object({connection:iC}),kW=S({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:cNA,output:CNA,pagination:"none",async:"sync"}),dM=Q.object({organizationId:Q.string().min(1).optional()}),$W=Q.object({organizationEnabled:Q.boolean(),effectiveEnabled:Q.boolean()}),GW=dM.extend({connectionId:Q.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),TW=S({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:dM,output:$W,pagination:"none",async:"sync"}),JW=S({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:dM.extend({enabled:Q.boolean()}),output:$W,pagination:"none",async:"sync"}),PW=S({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:GW,output:lW,pagination:"none",async:"sync"}),RW=S({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:GW.extend({enabled:Q.boolean()}),output:lW,pagination:"none",async:"sync"}),oC=Q.object({organizationId:Q.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:Q.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),fW=Q.object({connectionId:Q.string().uuid(),defaultProjectId:Q.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:Q.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:Q.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),ENA=oC,OW=S({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:ENA,output:fW,pagination:"none",async:"sync"}),aNA=oC.extend({defaultProjectId:Q.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:Q.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:Q.boolean().optional().describe("Omit to leave unchanged.")}),zW=S({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:aNA,output:fW,pagination:"none",async:"sync"}),vW=Q.object({connectionId:Q.string().uuid(),slackChannelId:Q.string().min(1),slackChannelName:Q.string().min(1),projectId:Q.string().uuid()}),rNA=oC,yNA=Q.object({mappings:Q.array(vW)}),mW=S({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:rNA,output:yNA,pagination:"none",async:"sync"}),wNA=oC.extend({slackChannelId:Q.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:Q.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:Q.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),WW=S({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:wNA,output:vW,pagination:"none",async:"sync"}),DNA=oC.extend({slackChannelId:Q.string().min(1)}),uNA=Q.object({success:Q.boolean()}),ZW=S({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:DNA,output:uNA,pagination:"none",async:"sync"})});var On,bNA,lNA,HW,Hy,Xy,XW,pM,jW,AY,KW,_W,NNA,UNA,xW,sW,qW,dW,pW,A4,t4,g4,n4,i4,o4,e4,Q4,I4,h4,kI,jy,Ky,_y,xy,sy,qy,dy,py,Aw,tw,SNA;var tY=r(()=>{JA();KA();On=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),description:Q.string().nullable(),status:Q.enum(["open","resolved","ignored"]),severity:Q.enum(["low","medium","high","critical"]),componentId:Q.string().uuid().nullable(),createdAt:Q.string().datetime(),resolvedAt:Q.string().datetime().nullable(),mutedAt:Q.string().datetime().nullable(),muteHitCount:Q.number().int().nonnegative(),lastActivityAt:Q.string().datetime().nullable(),lastDeliveredAt:Q.string().datetime().nullable(),locked:Q.boolean(),redacted:Q.boolean()}),bNA=Q.object({channelId:Q.string().nullable(),channelName:Q.string().nullable(),threadTs:Q.string().nullable(),permalink:Q.string().nullable(),workspaceName:Q.string().nullable()}),lNA=On.extend({slackChannels:Q.array(bNA)}),HW=On.extend({delivery:Q.record(Q.string(),Q.unknown()).nullable().optional()}),Hy=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:Q.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:Q.string().trim().min(1,"contentMdx cannot be empty").describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence)."),severity:Q.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:Q.string().uuid().describe("Required UUID of a registered component this issue belongs to. Every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:Q.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began.")}),Xy=Hy.superRefine((A,t)=>{if(A.statusStartedAt&&!A.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),XW=Q.object({issue:On,duplicateIssueId:Q.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),pM=Q.object({projectId:Q.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Q.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:Q.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:Q.string().uuid().optional().describe("Filter by component ID.")}),jW=Q.object({issues:Q.array(On),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AY=pM.extend({name:Q.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:Q.union([Q.boolean(),Q.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),KW=Q.object({issues:Q.array(HW),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_W=AY.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),NNA=Q.object({open:Q.number().int().nonnegative(),resolved:Q.number().int().nonnegative(),ignored:Q.number().int().nonnegative()}),UNA=Q.object({low:Q.number().int().nonnegative(),medium:Q.number().int().nonnegative(),high:Q.number().int().nonnegative(),critical:Q.number().int().nonnegative()}),xW=Q.object({total:Q.number().int().nonnegative(),byStatus:NNA,bySeverity:UNA,filters:Q.object({name:Q.string().nullable(),status:Q.enum(["open","resolved","ignored"]).nullable(),severity:Q.enum(["low","medium","high","critical"]).nullable(),componentId:Q.string().uuid().nullable()})}),sW=Q.object({issueId:Q.string().uuid().describe("Issue ID to retrieve.")}),qW=Q.object({issue:lNA}),dW=Q.object({issueId:Q.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:Q.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),pW=Q.object({issue:On}),A4=Q.object({issueId:Q.string().uuid().describe("Issue ID to ignore.")}),t4=Q.object({issue:On}),g4=Q.object({issueId:Q.string().uuid().describe("Issue ID to reopen.")}),n4=Q.object({issue:On}),i4=Q.object({issueId:Q.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:Q.string().uuid().describe("Active canonical component that will own the reopened issue.")}),o4=Q.object({issue:On,sourceComponentId:Q.string().uuid(),targetComponentId:Q.string().uuid()}),e4=Q.object({issueId:Q.string().uuid().describe("Issue ID to mute.")}),Q4=Q.object({issue:On}),I4=Q.object({issueId:Q.string().uuid().describe("Issue ID to unmute.")}),h4=Q.object({issue:On}),kI=S({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:Xy,output:XW,pagination:"none",async:"sync"}),jy=S({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:pM,output:jW,pagination:"cursor",async:"sync"}),Ky=S({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:AY,output:KW,pagination:"cursor",async:"sync"}),_y=S({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:_W,output:xW,pagination:"none",async:"sync"}),xy=S({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:sW,output:qW,pagination:"none",async:"sync"}),sy=S({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:dW,output:pW,pagination:"none",async:"sync"}),qy=S({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:A4,output:t4,pagination:"none",async:"sync"}),dy=S({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:g4,output:n4,pagination:"none",async:"sync"}),py=S({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:i4,output:o4,pagination:"none",async:"sync"}),Aw=S({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:e4,output:Q4,pagination:"none",async:"sync"}),tw=S({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:I4,output:h4,pagination:"none",async:"sync"}),SNA={count:_y.contract,create:kI.contract,list:jy.contract,search:Ky.contract,get:xy.contract,resolve:sy.contract,ignore:qy.contract,reopen:dy.contract,reassignAndReopen:py.contract,mute:Aw.contract,unmute:tw.contract}});var gY,B4,gw,nw,c4,C4,E4,a4,iw,nY,r4,y4,w4,D4,u4,b4,l4,N4,U4,S4,L4,F4,$I,GI,TI,JI,PI,ow,ew,Qw,Iw,hw,LNA,FNA;var iY=r(()=>{JA();KA();gY=/^[a-zA-Z0-9\s\-_]+$/,B4=Q.object({id:Q.string().uuid(),name:Q.string(),expiresAt:Q.string().datetime().nullable(),lastUsedAt:Q.string().datetime().nullable(),createdAt:Q.string().datetime()}),gw=B4.extend({projectId:Q.string().uuid(),dataSourceConnectionId:Q.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:Q.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),nw=B4.extend({projectId:Q.string().uuid().nullable()}),c4=Q.object({projectId:Q.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),C4=Q.object({publicKeys:Q.array(gw),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),E4=Q.object({secretKeys:Q.array(nw),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a4=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:Q.string().uuid().describe("Key ID to fetch.")}),iw=Q.object({publicKey:gw}),nY=Q.object({secretKey:nw}),r4=Q.object({publicKey:gw.extend({value:Q.string()})}),y4=Q.object({projectId:Q.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),w4=Q.object({secretKey:nw.extend({value:Q.string()})}),D4=Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:Q.string().uuid().describe("Key ID to update."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:Q.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),u4=Q.object({params:Q.object({keyId:Q.string().uuid().describe("Public key ID to deactivate.")}),query:Q.object({projectId:Q.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),b4=iw,l4=Q.void(),N4=Q.object({limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),U4=Q.object({keyId:Q.string().uuid().describe("Key ID to fetch.")}),S4=Q.object({projectId:Q.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:Q.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),L4=Q.object({keyId:Q.string().uuid().describe("Key ID to update."),name:Q.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(gY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:Q.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),F4=Q.object({params:Q.object({keyId:Q.string().uuid().describe("Key ID to delete.")})}).transform(({params:A})=>({...A})),$I=S({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:c4,output:C4,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),GI=S({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:a4,output:iw,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),TI=S({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:y4,output:r4,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),JI=S({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:D4,output:iw,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),PI=S({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:u4,output:b4,pagination:"none",async:"sync"}),ow=S({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:N4,output:E4,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),ew=S({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:U4,output:nY,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Qw=S({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:S4,output:w4,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),Iw=S({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:L4,output:nY,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),hw=S({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:F4,output:l4,pagination:"none",async:"sync"}),LNA={list:$I.contract,get:GI.contract,ensureLogForwarding:TI.contract,update:JI.contract,deactivate:PI.contract},FNA={list:ow.contract,get:ew.contract,create:Qw.contract,update:Iw.contract,delete:hw.contract}});var oY,M4,eY,eC,MNA,YNA,kNA,$NA,GNA,TNA,JNA,PNA,RNA,fNA,QY,IY,hY,BY,cY,$ht;var Y4=r(()=>{JA();KA();oY=Q.string().uuid().describe("Log match expression ID."),M4=Q.string().min(1).max(200).describe("Human-readable expression name."),eY=Q.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),eC=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),expression:eY,enabled:Q.boolean(),compiledVersion:Q.number().int(),linkedAutomationIds:Q.array(Q.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),MNA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list expressions for. Auto-filled from CLI and SDK context when omitted.")}),YNA=Q.object({expressions:Q.array(eC)}),kNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),$NA=Q.object({expression:eC}),GNA=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:M4,expression:eY,enabled:Q.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),TNA=Q.object({expression:eC}),JNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:M4.optional(),expression:eY.optional(),enabled:Q.boolean().optional().describe("Whether the expression is enabled.")}),PNA=Q.object({expression:eC}),RNA=Q.object({expressionId:oY,projectId:Q.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),fNA=Q.object({expression:eC}),QY=S({operationId:"logMatchExpressions.list",description:"List CEL log-match expressions in a project.",backend:"api",route:{method:"GET",path:"/log-match-expressions",tags:["Log match expressions"]},input:MNA,output:YNA,pagination:"none",async:"sync"}),IY=S({operationId:"logMatchExpressions.get",description:"Get a single log-match expression by ID.",backend:"api",route:{method:"GET",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:kNA,output:$NA,pagination:"none",async:"sync"}),hY=S({operationId:"logMatchExpressions.create",description:"Create a CEL log-match expression for a project.",backend:"api",route:{method:"POST",path:"/log-match-expressions",successStatus:201,tags:["Log match expressions"]},input:GNA,output:TNA,pagination:"none",async:"sync"}),BY=S({operationId:"logMatchExpressions.update",description:"Update a log-match expression's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:JNA,output:PNA,pagination:"none",async:"sync"}),cY=S({operationId:"logMatchExpressions.disable",description:"Disable a log-match expression so it stops matching logs.",backend:"api",route:{method:"POST",path:"/log-match-expressions/{expressionId}/disable",tags:["Log match expressions"]},input:RNA,output:fNA,pagination:"none",async:"sync"}),$ht={list:QY.contract,get:IY.contract,create:hY.contract,update:BY.contract,disable:cY.contract}});var $4="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var k4=()=>{};var T4=`---
106
106
  name: claude-code-log-source-setup
107
107
  description: Export Claude Code session telemetry to a Sazabi project. Use when the user wants to "connect Claude Code", "set up Claude Code telemetry", "ingest Claude Code events", "send my coding agent telemetry to Sazabi", or after running \`sazabi log-sources skill --provider claude_code\`. Points Claude Code's built-in OTLP exporter at Sazabi's keyed intake host — no SDK or code changes required.
108
108
  surface: log-source
@@ -8707,7 +8707,7 @@ Connect 1Password so Sazabi agents can work with your vaults and secrets through
8707
8707
  `)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var ZIA;var VIA=r(()=>{IA();ZIA=v({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var HIA;var XIA=r(()=>{IA();HIA=v({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var jIA;var KIA=r(()=>{$t();IA();jIA=v({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:LeA,normalizeHeaders:SeA})});var _IA;var xIA=r(()=>{IA();_IA=v({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var sIA;var qIA=r(()=>{IA();sIA=v({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var dIA;var pIA=r(()=>{IA();dIA=v({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var AhA;var thA=r(()=>{IA();AhA=v({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var ghA;var nhA=r(()=>{$t();IA();ghA=v({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:yeA,normalizeHeaders:reA,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var ihA;var ohA=r(()=>{IA();ihA=v({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var ehA;var QhA=r(()=>{$t();IA();ehA=v({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:weA,normalizeHeaders:aeA,skill:"x",setupSkill:"x-setup"})});var IhA,lGt;var hhA=r(()=>{deA();AQA();gQA();iQA();TR();TR();QQA();hQA();cQA();EQA();rQA();wQA();uQA();lQA();UQA();LQA();MQA();kQA();GQA();JQA();RQA();OQA();vQA();WQA();VQA();XQA();KQA();xQA();qQA();pQA();tIA();nIA();oIA();QIA();hIA();cIA();EIA();rIA();wIA();uIA();lIA();UIA();LIA();MIA();kIA();GIA();JIA();RIA();OIA();vIA();WIA();VIA();XIA();KIA();xIA();qIA();pIA();thA();nhA();ohA();QhA();IhA=[dIA,PQA,fQA,qeA,peA,tQA,nQA,oQA,eQA,IQA,BQA,CQA,aQA,yQA,bQA,NQA,SQA,FQA,DQA,YQA,$QA,zQA,mQA,ZQA,HQA,jQA,_QA,sQA,dQA,AIA,gIA,iIA,eIA,IIA,BIA,CIA,aIA,yIA,DIA,bIA,NIA,SIA,FIA,YIA,$IA,PIA,TIA,fIA,zIA,mIA,ZIA,HIA,jIA,_IA,sIA,AhA,ghA,ihA,ehA,TQA],lGt=new Map(IhA.map((A)=>[A.id,A]))});var BhA=()=>{};var chA=()=>{};var ChA=()=>{};var EhA=()=>{};var ahA=()=>{};var rhA=()=>{};var yhA=()=>{};var whA=()=>{};var DhA=()=>{};var uhA=()=>{};var bhA=()=>{};var lhA=()=>{};var NhA=()=>{};var UhA=()=>{};var ShA=()=>{};var LhA=()=>{};var FhA=()=>{};var MhA=()=>{};var YhA=()=>{};var khA=()=>{};var $hA=()=>{};var GhA=()=>{};var ThA=()=>{};var JhA=()=>{};var PhA=()=>{};var RhA=()=>{};var fhA=()=>{};var OhA=()=>{};var zhA=()=>{};var vhA=()=>{};var mhA=()=>{};var WhA=()=>{};var ZhA=()=>{};var VhA=()=>{};var HhA=()=>{};var XhA=()=>{};var jhA=()=>{};var KhA=()=>{};var _hA=()=>{};var xhA=()=>{};var shA=()=>{};var qhA=()=>{};var dhA=()=>{};var phA=()=>{};var ABA=r(()=>{BhA();chA();ChA();EhA();ahA();rhA();yhA();whA();DhA();uhA();bhA();lhA();NhA();UhA();ShA();LhA();FhA();MhA();YhA();khA();$hA();GhA();ThA();JhA();PhA();RhA();fhA();OhA();zhA();vhA();mhA();WhA();ZhA();VhA();HhA();XhA();jhA();KhA();_hA();xhA();shA();qhA();dhA();phA()});var tBA=()=>{};var gBA=r(()=>{kK();Nw();eeA();$t();XeA();jeA();hhA();$R();ABA();tBA()});var nBA,i8A,iBA,o8A,oBA,JR,eBA,QBA,Ie,IBA,hBA,BBA,QB,cBA,CBA,IB,EBA,aBA,hB,rBA,e8A,yBA,Sb,wBA,DBA,uBA,bBA,BB,lBA,NBA,cB,UBA,SBA,CB,PR,RR,LBA,FBA,EB,MBA,YBA,aB,kBA,Q8A,rB,$BA,GBA,yB,TBA,JBA,wB,PBA,RBA,DB,I8A;var fR=r(()=>{gBA();JA();KA();nBA=["configured","authorizing","connected","error"],i8A=Q.enum(nBA),iBA=["preset","custom"],o8A=Q.enum(iBA),oBA=["streamable-http","sse"],JR=Q.enum(oBA),eBA=["none","headers","oauth","aws-sigv4"],QBA=Q.enum(eBA),Ie=Q.object({connectionId:Q.string().uuid().describe("Connection ID."),connectionKey:Q.string().describe("Stable key used to reference this connector in tool calls."),providerId:Q.string().describe('Provider identifier, e.g. "linear".'),displayName:Q.string().describe("Human-readable connector name."),source:o8A.describe("Whether the connector is a built-in preset or a custom server."),installStatus:i8A.describe("Current connection lifecycle status."),authMode:QBA.describe("Authentication mode."),transport:JR.describe("Transport protocol."),serverUrl:Q.string().describe("MCP server URL."),readOnly:Q.boolean().describe("Whether the connector is restricted to read-only tools."),management:Wk.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:Q.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:Q.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),IBA=Q.object({name:Q.string().describe("Tool name as invoked."),title:Q.string().describe("Human-readable tool title."),description:Q.string().describe("Tool description."),isReadOnly:Q.boolean().describe("Whether the tool is considered read-only."),enabled:Q.boolean().describe("Whether the tool is enabled and available given the connector config.")}),hBA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:Q.union([Q.boolean(),Q.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),BBA=Q.object({connectors:Q.array(Ie)}),QB=S({operationId:"mcpConnectors.list",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:hBA,output:BBA,pagination:"none",async:"sync"}),cBA=Q.object({connectionId:Q.string().uuid().describe("Connection ID to fetch."),projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),CBA=Q.object({connector:Ie}),IB=S({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:cBA,output:CBA,pagination:"none",async:"sync"}),EBA=Q.object({connectionId:Q.string().uuid().describe("Connection ID to inspect."),projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),aBA=Q.object({connector:Ie,tools:Q.array(IBA)}),hB=S({operationId:"mcpConnectors.details",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:EBA,output:aBA,pagination:"none",async:"sync"}),rBA=Q.object({providerId:Q.string().describe('Provider identifier, e.g. "linear".'),label:Q.string().describe("Human-readable provider name."),authMode:QBA.describe("Authentication mode."),availability:Q.enum(VI).describe("Whether the provider is enabled or coming soon."),setupSkill:Q.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),e8A=Q.object({}),yBA=Q.object({providers:Q.array(rBA)}),Sb=S({operationId:"mcpConnectors.listProviders",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:e8A,output:yBA,pagination:"none",async:"sync"}),wBA=Q.object({connectionKey:Q.string().describe("Stable key used to call this connector."),displayName:Q.string().describe("Human-readable connector name."),providerId:Q.string().describe('Provider identifier, e.g. "linear".'),toolCount:Q.number().int().nonnegative().describe("Number of executable tools on this connector.")}),DBA=Q.object({connectionKey:Q.string().describe("Connector that exposes this tool."),toolName:Q.string().describe("Tool name as invoked."),providerId:Q.string().describe('Provider identifier, e.g. "linear".'),displayName:Q.string().describe("Human-readable connector name."),isReadOnly:Q.boolean().describe("Whether the tool is considered read-only."),description:Q.string().describe("Tool description from the stored snapshot."),score:Q.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:Q.record(Q.string(),Q.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),uBA=Q.object({projectId:Q.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:Q.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:Q.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:Q.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:Q.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:Q.union([Q.boolean(),Q.stringbool()]).optional().describe("When true, tool hits include inputSchema so a caller can execute without a describe round-trip.")}),bBA=Q.object({kind:Q.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:Q.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:Q.array(wBA).describe("Connector index. Empty when kind is tools."),tools:Q.array(DBA).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),BB=S({operationId:"mcpConnectors.search",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:uBA,output:bBA,pagination:"none",async:"sync"}),lBA=Q.object({projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:Q.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:Q.string().min(1).describe("Tool name as invoked.")}),NBA=Q.object({connectionKey:Q.string().describe("Connector that exposes this tool."),toolName:Q.string().describe("Tool name as invoked."),providerId:Q.string().describe('Provider identifier, e.g. "linear".'),displayName:Q.string().describe("Human-readable connector name."),title:Q.string().describe("Human-readable tool title."),description:Q.string().describe("Tool description from the stored snapshot."),isReadOnly:Q.boolean().describe("Whether the tool is considered read-only."),inputSchema:Q.record(Q.string(),Q.unknown()).describe("JSON Schema for the tool's arguments.")}),cB=S({operationId:"mcpConnectors.describe",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:lBA,output:NBA,pagination:"none",async:"sync"}),UBA=Q.object({projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:Q.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:Q.string().min(1).describe("Tool name as invoked."),arguments:Q.record(Q.string(),Q.unknown()).optional().describe("Arguments matching the tool's input schema.")}),SBA=Q.discriminatedUnion("ok",[Q.object({ok:Q.literal(!0),connectionKey:Q.string().describe("Connector that ran the tool."),toolName:Q.string().describe("Tool name as invoked."),result:Q.unknown().describe("Vendor tool result payload."),structuredContent:Q.unknown().optional().describe("Structured content from the vendor when present."),content:Q.array(Q.record(Q.string(),Q.unknown())).describe("Raw MCP content parts from the vendor."),text:Q.string().nullable().describe("Concatenated text content, if any.")}),Q.object({ok:Q.literal(!1),code:Q.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:Q.string().describe("Caller-facing error message.")})]),CB=S({operationId:"mcpConnectors.call",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:UBA,output:SBA,pagination:"none",async:"sync"}),PR=Q.object({id:Q.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:Q.string().trim().min(1).describe("HTTP header name."),value:Q.string().min(1).describe("HTTP header value (passed verbatim).")}),RR=Q.object({accessKeyId:Q.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:Q.string().min(1).describe("AWS secret access key."),sessionToken:Q.string().min(1).optional().describe("Optional session token for temporary credentials."),region:Q.string().trim().min(1).describe("AWS region.")}),LBA=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:Q.string().url().describe("MCP server URL (must be https)."),transport:JR.describe("Transport protocol."),headers:Q.array(PR).optional().describe("HTTP headers to send with each request."),awsSigV4:RR.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:Q.string().min(1).optional().describe("Built-in provider ID to associate with this custom connection."),readOnly:Q.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),FBA=Q.object({connector:Ie}),EB=S({operationId:"mcpConnectors.create",description:"Create a custom MCP connector with header-based or AWS SigV4 authentication. Connects to the server immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:LBA,output:FBA,pagination:"none",async:"sync"}),MBA=Q.object({connectionId:Q.string().uuid().describe("Connection ID to update."),projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:Q.string().url().optional().describe("New MCP server URL."),transport:JR.optional().describe("New transport protocol."),headers:Q.array(PR).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:RR.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),YBA=Q.object({connector:Ie}),aB=S({operationId:"mcpConnectors.update",description:"Update a custom MCP connector's server URL, transport, or headers. Reconnects to the server after the update and refreshes the tool snapshot.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:MBA,output:YBA,pagination:"none",async:"sync"}),kBA=Q.object({connectionId:Q.string().uuid().describe("Connection ID to disconnect."),projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),Q8A=Q.void(),rB=S({operationId:"mcpConnectors.disconnect",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:kBA,output:Q8A,pagination:"none",async:"sync"}),$BA=Q.object({connectionId:Q.string().uuid().describe("Connection ID to update."),projectId:Q.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:Q.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),GBA=Q.object({connector:Ie}),yB=S({operationId:"mcpConnectors.setReadOnly",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:$BA,output:GBA,pagination:"none",async:"sync"}),TBA=Q.object({projectId:Q.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:Q.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:Q.array(Q.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:Q.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:Q.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:Q.string().optional().describe("Path to redirect the user to after OAuth completes.")}),JBA=Q.object({authorizationUrl:Q.string().describe("Authorization URL to open in the user's browser."),connectionId:Q.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:Q.string().datetime().describe("When the OAuth authorization attempt expires.")}),wB=S({operationId:"mcpConnectors.beginOAuthInstall",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:TBA,output:JBA,pagination:"none",async:"sync"}),PBA=Q.object({connectionId:Q.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:Q.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),RBA=Q.object({status:Q.enum(["authorizing","connected","error"]).describe("Current install status."),connector:Ie.optional().describe("Connector details once connected or in error state.")}),DB=S({operationId:"mcpConnectors.getOAuthInstallAttempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:PBA,output:RBA,pagination:"none",async:"sync"}),I8A={list:QB.contract,get:IB.contract,details:hB.contract,listProviders:Sb.contract,search:BB.contract,describe:cB.contract,call:CB.contract,create:EB.contract,update:aB.contract,disconnect:rB.contract,setReadOnly:yB.contract,beginOAuthInstall:wB.contract,getOAuthInstallAttempt:DB.contract}});var he,h8A,B8A,c8A,C8A,E8A,a8A,r8A,OR,ift;var Lb=r(()=>{JA();KA();he=Q.enum(["admin","member"]),h8A=Q.object({id:Q.string().min(1),name:Q.string(),slug:Q.string(),logo:Q.string().nullable().optional(),role:he}),B8A=Q.object({id:Q.string().min(1),name:Q.string().nullable(),email:Q.string().email()}),c8A=Q.object({credentialType:Q.literal("user"),user:B8A,activeOrganizationId:Q.string().min(1).nullable(),organizations:Q.array(h8A).describe("Organizations the user belongs to, including membership role.")}),C8A=Q.object({credentialType:Q.literal("secret"),organization:Q.object({id:Q.string().min(1),name:Q.string(),slug:Q.string(),logo:Q.string().nullable().optional()}),keyName:Q.string()}),E8A=Q.object({credentialType:Q.literal("partner"),superorganization:Q.object({id:Q.string().uuid(),name:Q.string()})}),a8A=Q.object({}),r8A=Q.discriminatedUnion("credentialType",[c8A,C8A,E8A]),OR=S({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:a8A,output:r8A,pagination:"none",async:"sync"}),ift=OR.contract});var fBA,OBA,zBA,y8A,w8A,D8A,u8A,b8A,l8A,zR,vR,mR,N8A,U8A,S8A,L8A,F8A,M8A,WR,ZR,VR,hft;var vBA=r(()=>{JA();KA();Lb();fBA=Q.object({membershipId:Q.string().min(1).describe("Organization membership record ID."),userId:Q.string().min(1).describe("User ID for the organization member."),name:Q.string().nullable().describe("Display name for the member, when available."),email:Q.string().email().describe("Email address for the member."),imageUrl:Q.string().nullable().describe("Profile image URL for the member, when available."),role:he.describe("Organization role."),createdAt:Q.string().datetime().describe("When the membership was created.")}),OBA=Q.object({id:Q.string().min(1).describe("Invitation ID."),email:Q.string().email().describe("Invited email address."),role:he.describe("Role the invitee will receive when they accept."),status:Q.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:Q.string().datetime().describe("When the invitation was created."),expiresAt:Q.string().datetime().describe("When the invitation expires.")}),zBA=Q.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),y8A=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),w8A=Q.object({members:Q.array(fBA).describe("Members visible within the selected organization.")}),D8A=Q.object({organizationId:Q.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),member:zBA.describe("User ID, or URL-encoded email address, of the member to update."),role:he.describe("Role to assign.")}),u8A=Q.object({member:fBA.describe("Updated organization member.")}),b8A=Q.object({params:Q.object({member:zBA.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:Q.object({organizationId:Q.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),l8A=Q.object({removedUserId:Q.string().min(1).describe("User ID removed from the organization.")}),zR=S({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:y8A,output:w8A,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),vR=S({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:D8A,output:u8A,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),mR=S({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:b8A,output:l8A,pagination:"none",async:"sync"}),N8A=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted."),email:Q.string().email().describe("Email address to invite."),role:he.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),U8A=Q.object({invitation:OBA.describe("The created pending invitation.")}),S8A=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted.")}),L8A=Q.object({invitations:Q.array(OBA).describe("Pending invitations visible within the selected organization.")}),F8A=Q.object({params:Q.object({invitationId:Q.string().min(1).describe("ID of the invitation to revoke.")}),query:Q.object({organizationId:Q.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),M8A=Q.object({revokedInvitationId:Q.string().min(1).describe("ID of the revoked invitation.")}),WR=S({operationId:"members.invite",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:N8A,output:U8A,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),ZR=S({operationId:"members.listInvitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:S8A,output:L8A,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),VR=S({operationId:"members.revokeInvitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:F8A,output:M8A,pagination:"none",async:"sync"}),hft={list:zR.contract,updateRole:vR.contract,remove:mR.contract,invite:WR.contract,listInvitations:ZR.contract,revokeInvitation:VR.contract}});var WBA,ZBA,Fb,VBA,Mb,mBA=4194304,HR,XR,Y8A=(A)=>{let t=A.split(",").map((i)=>i.trim()).filter(Boolean),g=Q.array(Fb).safeParse(t);if(!g.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return g.data},qE,jR,KR,HBA,XBA,jBA,KBA,_BA,xBA,sBA,qBA,dBA,pBA,AcA,tcA,uB,bB,lB,NB,UB,k8A;var _R=r(()=>{JA();KA();WBA=["note","runbook"],ZBA=["note","runbook","change"],Fb=Q.enum(ZBA),VBA=Q.enum(WBA),Mb=Q.string().min(1).max(512).refine((A)=>!A.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),HR=Q.string().min(1).refine((A)=>new TextEncoder().encode(A).length<=mBA,{message:`Memory body must be at most ${mBA} bytes (4 MiB).`}).describe("Document body stored in project memory."),XR=Q.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),qE=Q.string().min(1).transform(Y8A).describe("Comma-separated kinds, for example note,runbook."),jR=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),kind:Fb,managed:Q.boolean(),path:Q.string().nullable(),title:Q.string().nullable(),contentHash:Q.string(),attrs:Q.record(Q.string(),Q.unknown()),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),KR=jR.extend({body:HR}),HBA=Q.object({projectId:Q.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:Mb.describe("Relative path for the curated document."),body:HR,kind:VBA.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:Q.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),XBA=Q.object({document:KR}),jBA=Q.object({projectId:Q.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:Q.string().uuid().optional().describe("Document id."),path:Mb.optional().describe("Relative curated path.")}).superRefine((A,t)=>{let g=A.id!==void 0,i=A.path!==void 0;if(g===i)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),KBA=Q.object({document:KR}),_BA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:qE.optional(),since:XR.optional().describe("Only return documents updated within this window, for example 7d."),service:Q.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:Q.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:Q.coerce.boolean().optional(),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),xBA=Q.object({documents:Q.array(jR),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),sBA=Q.object({documentId:Q.string().uuid(),kind:Fb,managed:Q.boolean(),path:Q.string().nullable(),title:Q.string().nullable(),snippet:Q.string(),score:Q.number()}),qBA=Q.object({calibrated:Q.literal(!0),minScoreThreshold:Q.number(),queryTerms:Q.array(Q.string()),message:Q.string()}),dBA=Q.object({projectId:Q.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:Q.string().trim().min(1).max(500).describe("Natural-language search query."),kind:qE.optional(),since:XR.optional(),service:Q.string().min(1).optional(),pathPrefix:Q.string().min(1).optional(),managed:Q.coerce.boolean().optional(),limit:Q.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),pBA=Q.object({hits:Q.array(sBA),emptyVerdict:qBA.nullable()}),AcA=Q.object({projectId:Q.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:Q.string().uuid().optional().describe("Document id."),path:Mb.optional()}).superRefine((A,t)=>{let g=A.id!==void 0,i=A.path!==void 0;if(g===i)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),tcA=Q.object({deleted:Q.boolean()}),uB=S({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:HBA,output:XBA,pagination:"none",async:"sync"}),bB=S({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:jBA,output:KBA,pagination:"none",async:"sync"}),lB=S({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:_BA,output:xBA,pagination:"cursor",async:"sync"}),NB=S({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:dBA,output:pBA,pagination:"none",async:"sync"}),UB=S({operationId:"memory.delete",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:AcA,output:tcA,pagination:"none",async:"sync"}),k8A={put:uB.contract,get:bB.contract,list:lB.contract,search:NB.contract,delete:UB.contract}});var gcA,ncA,$8A,G8A,T8A,J8A,P8A,dE,R8A,f8A,O8A,xR,sR,qR,dR,yft;var Yb=r(()=>{JA();KA();gcA=Q.enum(["processing","completed","aborted","error"]),ncA=Q.object({id:Q.string().uuid(),threadId:Q.string().uuid(),userMessageId:Q.string().uuid().nullable(),assistantMessageId:Q.string().uuid().nullable(),parentRunId:Q.string().uuid().nullable(),workflowRunId:Q.string().nullable(),status:gcA,source:Q.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime(),completedAt:Q.string().datetime().nullable()}),$8A=Q.object({projectId:Q.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:Q.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),G8A=Q.object({runs:Q.array(ncA),nextCursor:Q.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),T8A=Q.object({threadId:Q.string().uuid().describe("Thread ID to list runs for."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:Q.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),J8A=Q.object({runs:Q.array(ncA),nextCursor:Q.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),P8A=Q.object({runId:Q.string().uuid().describe("Run ID returned by a deferred operation.")}),dE=Q.object({completed:Q.boolean().describe("Whether the run has reached a terminal status."),threadId:Q.string().uuid().describe("Thread ID associated with the run."),runId:Q.string().uuid().describe("Run ID for subsequent polling."),messageId:Q.string().uuid().optional().describe("ID of the user message that triggered this run."),status:gcA.describe("Current run lifecycle status."),response:Q.string().nullable().describe("Assistant response text when the run has completed.")}),R8A=dE.describe("Current run state and, when complete, the assistant response."),f8A=Q.object({runId:Q.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),O8A=Q.object({success:Q.literal(!0).describe("Always true when the cancellation request was accepted.")}),xR=S({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:$8A,output:G8A,pagination:"cursor",async:"sync"}),sR=S({operationId:"runs.listForThread",summary:"List Runs for a Thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:T8A,output:J8A,pagination:"cursor",async:"sync"}),qR=S({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:P8A,output:R8A,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),dR=S({operationId:"runs.cancel",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:f8A,output:O8A,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),yft={list:xR.contract,listForThread:sR.contract,get:qR.contract,cancel:dR.contract}});var kb=(A,t,g)=>{let i=t?20000:1e4;if(A.length>i)g.addIssue({code:"too_big",maximum:i,type:"string",inclusive:!0,message:`Message cannot exceed ${i} characters`,origin:"string",path:["message"]})},$b=(A,t,g)=>{if(A&&!t)g.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var icA,pE,z8A,v8A,m8A,W8A,Z8A,V8A,H8A,X8A,j8A,pR,K8A,_8A,x8A,s8A,q8A,d8A,p8A,A5A,t5A,g5A,n5A,i5A,Af,tf,gf,nf,of,ef,ocA,o5A,e5A,Q5A,I5A,ecA,h5A,B5A,c5A,C5A,E5A,a5A,TQ="22222222-2222-4222-8222-222222222222",QcA="11111111-1111-4111-8111-111111111111",r5A="44444444-4444-4444-8444-444444444444",IcA="55555555-5555-4555-8555-555555555555",Qf,If,hf,Bf,cf,Uft;var Cf=r(()=>{JA();KA();Yb();icA=Q.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),pE=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),title:Q.string().nullable(),status:Q.enum(["regular","archived"]),source:icA.nullable(),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),z8A=Q.object({type:Q.literal("message"),message:Q.string()}),v8A=Q.object({type:Q.literal("reasoning"),reasoning:Q.string(),status:Q.enum(["in_progress","complete"]).optional()}),m8A=Q.object({type:Q.literal("tool_call"),name:Q.string(),params:Q.any().optional(),result:Q.any().optional(),status:Q.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:Q.string().optional(),durationMs:Q.number().nonnegative().optional()}),W8A=Q.object({type:Q.literal("artifact"),name:Q.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:Q.any(),toolCallId:Q.string().optional()}),Z8A=Q.object({type:Q.literal("fork"),sourceThreadId:Q.string(),sourceMessageId:Q.string(),sourceThreadTitle:Q.string().nullable()}),V8A=Q.object({type:Q.literal("summary"),summary:Q.string()}),H8A=Q.object({type:Q.literal("slack_context"),channelId:Q.string(),isTruncated:Q.boolean().optional(),messages:Q.array(Q.object({timestamp:Q.string(),slackUserId:Q.string().optional(),displayName:Q.string(),text:Q.string(),isBot:Q.boolean(),files:Q.array(Q.object({name:Q.string(),mimetype:Q.string(),size:Q.number().optional(),attachmentId:Q.string().uuid().optional(),ingestionStatus:Q.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),X8A=Q.object({type:Q.literal("teams_context"),conversationId:Q.string(),isTruncated:Q.boolean().optional(),messages:Q.array(Q.object({activityId:Q.string().optional(),displayName:Q.string(),text:Q.string(),isBot:Q.boolean(),createdDateTime:Q.string().optional()}))}),j8A=Q.union([z8A,v8A,m8A,W8A,Z8A,V8A,H8A,X8A]),pR=Q.object({id:Q.string().uuid(),role:Q.enum(["user","assistant"]),content:Q.array(j8A),source:icA,createdAt:Q.string().datetime()}),K8A=Q.object({projectId:Q.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Q.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),_8A=Q.object({threads:Q.array(pE).describe("The page of threads matching the query."),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),x8A=Q.object({threadId:Q.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),s8A=Q.object({thread:pE.describe("The requested thread."),messages:Q.array(pR).describe("Messages currently stored on the thread in chronological order.")}),q8A=Q.object({projectId:Q.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:Q.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:Q.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:Q.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:Q.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:Q.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((A,t)=>{kb(A.message,A.automationId,t),$b(A.ambientServiceRun,A.automationId,t)}),d8A=dE.describe("Deferred run result for creating a thread."),p8A=Q.object({threadId:Q.string().uuid().describe("Thread ID whose current processing status should be returned.")}),A5A=Q.object({status:Q.enum(["idle","processing"]),lastRunStatus:Q.enum(["error"]).nullable()}),t5A=Q.object({threadId:Q.string().uuid().describe("Thread ID whose active run should be stopped.")}),g5A=Q.object({success:Q.literal(!0).describe("Always true when the stop request was accepted.")}),n5A=Q.object({threadId:Q.string().uuid().describe("Thread ID of the thread to update."),status:Q.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),i5A=Q.object({thread:pE.describe("The updated thread.")}),Af=S({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:K8A,output:_8A,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),tf=S({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:x8A,output:s8A,pagination:"none",async:"sync"}),gf=S({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:p8A,output:A5A,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),nf=S({operationId:"threads.stop",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:t5A,output:g5A,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),of=S({operationId:"threads.create",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:q8A,output:d8A,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),ef=S({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:n5A,output:i5A,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),ocA=Q.enum(["private","organization"]),o5A=Q.object({threadId:Q.string().uuid().describe("Thread ID of the source thread to fork."),messageId:Q.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),e5A=Q.object({thread:pE.describe("The newly created forked thread.")}),Q5A=Q.object({threadId:Q.string().uuid().describe("Thread ID of the thread to update."),visibility:ocA.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),I5A=Q.object({thread:pE.describe("The updated thread."),visibility:ocA.describe("The thread's resulting visibility.")}),ecA=Q.object({shareId:Q.string().uuid().describe("Unique identifier for the snapshot."),threadId:Q.string().uuid().describe("Thread the snapshot was taken from."),url:Q.string().describe("Public read-only URL for the snapshot."),createdAt:Q.string().datetime()}),h5A=Q.object({threadId:Q.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),B5A=Q.object({share:ecA.describe("The created share link.")}),c5A=Q.object({threadId:Q.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:Q.string().uuid().describe("Snapshot ID to revoke.")}),C5A=Q.void(),E5A=Q.object({threadId:Q.string().uuid().describe("Thread ID to list public snapshots for.")}),a5A=Q.object({shares:Q.array(ecA).describe("Active share links for the thread.")}),Qf=S({operationId:"threads.fork",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:o5A,output:e5A,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:TQ,messageId:r5A},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:QcA,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),If=S({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:Q5A,output:I5A,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:TQ,visibility:"private"},output:{thread:{id:TQ,projectId:QcA,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),hf=S({operationId:"threads.createShareLink",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:h5A,output:B5A,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:TQ},output:{share:{shareId:IcA,threadId:TQ,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),Bf=S({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:E5A,output:a5A,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:TQ},output:{shares:[{shareId:IcA,threadId:TQ,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),cf=S({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:c5A,output:C5A,pagination:"none",async:"sync"}),Uft={list:Af.contract,get:tf.contract,getStatus:gf.contract,stop:nf.contract,create:of.contract,update:ef.contract,fork:Qf.contract,setVisibility:If.contract,createShareLink:hf.contract,listShareLinks:Bf.contract,revokeShareLink:cf.contract}});var y5A,w5A,D5A,u5A,hcA,BcA;var ccA=r(()=>{JA();KA();Yb();Cf();y5A=Q.object({threadId:Q.string().uuid().describe("Thread ID to list messages for."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),w5A=Q.object({messages:Q.array(pR),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),D5A=Q.object({threadId:Q.string().uuid().describe("Thread ID to append the message to."),message:Q.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:Q.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:Q.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:Q.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:Q.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((A,t)=>{kb(A.message,A.automationId,t),$b(A.ambientServiceRun,A.automationId,t)}),u5A=dE.describe("Deferred run result for appending a message to an existing thread."),hcA=S({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:y5A,output:w5A,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),BcA=S({operationId:"messages.append",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:D5A,output:u5A,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var en,EcA,Ef,SB,af,Gb,Be,acA,CcA;var Aa=r(()=>{JA();en={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},EcA=[en.IN_APP,en.SLACK,en.EMAIL,en.SMS],Ef=[en.SLACK_CHANNEL,en.MICROSOFT_TEAMS_CHANNEL,en.INCIDENT_IO,en.PAGERDUTY,en.ROOTLY,en.WEBHOOK],SB=Object.values(en),af=[...SB,"victorops"],Gb=Q.enum(SB),Be=Q.enum(Ef),acA=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],CcA=new Set(acA.map(({channel:A})=>A));if(CcA.size!==SB.length||SB.some((A)=>!CcA.has(A)))throw Error("Notification channel definitions must represent every channel")});var rcA,b5A=(A,t)=>A.value===t.value&&A.label===t.label&&A.scope===t.scope&&A.role===t.role&&A.defaultOff===t.defaultOff&&(A.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&A.email?.template===t.email?.template&&A.email?.ctaLabel===t.email?.ctaLabel&&(A.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Mg=(A)=>{for(let t of Object.values(A)){let g=rcA.get(t.value);if(g&&!b5A(g,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);rcA.set(t.value,t)}return A};var pi=r(()=>{rcA=new Map});var ycA;var wcA=r(()=>{pi();ycA=Mg({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var Tb;var rf=r(()=>{pi();Tb=Mg({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var DcA;var ucA=r(()=>{pi();DcA=Mg({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var bcA;var lcA=r(()=>{pi();bcA=Mg({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var NcA;var UcA=r(()=>{pi();NcA=Mg({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var ScA;var LcA=r(()=>{pi();ScA=Mg({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var FcA;var McA=r(()=>{pi();FcA=Mg({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var yf,St,N5A,wf=(A)=>{let t=N5A.get(A)?.label;if(t)return t;let g=A.replace(/_/g," ").trim();return g?g.charAt(0).toUpperCase()+g.slice(1):A};var ta=r(()=>{wcA();rf();rf();ucA();lcA();UcA();LcA();McA();pi();yf={...FcA,...NcA,...DcA,...ycA,...bcA,...ScA,...Tb},St=Object.fromEntries(Object.entries(yf).map(([A,t])=>[A,t.value])),N5A=new Map(Object.values(yf).map((A)=>[A.value,A]))});var Jb,kcA,oOt,Fi,eOt;var JQ=r(()=>{ta();Aa();Aa();Jb=Object.values(St),kcA=[St.BILLING_PLAN_UPGRADE_APPLIED,St.BILLING_PLAN_DOWNGRADE_SCHEDULED,St.BILLING_PLAN_DOWNGRADE_APPLIED,St.BILLING_CREDIT_BALANCE_LOW,St.BILLING_CREDIT_BALANCE_DEPLETED,St.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,St.BILLING_AUTO_TOP_UP_FAILED,St.BILLING_INVOICE_PAID,St.BILLING_NEGATIVE_BALANCE_COLLECTED,St.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,St.BILLING_INVOICE_PAYMENT_FAILED,St.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,St.BILLING_SUBSCRIPTION_CANCELED,St.BILLING_PAYMENT_METHOD_EXPIRING,St.BILLING_PAYMENT_METHOD_CHANGED],oOt=new Set(kcA),Fi=[St.ISSUE_TRIGGERED,St.ISSUE_RESOLVED,St.ISSUE_IGNORED,St.AUTOMATION_RUN_FAILED],eOt=new Set(Fi)});var ga,$cA,GcA=(A)=>typeof A==="string"&&(A in $cA)?$cA[A]:A,S5A;var TcA=r(()=>{Aa();JA();JQ();ga=Q.enum(Jb),$cA={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},S5A=Q.preprocess(GcA,ga)});var L5A;var JcA=r(()=>{ta();JQ();L5A=Fi.map((A)=>({notificationType:A,label:wf(A)}))});var PcA=r(()=>{ta();JQ()});var RcA=r(()=>{Aa();ta();JQ();TcA();JcA();PcA()});var fcA=()=>{};var OcA=r(()=>{JQ()});var zcA=r(()=>{JQ()});var Df=r(()=>{fcA();OcA();zcA();RcA()});var k5A,$5A,G5A,T5A,J5A,P5A,R5A,uf,Nzt;var vcA=r(()=>{Df();JA();KA();k5A=Q.enum(["ready","missing","degraded","unavailable"]),$5A=Q.object({id:Q.string(),label:Q.string(),status:Q.enum(["active","inactive","degraded"]),statusLabel:Q.string()}),G5A=Q.object({channel:Gb,name:Q.string(),description:Q.string(),scope:Q.enum(["personal","project"]),enabled:Q.boolean().nullable(),preferenceId:Q.string().nullable(),prerequisite:Q.object({status:k5A,statusLabel:Q.string(),message:Q.string()}),action:Q.object({label:Q.string(),href:Q.string()}).nullable(),destinations:Q.array($5A),destinationManagement:Q.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:Q.boolean(),supportedNotificationTypes:Q.array(ga)}),T5A=Q.object({channel:Be,enabled:Q.boolean(),preferenceId:Q.string().nullable()}),J5A=Q.object({channel:Be,notificationType:ga,enabled:Q.boolean(),preferenceId:Q.string()}),P5A=Q.object({projectId:Q.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),R5A=Q.object({channelCards:Q.array(G5A).length(10),channels:Q.array(T5A),notificationTypePreferences:Q.array(J5A),issueNotificationMinSeverity:Q.enum(["low","medium","high","critical"])}),uf=S({operationId:"notificationChannels.getProject",summary:"List Project Notification Channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:P5A,output:R5A,pagination:"none",async:"sync"}),Nzt={getProject:uf.contract}});var mcA,lf,WcA,Nf,Mzt,Yzt,Uf,Sf=(A,t)=>{if((A.componentIds?.length||A.componentId)&&"componentIds"in A.condition&&A.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(A.componentIds?.length&&A.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},kzt,ZcA,bf,Lf,na,VcA,f5A,O5A,z5A,v5A,m5A,W5A,Z5A,V5A,H5A,Ff,Mf,Yf,kf,$f,$zt;var HcA=r(()=>{Df();JA();KA();mcA=Q.enum(["low","medium","high","critical"]),lf=Q.object({severities:Q.array(mcA).min(1).optional()}).strict(),WcA=Q.object({componentIds:Q.array(Q.string().uuid()).min(1).optional(),severities:Q.array(mcA).min(1).optional()}).strict(),Nf=Q.object({channel:Be,destinationKey:Q.string().min(1)}),Mzt=Q.object({destinations:Q.array(Nf).min(1),notificationTypes:Q.array(Q.enum(Fi)).min(1),componentIds:Q.array(Q.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:Q.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:lf}),Yzt=Q.object({destinations:Q.array(Nf).min(1),notificationTypes:Q.array(Q.enum(Fi)).min(1),condition:WcA}),Uf=Q.object({destinations:Q.array(Nf).min(1),notificationTypes:Q.array(Q.enum(Fi)).min(1),componentIds:Q.array(Q.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:Q.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:Q.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:Q.union([lf,WcA])}),kzt=Uf.superRefine(Sf),ZcA=Q.object({id:Q.string(),channel:Be,destinationKey:Q.string(),displayName:Q.string()}),bf=Q.object({id:Q.string().uuid(),label:Q.string(),lifecycle:Q.enum(["active","retired","merged"])}),Lf=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),notificationTypes:Q.array(Q.enum(Fi)),destinations:Q.array(ZcA),condition:lf,component:bf.nullable(),componentId:Q.string().uuid().nullable(),includeDescendants:Q.boolean(),suspendedAt:Q.string().datetime().nullable(),suspensionReason:Q.string().nullable(),components:Q.array(bf),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),na=Q.object({projectId:Q.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),VcA=Q.string().uuid().describe("Logical notification delivery rule ID."),f5A=na,O5A=Q.object({rules:Q.array(Lf)}),z5A=Q.object({destinations:Q.array(ZcA),notificationTypes:Q.array(Q.object({notificationType:Q.enum(Fi),label:Q.string(),conditions:Q.array(Q.enum(["component","severity"]))})),components:Q.array(bf)}),v5A=na.extend(Uf.shape).superRefine(Sf),m5A=Lf,W5A=na.extend({...Uf.shape,ruleId:VcA}).superRefine(Sf),Z5A=Lf,V5A=na.extend({ruleId:VcA}),H5A=Q.object({removed:Q.boolean()}),Ff=S({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:f5A,output:O5A,pagination:"none",async:"sync"}),Mf=S({operationId:"notificationDeliveryRules.options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:na,output:z5A,pagination:"none",async:"sync"}),Yf=S({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:v5A,output:m5A,pagination:"none",async:"sync"}),kf=S({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:W5A,output:Z5A,pagination:"none",async:"sync"}),$f=S({operationId:"notificationDeliveryRules.delete",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:V5A,output:H5A,pagination:"none",async:"sync"}),$zt={list:Ff.contract,options:Mf.contract,create:Yf.contract,update:kf.contract,delete:$f.contract}});var Gf,X5A,j5A,K5A,_5A,x5A,s5A,Tf,q5A,d5A,Jf,p5A,AxA,Pf,txA,gxA,Rf,nxA,ixA,ff,Pzt;var XcA=r(()=>{JA();KA();Gf=Q.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),X5A=Q.enum(["needs-onboarding","blocked","ready"]),j5A=Q.enum(["incomplete","complete","skipped"]),K5A=Q.object({invitationId:Q.string(),organizationId:Q.string(),organizationName:Q.string(),organizationSlug:Q.string(),organizationImageUrl:Q.string().nullable(),inviterName:Q.string().nullable()}),_5A=Q.object({gate:X5A,canonicalStep:Gf.nullable(),organizationId:Q.string().nullable(),projectId:Q.string().nullable(),completionByStep:Q.record(Gf,j5A),githubSkipped:Q.boolean(),githubAppSkipped:Q.boolean(),slackSkipped:Q.boolean(),sampleIssueId:Q.string().nullable(),actorRole:Q.enum(["admin","member"]).nullable(),requiredStep:Q.union([Gf,Q.literal("select-organization")]).nullable(),isCompleted:Q.boolean(),onboardingRecommendationsThreadId:Q.string().nullable(),hasOrganizations:Q.boolean(),hasPaidBillingSubscription:Q.boolean(),billingStepEnabled:Q.boolean(),pendingInvitations:Q.array(K5A)}),x5A=Q.object({}),s5A=Q.object({onboarding:_5A}),Tf=S({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:x5A,output:s5A,pagination:"none",async:"sync"}),q5A=Q.object({integration:Q.enum(["github","slack"]).describe("Integration onboarding step to skip.")}),d5A=Q.object({skipped:Q.literal(!0)}),Jf=S({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:q5A,output:d5A,pagination:"none",async:"sync"}),p5A=Q.object({}),AxA=Q.object({skipped:Q.literal(!0)}),Pf=S({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App Installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:p5A,output:AxA,pagination:"none",async:"sync"}),txA=Q.object({}),gxA=Q.object({skipped:Q.literal(!0)}),Rf=S({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:txA,output:gxA,pagination:"none",async:"sync"}),nxA=Q.object({projectId:Q.string().uuid().describe("Project that completed onboarding.")}),ixA=Q.object({completed:Q.boolean()}),ff=S({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:nxA,output:ixA,pagination:"none",async:"sync"}),Pzt={getState:Tf.contract,skipIntegration:Jf.contract,skipGithubAppInstallation:Pf.contract,skipSampleIssue:Rf.contract,finish:ff.contract}});var Pb,oxA,exA,QxA,IxA,hxA,BxA,cxA,CxA,ExA,axA,Of,zf,vf,mf,vzt;var jcA=r(()=>{JA();KA();Lb();Pb=Q.object({id:Q.string().min(1),name:Q.string(),slug:Q.string(),logo:Q.string().nullable().optional()}),oxA=Pb.extend({role:he.optional()}),exA=Q.object({}),QxA=Q.object({organizations:Q.array(oxA).describe("Organizations available to the current credential.")}),IxA=Q.object({organizationId:Q.string().min(1).describe("Organization ID to fetch.")}),hxA=Q.object({organization:Pb}),BxA=Q.object({organizationId:Q.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:Q.string().trim().min(1).max(100).describe("New organization name.")}),cxA=Q.object({organization:Pb.describe("Updated organization.")}),CxA=Q.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),ExA=Q.object({name:CxA.describe("Organization display name.")}),axA=Q.object({organization:Pb}),Of=S({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:ExA,output:axA,pagination:"none",async:"sync"}),zf=S({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:exA,output:QxA,pagination:"none",async:"sync"}),vf=S({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:IxA,output:hxA,pagination:"none",async:"sync"}),mf=S({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:BxA,output:cxA,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),vzt={list:zf.contract,get:vf.contract,create:Of.contract,update:mf.contract}});var LB,ia,KcA,_cA,xcA,scA,qcA,dcA,pcA,Rb,fb,Ob,ACA,tCA,zb,gCA,nCA,vb,rxA;var Wf=r(()=>{JA();KA();LB=Q.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),ia=Q.object({id:Q.string().uuid(),organizationId:Q.string().min(1),name:Q.string(),region:LB}),KcA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),_cA=Q.object({projects:Q.array(ia).describe("Projects visible within the selected organization.")}),xcA=Q.object({projectId:Q.string().uuid().describe("Project ID to fetch.")}),scA=Q.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),qcA=Q.object({organizationId:Q.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted."),name:scA.describe("Project name."),region:LB.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),dcA=Q.object({project:ia}),pcA=Q.object({project:ia}),Rb=S({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:KcA,output:_cA,pagination:"none",async:"sync"}),fb=S({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:xcA,output:pcA,pagination:"none",async:"sync"}),Ob=S({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:qcA,output:dcA,pagination:"none",async:"sync"}),ACA=Q.object({projectId:Q.string().uuid().describe("Project ID to update."),name:scA.optional().describe("New project name.")}),tCA=Q.object({project:ia}),zb=S({operationId:"projects.update",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:ACA,output:tCA,pagination:"none",async:"sync"}),gCA=Q.object({projectId:Q.string().uuid().describe("Project ID to delete.")}),nCA=Q.void(),vb=S({operationId:"projects.delete",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:gCA,output:nCA,pagination:"none",async:"sync"}),rxA={list:Rb.contract,get:fb.contract,create:Ob.contract,update:zb.contract,delete:vb.contract}});var iCA,yxA,wxA,DxA,uxA,bxA,Zf,jzt;var oCA=r(()=>{JA();KA();iCA=Q.enum(["open","merged","closed"]),yxA=Q.enum(["review_required","approved","changes_requested"]),wxA=Q.enum(["passing","failing","pending"]),DxA=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),repositoryFullName:Q.string(),pullRequestId:Q.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:Q.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:Q.string().nullable(),url:Q.string().nullable(),status:iCA.nullable(),reviewState:yxA.nullable(),checksState:wxA.nullable(),requestedByUserId:Q.string().nullable(),authorLogin:Q.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:Q.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:Q.string().uuid().nullable(),runId:Q.string().uuid().nullable(),createdAt:Q.string().datetime(),mergedAt:Q.string().datetime().nullable(),closedAt:Q.string().datetime().nullable()}),uxA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:Q.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:iCA.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:Q.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:Q.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),bxA=Q.object({pullRequests:Q.array(DxA),nextCursor:Q.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),Zf=S({operationId:"pullRequests.list",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:uxA,output:bxA,pagination:"cursor",async:"sync"}),jzt={list:Zf.contract}});var eCA,QCA,ICA,hCA,BCA,oa;var Vf=r(()=>{JA();KA();eCA=Q.enum(["data_source","mcp_connector","sandbox_cli","integration"]),QCA=Q.enum(["connected","recommended"]),ICA=Q.object({kind:eCA.describe("What the recommendation targets: a data source, MCP connector, sandbox CLI, or integration."),targetId:Q.string().describe("Exact catalog id for the kind (data source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:QCA.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:Q.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:Q.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),hCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),BCA=Q.object({recommendations:Q.array(ICA).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),oa=S({operationId:"recommendations.list",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:hCA,output:BCA,pagination:"none",async:"sync"})});var cCA,lxA,CCA,mb,ECA,aCA,rCA,yCA,FB,Hf,wCA,DCA,MB,uCA,bCA,YB,lCA,NCA,kB,NxA;var Xf=r(()=>{JA();KA();cCA=Q.object({type:Q.string().describe("Preset type identifier."),label:Q.string().describe("Human-readable display name."),executableNames:Q.array(Q.string()).describe("CLI binary names installed by this preset."),envVarKeys:Q.array(Q.string()).describe("Environment variables required for authentication."),setupSkill:Q.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),lxA=Q.object({}),CCA=Q.object({types:Q.array(cCA)}),mb=S({operationId:"sandboxPresets.listTypes",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:lxA,output:CCA,pagination:"none",async:"sync"}),ECA=Q.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),aCA=Q.object({presetType:Q.string().describe("Preset type identifier."),credentialSource:ECA.describe("Authoritative credential source for the preset."),isSystemManaged:Q.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:Q.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:Q.array(Q.string()).describe("Stored environment variable names. Secret values are omitted.")}),rCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),yCA=Q.object({connections:Q.array(aCA)}),FB=S({operationId:"sandboxPresets.listConnections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:rCA,output:yCA,pagination:"none",async:"sync"}),Hf=Q.object({key:Q.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:Q.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),wCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:Q.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:Q.array(Hf).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),DCA=Q.object({projectId:Q.string().uuid().describe("Project the preset was written to."),presetType:Q.string().describe("Preset type that was upserted."),envVarKeys:Q.array(Q.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),MB=S({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:wCA,output:DCA,pagination:"none",async:"sync"}),uCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:Q.string().min(1).describe("Preset type identifier.")}),bCA=Q.object({projectId:Q.string().uuid().describe("Project the CLI connection belonged to."),presetType:Q.string().describe("Preset type that was disconnected."),deleted:Q.boolean().describe("Whether a stored CLI connection was deleted.")}),YB=S({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:uCA,output:bCA,pagination:"none",async:"sync"}),lCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:Q.string().min(1).describe("Preset type identifier."),environmentVariables:Q.array(Hf).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),NCA=Q.object({status:Q.enum(["success","failed"]),message:Q.string().nullable(),stdout:Q.string().describe("Truncated command output with submitted credentials redacted."),stderr:Q.string().describe("Truncated command errors with submitted credentials redacted.")}),kB=S({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:lCA,output:NCA,pagination:"none",async:"sync"}),NxA={deletePreset:YB.contract,listConnections:FB.contract,listTypes:mb.contract,testPreset:kB.contract,upsertPreset:MB.contract}});var Wb,UCA=1048576,jf,SCA,Kf,UxA,SxA,LxA,FxA,MxA,YxA,kxA,$xA,GxA,TxA,_f,xf,sf,qf,df,gvt;var LCA=r(()=>{JA();KA();Wb=Q.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),jf=Q.string().min(1).refine((A)=>new TextEncoder().encode(A).length<=UCA,{message:`Script content must be at most ${UCA} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),SCA=Q.object({id:Q.string().uuid(),projectId:Q.string().uuid(),name:Q.string(),description:Q.string().nullable(),contentHash:Q.string().describe("sha256 hex digest of the script content."),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime()}),Kf=SCA.extend({content:jf}),UxA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:Q.string().optional().describe("Case-insensitive partial match on script name."),cursor:Q.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:Q.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),SxA=Q.object({scripts:Q.array(SCA),nextCursor:Q.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),LxA=Q.object({name:Wb.describe("Script name to fetch."),projectId:Q.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),FxA=Q.object({script:Kf}),MxA=Q.object({projectId:Q.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:Wb.describe("Script name. Must be unique within the project among non-deleted scripts."),content:jf,description:Q.string().max(500).nullable().optional().describe("Optional human-readable description.")}),YxA=Q.object({script:Kf}),kxA=Q.object({name:Wb.describe("Script to update."),projectId:Q.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:jf.optional().describe("New script body. Omit to leave content unchanged."),description:Q.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),$xA=Q.object({script:Kf}),GxA=Q.object({name:Wb.describe("Script to delete."),projectId:Q.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),TxA=Q.object({deleted:Q.boolean()}),_f=S({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:UxA,output:SxA,pagination:"cursor",async:"sync"}),xf=S({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:LxA,output:FxA,pagination:"none",async:"sync"}),sf=S({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:MxA,output:YxA,pagination:"none",async:"sync"}),qf=S({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:kxA,output:$xA,pagination:"none",async:"sync"}),df=S({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:GxA,output:TxA,pagination:"none",async:"sync"}),gvt={list:_f.contract,get:xf.contract,create:sf.contract,update:qf.contract,delete:df.contract}});var pf,FCA,MCA,YCA,kCA,$B,GB,JxA;var AO=r(()=>{JA();KA();pf=Q.object({projectId:Q.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:Q.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:Q.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:Q.coerce.number().min(1).default(1).describe("One-based page number.")}),FCA=pf.extend({status:Q.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),MCA=pf.extend({threadId:Q.string().uuid().optional().describe("Optional thread restriction for message search."),role:Q.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),YCA=Q.object({threads:Q.array(Q.object({id:Q.string().uuid(),projectId:Q.string().uuid().optional(),title:Q.string(),status:Q.enum(["regular","archived"]),labels:Q.array(Q.string()),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime(),highlights:Q.array(Q.string()),score:Q.number().optional()})),pagination:Q.object({page:Q.number(),limit:Q.number(),totalResults:Q.number(),totalPages:Q.number()}).describe("Page-based pagination metadata for the current search result.")}),kCA=Q.object({messages:Q.array(Q.object({id:Q.string().uuid(),threadId:Q.string().uuid(),threadTitle:Q.string(),role:Q.enum(["user","assistant"]),content:Q.string(),createdAt:Q.string().datetime(),updatedAt:Q.string().datetime(),highlights:Q.array(Q.string()),score:Q.number().optional()})),pagination:Q.object({page:Q.number(),limit:Q.number(),totalResults:Q.number(),totalPages:Q.number()}).describe("Page-based pagination metadata for the current search result.")}),$B=S({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:FCA,output:YCA,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),GB=S({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:MCA,output:kCA,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),JxA={threads:$B.contract,messages:GB.contract}});var $CA;var GCA=r(()=>{$CA=["onboarding","setup"]});var TCA,JCA,PCA,RCA,ea;var tO=r(()=>{GCA();JA();KA();TCA=Q.enum($CA),JCA=Q.object({id:Q.string().describe("Unique task identifier (e.g. install_github_app)."),label:Q.string().describe("Short human-readable task name."),description:Q.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:Q.string().describe("Step-by-step instructions for completing this task."),completed:Q.boolean().describe("Whether the task has been completed."),completedAt:Q.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:TCA.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),PCA=Q.object({projectId:Q.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),RCA=Q.object({tasks:Q.array(JCA).describe("All onboarding and setup tasks with their current completion status.")}),ea=S({operationId:"tasks.list",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:PCA,output:RCA,pagination:"none",async:"sync"})});var PxA,RxA,PQ,fxA,OxA,zxA,vxA,mxA,WxA,ZxA,VxA,HxA,XxA,jxA,KxA,_xA,xxA,gO,nO,iO,oO,eO,QO,IO,avt;var fCA=r(()=>{JA();KA();PxA=Q.object({id:Q.string().uuid().describe("Team ID."),name:Q.string().describe("Team name, unique among the org's active teams."),description:Q.string().nullable().describe("Optional team description."),createdAt:Q.string().datetime().describe("When the team was created."),memberCount:Q.number().int().nonnegative().describe("Number of active members in the team.")}),RxA=Q.object({userId:Q.string().min(1).describe("User ID of the team member."),name:Q.string().nullable().describe("Display name for the member, when available."),email:Q.string().email().describe("Email address for the member."),addedAt:Q.string().datetime().describe("When the member was added to the team.")}),PQ=Q.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),fxA=Q.object({organizationId:PQ}),OxA=Q.object({teams:Q.array(PxA).describe("Active teams in the organization.")}),zxA=Q.object({organizationId:PQ,name:Q.string().trim().min(1).describe("Team name."),description:Q.string().trim().min(1).optional().describe("Optional team description.")}),vxA=Q.object({id:Q.string().uuid().describe("ID of the created team.")}),mxA=Q.object({organizationId:PQ,teamId:Q.string().uuid().describe("Team to update."),name:Q.string().trim().min(1).optional().describe("New team name."),description:Q.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),WxA=Q.object({id:Q.string().uuid().describe("ID of the updated team.")}),ZxA=Q.object({params:Q.object({teamId:Q.string().uuid().describe("Team to delete.")}),query:Q.object({organizationId:PQ})}).transform(({params:A,query:t})=>({...t,...A})),VxA=Q.object({success:Q.literal(!0).describe("The team and its memberships were removed.")}),HxA=Q.object({organizationId:PQ,teamId:Q.string().uuid().describe("Team to add the member to."),userId:Q.string().min(1).describe("User ID of an active organization member to add.")}),XxA=Q.object({id:Q.string().uuid().describe("ID of the team membership.")}),jxA=Q.object({params:Q.object({teamId:Q.string().uuid().describe("Team to remove the member from."),userId:Q.string().min(1).describe("User ID of the member to remove.")}),query:Q.object({organizationId:PQ})}).transform(({params:A,query:t})=>({...t,...A})),KxA=Q.object({success:Q.literal(!0).describe("The membership was removed.")}),_xA=Q.object({organizationId:PQ,teamId:Q.string().uuid().describe("Team to list members for.")}),xxA=Q.object({members:Q.array(RxA).describe("Active members of the team.")}),gO=S({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:fxA,output:OxA,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),nO=S({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:zxA,output:vxA,pagination:"none",async:"sync"}),iO=S({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:mxA,output:WxA,pagination:"none",async:"sync"}),oO=S({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:ZxA,output:VxA,pagination:"none",async:"sync"}),eO=S({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:HxA,output:XxA,pagination:"none",async:"sync"}),QO=S({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:jxA,output:KxA,pagination:"none",async:"sync"}),IO=S({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:_xA,output:xxA,pagination:"none",async:"sync"}),avt={list:gO.contract,create:nO.contract,update:iO.contract,delete:oO.contract,addMember:eO.contract,removeMember:QO.contract,listMembers:IO.contract}});var sxA,qxA,dxA,hO,pxA,AsA,BO,tsA,gsA,cO,Dvt;var OCA=r(()=>{JA();KA();sxA=Q.object({kind:Q.enum(["user","workspace"]),name:Q.string().optional(),email:Q.string().optional()}),qxA=Q.object({container:Q.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:Q.string().min(1),bodyMarkdown:Q.string().optional(),state:Q.string().optional(),itemType:Q.string().optional(),organizationId:Q.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization."),clientRequestId:Q.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),dxA=Q.object({identifier:Q.string(),title:Q.string(),url:Q.string(),state:Q.string(),attribution:sxA.optional(),reused:Q.boolean()}),hO=S({operationId:"work-items.create",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:qxA,output:dxA,pagination:"none",async:"sync"}),pxA=Q.object({itemId:Q.string().min(1).describe("The work item to comment on."),bodyMarkdown:Q.string().min(1),organizationId:Q.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization.")}).strict(),AsA=Q.object({identifier:Q.string(),url:Q.string()}),BO=S({operationId:"work-items.comment",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:pxA,output:AsA,pagination:"none",async:"sync"}),tsA=Q.object({itemId:Q.string().min(1).describe("The work item to transition."),state:Q.string().min(1).describe("The target workflow state."),organizationId:Q.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization.")}).strict(),gsA=Q.object({identifier:Q.string(),title:Q.string(),url:Q.string(),state:Q.string(),changed:Q.boolean()}),cO=S({operationId:"work-items.transition",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:tsA,output:gsA,pagination:"none",async:"sync"}),Dvt={create:hO.contract,comment:BO.contract,transition:cO.contract}});var CO;var zCA=r(()=>{yW();bW();uM();LM();VW();tY();iY();Y4();Dw();eK();Pk();fR();Lb();vBA();_R();ccA();vcA();HcA();XcA();jcA();Wf();oCA();Vf();Yb();Xf();LCA();AO();tO();fCA();Cf();OCA();CO={me:OR.contract,automations:{list:MM.contract,get:YM.contract,create:kM.contract,update:$M.contract,enable:GM.contract,disable:TM.contract,runs:{list:JM.contract,get:PM.contract,logs:RM.contract}},logs:{query:zI.contract,schema:vI.contract,volume:mI.contract,patterns:WI.contract,nativeQuery:ZI.contract},logSources:{listProviders:aw.contract,list:fI.contract,create:OI.contract,get:rw.contract,update:yw.contract,delete:ww.contract},logStreams:{list:Mk.contract,create:Yk.contract,get:kk.contract,update:$k.contract,delete:Gk.contract,reassign:Tk.contract},connectedAccounts:{beginConnect:lM.contract,getConnectAttempt:NM.contract,list:UM.contract,disconnect:SM.contract},integrations:{listProviders:NW.contract,listConnections:UW.contract,getConnection:SW.contract,createConnection:LW.contract,beginConnect:FW.contract,getConnectAttempt:MW.contract,disconnectConnection:YW.contract,updateConnectionCredentials:kW.contract,getOrganizationExternalIdentityJitPolicy:TW.contract,updateOrganizationExternalIdentityJitPolicy:JW.contract,getConnectionExternalIdentityJitPolicy:PW.contract,updateConnectionExternalIdentityJitPolicy:RW.contract,getSlackConfiguration:OW.contract,updateSlackConfiguration:zW.contract,listSlackChannelProjectMappings:mW.contract,setSlackChannelProjectMapping:WW.contract,deleteSlackChannelProjectMapping:ZW.contract},notificationChannels:{getProject:uf.contract},notificationDeliveryRules:{list:Ff.contract,options:Mf.contract,create:Yf.contract,update:kf.contract,delete:$f.contract},mcpConnectors:{listProviders:Sb.contract,list:QB.contract,get:IB.contract,details:hB.contract,search:BB.contract,describe:cB.contract,call:CB.contract,create:EB.contract,update:aB.contract,disconnect:rB.contract,setReadOnly:yB.contract,beginOAuthInstall:wB.contract,getOAuthInstallAttempt:DB.contract},sandboxPresets:{deletePreset:YB.contract,listConnections:FB.contract,listTypes:mb.contract,testPreset:kB.contract,upsertPreset:MB.contract},scripts:{list:_f.contract,get:xf.contract,create:sf.contract,update:qf.contract,delete:df.contract},logMatchExpressions:{list:QY.contract,get:IY.contract,create:hY.contract,update:BY.contract,disable:cY.contract},memory:{put:uB.contract,get:bB.contract,list:lB.contract,search:NB.contract,delete:UB.contract},onboarding:{getState:Tf.contract,skipIntegration:Jf.contract,skipGithubAppInstallation:Pf.contract,skipSampleIssue:Rf.contract,finish:ff.contract},organizations:{list:zf.contract,get:vf.contract,create:Of.contract,update:mf.contract},members:{list:zR.contract,updateRole:vR.contract,remove:mR.contract,invite:WR.contract,listInvitations:ZR.contract,revokeInvitation:VR.contract},teams:{list:gO.contract,create:nO.contract,update:iO.contract,delete:oO.contract,addMember:eO.contract,removeMember:QO.contract,listMembers:IO.contract},publicKeys:{list:$I.contract,get:GI.contract,ensureLogForwarding:TI.contract,update:JI.contract,deactivate:PI.contract},secretKeys:{list:ow.contract,get:ew.contract,create:Qw.contract,update:Iw.contract,delete:hw.contract},projects:{list:Rb.contract,get:fb.contract,create:Ob.contract,update:zb.contract,delete:vb.contract},search:{threads:$B.contract,messages:GB.contract},messages:{list:hcA.contract,append:BcA.contract},threads:{list:Af.contract,get:tf.contract,getStatus:gf.contract,stop:nf.contract,create:of.contract,update:ef.contract,fork:Qf.contract,setVisibility:If.contract,createShareLink:hf.contract,listShareLinks:Bf.contract,revokeShareLink:cf.contract},runs:{list:xR.contract,listForThread:sR.contract,get:qR.contract,cancel:dR.contract},pullRequests:{list:Zf.contract},issues:{count:_y.contract,create:kI.contract,list:jy.contract,search:Ky.contract,get:xy.contract,resolve:sy.contract,ignore:qy.contract,reopen:dy.contract,reassignAndReopen:py.contract,mute:Aw.contract,unmute:tw.contract},workItems:{create:hO.contract,comment:BO.contract,transition:cO.contract},billing:{getSummary:OM.contract,getUsage:zM.contract,listTransactions:vM.contract,retryOutstandingBalance:mM.contract,getAutoTopUp:ZM.contract,updateAutoTopUp:VM.contract,purchaseCredits:HM.contract,listPlans:XM.contract,previewPlanChange:jM.contract,changePlan:KM.contract,createCheckoutSession:_M.contract,getCheckoutSessionStatus:xM.contract,createPortalSession:sM.contract,getPaymentMethod:qM.contract},tasks:{list:ea.contract},recommendations:{list:oa.contract},components:{list:Ly.contract,get:Fy.contract,register:MI.contract,deregister:My.contract,rename:Yy.contract,assignTeam:ky.contract,retirementPreview:$y.contract,retire:Gy.contract,restorationPreview:Ty.contract,restore:Jy.contract,mergePreview:vy.contract,merge:my.contract,relationships:{list:Py.contract,preview:Ry.contract,add:fy.contract,remove:Oy.contract},incidents:{list:Wy.contract},timeline:Zy.contract}}});var RQ=r(()=>{om();uM();LM();zCA();tY();iY();Dw();Pk();fR();_R();Wf();Vf();Xf();AO();tO()});var nsA="https://api.sazabi.com",isA="x-sazabi-client-source",mCA=(A)=>{return{streamRun:async(t)=>{return vCA({options:A,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal})},streamThread:async(t)=>{return vCA({options:A,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}}},vCA=async(A)=>{let t=A.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let g=await A.options.credentialProvider.getToken(),i=osA(A.options.apiBaseUrl,A.path,A.cursor);return QsA({url:i,token:g,clientSource:A.options.clientSource,initialCursor:A.cursor,signal:A.signal,fetch:t})},osA=(A,t,g)=>{let i=esA(A??nsA),n=new URL(`${i}${t}`);if(g)n.searchParams.set(iM,g);return n.toString()},esA=(A)=>{let t=A.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},QsA=async(A)=>{let t=[],g=[],i=!1,n=!1,o,e=A.initialCursor,I=new AbortController,h=(w)=>{if(i)return;i=!0,o=w;while(g.length>0)g.shift()?.({value:void 0,done:!0})},B=(w)=>{let l=g.shift();if(l){l({value:w,done:!1});return}t.push(w)},c=(w)=>{if(w.event===eM){let N=CsA(w.data);if(N!==void 0)e=N;return}if(w.data===QM){n=!0,I.abort(),h();return}let l=EsA(w.data);if(l)B(l)},C=()=>{n=!0,I.abort(),h()};if(A.signal)if(A.signal.aborted)n=!0,I.abort();else A.signal.addEventListener("abort",C,{once:!0});let E={[Symbol.asyncIterator](){return E},get cursor(){return e},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(i){if(o)throw o;return{value:void 0,done:!0}}return new Promise((w)=>{g.push(w)}).then((w)=>{if(w.done&&o)throw o;return w})},return:async()=>{return n=!0,I.abort(),h(),{value:void 0,done:!0}},throw:async(w)=>{throw n=!0,I.abort(),h(w instanceof Error?w:Error(String(w))),w},close:async()=>{n=!0,I.abort(),h()}};if(n)return h(),E;let a=await A.fetch(A.url,{method:oM,headers:IsA(A.token,A.clientSource),signal:I.signal});if(await hsA(a))h();else BsA(a,c).then(()=>h()).catch((w)=>{if(rsA(w)||n||A.signal?.aborted){h();return}h(ysA(w))});return E},IsA=(A,t)=>{return{accept:"text/event-stream",authorization:`Bearer ${A}`,...t?{[isA]:t}:{}}},hsA=async(A)=>{if(A.status===204)return!0;if(A.ok&&A.body)return!1;let t=await asA(A);if(A.status===401)throw Error("Authentication failed. Check your credential.");if(A.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(A.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(A.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(A.status>=400&&A.status<500&&A.status!==429)throw Error(`Client error (${A.status}): ${t}`);if(!A.body)throw Error("Agent stream response did not include a body.");throw Error(A.status===429?`Rate limited (429): ${t}`:`Server error (${A.status}): ${t}`)},BsA=async(A,t)=>{let g=A.body?.getReader();if(!g)throw Error("Agent stream response did not include a body.");let i=new TextDecoder,n="",o=csA(t);try{while(!0){let e=await g.read();if(e.done)break;n+=i.decode(e.value,{stream:!0});let I=n.split(/\r\n|\r|\n/);n=I.pop()??"";for(let h of I)o.line(h)}if(n+=i.decode(),n)for(let e of n.split(/\r\n|\r|\n/))o.line(e);o.flush()}finally{g.releaseLock()}},csA=(A)=>{let t="message",g=[],i=()=>{t="message",g=[]},n=()=>{if(g.length===0){i();return}A({event:t,data:g.join(`
8708
8708
  `)}),i()};return{line:(o)=>{if(o===""){n();return}if(o.startsWith(":"))return;let e=o.indexOf(":"),I=e===-1?o:o.slice(0,e),h=e===-1?"":o.slice(e+1),B=h.startsWith(" ")?h.slice(1):h;if(I==="event"){t=B||"message";return}if(I==="data")g.push(B)},flush:n}},CsA=(A)=>{try{let t=nM.safeParse(JSON.parse(A));return t.success?t.data.streamNextOffset:void 0}catch{return}},EsA=(A)=>{try{let t=gM.safeParse(JSON.parse(A));return t.success?t.data:void 0}catch{return}},asA=async(A)=>{try{return await A.text()}catch{return""}},rsA=(A)=>{return A instanceof Error&&A.name==="AbortError"},ysA=(A)=>{return A instanceof Error?A:Error(String(A))};var WCA=r(()=>{RQ()});var EO,aO,rO,ZCA;var VCA=r(()=>{JA();EO=Q.object({severities:Q.array(Q.string()).optional().describe("Limit results to the listed severities."),services:Q.array(Q.string()).optional().describe("Limit results to the listed service names."),environments:Q.array(Q.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:Q.string().optional().describe("Case-insensitive substring match against the log body."),traceId:Q.string().optional().describe("Limit results to one trace ID."),attributes:Q.record(Q.string(),Q.string()).optional().describe("Limit results to logs whose attributes contain every listed key with an exactly equal value.")}),aO=Q.object({service:Q.string(),namespace:Q.string(),environment:Q.string(),host:Q.string(),container:Q.string(),pod:Q.string()}),rO=Q.object({id:Q.string(),timestamp:Q.string().datetime(),severity:Q.string(),body:Q.string(),service:Q.string(),traceId:Q.string(),spanId:Q.string(),attributes:Q.record(Q.string(),Q.string()),resource:aO}),ZCA=Q.object({type:Q.literal("logs"),timestamp:Q.string().datetime(),data:Q.array(rO)})});var wsA="https://{region}.intake.sazabi.com",DsA="https://{region}.tail.sazabi.com",jCA=500,usA=5000,KCA="sazabi.public_key",bsA="x-sazabi-internal-log-forwarding-secret",lsA="x-sazabi-internal-log-forwarding-source",NsA=(A)=>{return A.startsWith("[")&&A.endsWith("]")?A.slice(1,-1):A},_CA=(A)=>{let t=NsA(A);return t==="localhost"||t==="127.0.0.1"||t==="::1"},UsA,SsA,LsA,xCA=(A)=>{let t=new Map;return{tail:async(g)=>{let i=await OsA(A.credentialProvider,g.projectId,"logs.tail"),n=await zsA(A,t,i,g.region,"logs.tail"),o=YsA({projectId:i,region:n,filters:g.filters,apiBaseUrl:A.apiBaseUrl,tailBaseUrl:A.tailBaseUrl}),e=await A.credentialProvider.getToken(),I=A.fetch??globalThis.fetch;if(!I)throw Error("Fetch transport is not available in this runtime.");return msA({token:e,url:o,signal:g.signal,fetch:I})},forward:async(g)=>{let i=await vsA(A,t,g.projectId??await A.credentialProvider.getProjectId?.(),g.region,"logs.forward"),n=TsA(i,A.intakeBaseUrl),o=A.fetch??globalThis.fetch,e=PsA(g.logs,g.publicKey),I=_sA(e);return await KsA(o,n,e,fsA(g.sazabiInternalForwarding)),{forwardedCount:I,failedCount:0}}}},FsA="3010",MsA,YsA=(A)=>{let t=(A.tailBaseUrl??ksA({region:A.region,apiBaseUrl:A.apiBaseUrl})).replace("{region}",A.region),g=$sA(t);g.searchParams.set("projectId",A.projectId);let i=GsA(A.filters);if(i)g.searchParams.set("filters",i);return g.toString()},ksA=(A)=>{if(A.apiBaseUrl)try{let t=new URL(A.apiBaseUrl).hostname;if(t.endsWith(".sazabi.dev")){let g=t.includes(".staging.")?"staging.sazabi.dev":"development.sazabi.dev";return`https://${A.region}.tail.${g}`}}catch{}return DsA.replace("{region}",A.region)},$sA=(A)=>{let t=(()=>{try{return new URL(A)}catch{return null}})();if(!t)throw Error(`Invalid tail base URL: ${A}`);if(_CA(t.hostname)){if(t.protocol="http:",!t.port||MsA.has(t.port))t.port=FsA;return t.pathname="/v1/tail",t.search="",t.hash="",t}if(t.protocol==="ws:"||t.protocol==="wss:")t.protocol=t.protocol==="wss:"?"https:":"http:";if(t.protocol!=="http:"&&t.protocol!=="https:")throw Error(`Invalid tail base URL protocol: ${t.protocol}. Expected http:, https:, ws:, or wss:.`);return t.pathname="/v1/tail",t.search="",t.hash="",t},GsA=(A)=>{if(!A)return;let t=Object.entries(A).filter(([,g])=>g!==void 0&&(!Array.isArray(g)||g.length>0)&&(typeof g!=="object"||Array.isArray(g)||g===null||Object.keys(g).length>0)&&g!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},TsA=(A,t)=>{let g=(t??wsA).replace("{region}",A),i=g.endsWith("/")?g.slice(0,-1):g,n=JsA(i);if(n)return n;let o=i.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${o?`https://otlp.${o[1]}.intake.${o[2]}`:i}/v1/logs`},JsA=(A)=>{let t=(()=>{try{return new URL(A)}catch{return null}})();if(!t)return;if(!_CA(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},PsA=(A,t)=>{let g=A.resourceLogs;if(!g||g.length===0)return{...A,resourceLogs:[{resource:{attributes:[sCA(t)]},scopeLogs:[]}]};return{...A,resourceLogs:g.map((i)=>({...i,resource:{...i.resource,attributes:RsA(i.resource?.attributes,t)}}))}},RsA=(A,t)=>{return[...(A??[]).filter((i)=>i?.key!==KCA),sCA(t)]},sCA=(A)=>({key:KCA,value:{stringValue:A}}),fsA=(A)=>{if(!A?.secret)return{};return{[bsA]:A.secret,...A.source?{[lsA]:A.source}:{}}},OsA=async(A,t,g)=>{let i=t??await A.getProjectId?.();if(i)return i;throw pCA(g,"Project ID is required",["projectId"])},zsA=async(A,t,g,i,n)=>{return i??await qCA(A,t,g)},vsA=async(A,t,g,i,n)=>{if(i)return i;if(!g)throw pCA(n,"Project ID is required",["projectId"]);return qCA(A,t,g)},qCA=async(A,t,g)=>{let i=t.get(g);if(i)return i;let n=A.raw.projects.get({projectId:g}).then((o)=>o.project.region);t.set(g,n);try{return await n}catch(o){throw t.delete(g),o}},msA=async(A)=>{let t=[],g=[],i=!1,n=!1,o,e=0,I,h,B=(l)=>{if(i)return;i=!0,o=l;while(g.length>0){let N=g.shift();if(N)N({value:void 0,done:!0})}},c=(l)=>{let N=g.shift();if(N){N({value:l,done:!1});return}t.push(l)},C=()=>{h?.abort()},E=(l)=>{if(l.event!=="log"){if(l.id)I=l.id;return}let N=XsA(l.data);for(let Y of N)c(Y);if(l.id)I=l.id},a=async(l)=>{let N=!1;while(!i&&!n){let Y=new AbortController,T=()=>Y.abort();h=Y;let H=!1;A.signal?.addEventListener("abort",T,{once:!0});try{let P=await A.fetch(WsA(A.url,I),{method:"GET",headers:{accept:"text/event-stream",authorization:`Bearer ${A.token}`},signal:Y.signal});await ZsA(P),e=0,N=!0,l(),await VsA(P,E),H=!0}catch(P){if(XCA(P)||A.signal?.aborted)break;let eA=HCA(P);if(!N||jsA(eA))throw eA;H=!0}finally{if(A.signal?.removeEventListener("abort",T),h===Y)h=void 0}if(i||n||A.signal?.aborted)break;if(!H)continue;e+=1,await dCA(Math.min(jCA*2**(e-1),usA),A.signal)}};if(A.signal?.addEventListener("abort",()=>{n=!0,C(),B()},{once:!0}),A.signal?.aborted)n=!0,C(),B();await new Promise((l,N)=>{let Y=!1;a(()=>{if(!Y)Y=!0,l()}).catch((H)=>{let P=HCA(H);if(!Y){Y=!0,N(P);return}if(!XCA(H))B(P)})});let w={[Symbol.asyncIterator](){return w},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(i){if(o)throw o;return{value:void 0,done:!0}}return new Promise((l)=>{g.push(l)}).then((l)=>{if(l.done&&o)throw o;return l})},return:async()=>{return n=!0,C(),B(),{value:void 0,done:!0}},throw:async(l)=>{throw n=!0,C(),B(l instanceof Error?l:Error(String(l))),l}};return w},WsA=(A,t)=>{if(!t)return A;let g=new URL(A);return g.searchParams.set("cursor",t),g.toString()},ZsA=async(A)=>{if(A.ok&&A.body)return;let t=await A.text();if(A.status===401)throw Error("Authentication failed. Check your credential.");if(A.status===403){if(/not served by this region/i.test(t))throw Error(`Wrong region (403): ${t||"Project is not served by this region"}`);throw Error(`Forbidden (403): ${t||"Credential may not have access to this project"}`)}if(A.status>=400&&A.status<500&&A.status!==429)throw Error(`Client error (${A.status}): ${t}`);if(!A.body)throw Error("Tail stream response did not include a body.");throw Error(A.status===429?`Rate limited (429): ${t}`:`Server error (${A.status}): ${t}`)},VsA=async(A,t)=>{let g=A.body?.getReader();if(!g)throw Error("Tail stream response did not include a body.");let i=new TextDecoder,n="",o=HsA(t);try{while(!0){let e=await g.read();if(e.done)break;n+=i.decode(e.value,{stream:!0});let I=n.split(/\r\n|\r|\n/);n=I.pop()??"";for(let h of I)o.line(h)}if(n+=i.decode(),n){let e=n.split(/\r\n|\r|\n/);for(let I of e)o.line(I)}o.flush()}finally{g.releaseLock()}},HsA=(A)=>{let t="message",g,i=[],n=()=>{t="message",g=void 0,i=[]},o=()=>{if(i.length===0&&!g){n();return}A({event:t,data:i.join(`
8709
8709
  `),...g?{id:g}:{}}),n()};return{line:(e)=>{if(e===""){o();return}if(e.startsWith(":"))return;let I=e.indexOf(":"),h=I===-1?e:e.slice(0,I),B=I===-1?"":e.slice(I+1),c=B.startsWith(" ")?B.slice(1):B;if(h==="event"){t=c||"message";return}if(h==="data"){i.push(c);return}if(h==="id"&&!c.includes("\x00"))g=c},flush:o}},XsA=(A)=>{try{let t=ZCA.safeParse(JSON.parse(A));if(!t.success)return[];return t.data.data}catch{return[]}},HCA=(A)=>{return A instanceof Error?A:Error(String(A))},XCA=(A)=>{return A instanceof Error&&A.name==="AbortError"},jsA=(A)=>{return A.message.startsWith("Authentication failed")||A.message.startsWith("Forbidden (")||A.message.startsWith("Wrong region (")||A.message.startsWith("Client error (")},KsA=async(A,t,g,i={},n=3,o=1e4)=>{let e;for(let I=0;I<=n;I+=1){let h=new AbortController,B=globalThis.setTimeout(()=>h.abort(),o);try{let c=await A(t,{method:"POST",headers:{"content-type":"application/json",...i},body:JSON.stringify(g),signal:h.signal});if(c.ok)return;let C=await c.text();if(c.status===401||c.status===403)throw Error("Authentication failed. Check your public key.");if(c.status>=400&&c.status<500&&c.status!==429)throw Error(`Client error (${c.status}): ${C}`);e=Error(c.status===429?`Rate limited (429): ${C}`:`Server error (${c.status}): ${C}`)}catch(c){let C=c instanceof Error?c.message:String(c);if(C.startsWith("Authentication failed")||C.startsWith("Client error ("))throw c instanceof Error?c:Error(C);e=c instanceof Error&&c.name==="AbortError"?Error("Request timed out"):c instanceof Error?c:Error(String(c))}finally{globalThis.clearTimeout(B)}if(I<n)await dCA(jCA*2**I)}throw Error(`Failed after ${n+1} attempts: ${e?.message??"Unknown error"}`)},_sA=(A)=>{return A.resourceLogs?.reduce((t,g)=>t+(g.scopeLogs?.reduce((i,n)=>i+(n.logRecords?.length??0),0)??0),0)??0},dCA=async(A,t)=>{if(t?.aborted)return;await new Promise((g)=>{let i=globalThis.setTimeout(g,A);t?.addEventListener("abort",()=>{globalThis.clearTimeout(i),g()},{once:!0})})},pCA=(A,t,g)=>{return new _t("BAD_REQUEST",{message:t,data:{operationId:A,missingContext:g}})};var yO=r(()=>{xQ();VCA();JA();UsA=Q.object({projectId:Q.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:EO.optional().describe("Optional filters applied by the tail SSE service.")}),SsA=Q.object({publicKey:Q.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:Q.custom((A)=>typeof A==="object"&&A!==null).describe("OTLP logs export request payload to send to the intake service.")}),LsA=Q.object({forwardedCount:Q.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:Q.number().int().nonnegative().describe("Number of log records rejected by the intake request.")}),MsA=new Set(["15006","3010"])});var wO="https://api.sazabi.com",tEA="https://api.platform.sazabi.com",gEA="sazabi-cli",xsA="urn:ietf:params:oauth:grant-type:device_code",nEA=(A)=>{let t=jl(new oN(CO,{url:ssA(A.apiBaseUrl??wO),headers:async()=>{let n=new Headers({authorization:`Bearer ${await A.credentialProvider.getToken()}`});if(A.clientSource)n.set("x-sazabi-client-source",A.clientSource);if(A.sandboxActorDescriptor)n.set("x-sazabi-sandbox-actor",A.sandboxActorDescriptor);return n},fetch:A.fetch,customErrorResponseBodyDecoder:(n,o)=>{let e=n3A(n);if(!e)return null;return new _t(e.code,{message:e.message,status:o.status,data:{operationId:e.operationId,missingContext:e.missingContext}})}})),g=xCA({raw:t,credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??wO,intakeBaseUrl:A.intakeBaseUrl,tailBaseUrl:A.tailBaseUrl}),i=mCA({credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??wO,clientSource:A.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(n={})=>t.automations.list(await AA(A.credentialProvider,n,"automations.list")),get:async(n)=>t.automations.get(await AA(A.credentialProvider,n,"automations.get")),create:async(n)=>t.automations.create(await AA(A.credentialProvider,n,"automations.create")),update:async(n)=>t.automations.update(await AA(A.credentialProvider,n,"automations.update")),enable:async(n)=>t.automations.enable(await AA(A.credentialProvider,n,"automations.enable")),disable:async(n)=>t.automations.disable(await AA(A.credentialProvider,n,"automations.disable")),runs:{list:async(n)=>t.automations.runs.list(await AA(A.credentialProvider,n,"automations.runs.list")),get:async(n)=>t.automations.runs.get(await AA(A.credentialProvider,n,"automations.runs.get")),logs:async(n)=>t.automations.runs.logs(await AA(A.credentialProvider,n,"automations.runs.logs"))}},logs:{...g,query:async(n={})=>t.logs.query(await AA(A.credentialProvider,n,zI.operationId)),schema:async(n={})=>t.logs.schema(await AA(A.credentialProvider,n,vI.operationId)),volume:async(n)=>t.logs.volume(await AA(A.credentialProvider,n,mI.operationId)),patterns:async(n={})=>t.logs.patterns(await AA(A.credentialProvider,n,WI.operationId)),nativeQuery:async(n)=>t.logs.nativeQuery(await AA(A.credentialProvider,n,ZI.operationId))},organizations:{list:async()=>t.organizations.list({}),get:async(n)=>t.organizations.get(n),update:async(n)=>t.organizations.update(await dsA(A.credentialProvider,n))},members:{list:async(n={})=>t.members.list(await GA(A.credentialProvider,n)),updateRole:async(n)=>t.members.updateRole(await GA(A.credentialProvider,n)),remove:async(n)=>{let o=await GA(A.credentialProvider,n);return t.members.remove({params:{member:o.member},query:{organizationId:o.organizationId}})},invite:async(n)=>t.members.invite(await GA(A.credentialProvider,n)),listInvitations:async(n={})=>t.members.listInvitations(await GA(A.credentialProvider,n)),revokeInvitation:async(n)=>{let o=await GA(A.credentialProvider,n);return t.members.revokeInvitation({params:{invitationId:o.invitationId},query:{organizationId:o.organizationId}})}},teams:{list:async(n={})=>t.teams.list(await GA(A.credentialProvider,n)),create:async(n)=>t.teams.create(await GA(A.credentialProvider,n)),update:async(n)=>t.teams.update(await GA(A.credentialProvider,n)),delete:async(n)=>{let o=await GA(A.credentialProvider,n);return t.teams.delete({params:{teamId:o.teamId},query:{organizationId:o.organizationId}})},addMember:async(n)=>t.teams.addMember(await GA(A.credentialProvider,n)),removeMember:async(n)=>{let o=await GA(A.credentialProvider,n);return t.teams.removeMember({params:{teamId:o.teamId,userId:o.userId},query:{organizationId:o.organizationId}})},listMembers:async(n)=>t.teams.listMembers(await GA(A.credentialProvider,n))},publicKeys:{list:async(n={})=>t.publicKeys.list(await AA(A.credentialProvider,n,$I.operationId)),get:async(n)=>t.publicKeys.get(await AA(A.credentialProvider,n,GI.operationId)),ensureLogForwarding:async(n={})=>t.publicKeys.ensureLogForwarding(await AA(A.credentialProvider,n,TI.operationId)),update:async(n)=>t.publicKeys.update(await AA(A.credentialProvider,n,JI.operationId)),deactivate:async(n)=>{let o=await AA(A.credentialProvider,n,PI.operationId);return t.publicKeys.deactivate({params:{keyId:o.keyId},query:{projectId:o.projectId}})}},secretKeys:{list:async(n={})=>t.secretKeys.list(n),get:async(n)=>t.secretKeys.get(n),create:async(n)=>t.secretKeys.create(n),update:async(n)=>t.secretKeys.update(n),delete:async(n)=>{await t.secretKeys.delete({params:{keyId:n.keyId}})}},search:{threads:async(n)=>t.search.threads(await AA(A.credentialProvider,n,$B.operationId)),messages:async(n)=>t.search.messages(await AA(A.credentialProvider,n,GB.operationId))},projects:{list:async(n={})=>t.projects.list(await qsA(A.credentialProvider,n)),get:async(n)=>t.projects.get(n),create:async(n)=>t.projects.create(await GA(A.credentialProvider,n))},messages:{list:async(n)=>t.messages.list(n),append:async(n)=>AEA(t,await t.messages.append(g3A(n)))},threads:{list:async(n={})=>t.threads.list(await psA(A.credentialProvider,n)),get:async(n)=>t.threads.get(n),getStatus:async(n)=>t.threads.getStatus(n),stop:async(n)=>t.threads.stop(n),create:async(n)=>AEA(t,await t.threads.create(await t3A(A.credentialProvider,n))),update:async(n)=>t.threads.update(n),fork:async(n)=>t.threads.fork(n),setVisibility:async(n)=>t.threads.setVisibility(n),createShareLink:async(n)=>t.threads.createShareLink(n),listShareLinks:async(n)=>t.threads.listShareLinks(n),revokeShareLink:async(n)=>t.threads.revokeShareLink(n),stream:async(n)=>i.streamThread(n)},runs:{list:async(n={})=>t.runs.list(await A3A(A.credentialProvider,n)),listForThread:async(n)=>t.runs.listForThread(n),get:async(n)=>t.runs.get(n),cancel:async(n)=>t.runs.cancel(n),stream:async(n)=>i.streamRun(n)},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(n={})=>t.logSources.list(await AA(A.credentialProvider,n,fI.operationId)),get:async(n)=>t.logSources.get(n),create:async(n)=>t.logSources.create(await AA(A.credentialProvider,n,OI.operationId)),update:async(n)=>t.logSources.update(n),delete:async(n)=>t.logSources.delete(n)},logStreams:{list:async(n)=>t.logStreams.list(n),get:async(n)=>t.logStreams.get(n),create:async(n)=>t.logStreams.create(n),update:async(n)=>t.logStreams.update(n),delete:async(n)=>t.logStreams.delete(n),reassign:async(n)=>t.logStreams.reassign(n)},connectedAccounts:{beginConnect:async(n)=>t.connectedAccounts.beginConnect(await GA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.connectedAccounts.getConnectAttempt(await GA(A.credentialProvider,n)),list:async(n={})=>t.connectedAccounts.list(await GA(A.credentialProvider,n)),disconnect:async(n)=>t.connectedAccounts.disconnect(await GA(A.credentialProvider,n))},integrations:{listProviders:async(n={})=>t.integrations.listProviders(await GA(A.credentialProvider,n)),listConnections:async(n={})=>t.integrations.listConnections(await GA(A.credentialProvider,n)),getConnection:async(n)=>t.integrations.getConnection(await GA(A.credentialProvider,n)),createConnection:async(n)=>t.integrations.createConnection(await GA(A.credentialProvider,n)),beginConnect:async(n)=>t.integrations.beginConnect(await GA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.integrations.getConnectAttempt(await GA(A.credentialProvider,n)),disconnectConnection:async(n)=>t.integrations.disconnectConnection(await GA(A.credentialProvider,n)),updateConnectionCredentials:async(n)=>t.integrations.updateConnectionCredentials(await GA(A.credentialProvider,n))},mcpConnectors:{list:async(n={})=>t.mcpConnectors.list(await AA(A.credentialProvider,n,QB.operationId)),get:async(n)=>t.mcpConnectors.get(await AA(A.credentialProvider,n,IB.operationId)),details:async(n)=>t.mcpConnectors.details(await AA(A.credentialProvider,n,hB.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({}),search:async(n={})=>t.mcpConnectors.search(await AA(A.credentialProvider,n,BB.operationId)),describe:async(n)=>t.mcpConnectors.describe(await AA(A.credentialProvider,n,cB.operationId)),call:async(n)=>t.mcpConnectors.call(await AA(A.credentialProvider,n,CB.operationId)),create:async(n)=>t.mcpConnectors.create(await AA(A.credentialProvider,n,EB.operationId)),update:async(n)=>t.mcpConnectors.update(await AA(A.credentialProvider,n,aB.operationId)),disconnect:async(n)=>{await t.mcpConnectors.disconnect(await AA(A.credentialProvider,n,rB.operationId))},setReadOnly:async(n)=>t.mcpConnectors.setReadOnly(await AA(A.credentialProvider,n,yB.operationId)),beginOAuthInstall:async(n)=>t.mcpConnectors.beginOAuthInstall(await AA(A.credentialProvider,n,wB.operationId)),getOAuthInstallAttempt:async(n)=>t.mcpConnectors.getOAuthInstallAttempt(await AA(A.credentialProvider,n,DB.operationId))},sandboxPresets:{delete:async(n)=>t.sandboxPresets.deletePreset(await AA(A.credentialProvider,n,YB.operationId)),listConnections:async(n={})=>t.sandboxPresets.listConnections(await AA(A.credentialProvider,n,FB.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({}),test:async(n)=>t.sandboxPresets.testPreset(await AA(A.credentialProvider,n,kB.operationId)),upsert:async(n)=>t.sandboxPresets.upsertPreset(await AA(A.credentialProvider,n,MB.operationId))},memory:{list:async(n={})=>t.memory.list(await AA(A.credentialProvider,n,lB.operationId)),get:async(n)=>t.memory.get(await AA(A.credentialProvider,n,bB.operationId)),put:async(n)=>t.memory.put(await AA(A.credentialProvider,n,uB.operationId)),search:async(n)=>t.memory.search(await AA(A.credentialProvider,n,NB.operationId)),delete:async(n)=>t.memory.delete(await AA(A.credentialProvider,n,UB.operationId))},logMatchExpressions:{list:async(n={})=>t.logMatchExpressions.list(await AA(A.credentialProvider,n,"logMatchExpressions.list")),get:async(n)=>t.logMatchExpressions.get(await AA(A.credentialProvider,n,"logMatchExpressions.get")),create:async(n)=>t.logMatchExpressions.create(await AA(A.credentialProvider,n,"logMatchExpressions.create")),update:async(n)=>t.logMatchExpressions.update(await AA(A.credentialProvider,n,"logMatchExpressions.update")),disable:async(n)=>t.logMatchExpressions.disable(await AA(A.credentialProvider,n,"logMatchExpressions.disable"))},scripts:{list:async(n={})=>t.scripts.list(await AA(A.credentialProvider,n,"scripts.list")),get:async(n)=>t.scripts.get(await AA(A.credentialProvider,n,"scripts.get")),create:async(n)=>t.scripts.create(await AA(A.credentialProvider,n,"scripts.create")),update:async(n)=>t.scripts.update(await AA(A.credentialProvider,n,"scripts.update")),delete:async(n)=>t.scripts.delete(await AA(A.credentialProvider,n,"scripts.delete"))},issues:{count:async(n={})=>t.issues.count(await AA(A.credentialProvider,n,"issues.count")),create:async(n)=>t.issues.create(await AA(A.credentialProvider,n,kI.operationId)),list:async(n={})=>t.issues.list(await AA(A.credentialProvider,n,"issues.list")),search:async(n={})=>t.issues.search(await AA(A.credentialProvider,n,"issues.search")),get:async(n)=>t.issues.get(n),resolve:async(n)=>t.issues.resolve(n),ignore:async(n)=>t.issues.ignore(n),reopen:async(n)=>t.issues.reopen(n),mute:async(n)=>t.issues.mute(n),unmute:async(n)=>t.issues.unmute(n)},workItems:{create:async(n)=>t.workItems.create(n),comment:async(n)=>t.workItems.comment(n),transition:async(n)=>t.workItems.transition(n)},pullRequests:{list:async(n={})=>t.pullRequests.list(await AA(A.credentialProvider,n,"pullRequests.list"))},components:{list:async(n={})=>t.components.list(await AA(A.credentialProvider,n,"components.list")),get:async(n)=>t.components.get(n),register:async(n)=>t.components.register(await AA(A.credentialProvider,n,MI.operationId)),deregister:async(n)=>t.components.deregister({componentId:n.componentId,...n.reason!==void 0?{reason:n.reason}:{}}),rename:async(n)=>t.components.rename(n),assignTeam:async(n)=>t.components.assignTeam(n),retirementPreview:async(n)=>t.components.retirementPreview(n),retire:async(n)=>t.components.retire(n),restorationPreview:async(n)=>t.components.restorationPreview(n),restore:async(n)=>t.components.restore(n),mergePreview:async(n)=>t.components.mergePreview(await AA(A.credentialProvider,n,"components.mergePreview")),merge:async(n)=>t.components.merge(await AA(A.credentialProvider,n,"components.merge")),relationships:{list:async(n={})=>t.components.relationships.list(await AA(A.credentialProvider,n,"components.relationships.list")),preview:async(n)=>t.components.relationships.preview(await AA(A.credentialProvider,n,"components.relationships.preview")),add:async(n)=>t.components.relationships.add(await AA(A.credentialProvider,n,"components.relationships.add")),remove:async(n)=>t.components.relationships.remove(await AA(A.credentialProvider,n,"components.relationships.remove"))},incidents:{list:async(n={})=>t.components.incidents.list(await AA(A.credentialProvider,n,"components.incidents.list"))},timeline:async(n)=>t.components.timeline(n)},billing:{getSummary:async(n={})=>t.billing.getSummary(await GA(A.credentialProvider,n)),getUsage:async(n={})=>t.billing.getUsage(await GA(A.credentialProvider,n)),listTransactions:async(n={})=>t.billing.listTransactions(await GA(A.credentialProvider,n)),retryOutstandingBalance:async(n)=>t.billing.retryOutstandingBalance(await GA(A.credentialProvider,n)),getAutoTopUp:async(n={})=>t.billing.getAutoTopUp(await GA(A.credentialProvider,n)),updateAutoTopUp:async(n)=>t.billing.updateAutoTopUp(await GA(A.credentialProvider,n)),purchaseCredits:async(n)=>t.billing.purchaseCredits(await GA(A.credentialProvider,n)),listPlans:async(n={})=>t.billing.listPlans(await GA(A.credentialProvider,n)),previewPlanChange:async(n)=>t.billing.previewPlanChange(await GA(A.credentialProvider,n)),changePlan:async(n)=>t.billing.changePlan(await GA(A.credentialProvider,n)),createCheckoutSession:async(n)=>t.billing.createCheckoutSession(await GA(A.credentialProvider,n)),getCheckoutSessionStatus:async(n)=>t.billing.getCheckoutSessionStatus(await GA(A.credentialProvider,n)),createPortalSession:async(n={})=>t.billing.createPortalSession(await GA(A.credentialProvider,n)),getPaymentMethod:async(n={})=>t.billing.getPaymentMethod(await GA(A.credentialProvider,n))},tasks:{list:async(n={})=>t.tasks.list(await AA(A.credentialProvider,n,ea.operationId))},recommendations:{list:async(n={})=>t.recommendations.list(await AA(A.credentialProvider,n,oa.operationId))},notificationDeliveryRules:{list:async(n={})=>t.notificationDeliveryRules.list(await AA(A.credentialProvider,n,"notificationDeliveryRules.list")),options:async(n={})=>t.notificationDeliveryRules.options(await AA(A.credentialProvider,n,"notificationDeliveryRules.options")),create:async(n)=>t.notificationDeliveryRules.create(await AA(A.credentialProvider,n,"notificationDeliveryRules.create")),update:async(n)=>t.notificationDeliveryRules.update(await AA(A.credentialProvider,n,"notificationDeliveryRules.update")),delete:async(n)=>t.notificationDeliveryRules.delete(await AA(A.credentialProvider,n,"notificationDeliveryRules.delete"))},notificationChannels:{getProject:async(n={})=>t.notificationChannels.getProject(await AA(A.credentialProvider,n,"notificationChannels.getProject"))}}},uO=async(A={})=>{let t=await eEA(A.fetch)(iEA(A.apiBaseUrl??tEA,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:A.clientId??gEA,...A.scope?{scope:A.scope}:{}})}),g=await t.json();if(!t.ok)throw i3A(g,t.status);let i=g;return{deviceCode:TB(i.device_code,"device_code"),userCode:TB(i.user_code,"user_code"),verificationUri:TB(i.verification_uri,"verification_uri"),verificationUriComplete:TB(i.verification_uri_complete,"verification_uri_complete"),expiresIn:DO(i.expires_in,"expires_in"),interval:DO(i.interval,"interval")}},bO=async(A)=>{let t=await eEA(A.fetch)(iEA(A.apiBaseUrl??tEA,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:xsA,device_code:A.deviceCode,client_id:A.clientId??gEA})}),g=await t.json();if(t.ok){let n=g;return{status:"authorized",accessToken:TB(n.access_token,"access_token"),tokenType:TB(n.token_type,"token_type"),expiresIn:DO(n.expires_in,"expires_in"),scope:typeof n.scope==="string"?n.scope:""}}let i=oEA(g);if(!i)throw Error(`Device authorization failed with status ${t.status}`);if(i.error==="authorization_pending")return{status:"pending"};if(i.error==="slow_down")return{status:"pending",interval:10};if(i.error==="access_denied")return{status:"denied",message:i.errorDescription};if(i.error==="expired_token"||i.error==="invalid_grant")return{status:"expired",message:i.errorDescription};throw Error(i.errorDescription)},ssA=(A)=>{let t=A.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},iEA=(A,t)=>{return`${A.replace(/\/+$/,"")}/api/auth${t}`},qsA=async(A,t)=>{return GA(A,t)},GA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();return g?{...t,organizationId:g}:t},dsA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();if(!g)throw new _t("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:g}},AA=async(A,t,g)=>{let i=t.projectId??await A.getProjectId?.();if(!i)throw new _t("BAD_REQUEST",{message:"Project ID is required",data:{operationId:g,missingContext:["projectId"]},status:400});return{...t,projectId:i}},psA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},A3A=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},t3A=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},g3A=(A)=>{return{threadId:A.threadId,message:A.message,wait:A.wait??!0,timeoutSeconds:A.timeoutSeconds??20,...A.automationId!==void 0?{automationId:A.automationId}:{}}},n3A=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.code!=="string"||typeof t.message!=="string"||typeof t.operationId!=="string")return null;return{code:t.code,message:t.message,operationId:t.operationId,missingContext:Array.isArray(t.missingContext)?t.missingContext.filter((g)=>typeof g==="string"):[]}},oEA=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},i3A=(A,t)=>{let g=oEA(A);return Error(g?.errorDescription??`Device authorization failed with status ${t}`)},eEA=(A)=>{return A??globalThis.fetch},AEA=(A,t)=>({result:t,poll:()=>A.runs.get({runId:t.runId}),waitForCompletion:async(g={})=>o3A(A,t,g)}),o3A=async(A,t,g)=>{if(t.completed)return t;let i=g.intervalMs??2000,n=Date.now(),o=t;while(!o.completed){if(g.timeoutMs!==void 0&&Date.now()-n>=g.timeoutMs)return o;await e3A(i),o=await A.runs.get({runId:o.runId})}return o},e3A=async(A)=>{await new Promise((t)=>globalThis.setTimeout(t,A))},TB=(A,t)=>{if(typeof A==="string")return A;throw Error(`Expected '${t}' to be a string.`)},DO=(A,t)=>{if(typeof A==="number")return A;throw Error(`Expected '${t}' to be a number.`)};var lO=r(()=>{xQ();gv();RQ();WCA();yO();yO()});var Zt=(A)=>({success:!0,value:A}),Lt=(A,t,g)=>({success:!1,error:A,...t!==void 0&&{statusCode:t},...g!==void 0&&{errorPayload:g}}),b=(A,t,g)=>{if(!A.success){let i=`${t}: ${A.error}`;if(g)return u(A.errorPayload??i);return D(i)}return A.value};var CA=r(()=>{oA()});var Q3A="https://api.sazabi.com",G=async(A)=>{try{return Zt(await A())}catch(t){let g=I3A(t),i=h3A(t),n=t instanceof Error?t.message:String(t);return Lt(n,i,g)}},I3A=(A)=>{if(!A||typeof A!=="object")return;let t=A;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let g=t.data;if(typeof g.operationId!=="string")return;return{code:t.code,message:t.message,operationId:g.operationId,missingContext:Array.isArray(g.missingContext)?g.missingContext.filter((i)=>typeof i==="string"):[]}},h3A=(A)=>{if(!A||typeof A!=="object")return;let t=A;return typeof t.status==="number"?t.status:void 0},Ao=(A)=>{let t=nEA({apiBaseUrl:A.baseUrl??Q3A,clientSource:"cli",sandboxActorDescriptor:A.sandboxActorDescriptor,credentialProvider:{getToken:()=>A.token,getOrganizationId:()=>A.organizationId,getProjectId:()=>A.projectId},intakeBaseUrl:A.intakeBaseUrl,tailBaseUrl:A.tailBaseUrl});return{me:()=>G(()=>t.me()),automations:{list:(g={})=>G(()=>t.automations.list(g)),get:(g)=>G(()=>t.automations.get({automationId:g})),create:(g)=>G(()=>t.automations.create(g)),update:(g)=>G(()=>t.automations.update(g)),enable:(g)=>G(()=>t.automations.enable({automationId:g})),disable:(g)=>G(()=>t.automations.disable({automationId:g})),runs:{list:(g,i={})=>G(()=>t.automations.runs.list({automationId:g,...i})),get:(g,i)=>G(()=>t.automations.runs.get({automationId:g,runId:i})),logs:(g,i)=>G(()=>t.automations.runs.logs({automationId:g,runId:i}))}},logs:{tail:(g)=>G(()=>t.logs.tail(g)),forward:(g)=>G(()=>t.logs.forward(g)),query:(g={})=>G(()=>t.logs.query(g)),schema:(g={})=>G(()=>t.logs.schema(g)),volume:(g)=>G(()=>t.logs.volume(g)),patterns:(g={})=>G(()=>t.logs.patterns(g)),nativeQuery:(g)=>G(()=>t.logs.nativeQuery(g))},organizations:{list:()=>G(()=>t.organizations.list()),get:(g)=>G(()=>t.organizations.get({organizationId:g})),rename:(g,i)=>G(()=>t.organizations.update({organizationId:i,name:g}))},members:{list:(g={})=>G(()=>t.members.list(g)),updateRole:(g,i,n)=>G(()=>t.members.updateRole({organizationId:n,member:g,role:i})),remove:(g,i)=>G(()=>t.members.remove({organizationId:i,member:g})),invite:(g)=>G(()=>t.members.invite({organizationId:g.organizationId,email:g.email,role:g.role})),listInvitations:(g)=>G(()=>t.members.listInvitations({organizationId:g})),revokeInvitation:(g)=>G(()=>t.members.revokeInvitation({organizationId:g.organizationId,invitationId:g.invitationId}))},teams:{list:(g={})=>G(()=>t.teams.list(g)),create:(g,i,n)=>G(()=>t.teams.create({organizationId:n,name:g,...i!==void 0?{description:i}:{}})),update:(g,i,n)=>G(()=>t.teams.update({organizationId:n,teamId:g,...i.name!==void 0?{name:i.name}:{},...i.description!==void 0?{description:i.description}:{}})),delete:(g,i)=>G(()=>t.teams.delete({organizationId:i,teamId:g})),addMember:(g,i,n)=>G(()=>t.teams.addMember({organizationId:n,teamId:g,userId:i})),removeMember:(g,i,n)=>G(()=>t.teams.removeMember({organizationId:n,teamId:g,userId:i})),listMembers:(g,i)=>G(()=>t.teams.listMembers({organizationId:i,teamId:g}))},projects:{list:(g={})=>G(()=>t.projects.list(g)),get:(g)=>G(()=>t.projects.get({projectId:g})),create:(g)=>G(()=>t.projects.create(g))},threads:{list:(g={})=>G(()=>t.threads.list(g)),get:(g)=>G(()=>t.threads.get({threadId:g})),create:(g)=>G(()=>t.threads.create(g)),getStatus:(g)=>G(()=>t.threads.getStatus({threadId:g})),update:(g,i)=>G(()=>t.threads.update({threadId:g,status:i})),fork:(g,i)=>G(()=>t.threads.fork({threadId:g,messageId:i})),setVisibility:(g,i)=>G(()=>t.threads.setVisibility({threadId:g,visibility:i})),createShareLink:(g)=>G(()=>t.threads.createShareLink({threadId:g})),listShareLinks:(g)=>G(()=>t.threads.listShareLinks({threadId:g})),revokeShareLink:(g,i)=>G(()=>t.threads.revokeShareLink({threadId:g,shareId:i})),stop:(g)=>G(()=>t.threads.stop({threadId:g})),stream:(g)=>G(()=>t.threads.stream(g))},messages:{list:(g,i={})=>G(()=>t.messages.list({threadId:g,...i})),append:(g,i,n,o,e,I)=>G(()=>t.messages.append({threadId:g,message:i,wait:n,timeoutSeconds:o,...e!==void 0?{automationId:e}:{},...I?{ambientServiceRun:I}:{}}))},runs:{get:(g)=>G(()=>t.runs.get({runId:g})),cancel:(g)=>G(()=>t.runs.cancel({runId:g})),stream:(g)=>G(()=>t.runs.stream(g))},search:{threads:(g)=>G(()=>t.search.threads(g)),messages:(g)=>G(()=>t.search.messages(g))},publicKeys:{list:(g)=>G(()=>t.publicKeys.list(g)),get:(g,i)=>G(()=>t.publicKeys.get(i?{keyId:g,projectId:i}:{keyId:g})),ensureLogForwarding:(g)=>G(()=>t.publicKeys.ensureLogForwarding(g)),update:(g)=>G(()=>t.publicKeys.update(g)),deactivate:(g)=>G(()=>t.publicKeys.deactivate(g))},secretKeys:{list:(g)=>G(()=>t.secretKeys.list(g)),get:(g)=>G(()=>t.secretKeys.get({keyId:g})),create:(g)=>G(()=>t.secretKeys.create(g)),update:(g)=>G(()=>t.secretKeys.update(g)),delete:(g)=>G(()=>t.secretKeys.delete(g))},issues:{count:(g={})=>G(()=>t.issues.count(g)),create:(g)=>G(()=>t.issues.create(g)),list:(g={})=>G(()=>t.issues.list(g)),search:(g={})=>G(()=>t.issues.search(g)),get:(g)=>G(()=>t.issues.get({issueId:g})),resolve:(g)=>G(()=>t.issues.resolve({issueId:g})),ignore:(g)=>G(()=>t.issues.ignore({issueId:g})),reopen:(g)=>G(()=>t.issues.reopen({issueId:g})),mute:(g)=>G(()=>t.issues.mute({issueId:g})),unmute:(g)=>G(()=>t.issues.unmute({issueId:g}))},pullRequests:{list:(g={})=>G(()=>t.pullRequests.list(g))},workItems:{create:(g)=>G(()=>t.workItems.create(g)),comment:(g)=>G(()=>t.workItems.comment(g)),transition:(g)=>G(()=>t.workItems.transition(g))},components:{list:(g={})=>G(()=>t.components.list(g)),get:(g)=>G(()=>t.components.get({componentId:g})),register:(g)=>G(()=>t.components.register(g)),deregister:(g,i)=>G(()=>t.components.deregister({componentId:g,...i!==void 0?{reason:i}:{}})),rename:(g)=>G(()=>t.components.rename(g)),retirementPreview:(g)=>G(()=>t.components.retirementPreview(g)),retire:(g)=>G(()=>t.components.retire(g)),restorationPreview:(g)=>G(()=>t.components.restorationPreview(g)),restore:(g)=>G(()=>t.components.restore(g)),mergePreview:(g)=>G(()=>t.components.mergePreview(g)),merge:(g)=>G(()=>t.components.merge(g)),relationships:{list:(g={})=>G(()=>t.components.relationships.list(g)),preview:(g)=>G(()=>t.components.relationships.preview(g)),add:(g)=>G(()=>t.components.relationships.add(g)),remove:(g)=>G(()=>t.components.relationships.remove(g))},incidents:{list:(g={})=>G(()=>t.components.incidents.list(g))},timeline:(g)=>G(()=>t.components.timeline(g))},billing:{getSummary:(g={})=>G(()=>t.billing.getSummary(g)),getUsage:(g={})=>G(()=>t.billing.getUsage(g)),listTransactions:(g={})=>G(()=>t.billing.listTransactions(g)),retryOutstandingBalance:(g)=>G(()=>t.billing.retryOutstandingBalance(g)),getAutoTopUp:(g={})=>G(()=>t.billing.getAutoTopUp(g)),updateAutoTopUp:(g)=>G(()=>t.billing.updateAutoTopUp(g)),purchaseCredits:(g)=>G(()=>t.billing.purchaseCredits(g)),listPlans:(g={})=>G(()=>t.billing.listPlans(g)),previewPlanChange:(g)=>G(()=>t.billing.previewPlanChange(g)),changePlan:(g)=>G(()=>t.billing.changePlan(g)),createCheckoutSession:(g)=>G(()=>t.billing.createCheckoutSession(g)),getCheckoutSessionStatus:(g)=>G(()=>t.billing.getCheckoutSessionStatus(g)),createPortalSession:(g={})=>G(()=>t.billing.createPortalSession(g)),getPaymentMethod:(g={})=>G(()=>t.billing.getPaymentMethod(g))},tasks:{list:(g={})=>G(()=>t.tasks.list(g))},recommendations:{list:(g={})=>G(()=>t.recommendations.list(g))},notificationDeliveryRules:{list:()=>G(()=>t.notificationDeliveryRules.list()),options:()=>G(()=>t.notificationDeliveryRules.options()),create:(g)=>G(()=>t.notificationDeliveryRules.create(g)),update:(g)=>G(()=>t.notificationDeliveryRules.update(g)),delete:(g)=>G(()=>t.notificationDeliveryRules.delete({ruleId:g}))},notificationChannels:{getProject:()=>G(()=>t.notificationChannels.getProject())},logSources:{listProviders:()=>G(()=>t.logSources.listProviders()),list:(g)=>G(()=>t.logSources.list(g)),get:(g)=>G(()=>t.logSources.get({logSourceId:g})),create:(g)=>G(()=>t.logSources.create(g)),update:(g)=>G(()=>t.logSources.update(g)),delete:(g)=>G(()=>t.logSources.delete({logSourceId:g}))},logStreams:{list:(g)=>G(()=>t.logStreams.list({logSourceId:g})),get:(g)=>G(()=>t.logStreams.get({streamId:g})),create:(g)=>G(()=>t.logStreams.create(g)),update:(g)=>G(()=>t.logStreams.update(g)),delete:(g)=>G(()=>t.logStreams.delete({streamId:g})),reassign:(g)=>G(()=>t.logStreams.reassign(g))},integrations:{listProviders:()=>G(()=>t.integrations.listProviders()),listConnections:(g)=>G(()=>t.integrations.listConnections(g)),getConnection:(g)=>G(()=>t.integrations.getConnection({connectionId:g})),createConnection:(g)=>G(()=>t.integrations.createConnection(g)),beginConnect:(g)=>G(()=>t.integrations.beginConnect(g)),getConnectAttempt:(g)=>G(()=>t.integrations.getConnectAttempt({attemptId:g})),disconnectConnection:(g)=>G(()=>t.integrations.disconnectConnection({connectionId:g})),updateConnectionCredentials:(g)=>G(()=>t.integrations.updateConnectionCredentials(g))},connectedAccounts:{beginConnect:(g)=>G(()=>t.connectedAccounts.beginConnect(g)),getConnectAttempt:(g)=>G(()=>t.connectedAccounts.getConnectAttempt({attemptId:g})),list:()=>G(()=>t.connectedAccounts.list({})),disconnect:(g)=>G(()=>t.connectedAccounts.disconnect(g))},mcpConnectors:{list:(g)=>G(()=>t.mcpConnectors.list(g)),get:(g)=>G(()=>t.mcpConnectors.get(g)),details:(g)=>G(()=>t.mcpConnectors.details(g)),listProviders:()=>G(()=>t.mcpConnectors.listProviders()),beginOAuthInstall:(g)=>G(()=>t.mcpConnectors.beginOAuthInstall(g)),getOAuthInstallAttempt:(g)=>G(()=>t.mcpConnectors.getOAuthInstallAttempt(g)),disconnect:(g)=>G(()=>t.mcpConnectors.disconnect(g)),update:(g)=>G(()=>t.mcpConnectors.update(g))},sandboxPresets:{delete:(g)=>G(()=>t.sandboxPresets.delete(g)),listConnections:(g)=>G(()=>t.sandboxPresets.listConnections(g)),listTypes:()=>G(()=>t.sandboxPresets.listTypes()),test:(g)=>G(()=>t.sandboxPresets.test(g)),upsert:(g)=>G(()=>t.sandboxPresets.upsert(g))},memory:{list:(g={})=>G(()=>t.memory.list(g)),get:(g)=>G(()=>t.memory.get(g)),search:(g)=>G(()=>t.memory.search(g)),put:(g)=>G(()=>t.memory.put({kind:"note",...g})),delete:(g)=>G(()=>t.memory.delete(g))},logMatchExpressions:{list:(g={})=>G(()=>t.logMatchExpressions.list(g)),get:(g)=>G(()=>t.logMatchExpressions.get({expressionId:g})),create:(g)=>G(()=>t.logMatchExpressions.create(g)),update:(g,i={})=>G(()=>t.logMatchExpressions.update({expressionId:g,...i})),disable:(g)=>G(()=>t.logMatchExpressions.disable({expressionId:g}))},scripts:{list:(g={})=>G(()=>t.scripts.list(g)),get:(g)=>G(()=>t.scripts.get({name:g})),create:(g)=>G(()=>t.scripts.create(g)),update:(g,i={})=>G(()=>t.scripts.update({name:g,...i})),delete:(g)=>G(()=>t.scripts.delete({name:g}))}}};var Qa=r(()=>{lO();CA()});var QEA;var IEA=r(()=>{QEA={version:2,activeProfile:"default",profiles:{default:{}}}});import*as to from"node:fs";import*as hEA from"node:os";import*as SO from"node:path";var rg=(A)=>{if(A===void 0||A===null)return;if(typeof A==="string")return A.length>0?A:void 0;return},NO,JB,B3A=()=>{if(!to.existsSync(NO))to.mkdirSync(NO,{recursive:!0,mode:448})},UO,BEA=(A)=>{UO=A},cEA=(A)=>({token:rg(A.token),activeOrganizationId:rg(A.activeOrganizationId??A.organizationId),organizationName:rg(A.organizationName),activeProjectId:rg(A.activeProjectId??A.defaultProjectId),apiBaseUrl:rg(A.apiBaseUrl),authBaseUrl:rg(A.authBaseUrl),webBaseUrl:rg(A.webBaseUrl),intakeBaseUrl:rg(A.intakeBaseUrl),tailBaseUrl:rg(A.tailBaseUrl),apiDomain:rg(A.apiDomain),webDomain:rg(A.webDomain),intakeDomain:rg(A.intakeDomain),tailDomain:rg(A.tailDomain),forwardPublicKey:rg(A.forwardPublicKey),forwardPublicKeyProjectId:rg(A.forwardPublicKeyProjectId)}),c3A=(A)=>({version:2,activeProfile:"default",profiles:{default:cEA(A)}}),C3A=(A)=>{let t=rg(A.activeProfile)??"default",g=typeof A.profiles==="object"&&A.profiles!==null?A.profiles:{},i={};for(let[n,o]of Object.entries(g)){if(typeof o!=="object"||o===null)continue;i[n]=cEA(o)}if(!i[t])i[t]={};return{version:2,activeProfile:t,profiles:i}},yt=()=>{try{if(!to.existsSync(JB))return Zt(QEA);let A=to.readFileSync(JB,"utf-8"),t=JSON.parse(A),g=typeof t.version==="number"?t.version:void 0;if(g!==void 0&&g>2)return Lt("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(g===2)return Zt(C3A(t));let i=c3A(t),n=Xt(i);if(!n.success)return n;return Zt(i)}catch(A){let t=A instanceof Error?A.message:String(A);return Lt(t)}},Xt=(A)=>{try{return B3A(),to.writeFileSync(JB,JSON.stringify(A,null,2),{encoding:"utf-8",mode:384}),Zt(void 0)}catch(t){let g=t instanceof Error?t.message:String(t);return Lt(g)}},Mi=(A,t)=>{if(t)return t;if(UO)return UO;let g=process.env.SAZABI_PROFILE?.trim();if(g)return g;return A.activeProfile??"default"},Qn=(A,t)=>{let g=Mi(A,t),i=A.profiles[g];if(i)return Zt(i);if(g==="default")return Zt({});return Lt(`Profile '${g}' does not exist. Run 'sazabi profiles create ${g}' first.`)},go=()=>{let A=yt();if(!A.success)return A;return Qn(A.value)},In=(A,t,g)=>{let i=Mi(A,g);if(!A.profiles[i])return Lt(`Profile '${i}' does not exist. Run 'sazabi profiles create ${i}' first.`);return Zt({...A,profiles:{...A.profiles,[i]:{...A.profiles[i],...t}}})},no=(A)=>{if(!A?.forwardPublicKey&&!A?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var Gn=r(()=>{IEA();CA();NO=SO.join(hEA.homedir(),".sazabi"),JB=SO.join(NO,"settings.json")});var Yi=(A)=>{let{cliFlag:t,globalUrl:g,globalDomain:i,buildUrlFromDomain:n,defaultUrl:o}=A;if(t)return t;let e=process.env.SAZABI_API_URL?.trim();if(e)return e;if(g)return g;if(i)return n(i);return o},f=(A)=>{let{tokenFlag:t,organizationIdFlag:g,projectIdFlag:i,jsonMode:n}=A,o=t?.trim(),e=process.env.SAZABI_TOKEN?.trim(),I=process.env.SAZABI_ORGANIZATION_ID?.trim(),h=process.env.SAZABI_PROJECT_ID?.trim(),B=b(go(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",n),c=B.token?.trim(),C=(o&&o.length>0?o:void 0)||(e&&e.length>0?e:void 0)||c,E=o&&o.length>0?"flag":e&&e.length>0?"environment":"settings";if(!C||C.length===0){if(n)return u("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return D("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let a,y;if(g)a=g,y="flag";else if(I&&I.length>0)a=I,y="environment";else if(B.activeOrganizationId)a=B.activeOrganizationId,y="settings";let w,l;if(i)w=i,l="flag";else if(h&&h.length>0)w=h,l="environment";else if(B.activeProjectId)w=B.activeProjectId,l="settings";return{token:C,type:"token",projectId:w,organizationId:a,tokenSource:E,organizationSource:y,projectSource:l}},FO=(A)=>{let t=b(go(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A?.jsonMode);return Yi({cliFlag:A?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(g)=>`https://api.${g}`,defaultUrl:"https://api.sazabi.com"})},O=(A)=>{let t=FO({apiBaseUrlFlag:A.apiBaseUrlFlag,jsonMode:A.jsonMode});return Ao({token:A.token,baseUrl:t,organizationId:A.organizationId,projectId:A.projectId,sandboxActorDescriptor:process.env.SAZABI_SANDBOX_ACTOR})},CEA,LO,Vb=async(A)=>{let t=b(go(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.jsonMode),g=Yi({cliFlag:A.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(h)=>`https://api.${h}`,defaultUrl:"https://api.sazabi.com"}),i=`${A.token}@${g}@${A.projectId??""}`,n=CEA.get(i);if(n)return n;let o=LO.get(i);if(o)return o;if(!A.projectId){if(A.jsonMode)return u("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return D("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let e=A.projectId,I=(async()=>{let B=await Ao({token:A.token,baseUrl:g,projectId:e}).projects.get(e),C=b(B,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",A.jsonMode).project;return CEA.set(i,C),C})();LO.set(i,I);try{return await I}finally{LO.delete(i)}},Zb=(A)=>{let t=A.trim().toLowerCase(),g=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,i=t;try{i=new URL(g).hostname.toLowerCase()}catch{i=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${i.replace(/^(?:app\.)+/,"")}`},PB=(A)=>{let t=(i)=>i.replace(/\/+$/,"");if(A)return t(A);let g=b(go(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(g.webBaseUrl)return t(g.webBaseUrl);if(g.webDomain)return Zb(g.webDomain);if(g.apiDomain)return Zb(g.apiDomain);return"https://app.sazabi.com"},Hg=(A,t)=>{if(A&&A.length>0)return A;let g="No project selected. Pass --project-id, set SAZABI_PROJECT_ID, or run 'sazabi projects use <project-id>'.";if(t)return u(g);return D(g)},ce=(A,t)=>{return`${PB(t)}/projects/${A}`},jt=(A,t,g,i)=>{let n=`${PB(g)}/projects/${A}/threads/${t}`;return i?`${n}?messageId=${encodeURIComponent(i)}`:n},EEA=(A,t,g,i)=>{return jt(A,t,g,i)},aEA=(A,t,g)=>{return`${ce(A,g)}/issues/${t}`},rEA=(A,t,g)=>{return`${ce(A,g)}/automations/${t}`},yEA=(A,t)=>{return`${ce(A,t)}/status`},wEA=(A,t,g)=>{return`${ce(A,g)}/settings/log-source-providers/${t}`},DEA=(A,t,g)=>{return`${ce(A,g)}/settings/mcp-connectors/${t}`},Hb=(A,t,g)=>{return`${ce(A,g)}/settings/sandbox/catalog/${t}`},uEA=(A,t)=>{return`https://otlp.${t}.intake.${A}`};var bA=r(()=>{oA();Qa();CA();Gn();CEA=new Map,LO=new Map});var al,$yA=(A)=>{al.set(A.name,A)},rl=(A)=>{return al.get(A)},Sa=()=>{return Array.from(al.values())},GyA=(A)=>{return al.has(A)};var iz=r(()=>{al=new Map});async function Iz(A){let t=await A.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((g)=>({value:g.id,description:g.name}))}async function hz(A){let t=await A.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((g)=>({value:g.id,description:g.name}))}async function Fa(A){let t=await A.logSources.list();if(!t.success)return[];return t.value.logSources.map((g)=>({value:g.id,description:g.name??g.provider}))}async function PyA(A){let t=await A.members.list();if(!t.success)return[];return t.value.members.map((g)=>({value:g.userId,description:g.name??g.email}))}var Nnt=3000,Unt,RyA=async(A,t,g)=>{try{let i=Unt[A]?.[t];if(!i)return[];let n=go();if(!n.success)return[];let o=n.value,e=process.env.SAZABI_TOKEN?.trim()||o.token?.trim();if(!e)return[];let I=Yi({globalUrl:o.apiBaseUrl,globalDomain:o.apiDomain,buildUrlFromDomain:(c)=>`https://api.${c}`,defaultUrl:"https://api.sazabi.com"}),h=Ao({token:e,baseUrl:I,organizationId:o.activeOrganizationId,projectId:o.activeProjectId});return(await Promise.race([i(h),new Promise((c)=>setTimeout(()=>c([]),Nnt))])).filter((c)=>c.value.startsWith(g))}catch{return[]}};var fyA=r(()=>{Qa();bA();Gn();Unt={threads:{get:async(A)=>{let t=await A.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((g)=>({value:g.id,description:g.title??void 0}))}},projects:{use:async(A)=>{let t=await A.projects.list();if(!t.success)return[];return t.value.projects.map((g)=>({value:g.id,description:g.name}))}},organizations:{use:async(A)=>{let t=await A.organizations.list();if(!t.success)return[];return t.value.organizations.map((g)=>({value:g.id,description:g.name}))},rename:async(A)=>{let t=await A.organizations.list();if(!t.success)return[];return t.value.organizations.map((g)=>({value:g.id,description:g.name}))}},"public-keys":{get:Iz,update:Iz,deactivate:Iz},"secret-keys":{get:hz,update:hz,delete:hz},"log-sources":{get:Fa,enable:Fa,disable:Fa,delete:Fa,remove:Fa},members:{"update-role":PyA,remove:PyA}}});var zyA={};dn(zyA,{parseCompletionContext:()=>Fnt,getCompletions:()=>Mnt});var Snt,Lnt,Fnt=(A)=>{let t=A.length>0?A:[""],g=t.length-1,i=t[g]??"";return{words:t,currentIndex:g,partial:i}},Mnt=async(A)=>{let{words:t,currentIndex:g,partial:i}=A,n=t[g-1];if(n==="--profile")return Gnt(i);let o=$nt(t),e=Math.max(0,o.length-(t.length-g));if(e===0)return Ynt(i);let I=o[0]??"",h=rl(I);if(!h)return[];if(e===1&&h.subcommands){if(i.startsWith("-"))return OyA(h.options,o);return knt(h,i)}let B=h.subcommands?o[1]:void 0,C=(B?h.subcommands?.[B]:void 0)?.options??h.options;if(i.startsWith("-"))return OyA(C,o);if(n?.startsWith("--")){let E=n.slice(2);if(C?.[E]?.type==="string"){let y=`${I}:${B??""}`,w=Lnt[y]?.[E]??Snt[E];if(w)return w.filter((l)=>l.startsWith(i)).map((l)=>({value:l}));return[]}}return RyA(I,B??"",i)},Ynt=(A)=>{let g=Sa().filter((n)=>n.name.startsWith(A)).map((n)=>({value:n.name,description:n.description})),i=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let n of i)if(n.value.startsWith(A))g.push(n);return g},knt=(A,t)=>{if(!A.subcommands)return[];return Object.values(A.subcommands).filter((g)=>g.name.startsWith(t)).map((g)=>({value:g.name,description:g.description}))},OyA=(A,t)=>{let g=t[t.length-1]??"",i=new Set(t.filter((o)=>o.startsWith("--")).map((o)=>o.replace(/=.*/,""))),n=[];if(!i.has("--help")&&"--help".startsWith(g))n.push({value:"--help",description:"Show help"});if(!i.has("--profile")&&"--profile".startsWith(g))n.push({value:"--profile",description:"Use a named profile"});if(!A)return n;for(let[o,e]of Object.entries(A)){let I=`--${o}`;if(i.has(I))continue;if(!I.startsWith(g))continue;n.push({value:I,description:e.description})}return n},$nt=(A)=>{let t=[];for(let g=0;g<A.length;g++){let i=A[g];if(i==="--profile"&&g+1<A.length)g++;else if(i.startsWith("--profile="));else t.push(i)}return t},Gnt=(A)=>{try{let t=yt();if(!t.success)return[];return Object.keys(t.value.profiles).filter((g)=>g.startsWith(A)).map((g)=>({value:g,description:g===t.value.activeProfile?"active":void 0}))}catch{return[]}};var vyA=r(()=>{iz();Gn();fyA();Snt={status:["regular","archived"],format:["json","text"]},Lnt={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});oA();oA();oA();import{parseArgs as EwA}from"node:util";var L=(A,t,g={})=>{let i=EwA({args:A,options:t,allowPositionals:Boolean(g.allowPositionals),strict:!1,tokens:!0}),n=Object.hasOwn(t,"json")&&i.values.json===!0,o=new Set(Object.keys(t)),e=new Set(Object.entries(t).map(([,h])=>h.short).filter((h)=>Boolean(h))),I=[];if(Array.isArray(i.tokens))for(let h of i.tokens){if(h.kind!=="option")continue;let B=h.name,c=B.length>1;if(!(o.has(B)||!c&&e.has(B))){let E=c?`--${B}`:`-${B}`;if(!I.includes(E))I.push(E)}}for(let h of Object.keys(i.values))if(!o.has(h)){let B=h.length>1?`--${h}`:`-${h}`;if(!I.includes(B))I.push(B)}if(I.length>0){let h=`Unknown option${I.length>1?"s":""}: ${I.join(", ")}. Run the command with -h for usage.`;if(n)u(h);D(h)}for(let[h,B]of Object.entries(t))if(B.type==="string"&&i.values[h]===!0){let c=h.length===1?`-${h}`:`--${h}`,C=`Option ${c} requires a value. Use '${c} <value>'.`;if(n)u(C);D(C)}for(let[h,B]of Object.entries(t)){let c=i.values[h];if(B.type==="string"&&typeof c==="string"){if(c.startsWith("--")||c.length===2&&c[0]==="-"&&/[a-zA-Z]/.test(c.charAt(1))){let a=`Option ${h.length===1?`-${h}`:`--${h}`} received "${c}" as its value. Did you forget to provide a value?`;if(n)u(a);D(a)}}}return{values:i.values,positionals:i.positionals}};var Ja=(A,t)=>{if(A?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class Uz{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(A,t,g){this.name=A,this.description=t,this.handler=g}withOptions(A){return this.options=A,this}withSubcommands(A){return this.subcommands=A,this}withExamples(A){return this.examples=A,this}withPositionalArgs(A){return this.positionalArgs=A,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)Ja(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[A,t]of Object.entries(this.subcommands))if(!t.subcommands)Ja(t.options,`Subcommand "${this.name} ${A}"`)}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}class Sz{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(A,t){this.name=A,this.description=t}withHandler(A){return this.handler=A,this}withSubcommands(A){return this.subcommands=A,this}withOptions(A){return this.options=A,this}withExamples(A){return this.examples=A,this}withPositionalArgs(A){return this.positionalArgs=A,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Command "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson){if(this.handler)Ja(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[A,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;Ja(t.options,`Subcommand "${this.name} ${A}"`)}}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}var nA=(A,t)=>{return new Sz(A,t)},U=(A,t,g)=>{return new Uz(A,t,g)};oA();var Qg=(A,t,g,i,n)=>{let o=Number.parseInt(A,10);if(Number.isNaN(o)||o<t||o>g){let e=`${i} must be between ${t} and ${g}.`;if(n)return u(e);return D(e)}return o},Kg=(A,t,g,i)=>{if(!t.includes(A)){let n=t.map((e)=>`"${e}"`).join(" or "),o=`${g} must be ${n}.`;if(i)return u(o);return D(o)}return A};oA();bA();CA();var YO=(A)=>{let t=[];for(let g of A){let i=0;for(let n of g.content){if(n.type!=="artifact")continue;t.push({id:`${g.id}:${i}`,messageId:g.id,name:n.name,toolCallId:n.toolCallId??null,createdAt:g.createdAt,data:n.data}),i+=1}}return t},lEA=(A)=>{let t=A.lastIndexOf(":");if(t<=0||t===A.length-1)return null;let g=A.slice(0,t),i=A.slice(t+1);if(!/^\d+$/.test(i))return null;return{messageId:g,index:Number.parseInt(i,10)}},NEA=(A,t)=>{return YO(A).find((g)=>g.id===t)},MO=(A)=>typeof A==="object"&&A!==null&&!Array.isArray(A),bEA=(A)=>{let t=A===null||A===void 0?"":typeof A==="object"?JSON.stringify(A):String(A);if(/[",\n\r]/.test(t))return`"${t.replace(/"/g,'""')}"`;return t},E3A=(A)=>{if(Array.isArray(A)&&A.every(MO))return A;if(MO(A))for(let t of["rows","data","items","points"]){let g=A[t];if(Array.isArray(g)&&g.every(MO))return g}return null},UEA=(A)=>{let t=E3A(A);if(!t||t.length===0)return null;let g=[];for(let n of t)for(let o of Object.keys(n))if(!g.includes(o))g.push(o);if(g.length===0)return null;let i=[g.map(bEA).join(",")];for(let n of t)i.push(g.map((o)=>bEA(n[o])).join(","));return i.join(`
8710
- `)};var a3A=100,SEA=100,r3A=async(A,t,g)=>{let i=[],n;for(let o=0;o<SEA;o++){let e=await A.messages.list(t,{limit:a3A,...n?{cursor:n}:{}}),I=b(e,"Couldn't get artifact (check the thread ID and try again)",g);if(i.push(...I.messages),!I.nextCursor)break;n=I.nextCursor}if(n&&!g)console.error(`Warning: reached the ${SEA}-page limit; the artifact may exist beyond the scanned messages.`);return i},y3A=(A,t,g)=>{if(t)return t;let i=`--thread-id is required to locate artifact '${A}'. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>`;if(g)u(i);else D(i);return},w3A=(A,t)=>{if(t.json){V({id:A.id,messageId:A.messageId,name:A.name,toolCallId:A.toolCallId,createdAt:A.createdAt,data:A.data});return}if(t.format==="csv"){let g=UEA(A.data);if(g===null){D(`Artifact '${A.id}' (${A.name}) has no embedded rows to render as CSV. Built-in table/timeseries artifacts persist query parameters rather than result rows, so only artifacts that embed their data (such as custom artifacts) can be exported as CSV. Use --json or the default output to inspect this artifact.`);return}console.log(g);return}console.log(JSON.stringify(A.data,null,2))},LEA=async(A,t)=>{if(!lEA(A)){let h=`Invalid artifact ID: '${A}'. Expected format '<message-id>:<index>' (from 'sazabi artifacts list').`;if(t.json)return u(h);return D(h)}let i=y3A(A,t.threadId,t.json);if(!i)return;let n=f({tokenFlag:t.token,jsonMode:t.json}),o=O({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),e=await r3A(o,i,t.json),I=NEA(e,A);if(!I){let h=`Artifact '${A}' not found in thread '${i}'. Run 'sazabi artifacts list --thread-id ${i}' to see available artifacts.`;if(t.json)return u(h);return D(h)}w3A(I,t)};oA();bA();CA();var D3A={id:{label:"ID",type:{kind:"string"}},name:{label:"Type",type:{kind:"string"}},toolCallId:{label:"Tool call",type:{kind:"nullable-string",emptyLabel:"(none)"}},createdAt:{label:"Created",type:{kind:"date"}}},u3A={schema:D3A,columns:["id","name","toolCallId","createdAt"],header:"Artifacts",emptyMessage:"No artifacts found in this thread."},b3A=100,FEA=100,l3A=async(A,t,g)=>{let i=[],n;for(let o=0;o<FEA;o++){let e=await A.messages.list(t,{limit:b3A,...n?{cursor:n}:{}}),I=b(e,"Couldn't list artifacts (check the thread ID and try again)",g);if(i.push(...I.messages),!I.nextCursor)break;n=I.nextCursor}if(n&&!g)console.error(`Warning: reached the ${FEA}-page limit; artifact list may be incomplete for this thread.`);return i},MEA=async(A)=>{let t=f({tokenFlag:A.token,jsonMode:A.json}),g=O({token:t.token,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl}),i=await l3A(g,A.threadId,A.json),o=YO(i).map((e)=>({id:e.id,name:e.name,toolCallId:e.toolCallId,createdAt:e.createdAt}));x(u3A,o,{json:A.json})};var YEA=nA("artifacts","Retrieve artifacts produced in a thread").withSubcommands({list:U("list","List artifacts produced in a thread",async(A)=>{let{values:t}=L(A,{token:{type:"string"},"thread-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),g=t["thread-id"];if(!g){if(t.json)return u("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>");return D("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>")}await MEA({threadId:g,token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread to list artifacts for (required)"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts list --thread-id <thread-id> --json # Output as JSON"]).build(),get:U("get","Get a single artifact's data",async(A)=>{let{values:t,positionals:g}=L(A,{token:{type:"string"},"thread-id":{type:"string"},format:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return u("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>");return D("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>")}if(g.length>1){let o=g.slice(1).join(", ");if(t.json)return u(`Unexpected arguments: ${o}.`);return D(`Unexpected arguments: ${o}.`)}let n;if(t.format)n=Kg(t.format,["json","csv"],"Format",t.json);await LEA(i,{token:t.token,threadId:t["thread-id"],format:n,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<artifact-id>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread the artifact belongs to (required)"},format:{type:"string",description:"Output format for non-JSON mode: json (default) or csv"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts get <artifact-id> --thread-id <thread-id> # Print artifact data","sazabi artifacts get <artifact-id> --thread-id <thread-id> --format csv # Render table/timeseries as CSV","sazabi artifacts get <artifact-id> --thread-id <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts get <artifact-id> --thread-id <thread-id> # Get one artifact's data"]).build();oA();lO();import{spawn as N3A}from"node:child_process";var z={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},R={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};bA();CA();Gn();var kEA="sazabi:organization:",$EA="sazabi:project:",GEA=(A)=>{let t=null,g=null;for(let i of(A??"").split(/\s+/).filter(Boolean))try{if(i.startsWith(kEA))t=decodeURIComponent(i.slice(kEA.length));else if(i.startsWith($EA))g=decodeURIComponent(i.slice($EA.length))}catch{return null}return t?{organizationId:t,projectId:g}:null},RB=(A)=>{if(A==="flag")return"from flag";if(A==="environment")return"from environment";return"from settings"},U3A=async(A={})=>{let t=f({jsonMode:A.json}),g=O({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),i=b(await g.me(),"Couldn't fetch authentication details (run 'sazabi auth login' to sign in again)",A.json);if(A.json){V({credential:i,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(LA("Authentication"),i.credentialType==="user"){RA({Type:`User token (${RB(t.tokenSource)})`,User:i.user.name??i.user.email,Email:i.user.email,"Active organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${RB(t.organizationSource)})`:eg("(none)"),"Active project":t.projectId&&t.projectSource?`${t.projectId} (${RB(t.projectSource)})`:eg("(none)"),Organizations:i.organizations.length.toString(),"Dashboard URL":PB()});return}if(i.credentialType==="secret"){RA({Type:`Secret key (${RB(t.tokenSource)})`,Organization:i.organization.name,"Key name":i.keyName,"Active project":t.projectId&&t.projectSource?`${t.projectId} (${RB(t.projectSource)})`:eg("(none)"),"Dashboard URL":PB()});return}RA({Type:`Partner key (${RB(t.tokenSource)})`,Superorganization:i.superorganization.name,"Dashboard URL":PB()})},S3A=async(A,t={})=>{let g=A.trim();if(!g){if(t.json)return u("Token is required.");return D("Token is required.")}let i=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",t.json);await kO({token:g,options:t,cliSettings:i,status:"saved"})},TEA=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=N3A(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},JEA=(A)=>new Promise((t)=>setTimeout(t,A)),L3A=async(A={})=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=Mi(t),i=t.profiles[g]??{},n=$O(i,A.apiBaseUrl),o=PEA(n,A.authBaseUrl??i.authBaseUrl),e;try{e=await uO({apiBaseUrl:o})}catch(E){let a=E instanceof Error?E.message:String(E);if(A.json)return u(`Failed to initiate sign-up: ${a}`);return D(`Failed to initiate sign-up: ${a}`)}let I=fEA({profile:i,publicApiBaseUrl:n,authBaseUrl:o,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:e.verificationUriComplete}),h=`/login/cli?user_code=${encodeURIComponent(e.userCode)}`,B=`${I}/sign-up?returnTo=${encodeURIComponent(h)}`,c=new Date(Date.now()+e.expiresIn*1000),C=e.interval*1000;if(!A.json)yA(),LA("Create a Sazabi account"),yA(),yg(`Opening ${zA.info(B)}`),yA(),TEA(B),iA("Waiting for sign-up to complete...");while(new Date<c){await JEA(C);try{let E=await bO({apiBaseUrl:o,deviceCode:e.deviceCode});if(E.status==="pending"){C=(E.interval??e.interval)*1000;continue}if(E.status==="denied"){if(A.json)return u("Sign-up was denied.");return yA(),D("Sign-up was denied.")}if(E.status==="expired"){if(A.json)return u("Sign-up request expired. Try again.");return yA(),D("Sign-up request expired. Try again.")}await kO({token:E.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:GEA(E.scope)});return}catch(E){let a=E instanceof Error?E.message:String(E);if(A.json)return u(`Sign-up failed: ${a}`);return yA(),D(`Sign-up failed: ${a}`)}}if(A.json)return u("Sign-up request expired. Try again.");return yA(),D("Sign-up request expired. Try again.")},F3A=async(A={})=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=Mi(t),i=t.profiles[g]??{},n=$O(i,A.apiBaseUrl),o=PEA(n,A.authBaseUrl??i.authBaseUrl),e;try{e=await uO({apiBaseUrl:o})}catch(C){let E=C instanceof Error?C.message:String(C);if(A.json)return u(`Failed to initiate login: ${E}`);return D(`Failed to initiate login: ${E}`)}let I=fEA({profile:i,publicApiBaseUrl:n,authBaseUrl:o,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:e.verificationUriComplete}),h=P3A(e.verificationUriComplete,I),B=new Date(Date.now()+e.expiresIn*1000),c=e.interval*1000;if(!A.json)yA(),LA("Sign in to Sazabi"),yA(),yg("Enter this code in your browser:"),yA(),yg(zA.bold(e.userCode),4),yA(),yg(`Opening ${zA.info(h)}`),yA(),TEA(h),iA("Waiting for authorization...");while(new Date<B){await JEA(c);try{let C=await bO({apiBaseUrl:o,deviceCode:e.deviceCode});if(C.status==="pending"){c=(C.interval??e.interval)*1000;continue}if(C.status==="denied"){if(A.json)return u("Authorization was denied.");return yA(),D("Authorization was denied.")}if(C.status==="expired"){if(A.json)return u("Authorization request expired. Try again.");return yA(),D("Authorization request expired. Try again.")}await kO({token:C.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:GEA(C.scope)});return}catch(C){let E=C instanceof Error?C.message:String(C);if(A.json)return u(`Authorization failed: ${E}`);return yA(),D(`Authorization failed: ${E}`)}}if(A.json)return u("Authorization request expired. Try again.");return yA(),D("Authorization request expired. Try again.")},M3A=(A)=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=b(Qn(t),"Couldn't resolve profile (run 'sazabi profiles list' to see available profiles)",A.json),i=Boolean(g.token),n=b(In(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0,...no(g)}),"Failed to update profile",A.json);if(b(Xt(n),"Failed to remove credentials",A.json),A.json){V({removed:i});return}if(i){j("Signed out.");return}iA("No credentials were saved.")},kO=async({token:A,options:t,cliSettings:g,status:i,approvedContext:n})=>{let o=Mi(g),e=g.profiles[o]??{},I=$O(e,t.apiBaseUrl),h=O({token:A,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),B=b(await h.me(),`Couldn't resolve authenticated context at ${I} (pass --api-base-url to target a different environment)`,t.json);if(i==="authorized"&&B.credentialType!=="user"){if(t.json)return u("Expected a user session from device authorization.");return D("Expected a user session from device authorization.")}if(n&&B.credentialType==="user"&&B.activeOrganizationId!==n.organizationId){if(t.json)return u("The issued session did not match the organization approved in the browser.");return D("The issued session did not match the organization approved in the browser.")}let c=g.profiles[o]?g:{...g,profiles:{...g.profiles,[o]:{}}},C=c.profiles[o],E=await Y3A({client:h,credential:B,currentProjectId:C.activeProjectId,approvedProjectId:n?n.projectId:void 0,jsonMode:t.json}),a=C.token!==A||C.activeOrganizationId!==E.activeOrganizationId||C.activeProjectId!==E.activeProjectId,y=b(In(c,{token:A,activeOrganizationId:E.activeOrganizationId,organizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,apiBaseUrl:t.apiBaseUrl??C.apiBaseUrl,authBaseUrl:t.authBaseUrl??C.authBaseUrl,webBaseUrl:t.webBaseUrl??C.webBaseUrl,...a&&no(C)}),"Failed to update profile",t.json);if(b(Xt(y),"Failed to save credentials",t.json),t.json){V({status:i,credential:B,activeOrganizationId:E.activeOrganizationId,activeProjectId:E.activeProjectId,projects:E.projects});return}if(yA(),j(i==="authorized"?"Signed in.":"Token saved."),yA(),$3A({credential:B,activeOrganizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,projects:E.projects}),E.projects.length>0){yA(),LA("Available projects");for(let w of E.projects){let N=w.id===E.activeProjectId?zA.success(" (active)"):"";yg(`${w.name} (${w.region})${N}`)}}},Y3A=async({client:A,credential:t,currentProjectId:g,approvedProjectId:i,jsonMode:n})=>{if(t.credentialType==="partner")return{projects:[]};let o=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,e=t.credentialType==="user"?t.organizations.find((h)=>h.id===o)?.name:t.organization.name,I=o?b(await A.projects.list({organizationId:o}),"Couldn't fetch projects (check your organization access and try again)",n).projects:[];return{activeOrganizationId:o,activeOrganizationName:e,activeProjectId:k3A(I,g,i),projects:I}},k3A=(A,t,g)=>{if(g===null)return;if(g!==void 0)return A.some((i)=>i.id===g)?g:void 0;if(t&&A.some((i)=>i.id===t))return t;return A[0]?.id},$3A=({credential:A,activeOrganizationName:t,activeProjectId:g,projects:i})=>{if(A.credentialType==="user"){RA({Type:"User token",User:A.user.name??A.user.email,Organizations:A.organizations.length.toString(),"Active organization":t??"(none)","Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}if(A.credentialType==="secret"){RA({Type:"Secret key",Organization:A.organization.name,"Key name":A.keyName,"Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}RA({Type:"Partner key",Superorganization:A.superorganization.name})},$O=(A,t)=>{return Yi({cliFlag:t,globalUrl:A.apiBaseUrl,globalDomain:A.apiDomain,buildUrlFromDomain:(g)=>`https://api.${g}`,defaultUrl:"https://api.sazabi.com"})},PEA=(A,t)=>{if(t)return t;try{let g=new URL(A);if(["localhost","127.0.0.1"].includes(g.hostname)&&["15005","15009"].includes(g.port))return g.port="15001",g.toString().replace(/\/$/,"");if(g.hostname==="api.sazabi.com")return g.hostname="api.platform.sazabi.com",g.toString().replace(/\/$/,"");if(g.hostname==="api.staging.sazabi.dev")return g.hostname="api.platform.staging.sazabi.dev",g.toString().replace(/\/$/,"");return g.toString().replace(/\/$/,"")}catch{return A}},REA=(A)=>A.replace(/\/+$/,""),hn=(A)=>(A?.trim().length??0)>0,G3A=(A)=>{if(!hn(A))return;try{let t=new URL(A);return`${t.protocol}//${t.host}`}catch{return}},fB=(A)=>{if(!hn(A))return;try{let g=new URL(A).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(g))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(g))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(g))return"https://app.sazabi.com"}catch{return}return},T3A=(A)=>{if(hn(A.webBaseUrl))return REA(A.webBaseUrl);if(hn(A.webDomain))return Zb(A.webDomain);return},J3A=({profile:A,publicApiBaseUrl:t})=>{if(!(hn(A.authBaseUrl)||hn(A.apiBaseUrl)||hn(A.apiDomain)))return;if(hn(A.authBaseUrl)){let i=fB(A.authBaseUrl);if(i)return i}return fB(t)},fEA=({profile:A,publicApiBaseUrl:t,authBaseUrl:g,apiBaseUrlOverride:i,authBaseUrlOverride:n,webBaseUrlOverride:o,verificationUriComplete:e})=>{if(hn(o))return REA(o);let I=process.env.SAZABI_API_URL?.trim(),h=hn(n)||hn(i)||hn(I),B=G3A(e);if(h){let E=hn(n)?fB(g):fB(t);if(E)return E;if(B)return B}let c=T3A(A);if(c)return c;let C=J3A({profile:A,publicApiBaseUrl:t});if(C)return C;if(B)return B;return"https://app.sazabi.com"},P3A=(A,t)=>{if(!t)return A;try{let g=new URL(A),i=new URL(t);return g.protocol=i.protocol,g.host=i.host,g.toString()}catch{return A}},OEA=nA("auth","Manage authentication credentials").withSubcommands({signup:U("signup","Create a new Sazabi account via browser",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await L3A({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth signup # Create a new account via browser"]).build(),login:U("login","Authenticate via browser",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await F3A({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth login # Authenticate via browser"]).build(),save:U("save","Save an existing bearer token",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"web-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return u("Token is required.");return D("Token is required.")}if(g.length>1){let n=g.slice(1).join(", ");if(t.json)return u(`Unexpected arguments: ${n}.`);return D(`Unexpected arguments: ${n}.`)}await S3A(i,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({...R,"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth save sazabi_secret_xxx # Save a secret key for future commands"]).build(),logout:U("logout","Remove saved credentials",async(A)=>{let{values:t,positionals:g}=L(A,z,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}M3A({json:t.json})}).withOptions(R).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:U("whoami","Display current authentication context",async(A)=>{let{values:t,positionals:g}=L(A,z,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await U3A({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(R).withExamples(["sazabi auth whoami # Show current context","sazabi auth whoami --json # Output as JSON"]).build()}).withExamples(["sazabi auth signup # Create a new account via browser","sazabi auth login # Authenticate via browser","sazabi auth save sazabi_secret_xxx # Save an existing token","sazabi auth logout # Remove saved credentials","sazabi auth whoami # Show current context"]).build();oA();bA();CA();var Ia=(A)=>({id:A.id,name:A.name,status:A.enabled?"active":"paused",source:A.source,kind:A.kind,health:A.health,cronExpression:A.cronExpression,timezone:A.timezone,timeoutSeconds:A.timeoutSeconds,successRate:A.successRate,runCount:A.runCount,failedRunCount:A.failedRunCount,lastRunStatus:A.lastRun?.status??null,lastRunAt:A.lastRun?.startedAt??null,scriptIdentifier:"scriptIdentifier"in A?A.scriptIdentifier:null,scriptId:"scriptId"in A?A.scriptId:null,scriptName:"scriptName"in A?A.scriptName:null,canToggle:"canToggle"in A?A.canToggle:null,createdAt:"createdAt"in A?A.createdAt:null,updatedAt:"updatedAt"in A?A.updatedAt:null}),vEA={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"nullable-string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"custom",render:(A)=>A==="active"?"Enabled":"Disabled",serialize:(A)=>A}},source:{label:"Source",type:{kind:"string"}},kind:{label:"Kind",type:{kind:"string"}},health:{label:"Health",type:{kind:"string"}},cronExpression:{label:"Cron",type:{kind:"nullable-string",emptyLabel:"(n/a)"}},timezone:{label:"Timezone",type:{kind:"string"}},timeoutSeconds:{label:"Timeout (s)",type:{kind:"custom",render:(A)=>A==null?"(none)":String(A),serialize:(A)=>A}},successRate:{label:"Success rate",type:{kind:"custom",render:(A)=>A==null?"(n/a)":`${Math.round(Number(A)*100)}%`,serialize:(A)=>A}},runCount:{label:"Runs (7d)",type:{kind:"number"}},failedRunCount:{label:"Failures (7d)",type:{kind:"number"}},lastRunStatus:{label:"Last run status",type:{kind:"nullable-string",emptyLabel:"(never)"}},lastRunAt:{label:"Last run",type:{kind:"nullable-date",emptyLabel:"(never)"}},scriptIdentifier:{label:"Script",type:{kind:"nullable-string"}},scriptId:{label:"Script ID",type:{kind:"nullable-string"}},scriptName:{label:"Script name",type:{kind:"nullable-string"}},canToggle:{label:"Can toggle",type:{kind:"custom",render:(A)=>A==null?"(n/a)":A?"yes":"no",serialize:(A)=>A}},createdAt:{label:"Created at",type:{kind:"nullable-date"}},updatedAt:{label:"Updated at",type:{kind:"nullable-date"}}},R3A={schema:vEA,columns:["name","status","health","cronExpression","lastRunAt"],jsonFields:["id","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt"],header:"Automations",emptyMessage:"No automations found."},Xb={layout:"field-list",schema:vEA,fields:["id","url","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt","scriptIdentifier","scriptId","scriptName","canToggle","createdAt","updatedAt"],title:"Automation"},mEA=(A)=>({id:A.id,automationRunKey:A.automationRunKey,status:A.status,scheduledAt:A.scheduledAt,dueAt:A.dueAt,startedAt:A.startedAt,completedAt:A.completedAt,durationMs:A.durationMs,exitCode:A.exitCode,errorMessage:A.errorMessage,automationId:"automationId"in A?A.automationId:null}),WEA={id:{label:"ID",type:{kind:"id"}},automationId:{label:"Automation",type:{kind:"nullable-string"}},automationRunKey:{label:"Run key",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},scheduledAt:{label:"Scheduled at",type:{kind:"nullable-date"}},dueAt:{label:"Due at",type:{kind:"nullable-date"}},startedAt:{label:"Started at",type:{kind:"date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},errorMessage:{label:"Error",type:{kind:"nullable-string",emptyLabel:"(none)"}}},f3A={schema:WEA,columns:["status","startedAt","durationMs","exitCode"],jsonFields:["id","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],header:"Automation runs",emptyMessage:"No automation runs found."},O3A={layout:"field-list",schema:WEA,fields:["id","automationId","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],title:"Automation run"},z3A=(A)=>({status:A.status,exitCode:A.exitCode,truncated:A.truncated,durationMs:A.durationMs,startedAt:A.startedAt,completedAt:A.completedAt,stdout:A.stdout,stderr:A.stderr}),v3A={status:{label:"Status",type:{kind:"string"}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},truncated:{label:"Truncated",type:{kind:"custom",render:(A)=>A?"yes":"no",serialize:(A)=>A}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},startedAt:{label:"Started at",type:{kind:"nullable-date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},stdout:{label:"Stdout",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}},stderr:{label:"Stderr",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}}},m3A={layout:"field-list",schema:v3A,fields:["status","exitCode","truncated","durationMs","startedAt","completedAt","stdout","stderr"],title:"Automation run logs"},Ce=(A)=>{let t=f({tokenFlag:A.token,projectIdFlag:A.projectId,jsonMode:A.json});return{client:O({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),projectId:t.projectId}},jb=(A,t)=>t?{...A,url:rEA(t,A.id)}:A,W3A=async(A)=>{let{client:t}=Ce(A),g=b(await t.automations.list({search:A.search,status:A.status,source:A.source,health:A.health,sort:A.sort,limit:A.limit,cursor:A.cursor}),"Couldn't list automations (check the active project and try again)",A.json);x(R3A,g.automations.map(Ia),{json:A.json,nextCursor:g.nextCursor})},Z3A=async(A,t)=>{let{client:g,projectId:i}=Ce(t),n=b(await g.automations.get(A),"Couldn't get automation (run 'sazabi automations list' to see automation IDs)",t.json);W(Xb,jb(Ia(n.automation),i),{json:t.json})},V3A=async(A,t)=>{let g=t.scriptId!==void 0,i=t.script!==void 0,n=t.expressionId!==void 0,o=Number(g)+Number(i)+Number(n),e=(c)=>{if(t.json){u(c);return}D(c)};if(o!==1){e("Provide exactly one of --script-id, --script, or --expression-id.");return}if(n){if(t.cronExpression!==void 0||t.timezone!==void 0||t.timeoutSeconds!==void 0){e("Cron and timeout flags are not used with --expression-id log-match automations.");return}if(!t.description?.trim()){e("--description is required for log-match automations (investigation instructions).");return}}let{client:I,projectId:h}=Ce(t),B=b(await I.automations.create({name:A,...t.description!==void 0?{description:t.description}:{},...t.scriptId!==void 0?{scriptId:t.scriptId}:{},...t.script!==void 0?{script:t.script}:{},...t.expressionId!==void 0?{expressionId:t.expressionId}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{},...t.enabled!==void 0?{enabled:t.enabled}:{}}),n?"Couldn't create log-match automation (check the expression ID and description)":"Couldn't create automation (check the script name/ID and try again)",t.json);if(!t.json)j(`Automation "${B.automation.name}" created.`);W(Xb,jb(Ia(B.automation),h),{json:t.json})},H3A=async(A,t)=>{if(t.name===void 0&&t.description===void 0&&t.clearDescription!==!0&&t.cronExpression===void 0&&t.timezone===void 0&&t.timeoutSeconds===void 0){if(t.json){u("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}D("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}if(t.description!==void 0&&t.clearDescription===!0){if(t.json){u("Use either --description or --clear-description, not both.");return}D("Use either --description or --clear-description, not both.");return}let{client:g,projectId:i}=Ce(t),n=b(await g.automations.update({automationId:A,...t.name!==void 0?{name:t.name}:{},...t.clearDescription?{description:null}:t.description!==void 0?{description:t.description}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{}}),"Couldn't update automation (run 'sazabi automations list' to see automation IDs)",t.json);if(!t.json)j(`Automation "${n.automation.name}" updated.`);W(Xb,jb(Ia(n.automation),i),{json:t.json})},ZEA=async(A,t,g)=>{let{client:i,projectId:n}=Ce(g),o=b(t?await i.automations.enable(A):await i.automations.disable(A),t?"Failed to enable automation":"Failed to disable automation",g.json),e=jb(Ia(o.automation),n);if(!g.json)j(`Automation "${e.name}" is now ${t?"enabled":"disabled"}.`);W(Xb,e,{json:g.json})},X3A=async(A,t)=>ZEA(A,!0,t),j3A=async(A,t)=>ZEA(A,!1,t),K3A=async(A,t)=>{let{client:g}=Ce(t),i=b(await g.automations.runs.list(A,{status:t.status,limit:t.limit,cursor:t.cursor}),"Couldn't list automation runs (run 'sazabi automations list' to see automation IDs)",t.json);x(f3A,i.runs.map(mEA),{json:t.json,nextCursor:i.nextCursor})},_3A=async(A,t,g)=>{let{client:i}=Ce(g),n=b(await i.automations.runs.get(A,t),"Couldn't get automation run (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);W(O3A,mEA(n.run),{json:g.json})},x3A=async(A,t,g)=>{let{client:i}=Ce(g),n=b(await i.automations.runs.logs(A,t),"Couldn't get automation run logs (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);W(m3A,z3A(n.logs),{json:g.json})},io={...z,"project-id":{type:"string"}},oo={...R,"project-id":{type:"string",description:"Override active project ID"}},s3A=(A,t)=>{let g=A[0];if(!g){if(t){u("Automation name is required.");return}D("Automation name is required.");return}return g},fQ=(A,t)=>{let g=A[0];if(!g){if(t){u("Automation ID is required.");return}D("Automation ID is required.");return}return g},zEA=(A,t)=>{let g=A[1];if(!g){if(t){u("Run ID is required.");return}D("Run ID is required.");return}return g},VEA=nA("automations","Manage scheduled automations").withSubcommands({list:U("list","List automations in the active project",async(A)=>{let{values:t}=L(A,{...io,search:{type:"string"},status:{type:"string"},source:{type:"string"},health:{type:"string"},sort:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),g=(c)=>{if(t.json){u(c);return}D(c)},i=t.status;if(i!==void 0&&i!=="active"&&i!=="paused")return g(`Invalid --status value "${i}". Expected "active" or "paused".`);let n=t.source;if(n!==void 0&&n!=="sazabi_managed"&&n!=="custom")return g(`Invalid --source value "${n}". Expected "sazabi_managed" or "custom".`);let o=t.health,e=["healthy","failing","never_run"];if(o!==void 0&&!e.includes(o))return g(`Invalid --health value "${o}". Expected one of: ${e.join(", ")}.`);let I=t.sort,h=["name","last_run","failures","runs"];if(I!==void 0&&!h.includes(I))return g(`Invalid --sort value "${I}". Expected one of: ${h.join(", ")}.`);let B;if(t.limit!==void 0){if(B=Number(t.limit),!Number.isInteger(B)||B<1||B>100)return g(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await W3A({token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],search:t.search,status:i,source:n,health:o,sort:I,limit:B,cursor:t.cursor})}).withOptions({...oo,search:{type:"string",description:"Filter by automation name (case-insensitive)"},status:{type:"string",description:"Filter by status: active or paused"},source:{type:"string",description:"Filter by source: sazabi_managed or custom"},health:{type:"string",description:"Filter by health: healthy, failing, or never_run"},sort:{type:"string",description:"Sort by: name, last_run, failures, or runs"},limit:{type:"string",description:"Maximum number of automations to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations list # List all automations","sazabi automations list --status paused # List paused automations"]).build(),get:U("get","Get one automation by ID",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await Z3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations get <automation-id> # Get one automation"]).build(),create:U("create","Create an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,description:{type:"string"},"script-id":{type:"string"},script:{type:"string"},"expression-id":{type:"string"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"},enabled:{type:"boolean"}},{allowPositionals:!0}),i=s3A(g,t.json);if(!i)return;let n=(e)=>{if(t.json){u(e);return}D(e)},o;if(t["timeout-seconds"]!==void 0){if(o=Number(t["timeout-seconds"]),!Number.isInteger(o)||o<1||o>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await V3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],description:t.description,scriptId:t["script-id"],script:t.script,expressionId:t["expression-id"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:o,enabled:t.enabled})}).withPositionalArgs("<name>").withOptions({...oo,description:{type:"string",description:"Human-readable description (required for log-match automations)"},"script-id":{type:"string",description:"Project script ID to run (cron automations)"},script:{type:"string",description:"Project script name to run (cron automations)"},"expression-id":{type:"string",description:"Log-match expression ID to bind (creates a log-match investigation automation)"},"cron-expression":{type:"string",description:"Cron schedule expression"},timezone:{type:"string",description:"IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"Run timeout in seconds (1-3600)"},enabled:{type:"boolean",description:"Create the automation enabled"}}).withExamples(["sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations create deploy-nightly --script-id <script-id> # Create by script ID",'sazabi automations create "Investigate Plain tickets" --expression-id <uuid> --description "When a new Plain ticket is created, investigate …" # Create a log-match investigation automation']).build(),update:U("update","Update an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,name:{type:"string"},description:{type:"string"},"clear-description":{type:"boolean"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"}},{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=(e)=>{if(t.json){u(e);return}D(e)},o;if(t["timeout-seconds"]!==void 0){if(o=Number(t["timeout-seconds"]),!Number.isInteger(o)||o<1||o>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await H3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,clearDescription:t["clear-description"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:o})}).withPositionalArgs("<automation-id>").withOptions({...oo,name:{type:"string",description:"New automation name"},description:{type:"string",description:"New human-readable description"},"clear-description":{type:"boolean",description:"Clear the automation description"},"cron-expression":{type:"string",description:"New cron schedule expression"},timezone:{type:"string",description:"New IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"New run timeout in seconds (1-3600)"}}).withExamples(["sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule"]).build(),enable:U("enable","Enable an automation",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await X3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations enable <automation-id> # Enable an automation"]).build(),disable:U("disable","Disable an automation",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await j3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations disable <automation-id> # Disable an automation"]).build(),runs:U("runs","Inspect automation runs").withSubcommands({list:U("list","List runs for an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,status:{type:"string"},limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=(h)=>{if(t.json){u(h);return}D(h)},o=t.status,e=["running","succeeded","failed","timed_out","cancelled"];if(o!==void 0&&!e.includes(o))return n(`Invalid --status value "${o}". Expected one of: ${e.join(", ")}.`);let I;if(t.limit!==void 0){if(I=Number(t.limit),!Number.isInteger(I)||I<1||I>100)return n(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await K3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],status:o,limit:I,cursor:t.cursor})}).withPositionalArgs("<automation-id>").withOptions({...oo,status:{type:"string",description:"Filter by run status: running, succeeded, failed, timed_out, or cancelled"},limit:{type:"string",description:"Maximum number of runs to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs list <automation-id> --status failed # List failed runs"]).build(),get:U("get","Get one automation run by ID",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=zEA(g,t.json);if(!n)return;await _3A(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(oo).withExamples(["sazabi automations runs get <automation-id> <run-id> # Get one automation run"]).build(),logs:U("logs","Get the captured logs for an automation run",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=zEA(g,t.json);if(!n)return;await x3A(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(oo).withExamples(["sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations list # List all automations","sazabi automations get <automation-id> # Get one automation","sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule","sazabi automations enable <automation-id> # Enable an automation","sazabi automations disable <automation-id> # Disable an automation","sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build();oA();bA();import{spawn as q3A}from"node:child_process";var eo=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=q3A(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},ki=(A)=>new Promise((t)=>setTimeout(t,A));import{randomUUID as d3A}from"node:crypto";import Kb from"node:fs";import p3A from"node:os";import HEA from"node:path";var XEA=()=>HEA.join(p3A.homedir(),".sazabi","pending-purchases"),A7A=()=>{Kb.mkdirSync(XEA(),{recursive:!0,mode:448})},jEA=(A)=>HEA.join(XEA(),`${encodeURIComponent(A)}.json`),t7A=(A)=>{for(let t=0;t<50;t+=1){let g;try{g=Kb.readFileSync(A,"utf-8")}catch(n){if(n.code==="ENOENT")return null;throw n}if(g.trim().length>0)try{let n=JSON.parse(g);if(n?.idempotencyKey&&n.organizationId&&n.amount)return n}catch{}let i=Date.now()+2;while(Date.now()<i);}return null},KEA=({organizationId:A,amount:t,explicitIdempotencyKey:g})=>{A7A();let i=jEA(A);for(let n=0;n<100;n+=1){let o={idempotencyKey:g??d3A(),organizationId:A,amount:t,createdAt:new Date().toISOString()};try{return Kb.writeFileSync(i,JSON.stringify(o,null,2),{encoding:"utf-8",mode:384,flag:"wx"}),{kind:"reserved",entry:o}}catch(I){if(I.code!=="EEXIST")throw I}let e=t7A(i);if(!e)continue;if(e.amount!==t)return{kind:"conflict",existing:e,reason:`A pending purchase for ${e.amount} is unresolved. Resolve it before purchasing a different amount.`};if(g&&g!==e.idempotencyKey)return{kind:"conflict",existing:e,reason:"A pending purchase with a different idempotency key is unresolved. Resolve it first."};return{kind:"resumed",entry:e}}throw Error("Could not reserve a pending purchase after repeated attempts.")},GO=(A)=>{try{Kb.unlinkSync(jEA(A))}catch(t){if(t.code!=="ENOENT")throw t}};import{createInterface as _EA}from"node:readline";var TO=()=>Boolean(process.stdin.isTTY)&&Boolean(process.stdout.isTTY),xEA=async(A)=>{let t=_EA({input:process.stdin,output:process.stdout});try{let i=(await new Promise((n)=>{t.question(`${A} [y/N] `,n)})).trim().toLowerCase();return i==="y"||i==="yes"}finally{t.close()}},sEA=async(A)=>{let t=_EA({input:process.stdin,output:process.stdout});try{await new Promise((g)=>{t.question(`${A} `,()=>g())})}finally{t.close()}};CA();var Tn=(A)=>{let t=A.json,g=f({tokenFlag:A.token,jsonMode:t});return{client:O({token:g.token,organizationId:g.organizationId,projectId:g.projectId,apiBaseUrlFlag:A["api-base-url"],jsonMode:t}),json:t??!1,credentials:g}},dEA=async({yes:A,json:t,prompt:g})=>{if(A)return!0;if(!TO()){if(t)u("Refusing to run this in a non-interactive shell without --yes.");else D("Refusing to run this in a non-interactive shell without --yes.");return!1}return xEA(g)},pEA=(A)=>A.statusCode===void 0||A.statusCode===408||A.statusCode===425||A.statusCode===429||A.statusCode>=500,AaA=(A,t,g)=>{let i=`${t}: ${A.error}`;if(g){u(A.errorPayload??i);return}D(i)},g7A={plan:{label:"Plan",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},currency:{label:"Currency",type:{kind:"string"}},balance:{label:"Current balance",type:{kind:"string"}},targetBalance:{label:"Target balance",type:{kind:"string"}},cycle:{label:"Cycle",type:{kind:"string"}},estimate:{label:"Est. total",type:{kind:"string"}},pendingDowngrade:{label:"Pending downgrade",type:{kind:"string"}},collection:{label:"Outstanding balance",type:{kind:"string"}}},n7A={layout:"field-list",schema:g7A,fields:["plan","status","currency","balance","targetBalance","cycle","estimate","pendingDowngrade","collection"]},i7A=(A)=>({plan:A.planName??"—",status:A.status,currency:A.currency??"—",balance:A.currentBalance??"—",targetBalance:A.targetCreditBalance??"—",cycle:A.currentCycle?`${A.currentCycle.startsAt.slice(0,10)} - ${A.currentCycle.endsAt.slice(0,10)}`:"—",estimate:A.currentPeriodEstimate?`${A.currentPeriodEstimate.totalAmount} ${A.currentPeriodEstimate.currency}`:"—",pendingDowngrade:A.pendingDowngrade?`${A.pendingDowngrade.planName??"—"} (effective ${A.pendingDowngrade.effectiveAt.slice(0,10)})`:"—",collection:o7A(A.collection)}),o7A=(A)=>{if(A.status==="current")return"None";let t=A.outstandingAmount!==null&&A.currency!==null?`${A.outstandingAmount} ${A.currency}`:`${A.outstandingCredits??"—"} credits`;if(A.status==="delinquent")return`${t} owed — delinquent, log intake paused until paid`;let g=A.nextRetryAt?`next retry ${A.nextRetryAt.slice(0,10)}`:"retry pending";return`${t} owed — payment retrying (${g})`},e7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getSummary(),"Couldn't fetch billing summary (check your organization access and try again)",i);if(!i){if(LA("Billing summary"),!n.billable&&n.nonBillableReason)RA({"Not billable":n.nonBillableReason})}W(n7A,i7A(n),{json:i})},Q7A={logs_ingested_bytes:"Log data (GB)",input_tokens:"Input tokens",output_tokens:"Output tokens"},I7A=(A)=>{let t=Number.parseFloat(A);if(Number.isNaN(t))return A;return(t/1e9).toFixed(3)},h7A=(A,t)=>{if(t==="logs_ingested_bytes")return I7A(A);let g=Number.parseInt(A,10);return Number.isNaN(g)?A:g.toLocaleString()},B7A={dimension:{label:"Dimension",type:{kind:"string"}},total:{label:"Total quantity",type:{kind:"string"}},credits:{label:"Credits consumed",type:{kind:"string"}}},c7A={schema:B7A,columns:["dimension","total","credits"],emptyMessage:"No usage recorded for this billing cycle."},C7A=async(A)=>{let{values:t}=L(A,{...z,cycle:{type:"string"}}),{client:g,json:i}=Tn(t);if(t.cycle&&t.cycle!=="current"&&t.cycle!=="previous"){if(i)return u("--cycle must be 'current' or 'previous'.");D("--cycle must be 'current' or 'previous'.");return}let n=t.cycle??"current",o=b(await g.billing.getUsage({cycle:n}),"Couldn't fetch billing usage (check your organization access and try again)",i);if(!i){if(LA(`Billing usage (${n} cycle)`),o.cycle)RA({Cycle:`${o.cycle.startsAt.slice(0,10)} - ${o.cycle.endsAt.slice(0,10)}`})}let e=o.usage.map((I)=>{let h=I.dimension;return{dimension:Q7A[h]??I.dimension,total:h7A(I.totalQuantity,h),credits:I.creditsConsumed}});x(c7A,e,{json:i})},E7A={occurredAt:{label:"Date",type:{kind:"date"}},type:{label:"Type",type:{kind:"string"}},delta:{label:"Credit delta",type:{kind:"string"}},balance:{label:"Balance after",type:{kind:"string"}}},a7A={schema:E7A,columns:["occurredAt","type","delta","balance"],emptyMessage:"No billing transactions found."},r7A=async(A)=>{let{values:t}=L(A,{...z,limit:{type:"string"},page:{type:"string"}}),{client:g,json:i}=Tn(t),n,o;if(t.limit){if(n=Number.parseInt(t.limit,10),Number.isNaN(n)||n<1||n>100){if(i)return u("--limit must be a positive integer (max 100).");D("--limit must be a positive integer (max 100).");return}}if(t.page){if(o=Number.parseInt(t.page,10),Number.isNaN(o)||o<1){if(i)return u("--page must be a positive integer.");D("--page must be a positive integer.");return}}let e=b(await g.billing.listTransactions({limit:n??10,page:o??1}),"Couldn't fetch billing transactions (check your organization access and try again)",i);if(!i)LA("Billing transactions");let I=e.items.map((h)=>({occurredAt:h.occurredAt,type:h.transactionType,delta:h.creditDelta,balance:h.balanceAfter}));if(x(a7A,I,{json:i,count:e.pagination.total}),!i&&e.pagination.hasNext){let h=(o??1)+1;RA({"Next page":`Use --page ${h} for more results.`})}},y7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.retryOutstandingBalance({idempotencyKey:crypto.randomUUID()}),"Couldn't start the outstanding balance retry (check that a balance is outstanding and you can manage billing)",i);if(i){V(n);return}LA("Outstanding balance retry"),RA({Status:"Started","Workflow ID":n.workflowId,Next:"Run `sazabi billing summary` to see the outcome."})},w7A={enabled:{label:"Enabled",type:{kind:"string"}},triggerBalance:{label:"Trigger balance",type:{kind:"string"}},topUpAmount:{label:"Top-up amount",type:{kind:"string"}},cycleLimit:{label:"Cycle spending limit",type:{kind:"string"}},currency:{label:"Currency",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}}},taA={layout:"field-list",schema:w7A,fields:["enabled","triggerBalance","topUpAmount","cycleLimit","currency","status"]},gaA=(A)=>({enabled:A.enabled?"Yes":"No",triggerBalance:A.triggerCreditBalance,topUpAmount:A.topUpAmount,cycleLimit:A.cycleSpendingLimit,currency:A.currency.toUpperCase(),status:A.status}),D7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getAutoTopUp(),"Couldn't fetch auto top-up settings (check your organization access and that you can manage billing)",i);if(!i)LA("Auto top-up");W(taA,gaA(n),{json:i})},u7A=async(A)=>{let{values:t}=L(A,{...z,enable:{type:"boolean"},disable:{type:"boolean"},"trigger-balance":{type:"string"},amount:{type:"string"},"cycle-limit":{type:"string"}}),{client:g,json:i}=Tn(t);if(t.enable&&t.disable){if(i)return u("Pass either --enable or --disable, not both.");D("Pass either --enable or --disable, not both.");return}let n=b(await g.billing.getAutoTopUp(),"Couldn't load current auto top-up settings",i),o=t.enable?!0:t.disable?!1:n.enabled,e=t["trigger-balance"]??n.triggerCreditBalance,I=t.amount??n.topUpAmount,h=t["cycle-limit"]??n.cycleSpendingLimit,B=b(await g.billing.updateAutoTopUp({enabled:o,triggerCreditBalance:e,topUpAmount:I,cycleSpendingLimit:h}),"Couldn't update auto top-up settings (check the values and that you can manage billing)",i);if(!i)j(o?"Auto top-up enabled.":"Auto top-up disabled."),LA("Auto top-up");W(taA,gaA(B),{json:i})},b7A=async(A)=>{let{values:t}=L(A,{...z,amount:{type:"string"},"idempotency-key":{type:"string"},yes:{type:"boolean"}}),{client:g,json:i,credentials:n}=Tn(t),o=t.amount?.trim();if(!o){if(i)return u("--amount is required (e.g. --amount 50).");D("--amount is required (e.g. --amount 50).");return}if(!/^\d+(?:\.\d{1,2})?$/.test(o)){if(i)return u("--amount must be a dollar amount, e.g. 50 or 50.00.");D("--amount must be a dollar amount, e.g. 50 or 50.00.");return}let e=n.organizationId;if(!e){if(i)return u("No active organization. Run `sazabi organizations use <id>` first.");D("No active organization. Run `sazabi organizations use <id>` first.");return}if(!await dEA({yes:Boolean(t.yes),json:i,prompt:`Purchase ${o} of credits for this organization?`})){if(!i)iA("Cancelled.");return}let h=KEA({organizationId:e,amount:o,explicitIdempotencyKey:t["idempotency-key"]});if(h.kind==="conflict"){let E=`${h.reason} Re-run to resume it, or pass --idempotency-key to control the key.`;if(i)return u(E);D(E);return}if(h.kind==="resumed"&&!i)iA("Resolving a prior purchase attempt (idempotency key reused).");let B=h.entry.idempotencyKey,c=await g.billing.purchaseCredits({amount:o,idempotencyKey:B});if(c.success)GO(e);else if(typeof c.statusCode==="number"&&c.statusCode>=400&&c.statusCode<500)GO(e);let C=b(c,"Couldn't purchase credits (check your payment method with `sazabi billing payment-method update` and that you can manage billing)",i);if(i){V(C);return}j("Credit purchase submitted."),RA({Status:C.status,"Credits granted":C.creditsToGrant,Charged:`${C.topUpAmount} ${C.currency.toUpperCase()}`,Invoice:C.billingInvoiceId})},l7A={current:{label:"",type:{kind:"string"}},slug:{label:"Slug",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},price:{label:"Price",type:{kind:"string"}},includedCredits:{label:"Included credits",type:{kind:"string"}}},N7A={schema:l7A,columns:["current","slug","name","price","includedCredits"],emptyMessage:"No self-serve plans are available."},U7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.listPlans(),"Couldn't fetch plans (check your organization access and that you can manage billing)",i);if(i){V(n);return}LA("Plans");let o=n.plans.map((e)=>({current:e.slug===n.currentPlanSlug?"*":"",slug:e.slug,name:e.name,price:`${e.price} ${e.currency.toUpperCase()}`,includedCredits:e.targetCreditBalance??"—"}));if(x(N7A,o,{json:!1}),n.currentPlanSlug)RA({Current:`* = your current plan (${n.currentPlanSlug})`})},S7A={type:{label:"Change type",type:{kind:"string"}},effectiveAt:{label:"Effective",type:{kind:"string"}},currentPlan:{label:"Current plan",type:{kind:"string"}},targetPlan:{label:"Target plan",type:{kind:"string"}},immediateCharge:{label:"Immediate charge",type:{kind:"string"}},nextCycleCharge:{label:"Next cycle charge",type:{kind:"string"}},targetBalance:{label:"Target credit balance",type:{kind:"string"}}},naA={layout:"field-list",schema:S7A,fields:["type","effectiveAt","currentPlan","targetPlan","immediateCharge","nextCycleCharge","targetBalance"]},iaA=(A)=>({type:A.type,effectiveAt:A.effectiveAt.slice(0,10),currentPlan:`${A.currentPlanName} (${A.currentPlanPrice} ${A.currency.toUpperCase()})`,targetPlan:`${A.targetPlanName} (${A.targetPlanPrice} ${A.currency.toUpperCase()})`,immediateCharge:`${A.immediateChargeAmount} ${A.currency.toUpperCase()}`,nextCycleCharge:`${A.nextCycleChargeAmount} ${A.currency.toUpperCase()}`,targetBalance:A.targetCreditBalance}),PO=(A,t)=>{let g=A.plan?.trim();if(!g){if(t)u("--plan <slug> is required. Run `sazabi billing plans list`.");else D("--plan <slug> is required. Run `sazabi billing plans list`.");return null}return g},L7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.previewPlanChange({planSlug:n}),"Couldn't preview the plan change (check the plan slug and that you can manage billing)",i);if(!i)LA("Plan change preview");W(naA,iaA(o),{json:i})},F7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"},yes:{type:"boolean"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.previewPlanChange({planSlug:n}),"Couldn't preview the plan change (check the plan slug and that you can manage billing)",i);if(!i)LA("Plan change preview"),W(naA,iaA(o),{json:!1});if(!await dEA({yes:Boolean(t.yes),json:i,prompt:`Apply this plan change to ${n}?`})){if(!i)iA("Cancelled.");return}let I=b(await g.billing.changePlan({planSlug:n}),"Couldn't change the plan (check that you can manage billing)",i);if(i){V(I);return}j(I.type==="downgrade"?"Plan downgrade scheduled.":"Plan changed."),RA({Type:I.type,Status:I.status,Effective:I.effectiveAt.slice(0,10)})},M7A=3000,Y7A=900000,k7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.createCheckoutSession({planSlug:n}),"Couldn't start checkout (sign in with `sazabi auth login` — secret keys can't subscribe)",i);if(!i)yA(),LA("Subscribe to Sazabi"),yA(),yg("Complete checkout in your browser:"),yA(),yg(zA.info(o.checkoutUrl)),yA();if(eo(o.checkoutUrl),!i)iA("Waiting for checkout to complete...");let e=Date.now()+Y7A;while(Date.now()<e){await ki(M7A);let h=await g.billing.getCheckoutSessionStatus({sessionId:o.sessionId});if(!h.success&&pEA(h))continue;if(!h.success){AaA(h,"Couldn't check checkout status",i);return}let B=h.value.status;if(B==="active"){if(i){V({status:"active",sessionId:o.sessionId});return}yA(),j("Subscription active."),RA({Next:"Run `sazabi billing summary` to see your plan, or `sazabi billing auto-top-up set` to enable auto top-up."});return}if(B==="expired"){let c=`Checkout ${B}. Run \`sazabi billing setup --plan ${n}\` to try again.`;if(i)return u(c);yA(),D(c);return}}let I="Checkout timed out. If you completed payment, run `sazabi billing summary` to confirm.";if(i)return u(I);yA(),D(I)},qEA=3000,$7A=300000,JO=(A)=>`${A.hasPaymentMethod}:${A.brand??""}:${A.last4??""}`,G7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getPaymentMethod(),"Couldn't read the current payment method",i),o=b(await g.billing.createPortalSession(),"Couldn't open the billing portal (sign in with `sazabi auth login` — secret keys can't manage billing)",i);if(!i)yA(),LA("Update payment method"),yA(),yg("Update your payment method in the browser:"),yA(),yg(zA.info(o.portalUrl)),yA();if(eo(o.portalUrl),TO())await sEA("Press Enter when you've finished updating your payment method in the browser...");let e=JO(n),I=Date.now()+$7A,h=n;while(Date.now()<I){let B=await g.billing.getPaymentMethod();if(!B.success&&pEA(B)){await ki(qEA);continue}if(!B.success){AaA(B,"Couldn't refresh the payment method",i);return}if(h=B.value,JO(h)!==e)break;await ki(qEA)}if(i){V(h);return}if(JO(h)!==e)j("Payment method updated."),RA({"Payment method":h.display??"on file"});else iA("No change detected. If you replaced your card with one of the same brand and last 4 digits, this is expected.")},T7A=U("summary","Show the billing summary for your organization",async(A)=>{await e7A(A)}).withOptions(R).withExamples(["sazabi billing summary # Show billing summary","sazabi billing summary --json # Output as JSON"]).build(),J7A=U("usage","Show per-dimension usage for the current or previous cycle",async(A)=>{await C7A(A)}).withOptions({...R,cycle:{type:"string",description:"Which cycle to report (current or previous)"}}).withExamples(["sazabi billing usage # Current cycle usage","sazabi billing usage --cycle previous # Previous cycle usage","sazabi billing usage --json # Output as JSON"]).build(),P7A=U("transactions","List recent credit ledger transactions",async(A)=>{await r7A(A)}).withOptions({...R,limit:{type:"string",description:"Max results per page (default 10, max 100)"},page:{type:"string",description:"Page number (1-indexed)"}}).withExamples(["sazabi billing transactions # Recent transactions","sazabi billing transactions --limit 50 # More results","sazabi billing transactions --page 2 # Next page","sazabi billing transactions --json # Output as JSON"]).build(),R7A=U("retry-outstanding-balance","Retry payment of an outstanding negative balance with the saved payment method",async(A)=>{await y7A(A)}).withOptions(R).withExamples(["sazabi billing retry-outstanding-balance # Retry the outstanding balance now","sazabi billing retry-outstanding-balance --json # Output as JSON"]).build(),f7A=U("auto-top-up","View or configure credit auto top-up").withSubcommands({get:U("get","Show the current auto top-up settings",async(A)=>{await D7A(A)}).withOptions(R).withExamples(["sazabi billing auto-top-up get # Show current auto top-up settings"]).build(),set:U("set","Enable/disable and configure auto top-up",async(A)=>{await u7A(A)}).withOptions({...R,enable:{type:"boolean",description:"Enable auto top-up"},disable:{type:"boolean",description:"Disable auto top-up"},"trigger-balance":{type:"string",description:"Credit balance that triggers a top-up"},amount:{type:"string",description:"Amount of credits to add per top-up"},"cycle-limit":{type:"string",description:"Maximum auto top-up spend per cycle"}}).withExamples(["sazabi billing auto-top-up set --enable --trigger-balance 10 --amount 50 --cycle-limit 200 # Enable auto top-up","sazabi billing auto-top-up set --disable # Turn auto top-up off"]).build()}).build(),O7A=U("credits","Purchase credits").withSubcommands({purchase:U("purchase","Buy a one-time amount of credits with the saved payment method",async(A)=>{await b7A(A)}).withOptions({...R,amount:{type:"string",description:"Dollar amount of credits to purchase (e.g. 50)"},"idempotency-key":{type:"string",description:"Explicit idempotency key (advanced; auto-generated otherwise)"},yes:{type:"boolean",description:"Skip the confirmation prompt"}}).withExamples(["sazabi billing credits purchase --amount 50 # Buy $50 of credits (prompts to confirm)","sazabi billing credits purchase --amount 50 --yes # Buy without a prompt"]).build()}).build(),z7A=U("plans","List available plans").withSubcommands({list:U("list","List the self-serve plans available for checkout",async(A)=>{await U7A(A)}).withOptions(R).withExamples(["sazabi billing plans list # List plans available for checkout"]).build()}).build(),v7A=U("plan","Preview or change your plan").withSubcommands({preview:U("preview","Preview the cost of changing to a plan",async(A)=>{await L7A(A)}).withOptions({...R,plan:{type:"string",description:"Target plan slug (see `sazabi billing plans list`)"}}).withExamples(["sazabi billing plan preview --plan team-v1 # See the cost of switching to team-v1"]).build(),change:U("change","Change to a plan (upgrade applies now; downgrade schedules)",async(A)=>{await F7A(A)}).withOptions({...R,plan:{type:"string",description:"Target plan slug (see `sazabi billing plans list`)"},yes:{type:"boolean",description:"Skip the confirmation prompt"}}).withExamples(["sazabi billing plan change --plan team-v1 # Change plan (shows preview, prompts to confirm)","sazabi billing plan change --plan team-v1 --yes # Change plan without a prompt"]).build()}).build(),m7A=U("setup","Subscribe from the terminal (opens a browser for checkout)",async(A)=>{await k7A(A)}).withOptions({...R,plan:{type:"string",description:"Plan slug to subscribe to (see `sazabi billing plans list`)"}}).withExamples(["sazabi billing setup --plan team-v1 # Subscribe via browser checkout"]).build(),W7A=U("payment-method","Manage your saved payment method").withSubcommands({update:U("update","Update your payment method (opens the Stripe Customer Portal)",async(A)=>{await G7A(A)}).withOptions(R).withExamples(["sazabi billing payment-method update # Update your card via the Stripe portal"]).build()}).build(),oaA=nA("billing","View and manage billing — usage, plans, credits, and subscribe").withSubcommands({summary:T7A,usage:J7A,transactions:P7A,"retry-outstanding-balance":R7A,"auto-top-up":f7A,credits:O7A,plans:z7A,plan:v7A,setup:m7A,"payment-method":W7A}).withExamples(["sazabi billing summary # Show billing plan and balance","sazabi billing setup --plan team-v1 # Subscribe from the terminal","sazabi billing credits purchase --amount 50 # Buy credits","sazabi billing auto-top-up set --enable --trigger-balance 10 --amount 50 --cycle-limit 200 # Enable auto top-up"]).build();oA();var eaA=()=>`
8710
+ `)};var a3A=100,SEA=100,r3A=async(A,t,g)=>{let i=[],n;for(let o=0;o<SEA;o++){let e=await A.messages.list(t,{limit:a3A,...n?{cursor:n}:{}}),I=b(e,"Couldn't get artifact (check the thread ID and try again)",g);if(i.push(...I.messages),!I.nextCursor)break;n=I.nextCursor}if(n&&!g)console.error(`Warning: reached the ${SEA}-page limit; the artifact may exist beyond the scanned messages.`);return i},y3A=(A,t,g)=>{if(t)return t;let i=`--thread-id is required to locate artifact '${A}'. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>`;if(g)u(i);else D(i);return},w3A=(A,t)=>{if(t.json){V({id:A.id,messageId:A.messageId,name:A.name,toolCallId:A.toolCallId,createdAt:A.createdAt,data:A.data});return}if(t.format==="csv"){let g=UEA(A.data);if(g===null){D(`Artifact '${A.id}' (${A.name}) has no embedded rows to render as CSV. Built-in table/timeseries artifacts persist query parameters rather than result rows, so only artifacts that embed their data (such as custom artifacts) can be exported as CSV. Use --json or the default output to inspect this artifact.`);return}console.log(g);return}console.log(JSON.stringify(A.data,null,2))},LEA=async(A,t)=>{if(!lEA(A)){let h=`Invalid artifact ID: '${A}'. Expected format '<message-id>:<index>' (from 'sazabi artifacts list').`;if(t.json)return u(h);return D(h)}let i=y3A(A,t.threadId,t.json);if(!i)return;let n=f({tokenFlag:t.token,jsonMode:t.json}),o=O({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),e=await r3A(o,i,t.json),I=NEA(e,A);if(!I){let h=`Artifact '${A}' not found in thread '${i}'. Run 'sazabi artifacts list --thread-id ${i}' to see available artifacts.`;if(t.json)return u(h);return D(h)}w3A(I,t)};oA();bA();CA();var D3A={id:{label:"ID",type:{kind:"string"}},name:{label:"Type",type:{kind:"string"}},toolCallId:{label:"Tool call",type:{kind:"nullable-string",emptyLabel:"(none)"}},createdAt:{label:"Created",type:{kind:"date"}}},u3A={schema:D3A,columns:["id","name","toolCallId","createdAt"],header:"Artifacts",emptyMessage:"No artifacts found in this thread."},b3A=100,FEA=100,l3A=async(A,t,g)=>{let i=[],n;for(let o=0;o<FEA;o++){let e=await A.messages.list(t,{limit:b3A,...n?{cursor:n}:{}}),I=b(e,"Couldn't list artifacts (check the thread ID and try again)",g);if(i.push(...I.messages),!I.nextCursor)break;n=I.nextCursor}if(n&&!g)console.error(`Warning: reached the ${FEA}-page limit; artifact list may be incomplete for this thread.`);return i},MEA=async(A)=>{let t=f({tokenFlag:A.token,jsonMode:A.json}),g=O({token:t.token,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl}),i=await l3A(g,A.threadId,A.json),o=YO(i).map((e)=>({id:e.id,name:e.name,toolCallId:e.toolCallId,createdAt:e.createdAt}));x(u3A,o,{json:A.json})};var YEA=nA("artifacts","Retrieve artifacts produced in a thread").withSubcommands({list:U("list","List artifacts produced in a thread",async(A)=>{let{values:t}=L(A,{token:{type:"string"},"thread-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),g=t["thread-id"];if(!g){if(t.json)return u("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>");return D("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>")}await MEA({threadId:g,token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread to list artifacts for (required)"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts list --thread-id <thread-id> --json # Output as JSON"]).build(),get:U("get","Get a single artifact's data",async(A)=>{let{values:t,positionals:g}=L(A,{token:{type:"string"},"thread-id":{type:"string"},format:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return u("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>");return D("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>")}if(g.length>1){let o=g.slice(1).join(", ");if(t.json)return u(`Unexpected arguments: ${o}.`);return D(`Unexpected arguments: ${o}.`)}let n;if(t.format)n=Kg(t.format,["json","csv"],"Format",t.json);await LEA(i,{token:t.token,threadId:t["thread-id"],format:n,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<artifact-id>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread the artifact belongs to (required)"},format:{type:"string",description:"Output format for non-JSON mode: json (default) or csv"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts get <artifact-id> --thread-id <thread-id> # Print artifact data","sazabi artifacts get <artifact-id> --thread-id <thread-id> --format csv # Render table/timeseries as CSV","sazabi artifacts get <artifact-id> --thread-id <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts get <artifact-id> --thread-id <thread-id> # Get one artifact's data"]).build();oA();lO();import{spawn as N3A}from"node:child_process";var z={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},R={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};bA();CA();Gn();var kEA="sazabi:organization:",$EA="sazabi:project:",GEA=(A)=>{let t=null,g=null;for(let i of(A??"").split(/\s+/).filter(Boolean))try{if(i.startsWith(kEA))t=decodeURIComponent(i.slice(kEA.length));else if(i.startsWith($EA))g=decodeURIComponent(i.slice($EA.length))}catch{return null}return t?{organizationId:t,projectId:g}:null},RB=(A)=>{if(A==="flag")return"from flag";if(A==="environment")return"from environment";return"from settings"},U3A=async(A={})=>{let t=f({jsonMode:A.json}),g=O({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),i=b(await g.me(),"Couldn't fetch authentication details (run 'sazabi auth login' to sign in again)",A.json);if(A.json){V({credential:i,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(LA("Authentication"),i.credentialType==="user"){RA({Type:`User token (${RB(t.tokenSource)})`,User:i.user.name??i.user.email,Email:i.user.email,"Active organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${RB(t.organizationSource)})`:eg("(none)"),"Active project":t.projectId&&t.projectSource?`${t.projectId} (${RB(t.projectSource)})`:eg("(none)"),Organizations:i.organizations.length.toString(),"Dashboard URL":PB()});return}if(i.credentialType==="secret"){RA({Type:`Secret key (${RB(t.tokenSource)})`,Organization:i.organization.name,"Key name":i.keyName,"Active project":t.projectId&&t.projectSource?`${t.projectId} (${RB(t.projectSource)})`:eg("(none)"),"Dashboard URL":PB()});return}RA({Type:`Partner key (${RB(t.tokenSource)})`,Superorganization:i.superorganization.name,"Dashboard URL":PB()})},S3A=async(A,t={})=>{let g=A.trim();if(!g){if(t.json)return u("Token is required.");return D("Token is required.")}let i=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",t.json);await kO({token:g,options:t,cliSettings:i,status:"saved"})},TEA=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=N3A(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},JEA=(A)=>new Promise((t)=>setTimeout(t,A)),L3A=async(A={})=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=Mi(t),i=t.profiles[g]??{},n=$O(i,A.apiBaseUrl),o=PEA(n,A.authBaseUrl??i.authBaseUrl),e;try{e=await uO({apiBaseUrl:o})}catch(E){let a=E instanceof Error?E.message:String(E);if(A.json)return u(`Failed to initiate sign-up: ${a}`);return D(`Failed to initiate sign-up: ${a}`)}let I=fEA({profile:i,publicApiBaseUrl:n,authBaseUrl:o,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:e.verificationUriComplete}),h=`/login/cli?user_code=${encodeURIComponent(e.userCode)}`,B=`${I}/sign-up?returnTo=${encodeURIComponent(h)}`,c=new Date(Date.now()+e.expiresIn*1000),C=e.interval*1000;if(!A.json)yA(),LA("Create a Sazabi account"),yA(),yg(`Opening ${zA.info(B)}`),yA(),TEA(B),iA("Waiting for sign-up to complete...");while(new Date<c){await JEA(C);try{let E=await bO({apiBaseUrl:o,deviceCode:e.deviceCode});if(E.status==="pending"){C=(E.interval??e.interval)*1000;continue}if(E.status==="denied"){if(A.json)return u("Sign-up was denied.");return yA(),D("Sign-up was denied.")}if(E.status==="expired"){if(A.json)return u("Sign-up request expired. Try again.");return yA(),D("Sign-up request expired. Try again.")}await kO({token:E.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:GEA(E.scope)});return}catch(E){let a=E instanceof Error?E.message:String(E);if(A.json)return u(`Sign-up failed: ${a}`);return yA(),D(`Sign-up failed: ${a}`)}}if(A.json)return u("Sign-up request expired. Try again.");return yA(),D("Sign-up request expired. Try again.")},F3A=async(A={})=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=Mi(t),i=t.profiles[g]??{},n=$O(i,A.apiBaseUrl),o=PEA(n,A.authBaseUrl??i.authBaseUrl),e;try{e=await uO({apiBaseUrl:o})}catch(C){let E=C instanceof Error?C.message:String(C);if(A.json)return u(`Failed to initiate login: ${E}`);return D(`Failed to initiate login: ${E}`)}let I=fEA({profile:i,publicApiBaseUrl:n,authBaseUrl:o,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:e.verificationUriComplete}),h=P3A(e.verificationUriComplete,I),B=new Date(Date.now()+e.expiresIn*1000),c=e.interval*1000;if(!A.json)yA(),LA("Sign in to Sazabi"),yA(),yg("Enter this code in your browser:"),yA(),yg(zA.bold(e.userCode),4),yA(),yg(`Opening ${zA.info(h)}`),yA(),TEA(h),iA("Waiting for authorization...");while(new Date<B){await JEA(c);try{let C=await bO({apiBaseUrl:o,deviceCode:e.deviceCode});if(C.status==="pending"){c=(C.interval??e.interval)*1000;continue}if(C.status==="denied"){if(A.json)return u("Authorization was denied.");return yA(),D("Authorization was denied.")}if(C.status==="expired"){if(A.json)return u("Authorization request expired. Try again.");return yA(),D("Authorization request expired. Try again.")}await kO({token:C.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:GEA(C.scope)});return}catch(C){let E=C instanceof Error?C.message:String(C);if(A.json)return u(`Authorization failed: ${E}`);return yA(),D(`Authorization failed: ${E}`)}}if(A.json)return u("Authorization request expired. Try again.");return yA(),D("Authorization request expired. Try again.")},M3A=(A)=>{let t=b(yt(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=b(Qn(t),"Couldn't resolve profile (run 'sazabi profiles list' to see available profiles)",A.json),i=Boolean(g.token),n=b(In(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0,...no(g)}),"Failed to update profile",A.json);if(b(Xt(n),"Failed to remove credentials",A.json),A.json){V({removed:i});return}if(i){j("Signed out.");return}iA("No credentials were saved.")},kO=async({token:A,options:t,cliSettings:g,status:i,approvedContext:n})=>{let o=Mi(g),e=g.profiles[o]??{},I=$O(e,t.apiBaseUrl),h=O({token:A,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),B=b(await h.me(),`Couldn't resolve authenticated context at ${I} (pass --api-base-url to target a different environment)`,t.json);if(i==="authorized"&&B.credentialType!=="user"){if(t.json)return u("Expected a user session from device authorization.");return D("Expected a user session from device authorization.")}if(n&&B.credentialType==="user"&&B.activeOrganizationId!==n.organizationId){if(t.json)return u("The issued session did not match the organization approved in the browser.");return D("The issued session did not match the organization approved in the browser.")}let c=g.profiles[o]?g:{...g,profiles:{...g.profiles,[o]:{}}},C=c.profiles[o],E=await Y3A({client:h,credential:B,currentProjectId:C.activeProjectId,approvedProjectId:n?n.projectId:void 0,jsonMode:t.json}),a=C.token!==A||C.activeOrganizationId!==E.activeOrganizationId||C.activeProjectId!==E.activeProjectId,y=b(In(c,{token:A,activeOrganizationId:E.activeOrganizationId,organizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,apiBaseUrl:t.apiBaseUrl??C.apiBaseUrl,authBaseUrl:t.authBaseUrl??C.authBaseUrl,webBaseUrl:t.webBaseUrl??C.webBaseUrl,...a&&no(C)}),"Failed to update profile",t.json);if(b(Xt(y),"Failed to save credentials",t.json),t.json){V({status:i,credential:B,activeOrganizationId:E.activeOrganizationId,activeProjectId:E.activeProjectId,projects:E.projects});return}if(yA(),j(i==="authorized"?"Signed in.":"Token saved."),yA(),$3A({credential:B,activeOrganizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,projects:E.projects}),E.projects.length>0){yA(),LA("Available projects");for(let w of E.projects){let N=w.id===E.activeProjectId?zA.success(" (active)"):"";yg(`${w.name} (${w.region})${N}`)}}},Y3A=async({client:A,credential:t,currentProjectId:g,approvedProjectId:i,jsonMode:n})=>{if(t.credentialType==="partner")return{projects:[]};let o=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,e=t.credentialType==="user"?t.organizations.find((h)=>h.id===o)?.name:t.organization.name,I=o?b(await A.projects.list({organizationId:o}),"Couldn't fetch projects (check your organization access and try again)",n).projects:[];return{activeOrganizationId:o,activeOrganizationName:e,activeProjectId:k3A(I,g,i),projects:I}},k3A=(A,t,g)=>{if(g===null)return;if(g!==void 0)return A.some((i)=>i.id===g)?g:void 0;if(t&&A.some((i)=>i.id===t))return t;return A[0]?.id},$3A=({credential:A,activeOrganizationName:t,activeProjectId:g,projects:i})=>{if(A.credentialType==="user"){RA({Type:"User token",User:A.user.name??A.user.email,Organizations:A.organizations.length.toString(),"Active organization":t??"(none)","Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}if(A.credentialType==="secret"){RA({Type:"Secret key",Organization:A.organization.name,"Key name":A.keyName,"Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}RA({Type:"Partner key",Superorganization:A.superorganization.name})},$O=(A,t)=>{return Yi({cliFlag:t,globalUrl:A.apiBaseUrl,globalDomain:A.apiDomain,buildUrlFromDomain:(g)=>`https://api.${g}`,defaultUrl:"https://api.sazabi.com"})},PEA=(A,t)=>{if(t)return t;try{let g=new URL(A);if(["localhost","127.0.0.1"].includes(g.hostname)&&["15005","15009"].includes(g.port))return g.port="15001",g.toString().replace(/\/$/,"");if(g.hostname==="api.sazabi.com")return g.hostname="api.platform.sazabi.com",g.toString().replace(/\/$/,"");if(g.hostname==="api.staging.sazabi.dev")return g.hostname="api.platform.staging.sazabi.dev",g.toString().replace(/\/$/,"");return g.toString().replace(/\/$/,"")}catch{return A}},REA=(A)=>A.replace(/\/+$/,""),hn=(A)=>(A?.trim().length??0)>0,G3A=(A)=>{if(!hn(A))return;try{let t=new URL(A);return`${t.protocol}//${t.host}`}catch{return}},fB=(A)=>{if(!hn(A))return;try{let g=new URL(A).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(g))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(g))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(g))return"https://app.sazabi.com"}catch{return}return},T3A=(A)=>{if(hn(A.webBaseUrl))return REA(A.webBaseUrl);if(hn(A.webDomain))return Zb(A.webDomain);return},J3A=({profile:A,publicApiBaseUrl:t})=>{if(!(hn(A.authBaseUrl)||hn(A.apiBaseUrl)||hn(A.apiDomain)))return;if(hn(A.authBaseUrl)){let i=fB(A.authBaseUrl);if(i)return i}return fB(t)},fEA=({profile:A,publicApiBaseUrl:t,authBaseUrl:g,apiBaseUrlOverride:i,authBaseUrlOverride:n,webBaseUrlOverride:o,verificationUriComplete:e})=>{if(hn(o))return REA(o);let I=process.env.SAZABI_API_URL?.trim(),h=hn(n)||hn(i)||hn(I),B=G3A(e);if(h){let E=hn(n)?fB(g):fB(t);if(E)return E;if(B)return B}let c=T3A(A);if(c)return c;let C=J3A({profile:A,publicApiBaseUrl:t});if(C)return C;if(B)return B;return"https://app.sazabi.com"},P3A=(A,t)=>{if(!t)return A;try{let g=new URL(A),i=new URL(t);return g.protocol=i.protocol,g.host=i.host,g.toString()}catch{return A}},OEA=nA("auth","Manage authentication credentials").withSubcommands({signup:U("signup","Create a new Sazabi account via browser",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await L3A({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth signup # Create a new account via browser"]).build(),login:U("login","Authenticate via browser",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await F3A({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth login # Authenticate via browser"]).build(),save:U("save","Save an existing bearer token",async(A)=>{let{values:t,positionals:g}=L(A,{...z,"web-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return u("Token is required.");return D("Token is required.")}if(g.length>1){let n=g.slice(1).join(", ");if(t.json)return u(`Unexpected arguments: ${n}.`);return D(`Unexpected arguments: ${n}.`)}await S3A(i,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({...R,"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth save sazabi_secret_xxx # Save a secret key for future commands"]).build(),logout:U("logout","Remove saved credentials",async(A)=>{let{values:t,positionals:g}=L(A,z,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}M3A({json:t.json})}).withOptions(R).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:U("whoami","Display current authentication context",async(A)=>{let{values:t,positionals:g}=L(A,z,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return u(`Unexpected arguments: ${i}.`);return D(`Unexpected arguments: ${i}.`)}await U3A({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(R).withExamples(["sazabi auth whoami # Show current context","sazabi auth whoami --json # Output as JSON"]).build()}).withExamples(["sazabi auth signup # Create a new account via browser","sazabi auth login # Authenticate via browser","sazabi auth save sazabi_secret_xxx # Save an existing token","sazabi auth logout # Remove saved credentials","sazabi auth whoami # Show current context"]).build();oA();bA();CA();var Ia=(A)=>({id:A.id,name:A.name,status:A.enabled?"active":"paused",source:A.source,kind:A.kind,health:A.health,cronExpression:A.cronExpression,timezone:A.timezone,timeoutSeconds:A.timeoutSeconds,successRate:A.successRate,runCount:A.runCount,failedRunCount:A.failedRunCount,lastRunStatus:A.lastRun?.status??null,lastRunAt:A.lastRun?.startedAt??null,scriptIdentifier:"scriptIdentifier"in A?A.scriptIdentifier:null,scriptId:"scriptId"in A?A.scriptId:null,scriptName:"scriptName"in A?A.scriptName:null,canToggle:"canToggle"in A?A.canToggle:null,createdAt:"createdAt"in A?A.createdAt:null,updatedAt:"updatedAt"in A?A.updatedAt:null}),vEA={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"nullable-string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"custom",render:(A)=>A==="active"?"Enabled":"Disabled",serialize:(A)=>A}},source:{label:"Source",type:{kind:"string"}},kind:{label:"Kind",type:{kind:"string"}},health:{label:"Health",type:{kind:"string"}},cronExpression:{label:"Cron",type:{kind:"nullable-string",emptyLabel:"(n/a)"}},timezone:{label:"Timezone",type:{kind:"string"}},timeoutSeconds:{label:"Timeout (s)",type:{kind:"custom",render:(A)=>A==null?"(none)":String(A),serialize:(A)=>A}},successRate:{label:"Success rate",type:{kind:"custom",render:(A)=>A==null?"(n/a)":`${Math.round(Number(A)*100)}%`,serialize:(A)=>A}},runCount:{label:"Runs (7d)",type:{kind:"number"}},failedRunCount:{label:"Failures (7d)",type:{kind:"number"}},lastRunStatus:{label:"Last run status",type:{kind:"nullable-string",emptyLabel:"(never)"}},lastRunAt:{label:"Last run",type:{kind:"nullable-date",emptyLabel:"(never)"}},scriptIdentifier:{label:"Script",type:{kind:"nullable-string"}},scriptId:{label:"Script ID",type:{kind:"nullable-string"}},scriptName:{label:"Script name",type:{kind:"nullable-string"}},canToggle:{label:"Can toggle",type:{kind:"custom",render:(A)=>A==null?"(n/a)":A?"yes":"no",serialize:(A)=>A}},createdAt:{label:"Created at",type:{kind:"nullable-date"}},updatedAt:{label:"Updated at",type:{kind:"nullable-date"}}},R3A={schema:vEA,columns:["name","status","health","cronExpression","lastRunAt"],jsonFields:["id","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt"],header:"Automations",emptyMessage:"No automations found."},Xb={layout:"field-list",schema:vEA,fields:["id","url","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt","scriptIdentifier","scriptId","scriptName","canToggle","createdAt","updatedAt"],title:"Automation"},mEA=(A)=>({id:A.id,automationRunKey:A.automationRunKey,status:A.status,scheduledAt:A.scheduledAt,dueAt:A.dueAt,startedAt:A.startedAt,completedAt:A.completedAt,durationMs:A.durationMs,exitCode:A.exitCode,errorMessage:A.errorMessage,automationId:"automationId"in A?A.automationId:null}),WEA={id:{label:"ID",type:{kind:"id"}},automationId:{label:"Automation",type:{kind:"nullable-string"}},automationRunKey:{label:"Run key",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},scheduledAt:{label:"Scheduled at",type:{kind:"nullable-date"}},dueAt:{label:"Due at",type:{kind:"nullable-date"}},startedAt:{label:"Started at",type:{kind:"date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},errorMessage:{label:"Error",type:{kind:"nullable-string",emptyLabel:"(none)"}}},f3A={schema:WEA,columns:["status","startedAt","durationMs","exitCode"],jsonFields:["id","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],header:"Automation runs",emptyMessage:"No automation runs found."},O3A={layout:"field-list",schema:WEA,fields:["id","automationId","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],title:"Automation run"},z3A=(A)=>({status:A.status,exitCode:A.exitCode,truncated:A.truncated,durationMs:A.durationMs,startedAt:A.startedAt,completedAt:A.completedAt,stdout:A.stdout,stderr:A.stderr}),v3A={status:{label:"Status",type:{kind:"string"}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},truncated:{label:"Truncated",type:{kind:"custom",render:(A)=>A?"yes":"no",serialize:(A)=>A}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},startedAt:{label:"Started at",type:{kind:"nullable-date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},stdout:{label:"Stdout",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}},stderr:{label:"Stderr",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}}},m3A={layout:"field-list",schema:v3A,fields:["status","exitCode","truncated","durationMs","startedAt","completedAt","stdout","stderr"],title:"Automation run logs"},Ce=(A)=>{let t=f({tokenFlag:A.token,projectIdFlag:A.projectId,jsonMode:A.json});return{client:O({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),projectId:t.projectId}},jb=(A,t)=>t?{...A,url:rEA(t,A.id)}:A,W3A=async(A)=>{let{client:t}=Ce(A),g=b(await t.automations.list({search:A.search,status:A.status,source:A.source,health:A.health,sort:A.sort,limit:A.limit,cursor:A.cursor}),"Couldn't list automations (check the active project and try again)",A.json);x(R3A,g.automations.map(Ia),{json:A.json,nextCursor:g.nextCursor})},Z3A=async(A,t)=>{let{client:g,projectId:i}=Ce(t),n=b(await g.automations.get(A),"Couldn't get automation (run 'sazabi automations list' to see automation IDs)",t.json);W(Xb,jb(Ia(n.automation),i),{json:t.json})},V3A=async(A,t)=>{let g=t.scriptId!==void 0,i=t.script!==void 0,n=t.expressionId!==void 0,o=Number(g)+Number(i)+Number(n),e=(c)=>{if(t.json){u(c);return}D(c)};if(o!==1){e("Provide exactly one of --script-id, --script, or --expression-id.");return}if(n){if(t.cronExpression!==void 0||t.timezone!==void 0||t.timeoutSeconds!==void 0){e("Cron and timeout flags are not used with --expression-id log-match automations.");return}if(!t.description?.trim()){e("--description is required for log-match automations (investigation instructions).");return}}let{client:I,projectId:h}=Ce(t),B=b(await I.automations.create({name:A,...t.description!==void 0?{description:t.description}:{},...t.scriptId!==void 0?{scriptId:t.scriptId}:{},...t.script!==void 0?{script:t.script}:{},...t.expressionId!==void 0?{expressionId:t.expressionId}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{},...t.enabled!==void 0?{enabled:t.enabled}:{}}),n?"Couldn't create log-match automation (check the expression ID and description)":"Couldn't create automation (check the script name/ID and try again)",t.json);if(!t.json)j(`Automation "${B.automation.name}" created.`);W(Xb,jb(Ia(B.automation),h),{json:t.json})},H3A=async(A,t)=>{if(t.name===void 0&&t.description===void 0&&t.clearDescription!==!0&&t.cronExpression===void 0&&t.timezone===void 0&&t.timeoutSeconds===void 0){if(t.json){u("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}D("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}if(t.description!==void 0&&t.clearDescription===!0){if(t.json){u("Use either --description or --clear-description, not both.");return}D("Use either --description or --clear-description, not both.");return}let{client:g,projectId:i}=Ce(t),n=b(await g.automations.update({automationId:A,...t.name!==void 0?{name:t.name}:{},...t.clearDescription?{description:null}:t.description!==void 0?{description:t.description}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{}}),"Couldn't update automation (run 'sazabi automations list' to see automation IDs)",t.json);if(!t.json)j(`Automation "${n.automation.name}" updated.`);W(Xb,jb(Ia(n.automation),i),{json:t.json})},ZEA=async(A,t,g)=>{let{client:i,projectId:n}=Ce(g),o=b(t?await i.automations.enable(A):await i.automations.disable(A),t?"Failed to enable automation":"Failed to disable automation",g.json),e=jb(Ia(o.automation),n);if(!g.json)j(`Automation "${e.name}" is now ${t?"enabled":"disabled"}.`);W(Xb,e,{json:g.json})},X3A=async(A,t)=>ZEA(A,!0,t),j3A=async(A,t)=>ZEA(A,!1,t),K3A=async(A,t)=>{let{client:g}=Ce(t),i=b(await g.automations.runs.list(A,{status:t.status,limit:t.limit,cursor:t.cursor}),"Couldn't list automation runs (run 'sazabi automations list' to see automation IDs)",t.json);x(f3A,i.runs.map(mEA),{json:t.json,nextCursor:i.nextCursor})},_3A=async(A,t,g)=>{let{client:i}=Ce(g),n=b(await i.automations.runs.get(A,t),"Couldn't get automation run (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);W(O3A,mEA(n.run),{json:g.json})},x3A=async(A,t,g)=>{let{client:i}=Ce(g),n=b(await i.automations.runs.logs(A,t),"Couldn't get automation run logs (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);W(m3A,z3A(n.logs),{json:g.json})},io={...z,"project-id":{type:"string"}},oo={...R,"project-id":{type:"string",description:"Override active project ID"}},s3A=(A,t)=>{let g=A[0];if(!g){if(t){u("Automation name is required.");return}D("Automation name is required.");return}return g},fQ=(A,t)=>{let g=A[0];if(!g){if(t){u("Automation ID is required.");return}D("Automation ID is required.");return}return g},zEA=(A,t)=>{let g=A[1];if(!g){if(t){u("Run ID is required.");return}D("Run ID is required.");return}return g},VEA=nA("automations","Manage scheduled automations").withSubcommands({list:U("list","List automations in the active project",async(A)=>{let{values:t}=L(A,{...io,search:{type:"string"},status:{type:"string"},source:{type:"string"},health:{type:"string"},sort:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),g=(c)=>{if(t.json){u(c);return}D(c)},i=t.status;if(i!==void 0&&i!=="active"&&i!=="paused")return g(`Invalid --status value "${i}". Expected "active" or "paused".`);let n=t.source;if(n!==void 0&&n!=="sazabi_managed"&&n!=="custom")return g(`Invalid --source value "${n}". Expected "sazabi_managed" or "custom".`);let o=t.health,e=["healthy","failing","never_run"];if(o!==void 0&&!e.includes(o))return g(`Invalid --health value "${o}". Expected one of: ${e.join(", ")}.`);let I=t.sort,h=["name","last_run","failures","runs"];if(I!==void 0&&!h.includes(I))return g(`Invalid --sort value "${I}". Expected one of: ${h.join(", ")}.`);let B;if(t.limit!==void 0){if(B=Number(t.limit),!Number.isInteger(B)||B<1||B>100)return g(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await W3A({token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],search:t.search,status:i,source:n,health:o,sort:I,limit:B,cursor:t.cursor})}).withOptions({...oo,search:{type:"string",description:"Filter by automation name (case-insensitive)"},status:{type:"string",description:"Filter by status: active or paused"},source:{type:"string",description:"Filter by source: sazabi_managed or custom"},health:{type:"string",description:"Filter by health: healthy, failing, or never_run"},sort:{type:"string",description:"Sort by: name, last_run, failures, or runs"},limit:{type:"string",description:"Maximum number of automations to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations list # List all automations","sazabi automations list --status paused # List paused automations"]).build(),get:U("get","Get one automation by ID",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await Z3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations get <automation-id> # Get one automation"]).build(),create:U("create","Create an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,description:{type:"string"},"script-id":{type:"string"},script:{type:"string"},"expression-id":{type:"string"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"},enabled:{type:"boolean"}},{allowPositionals:!0}),i=s3A(g,t.json);if(!i)return;let n=(e)=>{if(t.json){u(e);return}D(e)},o;if(t["timeout-seconds"]!==void 0){if(o=Number(t["timeout-seconds"]),!Number.isInteger(o)||o<1||o>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await V3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],description:t.description,scriptId:t["script-id"],script:t.script,expressionId:t["expression-id"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:o,enabled:t.enabled})}).withPositionalArgs("<name>").withOptions({...oo,description:{type:"string",description:"Human-readable description (required for log-match automations)"},"script-id":{type:"string",description:"Project script ID to run (cron automations)"},script:{type:"string",description:"Project script name to run (cron automations)"},"expression-id":{type:"string",description:"Log-match expression ID to bind (creates a log-match investigation automation)"},"cron-expression":{type:"string",description:"Cron schedule expression"},timezone:{type:"string",description:"IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"Run timeout in seconds (1-3600)"},enabled:{type:"boolean",description:"Create the automation enabled"}}).withExamples(["sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations create deploy-nightly --script-id <script-id> # Create by script ID",'sazabi automations create "Investigate Plain tickets" --expression-id <uuid> --description "When a new Plain ticket is created, investigate …" # Create a log-match investigation automation']).build(),update:U("update","Update an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,name:{type:"string"},description:{type:"string"},"clear-description":{type:"boolean"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"}},{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=(e)=>{if(t.json){u(e);return}D(e)},o;if(t["timeout-seconds"]!==void 0){if(o=Number(t["timeout-seconds"]),!Number.isInteger(o)||o<1||o>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await H3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,clearDescription:t["clear-description"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:o})}).withPositionalArgs("<automation-id>").withOptions({...oo,name:{type:"string",description:"New automation name"},description:{type:"string",description:"New human-readable description"},"clear-description":{type:"boolean",description:"Clear the automation description"},"cron-expression":{type:"string",description:"New cron schedule expression"},timezone:{type:"string",description:"New IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"New run timeout in seconds (1-3600)"}}).withExamples(["sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule"]).build(),enable:U("enable","Enable an automation",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await X3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations enable <automation-id> # Enable an automation"]).build(),disable:U("disable","Disable an automation",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;await j3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(oo).withExamples(["sazabi automations disable <automation-id> # Disable an automation"]).build(),runs:U("runs","Inspect automation runs").withSubcommands({list:U("list","List runs for an automation",async(A)=>{let{values:t,positionals:g}=L(A,{...io,status:{type:"string"},limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=(h)=>{if(t.json){u(h);return}D(h)},o=t.status,e=["running","succeeded","failed","timed_out","cancelled"];if(o!==void 0&&!e.includes(o))return n(`Invalid --status value "${o}". Expected one of: ${e.join(", ")}.`);let I;if(t.limit!==void 0){if(I=Number(t.limit),!Number.isInteger(I)||I<1||I>100)return n(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await K3A(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],status:o,limit:I,cursor:t.cursor})}).withPositionalArgs("<automation-id>").withOptions({...oo,status:{type:"string",description:"Filter by run status: running, succeeded, failed, timed_out, or cancelled"},limit:{type:"string",description:"Maximum number of runs to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs list <automation-id> --status failed # List failed runs"]).build(),get:U("get","Get one automation run by ID",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=zEA(g,t.json);if(!n)return;await _3A(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(oo).withExamples(["sazabi automations runs get <automation-id> <run-id> # Get one automation run"]).build(),logs:U("logs","Get the captured logs for an automation run",async(A)=>{let{values:t,positionals:g}=L(A,io,{allowPositionals:!0}),i=fQ(g,t.json);if(!i)return;let n=zEA(g,t.json);if(!n)return;await x3A(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(oo).withExamples(["sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations list # List all automations","sazabi automations get <automation-id> # Get one automation","sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule","sazabi automations enable <automation-id> # Enable an automation","sazabi automations disable <automation-id> # Disable an automation","sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build();oA();bA();import{spawn as q3A}from"node:child_process";var eo=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=q3A(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},ki=(A)=>new Promise((t)=>setTimeout(t,A));import{randomUUID as d3A}from"node:crypto";import Kb from"node:fs";import p3A from"node:os";import HEA from"node:path";var XEA=()=>HEA.join(p3A.homedir(),".sazabi","pending-purchases"),A7A=()=>{Kb.mkdirSync(XEA(),{recursive:!0,mode:448})},jEA=(A)=>HEA.join(XEA(),`${encodeURIComponent(A)}.json`),t7A=(A)=>{for(let t=0;t<50;t+=1){let g;try{g=Kb.readFileSync(A,"utf-8")}catch(n){if(n.code==="ENOENT")return null;throw n}if(g.trim().length>0)try{let n=JSON.parse(g);if(n?.idempotencyKey&&n.organizationId&&n.amount)return n}catch{}let i=Date.now()+2;while(Date.now()<i);}return null},KEA=({organizationId:A,amount:t,explicitIdempotencyKey:g})=>{A7A();let i=jEA(A);for(let n=0;n<100;n+=1){let o={idempotencyKey:g??d3A(),organizationId:A,amount:t,createdAt:new Date().toISOString()};try{return Kb.writeFileSync(i,JSON.stringify(o,null,2),{encoding:"utf-8",mode:384,flag:"wx"}),{kind:"reserved",entry:o}}catch(I){if(I.code!=="EEXIST")throw I}let e=t7A(i);if(!e)continue;if(e.amount!==t)return{kind:"conflict",existing:e,reason:`A pending purchase for ${e.amount} is unresolved. Resolve it before purchasing a different amount.`};if(g&&g!==e.idempotencyKey)return{kind:"conflict",existing:e,reason:"A pending purchase with a different idempotency key is unresolved. Resolve it first."};return{kind:"resumed",entry:e}}throw Error("Could not reserve a pending purchase after repeated attempts.")},GO=(A)=>{try{Kb.unlinkSync(jEA(A))}catch(t){if(t.code!=="ENOENT")throw t}};import{createInterface as _EA}from"node:readline";var TO=()=>Boolean(process.stdin.isTTY)&&Boolean(process.stdout.isTTY),xEA=async(A)=>{let t=_EA({input:process.stdin,output:process.stdout});try{let i=(await new Promise((n)=>{t.question(`${A} [y/N] `,n)})).trim().toLowerCase();return i==="y"||i==="yes"}finally{t.close()}},sEA=async(A)=>{let t=_EA({input:process.stdin,output:process.stdout});try{await new Promise((g)=>{t.question(`${A} `,()=>g())})}finally{t.close()}};CA();var Tn=(A)=>{let t=A.json,g=f({tokenFlag:A.token,jsonMode:t});return{client:O({token:g.token,organizationId:g.organizationId,projectId:g.projectId,apiBaseUrlFlag:A["api-base-url"],jsonMode:t}),json:t??!1,credentials:g}},dEA=async({yes:A,json:t,prompt:g})=>{if(A)return!0;if(!TO()){if(t)u("Refusing to run this in a non-interactive shell without --yes.");else D("Refusing to run this in a non-interactive shell without --yes.");return!1}return xEA(g)},pEA=(A)=>A.statusCode===void 0||A.statusCode===408||A.statusCode===425||A.statusCode===429||A.statusCode>=500,AaA=(A,t,g)=>{let i=`${t}: ${A.error}`;if(g){u(A.errorPayload??i);return}D(i)},g7A={plan:{label:"Plan",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},currency:{label:"Currency",type:{kind:"string"}},balance:{label:"Current balance",type:{kind:"string"}},targetBalance:{label:"Target balance",type:{kind:"string"}},cycle:{label:"Cycle",type:{kind:"string"}},estimate:{label:"Est. total",type:{kind:"string"}},pendingDowngrade:{label:"Pending downgrade",type:{kind:"string"}},collection:{label:"Outstanding balance",type:{kind:"string"}}},n7A={layout:"field-list",schema:g7A,fields:["plan","status","currency","balance","targetBalance","cycle","estimate","pendingDowngrade","collection"]},i7A=(A)=>({plan:A.planName??"—",status:A.status,currency:A.currency??"—",balance:A.currentBalance??"—",targetBalance:A.targetCreditBalance??"—",cycle:A.currentCycle?`${A.currentCycle.startsAt.slice(0,10)} - ${A.currentCycle.endsAt.slice(0,10)}`:"—",estimate:A.currentPeriodEstimate?`${A.currentPeriodEstimate.totalAmount} ${A.currentPeriodEstimate.currency}`:"—",pendingDowngrade:A.pendingDowngrade?`${A.pendingDowngrade.planName??"—"} (effective ${A.pendingDowngrade.effectiveAt.slice(0,10)})`:"—",collection:o7A(A.collection)}),o7A=(A)=>{if(A.status==="current")return"None";let t=A.outstandingAmount!==null&&A.currency!==null?`${A.outstandingAmount} ${A.currency}`:`${A.outstandingCredits??"—"} credits`;if(A.status==="delinquent")return`${t} owed — delinquent, log intake paused until paid`;let g=A.nextRetryAt?`next retry ${A.nextRetryAt.slice(0,10)}`:"retry pending";return`${t} owed — payment retrying (${g})`},e7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getSummary(),"Couldn't fetch billing summary (check your organization access and try again)",i);if(!i){if(LA("Billing summary"),!n.billable&&n.nonBillableReason)RA({"Not billable":n.nonBillableReason})}W(n7A,i7A(n),{json:i})},Q7A={logs_ingested_bytes:"Log data (GB)",logs_accepted_bytes:"Log data (GB)",input_tokens:"Input tokens",output_tokens:"Output tokens"},I7A=(A)=>{let t=Number.parseFloat(A);if(Number.isNaN(t))return A;return(t/1e9).toFixed(3)},h7A=(A,t)=>{if(t==="logs_ingested_bytes"||t==="logs_accepted_bytes")return I7A(A);let g=Number.parseInt(A,10);return Number.isNaN(g)?A:g.toLocaleString()},B7A={dimension:{label:"Dimension",type:{kind:"string"}},total:{label:"Total quantity",type:{kind:"string"}},credits:{label:"Credits consumed",type:{kind:"string"}}},c7A={schema:B7A,columns:["dimension","total","credits"],emptyMessage:"No usage recorded for this billing cycle."},C7A=async(A)=>{let{values:t}=L(A,{...z,cycle:{type:"string"}}),{client:g,json:i}=Tn(t);if(t.cycle&&t.cycle!=="current"&&t.cycle!=="previous"){if(i)return u("--cycle must be 'current' or 'previous'.");D("--cycle must be 'current' or 'previous'.");return}let n=t.cycle??"current",o=b(await g.billing.getUsage({cycle:n}),"Couldn't fetch billing usage (check your organization access and try again)",i);if(!i){if(LA(`Billing usage (${n} cycle)`),o.cycle)RA({Cycle:`${o.cycle.startsAt.slice(0,10)} - ${o.cycle.endsAt.slice(0,10)}`})}let e=new Map;for(let h of o.usage){let B=h.dimension,c=Q7A[B]??h.dimension,C=e.get(c),E=(C?.rawTotal??0)+Number.parseFloat(h.totalQuantity||"0");e.set(c,{dimension:c,rawTotal:E,total:h7A(String(E),B),credits:(Number.parseFloat(C?.credits??"0")+Number.parseFloat(h.creditsConsumed||"0")).toString()})}let I=[...e.values()].map(({rawTotal:h,...B})=>B);x(c7A,I,{json:i})},E7A={occurredAt:{label:"Date",type:{kind:"date"}},type:{label:"Type",type:{kind:"string"}},delta:{label:"Credit delta",type:{kind:"string"}},balance:{label:"Balance after",type:{kind:"string"}}},a7A={schema:E7A,columns:["occurredAt","type","delta","balance"],emptyMessage:"No billing transactions found."},r7A=async(A)=>{let{values:t}=L(A,{...z,limit:{type:"string"},page:{type:"string"}}),{client:g,json:i}=Tn(t),n,o;if(t.limit){if(n=Number.parseInt(t.limit,10),Number.isNaN(n)||n<1||n>100){if(i)return u("--limit must be a positive integer (max 100).");D("--limit must be a positive integer (max 100).");return}}if(t.page){if(o=Number.parseInt(t.page,10),Number.isNaN(o)||o<1){if(i)return u("--page must be a positive integer.");D("--page must be a positive integer.");return}}let e=b(await g.billing.listTransactions({limit:n??10,page:o??1}),"Couldn't fetch billing transactions (check your organization access and try again)",i);if(!i)LA("Billing transactions");let I=e.items.map((h)=>({occurredAt:h.occurredAt,type:h.transactionType,delta:h.creditDelta,balance:h.balanceAfter}));if(x(a7A,I,{json:i,count:e.pagination.total}),!i&&e.pagination.hasNext){let h=(o??1)+1;RA({"Next page":`Use --page ${h} for more results.`})}},y7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.retryOutstandingBalance({idempotencyKey:crypto.randomUUID()}),"Couldn't start the outstanding balance retry (check that a balance is outstanding and you can manage billing)",i);if(i){V(n);return}LA("Outstanding balance retry"),RA({Status:"Started","Workflow ID":n.workflowId,Next:"Run `sazabi billing summary` to see the outcome."})},w7A={enabled:{label:"Enabled",type:{kind:"string"}},triggerBalance:{label:"Trigger balance",type:{kind:"string"}},topUpAmount:{label:"Top-up amount",type:{kind:"string"}},cycleLimit:{label:"Cycle spending limit",type:{kind:"string"}},currency:{label:"Currency",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}}},taA={layout:"field-list",schema:w7A,fields:["enabled","triggerBalance","topUpAmount","cycleLimit","currency","status"]},gaA=(A)=>({enabled:A.enabled?"Yes":"No",triggerBalance:A.triggerCreditBalance,topUpAmount:A.topUpAmount,cycleLimit:A.cycleSpendingLimit,currency:A.currency.toUpperCase(),status:A.status}),D7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getAutoTopUp(),"Couldn't fetch auto top-up settings (check your organization access and that you can manage billing)",i);if(!i)LA("Auto top-up");W(taA,gaA(n),{json:i})},u7A=async(A)=>{let{values:t}=L(A,{...z,enable:{type:"boolean"},disable:{type:"boolean"},"trigger-balance":{type:"string"},amount:{type:"string"},"cycle-limit":{type:"string"}}),{client:g,json:i}=Tn(t);if(t.enable&&t.disable){if(i)return u("Pass either --enable or --disable, not both.");D("Pass either --enable or --disable, not both.");return}let n=b(await g.billing.getAutoTopUp(),"Couldn't load current auto top-up settings",i),o=t.enable?!0:t.disable?!1:n.enabled,e=t["trigger-balance"]??n.triggerCreditBalance,I=t.amount??n.topUpAmount,h=t["cycle-limit"]??n.cycleSpendingLimit,B=b(await g.billing.updateAutoTopUp({enabled:o,triggerCreditBalance:e,topUpAmount:I,cycleSpendingLimit:h}),"Couldn't update auto top-up settings (check the values and that you can manage billing)",i);if(!i)j(o?"Auto top-up enabled.":"Auto top-up disabled."),LA("Auto top-up");W(taA,gaA(B),{json:i})},b7A=async(A)=>{let{values:t}=L(A,{...z,amount:{type:"string"},"idempotency-key":{type:"string"},yes:{type:"boolean"}}),{client:g,json:i,credentials:n}=Tn(t),o=t.amount?.trim();if(!o){if(i)return u("--amount is required (e.g. --amount 50).");D("--amount is required (e.g. --amount 50).");return}if(!/^\d+(?:\.\d{1,2})?$/.test(o)){if(i)return u("--amount must be a dollar amount, e.g. 50 or 50.00.");D("--amount must be a dollar amount, e.g. 50 or 50.00.");return}let e=n.organizationId;if(!e){if(i)return u("No active organization. Run `sazabi organizations use <id>` first.");D("No active organization. Run `sazabi organizations use <id>` first.");return}if(!await dEA({yes:Boolean(t.yes),json:i,prompt:`Purchase ${o} of credits for this organization?`})){if(!i)iA("Cancelled.");return}let h=KEA({organizationId:e,amount:o,explicitIdempotencyKey:t["idempotency-key"]});if(h.kind==="conflict"){let E=`${h.reason} Re-run to resume it, or pass --idempotency-key to control the key.`;if(i)return u(E);D(E);return}if(h.kind==="resumed"&&!i)iA("Resolving a prior purchase attempt (idempotency key reused).");let B=h.entry.idempotencyKey,c=await g.billing.purchaseCredits({amount:o,idempotencyKey:B});if(c.success)GO(e);else if(typeof c.statusCode==="number"&&c.statusCode>=400&&c.statusCode<500)GO(e);let C=b(c,"Couldn't purchase credits (check your payment method with `sazabi billing payment-method update` and that you can manage billing)",i);if(i){V(C);return}j("Credit purchase submitted."),RA({Status:C.status,"Credits granted":C.creditsToGrant,Charged:`${C.topUpAmount} ${C.currency.toUpperCase()}`,Invoice:C.billingInvoiceId})},l7A={current:{label:"",type:{kind:"string"}},slug:{label:"Slug",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},price:{label:"Price",type:{kind:"string"}},includedCredits:{label:"Included credits",type:{kind:"string"}}},N7A={schema:l7A,columns:["current","slug","name","price","includedCredits"],emptyMessage:"No self-serve plans are available."},U7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.listPlans(),"Couldn't fetch plans (check your organization access and that you can manage billing)",i);if(i){V(n);return}LA("Plans");let o=n.plans.map((e)=>({current:e.slug===n.currentPlanSlug?"*":"",slug:e.slug,name:e.name,price:`${e.price} ${e.currency.toUpperCase()}`,includedCredits:e.targetCreditBalance??"—"}));if(x(N7A,o,{json:!1}),n.currentPlanSlug)RA({Current:`* = your current plan (${n.currentPlanSlug})`})},S7A={type:{label:"Change type",type:{kind:"string"}},effectiveAt:{label:"Effective",type:{kind:"string"}},currentPlan:{label:"Current plan",type:{kind:"string"}},targetPlan:{label:"Target plan",type:{kind:"string"}},immediateCharge:{label:"Immediate charge",type:{kind:"string"}},nextCycleCharge:{label:"Next cycle charge",type:{kind:"string"}},targetBalance:{label:"Target credit balance",type:{kind:"string"}}},naA={layout:"field-list",schema:S7A,fields:["type","effectiveAt","currentPlan","targetPlan","immediateCharge","nextCycleCharge","targetBalance"]},iaA=(A)=>({type:A.type,effectiveAt:A.effectiveAt.slice(0,10),currentPlan:`${A.currentPlanName} (${A.currentPlanPrice} ${A.currency.toUpperCase()})`,targetPlan:`${A.targetPlanName} (${A.targetPlanPrice} ${A.currency.toUpperCase()})`,immediateCharge:`${A.immediateChargeAmount} ${A.currency.toUpperCase()}`,nextCycleCharge:`${A.nextCycleChargeAmount} ${A.currency.toUpperCase()}`,targetBalance:A.targetCreditBalance}),PO=(A,t)=>{let g=A.plan?.trim();if(!g){if(t)u("--plan <slug> is required. Run `sazabi billing plans list`.");else D("--plan <slug> is required. Run `sazabi billing plans list`.");return null}return g},L7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.previewPlanChange({planSlug:n}),"Couldn't preview the plan change (check the plan slug and that you can manage billing)",i);if(!i)LA("Plan change preview");W(naA,iaA(o),{json:i})},F7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"},yes:{type:"boolean"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.previewPlanChange({planSlug:n}),"Couldn't preview the plan change (check the plan slug and that you can manage billing)",i);if(!i)LA("Plan change preview"),W(naA,iaA(o),{json:!1});if(!await dEA({yes:Boolean(t.yes),json:i,prompt:`Apply this plan change to ${n}?`})){if(!i)iA("Cancelled.");return}let I=b(await g.billing.changePlan({planSlug:n}),"Couldn't change the plan (check that you can manage billing)",i);if(i){V(I);return}j(I.type==="downgrade"?"Plan downgrade scheduled.":"Plan changed."),RA({Type:I.type,Status:I.status,Effective:I.effectiveAt.slice(0,10)})},M7A=3000,Y7A=900000,k7A=async(A)=>{let{values:t}=L(A,{...z,plan:{type:"string"}}),{client:g,json:i}=Tn(t),n=PO(t,i);if(!n)return;let o=b(await g.billing.createCheckoutSession({planSlug:n}),"Couldn't start checkout (sign in with `sazabi auth login` — secret keys can't subscribe)",i);if(!i)yA(),LA("Subscribe to Sazabi"),yA(),yg("Complete checkout in your browser:"),yA(),yg(zA.info(o.checkoutUrl)),yA();if(eo(o.checkoutUrl),!i)iA("Waiting for checkout to complete...");let e=Date.now()+Y7A;while(Date.now()<e){await ki(M7A);let h=await g.billing.getCheckoutSessionStatus({sessionId:o.sessionId});if(!h.success&&pEA(h))continue;if(!h.success){AaA(h,"Couldn't check checkout status",i);return}let B=h.value.status;if(B==="active"){if(i){V({status:"active",sessionId:o.sessionId});return}yA(),j("Subscription active."),RA({Next:"Run `sazabi billing summary` to see your plan, or `sazabi billing auto-top-up set` to enable auto top-up."});return}if(B==="expired"){let c=`Checkout ${B}. Run \`sazabi billing setup --plan ${n}\` to try again.`;if(i)return u(c);yA(),D(c);return}}let I="Checkout timed out. If you completed payment, run `sazabi billing summary` to confirm.";if(i)return u(I);yA(),D(I)},qEA=3000,$7A=300000,JO=(A)=>`${A.hasPaymentMethod}:${A.brand??""}:${A.last4??""}`,G7A=async(A)=>{let{values:t}=L(A,z),{client:g,json:i}=Tn(t),n=b(await g.billing.getPaymentMethod(),"Couldn't read the current payment method",i),o=b(await g.billing.createPortalSession(),"Couldn't open the billing portal (sign in with `sazabi auth login` — secret keys can't manage billing)",i);if(!i)yA(),LA("Update payment method"),yA(),yg("Update your payment method in the browser:"),yA(),yg(zA.info(o.portalUrl)),yA();if(eo(o.portalUrl),TO())await sEA("Press Enter when you've finished updating your payment method in the browser...");let e=JO(n),I=Date.now()+$7A,h=n;while(Date.now()<I){let B=await g.billing.getPaymentMethod();if(!B.success&&pEA(B)){await ki(qEA);continue}if(!B.success){AaA(B,"Couldn't refresh the payment method",i);return}if(h=B.value,JO(h)!==e)break;await ki(qEA)}if(i){V(h);return}if(JO(h)!==e)j("Payment method updated."),RA({"Payment method":h.display??"on file"});else iA("No change detected. If you replaced your card with one of the same brand and last 4 digits, this is expected.")},T7A=U("summary","Show the billing summary for your organization",async(A)=>{await e7A(A)}).withOptions(R).withExamples(["sazabi billing summary # Show billing summary","sazabi billing summary --json # Output as JSON"]).build(),J7A=U("usage","Show per-dimension usage for the current or previous cycle",async(A)=>{await C7A(A)}).withOptions({...R,cycle:{type:"string",description:"Which cycle to report (current or previous)"}}).withExamples(["sazabi billing usage # Current cycle usage","sazabi billing usage --cycle previous # Previous cycle usage","sazabi billing usage --json # Output as JSON"]).build(),P7A=U("transactions","List recent credit ledger transactions",async(A)=>{await r7A(A)}).withOptions({...R,limit:{type:"string",description:"Max results per page (default 10, max 100)"},page:{type:"string",description:"Page number (1-indexed)"}}).withExamples(["sazabi billing transactions # Recent transactions","sazabi billing transactions --limit 50 # More results","sazabi billing transactions --page 2 # Next page","sazabi billing transactions --json # Output as JSON"]).build(),R7A=U("retry-outstanding-balance","Retry payment of an outstanding negative balance with the saved payment method",async(A)=>{await y7A(A)}).withOptions(R).withExamples(["sazabi billing retry-outstanding-balance # Retry the outstanding balance now","sazabi billing retry-outstanding-balance --json # Output as JSON"]).build(),f7A=U("auto-top-up","View or configure credit auto top-up").withSubcommands({get:U("get","Show the current auto top-up settings",async(A)=>{await D7A(A)}).withOptions(R).withExamples(["sazabi billing auto-top-up get # Show current auto top-up settings"]).build(),set:U("set","Enable/disable and configure auto top-up",async(A)=>{await u7A(A)}).withOptions({...R,enable:{type:"boolean",description:"Enable auto top-up"},disable:{type:"boolean",description:"Disable auto top-up"},"trigger-balance":{type:"string",description:"Credit balance that triggers a top-up"},amount:{type:"string",description:"Amount of credits to add per top-up"},"cycle-limit":{type:"string",description:"Maximum auto top-up spend per cycle"}}).withExamples(["sazabi billing auto-top-up set --enable --trigger-balance 10 --amount 50 --cycle-limit 200 # Enable auto top-up","sazabi billing auto-top-up set --disable # Turn auto top-up off"]).build()}).build(),O7A=U("credits","Purchase credits").withSubcommands({purchase:U("purchase","Buy a one-time amount of credits with the saved payment method",async(A)=>{await b7A(A)}).withOptions({...R,amount:{type:"string",description:"Dollar amount of credits to purchase (e.g. 50)"},"idempotency-key":{type:"string",description:"Explicit idempotency key (advanced; auto-generated otherwise)"},yes:{type:"boolean",description:"Skip the confirmation prompt"}}).withExamples(["sazabi billing credits purchase --amount 50 # Buy $50 of credits (prompts to confirm)","sazabi billing credits purchase --amount 50 --yes # Buy without a prompt"]).build()}).build(),z7A=U("plans","List available plans").withSubcommands({list:U("list","List the self-serve plans available for checkout",async(A)=>{await U7A(A)}).withOptions(R).withExamples(["sazabi billing plans list # List plans available for checkout"]).build()}).build(),v7A=U("plan","Preview or change your plan").withSubcommands({preview:U("preview","Preview the cost of changing to a plan",async(A)=>{await L7A(A)}).withOptions({...R,plan:{type:"string",description:"Target plan slug (see `sazabi billing plans list`)"}}).withExamples(["sazabi billing plan preview --plan team-v1 # See the cost of switching to team-v1"]).build(),change:U("change","Change to a plan (upgrade applies now; downgrade schedules)",async(A)=>{await F7A(A)}).withOptions({...R,plan:{type:"string",description:"Target plan slug (see `sazabi billing plans list`)"},yes:{type:"boolean",description:"Skip the confirmation prompt"}}).withExamples(["sazabi billing plan change --plan team-v1 # Change plan (shows preview, prompts to confirm)","sazabi billing plan change --plan team-v1 --yes # Change plan without a prompt"]).build()}).build(),m7A=U("setup","Subscribe from the terminal (opens a browser for checkout)",async(A)=>{await k7A(A)}).withOptions({...R,plan:{type:"string",description:"Plan slug to subscribe to (see `sazabi billing plans list`)"}}).withExamples(["sazabi billing setup --plan team-v1 # Subscribe via browser checkout"]).build(),W7A=U("payment-method","Manage your saved payment method").withSubcommands({update:U("update","Update your payment method (opens the Stripe Customer Portal)",async(A)=>{await G7A(A)}).withOptions(R).withExamples(["sazabi billing payment-method update # Update your card via the Stripe portal"]).build()}).build(),oaA=nA("billing","View and manage billing — usage, plans, credits, and subscribe").withSubcommands({summary:T7A,usage:J7A,transactions:P7A,"retry-outstanding-balance":R7A,"auto-top-up":f7A,credits:O7A,plans:z7A,plan:v7A,setup:m7A,"payment-method":W7A}).withExamples(["sazabi billing summary # Show billing plan and balance","sazabi billing setup --plan team-v1 # Subscribe from the terminal","sazabi billing credits purchase --amount 50 # Buy credits","sazabi billing auto-top-up set --enable --trigger-balance 10 --amount 50 --cycle-limit 200 # Enable auto top-up"]).build();oA();var eaA=()=>`
8711
8711
  _sazabi() {
8712
8712
  local -a completions
8713
8713
  local line IFS=$'\\n'