@sazabi/cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +330 -213
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var dT=Object.create;var{getPrototypeOf:bT,defineProperty:ic,getOwnPropertyNames:yT}=Object;var mT=Object.prototype.hasOwnProperty;function pT(e){return this[e]}var vT,IT,go=(e,t,o)=>{var n=e!=null&&typeof e==="object";if(n){var r=t?vT??=new WeakMap:IT??=new WeakMap,i=r.get(e);if(i)return i}o=e!=null?dT(bT(e)):{};let a=t||!e||!e.__esModule?ic(o,"default",{value:e,enumerable:!0}):o;for(let c of yT(e))if(!mT.call(a,c))ic(a,c,{get:pT.bind(e,c),enumerable:!0});if(n)r.set(e,a);return a};var fT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var kT=(e)=>e;function $T(e,t){this[e]=kT.bind(null,t)}var Qe=(e,t)=>{for(var o in t)ic(e,o,{get:t[o],enumerable:!0,configurable:!0,set:$T.bind(t,o)})};var d=(e,t)=>()=>(e&&(t=e(e=0)),t);var ir=fT((l4,ac)=>{var _n=process||{},Qy=_n.argv||[],wn=_n.env||{},wT=!(!!wn.NO_COLOR||Qy.includes("--no-color"))&&(!!wn.FORCE_COLOR||Qy.includes("--color")||_n.platform==="win32"||(_n.stdout||{}).isTTY&&wn.TERM!=="dumb"||!!wn.CI),_T=(e,t,o=e)=>(n)=>{let r=""+n,i=r.indexOf(t,e.length);return~i?e+OT(r,t,o,i)+t:e+r+t},OT=(e,t,o,n)=>{let r="",i=0;do r+=e.substring(i,n)+o,i=n+t.length,n=e.indexOf(t,i);while(~n);return r+e.substring(i)},em=(e=wT)=>{let t=e?_T:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};ac.exports=em();ac.exports.createColors=em});var tm=()=>{};var rm,we=(e)=>{return rm.default.bold(e)};var cc=d(()=>{rm=go(ir(),1)});var lc=(e,t=!1)=>{let o=Object.entries(e);if(o.length===0&&!t)return"";let n=t?[["help",{type:"boolean",short:"h",description:"Show help for this command"}],...o]:o,r=Math.max(...n.map(([a,c])=>{return`${c.short?`-${c.short}, `:""}--${a}`.length})),i=n.map(([a,c])=>{let h=`${c.short?`-${c.short}, `:""}--${a}`,s=c.description.includes("(required)"),g=c.required&&!s?" (required)":"";return` ${h.padEnd(r)} ${c.description}${g}`});return`
|
|
3
3
|
|
|
4
4
|
${we("OPTIONS")}
|
|
5
5
|
${i.join(`
|
|
@@ -7,9 +7,9 @@ ${i.join(`
|
|
|
7
7
|
|
|
8
8
|
${we("EXAMPLES")}
|
|
9
9
|
${n.join(`
|
|
10
|
-
`)}`},om=(e,t=2)=>{let o=Object.entries(e);if(o.length===0)return"";let n=Math.max(...o.map(([g])=>g.length)),r=o.flatMap(([,g])=>g.subcommands?Object.keys(g.subcommands):[]),i=r.length>0?Math.max(...r.map((g)=>g.length)):0,a=Math.max(t+n+2,t+2+i+2),c=" ".repeat(t),u=a-t-2,h=a-t-2-2,
|
|
11
|
-
${c}${g.padEnd(u)} ${b.description}`,b.subcommands&&Object.keys(b.subcommands).length>0)for(let[y,_]of Object.entries(b.subcommands))
|
|
12
|
-
${c} ${y.padEnd(h)} ${_.description}`;return
|
|
10
|
+
`)}`},om=(e,t=2)=>{let o=Object.entries(e);if(o.length===0)return"";let n=Math.max(...o.map(([g])=>g.length)),r=o.flatMap(([,g])=>g.subcommands?Object.keys(g.subcommands):[]),i=r.length>0?Math.max(...r.map((g)=>g.length)):0,a=Math.max(t+n+2,t+2+i+2),c=" ".repeat(t),u=a-t-2,h=a-t-2-2,s="";for(let[g,b]of o)if(s+=`
|
|
11
|
+
${c}${g.padEnd(u)} ${b.description}`,b.subcommands&&Object.keys(b.subcommands).length>0)for(let[y,_]of Object.entries(b.subcommands))s+=`
|
|
12
|
+
${c} ${y.padEnd(h)} ${_.description}`;return s},uc=(e)=>{return{renderSubcommandHelp:(i,a)=>{let c=a.positionalArgs?` ${a.positionalArgs}`:"",u=`${e} ${i} ${a.name}${c}`,h=`
|
|
13
13
|
${we(`${e} ${i} ${a.name}`)} - ${a.description}
|
|
14
14
|
`;if(h+=`
|
|
15
15
|
${we("USAGE")}
|
|
@@ -39,17 +39,17 @@ ${we(a.title)} - ${a.description}
|
|
|
39
39
|
${we("USAGE")}`,c+=`
|
|
40
40
|
${e} <command> [subcommand] [options]`,c+=`
|
|
41
41
|
|
|
42
|
-
${we("COMMANDS")}`;let u=Math.max(...i.map((
|
|
43
|
-
${
|
|
42
|
+
${we("COMMANDS")}`;let u=Math.max(...i.map((F)=>F.name.length)),h=i.flatMap((F)=>F.subcommands?Object.keys(F.subcommands):[]),s=h.length>0?Math.max(...h.map((F)=>F.length)):0,g=i.flatMap((F)=>F.subcommands?Object.values(F.subcommands).flatMap((le)=>le.subcommands?Object.keys(le.subcommands):[]):[]),b=g.length>0?Math.max(...g.map((F)=>F.length)):0,y=Math.max(2+u+2,4+s+2,6+b+2),_=y-2-2,S=y-4-2,H=y-6-2;for(let F of i)if(c+=`
|
|
43
|
+
${F.name.padEnd(_)} ${F.description.trim()}`,F.subcommands){for(let[le,oe]of Object.entries(F.subcommands))if(c+=`
|
|
44
44
|
${le.padEnd(S)} ${oe.description}`,oe.subcommands)for(let[pe,Te]of Object.entries(oe.subcommands))c+=`
|
|
45
|
-
${pe.padEnd(
|
|
45
|
+
${pe.padEnd(H)} ${Te.description}`}return c+=`
|
|
46
46
|
|
|
47
47
|
${we("OPTIONS")}`,c+=`
|
|
48
48
|
-h, --help Show help for a command`,c+=`
|
|
49
49
|
-v, --version Show version number`,c+=`
|
|
50
50
|
--json Output errors as JSON`,c+=`
|
|
51
51
|
--profile <name> Use a named profile`,c+=On(a.examples),c+=`
|
|
52
|
-
`,c}}};var nm=s(()=>{cc()});var ge,ae,bt=(e,t)=>{let o=t??e,n=e.trim().toUpperCase(),i={ERROR:ge.default.red,FATAL:ge.default.red,WARN:ge.default.yellow,WARNING:ge.default.yellow,INFO:ge.default.blue,DEBUG:ge.default.gray,TRACE:ge.default.gray}[n];return i?i(o):o},hc=(e,t)=>{let o=t??e;if(e==="user")return ge.default.blue(o);if(e==="assistant")return ge.default.green(o);return ge.default.gray(o)};var gc=s(()=>{ge=go(ir(),1),ae={success:(e)=>ge.default.green(e),error:(e)=>ge.default.red(e),warning:(e)=>ge.default.yellow(e),info:(e)=>ge.default.blue(e),muted:(e)=>ge.default.dim(e),bold:(e)=>ge.default.bold(e),cyan:(e)=>ge.default.cyan(e),gray:(e)=>ge.default.gray(e)}});var St,Rt=(e)=>{console.log(St.default.yellow(e))},j=(e)=>{console.log(JSON.stringify(e,null,2))},v=(e,t=1)=>{console.error(JSON.stringify(typeof e==="string"?{success:!1,error:e}:e,null,2)),process.exit(t)},ce=(e)=>{console.log(St.default.bold(e))},Y=(e)=>{console.log(St.default.dim(e))},H=(e)=>{console.log(St.default.green(e))},Tt=(e)=>{console.log(St.default.red(e))},Ge=(e)=>{console.log(St.default.yellow(e))},_e=(e)=>St.default.dim(e);var so=s(()=>{St=go(ir(),1)});var ar,yt=(e)=>{if(e.type==="cursor")if(e.nextCursor)console.log(ar.default.dim(`Next: --cursor ${e.nextCursor}`));else console.log(ar.default.dim("End of results"));else console.log(ar.default.dim(`Page ${e.page} of ${e.totalPages}`))},dc=(e,t)=>{console.log(ar.default.bold(`${e} (${t} total)`))},sc=(e,t)=>{console.log(ar.default.bold(`${e} (${t} results)`))};var Sn=s(()=>{ar=go(ir(),1)});var R=()=>{console.log("")},et=(e,t=2)=>{console.log(`${" ".repeat(t)}${e}`)},ne=(e,t=0)=>{for(let[o,n]of Object.entries(e))console.log(`${" ".repeat(t)}${o}: ${n}`)},bo=(e="─",t=80)=>{console.log(e.repeat(t))},tt=(e,t,o)=>{if(e.length===0)return;if(o?.header){let u=typeof o.header==="string"?{title:o.header}:o.header,h=u.variant??"section",d=u.count??e.length;if(h==="results")dc(u.title,d);else if(h==="search")sc(u.title,d);else ce(u.title)}let n=/\u001B\[[0-?]*[ -/]*[@-~]/g,r=(u)=>(u??"").replace(n,"").length,i=(u,h,d)=>{let g=r(u),b=Math.max(0,h-g);return d==="right"?`${" ".repeat(b)}${u}`:`${u}${" ".repeat(b)}`},a=t.map((u)=>{if(u.width)return u.width;let h=r(u.header),d=Math.max(...e.map((g)=>r(g[u.key]||"")));return Math.max(h,d)}),c=[t.map((u,h)=>{let d=a[h]||0;return i(u.header,d,"left")}),...e.map((u)=>t.map((h,d)=>{let g=u[h.key]||"",b=a[d]||0,y=h.align||"left";return i(g,b,y)}))];for(let u of c)et(u.join(" "));R()};var bc=s(()=>{so();Sn()});var qe=(e,t=60)=>{if(e.length<=t)return e;return`${e.substring(0,t-3)}...`},Tn=(e)=>{return new Date(e).toLocaleString()};var yc=()=>{};var yo,mc="✓",pc="✗",im="⚠",am="ℹ",ST,TT,PT,AT;var vc=s(()=>{yo=go(ir(),1),ST=yo.default.green(mc),TT=yo.default.red(pc),PT=yo.default.yellow(im),AT=yo.default.cyan(am)});var Ic=()=>{};var cm=s(()=>{yc();vc();Ic()});var mo=(e,t)=>{let o=t==null?"":String(t);switch(e.kind){case"string":case"number":return o;case"boolean":return t?"yes":"no";case"date":return o?Tn(o):_e("(none)");case"nullable-date":return o?Tn(o):_e(e.emptyLabel??"(never)");case"nullable-string":return o?o:_e(e.emptyLabel??"(none)");case"truncated":return o?qe(o,e.maxLength):"";case"id":return o;case"severity":return o?bt(o):o;case"role":return o?hc(o):o;case"custom":return e.render(t)}},fc=(e,t)=>{if(e.kind==="custom")return e.serialize?e.serialize(t):t??null;return t??null},Gt=(e,t,o)=>{return e.get?e.get(o):o[t]};var kc=s(()=>{gc();so()});var lm=s(()=>{yc();Ic()});var um=(e,t,o)=>{let n={};for(let r of t){let i=e[r];if(!i)continue;let a=Gt(i,r,o);n[r]=fc(i.type,a)}return n},jT=(e)=>{if(e.layout==="field-list")return e.fields;let t=[...e.primary.fields];for(let o of e.secondary??[])if(!t.includes(o.field))t.push(o.field);return t},M=(e,t,o)=>{if(o?.json){let c={items:t.map((u)=>um(e.schema,e.columns,u))};if(o.nextCursor!==void 0)c.nextCursor=o.nextCursor??null;j(c);return}if(t.length===0){Rt(e.emptyMessage??"No results found.");return}let n=e.columns.map((a)=>{let c=e.schema[a];return{header:c?.label??a,key:a,align:c?.align}}),r=t.map((a)=>{let c={};for(let u of e.columns){let h=e.schema[u];if(!h)continue;let d=Gt(h,u,a);c[u]=mo(h.type,d)}return c}),i=e.header;if(o?.count!==void 0)i=typeof i==="string"?{title:i,count:o.count}:i!=null?{...i,count:o.count}:void 0;if(tt(r,n,{header:i}),o?.nextCursor)yt({type:"cursor",nextCursor:o.nextCursor})},U=(e,t,o)=>{if(o?.json){j(um(e.schema,jT(e),t));return}if(e.layout==="field-list")ET(e,t);else UT(e,t)},ET=(e,t)=>{if(e.title)ce(e.title);let o={};for(let n of e.fields){let r=e.schema[n];if(!r)continue;let i=Gt(r,n,t);o[r.label]=mo(r.type,i)}ne(o)},UT=(e,t)=>{let{primary:o}=e;if(o.title)ce(o.title);let n={};for(let r of o.fields){let i=e.schema[r];if(!i)continue;let a=Gt(i,r,t);n[i.label]=mo(i.type,a)}ne(n);for(let r of e.secondary??[]){let i=e.schema[r.field];if(!i)continue;let a=Gt(i,r.field,t);if(a==null)continue;R(),ce(r.title),et(String(a))}};var hm=s(()=>{bc();so();kc();Sn()});var p=(e,t=1)=>{console.error(e),process.exit(t)},Bt=(e)=>{console.log(e)};var F=s(()=>{tm();nm();gc();bc();cc();cm();vc();so();kc();Sn();lm();hm()});function gm(e){return e[0]??{}}function Jt(e){return Array.isArray(e)?e:e===void 0||e===null?[]:[e]}function Pn(e){let t;return()=>{if(t)return t.result;let o=e();return t={result:o},o}}function GT(e){let t=Promise.resolve();return(...o)=>{return t=t.catch(()=>{}).then(()=>{return e(...o)})}}function po(){return globalThis[FT]}function An(e,t={},o){return po()?.tracer?.startSpan(e,t,o)}function Pt(e,t,o={}){if(!e)return;let n=JT(t);if(e.recordException(n),!o.signal?.aborted||o.signal.reason!==t)e.setStatus({code:BT,message:n.message})}function JT(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};if("code"in e&&(typeof e.code==="string"||typeof e.code==="number"))t.code=e.code;return t}return{message:String(e)}}async function Ht({name:e,context:t,...o},n){let r=po()?.tracer;if(!r)return n();let i=async(a)=>{try{return await n(a)}catch(c){throw Pt(a,c,o),c}finally{a.end()}};if(t)return r.startActiveSpan(e,o,t,i);else return r.startActiveSpan(e,o,i)}async function Ft(e,t){let o=po();if(!e||!o)return t();let n=o.trace.setSpan(o.context.active(),e);return o.context.with(n,t)}function We(e){if(!e||typeof e!=="object")return!1;return"next"in e&&typeof e.next==="function"&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==="function"}function _c({name:e,...t},o){let n;return new At(async()=>{n??=An(e);try{let r=await Ft(n,()=>o.next());return n?.addEvent(r.done?"completed":"yielded"),r}catch(r){throw Pt(n,r,t),r}},async(r)=>{try{if(r!=="next")await Ft(n,()=>o.return?.())}catch(i){throw Pt(n,i,t),i}finally{n?.end()}})}class VT{#e=new Map;#t;constructor(e={}){this.#t=e.maxBufferedEvents??100}get size(){return this.#e.size}publish(e,t){let o=this.#e.get(e);if(!o)return;for(let n of o)n(t)}subscribe(e,t){if(typeof t==="function"){let u=this.#e.get(e);if(!u)this.#e.set(e,u=[]);return u.push(t),Pn(()=>{if(u.splice(u.indexOf(t),1),u.length===0)this.#e.delete(e)})}let o=t?.signal,n=t?.maxBufferedEvents??this.#t;o?.throwIfAborted();let r=[],i=[],a=this.subscribe(e,(u)=>{let h=i.shift();if(h)h[0]({done:!1,value:u});else if(r.push(u),r.length>n)r.shift()}),c=(u)=>{a(),i.forEach((h)=>h[1](u.target.reason)),i.length=0,r.length=0};return o?.addEventListener("abort",c,{once:!0}),new At(async()=>{if(o?.aborted)throw o.reason;if(r.length>0)return{done:!1,value:r.shift()};return new Promise((u,h)=>{i.push([u,h])})},async()=>{a(),o?.removeEventListener("abort",c),i.forEach((u)=>u[0]({done:!0,value:void 0})),i.length=0,r.length=0})}}class qT{index=BigInt(1);generate(){let e=this.index.toString(36);return this.index++,e}}function vo(e,t,o){let n=(r,i)=>{let a=e[i];if(!a)return o(r);return a({...r,next:(c=r)=>n(c,i+1)})};return n(t,0)}function Io(e){if(!e)return;return JSON.parse(e)}function cr(e){return JSON.stringify(e)}function dm(e){if(!Ye(e))return null;return Object.getPrototypeOf(e)?.constructor}function Be(e){if(!e||typeof e!=="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function Ye(e){return!!e&&(typeof e==="object"||typeof e==="function")}function Oc(e,t){let o=e;for(let n of t){if(!Ye(o))return;o=o[n]}return o}function Dn(e,...t){if(typeof e==="function")return e(...t);return e}function Tc(e){return new Proxy(e,{get(t,o,n){let r=Reflect.get(t,o,n);if(o!=="then"||typeof r!=="function")return r;return new Proxy(r,{apply(i,a,c){if(c.length!==2||c.some((h)=>!YT(h)))return Reflect.apply(i,a,c);let u=!0;c[0].call(a,Tc(new Proxy(t,{get:(h,d,g)=>{if(u&&d==="then"){u=!1;return}return Reflect.get(h,d,g)}})))}})}})}function YT(e){return typeof e==="function"&&WT.test(e.toString())}function sm(e){try{return decodeURIComponent(e)}catch{return e}}var $c="orpc",RT="@orpc/shared",KT="1.14.3",wc,BT=2,FT,HT,MT,At,Sc,WT;var rt=s(()=>{wc=class wc extends Error{constructor(...e){super(...e);this.name="AbortError"}};FT=`__${RT}@${KT}/otel/config__`;HT=Symbol.for("asyncDispose"),MT=Symbol.asyncDispose??HT;At=class At{#e=!1;#t=!1;#r;#o;constructor(e,t){this.#r=t,this.#o=GT(async()=>{if(this.#e)return{done:!0,value:void 0};try{let o=await e();if(o.done)this.#e=!0;return o}catch(o){throw this.#e=!0,o}finally{if(this.#e&&!this.#t)this.#t=!0,await this.#r("next")}})}next(){return this.#o()}async return(e){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("return");return{done:!0,value:e}}async throw(e){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("throw");throw e}async[MT](){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("dispose")}[Symbol.asyncIterator](){return this}};Sc=(()=>{let e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})();WT=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/});function Ac(e,t){return t??fo[e]?.status??500}function mm(e,t){return t||fo[e]?.message||e}function ko(e){return e instanceof ye?e:new ye("INTERNAL_SERVER_ERROR",{message:"Internal server error",cause:e})}function mt(e){return e<200||e>=400}function lr(e){if(!Be(e))return!1;let t=["defined","code","status","message","data"];if(Object.keys(e).some((o)=>!t.includes(o)))return!1;return"defined"in e&&typeof e.defined==="boolean"&&"code"in e&&typeof e.code==="string"&&"status"in e&&typeof e.status==="number"&&mt(e.status)&&"message"in e&&typeof e.message==="string"}function ur(e,t={}){return new ye(e.code,{...t,...e})}var bm="@orpc/client",ym="1.14.3",fo,pm,Pc,ye;var Dc=s(()=>{rt();fo={BAD_REQUEST:{status:400,message:"Bad Request"},UNAUTHORIZED:{status:401,message:"Unauthorized"},FORBIDDEN:{status:403,message:"Forbidden"},NOT_FOUND:{status:404,message:"Not Found"},METHOD_NOT_SUPPORTED:{status:405,message:"Method Not Supported"},NOT_ACCEPTABLE:{status:406,message:"Not Acceptable"},TIMEOUT:{status:408,message:"Request Timeout"},CONFLICT:{status:409,message:"Conflict"},PRECONDITION_FAILED:{status:412,message:"Precondition Failed"},PAYLOAD_TOO_LARGE:{status:413,message:"Payload Too Large"},UNSUPPORTED_MEDIA_TYPE:{status:415,message:"Unsupported Media Type"},UNPROCESSABLE_CONTENT:{status:422,message:"Unprocessable Content"},TOO_MANY_REQUESTS:{status:429,message:"Too Many Requests"},CLIENT_CLOSED_REQUEST:{status:499,message:"Client Closed Request"},INTERNAL_SERVER_ERROR:{status:500,message:"Internal Server Error"},NOT_IMPLEMENTED:{status:501,message:"Not Implemented"},BAD_GATEWAY:{status:502,message:"Bad Gateway"},SERVICE_UNAVAILABLE:{status:503,message:"Service Unavailable"},GATEWAY_TIMEOUT:{status:504,message:"Gateway Timeout"}};pm=Symbol.for(`__${bm}@${ym}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[pm]??=new WeakSet;Pc=globalThis[pm];ye=class ye extends Error{defined;code;status;data;constructor(e,...t){let o=gm(t);if(o.status!==void 0&&!mt(o.status))throw Error("[ORPCError] Invalid error status code.");let n=mm(e,o.message);super(n,o);this.code=e,this.status=Ac(e,o.status),this.defined=o.defined??!1,this.data=o.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(Pc.has(this)){let t=dm(e);if(t&&Pc.has(t))return!0}return super[Symbol.hasInstance](e)}};Pc.add(ye)});function XT(e){let t=e.replace(/\n+$/,"").split(/\n/),o={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(let n of t){let r=n.indexOf(":"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r+1).replace(/^\s/,"");if(r===0)o.comments.push(a);else if(i==="data")o.data??="",o.data+=`${a}
|
|
52
|
+
`,c}}};var nm=d(()=>{cc()});var ge,ae,bt=(e,t)=>{let o=t??e,n=e.trim().toUpperCase(),i={ERROR:ge.default.red,FATAL:ge.default.red,WARN:ge.default.yellow,WARNING:ge.default.yellow,INFO:ge.default.blue,DEBUG:ge.default.gray,TRACE:ge.default.gray}[n];return i?i(o):o},hc=(e,t)=>{let o=t??e;if(e==="user")return ge.default.blue(o);if(e==="assistant")return ge.default.green(o);return ge.default.gray(o)};var gc=d(()=>{ge=go(ir(),1),ae={success:(e)=>ge.default.green(e),error:(e)=>ge.default.red(e),warning:(e)=>ge.default.yellow(e),info:(e)=>ge.default.blue(e),muted:(e)=>ge.default.dim(e),bold:(e)=>ge.default.bold(e),cyan:(e)=>ge.default.cyan(e),gray:(e)=>ge.default.gray(e)}});var St,Rt=(e)=>{console.log(St.default.yellow(e))},j=(e)=>{console.log(JSON.stringify(e,null,2))},v=(e,t=1)=>{console.error(JSON.stringify(typeof e==="string"?{success:!1,error:e}:e,null,2)),process.exit(t)},ce=(e)=>{console.log(St.default.bold(e))},Y=(e)=>{console.log(St.default.dim(e))},M=(e)=>{console.log(St.default.green(e))},Tt=(e)=>{console.log(St.default.red(e))},Fe=(e)=>{console.log(St.default.yellow(e))},_e=(e)=>St.default.dim(e);var so=d(()=>{St=go(ir(),1)});var ar,yt=(e)=>{if(e.type==="cursor")if(e.nextCursor)console.log(ar.default.dim(`Next: --cursor ${e.nextCursor}`));else console.log(ar.default.dim("End of results"));else console.log(ar.default.dim(`Page ${e.page} of ${e.totalPages}`))},sc=(e,t)=>{console.log(ar.default.bold(`${e} (${t} total)`))},dc=(e,t)=>{console.log(ar.default.bold(`${e} (${t} results)`))};var Sn=d(()=>{ar=go(ir(),1)});var R=()=>{console.log("")},et=(e,t=2)=>{console.log(`${" ".repeat(t)}${e}`)},ne=(e,t=0)=>{for(let[o,n]of Object.entries(e))console.log(`${" ".repeat(t)}${o}: ${n}`)},bo=(e="─",t=80)=>{console.log(e.repeat(t))},tt=(e,t,o)=>{if(e.length===0)return;if(o?.header){let u=typeof o.header==="string"?{title:o.header}:o.header,h=u.variant??"section",s=u.count??e.length;if(h==="results")sc(u.title,s);else if(h==="search")dc(u.title,s);else ce(u.title)}let n=/\u001B\[[0-?]*[ -/]*[@-~]/g,r=(u)=>(u??"").replace(n,"").length,i=(u,h,s)=>{let g=r(u),b=Math.max(0,h-g);return s==="right"?`${" ".repeat(b)}${u}`:`${u}${" ".repeat(b)}`},a=t.map((u)=>{if(u.width)return u.width;let h=r(u.header),s=Math.max(...e.map((g)=>r(g[u.key]||"")));return Math.max(h,s)}),c=[t.map((u,h)=>{let s=a[h]||0;return i(u.header,s,"left")}),...e.map((u)=>t.map((h,s)=>{let g=u[h.key]||"",b=a[s]||0,y=h.align||"left";return i(g,b,y)}))];for(let u of c)et(u.join(" "));R()};var bc=d(()=>{so();Sn()});var qe=(e,t=60)=>{if(e.length<=t)return e;return`${e.substring(0,t-3)}...`},Tn=(e)=>{return new Date(e).toLocaleString()};var yc=()=>{};var yo,mc="✓",pc="✗",im="⚠",am="ℹ",ST,TT,PT,AT;var vc=d(()=>{yo=go(ir(),1),ST=yo.default.green(mc),TT=yo.default.red(pc),PT=yo.default.yellow(im),AT=yo.default.cyan(am)});var Ic=()=>{};var cm=d(()=>{yc();vc();Ic()});var mo=(e,t)=>{let o=t==null?"":String(t);switch(e.kind){case"string":case"number":return o;case"boolean":return t?"yes":"no";case"date":return o?Tn(o):_e("(none)");case"nullable-date":return o?Tn(o):_e(e.emptyLabel??"(never)");case"nullable-string":return o?o:_e(e.emptyLabel??"(none)");case"truncated":return o?qe(o,e.maxLength):"";case"id":return o;case"severity":return o?bt(o):o;case"role":return o?hc(o):o;case"custom":return e.render(t)}},fc=(e,t)=>{if(e.kind==="custom")return e.serialize?e.serialize(t):t??null;return t??null},Ft=(e,t,o)=>{return e.get?e.get(o):o[t]};var kc=d(()=>{gc();so()});var lm=d(()=>{yc();Ic()});var um=(e,t,o)=>{let n={};for(let r of t){let i=e[r];if(!i)continue;let a=Ft(i,r,o);n[r]=fc(i.type,a)}return n},jT=(e)=>{if(e.layout==="field-list")return e.fields;let t=[...e.primary.fields];for(let o of e.secondary??[])if(!t.includes(o.field))t.push(o.field);return t},J=(e,t,o)=>{if(o?.json){let c={items:t.map((u)=>um(e.schema,e.columns,u))};if(o.nextCursor!==void 0)c.nextCursor=o.nextCursor??null;j(c);return}if(t.length===0){Rt(e.emptyMessage??"No results found.");return}let n=e.columns.map((a)=>{let c=e.schema[a];return{header:c?.label??a,key:a,align:c?.align}}),r=t.map((a)=>{let c={};for(let u of e.columns){let h=e.schema[u];if(!h)continue;let s=Ft(h,u,a);c[u]=mo(h.type,s)}return c}),i=e.header;if(o?.count!==void 0)i=typeof i==="string"?{title:i,count:o.count}:i!=null?{...i,count:o.count}:void 0;if(tt(r,n,{header:i}),o?.nextCursor)yt({type:"cursor",nextCursor:o.nextCursor})},U=(e,t,o)=>{if(o?.json){j(um(e.schema,jT(e),t));return}if(e.layout==="field-list")ET(e,t);else UT(e,t)},ET=(e,t)=>{if(e.title)ce(e.title);let o={};for(let n of e.fields){let r=e.schema[n];if(!r)continue;let i=Ft(r,n,t);o[r.label]=mo(r.type,i)}ne(o)},UT=(e,t)=>{let{primary:o}=e;if(o.title)ce(o.title);let n={};for(let r of o.fields){let i=e.schema[r];if(!i)continue;let a=Ft(i,r,t);n[i.label]=mo(i.type,a)}ne(n);for(let r of e.secondary??[]){let i=e.schema[r.field];if(!i)continue;let a=Ft(i,r.field,t);if(a==null)continue;R(),ce(r.title),et(String(a))}};var hm=d(()=>{bc();so();kc();Sn()});var p=(e,t=1)=>{console.error(e),process.exit(t)},Gt=(e)=>{console.log(e)};var B=d(()=>{tm();nm();gc();bc();cc();cm();vc();so();kc();Sn();lm();hm()});function gm(e){return e[0]??{}}function Ht(e){return Array.isArray(e)?e:e===void 0||e===null?[]:[e]}function Pn(e){let t;return()=>{if(t)return t.result;let o=e();return t={result:o},o}}function FT(e){let t=Promise.resolve();return(...o)=>{return t=t.catch(()=>{}).then(()=>{return e(...o)})}}function po(){return globalThis[BT]}function An(e,t={},o){return po()?.tracer?.startSpan(e,t,o)}function Pt(e,t,o={}){if(!e)return;let n=HT(t);if(e.recordException(n),!o.signal?.aborted||o.signal.reason!==t)e.setStatus({code:GT,message:n.message})}function HT(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};if("code"in e&&(typeof e.code==="string"||typeof e.code==="number"))t.code=e.code;return t}return{message:String(e)}}async function Mt({name:e,context:t,...o},n){let r=po()?.tracer;if(!r)return n();let i=async(a)=>{try{return await n(a)}catch(c){throw Pt(a,c,o),c}finally{a.end()}};if(t)return r.startActiveSpan(e,o,t,i);else return r.startActiveSpan(e,o,i)}async function Bt(e,t){let o=po();if(!e||!o)return t();let n=o.trace.setSpan(o.context.active(),e);return o.context.with(n,t)}function We(e){if(!e||typeof e!=="object")return!1;return"next"in e&&typeof e.next==="function"&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==="function"}function _c({name:e,...t},o){let n;return new At(async()=>{n??=An(e);try{let r=await Bt(n,()=>o.next());return n?.addEvent(r.done?"completed":"yielded"),r}catch(r){throw Pt(n,r,t),r}},async(r)=>{try{if(r!=="next")await Bt(n,()=>o.return?.())}catch(i){throw Pt(n,i,t),i}finally{n?.end()}})}class VT{#e=new Map;#t;constructor(e={}){this.#t=e.maxBufferedEvents??100}get size(){return this.#e.size}publish(e,t){let o=this.#e.get(e);if(!o)return;for(let n of o)n(t)}subscribe(e,t){if(typeof t==="function"){let u=this.#e.get(e);if(!u)this.#e.set(e,u=[]);return u.push(t),Pn(()=>{if(u.splice(u.indexOf(t),1),u.length===0)this.#e.delete(e)})}let o=t?.signal,n=t?.maxBufferedEvents??this.#t;o?.throwIfAborted();let r=[],i=[],a=this.subscribe(e,(u)=>{let h=i.shift();if(h)h[0]({done:!1,value:u});else if(r.push(u),r.length>n)r.shift()}),c=(u)=>{a(),i.forEach((h)=>h[1](u.target.reason)),i.length=0,r.length=0};return o?.addEventListener("abort",c,{once:!0}),new At(async()=>{if(o?.aborted)throw o.reason;if(r.length>0)return{done:!1,value:r.shift()};return new Promise((u,h)=>{i.push([u,h])})},async()=>{a(),o?.removeEventListener("abort",c),i.forEach((u)=>u[0]({done:!0,value:void 0})),i.length=0,r.length=0})}}class qT{index=BigInt(1);generate(){let e=this.index.toString(36);return this.index++,e}}function vo(e,t,o){let n=(r,i)=>{let a=e[i];if(!a)return o(r);return a({...r,next:(c=r)=>n(c,i+1)})};return n(t,0)}function Io(e){if(!e)return;return JSON.parse(e)}function cr(e){return JSON.stringify(e)}function sm(e){if(!Ye(e))return null;return Object.getPrototypeOf(e)?.constructor}function Ge(e){if(!e||typeof e!=="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function Ye(e){return!!e&&(typeof e==="object"||typeof e==="function")}function Oc(e,t){let o=e;for(let n of t){if(!Ye(o))return;o=o[n]}return o}function Dn(e,...t){if(typeof e==="function")return e(...t);return e}function Tc(e){return new Proxy(e,{get(t,o,n){let r=Reflect.get(t,o,n);if(o!=="then"||typeof r!=="function")return r;return new Proxy(r,{apply(i,a,c){if(c.length!==2||c.some((h)=>!YT(h)))return Reflect.apply(i,a,c);let u=!0;c[0].call(a,Tc(new Proxy(t,{get:(h,s,g)=>{if(u&&s==="then"){u=!1;return}return Reflect.get(h,s,g)}})))}})}})}function YT(e){return typeof e==="function"&&WT.test(e.toString())}function dm(e){try{return decodeURIComponent(e)}catch{return e}}var $c="orpc",RT="@orpc/shared",KT="1.14.3",wc,GT=2,BT,MT,JT,At,Sc,WT;var rt=d(()=>{wc=class wc extends Error{constructor(...e){super(...e);this.name="AbortError"}};BT=`__${RT}@${KT}/otel/config__`;MT=Symbol.for("asyncDispose"),JT=Symbol.asyncDispose??MT;At=class At{#e=!1;#t=!1;#r;#o;constructor(e,t){this.#r=t,this.#o=FT(async()=>{if(this.#e)return{done:!0,value:void 0};try{let o=await e();if(o.done)this.#e=!0;return o}catch(o){throw this.#e=!0,o}finally{if(this.#e&&!this.#t)this.#t=!0,await this.#r("next")}})}next(){return this.#o()}async return(e){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("return");return{done:!0,value:e}}async throw(e){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("throw");throw e}async[JT](){if(this.#e=!0,!this.#t)this.#t=!0,await this.#r("dispose")}[Symbol.asyncIterator](){return this}};Sc=(()=>{let e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})();WT=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/});function Ac(e,t){return t??fo[e]?.status??500}function mm(e,t){return t||fo[e]?.message||e}function ko(e){return e instanceof ye?e:new ye("INTERNAL_SERVER_ERROR",{message:"Internal server error",cause:e})}function mt(e){return e<200||e>=400}function lr(e){if(!Ge(e))return!1;let t=["defined","code","status","message","data"];if(Object.keys(e).some((o)=>!t.includes(o)))return!1;return"defined"in e&&typeof e.defined==="boolean"&&"code"in e&&typeof e.code==="string"&&"status"in e&&typeof e.status==="number"&&mt(e.status)&&"message"in e&&typeof e.message==="string"}function ur(e,t={}){return new ye(e.code,{...t,...e})}var bm="@orpc/client",ym="1.14.3",fo,pm,Pc,ye;var Dc=d(()=>{rt();fo={BAD_REQUEST:{status:400,message:"Bad Request"},UNAUTHORIZED:{status:401,message:"Unauthorized"},FORBIDDEN:{status:403,message:"Forbidden"},NOT_FOUND:{status:404,message:"Not Found"},METHOD_NOT_SUPPORTED:{status:405,message:"Method Not Supported"},NOT_ACCEPTABLE:{status:406,message:"Not Acceptable"},TIMEOUT:{status:408,message:"Request Timeout"},CONFLICT:{status:409,message:"Conflict"},PRECONDITION_FAILED:{status:412,message:"Precondition Failed"},PAYLOAD_TOO_LARGE:{status:413,message:"Payload Too Large"},UNSUPPORTED_MEDIA_TYPE:{status:415,message:"Unsupported Media Type"},UNPROCESSABLE_CONTENT:{status:422,message:"Unprocessable Content"},TOO_MANY_REQUESTS:{status:429,message:"Too Many Requests"},CLIENT_CLOSED_REQUEST:{status:499,message:"Client Closed Request"},INTERNAL_SERVER_ERROR:{status:500,message:"Internal Server Error"},NOT_IMPLEMENTED:{status:501,message:"Not Implemented"},BAD_GATEWAY:{status:502,message:"Bad Gateway"},SERVICE_UNAVAILABLE:{status:503,message:"Service Unavailable"},GATEWAY_TIMEOUT:{status:504,message:"Gateway Timeout"}};pm=Symbol.for(`__${bm}@${ym}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[pm]??=new WeakSet;Pc=globalThis[pm];ye=class ye extends Error{defined;code;status;data;constructor(e,...t){let o=gm(t);if(o.status!==void 0&&!mt(o.status))throw Error("[ORPCError] Invalid error status code.");let n=mm(e,o.message);super(n,o);this.code=e,this.status=Ac(e,o.status),this.defined=o.defined??!1,this.data=o.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(Pc.has(this)){let t=sm(e);if(t&&Pc.has(t))return!0}return super[Symbol.hasInstance](e)}};Pc.add(ye)});function XT(e){let t=e.replace(/\n+$/,"").split(/\n/),o={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(let n of t){let r=n.indexOf(":"),i=r===-1?n:n.slice(0,r),a=r===-1?"":n.slice(r+1).replace(/^\s/,"");if(r===0)o.comments.push(a);else if(i==="data")o.data??="",o.data+=`${a}
|
|
53
53
|
`;else if(i==="event")o.event=a;else if(i==="id")o.id=a;else if(i==="retry"){let c=Number.parseInt(a);if(Number.isInteger(c)&&c>=0&&c.toString()===a)o.retry=c}}return o.data=o.data?.replace(/\n$/,""),o}class Im{constructor(e={}){this.options=e}incomplete="";feed(e){this.incomplete+=e;let t=this.incomplete.lastIndexOf(`
|
|
54
54
|
|
|
55
55
|
`);if(t===-1)return;let o=this.incomplete.slice(0,t).split(/\n\n/);this.incomplete=this.incomplete.slice(t+2);for(let n of o){let r=XT(`${n}
|
|
@@ -63,24 +63,18 @@ ${we("OPTIONS")}`,c+=`
|
|
|
63
63
|
`;if(e.retry!==void 0)km(e.retry),t+=`retry: ${e.retry}
|
|
64
64
|
`;if(e.id!==void 0)fm(e.id),t+=`id: ${e.id}
|
|
65
65
|
`;return t+=QT(e.data),t+=`
|
|
66
|
-
`,t}function Mt(e,t){if(t.id===void 0&&t.retry===void 0&&!t.comments?.length)return e;if(t.id!==void 0)fm(t.id);if(t.retry!==void 0)km(t.retry);if(t.comments!==void 0)for(let o of t.comments)$m(o);return new Proxy(e,{get(o,n,r){if(n===wm)return t;return Reflect.get(o,n,r)}})}function hr(e){return Ye(e)?Reflect.get(e,wm):void 0}function _m(e,t="inline"){let o=e.replace(/[^\x20-\x7E]/g,"_").replace(/"/g,"\\\""),n=encodeURIComponent(e).replace(/['()*]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(r,i)=>String.fromCharCode(Number.parseInt(i,16)));return`${t}; filename="${o}"; filename*=utf-8''${n}`}function Om(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==="string")return sm(t[2]);let o=e.match(/filename="((?:\\"|[^"])*)"/i);if(o&&typeof o[1]==="string")return o[1].replace(/\\"/g,'"')}function Nn(e,t){let o={...e};for(let n in t)if(Array.isArray(t[n]))o[n]=[...Jt(o[n]),...t[n]];else if(t[n]!==void 0)if(Array.isArray(o[n]))o[n]=[...o[n],t[n]];else if(o[n]!==void 0)o[n]=[o[n],t[n]];else o[n]=t[n];return o}var $o,vm,Fe,Nc,wm;var _o=s(()=>{rt();$o=class $o extends TypeError{};vm=class vm extends TypeError{};Fe=class Fe extends Error{data;constructor(e){super(e?.message??"An error event was received",e);this.data=e?.data}};Nc=class Nc extends TransformStream{constructor(){let e;super({start(t){e=new Im({onEvent:(o)=>{t.enqueue(o)}})},transform(t){e.feed(t)},flush(){e.end()}})}};wm=Symbol("ORPC_EVENT_SOURCE_META")});function Vt(e,t){let o=async(n)=>{let r=await t.error(n);if(r!==n){let i=hr(n);if(i&&Ye(r))r=Mt(r,i)}return r};return new At(async()=>{let{done:n,value:r}=await(async()=>{try{return await e.next()}catch(a){throw await o(a)}})(),i=await t.value(r,n);if(i!==r){let a=hr(r);if(a&&Ye(i))i=Mt(i,a)}return{done:n,value:i}},async()=>{try{await e.return?.()}catch(n){throw await o(n)}})}var Lc=s(()=>{rt();_o()});function tP(e){return{...e,context:e.context??{}}}function Cc(e,t={}){let o=t.path??[],r=new Proxy(async(...[i,a={}])=>{return await e.call(o,i,tP(a))},{get(i,a){if(typeof a!=="string")return Reflect.get(i,a);return Cc(e,{...t,path:[...o,a]})}});return Tc(r)}var gr=s(()=>{rt();Dc();Lc()});function rP(e,t={}){let n=e?.pipeThrough(new TextDecoderStream).pipeThrough(new Nc)?.getReader(),r,i=!1;return new At(async()=>{r??=An("consume_event_iterator_stream");try{while(!0){if(n===void 0)return{done:!0,value:void 0};let{done:a,value:c}=await Ft(r,()=>n.read());if(a){if(i)throw new wc("Stream was cancelled");return{done:!0,value:void 0}}switch(c.event){case"message":{let u=Io(c.data);if(Ye(u))u=Mt(u,c);return r?.addEvent("message"),{done:!1,value:u}}case"error":{let u=new Fe({data:Io(c.data)});throw u=Mt(u,c),r?.addEvent("error"),u}case"done":{let u=Io(c.data);if(Ye(u))u=Mt(u,c);return r?.addEvent("done"),{done:!0,value:u}}default:r?.addEvent("maybe_keepalive")}}}catch(a){if(!(a instanceof Fe))Pt(r,a,t);throw a}},async(a)=>{try{if(a!=="next")i=!0,r?.addEvent("cancelled");await Ft(r,()=>n?.cancel())}catch(c){throw Pt(r,c,t),c}finally{r?.end()}})}function oP(e,t={}){let o=t.eventIteratorKeepAliveEnabled??!0,n=t.eventIteratorKeepAliveInterval??5000,r=t.eventIteratorKeepAliveComment??"",i=t.eventIteratorInitialCommentEnabled??!0,a=t.eventIteratorInitialComment??"",c=!1,u,h;return new ReadableStream({start(g){if(h=An("stream_event_iterator"),i)g.enqueue(wo({comments:[a]}))},async pull(g){try{if(o)u=setInterval(()=>{g.enqueue(wo({comments:[r]})),h?.addEvent("keepalive")},n);let b=await Ft(h,()=>e.next());if(clearInterval(u),c)return;let y=hr(b.value);if(!b.done||b.value!==void 0||y!==void 0){let _=b.done?"done":"message";g.enqueue(wo({...y,event:_,data:cr(b.value)})),h?.addEvent(_)}if(b.done)g.close(),h?.end()}catch(b){if(clearInterval(u),c)return;if(b instanceof Fe)g.enqueue(wo({...hr(b),event:"error",data:cr(b.data)})),h?.addEvent("error"),g.close();else Pt(h,b),g.error(b);h?.end()}},async cancel(){try{c=!0,clearInterval(u),h?.addEvent("cancelled"),await Ft(h,()=>e.return?.())}catch(g){throw Pt(h,g),g}finally{h?.end()}}}).pipeThrough(new TextEncoderStream)}function nP(e,t={}){return Ht({name:"parse_standard_body",signal:t.signal},async()=>{let o=e.headers.get("content-disposition");if(typeof o==="string"){let i=Om(o)??"blob",a=await e.blob();return new File([a],i,{type:a.type})}let n=e.headers.get("content-type");if(!n||n.startsWith("application/json")){let i=await e.text();return Io(i)}if(n.startsWith("multipart/form-data"))return await e.formData();if(n.startsWith("application/x-www-form-urlencoded")){let i=await e.text();return new URLSearchParams(i)}if(n.startsWith("text/event-stream"))return rP(e.body,t);if(n.startsWith("text/plain"))return await e.text();let r=await e.blob();return new File([r],"blob",{type:r.type})})}function iP(e,t,o={}){if(e instanceof ReadableStream)return e;let n=t.get("content-disposition");if(t.delete("content-type"),t.delete("content-disposition"),e===void 0)return;if(e instanceof Blob)return t.set("content-type",e.type),t.set("content-length",e.size.toString()),t.set("content-disposition",n??_m(e instanceof File?e.name:"blob")),e;if(e instanceof FormData)return e;if(e instanceof URLSearchParams)return e;if(We(e))return t.set("content-type","text/event-stream"),oP(e,o);return t.set("content-type","application/json"),cr(e)}function xc(e,t={}){return e.forEach((o,n)=>{if(Array.isArray(t[n]))t[n].push(o);else if(t[n]!==void 0)t[n]=[t[n],o];else t[n]=o}),t}function aP(e,t=new Headers){for(let[o,n]of Object.entries(e))if(Array.isArray(n))for(let r of n)t.append(o,r);else if(n!==void 0)t.append(o,n);return t}function Sm(e,t={}){let o=aP(e.headers),n=iP(e.body,o,t);return new Request(e.url,{signal:e.signal,method:e.method,headers:o,body:n})}function Tm(e,t={}){return{body:Pn(()=>nP(e,t)),status:e.status,get headers(){let o=xc(e.headers);return Object.defineProperty(this,"headers",{value:o,writable:!0}),o},set headers(o){Object.defineProperty(this,"headers",{value:o,writable:!0})}}}var zc=s(()=>{rt();_o()});class Oo{plugins;constructor(e=[]){this.plugins=[...e].sort((t,o)=>(t.order??0)-(o.order??0))}init(e){for(let t of this.plugins)t.init?.(e)}}class Ln{constructor(e,t,o={}){this.codec=e,this.sender=t,new Oo(o.plugins).init(o),this.interceptors=Jt(o.interceptors),this.clientInterceptors=Jt(o.clientInterceptors)}interceptors;clientInterceptors;call(e,t,o){return Ht({name:`${$c}.${e.join("/")}`,signal:o.signal},(n)=>{if(n?.setAttribute("rpc.system",$c),n?.setAttribute("rpc.method",e.join(".")),We(t))t=_c({name:"consume_event_iterator_input",signal:o.signal},t);return vo(this.interceptors,{...o,path:e,input:t},async({path:r,input:i,...a})=>{let c=po(),u,h=c?.trace.getActiveSpan()??n;if(h&&c)u=c?.trace.setSpan(c.context.active(),h);let d=await Ht({name:"encode_request",context:u},()=>this.codec.encode(r,i,a)),g=await vo(this.clientInterceptors,{...a,input:i,path:r,request:d},({input:y,path:_,request:S,...J})=>{return Ht({name:"send_request",signal:J.signal,context:u},()=>this.sender.call(S,J,_,y))}),b=await Ht({name:"decode_response",context:u},()=>this.codec.decode(g,a,r,i));if(We(b))return _c({name:"consume_event_iterator_output",signal:a.signal},b);return b})})}}function Cn(e){return`/${e.map(encodeURIComponent).join("/")}`}function jc(e){if(typeof e.forEach==="function")return xc(e);return e}function Ec(e){return Object.entries(fo).find(([,t])=>t.status===e)?.[0]??"MALFORMED_ORPC_ERROR_RESPONSE"}class Pm{constructor(e){this.jsonSerializer=e}serialize(e){if(We(e))return Vt(e,{value:async(t)=>this.#e(t,!1),error:async(t)=>{return new Fe({data:this.#e(ko(t).toJSON(),!1),cause:t})}});return this.#e(e,!0)}#e(e,t){let[o,n,r,i]=this.jsonSerializer.serialize(e),a=n.length===0?void 0:n;if(!t||i.length===0)return{json:o,meta:a};let c=new FormData;return c.set("data",cr({json:o,meta:a,maps:r})),i.forEach((u,h)=>{c.set(h.toString(),u)}),c}deserialize(e){if(We(e))return Vt(e,{value:async(t)=>this.#t(t),error:async(t)=>{if(!(t instanceof Fe))return t;let o=this.#t(t.data);if(lr(o))return ur(o,{cause:t});return new Fe({data:o,cause:t})}});return this.#t(e)}#t(e){if(e===void 0)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);let t=JSON.parse(e.get("data"));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,(o)=>e.get(o.toString()))}}var Uc=s(()=>{rt();_o();Dc();zc();Lc()});class Rc{fetch;toFetchRequestOptions;adapterInterceptors;constructor(e){new Am(e.plugins).initRuntimeAdapter(e),this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e,this.adapterInterceptors=Jt(e.adapterInterceptors)}async call(e,t,o,n){let r=Sm(e,this.toFetchRequestOptions),i=await vo(this.adapterInterceptors,{...t,request:r,path:o,input:n,init:{redirect:"manual"}},({request:c,path:u,input:h,init:d,...g})=>this.fetch(c,d,g,u,h));return Tm(i,{signal:r.signal})}}var Am;var Dm=s(()=>{rt();zc();Uc();Am=class Am extends Oo{initRuntimeAdapter(e){for(let t of this.plugins)t.initRuntimeAdapter?.(e)}}});var Nm=s(()=>{Uc()});class Gc{maxArrayIndex;constructor(e={}){this.maxArrayIndex=e.maxBracketNotationArrayIndex??9999}serialize(e,t=[],o=[]){if(Array.isArray(e))e.forEach((n,r)=>{this.serialize(n,[...t,r],o)});else if(Be(e))for(let n in e)this.serialize(e[n],[...t,n],o);else o.push([this.stringifyPath(t),e]);return o}deserialize(e){if(e.length===0)return{};let t=new WeakSet,o={value:[]};for(let[n,r]of e){let i=this.parsePath(n),a=o,c="value";if(i.forEach((u,h)=>{if(!Array.isArray(a[c])&&!Be(a[c]))a[c]=[];if(h!==i.length-1){if(Array.isArray(a[c])&&!Lm(u,this.maxArrayIndex))if(t.has(a[c]))t.delete(a[c]),a[c]=Cm(a[c]);else a[c]=Kc(a[c])}else if(Array.isArray(a[c])){if(u===""){if(a[c].length&&!t.has(a[c]))a[c]=Kc(a[c])}else if(t.has(a[c]))t.delete(a[c]),a[c]=Cm(a[c]);else if(!Lm(u,this.maxArrayIndex))a[c]=Kc(a[c])}a=a[c],c=u}),Array.isArray(a)&&c==="")t.add(a),a.push(r);else if(c in a)if(Array.isArray(a[c]))a[c].push(r);else a[c]=[a[c],r];else a[c]=r}return o.value}stringifyPath(e){return e.map((t)=>{return t.toString().replace(/[\\[\]]/g,(o)=>{switch(o){case"\\":return"\\\\";case"[":return"\\[";case"]":return"\\]";default:return o}})}).reduce((t,o,n)=>{if(n===0)return o;return`${t}[${o}]`},"")}parsePath(e){let t=[],o=!1,n="",r=0;for(let i=0;i<e.length;i++){let a=e[i],c=e[i+1];if(o&&a==="]"&&(c===void 0||c==="[")&&r%2===0){if(c===void 0)o=!1;t.push(n),n="",i++}else if(t.length===0&&a==="["&&r%2===0)o=!0,t.push(n),n="";else if(a==="\\")r++;else n+="\\".repeat(r/2)+a,r=0}return o||t.length===0?[e]:t}}function Lm(e,t){return/^0$|^[1-9]\d*$/.test(e)&&Number(e)<=t}function Kc(e){let t=new Sc;return e.forEach((o,n)=>{t[n]=o}),t}function Cm(e){let t=new Sc;return t[""]=e.length===1?e[0]:e,t}var xm=s(()=>{rt()});function Bc(e,t){return{...e,...t}}class So{"~orpc";constructor(e){if(e.route?.successStatus&&mt(e.route.successStatus))throw Error("[ContractProcedure] Invalid successStatus.");if(Object.values(e.errorMap).some((t)=>t&&t.status&&!mt(t.status)))throw Error("[ContractProcedure] Invalid error status code.");this["~orpc"]=e}}function To(e){if(e instanceof So)return!0;return(typeof e==="object"||typeof e==="function")&&e!==null&&"~orpc"in e&&typeof e["~orpc"]==="object"&&e["~orpc"]!==null&&"errorMap"in e["~orpc"]&&"route"in e["~orpc"]&&"meta"in e["~orpc"]}var zm=s(()=>{gr()});function lP(e,t){return{...e,...t}}function uP(e,t){return{...e,...t}}function hP(e,t){if(!e.path)return e;return{...e,path:`${t}${e.path}`}}function gP(e,t){return{...e,tags:[...t,...e.tags??[]]}}function dP(e,t){return e?`${e}${t}`:t}function sP(e,t){return e?[...e,...t]:t}function bP(e,t){let o=e;if(t.prefix)o=hP(o,t.prefix);if(t.tags?.length)o=gP(o,t.tags);return o}function jm(e,t){if(To(e))return new So({...e["~orpc"],errorMap:Bc(t.errorMap,e["~orpc"].errorMap),route:bP(e["~orpc"].route,t)});if(typeof e!=="object"||e===null)return e;let o={};for(let n in e)o[n]=jm(e[n],t);return o}function Po(e,t){if(t===void 0)return yP[e];return t}var Je,Em,yP,rU;var Fc=s(()=>{zm();gr();Je=class Je extends So{constructor(e){super(e);this["~orpc"].prefix=e.prefix,this["~orpc"].tags=e.tags}$meta(e){return new Je({...this["~orpc"],meta:e})}$route(e){return new Je({...this["~orpc"],route:e})}$input(e){return new Je({...this["~orpc"],inputSchema:e})}errors(e){return new Je({...this["~orpc"],errorMap:Bc(this["~orpc"].errorMap,e)})}meta(e){return new Je({...this["~orpc"],meta:lP(this["~orpc"].meta,e)})}route(e){return new Je({...this["~orpc"],route:uP(this["~orpc"].route,e)})}input(e){return new Je({...this["~orpc"],inputSchema:e})}output(e){return new Je({...this["~orpc"],outputSchema:e})}prefix(e){return new Je({...this["~orpc"],prefix:dP(this["~orpc"].prefix,e)})}tag(...e){return new Je({...this["~orpc"],tags:sP(this["~orpc"].tags,e)})}router(e){return jm(e,this["~orpc"])}};Em=new Je({errorMap:{},route:{},meta:{}}),yP={defaultMethod:"POST",defaultSuccessStatus:200,defaultSuccessDescription:"OK",defaultInputStructure:"compact",defaultOutputStructure:"compact"};rU=Symbol("ORPC_EVENT_ITERATOR_DETAILS")});class Rm{customSerializers;constructor(e={}){this.customSerializers=e.customJsonSerializers??[]}serialize(e,t={value:!1}){for(let o of this.customSerializers)if(o.condition(e))return this.serialize(o.serialize(e),t);if(e instanceof Blob)return t.value=!0,[e,t.value];if(e instanceof Set)return this.serialize(Array.from(e),t);if(e instanceof Map)return this.serialize(Array.from(e.entries()),t);if(Array.isArray(e))return[e.map((n)=>n===void 0?null:this.serialize(n,t)[0]),t.value];if(Be(e)){let o={};for(let n in e){if(n==="toJSON"&&typeof e[n]==="function")continue;o[n]=this.serialize(e[n],t)[0]}return[o,t.value]}if(typeof e==="bigint"||e instanceof RegExp||e instanceof URL)return[e.toString(),t.value];if(e instanceof Date)return[Number.isNaN(e.getTime())?null:e.toISOString(),t.value];if(Number.isNaN(e))return[null,t.value];return[e,t.value]}}function Jc(e){return`/${e.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")}`}function Um(e){return e?Jc(e).match(/\/\{[^}]+\}/g)?.map((t)=>({raw:t,name:t.match(/\{\+?([^}]+)\}/)[1]})):void 0}class Km{constructor(e,t,o){this.contract=e,this.serializer=t,this.baseUrl=o.url,this.headers=o.headers??{},this.customErrorResponseBodyDecoder=o.customErrorResponseBodyDecoder}baseUrl;headers;customErrorResponseBodyDecoder;async encode(e,t,o){let n=jc(await Dn(this.headers,o,e,t));if(o.lastEventId!==void 0)n=Nn(n,{"last-event-id":o.lastEventId});let r=await Dn(this.baseUrl,o,e,t),i=Oc(this.contract,e);if(!To(i))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${e.join(".")}`);return Po("defaultInputStructure",i["~orpc"].route.inputStructure)==="compact"?this.#e(i,e,t,o,r,n):this.#t(i,e,t,o,r,n)}#e(e,t,o,n,r,i){let a=Jc(e["~orpc"].route.path??Cn(t)),c=o,u=Um(a);if(u?.length){if(!Be(o))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${t.join(".")}.`);let g={...o};for(let b of u){let y=o[b.name];a=a.replace(b.raw,`/${encodeURIComponent(`${this.serializer.serialize(y)}`)}`),delete g[b.name]}c=Object.keys(g).length?g:void 0}let h=Po("defaultMethod",e["~orpc"].route.method),d=new URL(r);if(d.pathname=`${d.pathname.replace(/\/$/,"")}${a}`,h==="GET"){let g=this.serializer.serialize(c,{outputFormat:"URLSearchParams"});for(let[b,y]of g)d.searchParams.append(b,y);return{url:d,method:h,headers:i,body:void 0,signal:n.signal}}return{url:d,method:h,headers:i,body:this.serializer.serialize(c),signal:n.signal}}#t(e,t,o,n,r,i){let a=Jc(e["~orpc"].route.path??Cn(t)),c=Um(a);if(!Be(o)&&o!==void 0)throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${t.join(".")}.`);if(c?.length){if(!Be(o?.params))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${t.join(".")}.`);for(let g of c){let b=o.params[g.name];a=a.replace(g.raw,`/${encodeURIComponent(`${this.serializer.serialize(b)}`)}`)}}let u=i;if(o?.headers!==void 0){if(!Be(o.headers))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${t.join(".")}.`);u=Nn(o.headers,i)}let h=Po("defaultMethod",e["~orpc"].route.method),d=new URL(r);if(d.pathname=`${d.pathname.replace(/\/$/,"")}${a}`,o?.query!==void 0){let g=this.serializer.serialize(o.query,{outputFormat:"URLSearchParams"});for(let[b,y]of g)d.searchParams.append(b,y)}if(h==="GET")return{url:d,method:h,headers:u,body:void 0,signal:n.signal};return{url:d,method:h,headers:u,body:this.serializer.serialize(o?.body),signal:n.signal}}async decode(e,t,o){let n=!mt(e.status),r=await(async()=>{let c=!1;try{let u=await e.body();return c=!0,this.serializer.deserialize(u)}catch(u){if(!c)throw Error("Cannot parse response body, please check the response body and content-type.",{cause:u});throw Error("Invalid OpenAPI response format.",{cause:u})}})();if(!n){let c=this.customErrorResponseBodyDecoder?.(r,e);if(c!==null&&c!==void 0)throw c;if(lr(r))throw ur(r);throw new ye(Ec(e.status),{status:e.status,data:{...e,body:r}})}let i=Oc(this.contract,o);if(!To(i))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${o.join(".")}`);if(Po("defaultOutputStructure",i["~orpc"].route.outputStructure)==="compact")return r;return{status:e.status,headers:e.headers,body:r}}}class Gm{constructor(e,t){this.jsonSerializer=e,this.bracketNotation=t}serialize(e,t={}){if(We(e)&&!t.outputFormat)return Vt(e,{value:async(o)=>this.#e(o,{outputFormat:"plain"}),error:async(o)=>{return new Fe({data:this.#e(ko(o).toJSON(),{outputFormat:"plain"}),cause:o})}});return this.#e(e,t)}#e(e,t){let[o,n]=this.jsonSerializer.serialize(e);if(t.outputFormat==="plain")return o;if(t.outputFormat==="URLSearchParams"){let i=new URLSearchParams;for(let[a,c]of this.bracketNotation.serialize(o))if(typeof c==="string"||typeof c==="number"||typeof c==="boolean")i.append(a,c.toString());return i}if(o instanceof Blob||o===void 0||!n)return o;let r=new FormData;for(let[i,a]of this.bracketNotation.serialize(o))if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")r.append(i,a.toString());else if(a instanceof Blob)r.append(i,a);return r}deserialize(e){if(e instanceof URLSearchParams||e instanceof FormData)return this.bracketNotation.deserialize(Array.from(e.entries()));if(We(e))return Vt(e,{value:async(t)=>t,error:async(t)=>{if(t instanceof Fe&&lr(t.data))return ur(t.data,{cause:t});return t}});return e}}var Hc;var Bm=s(()=>{Nm();xm();rt();gr();Fc();_o();Hc=class Hc extends Ln{constructor(e,t,o){let n=new Rm(o),r=new Gc({maxBracketNotationArrayIndex:4294967294}),i=new Gm(n,r),a=new Km(e,i,o);super(a,t,o)}}});var Mc;var Fm=s(()=>{Dm();Bm();Mc=class Mc extends Hc{constructor(e,t){let o=new Rc(t);super(e,o,t)}}});var Hm=`## Overview
|
|
66
|
+
`,t}function Jt(e,t){if(t.id===void 0&&t.retry===void 0&&!t.comments?.length)return e;if(t.id!==void 0)fm(t.id);if(t.retry!==void 0)km(t.retry);if(t.comments!==void 0)for(let o of t.comments)$m(o);return new Proxy(e,{get(o,n,r){if(n===wm)return t;return Reflect.get(o,n,r)}})}function hr(e){return Ye(e)?Reflect.get(e,wm):void 0}function _m(e,t="inline"){let o=e.replace(/[^\x20-\x7E]/g,"_").replace(/"/g,"\\\""),n=encodeURIComponent(e).replace(/['()*]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(r,i)=>String.fromCharCode(Number.parseInt(i,16)));return`${t}; filename="${o}"; filename*=utf-8''${n}`}function Om(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==="string")return dm(t[2]);let o=e.match(/filename="((?:\\"|[^"])*)"/i);if(o&&typeof o[1]==="string")return o[1].replace(/\\"/g,'"')}function Nn(e,t){let o={...e};for(let n in t)if(Array.isArray(t[n]))o[n]=[...Ht(o[n]),...t[n]];else if(t[n]!==void 0)if(Array.isArray(o[n]))o[n]=[...o[n],t[n]];else if(o[n]!==void 0)o[n]=[o[n],t[n]];else o[n]=t[n];return o}var $o,vm,Be,Nc,wm;var _o=d(()=>{rt();$o=class $o extends TypeError{};vm=class vm extends TypeError{};Be=class Be extends Error{data;constructor(e){super(e?.message??"An error event was received",e);this.data=e?.data}};Nc=class Nc extends TransformStream{constructor(){let e;super({start(t){e=new Im({onEvent:(o)=>{t.enqueue(o)}})},transform(t){e.feed(t)},flush(){e.end()}})}};wm=Symbol("ORPC_EVENT_SOURCE_META")});function Vt(e,t){let o=async(n)=>{let r=await t.error(n);if(r!==n){let i=hr(n);if(i&&Ye(r))r=Jt(r,i)}return r};return new At(async()=>{let{done:n,value:r}=await(async()=>{try{return await e.next()}catch(a){throw await o(a)}})(),i=await t.value(r,n);if(i!==r){let a=hr(r);if(a&&Ye(i))i=Jt(i,a)}return{done:n,value:i}},async()=>{try{await e.return?.()}catch(n){throw await o(n)}})}var Lc=d(()=>{rt();_o()});function tP(e){return{...e,context:e.context??{}}}function Cc(e,t={}){let o=t.path??[],r=new Proxy(async(...[i,a={}])=>{return await e.call(o,i,tP(a))},{get(i,a){if(typeof a!=="string")return Reflect.get(i,a);return Cc(e,{...t,path:[...o,a]})}});return Tc(r)}var gr=d(()=>{rt();Dc();Lc()});function rP(e,t={}){let n=e?.pipeThrough(new TextDecoderStream).pipeThrough(new Nc)?.getReader(),r,i=!1;return new At(async()=>{r??=An("consume_event_iterator_stream");try{while(!0){if(n===void 0)return{done:!0,value:void 0};let{done:a,value:c}=await Bt(r,()=>n.read());if(a){if(i)throw new wc("Stream was cancelled");return{done:!0,value:void 0}}switch(c.event){case"message":{let u=Io(c.data);if(Ye(u))u=Jt(u,c);return r?.addEvent("message"),{done:!1,value:u}}case"error":{let u=new Be({data:Io(c.data)});throw u=Jt(u,c),r?.addEvent("error"),u}case"done":{let u=Io(c.data);if(Ye(u))u=Jt(u,c);return r?.addEvent("done"),{done:!0,value:u}}default:r?.addEvent("maybe_keepalive")}}}catch(a){if(!(a instanceof Be))Pt(r,a,t);throw a}},async(a)=>{try{if(a!=="next")i=!0,r?.addEvent("cancelled");await Bt(r,()=>n?.cancel())}catch(c){throw Pt(r,c,t),c}finally{r?.end()}})}function oP(e,t={}){let o=t.eventIteratorKeepAliveEnabled??!0,n=t.eventIteratorKeepAliveInterval??5000,r=t.eventIteratorKeepAliveComment??"",i=t.eventIteratorInitialCommentEnabled??!0,a=t.eventIteratorInitialComment??"",c=!1,u,h;return new ReadableStream({start(g){if(h=An("stream_event_iterator"),i)g.enqueue(wo({comments:[a]}))},async pull(g){try{if(o)u=setInterval(()=>{g.enqueue(wo({comments:[r]})),h?.addEvent("keepalive")},n);let b=await Bt(h,()=>e.next());if(clearInterval(u),c)return;let y=hr(b.value);if(!b.done||b.value!==void 0||y!==void 0){let _=b.done?"done":"message";g.enqueue(wo({...y,event:_,data:cr(b.value)})),h?.addEvent(_)}if(b.done)g.close(),h?.end()}catch(b){if(clearInterval(u),c)return;if(b instanceof Be)g.enqueue(wo({...hr(b),event:"error",data:cr(b.data)})),h?.addEvent("error"),g.close();else Pt(h,b),g.error(b);h?.end()}},async cancel(){try{c=!0,clearInterval(u),h?.addEvent("cancelled"),await Bt(h,()=>e.return?.())}catch(g){throw Pt(h,g),g}finally{h?.end()}}}).pipeThrough(new TextEncoderStream)}function nP(e,t={}){return Mt({name:"parse_standard_body",signal:t.signal},async()=>{let o=e.headers.get("content-disposition");if(typeof o==="string"){let i=Om(o)??"blob",a=await e.blob();return new File([a],i,{type:a.type})}let n=e.headers.get("content-type");if(!n||n.startsWith("application/json")){let i=await e.text();return Io(i)}if(n.startsWith("multipart/form-data"))return await e.formData();if(n.startsWith("application/x-www-form-urlencoded")){let i=await e.text();return new URLSearchParams(i)}if(n.startsWith("text/event-stream"))return rP(e.body,t);if(n.startsWith("text/plain"))return await e.text();let r=await e.blob();return new File([r],"blob",{type:r.type})})}function iP(e,t,o={}){if(e instanceof ReadableStream)return e;let n=t.get("content-disposition");if(t.delete("content-type"),t.delete("content-disposition"),e===void 0)return;if(e instanceof Blob)return t.set("content-type",e.type),t.set("content-length",e.size.toString()),t.set("content-disposition",n??_m(e instanceof File?e.name:"blob")),e;if(e instanceof FormData)return e;if(e instanceof URLSearchParams)return e;if(We(e))return t.set("content-type","text/event-stream"),oP(e,o);return t.set("content-type","application/json"),cr(e)}function xc(e,t={}){return e.forEach((o,n)=>{if(Array.isArray(t[n]))t[n].push(o);else if(t[n]!==void 0)t[n]=[t[n],o];else t[n]=o}),t}function aP(e,t=new Headers){for(let[o,n]of Object.entries(e))if(Array.isArray(n))for(let r of n)t.append(o,r);else if(n!==void 0)t.append(o,n);return t}function Sm(e,t={}){let o=aP(e.headers),n=iP(e.body,o,t);return new Request(e.url,{signal:e.signal,method:e.method,headers:o,body:n})}function Tm(e,t={}){return{body:Pn(()=>nP(e,t)),status:e.status,get headers(){let o=xc(e.headers);return Object.defineProperty(this,"headers",{value:o,writable:!0}),o},set headers(o){Object.defineProperty(this,"headers",{value:o,writable:!0})}}}var zc=d(()=>{rt();_o()});class Oo{plugins;constructor(e=[]){this.plugins=[...e].sort((t,o)=>(t.order??0)-(o.order??0))}init(e){for(let t of this.plugins)t.init?.(e)}}class Ln{constructor(e,t,o={}){this.codec=e,this.sender=t,new Oo(o.plugins).init(o),this.interceptors=Ht(o.interceptors),this.clientInterceptors=Ht(o.clientInterceptors)}interceptors;clientInterceptors;call(e,t,o){return Mt({name:`${$c}.${e.join("/")}`,signal:o.signal},(n)=>{if(n?.setAttribute("rpc.system",$c),n?.setAttribute("rpc.method",e.join(".")),We(t))t=_c({name:"consume_event_iterator_input",signal:o.signal},t);return vo(this.interceptors,{...o,path:e,input:t},async({path:r,input:i,...a})=>{let c=po(),u,h=c?.trace.getActiveSpan()??n;if(h&&c)u=c?.trace.setSpan(c.context.active(),h);let s=await Mt({name:"encode_request",context:u},()=>this.codec.encode(r,i,a)),g=await vo(this.clientInterceptors,{...a,input:i,path:r,request:s},({input:y,path:_,request:S,...H})=>{return Mt({name:"send_request",signal:H.signal,context:u},()=>this.sender.call(S,H,_,y))}),b=await Mt({name:"decode_response",context:u},()=>this.codec.decode(g,a,r,i));if(We(b))return _c({name:"consume_event_iterator_output",signal:a.signal},b);return b})})}}function Cn(e){return`/${e.map(encodeURIComponent).join("/")}`}function jc(e){if(typeof e.forEach==="function")return xc(e);return e}function Ec(e){return Object.entries(fo).find(([,t])=>t.status===e)?.[0]??"MALFORMED_ORPC_ERROR_RESPONSE"}class Pm{constructor(e){this.jsonSerializer=e}serialize(e){if(We(e))return Vt(e,{value:async(t)=>this.#e(t,!1),error:async(t)=>{return new Be({data:this.#e(ko(t).toJSON(),!1),cause:t})}});return this.#e(e,!0)}#e(e,t){let[o,n,r,i]=this.jsonSerializer.serialize(e),a=n.length===0?void 0:n;if(!t||i.length===0)return{json:o,meta:a};let c=new FormData;return c.set("data",cr({json:o,meta:a,maps:r})),i.forEach((u,h)=>{c.set(h.toString(),u)}),c}deserialize(e){if(We(e))return Vt(e,{value:async(t)=>this.#t(t),error:async(t)=>{if(!(t instanceof Be))return t;let o=this.#t(t.data);if(lr(o))return ur(o,{cause:t});return new Be({data:o,cause:t})}});return this.#t(e)}#t(e){if(e===void 0)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);let t=JSON.parse(e.get("data"));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,(o)=>e.get(o.toString()))}}var Uc=d(()=>{rt();_o();Dc();zc();Lc()});class Rc{fetch;toFetchRequestOptions;adapterInterceptors;constructor(e){new Am(e.plugins).initRuntimeAdapter(e),this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e,this.adapterInterceptors=Ht(e.adapterInterceptors)}async call(e,t,o,n){let r=Sm(e,this.toFetchRequestOptions),i=await vo(this.adapterInterceptors,{...t,request:r,path:o,input:n,init:{redirect:"manual"}},({request:c,path:u,input:h,init:s,...g})=>this.fetch(c,s,g,u,h));return Tm(i,{signal:r.signal})}}var Am;var Dm=d(()=>{rt();zc();Uc();Am=class Am extends Oo{initRuntimeAdapter(e){for(let t of this.plugins)t.initRuntimeAdapter?.(e)}}});var Nm=d(()=>{Uc()});class Fc{maxArrayIndex;constructor(e={}){this.maxArrayIndex=e.maxBracketNotationArrayIndex??9999}serialize(e,t=[],o=[]){if(Array.isArray(e))e.forEach((n,r)=>{this.serialize(n,[...t,r],o)});else if(Ge(e))for(let n in e)this.serialize(e[n],[...t,n],o);else o.push([this.stringifyPath(t),e]);return o}deserialize(e){if(e.length===0)return{};let t=new WeakSet,o={value:[]};for(let[n,r]of e){let i=this.parsePath(n),a=o,c="value";if(i.forEach((u,h)=>{if(!Array.isArray(a[c])&&!Ge(a[c]))a[c]=[];if(h!==i.length-1){if(Array.isArray(a[c])&&!Lm(u,this.maxArrayIndex))if(t.has(a[c]))t.delete(a[c]),a[c]=Cm(a[c]);else a[c]=Kc(a[c])}else if(Array.isArray(a[c])){if(u===""){if(a[c].length&&!t.has(a[c]))a[c]=Kc(a[c])}else if(t.has(a[c]))t.delete(a[c]),a[c]=Cm(a[c]);else if(!Lm(u,this.maxArrayIndex))a[c]=Kc(a[c])}a=a[c],c=u}),Array.isArray(a)&&c==="")t.add(a),a.push(r);else if(c in a)if(Array.isArray(a[c]))a[c].push(r);else a[c]=[a[c],r];else a[c]=r}return o.value}stringifyPath(e){return e.map((t)=>{return t.toString().replace(/[\\[\]]/g,(o)=>{switch(o){case"\\":return"\\\\";case"[":return"\\[";case"]":return"\\]";default:return o}})}).reduce((t,o,n)=>{if(n===0)return o;return`${t}[${o}]`},"")}parsePath(e){let t=[],o=!1,n="",r=0;for(let i=0;i<e.length;i++){let a=e[i],c=e[i+1];if(o&&a==="]"&&(c===void 0||c==="[")&&r%2===0){if(c===void 0)o=!1;t.push(n),n="",i++}else if(t.length===0&&a==="["&&r%2===0)o=!0,t.push(n),n="";else if(a==="\\")r++;else n+="\\".repeat(r/2)+a,r=0}return o||t.length===0?[e]:t}}function Lm(e,t){return/^0$|^[1-9]\d*$/.test(e)&&Number(e)<=t}function Kc(e){let t=new Sc;return e.forEach((o,n)=>{t[n]=o}),t}function Cm(e){let t=new Sc;return t[""]=e.length===1?e[0]:e,t}var xm=d(()=>{rt()});function Gc(e,t){return{...e,...t}}class So{"~orpc";constructor(e){if(e.route?.successStatus&&mt(e.route.successStatus))throw Error("[ContractProcedure] Invalid successStatus.");if(Object.values(e.errorMap).some((t)=>t&&t.status&&!mt(t.status)))throw Error("[ContractProcedure] Invalid error status code.");this["~orpc"]=e}}function To(e){if(e instanceof So)return!0;return(typeof e==="object"||typeof e==="function")&&e!==null&&"~orpc"in e&&typeof e["~orpc"]==="object"&&e["~orpc"]!==null&&"errorMap"in e["~orpc"]&&"route"in e["~orpc"]&&"meta"in e["~orpc"]}var zm=d(()=>{gr()});function lP(e,t){return{...e,...t}}function uP(e,t){return{...e,...t}}function hP(e,t){if(!e.path)return e;return{...e,path:`${t}${e.path}`}}function gP(e,t){return{...e,tags:[...t,...e.tags??[]]}}function sP(e,t){return e?`${e}${t}`:t}function dP(e,t){return e?[...e,...t]:t}function bP(e,t){let o=e;if(t.prefix)o=hP(o,t.prefix);if(t.tags?.length)o=gP(o,t.tags);return o}function jm(e,t){if(To(e))return new So({...e["~orpc"],errorMap:Gc(t.errorMap,e["~orpc"].errorMap),route:bP(e["~orpc"].route,t)});if(typeof e!=="object"||e===null)return e;let o={};for(let n in e)o[n]=jm(e[n],t);return o}function Po(e,t){if(t===void 0)return yP[e];return t}var He,Em,yP,oU;var Bc=d(()=>{zm();gr();He=class He extends So{constructor(e){super(e);this["~orpc"].prefix=e.prefix,this["~orpc"].tags=e.tags}$meta(e){return new He({...this["~orpc"],meta:e})}$route(e){return new He({...this["~orpc"],route:e})}$input(e){return new He({...this["~orpc"],inputSchema:e})}errors(e){return new He({...this["~orpc"],errorMap:Gc(this["~orpc"].errorMap,e)})}meta(e){return new He({...this["~orpc"],meta:lP(this["~orpc"].meta,e)})}route(e){return new He({...this["~orpc"],route:uP(this["~orpc"].route,e)})}input(e){return new He({...this["~orpc"],inputSchema:e})}output(e){return new He({...this["~orpc"],outputSchema:e})}prefix(e){return new He({...this["~orpc"],prefix:sP(this["~orpc"].prefix,e)})}tag(...e){return new He({...this["~orpc"],tags:dP(this["~orpc"].tags,e)})}router(e){return jm(e,this["~orpc"])}};Em=new He({errorMap:{},route:{},meta:{}}),yP={defaultMethod:"POST",defaultSuccessStatus:200,defaultSuccessDescription:"OK",defaultInputStructure:"compact",defaultOutputStructure:"compact"};oU=Symbol("ORPC_EVENT_ITERATOR_DETAILS")});class Rm{customSerializers;constructor(e={}){this.customSerializers=e.customJsonSerializers??[]}serialize(e,t={value:!1}){for(let o of this.customSerializers)if(o.condition(e))return this.serialize(o.serialize(e),t);if(e instanceof Blob)return t.value=!0,[e,t.value];if(e instanceof Set)return this.serialize(Array.from(e),t);if(e instanceof Map)return this.serialize(Array.from(e.entries()),t);if(Array.isArray(e))return[e.map((n)=>n===void 0?null:this.serialize(n,t)[0]),t.value];if(Ge(e)){let o={};for(let n in e){if(n==="toJSON"&&typeof e[n]==="function")continue;o[n]=this.serialize(e[n],t)[0]}return[o,t.value]}if(typeof e==="bigint"||e instanceof RegExp||e instanceof URL)return[e.toString(),t.value];if(e instanceof Date)return[Number.isNaN(e.getTime())?null:e.toISOString(),t.value];if(Number.isNaN(e))return[null,t.value];return[e,t.value]}}function Hc(e){return`/${e.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")}`}function Um(e){return e?Hc(e).match(/\/\{[^}]+\}/g)?.map((t)=>({raw:t,name:t.match(/\{\+?([^}]+)\}/)[1]})):void 0}class Km{constructor(e,t,o){this.contract=e,this.serializer=t,this.baseUrl=o.url,this.headers=o.headers??{},this.customErrorResponseBodyDecoder=o.customErrorResponseBodyDecoder}baseUrl;headers;customErrorResponseBodyDecoder;async encode(e,t,o){let n=jc(await Dn(this.headers,o,e,t));if(o.lastEventId!==void 0)n=Nn(n,{"last-event-id":o.lastEventId});let r=await Dn(this.baseUrl,o,e,t),i=Oc(this.contract,e);if(!To(i))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${e.join(".")}`);return Po("defaultInputStructure",i["~orpc"].route.inputStructure)==="compact"?this.#e(i,e,t,o,r,n):this.#t(i,e,t,o,r,n)}#e(e,t,o,n,r,i){let a=Hc(e["~orpc"].route.path??Cn(t)),c=o,u=Um(a);if(u?.length){if(!Ge(o))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${t.join(".")}.`);let g={...o};for(let b of u){let y=o[b.name];a=a.replace(b.raw,`/${encodeURIComponent(`${this.serializer.serialize(y)}`)}`),delete g[b.name]}c=Object.keys(g).length?g:void 0}let h=Po("defaultMethod",e["~orpc"].route.method),s=new URL(r);if(s.pathname=`${s.pathname.replace(/\/$/,"")}${a}`,h==="GET"){let g=this.serializer.serialize(c,{outputFormat:"URLSearchParams"});for(let[b,y]of g)s.searchParams.append(b,y);return{url:s,method:h,headers:i,body:void 0,signal:n.signal}}return{url:s,method:h,headers:i,body:this.serializer.serialize(c),signal:n.signal}}#t(e,t,o,n,r,i){let a=Hc(e["~orpc"].route.path??Cn(t)),c=Um(a);if(!Ge(o)&&o!==void 0)throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${t.join(".")}.`);if(c?.length){if(!Ge(o?.params))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${t.join(".")}.`);for(let g of c){let b=o.params[g.name];a=a.replace(g.raw,`/${encodeURIComponent(`${this.serializer.serialize(b)}`)}`)}}let u=i;if(o?.headers!==void 0){if(!Ge(o.headers))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${t.join(".")}.`);u=Nn(o.headers,i)}let h=Po("defaultMethod",e["~orpc"].route.method),s=new URL(r);if(s.pathname=`${s.pathname.replace(/\/$/,"")}${a}`,o?.query!==void 0){let g=this.serializer.serialize(o.query,{outputFormat:"URLSearchParams"});for(let[b,y]of g)s.searchParams.append(b,y)}if(h==="GET")return{url:s,method:h,headers:u,body:void 0,signal:n.signal};return{url:s,method:h,headers:u,body:this.serializer.serialize(o?.body),signal:n.signal}}async decode(e,t,o){let n=!mt(e.status),r=await(async()=>{let c=!1;try{let u=await e.body();return c=!0,this.serializer.deserialize(u)}catch(u){if(!c)throw Error("Cannot parse response body, please check the response body and content-type.",{cause:u});throw Error("Invalid OpenAPI response format.",{cause:u})}})();if(!n){let c=this.customErrorResponseBodyDecoder?.(r,e);if(c!==null&&c!==void 0)throw c;if(lr(r))throw ur(r);throw new ye(Ec(e.status),{status:e.status,data:{...e,body:r}})}let i=Oc(this.contract,o);if(!To(i))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${o.join(".")}`);if(Po("defaultOutputStructure",i["~orpc"].route.outputStructure)==="compact")return r;return{status:e.status,headers:e.headers,body:r}}}class Fm{constructor(e,t){this.jsonSerializer=e,this.bracketNotation=t}serialize(e,t={}){if(We(e)&&!t.outputFormat)return Vt(e,{value:async(o)=>this.#e(o,{outputFormat:"plain"}),error:async(o)=>{return new Be({data:this.#e(ko(o).toJSON(),{outputFormat:"plain"}),cause:o})}});return this.#e(e,t)}#e(e,t){let[o,n]=this.jsonSerializer.serialize(e);if(t.outputFormat==="plain")return o;if(t.outputFormat==="URLSearchParams"){let i=new URLSearchParams;for(let[a,c]of this.bracketNotation.serialize(o))if(typeof c==="string"||typeof c==="number"||typeof c==="boolean")i.append(a,c.toString());return i}if(o instanceof Blob||o===void 0||!n)return o;let r=new FormData;for(let[i,a]of this.bracketNotation.serialize(o))if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")r.append(i,a.toString());else if(a instanceof Blob)r.append(i,a);return r}deserialize(e){if(e instanceof URLSearchParams||e instanceof FormData)return this.bracketNotation.deserialize(Array.from(e.entries()));if(We(e))return Vt(e,{value:async(t)=>t,error:async(t)=>{if(t instanceof Be&&lr(t.data))return ur(t.data,{cause:t});return t}});return e}}var Mc;var Gm=d(()=>{Nm();xm();rt();gr();Bc();_o();Mc=class Mc extends Ln{constructor(e,t,o){let n=new Rm(o),r=new Fc({maxBracketNotationArrayIndex:4294967294}),i=new Fm(n,r),a=new Km(e,i,o);super(a,t,o)}}});var Jc;var Bm=d(()=>{Dm();Gm();Jc=class Jc extends Mc{constructor(e,t){let o=new Rc(t);super(e,o,t)}}});var Mm=`## Overview
|
|
67
67
|
|
|
68
68
|
Stream your Cloudflare Workers logs and traces directly to Sazabi for edge network observability. Monitor Workers executions, binding calls, and fetch requests with real-time AI-powered analysis.
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## How it works
|
|
71
71
|
|
|
72
|
-
Each Worker can opt in to logs and/or traces independently. Selecting a
|
|
73
|
-
Worker signal in the streams modal provisions a single Cloudflare
|
|
74
|
-
Workers Observability destination plus a per-stream public key. The
|
|
75
|
-
destinations are named:
|
|
72
|
+
Each Worker can opt in to logs and/or traces independently. Selecting a Worker signal in the streams modal provisions a single Cloudflare Workers Observability destination plus a per-stream public key. The destinations are named:
|
|
76
73
|
|
|
77
74
|
- \`sazabi-workers-logs-<scriptName>-<suffix>\`
|
|
78
75
|
- \`sazabi-workers-traces-<scriptName>-<suffix>\`
|
|
79
76
|
|
|
80
|
-
Each Worker must
|
|
81
|
-
own Wrangler config. Cloudflare ignores destinations the Worker hasn't
|
|
82
|
-
explicitly listed, so until this is in place the destination shows
|
|
83
|
-
"Never run" in the Cloudflare dashboard.
|
|
77
|
+
Each Worker must reference those destination names in its own Wrangler config. Cloudflare ignores destinations the Worker has not explicitly listed, so until this is in place the destination shows "Never run" in the Cloudflare dashboard.
|
|
84
78
|
|
|
85
79
|
**\`wrangler.jsonc\`:**
|
|
86
80
|
|
|
@@ -112,16 +106,19 @@ enabled = true
|
|
|
112
106
|
destinations = [ "sazabi-workers-traces-<scriptName>-<suffix>" ]
|
|
113
107
|
\`\`\`
|
|
114
108
|
|
|
115
|
-
The exact destination name appears on each stream's detail page after
|
|
116
|
-
|
|
109
|
+
The exact destination name appears on each stream's detail page after provisioning.
|
|
110
|
+
|
|
111
|
+
## Features
|
|
117
112
|
|
|
118
|
-
|
|
113
|
+
- Workers logs and traces forwarded via Workers Observability destinations
|
|
114
|
+
- Independent opt-in per Worker and per signal type (logs or traces)
|
|
115
|
+
- Optional Logpush job for Enterprise Cloudflare accounts preferring the push delivery path
|
|
116
|
+
|
|
117
|
+
## Requirements
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Cloudflare customers.
|
|
124
|
-
`;var Jm=()=>{};var Vm=`# Cloudflare Data Source Setup
|
|
119
|
+
- Edit access to each Worker's \`wrangler.jsonc\` or \`wrangler.toml\` configuration file
|
|
120
|
+
- Cloudflare account permissions to enable Workers Observability destinations
|
|
121
|
+
- Enterprise Cloudflare plan required for the Logpush delivery path`;var Hm=()=>{};var Vm=`# Cloudflare Data Source Setup
|
|
125
122
|
|
|
126
123
|
You can automate Cloudflare ingestion through Sazabi’s **native API token onboarding** plus managed Logpush / Workers Observability streams, **or** create a standalone **manual Logpush → HTTP job**.
|
|
127
124
|
|
|
@@ -155,7 +152,7 @@ Without native automation you can manually create Cloudflare Logpush jobs:
|
|
|
155
152
|
## Verification
|
|
156
153
|
|
|
157
154
|
Send representative traffic (HTTP requests, Worker invocations) and confirm matching normalized events in Sazabi.
|
|
158
|
-
`;var
|
|
155
|
+
`;var Jm=()=>{};var Wm=`## Overview
|
|
159
156
|
|
|
160
157
|
Stream your AWS CloudWatch logs directly to Sazabi for real-time analysis, alerting, and AI-powered incident investigation. CloudWatch integration forwards logs from any CloudWatch Log Group to Sazabi using subscription filters.
|
|
161
158
|
|
|
@@ -165,10 +162,19 @@ Connect your AWS account by creating an IAM role that Sazabi can assume. The rol
|
|
|
165
162
|
|
|
166
163
|
Once connected, you can select which log groups to forward to Sazabi. Logs are streamed in real-time via CloudWatch subscription filters to our observability platform. Our AI agents automatically analyze log patterns, detect anomalies, and identify root causes of issues.
|
|
167
164
|
|
|
168
|
-
##
|
|
165
|
+
## Features
|
|
166
|
+
|
|
167
|
+
- Subscription-filter delivery of logs from any CloudWatch Log Group in real-time
|
|
168
|
+
- Multi-region support: connect log groups across AWS regions
|
|
169
|
+
- Selective log-group forwarding — choose which groups stream to Sazabi
|
|
170
|
+
- AI-powered anomaly detection and root-cause analysis
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- AWS account access with permissions to create IAM roles
|
|
175
|
+
- Ability to create and manage CloudFormation stacks, run Terraform, or use the AWS CLI to provision the Sazabi IAM role
|
|
176
|
+
- IAM role creation rights with \`logs:PutSubscriptionFilter\` and related CloudWatch Logs permissions granted to the role
|
|
177
|
+
- A workspace admin to enable the integration in Sazabi settings`;var qm=()=>{};var Xm=`# CloudWatch Data Source Setup
|
|
172
178
|
|
|
173
179
|
Walk the user through connecting AWS CloudWatch Logs to a Sazabi project via a customer-owned **cross-account IAM role**. Sazabi assumes that role to install per-log-group subscription filters that forward logs to a Sazabi-managed CloudWatch destination.
|
|
174
180
|
|
|
@@ -482,10 +488,19 @@ Connect your Convex account by configuring a log stream that forwards logs to Sa
|
|
|
482
488
|
|
|
483
489
|
Once connected, logs are streamed in real-time using Convex's log stream feature. Our AI agents analyze function executions, scheduled function activity, and \`console.log\` events to detect anomalies and help you troubleshoot issues across your Convex deployments.
|
|
484
490
|
|
|
485
|
-
##
|
|
491
|
+
## Features
|
|
486
492
|
|
|
487
|
-
|
|
488
|
-
`;var Zm=()=>{};var tp="# Convex Data Source Setup\n\nWalk the user through connecting **Convex** deployments to a Sazabi project using a Convex **team access token** plus the Sazabi CLI. Stream creation enqueues the Convex backend's `provisionStream`, which mints a per-deployment deploy key, registers a webhook log stream on each Convex deployment, and points it at the Sazabi datasource-scoped intake host. Log streaming requires a Convex **Professional** plan.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating the team token in the Convex UI, choosing the Sazabi project, or picking which Convex deployments to monitor. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, pasting the team token, picking deployments.\n- Never echo `CONVEX_TEAM_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n- The team token is a JWT starting with `eyJ...`. Reject deploy keys (`prod:...`, `dev:...`, `preview:...`) — Sazabi mints its own per-deployment deploy keys via the Convex Management API.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI=\"sazabi\"\nelse\n SAZABI_CLI=\"bunx @sazabi/cli\"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to the Convex Management API in Phase 3.\n\nCheck authentication:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf authentication fails, ask the user whether to authenticate via `auth login` (browser) or `auth save <token>` (existing secret key). Do not print tokens back to the user.\n\nThe user needs:\n\n1. A Sazabi project to receive the Convex telemetry.\n2. A Convex team on the **Professional** plan. Log streaming returns `LogStreamingNotEnabled` on Starter/Free teams.\n3. Access to the Convex deployments they want to monitor.\n4. A browser to create a Convex team access token.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the Convex telemetry? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use \"$SAZABI_PROJECT_ID\"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing Convex connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type convex --json\n```\n\nIf a Convex connection already exists that targets the Convex team the user wants to onboard, reuse its `id` as `CONVEX_CONNECTION_ID` and skip Phase 4 — still run Phase 2 to capture and validate the team token (the list response does not expose the decrypted team token, so Phase 3's Management API calls still need a freshly pasted `CONVEX_TEAM_TOKEN`), then continue into Phase 3 and Phase 5 to add new streams. Do not create a duplicate connection for the same Convex team.\n\n## Phase 2: Create and capture the Convex team token\n\nDirect the user to create the token:\n\n> Open **https://dashboard.convex.dev/team/settings/access-tokens** and click **Generate access token**.\n>\n> - **Token Name**: `Sazabi`\n> - **Permission**: This is a team-scoped token; it inherits the creator's team permissions. The creator must be a team admin or have permission to manage deployments in the team you want to monitor.\n>\n> Copy the token immediately — Convex only shows it once. The token is a JWT and starts with `eyJ`.\n\n`AskUserQuestion`: ask the user to paste the team access token. Capture it as `CONVEX_TEAM_TOKEN`.\n\nSanity-check the token before discovering deployments. The Management API's `/v1/token_details` returns the team the token is bound to:\n\n```sh\nif TOKEN_DETAILS=$(curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n https://api.convex.dev/v1/token_details 2>/dev/null); then\n CONVEX_TEAM_ID=$(jq -r '.teamId' <<<\"$TOKEN_DETAILS\")\nelse\n CONVEX_TEAM_ID=\"\"\nfi\n```\n\nIf the call fails or `CONVEX_TEAM_ID` is empty/`null`, the token was revoked, copied incorrectly, or is not a team access token. Have the user regenerate it and retry. Do not print `CONVEX_TEAM_TOKEN` in any error output.\n\nConvex team access tokens are scoped to **exactly one team**. If the user wants to onboard deployments from multiple Convex teams, run this skill once per team — each run produces a separate Sazabi connection.\n\nCapture a display name for the team. Convex does not expose a team-name endpoint to token holders; fall back to `Team ${CONVEX_TEAM_ID}` if the user has no preferred label:\n\n```sh\nCONVEX_TEAM_NAME=\"Team ${CONVEX_TEAM_ID}\"\n```\n\n## Phase 3: Discover and pick Convex deployments\n\nEnumerate the team's projects, then enumerate each project's deployments. Reuse the exact `deployment.name` slug (e.g. `sleek-bear-350`) as `deploymentId` — that is the identifier the Convex log-streams API expects.\n\n```sh\nPROJECTS_JSON=$(curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n \"https://api.convex.dev/v1/teams/${CONVEX_TEAM_ID}/list_projects\")\n\n# Emits one row per deployment: deploymentName<TAB>projectName<TAB>deploymentType\nDEPLOYMENTS_TSV=$(jq -r '.[] | \"\\(.id)\\t\\(.name)\"' <<<\"$PROJECTS_JSON\" \\\n | while IFS=$'\\t' read -r PROJECT_ID PROJECT_NAME; do\n curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n \"https://api.convex.dev/v1/projects/${PROJECT_ID}/list_deployments\" \\\n | jq -r --arg pname \"$PROJECT_NAME\" \\\n '.[] | \"\\(.name)\\t\\($pname)\\t\\(.deploymentType)\"'\n done)\n\nprintf '%s\\n' \"$DEPLOYMENTS_TSV\"\n```\n\nGroup the rows by `projectName` and present them to the user. The `deploymentType` is one of `prod`, `dev`, `preview`.\n\n`AskUserQuestion`: which Convex deployments should Sazabi connect? One Sazabi stream is created per selected deployment.\n\nFor each selected row, build `(DEPLOYMENT_ID, DEPLOYMENT_DISPLAY_NAME)`:\n\n- `DEPLOYMENT_ID` = the deployment slug (column 1, e.g. `sleek-bear-350`). This is the value passed to Convex's `/api/v1/create_log_stream`.\n- `DEPLOYMENT_DISPLAY_NAME` = `<projectName> (<deploymentType>)` (e.g. `web (prod)`). This becomes both the stream's `displayName` and `config.deploymentName`.\n\nCollect these into a list `CONVEX_DEPLOYMENTS` for use in Phase 5.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection. The metadata schema lives in `convexMetadataSchema` — only `accessToken`, `teamId`, and `teamName` are persisted:\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token \"$CONVEX_TEAM_TOKEN\" \\\n --arg teamId \"$CONVEX_TEAM_ID\" \\\n --arg name \"$CONVEX_TEAM_NAME\" \\\n '{accessToken: $token, teamId: $teamId, teamName: $name}')\n\nCONVEX_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type convex \\\n --metadata \"$METADATA_JSON\" \\\n --json | jq -r '.connectionId')\n```\n\nThe connection persists the (encrypted) team token and team scope. It does **not** provision any Convex-side log streams on its own — log-stream creation happens per stream in Phase 5.\n\n## Phase 5: Create one stream per Convex deployment\n\nFor each entry in `CONVEX_DEPLOYMENTS`, create a stream. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the Convex backend's `provisionStream`. That activity:\n\n1. Calls `POST https://api.convex.dev/v1/deployments/<deploymentId>/create_deploy_key` with the team token to mint a Sazabi-named deploy key.\n2. Mints a per-stream Sazabi public key.\n3. Calls `POST https://<deploymentId>.convex.cloud/api/v1/create_log_stream` with the deploy key to register a `webhook` / `json` log stream pointed at `https://convex.<projectRegion>.intake.<intakeDomain>/api/v1/convex/ingest?key=<publicKey>`.\n\nThe agent only has to set `deploymentId` and `deploymentName` in the stream `config`. The backend writes back `logStreamId`, `deployKey`, and `publicKeyId` on success.\n\n```sh\n$SAZABI_CLI data-sources streams create \\\n --connection-id \"$CONVEX_CONNECTION_ID\" \\\n --display-name \"$DEPLOYMENT_DISPLAY_NAME\" \\\n --config \"$(jq -nc \\\n --arg id \"$DEPLOYMENT_ID\" \\\n --arg name \"$DEPLOYMENT_DISPLAY_NAME\" \\\n '{deploymentId: $id, deploymentName: $name}')\" \\\n --json\n```\n\nDo **not** set `logStreamId`, `deployKey`, or `publicKeyId` in the initial config — those fields are reserved for the backend's write-back. Reuse the exact `deployment.name` slug returned by `list_deployments` for `deploymentId`; do not invent or reformat it.\n\nIf a stream creation fails because of a duplicate display name on this connection, append the deployment slug (e.g. `\"$DEPLOYMENT_DISPLAY_NAME [$DEPLOYMENT_ID]\"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nLog-stream provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id \"$CONVEX_CONNECTION_ID\" --json\n```\n\nEach stream's status transitions from `pending`/`provisioning` to `active` once the backend finishes calling Convex's `/api/v1/create_log_stream`. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that deployment and surface it to the user.\n\n**Pass 2 — telemetry arrival.** Convex emits log-stream batches only while the deployment is processing requests. Trigger traffic (run a Convex function, hit a deployed endpoint, run `npx convex dev`) and then:\n\n```sh\n$SAZABI_CLI logs tail --json --search convex\n```\n\nConfirm new records arrive tagged with the corresponding `deploymentName`. If nothing appears within a few minutes of triggering traffic, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `CONVEX_CONNECTION_ID` and `CONVEX_TEAM_NAME`.\n- One line per stream: deployment display name, deployment slug, current status.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored, call out the failed deployment slug and offer to recreate just that stream.\n\nDo not include `CONVEX_TEAM_TOKEN` or any minted deploy key in the summary.\n\n## Troubleshooting\n\n### Invalid or expired team access token\n\n`/v1/token_details` returns 401 or `Invalid access token`. The token was revoked, copied incorrectly, or is not a team access token. Regenerate at **https://dashboard.convex.dev/team/settings/access-tokens** and rerun Phase 2. The existing connection record holds a now-stale token — delete the connection and rerun from Phase 4 unless your CLI version supports `connections update` (check `$SAZABI_CLI data-sources connections -h`).\n\n### `LogStreamingNotEnabled`\n\nThe Convex `create_log_stream` API returns `LogStreamingNotEnabled` when the team is not on the **Professional** plan. The user must upgrade at **https://www.convex.dev/plans**. After upgrading, rerun `streams create` for the failed deployments — the connection itself does not need to be recreated.\n\n### Token has no access to expected deployments\n\nConvex team access tokens are scoped to exactly one team and inherit the creator's permissions inside that team. If a project or deployment is missing from `list_projects`/`list_deployments`, either the deployment lives in a different team (run this skill again for that team) or the token's creator does not have the necessary role. Have the user regenerate the token under an account with the right permissions and retry from Phase 2.\n\n### Wrong token shape (deploy key pasted instead of access token)\n\nIf the user pasted a string starting with `prod:`, `dev:`, or `preview:`, that is a deploy key, not a team access token. Deploy keys cannot list teams or projects via the Management API. Have the user generate a team access token (JWT, `eyJ...`) and retry Phase 2.\n\n### Stream config rejected by Sazabi\n\n`streams create` validates `config` against `convexStreamConfigSchema` before insert. If the CLI returns a validation error, check that `deploymentId` and `deploymentName` are non-empty strings and that you did **not** pre-populate `logStreamId`, `deployKey`, or `publicKeyId`. Field names are case-sensitive.\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No telemetry arriving after streams are `active`\n\nAn `active` stream on the Sazabi side only delivers data when the corresponding Convex deployment processes requests. Trigger a function call, deploy, or `console.log` in the deployment. If logs still never arrive, verify the Convex dashboard shows the `Sazabi …` log stream under the deployment's **Log Streams** settings and that its destination URL host is `convex.<region>.intake.<domain>` (not the base regional intake host).\n\n### Manual connection already exists without streams\n\nIf someone previously ran `sazabi data-sources connections create --type convex` without the corresponding `streams create` calls, the connection exists but `streams list --connection-id <id>` returns empty. Reuse the existing `CONVEX_CONNECTION_ID` and continue from Phase 3 to add streams; do not create a second connection for the same Convex team.\n";var ep=()=>{};var op=`## Overview
|
|
493
|
+
- Convex function logs from queries, mutations, actions, and scheduled functions
|
|
494
|
+
- Real-time log streaming via Convex's log stream feature
|
|
495
|
+
- Query, mutation, and action attribution for precise incident tracing
|
|
496
|
+
- AI analysis of \`console.log\` events and function execution patterns
|
|
497
|
+
|
|
498
|
+
## Requirements
|
|
499
|
+
|
|
500
|
+
- A Convex **Pro** plan. Log streaming is not available on the free tier.
|
|
501
|
+
- Access to the Convex deployments you want to monitor
|
|
502
|
+
- Rights to create a team access token from the Convex dashboard
|
|
503
|
+
- A workspace admin to enable the integration in Sazabi settings`;var Zm=()=>{};var tp="# Convex Data Source Setup\n\nWalk the user through connecting **Convex** deployments to a Sazabi project using a Convex **team access token** plus the Sazabi CLI. Stream creation enqueues the Convex backend's `provisionStream`, which mints a per-deployment deploy key, registers a webhook log stream on each Convex deployment, and points it at the Sazabi datasource-scoped intake host. Log streaming requires a Convex **Professional** plan.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating the team token in the Convex UI, choosing the Sazabi project, or picking which Convex deployments to monitor. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, pasting the team token, picking deployments.\n- Never echo `CONVEX_TEAM_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n- The team token is a JWT starting with `eyJ...`. Reject deploy keys (`prod:...`, `dev:...`, `preview:...`) — Sazabi mints its own per-deployment deploy keys via the Convex Management API.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI=\"sazabi\"\nelse\n SAZABI_CLI=\"bunx @sazabi/cli\"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to the Convex Management API in Phase 3.\n\nCheck authentication:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf authentication fails, ask the user whether to authenticate via `auth login` (browser) or `auth save <token>` (existing secret key). Do not print tokens back to the user.\n\nThe user needs:\n\n1. A Sazabi project to receive the Convex telemetry.\n2. A Convex team on the **Professional** plan. Log streaming returns `LogStreamingNotEnabled` on Starter/Free teams.\n3. Access to the Convex deployments they want to monitor.\n4. A browser to create a Convex team access token.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the Convex telemetry? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use \"$SAZABI_PROJECT_ID\"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing Convex connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type convex --json\n```\n\nIf a Convex connection already exists that targets the Convex team the user wants to onboard, reuse its `id` as `CONVEX_CONNECTION_ID` and skip Phase 4 — still run Phase 2 to capture and validate the team token (the list response does not expose the decrypted team token, so Phase 3's Management API calls still need a freshly pasted `CONVEX_TEAM_TOKEN`), then continue into Phase 3 and Phase 5 to add new streams. Do not create a duplicate connection for the same Convex team.\n\n## Phase 2: Create and capture the Convex team token\n\nDirect the user to create the token:\n\n> Open **https://dashboard.convex.dev/team/settings/access-tokens** and click **Generate access token**.\n>\n> - **Token Name**: `Sazabi`\n> - **Permission**: This is a team-scoped token; it inherits the creator's team permissions. The creator must be a team admin or have permission to manage deployments in the team you want to monitor.\n>\n> Copy the token immediately — Convex only shows it once. The token is a JWT and starts with `eyJ`.\n\n`AskUserQuestion`: ask the user to paste the team access token. Capture it as `CONVEX_TEAM_TOKEN`.\n\nSanity-check the token before discovering deployments. The Management API's `/v1/token_details` returns the team the token is bound to:\n\n```sh\nif TOKEN_DETAILS=$(curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n https://api.convex.dev/v1/token_details 2>/dev/null); then\n CONVEX_TEAM_ID=$(jq -r '.teamId' <<<\"$TOKEN_DETAILS\")\nelse\n CONVEX_TEAM_ID=\"\"\nfi\n```\n\nIf the call fails or `CONVEX_TEAM_ID` is empty/`null`, the token was revoked, copied incorrectly, or is not a team access token. Have the user regenerate it and retry. Do not print `CONVEX_TEAM_TOKEN` in any error output.\n\nConvex team access tokens are scoped to **exactly one team**. If the user wants to onboard deployments from multiple Convex teams, run this skill once per team — each run produces a separate Sazabi connection.\n\nCapture a display name for the team. Convex does not expose a team-name endpoint to token holders; fall back to `Team ${CONVEX_TEAM_ID}` if the user has no preferred label:\n\n```sh\nCONVEX_TEAM_NAME=\"Team ${CONVEX_TEAM_ID}\"\n```\n\n## Phase 3: Discover and pick Convex deployments\n\nEnumerate the team's projects, then enumerate each project's deployments. Reuse the exact `deployment.name` slug (e.g. `sleek-bear-350`) as `deploymentId` — that is the identifier the Convex log-streams API expects.\n\n```sh\nPROJECTS_JSON=$(curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n \"https://api.convex.dev/v1/teams/${CONVEX_TEAM_ID}/list_projects\")\n\n# Emits one row per deployment: deploymentName<TAB>projectName<TAB>deploymentType\nDEPLOYMENTS_TSV=$(jq -r '.[] | \"\\(.id)\\t\\(.name)\"' <<<\"$PROJECTS_JSON\" \\\n | while IFS=$'\\t' read -r PROJECT_ID PROJECT_NAME; do\n curl -fsS -H \"Authorization: Bearer $CONVEX_TEAM_TOKEN\" \\\n \"https://api.convex.dev/v1/projects/${PROJECT_ID}/list_deployments\" \\\n | jq -r --arg pname \"$PROJECT_NAME\" \\\n '.[] | \"\\(.name)\\t\\($pname)\\t\\(.deploymentType)\"'\n done)\n\nprintf '%s\\n' \"$DEPLOYMENTS_TSV\"\n```\n\nGroup the rows by `projectName` and present them to the user. The `deploymentType` is one of `prod`, `dev`, `preview`.\n\n`AskUserQuestion`: which Convex deployments should Sazabi connect? One Sazabi stream is created per selected deployment.\n\nFor each selected row, build `(DEPLOYMENT_ID, DEPLOYMENT_DISPLAY_NAME)`:\n\n- `DEPLOYMENT_ID` = the deployment slug (column 1, e.g. `sleek-bear-350`). This is the value passed to Convex's `/api/v1/create_log_stream`.\n- `DEPLOYMENT_DISPLAY_NAME` = `<projectName> (<deploymentType>)` (e.g. `web (prod)`). This becomes both the stream's `displayName` and `config.deploymentName`.\n\nCollect these into a list `CONVEX_DEPLOYMENTS` for use in Phase 5.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection. The metadata schema lives in `convexMetadataSchema` — only `accessToken`, `teamId`, and `teamName` are persisted:\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token \"$CONVEX_TEAM_TOKEN\" \\\n --arg teamId \"$CONVEX_TEAM_ID\" \\\n --arg name \"$CONVEX_TEAM_NAME\" \\\n '{accessToken: $token, teamId: $teamId, teamName: $name}')\n\nCONVEX_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type convex \\\n --metadata \"$METADATA_JSON\" \\\n --json | jq -r '.connectionId')\n```\n\nThe connection persists the (encrypted) team token and team scope. It does **not** provision any Convex-side log streams on its own — log-stream creation happens per stream in Phase 5.\n\n## Phase 5: Create one stream per Convex deployment\n\nFor each entry in `CONVEX_DEPLOYMENTS`, create a stream. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the Convex backend's `provisionStream`. That activity:\n\n1. Calls `POST https://api.convex.dev/v1/deployments/<deploymentId>/create_deploy_key` with the team token to mint a Sazabi-named deploy key.\n2. Mints a per-stream Sazabi public key.\n3. Calls `POST https://<deploymentId>.convex.cloud/api/v1/create_log_stream` with the deploy key to register a `webhook` / `json` log stream pointed at `https://convex.<projectRegion>.intake.<intakeDomain>/api/v1/convex/ingest?key=<publicKey>`.\n\nThe agent only has to set `deploymentId` and `deploymentName` in the stream `config`. The backend writes back `logStreamId`, `deployKey`, and `publicKeyId` on success.\n\n```sh\n$SAZABI_CLI data-sources streams create \\\n --connection-id \"$CONVEX_CONNECTION_ID\" \\\n --display-name \"$DEPLOYMENT_DISPLAY_NAME\" \\\n --config \"$(jq -nc \\\n --arg id \"$DEPLOYMENT_ID\" \\\n --arg name \"$DEPLOYMENT_DISPLAY_NAME\" \\\n '{deploymentId: $id, deploymentName: $name}')\" \\\n --json\n```\n\nDo **not** set `logStreamId`, `deployKey`, or `publicKeyId` in the initial config — those fields are reserved for the backend's write-back. Reuse the exact `deployment.name` slug returned by `list_deployments` for `deploymentId`; do not invent or reformat it.\n\nIf a stream creation fails because of a duplicate display name on this connection, append the deployment slug (e.g. `\"$DEPLOYMENT_DISPLAY_NAME [$DEPLOYMENT_ID]\"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nLog-stream provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id \"$CONVEX_CONNECTION_ID\" --json\n```\n\nEach stream's status transitions from `pending`/`provisioning` to `active` once the backend finishes calling Convex's `/api/v1/create_log_stream`. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that deployment and surface it to the user.\n\n**Pass 2 — telemetry arrival.** Convex emits log-stream batches only while the deployment is processing requests. Trigger traffic (run a Convex function, hit a deployed endpoint, run `npx convex dev`) and then:\n\n```sh\n$SAZABI_CLI logs tail --json --search convex\n```\n\nConfirm new records arrive tagged with the corresponding `deploymentName`. If nothing appears within a few minutes of triggering traffic, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `CONVEX_CONNECTION_ID` and `CONVEX_TEAM_NAME`.\n- One line per stream: deployment display name, deployment slug, current status.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored, call out the failed deployment slug and offer to recreate just that stream.\n\nDo not include `CONVEX_TEAM_TOKEN` or any minted deploy key in the summary.\n\n## Troubleshooting\n\n### Invalid or expired team access token\n\n`/v1/token_details` returns 401 or `Invalid access token`. The token was revoked, copied incorrectly, or is not a team access token. Regenerate at **https://dashboard.convex.dev/team/settings/access-tokens** and rerun Phase 2. The existing connection record holds a now-stale token — delete the connection and rerun from Phase 4 unless your CLI version supports `connections update` (check `$SAZABI_CLI data-sources connections -h`).\n\n### `LogStreamingNotEnabled`\n\nThe Convex `create_log_stream` API returns `LogStreamingNotEnabled` when the team is not on the **Professional** plan. The user must upgrade at **https://www.convex.dev/plans**. After upgrading, rerun `streams create` for the failed deployments — the connection itself does not need to be recreated.\n\n### Token has no access to expected deployments\n\nConvex team access tokens are scoped to exactly one team and inherit the creator's permissions inside that team. If a project or deployment is missing from `list_projects`/`list_deployments`, either the deployment lives in a different team (run this skill again for that team) or the token's creator does not have the necessary role. Have the user regenerate the token under an account with the right permissions and retry from Phase 2.\n\n### Wrong token shape (deploy key pasted instead of access token)\n\nIf the user pasted a string starting with `prod:`, `dev:`, or `preview:`, that is a deploy key, not a team access token. Deploy keys cannot list teams or projects via the Management API. Have the user generate a team access token (JWT, `eyJ...`) and retry Phase 2.\n\n### Stream config rejected by Sazabi\n\n`streams create` validates `config` against `convexStreamConfigSchema` before insert. If the CLI returns a validation error, check that `deploymentId` and `deploymentName` are non-empty strings and that you did **not** pre-populate `logStreamId`, `deployKey`, or `publicKeyId`. Field names are case-sensitive.\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No telemetry arriving after streams are `active`\n\nAn `active` stream on the Sazabi side only delivers data when the corresponding Convex deployment processes requests. Trigger a function call, deploy, or `console.log` in the deployment. If logs still never arrive, verify the Convex dashboard shows the `Sazabi …` log stream under the deployment's **Log Streams** settings and that its destination URL host is `convex.<region>.intake.<domain>` (not the base regional intake host).\n\n### Manual connection already exists without streams\n\nIf someone previously ran `sazabi data-sources connections create --type convex` without the corresponding `streams create` calls, the connection exists but `streams list --connection-id <id>` returns empty. Reuse the existing `CONVEX_CONNECTION_ID` and continue from Phase 3 to add streams; do not create a second connection for the same Convex team.\n";var ep=()=>{};var op=`## Overview
|
|
489
504
|
|
|
490
505
|
Forward your Datadog Agent logs directly to Sazabi for real-time analysis, alerting, and AI-powered incident investigation. The Datadog integration allows you to stream logs from any Datadog Agent deployment to Sazabi's observability platform.
|
|
491
506
|
|
|
@@ -495,10 +510,18 @@ Configure your Datadog Agent to forward logs to Sazabi's intake endpoint using a
|
|
|
495
510
|
|
|
496
511
|
Once configured, logs are streamed in real-time from your Datadog Agent to Sazabi. Our AI agents automatically analyze log patterns, detect anomalies, and identify root causes of issues across your infrastructure.
|
|
497
512
|
|
|
498
|
-
##
|
|
513
|
+
## Features
|
|
499
514
|
|
|
500
|
-
|
|
501
|
-
|
|
515
|
+
- Dual-shipping via \`logs_config.additional_endpoints\` so existing Datadog Agents continue forwarding to Datadog while also sending to Sazabi
|
|
516
|
+
- Dedicated sidecar or container Agent pointed exclusively at Sazabi for isolated log pipelines
|
|
517
|
+
- Full Datadog Agent log metadata preserved: message, status, timestamp, hostname, service, and tags
|
|
518
|
+
|
|
519
|
+
## Requirements
|
|
520
|
+
|
|
521
|
+
- Access to edit the Datadog Agent configuration file or container environment variables
|
|
522
|
+
- For dual-shipping: keep the existing \`api_key\` / \`DD_API_KEY\` as Datadog's key and add Sazabi through \`logs_config.additional_endpoints\` or \`DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS\`
|
|
523
|
+
- For a dedicated Sazabi Agent: set root \`DD_API_KEY\` to the Sazabi public key only when the Agent is not also forwarding to Datadog
|
|
524
|
+
- The \`DD-API-KEY\` header must be populated with your Sazabi public key for Sazabi's intake to authenticate the request`;var rp=()=>{};var ip=`# Datadog Agent Data Source Setup
|
|
502
525
|
|
|
503
526
|
Stream logs from the Datadog Agent to Sazabi. Support both dual-shipping from an existing Agent and dedicated Agent sidecars that send logs only to Sazabi.
|
|
504
527
|
|
|
@@ -560,14 +583,21 @@ Stream telemetry from all your Daytona sandboxes to Sazabi using org-level OpenT
|
|
|
560
583
|
|
|
561
584
|
## How it works
|
|
562
585
|
|
|
563
|
-
Enable the OpenTelemetry card in your Daytona organization's **Settings**. Once configured, Daytona exports OTLP logs, traces, and metrics from all sandboxes to Sazabi's intake endpoint automatically.
|
|
586
|
+
Enable the OpenTelemetry card in your Daytona organization's **Settings**. Once configured, Daytona exports OTLP logs, traces, and metrics from all sandboxes to Sazabi's intake endpoint automatically.
|
|
564
587
|
|
|
565
588
|
AI agents analyze sandbox patterns, detect provisioning issues, and help you optimize your Daytona deployments.
|
|
566
589
|
|
|
567
|
-
##
|
|
590
|
+
## Features
|
|
568
591
|
|
|
569
|
-
|
|
570
|
-
|
|
592
|
+
- Sandbox log and trace forwarding via the Daytona OpenTelemetry card
|
|
593
|
+
- Org-level coverage: all sandboxes forward telemetry once the card is configured
|
|
594
|
+
- OTLP metrics are accepted at intake but not yet persisted in Sazabi
|
|
595
|
+
|
|
596
|
+
## Requirements
|
|
597
|
+
|
|
598
|
+
- Daytona organization owner access to enable the OpenTelemetry card under **Settings**
|
|
599
|
+
- Access to the OpenTelemetry card configuration to enter the Sazabi public key and intake endpoint
|
|
600
|
+
- Sazabi public key and intake endpoint values provided during connection setup`;var ap=()=>{};var up=`# Daytona Data Source Setup
|
|
571
601
|
|
|
572
602
|
Connect Daytona Cloud to a Sazabi project using **organization-level OpenTelemetry forwarding**. Daytona exports OTLP logs and traces from every sandbox in the organization through the **OpenTelemetry** card under **Settings**; there is no per-sandbox SDK install and no provider API token. Sazabi mints a public intake key, the user pastes the OTLP endpoint and \`Authorization: Bearer ...\` header into Daytona, and telemetry begins flowing on the next sandbox start.
|
|
573
603
|
|
|
@@ -763,18 +793,17 @@ Sazabi connects to your DigitalOcean account with a personal access token and co
|
|
|
763
793
|
|
|
764
794
|
Once configured, logs stream automatically from your App Platform components. Our AI agents analyze application health, detect deployment issues, and help you maintain reliability across your apps.
|
|
765
795
|
|
|
766
|
-
## Configuration
|
|
767
|
-
|
|
768
|
-
1. Generate a DigitalOcean personal access token with Full Access scope (or custom scopes that include app read and update permissions).
|
|
769
|
-
2. Connect via the native flow and select the App Platform apps you want to forward logs from.
|
|
770
|
-
3. Sazabi provisions per-stream \`log_destinations\` on each selected app.
|
|
771
|
-
|
|
772
796
|
## Features
|
|
773
797
|
|
|
774
798
|
- Native App Platform log forwarding via \`log_destinations\`
|
|
775
799
|
- Per-component routing for services, workers, and jobs
|
|
776
800
|
- Idempotent per-stream destination naming so multiple Sazabi streams can target the same app
|
|
777
|
-
|
|
801
|
+
|
|
802
|
+
## Requirements
|
|
803
|
+
|
|
804
|
+
- DigitalOcean personal access token with Full Access scope, or a custom token with app read and update permissions
|
|
805
|
+
- Access to select the App Platform apps you want to forward logs from during connection setup
|
|
806
|
+
- Permissions to provision \`log_destinations\` on the selected apps (granted by the token scopes above)`;var hp=()=>{};var dp=`# DigitalOcean Data Source Setup
|
|
778
807
|
|
|
779
808
|
Walk the user through connecting DigitalOcean App Platform apps to a Sazabi project using the Sazabi CLI. The connection holds a DigitalOcean personal access token; each stream points at one App Platform app, and the backend provisions a Datadog-typed \`log_destinations\` entry on every service, worker, and job in that app's spec. Stream creation enqueues a Temporal activity — there is no separate "provision drains" command.
|
|
780
809
|
|
|
@@ -1012,7 +1041,7 @@ This flow only covers App Platform apps. If the user wants telemetry from Drople
|
|
|
1012
1041
|
### Manual connection already exists without streams
|
|
1013
1042
|
|
|
1014
1043
|
If someone previously ran \`sazabi data-sources connections create --type digital_ocean\` without follow-up \`streams create\` calls, the connection exists but \`streams list --connection-id <id>\` returns empty. Reuse the existing \`DO_CONNECTION_ID\` and continue from Phase 5 to add streams; do not create a second connection for the same DigitalOcean account.
|
|
1015
|
-
`;var
|
|
1044
|
+
`;var sp=()=>{};var yp=`## Overview
|
|
1016
1045
|
|
|
1017
1046
|
Stream stdout and stderr from your E2B sandboxes to Sazabi via OpenTelemetry. Capture the output of \`sandbox.runCode()\` calls and forward it to our intake in real time so AI agents can analyze execution output alongside the rest of your observability data.
|
|
1018
1047
|
|
|
@@ -1022,9 +1051,17 @@ Configure an OpenTelemetry log exporter pointing at Sazabi's E2B intake URL, the
|
|
|
1022
1051
|
|
|
1023
1052
|
Only output from code passed to \`sandbox.runCode()\` is captured — anything emitted by long-running processes started outside that call (for example via \`sandbox.commands.run\`) is not forwarded by this setup.
|
|
1024
1053
|
|
|
1025
|
-
##
|
|
1054
|
+
## Features
|
|
1055
|
+
|
|
1056
|
+
- OpenTelemetry log export for stdout and stderr from E2B sandboxes.
|
|
1057
|
+
- Per-line log records tagged with sandbox ID and stream name.
|
|
1058
|
+
- Real-time analysis of \`sandbox.runCode()\` output alongside your other telemetry.
|
|
1026
1059
|
|
|
1027
|
-
|
|
1060
|
+
## Requirements
|
|
1061
|
+
|
|
1062
|
+
- Ability to attach \`onStdout\` and \`onStderr\` callbacks to \`sandbox.runCode()\` calls.
|
|
1063
|
+
- Access to set Sazabi public-key environment variables in the sandbox runtime.
|
|
1064
|
+
- Only output from code passed to \`sandbox.runCode()\` is captured; long-running processes started outside that call are not forwarded by this setup.
|
|
1028
1065
|
`;var bp=()=>{};var pp="# E2B Data Source Setup\n\nInstrument E2B sandboxes by attaching an **OpenTelemetry log exporter** that POSTs OTLP payloads to Sazabi's E2B intake URL. The exporter is configured in the host process where you create sandboxes; `onStdout` / `onStderr` callbacks passed to `sandbox.runCode()` emit one OTLP log record per output line.\n\n## Scope\n\nOnly output from code passed to `sandbox.runCode()` is captured. E2B's lifecycle webhook is not used by this setup, and the platform's `GET /sandboxes/{id}/logs/v2` endpoint is pull-only — any stdout/stderr emitted outside `runCode()` (for example by long-running processes spawned via `sandbox.commands.run`) is not forwarded.\n\n## Phase 1: Environment variables\n\n| Variable | Value |\n|----------|-------|\n| `SAZABI_INTAKE_URL` | `https://e2b.{projectRegion}.intake.{intakeDomain}/v1/logs` |\n| `SAZABI_PUBLIC_KEY` | Sazabi `{publicKey}` |\n\nTreat `SAZABI_PUBLIC_KEY` as a bearer secret embedded in the OTLP exporter's `Authorization: Bearer ...` header. The `/v1/logs` path suffix is required.\n\n## Phase 2: Install dependencies\n\n**Node / TypeScript:**\n\n```bash\nnpm install @e2b/code-interpreter @opentelemetry/api-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources @opentelemetry/sdk-logs\n```\n\n**Python:**\n\n```bash\npip install e2b_code_interpreter opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http\n```\n\n## Phase 3: Wire the exporter\n\n1. Construct an `OTLPLogExporter` pointing at `SAZABI_INTAKE_URL` with `Authorization: Bearer ${SAZABI_PUBLIC_KEY}`.\n2. Wrap it in a `BatchLogRecordProcessor` and attach it to a `LoggerProvider`. On Node / TypeScript pass the processor through the `processors: [...]` option on the `LoggerProvider` constructor — the legacy `addLogRecordProcessor()` method was removed in `@opentelemetry/sdk-logs` 0.x → 2.x. On Python use `logger_provider.add_log_record_processor(...)`.\n3. Register the provider globally:\n - Node: `logs.setGlobalLoggerProvider(loggerProvider)` and `logs.getLogger('e2b').emit({...})` for each output line.\n - Python: `_logs.set_logger_provider(logger_provider)` plus a `LoggingHandler(logger_provider=...)` attached to the `e2b` logger (not root) with `logger.propagate = False`. Records emitted via `logging.getLogger('e2b').info(...)` are exported as OTLP log records via that bridge; unrelated app logs are not forwarded.\n\n## Phase 4: Create the sandbox and stream output\n\n1. Create the sandbox with `Sandbox.create()` (Node and Python). The bare `Sandbox()` constructor in Python requires positional arguments for an existing sandbox and is not the right entrypoint for new sandboxes.\n2. Pass `onStdout` / `onStderr` callbacks to **`sandbox.runCode(code, { ... })`** — not to `Sandbox.create()`. The callbacks fire once per output line; emit an OTLP log record from each, with attributes `e2b.stream` (`\"stdout\"` or `\"stderr\"`) and `e2b.sandbox_id`.\n3. When the code passed to `runCode()` is JavaScript, set `language: 'javascript'` in the options. The E2B code interpreter defaults to Python; without the override, JS code is evaluated as Python and stdout is silently empty.\n\n## Phase 5: Teardown\n\nIn a `finally` block (or equivalent):\n\n1. Call `sandbox.kill()` so the sandbox does not idle against the team's concurrent-sandbox quota until E2B's default timeout expires.\n2. Call `loggerProvider.shutdown()` (or the Python equivalent) so the batch processor flushes any pending records before the process exits.\n\nFollow the onboarding code tabs verbatim — they encode every required option above.\n";var mp=()=>{};var Ip=`## Overview
|
|
1029
1066
|
|
|
1030
1067
|
Forward logs from your Kubernetes cluster or any infrastructure to Sazabi using the Fluent Bit agent. Fluent Bit runs as a lightweight DaemonSet that collects container logs from every node and ships them to Sazabi's OTLP intake.
|
|
@@ -1033,9 +1070,17 @@ Forward logs from your Kubernetes cluster or any infrastructure to Sazabi using
|
|
|
1033
1070
|
|
|
1034
1071
|
Fluent Bit's built-in \`opentelemetry\` output plugin sends logs directly to Sazabi over HTTPS. No extra plugins or custom builds required — the plugin ships with Fluent Bit v2.0 and later.
|
|
1035
1072
|
|
|
1036
|
-
##
|
|
1073
|
+
## Features
|
|
1037
1074
|
|
|
1038
|
-
|
|
1075
|
+
- Log forwarding through Fluent Bit's built-in \`opentelemetry\` output plugin.
|
|
1076
|
+
- Kubernetes DaemonSet support for collecting container logs from every node.
|
|
1077
|
+
- HTTPS delivery directly to Sazabi's OTLP intake.
|
|
1078
|
+
|
|
1079
|
+
## Requirements
|
|
1080
|
+
|
|
1081
|
+
- Fluent Bit v2.0 or later with the built-in \`opentelemetry\` output plugin.
|
|
1082
|
+
- Access to edit Fluent Bit configuration files, Helm values, or Kubernetes ConfigMaps.
|
|
1083
|
+
- Outbound HTTPS connectivity from Fluent Bit agents to the Sazabi intake endpoint.
|
|
1039
1084
|
`;var vp=()=>{};var kp=`# Fluent Bit Data Source Setup
|
|
1040
1085
|
|
|
1041
1086
|
Walk the user through connecting a Fluent Bit agent to Sazabi so logs from their Kubernetes cluster or infrastructure appear in the project.
|
|
@@ -1128,10 +1173,19 @@ Connect your Fly.io organization with a read-only org token, then select which a
|
|
|
1128
1173
|
|
|
1129
1174
|
You run a small Vector deployment inside your Fly organization that reads Fly's internal NATS log stream, wraps each event in the OTLP \`resourceLogs\` envelope, and forwards it to that intake URL. The setup docs include a ready-to-build Dockerfile and \`vector.toml\`. Our AI agents analyze application behavior, detect regional issues, and help you maintain global availability.
|
|
1130
1175
|
|
|
1131
|
-
##
|
|
1176
|
+
## Features
|
|
1177
|
+
|
|
1178
|
+
- Per-app log forwarding via a lightweight Vector deployment inside your Fly organization
|
|
1179
|
+
- Reads Fly's internal NATS log stream for low-latency delivery
|
|
1180
|
+
- OTLP envelope wrapping for structured log ingestion
|
|
1181
|
+
- AI monitoring of application behavior and regional availability across Fly machines
|
|
1182
|
+
|
|
1183
|
+
## Requirements
|
|
1132
1184
|
|
|
1133
|
-
A
|
|
1134
|
-
|
|
1185
|
+
- A read-only Fly.io org token scoped to the organization you want to monitor
|
|
1186
|
+
- Access to the specific apps you want to forward logs from
|
|
1187
|
+
- Ability to deploy and run a Vector instance inside your Fly organization (Dockerfile and \`vector.toml\` provided in the setup docs)
|
|
1188
|
+
- Outbound HTTPS connectivity from your Fly organization to the Sazabi intake endpoint`;var $p=()=>{};var Op=`# Fly.io Data Source Setup
|
|
1135
1189
|
|
|
1136
1190
|
Walk the user through creating a Fly.io read-only API token scoped to their organization. The resulting token and org slug are entered into the Sazabi dashboard to enable native Fly.io log shipping.
|
|
1137
1191
|
|
|
@@ -1254,10 +1308,19 @@ Provide a GCP service account key and Sazabi automatically provisions a Pub/Sub
|
|
|
1254
1308
|
|
|
1255
1309
|
Alternatively, you can set up forwarding manually using an OpenTelemetry Collector with a \`googlecloudpubsub\` receiver.
|
|
1256
1310
|
|
|
1257
|
-
##
|
|
1311
|
+
## Features
|
|
1312
|
+
|
|
1313
|
+
- Pub/Sub log delivery for real-time streaming from any GCP service
|
|
1314
|
+
- Project-scoped log sinks: connect one or more GCP projects
|
|
1315
|
+
- Automatic provisioning of Pub/Sub topic, log sink, and push subscription
|
|
1316
|
+
- AI agents correlate events across Cloud Functions, Cloud Run, GKE, and Compute Engine
|
|
1317
|
+
|
|
1318
|
+
## Requirements
|
|
1258
1319
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1320
|
+
- A GCP service account key with permissions to create Pub/Sub topics, log sinks, and push subscriptions in the selected project
|
|
1321
|
+
- Rights to create service account keys in your GCP project (if service account key creation is restricted, use the manual OpenTelemetry Collector path instead)
|
|
1322
|
+
- Access to the GCP project(s) you want to stream logs from
|
|
1323
|
+
- A workspace admin to enable the integration in Sazabi settings`;var Sp=()=>{};var Ap=`# GCP Data Source Setup
|
|
1261
1324
|
|
|
1262
1325
|
Walk the user through creating a GCP service account with the correct permissions for Sazabi's native GCL (Google Cloud Logging) integration. The resulting JSON key can be pasted into the Sazabi dashboard or used via the API.
|
|
1263
1326
|
|
|
@@ -1501,9 +1564,17 @@ Forward logs and traces from your infrastructure to Sazabi using Grafana Alloy.
|
|
|
1501
1564
|
|
|
1502
1565
|
Alloy's \`otelcol.exporter.otlphttp\` component exports data to Sazabi using the OTLP/HTTP protocol. Wire the exporter into your existing pipeline by referencing it as an output in your processors or receivers.
|
|
1503
1566
|
|
|
1504
|
-
##
|
|
1567
|
+
## Features
|
|
1568
|
+
|
|
1569
|
+
- OTLP/HTTP export from Grafana Alloy to Sazabi.
|
|
1570
|
+
- River pipeline integration with existing receivers and processors.
|
|
1571
|
+
- Kubernetes-friendly deployment through the Grafana Helm chart.
|
|
1505
1572
|
|
|
1506
|
-
|
|
1573
|
+
## Requirements
|
|
1574
|
+
|
|
1575
|
+
- Access to edit the Alloy River configuration that defines your telemetry pipeline.
|
|
1576
|
+
- Permission to update Helm values or ConfigMaps when Alloy runs on Kubernetes.
|
|
1577
|
+
- Existing receiver and processor wiring that can route logs or traces to the Sazabi exporter.
|
|
1507
1578
|
`;var Dp=()=>{};var Cp=`# Grafana Alloy Data Source Setup
|
|
1508
1579
|
|
|
1509
1580
|
Walk the user through connecting Grafana Alloy to Sazabi so logs and traces from their infrastructure appear in the project.
|
|
@@ -1634,9 +1705,17 @@ Inngest itself does not export logs or traces; this integration instead instrume
|
|
|
1634
1705
|
|
|
1635
1706
|
Once connected, telemetry streams in real-time. Our AI agents analyze function performance, detect failure patterns, and help you optimize your event-driven architecture.
|
|
1636
1707
|
|
|
1637
|
-
##
|
|
1708
|
+
## Features
|
|
1638
1709
|
|
|
1639
|
-
|
|
1710
|
+
- OpenTelemetry logs and traces from the application that hosts your Inngest serve handler.
|
|
1711
|
+
- Optional per-step spans, database query traces, and HTTP request spans through \`extendedTracesMiddleware()\`.
|
|
1712
|
+
- Real-time visibility into function executions, retries, and event-driven workflows.
|
|
1713
|
+
|
|
1714
|
+
## Requirements
|
|
1715
|
+
|
|
1716
|
+
- Access to instrument the host application that serves your Inngest functions.
|
|
1717
|
+
- Permission to set OpenTelemetry environment variables in that application's runtime.
|
|
1718
|
+
- Optional access to wrap your Inngest client with \`extendedTracesMiddleware()\` for deeper trace coverage.
|
|
1640
1719
|
`;var xp=()=>{};var Ep=`# Inngest Data Source Setup
|
|
1641
1720
|
|
|
1642
1721
|
Connect Inngest telemetry to a Sazabi project by instrumenting the **customer application that serves \`/api/inngest\`** with the OpenTelemetry SDK, pointing it at Sazabi's Inngest OTLP intake with a Sazabi public key, and (optionally) wrapping the Inngest client with \`extendedTracesMiddleware()\` for richer per-step spans.
|
|
@@ -1849,20 +1928,19 @@ LangChain itself does not emit OpenTelemetry. You wire in an instrumentation pac
|
|
|
1849
1928
|
|
|
1850
1929
|
Sazabi's intake accepts OTLP/HTTP traces (protobuf or JSON).
|
|
1851
1930
|
|
|
1852
|
-
## Configuration
|
|
1853
|
-
|
|
1854
|
-
1. Install an OpenTelemetry instrumentation for LangChain (OpenInference covers Python and TypeScript; LangGraph is supported through the same package).
|
|
1855
|
-
2. Initialise it at startup, before your application imports LangChain.
|
|
1856
|
-
3. Set the environment variables shown in the setup instructions.
|
|
1857
|
-
4. Deploy your application.
|
|
1858
|
-
|
|
1859
1931
|
## Features
|
|
1860
1932
|
|
|
1861
1933
|
- Chain, agent, and tool-call traces with input/output capture
|
|
1862
1934
|
- LLM call spans with provider, prompt template, and (when the model returns it) token-count attributes
|
|
1863
1935
|
- Supported in Python and TypeScript/JavaScript via OpenInference (the languages that currently ship both an OpenTelemetry SDK and a LangChain instrumentation package)
|
|
1864
1936
|
- Supports LangGraph through OpenInference
|
|
1865
|
-
|
|
1937
|
+
|
|
1938
|
+
## Requirements
|
|
1939
|
+
|
|
1940
|
+
- OpenInference or equivalent OpenTelemetry instrumentation package for LangChain installed in the application
|
|
1941
|
+
- Instrumentation initialized at application startup before LangChain is imported
|
|
1942
|
+
- Access to set environment variables in the application's deploy or runtime environment
|
|
1943
|
+
- Supported Python or TypeScript/JavaScript runtime with an OpenTelemetry SDK available`;var Up=()=>{};var Fp=`# LangChain Data Source Setup
|
|
1866
1944
|
|
|
1867
1945
|
Wire a LangChain application to a Sazabi project via **manual OTLP**. LangChain core does not emit OpenTelemetry on its own, so an **OpenInference** instrumentation package (Python or TypeScript) must be installed and started before the host process imports LangChain. Sazabi mints a project-scoped public key and accepts OTLP/HTTP traces at the \`langchain\` intake subdomain.
|
|
1868
1946
|
|
|
@@ -2113,25 +2191,36 @@ The Resource was not attached to the \`TracerProvider\`. Re-check that \`Resourc
|
|
|
2113
2191
|
### Manual connection already exists
|
|
2114
2192
|
|
|
2115
2193
|
If \`connections create --type langchain\` rejects with a duplicate, reuse the existing \`connectionId\` from \`connections list --type langchain --json\` instead of creating a second connection. One LangChain connection per project is enough — additional public keys can be minted under it for separate environments.
|
|
2116
|
-
`;var Kp=()=>{};var
|
|
2194
|
+
`;var Kp=()=>{};var Bp=`## Overview
|
|
2117
2195
|
|
|
2118
|
-
|
|
2196
|
+
Stream your Mastra agent traces directly to Sazabi for comprehensive observability of your AI agent workflows. Monitor agent executions, tool calls, and LLM interactions with real-time analysis.
|
|
2119
2197
|
|
|
2120
2198
|
## How it works
|
|
2121
2199
|
|
|
2122
|
-
|
|
2200
|
+
Install \`@mastra/otel-exporter\` alongside \`@mastra/core\` and \`@mastra/observability\`, then wire the exporter into your \`Mastra\` instance through the \`Observability\` config. Mastra's \`Observability\` system handles span creation and batching, so you don't need to set up the OpenTelemetry SDK manually.
|
|
2123
2201
|
|
|
2124
|
-
Once
|
|
2202
|
+
Once configured, traces flow automatically to our platform. AI agents analyze agent behavior, detect failures, and help you optimize your Mastra-powered applications.
|
|
2203
|
+
|
|
2204
|
+
## Features
|
|
2205
|
+
|
|
2206
|
+
- Mastra agent trace export through \`@mastra/otel-exporter\`.
|
|
2207
|
+
- Visibility into agent executions, tool calls, and LLM interactions.
|
|
2208
|
+
- Real-time trace analysis without manual OpenTelemetry SDK setup.
|
|
2125
2209
|
|
|
2126
|
-
##
|
|
2210
|
+
## Requirements
|
|
2211
|
+
|
|
2212
|
+
- Ability to install \`@mastra/otel-exporter\` alongside your Mastra application dependencies.
|
|
2213
|
+
- Permission to deploy the application code that configures Mastra's \`OtelExporter\`.
|
|
2214
|
+
- Access to set Sazabi intake environment variables in the application runtime.
|
|
2215
|
+
`;var Gp=()=>{};var Mp="# Mastra Data Source Setup\n\nExport Mastra observability spans/logs by pointing `@mastra/otel-exporter` at Sazabi’s Mastra OTLP ingest host.\n\n## Phase 1: Environment variables\n\nSet (values come directly from dashboard copy helpers):\n\n| Variable | Purpose |\n|---------|---------|\n| `SAZABI_INTAKE_URL` | Must be `https://mastra.{projectRegion}.intake.{intakeDomain}/v1/traces` |\n| `SAZABI_API_KEY` | Raw **`{publicKey}`** (distinct from Bearer prefix; code adds Bearer if needed—match template you adopt) |\n\n## Phase 2: Mastra Observability bootstrap\n\nPut the snippet in `src/mastra/index.ts` (the canonical Mastra entry; `mastra build` and `mastra studio deploy` only look here, `mastra dev` accepts `--dir` as an override). The `mastra` binding **must be exported** — Mastra's generated dev/build entry does `import { mastra } from '#mastra'`, and an unexported `const mastra` fails the build with `MISSING_EXPORT`.\n\nInstantiate `Observability` with an `OtelExporter` referencing `process.env.SAZABI_INTAKE_URL` and Bearer headers wired to `process.env.SAZABI_API_KEY`, per the Mastra snippets in-dashboard:\n\n```typescript\n// src/mastra/index.ts\nimport { Mastra } from \"@mastra/core\";\nimport { OtelExporter } from \"@mastra/otel-exporter\";\nimport { Observability } from \"@mastra/observability\";\n\nexport const mastra = new Mastra({\n observability: new Observability({\n configs: {\n default: {\n serviceName: \"my-mastra-app\",\n exporters: [\n new OtelExporter({\n provider: {\n custom: {\n endpoint: process.env.SAZABI_INTAKE_URL,\n protocol: \"http/json\",\n headers: {\n Authorization: `Bearer ${process.env.SAZABI_API_KEY}`,\n },\n },\n },\n }),\n ],\n },\n },\n }),\n});\n```\n\nMatch `protocol`, headers, and path suffix to what the onboard wizard emits.\n\n## Phase 3: Verify\n\nRun Mastra workloads (agents/tools) generating spans; inspect Sazabi for OTLP payloads tagged with Mastra adapters.\n";var Hp=()=>{};var Vp=`## Overview
|
|
2216
|
+
|
|
2217
|
+
Forward Postgres logs from your Neon database to Sazabi using Neon's OpenTelemetry integration. Database errors, warnings, and connection events stream into Sazabi alongside the rest of your application telemetry, so failures in the database surface in the same place as the application code that triggered them.
|
|
2127
2218
|
|
|
2128
|
-
|
|
2219
|
+
## How it works
|
|
2129
2220
|
|
|
2130
|
-
-
|
|
2131
|
-
- Permission to add integrations to the project
|
|
2132
|
-
- A short, stable \`service.name\` to identify this project's logs in Sazabi
|
|
2221
|
+
Neon ships per-project log export through its OpenTelemetry integration. Once configured, your Neon project pushes Postgres logs to Sazabi's OTLP intake. From the Neon docs, exported logs include "error messages, warnings, connection events, and system notifications." Logs are organized under the \`service.name\` you configure in Neon.
|
|
2133
2222
|
|
|
2134
|
-
|
|
2223
|
+
Once connected, logs stream in near real-time (Neon: "within a few minutes"). Sazabi's AI agents correlate Postgres errors with application traces, surface connection-pool issues, and help you root-cause database incidents without hopping between tools.
|
|
2135
2224
|
|
|
2136
2225
|
## Features
|
|
2137
2226
|
|
|
@@ -2139,7 +2228,12 @@ Follow the setup instructions in the Sazabi dashboard for the exact endpoint URL
|
|
|
2139
2228
|
- Logs grouped by your chosen \`service.name\` for cross-project filtering
|
|
2140
2229
|
- HTTP/2 transport with bearer auth (no agent or sidecar to deploy)
|
|
2141
2230
|
- Compute lifecycle aware: while a Scale-to-Zero compute is suspended, no logs flow — wake it by running a query
|
|
2142
|
-
|
|
2231
|
+
|
|
2232
|
+
## Requirements
|
|
2233
|
+
|
|
2234
|
+
- A Neon project on the **Scale** plan. The OpenTelemetry integration is Scale-only, and both the integration and its Postgres logs export are currently in Beta.
|
|
2235
|
+
- Permission to add integrations to the Neon project
|
|
2236
|
+
- A short, stable \`service.name\` to identify this project's logs in Sazabi`;var Jp=()=>{};var Wp=`# Neon Data Source Setup
|
|
2143
2237
|
|
|
2144
2238
|
Connect Neon Postgres logs to a Sazabi project via Neon's **OpenTelemetry** integration over **OTLP HTTP** with a Sazabi-minted bearer key. Logs only — no metrics or traces. Drive the Sazabi side with the CLI; the user must finish in Neon's console because the OpenTelemetry integration is configured exclusively in Neon's UI.
|
|
2145
2239
|
|
|
@@ -2334,30 +2428,17 @@ Configure a Log Drain in your Netlify site settings to forward logs to Sazabi's
|
|
|
2334
2428
|
|
|
2335
2429
|
Once configured, logs stream automatically. Our AI agents analyze build performance, detect function errors, and help you optimize your Netlify deployments.
|
|
2336
2430
|
|
|
2337
|
-
##
|
|
2338
|
-
|
|
2339
|
-
Log Drains require a Netlify Enterprise plan. Contact Netlify sales to upgrade if needed.
|
|
2340
|
-
|
|
2341
|
-
## Available log types
|
|
2431
|
+
## Features
|
|
2342
2432
|
|
|
2343
2433
|
- **Traffic logs**: Site visitor requests for assets and pages
|
|
2344
2434
|
- **Function logs**: Serverless function invocations and execution details
|
|
2345
2435
|
- **Edge Function logs**: Edge function console output and execution
|
|
2346
2436
|
- **Deploy logs**: Build and deployment information
|
|
2347
2437
|
|
|
2348
|
-
##
|
|
2349
|
-
|
|
2350
|
-
1. Navigate to your Netlify site dashboard
|
|
2351
|
-
2. Go to Logs & Metrics > Log Drains
|
|
2352
|
-
3. Click "Enable a log drain"
|
|
2353
|
-
4. Select "General HTTP endpoint" as the service
|
|
2354
|
-
5. Select the log types you want to drain
|
|
2355
|
-
6. Enter the Full URL and Authorization header shown in the setup instructions
|
|
2356
|
-
7. Set Log Drain Format to JSON
|
|
2357
|
-
8. Click Connect
|
|
2438
|
+
## Requirements
|
|
2358
2439
|
|
|
2359
|
-
|
|
2360
|
-
`;var Yp=()=>{};var Qp=`# Netlify Data Source Setup
|
|
2440
|
+
- Netlify Enterprise plan required for Log Drains — contact Netlify sales to upgrade if needed
|
|
2441
|
+
- Site-level permissions to configure Log Drains under Logs & Metrics in the Netlify site dashboard`;var Yp=()=>{};var Qp=`# Netlify Data Source Setup
|
|
2361
2442
|
|
|
2362
2443
|
Connect a Netlify site to a Sazabi project by configuring a Netlify **Log Drain** (General HTTP endpoint, JSON) that posts to Sazabi's regional intake with a Sazabi-minted bearer key. Netlify has no API to provision drains for a third party — the user must configure the drain in the Netlify UI. The Sazabi side of the flow runs through the CLI.
|
|
2363
2444
|
|
|
@@ -2538,19 +2619,7 @@ Forward LLM trace spans from OpenRouter to Sazabi using OpenRouter's built-in Op
|
|
|
2538
2619
|
|
|
2539
2620
|
## How it works
|
|
2540
2621
|
|
|
2541
|
-
In the OpenRouter dashboard you enable Broadcast and add an OpenTelemetry Collector destination pointing at Sazabi's regional OTLP intake. OpenRouter pushes a trace span for each generation request, and Sazabi attributes the span to your project via the public key in the destination's \`Authorization\` header.
|
|
2542
|
-
|
|
2543
|
-
## Configuration
|
|
2544
|
-
|
|
2545
|
-
1. In Sazabi, open **Settings > Data sources > OpenRouter**, create a connection, and copy the **Endpoint** and **Headers** values from the manual setup screen. Both are scoped to your project — the endpoint encodes your project's region and the headers include a project-scoped public key.
|
|
2546
|
-
|
|
2547
|
-
2. In OpenRouter, open **Settings > Observability**, toggle **Enable Broadcast** on, and click the edit icon next to **OpenTelemetry Collector**.
|
|
2548
|
-
|
|
2549
|
-
3. Paste Sazabi's **Endpoint** value (ends in \`/v1/traces\`) into OpenRouter's **Endpoint** field. Paste Sazabi's JSON **Headers** value into OpenRouter's **Headers** field. The endpoint host follows the pattern \`openrouter.<region>.intake.<domain>\` — \`<domain>\` is \`sazabi.com\` for production projects and \`sazabi.dev\` for development and staging.
|
|
2550
|
-
|
|
2551
|
-
4. Click **Test Connection**. OpenRouter only saves the destination if the test passes; a green check confirms Sazabi accepted the trace. Then save the destination.
|
|
2552
|
-
|
|
2553
|
-
OpenRouter starts forwarding spans to Sazabi as soon as the destination is enabled.
|
|
2622
|
+
In the OpenRouter dashboard you enable Broadcast and add an OpenTelemetry Collector destination pointing at Sazabi's regional OTLP intake. OpenRouter pushes a trace span for each generation request, and Sazabi attributes the span to your project via the public key in the destination's \`Authorization\` header. The endpoint host follows the pattern \`openrouter.<region>.intake.<domain>\` — \`<domain>\` is \`sazabi.com\` for production projects and \`sazabi.dev\` for development and staging.
|
|
2554
2623
|
|
|
2555
2624
|
## Features
|
|
2556
2625
|
|
|
@@ -2558,7 +2627,13 @@ OpenRouter starts forwarding spans to Sazabi as soon as the destination is enabl
|
|
|
2558
2627
|
- Token counts and cost per request
|
|
2559
2628
|
- Prompt and completion content (unless OpenRouter's **Privacy Mode** is enabled)
|
|
2560
2629
|
- Optional sampling rate and per-API-key filtering controlled in OpenRouter
|
|
2561
|
-
|
|
2630
|
+
|
|
2631
|
+
## Requirements
|
|
2632
|
+
|
|
2633
|
+
- OpenRouter account with Broadcast access enabled
|
|
2634
|
+
- Ability to configure an OpenTelemetry Collector destination in OpenRouter Settings > Observability
|
|
2635
|
+
- Project-scoped public key and intake endpoint provided by Sazabi during connection setup
|
|
2636
|
+
- Note: prompt and completion content is withheld when OpenRouter's Privacy Mode is active`;var ev=()=>{};var ov=`# OpenRouter Data Source Setup
|
|
2562
2637
|
|
|
2563
2638
|
Connect OpenRouter to a Sazabi project by adding an **OpenTelemetry Collector** destination in OpenRouter's Broadcast settings that points at Sazabi's regional OTLP intake. OpenRouter exports trace spans for every generation directly from its own infrastructure — no SDK install or code changes in the user's app.
|
|
2564
2639
|
|
|
@@ -2612,9 +2687,17 @@ Configure the standard OpenTelemetry environment variables to point your OTLP ex
|
|
|
2612
2687
|
|
|
2613
2688
|
Once connected, telemetry streams in real-time. Our AI agents analyze patterns, detect anomalies, and help you troubleshoot production issues faster.
|
|
2614
2689
|
|
|
2615
|
-
##
|
|
2690
|
+
## Features
|
|
2616
2691
|
|
|
2617
|
-
|
|
2692
|
+
- OTLP-compatible intake for OpenTelemetry logs and traces.
|
|
2693
|
+
- Standard \`OTEL_EXPORTER_OTLP_*\` environment variable configuration.
|
|
2694
|
+
- AI-powered analysis of streamed telemetry for anomaly detection and troubleshooting.
|
|
2695
|
+
|
|
2696
|
+
## Requirements
|
|
2697
|
+
|
|
2698
|
+
- An application or collector that can export OTLP logs and traces.
|
|
2699
|
+
- Runtime or deployment access to set the Sazabi OTLP endpoint and public-key authorization header.
|
|
2700
|
+
- Metrics are accepted by the intake but are not yet stored; logs and traces are supported.
|
|
2618
2701
|
`;var nv=()=>{};var cv=`# OpenTelemetry (Generic) Data Source Setup
|
|
2619
2702
|
|
|
2620
2703
|
Walk the user through connecting any OpenTelemetry-instrumented application to a Sazabi project via the standard **OTLP HTTP** exporter env vars. This is the generic, any-language manual setup — works with the Node.js, Python, Go, Java, .NET, Rust, or Ruby OpenTelemetry SDKs.
|
|
@@ -2858,7 +2941,26 @@ When telemetry is arriving, report back:
|
|
|
2858
2941
|
- That \`/v1/logs\` and \`/v1/traces\` are live and \`/v1/metrics\` is not yet persisted.
|
|
2859
2942
|
|
|
2860
2943
|
Do not print \`PUBLIC_KEY\` in the summary.
|
|
2861
|
-
`;var av=()=>{};var uv
|
|
2944
|
+
`;var av=()=>{};var uv=`## Overview
|
|
2945
|
+
|
|
2946
|
+
Forward logs and traces from your infrastructure to Sazabi using the OpenTelemetry Collector. The collector runs as a DaemonSet on Kubernetes and provides a vendor-neutral, extensible pipeline for your telemetry.
|
|
2947
|
+
|
|
2948
|
+
## How it works
|
|
2949
|
+
|
|
2950
|
+
The collector's \`otlphttp\` exporter sends data to Sazabi's OTLP intake. Add it to your existing collector config and include it in your service pipelines alongside any processors you already use.
|
|
2951
|
+
|
|
2952
|
+
## Features
|
|
2953
|
+
|
|
2954
|
+
- OTLP/HTTP export from the OpenTelemetry Collector to Sazabi.
|
|
2955
|
+
- Support for existing collector receivers, processors, and service pipelines.
|
|
2956
|
+
- Kubernetes-friendly deployment through the \`opentelemetry-collector\` Helm chart.
|
|
2957
|
+
|
|
2958
|
+
## Requirements
|
|
2959
|
+
|
|
2960
|
+
- Access to configure the collector's \`otlphttp\` exporter.
|
|
2961
|
+
- Permission to edit collector configuration files, Helm values, or ConfigMaps.
|
|
2962
|
+
- Ownership of the logs or traces pipeline that should include the Sazabi exporter.
|
|
2963
|
+
`;var lv=()=>{};var gv=`# OpenTelemetry Collector Data Source Setup
|
|
2862
2964
|
|
|
2863
2965
|
Walk the user through connecting the OpenTelemetry Collector to Sazabi so logs and traces from their infrastructure appear in the project.
|
|
2864
2966
|
|
|
@@ -2935,7 +3037,7 @@ After the user confirms the config is applied, check whether telemetry is arrivi
|
|
|
2935
3037
|
### Helm deployment
|
|
2936
3038
|
|
|
2937
3039
|
For the \`opentelemetry-collector\` Helm chart, pass the config via \`config\` in \`values.yaml\` and merge the exporter block into the existing structure.
|
|
2938
|
-
`;var hv=()=>{};var
|
|
3040
|
+
`;var hv=()=>{};var dv=`## Overview
|
|
2939
3041
|
|
|
2940
3042
|
Forward your PostHog events directly to Sazabi for real-time observability and AI-powered analysis. Use PostHog's CDP HTTP Webhook destination to stream product analytics and error events into your project.
|
|
2941
3043
|
|
|
@@ -2943,21 +3045,16 @@ Forward your PostHog events directly to Sazabi for real-time observability and A
|
|
|
2943
3045
|
|
|
2944
3046
|
Configure an HTTP Webhook destination in PostHog Data Pipeline > Destinations and point it to your Sazabi intake URL. PostHog sends a JSON payload for each matching event, and Sazabi transforms it into OTEL logs for search, alerting, and investigation.
|
|
2945
3047
|
|
|
2946
|
-
##
|
|
2947
|
-
|
|
2948
|
-
CDP destinations are a paid PostHog feature. Your PostHog workspace must have access to Data Pipeline destinations.
|
|
3048
|
+
## Features
|
|
2949
3049
|
|
|
2950
|
-
|
|
3050
|
+
- Event delivery via PostHog's HTTP Webhook destination in Data Pipeline
|
|
3051
|
+
- Per-event filtering to control which PostHog events are forwarded to Sazabi
|
|
3052
|
+
- Full event and person properties included in each payload for rich observability context
|
|
2951
3053
|
|
|
2952
|
-
|
|
2953
|
-
2. Create a new HTTP Webhook destination.
|
|
2954
|
-
3. Use the destination URL and authorization header shown in the setup instructions.
|
|
2955
|
-
4. Set method to POST and content type to JSON.
|
|
2956
|
-
5. Keep the default body template (\`{ "event": "{event}", "person": "{person}" }\`) unless you need custom fields.
|
|
2957
|
-
6. Choose which events to forward and save.
|
|
3054
|
+
## Requirements
|
|
2958
3055
|
|
|
2959
|
-
|
|
2960
|
-
`;var dv=()=>{};var yv='---\nname: posthog-data-source-setup\ndescription: Connect a PostHog organization to a Sazabi project so PostHog events stream into Sazabi via auto-provisioned CDP HTTP-webhook destinations. Use when the user wants to "connect PostHog", "ingest PostHog events", "add a PostHog data source", or after running `sazabi data-sources skill --type posthog`. Drives the Sazabi CLI (`data-sources connections create` + `data-sources streams create`) plus direct calls to PostHog\'s REST API for project discovery and scope validation; stream creation triggers the backend to POST to `/api/projects/{id}/hog_functions/` and mint a Sazabi public key.\n---\n\n# PostHog Data Source Setup\n\nWalk the user through connecting a PostHog organization to a Sazabi project using a **personal API key** (`phx_...`). The Sazabi backend installs a CDP HTTP-webhook destination (hog function) on each selected PostHog project and mints a per-stream public key. Prefer this native flow. The legacy "manual webhook" flow (user hand-creates an HTTP Webhook destination in PostHog) is out of scope for this skill.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating the personal API key in PostHog, choosing the Sazabi project, or picking PostHog projects. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, entering the personal API key, picking PostHog projects.\n- Never echo `POSTHOG_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to PostHog\'s REST API in Phase 2 and Phase 3.\n\nConfirm CLI auth:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf unauthenticated, run `$SAZABI_CLI auth login` (browser) or `$SAZABI_CLI auth save <token>` (paste an existing session token or secret key). Do not print tokens.\n\nThe user needs:\n\n1. A Sazabi project to receive PostHog events.\n2. A PostHog account with admin access to the projects they want to forward, on either **US Cloud** (`us.posthog.com`) or **EU Cloud** (`eu.posthog.com`).\n3. A PostHog plan that includes **CDP / Data Pipeline destinations** (hog functions) — this is a paid PostHog feature.\n4. A browser to create a personal API key.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the PostHog events? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use "$SAZABI_PROJECT_ID"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing PostHog connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type posthog --json\n```\n\nIf a PostHog connection already exists for the same organization the user wants to onboard, reuse its `id` as `POSTHOG_CONNECTION_ID` and skip token creation (Phase 2) and connection creation (Phase 4) — but still run Phase 3 to discover and select the PostHog projects to create streams for. The user must paste a personal API key with `project:read` (and `hog_function:write` for stream provisioning) so Phase 3 can list projects; the existing connection\'s stored token is encrypted and not retrievable. Once the new project selection is captured in `POSTHOG_PROJECTS`, jump to Phase 5 and create only the new streams. Do not create a duplicate connection for the same PostHog organization (the backend dedupes by `region + organizationId + token`).\n\n## Phase 2: Create the PostHog personal API key\n\nDirect the user to create a personal API key. PostHog hosts US and EU Cloud separately; pick the one their organization lives on.\n\n> Open **PostHog → Settings → Personal API keys**:\n>\n> - US Cloud: **https://us.posthog.com/settings/user-api-keys**\n> - EU Cloud: **https://eu.posthog.com/settings/user-api-keys**\n>\n> Click **Create personal API key**.\n>\n> - **Label**: `Sazabi`\n> - **Scopes** (all three are required):\n> - `project:read` — enumerate projects in the stream selector\n> - `organization:read` — resolve the organization name shown alongside projects\n> - `hog_function:write` — install the webhook destination on each project\n> - **Scoped organizations / projects**: leave unrestricted, or restrict to the organization the user wants to onboard.\n>\n> PostHog displays the key (`phx_...`) only once. If the user dismisses the dialog without copying it, they must create a new key.\n\n`AskUserQuestion`: ask the user to paste the personal API key. Capture it as `POSTHOG_TOKEN`.\n\n### Validate the token and resolve region + organization\n\nThe Sazabi backend probes US then EU using the token to discover which region it belongs to and which organization it grants access to. Reproduce that probe with `curl` so the agent has the values it needs for Phase 4. The token may be on either region; try US first, fall back to EU on `401`/`403`.\n\n```sh\nposthog_probe() {\n local region="$1"\n curl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${region}.posthog.com/api/projects/@current/"\n}\n\nif PROJECT_JSON=$(posthog_probe us 2>/dev/null); then\n POSTHOG_REGION="us"\nelif PROJECT_JSON=$(posthog_probe eu 2>/dev/null); then\n POSTHOG_REGION="eu"\nelse\n echo "PostHog token rejected on both US and EU." >&2\n exit 1\nfi\n\nPOSTHOG_ORGANIZATION_ID=$(jq -r \'.organization\' <<<"$PROJECT_JSON")\nPOSTHOG_ORGANIZATION_NAME=$(curl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${POSTHOG_REGION}.posthog.com/api/organizations/${POSTHOG_ORGANIZATION_ID}/" \\\n | jq -r \'.name\')\n```\n\nIf the probe fails on both regions: the key was revoked, copied incorrectly, or lacks `project:read`. Have the user create a new key with the three required scopes and rerun this phase. Do not print `POSTHOG_TOKEN` in any error output.\n\n### Verify all three scopes\n\n`project:read` is implied by the successful probe above. Verify `organization:read` succeeded (`POSTHOG_ORGANIZATION_NAME` is non-empty) and confirm `hog_function:write` is on the key — stream creation will fail later if it is missing.\n\n```sh\ncurl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${POSTHOG_REGION}.posthog.com/api/personal_api_keys/@current/" \\\n | jq -e \'.scopes | index("hog_function:write") or index("*")\'\n```\n\nIf the check exits non-zero, the key is missing `hog_function:write`. Have the user edit the key in PostHog to add that scope (or recreate it) and rerun this phase.\n\n## Phase 3: Discover and pick PostHog projects\n\nList the PostHog projects the token can see. The stream selector flow in the dashboard calls Sazabi\'s `list-projects` action, which requires a created connection — but here we\'re discovering before connection creation, so call PostHog\'s REST API directly.\n\nPostHog `/api/projects/` is paginated using DRF-style `{ count, next, previous, results }`. Follow `next` until it is `null` so orgs with more than one page of projects are fully enumerated.\n\n```sh\nPOSTHOG_PROJECTS_JSON=\'[]\'\nNEXT_URL="https://${POSTHOG_REGION}.posthog.com/api/projects/?limit=200"\nwhile [ -n "$NEXT_URL" ] && [ "$NEXT_URL" != "null" ]; do\n PAGE=$(curl -fsS -H "Authorization: Bearer $POSTHOG_TOKEN" "$NEXT_URL")\n POSTHOG_PROJECTS_JSON=$(jq -c \\\n --argjson acc "$POSTHOG_PROJECTS_JSON" \\\n \'($acc + (.results // . | [.[] | {id: (.id | tostring), name}]))\' \\\n <<<"$PAGE")\n NEXT_URL=$(jq -r \'.next // empty\' <<<"$PAGE")\ndone\njq \'.\' <<<"$POSTHOG_PROJECTS_JSON"\n```\n\n`AskUserQuestion`: which PostHog projects should Sazabi forward events from?\n\nBuild `POSTHOG_PROJECTS` as a list of `(posthogProjectId, posthogProjectName)` pairs. Reuse the exact `id` (stringified) and `name` returned by PostHog — do not invent or reformat them. Each selected project becomes one Sazabi stream and one PostHog hog function.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection. The metadata schema requires `posthogPersonalApiKey`, `posthogApiRegion`, `posthogOrganizationId`, and `connectionMode: "native"`; `posthogOrganizationName` is optional but recommended for the dashboard.\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token "$POSTHOG_TOKEN" \\\n --arg region "$POSTHOG_REGION" \\\n --arg orgId "$POSTHOG_ORGANIZATION_ID" \\\n --arg orgName "$POSTHOG_ORGANIZATION_NAME" \\\n \'{\n posthogPersonalApiKey: $token,\n posthogApiRegion: $region,\n posthogOrganizationId: $orgId,\n posthogOrganizationName: $orgName,\n connectionMode: "native"\n }\')\n\nPOSTHOG_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type posthog \\\n --metadata "$METADATA_JSON" \\\n --json | jq -r \'.connectionId\')\n```\n\nThe connection persists the encrypted personal API key plus the resolved region and organization. It does **not** install any hog functions on its own — that happens per stream in Phase 5.\n\nIf the CLI reports `duplicate connection` or a connection-identity collision, an existing PostHog connection already covers this `(region, organizationId, token)` triple — reuse its `id` from `connections list --type posthog --json` and continue from Phase 5.\n\n## Phase 5: Create one stream per PostHog project\n\nFor each entry in `POSTHOG_PROJECTS`, call `streams create`. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the backend\'s `provisionStream` for `posthog` — that mints a Sazabi public key scoped to the stream, then POSTs to `https://${POSTHOG_REGION}.posthog.com/api/projects/${POSTHOG_PROJECT_ID}/hog_functions/` with `template_id: "template-webhook"` pointed at Sazabi\'s intake URL.\n\n```sh\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$POSTHOG_CONNECTION_ID" \\\n --display-name "$POSTHOG_PROJECT_NAME" \\\n --config "$(jq -nc \\\n --arg id "$POSTHOG_PROJECT_ID" \\\n --arg name "$POSTHOG_PROJECT_NAME" \\\n \'{posthogProjectId: $id, posthogProjectName: $name}\')" \\\n --json\n```\n\nReuse the exact `id` (stringified) and `name` returned by PostHog\'s `/api/projects/` response for `posthogProjectId` and `posthogProjectName`. Field names are case-sensitive.\n\nIf a stream creation fails on duplicate display name, append a suffix (e.g. `"$POSTHOG_PROJECT_NAME (events)"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nHog-function provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id "$POSTHOG_CONNECTION_ID" --json\n```\n\nEach stream transitions from `pending` (or `provisioning`) to `active` once the backend finishes calling PostHog\'s `/api/projects/{id}/hog_functions/` endpoint. The stream\'s `config.posthogHogFunctionId` is populated on success. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that PostHog project and surface it to the user — the Temporal activity log holds the underlying error.\n\n**Pass 2 — telemetry arrival.** Hog functions only emit events when the PostHog project receives matching captures. Either trigger an event (`$pageview`, custom capture) or wait for natural traffic, then tail:\n\n```sh\n$SAZABI_CLI logs tail --json --search posthog\n```\n\nConfirm new records arrive tagged with the corresponding `posthogProjectName`. If nothing appears within a few minutes of triggering an event, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `POSTHOG_CONNECTION_ID` and the resolved `$POSTHOG_REGION` + `$POSTHOG_ORGANIZATION_NAME`.\n- One line per stream: PostHog project name, current status, and (if active) the `posthogHogFunctionId`.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored out (non-`active`, non-`pending`, non-`provisioning`), call out the failed PostHog project name and offer to recreate just that stream.\n\nDo not include `POSTHOG_TOKEN` in the summary.\n\n## Troubleshooting\n\n### Invalid or expired personal API key\n\nThe key may have been revoked, copied incorrectly, or expired. Recreate at the region-specific URL (`https://${POSTHOG_REGION}.posthog.com/settings/user-api-keys`) with the three required scopes and rerun Phase 2. The Sazabi connection still exists with a stale key — delete it (`data-sources connections delete <id>` if your CLI version supports it) and rerun from Phase 4, or update the connection metadata if `connections update` is available (`$SAZABI_CLI data-sources connections -h`).\n\n### Stream creation fails with `403` / "Insufficient permissions"\n\nThe personal API key is missing `hog_function:write`, or the user lacks admin access to that PostHog project. Verify the scope check at the end of Phase 2 passes, and confirm the user has at least Member (Admin recommended) access to the PostHog project. Recreate the key with the correct scope if needed.\n\n### Stream creation fails with `402` / "CDP destinations require a paid plan"\n\nHog functions / CDP destinations are a paid PostHog feature. The user must upgrade the PostHog organization billing plan before provisioning will succeed. The Sazabi connection and the failed stream can be deleted before retry; or leave them and provisioning will succeed next time it is retried.\n\n### Wrong region resolved\n\nThe probe in Phase 2 tries US first, EU second. A key that exists on **EU Cloud** but is rejected on US with a `401`/`403` will fall through correctly. If the probe returns a `5xx` on US, it short-circuits without trying EU — in that case retry the probe manually against EU only:\n\n```sh\ncurl -fsS -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://eu.posthog.com/api/projects/@current/"\n```\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No events arriving after streams are `active`\n\nA hog function that is `active` on the Sazabi side does not emit events unless the PostHog project receives captures matching the destination\'s filters. Trigger a real `$pageview` or `capture` event against the PostHog project. Confirm the hog function is enabled in PostHog → **Data Pipeline → Destinations** (look for `Sazabi — <project> (<prefix>)`).\n\n### Manual webhook destination already exists\n\nIf the user previously hand-created an HTTP Webhook destination in PostHog (the legacy manual flow), it will keep forwarding to Sazabi independently of this connection — this skill\'s native flow installs a **separate** hog function. Either delete the manual destination in PostHog before running this skill (to avoid duplicate events) or leave both in place if intentional.\n';var bv=()=>{};var pv=`## Overview
|
|
3056
|
+
- PostHog workspace with access to CDP / Data Pipeline destinations (paid PostHog feature)
|
|
3057
|
+
- Permissions to create and configure HTTP Webhook destinations in PostHog Data Pipeline > Destinations`;var sv=()=>{};var yv='---\nname: posthog-data-source-setup\ndescription: Connect a PostHog organization to a Sazabi project so PostHog events stream into Sazabi via auto-provisioned CDP HTTP-webhook destinations. Use when the user wants to "connect PostHog", "ingest PostHog events", "add a PostHog data source", or after running `sazabi data-sources skill --type posthog`. Drives the Sazabi CLI (`data-sources connections create` + `data-sources streams create`) plus direct calls to PostHog\'s REST API for project discovery and scope validation; stream creation triggers the backend to POST to `/api/projects/{id}/hog_functions/` and mint a Sazabi public key.\n---\n\n# PostHog Data Source Setup\n\nWalk the user through connecting a PostHog organization to a Sazabi project using a **personal API key** (`phx_...`). The Sazabi backend installs a CDP HTTP-webhook destination (hog function) on each selected PostHog project and mints a per-stream public key. Prefer this native flow. The legacy "manual webhook" flow (user hand-creates an HTTP Webhook destination in PostHog) is out of scope for this skill.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating the personal API key in PostHog, choosing the Sazabi project, or picking PostHog projects. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, entering the personal API key, picking PostHog projects.\n- Never echo `POSTHOG_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to PostHog\'s REST API in Phase 2 and Phase 3.\n\nConfirm CLI auth:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf unauthenticated, run `$SAZABI_CLI auth login` (browser) or `$SAZABI_CLI auth save <token>` (paste an existing session token or secret key). Do not print tokens.\n\nThe user needs:\n\n1. A Sazabi project to receive PostHog events.\n2. A PostHog account with admin access to the projects they want to forward, on either **US Cloud** (`us.posthog.com`) or **EU Cloud** (`eu.posthog.com`).\n3. A PostHog plan that includes **CDP / Data Pipeline destinations** (hog functions) — this is a paid PostHog feature.\n4. A browser to create a personal API key.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the PostHog events? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use "$SAZABI_PROJECT_ID"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing PostHog connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type posthog --json\n```\n\nIf a PostHog connection already exists for the same organization the user wants to onboard, reuse its `id` as `POSTHOG_CONNECTION_ID` and skip token creation (Phase 2) and connection creation (Phase 4) — but still run Phase 3 to discover and select the PostHog projects to create streams for. The user must paste a personal API key with `project:read` (and `hog_function:write` for stream provisioning) so Phase 3 can list projects; the existing connection\'s stored token is encrypted and not retrievable. Once the new project selection is captured in `POSTHOG_PROJECTS`, jump to Phase 5 and create only the new streams. Do not create a duplicate connection for the same PostHog organization (the backend dedupes by `region + organizationId + token`).\n\n## Phase 2: Create the PostHog personal API key\n\nDirect the user to create a personal API key. PostHog hosts US and EU Cloud separately; pick the one their organization lives on.\n\n> Open **PostHog → Settings → Personal API keys**:\n>\n> - US Cloud: **https://us.posthog.com/settings/user-api-keys**\n> - EU Cloud: **https://eu.posthog.com/settings/user-api-keys**\n>\n> Click **Create personal API key**.\n>\n> - **Label**: `Sazabi`\n> - **Scopes** (all three are required):\n> - `project:read` — enumerate projects in the stream selector\n> - `organization:read` — resolve the organization name shown alongside projects\n> - `hog_function:write` — install the webhook destination on each project\n> - **Scoped organizations / projects**: leave unrestricted, or restrict to the organization the user wants to onboard.\n>\n> PostHog displays the key (`phx_...`) only once. If the user dismisses the dialog without copying it, they must create a new key.\n\n`AskUserQuestion`: ask the user to paste the personal API key. Capture it as `POSTHOG_TOKEN`.\n\n### Validate the token and resolve region + organization\n\nThe Sazabi backend probes US then EU using the token to discover which region it belongs to and which organization it grants access to. Reproduce that probe with `curl` so the agent has the values it needs for Phase 4. The token may be on either region; try US first, fall back to EU on `401`/`403`.\n\n```sh\nposthog_probe() {\n local region="$1"\n curl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${region}.posthog.com/api/projects/@current/"\n}\n\nif PROJECT_JSON=$(posthog_probe us 2>/dev/null); then\n POSTHOG_REGION="us"\nelif PROJECT_JSON=$(posthog_probe eu 2>/dev/null); then\n POSTHOG_REGION="eu"\nelse\n echo "PostHog token rejected on both US and EU." >&2\n exit 1\nfi\n\nPOSTHOG_ORGANIZATION_ID=$(jq -r \'.organization\' <<<"$PROJECT_JSON")\nPOSTHOG_ORGANIZATION_NAME=$(curl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${POSTHOG_REGION}.posthog.com/api/organizations/${POSTHOG_ORGANIZATION_ID}/" \\\n | jq -r \'.name\')\n```\n\nIf the probe fails on both regions: the key was revoked, copied incorrectly, or lacks `project:read`. Have the user create a new key with the three required scopes and rerun this phase. Do not print `POSTHOG_TOKEN` in any error output.\n\n### Verify all three scopes\n\n`project:read` is implied by the successful probe above. Verify `organization:read` succeeded (`POSTHOG_ORGANIZATION_NAME` is non-empty) and confirm `hog_function:write` is on the key — stream creation will fail later if it is missing.\n\n```sh\ncurl -fsS \\\n -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://${POSTHOG_REGION}.posthog.com/api/personal_api_keys/@current/" \\\n | jq -e \'.scopes | index("hog_function:write") or index("*")\'\n```\n\nIf the check exits non-zero, the key is missing `hog_function:write`. Have the user edit the key in PostHog to add that scope (or recreate it) and rerun this phase.\n\n## Phase 3: Discover and pick PostHog projects\n\nList the PostHog projects the token can see. The stream selector flow in the dashboard calls Sazabi\'s `list-projects` action, which requires a created connection — but here we\'re discovering before connection creation, so call PostHog\'s REST API directly.\n\nPostHog `/api/projects/` is paginated using DRF-style `{ count, next, previous, results }`. Follow `next` until it is `null` so orgs with more than one page of projects are fully enumerated.\n\n```sh\nPOSTHOG_PROJECTS_JSON=\'[]\'\nNEXT_URL="https://${POSTHOG_REGION}.posthog.com/api/projects/?limit=200"\nwhile [ -n "$NEXT_URL" ] && [ "$NEXT_URL" != "null" ]; do\n PAGE=$(curl -fsS -H "Authorization: Bearer $POSTHOG_TOKEN" "$NEXT_URL")\n POSTHOG_PROJECTS_JSON=$(jq -c \\\n --argjson acc "$POSTHOG_PROJECTS_JSON" \\\n \'($acc + (.results // . | [.[] | {id: (.id | tostring), name}]))\' \\\n <<<"$PAGE")\n NEXT_URL=$(jq -r \'.next // empty\' <<<"$PAGE")\ndone\njq \'.\' <<<"$POSTHOG_PROJECTS_JSON"\n```\n\n`AskUserQuestion`: which PostHog projects should Sazabi forward events from?\n\nBuild `POSTHOG_PROJECTS` as a list of `(posthogProjectId, posthogProjectName)` pairs. Reuse the exact `id` (stringified) and `name` returned by PostHog — do not invent or reformat them. Each selected project becomes one Sazabi stream and one PostHog hog function.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection. The metadata schema requires `posthogPersonalApiKey`, `posthogApiRegion`, `posthogOrganizationId`, and `connectionMode: "native"`; `posthogOrganizationName` is optional but recommended for the dashboard.\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token "$POSTHOG_TOKEN" \\\n --arg region "$POSTHOG_REGION" \\\n --arg orgId "$POSTHOG_ORGANIZATION_ID" \\\n --arg orgName "$POSTHOG_ORGANIZATION_NAME" \\\n \'{\n posthogPersonalApiKey: $token,\n posthogApiRegion: $region,\n posthogOrganizationId: $orgId,\n posthogOrganizationName: $orgName,\n connectionMode: "native"\n }\')\n\nPOSTHOG_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type posthog \\\n --metadata "$METADATA_JSON" \\\n --json | jq -r \'.connectionId\')\n```\n\nThe connection persists the encrypted personal API key plus the resolved region and organization. It does **not** install any hog functions on its own — that happens per stream in Phase 5.\n\nIf the CLI reports `duplicate connection` or a connection-identity collision, an existing PostHog connection already covers this `(region, organizationId, token)` triple — reuse its `id` from `connections list --type posthog --json` and continue from Phase 5.\n\n## Phase 5: Create one stream per PostHog project\n\nFor each entry in `POSTHOG_PROJECTS`, call `streams create`. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the backend\'s `provisionStream` for `posthog` — that mints a Sazabi public key scoped to the stream, then POSTs to `https://${POSTHOG_REGION}.posthog.com/api/projects/${POSTHOG_PROJECT_ID}/hog_functions/` with `template_id: "template-webhook"` pointed at Sazabi\'s intake URL.\n\n```sh\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$POSTHOG_CONNECTION_ID" \\\n --display-name "$POSTHOG_PROJECT_NAME" \\\n --config "$(jq -nc \\\n --arg id "$POSTHOG_PROJECT_ID" \\\n --arg name "$POSTHOG_PROJECT_NAME" \\\n \'{posthogProjectId: $id, posthogProjectName: $name}\')" \\\n --json\n```\n\nReuse the exact `id` (stringified) and `name` returned by PostHog\'s `/api/projects/` response for `posthogProjectId` and `posthogProjectName`. Field names are case-sensitive.\n\nIf a stream creation fails on duplicate display name, append a suffix (e.g. `"$POSTHOG_PROJECT_NAME (events)"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nHog-function provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id "$POSTHOG_CONNECTION_ID" --json\n```\n\nEach stream transitions from `pending` (or `provisioning`) to `active` once the backend finishes calling PostHog\'s `/api/projects/{id}/hog_functions/` endpoint. The stream\'s `config.posthogHogFunctionId` is populated on success. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that PostHog project and surface it to the user — the Temporal activity log holds the underlying error.\n\n**Pass 2 — telemetry arrival.** Hog functions only emit events when the PostHog project receives matching captures. Either trigger an event (`$pageview`, custom capture) or wait for natural traffic, then tail:\n\n```sh\n$SAZABI_CLI logs tail --json --search posthog\n```\n\nConfirm new records arrive tagged with the corresponding `posthogProjectName`. If nothing appears within a few minutes of triggering an event, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `POSTHOG_CONNECTION_ID` and the resolved `$POSTHOG_REGION` + `$POSTHOG_ORGANIZATION_NAME`.\n- One line per stream: PostHog project name, current status, and (if active) the `posthogHogFunctionId`.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored out (non-`active`, non-`pending`, non-`provisioning`), call out the failed PostHog project name and offer to recreate just that stream.\n\nDo not include `POSTHOG_TOKEN` in the summary.\n\n## Troubleshooting\n\n### Invalid or expired personal API key\n\nThe key may have been revoked, copied incorrectly, or expired. Recreate at the region-specific URL (`https://${POSTHOG_REGION}.posthog.com/settings/user-api-keys`) with the three required scopes and rerun Phase 2. The Sazabi connection still exists with a stale key — delete it (`data-sources connections delete <id>` if your CLI version supports it) and rerun from Phase 4, or update the connection metadata if `connections update` is available (`$SAZABI_CLI data-sources connections -h`).\n\n### Stream creation fails with `403` / "Insufficient permissions"\n\nThe personal API key is missing `hog_function:write`, or the user lacks admin access to that PostHog project. Verify the scope check at the end of Phase 2 passes, and confirm the user has at least Member (Admin recommended) access to the PostHog project. Recreate the key with the correct scope if needed.\n\n### Stream creation fails with `402` / "CDP destinations require a paid plan"\n\nHog functions / CDP destinations are a paid PostHog feature. The user must upgrade the PostHog organization billing plan before provisioning will succeed. The Sazabi connection and the failed stream can be deleted before retry; or leave them and provisioning will succeed next time it is retried.\n\n### Wrong region resolved\n\nThe probe in Phase 2 tries US first, EU second. A key that exists on **EU Cloud** but is rejected on US with a `401`/`403` will fall through correctly. If the probe returns a `5xx` on US, it short-circuits without trying EU — in that case retry the probe manually against EU only:\n\n```sh\ncurl -fsS -H "Authorization: Bearer $POSTHOG_TOKEN" \\\n "https://eu.posthog.com/api/projects/@current/"\n```\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No events arriving after streams are `active`\n\nA hog function that is `active` on the Sazabi side does not emit events unless the PostHog project receives captures matching the destination\'s filters. Trigger a real `$pageview` or `capture` event against the PostHog project. Confirm the hog function is enabled in PostHog → **Data Pipeline → Destinations** (look for `Sazabi — <project> (<prefix>)`).\n\n### Manual webhook destination already exists\n\nIf the user previously hand-created an HTTP Webhook destination in PostHog (the legacy manual flow), it will keep forwarding to Sazabi independently of this connection — this skill\'s native flow installs a **separate** hog function. Either delete the manual destination in PostHog before running this skill (to avoid duplicate events) or leave both in place if intentional.\n';var bv=()=>{};var pv=`## Overview
|
|
2961
3058
|
|
|
2962
3059
|
Forward Railway service logs and traces directly to Sazabi for real-time monitoring of your applications. Railway does not provide a managed log drain, so logs are emitted from your application via the OpenTelemetry SDK.
|
|
2963
3060
|
|
|
@@ -2967,22 +3064,19 @@ Configure your application with the standard OTEL environment variables to send
|
|
|
2967
3064
|
|
|
2968
3065
|
Once configured, logs stream automatically from your Railway deployments. Our AI agents analyze application health, detect deployment issues, and help you maintain reliable services.
|
|
2969
3066
|
|
|
2970
|
-
## Configuration
|
|
2971
|
-
|
|
2972
|
-
1. Add and initialize the OpenTelemetry SDK, OTLP exporter, and any language-specific auto-instrumentation your application needs
|
|
2973
|
-
2. In the Railway service's Variables tab, set the environment variables shown in the setup instructions
|
|
2974
|
-
3. Review and deploy Railway's staged variable changes, then redeploy or restart the service
|
|
2975
|
-
4. Generate traffic and verify the telemetry appears in Sazabi
|
|
2976
|
-
|
|
2977
|
-
The standard OTEL SDK environment variables configure the exporter once OpenTelemetry is installed and initialized. Minimal applications may still need an explicit bootstrap file, preload flag, or wrapper command so the SDK starts with the service.
|
|
2978
|
-
|
|
2979
3067
|
## Features
|
|
2980
3068
|
|
|
2981
3069
|
- Real-time log streaming via OpenTelemetry
|
|
2982
3070
|
- Support for logs and traces
|
|
2983
3071
|
- Service and deployment metadata included automatically
|
|
2984
3072
|
- Works with any language that has an OpenTelemetry SDK
|
|
2985
|
-
|
|
3073
|
+
|
|
3074
|
+
## Requirements
|
|
3075
|
+
|
|
3076
|
+
- Application instrumented with the OpenTelemetry SDK and OTLP exporter
|
|
3077
|
+
- Access to the Railway service's Variables tab to set environment variables
|
|
3078
|
+
- Permissions to approve and deploy Railway's staged variable changes and restart the service
|
|
3079
|
+
- Minimal applications may require an explicit bootstrap file, preload flag, or wrapper command so the SDK initializes with the service`;var mv=()=>{};var Iv=`# Railway Data Source Setup
|
|
2986
3080
|
|
|
2987
3081
|
Send Railway deployment logs to Sazabi with the **OpenTelemetry** pattern (same as other push-style manual sources).
|
|
2988
3082
|
|
|
@@ -3041,10 +3135,17 @@ Connect your Render account by configuring a log stream that forwards logs to Sa
|
|
|
3041
3135
|
|
|
3042
3136
|
Once connected, logs are streamed in real-time. Our AI agents analyze application behavior, detect anomalies, and help you troubleshoot issues across your Render deployments.
|
|
3043
3137
|
|
|
3044
|
-
##
|
|
3138
|
+
## Features
|
|
3045
3139
|
|
|
3046
|
-
|
|
3047
|
-
|
|
3140
|
+
- Real-time log streaming from Render services via the native log stream configuration
|
|
3141
|
+
- Coverage for web services, background workers, cron jobs, and databases
|
|
3142
|
+
- Service and environment filtering to control which deployments are monitored
|
|
3143
|
+
|
|
3144
|
+
## Requirements
|
|
3145
|
+
|
|
3146
|
+
- Render account with access to the services you want to monitor
|
|
3147
|
+
- Permissions to select services and configure log streams in the Render dashboard
|
|
3148
|
+
- Workspace admin access in Sazabi to enable the integration`;var fv=()=>{};var wv=`# Render Data Source Setup
|
|
3048
3149
|
|
|
3049
3150
|
Walk the user through connecting Render services to a Sazabi project using the Sazabi CLI for all Sazabi-side operations and direct calls to Render's REST API for workspace and service discovery. Creating a stream via \`sazabi data-sources streams create\` enqueues a Temporal activity that calls Render's \`PUT /v1/logs/streams/resource/{serviceId}\` API to install a per-service log stream override pointed at Sazabi's regional syslog intake — there is no separate "provision drains" command.
|
|
3050
3151
|
|
|
@@ -3276,9 +3377,17 @@ Configure your Sentry SDK to use a Sazabi DSN instead of the standard Sentry DSN
|
|
|
3276
3377
|
|
|
3277
3378
|
Once configured, errors are streamed in real-time from your application to Sazabi. Our AI agents automatically group similar errors, detect patterns, and help you identify root causes faster.
|
|
3278
3379
|
|
|
3279
|
-
##
|
|
3380
|
+
## Features
|
|
3381
|
+
|
|
3382
|
+
- Drop-in Sazabi DSN replacement for official Sentry SDKs.
|
|
3383
|
+
- Error, exception, and event capture using the SDK payloads your app already emits.
|
|
3384
|
+
- Automatic grouping, pattern detection, and root-cause analysis for streamed errors.
|
|
3280
3385
|
|
|
3281
|
-
|
|
3386
|
+
## Requirements
|
|
3387
|
+
|
|
3388
|
+
- Ability to replace the DSN used by your Sentry SDK initialization.
|
|
3389
|
+
- Permission to deploy the application code or configuration that sets the DSN.
|
|
3390
|
+
- Use of an official Sentry SDK supported by Sentry's standard DSN configuration.
|
|
3282
3391
|
`;var _v=()=>{};var Tv=`# Sentry SDK Data Source Setup
|
|
3283
3392
|
|
|
3284
3393
|
Forward Sentry SDK telemetry to Sazabi by swapping the SDK **DSN** to Sazabi’s intake-shaped DSN. This aligns with official Sentry clients (JavaScript, Python, Go, Ruby, Java, .NET, etc.).
|
|
@@ -3322,16 +3431,17 @@ During setup, Sazabi creates a Sentry Internal Integration scoped to your organi
|
|
|
3322
3431
|
|
|
3323
3432
|
The integration is also registered as an **alert action** in your Sentry org. To stream a specific Issue Alert or Metric Alert into Sazabi, edit that rule in Sentry and add the Sazabi integration as a notification destination — Sentry will then POST \`event_alert\` / \`metric_alert\` webhooks to Sazabi when the rule triggers.
|
|
3324
3433
|
|
|
3434
|
+
## Features
|
|
3435
|
+
|
|
3436
|
+
- Real-time issue and comment events forwarded via Sentry Internal Integration webhook
|
|
3437
|
+
- Alert actions for Issue Alerts and Metric Alerts when the Sazabi integration is added as a notification destination
|
|
3438
|
+
- AI analysis of error patterns and anomaly detection across your Sentry organization
|
|
3439
|
+
|
|
3325
3440
|
## Requirements
|
|
3326
3441
|
|
|
3327
3442
|
- **Owner or Manager role in your Sentry organization.** Creating an Internal Integration requires the \`org:write\` scope, which is only granted to Owners and Managers. The Admin role does not include \`org:write\`, so personal user auth tokens minted by Admins cannot create Internal Integrations. Sentry returns 403 when a Member, Billing, or Admin-role user tries to create one regardless of the auth token's scopes.
|
|
3328
3443
|
- A Sentry user auth token (Sentry UI labels): **Organization: Read & Write** (\`org:write\`), **Project: Read** (\`project:read\`), **Issue & Event: Read** (\`event:read\`). The \`org:write\` scope is needed only so Sazabi can create the Internal Integration on your behalf; the integration itself only receives read-level webhook events.
|
|
3329
|
-
- Works on all Sentry plans. Per-event \`error\` delivery (Sentry Business plan and up) is not currently used; \`issue\` events cover new error groupings on every plan.
|
|
3330
|
-
|
|
3331
|
-
## Configuration
|
|
3332
|
-
|
|
3333
|
-
A workspace admin can enable this integration in settings. Provide your Sentry auth token and organization slug, and Sazabi handles the rest.
|
|
3334
|
-
`;var Pv=()=>{};var Nv='# Sentry Platform Data Source Setup\n\nConnect a Sentry organization to a Sazabi project via Sazabi-managed **Sentry Internal Integration**. Sazabi creates the Internal Integration in the user\'s Sentry org, subscribes it to `issue` and `comment` webhooks, and registers it as an alertable destination for Issue/Metric Alert rules. Use the Sazabi CLI (`data-sources connections create --type sentry_platform`); the provisioning, public-key minting, and webhook URL are handled server-side. This source has `streamCardinality: "single"` — creating the connection auto-provisions exactly one stream. Do **not** call `streams create` manually.\n\nThis skill covers the Sentry Platform (webhook) source. It is distinct from the **Sentry SDK** source (`sentry`), which forwards SDK telemetry via a swapped DSN. Pick this one when the user wants Sentry issues, comments, and alerts streamed to Sazabi.\n\n**Principle:** Do the work. Only pause when the user must act: minting a Sentry auth token in the browser, choosing the Sazabi project, or confirming a policy decision.\n\n<important>\nUse AskUserQuestion only for user-owned boundaries: choosing the Sazabi project, pasting the Sentry auth token, providing the organization slug, and confirming the Sentry user has Owner/Manager role.\n</important>\n\n## Phase 0: Preflight\n\nSelect the Sazabi CLI command prefix. Prefer the installed `sazabi` binary; fall back to `bunx @sazabi/cli` rather than asking the user to install globally.\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below.\n\nCheck authentication:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf unauthenticated, ask the user whether to authenticate via browser login or paste an existing token. Browser login: `$SAZABI_CLI auth login`. Token: `$SAZABI_CLI auth save <token>`. Do not echo the token back.\n\nCheck whether a Sentry Platform connection already exists for the active project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type sentry_platform --json\n```\n\nIf a connection already exists for the target Sentry organization, stop and tell the user setup is already complete. Re-running the create flow against the same organization will be rejected by `getConnectionIdentity` (which keys on `org:<organizationSlug>`).\n\n## Phase 1: Choose the Sazabi project\n\nIf the active project is already correct in context, reuse it. Otherwise list and select:\n\n```sh\n$SAZABI_CLI projects list --json\n$SAZABI_CLI projects use <project-id>\n```\n\nCapture the chosen project ID as `SAZABI_PROJECT_ID`.\n\n## Phase 2: Confirm the user has Owner or Manager role in Sentry\n\nCreating a Sentry Internal Integration requires the **`org:write`** scope, which Sentry only grants to users with **Owner** or **Manager** organization role. Admin, Member, and Billing roles cannot mint an `org:write` token regardless of the UI letting them check the scope box — Sentry will return `403` from `POST /api/0/sentry-apps/`.\n\nAskUserQuestion: Confirm the Sentry user is an **Owner** or **Manager** in the target Sentry organization. If they are an Admin/Member/Billing user, have an Owner or Manager run this setup instead.\n\n## Phase 3: Mint the Sentry auth token\n\nDirect the user to:\n\n> Open **https://sentry.io/settings/account/api/auth-tokens/new-token/** in your browser, then create a token with exactly these scopes:\n>\n> - **Organization: Read & Write** (`org:write`)\n> - **Project: Read** (`project:read`)\n> - **Issue & Event: Read** (`event:read`)\n>\n> Confirm the **Permissions Preview** at the bottom of the form shows `event:read, org:write, project:read` before clicking **Create Token**. The token is shown once — copy it immediately.\n\nAskUserQuestion: Paste the Sentry auth token you just created.\n\nCapture as `SENTRY_AUTH_TOKEN`. Do not print it back.\n\nAskUserQuestion: Paste the Sentry organization slug (the `<slug>` segment in `sentry.io/organizations/<slug>/`).\n\nCapture as `SENTRY_ORG_SLUG`. It must match `^[a-z0-9][a-z0-9-]*[a-z0-9]$` — lowercase letters, digits, and hyphens only.\n\n## Phase 4: Create the connection\n\nThe Sazabi CLI runs validation (`GET /api/0/organizations/<slug>/`) before persisting, then auto-provisions the single stream, which in turn mints a public key and creates the Internal Integration in Sentry with webhook URL `https://sentry-platform.<region>.intake.<domain>/v1/logs?api_key=<publicKey>`.\n\n```sh\nCONNECTION_JSON=$($SAZABI_CLI data-sources connections create \\\n --type sentry_platform \\\n --metadata "$(jq -n \\\n --arg token "$SENTRY_AUTH_TOKEN" \\\n --arg slug "$SENTRY_ORG_SLUG" \\\n \'{connectionMode: "native", sentryAuthToken: $token, organizationSlug: $slug}\')" \\\n --json)\n\nCONNECTION_ID=$(printf \'%s\' "$CONNECTION_JSON" | jq -r \'.connectionId\')\n```\n\nDo **not** also run `data-sources streams create`. `streamCardinality: "single"` causes the connection-create flow to provision the one stream automatically.\n\nHandle expected failures here:\n\n- **`401 Invalid auth token`**: the token was mistyped, revoked, or lacks the required scopes. Re-mint at the URL in Phase 3 and retry.\n- **`403 ... org:write scope ... Owner or Manager`**: the Sentry user is not an Owner/Manager. Restart from Phase 2 with a qualified user.\n- **`404 Organization not found`**: re-check `SENTRY_ORG_SLUG` against `sentry.io/organizations/<slug>/`. Do not invent it — Sentry slugs are lowercase and may differ from the display name.\n- **Duplicate connection error**: a connection already exists for `org:<SENTRY_ORG_SLUG>` in this project. Run `connections list --type sentry_platform --json` to find it; reuse or delete it before retrying.\n\n## Phase 5: Verify and report\n\nInspect the connection and its stream:\n\n```sh\n$SAZABI_CLI data-sources connections get "$CONNECTION_ID" --json\n$SAZABI_CLI data-sources streams list --connection-id "$CONNECTION_ID" --json\n```\n\nThe single stream should appear with a `status` that transitions to `active` once provisioning finishes. The stream\'s `config` will then contain `sentryAppSlug` (the Internal Integration\'s slug in Sentry) and `publicKeyId`.\n\nTrigger a real signal to confirm end-to-end delivery. Any of these will fire a webhook:\n\n- In Sentry, open any Issue and add a comment, change status, assign, or resolve it.\n- Or trigger a fresh exception in an instrumented Sentry project to create a new issue.\n\nTail Sazabi logs for the project while the user performs the action:\n\n```sh\n$SAZABI_CLI logs tail --services sentry-platform-intake --json\n```\n\nSuccessful delivery shows entries with `sentry.webhook.resource` of `issue` or `comment` and `sentry.webhook.action` populated.\n\nSummarize the result for the user:\n\n- The `connectionId`.\n- That a single stream was auto-provisioned and is forwarding `issue` and `comment` webhooks.\n- That **Issue Alert** and **Metric Alert** webhooks are opt-in: the user must edit each Sentry alert rule in **Alerts** and add the integration (named `Sazabi (<stream display name>)`) as a notification destination. Without that step, `event_alert` and `metric_alert` deliveries will not arrive even though the integration is `isAlertable`.\n\nNever print `SENTRY_AUTH_TOKEN` or the minted public key in the summary.\n\n## Troubleshooting\n\n### Token works but no webhooks arrive\n\nVerify the Internal Integration exists in Sentry at **Settings → Developer Settings → Custom Integrations**. The name will be `Sazabi (<stream display name>)`. If it is missing, the provisioning step failed silently — check `streams list` for `status = error` and `errorMessage` to see the underlying Sentry API response.\n\n### Alert webhooks (`event_alert` / `metric_alert`) never fire\n\nThese are not subscribed automatically. The user must add the Sazabi integration as a notification action on each alert rule in Sentry under **Alerts → <rule> → Edit → Then perform these actions**. Issue and comment webhooks are unaffected and arrive regardless.\n\n### `403` on every Sentry call despite Owner role\n\nConfirm the token is a **user auth token** minted from **Account → API → Auth Tokens**, not an organization-scoped DSN or a deploy key. Internal Integration auth tokens cannot mint other Internal Integrations.\n\n### Connection persisted but stream stuck in `pending`\n\nProvisioning runs in a Temporal workflow. Wait 30 seconds and re-run `streams list`. If still pending after a minute, the workflow likely errored — surface `errorMessage` and retry by deleting the connection and re-running Phase 4.\n';var Dv=()=>{};var Cv=`## Overview
|
|
3444
|
+
- Works on all Sentry plans. Per-event \`error\` delivery (Sentry Business plan and up) is not currently used; \`issue\` events cover new error groupings on every plan.`;var Pv=()=>{};var Nv='# Sentry Platform Data Source Setup\n\nConnect a Sentry organization to a Sazabi project via Sazabi-managed **Sentry Internal Integration**. Sazabi creates the Internal Integration in the user\'s Sentry org, subscribes it to `issue` and `comment` webhooks, and registers it as an alertable destination for Issue/Metric Alert rules. Use the Sazabi CLI (`data-sources connections create --type sentry_platform`); the provisioning, public-key minting, and webhook URL are handled server-side. This source has `streamCardinality: "single"` — creating the connection auto-provisions exactly one stream. Do **not** call `streams create` manually.\n\nThis skill covers the Sentry Platform (webhook) source. It is distinct from the **Sentry SDK** source (`sentry`), which forwards SDK telemetry via a swapped DSN. Pick this one when the user wants Sentry issues, comments, and alerts streamed to Sazabi.\n\n**Principle:** Do the work. Only pause when the user must act: minting a Sentry auth token in the browser, choosing the Sazabi project, or confirming a policy decision.\n\n<important>\nUse AskUserQuestion only for user-owned boundaries: choosing the Sazabi project, pasting the Sentry auth token, providing the organization slug, and confirming the Sentry user has Owner/Manager role.\n</important>\n\n## Phase 0: Preflight\n\nSelect the Sazabi CLI command prefix. Prefer the installed `sazabi` binary; fall back to `bunx @sazabi/cli` rather than asking the user to install globally.\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below.\n\nCheck authentication:\n\n```sh\n$SAZABI_CLI auth whoami --json\n```\n\nIf unauthenticated, ask the user whether to authenticate via browser login or paste an existing token. Browser login: `$SAZABI_CLI auth login`. Token: `$SAZABI_CLI auth save <token>`. Do not echo the token back.\n\nCheck whether a Sentry Platform connection already exists for the active project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type sentry_platform --json\n```\n\nIf a connection already exists for the target Sentry organization, stop and tell the user setup is already complete. Re-running the create flow against the same organization will be rejected by `getConnectionIdentity` (which keys on `org:<organizationSlug>`).\n\n## Phase 1: Choose the Sazabi project\n\nIf the active project is already correct in context, reuse it. Otherwise list and select:\n\n```sh\n$SAZABI_CLI projects list --json\n$SAZABI_CLI projects use <project-id>\n```\n\nCapture the chosen project ID as `SAZABI_PROJECT_ID`.\n\n## Phase 2: Confirm the user has Owner or Manager role in Sentry\n\nCreating a Sentry Internal Integration requires the **`org:write`** scope, which Sentry only grants to users with **Owner** or **Manager** organization role. Admin, Member, and Billing roles cannot mint an `org:write` token regardless of the UI letting them check the scope box — Sentry will return `403` from `POST /api/0/sentry-apps/`.\n\nAskUserQuestion: Confirm the Sentry user is an **Owner** or **Manager** in the target Sentry organization. If they are an Admin/Member/Billing user, have an Owner or Manager run this setup instead.\n\n## Phase 3: Mint the Sentry auth token\n\nDirect the user to:\n\n> Open **https://sentry.io/settings/account/api/auth-tokens/new-token/** in your browser, then create a token with exactly these scopes:\n>\n> - **Organization: Read & Write** (`org:write`)\n> - **Project: Read** (`project:read`)\n> - **Issue & Event: Read** (`event:read`)\n>\n> Confirm the **Permissions Preview** at the bottom of the form shows `event:read, org:write, project:read` before clicking **Create Token**. The token is shown once — copy it immediately.\n\nAskUserQuestion: Paste the Sentry auth token you just created.\n\nCapture as `SENTRY_AUTH_TOKEN`. Do not print it back.\n\nAskUserQuestion: Paste the Sentry organization slug (the `<slug>` segment in `sentry.io/organizations/<slug>/`).\n\nCapture as `SENTRY_ORG_SLUG`. It must match `^[a-z0-9][a-z0-9-]*[a-z0-9]$` — lowercase letters, digits, and hyphens only.\n\n## Phase 4: Create the connection\n\nThe Sazabi CLI runs validation (`GET /api/0/organizations/<slug>/`) before persisting, then auto-provisions the single stream, which in turn mints a public key and creates the Internal Integration in Sentry with webhook URL `https://sentry-platform.<region>.intake.<domain>/v1/logs?api_key=<publicKey>`.\n\n```sh\nCONNECTION_JSON=$($SAZABI_CLI data-sources connections create \\\n --type sentry_platform \\\n --metadata "$(jq -n \\\n --arg token "$SENTRY_AUTH_TOKEN" \\\n --arg slug "$SENTRY_ORG_SLUG" \\\n \'{connectionMode: "native", sentryAuthToken: $token, organizationSlug: $slug}\')" \\\n --json)\n\nCONNECTION_ID=$(printf \'%s\' "$CONNECTION_JSON" | jq -r \'.connectionId\')\n```\n\nDo **not** also run `data-sources streams create`. `streamCardinality: "single"` causes the connection-create flow to provision the one stream automatically.\n\nHandle expected failures here:\n\n- **`401 Invalid auth token`**: the token was mistyped, revoked, or lacks the required scopes. Re-mint at the URL in Phase 3 and retry.\n- **`403 ... org:write scope ... Owner or Manager`**: the Sentry user is not an Owner/Manager. Restart from Phase 2 with a qualified user.\n- **`404 Organization not found`**: re-check `SENTRY_ORG_SLUG` against `sentry.io/organizations/<slug>/`. Do not invent it — Sentry slugs are lowercase and may differ from the display name.\n- **Duplicate connection error**: a connection already exists for `org:<SENTRY_ORG_SLUG>` in this project. Run `connections list --type sentry_platform --json` to find it; reuse or delete it before retrying.\n\n## Phase 5: Verify and report\n\nInspect the connection and its stream:\n\n```sh\n$SAZABI_CLI data-sources connections get "$CONNECTION_ID" --json\n$SAZABI_CLI data-sources streams list --connection-id "$CONNECTION_ID" --json\n```\n\nThe single stream should appear with a `status` that transitions to `active` once provisioning finishes. The stream\'s `config` will then contain `sentryAppSlug` (the Internal Integration\'s slug in Sentry) and `publicKeyId`.\n\nTrigger a real signal to confirm end-to-end delivery. Any of these will fire a webhook:\n\n- In Sentry, open any Issue and add a comment, change status, assign, or resolve it.\n- Or trigger a fresh exception in an instrumented Sentry project to create a new issue.\n\nTail Sazabi logs for the project while the user performs the action:\n\n```sh\n$SAZABI_CLI logs tail --services sentry-platform-intake --json\n```\n\nSuccessful delivery shows entries with `sentry.webhook.resource` of `issue` or `comment` and `sentry.webhook.action` populated.\n\nSummarize the result for the user:\n\n- The `connectionId`.\n- That a single stream was auto-provisioned and is forwarding `issue` and `comment` webhooks.\n- That **Issue Alert** and **Metric Alert** webhooks are opt-in: the user must edit each Sentry alert rule in **Alerts** and add the integration (named `Sazabi (<stream display name>)`) as a notification destination. Without that step, `event_alert` and `metric_alert` deliveries will not arrive even though the integration is `isAlertable`.\n\nNever print `SENTRY_AUTH_TOKEN` or the minted public key in the summary.\n\n## Troubleshooting\n\n### Token works but no webhooks arrive\n\nVerify the Internal Integration exists in Sentry at **Settings → Developer Settings → Custom Integrations**. The name will be `Sazabi (<stream display name>)`. If it is missing, the provisioning step failed silently — check `streams list` for `status = error` and `errorMessage` to see the underlying Sentry API response.\n\n### Alert webhooks (`event_alert` / `metric_alert`) never fire\n\nThese are not subscribed automatically. The user must add the Sazabi integration as a notification action on each alert rule in Sentry under **Alerts → <rule> → Edit → Then perform these actions**. Issue and comment webhooks are unaffected and arrive regardless.\n\n### `403` on every Sentry call despite Owner role\n\nConfirm the token is a **user auth token** minted from **Account → API → Auth Tokens**, not an organization-scoped DSN or a deploy key. Internal Integration auth tokens cannot mint other Internal Integrations.\n\n### Connection persisted but stream stuck in `pending`\n\nProvisioning runs in a Temporal workflow. Wait 30 seconds and re-run `streams list`. If still pending after a minute, the workflow likely errored — surface `errorMessage` and retry by deleting the connection and re-running Phase 4.\n';var Dv=()=>{};var Cv=`## Overview
|
|
3335
3445
|
|
|
3336
3446
|
Stream your Supabase project logs directly to Sazabi for unified observability of your backend-as-a-service infrastructure. Monitor database queries, authentication events, Edge Functions, and real-time subscriptions.
|
|
3337
3447
|
|
|
@@ -3341,22 +3451,18 @@ Configure an OpenTelemetry Protocol (OTLP) log drain in your Supabase dashboard
|
|
|
3341
3451
|
|
|
3342
3452
|
Once configured, logs flow automatically to our platform. AI agents analyze query performance, detect authentication anomalies, and help you optimize your Supabase applications.
|
|
3343
3453
|
|
|
3344
|
-
##
|
|
3345
|
-
|
|
3346
|
-
Log Drains require a Supabase Pro, Team, or Enterprise plan. You can upgrade your project plan in the Supabase dashboard under Project Settings > Billing.
|
|
3454
|
+
## Features
|
|
3347
3455
|
|
|
3348
|
-
|
|
3456
|
+
- Postgres query logs, authentication events, and connection events via OTLP Log Drains
|
|
3457
|
+
- Edge Function logs streamed in real-time
|
|
3458
|
+
- Auth service logs for anomaly detection and debugging
|
|
3459
|
+
- HTTP/protobuf transport with gzip compression support
|
|
3349
3460
|
|
|
3350
|
-
|
|
3351
|
-
2. Go to Project Settings > Log Drains
|
|
3352
|
-
3. Click "Add destination" and select "OpenTelemetry Protocol (OTLP)" in the Type dropdown
|
|
3353
|
-
4. Enter the endpoint shown in the setup instructions
|
|
3354
|
-
5. Leave Protocol on HTTP/Protobuf (the only supported option) and keep Gzip Compression enabled
|
|
3355
|
-
6. Under Custom Headers, leave the pre-filled \`Content-Type: application/x-protobuf\` row in place and click "Add a new header" to add the \`Authorization: Bearer <publicKey>\` row shown in the setup instructions
|
|
3356
|
-
7. Click "Save destination"
|
|
3461
|
+
## Requirements
|
|
3357
3462
|
|
|
3358
|
-
|
|
3359
|
-
|
|
3463
|
+
- A Supabase **Pro**, **Team**, or **Enterprise** plan. Log Drains are not available on the Free plan. You can upgrade your project plan in the Supabase dashboard under Project Settings > Billing.
|
|
3464
|
+
- Access to your Supabase project's Log Drains settings (Project Settings > Log Drains)
|
|
3465
|
+
- Ability to add custom HTTP headers when configuring the OTLP destination`;var Lv=()=>{};var zv=`# Supabase Data Source Setup
|
|
3360
3466
|
|
|
3361
3467
|
Connect Supabase project logs to Sazabi through Supabase **Log Drains** using **OpenTelemetry (OTLP) over HTTP** with protobuf bodies.
|
|
3362
3468
|
|
|
@@ -3389,7 +3495,7 @@ Under **Custom Headers**, Supabase pre-fills the \`Content-Type\` row when OTLP
|
|
|
3389
3495
|
## Phase 3: Validate
|
|
3390
3496
|
|
|
3391
3497
|
Produce traffic in Supabase so new log drain batches emit. Confirm matching events appear in Sazabi for that project. If silent, verify gzip + protobuf + bearer format and that the drain is enabled for the environments you expect.
|
|
3392
|
-
`;var xv=()=>{};var Ev="## Overview\n\nForward OpenTelemetry logs and traces from your Temporal worker processes to Sazabi to observe durable workflow execution. Works for both Temporal Cloud and self-hosted clusters — everything is configured inside the worker process, not in the Temporal control plane.\n\n## How it works\n\nAdd the OpenTelemetry SDK to each Temporal worker. The OTel SDK reads the `OTEL_EXPORTER_OTLP_*` environment variables you set on the worker and exports telemetry to the Sazabi intake. Workflow- and activity-level traces are produced by registering Temporal's official OpenTelemetry tracing interceptor (`temporalio.contrib.opentelemetry.TracingInterceptor` in Python, `OpenTelemetryWorkflowClientInterceptor` in TypeScript, `tracing.NewTracingInterceptor` in Go, `Temporalio.Extensions.OpenTelemetry` in .NET).\n\nWorker-emitted metrics (such as `temporal_workflow_task_execution_latency` and `temporal_worker_task_slots_available`) are configured separately on the Temporal SDK runtime and are not currently ingested by this integration.\n\n##
|
|
3498
|
+
`;var xv=()=>{};var Ev="## Overview\n\nForward OpenTelemetry logs and traces from your Temporal worker processes to Sazabi to observe durable workflow execution. Works for both Temporal Cloud and self-hosted clusters — everything is configured inside the worker process, not in the Temporal control plane.\n\n## How it works\n\nAdd the OpenTelemetry SDK to each Temporal worker. The OTel SDK reads the `OTEL_EXPORTER_OTLP_*` environment variables you set on the worker and exports telemetry to the Sazabi intake. Workflow- and activity-level traces are produced by registering Temporal's official OpenTelemetry tracing interceptor (`temporalio.contrib.opentelemetry.TracingInterceptor` in Python, `OpenTelemetryWorkflowClientInterceptor` in TypeScript, `tracing.NewTracingInterceptor` in Go, `Temporalio.Extensions.OpenTelemetry` in .NET).\n\nWorker-emitted metrics (such as `temporal_workflow_task_execution_latency` and `temporal_worker_task_slots_available`) are configured separately on the Temporal SDK runtime and are not currently ingested by this integration.\n\n## Features\n\n- OpenTelemetry logs and traces from Temporal worker processes.\n- Workflow- and activity-level spans through Temporal's official tracing interceptors.\n- Support for Temporal Cloud and self-hosted clusters without control-plane changes.\n\n## Requirements\n\n- Permission to deploy worker code that initializes the OpenTelemetry SDK.\n- Access to install and configure the OpenTelemetry SDK and Temporal tracing interceptor for your worker language.\n- Metrics emitted by Temporal workers are configured separately and are not currently stored by this integration; logs and traces are supported.\n";var jv=()=>{};var Rv=`# Temporal Data Source Setup
|
|
3393
3499
|
|
|
3394
3500
|
Forward OpenTelemetry logs and traces from your **Temporal worker processes** (self-hosted or long-lived workers connecting to Temporal Cloud) to Sazabi. The Temporal control plane is not modified — everything is configured in worker code and worker environment variables.
|
|
3395
3501
|
|
|
@@ -3419,7 +3525,7 @@ Restart workers after changing env vars.
|
|
|
3419
3525
|
- Temporal Cloud users still run OTEL inside **their** workers; Temporal Cloud itself is not altered.
|
|
3420
3526
|
- The Sazabi intake accepts OTLP logs and traces. OTLP metrics posted to this endpoint are dropped — Temporal SDK worker metrics (Prometheus/\`Runtime.install\` telemetry) are not currently ingested.
|
|
3421
3527
|
- Confirm clock skew is normal and batches are permitted through corporate egress (HTTPS to \`*.intake.*\`).
|
|
3422
|
-
`;var Uv=()=>{};var
|
|
3528
|
+
`;var Uv=()=>{};var Fv=`## Overview
|
|
3423
3529
|
|
|
3424
3530
|
Stream Trigger.dev task logs directly to Sazabi for real-time monitoring of background jobs and scheduled tasks.
|
|
3425
3531
|
|
|
@@ -3429,14 +3535,6 @@ Configure \`telemetry.logExporters\` in your \`trigger.config.ts\` file with an
|
|
|
3429
3535
|
|
|
3430
3536
|
This source is logs-first. Trigger.dev alert webhooks only report run and deployment status changes, and the Trigger.dev management API exposes run or trace retrieval rather than a log-forwarding subscription. Do not use those paths as the primary Sazabi data source.
|
|
3431
3537
|
|
|
3432
|
-
## Configuration
|
|
3433
|
-
|
|
3434
|
-
1. In Sazabi, open **Settings → Data sources → Trigger.dev** and create the manual connection.
|
|
3435
|
-
2. Install \`@opentelemetry/exporter-logs-otlp-http\` in the package that owns \`trigger.config.ts\`.
|
|
3436
|
-
3. Add \`SAZABI_API_KEY\` to the Trigger.dev deployment environment using the public key from Sazabi.
|
|
3437
|
-
4. Add an \`OTLPLogExporter\` to \`telemetry.logExporters\` in \`trigger.config.ts\` using the Sazabi URL shown in the setup screen. The URL includes \`/v1/logs\`.
|
|
3438
|
-
5. Redeploy the Trigger.dev project.
|
|
3439
|
-
|
|
3440
3538
|
Do not configure this integration with \`OTEL_*\` environment variables. Trigger.dev reserves those variables for its own internal telemetry, so the exporter must be configured directly in \`trigger.config.ts\`.
|
|
3441
3539
|
|
|
3442
3540
|
## Features
|
|
@@ -3444,7 +3542,32 @@ Do not configure this integration with \`OTEL_*\` environment variables. Trigger
|
|
|
3444
3542
|
- Task and job logs forwarded through OTLP
|
|
3445
3543
|
- Run failure details when emitted through Trigger.dev logs
|
|
3446
3544
|
- Background job observability in Sazabi without alert-webhook or polling setup
|
|
3447
|
-
|
|
3545
|
+
|
|
3546
|
+
## Requirements
|
|
3547
|
+
|
|
3548
|
+
- Edit access to \`trigger.config.ts\` in the package that owns the Trigger.dev project
|
|
3549
|
+
- Ability to install \`@opentelemetry/exporter-logs-otlp-http\` as a dependency
|
|
3550
|
+
- Access to set environment variables in the Trigger.dev deployment environment (for the Sazabi public key)
|
|
3551
|
+
- Trigger.dev project must be redeployed after configuration changes take effect`;var Kv=()=>{};var Bv="# Trigger.dev Data Source Setup\n\nConfigure Trigger.dev as a **manual OTLP logs** data source. This source is not native: the user must edit `trigger.config.ts` and redeploy their Trigger.dev project.\n\n## Phase 1: Sazabi values\n\nCreate or open the Trigger.dev data source in Sazabi and copy the rendered values from the manual setup screen:\n\n- **Sazabi API key**: `{publicKey}`.\n- **Logs endpoint**: `https://trigger-dev.{projectRegion}.intake.{intakeDomain}/v1/logs`.\n\nTreat the key as a bearer secret and never echo the full value back in logs, commits, or chat transcripts.\n\n## Phase 2: Trigger.dev config\n\n1. Install `@opentelemetry/exporter-logs-otlp-http` in the package that owns `trigger.config.ts`.\n2. Store the Sazabi public key as `SAZABI_API_KEY` in the Trigger.dev deployment environment.\n3. Add an `OTLPLogExporter` to `telemetry.logExporters` in `trigger.config.ts`.\n4. Redeploy the Trigger.dev project.\n\nDo not set `OTEL_*` environment variables for this integration. Trigger.dev reserves those variables for internal telemetry, so configure the log exporter in code.\n\n## Phase 3: Out of scope\n\nUse this data source for logs only. Do not configure Trigger.dev alert webhooks, management API polling, trace retrieval, trace exporters, or metrics exporters as the primary Sazabi data source for this setup.\n\n## Phase 4: Verify\n\nTrigger a task that emits logs and confirm new records arrive in Sazabi for the project. If nothing appears, re-check that the URL includes `/v1/logs`, the `Authorization` header is `Bearer <publicKey>`, and the redeployed config uses `telemetry.logExporters`.\n";var Gv=()=>{};var Mv=`## Overview
|
|
3552
|
+
|
|
3553
|
+
Forward logs and traces from your infrastructure to Sazabi using Vector. Vector runs as a high-performance DaemonSet on Kubernetes and can collect from dozens of sources before shipping to Sazabi's OTLP intake.
|
|
3554
|
+
|
|
3555
|
+
## How it works
|
|
3556
|
+
|
|
3557
|
+
Vector's \`opentelemetry\` sink exports data to Sazabi using the OTLP/HTTP protocol. Configure the sink with your Sazabi intake endpoint and public key, then route your existing pipeline outputs through a \`remap\` transform that builds the OTLP envelope before the sink consumes them.
|
|
3558
|
+
|
|
3559
|
+
## Features
|
|
3560
|
+
|
|
3561
|
+
- OTLP/HTTP export from Vector to Sazabi using the \`opentelemetry\` sink.
|
|
3562
|
+
- Flexible routing from selected Vector sources or transforms into Sazabi.
|
|
3563
|
+
- Remap transform support for building the OTLP envelope before export.
|
|
3564
|
+
|
|
3565
|
+
## Requirements
|
|
3566
|
+
|
|
3567
|
+
- Vector 0.51.0 or later for the \`otlp\` encoding codec.
|
|
3568
|
+
- Access to edit your Vector configuration file or Helm values.
|
|
3569
|
+
- Ability to add the OTLP envelope remap transform and Sazabi public-key authorization to the pipeline.
|
|
3570
|
+
`;var Hv=()=>{};var Vv=`# Vector Data Source Setup
|
|
3448
3571
|
|
|
3449
3572
|
Walk the user through connecting Vector to Sazabi so logs from their infrastructure appear in the project. Forwarding traces is supported but requires the source already produce OTLP-shaped events — covered as an optional add-on at the end.
|
|
3450
3573
|
|
|
@@ -3594,32 +3717,26 @@ This is the most common failure mode and almost always means the OTLP envelope i
|
|
|
3594
3717
|
### Partial data
|
|
3595
3718
|
|
|
3596
3719
|
- Use \`vector top\` to check per-component throughput. If the transform receives events but the sink shows zero outbound, the envelope shape is likely wrong — \`tap\` the transform and verify the structure.
|
|
3597
|
-
`;var
|
|
3598
|
-
|
|
3599
|
-
Forward your Vercel deployment logs, traces, and Web Analytics events directly to Sazabi for real-time analysis and alerting.
|
|
3600
|
-
|
|
3601
|
-
## Overview
|
|
3720
|
+
`;var Jv=()=>{};var Wv=`## Overview
|
|
3602
3721
|
|
|
3603
3722
|
Our Vercel integration automatically streams logs from your serverless functions, edge functions, and static builds, along with OpenTelemetry traces and Web Analytics events, to Sazabi's observability platform.
|
|
3604
3723
|
|
|
3605
3724
|
## How it works
|
|
3606
3725
|
|
|
3607
|
-
|
|
3726
|
+
Connect your Vercel account by providing an API token. Select which Vercel projects to monitor, then choose whether to create logs, traces, or analytics drains. Log drains forward every Vercel log source (Static, Lambda, Edge, Build, External, Firewall, Redirect). AI agents analyze logs, traces, and analytics events to identify patterns, anomalies, and root causes of issues.
|
|
3608
3727
|
|
|
3609
|
-
|
|
3728
|
+
## Features
|
|
3610
3729
|
|
|
3611
|
-
|
|
3730
|
+
- Logs from all Vercel log sources: Static, Lambda, Edge, Build, External, Firewall, Redirect
|
|
3731
|
+
- OpenTelemetry traces from serverless and edge functions
|
|
3732
|
+
- Web Analytics events forwarded via analytics drains
|
|
3733
|
+
- Real-time AI analysis of deployment logs, traces, and analytics
|
|
3612
3734
|
|
|
3613
3735
|
## Requirements
|
|
3614
3736
|
|
|
3615
3737
|
- A Vercel team on the **Pro** or **Enterprise** plan. Vercel's [Drains](https://vercel.com/docs/drains) feature — which Sazabi uses to forward logs, traces, and Web Analytics events — is not available on Hobby or Pro Trial accounts.
|
|
3616
3738
|
- A full-access API token created from your [Vercel account settings](https://vercel.com/account/tokens). Vercel tokens inherit the full permissions of your account; there is no way to select individual scopes. For team accounts, create the token while scoped to the team you want to connect.
|
|
3617
|
-
- Web Analytics enabled in Vercel for projects where you create analytics drains.
|
|
3618
|
-
|
|
3619
|
-
## Configuration
|
|
3620
|
-
|
|
3621
|
-
A workspace admin can enable this integration in settings. Once configured, Vercel logs, traces, and Web Analytics events will automatically stream to Sazabi.
|
|
3622
|
-
`;var qv=()=>{};var Xv='---\nname: vercel-data-source-setup\ndescription: Connect Vercel projects to a Sazabi project so deployment logs, OpenTelemetry traces, and Web Analytics events stream into Sazabi. Use when the user wants to "connect Vercel", "set up Vercel logs/traces in Sazabi", "ingest Vercel telemetry", "add a Vercel data source", or after running `sazabi data-sources skill --type vercel`. Drives the Sazabi CLI (`data-sources connections create` + `data-sources streams create`) plus direct calls to Vercel\'s REST API for project discovery; stream creation triggers the backend\'s drain provisioner which calls Vercel\'s `/v1/drains` endpoint.\n---\n\n# Vercel Data Source Setup\n\nWalk the user through connecting Vercel projects to a Sazabi project using the Sazabi CLI for all Sazabi-side operations and direct calls to Vercel\'s REST API for Vercel-side project discovery. Creating a stream via `sazabi data-sources streams create` enqueues a Temporal activity that calls Vercel\'s `/v1/drains` API for that project — there is no separate "provision drains" command.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating a token in the Vercel UI, choosing the Sazabi project, picking Vercel projects, or picking a drain type. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, entering the API token, picking Vercel projects, or picking a drain type.\n- Never echo `VERCEL_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to Vercel\'s REST API in Phase 3.\n\nThe user needs:\n\n1. A Sazabi project to receive the Vercel telemetry.\n2. A Vercel team on the **Pro** or **Enterprise** plan. Drains are not available on Hobby or Pro Trial — see https://vercel.com/docs/drains#usage-and-pricing.\n3. A Vercel account with access to the projects they want to monitor.\n4. A browser to create a Vercel API token.\n5. Web Analytics enabled in Vercel for any project where they want analytics events.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the Vercel telemetry? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use "$SAZABI_PROJECT_ID"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing Vercel connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type vercel --json\n```\n\nIf a Vercel connection already exists that targets the Vercel scope (team or personal account) the user wants to onboard, reuse its `id` as `VERCEL_CONNECTION_ID` and skip Phase 2 and Phase 4 — jump to Phase 5 and create only the new streams. Do not create a duplicate connection for the same Vercel scope.\n\n## Phase 2: Create and capture the Vercel token\n\nDirect the user to create a token:\n\n> Open **https://vercel.com/account/tokens** and click **Create Token**.\n>\n> - **Token Name**: `Sazabi`\n> - **Scope**: Select the team you want to monitor, or **Full Account** for personal accounts.\n> - **Expiration**: Choose per security policy. No expiration is acceptable for automation.\n>\n> Vercel only displays the token once. If the user closes the dialog without copying it, they must create a new token.\n\n`AskUserQuestion`: ask the user to paste the API token. Capture it as `VERCEL_TOKEN`.\n\nSanity-check the token before discovering projects:\n\n```sh\ncurl -fsS -H "Authorization: Bearer $VERCEL_TOKEN" https://api.vercel.com/v2/user >/dev/null \\\n && echo "ok" || echo "invalid"\n```\n\nIf `invalid`, the token was revoked, copied incorrectly, or expired. Have the user create a new token and retry. Do not print `VERCEL_TOKEN` in any error output.\n\n## Phase 3: Discover and pick Vercel projects\n\nThe Sazabi CLI does not enumerate Vercel projects — call Vercel\'s REST API directly with `VERCEL_TOKEN`. Both endpoints are paginated and return `{ pagination: { next, ... } }`; iterate until `next` is null/missing or accounts with more than 100 projects/teams will be silently truncated.\n\n```bash\n# Iterate a Vercel paginated endpoint. $1 = base URL, $2 = cursor param name\n# (`from` for /v10/projects, `until` for /v2/teams). Emits one JSON page per line.\nvercel_paginate() {\n local url="$1" param="$2" page next\n while :; do\n page=$(curl -fsS -H "Authorization: Bearer $VERCEL_TOKEN" "$url") || return 1\n printf \'%s\\n\' "$page"\n next=$(jq -r \'.pagination.next // empty\' <<<"$page")\n [ -z "$next" ] && break\n url="${1}&${param}=${next}"\n done\n}\n\n# Teams the token can access; cache for the per-team loop below.\nTEAMS_JSON=$(vercel_paginate "https://api.vercel.com/v2/teams?limit=100" until \\\n | jq -s \'[.[].teams[]]\')\necho "$TEAMS_JSON" | jq \'.[] | {id, name, slug}\'\n\n# Personal-account projects (no teamId param).\nvercel_paginate "https://api.vercel.com/v10/projects?limit=100" from \\\n | jq -s \'[.[].projects[]] | .[] | {id, name, framework}\'\n\n# Projects per discovered team.\necho "$TEAMS_JSON" | jq -r \'.[] | "\\(.id)\\t\\(.name)"\' \\\n | while IFS=$\'\\t\' read -r TEAM_ID TEAM_NAME; do\n vercel_paginate "https://api.vercel.com/v10/projects?limit=100&teamId=$TEAM_ID" from \\\n | jq -s --arg team "$TEAM_NAME" \'[.[].projects[]] | .[] | {id, name, framework, team: $team}\'\n done\n```\n\nGroup the results: under each `team.name` for team-scoped projects, and under **Personal account** for projects with no `teamId`.\n\nResolve the connection scope:\n\n- If every project the user wants to onboard belongs to the same non-personal team, capture `VERCEL_TEAM_ID` and `VERCEL_TEAM_NAME` from that team\'s record. The Sazabi connection will be scoped to that team.\n- If the user only wants personal-account projects, leave `VERCEL_TEAM_ID` and `VERCEL_TEAM_NAME` unset.\n- If the user wants projects across multiple teams or across team + personal scopes, plan **one Sazabi connection per scope** — repeat Phase 4 and Phase 5 for each.\n\n`AskUserQuestion`: which Vercel projects should Sazabi connect?\n\nFor each selected project, ask which drain type to create. Each `(project, drainType)` pair becomes one Sazabi stream.\n\n| Drain type | Stream config fields |\n| ---------- | ----------------------------------------------------- |\n| Logs | `drainType: "logs"`, `ingestTraces: false` |\n| Traces | `drainType: "traces"`, `ingestTraces: true` |\n| Analytics | `drainType: "analytics"` (omit `ingestTraces`) |\n\nMultiple drain types per project are supported — each drain type creates a separate stream and a separate Vercel drain.\n\nDo not pass a narrowed `sources` array for log streams. The backend overwrites the Vercel-side drain filter with the full source set (`static, lambda, edge, build, external, firewall, redirect`) at provision time, so narrowing has no effect on what Vercel forwards. Omit `sources` from the stream config.\n\nBuild `VERCEL_PROJECTS` as a list of `(vercelProjectId, vercelProjectName, drainType)` triples for use in Phase 5.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection:\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token "$VERCEL_TOKEN" \\\n --arg teamId "${VERCEL_TEAM_ID:-}" \\\n --arg teamName "${VERCEL_TEAM_NAME:-}" \\\n \'{vercelApiToken: $token}\n + (if $teamId != "" then {vercelTeamId: $teamId } else {} end)\n + (if $teamName != "" then {vercelTeamName: $teamName} else {} end)\')\n\nVERCEL_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type vercel \\\n --metadata "$METADATA_JSON" \\\n --json | jq -r \'.connectionId\')\n```\n\nThe connection persists the (encrypted) token and team scope. It does **not** provision any Vercel drains on its own — drain creation happens per stream in Phase 5.\n\n## Phase 5: Create one stream per (project, drainType)\n\nFor each entry in `VERCEL_PROJECTS`, build a stream config and call `streams create`. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the backend\'s `provisionStream` for vercel — which in turn POSTs to Vercel\'s `/v1/drains` API.\n\n```sh\n# Logs stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "logs", ingestTraces: false}\')" \\\n --json\n\n# Traces stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME (traces)" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "traces", ingestTraces: true}\')" \\\n --json\n\n# Analytics stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME (analytics)" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "analytics"}\')" \\\n --json\n```\n\nReuse the exact `id` and `name` values returned by Vercel\'s API for `vercelProjectId` and `vercelProjectName`. Do not invent or reformat them.\n\nIf a stream creation fails because of a duplicate display name, append the drain type (e.g. `"$VERCEL_PROJECT_NAME (logs)"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nDrain provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id "$VERCEL_CONNECTION_ID" --json\n```\n\nEach stream\'s status transitions from `pending` (or `provisioning`) to `active` once the backend finishes calling Vercel\'s `/v1/drains`. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that project and surface it to the user — the Temporal activity log will have the underlying error, but the agent doesn\'t have direct access to it from this skill.\n\n**Pass 2 — telemetry arrival.** Drains only emit data when the underlying Vercel project receives traffic. Either trigger traffic (deploy, redeploy, hit a route, navigate a Web Analytics-instrumented page) or wait for natural traffic, then:\n\n```sh\n$SAZABI_CLI logs tail --json --search vercel\n```\n\nConfirm new records arrive tagged with the corresponding `vercelProjectName`. If nothing appears within a few minutes of triggering traffic, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `VERCEL_CONNECTION_ID`.\n- One line per stream: project name, drain type, current status.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored out (you can detect this via a non-`active`, non-`pending`, non-`provisioning` status), call out the failed project name and offer to recreate just that stream.\n\nDo not include `VERCEL_TOKEN` in the summary.\n\n## Troubleshooting\n\n### Invalid or expired Vercel token\n\nThe token may have been revoked, copied incorrectly, or expired. Recreate at https://vercel.com/account/tokens and rerun Phase 2. The connection record still exists with a now-stale token — either delete it and rerun the skill from Phase 4, or update the connection metadata if your Sazabi CLI version supports `connections update` (check `$SAZABI_CLI data-sources connections -h`).\n\n### Token has no access to expected projects\n\nVercel API tokens are scoped to a team or to the personal account at creation time. If the desired projects are missing from the `/v10/projects` response in Phase 3, the token was created under the wrong scope. Have the user create a new token while scoped to the correct team and rerun from Phase 2.\n\n### Stream config rejected by Sazabi\n\n`streams create` validates the `config` payload against the source\'s stream schema before insert. If the CLI returns a validation error, check that `vercelProjectId` and `vercelProjectName` are non-empty strings and `drainType` is one of `logs`, `traces`, `analytics`. Field names are case-sensitive.\n\n### Drains feature unavailable (Hobby / Pro Trial)\n\nIf `streams list` shows a stream stuck or errored, and the underlying error mentions a permissions or feature-availability issue, the Vercel team is on Hobby or Pro Trial. Drains require Pro or Enterprise — see https://vercel.com/docs/drains#usage-and-pricing. The user must upgrade the Vercel team. The connection record and the failed stream can be deleted before retry; or leave them and Vercel-side drain creation will succeed next time provisioning is retried.\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound; longer than that suggests the worker is unhealthy or the activity is throwing a non-retryable error. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No telemetry arriving after streams are `active`\n\nA drain that is `active` on the Sazabi side does not emit logs unless the Vercel project receives requests, builds, or Web Analytics events. Trigger real traffic against the Vercel project. For analytics specifically, confirm Web Analytics is enabled in the Vercel project\'s settings — drain creation succeeds even when analytics is disabled, and the drain will silently produce nothing.\n\n### Manual connection already exists without streams\n\nIf someone previously ran `sazabi data-sources connections create --type vercel` without the corresponding `streams create` calls, the connection exists but `streams list --connection-id <id>` returns empty. Reuse the existing `VERCEL_CONNECTION_ID` and continue from Phase 5 to add streams; do not create a second connection for the same Vercel scope.\n';var Yv=()=>{};var Zv,Qv;var eI=s(()=>{Jm();Mm();qm();Ym();Zm();ep();rp();np();ap();lp();hp();dp();bp();mp();vp();fp();$p();_p();Sp();Pp();Dp();Lp();xp();jp();Up();Kp();Bp();Jp();Mp();qp();Yp();Zp();ev();rv();nv();av();lv();hv();dv();bv();mv();vv();fv();$v();_v();Sv();Pv();Dv();Lv();xv();jv();Uv();Kv();Bv();Jv();Mv();qv();Yv();Zv={cloudflare:Hm.trim(),cloudwatch:Wm.trim(),convex:Qm.trim(),datadog:op.trim(),daytona:cp.trim(),digital_ocean:gp.trim(),e2b:yp.trim(),fluent_bit:Ip.trim(),fly_io:wp.trim(),gcp:Tp.trim(),grafana_alloy:Np.trim(),inngest:zp.trim(),langchain:Rp.trim(),mastra:Fp.trim(),neon:Vp.trim(),netlify:Xp.trim(),openrouter:tv.trim(),otel:iv.trim(),otel_collector:uv.trim(),posthog:sv.trim(),railway:pv.trim(),render:kv.trim(),sentry:Ov.trim(),sentry_platform:Av.trim(),supabase:Cv.trim(),temporal:Ev.trim(),trigger_dev:Gv.trim(),vector:Hv.trim(),vercel:Wv.trim()},Qv={cloudflare:Vm.trim(),cloudwatch:Xm.trim(),convex:tp.trim(),datadog:ip.trim(),daytona:up.trim(),digital_ocean:sp.trim(),e2b:pp.trim(),fluent_bit:kp.trim(),fly_io:Op.trim(),gcp:Ap.trim(),grafana_alloy:Cp.trim(),inngest:Ep.trim(),langchain:Gp.trim(),mastra:Hp.trim(),neon:Wp.trim(),netlify:Qp.trim(),openrouter:ov.trim(),otel:cv.trim(),otel_collector:gv.trim(),posthog:yv.trim(),railway:Iv.trim(),render:wv.trim(),sentry:Tv.trim(),sentry_platform:Nv.trim(),supabase:zv.trim(),temporal:Rv.trim(),trigger_dev:Fv.trim(),vector:Vv.trim(),vercel:Xv.trim()}});var Vc=(e)=>{let t=Qv[e];if(t)return t;return Zv[e]};var tI=s(()=>{eI()});var C="available";var he,xn="Authorization=Bearer ${context.publicKey}",ot="Bearer ${context.publicKey}",zn=(e)=>[`Add the OpenTelemetry SDK to your ${e}. Most languages have official OpenTelemetry SDKs available (e.g., \`@opentelemetry/api\` for Node.js, \`opentelemetry-api\` for Python, etc.).`,`Initialize the OpenTelemetry SDK in your ${e}. The SDK will automatically read these environment variables and export telemetry data to Sazabi.`,`Set the following environment variables in your ${e} environment. These variables configure the OpenTelemetry exporter to send logs, traces, and metrics to Sazabi.`],dr=(e,t="http/protobuf")=>[{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_ENDPOINT`",value:`https://${e}.\${context.projectRegion}.intake.\${context.intakeDomain}`,copyLabel:"OTLP endpoint"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_HEADERS`",value:"Authorization=Bearer ${context.publicKey}",copyLabel:"OTLP headers"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_PROTOCOL`",value:t,copyLabel:"OTLP protocol"}],jn;var de=s(()=>{he={label:"Connect",pendingLabel:"Connecting..."},jn={kind:"prose",text:"The OpenTelemetry SDK will automatically detect these environment variables and start exporting telemetry data without requiring any additional code changes."}});var qc,Wc,Yc;var rI=s(()=>{de();qc={kind:"linear",steps:[{kind:"prose",text:"Create a Cloudflare API token with **Account Settings: Read**, **Zone: Read**, **Zone Logs: Edit**, **Workers Observability: Edit**, and **Workers Scripts: Read** permissions. The template below preselects the required permissions. Pick the account you want to connect, click **Continue to summary**, then **Create Token**, and paste the value below."},{kind:"external-link",label:"Open Cloudflare API token template",href:"https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22account%22%7D%2C%7B%22key%22%3A%22logs%22%2C%22type%22%3A%22edit%22%2C%22scope%22%3A%22zone%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22zone%22%7D%2C%7B%22key%22%3A%22workers_observability%22%2C%22type%22%3A%22edit%22%2C%22scope%22%3A%22account%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22account%22%7D%5D&name=Sazabi+Cloudflare"},{id:"token",kind:"secret",label:"Cloudflare API token",description:"Token with Account Settings Read, Zone Read, Logs Edit, Workers Observability Edit, and Workers Scripts Read permissions.",placeholder:"Enter your Cloudflare API token"},{id:"accountId",kind:"text",label:"Cloudflare account ID",description:"The 32-character hex ID from your Cloudflare dashboard URL or account overview.",placeholder:"e.g. a1b2c3d4e5f6...",pattern:"^[a-f0-9]{32}$",patternMessage:"Enter the 32-character Cloudflare account ID."}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token",accountId:"$accountId"},resultAs:"validate"}],metadata:{connectionMode:"native",cloudflareApiToken:"$token",accountId:"$accountId",accountName:"$validate.accountName"},button:he}},Wc={content:{kind:"tabs",tabs:[{id:"logpush",label:"Logpush",content:{kind:"list",listAction:"listLogpushDatasets",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"datasetName",header:"Dataset",cell:"badge"},{field:"scopeDetail",header:"Scope"}],searchPlaceholder:"Search datasets and zones...",searchFields:["datasetName","scopeDetail"],dedupeByConfigField:["scope","zoneId","dataset"],dedupeMissingFieldAsEmpty:!0,emptyState:{noMatches:"No Logpush datasets match your search.",allConfigured:"All Logpush datasets already have streams configured."},toStreamItem:{displayName:"$item.displayName",config:{scope:"$item.scope",accountId:"$item.accountId",zoneId:"$item.zoneId",zoneName:"$item.zoneName",dataset:"$item.dataset",datasetName:"$item.datasetName"}}}},{id:"workers-observability",label:"Workers Observability",content:{kind:"list",listAction:"listWorkers",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"scriptName",header:"Worker"}],searchPlaceholder:"Search Workers...",searchFields:["scriptName"],dedupeByConfigField:["accountId","scriptTag","signal"],dedupeExtraMatch:{scope:"workers-observability"},rowVariants:[{id:"logs",label:"Logs",configMerge:{signal:"logs"},displayNameTemplate:"Workers Logs — $item.scriptName"},{id:"traces",label:"Traces",configMerge:{signal:"traces"},displayNameTemplate:"Workers Traces — $item.scriptName"}],emptyState:{noMatches:"No Workers match your search.",noItems:"No Workers found in this account.",allConfigured:"All Workers in this account already have Sazabi destinations."},toStreamItem:{displayName:"Workers — $item.scriptName",config:{scope:"workers-observability",accountId:"$item.accountId",scriptTag:"$item.scriptTag",scriptName:"$item.scriptName"}}}}]}},Yc={steps:[{kind:"prose",text:"Create a Logpush job in your [Cloudflare dashboard](https://dash.cloudflare.com) under Analytics & Logs > Logpush, or via the Cloudflare API. Select **HTTP** as the destination type and paste the destination URL below."},{kind:"copyable",label:"Destination URL",value:"https://cloudflare-logpush.${context.projectRegion}.intake.${context.intakeDomain}/v1/logs?api_key=${context.publicKey}"},{kind:"prose",text:"In the Logpush job's **Output options**, set **Timestamp format** to **RFC3339** so Sazabi can parse event times accurately."}]}});var fA,oI;var nI=s(()=>{rI();fA=["cloudflareApiToken"],oI={id:"cloudflare",name:"Cloudflare",capabilities:["manual","native"],auth:["manualKey","apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:fA,subtitle:"Stream your Cloudflare logs directly to Sazabi for edge network observability.",features:["Logpush support","Workers logs","Edge analytics"],setupSkill:C,dashboard:{iconKey:"cloudflare",intakeSourceId:"cloudflare",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-enum-badge",header:"Type",width:"12rem",configField:"scope",values:[{value:"zone",label:"Logpush"},{value:"account",label:"Logpush"},{value:"workers-observability",label:"Workers Observability"}],fallbackLabel:"—"}],streamRowInstructions:[{id:"wrangler-config",matchConfig:{scope:"workers-observability"},label:"View instructions",title:"Configure your Worker",description:"Add this block to your Worker's Wrangler config and redeploy. Cloudflare ignores destinations the Worker hasn't explicitly listed, so until this is in place the destination shows as Never run in the Cloudflare dashboard.",snippets:[{label:"wrangler.jsonc",language:"jsonc",code:`"observability": {
|
|
3739
|
+
- Web Analytics enabled in Vercel for projects where you create analytics drains.`;var qv=()=>{};var Xv='---\nname: vercel-data-source-setup\ndescription: Connect Vercel projects to a Sazabi project so deployment logs, OpenTelemetry traces, and Web Analytics events stream into Sazabi. Use when the user wants to "connect Vercel", "set up Vercel logs/traces in Sazabi", "ingest Vercel telemetry", "add a Vercel data source", or after running `sazabi data-sources skill --type vercel`. Drives the Sazabi CLI (`data-sources connections create` + `data-sources streams create`) plus direct calls to Vercel\'s REST API for project discovery; stream creation triggers the backend\'s drain provisioner which calls Vercel\'s `/v1/drains` endpoint.\n---\n\n# Vercel Data Source Setup\n\nWalk the user through connecting Vercel projects to a Sazabi project using the Sazabi CLI for all Sazabi-side operations and direct calls to Vercel\'s REST API for Vercel-side project discovery. Creating a stream via `sazabi data-sources streams create` enqueues a Temporal activity that calls Vercel\'s `/v1/drains` API for that project — there is no separate "provision drains" command.\n\n<important>\n- **Do the work.** Only pause when the user must act: creating a token in the Vercel UI, choosing the Sazabi project, picking Vercel projects, or picking a drain type. If a step fails, diagnose and retry before asking the user to intervene.\n- Use `AskUserQuestion` only at user-owned boundaries: choosing a Sazabi project, entering the API token, picking Vercel projects, or picking a drain type.\n- Never echo `VERCEL_TOKEN` back to the user, into logs, into shell history, or into any tool input that is not strictly required.\n</important>\n\n## Phase 0: Preflight\n\nPick the Sazabi CLI command prefix:\n\n```sh\nif command -v sazabi >/dev/null 2>&1; then\n SAZABI_CLI="sazabi"\nelse\n SAZABI_CLI="bunx @sazabi/cli"\nfi\n```\n\nUse `$SAZABI_CLI` for every Sazabi command below. Confirm `curl` and `jq` are available — both are used to talk to Vercel\'s REST API in Phase 3.\n\nThe user needs:\n\n1. A Sazabi project to receive the Vercel telemetry.\n2. A Vercel team on the **Pro** or **Enterprise** plan. Drains are not available on Hobby or Pro Trial — see https://vercel.com/docs/drains#usage-and-pricing.\n3. A Vercel account with access to the projects they want to monitor.\n4. A browser to create a Vercel API token.\n5. Web Analytics enabled in Vercel for any project where they want analytics events.\n\n## Phase 1: Choose the Sazabi project\n\nIf the active Sazabi project is already clear from context, reuse it. Otherwise:\n\n```sh\n$SAZABI_CLI projects list --json\n```\n\n`AskUserQuestion`: which Sazabi project should receive the Vercel telemetry? Capture the selected ID as `SAZABI_PROJECT_ID` and activate it:\n\n```sh\n$SAZABI_CLI projects use "$SAZABI_PROJECT_ID"\n```\n\n### Detect already-complete setup\n\nBefore creating anything new, list existing Vercel connections on this Sazabi project:\n\n```sh\n$SAZABI_CLI data-sources connections list --type vercel --json\n```\n\nIf a Vercel connection already exists that targets the Vercel scope (team or personal account) the user wants to onboard, reuse its `id` as `VERCEL_CONNECTION_ID` and skip Phase 2 and Phase 4 — jump to Phase 5 and create only the new streams. Do not create a duplicate connection for the same Vercel scope.\n\n## Phase 2: Create and capture the Vercel token\n\nDirect the user to create a token:\n\n> Open **https://vercel.com/account/tokens** and click **Create Token**.\n>\n> - **Token Name**: `Sazabi`\n> - **Scope**: Select the team you want to monitor, or **Full Account** for personal accounts.\n> - **Expiration**: Choose per security policy. No expiration is acceptable for automation.\n>\n> Vercel only displays the token once. If the user closes the dialog without copying it, they must create a new token.\n\n`AskUserQuestion`: ask the user to paste the API token. Capture it as `VERCEL_TOKEN`.\n\nSanity-check the token before discovering projects:\n\n```sh\ncurl -fsS -H "Authorization: Bearer $VERCEL_TOKEN" https://api.vercel.com/v2/user >/dev/null \\\n && echo "ok" || echo "invalid"\n```\n\nIf `invalid`, the token was revoked, copied incorrectly, or expired. Have the user create a new token and retry. Do not print `VERCEL_TOKEN` in any error output.\n\n## Phase 3: Discover and pick Vercel projects\n\nThe Sazabi CLI does not enumerate Vercel projects — call Vercel\'s REST API directly with `VERCEL_TOKEN`. Both endpoints are paginated and return `{ pagination: { next, ... } }`; iterate until `next` is null/missing or accounts with more than 100 projects/teams will be silently truncated.\n\n```bash\n# Iterate a Vercel paginated endpoint. $1 = base URL, $2 = cursor param name\n# (`from` for /v10/projects, `until` for /v2/teams). Emits one JSON page per line.\nvercel_paginate() {\n local url="$1" param="$2" page next\n while :; do\n page=$(curl -fsS -H "Authorization: Bearer $VERCEL_TOKEN" "$url") || return 1\n printf \'%s\\n\' "$page"\n next=$(jq -r \'.pagination.next // empty\' <<<"$page")\n [ -z "$next" ] && break\n url="${1}&${param}=${next}"\n done\n}\n\n# Teams the token can access; cache for the per-team loop below.\nTEAMS_JSON=$(vercel_paginate "https://api.vercel.com/v2/teams?limit=100" until \\\n | jq -s \'[.[].teams[]]\')\necho "$TEAMS_JSON" | jq \'.[] | {id, name, slug}\'\n\n# Personal-account projects (no teamId param).\nvercel_paginate "https://api.vercel.com/v10/projects?limit=100" from \\\n | jq -s \'[.[].projects[]] | .[] | {id, name, framework}\'\n\n# Projects per discovered team.\necho "$TEAMS_JSON" | jq -r \'.[] | "\\(.id)\\t\\(.name)"\' \\\n | while IFS=$\'\\t\' read -r TEAM_ID TEAM_NAME; do\n vercel_paginate "https://api.vercel.com/v10/projects?limit=100&teamId=$TEAM_ID" from \\\n | jq -s --arg team "$TEAM_NAME" \'[.[].projects[]] | .[] | {id, name, framework, team: $team}\'\n done\n```\n\nGroup the results: under each `team.name` for team-scoped projects, and under **Personal account** for projects with no `teamId`.\n\nResolve the connection scope:\n\n- If every project the user wants to onboard belongs to the same non-personal team, capture `VERCEL_TEAM_ID` and `VERCEL_TEAM_NAME` from that team\'s record. The Sazabi connection will be scoped to that team.\n- If the user only wants personal-account projects, leave `VERCEL_TEAM_ID` and `VERCEL_TEAM_NAME` unset.\n- If the user wants projects across multiple teams or across team + personal scopes, plan **one Sazabi connection per scope** — repeat Phase 4 and Phase 5 for each.\n\n`AskUserQuestion`: which Vercel projects should Sazabi connect?\n\nFor each selected project, ask which drain type to create. Each `(project, drainType)` pair becomes one Sazabi stream.\n\n| Drain type | Stream config fields |\n| ---------- | ----------------------------------------------------- |\n| Logs | `drainType: "logs"`, `ingestTraces: false` |\n| Traces | `drainType: "traces"`, `ingestTraces: true` |\n| Analytics | `drainType: "analytics"` (omit `ingestTraces`) |\n\nMultiple drain types per project are supported — each drain type creates a separate stream and a separate Vercel drain.\n\nDo not pass a narrowed `sources` array for log streams. The backend overwrites the Vercel-side drain filter with the full source set (`static, lambda, edge, build, external, firewall, redirect`) at provision time, so narrowing has no effect on what Vercel forwards. Omit `sources` from the stream config.\n\nBuild `VERCEL_PROJECTS` as a list of `(vercelProjectId, vercelProjectName, drainType)` triples for use in Phase 5.\n\n## Phase 4: Create the Sazabi connection\n\nBuild the metadata payload and create the connection:\n\n```sh\nMETADATA_JSON=$(jq -nc \\\n --arg token "$VERCEL_TOKEN" \\\n --arg teamId "${VERCEL_TEAM_ID:-}" \\\n --arg teamName "${VERCEL_TEAM_NAME:-}" \\\n \'{vercelApiToken: $token}\n + (if $teamId != "" then {vercelTeamId: $teamId } else {} end)\n + (if $teamName != "" then {vercelTeamName: $teamName} else {} end)\')\n\nVERCEL_CONNECTION_ID=$($SAZABI_CLI data-sources connections create \\\n --type vercel \\\n --metadata "$METADATA_JSON" \\\n --json | jq -r \'.connectionId\')\n```\n\nThe connection persists the (encrypted) token and team scope. It does **not** provision any Vercel drains on its own — drain creation happens per stream in Phase 5.\n\n## Phase 5: Create one stream per (project, drainType)\n\nFor each entry in `VERCEL_PROJECTS`, build a stream config and call `streams create`. Stream creation enqueues the Temporal `provisionStreamActivity`, which calls the backend\'s `provisionStream` for vercel — which in turn POSTs to Vercel\'s `/v1/drains` API.\n\n```sh\n# Logs stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "logs", ingestTraces: false}\')" \\\n --json\n\n# Traces stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME (traces)" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "traces", ingestTraces: true}\')" \\\n --json\n\n# Analytics stream:\n$SAZABI_CLI data-sources streams create \\\n --connection-id "$VERCEL_CONNECTION_ID" \\\n --display-name "$VERCEL_PROJECT_NAME (analytics)" \\\n --config "$(jq -nc \\\n --arg id "$VERCEL_PROJECT_ID" \\\n --arg name "$VERCEL_PROJECT_NAME" \\\n \'{vercelProjectId: $id, vercelProjectName: $name, drainType: "analytics"}\')" \\\n --json\n```\n\nReuse the exact `id` and `name` values returned by Vercel\'s API for `vercelProjectId` and `vercelProjectName`. Do not invent or reformat them.\n\nIf a stream creation fails because of a duplicate display name, append the drain type (e.g. `"$VERCEL_PROJECT_NAME (logs)"`) and retry that one stream — `display-name` is unique per connection.\n\n## Phase 6: Verify and report\n\nDrain provisioning runs asynchronously after `streams create` returns. Verify in two passes.\n\n**Pass 1 — provisioning status.** Within a minute of the last `streams create`:\n\n```sh\n$SAZABI_CLI data-sources streams list --connection-id "$VERCEL_CONNECTION_ID" --json\n```\n\nEach stream\'s status transitions from `pending` (or `provisioning`) to `active` once the backend finishes calling Vercel\'s `/v1/drains`. If a stream stays non-`active` for more than five minutes, treat it as a provisioning failure for that project and surface it to the user — the Temporal activity log will have the underlying error, but the agent doesn\'t have direct access to it from this skill.\n\n**Pass 2 — telemetry arrival.** Drains only emit data when the underlying Vercel project receives traffic. Either trigger traffic (deploy, redeploy, hit a route, navigate a Web Analytics-instrumented page) or wait for natural traffic, then:\n\n```sh\n$SAZABI_CLI logs tail --json --search vercel\n```\n\nConfirm new records arrive tagged with the corresponding `vercelProjectName`. If nothing appears within a few minutes of triggering traffic, see **Troubleshooting**.\n\nReport back to the user:\n\n- The created `VERCEL_CONNECTION_ID`.\n- One line per stream: project name, drain type, current status.\n- For any stream still non-`active`, say so explicitly and suggest re-running `streams list` in a minute.\n- For any stream that errored out (you can detect this via a non-`active`, non-`pending`, non-`provisioning` status), call out the failed project name and offer to recreate just that stream.\n\nDo not include `VERCEL_TOKEN` in the summary.\n\n## Troubleshooting\n\n### Invalid or expired Vercel token\n\nThe token may have been revoked, copied incorrectly, or expired. Recreate at https://vercel.com/account/tokens and rerun Phase 2. The connection record still exists with a now-stale token — either delete it and rerun the skill from Phase 4, or update the connection metadata if your Sazabi CLI version supports `connections update` (check `$SAZABI_CLI data-sources connections -h`).\n\n### Token has no access to expected projects\n\nVercel API tokens are scoped to a team or to the personal account at creation time. If the desired projects are missing from the `/v10/projects` response in Phase 3, the token was created under the wrong scope. Have the user create a new token while scoped to the correct team and rerun from Phase 2.\n\n### Stream config rejected by Sazabi\n\n`streams create` validates the `config` payload against the source\'s stream schema before insert. If the CLI returns a validation error, check that `vercelProjectId` and `vercelProjectName` are non-empty strings and `drainType` is one of `logs`, `traces`, `analytics`. Field names are case-sensitive.\n\n### Drains feature unavailable (Hobby / Pro Trial)\n\nIf `streams list` shows a stream stuck or errored, and the underlying error mentions a permissions or feature-availability issue, the Vercel team is on Hobby or Pro Trial. Drains require Pro or Enterprise — see https://vercel.com/docs/drains#usage-and-pricing. The user must upgrade the Vercel team. The connection record and the failed stream can be deleted before retry; or leave them and Vercel-side drain creation will succeed next time provisioning is retried.\n\n### Streams stuck in `pending` or `provisioning`\n\nThe Temporal worker that runs `provisionStreamActivity` may be lagging. Five minutes is a reasonable upper bound; longer than that suggests the worker is unhealthy or the activity is throwing a non-retryable error. Re-running `streams create` for the same `(connectionId, displayName)` will fail on duplicate display name — append a suffix like `(retry)` or delete the stuck stream first.\n\n### No telemetry arriving after streams are `active`\n\nA drain that is `active` on the Sazabi side does not emit logs unless the Vercel project receives requests, builds, or Web Analytics events. Trigger real traffic against the Vercel project. For analytics specifically, confirm Web Analytics is enabled in the Vercel project\'s settings — drain creation succeeds even when analytics is disabled, and the drain will silently produce nothing.\n\n### Manual connection already exists without streams\n\nIf someone previously ran `sazabi data-sources connections create --type vercel` without the corresponding `streams create` calls, the connection exists but `streams list --connection-id <id>` returns empty. Reuse the existing `VERCEL_CONNECTION_ID` and continue from Phase 5 to add streams; do not create a second connection for the same Vercel scope.\n';var Yv=()=>{};var Zv,Qv;var eI=d(()=>{Hm();Jm();qm();Ym();Zm();ep();rp();np();ap();lp();hp();sp();bp();mp();vp();fp();$p();_p();Sp();Pp();Dp();Lp();xp();jp();Up();Kp();Gp();Hp();Jp();qp();Yp();Zp();ev();rv();nv();av();lv();hv();sv();bv();mv();vv();fv();$v();_v();Sv();Pv();Dv();Lv();xv();jv();Uv();Kv();Gv();Hv();Jv();qv();Yv();Zv={cloudflare:Mm.trim(),cloudwatch:Wm.trim(),convex:Qm.trim(),datadog:op.trim(),daytona:cp.trim(),digital_ocean:gp.trim(),e2b:yp.trim(),fluent_bit:Ip.trim(),fly_io:wp.trim(),gcp:Tp.trim(),grafana_alloy:Np.trim(),inngest:zp.trim(),langchain:Rp.trim(),mastra:Bp.trim(),neon:Vp.trim(),netlify:Xp.trim(),openrouter:tv.trim(),otel:iv.trim(),otel_collector:uv.trim(),posthog:dv.trim(),railway:pv.trim(),render:kv.trim(),sentry:Ov.trim(),sentry_platform:Av.trim(),supabase:Cv.trim(),temporal:Ev.trim(),trigger_dev:Fv.trim(),vector:Mv.trim(),vercel:Wv.trim()},Qv={cloudflare:Vm.trim(),cloudwatch:Xm.trim(),convex:tp.trim(),datadog:ip.trim(),daytona:up.trim(),digital_ocean:dp.trim(),e2b:pp.trim(),fluent_bit:kp.trim(),fly_io:Op.trim(),gcp:Ap.trim(),grafana_alloy:Cp.trim(),inngest:Ep.trim(),langchain:Fp.trim(),mastra:Mp.trim(),neon:Wp.trim(),netlify:Qp.trim(),openrouter:ov.trim(),otel:cv.trim(),otel_collector:gv.trim(),posthog:yv.trim(),railway:Iv.trim(),render:wv.trim(),sentry:Tv.trim(),sentry_platform:Nv.trim(),supabase:zv.trim(),temporal:Rv.trim(),trigger_dev:Bv.trim(),vector:Vv.trim(),vercel:Xv.trim()}});var Vc=(e)=>{let t=Qv[e];if(t)return t;return Zv[e]};var tI=d(()=>{eI()});var C="available";var he,xn="Authorization=Bearer ${context.publicKey}",ot="Bearer ${context.publicKey}",zn=(e)=>[`Add the OpenTelemetry SDK to your ${e}. Most languages have official OpenTelemetry SDKs available (e.g., \`@opentelemetry/api\` for Node.js, \`opentelemetry-api\` for Python, etc.).`,`Initialize the OpenTelemetry SDK in your ${e}. The SDK will automatically read these environment variables and export telemetry data to Sazabi.`,`Set the following environment variables in your ${e} environment. These variables configure the OpenTelemetry exporter to send logs, traces, and metrics to Sazabi.`],sr=(e,t="http/protobuf")=>[{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_ENDPOINT`",value:`https://${e}.\${context.projectRegion}.intake.\${context.intakeDomain}`,copyLabel:"OTLP endpoint"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_HEADERS`",value:"Authorization=Bearer ${context.publicKey}",copyLabel:"OTLP headers"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_PROTOCOL`",value:t,copyLabel:"OTLP protocol"}],jn;var se=d(()=>{he={label:"Connect",pendingLabel:"Connecting..."},jn={kind:"prose",text:"The OpenTelemetry SDK will automatically detect these environment variables and start exporting telemetry data without requiring any additional code changes."}});var qc,Wc,Yc;var rI=d(()=>{se();qc={kind:"linear",steps:[{kind:"prose",text:"Create a Cloudflare API token with **Account Settings: Read**, **Zone: Read**, **Zone Logs: Edit**, **Workers Observability: Edit**, and **Workers Scripts: Read** permissions. The template below preselects the required permissions. Pick the account you want to connect, click **Continue to summary**, then **Create Token**, and paste the value below."},{kind:"external-link",label:"Open Cloudflare API token template",href:"https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22account%22%7D%2C%7B%22key%22%3A%22logs%22%2C%22type%22%3A%22edit%22%2C%22scope%22%3A%22zone%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22zone%22%7D%2C%7B%22key%22%3A%22workers_observability%22%2C%22type%22%3A%22edit%22%2C%22scope%22%3A%22account%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22read%22%2C%22scope%22%3A%22account%22%7D%5D&name=Sazabi+Cloudflare"},{id:"token",kind:"secret",label:"Cloudflare API token",description:"Token with Account Settings Read, Zone Read, Logs Edit, Workers Observability Edit, and Workers Scripts Read permissions.",placeholder:"Enter your Cloudflare API token"},{id:"accountId",kind:"text",label:"Cloudflare account ID",description:"The 32-character hex ID from your Cloudflare dashboard URL or account overview.",placeholder:"e.g. a1b2c3d4e5f6...",pattern:"^[a-f0-9]{32}$",patternMessage:"Enter the 32-character Cloudflare account ID."}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token",accountId:"$accountId"},resultAs:"validate"}],metadata:{connectionMode:"native",cloudflareApiToken:"$token",accountId:"$accountId",accountName:"$validate.accountName"},button:he}},Wc={content:{kind:"tabs",tabs:[{id:"logpush",label:"Logpush",content:{kind:"list",listAction:"listLogpushDatasets",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"datasetName",header:"Dataset",cell:"badge"},{field:"scopeDetail",header:"Scope"}],searchPlaceholder:"Search datasets and zones...",searchFields:["datasetName","scopeDetail"],dedupeByConfigField:["scope","zoneId","dataset"],dedupeMissingFieldAsEmpty:!0,emptyState:{noMatches:"No Logpush datasets match your search.",allConfigured:"All Logpush datasets already have streams configured."},toStreamItem:{displayName:"$item.displayName",config:{scope:"$item.scope",accountId:"$item.accountId",zoneId:"$item.zoneId",zoneName:"$item.zoneName",dataset:"$item.dataset",datasetName:"$item.datasetName"}}}},{id:"workers-observability",label:"Workers Observability",content:{kind:"list",listAction:"listWorkers",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"scriptName",header:"Worker"}],searchPlaceholder:"Search Workers...",searchFields:["scriptName"],dedupeByConfigField:["accountId","scriptTag","signal"],dedupeExtraMatch:{scope:"workers-observability"},rowVariants:[{id:"logs",label:"Logs",configMerge:{signal:"logs"},displayNameTemplate:"Workers Logs — $item.scriptName"},{id:"traces",label:"Traces",configMerge:{signal:"traces"},displayNameTemplate:"Workers Traces — $item.scriptName"}],emptyState:{noMatches:"No Workers match your search.",noItems:"No Workers found in this account.",allConfigured:"All Workers in this account already have Sazabi destinations."},toStreamItem:{displayName:"Workers — $item.scriptName",config:{scope:"workers-observability",accountId:"$item.accountId",scriptTag:"$item.scriptTag",scriptName:"$item.scriptName"}}}}]}},Yc={steps:[{kind:"prose",text:"Create a Logpush job in your [Cloudflare dashboard](https://dash.cloudflare.com) under Analytics & Logs > Logpush, or via the Cloudflare API. Select **HTTP** as the destination type and paste the destination URL below."},{kind:"copyable",label:"Destination URL",value:"https://cloudflare-logpush.${context.projectRegion}.intake.${context.intakeDomain}/v1/logs?api_key=${context.publicKey}"},{kind:"prose",text:"In the Logpush job's **Output options**, set **Timestamp format** to **RFC3339** so Sazabi can parse event times accurately."}]}});var fA,oI;var nI=d(()=>{rI();fA=["cloudflareApiToken"],oI={id:"cloudflare",name:"Cloudflare",capabilities:["manual","native"],auth:["manualKey","apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:fA,subtitle:"Stream your Cloudflare logs directly to Sazabi for edge network observability.",features:["Logpush support","Workers logs","Edge analytics"],setupSkill:C,dashboard:{iconKey:"cloudflare",intakeSourceId:"cloudflare",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-enum-badge",header:"Type",width:"12rem",configField:"scope",values:[{value:"zone",label:"Logpush"},{value:"account",label:"Logpush"},{value:"workers-observability",label:"Workers Observability"}],fallbackLabel:"—"}],streamRowInstructions:[{id:"wrangler-config",matchConfig:{scope:"workers-observability"},label:"View instructions",title:"Configure your Worker",description:"Add this block to your Worker's Wrangler config and redeploy. Cloudflare ignores destinations the Worker hasn't explicitly listed, so until this is in place the destination shows as Never run in the Cloudflare dashboard.",snippets:[{label:"wrangler.jsonc",language:"jsonc",code:`"observability": {
|
|
3623
3740
|
"enabled": true,
|
|
3624
3741
|
"$config.signal": {
|
|
3625
3742
|
"enabled": true,
|
|
@@ -3627,7 +3744,7 @@ A workspace admin can enable this integration in settings. Once configured, Verc
|
|
|
3627
3744
|
}
|
|
3628
3745
|
}`},{label:"wrangler.toml",language:"toml",code:`[observability.$config.signal]
|
|
3629
3746
|
enabled = true
|
|
3630
|
-
destinations = [ "$config.destinationName" ]`}]}],actions:{submit:{validate:{procedure:"cloudflare.validateToken"}},list:{listLogpushDatasets:{procedure:"cloudflare.listLogpushDatasets",itemsField:"items"},listWorkers:{procedure:"cloudflare.listWorkers",itemsField:"items"}}}}}});var Xc,Zc;var iI=
|
|
3747
|
+
destinations = [ "$config.destinationName" ]`}]}],actions:{submit:{validate:{procedure:"cloudflare.validateToken"}},list:{listLogpushDatasets:{procedure:"cloudflare.listLogpushDatasets",itemsField:"items"},listWorkers:{procedure:"cloudflare.listWorkers",itemsField:"items"}}}}}});var Xc,Zc;var iI=d(()=>{se();Xc={kind:"linear",prefetch:{action:"prefetch",input:{projectId:"${context.projectId}",templateUrl:"${context.cloudformationTemplateUrl}"},resultAs:"cloudwatch"},steps:[{kind:"prose",text:"Set up an IAM role in your AWS account to allow Sazabi to read your CloudWatch logs. Use one of the setup methods below, then paste the resulting Role ARN."},{kind:"tab-set",tabs:[{id:"cloudformation",label:"CloudFormation",steps:[{kind:"prose",text:"Click the button below to launch a CloudFormation stack in your AWS account. After the stack is created, find your role ARN under **Stacks → ${context.extras.cloudwatch.stackName} → Outputs** and copy the `RoleArn` value."},{kind:"external-link",label:"Launch CloudFormation stack",href:"${context.extras.cloudwatch.cloudFormationQuickCreateUrl}"}]},{id:"terraform",label:"Terraform",steps:[{kind:"prose",text:"Add this configuration to your Terraform files."},{kind:"code",language:"hcl",copyLabel:"Terraform",value:`data "aws_caller_identity" "current" {}
|
|
3631
3748
|
|
|
3632
3749
|
resource "aws_iam_role" "sazabi_log_ingestion" {
|
|
3633
3750
|
name = "SazabiLogIngestion"
|
|
@@ -3685,7 +3802,7 @@ EOF
|
|
|
3685
3802
|
|
|
3686
3803
|
aws iam create-role --role-name SazabiLogIngestion --assume-role-policy-document file://trust-policy.json
|
|
3687
3804
|
aws iam put-role-policy --role-name SazabiLogIngestion --policy-name SazabiLogSubscriptionManagement --policy-document file://permission-policy.json
|
|
3688
|
-
aws iam get-role --role-name SazabiLogIngestion --query 'Role.Arn' --output text`}]}]},{id:"arn",kind:"secret",label:"Role ARN",placeholder:"arn:aws:iam::123456789012:role/SazabiLogIngestion-Sazabi-...",pattern:"^arn:aws:iam::(\\d{12}):role\\/[\\w+=,.@\\-\\/]+$",patternMessage:"Invalid ARN format. Expected: arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"}],submit:{actions:[{kind:"validate",action:"validate",input:{projectId:"${context.projectId}",roleArn:"$arn",externalId:"${context.extras.cloudwatch.externalId}"},resultAs:"validateRole"}],metadata:{roleArn:"$arn",awsAccountId:"$validateRole.awsAccountId",externalId:"${context.extras.cloudwatch.externalId}"},displayName:"AWS Account $validateRole.awsAccountId",button:he}},Zc={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}",pattern:""},columns:[{field:"name",header:"Log group",cell:"mono"},{field:"arn",header:"Region",width:"w-32",cell:"badge",extract:"regex:^arn:aws:logs:([^:]+):"}],searchPlaceholder:"Search log groups...",searchFields:["name"],dedupeByConfigField:"logGroupName",filterItemsBy:{field:"arn",operator:"regex-group-equals",pattern:"^arn:aws:logs:([^:]+):",equals:"${context.projectRegion}"},infoBanner:"Only showing log groups from ${context.projectRegion}. To stream logs from other regions, create a new project for that region in Sazabi.",emptyState:{noMatches:"No log groups found.",allConfigured:"All log groups already have streams configured.",noResults:"No log groups found in ${context.projectRegion} region."},toStreamItem:{displayName:"$item.name",config:{logGroupName:"$item.name",logGroupArn:"$item.arn"}}}}});var kA,aI;var cI=
|
|
3805
|
+
aws iam get-role --role-name SazabiLogIngestion --query 'Role.Arn' --output text`}]}]},{id:"arn",kind:"secret",label:"Role ARN",placeholder:"arn:aws:iam::123456789012:role/SazabiLogIngestion-Sazabi-...",pattern:"^arn:aws:iam::(\\d{12}):role\\/[\\w+=,.@\\-\\/]+$",patternMessage:"Invalid ARN format. Expected: arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"}],submit:{actions:[{kind:"validate",action:"validate",input:{projectId:"${context.projectId}",roleArn:"$arn",externalId:"${context.extras.cloudwatch.externalId}"},resultAs:"validateRole"}],metadata:{roleArn:"$arn",awsAccountId:"$validateRole.awsAccountId",externalId:"${context.extras.cloudwatch.externalId}"},displayName:"AWS Account $validateRole.awsAccountId",button:he}},Zc={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}",pattern:""},columns:[{field:"name",header:"Log group",cell:"mono"},{field:"arn",header:"Region",width:"w-32",cell:"badge",extract:"regex:^arn:aws:logs:([^:]+):"}],searchPlaceholder:"Search log groups...",searchFields:["name"],dedupeByConfigField:"logGroupName",filterItemsBy:{field:"arn",operator:"regex-group-equals",pattern:"^arn:aws:logs:([^:]+):",equals:"${context.projectRegion}"},infoBanner:"Only showing log groups from ${context.projectRegion}. To stream logs from other regions, create a new project for that region in Sazabi.",emptyState:{noMatches:"No log groups found.",allConfigured:"All log groups already have streams configured.",noResults:"No log groups found in ${context.projectRegion} region."},toStreamItem:{displayName:"$item.name",config:{logGroupName:"$item.name",logGroupArn:"$item.arn"}}}}});var kA,aI;var cI=d(()=>{iI();kA=["externalId"],aI={id:"cloudwatch",name:"CloudWatch",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:kA,subtitle:"Stream your AWS CloudWatch logs directly to Sazabi for real-time analysis and alerting.",features:["Log forwarding","Real-time streaming","Multi-region support"],setupSkill:C,dashboard:{iconKey:"cloudwatch",intakeSourceId:"cloudwatch",streamSelectorLayout:"sidepanel",connectionMetadataSection:{title:"AWS account details",description:"The AWS account and IAM role used for log ingestion.",fields:[{key:"awsAccountId",label:"AWS account ID",description:"AWS account connected to this data source."},{key:"roleArn",label:"IAM role ARN",description:"IAM role Sazabi assumes for log ingestion."}]},actions:{submit:{validate:{kind:"source-action",actionId:"validate-role"}},list:{list:{kind:"source-action",actionId:"list-log-groups",itemsField:"logGroups"}},prefetch:{prefetch:{kind:"source-action",actionId:"get-setup-info"}}}}}});var Qc,el;var lI=d(()=>{se();Qc={kind:"linear",steps:[{kind:"prose",text:"Enter a Convex team access token to connect your deployments. You can create one in your [Convex dashboard team settings](https://dashboard.convex.dev)."},{id:"token",kind:"secret",label:"Team access token",placeholder:"eyJ..."},{id:"team",kind:"select",label:"Team",placeholder:"Select a team",optionsAction:"options",optionsInput:{token:"$token"},optionValueField:"id",optionLabelField:"name",optionDescriptionField:"slug"}],submit:{metadata:{accessToken:"$token",teamId:"$team.id",teamName:"$team.name"},displayName:"$team.name",button:he}},el={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"},{field:"slug",header:"Slug",width:"w-48",cell:"muted"}],searchPlaceholder:"Search deployments...",searchFields:["name"],dedupeByConfigField:"deploymentId",emptyState:{noMatches:"No deployments found.",allConfigured:"All deployments already have log streams configured."},toStreamItem:{displayName:"$item.name",config:{deploymentId:"$item.id",deploymentName:"$item.name"}}}}});var $A,uI;var hI=d(()=>{lI();$A=["accessToken"],uI={id:"convex",name:"Convex",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:$A,subtitle:"Forward your Convex deployment logs directly to Sazabi for serverless observability.",features:["Function logs","Database mutations","Scheduled job monitoring"],setupSkill:C,dashboard:{iconKey:"convex",intakeSourceId:"convex",streamSelectorLayout:"sidepanel",actions:{list:{options:{procedure:"convex.listTeams",itemsField:"teams",sensitiveInputFields:["token"]},list:{procedure:"convex.listDeployments",itemsField:"deployments",sensitiveInputFields:["token"]}}}}}});var tl;var gI=d(()=>{tl={steps:[{kind:"prose",text:"Configure your Datadog Agent to forward logs to Sazabi. Use the dual-ship option when the same Agent should keep sending logs to Datadog. Use the dedicated Agent option for sidecars or containers that send logs only to Sazabi."},{kind:"copyable",label:"Sazabi public key",value:"${context.publicKey}",copyLabel:"Sazabi public key"},{kind:"copyable",label:"Intake URL",value:"https://datadog.${context.projectRegion}.intake.${context.intakeDomain}",copyLabel:"Datadog Agent intake URL"},{kind:"code-tabs",label:"Configuration options",description:"Choose one option. For dual-shipping, leave the top-level Datadog `api_key` or `DD_API_KEY` unchanged and add Sazabi as a logs endpoint. For a dedicated Sazabi sidecar, set `DD_API_KEY` to the Sazabi public key.",tabs:[{id:"datadog-yaml-dual-ship",label:"`datadog.yaml` dual-ship",language:"yaml",copyLabel:"datadog.yaml dual-ship configuration",value:`# Enable logs collection if it is not already enabled.
|
|
3689
3806
|
logs_enabled: true
|
|
3690
3807
|
|
|
3691
3808
|
# Send a copy of logs to Sazabi while the primary Agent config
|
|
@@ -3702,7 +3819,7 @@ DD_API_KEY=\${context.publicKey}
|
|
|
3702
3819
|
DD_LOGS_ENABLED=true
|
|
3703
3820
|
DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
|
|
3704
3821
|
DD_LOGS_CONFIG_LOGS_DD_URL=https://datadog.\${context.projectRegion}.intake.\${context.intakeDomain}
|
|
3705
|
-
DD_LOGS_CONFIG_FORCE_USE_HTTP=true`}]},{kind:"prose",text:"Restart or redeploy the Agent after changing its configuration. `DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS` requires Datadog Agent v6.18+ or v7.18+. Avoid configuring both a Sazabi additional endpoint and a Sazabi-only logs URL in the same Agent, or you may send duplicate logs."}]}});var
|
|
3822
|
+
DD_LOGS_CONFIG_FORCE_USE_HTTP=true`}]},{kind:"prose",text:"Restart or redeploy the Agent after changing its configuration. `DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS` requires Datadog Agent v6.18+ or v7.18+. Avoid configuring both a Sazabi additional endpoint and a Sazabi-only logs URL in the same Agent, or you may send duplicate logs."}]}});var sI;var dI=d(()=>{gI();sI={id:"datadog",name:"Datadog Agent",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK/agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward your Datadog Agent logs directly to Sazabi for AI-powered observability.",features:["Agent log forwarding","Minimal configuration","Keep existing setup"],setupSkill:C,dashboard:{iconKey:"datadog",intakeSourceId:"datadog"}}});var rl;var bI=d(()=>{se();rl={steps:[{kind:"prose",text:"In the [Daytona dashboard](https://app.daytona.io), open **Settings** and find the **OpenTelemetry** card (visible to organization owners only). Set the OTLP endpoint and add an `Authorization` header using the values below."},{kind:"copyable",label:"OTLP Endpoint",value:"https://daytona.${context.projectRegion}.intake.${context.intakeDomain}"},{kind:"copyable",label:"Authorization header",value:ot},{kind:"prose",text:"Notes"},{kind:"bulleted-list",items:["Save the OpenTelemetry card; sandboxes begin exporting telemetry automatically on their next start with no per-sandbox change required.","Filter in Sazabi using the resource attributes Daytona stamps on each record: `daytona_organization_id`, `daytona_region_id`, `daytona_snapshot`.","Sazabi currently stores logs and traces from this source. OTLP metrics are accepted at the intake endpoint but not yet persisted.","Daytona only retains sandbox telemetry for 3 days in its own dashboard, so Sazabi is the durable store."]}]}});var yI;var mI=d(()=>{bI();yI={id:"daytona",name:"Daytona",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual webhook setup is not exercised by automated lifecycle tests yet.",subtitle:"Stream sandbox telemetry from your Daytona organization to Sazabi via org-level OpenTelemetry export.",features:["Org-level OTLP logs and traces","Sandbox resource attributes (organization, region, snapshot)","Durable retention beyond Daytona's 3-day window"],setupSkill:C,dashboard:{iconKey:"daytona",intakeSourceId:"daytona"}}});var ol,nl;var pI=d(()=>{se();ol={kind:"linear",steps:[{kind:"prose",text:"Enter your [DigitalOcean personal access token](https://cloud.digitalocean.com/account/api/tokens). Use **Full Access** scope, or Custom Scopes with `app:read`, `app:update`, `actions:read`, `regions:read`, and `sizes:read` so Sazabi can provision log forwarding on your apps."},{id:"token",kind:"secret",label:"Personal access token",placeholder:"dop_v1_..."}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token"}}],metadata:{apiToken:"$token"},button:he}},nl={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"},{field:"componentCount",header:"Components",width:"w-40",cell:"badge"}],searchPlaceholder:"Search apps...",searchFields:["name"],dedupeByConfigField:"appId",emptyState:{noMatches:"No apps found.",allConfigured:"All apps already have log streams configured.",noItems:"No App Platform apps found in this DigitalOcean account. Create an app in DigitalOcean first, then return here to forward its logs."},toStreamItem:{displayName:"$item.name",config:{appId:"$item.id",appName:"$item.name"}}}}});var wA,vI;var II=d(()=>{pI();wA=["apiToken"],vI={id:"digital_ocean",name:"DigitalOcean",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:wA,subtitle:"Forward your DigitalOcean infrastructure logs directly to Sazabi for unified observability.",features:["Log forwarding","App Platform logs"],setupSkill:C,dashboard:{iconKey:"digital-ocean",intakeSourceId:"digital-ocean",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-text",header:"App",width:"w-32",configField:"appName",fallbackLabel:"Unknown app"}],actions:{submit:{validate:{kind:"source-action",actionId:"validate-token",sensitiveInputFields:["token"]}},list:{list:{kind:"source-action",actionId:"list-apps",itemsField:"apps"}}}}}});var il;var fI=d(()=>{il={steps:[{kind:"prose",text:"Set these values as environment variables in your application."},{kind:"copyable",label:"`SAZABI_INTAKE_URL`",value:"https://e2b.${context.projectRegion}.intake.${context.intakeDomain}/v1/logs",copyLabel:"Intake URL"},{kind:"copyable",label:"`SAZABI_PUBLIC_KEY`",value:"${context.publicKey}",copyLabel:"Public key"},{kind:"code-tabs",label:"SDK integration",tabs:[{id:"typescript",label:"TypeScript",language:"typescript",copyLabel:"TypeScript code",value:`import { Sandbox } from '@e2b/code-interpreter'
|
|
3706
3823
|
import { logs, SeverityNumber } from '@opentelemetry/api-logs'
|
|
3707
3824
|
import { LoggerProvider, BatchLogRecordProcessor } from '@opentelemetry/sdk-logs'
|
|
3708
3825
|
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http'
|
|
@@ -3827,7 +3944,7 @@ finally:
|
|
|
3827
3944
|
sandbox.kill()
|
|
3828
3945
|
finally:
|
|
3829
3946
|
# Flush logs before exit; runs even if sandbox.kill() raises.
|
|
3830
|
-
logger_provider.shutdown()`}]}]}});var kI;var $I=
|
|
3947
|
+
logger_provider.shutdown()`}]}]}});var kI;var $I=d(()=>{fI();kI={id:"e2b",name:"E2B",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK setup is not exercised by automated lifecycle tests yet.",subtitle:"Stream your E2B sandbox logs directly to Sazabi for code execution observability.",features:["Sandbox stdout/stderr capture"],setupSkill:C,dashboard:{iconKey:"e2b",intakeSourceId:"e2b"}}});var al;var wI=d(()=>{al={perStreamInstructions:!0,steps:[{kind:"prose",text:"Configure the Fluent Bit `opentelemetry` output plugin to forward logs to Sazabi. Use the classic config format or the Helm values snippet if you are deploying Fluent Bit via the official Helm chart."},{kind:"code-tabs",label:"Fluent Bit output configuration",tabs:[{id:"classic",label:"Classic config",language:"bash",copyLabel:"Classic config",value:`[OUTPUT]
|
|
3831
3948
|
name opentelemetry
|
|
3832
3949
|
match *
|
|
3833
3950
|
host fluent-bit.\${context.projectRegion}.intake.\${context.intakeDomain}
|
|
@@ -3845,7 +3962,7 @@ finally:
|
|
|
3845
3962
|
logs_uri /v1/logs
|
|
3846
3963
|
header Authorization Bearer \${context.publicKey}
|
|
3847
3964
|
tls on
|
|
3848
|
-
tls.verify on`}]},{kind:"prose",text:"Requires Fluent Bit v2.0 or later. The `opentelemetry` output plugin is included in the default distribution — no additional installation needed."}]}});var _I;var OI=
|
|
3965
|
+
tls.verify on`}]},{kind:"prose",text:"Requires Fluent Bit v2.0 or later. The `opentelemetry` output plugin is included in the default distribution — no additional installation needed."}]}});var _I;var OI=d(()=>{wI();_I={id:"fluent_bit",name:"Fluent Bit",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward logs from your Kubernetes cluster or any infrastructure to Sazabi using the Fluent Bit agent.",features:["Kubernetes DaemonSet","Container log collection","Multi-pipeline routing","Low resource footprint"],setupSkill:C,dashboard:{iconKey:"fluent-bit",intakeSourceId:"fluent-bit"}}});var cl,ll;var SI=d(()=>{se();cl={kind:"linear",steps:[{kind:"prose",text:"Create a read-only token for your Fly.io organization. From the CLI: `flyctl tokens create readonly -o <org-slug>`. Or open the org's Tokens tab in the [Fly.io dashboard](https://fly.io/dashboard) and create a read-only token."},{id:"token",kind:"secret",label:"API token",placeholder:"FlyV1 ..."},{id:"orgSlug",kind:"secret",label:"Organization slug",placeholder:"personal"}],submit:{actions:[{kind:"validate",action:"validate",input:{dataSourceType:"fly_io",metadata:{apiToken:"$token",organizationSlug:"$orgSlug"}}}],metadata:{apiToken:"$token",organizationSlug:"$orgSlug"},button:he}},ll={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"}],searchPlaceholder:"Search apps...",searchFields:["name"],dedupeByConfigField:"appName",emptyState:{noMatches:"No apps found.",allConfigured:"All apps already have log streams configured."},toStreamItem:{displayName:"$item.name",config:{appName:"$item.name"}}}}});var _A,TI;var PI=d(()=>{SI();_A=["apiToken"],TI={id:"fly_io",name:"Fly.io",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:_A,subtitle:"Forward your Fly.io application logs directly to Sazabi for global monitoring.",features:["Log shipping","Multi-region logs","Machine monitoring"],setupSkill:C,dashboard:{iconKey:"fly-io",intakeSourceId:"fly-io",streamSelectorLayout:"sidepanel",actions:{submit:{validate:{procedure:"dataSources.validateConnection"}},list:{list:{kind:"source-action",actionId:"list-apps",itemsField:"apps"}}}}}});var ul,hl,gl;var AI=d(()=>{se();ul={kind:"tabs",tabs:[{id:"service-account",label:"Service account",content:{kind:"linear",steps:[{kind:"prose",text:"Provide a GCP service account key with permissions to enable APIs and create log sinks, Pub/Sub topics, and subscriptions. Sazabi enables the required APIs and provisions the log pipeline in your GCP project automatically. The service account needs `roles/serviceusage.serviceUsageAdmin`, `roles/logging.configWriter`, `roles/pubsub.admin`, and `roles/browser` on the target GCP project(s)."},{kind:"external-link",label:"Open service accounts in GCP Console",href:"https://console.cloud.google.com/iam-admin/serviceaccounts"},{id:"key",kind:"secret",label:"Service account key (JSON)",placeholder:'{"type": "service_account", "project_id": "...", ...}'}],submit:{actions:[{kind:"validate",action:"validate",input:{serviceAccountKey:"$key"},resultAs:"validateKey"},{kind:"preflight",action:"preflight",input:{serviceAccountKey:"$key"}}],metadata:{serviceAccountKey:"$key",connectionMode:"native"},displayName:"GCP $validateKey.projectId",button:he}}},{id:"manual",label:"Manual setup",content:{kind:"manual"}}]},hl={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"displayName",header:"Name"},{field:"projectId",header:"Project ID",width:"w-48",cell:"muted"}],searchPlaceholder:"Search projects...",searchFields:["displayName","projectId"],dedupeByConfigField:"gcpProjectId",emptyState:{noMatches:"No projects found.",allConfigured:"All accessible projects already have log streams configured."},toStreamItem:{displayName:"$item.displayName",config:{gcpProjectId:"$item.projectId",gcpProjectName:"$item.displayName"}}}},gl={steps:[{kind:"prose",text:"To forward Google Cloud Logging data to Sazabi, create a log sink that routes logs to a Pub/Sub topic, then deploy an OpenTelemetry Collector with a `googlecloudpubsub` receiver that subscribes to that topic and exports to Sazabi."},{kind:"prose",text:"Required GCP permissions: the person performing these steps needs a role that grants `logging.sinks.create` (e.g. `roles/logging.configWriter`) and `pubsub.topics.setIamPolicy` (e.g. `roles/pubsub.admin`)."},{kind:"ordered-steps",items:["Create a Pub/Sub topic and subscription in your GCP project (e.g. `sazabi-logs` and `sazabi-logs-sub`).","Create a Cloud Logging sink that routes logs to the Pub/Sub topic. Grant the sink's service account the `roles/pubsub.publisher` role on the topic.","Deploy an OpenTelemetry Collector (e.g. on a GCE instance, GKE pod, or Cloud Run service) using the `opentelemetry-collector-contrib` distribution.","Configure the collector with a `googlecloudpubsub` receiver pointing at your subscription and an `otlp_http` exporter using the values below. The receiver requires the `googlecloudlogentry_encoding` encoding extension.","Ensure the collector's service account has the `roles/pubsub.subscriber` IAM role on the subscription."]},{kind:"copyable",label:"`OTLP endpoint`",value:"https://otel.${context.projectRegion}.intake.${context.intakeDomain}",copyLabel:"OTLP endpoint"},{kind:"copyable",label:"`Authorization header value`",value:ot,copyLabel:"Authorization header"},{kind:"code",label:"Example collector configuration",language:"yaml",copyLabel:"Collector configuration",value:`extensions:
|
|
3849
3966
|
googlecloudlogentry_encoding:
|
|
3850
3967
|
|
|
3851
3968
|
receivers:
|
|
@@ -3865,7 +3982,7 @@ service:
|
|
|
3865
3982
|
pipelines:
|
|
3866
3983
|
logs:
|
|
3867
3984
|
receivers: [googlecloudpubsub]
|
|
3868
|
-
exporters: [otlp_http]`}]}});var OA,DI;var NI=
|
|
3985
|
+
exporters: [otlp_http]`}]}});var OA,DI;var NI=d(()=>{AI();OA=["serviceAccountKey"],DI={id:"gcp",name:"GCP",capabilities:["manual","native"],auth:["manualKey","apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:OA,subtitle:"Connect your GCP logs to Sazabi for AI-powered observability. Automatically provision log sinks with a service account, or set up manually.",features:["Log forwarding","Real-time streaming","Log sink support"],setupSkill:C,dashboard:{iconKey:"gcp",intakeSourceId:"gcp",streamSelectorLayout:"sidepanel",actions:{submit:{validate:{kind:"source-action",actionId:"validate-service-account-key"},preflight:{kind:"source-action",actionId:"run-preflight-checks",normalize:"preflight"}},list:{list:{kind:"source-action",actionId:"list-projects",itemsField:"projects"}}}}}});var sl;var LI=d(()=>{sl={perStreamInstructions:!0,steps:[{kind:"prose",text:"Add the Sazabi OTLP exporter to your Alloy config and wire it into a complete pipeline. The snippets below include an OTLP receiver and a batch processor — the minimum needed for telemetry to actually reach Sazabi. Use the Helm values tab if you deploy Alloy via the Grafana Helm chart."},{kind:"code-tabs",label:"Alloy configuration",tabs:[{id:"river",label:"config.alloy",language:"hcl",copyLabel:"Alloy config",value:`otelcol.receiver.otlp "default" {
|
|
3869
3986
|
grpc {}
|
|
3870
3987
|
http {}
|
|
3871
3988
|
|
|
@@ -3916,7 +4033,7 @@ otelcol.exporter.otlphttp "sazabi" {
|
|
|
3916
4033
|
"Authorization" = "Bearer \${context.publicKey}",
|
|
3917
4034
|
}
|
|
3918
4035
|
}
|
|
3919
|
-
}`}]},{kind:"prose",text:"Replace `otelcol.receiver.otlp` with the OpenTelemetry receiver(s) that match your sources (for example `otelcol.receiver.filelog` for log files or `otelcol.receiver.jaeger` for Jaeger traces). Each upstream `otelcol.*` component must list `otelcol.processor.batch.default.input` in its `output` block to ship data to Sazabi."}]}});var CI;var xI=
|
|
4036
|
+
}`}]},{kind:"prose",text:"Replace `otelcol.receiver.otlp` with the OpenTelemetry receiver(s) that match your sources (for example `otelcol.receiver.filelog` for log files or `otelcol.receiver.jaeger` for Jaeger traces). Each upstream `otelcol.*` component must list `otelcol.processor.batch.default.input` in its `output` block to ship data to Sazabi."}]}});var CI;var xI=d(()=>{LI();CI={id:"grafana_alloy",name:"Grafana Alloy",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward logs and traces from your infrastructure to Sazabi using Grafana Alloy.",features:["Kubernetes DaemonSet","OpenTelemetry native","Flexible River pipeline","Logs and traces"],setupSkill:C,dashboard:{iconKey:"grafana-alloy",intakeSourceId:"grafana-alloy"}}});var dl;var zI=d(()=>{se();dl={steps:[{kind:"ordered-steps",items:zn("Inngest function")},jn,...sr("inngest")]}});var jI;var EI=d(()=>{zI();jI={id:"inngest",name:"Inngest",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward your Inngest function logs directly to Sazabi for workflow observability.",features:["Function logs","Event tracing","Step monitoring"],setupSkill:C,dashboard:{iconKey:"inngest",intakeSourceId:"inngest"}}});var bl;var UI=d(()=>{se();bl={steps:[{kind:"prose",text:"LangChain does not emit OpenTelemetry traces on its own. Set the OTLP environment variables (shown in the last step) in your deployment so they are present when the process starts, then install an instrumentation package (OpenInference shown below) and initialise it once at startup before importing LangChain."},{kind:"code-tabs",label:"Install instrumentation",tabs:[{id:"python",label:"Python",language:"bash",copyLabel:"Python install command",value:"pip install openinference-instrumentation-langchain \\\n opentelemetry-sdk \\\n opentelemetry-exporter-otlp-proto-http"},{id:"typescript",label:"TypeScript",language:"bash",copyLabel:"TypeScript install command",value:"npm install @arizeai/openinference-instrumentation-langchain \\\n @opentelemetry/sdk-trace-node \\\n @opentelemetry/exporter-trace-otlp-proto \\\n @langchain/core"}]},{kind:"code-tabs",label:"Initialise the tracer at startup",tabs:[{id:"python",label:"Python",language:"python",copyLabel:"Python init snippet",value:`from opentelemetry import trace
|
|
3920
4037
|
from opentelemetry.sdk.resources import Resource
|
|
3921
4038
|
from opentelemetry.sdk.trace import TracerProvider
|
|
3922
4039
|
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
@@ -3941,7 +4058,7 @@ provider.register();
|
|
|
3941
4058
|
|
|
3942
4059
|
// LangChain.js has no traditional auto-instrumentable module structure, so the
|
|
3943
4060
|
// callbacks manager must be wired in by hand.
|
|
3944
|
-
new LangChainInstrumentation().manuallyInstrument(CallbackManagerModule);`}]},{kind:"prose",text:"Set these environment variables before starting your application. The OpenTelemetry SDK reads them automatically."},...
|
|
4061
|
+
new LangChainInstrumentation().manuallyInstrument(CallbackManagerModule);`}]},{kind:"prose",text:"Set these environment variables before starting your application. The OpenTelemetry SDK reads them automatically."},...sr("langchain")]}});var RI;var KI=d(()=>{UI();RI={id:"langchain",name:"LangChain",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward LangChain traces to Sazabi for end-to-end LLM observability.",features:["Chain tracing","Tool & agent traces","LLM call traces"],setupSkill:C,dashboard:{iconKey:"langchain",intakeSourceId:"langchain"}}});var yl;var FI=d(()=>{yl={steps:[{kind:"prose",text:"Set these values as environment variables in your application."},{kind:"copyable",label:"`SAZABI_INTAKE_URL`",value:"https://mastra.${context.projectRegion}.intake.${context.intakeDomain}/v1/traces",copyLabel:"Intake URL"},{kind:"copyable",label:"`SAZABI_API_KEY`",value:"${context.publicKey}",copyLabel:"API key"},{kind:"code",label:"Configuration",language:"typescript",copyLabel:"TypeScript code",value:`// src/mastra/index.ts
|
|
3945
4062
|
import { Mastra } from "@mastra/core";
|
|
3946
4063
|
import { OtelExporter } from "@mastra/otel-exporter";
|
|
3947
4064
|
import { Observability } from "@mastra/observability";
|
|
@@ -3972,7 +4089,7 @@ export const mastra = new Mastra({
|
|
|
3972
4089
|
|
|
3973
4090
|
// Use your Mastra instance
|
|
3974
4091
|
const agent = mastra.getAgent("my-agent");
|
|
3975
|
-
const response = await agent.generate("Hello, world!");`}]}});var
|
|
4092
|
+
const response = await agent.generate("Hello, world!");`}]}});var GI;var BI=d(()=>{FI();GI={id:"mastra",name:"Mastra",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK setup is not exercised by automated lifecycle tests yet.",subtitle:"Stream your Mastra agent traces directly to Sazabi for AI workflow observability.",features:["Agent traces","Tool tracing","Workflow monitoring"],setupSkill:C,dashboard:{iconKey:"mastra",intakeSourceId:"mastra"}}});var ml;var HI=d(()=>{ml={perStreamInstructions:!0,steps:[{kind:"prose",text:"Neon's OpenTelemetry integration forwards Postgres logs to Sazabi. The integration is available on Neon's **Scale** plan, and both the integration itself and Postgres logs export are currently in Beta. You'll need admin access on the Neon project to add it."},{kind:"prose",text:"Neon can export both metrics and Postgres logs through this integration; this Sazabi data source is logs-only. Leave metrics disabled in the Neon form."},{kind:"external-link",label:"Open Neon integrations",href:"https://console.neon.tech/app/projects",description:"Choose the Neon project you want to monitor, then open the project's **Integrations** page."},{kind:"ordered-steps",items:["In the Neon Console, open your project and go to **Integrations**. On the **OpenTelemetry** card, click **Add** to open the configuration sidebar.","In **Select data to export**, enable `Postgres logs` and leave `Metrics` disabled. Neon does not expose a traces export for this integration.","Choose the `HTTP` protocol and paste the Sazabi OTLP base endpoint below. Neon appends `/v1/logs` automatically for log export.","Configure authentication as `Bearer` and paste the generated Sazabi token value below. Neon adds the `Bearer` prefix to outgoing requests automatically.","Under **Resource attributes**, set `service.name` to a short, stable identifier for this Neon project (Neon's docs use `neon-postgres-test` as an example). This attribute is optional but recommended so the project's logs are easy to filter in Sazabi.","Save the integration. Logs typically start arriving within a few minutes; if the compute has Scale to Zero enabled and is currently suspended, run a query against the database to wake it and begin log delivery."]},{kind:"copyable",label:"OTLP endpoint URL",value:"https://neon.${context.projectRegion}.intake.${context.intakeDomain}",copyLabel:"Neon OTLP endpoint URL",description:"Use the base URL in Neon. Neon will send logs to this URL with `/v1/logs` appended."},{kind:"copyable",label:"Connection protocol",value:"HTTP"},{kind:"copyable",label:"Data to export",value:"Postgres logs only"},{kind:"copyable",label:"Authentication method",value:"Bearer"},{kind:"copyable",label:"Bearer token value",value:"${context.publicKey}",copyLabel:"Neon bearer token value"},{kind:"copyable",label:"`service.name` resource attribute",value:"neon-postgres",copyLabel:"Neon service.name value",description:"Optional but recommended — paste under **Resource attributes** in Neon. Change the suffix (e.g. `neon-postgres-prod`, `neon-checkout-db`) when you have more than one Neon project so streams stay easy to filter in Sazabi."},{kind:"prose",text:"If logs do not arrive after a few minutes, check whether the Neon compute is suspended (Scale to Zero) — logs only flow while the compute is active. Run a query from the Neon SQL Editor or your application to wake it, then check the Neon integration's status panel for OTLP export errors."}]}});var SA,MI;var JI=d(()=>{HI();SA=[],MI={id:"neon",name:"Neon",capabilities:["manual"],auth:["manualKey"],delivery:["push"],sensitiveFields:SA,lifecycleSkipReason:"Manual OTLP setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward Neon Postgres logs to Sazabi for database observability without sending metrics or traces.",features:["Postgres logs","Connection events","Error and warning logs"],setupSkill:C,dashboard:{iconKey:"neon",intakeSourceId:"neon"}}});var pl;var VI=d(()=>{se();pl={steps:[{kind:"prose",text:"Configure a log drain in your [Netlify site settings](https://app.netlify.com) under Logs & Metrics > Log Drains. Select 'General HTTP endpoint' as the service and use the values below. Note: log drains require a Netlify Enterprise plan."},{kind:"copyable",label:"Full URL",value:"https://netlify.${context.projectRegion}.intake.${context.intakeDomain}"},{kind:"copyable",label:"Authorization header",value:ot},{kind:"copyable",label:"Log drain format",value:"JSON"}]}});var qI;var WI=d(()=>{VI();qI={id:"netlify",name:"Netlify",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual drain setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward your Netlify deployment logs directly to Sazabi for Jamstack observability.",features:["Build logs","Function logs","Edge handler logs"],setupSkill:C,dashboard:{iconKey:"netlify",intakeSourceId:"netlify"}}});var vl;var YI=d(()=>{vl={steps:[{kind:"prose",text:"In the OpenRouter dashboard, open **Settings > Observability**, toggle **Enable Broadcast** on, then click the edit icon next to **OpenTelemetry Collector**."},{kind:"external-link",label:"Settings > Observability",href:"https://openrouter.ai/settings/observability"},{kind:"prose",text:"Paste the values below into the destination form."},{kind:"copyable",label:"Endpoint",value:"https://openrouter.${context.projectRegion}.intake.${context.intakeDomain}/v1/traces",copyLabel:"Endpoint"},{kind:"copyable",label:"Headers",value:'{"Authorization": "Bearer ${context.publicKey}"}',copyLabel:"Headers"},{kind:"prose",text:"Click **Test Connection** to verify Sazabi accepts the trace. OpenRouter only saves the destination if the test passes; a green check confirms forwarding is enabled."}]}});var XI;var ZI=d(()=>{YI();XI={id:"openrouter",name:"OpenRouter",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"OpenRouter Broadcast destination setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward OpenRouter trace spans to Sazabi from the OpenRouter dashboard.",features:["Trace spans per generation","Token & cost tracking","Model & provider attribution"],setupSkill:C,dashboard:{iconKey:"openrouter",intakeSourceId:"openrouter"}}});var Il;var QI=d(()=>{se();Il={perStreamInstructions:!0,steps:[{kind:"prose",text:"Configure your application to export OpenTelemetry logs and traces to Sazabi by setting the following environment variables. These work with any OpenTelemetry SDK (Node.js, Python, Go, Java, .NET, etc.). Metrics are accepted by the intake but are not yet stored."},{kind:"ordered-steps",items:["Add the OpenTelemetry SDK to your application. Most languages have official SDKs available (e.g., `@opentelemetry/api` for Node.js, `opentelemetry-api` for Python, etc.).","Initialize the OpenTelemetry SDK in your application and configure the OTLP exporters for the signals you want (logs and/or traces). The SDK will automatically read the environment variables below.","Set the following environment variables in your application environment. These configure the OTLP exporter to send logs and traces to Sazabi."]},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_ENDPOINT`",value:"https://otlp.${context.projectRegion}.intake.${context.intakeDomain}",copyLabel:"OTLP endpoint"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_HEADERS`",value:xn,copyLabel:"OTLP headers"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_PROTOCOL`",value:"http/protobuf",copyLabel:"OTLP protocol"}]}});var ef;var tf=d(()=>{QI();ef={id:"otel",name:"OpenTelemetry",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual OTLP setup is not exercised by automated lifecycle tests yet.",subtitle:"Send OpenTelemetry logs and traces directly to Sazabi's OTLP-compatible intake for AI-powered observability.",features:["OTLP log export","OTLP trace export","Any OTEL SDK"],setupSkill:C,dashboard:{slug:"opentelemetry",iconKey:"opentelemetry",intakeSourceId:"otel"}}});var fl;var rf=d(()=>{fl={perStreamInstructions:!0,steps:[{kind:"prose",text:"Add the `otlphttp/sazabi` exporter to your OpenTelemetry Collector configuration and include it in your service pipelines. Use the Helm values snippet if you are deploying the collector via the `opentelemetry-collector` Helm chart."},{kind:"code-tabs",label:"Collector configuration",tabs:[{id:"yaml",label:"otelcol.yaml",language:"yaml",copyLabel:"Collector config",value:`exporters:
|
|
3976
4093
|
otlphttp/sazabi:
|
|
3977
4094
|
endpoint: "https://otel-collector.\${context.projectRegion}.intake.\${context.intakeDomain}"
|
|
3978
4095
|
headers:
|
|
@@ -4002,17 +4119,17 @@ service:
|
|
|
4002
4119
|
traces:
|
|
4003
4120
|
receivers: [otlp]
|
|
4004
4121
|
processors: [batch]
|
|
4005
|
-
exporters: [otlphttp/sazabi]`}]},{kind:"prose",text:"Adjust the `receivers` list to match the sources you have configured. The `filelog` receiver collects container logs on Kubernetes; the `otlp` receiver accepts spans from instrumented services."}]}});var of;var nf=
|
|
4122
|
+
exporters: [otlphttp/sazabi]`}]},{kind:"prose",text:"Adjust the `receivers` list to match the sources you have configured. The `filelog` receiver collects container logs on Kubernetes; the `otlp` receiver accepts spans from instrumented services."}]}});var of;var nf=d(()=>{rf();of={id:"otel_collector",name:"OpenTelemetry Collector",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward logs and traces from your infrastructure to Sazabi using the OpenTelemetry Collector.",features:["Kubernetes DaemonSet","Vendor-neutral standard","Extensible via contrib","Logs and traces"],setupSkill:C,dashboard:{iconKey:"otel-collector",intakeSourceId:"otel-collector"}}});var kl,TA,$l,wl;var af=d(()=>{se();kl={kind:"linear",steps:[{kind:"prose",text:"Create a personal API key in your PostHog account under **Settings → Personal API keys** ([US](https://us.posthog.com/settings/user-api-keys) · [EU](https://eu.posthog.com/settings/user-api-keys)). Grant it these scopes:\n\n- `project:read` — list your projects\n- `organization:read` — show your organization\n- `hog_function:write` — install the webhook destination"},{id:"token",kind:"secret",label:"Personal API key",placeholder:"phx_..."}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token"},resultAs:"validate"},{kind:"preflight",action:"preflight",input:{token:"$token",region:"$validate.posthogApiRegion",organizationId:"$validate.posthogOrganizationId"}}],metadata:{posthogPersonalApiKey:"$token",posthogApiRegion:"$validate.posthogApiRegion",posthogOrganizationId:"$validate.posthogOrganizationId",posthogOrganizationName:"$validate.posthogOrganizationName",connectionMode:"native"},button:he}},TA=[{field:"name",header:"Project"},{field:"organizationName",header:"Organization",width:"w-48",transform:"fallback:—"}],$l={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:TA,searchPlaceholder:"Search projects...",searchFields:["name","organizationName"],dedupeByConfigField:"posthogProjectId",emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have PostHog destinations configured."},toStreamItem:{displayName:"$item.name",config:{posthogProjectId:"$item.id",posthogProjectName:"$item.name"}}}},wl={steps:[{kind:"prose",text:"Configure an [HTTP Webhook destination](https://${context.posthogRegion}.posthog.com/pipeline/new/hog-template-webhook) in PostHog under Data Pipeline > Destinations. Use the values below and set your webhook body template to the default event and person payload."},{kind:"copyable",label:"Destination URL",value:"https://posthog.${context.projectRegion}.intake.${context.intakeDomain}"},{kind:"copyable",label:"Method",value:"POST"},{kind:"copyable",label:"Header name",value:"Authorization"},{kind:"copyable",label:"Header value",value:ot},{kind:"code",label:"Body template",language:"json",copyLabel:"Body template",value:`{
|
|
4006
4123
|
"event": "{event}",
|
|
4007
4124
|
"person": "{person}"
|
|
4008
|
-
}`}]}});var PA,cf;var lf=
|
|
4125
|
+
}`}]}});var PA,cf;var lf=d(()=>{af();PA=["posthogPersonalApiKey"],cf={id:"posthog",name:"PostHog",capabilities:["manual","native"],auth:["manualKey","apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:PA,subtitle:"Forward your PostHog events directly to Sazabi for real-time product and error observability.",features:["CDP webhook forwarding","Event property mapping","Real-time streaming"],setupSkill:C,dashboard:{iconKey:"posthog",intakeSourceId:"posthog",streamSelectorLayout:"sidepanel",actions:{submit:{validate:{kind:"source-action",actionId:"validate-personal-api-key",sensitiveInputFields:["token"]},preflight:{kind:"source-action",actionId:"run-preflight-checks",normalize:"preflight",sensitiveInputFields:["token"]}},list:{list:{kind:"source-action",actionId:"list-projects",itemsField:"projects"}}}}}});var _l;var uf=d(()=>{se();_l={steps:[{kind:"prose",text:"Railway does not provide a managed log drain to an external OTLP endpoint. Configure each Railway service you want to monitor so the application emits OpenTelemetry data directly to Sazabi. If you cannot add the SDK, run a log forwarder such as Vector or Fluent Bit as its own Railway service and point it at the same OTLP endpoint."},{kind:"external-link",label:"Open Railway dashboard",href:"https://railway.com/dashboard"},{kind:"ordered-steps",items:["Add OpenTelemetry to your application. Install the SDK, an OTLP HTTP/protobuf exporter, and any auto-instrumentation package your language needs. For Node.js, `@opentelemetry/api` alone is not enough; use the SDK/exporter packages too.","Initialize OpenTelemetry before your application handles requests. You can do this in code, with a preload flag such as `NODE_OPTIONS=--require ...`, or with a language-specific wrapper command.","In Railway, open the service, go to **Variables**, and use **New Variable** or **Raw Editor** to add the variables below. Railway stages variable changes, so review and deploy the change set when prompted.","Redeploy or restart the Railway service, then generate traffic or a test log line so Sazabi can receive fresh telemetry.","Verify data in Sazabi. If nothing appears, check the Railway deployment logs for OpenTelemetry exporter errors and confirm your app is emitting logs through the OpenTelemetry logger, not only stdout."]},{kind:"code",label:"Railway Raw Editor variables",description:"Paste this into the Railway service's Variables Raw Editor. Railway resolves the `${{...}}` references from its own service and deployment metadata.",language:"bash",value:'OTEL_EXPORTER_OTLP_ENDPOINT=https://railway.${context.projectRegion}.intake.${context.intakeDomain}\nOTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer ${context.publicKey}"\nOTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf\nOTEL_SERVICE_NAME=${{RAILWAY_SERVICE_NAME}}\nOTEL_RESOURCE_ATTRIBUTES=deployment.environment=${{RAILWAY_ENVIRONMENT_NAME}},service.version=${{RAILWAY_GIT_COMMIT_SHA}},railway.project.name=${{RAILWAY_PROJECT_NAME}},railway.deployment.id=${{RAILWAY_DEPLOYMENT_ID}}',copyLabel:"Railway environment variables"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_ENDPOINT`",value:"https://railway.${context.projectRegion}.intake.${context.intakeDomain}",copyLabel:"OTLP endpoint"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_HEADERS`",value:xn,copyLabel:"OTLP headers"},{kind:"copyable",label:"`OTEL_EXPORTER_OTLP_PROTOCOL`",value:"http/protobuf",copyLabel:"OTLP protocol"},{kind:"copyable",label:"`OTEL_SERVICE_NAME`",value:"${{RAILWAY_SERVICE_NAME}}",copyLabel:"OTEL service name"},{kind:"copyable",label:"`OTEL_RESOURCE_ATTRIBUTES`",value:"deployment.environment=${{RAILWAY_ENVIRONMENT_NAME}},service.version=${{RAILWAY_GIT_COMMIT_SHA}},railway.project.name=${{RAILWAY_PROJECT_NAME}},railway.deployment.id=${{RAILWAY_DEPLOYMENT_ID}}",copyLabel:"OTEL resource attributes"},{kind:"code-tabs",label:"Example bootstrap patterns",description:"Use the pattern for your runtime, or follow your language's OpenTelemetry documentation if your app already has instrumentation.",tabs:[{id:"node",label:"Node.js",language:"bash",value:`bun add @opentelemetry/api @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node @opentelemetry/exporter-trace-otlp-proto @opentelemetry/exporter-logs-otlp-proto
|
|
4009
4126
|
|
|
4010
4127
|
# Railway variable or start-command prefix:
|
|
4011
4128
|
NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"`,copyLabel:"Node.js OpenTelemetry bootstrap"},{id:"python",label:"Python",language:"bash",value:`pip install opentelemetry-distro opentelemetry-exporter-otlp-proto-http
|
|
4012
4129
|
opentelemetry-bootstrap -a install
|
|
4013
4130
|
|
|
4014
4131
|
# Railway start command example:
|
|
4015
|
-
opentelemetry-instrument python app.py`,copyLabel:"Python OpenTelemetry bootstrap"}]}]}});var hf;var gf=
|
|
4132
|
+
opentelemetry-instrument python app.py`,copyLabel:"Python OpenTelemetry bootstrap"}]}]}});var hf;var gf=d(()=>{uf();hf={id:"railway",name:"Railway",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual drain setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward your Railway deployment logs directly to Sazabi for real-time monitoring.",features:["Log drains","Deployment logs","Service monitoring"],setupSkill:C,dashboard:{iconKey:"railway",intakeSourceId:"railway"}}});var Ol,Sl;var sf=d(()=>{se();Ol={kind:"linear",steps:[{kind:"prose",text:"Enter your Render API key to connect your workspace. You can create an API key in your [Render dashboard](https://dashboard.render.com/settings#api-keys)."},{id:"token",kind:"secret",label:"API key",placeholder:"rnd_..."},{id:"workspace",kind:"select",label:"Workspace",placeholder:"Select a workspace",optionsAction:"options",optionsInput:{token:"$token"},optionValueField:"id",optionLabelField:"name",optionDescriptionField:"type"}],submit:{metadata:{apiToken:"$token",ownerId:"$workspace.id",ownerName:"$workspace.name"},displayName:"$workspace.name",button:he}},Sl={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"},{field:"type",header:"Type",width:"w-40",cell:"badge"}],searchPlaceholder:"Search services...",searchFields:["name"],dedupeByConfigField:"serviceId",emptyState:{noMatches:"No services found.",allConfigured:"All services already have log streams configured."},toStreamItem:{displayName:"$item.name",config:{serviceId:"$item.id",serviceName:"$item.name",serviceType:"$item.type"}}}}});var AA,df;var bf=d(()=>{sf();AA=["apiToken"],df={id:"render",name:"Render",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:AA,subtitle:"Forward your Render service logs directly to Sazabi for real-time monitoring.",features:["Log forwarding","Service monitoring","Environment filtering"],setupSkill:C,dashboard:{iconKey:"render",intakeSourceId:"render-syslog",streamSelectorLayout:"sidepanel",connectionMetadataSection:{title:"Render details",description:"The Render workspace linked to this connection.",fields:[{key:"ownerId",label:"Workspace ID",description:"Render workspace linked to this connection."}]},actions:{list:{options:{procedure:"render.listWorkspaces",itemsField:"workspaces",sensitiveInputFields:["token"]},list:{procedure:"render.listServices",itemsField:"services"}}}}}});var Tl;var yf=d(()=>{Tl={steps:[{kind:"prose",text:"Configure your Sentry SDK to forward errors to Sazabi using the DSN below. This works with all official Sentry SDKs."},{kind:"copyable",label:"Sentry DSN",value:"https://${context.publicKey}@sentry-dsn.${context.projectRegion}.intake.${context.intakeDomain}/0",copyLabel:"DSN"},{kind:"code",label:"JavaScript / Node.js",language:"javascript",copyLabel:"JavaScript",value:`import * as Sentry from "@sentry/node";
|
|
4016
4133
|
|
|
4017
4134
|
Sentry.init({
|
|
4018
4135
|
dsn: "https://\${context.publicKey}@sentry-dsn.\${context.projectRegion}.intake.\${context.intakeDomain}/0",
|
|
@@ -4020,7 +4137,7 @@ Sentry.init({
|
|
|
4020
4137
|
|
|
4021
4138
|
sentry_sdk.init(
|
|
4022
4139
|
dsn="https://\${context.publicKey}@sentry-dsn.\${context.projectRegion}.intake.\${context.intakeDomain}/0",
|
|
4023
|
-
)`},{kind:"prose",text:"This DSN works with any official Sentry SDK including Go, Ruby, Java, .NET, and more. Simply replace your existing Sentry DSN with the one above."}]}});var mf;var pf=
|
|
4140
|
+
)`},{kind:"prose",text:"This DSN works with any official Sentry SDK including Go, Ruby, Java, .NET, and more. Simply replace your existing Sentry DSN with the one above."}]}});var mf;var pf=d(()=>{yf();mf={id:"sentry",name:"Sentry SDK",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual SDK setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward your Sentry SDK errors and events directly to Sazabi for AI-powered error tracking.",features:["Error forwarding","Exception tracking","SDK integration"],setupSkill:C,dashboard:{iconKey:"sentry",intakeSourceId:"sentry-dsn"}}});var Pl;var vf=d(()=>{se();Pl={kind:"linear",steps:[{kind:"prose",text:"You must be an **Owner** or **Manager** in the Sentry organization — creating an Internal Integration requires the `org:write` scope, which is only granted to Owners and Managers. The Admin role does not include `org:write`, so a personal user auth token minted by an Admin cannot create the Internal Integration and Sentry will return 403. Create a Sentry user auth token with the following permissions: **Organization: Read & Write** (the `org:write` scope), **Project: Read**, and **Issue & Event: Read**. The `org:write` scope is required for Sazabi to create the Internal Integration; the integration itself only receives read-level webhook events. Confirm the Permissions Preview at the bottom of the Sentry form shows `event:read, org:write, project:read` before submitting."},{kind:"external-link",label:"Open Sentry auth token settings",href:"https://sentry.io/settings/account/api/auth-tokens/new-token/"},{id:"token",kind:"secret",label:"Sentry auth token",description:"Token with org:write, project:read, and event:read scopes.",placeholder:"Enter your Sentry auth token"},{id:"organizationSlug",kind:"text",label:"Sentry organization slug",description:"The slug from your Sentry URL: sentry.io/organizations/<slug>/",placeholder:"e.g. my-org",pattern:"^[a-z0-9][a-z0-9-]*[a-z0-9]$",patternMessage:"Enter a valid Sentry organization slug (lowercase, hyphens allowed)."}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token",organizationSlug:"$organizationSlug"},resultAs:"validate"}],metadata:{connectionMode:"native",sentryAuthToken:"$token",organizationSlug:"$organizationSlug"},button:he}}});var DA,If;var ff=d(()=>{vf();DA=["sentryAuthToken"],If={id:"sentry_platform",name:"Sentry",capabilities:["native"],auth:["apiToken"],delivery:["push"],streamCardinality:"single",sensitiveFields:DA,subtitle:"Connect your Sentry organization to stream errors, issues, and alerts to Sazabi in real-time.",features:["Error streaming","Issue tracking","Alert forwarding","Metric alerts"],setupSkill:C,dashboard:{iconKey:"sentry",intakeSourceId:"sentry-platform",actions:{submit:{validate:{kind:"source-action",actionId:"validate",sensitiveInputFields:["token"]}}}}}});var Al;var kf=d(()=>{se();Al={steps:[{kind:"prose",text:"In the [Supabase dashboard](https://supabase.com/dashboard), open Project Settings > Log Drains and click **Add destination**. Fill in the fields below in order — they map 1:1 to the Supabase form. Under **Custom Headers**, Supabase pre-fills a `Content-Type` row when OTLP is selected; **leave it in place** and click **Add a new header** to add the `Authorization` row alongside it. Note: Log Drains require a Supabase Pro, Team, or Enterprise plan."},{kind:"copyable",label:"Name",value:"Sazabi"},{kind:"copyable",label:"Description",value:"Forward Supabase logs to Sazabi for observability and AI analysis."},{kind:"copyable",label:"Type",value:"OpenTelemetry Protocol (OTLP)"},{kind:"copyable",label:"OTLP Endpoint",value:"https://supabase.${context.projectRegion}.intake.${context.intakeDomain}"},{kind:"copyable",label:"Protocol",value:"HTTP/Protobuf"},{kind:"copyable",label:"Gzip Compression",value:"Enabled"},{kind:"copyable-pairs",label:"Custom Headers",pairs:[{name:"Content-Type",value:"application/x-protobuf",description:"Pre-filled by Supabase — keep as-is."},{name:"Authorization",value:ot,description:"Click **Add a new header** and paste these values."}]}]}});var $f;var wf=d(()=>{kf();$f={id:"supabase",name:"Supabase",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual drain setup is not exercised by automated lifecycle tests yet.",subtitle:"Stream your Supabase project logs directly to Sazabi for unified observability.",features:["Database logs","Auth events","Edge Function logs"],setupSkill:C,dashboard:{iconKey:"supabase",intakeSourceId:"supabase"}}});var Dl;var _f=d(()=>{se();Dl={steps:[{kind:"ordered-steps",items:zn("Temporal worker")},jn,...sr("temporal")]}});var Of;var Sf=d(()=>{_f();Of={id:"temporal",name:"Temporal",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual worker setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward OpenTelemetry logs and traces from your Temporal workers to Sazabi for durable execution observability.",features:["Worker logs","Workflow and activity traces"],setupSkill:C,dashboard:{iconKey:"temporal",intakeSourceId:"temporal"}}});var Nl;var Tf=d(()=>{Nl={perStreamInstructions:!0,steps:[{kind:"ordered-steps",items:["Install `@opentelemetry/exporter-logs-otlp-http` in the package that owns your `trigger.config.ts` file.","Add `SAZABI_API_KEY` to the Trigger.dev deployment environment using the public key shown below.","Configure `telemetry.logExporters` directly in `trigger.config.ts`. Trigger.dev reserves `OTEL_*` environment variables for its own internal telemetry, so do not use them for this integration.","Redeploy your Trigger.dev project so task logs are exported to Sazabi."]},{kind:"copyable",label:"`SAZABI_API_KEY`",value:"${context.publicKey}",copyLabel:"Sazabi API key",description:"Store this as a secret in the Trigger.dev environment that runs your tasks."},{kind:"copyable",label:"Sazabi log intake URL",value:"https://trigger-dev.${context.projectRegion}.intake.${context.intakeDomain}/v1/logs",copyLabel:"Sazabi log intake URL"},{kind:"code",label:"`trigger.config.ts`",language:"typescript",value:`import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
4024
4141
|
import { defineConfig } from "@trigger.dev/sdk";
|
|
4025
4142
|
|
|
4026
4143
|
const sazabiApiKey = process.env.SAZABI_API_KEY;
|
|
@@ -4042,7 +4159,7 @@ export default defineConfig({
|
|
|
4042
4159
|
],
|
|
4043
4160
|
},
|
|
4044
4161
|
});
|
|
4045
|
-
`,copyLabel:"Trigger.dev config snippet"},{kind:"bulleted-list",items:["This v1 source ingests logs only. Trace exporters, metrics exporters, alert webhooks, and management API polling are intentionally out of scope.","Use `telemetry.logExporters`; do not configure this source through `telemetry.exporters`, Trigger.dev alert webhooks, or management API polling."]}]}});var Pf;var Af=
|
|
4162
|
+
`,copyLabel:"Trigger.dev config snippet"},{kind:"bulleted-list",items:["This v1 source ingests logs only. Trace exporters, metrics exporters, alert webhooks, and management API polling are intentionally out of scope.","Use `telemetry.logExporters`; do not configure this source through `telemetry.exporters`, Trigger.dev alert webhooks, or management API polling."]}]}});var Pf;var Af=d(()=>{Tf();Pf={id:"trigger_dev",name:"Trigger.dev",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual trigger.config.ts setup is not exercised by automated lifecycle tests yet.",subtitle:"Stream your Trigger.dev job logs directly to Sazabi for background job monitoring.",features:["Task logs","Run failure logs","Background job monitoring"],setupSkill:C,dashboard:{iconKey:"trigger-dev",intakeSourceId:"trigger-dev"}}});var Ll;var Df=d(()=>{Ll={perStreamInstructions:!0,steps:[{kind:"prose",text:"Forward Vector logs to Sazabi over OTLP/HTTP. Vector 0.51.0 or later is required for the `otlp` encoding codec. The configuration pipes events through a `remap` transform that builds the OTLP `resourceLogs` envelope — the sink's `otlp` codec does not construct this envelope on its own, so wiring raw sources directly into it drops 100% of events."},{kind:"code-tabs",label:"Vector logs sink",tabs:[{id:"yaml",label:"vector.yaml",language:"yaml",copyLabel:"YAML config",value:`transforms:
|
|
4046
4163
|
sazabi_logs_otlp:
|
|
4047
4164
|
type: remap
|
|
4048
4165
|
inputs: ["*"] # replace with explicit source/transform IDs
|
|
@@ -4122,10 +4239,10 @@ sinks:
|
|
|
4122
4239
|
strategy: bearer
|
|
4123
4240
|
token: "\${context.publicKey}"
|
|
4124
4241
|
encoding:
|
|
4125
|
-
codec: otlp`}]},{kind:"prose",text:'Replace `inputs: ["*"]` on the `remap` transform with your specific source or transform IDs in production — `["*"]` also matches `internal_metrics` and other unrelated components. Sazabi indexes logs and traces from Vector; metrics are accepted at the intake but silently dropped.'},{kind:"prose",text:'**Forwarding traces (optional):** add a second `opentelemetry` sink with `uri` ending in `/v1/traces` and explicit `inputs` referencing an already-OTLP-shaped source — typically an `opentelemetry` Vector source with `use_otlp_decoding.traces: true` (use `inputs: ["otlp_in.traces"]`). No remap is needed for traces. Do not wire `["*"]` into a traces sink.'}]}});var Nf;var Lf=s(()=>{Df();Nf={id:"vector",name:"Vector",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward logs and traces from your infrastructure to Sazabi using the Vector observability pipeline.",features:["Kubernetes DaemonSet","High-throughput pipeline","Built-in transforms","Multiple source types"],setupSkill:C,dashboard:{iconKey:"vector",intakeSourceId:"vector"}}});var xl,Cl,zl;var Cf=s(()=>{de();xl={kind:"linear",steps:[{kind:"prose",text:"Create a full-access API token in your [Vercel account settings](https://vercel.com/account/tokens). Vercel tokens inherit your account permissions automatically. For team accounts, make sure you create the token while scoped to the correct team."},{id:"token",kind:"secret",label:"API token",placeholder:"Enter your Vercel API token"}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token"},resultAs:"validate"}],metadata:{vercelApiToken:"$token",vercelTeamId:"$validate.teamId",vercelTeamName:"$validate.teamName"},button:he}},Cl=[{field:"name",header:"Project"},{field:"framework",header:"Framework",width:"w-32",cell:"badge",transform:"fallback:Unspecified"}],zl={content:{kind:"tabs",tabs:[{id:"logs",label:"Logs",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{ingestTraces:!1},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have logs drains configured."},toStreamItem:{displayName:"$item.name (Logs)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"logs",ingestTraces:!1}}}},{id:"traces",label:"Traces",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{ingestTraces:!0},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have traces drains configured."},toStreamItem:{displayName:"$item.name (Traces)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"traces",ingestTraces:!0}}}},{id:"analytics",label:"Analytics",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{drainType:"analytics"},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have analytics drains configured."},toStreamItem:{displayName:"$item.name (Analytics)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"analytics"}}}}]}}});var NA,xf;var zf=s(()=>{Cf();NA=["vercelApiToken"],xf={id:"vercel",name:"Vercel",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:NA,subtitle:"Forward your Vercel deployment logs, traces, and Web Analytics events directly to Sazabi for real-time analysis and alerting.",features:["Log forwarding","Trace forwarding","Web Analytics forwarding","Real-time streaming"],setupSkill:C,dashboard:{iconKey:"vercel",intakeSourceId:"vercel",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-enum-badge",header:"Type",width:"w-24",configField:"drainType",values:[{value:"logs",label:"Logs"},{value:"traces",label:"Traces"},{value:"analytics",label:"Analytics"}],legacyBooleanField:"ingestTraces",legacyTrueLabel:"Traces",legacyFalseLabel:"Logs",fallbackLabel:"N/A"}],actions:{submit:{validate:{kind:"source-action",actionId:"validate-token"}},list:{list:{kind:"source-action",actionId:"list-projects",itemsField:"projects"}}}}}});var En,jf,AG,DG,sr,NG,LG,LA,CA,xA,CG;var Ef=s(()=>{nI();cI();hI();sI();mI();II();$I();OI();PI();NI();xI();EI();KI();FI();MI();WI();ZI();tf();nf();lf();gf();bf();pf();ff();wf();Sf();Af();Lf();zf();En=[oI,aI,uI,dI,yI,vI,kI,_I,TI,DI,CI,jI,RI,BI,HI,qI,XI,ef,of,cf,hf,sf,If,mf,$f,Of,Pf,Nf,xf],jf=En,AG=Object.fromEntries(jf.map((e)=>[e.id,e.sensitiveFields??[]])),DG=Object.fromEntries(jf.flatMap((e)=>[...Object.values(e.dashboard?.actions?.submit??{}),...Object.values(e.dashboard?.actions?.list??{}),...Object.values(e.dashboard?.actions?.prefetch??{})].flatMap((t)=>{let o=t.sensitiveInputFields??[];if(o.length===0)return[];return[["procedure"in t?t.procedure:`${e.id}.${t.actionId}`,o]]}))),sr=["vercel","cloudflare","railway","render","fly_io","netlify","supabase","digital_ocean","inngest","trigger_dev","temporal","mastra","neon","langchain","daytona","e2b","cloudwatch","convex","datadog","sentry","sentry_platform","openrouter","posthog","gcp","otel","fluent_bit","vector","grafana_alloy","otel_collector"],NG=En.map((e)=>({id:e.id,name:e.name,capabilities:e.capabilities})),LG=Object.fromEntries(En.map((e)=>[e.id,{name:e.name,setupSkill:e.setupSkill}])),LA={cloudflare:qc,cloudwatch:Xc,convex:Qc,digital_ocean:ol,fly_io:cl,gcp:ul,posthog:kl,render:Ol,sentry_platform:Pl,vercel:xl},CA={cloudflare:Wc,cloudwatch:Zc,convex:el,digital_ocean:nl,fly_io:ll,gcp:hl,posthog:$l,render:Sl,vercel:zl},xA={cloudflare:Yc,datadog:tl,daytona:rl,fluent_bit:al,grafana_alloy:dl,e2b:il,gcp:gl,inngest:sl,langchain:bl,mastra:yl,neon:ml,netlify:pl,openrouter:vl,otel:Il,otel_collector:fl,posthog:wl,railway:_l,sentry:Tl,supabase:Al,temporal:Dl,trigger_dev:Nl,vector:Ll},CG=En.map((e)=>({sourceId:e.id,name:e.name,capabilities:e.capabilities,setupAuthModes:e.auth,deliveryModes:e.delivery,hasDashboardMetadata:Boolean(e.dashboard),hasNativeFlow:Boolean(LA[e.id]),hasManualFlow:Boolean(xA[e.id]),hasStreamSelector:Boolean(CA[e.id]),lifecycleEligible:e.lifecycleEligible??!1,lifecycleSkipReason:e.lifecycleSkipReason}))});var Uf=s(()=>{Ef()});var jl=s(()=>{tI();Uf()});function m(e,t,o){function n(c,u){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let h=a.prototype,d=Object.keys(h);for(let g=0;g<d.length;g++){let b=d[g];if(!(b in c))c[b]=h[b].bind(c)}}let r=o?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(c){var u;let h=o?.Parent?new i:this;n(h,c),(u=h._zod).deferred??(u.deferred=[]);for(let d of h._zod.deferred)d();return h}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:(c)=>{if(o?.Parent&&c instanceof o.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}function ue(e){if(e)Object.assign(Ao,e);return Ao}var El,Ul,nt,qt,Ao;var br=s(()=>{El=Object.freeze({status:"aborted"});Ul=Symbol("zod_brand");nt=class nt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};qt=class qt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}};Ao={}});var w={};Qe(w,{unwrapMessage:()=>Do,uint8ArrayToHex:()=>iD,uint8ArrayToBase64url:()=>oD,uint8ArrayToBase64:()=>Gf,stringifyPrimitive:()=>k,slugify:()=>Gl,shallowClone:()=>Fl,safeExtend:()=>XA,required:()=>eD,randomString:()=>JA,propertyKeyTypes:()=>Co,promiseAllObject:()=>FA,primitiveTypes:()=>Jl,prefixIssues:()=>je,pick:()=>qA,partial:()=>QA,parsedType:()=>$,optionalKeys:()=>Hl,omit:()=>WA,objectClone:()=>KA,numKeys:()=>HA,nullish:()=>Dt,normalizeParams:()=>O,mergeDefs:()=>pt,merge:()=>ZA,jsonStringifyReplacer:()=>yr,joinValues:()=>I,issue:()=>pr,isPlainObject:()=>Lt,isObject:()=>Wt,hexToUint8Array:()=>nD,getSizableOrigin:()=>xo,getParsedType:()=>MA,getLengthableOrigin:()=>zo,getEnumValues:()=>No,getElementAtPath:()=>BA,floatSafeRemainder:()=>Kl,finalizeIssue:()=>Ce,extend:()=>YA,escapeRegex:()=>He,esc:()=>Un,defineLazy:()=>B,createTransparentProxy:()=>VA,cloneDef:()=>GA,clone:()=>Pe,cleanRegex:()=>Lo,cleanEnum:()=>tD,captureStackTrace:()=>Rn,cached:()=>mr,base64urlToUint8Array:()=>rD,base64ToUint8Array:()=>Kf,assignProp:()=>Nt,assertNotEqual:()=>jA,assertNever:()=>UA,assertIs:()=>EA,assertEqual:()=>zA,assert:()=>RA,allowsEval:()=>Bl,aborted:()=>Ct,NUMBER_FORMAT_RANGES:()=>Ml,Class:()=>Bf,BIGINT_FORMAT_RANGES:()=>Vl});function zA(e){return e}function jA(e){return e}function EA(e){}function UA(e){throw Error("Unexpected value in exhaustive check")}function RA(e){}function No(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function I(e,t="|"){return e.map((o)=>k(o)).join(t)}function yr(e,t){if(typeof t==="bigint")return t.toString();return t}function mr(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function Dt(e){return e===null||e===void 0}function Lo(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Kl(e,t){let o=(e.toString().split(".")[1]||"").length,n=t.toString(),r=(n.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(n)){let u=n.match(/\d?e-(\d?)/);if(u?.[1])r=Number.parseInt(u[1])}let i=o>r?o:r,a=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return a%c/10**i}function B(e,t,o){let n=void 0;Object.defineProperty(e,t,{get(){if(n===Rf)return;if(n===void 0)n=Rf,n=o();return n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function KA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Nt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function pt(...e){let t={};for(let o of e){let n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function GA(e){return pt(e._zod.def)}function BA(e,t){if(!t)return e;return t.reduce((o,n)=>o?.[n],e)}function FA(e){let t=Object.keys(e),o=t.map((n)=>e[n]);return Promise.all(o).then((n)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=n[i];return r})}function JA(e=10){let o="";for(let n=0;n<e;n++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Un(e){return JSON.stringify(e)}function Gl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Wt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Lt(e){if(Wt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let o=t.prototype;if(Wt(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Fl(e){if(Lt(e))return{...e};if(Array.isArray(e))return[...e];return e}function HA(e){let t=0;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))t++;return t}function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,o){let n=new e._zod.constr(t??e._zod.def);if(!t||o?.parent)n._zod.parent=e;return n}function O(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function VA(e){let t;return new Proxy({},{get(o,n,r){return t??(t=e()),Reflect.get(t,n,r)},set(o,n,r,i){return t??(t=e()),Reflect.set(t,n,r,i)},has(o,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(o,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(o,n,r){return t??(t=e()),Reflect.defineProperty(t,n,r)}})}function k(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Hl(e){return Object.keys(e).filter((t)=>{return e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional"})}function qA(e,t){let o=e._zod.def,n=o.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=pt(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;a[c]=o.shape[c]}return Nt(this,"shape",a),a},checks:[]});return Pe(e,i)}function WA(e,t){let o=e._zod.def,n=o.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=pt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete a[c]}return Nt(this,"shape",a),a},checks:[]});return Pe(e,i)}function YA(e,t){if(!Lt(t))throw Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=pt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Nt(this,"shape",i),i}});return Pe(e,r)}function XA(e,t){if(!Lt(t))throw Error("Invalid input to safeExtend: expected a plain object");let o=pt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nt(this,"shape",n),n}});return Pe(e,o)}function ZA(e,t){let o=pt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Nt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,o)}function QA(e,t,o){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=pt(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(o)for(let h in o){if(!(h in c))throw Error(`Unrecognized key: "${h}"`);if(!o[h])continue;u[h]=e?new e({type:"optional",innerType:c[h]}):c[h]}else for(let h in c)u[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return Nt(this,"shape",u),u},checks:[]});return Pe(t,a)}function eD(e,t,o){let n=pt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(o)for(let a in o){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!o[a])continue;i[a]=new e({type:"nonoptional",innerType:r[a]})}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return Nt(this,"shape",i),i}});return Pe(t,n)}function Ct(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function je(e,t){return t.map((o)=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function Do(e){return typeof e==="string"?e:e?.message}function Ce(e,t,o){let n={...e,path:e.path??[]};if(!e.message){let r=Do(e.inst?._zod.def?.error?.(e))??Do(t?.error?.(e))??Do(o.customError?.(e))??Do(o.localeError?.(e))??"Invalid input";n.message=r}if(delete n.inst,delete n.continue,!t?.reportInput)delete n.input;return n}function xo(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function zo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function $(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function pr(...e){let[t,o,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:o,inst:n};return{...t}}function tD(e){return Object.entries(e).filter(([t,o])=>{return Number.isNaN(Number.parseInt(t,10))}).map((t)=>t[1])}function Kf(e){let t=atob(e),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return o}function Gf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function rD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return Kf(t+o)}function oD(e){return Gf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function nD(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)o[n/2]=Number.parseInt(t.slice(n,n+2),16);return o}function iD(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class Bf{constructor(...e){}}var Rf,Rn,Bl,MA=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Co,Jl,Ml,Vl;var x=s(()=>{Rf=Symbol("evaluating");Rn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Bl=mr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});Co=new Set(["string","number","symbol"]),Jl=new Set(["string","number","bigint","boolean","symbol","undefined"]);Ml={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function Eo(e,t=(o)=>o.message){let o={},n=[];for(let r of e.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r));else n.push(t(r));return{formErrors:n,fieldErrors:o}}function Uo(e,t=(o)=>o.message){let o={_errors:[]},n=(r)=>{for(let i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>n({issues:a}));else if(i.code==="invalid_key")n({issues:i.issues});else if(i.code==="invalid_element")n({issues:i.issues});else if(i.path.length===0)o._errors.push(t(i));else{let a=o,c=0;while(c<i.path.length){let u=i.path[c];if(c!==i.path.length-1)a[u]=a[u]||{_errors:[]};else a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(i));a=a[u],c++}}};return n(e),o}function ql(e,t=(o)=>o.message){let o={errors:[]},n=(r,i=[])=>{var a,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((h)=>n({issues:h},u.path));else if(u.code==="invalid_key")n({issues:u.issues},u.path);else if(u.code==="invalid_element")n({issues:u.issues},u.path);else{let h=[...i,...u.path];if(h.length===0){o.errors.push(t(u));continue}let d=o,g=0;while(g<h.length){let b=h[g],y=g===h.length-1;if(typeof b==="string")d.properties??(d.properties={}),(a=d.properties)[b]??(a[b]={errors:[]}),d=d.properties[b];else d.items??(d.items=[]),(c=d.items)[b]??(c[b]={errors:[]}),d=d.items[b];if(y)d.errors.push(t(u));g++}}};return n(e),o}function Jf(e){let t=[],o=e.map((n)=>typeof n==="object"?n.key:n);for(let n of o)if(typeof n==="number")t.push(`[${n}]`);else if(typeof n==="symbol")t.push(`[${JSON.stringify(String(n))}]`);else if(/[^\w$]/.test(n))t.push(`[${JSON.stringify(n)}]`);else{if(t.length)t.push(".");t.push(n)}return t.join("")}function Wl(e){let t=[],o=[...e.issues].sort((n,r)=>(n.path??[]).length-(r.path??[]).length);for(let n of o)if(t.push(`✖ ${n.message}`),n.path?.length)t.push(` → at ${Jf(n.path)}`);return t.join(`
|
|
4126
|
-
`)}var Ff=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jo,xe;var Yl=s(()=>{br();x();jo=m("$ZodError",Ff),xe=m("$ZodError",Ff,{Parent:Error})});var vr=(e)=>(t,o,n,r)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new nt;if(a.issues.length){let c=new(r?.Err??e)(a.issues.map((u)=>Ce(u,i,ue())));throw Rn(c,r?.callee),c}return a.value},Kn,Ir=(e)=>async(t,o,n,r)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(r?.Err??e)(a.issues.map((u)=>Ce(u,i,ue())));throw Rn(c,r?.callee),c}return a.value},Gn,fr=(e)=>(t,o,n)=>{let r=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise)throw new nt;return i.issues.length?{success:!1,error:new(e??jo)(i.issues.map((a)=>Ce(a,r,ue())))}:{success:!0,data:i.value}},Xl,kr=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>Ce(a,r,ue())))}:{success:!0,data:i.value}},Zl,Bn=(e)=>(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return vr(e)(t,o,r)},cD,Fn=(e)=>(t,o,n)=>{return vr(e)(t,o,n)},lD,Jn=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ir(e)(t,o,r)},uD,Hn=(e)=>async(t,o,n)=>{return Ir(e)(t,o,n)},hD,Mn=(e)=>(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fr(e)(t,o,r)},gD,Vn=(e)=>(t,o,n)=>{return fr(e)(t,o,n)},dD,qn=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kr(e)(t,o,r)},sD,Wn=(e)=>async(t,o,n)=>{return kr(e)(t,o,n)},bD;var Ql=s(()=>{br();Yl();x();Kn=vr(xe),Gn=Ir(xe),Xl=fr(xe),Zl=kr(xe),cD=Bn(xe),lD=Fn(xe),uD=Jn(xe),hD=Hn(xe),gD=Mn(xe),dD=Vn(xe),sD=qn(xe),bD=Wn(xe)});var Me={};Qe(Me,{xid:()=>ou,uuid7:()=>vD,uuid6:()=>pD,uuid4:()=>mD,uuid:()=>Yt,uppercase:()=>Tu,unicodeEmail:()=>Hf,undefined:()=>Ou,ulid:()=>ru,time:()=>vu,string:()=>fu,sha512_hex:()=>RD,sha512_base64url:()=>GD,sha512_base64:()=>KD,sha384_hex:()=>jD,sha384_base64url:()=>UD,sha384_base64:()=>ED,sha256_hex:()=>CD,sha256_base64url:()=>zD,sha256_base64:()=>xD,sha1_hex:()=>DD,sha1_base64url:()=>LD,sha1_base64:()=>ND,rfc5322Email:()=>fD,number:()=>Ro,null:()=>_u,nanoid:()=>iu,md5_hex:()=>TD,md5_base64url:()=>AD,md5_base64:()=>PD,mac:()=>du,lowercase:()=>Su,ksuid:()=>nu,ipv6:()=>gu,ipv4:()=>hu,integer:()=>$u,idnEmail:()=>kD,html5Email:()=>ID,hostname:()=>_D,hex:()=>SD,guid:()=>cu,extendedDuration:()=>yD,emoji:()=>uu,email:()=>lu,e164:()=>mu,duration:()=>au,domain:()=>OD,datetime:()=>Iu,date:()=>pu,cuid2:()=>tu,cuid:()=>eu,cidrv6:()=>bu,cidrv4:()=>su,browserEmail:()=>$D,boolean:()=>wu,bigint:()=>ku,base64url:()=>Yn,base64:()=>yu});function uu(){return new RegExp(wD,"u")}function Vf(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vu(e){return new RegExp(`^${Vf(e)}$`)}function Iu(e){let t=Vf({precision:e.precision}),o=["Z"];if(e.local)o.push("");if(e.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${o.join("|")})`;return new RegExp(`^${Mf}T(?:${n})$`)}function Ko(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Go(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var eu,tu,ru,ou,nu,iu,au,yD,cu,Yt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},mD,pD,vD,lu,ID,fD,Hf,kD,$D,wD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hu,gu,du=(e)=>{let t=He(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},su,bu,yu,Yn,_D,OD,mu,Mf="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",pu,fu=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ku,$u,Ro,wu,_u,Ou,Su,Tu,SD,TD,PD,AD,DD,ND,LD,CD,xD,zD,jD,ED,UD,RD,KD,GD;var Xn=s(()=>{x();eu=/^[cC][^\s-]{8,}$/,tu=/^[0-9a-z]+$/,ru=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ou=/^[0-9a-vA-V]{20}$/,nu=/^[A-Za-z0-9]{27}$/,iu=/^[a-zA-Z0-9_-]{21}$/,au=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mD=Yt(4),pD=Yt(6),vD=Yt(7),lu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ID=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fD=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Hf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kD=Hf,$D=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;hu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,su=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yn=/^[A-Za-z0-9_-]*$/,_D=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,OD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mu=/^\+[1-9]\d{6,14}$/,pu=new RegExp(`^${Mf}$`);ku=/^-?\d+n?$/,$u=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,wu=/^(?:true|false)$/i,_u=/^null$/i,Ou=/^undefined$/i,Su=/^[^A-Z]*$/,Tu=/^[^a-z]*$/,SD=/^[0-9a-fA-F]*$/;TD=/^[0-9a-fA-F]{32}$/,PD=Ko(22,"=="),AD=Go(22),DD=/^[0-9a-fA-F]{40}$/,ND=Ko(27,"="),LD=Go(27),CD=/^[0-9a-fA-F]{64}$/,xD=Ko(43,"="),zD=Go(43),jD=/^[0-9a-fA-F]{96}$/,ED=Ko(64,""),UD=Go(64),RD=/^[0-9a-fA-F]{128}$/,KD=Ko(86,"=="),GD=Go(86)});function qf(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues))}var te,Wf,Zn,Qn,Pu,Au,Du,Nu,Lu,Cu,xu,zu,ju,$r,Eu,Uu,Ru,Ku,Gu,Bu,Fu,Ju,Hu;var ei=s(()=>{br();Xn();x();te=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Wf={number:"number",bigint:"bigint",object:"date"},Zn=m("$ZodCheckLessThan",(e,t)=>{te.init(e,t);let o=Wf[typeof t.value];e._zod.onattach.push((n)=>{let r=n._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:o,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qn=m("$ZodCheckGreaterThan",(e,t)=>{te.init(e,t);let o=Wf[typeof t.value];e._zod.onattach.push((n)=>{let r=n._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:o,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pu=m("$ZodCheckMultipleOf",(e,t)=>{te.init(e,t),e._zod.onattach.push((o)=>{var n;(n=o._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(o)=>{if(typeof o.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%t.value===BigInt(0):Kl(o.value,t.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Au=m("$ZodCheckNumberFormat",(e,t)=>{te.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),n=o?"int":"number",[r,i]=Ml[t.format];e._zod.onattach.push((a)=>{let c=a._zod.bag;if(c.format=t.format,c.minimum=r,c.maximum=i,o)c.pattern=$u}),e._zod.check=(a)=>{let c=a.value;if(o){if(!Number.isInteger(c)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<r)a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(c>i)a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Du=m("$ZodCheckBigIntFormat",(e,t)=>{te.init(e,t);let[o,n]=Vl[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=o,i.maximum=n}),e._zod.check=(r)=>{let i=r.value;if(i<o)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(i>n)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Nu=m("$ZodCheckMaxSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let r=n.value;if(r.size<=t.maximum)return;n.issues.push({origin:xo(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lu=m("$ZodCheckMinSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let r=n.value;if(r.size>=t.minimum)return;n.issues.push({origin:xo(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cu=m("$ZodCheckSizeEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(n)=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:xo(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xu=m("$ZodCheckMaxLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let r=n.value;if(r.length<=t.maximum)return;let a=zo(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zu=m("$ZodCheckMinLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let r=n.value;if(r.length>=t.minimum)return;let a=zo(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ju=m("$ZodCheckLengthEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(n)=>{let r=n.value,i=r.length;if(i===t.length)return;let a=zo(r),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$r=m("$ZodCheckStringFormat",(e,t)=>{var o,n;if(te.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(o=e._zod).check??(o.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Eu=m("$ZodCheckRegex",(e,t)=>{$r.init(e,t),e._zod.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Uu=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Su),$r.init(e,t)}),Ru=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tu),$r.init(e,t)}),Ku=m("$ZodCheckIncludes",(e,t)=>{te.init(e,t);let o=He(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Gu=m("$ZodCheckStartsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`^${He(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Bu=m("$ZodCheckEndsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`.*${He(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});Fu=m("$ZodCheckProperty",(e,t)=>{te.init(e,t),e._zod.check=(o)=>{let n=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then((r)=>qf(r,o,t.property));qf(n,o,t.property);return}}),Ju=m("$ZodCheckMimeType",(e,t)=>{te.init(e,t);let o=new Set(t.mime);e._zod.onattach.push((n)=>{n._zod.bag.mime=t.mime}),e._zod.check=(n)=>{if(o.has(n.value.type))return;n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),Hu=m("$ZodCheckOverwrite",(e,t)=>{te.init(e,t),e._zod.check=(o)=>{o.value=t.tx(o.value)}})});class ti{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
|
|
4242
|
+
codec: otlp`}]},{kind:"prose",text:'Replace `inputs: ["*"]` on the `remap` transform with your specific source or transform IDs in production — `["*"]` also matches `internal_metrics` and other unrelated components. Sazabi indexes logs and traces from Vector; metrics are accepted at the intake but silently dropped.'},{kind:"prose",text:'**Forwarding traces (optional):** add a second `opentelemetry` sink with `uri` ending in `/v1/traces` and explicit `inputs` referencing an already-OTLP-shaped source — typically an `opentelemetry` Vector source with `use_otlp_decoding.traces: true` (use `inputs: ["otlp_in.traces"]`). No remap is needed for traces. Do not wire `["*"]` into a traces sink.'}]}});var Nf;var Lf=d(()=>{Df();Nf={id:"vector",name:"Vector",capabilities:["manual"],auth:["manualKey"],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",subtitle:"Forward logs and traces from your infrastructure to Sazabi using the Vector observability pipeline.",features:["Kubernetes DaemonSet","High-throughput pipeline","Built-in transforms","Multiple source types"],setupSkill:C,dashboard:{iconKey:"vector",intakeSourceId:"vector"}}});var xl,Cl,zl;var Cf=d(()=>{se();xl={kind:"linear",steps:[{kind:"prose",text:"Create a full-access API token in your [Vercel account settings](https://vercel.com/account/tokens). Vercel tokens inherit your account permissions automatically. For team accounts, make sure you create the token while scoped to the correct team."},{id:"token",kind:"secret",label:"API token",placeholder:"Enter your Vercel API token"}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token"},resultAs:"validate"}],metadata:{vercelApiToken:"$token",vercelTeamId:"$validate.teamId",vercelTeamName:"$validate.teamName"},button:he}},Cl=[{field:"name",header:"Project"},{field:"framework",header:"Framework",width:"w-32",cell:"badge",transform:"fallback:Unspecified"}],zl={content:{kind:"tabs",tabs:[{id:"logs",label:"Logs",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{ingestTraces:!1},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have logs drains configured."},toStreamItem:{displayName:"$item.name (Logs)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"logs",ingestTraces:!1}}}},{id:"traces",label:"Traces",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{ingestTraces:!0},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have traces drains configured."},toStreamItem:{displayName:"$item.name (Traces)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"traces",ingestTraces:!0}}}},{id:"analytics",label:"Analytics",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:Cl,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{drainType:"analytics"},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have analytics drains configured."},toStreamItem:{displayName:"$item.name (Analytics)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"analytics"}}}}]}}});var NA,xf;var zf=d(()=>{Cf();NA=["vercelApiToken"],xf={id:"vercel",name:"Vercel",capabilities:["native"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:NA,subtitle:"Forward your Vercel deployment logs, traces, and Web Analytics events directly to Sazabi for real-time analysis and alerting.",features:["Log forwarding","Trace forwarding","Web Analytics forwarding","Real-time streaming"],setupSkill:C,dashboard:{iconKey:"vercel",intakeSourceId:"vercel",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-enum-badge",header:"Type",width:"w-24",configField:"drainType",values:[{value:"logs",label:"Logs"},{value:"traces",label:"Traces"},{value:"analytics",label:"Analytics"}],legacyBooleanField:"ingestTraces",legacyTrueLabel:"Traces",legacyFalseLabel:"Logs",fallbackLabel:"N/A"}],actions:{submit:{validate:{kind:"source-action",actionId:"validate-token"}},list:{list:{kind:"source-action",actionId:"list-projects",itemsField:"projects"}}}}}});var En,jf,DF,NF,dr,LF,CF,LA,CA,xA,xF;var Ef=d(()=>{nI();cI();hI();dI();mI();II();$I();OI();PI();NI();xI();EI();KI();BI();JI();WI();ZI();tf();nf();lf();gf();bf();pf();ff();wf();Sf();Af();Lf();zf();En=[oI,aI,uI,sI,yI,vI,kI,_I,TI,DI,CI,jI,RI,GI,MI,qI,XI,ef,of,cf,hf,df,If,mf,$f,Of,Pf,Nf,xf],jf=En,DF=Object.fromEntries(jf.map((e)=>[e.id,e.sensitiveFields??[]])),NF=Object.fromEntries(jf.flatMap((e)=>[...Object.values(e.dashboard?.actions?.submit??{}),...Object.values(e.dashboard?.actions?.list??{}),...Object.values(e.dashboard?.actions?.prefetch??{})].flatMap((t)=>{let o=t.sensitiveInputFields??[];if(o.length===0)return[];return[["procedure"in t?t.procedure:`${e.id}.${t.actionId}`,o]]}))),dr=["vercel","cloudflare","railway","render","fly_io","netlify","supabase","digital_ocean","inngest","trigger_dev","temporal","mastra","neon","langchain","daytona","e2b","cloudwatch","convex","datadog","sentry","sentry_platform","openrouter","posthog","gcp","otel","fluent_bit","vector","grafana_alloy","otel_collector"],LF=En.map((e)=>({id:e.id,name:e.name,capabilities:e.capabilities})),CF=Object.fromEntries(En.map((e)=>[e.id,{name:e.name,setupSkill:e.setupSkill}])),LA={cloudflare:qc,cloudwatch:Xc,convex:Qc,digital_ocean:ol,fly_io:cl,gcp:ul,posthog:kl,render:Ol,sentry_platform:Pl,vercel:xl},CA={cloudflare:Wc,cloudwatch:Zc,convex:el,digital_ocean:nl,fly_io:ll,gcp:hl,posthog:$l,render:Sl,vercel:zl},xA={cloudflare:Yc,datadog:tl,daytona:rl,fluent_bit:al,grafana_alloy:sl,e2b:il,gcp:gl,inngest:dl,langchain:bl,mastra:yl,neon:ml,netlify:pl,openrouter:vl,otel:Il,otel_collector:fl,posthog:wl,railway:_l,sentry:Tl,supabase:Al,temporal:Dl,trigger_dev:Nl,vector:Ll},xF=En.map((e)=>({sourceId:e.id,name:e.name,capabilities:e.capabilities,setupAuthModes:e.auth,deliveryModes:e.delivery,hasDashboardMetadata:Boolean(e.dashboard),hasNativeFlow:Boolean(LA[e.id]),hasManualFlow:Boolean(xA[e.id]),hasStreamSelector:Boolean(CA[e.id]),lifecycleEligible:e.lifecycleEligible??!1,lifecycleSkipReason:e.lifecycleSkipReason}))});var Uf=d(()=>{Ef()});var jl=d(()=>{tI();Uf()});function m(e,t,o){function n(c,u){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let h=a.prototype,s=Object.keys(h);for(let g=0;g<s.length;g++){let b=s[g];if(!(b in c))c[b]=h[b].bind(c)}}let r=o?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(c){var u;let h=o?.Parent?new i:this;n(h,c),(u=h._zod).deferred??(u.deferred=[]);for(let s of h._zod.deferred)s();return h}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:(c)=>{if(o?.Parent&&c instanceof o.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}function ue(e){if(e)Object.assign(Ao,e);return Ao}var El,Ul,nt,qt,Ao;var br=d(()=>{El=Object.freeze({status:"aborted"});Ul=Symbol("zod_brand");nt=class nt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};qt=class qt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}};Ao={}});var w={};Qe(w,{unwrapMessage:()=>Do,uint8ArrayToHex:()=>iD,uint8ArrayToBase64url:()=>oD,uint8ArrayToBase64:()=>Ff,stringifyPrimitive:()=>k,slugify:()=>Fl,shallowClone:()=>Bl,safeExtend:()=>XA,required:()=>eD,randomString:()=>HA,propertyKeyTypes:()=>Co,promiseAllObject:()=>BA,primitiveTypes:()=>Hl,prefixIssues:()=>je,pick:()=>qA,partial:()=>QA,parsedType:()=>$,optionalKeys:()=>Ml,omit:()=>WA,objectClone:()=>KA,numKeys:()=>MA,nullish:()=>Dt,normalizeParams:()=>O,mergeDefs:()=>pt,merge:()=>ZA,jsonStringifyReplacer:()=>yr,joinValues:()=>I,issue:()=>pr,isPlainObject:()=>Lt,isObject:()=>Wt,hexToUint8Array:()=>nD,getSizableOrigin:()=>xo,getParsedType:()=>JA,getLengthableOrigin:()=>zo,getEnumValues:()=>No,getElementAtPath:()=>GA,floatSafeRemainder:()=>Kl,finalizeIssue:()=>Ce,extend:()=>YA,escapeRegex:()=>Me,esc:()=>Un,defineLazy:()=>G,createTransparentProxy:()=>VA,cloneDef:()=>FA,clone:()=>Pe,cleanRegex:()=>Lo,cleanEnum:()=>tD,captureStackTrace:()=>Rn,cached:()=>mr,base64urlToUint8Array:()=>rD,base64ToUint8Array:()=>Kf,assignProp:()=>Nt,assertNotEqual:()=>jA,assertNever:()=>UA,assertIs:()=>EA,assertEqual:()=>zA,assert:()=>RA,allowsEval:()=>Gl,aborted:()=>Ct,NUMBER_FORMAT_RANGES:()=>Jl,Class:()=>Gf,BIGINT_FORMAT_RANGES:()=>Vl});function zA(e){return e}function jA(e){return e}function EA(e){}function UA(e){throw Error("Unexpected value in exhaustive check")}function RA(e){}function No(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function I(e,t="|"){return e.map((o)=>k(o)).join(t)}function yr(e,t){if(typeof t==="bigint")return t.toString();return t}function mr(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function Dt(e){return e===null||e===void 0}function Lo(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Kl(e,t){let o=(e.toString().split(".")[1]||"").length,n=t.toString(),r=(n.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(n)){let u=n.match(/\d?e-(\d?)/);if(u?.[1])r=Number.parseInt(u[1])}let i=o>r?o:r,a=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return a%c/10**i}function G(e,t,o){let n=void 0;Object.defineProperty(e,t,{get(){if(n===Rf)return;if(n===void 0)n=Rf,n=o();return n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function KA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Nt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function pt(...e){let t={};for(let o of e){let n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function FA(e){return pt(e._zod.def)}function GA(e,t){if(!t)return e;return t.reduce((o,n)=>o?.[n],e)}function BA(e){let t=Object.keys(e),o=t.map((n)=>e[n]);return Promise.all(o).then((n)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=n[i];return r})}function HA(e=10){let o="";for(let n=0;n<e;n++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Un(e){return JSON.stringify(e)}function Fl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Wt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Lt(e){if(Wt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let o=t.prototype;if(Wt(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Bl(e){if(Lt(e))return{...e};if(Array.isArray(e))return[...e];return e}function MA(e){let t=0;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))t++;return t}function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,o){let n=new e._zod.constr(t??e._zod.def);if(!t||o?.parent)n._zod.parent=e;return n}function O(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function VA(e){let t;return new Proxy({},{get(o,n,r){return t??(t=e()),Reflect.get(t,n,r)},set(o,n,r,i){return t??(t=e()),Reflect.set(t,n,r,i)},has(o,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(o,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(o,n,r){return t??(t=e()),Reflect.defineProperty(t,n,r)}})}function k(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ml(e){return Object.keys(e).filter((t)=>{return e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional"})}function qA(e,t){let o=e._zod.def,n=o.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=pt(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;a[c]=o.shape[c]}return Nt(this,"shape",a),a},checks:[]});return Pe(e,i)}function WA(e,t){let o=e._zod.def,n=o.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=pt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete a[c]}return Nt(this,"shape",a),a},checks:[]});return Pe(e,i)}function YA(e,t){if(!Lt(t))throw Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=pt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Nt(this,"shape",i),i}});return Pe(e,r)}function XA(e,t){if(!Lt(t))throw Error("Invalid input to safeExtend: expected a plain object");let o=pt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nt(this,"shape",n),n}});return Pe(e,o)}function ZA(e,t){let o=pt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Nt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,o)}function QA(e,t,o){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=pt(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(o)for(let h in o){if(!(h in c))throw Error(`Unrecognized key: "${h}"`);if(!o[h])continue;u[h]=e?new e({type:"optional",innerType:c[h]}):c[h]}else for(let h in c)u[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return Nt(this,"shape",u),u},checks:[]});return Pe(t,a)}function eD(e,t,o){let n=pt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(o)for(let a in o){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!o[a])continue;i[a]=new e({type:"nonoptional",innerType:r[a]})}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return Nt(this,"shape",i),i}});return Pe(t,n)}function Ct(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function je(e,t){return t.map((o)=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function Do(e){return typeof e==="string"?e:e?.message}function Ce(e,t,o){let n={...e,path:e.path??[]};if(!e.message){let r=Do(e.inst?._zod.def?.error?.(e))??Do(t?.error?.(e))??Do(o.customError?.(e))??Do(o.localeError?.(e))??"Invalid input";n.message=r}if(delete n.inst,delete n.continue,!t?.reportInput)delete n.input;return n}function xo(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function zo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function $(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function pr(...e){let[t,o,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:o,inst:n};return{...t}}function tD(e){return Object.entries(e).filter(([t,o])=>{return Number.isNaN(Number.parseInt(t,10))}).map((t)=>t[1])}function Kf(e){let t=atob(e),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return o}function Ff(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function rD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return Kf(t+o)}function oD(e){return Ff(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function nD(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)o[n/2]=Number.parseInt(t.slice(n,n+2),16);return o}function iD(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class Gf{constructor(...e){}}var Rf,Rn,Gl,JA=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Co,Hl,Jl,Vl;var x=d(()=>{Rf=Symbol("evaluating");Rn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Gl=mr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});Co=new Set(["string","number","symbol"]),Hl=new Set(["string","number","bigint","boolean","symbol","undefined"]);Jl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function Eo(e,t=(o)=>o.message){let o={},n=[];for(let r of e.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r));else n.push(t(r));return{formErrors:n,fieldErrors:o}}function Uo(e,t=(o)=>o.message){let o={_errors:[]},n=(r)=>{for(let i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>n({issues:a}));else if(i.code==="invalid_key")n({issues:i.issues});else if(i.code==="invalid_element")n({issues:i.issues});else if(i.path.length===0)o._errors.push(t(i));else{let a=o,c=0;while(c<i.path.length){let u=i.path[c];if(c!==i.path.length-1)a[u]=a[u]||{_errors:[]};else a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(i));a=a[u],c++}}};return n(e),o}function ql(e,t=(o)=>o.message){let o={errors:[]},n=(r,i=[])=>{var a,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((h)=>n({issues:h},u.path));else if(u.code==="invalid_key")n({issues:u.issues},u.path);else if(u.code==="invalid_element")n({issues:u.issues},u.path);else{let h=[...i,...u.path];if(h.length===0){o.errors.push(t(u));continue}let s=o,g=0;while(g<h.length){let b=h[g],y=g===h.length-1;if(typeof b==="string")s.properties??(s.properties={}),(a=s.properties)[b]??(a[b]={errors:[]}),s=s.properties[b];else s.items??(s.items=[]),(c=s.items)[b]??(c[b]={errors:[]}),s=s.items[b];if(y)s.errors.push(t(u));g++}}};return n(e),o}function Hf(e){let t=[],o=e.map((n)=>typeof n==="object"?n.key:n);for(let n of o)if(typeof n==="number")t.push(`[${n}]`);else if(typeof n==="symbol")t.push(`[${JSON.stringify(String(n))}]`);else if(/[^\w$]/.test(n))t.push(`[${JSON.stringify(n)}]`);else{if(t.length)t.push(".");t.push(n)}return t.join("")}function Wl(e){let t=[],o=[...e.issues].sort((n,r)=>(n.path??[]).length-(r.path??[]).length);for(let n of o)if(t.push(`✖ ${n.message}`),n.path?.length)t.push(` → at ${Hf(n.path)}`);return t.join(`
|
|
4243
|
+
`)}var Bf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jo,xe;var Yl=d(()=>{br();x();jo=m("$ZodError",Bf),xe=m("$ZodError",Bf,{Parent:Error})});var vr=(e)=>(t,o,n,r)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new nt;if(a.issues.length){let c=new(r?.Err??e)(a.issues.map((u)=>Ce(u,i,ue())));throw Rn(c,r?.callee),c}return a.value},Kn,Ir=(e)=>async(t,o,n,r)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(r?.Err??e)(a.issues.map((u)=>Ce(u,i,ue())));throw Rn(c,r?.callee),c}return a.value},Fn,fr=(e)=>(t,o,n)=>{let r=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise)throw new nt;return i.issues.length?{success:!1,error:new(e??jo)(i.issues.map((a)=>Ce(a,r,ue())))}:{success:!0,data:i.value}},Xl,kr=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>Ce(a,r,ue())))}:{success:!0,data:i.value}},Zl,Gn=(e)=>(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return vr(e)(t,o,r)},cD,Bn=(e)=>(t,o,n)=>{return vr(e)(t,o,n)},lD,Hn=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ir(e)(t,o,r)},uD,Mn=(e)=>async(t,o,n)=>{return Ir(e)(t,o,n)},hD,Jn=(e)=>(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fr(e)(t,o,r)},gD,Vn=(e)=>(t,o,n)=>{return fr(e)(t,o,n)},sD,qn=(e)=>async(t,o,n)=>{let r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kr(e)(t,o,r)},dD,Wn=(e)=>async(t,o,n)=>{return kr(e)(t,o,n)},bD;var Ql=d(()=>{br();Yl();x();Kn=vr(xe),Fn=Ir(xe),Xl=fr(xe),Zl=kr(xe),cD=Gn(xe),lD=Bn(xe),uD=Hn(xe),hD=Mn(xe),gD=Jn(xe),sD=Vn(xe),dD=qn(xe),bD=Wn(xe)});var Je={};Qe(Je,{xid:()=>ou,uuid7:()=>vD,uuid6:()=>pD,uuid4:()=>mD,uuid:()=>Yt,uppercase:()=>Tu,unicodeEmail:()=>Mf,undefined:()=>Ou,ulid:()=>ru,time:()=>vu,string:()=>fu,sha512_hex:()=>RD,sha512_base64url:()=>FD,sha512_base64:()=>KD,sha384_hex:()=>jD,sha384_base64url:()=>UD,sha384_base64:()=>ED,sha256_hex:()=>CD,sha256_base64url:()=>zD,sha256_base64:()=>xD,sha1_hex:()=>DD,sha1_base64url:()=>LD,sha1_base64:()=>ND,rfc5322Email:()=>fD,number:()=>Ro,null:()=>_u,nanoid:()=>iu,md5_hex:()=>TD,md5_base64url:()=>AD,md5_base64:()=>PD,mac:()=>su,lowercase:()=>Su,ksuid:()=>nu,ipv6:()=>gu,ipv4:()=>hu,integer:()=>$u,idnEmail:()=>kD,html5Email:()=>ID,hostname:()=>_D,hex:()=>SD,guid:()=>cu,extendedDuration:()=>yD,emoji:()=>uu,email:()=>lu,e164:()=>mu,duration:()=>au,domain:()=>OD,datetime:()=>Iu,date:()=>pu,cuid2:()=>tu,cuid:()=>eu,cidrv6:()=>bu,cidrv4:()=>du,browserEmail:()=>$D,boolean:()=>wu,bigint:()=>ku,base64url:()=>Yn,base64:()=>yu});function uu(){return new RegExp(wD,"u")}function Vf(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vu(e){return new RegExp(`^${Vf(e)}$`)}function Iu(e){let t=Vf({precision:e.precision}),o=["Z"];if(e.local)o.push("");if(e.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${o.join("|")})`;return new RegExp(`^${Jf}T(?:${n})$`)}function Ko(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var eu,tu,ru,ou,nu,iu,au,yD,cu,Yt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},mD,pD,vD,lu,ID,fD,Mf,kD,$D,wD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hu,gu,su=(e)=>{let t=Me(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},du,bu,yu,Yn,_D,OD,mu,Jf="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",pu,fu=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ku,$u,Ro,wu,_u,Ou,Su,Tu,SD,TD,PD,AD,DD,ND,LD,CD,xD,zD,jD,ED,UD,RD,KD,FD;var Xn=d(()=>{x();eu=/^[cC][^\s-]{8,}$/,tu=/^[0-9a-z]+$/,ru=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ou=/^[0-9a-vA-V]{20}$/,nu=/^[A-Za-z0-9]{27}$/,iu=/^[a-zA-Z0-9_-]{21}$/,au=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mD=Yt(4),pD=Yt(6),vD=Yt(7),lu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ID=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fD=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Mf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kD=Mf,$D=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;hu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,du=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yn=/^[A-Za-z0-9_-]*$/,_D=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,OD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mu=/^\+[1-9]\d{6,14}$/,pu=new RegExp(`^${Jf}$`);ku=/^-?\d+n?$/,$u=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,wu=/^(?:true|false)$/i,_u=/^null$/i,Ou=/^undefined$/i,Su=/^[^A-Z]*$/,Tu=/^[^a-z]*$/,SD=/^[0-9a-fA-F]*$/;TD=/^[0-9a-fA-F]{32}$/,PD=Ko(22,"=="),AD=Fo(22),DD=/^[0-9a-fA-F]{40}$/,ND=Ko(27,"="),LD=Fo(27),CD=/^[0-9a-fA-F]{64}$/,xD=Ko(43,"="),zD=Fo(43),jD=/^[0-9a-fA-F]{96}$/,ED=Ko(64,""),UD=Fo(64),RD=/^[0-9a-fA-F]{128}$/,KD=Ko(86,"=="),FD=Fo(86)});function qf(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues))}var te,Wf,Zn,Qn,Pu,Au,Du,Nu,Lu,Cu,xu,zu,ju,$r,Eu,Uu,Ru,Ku,Fu,Gu,Bu,Hu,Mu;var ei=d(()=>{br();Xn();x();te=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Wf={number:"number",bigint:"bigint",object:"date"},Zn=m("$ZodCheckLessThan",(e,t)=>{te.init(e,t);let o=Wf[typeof t.value];e._zod.onattach.push((n)=>{let r=n._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:o,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qn=m("$ZodCheckGreaterThan",(e,t)=>{te.init(e,t);let o=Wf[typeof t.value];e._zod.onattach.push((n)=>{let r=n._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:o,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pu=m("$ZodCheckMultipleOf",(e,t)=>{te.init(e,t),e._zod.onattach.push((o)=>{var n;(n=o._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(o)=>{if(typeof o.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%t.value===BigInt(0):Kl(o.value,t.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Au=m("$ZodCheckNumberFormat",(e,t)=>{te.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),n=o?"int":"number",[r,i]=Jl[t.format];e._zod.onattach.push((a)=>{let c=a._zod.bag;if(c.format=t.format,c.minimum=r,c.maximum=i,o)c.pattern=$u}),e._zod.check=(a)=>{let c=a.value;if(o){if(!Number.isInteger(c)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<r)a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(c>i)a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Du=m("$ZodCheckBigIntFormat",(e,t)=>{te.init(e,t);let[o,n]=Vl[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=o,i.maximum=n}),e._zod.check=(r)=>{let i=r.value;if(i<o)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(i>n)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Nu=m("$ZodCheckMaxSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let r=n.value;if(r.size<=t.maximum)return;n.issues.push({origin:xo(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lu=m("$ZodCheckMinSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let r=n.value;if(r.size>=t.minimum)return;n.issues.push({origin:xo(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cu=m("$ZodCheckSizeEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.size!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(n)=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:xo(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xu=m("$ZodCheckMaxLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let r=n.value;if(r.length<=t.maximum)return;let a=zo(r);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zu=m("$ZodCheckMinLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let r=n.value;if(r.length>=t.minimum)return;let a=zo(r);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ju=m("$ZodCheckLengthEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=(n)=>{let r=n.value;return!Dt(r)&&r.length!==void 0}),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(n)=>{let r=n.value,i=r.length;if(i===t.length)return;let a=zo(r),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$r=m("$ZodCheckStringFormat",(e,t)=>{var o,n;if(te.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(o=e._zod).check??(o.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Eu=m("$ZodCheckRegex",(e,t)=>{$r.init(e,t),e._zod.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Uu=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Su),$r.init(e,t)}),Ru=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tu),$r.init(e,t)}),Ku=m("$ZodCheckIncludes",(e,t)=>{te.init(e,t);let o=Me(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Fu=m("$ZodCheckStartsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`^${Me(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Gu=m("$ZodCheckEndsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`.*${Me(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});Bu=m("$ZodCheckProperty",(e,t)=>{te.init(e,t),e._zod.check=(o)=>{let n=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then((r)=>qf(r,o,t.property));qf(n,o,t.property);return}}),Hu=m("$ZodCheckMimeType",(e,t)=>{te.init(e,t);let o=new Set(t.mime);e._zod.onattach.push((n)=>{n._zod.bag.mime=t.mime}),e._zod.check=(n)=>{if(o.has(n.value.type))return;n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),Mu=m("$ZodCheckOverwrite",(e,t)=>{te.init(e,t),e._zod.check=(o)=>{o.value=t.tx(o.value)}})});class ti{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
|
|
4127
4244
|
`).filter((i)=>i),n=Math.min(...o.map((i)=>i.length-i.trimStart().length)),r=o.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of r)this.content.push(i)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[""]).map((r)=>` ${r}`)];return new e(...t,n.join(`
|
|
4128
|
-
`))}}var Mu;var Vu=s(()=>{Mu={major:4,minor:3,patch:6}});function yh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function lk(e){if(!Yn.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return yh(o)}function uk(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[n]=o;if(!n)return!1;let r=JSON.parse(atob(n));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}function Xf(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues));t.value[o]=e.value}function ai(e,t,o,n,r){if(e.issues.length){if(r&&!(o in n))return;t.issues.push(...je(o,e.issues))}if(e.value===void 0){if(o in n)t.value[o]=void 0}else t.value[o]=e.value}function hk(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let o=Hl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function gk(e,t,o,n,r,i){let a=[],c=r.keySet,u=r.catchall._zod,h=u.def.type,d=u.optout==="optional";for(let g in t){if(c.has(g))continue;if(h==="never"){a.push(g);continue}let b=u.run({value:t[g],issues:[]},n);if(b instanceof Promise)e.push(b.then((y)=>ai(y,o,g,t,d)));else ai(b,o,g,t,d)}if(a.length)o.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i});if(!e.length)return o;return Promise.all(e).then(()=>{return o})}function Zf(e,t,o,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!Ct(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map((i)=>i.issues.map((a)=>Ce(a,n,ue())))}),t}function Qf(e,t,o,n){let r=e.filter((i)=>i.issues.length===0);if(r.length===1)return t.value=r[0].value,t;if(r.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map((i)=>i.issues.map((a)=>Ce(a,n,ue())))});else t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1});return t}function qu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Lt(e)&&Lt(t)){let o=Object.keys(t),n=Object.keys(e).filter((i)=>o.indexOf(i)!==-1),r={...e,...t};for(let i of n){let a=qu(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let n=0;n<e.length;n++){let r=e[n],i=t[n],a=qu(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};o.push(a.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function ek(e,t,o){let n=new Map,r;for(let c of t.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys){if(!n.has(u))n.set(u,{});n.get(u).l=!0}}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let u of c.keys){if(!n.has(u))n.set(u,{});n.get(u).r=!0}else e.issues.push(c);let i=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&r)e.issues.push({...r,keys:i});if(Ct(e))return e;let a=qu(t.value,o.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function ri(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues));t.value[o]=e.value}function tk(e,t,o,n,r,i,a){if(e.issues.length)if(Co.has(typeof n))o.issues.push(...je(n,e.issues));else o.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((c)=>Ce(c,a,ue()))});if(t.issues.length)if(Co.has(typeof n))o.issues.push(...je(n,t.issues));else o.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:n,issues:t.issues.map((c)=>Ce(c,a,ue()))});o.value.set(e.value,t.value)}function rk(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}function ok(e,t){if(e.issues.length&&t===void 0)return{issues:[],value:void 0};return e}function nk(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}function ik(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function oi(e,t,o){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},o)}function ni(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>ii(e,i,t.out,o));return ii(e,r,t.out,o)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>ii(e,i,t.in,o));return ii(e,r,t.in,o)}}function ii(e,t,o,n){if(e.issues.length)return e.aborted=!0,e;return o._zod.run({value:t,issues:e.issues},n)}function ak(e){return e.value=Object.freeze(e.value),e}function ck(e,t,o,n){if(!e){let r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)r.params=n._zod.def.params;t.issues.push(pr(r))}}var E,Xt,Q,Wu,Yu,Xu,Zu,Qu,eh,th,rh,oh,nh,ih,ah,ch,lh,uh,hh,gh,dh,sh,bh,mh,ph,vh,Ih,fh,ci,kh,Bo,li,$h,wh,_h,Oh,Sh,Th,Ph,Ah,Dh,Nh,dk,Lh,Fo,Ch,xh,zh,ui,jh,Eh,Uh,Rh,Kh,Gh,Bh,hi,Fh,Jh,Hh,Mh,Vh,qh,Wh,Yh,Xh,Jo,Zh,Qh,eg,tg,rg,og;var ng=s(()=>{ei();br();Ql();Xn();x();Vu();x();E=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mu;let n=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))n.unshift(e);for(let r of n)for(let i of r._zod.onattach)i(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,c,u)=>{let h=Ct(a),d;for(let g of c){if(g._zod.def.when){if(!g._zod.def.when(a))continue}else if(h)continue;let b=a.issues.length,y=g._zod.check(a);if(y instanceof Promise&&u?.async===!1)throw new nt;if(d||y instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await y,a.issues.length===b)return;if(!h)h=Ct(a,b)});else{if(a.issues.length===b)continue;if(!h)h=Ct(a,b)}}if(d)return d.then(()=>{return a});return a},i=(a,c,u)=>{if(Ct(a))return a.aborted=!0,a;let h=r(c,n,u);if(h instanceof Promise){if(u.async===!1)throw new nt;return h.then((d)=>e._zod.parse(d,u))}return e._zod.parse(h,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let h=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(h instanceof Promise)return h.then((d)=>{return i(d,a,c)});return i(h,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new nt;return u.then((h)=>r(h,n,c))}return r(u,n,c)}}B(e,"~standard",()=>({validate:(r)=>{try{let i=Xl(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Zl(e,r).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Xt=m("$ZodString",(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fu(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch(r){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Q=m("$ZodStringFormat",(e,t)=>{$r.init(e,t),Xt.init(e,t)}),Wu=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cu),Q.init(e,t)}),Yu=m("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Yt(n))}else t.pattern??(t.pattern=Yt());Q.init(e,t)}),Xu=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lu),Q.init(e,t)}),Zu=m("$ZodURL",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{try{let n=o.value.trim(),r=new URL(n);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})}if(t.normalize)o.value=r.href;else o.value=n;return}catch(n){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Qu=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uu()),Q.init(e,t)}),eh=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iu),Q.init(e,t)}),th=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eu),Q.init(e,t)}),rh=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tu),Q.init(e,t)}),oh=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ru),Q.init(e,t)}),nh=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ou),Q.init(e,t)}),ih=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nu),Q.init(e,t)}),ah=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Iu(t)),Q.init(e,t)}),ch=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=pu),Q.init(e,t)}),lh=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vu(t)),Q.init(e,t)}),uh=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=au),Q.init(e,t)}),hh=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hu),Q.init(e,t),e._zod.bag.format="ipv4"}),gh=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gu),Q.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),dh=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=du(t.delimiter)),Q.init(e,t),e._zod.bag.format="mac"}),sh=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=su),Q.init(e,t)}),bh=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bu),Q.init(e,t),e._zod.check=(o)=>{let n=o.value.split("/");try{if(n.length!==2)throw Error();let[r,i]=n;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});mh=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yu),Q.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(o)=>{if(yh(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});ph=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yn),Q.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(o)=>{if(lk(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),vh=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=mu),Q.init(e,t)});Ih=m("$ZodJWT",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{if(uk(o.value,t.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),fh=m("$ZodCustomStringFormat",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{if(t.fn(o.value))return;o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),ci=m("$ZodNumber",(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ro,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Number(o.value)}catch(a){}let r=o.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return o;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),o}}),kh=m("$ZodNumberFormat",(e,t)=>{Au.init(e,t),ci.init(e,t)}),Bo=m("$ZodBoolean",(e,t)=>{E.init(e,t),e._zod.pattern=wu,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Boolean(o.value)}catch(i){}let r=o.value;if(typeof r==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),o}}),li=m("$ZodBigInt",(e,t)=>{E.init(e,t),e._zod.pattern=ku,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch(r){}if(typeof o.value==="bigint")return o;return o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),$h=m("$ZodBigIntFormat",(e,t)=>{Du.init(e,t),li.init(e,t)}),wh=m("$ZodSymbol",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(typeof r==="symbol")return o;return o.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),o}}),_h=m("$ZodUndefined",(e,t)=>{E.init(e,t),e._zod.pattern=Ou,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(o,n)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),o}}),Oh=m("$ZodNull",(e,t)=>{E.init(e,t),e._zod.pattern=_u,e._zod.values=new Set([null]),e._zod.parse=(o,n)=>{let r=o.value;if(r===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),o}}),Sh=m("$ZodAny",(e,t)=>{E.init(e,t),e._zod.parse=(o)=>o}),Th=m("$ZodUnknown",(e,t)=>{E.init(e,t),e._zod.parse=(o)=>o}),Ph=m("$ZodNever",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{return o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o}}),Ah=m("$ZodVoid",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),o}}),Dh=m("$ZodDate",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=new Date(o.value)}catch(c){}let r=o.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return o;return o.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),o}});Nh=m("$ZodArray",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),o;o.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let c=r[a],u=t.element._zod.run({value:c,issues:[]},n);if(u instanceof Promise)i.push(u.then((h)=>Xf(h,o,a)));else Xf(u,o,a)}if(i.length)return Promise.all(i).then(()=>o);return o}});dk=m("$ZodObject",(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}let n=mr(()=>hk(t));B(e._zod,"propValues",()=>{let c=t.shape,u={};for(let h in c){let d=c[h]._zod;if(d.values){u[h]??(u[h]=new Set);for(let g of d.values)u[h].add(g)}}return u});let r=Wt,i=t.catchall,a;e._zod.parse=(c,u)=>{a??(a=n.value);let h=c.value;if(!r(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};let d=[],g=a.shape;for(let b of a.keys){let y=g[b],_=y._zod.optout==="optional",S=y._zod.run({value:h[b],issues:[]},u);if(S instanceof Promise)d.push(S.then((J)=>ai(J,c,b,h,_)));else ai(S,c,b,h,_)}if(!i)return d.length?Promise.all(d).then(()=>c):c;return gk(d,h,c,u,n.value,e)}}),Lh=m("$ZodObjectJIT",(e,t)=>{dk.init(e,t);let o=e._zod.parse,n=mr(()=>hk(t)),r=(b)=>{let y=new ti(["shape","payload","ctx"]),_=n.value,S=(oe)=>{let pe=Un(oe);return`shape[${pe}]._zod.run({ value: input[${pe}], issues: [] }, ctx)`};y.write("const input = payload.value;");let J=Object.create(null),G=0;for(let oe of _.keys)J[oe]=`key_${G++}`;y.write("const newResult = {};");for(let oe of _.keys){let pe=J[oe],Te=Un(oe),dT=b[oe]?._zod?.optout==="optional";if(y.write(`const ${pe} = ${S(oe)};`),dT)y.write(`
|
|
4245
|
+
`))}}var Ju;var Vu=d(()=>{Ju={major:4,minor:3,patch:6}});function yh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function lk(e){if(!Yn.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return yh(o)}function uk(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[n]=o;if(!n)return!1;let r=JSON.parse(atob(n));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}function Xf(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues));t.value[o]=e.value}function ai(e,t,o,n,r){if(e.issues.length){if(r&&!(o in n))return;t.issues.push(...je(o,e.issues))}if(e.value===void 0){if(o in n)t.value[o]=void 0}else t.value[o]=e.value}function hk(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let o=Ml(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function gk(e,t,o,n,r,i){let a=[],c=r.keySet,u=r.catchall._zod,h=u.def.type,s=u.optout==="optional";for(let g in t){if(c.has(g))continue;if(h==="never"){a.push(g);continue}let b=u.run({value:t[g],issues:[]},n);if(b instanceof Promise)e.push(b.then((y)=>ai(y,o,g,t,s)));else ai(b,o,g,t,s)}if(a.length)o.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i});if(!e.length)return o;return Promise.all(e).then(()=>{return o})}function Zf(e,t,o,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!Ct(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map((i)=>i.issues.map((a)=>Ce(a,n,ue())))}),t}function Qf(e,t,o,n){let r=e.filter((i)=>i.issues.length===0);if(r.length===1)return t.value=r[0].value,t;if(r.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map((i)=>i.issues.map((a)=>Ce(a,n,ue())))});else t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1});return t}function qu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Lt(e)&&Lt(t)){let o=Object.keys(t),n=Object.keys(e).filter((i)=>o.indexOf(i)!==-1),r={...e,...t};for(let i of n){let a=qu(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let n=0;n<e.length;n++){let r=e[n],i=t[n],a=qu(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};o.push(a.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function ek(e,t,o){let n=new Map,r;for(let c of t.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys){if(!n.has(u))n.set(u,{});n.get(u).l=!0}}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let u of c.keys){if(!n.has(u))n.set(u,{});n.get(u).r=!0}else e.issues.push(c);let i=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&r)e.issues.push({...r,keys:i});if(Ct(e))return e;let a=qu(t.value,o.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function ri(e,t,o){if(e.issues.length)t.issues.push(...je(o,e.issues));t.value[o]=e.value}function tk(e,t,o,n,r,i,a){if(e.issues.length)if(Co.has(typeof n))o.issues.push(...je(n,e.issues));else o.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((c)=>Ce(c,a,ue()))});if(t.issues.length)if(Co.has(typeof n))o.issues.push(...je(n,t.issues));else o.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:n,issues:t.issues.map((c)=>Ce(c,a,ue()))});o.value.set(e.value,t.value)}function rk(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}function ok(e,t){if(e.issues.length&&t===void 0)return{issues:[],value:void 0};return e}function nk(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}function ik(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function oi(e,t,o){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},o)}function ni(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>ii(e,i,t.out,o));return ii(e,r,t.out,o)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>ii(e,i,t.in,o));return ii(e,r,t.in,o)}}function ii(e,t,o,n){if(e.issues.length)return e.aborted=!0,e;return o._zod.run({value:t,issues:e.issues},n)}function ak(e){return e.value=Object.freeze(e.value),e}function ck(e,t,o,n){if(!e){let r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)r.params=n._zod.def.params;t.issues.push(pr(r))}}var E,Xt,Q,Wu,Yu,Xu,Zu,Qu,eh,th,rh,oh,nh,ih,ah,ch,lh,uh,hh,gh,sh,dh,bh,mh,ph,vh,Ih,fh,ci,kh,Go,li,$h,wh,_h,Oh,Sh,Th,Ph,Ah,Dh,Nh,sk,Lh,Bo,Ch,xh,zh,ui,jh,Eh,Uh,Rh,Kh,Fh,Gh,hi,Bh,Hh,Mh,Jh,Vh,qh,Wh,Yh,Xh,Ho,Zh,Qh,eg,tg,rg,og;var ng=d(()=>{ei();br();Ql();Xn();x();Vu();x();E=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ju;let n=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))n.unshift(e);for(let r of n)for(let i of r._zod.onattach)i(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,c,u)=>{let h=Ct(a),s;for(let g of c){if(g._zod.def.when){if(!g._zod.def.when(a))continue}else if(h)continue;let b=a.issues.length,y=g._zod.check(a);if(y instanceof Promise&&u?.async===!1)throw new nt;if(s||y instanceof Promise)s=(s??Promise.resolve()).then(async()=>{if(await y,a.issues.length===b)return;if(!h)h=Ct(a,b)});else{if(a.issues.length===b)continue;if(!h)h=Ct(a,b)}}if(s)return s.then(()=>{return a});return a},i=(a,c,u)=>{if(Ct(a))return a.aborted=!0,a;let h=r(c,n,u);if(h instanceof Promise){if(u.async===!1)throw new nt;return h.then((s)=>e._zod.parse(s,u))}return e._zod.parse(h,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let h=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(h instanceof Promise)return h.then((s)=>{return i(s,a,c)});return i(h,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new nt;return u.then((h)=>r(h,n,c))}return r(u,n,c)}}G(e,"~standard",()=>({validate:(r)=>{try{let i=Xl(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Zl(e,r).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Xt=m("$ZodString",(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fu(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch(r){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Q=m("$ZodStringFormat",(e,t)=>{$r.init(e,t),Xt.init(e,t)}),Wu=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cu),Q.init(e,t)}),Yu=m("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Yt(n))}else t.pattern??(t.pattern=Yt());Q.init(e,t)}),Xu=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lu),Q.init(e,t)}),Zu=m("$ZodURL",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{try{let n=o.value.trim(),r=new URL(n);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})}if(t.normalize)o.value=r.href;else o.value=n;return}catch(n){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Qu=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uu()),Q.init(e,t)}),eh=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iu),Q.init(e,t)}),th=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eu),Q.init(e,t)}),rh=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tu),Q.init(e,t)}),oh=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ru),Q.init(e,t)}),nh=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ou),Q.init(e,t)}),ih=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nu),Q.init(e,t)}),ah=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Iu(t)),Q.init(e,t)}),ch=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=pu),Q.init(e,t)}),lh=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vu(t)),Q.init(e,t)}),uh=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=au),Q.init(e,t)}),hh=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hu),Q.init(e,t),e._zod.bag.format="ipv4"}),gh=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gu),Q.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),sh=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=su(t.delimiter)),Q.init(e,t),e._zod.bag.format="mac"}),dh=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=du),Q.init(e,t)}),bh=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bu),Q.init(e,t),e._zod.check=(o)=>{let n=o.value.split("/");try{if(n.length!==2)throw Error();let[r,i]=n;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});mh=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yu),Q.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(o)=>{if(yh(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});ph=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yn),Q.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(o)=>{if(lk(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),vh=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=mu),Q.init(e,t)});Ih=m("$ZodJWT",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{if(uk(o.value,t.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),fh=m("$ZodCustomStringFormat",(e,t)=>{Q.init(e,t),e._zod.check=(o)=>{if(t.fn(o.value))return;o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),ci=m("$ZodNumber",(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ro,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Number(o.value)}catch(a){}let r=o.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return o;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),o}}),kh=m("$ZodNumberFormat",(e,t)=>{Au.init(e,t),ci.init(e,t)}),Go=m("$ZodBoolean",(e,t)=>{E.init(e,t),e._zod.pattern=wu,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Boolean(o.value)}catch(i){}let r=o.value;if(typeof r==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),o}}),li=m("$ZodBigInt",(e,t)=>{E.init(e,t),e._zod.pattern=ku,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch(r){}if(typeof o.value==="bigint")return o;return o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),$h=m("$ZodBigIntFormat",(e,t)=>{Du.init(e,t),li.init(e,t)}),wh=m("$ZodSymbol",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(typeof r==="symbol")return o;return o.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),o}}),_h=m("$ZodUndefined",(e,t)=>{E.init(e,t),e._zod.pattern=Ou,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(o,n)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),o}}),Oh=m("$ZodNull",(e,t)=>{E.init(e,t),e._zod.pattern=_u,e._zod.values=new Set([null]),e._zod.parse=(o,n)=>{let r=o.value;if(r===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),o}}),Sh=m("$ZodAny",(e,t)=>{E.init(e,t),e._zod.parse=(o)=>o}),Th=m("$ZodUnknown",(e,t)=>{E.init(e,t),e._zod.parse=(o)=>o}),Ph=m("$ZodNever",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{return o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o}}),Ah=m("$ZodVoid",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),o}}),Dh=m("$ZodDate",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=new Date(o.value)}catch(c){}let r=o.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return o;return o.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),o}});Nh=m("$ZodArray",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),o;o.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let c=r[a],u=t.element._zod.run({value:c,issues:[]},n);if(u instanceof Promise)i.push(u.then((h)=>Xf(h,o,a)));else Xf(u,o,a)}if(i.length)return Promise.all(i).then(()=>o);return o}});sk=m("$ZodObject",(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}let n=mr(()=>hk(t));G(e._zod,"propValues",()=>{let c=t.shape,u={};for(let h in c){let s=c[h]._zod;if(s.values){u[h]??(u[h]=new Set);for(let g of s.values)u[h].add(g)}}return u});let r=Wt,i=t.catchall,a;e._zod.parse=(c,u)=>{a??(a=n.value);let h=c.value;if(!r(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};let s=[],g=a.shape;for(let b of a.keys){let y=g[b],_=y._zod.optout==="optional",S=y._zod.run({value:h[b],issues:[]},u);if(S instanceof Promise)s.push(S.then((H)=>ai(H,c,b,h,_)));else ai(S,c,b,h,_)}if(!i)return s.length?Promise.all(s).then(()=>c):c;return gk(s,h,c,u,n.value,e)}}),Lh=m("$ZodObjectJIT",(e,t)=>{sk.init(e,t);let o=e._zod.parse,n=mr(()=>hk(t)),r=(b)=>{let y=new ti(["shape","payload","ctx"]),_=n.value,S=(oe)=>{let pe=Un(oe);return`shape[${pe}]._zod.run({ value: input[${pe}], issues: [] }, ctx)`};y.write("const input = payload.value;");let H=Object.create(null),F=0;for(let oe of _.keys)H[oe]=`key_${F++}`;y.write("const newResult = {};");for(let oe of _.keys){let pe=H[oe],Te=Un(oe),sT=b[oe]?._zod?.optout==="optional";if(y.write(`const ${pe} = ${S(oe)};`),sT)y.write(`
|
|
4129
4246
|
if (${pe}.issues.length) {
|
|
4130
4247
|
if (${Te} in input) {
|
|
4131
4248
|
payload.issues = payload.issues.concat(${pe}.issues.map(iss => ({
|
|
@@ -4159,9 +4276,9 @@ sinks:
|
|
|
4159
4276
|
newResult[${Te}] = ${pe}.value;
|
|
4160
4277
|
}
|
|
4161
4278
|
|
|
4162
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");let le=y.compile();return(oe,pe)=>le(b,oe,pe)},i,a=Wt,c=!Ao.jitless,h=c&&Bl.value,d=t.catchall,g;e._zod.parse=(b,y)=>{g??(g=n.value);let _=b.value;if(!a(_))return b.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),b;if(c&&h&&y?.async===!1&&y.jitless!==!0){if(!i)i=r(t.shape);if(b=i(b,y),!d)return b;return gk([],_,b,y,g,e)}return o(b,y)}});Fo=m("$ZodUnion",(e,t)=>{E.init(e,t),B(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),B(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),B(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),B(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>Lo(i.source)).join("|")})$`)}return});let o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(o)return n(r,i);let a=!1,c=[];for(let u of t.options){let h=u._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)c.push(h),a=!0;else{if(h.issues.length===0)return h;c.push(h)}}if(!a)return Zf(c,r,e,i);return Promise.all(c).then((u)=>{return Zf(u,r,e,i)})}});Ch=m("$ZodXor",(e,t)=>{Fo.init(e,t),t.inclusive=!1;let o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(o)return n(r,i);let a=!1,c=[];for(let u of t.options){let h=u._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)c.push(h),a=!0;else c.push(h)}if(!a)return Qf(c,r,e,i);return Promise.all(c).then((u)=>{return Qf(u,r,e,i)})}}),xh=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Fo.init(e,t);let o=e._zod.parse;B(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,u]of Object.entries(a)){if(!r[c])r[c]=new Set;for(let h of u)r[c].add(h)}}return r});let n=mr(()=>{let r=t.options,i=new Map;for(let a of r){let c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let u of c){if(i.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!Wt(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let c=n.value.get(a?.[t.discriminator]);if(c)return c._zod.run(r,i);if(t.unionFallback)return o(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r}}),zh=m("$ZodIntersection",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([u,h])=>{return ek(o,u,h)});return ek(o,i,a)}});ui=m("$ZodTuple",(e,t)=>{E.init(e,t);let o=t.items;e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],c=[...o].reverse().findIndex((d)=>d._zod.optin!=="optional"),u=c===-1?0:o.length-c;if(!t.rest){let d=i.length>o.length,g=i.length<u-1;if(d||g)return n.issues.push({...d?{code:"too_big",maximum:o.length,inclusive:!0}:{code:"too_small",minimum:o.length},input:i,inst:e,origin:"array"}),n}let h=-1;for(let d of o){if(h++,h>=i.length){if(h>=u)continue}let g=d._zod.run({value:i[h],issues:[]},r);if(g instanceof Promise)a.push(g.then((b)=>ri(b,n,h)));else ri(g,n,h)}if(t.rest){let d=i.slice(o.length);for(let g of d){h++;let b=t.rest._zod.run({value:g,issues:[]},r);if(b instanceof Promise)a.push(b.then((y)=>ri(y,n,h)));else ri(b,n,h)}}if(a.length)return Promise.all(a).then(()=>n);return n}});jh=m("$ZodRecord",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!Lt(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a){o.value={};let c=new Set;for(let h of a)if(typeof h==="string"||typeof h==="number"||typeof h==="symbol"){c.add(typeof h==="number"?h.toString():h);let d=t.valueType._zod.run({value:r[h],issues:[]},n);if(d instanceof Promise)i.push(d.then((g)=>{if(g.issues.length)o.issues.push(...je(h,g.issues));o.value[h]=g.value}));else{if(d.issues.length)o.issues.push(...je(h,d.issues));o.value[h]=d.value}}let u;for(let h in r)if(!c.has(h))u=u??[],u.push(h);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{o.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__")continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&Ro.test(c)&&u.issues.length){let g=t.keyType._zod.run({value:Number(c),issues:[]},n);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)u=g}if(u.issues.length){if(t.mode==="loose")o.value[c]=r[c];else o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map((g)=>Ce(g,n,ue())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:r[c],issues:[]},n);if(d instanceof Promise)i.push(d.then((g)=>{if(g.issues.length)o.issues.push(...je(c,g.issues));o.value[u.value]=g.value}));else{if(d.issues.length)o.issues.push(...je(c,d.issues));o.value[u.value]=d.value}}}if(i.length)return Promise.all(i).then(()=>o);return o}}),Eh=m("$ZodMap",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!(r instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),o;let i=[];o.value=new Map;for(let[a,c]of r){let u=t.keyType._zod.run({value:a,issues:[]},n),h=t.valueType._zod.run({value:c,issues:[]},n);if(u instanceof Promise||h instanceof Promise)i.push(Promise.all([u,h]).then(([d,g])=>{tk(d,g,o,a,r,e,n)}));else tk(u,h,o,a,r,e,n)}if(i.length)return Promise.all(i).then(()=>o);return o}});Uh=m("$ZodSet",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!(r instanceof Set))return o.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),o;let i=[];o.value=new Set;for(let a of r){let c=t.valueType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)i.push(c.then((u)=>rk(u,o)));else rk(c,o)}if(i.length)return Promise.all(i).then(()=>o);return o}});Rh=m("$ZodEnum",(e,t)=>{E.init(e,t);let o=No(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter((r)=>Co.has(typeof r)).map((r)=>typeof r==="string"?He(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;if(n.has(a))return r;return r.issues.push({code:"invalid_value",values:o,input:a,inst:e}),r}}),Kh=m("$ZodLiteral",(e,t)=>{if(E.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?He(n):n?He(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Gh=m("$ZodFile",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(r instanceof File)return o;return o.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),o}}),Bh=m("$ZodTransform",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt(e.constructor.name);let r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then((a)=>{return o.value=a,o});if(r instanceof Promise)throw new nt;return o.value=r,o}});hi=m("$ZodOptional",(e,t)=>{E.init(e,t),e._zod.optin="optional",e._zod.optout="optional",B(e._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0}),B(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Lo(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>ok(i,o.value));return ok(r,o.value)}if(o.value===void 0)return o;return t.innerType._zod.run(o,n)}}),Fh=m("$ZodExactOptional",(e,t)=>{hi.init(e,t),B(e._zod,"values",()=>t.innerType._zod.values),B(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,n)=>{return t.innerType._zod.run(o,n)}}),Jh=m("$ZodNullable",(e,t)=>{E.init(e,t),B(e._zod,"optin",()=>t.innerType._zod.optin),B(e._zod,"optout",()=>t.innerType._zod.optout),B(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Lo(o.source)}|null)$`):void 0}),B(e._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0}),e._zod.parse=(o,n)=>{if(o.value===null)return o;return t.innerType._zod.run(o,n)}}),Hh=m("$ZodDefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",B(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>nk(i,t));return nk(r,t)}});Mh=m("$ZodPrefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",B(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)o.value=t.defaultValue;return t.innerType._zod.run(o,n)}}),Vh=m("$ZodNonOptional",(e,t)=>{E.init(e,t),B(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>ik(i,e));return ik(r,e)}});qh=m("$ZodSuccess",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt("ZodSuccess");let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>{return o.value=i.issues.length===0,o});return o.value=r.issues.length===0,o}}),Wh=m("$ZodCatch",(e,t)=>{E.init(e,t),B(e._zod,"optin",()=>t.innerType._zod.optin),B(e._zod,"optout",()=>t.innerType._zod.optout),B(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>{if(o.value=i.value,i.issues.length)o.value=t.catchValue({...o,error:{issues:i.issues.map((a)=>Ce(a,n,ue()))},input:o.value}),o.issues=[];return o});if(o.value=r.value,r.issues.length)o.value=t.catchValue({...o,error:{issues:r.issues.map((i)=>Ce(i,n,ue()))},input:o.value}),o.issues=[];return o}}),Yh=m("$ZodNaN",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(typeof o.value!=="number"||!Number.isNaN(o.value))return o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o;return o}}),Xh=m("$ZodPipe",(e,t)=>{E.init(e,t),B(e._zod,"values",()=>t.in._zod.values),B(e._zod,"optin",()=>t.in._zod.optin),B(e._zod,"optout",()=>t.out._zod.optout),B(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>oi(a,t.in,n));return oi(i,t.in,n)}let r=t.in._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>oi(i,t.out,n));return oi(r,t.out,n)}});Jo=m("$ZodCodec",(e,t)=>{E.init(e,t),B(e._zod,"values",()=>t.in._zod.values),B(e._zod,"optin",()=>t.in._zod.optin),B(e._zod,"optout",()=>t.out._zod.optout),B(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>ni(a,t,n));return ni(i,t,n)}else{let i=t.out._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>ni(a,t,n));return ni(i,t,n)}}});Zh=m("$ZodReadonly",(e,t)=>{E.init(e,t),B(e._zod,"propValues",()=>t.innerType._zod.propValues),B(e._zod,"values",()=>t.innerType._zod.values),B(e._zod,"optin",()=>t.innerType?._zod?.optin),B(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then(ak);return ak(r)}});Qh=m("$ZodTemplateLiteral",(e,t)=>{E.init(e,t);let o=[];for(let n of t.parts)if(typeof n==="object"&&n!==null){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let r=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${n._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;o.push(r.slice(i,a))}else if(n===null||Jl.has(typeof n))o.push(He(`${n}`));else throw Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(n,r)=>{if(typeof n.value!=="string")return n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(n.value))return n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n;return n}}),eg=m("$ZodFunction",(e,t)=>{return E.init(e,t),e._def=t,e._zod.def=t,e.implement=(o)=>{if(typeof o!=="function")throw Error("implement() must be called with a function");return function(...n){let r=e._def.input?Kn(e._def.input,n):n,i=Reflect.apply(o,this,r);if(e._def.output)return Kn(e._def.output,i);return i}},e.implementAsync=(o)=>{if(typeof o!=="function")throw Error("implementAsync() must be called with a function");return async function(...n){let r=e._def.input?await Gn(e._def.input,n):n,i=await Reflect.apply(o,this,r);if(e._def.output)return await Gn(e._def.output,i);return i}},e._zod.parse=(o,n)=>{if(typeof o.value!=="function")return o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o;if(e._def.output&&e._def.output._zod.def.type==="promise")o.value=e.implementAsync(o.value);else o.value=e.implement(o.value);return o},e.input=(...o)=>{let n=e.constructor;if(Array.isArray(o[0]))return new n({type:"function",input:new ui({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output});return new n({type:"function",input:o[0],output:e._def.output})},e.output=(o)=>{return new e.constructor({type:"function",input:e._def.input,output:o})},e}),tg=m("$ZodPromise",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{return Promise.resolve(o.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},n))}}),rg=m("$ZodLazy",(e,t)=>{E.init(e,t),B(e._zod,"innerType",()=>t.getter()),B(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),B(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),B(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),B(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,n)=>{return e._zod.innerType._zod.run(o,n)}}),og=m("$ZodCustom",(e,t)=>{te.init(e,t),E.init(e,t),e._zod.parse=(o,n)=>{return o},e._zod.check=(o)=>{let n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then((i)=>ck(i,o,n,e));ck(r,o,n,e);return}})});function ig(){return{localeError:FD()}}var FD=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let o={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:"مدخل"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${r.expected}، ولكن تم إدخال ${c}`;return`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${c}`}case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${I(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};var sk=s(()=>{x()});function ag(){return{localeError:JD()}}var JD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Yanlış dəyər: gözlənilən instanceof ${r.expected}, daxil olan ${c}`;return`Yanlış dəyər: gözlənilən ${i}, daxil olan ${c}`}case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${k(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var bk=s(()=>{x()});function yk(e,t,o,n){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return o;return n}function cg(){return{localeError:HD()}}var HD=()=>{let e={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(r){return e[r]??null}let o={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:"увод"},n={nan:"NaN",number:"лік",array:"масіў"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${c}`;return`Няправільны ўвод: чакаўся ${i}, атрымана ${c}`}case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${k(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=yk(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${a.verb} ${i}${r.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=yk(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${a.verb} ${i}${r.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${I(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};var mk=s(()=>{x()});function lg(){return{localeError:MD()}}var MD=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??null}let o={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:"вход"},n={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Невалиден вход: очакван instanceof ${r.expected}, получен ${c}`;return`Невалиден вход: очакван ${i}, получен ${c}`}case"invalid_value":if(r.values.length===1)return`Невалиден вход: очакван ${k(r.values[0])}`;return`Невалидна опция: очаквано едно от ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${a.unit??"елемента"}`;return`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${a.unit}`;return`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let a="Невалиден";if(i.format==="emoji")a="Невалидно";if(i.format==="datetime")a="Невалидно";if(i.format==="date")a="Невалидна";if(i.format==="time")a="Невалидно";if(i.format==="duration")a="Невалидна";return`${a} ${o[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};var pk=s(()=>{x()});function ug(){return{localeError:VD()}}var VD=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipus invàlid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`;return`Tipus invàlid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${k(r.values[0])}`;return`Opció invàlida: s'esperava una de ${I(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",a=t(r.origin);if(a)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",a=t(r.origin);if(a)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};var vk=s(()=>{x()});function hg(){return{localeError:qD()}}var qD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Neplatný vstup: očekáváno instanceof ${r.expected}, obdrženo ${c}`;return`Neplatný vstup: očekáváno ${i}, obdrženo ${c}`}case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${k(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${I(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};var Ik=s(()=>{x()});function gg(){return{localeError:WD()}}var WD=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`;return`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":if(r.values.length===1)return`Ugyldig værdi: forventede ${k(r.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`For stor: forventede ${c??"value"} ${a.verb} ${i} ${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`For lille: forventede ${c} ${a.verb} ${i} ${r.minimum.toString()} ${a.unit}`;return`For lille: forventede ${c} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${r.origin}`;default:return"Ugyldigt input"}}};var fk=s(()=>{x()});function dg(){return{localeError:YD()}}var YD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"Zahl",array:"Array"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ungültige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`;return`Ungültige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${k(r.values[0])}`;return`Ungültige Option: erwartet eine von ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};var kk=s(()=>{x()});function Ho(){return{localeError:XD()}}var XD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Invalid option: expected one of ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${a.unit}`;return`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};var sg=s(()=>{x()});function bg(){return{localeError:ZD()}}var ZD=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Nevalida enigo: atendiĝis instanceof ${r.expected}, riceviĝis ${c}`;return`Nevalida enigo: atendiĝis ${i}, riceviĝis ${c}`}case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${k(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${a.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${a.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${o[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};var $k=s(()=>{x()});function yg(){return{localeError:QD()}}var QD=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let o={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"},n={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(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrada inválida: se esperaba instanceof ${r.expected}, recibido ${c}`;return`Entrada inválida: se esperaba ${i}, recibido ${c}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: se esperaba ${k(r.values[0])}`;return`Opción inválida: se esperaba una de ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`Demasiado pequeño: se esperaba que ${c} tuviera ${i}${r.minimum.toString()} ${a.unit}`;return`Demasiado pequeño: se esperaba que ${c} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${o[i.format]??r.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n[r.origin]??r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n[r.origin]??r.origin}`;default:return"Entrada inválida"}}};var wk=s(()=>{x()});function mg(){return{localeError:eN()}}var eN=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let o={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:"ورودی"},n={nan:"NaN",number:"عدد",array:"آرایه"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ورودی نامعتبر: میبایست instanceof ${r.expected} میبود، ${c} دریافت شد`;return`ورودی نامعتبر: میبایست ${i} میبود، ${c} دریافت شد`}case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: میبایست ${k(r.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${I(r.values,"|")} میبود`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${I(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};var _k=s(()=>{x()});function pg(){return{localeError:tN()}}var tN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${k(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(r.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 Ok=s(()=>{x()});function vg(){return{localeError:rN()}}var rN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombre",array:"tableau"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : instanceof ${r.expected} attendu, ${c} reçu`;return`Entrée invalide : ${i} attendu, ${c} reçu`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${k(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${I(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Trop grand : ${r.origin??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${r.origin??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Trop petit : ${r.origin} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : ${r.origin} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${I(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};var Sk=s(()=>{x()});function Ig(){return{localeError:oN()}}var oN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : attendu instanceof ${r.expected}, reçu ${c}`;return`Entrée invalide : attendu ${i}, reçu ${c}`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${k(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",a=t(r.origin);if(a)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",a=t(r.origin);if(a)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${I(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};var Tk=s(()=>{x()});function fg(){return{localeError:nN()}}var nN=()=>{let e={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:"גדול"}},o=(h)=>h?e[h]:void 0,n=(h)=>{let d=o(h);if(d)return d.label;return h??e.unknown.label},r=(h)=>`ה${n(h)}`,i=(h)=>{return(o(h)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},a=(h)=>{if(!h)return null;return t[h]??null},c={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"}},u={nan:"NaN"};return(h)=>{switch(h.code){case"invalid_type":{let d=h.expected,g=u[d??""]??n(d),b=$(h.input),y=u[b]??e[b]?.label??b;if(/^[A-Z]/.test(h.expected))return`קלט לא תקין: צריך להיות instanceof ${h.expected}, התקבל ${y}`;return`קלט לא תקין: צריך להיות ${g}, התקבל ${y}`}case"invalid_value":{if(h.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(h.values[0])}`;let d=h.values.map((y)=>k(y));if(h.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let g=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${g}`}case"too_big":{let d=a(h.origin),g=r(h.origin??"value");if(h.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${g} צריכה להכיל ${h.maximum.toString()} ${d?.unit??""} ${h.inclusive?"או פחות":"לכל היותר"}`.trim();if(h.origin==="number"){let _=h.inclusive?`קטן או שווה ל-${h.maximum}`:`קטן מ-${h.maximum}`;return`גדול מדי: ${g} צריך להיות ${_}`}if(h.origin==="array"||h.origin==="set"){let _=h.origin==="set"?"צריכה":"צריך",S=h.inclusive?`${h.maximum} ${d?.unit??""} או פחות`:`פחות מ-${h.maximum} ${d?.unit??""}`;return`גדול מדי: ${g} ${_} להכיל ${S}`.trim()}let b=h.inclusive?"<=":"<",y=i(h.origin??"value");if(d?.unit)return`${d.longLabel} מדי: ${g} ${y} ${b}${h.maximum.toString()} ${d.unit}`;return`${d?.longLabel??"גדול"} מדי: ${g} ${y} ${b}${h.maximum.toString()}`}case"too_small":{let d=a(h.origin),g=r(h.origin??"value");if(h.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${g} צריכה להכיל ${h.minimum.toString()} ${d?.unit??""} ${h.inclusive?"או יותר":"לפחות"}`.trim();if(h.origin==="number"){let _=h.inclusive?`גדול או שווה ל-${h.minimum}`:`גדול מ-${h.minimum}`;return`קטן מדי: ${g} צריך להיות ${_}`}if(h.origin==="array"||h.origin==="set"){let _=h.origin==="set"?"צריכה":"צריך";if(h.minimum===1&&h.inclusive){let J=h.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${g} ${_} להכיל ${J}`}let S=h.inclusive?`${h.minimum} ${d?.unit??""} או יותר`:`יותר מ-${h.minimum} ${d?.unit??""}`;return`קטן מדי: ${g} ${_} להכיל ${S}`.trim()}let b=h.inclusive?">=":">",y=i(h.origin??"value");if(d?.unit)return`${d.shortLabel} מדי: ${g} ${y} ${b}${h.minimum.toString()} ${d.unit}`;return`${d?.shortLabel??"קטן"} מדי: ${g} ${y} ${b}${h.minimum.toString()}`}case"invalid_format":{let d=h;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let g=c[d.format],b=g?.label??d.format,_=(g?.gender??"m")==="f"?"תקינה":"תקין";return`${b} לא ${_}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${h.divisor}`;case"unrecognized_keys":return`מפתח${h.keys.length>1?"ות":""} לא מזוה${h.keys.length>1?"ים":"ה"}: ${I(h.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r(h.origin??"array")}`;default:return"קלט לא תקין"}}};var Pk=s(()=>{x()});function kg(){return{localeError:iN()}}var iN=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"szám",array:"tömb"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Érvénytelen bemenet: a várt érték instanceof ${r.expected}, a kapott érték ${c}`;return`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${c}`}case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};var Ak=s(()=>{x()});function Dk(e,t,o){return Math.abs(e)===1?t:o}function wr(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],o=e[e.length-1];return e+(t.includes(o)?"ն":"ը")}function $g(){return{localeError:aN()}}var aN=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(r){return e[r]??null}let o={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:"մուտք"},n={nan:"NaN",number:"թիվ",array:"զանգված"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${r.expected}, ստացվել է ${c}`;return`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${c}`}case"invalid_value":if(r.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(r.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=Dk(c,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${wr(r.origin??"արժեք")} կունենա ${i}${r.maximum.toString()} ${u}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${wr(r.origin??"արժեք")} լինի ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=Dk(c,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${wr(r.origin)} կունենա ${i}${r.minimum.toString()} ${u}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${wr(r.origin)} լինի ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`;if(i.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`;if(i.format==="includes")return`Սխալ տող․ պետք է պարունակի "${i.includes}"`;if(i.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`;return`Սխալ ${o[i.format]??r.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${r.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${r.keys.length>1?"ներ":""}. ${I(r.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${wr(r.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${wr(r.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var Nk=s(()=>{x()});function wg(){return{localeError:cN()}}var cN=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`;return`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${k(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};var Lk=s(()=>{x()});function _g(){return{localeError:lN()}}var lN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"númer",array:"fylki"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera instanceof ${r.expected}`;return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera ${i}`}case"invalid_value":if(r.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(r.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${a.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${a.unit}`;return`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ógildur strengur: verður að byrja á "${i.prefix}"`;if(i.format==="ends_with")return`Ógildur strengur: verður að enda á "${i.suffix}"`;if(i.format==="includes")return`Ógildur strengur: verður að innihalda "${i.includes}"`;if(i.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`;return`Rangt ${o[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${I(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};var Ck=s(()=>{x()});function Og(){return{localeError:uN()}}var uN=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"numero",array:"vettore"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`;return`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${k(r.values[0])}`;return`Opzione non valida: atteso uno tra ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${I(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};var xk=s(()=>{x()});function Sg(){return{localeError:hN()}}var hN=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let o={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:"入力値"},n={nan:"NaN",number:"数値",array:"配列"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`無効な入力: instanceof ${r.expected}が期待されましたが、${c}が入力されました`;return`無効な入力: ${i}が期待されましたが、${c}が入力されました`}case"invalid_value":if(r.values.length===1)return`無効な入力: ${k(r.values[0])}が期待されました`;return`無効な選択: ${I(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",a=t(r.origin);if(a)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",a=t(r.origin);if(a)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${I(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};var zk=s(()=>{x()});function Tg(){return{localeError:gN()}}var gN=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??null}let o={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:"შეყვანა"},n={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${r.expected}, მიღებული ${c}`;return`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${c}`}case"invalid_value":if(r.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${I(r.values,"|")}-დან`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${i.prefix}"-ით`;if(i.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${i.suffix}"-ით`;if(i.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${i.includes}"-ს`;if(i.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`;return`არასწორი ${o[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${I(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};var jk=s(()=>{x()});function Mo(){return{localeError:dN()}}var dN=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let o={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:"ទិន្នន័យបញ្ចូល"},n={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${r.expected} ប៉ុន្តែទទួលបាន ${c}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${c}`}case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${I(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var Pg=s(()=>{x()});function Ag(){return Mo()}var Ek=s(()=>{Pg()});function Dg(){return{localeError:sN()}}var sN=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let o={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:"입력"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`잘못된 입력: 예상 타입은 instanceof ${r.expected}, 받은 타입은 ${c}입니다`;return`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${c}입니다`}case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${k(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${I(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",c=t(r.origin),u=c?.unit??"요소";if(c)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${u} ${i}${a}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",c=t(r.origin),u=c?.unit??"요소";if(c)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${u} ${i}${a}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${I(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};var Uk=s(()=>{x()});function Rk(e){let t=Math.abs(e),o=t%10,n=t%100;if(n>=11&&n<=19||o===0)return"many";if(o===1)return"one";return"few"}function Ng(){return{localeError:bN()}}var Vo=(e)=>{return e.charAt(0).toUpperCase()+e.slice(1)},bN=()=>{let e={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(r,i,a,c){let u=e[r]??null;if(u===null)return u;return{unit:u.unit[i],verb:u.verb[c][a?"inclusive":"notInclusive"]}}let o={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"},n={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(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Gautas tipas ${c}, o tikėtasi - instanceof ${r.expected}`;return`Gautas tipas ${c}, o tikėtasi - ${i}`}case"invalid_value":if(r.values.length===1)return`Privalo būti ${k(r.values[0])}`;return`Privalo būti vienas iš ${I(r.values,"|")} pasirinkimų`;case"too_big":{let i=n[r.origin]??r.origin,a=t(r.origin,Rk(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${Vo(i??r.origin??"reikšmė")} ${a.verb} ${r.maximum.toString()} ${a.unit??"elementų"}`;let c=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Vo(i??r.origin??"reikšmė")} turi būti ${c} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let i=n[r.origin]??r.origin,a=t(r.origin,Rk(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${Vo(i??r.origin??"reikšmė")} ${a.verb} ${r.minimum.toString()} ${a.unit??"elementų"}`;let c=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Vo(i??r.origin??"reikšmė")} turi būti ${c} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Eilutė privalo prasidėti "${i.prefix}"`;if(i.format==="ends_with")return`Eilutė privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilutė privalo įtraukti "${i.includes}"`;if(i.format==="regex")return`Eilutė privalo atitikti ${i.pattern}`;return`Neteisingas ${o[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${I(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let i=n[r.origin]??r.origin;return`${Vo(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var Kk=s(()=>{x()});function Lg(){return{localeError:yN()}}var yN=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let o={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:"внес"},n={nan:"NaN",number:"број",array:"низа"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Грешен внес: се очекува instanceof ${r.expected}, примено ${c}`;return`Грешен внес: се очекува ${i}, примено ${c}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Грешана опција: се очекува една ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${I(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};var Gk=s(()=>{x()});function Cg(){return{localeError:mN()}}var mN=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombor"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`;return`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${k(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};var Bk=s(()=>{x()});function xg(){return{localeError:pN()}}var pN=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"getal"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`;return`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${k(r.values[0])}`;return`Ongeldige optie: verwacht één van ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";if(a)return`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`;return`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";if(a)return`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};var Fk=s(()=>{x()});function zg(){return{localeError:vN()}}var vN=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"tall",array:"liste"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`;return`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${k(r.values[0])}`;return`Ugyldig valg: forventet en av ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};var Jk=s(()=>{x()});function jg(){return{localeError:IN()}}var IN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Fâsit giren: umulan instanceof ${r.expected}, alınan ${c}`;return`Fâsit giren: umulan ${i}, alınan ${c}`}case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${k(r.values[0])}`;return`Fâsit tercih: mûteberler ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var Hk=s(()=>{x()});function Eg(){return{localeError:fN()}}var fN=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let o={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:"ورودي"},n={nan:"NaN",number:"عدد",array:"ارې"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ناسم ورودي: باید instanceof ${r.expected} وای, مګر ${c} ترلاسه شو`;return`ناسم ورودي: باید ${i} وای, مګر ${c} ترلاسه شو`}case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${k(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${I(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${I(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};var Mk=s(()=>{x()});function Ug(){return{localeError:kN()}}var kN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"liczba",array:"tablica"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${c}`}case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var Vk=s(()=>{x()});function Rg(){return{localeError:$N()}}var $N=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"número",null:"nulo"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipo inválido: esperado instanceof ${r.expected}, recebido ${c}`;return`Tipo inválido: esperado ${i}, recebido ${c}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${k(r.values[0])}`;return`Opção inválida: esperada uma das ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};var qk=s(()=>{x()});function Wk(e,t,o,n){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return o;return n}function Kg(){return{localeError:wN()}}var wN=()=>{let e={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(r){return e[r]??null}let o={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:"ввод"},n={nan:"NaN",number:"число",array:"массив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${c}`;return`Неверный ввод: ожидалось ${i}, получено ${c}`}case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${k(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=Wk(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=Wk(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};var Yk=s(()=>{x()});function Gg(){return{localeError:_N()}}var _N=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"število",array:"tabela"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Neveljaven vnos: pričakovano instanceof ${r.expected}, prejeto ${c}`;return`Neveljaven vnos: pričakovano ${i}, prejeto ${c}`}case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${k(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${I(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};var Xk=s(()=>{x()});function Bg(){return{localeError:ON()}}var ON=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"antal",array:"lista"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ogiltig inmatning: förväntat instanceof ${r.expected}, fick ${c}`;return`Ogiltig inmatning: förväntat ${i}, fick ${c}`}case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${k(r.values[0])}`;return`Ogiltigt val: förväntade en av ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};var Zk=s(()=>{x()});function Fg(){return{localeError:SN()}}var SN=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${r.expected}, பெறப்பட்டது ${c}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${c}`}case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${I(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var Qk=s(()=>{x()});function Jg(){return{localeError:TN()}}var TN=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let o={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:"ข้อมูลที่ป้อน"},n={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${r.expected} แต่ได้รับ ${c}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${c}`}case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(r.origin);if(a)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",a=t(r.origin);if(a)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${I(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var e$=s(()=>{x()});function Hg(){return{localeError:PN()}}var PN=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Geçersiz değer: beklenen instanceof ${r.expected}, alınan ${c}`;return`Geçersiz değer: beklenen ${i}, alınan ${c}`}case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${k(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${a.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Geçersiz metin: "${i.prefix}" ile başlamalı`;if(i.format==="ends_with")return`Geçersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Geçersiz metin: "${i.includes}" içermeli`;if(i.format==="regex")return`Geçersiz metin: ${i.pattern} desenine uymalı`;return`Geçersiz ${o[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var t$=s(()=>{x()});function qo(){return{localeError:AN()}}var AN=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let o={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:"вхідні дані"},n={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Неправильні вхідні дані: очікується instanceof ${r.expected}, отримано ${c}`;return`Неправильні вхідні дані: очікується ${i}, отримано ${c}`}case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${k(r.values[0])}`;return`Неправильна опція: очікується одне з ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Занадто велике: очікується, що ${r.origin??"значення"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Занадто мале: очікується, що ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};var Mg=s(()=>{x()});function Vg(){return qo()}var r$=s(()=>{Mg()});function qg(){return{localeError:DN()}}var DN=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let o={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:"ان پٹ"},n={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`غلط ان پٹ: instanceof ${r.expected} متوقع تھا، ${c} موصول ہوا`;return`غلط ان پٹ: ${i} متوقع تھا، ${c} موصول ہوا`}case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${k(r.values[0])} متوقع تھا`;return`غلط آپشن: ${I(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${I(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var o$=s(()=>{x()});function Wg(){return{localeError:NN()}}var NN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"raqam",array:"massiv"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`;return`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":if(r.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(r.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${a.unit} ${a.verb}`;return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`;if(i.format==="regex")return`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${o[i.format]??r.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${r.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${r.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var n$=s(()=>{x()});function Yg(){return{localeError:LN()}}var LN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"số",array:"mảng"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${r.expected}, nhận được ${c}`;return`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${c}`}case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Quá nhỏ: mong đợi ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${I(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.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 ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};var i$=s(()=>{x()});function Xg(){return{localeError:CN()}}var CN=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let o={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:"输入"},n={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`无效输入:期望 instanceof ${r.expected},实际接收 ${c}`;return`无效输入:期望 ${i},实际接收 ${c}`}case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${k(r.values[0])}`;return`无效选项:期望以下之一 ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};var a$=s(()=>{x()});function Zg(){return{localeError:xN()}}var xN=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let o={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:"輸入"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`無效的輸入值:預期為 instanceof ${r.expected},但收到 ${c}`;return`無效的輸入值:預期為 ${i},但收到 ${c}`}case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${k(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${I(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};var c$=s(()=>{x()});function Qg(){return{localeError:zN()}}var zN=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let o={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é"},n={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${r.expected}, àmọ̀ a rí ${c}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${c}`}case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${I(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var l$=s(()=>{x()});var Wo={};Qe(Wo,{zhTW:()=>Zg,zhCN:()=>Xg,yo:()=>Qg,vi:()=>Yg,uz:()=>Wg,ur:()=>qg,uk:()=>qo,ua:()=>Vg,tr:()=>Hg,th:()=>Jg,ta:()=>Fg,sv:()=>Bg,sl:()=>Gg,ru:()=>Kg,pt:()=>Rg,ps:()=>Eg,pl:()=>Ug,ota:()=>jg,no:()=>zg,nl:()=>xg,ms:()=>Cg,mk:()=>Lg,lt:()=>Ng,ko:()=>Dg,km:()=>Mo,kh:()=>Ag,ka:()=>Tg,ja:()=>Sg,it:()=>Og,is:()=>_g,id:()=>wg,hy:()=>$g,hu:()=>kg,he:()=>fg,frCA:()=>Ig,fr:()=>vg,fi:()=>pg,fa:()=>mg,es:()=>yg,eo:()=>bg,en:()=>Ho,de:()=>dg,da:()=>gg,cs:()=>hg,ca:()=>ug,bg:()=>lg,be:()=>cg,az:()=>ag,ar:()=>ig});var ed=s(()=>{sk();bk();mk();pk();vk();Ik();fk();kk();sg();$k();wk();_k();Ok();Sk();Tk();Pk();Ak();Nk();Lk();Ck();xk();zk();jk();Ek();Pg();Uk();Kk();Gk();Bk();Fk();Jk();Hk();Mk();Vk();qk();Yk();Xk();Zk();Qk();e$();t$();r$();Mg();o$();n$();i$();a$();c$();l$()});class od{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let o=t[0];if(this._map.set(e,o),o&&typeof o==="object"&&"id"in o)this._idmap.set(o.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let o={...this.get(t)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function gi(){return new od}var u$,td,rd,ve;var Yo=s(()=>{td=Symbol("ZodOutput"),rd=Symbol("ZodInput");(u$=globalThis).__zod_globalRegistry??(u$.__zod_globalRegistry=gi());ve=globalThis.__zod_globalRegistry});function nd(e,t){return new e({type:"string",...O(t)})}function id(e,t){return new e({type:"string",coerce:!0,...O(t)})}function di(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...O(t)})}function Xo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}function bi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}function yi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}function mi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}function Zo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}function pi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}function vi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}function Ii(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}function fi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}function ki(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}function $i(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}function wi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}function _i(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}function Oi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}function ad(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...O(t)})}function Si(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}function Ti(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}function Pi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}function Ai(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}function Di(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}function Ni(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}function ld(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}function ud(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}function hd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}function gd(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}function dd(e,t){return new e({type:"number",checks:[],...O(t)})}function sd(e,t){return new e({type:"number",coerce:!0,checks:[],...O(t)})}function bd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}function yd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...O(t)})}function md(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...O(t)})}function pd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...O(t)})}function vd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...O(t)})}function Id(e,t){return new e({type:"boolean",...O(t)})}function fd(e,t){return new e({type:"boolean",coerce:!0,...O(t)})}function kd(e,t){return new e({type:"bigint",...O(t)})}function $d(e,t){return new e({type:"bigint",coerce:!0,...O(t)})}function wd(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...O(t)})}function _d(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...O(t)})}function Od(e,t){return new e({type:"symbol",...O(t)})}function Sd(e,t){return new e({type:"undefined",...O(t)})}function Td(e,t){return new e({type:"null",...O(t)})}function Pd(e){return new e({type:"any"})}function Ad(e){return new e({type:"unknown"})}function Dd(e,t){return new e({type:"never",...O(t)})}function Nd(e,t){return new e({type:"void",...O(t)})}function Ld(e,t){return new e({type:"date",...O(t)})}function Cd(e,t){return new e({type:"date",coerce:!0,...O(t)})}function xd(e,t){return new e({type:"nan",...O(t)})}function it(e,t){return new Zn({check:"less_than",...O(t),value:e,inclusive:!1})}function Ee(e,t){return new Zn({check:"less_than",...O(t),value:e,inclusive:!0})}function at(e,t){return new Qn({check:"greater_than",...O(t),value:e,inclusive:!1})}function Ae(e,t){return new Qn({check:"greater_than",...O(t),value:e,inclusive:!0})}function Li(e){return at(0,e)}function Ci(e){return it(0,e)}function xi(e){return Ee(0,e)}function zi(e){return Ae(0,e)}function xt(e,t){return new Pu({check:"multiple_of",...O(t),value:e})}function zt(e,t){return new Nu({check:"max_size",...O(t),maximum:e})}function ct(e,t){return new Lu({check:"min_size",...O(t),minimum:e})}function Zt(e,t){return new Cu({check:"size_equals",...O(t),size:e})}function Qt(e,t){return new xu({check:"max_length",...O(t),maximum:e})}function vt(e,t){return new zu({check:"min_length",...O(t),minimum:e})}function er(e,t){return new ju({check:"length_equals",...O(t),length:e})}function _r(e,t){return new Eu({check:"string_format",format:"regex",...O(t),pattern:e})}function Or(e){return new Uu({check:"string_format",format:"lowercase",...O(e)})}function Sr(e){return new Ru({check:"string_format",format:"uppercase",...O(e)})}function Tr(e,t){return new Ku({check:"string_format",format:"includes",...O(t),includes:e})}function Pr(e,t){return new Gu({check:"string_format",format:"starts_with",...O(t),prefix:e})}function Ar(e,t){return new Bu({check:"string_format",format:"ends_with",...O(t),suffix:e})}function ji(e,t,o){return new Fu({check:"property",property:e,schema:t,...O(o)})}function Dr(e,t){return new Ju({check:"mime_type",mime:e,...O(t)})}function Xe(e){return new Hu({check:"overwrite",tx:e})}function Nr(e){return Xe((t)=>t.normalize(e))}function Lr(){return Xe((e)=>e.trim())}function Cr(){return Xe((e)=>e.toLowerCase())}function xr(){return Xe((e)=>e.toUpperCase())}function zr(){return Xe((e)=>Gl(e))}function zd(e,t,o){return new e({type:"array",element:t,...O(o)})}function EN(e,t,o){return new e({type:"union",options:t,...O(o)})}function UN(e,t,o){return new e({type:"union",options:t,inclusive:!1,...O(o)})}function RN(e,t,o,n){return new e({type:"union",options:o,discriminator:t,...O(n)})}function KN(e,t,o){return new e({type:"intersection",left:t,right:o})}function GN(e,t,o,n){let r=o instanceof E;return new e({type:"tuple",items:t,rest:r?o:null,...O(r?n:o)})}function BN(e,t,o,n){return new e({type:"record",keyType:t,valueType:o,...O(n)})}function FN(e,t,o,n){return new e({type:"map",keyType:t,valueType:o,...O(n)})}function JN(e,t,o){return new e({type:"set",valueType:t,...O(o)})}function HN(e,t,o){let n=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:n,...O(o)})}function MN(e,t,o){return new e({type:"enum",entries:t,...O(o)})}function VN(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...O(o)})}function jd(e,t){return new e({type:"file",...O(t)})}function qN(e,t){return new e({type:"transform",transform:t})}function WN(e,t){return new e({type:"optional",innerType:t})}function YN(e,t){return new e({type:"nullable",innerType:t})}function XN(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o==="function"?o():Fl(o)}})}function ZN(e,t,o){return new e({type:"nonoptional",innerType:t,...O(o)})}function QN(e,t){return new e({type:"success",innerType:t})}function eL(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o==="function"?o:()=>o})}function tL(e,t,o){return new e({type:"pipe",in:t,out:o})}function rL(e,t){return new e({type:"readonly",innerType:t})}function oL(e,t,o){return new e({type:"template_literal",parts:t,...O(o)})}function nL(e,t){return new e({type:"lazy",getter:t})}function iL(e,t){return new e({type:"promise",innerType:t})}function Ed(e,t,o){let n=O(o);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Ud(e,t,o){return new e({type:"custom",check:"custom",fn:t,...O(o)})}function Rd(e){let t=h$((o)=>{return o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(pr(n,o.value,t._zod.def));else{let r=n;if(r.fatal)r.continue=!1;r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(pr(r))}},e(o.value,o)});return t}function h$(e,t){let o=new te({check:"custom",...O(t)});return o._zod.check=e,o}function Kd(e){let t=new te({check:"describe"});return t._zod.onattach=[(o)=>{let n=ve.get(o)??{};ve.add(o,{...n,description:e})}],t._zod.check=()=>{},t}function Gd(e){let t=new te({check:"meta"});return t._zod.onattach=[(o)=>{let n=ve.get(o)??{};ve.add(o,{...n,...e})}],t._zod.check=()=>{},t}function Bd(e,t){let o=O(t),n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];if(o.case!=="sensitive")n=n.map((y)=>typeof y==="string"?y.toLowerCase():y),r=r.map((y)=>typeof y==="string"?y.toLowerCase():y);let i=new Set(n),a=new Set(r),c=e.Codec??Jo,u=e.Boolean??Bo,d=new(e.String??Xt)({type:"string",error:o.error}),g=new u({type:"boolean",error:o.error}),b=new c({type:"pipe",in:d,out:g,transform:(y,_)=>{let S=y;if(o.case!=="sensitive")S=S.toLowerCase();if(i.has(S))return!0;else if(a.has(S))return!1;else return _.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:_.value,inst:b,continue:!1}),{}},reverseTransform:(y,_)=>{if(y===!0)return n[0]||"true";else return r[0]||"false"},error:o.error});return b}function jr(e,t,o,n={}){let r=O(n),i={...O(n),check:"string_format",type:"string",format:t,fn:typeof o==="function"?o:(c)=>o.test(c),...r};if(o instanceof RegExp)i.pattern=o;return new e(i)}var cd;var g$=s(()=>{ei();Yo();ng();x();cd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function jt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??ve,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,o={path:[],schemaPath:[]}){var n;let r=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,o.schemaPath.includes(e))i.cycle=o.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,a);let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let b=a.schema,y=t.processors[r.type];if(!y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);y(e,t,b,d)}let g=e._zod.parent;if(g){if(!a.ref)a.ref=g;Z(g,t,d),t.seen.get(g).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)Object.assign(a.schema,u);if(t.io==="input"&&De(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&a.schema._prefault)(n=a.schema).default??(n.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function Et(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let u=n.get(c);if(u&&u!==a[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,a[0])}}let r=(a)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let g=e.external.registry.get(a[0])?.id,b=e.external.uri??((_)=>_);if(g)return{ref:b(g)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${b("__shared")}#/${c}/${y}`}}if(a[1]===o)return{ref:"#"};let h=`${"#"}/${c}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:h+d}},i=(a)=>{if(a[1].schema.$ref)return;let c=a[1],{ref:u,defId:h}=r(a);if(c.def={...c.schema},h)c.defId=h;let d=c.schema;for(let g in d)delete d[g];d.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
4279
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");let le=y.compile();return(oe,pe)=>le(b,oe,pe)},i,a=Wt,c=!Ao.jitless,h=c&&Gl.value,s=t.catchall,g;e._zod.parse=(b,y)=>{g??(g=n.value);let _=b.value;if(!a(_))return b.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),b;if(c&&h&&y?.async===!1&&y.jitless!==!0){if(!i)i=r(t.shape);if(b=i(b,y),!s)return b;return gk([],_,b,y,g,e)}return o(b,y)}});Bo=m("$ZodUnion",(e,t)=>{E.init(e,t),G(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),G(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),G(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),G(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>Lo(i.source)).join("|")})$`)}return});let o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(o)return n(r,i);let a=!1,c=[];for(let u of t.options){let h=u._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)c.push(h),a=!0;else{if(h.issues.length===0)return h;c.push(h)}}if(!a)return Zf(c,r,e,i);return Promise.all(c).then((u)=>{return Zf(u,r,e,i)})}});Ch=m("$ZodXor",(e,t)=>{Bo.init(e,t),t.inclusive=!1;let o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(o)return n(r,i);let a=!1,c=[];for(let u of t.options){let h=u._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)c.push(h),a=!0;else c.push(h)}if(!a)return Qf(c,r,e,i);return Promise.all(c).then((u)=>{return Qf(u,r,e,i)})}}),xh=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bo.init(e,t);let o=e._zod.parse;G(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,u]of Object.entries(a)){if(!r[c])r[c]=new Set;for(let h of u)r[c].add(h)}}return r});let n=mr(()=>{let r=t.options,i=new Map;for(let a of r){let c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let u of c){if(i.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!Wt(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let c=n.value.get(a?.[t.discriminator]);if(c)return c._zod.run(r,i);if(t.unionFallback)return o(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r}}),zh=m("$ZodIntersection",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([u,h])=>{return ek(o,u,h)});return ek(o,i,a)}});ui=m("$ZodTuple",(e,t)=>{E.init(e,t);let o=t.items;e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],c=[...o].reverse().findIndex((s)=>s._zod.optin!=="optional"),u=c===-1?0:o.length-c;if(!t.rest){let s=i.length>o.length,g=i.length<u-1;if(s||g)return n.issues.push({...s?{code:"too_big",maximum:o.length,inclusive:!0}:{code:"too_small",minimum:o.length},input:i,inst:e,origin:"array"}),n}let h=-1;for(let s of o){if(h++,h>=i.length){if(h>=u)continue}let g=s._zod.run({value:i[h],issues:[]},r);if(g instanceof Promise)a.push(g.then((b)=>ri(b,n,h)));else ri(g,n,h)}if(t.rest){let s=i.slice(o.length);for(let g of s){h++;let b=t.rest._zod.run({value:g,issues:[]},r);if(b instanceof Promise)a.push(b.then((y)=>ri(y,n,h)));else ri(b,n,h)}}if(a.length)return Promise.all(a).then(()=>n);return n}});jh=m("$ZodRecord",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!Lt(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a){o.value={};let c=new Set;for(let h of a)if(typeof h==="string"||typeof h==="number"||typeof h==="symbol"){c.add(typeof h==="number"?h.toString():h);let s=t.valueType._zod.run({value:r[h],issues:[]},n);if(s instanceof Promise)i.push(s.then((g)=>{if(g.issues.length)o.issues.push(...je(h,g.issues));o.value[h]=g.value}));else{if(s.issues.length)o.issues.push(...je(h,s.issues));o.value[h]=s.value}}let u;for(let h in r)if(!c.has(h))u=u??[],u.push(h);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{o.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__")continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&Ro.test(c)&&u.issues.length){let g=t.keyType._zod.run({value:Number(c),issues:[]},n);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)u=g}if(u.issues.length){if(t.mode==="loose")o.value[c]=r[c];else o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map((g)=>Ce(g,n,ue())),input:c,path:[c],inst:e});continue}let s=t.valueType._zod.run({value:r[c],issues:[]},n);if(s instanceof Promise)i.push(s.then((g)=>{if(g.issues.length)o.issues.push(...je(c,g.issues));o.value[u.value]=g.value}));else{if(s.issues.length)o.issues.push(...je(c,s.issues));o.value[u.value]=s.value}}}if(i.length)return Promise.all(i).then(()=>o);return o}}),Eh=m("$ZodMap",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!(r instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),o;let i=[];o.value=new Map;for(let[a,c]of r){let u=t.keyType._zod.run({value:a,issues:[]},n),h=t.valueType._zod.run({value:c,issues:[]},n);if(u instanceof Promise||h instanceof Promise)i.push(Promise.all([u,h]).then(([s,g])=>{tk(s,g,o,a,r,e,n)}));else tk(u,h,o,a,r,e,n)}if(i.length)return Promise.all(i).then(()=>o);return o}});Uh=m("$ZodSet",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(!(r instanceof Set))return o.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),o;let i=[];o.value=new Set;for(let a of r){let c=t.valueType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)i.push(c.then((u)=>rk(u,o)));else rk(c,o)}if(i.length)return Promise.all(i).then(()=>o);return o}});Rh=m("$ZodEnum",(e,t)=>{E.init(e,t);let o=No(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter((r)=>Co.has(typeof r)).map((r)=>typeof r==="string"?Me(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;if(n.has(a))return r;return r.issues.push({code:"invalid_value",values:o,input:a,inst:e}),r}}),Kh=m("$ZodLiteral",(e,t)=>{if(E.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Fh=m("$ZodFile",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{let r=o.value;if(r instanceof File)return o;return o.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),o}}),Gh=m("$ZodTransform",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt(e.constructor.name);let r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then((a)=>{return o.value=a,o});if(r instanceof Promise)throw new nt;return o.value=r,o}});hi=m("$ZodOptional",(e,t)=>{E.init(e,t),e._zod.optin="optional",e._zod.optout="optional",G(e._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0}),G(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Lo(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>ok(i,o.value));return ok(r,o.value)}if(o.value===void 0)return o;return t.innerType._zod.run(o,n)}}),Bh=m("$ZodExactOptional",(e,t)=>{hi.init(e,t),G(e._zod,"values",()=>t.innerType._zod.values),G(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,n)=>{return t.innerType._zod.run(o,n)}}),Hh=m("$ZodNullable",(e,t)=>{E.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Lo(o.source)}|null)$`):void 0}),G(e._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0}),e._zod.parse=(o,n)=>{if(o.value===null)return o;return t.innerType._zod.run(o,n)}}),Mh=m("$ZodDefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>nk(i,t));return nk(r,t)}});Jh=m("$ZodPrefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)o.value=t.defaultValue;return t.innerType._zod.run(o,n)}}),Vh=m("$ZodNonOptional",(e,t)=>{E.init(e,t),G(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>ik(i,e));return ik(r,e)}});qh=m("$ZodSuccess",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt("ZodSuccess");let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>{return o.value=i.issues.length===0,o});return o.value=r.issues.length===0,o}}),Wh=m("$ZodCatch",(e,t)=>{E.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>{if(o.value=i.value,i.issues.length)o.value=t.catchValue({...o,error:{issues:i.issues.map((a)=>Ce(a,n,ue()))},input:o.value}),o.issues=[];return o});if(o.value=r.value,r.issues.length)o.value=t.catchValue({...o,error:{issues:r.issues.map((i)=>Ce(i,n,ue()))},input:o.value}),o.issues=[];return o}}),Yh=m("$ZodNaN",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{if(typeof o.value!=="number"||!Number.isNaN(o.value))return o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o;return o}}),Xh=m("$ZodPipe",(e,t)=>{E.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>oi(a,t.in,n));return oi(i,t.in,n)}let r=t.in._zod.run(o,n);if(r instanceof Promise)return r.then((i)=>oi(i,t.out,n));return oi(r,t.out,n)}});Ho=m("$ZodCodec",(e,t)=>{E.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>ni(a,t,n));return ni(i,t,n)}else{let i=t.out._zod.run(o,n);if(i instanceof Promise)return i.then((a)=>ni(a,t,n));return ni(i,t,n)}}});Zh=m("$ZodReadonly",(e,t)=>{E.init(e,t),G(e._zod,"propValues",()=>t.innerType._zod.propValues),G(e._zod,"values",()=>t.innerType._zod.values),G(e._zod,"optin",()=>t.innerType?._zod?.optin),G(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);let r=t.innerType._zod.run(o,n);if(r instanceof Promise)return r.then(ak);return ak(r)}});Qh=m("$ZodTemplateLiteral",(e,t)=>{E.init(e,t);let o=[];for(let n of t.parts)if(typeof n==="object"&&n!==null){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let r=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${n._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;o.push(r.slice(i,a))}else if(n===null||Hl.has(typeof n))o.push(Me(`${n}`));else throw Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(n,r)=>{if(typeof n.value!=="string")return n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(n.value))return n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n;return n}}),eg=m("$ZodFunction",(e,t)=>{return E.init(e,t),e._def=t,e._zod.def=t,e.implement=(o)=>{if(typeof o!=="function")throw Error("implement() must be called with a function");return function(...n){let r=e._def.input?Kn(e._def.input,n):n,i=Reflect.apply(o,this,r);if(e._def.output)return Kn(e._def.output,i);return i}},e.implementAsync=(o)=>{if(typeof o!=="function")throw Error("implementAsync() must be called with a function");return async function(...n){let r=e._def.input?await Fn(e._def.input,n):n,i=await Reflect.apply(o,this,r);if(e._def.output)return await Fn(e._def.output,i);return i}},e._zod.parse=(o,n)=>{if(typeof o.value!=="function")return o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o;if(e._def.output&&e._def.output._zod.def.type==="promise")o.value=e.implementAsync(o.value);else o.value=e.implement(o.value);return o},e.input=(...o)=>{let n=e.constructor;if(Array.isArray(o[0]))return new n({type:"function",input:new ui({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output});return new n({type:"function",input:o[0],output:e._def.output})},e.output=(o)=>{return new e.constructor({type:"function",input:e._def.input,output:o})},e}),tg=m("$ZodPromise",(e,t)=>{E.init(e,t),e._zod.parse=(o,n)=>{return Promise.resolve(o.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},n))}}),rg=m("$ZodLazy",(e,t)=>{E.init(e,t),G(e._zod,"innerType",()=>t.getter()),G(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),G(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),G(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),G(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,n)=>{return e._zod.innerType._zod.run(o,n)}}),og=m("$ZodCustom",(e,t)=>{te.init(e,t),E.init(e,t),e._zod.parse=(o,n)=>{return o},e._zod.check=(o)=>{let n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then((i)=>ck(i,o,n,e));ck(r,o,n,e);return}})});function ig(){return{localeError:BD()}}var BD=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let o={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:"مدخل"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${r.expected}، ولكن تم إدخال ${c}`;return`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${c}`}case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${I(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};var dk=d(()=>{x()});function ag(){return{localeError:HD()}}var HD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Yanlış dəyər: gözlənilən instanceof ${r.expected}, daxil olan ${c}`;return`Yanlış dəyər: gözlənilən ${i}, daxil olan ${c}`}case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${k(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var bk=d(()=>{x()});function yk(e,t,o,n){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return o;return n}function cg(){return{localeError:MD()}}var MD=()=>{let e={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(r){return e[r]??null}let o={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:"увод"},n={nan:"NaN",number:"лік",array:"масіў"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${c}`;return`Няправільны ўвод: чакаўся ${i}, атрымана ${c}`}case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${k(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=yk(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${a.verb} ${i}${r.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=yk(c,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${a.verb} ${i}${r.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${I(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};var mk=d(()=>{x()});function lg(){return{localeError:JD()}}var JD=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??null}let o={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:"вход"},n={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Невалиден вход: очакван instanceof ${r.expected}, получен ${c}`;return`Невалиден вход: очакван ${i}, получен ${c}`}case"invalid_value":if(r.values.length===1)return`Невалиден вход: очакван ${k(r.values[0])}`;return`Невалидна опция: очаквано едно от ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${a.unit??"елемента"}`;return`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${a.unit}`;return`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let a="Невалиден";if(i.format==="emoji")a="Невалидно";if(i.format==="datetime")a="Невалидно";if(i.format==="date")a="Невалидна";if(i.format==="time")a="Невалидно";if(i.format==="duration")a="Невалидна";return`${a} ${o[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};var pk=d(()=>{x()});function ug(){return{localeError:VD()}}var VD=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipus invàlid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`;return`Tipus invàlid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${k(r.values[0])}`;return`Opció invàlida: s'esperava una de ${I(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",a=t(r.origin);if(a)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",a=t(r.origin);if(a)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};var vk=d(()=>{x()});function hg(){return{localeError:qD()}}var qD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Neplatný vstup: očekáváno instanceof ${r.expected}, obdrženo ${c}`;return`Neplatný vstup: očekáváno ${i}, obdrženo ${c}`}case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${k(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${I(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};var Ik=d(()=>{x()});function gg(){return{localeError:WD()}}var WD=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`;return`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":if(r.values.length===1)return`Ugyldig værdi: forventede ${k(r.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`For stor: forventede ${c??"value"} ${a.verb} ${i} ${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`For lille: forventede ${c} ${a.verb} ${i} ${r.minimum.toString()} ${a.unit}`;return`For lille: forventede ${c} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${r.origin}`;default:return"Ugyldigt input"}}};var fk=d(()=>{x()});function sg(){return{localeError:YD()}}var YD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"Zahl",array:"Array"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ungültige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`;return`Ungültige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${k(r.values[0])}`;return`Ungültige Option: erwartet eine von ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};var kk=d(()=>{x()});function Mo(){return{localeError:XD()}}var XD=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Invalid option: expected one of ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${a.unit}`;return`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};var dg=d(()=>{x()});function bg(){return{localeError:ZD()}}var ZD=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Nevalida enigo: atendiĝis instanceof ${r.expected}, riceviĝis ${c}`;return`Nevalida enigo: atendiĝis ${i}, riceviĝis ${c}`}case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${k(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${a.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${a.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${o[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};var $k=d(()=>{x()});function yg(){return{localeError:QD()}}var QD=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let o={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"},n={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(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrada inválida: se esperaba instanceof ${r.expected}, recibido ${c}`;return`Entrada inválida: se esperaba ${i}, recibido ${c}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: se esperaba ${k(r.values[0])}`;return`Opción inválida: se esperaba una de ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=n[r.origin]??r.origin;if(a)return`Demasiado pequeño: se esperaba que ${c} tuviera ${i}${r.minimum.toString()} ${a.unit}`;return`Demasiado pequeño: se esperaba que ${c} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${o[i.format]??r.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n[r.origin]??r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n[r.origin]??r.origin}`;default:return"Entrada inválida"}}};var wk=d(()=>{x()});function mg(){return{localeError:eN()}}var eN=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let o={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:"ورودی"},n={nan:"NaN",number:"عدد",array:"آرایه"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ورودی نامعتبر: میبایست instanceof ${r.expected} میبود، ${c} دریافت شد`;return`ورودی نامعتبر: میبایست ${i} میبود، ${c} دریافت شد`}case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: میبایست ${k(r.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${I(r.values,"|")} میبود`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${I(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};var _k=d(()=>{x()});function pg(){return{localeError:tN()}}var tN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${k(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(r.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 Ok=d(()=>{x()});function vg(){return{localeError:rN()}}var rN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombre",array:"tableau"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : instanceof ${r.expected} attendu, ${c} reçu`;return`Entrée invalide : ${i} attendu, ${c} reçu`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${k(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${I(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Trop grand : ${r.origin??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${r.origin??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Trop petit : ${r.origin} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : ${r.origin} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${I(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};var Sk=d(()=>{x()});function Ig(){return{localeError:oN()}}var oN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : attendu instanceof ${r.expected}, reçu ${c}`;return`Entrée invalide : attendu ${i}, reçu ${c}`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${k(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",a=t(r.origin);if(a)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",a=t(r.origin);if(a)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${I(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};var Tk=d(()=>{x()});function fg(){return{localeError:nN()}}var nN=()=>{let e={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:"גדול"}},o=(h)=>h?e[h]:void 0,n=(h)=>{let s=o(h);if(s)return s.label;return h??e.unknown.label},r=(h)=>`ה${n(h)}`,i=(h)=>{return(o(h)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},a=(h)=>{if(!h)return null;return t[h]??null},c={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"}},u={nan:"NaN"};return(h)=>{switch(h.code){case"invalid_type":{let s=h.expected,g=u[s??""]??n(s),b=$(h.input),y=u[b]??e[b]?.label??b;if(/^[A-Z]/.test(h.expected))return`קלט לא תקין: צריך להיות instanceof ${h.expected}, התקבל ${y}`;return`קלט לא תקין: צריך להיות ${g}, התקבל ${y}`}case"invalid_value":{if(h.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(h.values[0])}`;let s=h.values.map((y)=>k(y));if(h.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${s[0]} או ${s[1]}`;let g=s[s.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${s.slice(0,-1).join(", ")} או ${g}`}case"too_big":{let s=a(h.origin),g=r(h.origin??"value");if(h.origin==="string")return`${s?.longLabel??"ארוך"} מדי: ${g} צריכה להכיל ${h.maximum.toString()} ${s?.unit??""} ${h.inclusive?"או פחות":"לכל היותר"}`.trim();if(h.origin==="number"){let _=h.inclusive?`קטן או שווה ל-${h.maximum}`:`קטן מ-${h.maximum}`;return`גדול מדי: ${g} צריך להיות ${_}`}if(h.origin==="array"||h.origin==="set"){let _=h.origin==="set"?"צריכה":"צריך",S=h.inclusive?`${h.maximum} ${s?.unit??""} או פחות`:`פחות מ-${h.maximum} ${s?.unit??""}`;return`גדול מדי: ${g} ${_} להכיל ${S}`.trim()}let b=h.inclusive?"<=":"<",y=i(h.origin??"value");if(s?.unit)return`${s.longLabel} מדי: ${g} ${y} ${b}${h.maximum.toString()} ${s.unit}`;return`${s?.longLabel??"גדול"} מדי: ${g} ${y} ${b}${h.maximum.toString()}`}case"too_small":{let s=a(h.origin),g=r(h.origin??"value");if(h.origin==="string")return`${s?.shortLabel??"קצר"} מדי: ${g} צריכה להכיל ${h.minimum.toString()} ${s?.unit??""} ${h.inclusive?"או יותר":"לפחות"}`.trim();if(h.origin==="number"){let _=h.inclusive?`גדול או שווה ל-${h.minimum}`:`גדול מ-${h.minimum}`;return`קטן מדי: ${g} צריך להיות ${_}`}if(h.origin==="array"||h.origin==="set"){let _=h.origin==="set"?"צריכה":"צריך";if(h.minimum===1&&h.inclusive){let H=h.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${g} ${_} להכיל ${H}`}let S=h.inclusive?`${h.minimum} ${s?.unit??""} או יותר`:`יותר מ-${h.minimum} ${s?.unit??""}`;return`קטן מדי: ${g} ${_} להכיל ${S}`.trim()}let b=h.inclusive?">=":">",y=i(h.origin??"value");if(s?.unit)return`${s.shortLabel} מדי: ${g} ${y} ${b}${h.minimum.toString()} ${s.unit}`;return`${s?.shortLabel??"קטן"} מדי: ${g} ${y} ${b}${h.minimum.toString()}`}case"invalid_format":{let s=h;if(s.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${s.prefix}"`;if(s.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${s.suffix}"`;if(s.format==="includes")return`המחרוזת חייבת לכלול "${s.includes}"`;if(s.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${s.pattern}`;let g=c[s.format],b=g?.label??s.format,_=(g?.gender??"m")==="f"?"תקינה":"תקין";return`${b} לא ${_}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${h.divisor}`;case"unrecognized_keys":return`מפתח${h.keys.length>1?"ות":""} לא מזוה${h.keys.length>1?"ים":"ה"}: ${I(h.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r(h.origin??"array")}`;default:return"קלט לא תקין"}}};var Pk=d(()=>{x()});function kg(){return{localeError:iN()}}var iN=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"szám",array:"tömb"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Érvénytelen bemenet: a várt érték instanceof ${r.expected}, a kapott érték ${c}`;return`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${c}`}case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};var Ak=d(()=>{x()});function Dk(e,t,o){return Math.abs(e)===1?t:o}function wr(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],o=e[e.length-1];return e+(t.includes(o)?"ն":"ը")}function $g(){return{localeError:aN()}}var aN=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(r){return e[r]??null}let o={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:"մուտք"},n={nan:"NaN",number:"թիվ",array:"զանգված"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${r.expected}, ստացվել է ${c}`;return`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${c}`}case"invalid_value":if(r.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(r.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=Dk(c,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${wr(r.origin??"արժեք")} կունենա ${i}${r.maximum.toString()} ${u}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${wr(r.origin??"արժեք")} լինի ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=Dk(c,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${wr(r.origin)} կունենա ${i}${r.minimum.toString()} ${u}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${wr(r.origin)} լինի ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`;if(i.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`;if(i.format==="includes")return`Սխալ տող․ պետք է պարունակի "${i.includes}"`;if(i.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`;return`Սխալ ${o[i.format]??r.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${r.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${r.keys.length>1?"ներ":""}. ${I(r.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${wr(r.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${wr(r.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var Nk=d(()=>{x()});function wg(){return{localeError:cN()}}var cN=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`;return`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${k(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};var Lk=d(()=>{x()});function _g(){return{localeError:lN()}}var lN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"númer",array:"fylki"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera instanceof ${r.expected}`;return`Rangt gildi: Þú slóst inn ${c} þar sem á að vera ${i}`}case"invalid_value":if(r.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(r.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${a.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${a.unit}`;return`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ógildur strengur: verður að byrja á "${i.prefix}"`;if(i.format==="ends_with")return`Ógildur strengur: verður að enda á "${i.suffix}"`;if(i.format==="includes")return`Ógildur strengur: verður að innihalda "${i.includes}"`;if(i.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`;return`Rangt ${o[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${I(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};var Ck=d(()=>{x()});function Og(){return{localeError:uN()}}var uN=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"numero",array:"vettore"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`;return`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${k(r.values[0])}`;return`Opzione non valida: atteso uno tra ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${I(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};var xk=d(()=>{x()});function Sg(){return{localeError:hN()}}var hN=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let o={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:"入力値"},n={nan:"NaN",number:"数値",array:"配列"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`無効な入力: instanceof ${r.expected}が期待されましたが、${c}が入力されました`;return`無効な入力: ${i}が期待されましたが、${c}が入力されました`}case"invalid_value":if(r.values.length===1)return`無効な入力: ${k(r.values[0])}が期待されました`;return`無効な選択: ${I(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",a=t(r.origin);if(a)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",a=t(r.origin);if(a)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${I(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};var zk=d(()=>{x()});function Tg(){return{localeError:gN()}}var gN=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??null}let o={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:"შეყვანა"},n={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${r.expected}, მიღებული ${c}`;return`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${c}`}case"invalid_value":if(r.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${I(r.values,"|")}-დან`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${i.prefix}"-ით`;if(i.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${i.suffix}"-ით`;if(i.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${i.includes}"-ს`;if(i.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`;return`არასწორი ${o[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${I(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};var jk=d(()=>{x()});function Jo(){return{localeError:sN()}}var sN=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let o={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:"ទិន្នន័យបញ្ចូល"},n={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${r.expected} ប៉ុន្តែទទួលបាន ${c}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${c}`}case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${I(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var Pg=d(()=>{x()});function Ag(){return Jo()}var Ek=d(()=>{Pg()});function Dg(){return{localeError:dN()}}var dN=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let o={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:"입력"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`잘못된 입력: 예상 타입은 instanceof ${r.expected}, 받은 타입은 ${c}입니다`;return`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${c}입니다`}case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${k(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${I(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",c=t(r.origin),u=c?.unit??"요소";if(c)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${u} ${i}${a}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",c=t(r.origin),u=c?.unit??"요소";if(c)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${u} ${i}${a}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${I(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};var Uk=d(()=>{x()});function Rk(e){let t=Math.abs(e),o=t%10,n=t%100;if(n>=11&&n<=19||o===0)return"many";if(o===1)return"one";return"few"}function Ng(){return{localeError:bN()}}var Vo=(e)=>{return e.charAt(0).toUpperCase()+e.slice(1)},bN=()=>{let e={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(r,i,a,c){let u=e[r]??null;if(u===null)return u;return{unit:u.unit[i],verb:u.verb[c][a?"inclusive":"notInclusive"]}}let o={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"},n={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(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Gautas tipas ${c}, o tikėtasi - instanceof ${r.expected}`;return`Gautas tipas ${c}, o tikėtasi - ${i}`}case"invalid_value":if(r.values.length===1)return`Privalo būti ${k(r.values[0])}`;return`Privalo būti vienas iš ${I(r.values,"|")} pasirinkimų`;case"too_big":{let i=n[r.origin]??r.origin,a=t(r.origin,Rk(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${Vo(i??r.origin??"reikšmė")} ${a.verb} ${r.maximum.toString()} ${a.unit??"elementų"}`;let c=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Vo(i??r.origin??"reikšmė")} turi būti ${c} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let i=n[r.origin]??r.origin,a=t(r.origin,Rk(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${Vo(i??r.origin??"reikšmė")} ${a.verb} ${r.minimum.toString()} ${a.unit??"elementų"}`;let c=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Vo(i??r.origin??"reikšmė")} turi būti ${c} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Eilutė privalo prasidėti "${i.prefix}"`;if(i.format==="ends_with")return`Eilutė privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilutė privalo įtraukti "${i.includes}"`;if(i.format==="regex")return`Eilutė privalo atitikti ${i.pattern}`;return`Neteisingas ${o[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${I(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let i=n[r.origin]??r.origin;return`${Vo(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var Kk=d(()=>{x()});function Lg(){return{localeError:yN()}}var yN=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let o={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:"внес"},n={nan:"NaN",number:"број",array:"низа"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Грешен внес: се очекува instanceof ${r.expected}, примено ${c}`;return`Грешен внес: се очекува ${i}, примено ${c}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Грешана опција: се очекува една ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${I(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};var Fk=d(()=>{x()});function Cg(){return{localeError:mN()}}var mN=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"nombor"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`;return`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${k(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};var Gk=d(()=>{x()});function xg(){return{localeError:pN()}}var pN=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"getal"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`;return`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${k(r.values[0])}`;return`Ongeldige optie: verwacht één van ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";if(a)return`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`;return`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";if(a)return`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};var Bk=d(()=>{x()});function zg(){return{localeError:vN()}}var vN=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"tall",array:"liste"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`;return`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${k(r.values[0])}`;return`Ugyldig valg: forventet en av ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};var Hk=d(()=>{x()});function jg(){return{localeError:IN()}}var IN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Fâsit giren: umulan instanceof ${r.expected}, alınan ${c}`;return`Fâsit giren: umulan ${i}, alınan ${c}`}case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${k(r.values[0])}`;return`Fâsit tercih: mûteberler ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var Mk=d(()=>{x()});function Eg(){return{localeError:fN()}}var fN=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let o={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:"ورودي"},n={nan:"NaN",number:"عدد",array:"ارې"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ناسم ورودي: باید instanceof ${r.expected} وای, مګر ${c} ترلاسه شو`;return`ناسم ورودي: باید ${i} وای, مګر ${c} ترلاسه شو`}case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${k(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${I(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${I(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};var Jk=d(()=>{x()});function Ug(){return{localeError:kN()}}var kN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"liczba",array:"tablica"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${c}`}case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var Vk=d(()=>{x()});function Rg(){return{localeError:$N()}}var $N=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"número",null:"nulo"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipo inválido: esperado instanceof ${r.expected}, recebido ${c}`;return`Tipo inválido: esperado ${i}, recebido ${c}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${k(r.values[0])}`;return`Opção inválida: esperada uma das ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};var qk=d(()=>{x()});function Wk(e,t,o,n){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return o;return n}function Kg(){return{localeError:wN()}}var wN=()=>{let e={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(r){return e[r]??null}let o={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:"ввод"},n={nan:"NaN",number:"число",array:"массив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${c}`;return`Неверный ввод: ожидалось ${i}, получено ${c}`}case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${k(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let c=Number(r.maximum),u=Wk(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let c=Number(r.minimum),u=Wk(c,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};var Yk=d(()=>{x()});function Fg(){return{localeError:_N()}}var _N=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"število",array:"tabela"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Neveljaven vnos: pričakovano instanceof ${r.expected}, prejeto ${c}`;return`Neveljaven vnos: pričakovano ${i}, prejeto ${c}`}case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${k(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${I(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};var Xk=d(()=>{x()});function Gg(){return{localeError:ON()}}var ON=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"antal",array:"lista"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ogiltig inmatning: förväntat instanceof ${r.expected}, fick ${c}`;return`Ogiltig inmatning: förväntat ${i}, fick ${c}`}case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${k(r.values[0])}`;return`Ogiltigt val: förväntade en av ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${I(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};var Zk=d(()=>{x()});function Bg(){return{localeError:SN()}}var SN=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${r.expected}, பெறப்பட்டது ${c}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${c}`}case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${I(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var Qk=d(()=>{x()});function Hg(){return{localeError:TN()}}var TN=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let o={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:"ข้อมูลที่ป้อน"},n={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${r.expected} แต่ได้รับ ${c}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${c}`}case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(r.origin);if(a)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",a=t(r.origin);if(a)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${I(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var e$=d(()=>{x()});function Mg(){return{localeError:PN()}}var PN=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??null}let o={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"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Geçersiz değer: beklenen instanceof ${r.expected}, alınan ${c}`;return`Geçersiz değer: beklenen ${i}, alınan ${c}`}case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${k(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${a.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Geçersiz metin: "${i.prefix}" ile başlamalı`;if(i.format==="ends_with")return`Geçersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Geçersiz metin: "${i.includes}" içermeli`;if(i.format==="regex")return`Geçersiz metin: ${i.pattern} desenine uymalı`;return`Geçersiz ${o[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var t$=d(()=>{x()});function qo(){return{localeError:AN()}}var AN=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let o={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:"вхідні дані"},n={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Неправильні вхідні дані: очікується instanceof ${r.expected}, отримано ${c}`;return`Неправильні вхідні дані: очікується ${i}, отримано ${c}`}case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${k(r.values[0])}`;return`Неправильна опція: очікується одне з ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Занадто велике: очікується, що ${r.origin??"значення"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Занадто мале: очікується, що ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${I(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};var Jg=d(()=>{x()});function Vg(){return qo()}var r$=d(()=>{Jg()});function qg(){return{localeError:DN()}}var DN=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let o={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:"ان پٹ"},n={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`غلط ان پٹ: instanceof ${r.expected} متوقع تھا، ${c} موصول ہوا`;return`غلط ان پٹ: ${i} متوقع تھا، ${c} موصول ہوا`}case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${k(r.values[0])} متوقع تھا`;return`غلط آپشن: ${I(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${I(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var o$=d(()=>{x()});function Wg(){return{localeError:NN()}}var NN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"raqam",array:"massiv"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`;return`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":if(r.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(r.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${a.unit} ${a.verb}`;return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`;if(i.format==="regex")return`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${o[i.format]??r.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${r.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${r.keys.length>1?"lar":""}: ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${r.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var n$=d(()=>{x()});function Yg(){return{localeError:LN()}}var LN=()=>{let e={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(r){return e[r]??null}let o={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"},n={nan:"NaN",number:"số",array:"mảng"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${r.expected}, nhận được ${c}`;return`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${c}`}case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Quá nhỏ: mong đợi ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${I(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.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 ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};var i$=d(()=>{x()});function Xg(){return{localeError:CN()}}var CN=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let o={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:"输入"},n={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`无效输入:期望 instanceof ${r.expected},实际接收 ${c}`;return`无效输入:期望 ${i},实际接收 ${c}`}case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${k(r.values[0])}`;return`无效选项:期望以下之一 ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${I(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};var a$=d(()=>{x()});function Zg(){return{localeError:xN()}}var xN=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let o={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:"輸入"},n={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`無效的輸入值:預期為 instanceof ${r.expected},但收到 ${c}`;return`無效的輸入值:預期為 ${i},但收到 ${c}`}case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${k(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${I(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};var c$=d(()=>{x()});function Qg(){return{localeError:zN()}}var zN=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let o={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é"},n={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(r)=>{switch(r.code){case"invalid_type":{let i=n[r.expected]??r.expected,a=$(r.input),c=n[a]??a;if(/^[A-Z]/.test(r.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${r.expected}, àmọ̀ a rí ${c}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${c}`}case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${I(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${I(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var l$=d(()=>{x()});var Wo={};Qe(Wo,{zhTW:()=>Zg,zhCN:()=>Xg,yo:()=>Qg,vi:()=>Yg,uz:()=>Wg,ur:()=>qg,uk:()=>qo,ua:()=>Vg,tr:()=>Mg,th:()=>Hg,ta:()=>Bg,sv:()=>Gg,sl:()=>Fg,ru:()=>Kg,pt:()=>Rg,ps:()=>Eg,pl:()=>Ug,ota:()=>jg,no:()=>zg,nl:()=>xg,ms:()=>Cg,mk:()=>Lg,lt:()=>Ng,ko:()=>Dg,km:()=>Jo,kh:()=>Ag,ka:()=>Tg,ja:()=>Sg,it:()=>Og,is:()=>_g,id:()=>wg,hy:()=>$g,hu:()=>kg,he:()=>fg,frCA:()=>Ig,fr:()=>vg,fi:()=>pg,fa:()=>mg,es:()=>yg,eo:()=>bg,en:()=>Mo,de:()=>sg,da:()=>gg,cs:()=>hg,ca:()=>ug,bg:()=>lg,be:()=>cg,az:()=>ag,ar:()=>ig});var es=d(()=>{dk();bk();mk();pk();vk();Ik();fk();kk();dg();$k();wk();_k();Ok();Sk();Tk();Pk();Ak();Nk();Lk();Ck();xk();zk();jk();Ek();Pg();Uk();Kk();Fk();Gk();Bk();Hk();Mk();Jk();Vk();qk();Yk();Xk();Zk();Qk();e$();t$();r$();Jg();o$();n$();i$();a$();c$();l$()});class os{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let o=t[0];if(this._map.set(e,o),o&&typeof o==="object"&&"id"in o)this._idmap.set(o.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let o={...this.get(t)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function gi(){return new os}var u$,ts,rs,ve;var Yo=d(()=>{ts=Symbol("ZodOutput"),rs=Symbol("ZodInput");(u$=globalThis).__zod_globalRegistry??(u$.__zod_globalRegistry=gi());ve=globalThis.__zod_globalRegistry});function ns(e,t){return new e({type:"string",...O(t)})}function is(e,t){return new e({type:"string",coerce:!0,...O(t)})}function si(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...O(t)})}function Xo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function di(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}function bi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}function yi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}function mi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}function Zo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}function pi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}function vi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}function Ii(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}function fi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}function ki(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}function $i(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}function wi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}function _i(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}function Oi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}function as(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...O(t)})}function Si(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}function Ti(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}function Pi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}function Ai(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}function Di(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}function Ni(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}function ls(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}function us(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}function hs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}function gs(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}function ss(e,t){return new e({type:"number",checks:[],...O(t)})}function ds(e,t){return new e({type:"number",coerce:!0,checks:[],...O(t)})}function bs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}function ys(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...O(t)})}function ms(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...O(t)})}function ps(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...O(t)})}function vs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...O(t)})}function Is(e,t){return new e({type:"boolean",...O(t)})}function fs(e,t){return new e({type:"boolean",coerce:!0,...O(t)})}function ks(e,t){return new e({type:"bigint",...O(t)})}function $s(e,t){return new e({type:"bigint",coerce:!0,...O(t)})}function ws(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...O(t)})}function _s(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...O(t)})}function Os(e,t){return new e({type:"symbol",...O(t)})}function Ss(e,t){return new e({type:"undefined",...O(t)})}function Ts(e,t){return new e({type:"null",...O(t)})}function Ps(e){return new e({type:"any"})}function As(e){return new e({type:"unknown"})}function Ds(e,t){return new e({type:"never",...O(t)})}function Ns(e,t){return new e({type:"void",...O(t)})}function Ls(e,t){return new e({type:"date",...O(t)})}function Cs(e,t){return new e({type:"date",coerce:!0,...O(t)})}function xs(e,t){return new e({type:"nan",...O(t)})}function it(e,t){return new Zn({check:"less_than",...O(t),value:e,inclusive:!1})}function Ee(e,t){return new Zn({check:"less_than",...O(t),value:e,inclusive:!0})}function at(e,t){return new Qn({check:"greater_than",...O(t),value:e,inclusive:!1})}function Ae(e,t){return new Qn({check:"greater_than",...O(t),value:e,inclusive:!0})}function Li(e){return at(0,e)}function Ci(e){return it(0,e)}function xi(e){return Ee(0,e)}function zi(e){return Ae(0,e)}function xt(e,t){return new Pu({check:"multiple_of",...O(t),value:e})}function zt(e,t){return new Nu({check:"max_size",...O(t),maximum:e})}function ct(e,t){return new Lu({check:"min_size",...O(t),minimum:e})}function Zt(e,t){return new Cu({check:"size_equals",...O(t),size:e})}function Qt(e,t){return new xu({check:"max_length",...O(t),maximum:e})}function vt(e,t){return new zu({check:"min_length",...O(t),minimum:e})}function er(e,t){return new ju({check:"length_equals",...O(t),length:e})}function _r(e,t){return new Eu({check:"string_format",format:"regex",...O(t),pattern:e})}function Or(e){return new Uu({check:"string_format",format:"lowercase",...O(e)})}function Sr(e){return new Ru({check:"string_format",format:"uppercase",...O(e)})}function Tr(e,t){return new Ku({check:"string_format",format:"includes",...O(t),includes:e})}function Pr(e,t){return new Fu({check:"string_format",format:"starts_with",...O(t),prefix:e})}function Ar(e,t){return new Gu({check:"string_format",format:"ends_with",...O(t),suffix:e})}function ji(e,t,o){return new Bu({check:"property",property:e,schema:t,...O(o)})}function Dr(e,t){return new Hu({check:"mime_type",mime:e,...O(t)})}function Xe(e){return new Mu({check:"overwrite",tx:e})}function Nr(e){return Xe((t)=>t.normalize(e))}function Lr(){return Xe((e)=>e.trim())}function Cr(){return Xe((e)=>e.toLowerCase())}function xr(){return Xe((e)=>e.toUpperCase())}function zr(){return Xe((e)=>Fl(e))}function zs(e,t,o){return new e({type:"array",element:t,...O(o)})}function EN(e,t,o){return new e({type:"union",options:t,...O(o)})}function UN(e,t,o){return new e({type:"union",options:t,inclusive:!1,...O(o)})}function RN(e,t,o,n){return new e({type:"union",options:o,discriminator:t,...O(n)})}function KN(e,t,o){return new e({type:"intersection",left:t,right:o})}function FN(e,t,o,n){let r=o instanceof E;return new e({type:"tuple",items:t,rest:r?o:null,...O(r?n:o)})}function GN(e,t,o,n){return new e({type:"record",keyType:t,valueType:o,...O(n)})}function BN(e,t,o,n){return new e({type:"map",keyType:t,valueType:o,...O(n)})}function HN(e,t,o){return new e({type:"set",valueType:t,...O(o)})}function MN(e,t,o){let n=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:n,...O(o)})}function JN(e,t,o){return new e({type:"enum",entries:t,...O(o)})}function VN(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...O(o)})}function js(e,t){return new e({type:"file",...O(t)})}function qN(e,t){return new e({type:"transform",transform:t})}function WN(e,t){return new e({type:"optional",innerType:t})}function YN(e,t){return new e({type:"nullable",innerType:t})}function XN(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o==="function"?o():Bl(o)}})}function ZN(e,t,o){return new e({type:"nonoptional",innerType:t,...O(o)})}function QN(e,t){return new e({type:"success",innerType:t})}function eL(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o==="function"?o:()=>o})}function tL(e,t,o){return new e({type:"pipe",in:t,out:o})}function rL(e,t){return new e({type:"readonly",innerType:t})}function oL(e,t,o){return new e({type:"template_literal",parts:t,...O(o)})}function nL(e,t){return new e({type:"lazy",getter:t})}function iL(e,t){return new e({type:"promise",innerType:t})}function Es(e,t,o){let n=O(o);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Us(e,t,o){return new e({type:"custom",check:"custom",fn:t,...O(o)})}function Rs(e){let t=h$((o)=>{return o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(pr(n,o.value,t._zod.def));else{let r=n;if(r.fatal)r.continue=!1;r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(pr(r))}},e(o.value,o)});return t}function h$(e,t){let o=new te({check:"custom",...O(t)});return o._zod.check=e,o}function Ks(e){let t=new te({check:"describe"});return t._zod.onattach=[(o)=>{let n=ve.get(o)??{};ve.add(o,{...n,description:e})}],t._zod.check=()=>{},t}function Fs(e){let t=new te({check:"meta"});return t._zod.onattach=[(o)=>{let n=ve.get(o)??{};ve.add(o,{...n,...e})}],t._zod.check=()=>{},t}function Gs(e,t){let o=O(t),n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];if(o.case!=="sensitive")n=n.map((y)=>typeof y==="string"?y.toLowerCase():y),r=r.map((y)=>typeof y==="string"?y.toLowerCase():y);let i=new Set(n),a=new Set(r),c=e.Codec??Ho,u=e.Boolean??Go,s=new(e.String??Xt)({type:"string",error:o.error}),g=new u({type:"boolean",error:o.error}),b=new c({type:"pipe",in:s,out:g,transform:(y,_)=>{let S=y;if(o.case!=="sensitive")S=S.toLowerCase();if(i.has(S))return!0;else if(a.has(S))return!1;else return _.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:_.value,inst:b,continue:!1}),{}},reverseTransform:(y,_)=>{if(y===!0)return n[0]||"true";else return r[0]||"false"},error:o.error});return b}function jr(e,t,o,n={}){let r=O(n),i={...O(n),check:"string_format",type:"string",format:t,fn:typeof o==="function"?o:(c)=>o.test(c),...r};if(o instanceof RegExp)i.pattern=o;return new e(i)}var cs;var g$=d(()=>{ei();Yo();ng();x();cs={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function jt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??ve,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Z(e,t,o={path:[],schemaPath:[]}){var n;let r=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,o.schemaPath.includes(e))i.cycle=o.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,a);let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let s={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,s);else{let b=a.schema,y=t.processors[r.type];if(!y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);y(e,t,b,s)}let g=e._zod.parent;if(g){if(!a.ref)a.ref=g;Z(g,t,s),t.seen.get(g).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)Object.assign(a.schema,u);if(t.io==="input"&&De(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&a.schema._prefault)(n=a.schema).default??(n.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function Et(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let u=n.get(c);if(u&&u!==a[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,a[0])}}let r=(a)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let g=e.external.registry.get(a[0])?.id,b=e.external.uri??((_)=>_);if(g)return{ref:b(g)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${b("__shared")}#/${c}/${y}`}}if(a[1]===o)return{ref:"#"};let h=`${"#"}/${c}/`,s=a[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:h+s}},i=(a)=>{if(a[1].schema.$ref)return;let c=a[1],{ref:u,defId:h}=r(a);if(c.def={...c.schema},h)c.defId=h;let s=c.schema;for(let g in s)delete s[g];s.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
4163
4280
|
|
|
4164
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(t===a[0]){i(a);continue}if(e.external){let h=e.external.registry.get(a[0])?.id;if(t!==a[0]&&h){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(c.cycle){i(a);continue}if(c.count>1){if(e.reused==="ref"){i(a);continue}}}}function Ut(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,h={...u},d=c.ref;if(c.ref=null,d){n(d);let b=e.seen.get(d),y=b.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(y);else Object.assign(u,y);if(Object.assign(u,h),a._zod.parent===d)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(!(S in h))delete u[S]}if(y.$ref&&b.def)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(S in b.def&&JSON.stringify(u[S])===JSON.stringify(b.def[S]))delete u[S]}}let g=a._zod.parent;if(g&&g!==d){n(g);let b=e.seen.get(g);if(b?.schema.$ref){if(u.$ref=b.schema.$ref,b.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in b.def&&JSON.stringify(u[y])===JSON.stringify(b.def[y]))delete u[y]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let r={};if(e.target==="draft-2020-12")r.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")r.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")r.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}Object.assign(r,o.def??o.schema);let i=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId)i[c.defId]=c.def}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")r.$defs=i;else r.definitions=i;try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Er(t,"input",e.processors),output:Er(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function De(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return De(n.element,o);if(n.type==="set")return De(n.valueType,o);if(n.type==="lazy")return De(n.getter(),o);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return De(n.innerType,o);if(n.type==="intersection")return De(n.left,o)||De(n.right,o);if(n.type==="record"||n.type==="map")return De(n.keyType,o)||De(n.valueType,o);if(n.type==="pipe")return De(n.in,o)||De(n.out,o);if(n.type==="object"){for(let r in n.shape)if(De(n.shape[r],o))return!0;return!1}if(n.type==="union"){for(let r of n.options)if(De(r,o))return!0;return!1}if(n.type==="tuple"){for(let r of n.items)if(De(r,o))return!0;if(n.rest&&De(n.rest,o))return!0;return!1}return!1}var Fd=(e,t={})=>(o)=>{let n=jt({...o,processors:t});return Z(e,n),Et(n,e),Ut(n,e)},Er=(e,t,o={})=>(n)=>{let{libraryOptions:r,target:i}=n??{},a=jt({...r??{},target:i,io:t,processors:o});return Z(e,a),Et(a,e),Ut(a,e)};var Qo=s(()=>{Yo()});function Ki(e,t){if("_idmap"in e){let n=e,r=jt({...t,processors:Ei}),i={};for(let u of n._idmap.entries()){let[h,d]=u;Z(d,r)}let a={},c={registry:n,uri:t?.uri,defs:i};r.external=c;for(let u of n._idmap.entries()){let[h,d]=u;Et(r,d),a[h]=Ut(r,d)}if(Object.keys(i).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let o=jt({...t,processors:Ei});return Z(e,o),Et(o,e),Ut(o,e)}var aL,Jd=(e,t,o,n)=>{let r=o;r.type="string";let{minimum:i,maximum:a,format:c,patterns:u,contentEncoding:h}=e._zod.bag;if(typeof i==="number")r.minLength=i;if(typeof a==="number")r.maxLength=a;if(c){if(r.format=aL[c]??c,r.format==="")delete r.format;if(c==="time")delete r.format}if(h)r.contentEncoding=h;if(u&&u.size>0){let d=[...u];if(d.length===1)r.pattern=d[0].source;else if(d.length>1)r.allOf=[...d.map((g)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))]}},Hd=(e,t,o,n)=>{let r=o,{minimum:i,maximum:a,format:c,multipleOf:u,exclusiveMaximum:h,exclusiveMinimum:d}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))r.type="integer";else r.type="number";if(typeof d==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")r.minimum=d,r.exclusiveMinimum=!0;else r.exclusiveMinimum=d;if(typeof i==="number"){if(r.minimum=i,typeof d==="number"&&t.target!=="draft-04")if(d>=i)delete r.minimum;else delete r.exclusiveMinimum}if(typeof h==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")r.maximum=h,r.exclusiveMaximum=!0;else r.exclusiveMaximum=h;if(typeof a==="number"){if(r.maximum=a,typeof h==="number"&&t.target!=="draft-04")if(h<=a)delete r.maximum;else delete r.exclusiveMaximum}if(typeof u==="number")r.multipleOf=u},Md=(e,t,o,n)=>{o.type="boolean"},Vd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},qd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Wd=(e,t,o,n)=>{if(t.target==="openapi-3.0")o.type="string",o.nullable=!0,o.enum=[null];else o.type="null"},Yd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Xd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Zd=(e,t,o,n)=>{o.not={}},Qd=(e,t,o,n)=>{},es=(e,t,o,n)=>{},ts=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},rs=(e,t,o,n)=>{let r=e._zod.def,i=No(r.entries);if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";o.enum=i},os=(e,t,o,n)=>{let r=e._zod.def,i=[];for(let a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(a));else i.push(a);if(i.length===0);else if(i.length===1){let a=i[0];if(o.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")o.enum=[a];else o.const=a}else{if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";if(i.every((a)=>typeof a==="boolean"))o.type="boolean";if(i.every((a)=>a===null))o.type="null";o.enum=i}},ns=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},is=(e,t,o,n)=>{let r=o,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},as=(e,t,o,n)=>{let r=o,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:u}=e._zod.bag;if(a!==void 0)i.minLength=a;if(c!==void 0)i.maxLength=c;if(u)if(u.length===1)i.contentMediaType=u[0],Object.assign(r,i);else Object.assign(r,i),r.anyOf=u.map((h)=>({contentMediaType:h}));else Object.assign(r,i)},cs=(e,t,o,n)=>{o.type="boolean"},ls=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},us=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},hs=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},gs=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ds=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},ss=(e,t,o,n)=>{let r=o,i=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;if(typeof a==="number")r.minItems=a;if(typeof c==="number")r.maxItems=c;r.type="array",r.items=Z(i.element,t,{...n,path:[...n.path,"items"]})},bs=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let h in a)r.properties[h]=Z(a[h],t,{...n,path:[...n.path,"properties",h]});let c=new Set(Object.keys(a)),u=new Set([...c].filter((h)=>{let d=i.shape[h]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(u.size>0)r.required=Array.from(u);if(i.catchall?._zod.def.type==="never")r.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")r.additionalProperties=!1}else if(i.catchall)r.additionalProperties=Z(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},Ui=(e,t,o,n)=>{let r=e._zod.def,i=r.inclusive===!1,a=r.options.map((c,u)=>Z(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)o.oneOf=a;else o.anyOf=a},ys=(e,t,o,n)=>{let r=e._zod.def,i=Z(r.left,t,{...n,path:[...n.path,"allOf",0]}),a=Z(r.right,t,{...n,path:[...n.path,"allOf",1]}),c=(h)=>("allOf"in h)&&Object.keys(h).length===1,u=[...c(i)?i.allOf:[i],...c(a)?a.allOf:[a]];o.allOf=u},ms=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((b,y)=>Z(b,t,{...n,path:[...n.path,a,y]})),h=i.rest?Z(i.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(r.prefixItems=u,h)r.items=h}else if(t.target==="openapi-3.0"){if(r.items={anyOf:u},h)r.items.anyOf.push(h);if(r.minItems=u.length,!h)r.maxItems=u.length}else if(r.items=u,h)r.additionalItems=h;let{minimum:d,maximum:g}=e._zod.bag;if(typeof d==="number")r.minItems=d;if(typeof g==="number")r.maxItems=g},ps=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let d=Z(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});r.patternProperties={};for(let g of u)r.patternProperties[g.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")r.propertyNames=Z(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});r.additionalProperties=Z(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let h=a._zod.values;if(h){let d=[...h].filter((g)=>typeof g==="string"||typeof g==="number");if(d.length>0)r.required=d}},vs=(e,t,o,n)=>{let r=e._zod.def,i=Z(r.innerType,t,n),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=r.innerType,o.nullable=!0;else o.anyOf=[i,{type:"null"}]},Is=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},fs=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType,o.default=JSON.parse(JSON.stringify(r.defaultValue))},ks=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);if(i.ref=r.innerType,t.io==="input")o._prefault=JSON.parse(JSON.stringify(r.defaultValue))},$s=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}o.default=a},ws=(e,t,o,n)=>{let r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Z(i,t,n);let a=t.seen.get(e);a.ref=i},_s=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType,o.readOnly=!0},Os=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},Ri=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},Ss=(e,t,o,n)=>{let r=e._zod.innerType;Z(r,t,n);let i=t.seen.get(e);i.ref=r},Ei;var en=s(()=>{Qo();x();aL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ei={string:Jd,number:Hd,boolean:Md,bigint:Vd,symbol:qd,null:Wd,undefined:Yd,void:Xd,never:Zd,any:Qd,unknown:es,date:ts,enum:rs,literal:os,nan:ns,template_literal:is,file:as,success:cs,custom:ls,function:us,transform:hs,map:gs,set:ds,array:ss,object:bs,union:Ui,intersection:ys,tuple:ms,record:ps,nullable:vs,nonoptional:Is,default:fs,prefault:ks,catch:$s,pipe:ws,readonly:_s,promise:Os,optional:Ri,lazy:Ss}});class Ts{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=jt({processors:Ei,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Z(e,this.ctx,t)}emit(e,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}Et(this.ctx,e);let o=Ut(this.ctx,e),{"~standard":n,...r}=o;return r}}var d$=s(()=>{en();Qo()});var s$={};var b$=()=>{};var It={};Qe(It,{version:()=>Mu,util:()=>w,treeifyError:()=>ql,toJSONSchema:()=>Ki,toDotPath:()=>Jf,safeParseAsync:()=>Zl,safeParse:()=>Xl,safeEncodeAsync:()=>sD,safeEncode:()=>gD,safeDecodeAsync:()=>bD,safeDecode:()=>dD,registry:()=>gi,regexes:()=>Me,process:()=>Z,prettifyError:()=>Wl,parseAsync:()=>Gn,parse:()=>Kn,meta:()=>Gd,locales:()=>Wo,isValidJWT:()=>uk,isValidBase64URL:()=>lk,isValidBase64:()=>yh,initializeContext:()=>jt,globalRegistry:()=>ve,globalConfig:()=>Ao,formatError:()=>Uo,flattenError:()=>Eo,finalize:()=>Ut,extractDefs:()=>Et,encodeAsync:()=>uD,encode:()=>cD,describe:()=>Kd,decodeAsync:()=>hD,decode:()=>lD,createToJSONSchemaMethod:()=>Fd,createStandardJSONSchemaMethod:()=>Er,config:()=>ue,clone:()=>Pe,_xor:()=>UN,_xid:()=>$i,_void:()=>Nd,_uuidv7:()=>mi,_uuidv6:()=>yi,_uuidv4:()=>bi,_uuid:()=>si,_url:()=>Zo,_uppercase:()=>Sr,_unknown:()=>Ad,_union:()=>EN,_undefined:()=>Sd,_ulid:()=>ki,_uint64:()=>_d,_uint32:()=>vd,_tuple:()=>GN,_trim:()=>Lr,_transform:()=>qN,_toUpperCase:()=>xr,_toLowerCase:()=>Cr,_templateLiteral:()=>oL,_symbol:()=>Od,_superRefine:()=>Rd,_success:()=>QN,_stringbool:()=>Bd,_stringFormat:()=>jr,_string:()=>nd,_startsWith:()=>Pr,_slugify:()=>zr,_size:()=>Zt,_set:()=>JN,_safeParseAsync:()=>kr,_safeParse:()=>fr,_safeEncodeAsync:()=>qn,_safeEncode:()=>Mn,_safeDecodeAsync:()=>Wn,_safeDecode:()=>Vn,_regex:()=>_r,_refine:()=>Ud,_record:()=>BN,_readonly:()=>rL,_property:()=>ji,_promise:()=>iL,_positive:()=>Li,_pipe:()=>tL,_parseAsync:()=>Ir,_parse:()=>vr,_overwrite:()=>Xe,_optional:()=>WN,_number:()=>dd,_nullable:()=>YN,_null:()=>Td,_normalize:()=>Nr,_nonpositive:()=>xi,_nonoptional:()=>ZN,_nonnegative:()=>zi,_never:()=>Dd,_negative:()=>Ci,_nativeEnum:()=>MN,_nanoid:()=>vi,_nan:()=>xd,_multipleOf:()=>xt,_minSize:()=>ct,_minLength:()=>vt,_min:()=>Ae,_mime:()=>Dr,_maxSize:()=>zt,_maxLength:()=>Qt,_max:()=>Ee,_map:()=>FN,_mac:()=>ad,_lte:()=>Ee,_lt:()=>it,_lowercase:()=>Or,_literal:()=>VN,_length:()=>er,_lazy:()=>nL,_ksuid:()=>wi,_jwt:()=>Ni,_isoTime:()=>hd,_isoDuration:()=>gd,_isoDateTime:()=>ld,_isoDate:()=>ud,_ipv6:()=>Oi,_ipv4:()=>_i,_intersection:()=>KN,_int64:()=>wd,_int32:()=>pd,_int:()=>bd,_includes:()=>Tr,_guid:()=>Xo,_gte:()=>Ae,_gt:()=>at,_float64:()=>md,_float32:()=>yd,_file:()=>jd,_enum:()=>HN,_endsWith:()=>Ar,_encodeAsync:()=>Jn,_encode:()=>Bn,_emoji:()=>pi,_email:()=>di,_e164:()=>Di,_discriminatedUnion:()=>RN,_default:()=>XN,_decodeAsync:()=>Hn,_decode:()=>Fn,_date:()=>Ld,_custom:()=>Ed,_cuid2:()=>fi,_cuid:()=>Ii,_coercedString:()=>id,_coercedNumber:()=>sd,_coercedDate:()=>Cd,_coercedBoolean:()=>fd,_coercedBigint:()=>$d,_cidrv6:()=>Ti,_cidrv4:()=>Si,_check:()=>h$,_catch:()=>eL,_boolean:()=>Id,_bigint:()=>kd,_base64url:()=>Ai,_base64:()=>Pi,_array:()=>zd,_any:()=>Pd,TimePrecision:()=>cd,NEVER:()=>El,JSONSchemaGenerator:()=>Ts,JSONSchema:()=>s$,Doc:()=>ti,$output:()=>td,$input:()=>rd,$constructor:()=>m,$brand:()=>Ul,$ZodXor:()=>Ch,$ZodXID:()=>nh,$ZodVoid:()=>Ah,$ZodUnknown:()=>Th,$ZodUnion:()=>Fo,$ZodUndefined:()=>_h,$ZodUUID:()=>Yu,$ZodURL:()=>Zu,$ZodULID:()=>oh,$ZodType:()=>E,$ZodTuple:()=>ui,$ZodTransform:()=>Bh,$ZodTemplateLiteral:()=>Qh,$ZodSymbol:()=>wh,$ZodSuccess:()=>qh,$ZodStringFormat:()=>Q,$ZodString:()=>Xt,$ZodSet:()=>Uh,$ZodRegistry:()=>od,$ZodRecord:()=>jh,$ZodRealError:()=>xe,$ZodReadonly:()=>Zh,$ZodPromise:()=>tg,$ZodPrefault:()=>Mh,$ZodPipe:()=>Xh,$ZodOptional:()=>hi,$ZodObjectJIT:()=>Lh,$ZodObject:()=>dk,$ZodNumberFormat:()=>kh,$ZodNumber:()=>ci,$ZodNullable:()=>Jh,$ZodNull:()=>Oh,$ZodNonOptional:()=>Vh,$ZodNever:()=>Ph,$ZodNanoID:()=>eh,$ZodNaN:()=>Yh,$ZodMap:()=>Eh,$ZodMAC:()=>dh,$ZodLiteral:()=>Kh,$ZodLazy:()=>rg,$ZodKSUID:()=>ih,$ZodJWT:()=>Ih,$ZodIntersection:()=>zh,$ZodISOTime:()=>lh,$ZodISODuration:()=>uh,$ZodISODateTime:()=>ah,$ZodISODate:()=>ch,$ZodIPv6:()=>gh,$ZodIPv4:()=>hh,$ZodGUID:()=>Wu,$ZodFunction:()=>eg,$ZodFile:()=>Gh,$ZodExactOptional:()=>Fh,$ZodError:()=>jo,$ZodEnum:()=>Rh,$ZodEncodeError:()=>qt,$ZodEmoji:()=>Qu,$ZodEmail:()=>Xu,$ZodE164:()=>vh,$ZodDiscriminatedUnion:()=>xh,$ZodDefault:()=>Hh,$ZodDate:()=>Dh,$ZodCustomStringFormat:()=>fh,$ZodCustom:()=>og,$ZodCodec:()=>Jo,$ZodCheckUpperCase:()=>Ru,$ZodCheckStringFormat:()=>$r,$ZodCheckStartsWith:()=>Gu,$ZodCheckSizeEquals:()=>Cu,$ZodCheckRegex:()=>Eu,$ZodCheckProperty:()=>Fu,$ZodCheckOverwrite:()=>Hu,$ZodCheckNumberFormat:()=>Au,$ZodCheckMultipleOf:()=>Pu,$ZodCheckMinSize:()=>Lu,$ZodCheckMinLength:()=>zu,$ZodCheckMimeType:()=>Ju,$ZodCheckMaxSize:()=>Nu,$ZodCheckMaxLength:()=>xu,$ZodCheckLowerCase:()=>Uu,$ZodCheckLessThan:()=>Zn,$ZodCheckLengthEquals:()=>ju,$ZodCheckIncludes:()=>Ku,$ZodCheckGreaterThan:()=>Qn,$ZodCheckEndsWith:()=>Bu,$ZodCheckBigIntFormat:()=>Du,$ZodCheck:()=>te,$ZodCatch:()=>Wh,$ZodCUID2:()=>rh,$ZodCUID:()=>th,$ZodCIDRv6:()=>bh,$ZodCIDRv4:()=>sh,$ZodBoolean:()=>Bo,$ZodBigIntFormat:()=>$h,$ZodBigInt:()=>li,$ZodBase64URL:()=>ph,$ZodBase64:()=>mh,$ZodAsyncError:()=>nt,$ZodArray:()=>Nh,$ZodAny:()=>Sh});var Ue=s(()=>{x();Xn();ed();en();d$();b$();br();Ql();Yl();ng();ei();Vu();Yo();g$();Qo()});var Gi={};Qe(Gi,{uppercase:()=>Sr,trim:()=>Lr,toUpperCase:()=>xr,toLowerCase:()=>Cr,startsWith:()=>Pr,slugify:()=>zr,size:()=>Zt,regex:()=>_r,property:()=>ji,positive:()=>Li,overwrite:()=>Xe,normalize:()=>Nr,nonpositive:()=>xi,nonnegative:()=>zi,negative:()=>Ci,multipleOf:()=>xt,minSize:()=>ct,minLength:()=>vt,mime:()=>Dr,maxSize:()=>zt,maxLength:()=>Qt,lte:()=>Ee,lt:()=>it,lowercase:()=>Or,length:()=>er,includes:()=>Tr,gte:()=>Ae,gt:()=>at,endsWith:()=>Ar});var Bi=s(()=>{Ue()});var Ur={};Qe(Ur,{time:()=>Ds,duration:()=>Ns,datetime:()=>Ps,date:()=>As,ZodISOTime:()=>Hi,ZodISODuration:()=>Mi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ji});function Ps(e){return ld(Fi,e)}function As(e){return ud(Ji,e)}function Ds(e){return hd(Hi,e)}function Ns(e){return gd(Mi,e)}var Fi,Ji,Hi,Mi;var tn=s(()=>{Ue();on();Fi=m("ZodISODateTime",(e,t)=>{ah.init(e,t),ee.init(e,t)});Ji=m("ZodISODate",(e,t)=>{ch.init(e,t),ee.init(e,t)});Hi=m("ZodISOTime",(e,t)=>{lh.init(e,t),ee.init(e,t)});Mi=m("ZodISODuration",(e,t)=>{uh.init(e,t),ee.init(e,t)})});var y$=(e,t)=>{jo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(o)=>Uo(e,o)},flatten:{value:(o)=>Eo(e,o)},addIssue:{value:(o)=>{e.issues.push(o),e.message=JSON.stringify(e.issues,yr,2)}},addIssues:{value:(o)=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,yr,2)}},isEmpty:{get(){return e.issues.length===0}}})},lL,ze;var Ls=s(()=>{Ue();Ue();x();lL=m("ZodError",y$),ze=m("ZodError",y$,{Parent:Error})});var Cs,xs,zs,js,Es,Us,Rs,Ks,Gs,Bs,Fs,Js;var Hs=s(()=>{Ue();Ls();Cs=vr(ze),xs=Ir(ze),zs=fr(ze),js=kr(ze),Es=Bn(ze),Us=Fn(ze),Rs=Jn(ze),Ks=Hn(ze),Gs=Mn(ze),Bs=Vn(ze),Fs=qn(ze),Js=Wn(ze)});var rn={};Qe(rn,{xor:()=>aw,xid:()=>A$,void:()=>ew,uuidv7:()=>k$,uuidv6:()=>f$,uuidv4:()=>I$,uuid:()=>v$,url:()=>$$,unknown:()=>tr,union:()=>ba,undefined:()=>Z$,ulid:()=>P$,uint64:()=>Y$,uint32:()=>V$,tuple:()=>ub,transform:()=>ma,templateLiteral:()=>Iw,symbol:()=>X$,superRefine:()=>jb,success:()=>mw,stringbool:()=>Tw,stringFormat:()=>K$,string:()=>Vi,strictObject:()=>nw,set:()=>gw,refine:()=>zb,record:()=>hb,readonly:()=>Ab,promise:()=>fw,preprocess:()=>Aw,prefault:()=>$b,pipe:()=>ln,partialRecord:()=>lw,optional:()=>an,object:()=>ow,number:()=>Vs,nullish:()=>yw,nullable:()=>cn,null:()=>Zs,nonoptional:()=>wb,never:()=>sa,nativeEnum:()=>dw,nanoid:()=>O$,nan:()=>pw,meta:()=>Ow,map:()=>hw,mac:()=>L$,looseRecord:()=>uw,looseObject:()=>iw,literal:()=>sw,lazy:()=>Lb,ksuid:()=>D$,keyof:()=>rw,jwt:()=>R$,json:()=>Pw,ipv6:()=>C$,ipv4:()=>N$,intersection:()=>cb,int64:()=>W$,int32:()=>M$,int:()=>qi,instanceof:()=>Sw,httpUrl:()=>w$,hostname:()=>G$,hex:()=>B$,hash:()=>F$,guid:()=>p$,function:()=>kw,float64:()=>H$,float32:()=>J$,file:()=>bw,exactOptional:()=>pb,enum:()=>ya,emoji:()=>_$,email:()=>m$,e164:()=>U$,discriminatedUnion:()=>cw,describe:()=>_w,date:()=>tw,custom:()=>ww,cuid2:()=>T$,cuid:()=>S$,codec:()=>vw,cidrv6:()=>z$,cidrv4:()=>x$,check:()=>$w,catch:()=>Sb,boolean:()=>qs,bigint:()=>q$,base64url:()=>E$,base64:()=>j$,array:()=>gn,any:()=>Q$,_function:()=>kw,_default:()=>fb,_ZodString:()=>Wi,ZodXor:()=>nb,ZodXID:()=>ra,ZodVoid:()=>rb,ZodUnknown:()=>eb,ZodUnion:()=>sn,ZodUndefined:()=>Ys,ZodUUID:()=>lt,ZodURL:()=>un,ZodULID:()=>ta,ZodType:()=>K,ZodTuple:()=>lb,ZodTransform:()=>yb,ZodTemplateLiteral:()=>Db,ZodSymbol:()=>Ws,ZodSuccess:()=>_b,ZodStringFormat:()=>ee,ZodString:()=>Kr,ZodSet:()=>db,ZodRecord:()=>bn,ZodReadonly:()=>Pb,ZodPromise:()=>Cb,ZodPrefault:()=>kb,ZodPipe:()=>Ia,ZodOptional:()=>pa,ZodObject:()=>dn,ZodNumberFormat:()=>rr,ZodNumber:()=>Br,ZodNullable:()=>vb,ZodNull:()=>Xs,ZodNonOptional:()=>va,ZodNever:()=>tb,ZodNanoID:()=>Zi,ZodNaN:()=>Tb,ZodMap:()=>gb,ZodMAC:()=>Ms,ZodLiteral:()=>sb,ZodLazy:()=>Nb,ZodKSUID:()=>oa,ZodJWT:()=>ga,ZodIntersection:()=>ab,ZodIPv6:()=>ia,ZodIPv4:()=>na,ZodGUID:()=>nn,ZodFunction:()=>xb,ZodFile:()=>bb,ZodExactOptional:()=>mb,ZodEnum:()=>Rr,ZodEmoji:()=>Xi,ZodEmail:()=>Yi,ZodE164:()=>ha,ZodDiscriminatedUnion:()=>ib,ZodDefault:()=>Ib,ZodDate:()=>hn,ZodCustomStringFormat:()=>Gr,ZodCustom:()=>yn,ZodCodec:()=>fa,ZodCatch:()=>Ob,ZodCUID2:()=>ea,ZodCUID:()=>Qi,ZodCIDRv6:()=>ca,ZodCIDRv4:()=>aa,ZodBoolean:()=>Fr,ZodBigIntFormat:()=>da,ZodBigInt:()=>Jr,ZodBase64URL:()=>ua,ZodBase64:()=>la,ZodArray:()=>ob,ZodAny:()=>Qs});function Vi(e){return nd(Kr,e)}function m$(e){return di(Yi,e)}function p$(e){return Xo(nn,e)}function v$(e){return si(lt,e)}function I$(e){return bi(lt,e)}function f$(e){return yi(lt,e)}function k$(e){return mi(lt,e)}function $$(e){return Zo(un,e)}function w$(e){return Zo(un,{protocol:/^https?$/,hostname:Me.domain,...w.normalizeParams(e)})}function _$(e){return pi(Xi,e)}function O$(e){return vi(Zi,e)}function S$(e){return Ii(Qi,e)}function T$(e){return fi(ea,e)}function P$(e){return ki(ta,e)}function A$(e){return $i(ra,e)}function D$(e){return wi(oa,e)}function N$(e){return _i(na,e)}function L$(e){return ad(Ms,e)}function C$(e){return Oi(ia,e)}function x$(e){return Si(aa,e)}function z$(e){return Ti(ca,e)}function j$(e){return Pi(la,e)}function E$(e){return Ai(ua,e)}function U$(e){return Di(ha,e)}function R$(e){return Ni(ga,e)}function K$(e,t,o={}){return jr(Gr,e,t,o)}function G$(e){return jr(Gr,"hostname",Me.hostname,e)}function B$(e){return jr(Gr,"hex",Me.hex,e)}function F$(e,t){let o=t?.enc??"hex",n=`${e}_${o}`,r=Me[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return jr(Gr,n,r,t)}function Vs(e){return dd(Br,e)}function qi(e){return bd(rr,e)}function J$(e){return yd(rr,e)}function H$(e){return md(rr,e)}function M$(e){return pd(rr,e)}function V$(e){return vd(rr,e)}function qs(e){return Id(Fr,e)}function q$(e){return kd(Jr,e)}function W$(e){return wd(da,e)}function Y$(e){return _d(da,e)}function X$(e){return Od(Ws,e)}function Z$(e){return Sd(Ys,e)}function Zs(e){return Td(Xs,e)}function Q$(){return Pd(Qs)}function tr(){return Ad(eb)}function sa(e){return Dd(tb,e)}function ew(e){return Nd(rb,e)}function tw(e){return Ld(hn,e)}function gn(e,t){return zd(ob,e,t)}function rw(e){let t=e._zod.def.shape;return ya(Object.keys(t))}function ow(e,t){let o={type:"object",shape:e??{},...w.normalizeParams(t)};return new dn(o)}function nw(e,t){return new dn({type:"object",shape:e,catchall:sa(),...w.normalizeParams(t)})}function iw(e,t){return new dn({type:"object",shape:e,catchall:tr(),...w.normalizeParams(t)})}function ba(e,t){return new sn({type:"union",options:e,...w.normalizeParams(t)})}function aw(e,t){return new nb({type:"union",options:e,inclusive:!1,...w.normalizeParams(t)})}function cw(e,t,o){return new ib({type:"union",options:t,discriminator:e,...w.normalizeParams(o)})}function cb(e,t){return new ab({type:"intersection",left:e,right:t})}function ub(e,t,o){let n=t instanceof E,r=n?o:t;return new lb({type:"tuple",items:e,rest:n?t:null,...w.normalizeParams(r)})}function hb(e,t,o){return new bn({type:"record",keyType:e,valueType:t,...w.normalizeParams(o)})}function lw(e,t,o){let n=Pe(e);return n._zod.values=void 0,new bn({type:"record",keyType:n,valueType:t,...w.normalizeParams(o)})}function uw(e,t,o){return new bn({type:"record",keyType:e,valueType:t,mode:"loose",...w.normalizeParams(o)})}function hw(e,t,o){return new gb({type:"map",keyType:e,valueType:t,...w.normalizeParams(o)})}function gw(e,t){return new db({type:"set",valueType:e,...w.normalizeParams(t)})}function ya(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Rr({type:"enum",entries:o,...w.normalizeParams(t)})}function dw(e,t){return new Rr({type:"enum",entries:e,...w.normalizeParams(t)})}function sw(e,t){return new sb({type:"literal",values:Array.isArray(e)?e:[e],...w.normalizeParams(t)})}function bw(e){return jd(bb,e)}function ma(e){return new yb({type:"transform",transform:e})}function an(e){return new pa({type:"optional",innerType:e})}function pb(e){return new mb({type:"optional",innerType:e})}function cn(e){return new vb({type:"nullable",innerType:e})}function yw(e){return an(cn(e))}function fb(e,t){return new Ib({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():w.shallowClone(t)}})}function $b(e,t){return new kb({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():w.shallowClone(t)}})}function wb(e,t){return new va({type:"nonoptional",innerType:e,...w.normalizeParams(t)})}function mw(e){return new _b({type:"success",innerType:e})}function Sb(e,t){return new Ob({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}function pw(e){return xd(Tb,e)}function ln(e,t){return new Ia({type:"pipe",in:e,out:t})}function vw(e,t,o){return new fa({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function Ab(e){return new Pb({type:"readonly",innerType:e})}function Iw(e,t){return new Db({type:"template_literal",parts:e,...w.normalizeParams(t)})}function Lb(e){return new Nb({type:"lazy",getter:e})}function fw(e){return new Cb({type:"promise",innerType:e})}function kw(e){return new xb({type:"function",input:Array.isArray(e?.input)?ub(e?.input):e?.input??gn(tr()),output:e?.output??tr()})}function $w(e){let t=new te({check:"custom"});return t._zod.check=e,t}function ww(e,t){return Ed(yn,e??(()=>!0),t)}function zb(e,t={}){return Ud(yn,e,t)}function jb(e){return Rd(e)}function Sw(e,t={}){let o=new yn({type:"custom",check:"custom",fn:(n)=>n instanceof e,abort:!0,...w.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=(n)=>{if(!(n.value instanceof e))n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:o,path:[...o._zod.def.path??[]]})},o}function Pw(e){let t=Lb(()=>{return ba([Vi(e),Vs(),qs(),Zs(),gn(t),hb(Vi(),t)])});return t}function Aw(e,t){return ln(ma(e),t)}var K,Wi,Kr,ee,Yi,nn,lt,un,Xi,Zi,Qi,ea,ta,ra,oa,na,Ms,ia,aa,ca,la,ua,ha,ga,Gr,Br,rr,Fr,Jr,da,Ws,Ys,Xs,Qs,eb,tb,rb,hn,ob,dn,sn,nb,ib,ab,lb,bn,gb,db,Rr,sb,bb,yb,pa,mb,vb,Ib,kb,va,_b,Ob,Tb,Ia,fa,Pb,Db,Nb,Cb,xb,yn,_w,Ow,Tw=(...e)=>Bd({Codec:fa,Boolean:Fr,String:Kr},...e);var on=s(()=>{Ue();Ue();en();Qo();Bi();tn();Hs();K=m("ZodType",(e,t)=>{return E.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Er(e,"input"),output:Er(e,"output")}}),e.toJSONSchema=Fd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>{return e.clone(w.mergeDefs(t,{checks:[...t.checks??[],...o.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},e.with=e.check,e.clone=(o,n)=>Pe(e,o,n),e.brand=()=>e,e.register=(o,n)=>{return o.add(e,n),e},e.parse=(o,n)=>Cs(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>zs(e,o,n),e.parseAsync=async(o,n)=>xs(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>js(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Es(e,o,n),e.decode=(o,n)=>Us(e,o,n),e.encodeAsync=async(o,n)=>Rs(e,o,n),e.decodeAsync=async(o,n)=>Ks(e,o,n),e.safeEncode=(o,n)=>Gs(e,o,n),e.safeDecode=(o,n)=>Bs(e,o,n),e.safeEncodeAsync=async(o,n)=>Fs(e,o,n),e.safeDecodeAsync=async(o,n)=>Js(e,o,n),e.refine=(o,n)=>e.check(zb(o,n)),e.superRefine=(o)=>e.check(jb(o)),e.overwrite=(o)=>e.check(Xe(o)),e.optional=()=>an(e),e.exactOptional=()=>pb(e),e.nullable=()=>cn(e),e.nullish=()=>an(cn(e)),e.nonoptional=(o)=>wb(e,o),e.array=()=>gn(e),e.or=(o)=>ba([e,o]),e.and=(o)=>cb(e,o),e.transform=(o)=>ln(e,ma(o)),e.default=(o)=>fb(e,o),e.prefault=(o)=>$b(e,o),e.catch=(o)=>Sb(e,o),e.pipe=(o)=>ln(e,o),e.readonly=()=>Ab(e),e.describe=(o)=>{let n=e.clone();return ve.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return ve.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return ve.get(e);let n=e.clone();return ve.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=(o)=>o(e),e}),Wi=m("_ZodString",(e,t)=>{Xt.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Jd(e,n,r,i);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(_r(...n)),e.includes=(...n)=>e.check(Tr(...n)),e.startsWith=(...n)=>e.check(Pr(...n)),e.endsWith=(...n)=>e.check(Ar(...n)),e.min=(...n)=>e.check(vt(...n)),e.max=(...n)=>e.check(Qt(...n)),e.length=(...n)=>e.check(er(...n)),e.nonempty=(...n)=>e.check(vt(1,...n)),e.lowercase=(n)=>e.check(Or(n)),e.uppercase=(n)=>e.check(Sr(n)),e.trim=()=>e.check(Lr()),e.normalize=(...n)=>e.check(Nr(...n)),e.toLowerCase=()=>e.check(Cr()),e.toUpperCase=()=>e.check(xr()),e.slugify=()=>e.check(zr())}),Kr=m("ZodString",(e,t)=>{Xt.init(e,t),Wi.init(e,t),e.email=(o)=>e.check(di(Yi,o)),e.url=(o)=>e.check(Zo(un,o)),e.jwt=(o)=>e.check(Ni(ga,o)),e.emoji=(o)=>e.check(pi(Xi,o)),e.guid=(o)=>e.check(Xo(nn,o)),e.uuid=(o)=>e.check(si(lt,o)),e.uuidv4=(o)=>e.check(bi(lt,o)),e.uuidv6=(o)=>e.check(yi(lt,o)),e.uuidv7=(o)=>e.check(mi(lt,o)),e.nanoid=(o)=>e.check(vi(Zi,o)),e.guid=(o)=>e.check(Xo(nn,o)),e.cuid=(o)=>e.check(Ii(Qi,o)),e.cuid2=(o)=>e.check(fi(ea,o)),e.ulid=(o)=>e.check(ki(ta,o)),e.base64=(o)=>e.check(Pi(la,o)),e.base64url=(o)=>e.check(Ai(ua,o)),e.xid=(o)=>e.check($i(ra,o)),e.ksuid=(o)=>e.check(wi(oa,o)),e.ipv4=(o)=>e.check(_i(na,o)),e.ipv6=(o)=>e.check(Oi(ia,o)),e.cidrv4=(o)=>e.check(Si(aa,o)),e.cidrv6=(o)=>e.check(Ti(ca,o)),e.e164=(o)=>e.check(Di(ha,o)),e.datetime=(o)=>e.check(Ps(o)),e.date=(o)=>e.check(As(o)),e.time=(o)=>e.check(Ds(o)),e.duration=(o)=>e.check(Ns(o))});ee=m("ZodStringFormat",(e,t)=>{Q.init(e,t),Wi.init(e,t)}),Yi=m("ZodEmail",(e,t)=>{Xu.init(e,t),ee.init(e,t)});nn=m("ZodGUID",(e,t)=>{Wu.init(e,t),ee.init(e,t)});lt=m("ZodUUID",(e,t)=>{Yu.init(e,t),ee.init(e,t)});un=m("ZodURL",(e,t)=>{Zu.init(e,t),ee.init(e,t)});Xi=m("ZodEmoji",(e,t)=>{Qu.init(e,t),ee.init(e,t)});Zi=m("ZodNanoID",(e,t)=>{eh.init(e,t),ee.init(e,t)});Qi=m("ZodCUID",(e,t)=>{th.init(e,t),ee.init(e,t)});ea=m("ZodCUID2",(e,t)=>{rh.init(e,t),ee.init(e,t)});ta=m("ZodULID",(e,t)=>{oh.init(e,t),ee.init(e,t)});ra=m("ZodXID",(e,t)=>{nh.init(e,t),ee.init(e,t)});oa=m("ZodKSUID",(e,t)=>{ih.init(e,t),ee.init(e,t)});na=m("ZodIPv4",(e,t)=>{hh.init(e,t),ee.init(e,t)});Ms=m("ZodMAC",(e,t)=>{dh.init(e,t),ee.init(e,t)});ia=m("ZodIPv6",(e,t)=>{gh.init(e,t),ee.init(e,t)});aa=m("ZodCIDRv4",(e,t)=>{sh.init(e,t),ee.init(e,t)});ca=m("ZodCIDRv6",(e,t)=>{bh.init(e,t),ee.init(e,t)});la=m("ZodBase64",(e,t)=>{mh.init(e,t),ee.init(e,t)});ua=m("ZodBase64URL",(e,t)=>{ph.init(e,t),ee.init(e,t)});ha=m("ZodE164",(e,t)=>{vh.init(e,t),ee.init(e,t)});ga=m("ZodJWT",(e,t)=>{Ih.init(e,t),ee.init(e,t)});Gr=m("ZodCustomStringFormat",(e,t)=>{fh.init(e,t),ee.init(e,t)});Br=m("ZodNumber",(e,t)=>{ci.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hd(e,n,r,i),e.gt=(n,r)=>e.check(at(n,r)),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.lt=(n,r)=>e.check(it(n,r)),e.lte=(n,r)=>e.check(Ee(n,r)),e.max=(n,r)=>e.check(Ee(n,r)),e.int=(n)=>e.check(qi(n)),e.safe=(n)=>e.check(qi(n)),e.positive=(n)=>e.check(at(0,n)),e.nonnegative=(n)=>e.check(Ae(0,n)),e.negative=(n)=>e.check(it(0,n)),e.nonpositive=(n)=>e.check(Ee(0,n)),e.multipleOf=(n,r)=>e.check(xt(n,r)),e.step=(n,r)=>e.check(xt(n,r)),e.finite=()=>e;let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??0.5),e.isFinite=!0,e.format=o.format??null});rr=m("ZodNumberFormat",(e,t)=>{kh.init(e,t),Br.init(e,t)});Fr=m("ZodBoolean",(e,t)=>{Bo.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Md(e,o,n,r)});Jr=m("ZodBigInt",(e,t)=>{li.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Vd(e,n,r,i),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.gt=(n,r)=>e.check(at(n,r)),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.lt=(n,r)=>e.check(it(n,r)),e.lte=(n,r)=>e.check(Ee(n,r)),e.max=(n,r)=>e.check(Ee(n,r)),e.positive=(n)=>e.check(at(BigInt(0),n)),e.negative=(n)=>e.check(it(BigInt(0),n)),e.nonpositive=(n)=>e.check(Ee(BigInt(0),n)),e.nonnegative=(n)=>e.check(Ae(BigInt(0),n)),e.multipleOf=(n,r)=>e.check(xt(n,r));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});da=m("ZodBigIntFormat",(e,t)=>{$h.init(e,t),Jr.init(e,t)});Ws=m("ZodSymbol",(e,t)=>{wh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>qd(e,o,n,r)});Ys=m("ZodUndefined",(e,t)=>{_h.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Yd(e,o,n,r)});Xs=m("ZodNull",(e,t)=>{Oh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Wd(e,o,n,r)});Qs=m("ZodAny",(e,t)=>{Sh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Qd(e,o,n,r)});eb=m("ZodUnknown",(e,t)=>{Th.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>es(e,o,n,r)});tb=m("ZodNever",(e,t)=>{Ph.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Zd(e,o,n,r)});rb=m("ZodVoid",(e,t)=>{Ah.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Xd(e,o,n,r)});hn=m("ZodDate",(e,t)=>{Dh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ts(e,n,r,i),e.min=(n,r)=>e.check(Ae(n,r)),e.max=(n,r)=>e.check(Ee(n,r));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});ob=m("ZodArray",(e,t)=>{Nh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ss(e,o,n,r),e.element=t.element,e.min=(o,n)=>e.check(vt(o,n)),e.nonempty=(o)=>e.check(vt(1,o)),e.max=(o,n)=>e.check(Qt(o,n)),e.length=(o,n)=>e.check(er(o,n)),e.unwrap=()=>e.element});dn=m("ZodObject",(e,t)=>{Lh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>bs(e,o,n,r),w.defineLazy(e,"shape",()=>{return t.shape}),e.keyof=()=>ya(Object.keys(e._zod.def.shape)),e.catchall=(o)=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:tr()}),e.loose=()=>e.clone({...e._zod.def,catchall:tr()}),e.strict=()=>e.clone({...e._zod.def,catchall:sa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(o)=>{return w.extend(e,o)},e.safeExtend=(o)=>{return w.safeExtend(e,o)},e.merge=(o)=>w.merge(e,o),e.pick=(o)=>w.pick(e,o),e.omit=(o)=>w.omit(e,o),e.partial=(...o)=>w.partial(pa,e,o[0]),e.required=(...o)=>w.required(va,e,o[0])});sn=m("ZodUnion",(e,t)=>{Fo.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ui(e,o,n,r),e.options=t.options});nb=m("ZodXor",(e,t)=>{sn.init(e,t),Ch.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ui(e,o,n,r),e.options=t.options});ib=m("ZodDiscriminatedUnion",(e,t)=>{sn.init(e,t),xh.init(e,t)});ab=m("ZodIntersection",(e,t)=>{zh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ys(e,o,n,r)});lb=m("ZodTuple",(e,t)=>{ui.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ms(e,o,n,r),e.rest=(o)=>e.clone({...e._zod.def,rest:o})});bn=m("ZodRecord",(e,t)=>{jh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ps(e,o,n,r),e.keyType=t.keyType,e.valueType=t.valueType});gb=m("ZodMap",(e,t)=>{Eh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>gs(e,o,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(ct(...o)),e.nonempty=(o)=>e.check(ct(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Zt(...o))});db=m("ZodSet",(e,t)=>{Uh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ds(e,o,n,r),e.min=(...o)=>e.check(ct(...o)),e.nonempty=(o)=>e.check(ct(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Zt(...o))});Rr=m("ZodEnum",(e,t)=>{Rh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rs(e,n,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{let i={};for(let a of n)if(o.has(a))i[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new Rr({...t,checks:[],...w.normalizeParams(r),entries:i})},e.exclude=(n,r)=>{let i={...t.entries};for(let a of n)if(o.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new Rr({...t,checks:[],...w.normalizeParams(r),entries:i})}});sb=m("ZodLiteral",(e,t)=>{Kh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>os(e,o,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});bb=m("ZodFile",(e,t)=>{Gh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>as(e,o,n,r),e.min=(o,n)=>e.check(ct(o,n)),e.max=(o,n)=>e.check(zt(o,n)),e.mime=(o,n)=>e.check(Dr(Array.isArray(o)?o:[o],n))});yb=m("ZodTransform",(e,t)=>{Bh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>hs(e,o,n,r),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt(e.constructor.name);o.addIssue=(i)=>{if(typeof i==="string")o.issues.push(w.issue(i,o.value,t));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=o.value),a.inst??(a.inst=e),o.issues.push(w.issue(a))}};let r=t.transform(o.value,o);if(r instanceof Promise)return r.then((i)=>{return o.value=i,o});return o.value=r,o}});pa=m("ZodOptional",(e,t)=>{hi.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ri(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});mb=m("ZodExactOptional",(e,t)=>{Fh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ri(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});vb=m("ZodNullable",(e,t)=>{Jh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>vs(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Ib=m("ZodDefault",(e,t)=>{Hh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>fs(e,o,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});kb=m("ZodPrefault",(e,t)=>{Mh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ks(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});va=m("ZodNonOptional",(e,t)=>{Vh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Is(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});_b=m("ZodSuccess",(e,t)=>{qh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>cs(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Ob=m("ZodCatch",(e,t)=>{Wh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>$s(e,o,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Tb=m("ZodNaN",(e,t)=>{Yh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ns(e,o,n,r)});Ia=m("ZodPipe",(e,t)=>{Xh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ws(e,o,n,r),e.in=t.in,e.out=t.out});fa=m("ZodCodec",(e,t)=>{Ia.init(e,t),Jo.init(e,t)});Pb=m("ZodReadonly",(e,t)=>{Zh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>_s(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Db=m("ZodTemplateLiteral",(e,t)=>{Qh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>is(e,o,n,r)});Nb=m("ZodLazy",(e,t)=>{rg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ss(e,o,n,r),e.unwrap=()=>e._zod.def.getter()});Cb=m("ZodPromise",(e,t)=>{tg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Os(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});xb=m("ZodFunction",(e,t)=>{eg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>us(e,o,n,r)});yn=m("ZodCustom",(e,t)=>{og.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ls(e,o,n,r)});_w=Kd,Ow=Gd});function gL(e){ue({customError:e})}function dL(){return ue().customError}var hL,Eb;var Dw=s(()=>{Ue();hL={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(e){})(Eb||(Eb={}))});function bL(e,t){let o=e.$schema;if(o==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(o==="http://json-schema.org/draft-07/schema#")return"draft-7";if(o==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function yL(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===n){let r=o[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Nw(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return A.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return A.lazy(()=>{if(!t.refs.has(r))throw Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=yL(r,t),a=Oe(i,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return A.null();if(r.length===0)return A.never();if(r.length===1)return A.literal(r[0]);if(r.every((a)=>typeof a==="string"))return A.enum(r);let i=r.map((a)=>A.literal(a));if(i.length<2)return i[0];return A.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return A.literal(e.const);let o=e.type;if(Array.isArray(o)){let r=o.map((i)=>{let a={...e,type:i};return Nw(a,t)});if(r.length===0)return A.never();if(r.length===1)return r[0];return A.union(r)}if(!o)return A.any();let n;switch(o){case"string":{let r=A.string();if(e.format){let i=e.format;if(i==="email")r=r.check(A.email());else if(i==="uri"||i==="uri-reference")r=r.check(A.url());else if(i==="uuid"||i==="guid")r=r.check(A.uuid());else if(i==="date-time")r=r.check(A.iso.datetime());else if(i==="date")r=r.check(A.iso.date());else if(i==="time")r=r.check(A.iso.time());else if(i==="duration")r=r.check(A.iso.duration());else if(i==="ipv4")r=r.check(A.ipv4());else if(i==="ipv6")r=r.check(A.ipv6());else if(i==="mac")r=r.check(A.mac());else if(i==="cidr")r=r.check(A.cidrv4());else if(i==="cidr-v6")r=r.check(A.cidrv6());else if(i==="base64")r=r.check(A.base64());else if(i==="base64url")r=r.check(A.base64url());else if(i==="e164")r=r.check(A.e164());else if(i==="jwt")r=r.check(A.jwt());else if(i==="emoji")r=r.check(A.emoji());else if(i==="nanoid")r=r.check(A.nanoid());else if(i==="cuid")r=r.check(A.cuid());else if(i==="cuid2")r=r.check(A.cuid2());else if(i==="ulid")r=r.check(A.ulid());else if(i==="xid")r=r.check(A.xid());else if(i==="ksuid")r=r.check(A.ksuid())}if(typeof e.minLength==="number")r=r.min(e.minLength);if(typeof e.maxLength==="number")r=r.max(e.maxLength);if(e.pattern)r=r.regex(new RegExp(e.pattern));n=r;break}case"number":case"integer":{let r=o==="integer"?A.number().int():A.number();if(typeof e.minimum==="number")r=r.min(e.minimum);if(typeof e.maximum==="number")r=r.max(e.maximum);if(typeof e.exclusiveMinimum==="number")r=r.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")r=r.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")r=r.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")r=r.lt(e.maximum);if(typeof e.multipleOf==="number")r=r.multipleOf(e.multipleOf);n=r;break}case"boolean":{n=A.boolean();break}case"null":{n=A.null();break}case"object":{let r={},i=e.properties||{},a=new Set(e.required||[]);for(let[u,h]of Object.entries(i)){let d=Oe(h,t);r[u]=a.has(u)?d:d.optional()}if(e.propertyNames){let u=Oe(e.propertyNames,t),h=e.additionalProperties&&typeof e.additionalProperties==="object"?Oe(e.additionalProperties,t):A.any();if(Object.keys(r).length===0){n=A.record(u,h);break}let d=A.object(r).passthrough(),g=A.looseRecord(u,h);n=A.intersection(d,g);break}if(e.patternProperties){let u=e.patternProperties,h=Object.keys(u),d=[];for(let b of h){let y=Oe(u[b],t),_=A.string().regex(new RegExp(b));d.push(A.looseRecord(_,y))}let g=[];if(Object.keys(r).length>0)g.push(A.object(r).passthrough());if(g.push(...d),g.length===0)n=A.object({}).passthrough();else if(g.length===1)n=g[0];else{let b=A.intersection(g[0],g[1]);for(let y=2;y<g.length;y++)b=A.intersection(b,g[y]);n=b}break}let c=A.object(r);if(e.additionalProperties===!1)n=c.strict();else if(typeof e.additionalProperties==="object")n=c.catchall(Oe(e.additionalProperties,t));else n=c.passthrough();break}case"array":{let{prefixItems:r,items:i}=e;if(r&&Array.isArray(r)){let a=r.map((u)=>Oe(u,t)),c=i&&typeof i==="object"&&!Array.isArray(i)?Oe(i,t):void 0;if(c)n=A.tuple(a).rest(c);else n=A.tuple(a);if(typeof e.minItems==="number")n=n.check(A.minLength(e.minItems));if(typeof e.maxItems==="number")n=n.check(A.maxLength(e.maxItems))}else if(Array.isArray(i)){let a=i.map((u)=>Oe(u,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?Oe(e.additionalItems,t):void 0;if(c)n=A.tuple(a).rest(c);else n=A.tuple(a);if(typeof e.minItems==="number")n=n.check(A.minLength(e.minItems));if(typeof e.maxItems==="number")n=n.check(A.maxLength(e.maxItems))}else if(i!==void 0){let a=Oe(i,t),c=A.array(a);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);n=c}else n=A.array(A.any());break}default:throw Error(`Unsupported type: ${o}`)}if(e.description)n=n.describe(e.description);if(e.default!==void 0)n=n.default(e.default);return n}function Oe(e,t){if(typeof e==="boolean")return e?A.any():A.never();let o=Nw(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((h)=>Oe(h,t)),u=A.union(c);o=n?A.intersection(o,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((h)=>Oe(h,t)),u=A.xor(c);o=n?A.intersection(o,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=n?o:A.any();else{let c=n?o:Oe(e.allOf[0],t),u=n?0:1;for(let h=u;h<e.allOf.length;h++)c=A.intersection(c,Oe(e.allOf[h],t));o=c}if(e.nullable===!0&&t.version==="openapi-3.0")o=A.nullable(o);if(e.readOnly===!0)o=A.readonly(o);let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)if(c in e)r[c]=e[c];let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)if(c in e)r[c]=e[c];for(let c of Object.keys(e))if(!sL.has(c))r[c]=e[c];if(Object.keys(r).length>0)t.registry.add(o,r);return o}function Lw(e,t){if(typeof e==="boolean")return e?A.any():A.never();let o=bL(e,t?.defaultTarget),n=e.$defs||e.definitions||{},r={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??ve};return Oe(e,r)}var A,sL;var Cw=s(()=>{Yo();Bi();tn();on();A={...rn,...Gi,iso:Ur},sL=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 Ub={};Qe(Ub,{string:()=>mL,number:()=>pL,date:()=>fL,boolean:()=>vL,bigint:()=>IL});function mL(e){return id(Kr,e)}function pL(e){return sd(Br,e)}function vL(e){return fd(Fr,e)}function IL(e){return $d(Jr,e)}function fL(e){return Cd(hn,e)}var xw=s(()=>{Ue();on()});var l={};Qe(l,{xor:()=>aw,xid:()=>A$,void:()=>ew,uuidv7:()=>k$,uuidv6:()=>f$,uuidv4:()=>I$,uuid:()=>v$,util:()=>w,url:()=>$$,uppercase:()=>Sr,unknown:()=>tr,union:()=>ba,undefined:()=>Z$,ulid:()=>P$,uint64:()=>Y$,uint32:()=>V$,tuple:()=>ub,trim:()=>Lr,treeifyError:()=>ql,transform:()=>ma,toUpperCase:()=>xr,toLowerCase:()=>Cr,toJSONSchema:()=>Ki,templateLiteral:()=>Iw,symbol:()=>X$,superRefine:()=>jb,success:()=>mw,stringbool:()=>Tw,stringFormat:()=>K$,string:()=>Vi,strictObject:()=>nw,startsWith:()=>Pr,slugify:()=>zr,size:()=>Zt,setErrorMap:()=>gL,set:()=>gw,safeParseAsync:()=>js,safeParse:()=>zs,safeEncodeAsync:()=>Fs,safeEncode:()=>Gs,safeDecodeAsync:()=>Js,safeDecode:()=>Bs,registry:()=>gi,regexes:()=>Me,regex:()=>_r,refine:()=>zb,record:()=>hb,readonly:()=>Ab,property:()=>ji,promise:()=>fw,prettifyError:()=>Wl,preprocess:()=>Aw,prefault:()=>$b,positive:()=>Li,pipe:()=>ln,partialRecord:()=>lw,parseAsync:()=>xs,parse:()=>Cs,overwrite:()=>Xe,optional:()=>an,object:()=>ow,number:()=>Vs,nullish:()=>yw,nullable:()=>cn,null:()=>Zs,normalize:()=>Nr,nonpositive:()=>xi,nonoptional:()=>wb,nonnegative:()=>zi,never:()=>sa,negative:()=>Ci,nativeEnum:()=>dw,nanoid:()=>O$,nan:()=>pw,multipleOf:()=>xt,minSize:()=>ct,minLength:()=>vt,mime:()=>Dr,meta:()=>Ow,maxSize:()=>zt,maxLength:()=>Qt,map:()=>hw,mac:()=>L$,lte:()=>Ee,lt:()=>it,lowercase:()=>Or,looseRecord:()=>uw,looseObject:()=>iw,locales:()=>Wo,literal:()=>sw,length:()=>er,lazy:()=>Lb,ksuid:()=>D$,keyof:()=>rw,jwt:()=>R$,json:()=>Pw,iso:()=>Ur,ipv6:()=>C$,ipv4:()=>N$,intersection:()=>cb,int64:()=>W$,int32:()=>M$,int:()=>qi,instanceof:()=>Sw,includes:()=>Tr,httpUrl:()=>w$,hostname:()=>G$,hex:()=>B$,hash:()=>F$,guid:()=>p$,gte:()=>Ae,gt:()=>at,globalRegistry:()=>ve,getErrorMap:()=>dL,function:()=>kw,fromJSONSchema:()=>Lw,formatError:()=>Uo,float64:()=>H$,float32:()=>J$,flattenError:()=>Eo,file:()=>bw,exactOptional:()=>pb,enum:()=>ya,endsWith:()=>Ar,encodeAsync:()=>Rs,encode:()=>Es,emoji:()=>_$,email:()=>m$,e164:()=>U$,discriminatedUnion:()=>cw,describe:()=>_w,decodeAsync:()=>Ks,decode:()=>Us,date:()=>tw,custom:()=>ww,cuid2:()=>T$,cuid:()=>S$,core:()=>It,config:()=>ue,coerce:()=>Ub,codec:()=>vw,clone:()=>Pe,cidrv6:()=>z$,cidrv4:()=>x$,check:()=>$w,catch:()=>Sb,boolean:()=>qs,bigint:()=>q$,base64url:()=>E$,base64:()=>j$,array:()=>gn,any:()=>Q$,_function:()=>kw,_default:()=>fb,_ZodString:()=>Wi,ZodXor:()=>nb,ZodXID:()=>ra,ZodVoid:()=>rb,ZodUnknown:()=>eb,ZodUnion:()=>sn,ZodUndefined:()=>Ys,ZodUUID:()=>lt,ZodURL:()=>un,ZodULID:()=>ta,ZodType:()=>K,ZodTuple:()=>lb,ZodTransform:()=>yb,ZodTemplateLiteral:()=>Db,ZodSymbol:()=>Ws,ZodSuccess:()=>_b,ZodStringFormat:()=>ee,ZodString:()=>Kr,ZodSet:()=>db,ZodRecord:()=>bn,ZodRealError:()=>ze,ZodReadonly:()=>Pb,ZodPromise:()=>Cb,ZodPrefault:()=>kb,ZodPipe:()=>Ia,ZodOptional:()=>pa,ZodObject:()=>dn,ZodNumberFormat:()=>rr,ZodNumber:()=>Br,ZodNullable:()=>vb,ZodNull:()=>Xs,ZodNonOptional:()=>va,ZodNever:()=>tb,ZodNanoID:()=>Zi,ZodNaN:()=>Tb,ZodMap:()=>gb,ZodMAC:()=>Ms,ZodLiteral:()=>sb,ZodLazy:()=>Nb,ZodKSUID:()=>oa,ZodJWT:()=>ga,ZodIssueCode:()=>hL,ZodIntersection:()=>ab,ZodISOTime:()=>Hi,ZodISODuration:()=>Mi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ji,ZodIPv6:()=>ia,ZodIPv4:()=>na,ZodGUID:()=>nn,ZodFunction:()=>xb,ZodFirstPartyTypeKind:()=>Eb,ZodFile:()=>bb,ZodExactOptional:()=>mb,ZodError:()=>lL,ZodEnum:()=>Rr,ZodEmoji:()=>Xi,ZodEmail:()=>Yi,ZodE164:()=>ha,ZodDiscriminatedUnion:()=>ib,ZodDefault:()=>Ib,ZodDate:()=>hn,ZodCustomStringFormat:()=>Gr,ZodCustom:()=>yn,ZodCodec:()=>fa,ZodCatch:()=>Ob,ZodCUID2:()=>ea,ZodCUID:()=>Qi,ZodCIDRv6:()=>ca,ZodCIDRv4:()=>aa,ZodBoolean:()=>Fr,ZodBigIntFormat:()=>da,ZodBigInt:()=>Jr,ZodBase64URL:()=>ua,ZodBase64:()=>la,ZodArray:()=>ob,ZodAny:()=>Qs,TimePrecision:()=>cd,NEVER:()=>El,$output:()=>td,$input:()=>rd,$brand:()=>Ul});var Rb=s(()=>{Ue();Ue();sg();Ue();en();Cw();ed();tn();tn();xw();on();Bi();Ls();Hs();Dw();ue(Ho())});var Ie=s(()=>{Rb();Rb()});var D=(e)=>{let t={operationId:e.operationId,backend:e.backend,pagination:e.pagination,async:e.async,examples:e.examples??[]};return{...e,contract:Em.$meta(t).route({method:e.route.method,path:e.route.path,tags:e.route.tags,operationId:e.operationId,description:e.description,successStatus:e.route.successStatus,successDescription:e.route.successDescription,deprecated:e.route.deprecated,inputStructure:e.route.inputStructure}).input(e.input).output(e.output)}};var Ne=s(()=>{Fc()});var zw,Kb,kL,$L,jw,Gb,Bb,Ew,Uw,ka,Rw,Kw,Hr,Gw,Bw,$a,Fw,Jw,Mr,Hw,Mw,wa,Vw,qw,_a,Ww,Yw,Oa,Xw,Zw,Sa,Qw,e_,Ta,wL;var Fb=s(()=>{jl();Ie();Ne();zw=sr,Kb=l.enum(zw),kL=l.enum(["pending","provisioning","active","error"]),$L=l.object({name:l.string().describe("Field name used as the JSON key in metadata."),type:l.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:l.boolean().describe("Whether the field is required."),sensitive:l.boolean().describe("Whether the field contains a secret and will be encrypted."),description:l.string().nullable().describe("Human-readable description of the field.")}),jw=l.object({id:l.string().describe("Data source type identifier."),name:l.string().describe("Human-readable display name."),metadataFields:l.array($L).describe("Fields required in the metadata object when creating a connection."),setupSkill:l.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),Gb=l.object({id:l.string().uuid(),projectId:l.string().uuid(),dataSourceType:Kb,displayName:l.string().nullable(),createdAt:l.string().datetime()}),Bb=l.object({id:l.string().uuid(),connectionId:l.string().uuid(),displayName:l.string(),config:l.record(l.string(),l.unknown()),status:kL,errorMessage:l.string().nullable(),createdAt:l.string().datetime()}),Ew=l.object({}),Uw=l.object({types:l.array(jw)}),ka=D({operationId:"dataSources.listTypes",description:"List all supported data source types with their metadata requirements.",backend:"api",route:{method:"GET",path:"/data-sources/types",tags:["Data Sources"]},input:Ew,output:Uw,pagination:"none",async:"sync"}),Rw=l.object({projectId:l.string().uuid().optional().describe("Project to list connections for. Auto-filled from SDK context when omitted."),dataSourceType:Kb.optional().describe("Filter connections by data source type.")}),Kw=l.object({connections:l.array(Gb)}),Hr=D({operationId:"dataSources.listConnections",description:"List data source connections within one project.",backend:"api",route:{method:"GET",path:"/data-sources/connections",tags:["Data Sources"]},input:Rw,output:Kw,pagination:"none",async:"sync"}),Gw=l.object({connectionId:l.string().uuid().describe("Connection ID to fetch.")}),Bw=l.object({connection:Gb}),$a=D({operationId:"dataSources.getConnection",description:"Get one data source connection by ID.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}",tags:["Data Sources"]},input:Gw,output:Bw,pagination:"none",async:"sync"}),Fw=l.object({projectId:l.string().uuid().optional().describe("Project to create the connection in. Auto-filled from SDK context when omitted."),dataSourceType:Kb.describe("Data source type identifier."),metadata:l.record(l.string(),l.unknown()).describe("Platform-specific credentials. Fields vary by data source type."),displayName:l.string().optional().describe("Optional human-readable name for this connection.")}),Jw=l.object({connectionId:l.string().uuid().describe("ID of the created connection."),publicKey:l.string().describe("Auto-generated public API key for this connection. Store this securely — it is only shown once.")}),Mr=D({operationId:"dataSources.createConnection",description:"Create a new data source connection. Validates credentials, encrypts sensitive fields, and auto-generates a public API key.",backend:"api",route:{method:"POST",path:"/data-sources/connections",successStatus:201,tags:["Data Sources"]},input:Fw,output:Jw,pagination:"none",async:"sync"}),Hw=l.object({connectionId:l.string().uuid().describe("Connection ID to list streams for.")}),Mw=l.object({streams:l.array(Bb)}),wa=D({operationId:"dataSources.listStreams",description:"List streams for a data source connection.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}/streams",tags:["Data Sources"]},input:Hw,output:Mw,pagination:"none",async:"sync"}),Vw=l.object({connectionId:l.string().uuid().describe("Connection ID to create the stream under."),displayName:l.string().describe("Resource name, e.g. service or app name."),config:l.record(l.string(),l.unknown()).describe("Platform-specific stream configuration.")}),qw=l.object({streamId:l.string().uuid().describe("ID of the created stream."),publicKey:l.string().optional().describe("Auto-generated public API key for this stream. Returned only when the data source mints a per-stream key (manual-only sources). Store this securely — it is only shown once.")}),_a=D({operationId:"dataSources.createStream",description:"Create a new stream for a data source connection. Triggers async provisioning.",backend:"api",route:{method:"POST",path:"/data-sources/connections/{connectionId}/streams",successStatus:201,tags:["Data Sources"]},input:Vw,output:qw,pagination:"none",async:"sync"}),Ww=l.object({streamId:l.string().uuid().describe("Stream ID to fetch.")}),Yw=l.object({stream:Bb}),Oa=D({operationId:"dataSources.getStream",description:"Get one data source stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:Ww,output:Yw,pagination:"none",async:"sync"}),Xw=l.object({streamId:l.string().uuid().describe("Stream ID to delete.")}),Zw=l.object({success:l.boolean()}),Sa=D({operationId:"dataSources.deleteStream",description:"Delete a data source stream. For manual-only sources where streams are stored as connection API keys, deletes the underlying public key.",backend:"api",route:{method:"DELETE",path:"/data-sources/streams/{streamId}",successStatus:204,tags:["Data Sources"]},input:Xw,output:Zw,pagination:"none",async:"sync"}),Qw=l.object({connectionId:l.string().uuid().describe("Connection ID to disconnect.")}),e_=l.object({success:l.boolean(),connectionTeardownError:l.string().nullable().describe("Null when teardown succeeded; error message when remote cleanup failed.")}),Ta=D({operationId:"dataSources.disconnectConnection",description:"Disconnect a data source connection. Soft-deletes the connection, all associated streams, and all associated API keys. Triggers async backend teardown when the source supports it.",backend:"api",route:{method:"DELETE",path:"/data-sources/connections/{connectionId}",successStatus:200,tags:["Data Sources"]},input:Qw,output:e_,pagination:"none",async:"sync"}),wL={listTypes:ka.contract,listConnections:Hr.contract,getConnection:$a.contract,createConnection:Mr.contract,disconnectConnection:Ta.contract,listStreams:wa.contract,createStream:_a.contract,getStream:Oa.contract,deleteStream:Sa.contract}});var mn,_L,OL,SL,TL,PL,AL,DL,NL,LL,CL,Jb,Hb,Mb,Vb,qb,$J;var t_=s(()=>{Ie();Ne();mn=l.object({id:l.string().uuid(),projectId:l.string().uuid(),name:l.string(),whatHappened:l.string(),whyItHappened:l.string().nullable(),howToFix:l.string().nullable(),status:l.enum(["open","resolved","ignored"]),severity:l.enum(["low","medium","high","critical"]),statusComponentId:l.string().uuid().nullable(),createdAt:l.string().datetime(),resolvedAt:l.string().datetime().nullable(),mutedAt:l.string().datetime().nullable(),lastActivityAt:l.string().datetime().nullable()}),_L=l.object({projectId:l.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:l.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:l.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),statusComponentId:l.string().uuid().optional().describe("Filter by status component ID.")}),OL=l.object({issues:l.array(mn),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),SL=l.object({issueId:l.string().uuid().describe("Issue ID to retrieve.")}),TL=l.object({issue:mn}),PL=l.object({issueId:l.string().uuid().describe("Issue ID to resolve.")}),AL=l.object({issue:mn}),DL=l.object({issueId:l.string().uuid().describe("Issue ID to ignore.")}),NL=l.object({issue:mn}),LL=l.object({issueId:l.string().uuid().describe("Issue ID to unignore.")}),CL=l.object({issue:mn}),Jb=D({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:_L,output:OL,pagination:"cursor",async:"sync"}),Hb=D({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:SL,output:TL,pagination:"none",async:"sync"}),Mb=D({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:PL,output:AL,pagination:"none",async:"sync"}),Vb=D({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:DL,output:NL,pagination:"none",async:"sync"}),qb=D({operationId:"issues.unignore",description:"Unignore an ignored issue. Mute is separate from ignored status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unignore",tags:["Issues"]},input:LL,output:CL,pagination:"none",async:"sync"}),$J={list:Jb.contract,get:Hb.contract,resolve:Mb.contract,ignore:Vb.contract,unignore:qb.contract}});var Pa,r_,Aa,Da,o_,n_,i_,a_,Na,Wb,c_,l_,u_,h_,g_,d_,s_,b_,y_,m_,p_,v_,Vr,qr,Wr,Yr,Xr,La,Ca,xa,za,ja,xL,zL;var Yb=s(()=>{Ie();Ne();Pa=/^[a-zA-Z0-9\s\-_]+$/,r_=l.object({id:l.string().uuid(),name:l.string(),expiresAt:l.string().datetime().nullable(),lastUsedAt:l.string().datetime().nullable(),createdAt:l.string().datetime()}),Aa=r_.extend({projectId:l.string().uuid(),dataSourceConnectionId:l.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:l.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Da=r_.extend({projectId:l.string().uuid().nullable()}),o_=l.object({projectId:l.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),n_=l.object({publicKeys:l.array(Aa),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),i_=l.object({secretKeys:l.array(Da),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a_=l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:l.string().uuid().describe("Key ID to fetch.")}),Na=l.object({publicKey:Aa}),Wb=l.object({secretKey:Da}),c_=l.object({projectId:l.string().uuid().optional().describe("Project to create the key in. Auto-filled from CLI and SDK context when omitted."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:l.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),l_=l.object({publicKey:Aa.extend({value:l.string()})}),u_=l.object({secretKey:Da.extend({value:l.string()})}),h_=l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:l.string().uuid().describe("Key ID to update."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:l.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),g_=l.object({params:l.object({keyId:l.string().uuid().describe("Public key ID to deactivate.")}),query:l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),d_=Na,s_=l.void(),b_=l.object({limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),y_=l.object({keyId:l.string().uuid().describe("Key ID to fetch.")}),m_=l.object({projectId:l.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:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:l.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),p_=l.object({keyId:l.string().uuid().describe("Key ID to update."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:l.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),v_=l.object({params:l.object({keyId:l.string().uuid().describe("Key ID to delete.")})}).transform(({params:e})=>({...e})),Vr=D({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:o_,output:n_,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}}]}),qr=D({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:a_,output:Na,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"}}}]}),Wr=D({operationId:"publicKeys.create",description:"Create one public key within one project.",backend:"api",route:{method:"POST",path:"/public-keys",successStatus:201,tags:["Public Keys"]},input:c_,output:l_,pagination:"none",async:"sync",examples:[{name:"create-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder"},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",value:"sazabi_public_example"}}}]}),Yr=D({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:h_,output:Na,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"}}}]}),Xr=D({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Existing successful intake-auth cache entries may continue to authenticate until their current TTL expires.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:g_,output:d_,pagination:"none",async:"sync"}),La=D({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:b_,output:i_,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}}]}),Ca=D({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:y_,output:Wb,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"}}}]}),xa=D({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:m_,output:u_,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"}}}]}),za=D({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:p_,output:Wb,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"}}}]}),ja=D({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:v_,output:s_,pagination:"none",async:"sync"}),xL={list:Vr.contract,get:qr.contract,create:Wr.contract,update:Yr.contract,deactivate:Xr.contract},zL={list:La.contract,get:Ca.contract,create:xa.contract,update:za.contract,delete:ja.contract}});var I_,f_,k_,$_,w_,__,O_,Ea,S_,T_,P_,Xb,A_,D_,N_,L_,C_,x_,z_,j_,jL,E_,U_,Zr,Qr,eo,to,ro,EL;var Zb=s(()=>{Ie();Ne();I_=l.enum(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]).describe("Filter operator: 'eq' (equals), 'neq' (not equals), 'in' (in array), 'contains' (substring), 'starts_with' (prefix), 'gt' (greater than), 'gte' (greater than or equal), 'lt' (less than), 'lte' (less than or equal), 'between' (range), 'exists' (field exists)"),f_=l.enum(["any","all","phrase"]).describe("Search mode: 'any' (match any token), 'all' (match all tokens), 'phrase' (exact phrase match)"),k_=l.object({query:l.string().min(1,"Search query must be at least 1 character").max(500,"Search query must be at most 500 characters").describe("Search query text (1-500 characters)"),fields:l.array(l.string()).optional().describe("Fields to search in (defaults to backend allowlist)"),mode:f_.optional().default("all").describe("Token matching mode")}),$_=l.object({field:l.string().describe("Field name to filter on"),op:I_.describe("Filter operator"),value:l.union([l.string(),l.number(),l.boolean(),l.array(l.union([l.string(),l.number()])),l.object({from:l.string(),to:l.string()})]).describe("Filter value (type depends on operator)")}).superRefine((e,t)=>{if(e.op==="in"&&!Array.isArray(e.value))t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be an array when op is 'in'",path:["value"]});if(e.op==="between"){let o=e.value;if(!(typeof o==="object"&&o!==null&&("from"in o)&&("to"in o)))t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be an object with from/to when op is 'between'",path:["value"]})}if(e.op==="exists"&&typeof e.value!=="boolean")t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be boolean when op is 'exists'",path:["value"]})}),w_=l.object({field:l.string().describe("Field name to sort by"),direction:l.enum(["asc","desc"]).default("desc").describe("Sort direction: 'asc' for ascending, 'desc' for descending")}),__=l.object({limit:l.number().int().min(1,"Limit must be at least 1").max(1000,"Limit must be at most 1000").default(50).describe("Maximum number of rows to return"),cursor:l.string().optional().describe("Opaque cursor from previous response for pagination")}),O_=l.object({projectId:l.string().uuid().optional().describe("Project to query logs for. Auto-filled from CLI and SDK context when omitted."),search:k_.optional().describe("Full-text search configuration"),filters:l.array($_).optional().describe("Structured filter clauses (ANDed together)"),select:l.array(l.string()).optional().describe("Fields to return (defaults to backend default set)"),sort:w_.optional().describe("Sort configuration (defaults to timestamp desc)"),pagination:__.optional().describe("Pagination configuration")}),Ea=l.enum(["clickhouse","better-stack","datadog","gcp","axiom","cloudwatch","sentry","posthog","mezmo"]),S_=l.enum(["native","external"]),T_=l.object({projectId:l.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),P_=l.object({backend:l.object({id:Ea,name:l.string(),kind:S_}).describe("Active log backend for the project"),features:l.array(l.string()).describe("Backend features registered on the server"),commands:l.array(l.enum(["schema","query","volume","patterns","nativeQuery"])).describe("CLI/API commands available for this backend"),queryableFields:l.array(l.string()).describe("Fields accepted by the normalized logs.query contract"),searchableFields:l.array(l.string()).describe("Fields accepted by logs.query full-text search"),observedServiceNames:l.array(l.string()).describe("Recently observed service names for this project"),observedAttributeKeys:l.array(l.string()).describe("Recently observed log attribute keys for this project"),schemaContext:l.record(l.string(),l.any()).optional().describe("Backend-specific schema guidance and examples")}),Xb=l.enum(["1m","5m","15m","1h"]),A_=l.enum(["service_name","severity_text","environment"]),D_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),startDate:l.string().datetime({offset:!0}),endDate:l.string().datetime({offset:!0}),interval:Xb.optional().describe("Aggregation bucket size for the volume series"),groupBy:A_.optional().describe("Optional field to split volume series by"),filters:l.object({service_name:l.string().optional(),severity_text:l.string().optional(),environment:l.string().optional()}).optional()}).refine((e)=>new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),N_=l.object({total:l.number().nonnegative(),startDate:l.string().datetime({offset:!0}),endDate:l.string().datetime({offset:!0}),interval:Xb,series:l.array(l.object({group:l.string(),total:l.number().nonnegative(),points:l.array(l.object({bucket:l.string(),count:l.number().nonnegative()}))}))}),L_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:l.string().min(1).max(500).optional().describe("Optional text to match against normalized log patterns"),severity:l.string().optional().describe("Optional severity_text value, for example ERROR"),startDate:l.string().datetime({offset:!0}).optional().describe("Optional earliest last-seen timestamp"),endDate:l.string().datetime({offset:!0}).optional().describe("Optional latest last-seen timestamp"),limit:l.number().int().min(1).max(100).default(25).describe("Maximum number of log patterns to return")}).refine((e)=>!e.startDate||!e.endDate||new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),C_=l.object({fingerprint:l.string(),pattern:l.string(),severity:l.string().nullable(),occurrences:l.number().nonnegative(),firstSeen:l.string().nullable(),lastSeen:l.string().nullable(),representativeId:l.string().nullable()}),x_=l.object({patterns:l.array(C_),meta:l.object({backendId:Ea,count:l.number().int().nonnegative(),took:l.number().nonnegative()})}),z_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:l.string().min(1,"Query cannot be empty").max(1e4,"Query must be 10000 characters or less")}),j_=l.object({result:l.string().describe("Backend-formatted query result"),format:l.literal("text"),meta:l.object({backendId:Ea,took:l.number().nonnegative(),truncated:l.boolean()})}),jL=l.object({cursor:l.string().nullable().describe("Cursor for next page (null if no more results)"),hasMore:l.boolean().describe("Whether more results are available")}),E_=l.object({count:l.number().int().nonnegative().describe("Number of log rows returned in this response"),took:l.number().nonnegative().describe("Query execution time in milliseconds")}),U_=l.object({data:l.array(l.record(l.string(),l.any())).describe("Array of log rows with selected fields"),nextCursor:l.string().nullable().describe("Pass as 'cursor' in the next query to fetch the next page. Null when there are no more results."),meta:E_.describe("Query execution metadata")}),Zr=D({operationId:"logs.query",description:"Query logs within one project via the platform API proxy.",backend:"api",route:{method:"POST",path:"/logs/query",tags:["Logs"]},input:O_,output:U_,pagination:"cursor",async:"sync"}),Qr=D({operationId:"logs.schema",description:"Describe the active log backend, supported commands, query fields, and schema context.",backend:"api",route:{method:"POST",path:"/logs/schema",tags:["Logs"]},input:T_,output:P_,pagination:"none",async:"sync"}),eo=D({operationId:"logs.volume",description:"Query pre-aggregated log volume for one project.",backend:"api",route:{method:"POST",path:"/logs/volume",tags:["Logs"]},input:D_,output:N_,pagination:"none",async:"sync"}),to=D({operationId:"logs.patterns",description:"Query normalized log patterns for discovery workflows.",backend:"api",route:{method:"POST",path:"/logs/patterns",tags:["Logs"]},input:L_,output:x_,pagination:"none",async:"sync"}),ro=D({operationId:"logs.nativeQuery",description:"Run the active backend's native read-only query language through server-side guardrails.",backend:"api",route:{method:"POST",path:"/logs/native-query",tags:["Logs"]},input:z_,output:j_,pagination:"none",async:"sync"}),EL={query:Zr.contract,schema:Qr.contract,volume:eo.contract,patterns:to.contract,nativeQuery:ro.contract}});var oo,UL,RL,KL,GL,BL,FL,JL,Qb,LJ;var Ua=s(()=>{Ie();Ne();oo=l.enum(["admin","member"]),UL=l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional(),role:oo}),RL=l.object({id:l.string().min(1),name:l.string().nullable(),email:l.string().email()}),KL=l.object({credentialType:l.literal("user"),user:RL,activeOrganizationId:l.string().min(1).nullable(),organizations:l.array(UL).describe("Organizations the user belongs to, including membership role.")}),GL=l.object({credentialType:l.literal("secret"),organization:l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional()}),keyName:l.string()}),BL=l.object({credentialType:l.literal("partner"),superorganization:l.object({id:l.string().uuid(),name:l.string()})}),FL=l.object({}),JL=l.discriminatedUnion("credentialType",[KL,GL,BL]),Qb=D({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:FL,output:JL,pagination:"none",async:"sync"}),LJ=Qb.contract});var R_,HL,ML,VL,qL,WL,YL,ey,ty,ry,EJ;var K_=s(()=>{Ie();Ne();Ua();R_=l.object({membershipId:l.string().min(1).describe("Organization membership record ID."),userId:l.string().min(1).describe("User ID for the organization member."),name:l.string().nullable().describe("Display name for the member, when available."),email:l.string().email().describe("Email address for the member."),imageUrl:l.string().nullable().describe("Profile image URL for the member, when available."),role:oo.describe("Organization role."),createdAt:l.string().datetime().describe("When the membership was created.")}),HL=l.object({organizationId:l.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),ML=l.object({members:l.array(R_).describe("Members visible within the selected organization.")}),VL=l.object({organizationId:l.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),userId:l.string().min(1).describe("User ID of the member to update."),role:oo.describe("Role to assign.")}),qL=l.object({member:R_.describe("Updated organization member.")}),WL=l.object({params:l.object({userId:l.string().min(1).describe("User ID of the member to remove.")}),query:l.object({organizationId:l.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),YL=l.object({removedUserId:l.string().min(1).describe("User ID removed from the organization.")}),ey=D({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:HL,output:ML,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"}]}}]}),ty=D({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{userId}/role",tags:["Members"]},input:VL,output:qL,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",userId:"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"}}}]}),ry=D({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{userId}",tags:["Members"],inputStructure:"detailed"},input:WL,output:YL,pagination:"none",async:"sync"}),EJ={list:ey.contract,updateRole:ty.contract,remove:ry.contract}});var G_,B_,XL,ZL,QL,eC,tC,pn,rC,oy,ny,iy,GJ;var Ra=s(()=>{Ie();Ne();G_=l.enum(["processing","completed","aborted","error"]),B_=l.object({id:l.string().uuid(),threadId:l.string().uuid(),userMessageId:l.string().uuid().nullable(),assistantMessageId:l.string().uuid().nullable(),parentRunId:l.string().uuid().nullable(),workflowRunId:l.string().nullable(),status:G_,source:l.enum(["web","api","mcp","slack","agent","cli"]),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),completedAt:l.string().datetime().nullable()}),XL=l.object({projectId:l.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:l.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),ZL=l.object({runs:l.array(B_),nextCursor:l.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),QL=l.object({threadId:l.string().uuid().describe("Thread ID to list runs for."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:l.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),eC=l.object({runs:l.array(B_),nextCursor:l.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),tC=l.object({runId:l.string().uuid().describe("Run ID returned by a deferred operation.")}),pn=l.object({completed:l.boolean().describe("Whether the run has reached a terminal status."),threadId:l.string().uuid().describe("Thread ID associated with the run."),runId:l.string().uuid().describe("Run ID for subsequent polling."),messageId:l.string().uuid().optional().describe("ID of the user message that triggered this run."),status:G_.describe("Current run lifecycle status."),response:l.string().nullable().describe("Assistant response text when the run has completed.")}),rC=pn.describe("Current run state and, when complete, the assistant response."),oy=D({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:XL,output:ZL,pagination:"cursor",async:"sync"}),ny=D({operationId:"runs.listForThread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:QL,output:eC,pagination:"cursor",async:"sync"}),iy=D({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:tC,output:rC,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}}]}),GJ={list:oy.contract,listForThread:ny.contract,get:iy.contract}});var ay,oC,nC,iC,aC,cC,lC,uC,hC,cy,gC,dC,sC,bC,yC,mC,pC,vC,IC,fC,ly,uy,hy,gy,dy,MJ;var sy=s(()=>{Ie();Ne();Ra();ay=l.object({id:l.string().uuid(),projectId:l.string().uuid(),title:l.string().nullable(),status:l.enum(["regular","archived"]),createdAt:l.string().datetime(),updatedAt:l.string().datetime()}),oC=l.object({type:l.literal("message"),message:l.string()}),nC=l.object({type:l.literal("reasoning"),reasoning:l.string(),status:l.enum(["in_progress","complete"]).optional()}),iC=l.object({type:l.literal("tool_call"),name:l.string(),params:l.any().optional(),result:l.any().optional(),status:l.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:l.string().optional(),durationMs:l.number().nonnegative().optional()}),aC=l.object({type:l.literal("artifact"),name:l.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card"]),data:l.any(),toolCallId:l.string().optional()}),cC=l.object({type:l.literal("fork"),sourceThreadId:l.string(),sourceMessageId:l.string(),sourceThreadTitle:l.string().nullable()}),lC=l.object({type:l.literal("summary"),summary:l.string()}),uC=l.object({type:l.literal("slack_context"),channelId:l.string(),isTruncated:l.boolean().optional(),messages:l.array(l.object({timestamp:l.string(),slackUserId:l.string().optional(),displayName:l.string(),text:l.string(),isBot:l.boolean(),files:l.array(l.object({name:l.string(),mimetype:l.string(),size:l.number().optional(),attachmentId:l.string().uuid().optional(),ingestionStatus:l.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),hC=l.union([oC,nC,iC,aC,cC,lC,uC]),cy=l.object({id:l.string().uuid(),role:l.enum(["user","assistant"]),content:l.array(hC),createdAt:l.string().datetime()}),gC=l.object({projectId:l.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:l.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),dC=l.object({threads:l.array(ay).describe("The page of threads matching the query."),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),sC=l.object({threadId:l.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),bC=l.object({thread:ay.describe("The requested thread."),messages:l.array(cy).describe("Messages currently stored on the thread in chronological order.")}),yC=l.object({projectId:l.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:l.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters").describe("Initial user message that starts the thread."),wait:l.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:l.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),mC=pn.describe("Deferred run result for creating a thread."),pC=l.object({threadId:l.string().uuid().describe("Thread ID whose current processing status should be returned.")}),vC=l.object({status:l.enum(["idle","processing"]),lastRunStatus:l.enum(["error"]).nullable()}),IC=l.object({threadId:l.string().uuid().describe("Thread ID of the thread to update."),status:l.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),fC=l.object({thread:ay.describe("The updated thread.")}),ly=D({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:gC,output:dC,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",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),uy=D({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:sC,output:bC,pagination:"none",async:"sync"}),hy=D({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:pC,output:vC,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),gy=D({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:yC,output:mC,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}}]}),dy=D({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:IC,output:fC,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",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),MJ={list:ly.contract,get:uy.contract,getStatus:hy.contract,create:gy.contract,update:dy.contract}});var kC,$C,wC,_C,F_,J_;var H_=s(()=>{Ie();Ne();Ra();sy();kC=l.object({threadId:l.string().uuid().describe("Thread ID to list messages for."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),$C=l.object({messages:l.array(cy),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),wC=l.object({threadId:l.string().uuid().describe("Thread ID to append the message to."),message:l.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters"),wait:l.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:l.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),_C=pn.describe("Deferred run result for appending a message to an existing thread."),F_=D({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:kC,output:$C,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?"}],createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),J_=D({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:wC,output:_C,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 by,OC,SC,TC,PC,AC,DC,NC,yy,my,py,rH;var M_=s(()=>{Ie();Ne();Ua();by=l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional()}),OC=by.extend({role:oo.optional()}),SC=l.object({}),TC=l.object({organizations:l.array(OC).describe("Organizations available to the current credential.")}),PC=l.object({organizationId:l.string().min(1).describe("Organization ID to fetch.")}),AC=l.object({organization:by}),DC=l.object({organizationId:l.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:l.string().trim().min(1).max(100).describe("New organization name.")}),NC=l.object({organization:by.describe("Updated organization.")}),yy=D({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:SC,output:TC,pagination:"none",async:"sync"}),my=D({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:PC,output:AC,pagination:"none",async:"sync"}),py=D({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:DC,output:NC,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}}}]}),rH={list:yy.contract,get:my.contract,update:py.contract}});var Ka,vy,V_,q_,W_,Y_,Ga,Ba,LC;var Iy=s(()=>{Ie();Ne();Ka=l.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"]),vy=l.object({id:l.string().uuid(),organizationId:l.string().min(1),name:l.string(),region:Ka}),V_=l.object({organizationId:l.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),q_=l.object({projects:l.array(vy).describe("Projects visible within the selected organization.")}),W_=l.object({projectId:l.string().uuid().describe("Project ID to fetch.")}),Y_=l.object({project:vy}),Ga=D({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:V_,output:q_,pagination:"none",async:"sync"}),Ba=D({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:W_,output:Y_,pagination:"none",async:"sync"}),LC={list:Ga.contract,get:Ba.contract}});var fy,X_,Z_,Q_,eO,no,io,CC;var ky=s(()=>{Ie();Ne();fy=l.object({projectId:l.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:l.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:l.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:l.coerce.number().min(1).default(1).describe("One-based page number.")}),X_=fy.extend({status:l.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),Z_=fy.extend({threadId:l.string().uuid().optional().describe("Optional thread restriction for message search."),role:l.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),Q_=l.object({threads:l.array(l.object({id:l.string().uuid(),projectId:l.string().uuid().optional(),title:l.string(),status:l.enum(["regular","archived"]),labels:l.array(l.string()),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),highlights:l.array(l.string()),score:l.number().optional()})),pagination:l.object({page:l.number(),limit:l.number(),totalResults:l.number(),totalPages:l.number()}).describe("Page-based pagination metadata for the current search result.")}),eO=l.object({messages:l.array(l.object({id:l.string().uuid(),threadId:l.string().uuid(),threadTitle:l.string(),role:l.enum(["user","assistant"]),content:l.string(),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),highlights:l.array(l.string()),score:l.number().optional()})),pagination:l.object({page:l.number(),limit:l.number(),totalResults:l.number(),totalPages:l.number()}).describe("Page-based pagination metadata for the current search result.")}),no=D({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:X_,output:Q_,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}}}]}),io=D({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:Z_,output:eO,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}}}]}),CC={threads:no.contract,messages:io.contract}});var tO,xC,zC,jC,EC,$y,wy,dH;var rO=s(()=>{Ie();Ne();tO=l.object({id:l.string().uuid(),projectId:l.string().uuid(),name:l.string(),description:l.string().nullable(),currentStatus:l.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:l.string().datetime(),lastSeenAt:l.string().datetime()}),xC=l.object({projectId:l.string().uuid().optional().describe("Project to list status components for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),zC=l.object({statusComponents:l.array(tO),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),jC=l.object({componentId:l.string().uuid().describe("Status component ID to retrieve.")}),EC=l.object({statusComponent:tO}),$y=D({operationId:"statusComponents.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/status-components",tags:["Status Components"]},input:xC,output:zC,pagination:"cursor",async:"sync"}),wy=D({operationId:"statusComponents.get",description:"Get a single status component by ID.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}",tags:["Status Components"]},input:jC,output:EC,pagination:"none",async:"sync"}),dH={list:$y.contract,get:wy.contract}});var oO;var nO=s(()=>{oO=["onboarding","setup"]});var iO,aO,cO,lO,vn;var _y=s(()=>{nO();Ie();Ne();iO=l.enum(oO),aO=l.object({id:l.string().describe("Unique task identifier (e.g. install_github_app)."),label:l.string().describe("Short human-readable task name."),description:l.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:l.string().describe("Step-by-step instructions for completing this task."),completed:l.boolean().describe("Whether the task has been completed."),completedAt:l.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:iO.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),cO=l.object({projectId:l.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),lO=l.object({tasks:l.array(aO).describe("All onboarding and setup tasks with their current completion status.")}),vn=D({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:cO,output:lO,pagination:"none",async:"sync"})});var Oy;var uO=s(()=>{Fb();t_();Yb();Zb();Ua();K_();H_();M_();Iy();Ra();ky();rO();_y();sy();Oy={me:Qb.contract,logs:{query:Zr.contract,schema:Qr.contract,volume:eo.contract,patterns:to.contract,nativeQuery:ro.contract},dataSources:{listTypes:ka.contract,listConnections:Hr.contract,getConnection:$a.contract,createConnection:Mr.contract,disconnectConnection:Ta.contract,listStreams:wa.contract,createStream:_a.contract,getStream:Oa.contract,deleteStream:Sa.contract},organizations:{list:yy.contract,get:my.contract,update:py.contract},members:{list:ey.contract,updateRole:ty.contract,remove:ry.contract},publicKeys:{list:Vr.contract,get:qr.contract,create:Wr.contract,update:Yr.contract,deactivate:Xr.contract},secretKeys:{list:La.contract,get:Ca.contract,create:xa.contract,update:za.contract,delete:ja.contract},projects:{list:Ga.contract,get:Ba.contract},search:{threads:no.contract,messages:io.contract},messages:{list:F_.contract,append:J_.contract},threads:{list:ly.contract,get:uy.contract,getStatus:hy.contract,create:gy.contract,update:dy.contract},runs:{list:oy.contract,listForThread:ny.contract,get:iy.contract},issues:{list:Jb.contract,get:Hb.contract,resolve:Mb.contract,ignore:Vb.contract,unignore:qb.contract},tasks:{list:vn.contract},statusComponents:{list:$y.contract,get:wy.contract}}});var Sy=s(()=>{uO();Fb();Yb();Zb();Iy();ky();_y()});var UC,Yq,RC,Fa=(e)=>{return RC.includes(e)};var Ty=s(()=>{UC={"eu-central-1":"EU Central (Frankfurt)"},Yq={"us-west-2":"US West","us-east-1":"US East","eu-central-1":UC["eu-central-1"]},RC=["us-west-2","us-east-1","eu-central-1"]});var Py,Ay,Dy,hO;var gO=s(()=>{Ie();Py=l.object({severities:l.array(l.string()).optional().describe("Limit results to the listed severities."),services:l.array(l.string()).optional().describe("Limit results to the listed service names."),environments:l.array(l.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:l.string().optional().describe("Case-insensitive substring match against the log body."),traceId:l.string().optional().describe("Limit results to one trace ID.")}),Ay=l.object({service:l.string(),namespace:l.string(),environment:l.string(),host:l.string(),container:l.string(),pod:l.string()}),Dy=l.object({id:l.string(),timestamp:l.string().datetime(),severity:l.string(),body:l.string(),service:l.string(),traceId:l.string(),spanId:l.string(),attributes:l.record(l.string(),l.string()),resource:Ay}),hO=l.object({type:l.literal("logs"),timestamp:l.string().datetime(),data:l.array(Dy)})});var KC="https://{region}.intake.sazabi.com",GC="wss://{region}.tail.sazabi.com",BC=3,sO=500,bO="sazabi.public_key",FC=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},yO=(e)=>{let t=FC(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},JC,HC,MC,mO=(e)=>{let t=new Map;return{tail:async(o)=>{let n=await ex(e.credentialProvider,o.projectId,"logs.tail"),r=await tx(e,t,n,o.region,"logs.tail"),i=VC({projectId:n,region:r,filters:o.filters,tailBaseUrl:e.tailBaseUrl}),a=await e.credentialProvider.getToken(),c=e.webSocket??globalThis.WebSocket;if(!c)throw Error("WebSocket transport is not available in this runtime.");return nx({token:a,url:i,signal:o.signal,webSocket:c})},forward:async(o)=>{let n=await rx(e,t,o.projectId??await e.credentialProvider.getProjectId?.(),o.region,"logs.forward"),r=YC(n,e.intakeBaseUrl),i=e.fetch??globalThis.fetch,a=ZC(o.logs,o.publicKey),c=lx(a);return await cx(i,r,a),{forwardedCount:c,failedCount:0}}}},VC=(e)=>{let t=(e.tailBaseUrl??GC).replace("{region}",e.region),o=qC(t)??new URL(t);o.searchParams.set("projectId",e.projectId);let n=WC(e.filters);if(n)o.searchParams.set("filters",n);return o.toString()},qC=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!yO(t.hostname))return;return t.protocol="ws:",t.pathname="/tail",t},WC=(e)=>{if(!e)return;let t=Object.entries(e).filter(([,o])=>o!==void 0&&(!Array.isArray(o)||o.length>0)&&o!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},YC=(e,t)=>{let o=(t??KC).replace("{region}",e),n=o.endsWith("/")?o.slice(0,-1):o,r=XC(n);if(r)return r;let i=n.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${i?`https://otlp.${i[1]}.intake.${i[2]}`:n}/v1/logs`},XC=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!yO(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},ZC=(e,t)=>{let o=e.resourceLogs;if(!o||o.length===0)return{...e,resourceLogs:[{resource:{attributes:[pO(t)]},scopeLogs:[]}]};return{...e,resourceLogs:o.map((n)=>({...n,resource:{...n.resource,attributes:QC(n.resource?.attributes,t)}}))}},QC=(e,t)=>{return[...(e??[]).filter((n)=>n?.key!==bO),pO(t)]},pO=(e)=>({key:bO,value:{stringValue:e}}),ex=async(e,t,o)=>{let n=t??await e.getProjectId?.();if(n)return n;throw IO(o,"Project ID is required",["projectId"])},tx=async(e,t,o,n,r)=>{let i=n??await vO(e,t,o);return ox(i,r)},rx=async(e,t,o,n,r)=>{if(n)return n;if(!o)throw IO(r,"Project ID is required",["projectId"]);return vO(e,t,o)},vO=async(e,t,o)=>{let n=t.get(o);if(n)return n;let r=e.raw.projects.get({projectId:o}).then((i)=>i.project.region);t.set(o,r);try{return await r}catch(i){throw t.delete(o),i}},ox=(e,t)=>{if(Fa(e))return e;throw new ye("BAD_REQUEST",{message:`Log tail is not supported for project region ${e}.`,data:{operationId:t,missingContext:[]}})},nx=async(e)=>{let t=[],o=[],n=!1,r=!1,i,a=0,c,u=(y)=>{if(n)return;n=!0,i=y;while(o.length>0){let _=o.shift();if(_)_({value:void 0,done:!0})}},h=(y)=>{let _=o.shift();if(_){_({value:y,done:!1});return}t.push(y)},d=()=>{if(c&&c.readyState<c.CLOSING)c.close(1000,"Client closed stream")},g=async()=>{await new Promise((y,_)=>{let S=!1,J;try{J=new e.webSocket(e.url,[e.token])}catch(G){_(G instanceof Error?G:Error("Failed to open WebSocket connection."));return}c=J,J.onopen=()=>{if(a=0,!S)S=!0,y()},J.onmessage=(G)=>{let le=ix(G.data);for(let oe of le)h(oe)},J.onerror=()=>{if(!S)S=!0,_(Error("WebSocket connection failed. Check the close event for details."))},J.onclose=(G)=>{if(!S){S=!0,_(dO(G.code,G.reason));return}if(r||n){u();return}if(ax(G.code)&&a<BC){a+=1,globalThis.setTimeout(()=>{g().catch((le)=>{u(le instanceof Error?le:Error(String(le)))})},sO*2**(a-1));return}u(dO(G.code,G.reason))}})};e.signal?.addEventListener("abort",()=>{r=!0,d(),u()},{once:!0}),await g();let b={[Symbol.asyncIterator](){return b},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(n){if(i)throw i;return{value:void 0,done:!0}}return new Promise((y)=>{o.push(y)}).then((y)=>{if(y.done&&i)throw i;return y})},return:async()=>{return r=!0,d(),u(),{value:void 0,done:!0}},throw:async(y)=>{throw r=!0,d(),u(y instanceof Error?y:Error(String(y))),y}};return b},ix=(e)=>{let t=(()=>{if(typeof e==="string")return e;if(e instanceof ArrayBuffer)return new TextDecoder().decode(e);return null})();if(!t)return[];try{let o=hO.safeParse(JSON.parse(t));if(!o.success)return[];return o.data.data}catch{return[]}},ax=(e)=>{return![1000,1001,1008,4001,4003,4004].includes(e)},dO=(e,t)=>{if(t)return Error(t);let o={1000:"Normal closure",1001:"Endpoint going away",1002:"Protocol error",1003:"Unsupported data",1006:"Connection closed abnormally (no close frame received)",1007:"Invalid payload data",1008:"Policy violation",1009:"Message too big",1010:"Missing extension",1011:"Internal server error",1015:"TLS handshake failure",4001:"Authentication failed - check your credential",4003:"Forbidden - credential may not have access to this project",4004:"Project not found"}[e]??`Unknown close code: ${e}`;return Error(`Connection closed: ${o}`)},cx=async(e,t,o,n=3,r=1e4)=>{let i;for(let a=0;a<=n;a+=1){let c=new AbortController,u=globalThis.setTimeout(()=>c.abort(),r);try{let h=await e(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o),signal:c.signal});if(h.ok)return;let d=await h.text();if(h.status===401||h.status===403)throw Error("Authentication failed. Check your public key.");if(h.status>=400&&h.status<500&&h.status!==429)throw Error(`Client error (${h.status}): ${d}`);i=Error(h.status===429?`Rate limited (429): ${d}`:`Server error (${h.status}): ${d}`)}catch(h){let d=h instanceof Error?h.message:String(h);if(d.startsWith("Authentication failed")||d.startsWith("Client error ("))throw h instanceof Error?h:Error(d);i=h instanceof Error&&h.name==="AbortError"?Error("Request timed out"):h instanceof Error?h:Error(String(h))}finally{globalThis.clearTimeout(u)}if(a<n)await ux(sO*2**a)}throw Error(`Failed after ${n+1} attempts: ${i?.message??"Unknown error"}`)},lx=(e)=>{return e.resourceLogs?.reduce((t,o)=>t+(o.scopeLogs?.reduce((n,r)=>n+(r.logRecords?.length??0),0)??0),0)??0},ux=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},IO=(e,t,o)=>{return new ye("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:o}})};var Ny=s(()=>{gr();Ty();gO();Ie();JC=l.object({projectId:l.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:Py.optional().describe("Optional filters applied by the tail WebSocket service.")}),HC=l.object({publicKey:l.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:l.custom((e)=>typeof e==="object"&&e!==null).describe("OTLP logs export request payload to send to the intake service.")}),MC=l.object({forwardedCount:l.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:l.number().int().nonnegative().describe("Number of log records rejected by the intake request.")})});var hx="https://api.sazabi.com",kO="https://api.platform.sazabi.com",$O="sazabi-cli",gx="urn:ietf:params:oauth:grant-type:device_code",wO=(e)=>{let t=Cc(new Mc(Oy,{url:dx(e.apiBaseUrl??hx),headers:async()=>new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`}),fetch:e.fetch,customErrorResponseBodyDecoder:(n,r)=>{let i=Ix(n);if(!i)return null;return new ye(i.code,{message:i.message,status:r.status,data:{operationId:i.operationId,missingContext:i.missingContext}})}})),o=mO({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl,webSocket:e.webSocket});return{raw:t,me:async()=>t.me({}),logs:{...o,query:async(n={})=>t.logs.query(await fe(e.credentialProvider,n,Zr.operationId)),schema:async(n={})=>t.logs.schema(await fe(e.credentialProvider,n,Qr.operationId)),volume:async(n)=>t.logs.volume(await fe(e.credentialProvider,n,eo.operationId)),patterns:async(n={})=>t.logs.patterns(await fe(e.credentialProvider,n,to.operationId)),nativeQuery:async(n)=>t.logs.nativeQuery(await fe(e.credentialProvider,n,ro.operationId))},organizations:{list:async()=>t.organizations.list({}),get:async(n)=>t.organizations.get(n),update:async(n)=>t.organizations.update(await bx(e.credentialProvider,n))},members:{list:async(n={})=>t.members.list(await Ja(e.credentialProvider,n)),updateRole:async(n)=>t.members.updateRole(await Ja(e.credentialProvider,n)),remove:async(n)=>{let r=await Ja(e.credentialProvider,n);return t.members.remove({params:{userId:r.userId},query:{organizationId:r.organizationId}})}},publicKeys:{list:async(n={})=>t.publicKeys.list(await fe(e.credentialProvider,n,Vr.operationId)),get:async(n)=>t.publicKeys.get(await fe(e.credentialProvider,n,qr.operationId)),create:async(n)=>t.publicKeys.create(await fe(e.credentialProvider,n,Wr.operationId)),update:async(n)=>t.publicKeys.update(await fe(e.credentialProvider,n,Yr.operationId)),deactivate:async(n)=>{let r=await fe(e.credentialProvider,n,Xr.operationId);return t.publicKeys.deactivate({params:{keyId:r.keyId},query:{projectId:r.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 fe(e.credentialProvider,n,no.operationId)),messages:async(n)=>t.search.messages(await fe(e.credentialProvider,n,io.operationId))},projects:{list:async(n={})=>t.projects.list(await sx(e.credentialProvider,n)),get:async(n)=>t.projects.get(n)},messages:{list:async(n)=>t.messages.list(n),append:async(n)=>fO(t,await t.messages.append(vx(n)))},threads:{list:async(n={})=>t.threads.list(await yx(e.credentialProvider,n)),get:async(n)=>t.threads.get(n),getStatus:async(n)=>t.threads.getStatus(n),create:async(n)=>fO(t,await t.threads.create(await px(e.credentialProvider,n))),update:async(n)=>t.threads.update(n)},runs:{list:async(n={})=>t.runs.list(await mx(e.credentialProvider,n)),listForThread:async(n)=>t.runs.listForThread(n),get:async(n)=>t.runs.get(n)},dataSources:{listTypes:async()=>t.dataSources.listTypes({}),connections:{list:async(n={})=>t.dataSources.listConnections(await fe(e.credentialProvider,n,Hr.operationId)),get:async(n)=>t.dataSources.getConnection(n),create:async(n)=>t.dataSources.createConnection(await fe(e.credentialProvider,n,Mr.operationId)),disconnect:async(n)=>t.dataSources.disconnectConnection(n)},streams:{list:async(n)=>t.dataSources.listStreams(n),get:async(n)=>t.dataSources.getStream(n),create:async(n)=>t.dataSources.createStream(n),delete:async(n)=>t.dataSources.deleteStream(n)}},issues:{list:async(n={})=>t.issues.list(await fe(e.credentialProvider,n,"issues.list")),get:async(n)=>t.issues.get(n),resolve:async(n)=>t.issues.resolve(n),ignore:async(n)=>t.issues.ignore(n),unignore:async(n)=>t.issues.unignore(n)},statusComponents:{list:async(n={})=>t.statusComponents.list(await fe(e.credentialProvider,n,"statusComponents.list")),get:async(n)=>t.statusComponents.get(n)},tasks:{list:async(n={})=>t.tasks.list(await fe(e.credentialProvider,n,vn.operationId))}}},Cy=async(e={})=>{let t=await SO(e.fetch)(_O(e.apiBaseUrl??kO,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??$O,...e.scope?{scope:e.scope}:{}})}),o=await t.json();if(!t.ok)throw fx(o,t.status);let n=o;return{deviceCode:ao(n.device_code,"device_code"),userCode:ao(n.user_code,"user_code"),verificationUri:ao(n.verification_uri,"verification_uri"),verificationUriComplete:ao(n.verification_uri_complete,"verification_uri_complete"),expiresIn:Ly(n.expires_in,"expires_in"),interval:Ly(n.interval,"interval")}},xy=async(e)=>{let t=await SO(e.fetch)(_O(e.apiBaseUrl??kO,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:gx,device_code:e.deviceCode,client_id:e.clientId??$O})}),o=await t.json();if(t.ok){let r=o;return{status:"authorized",accessToken:ao(r.access_token,"access_token"),tokenType:ao(r.token_type,"token_type"),expiresIn:Ly(r.expires_in,"expires_in"),scope:typeof r.scope==="string"?r.scope:""}}let n=OO(o);if(!n)throw Error(`Device authorization failed with status ${t.status}`);if(n.error==="authorization_pending")return{status:"pending"};if(n.error==="slow_down")return{status:"pending",interval:10};if(n.error==="access_denied")return{status:"denied",message:n.errorDescription};if(n.error==="expired_token"||n.error==="invalid_grant")return{status:"expired",message:n.errorDescription};throw Error(n.errorDescription)},dx=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},_O=(e,t)=>{return`${e.replace(/\/+$/,"")}/api/auth${t}`},sx=async(e,t)=>{return Ja(e,t)},Ja=async(e,t)=>{let o=t.organizationId??await e.getOrganizationId?.();return o?{...t,organizationId:o}:t},bx=async(e,t)=>{let o=t.organizationId??await e.getOrganizationId?.();if(!o)throw new ye("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:o}},fe=async(e,t,o)=>{let n=t.projectId??await e.getProjectId?.();if(!n)throw new ye("BAD_REQUEST",{message:"Project ID is required",data:{operationId:o,missingContext:["projectId"]},status:400});return{...t,projectId:n}},yx=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},mx=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},px=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},vx=(e)=>{return{threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20}},Ix=(e)=>{if(!e||typeof e!=="object")return null;let t=e;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((o)=>typeof o==="string"):[]}},OO=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},fx=(e,t)=>{let o=OO(e);return Error(o?.errorDescription??`Device authorization failed with status ${t}`)},SO=(e)=>{return e??globalThis.fetch},fO=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(o={})=>kx(e,t,o)}),kx=async(e,t,o)=>{if(t.completed)return t;let n=o.intervalMs??2000,r=Date.now(),i=t;while(!i.completed){if(o.timeoutMs!==void 0&&Date.now()-r>=o.timeoutMs)return i;await $x(n),i=await e.runs.get({runId:i.runId})}return i},$x=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},ao=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},Ly=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var zy=s(()=>{gr();Fm();Sy();Ny();Ny()});var ke=(e)=>({success:!0,value:e}),se=(e,t,o)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...o!==void 0&&{errorPayload:o}}),f=(e,t,o)=>{if(!e.success){let n=`${t}: ${e.error}`;if(o)return v(e.errorPayload??n);return p(n)}return e.value};var X=s(()=>{F()});var _x="https://api.sazabi.com",z=async(e)=>{try{return ke(await e())}catch(t){let o=Ox(t),n=Sx(t),r=t instanceof Error?t.message:String(t);return se(r,n,o)}},Ox=(e)=>{if(!e||typeof e!=="object")return;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let o=t.data;if(typeof o.operationId!=="string")return;return{code:t.code,message:t.message,operationId:o.operationId,missingContext:Array.isArray(o.missingContext)?o.missingContext.filter((n)=>typeof n==="string"):[]}},Sx=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},ft=(e)=>{let t=wO({apiBaseUrl:e.baseUrl??_x,credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>z(()=>t.me()),logs:{tail:(o)=>z(()=>t.logs.tail(o)),forward:(o)=>z(()=>t.logs.forward(o)),query:(o={})=>z(()=>t.logs.query(o)),schema:(o={})=>z(()=>t.logs.schema(o)),volume:(o)=>z(()=>t.logs.volume(o)),patterns:(o={})=>z(()=>t.logs.patterns(o)),nativeQuery:(o)=>z(()=>t.logs.nativeQuery(o))},organizations:{list:()=>z(()=>t.organizations.list()),get:(o)=>z(()=>t.organizations.get({organizationId:o})),rename:(o,n)=>z(()=>t.organizations.update({organizationId:n,name:o}))},members:{list:(o={})=>z(()=>t.members.list(o)),updateRole:(o,n,r)=>z(()=>t.members.updateRole({organizationId:r,userId:o,role:n})),remove:(o,n)=>z(()=>t.members.remove({organizationId:n,userId:o}))},projects:{list:(o={})=>z(()=>t.projects.list(o)),get:(o)=>z(()=>t.projects.get({projectId:o}))},threads:{list:(o={})=>z(()=>t.threads.list(o)),get:(o)=>z(()=>t.threads.get({threadId:o})),create:(o)=>z(()=>t.threads.create(o)),getStatus:(o)=>z(()=>t.threads.getStatus({threadId:o})),update:(o,n)=>z(()=>t.threads.update({threadId:o,status:n}))},messages:{list:(o,n={})=>z(()=>t.messages.list({threadId:o,...n})),append:(o,n,r,i)=>z(()=>t.messages.append({threadId:o,message:n,wait:r,timeoutSeconds:i}))},runs:{get:(o)=>z(()=>t.runs.get({runId:o}))},search:{threads:(o)=>z(()=>t.search.threads(o)),messages:(o)=>z(()=>t.search.messages(o))},publicKeys:{list:(o)=>z(()=>t.publicKeys.list(o)),get:(o,n)=>z(()=>t.publicKeys.get(n?{keyId:o,projectId:n}:{keyId:o})),create:(o)=>z(()=>t.publicKeys.create(o)),update:(o)=>z(()=>t.publicKeys.update(o)),deactivate:(o)=>z(()=>t.publicKeys.deactivate(o))},secretKeys:{list:(o)=>z(()=>t.secretKeys.list(o)),get:(o)=>z(()=>t.secretKeys.get({keyId:o})),create:(o)=>z(()=>t.secretKeys.create(o)),update:(o)=>z(()=>t.secretKeys.update(o)),delete:(o)=>z(()=>t.secretKeys.delete(o))},issues:{list:(o={})=>z(()=>t.issues.list(o)),get:(o)=>z(()=>t.issues.get({issueId:o})),resolve:(o)=>z(()=>t.issues.resolve({issueId:o})),ignore:(o)=>z(()=>t.issues.ignore({issueId:o})),unignore:(o)=>z(()=>t.issues.unignore({issueId:o}))},statusComponents:{list:(o={})=>z(()=>t.statusComponents.list(o)),get:(o)=>z(()=>t.statusComponents.get({componentId:o}))},tasks:{list:(o={})=>z(()=>t.tasks.list(o))},dataSources:{listTypes:()=>z(()=>t.dataSources.listTypes()),connections:{list:(o)=>z(()=>t.dataSources.connections.list(o)),get:(o)=>z(()=>t.dataSources.connections.get({connectionId:o})),create:(o)=>z(()=>t.dataSources.connections.create(o)),disconnect:(o)=>z(()=>t.dataSources.connections.disconnect({connectionId:o}))},streams:{list:(o)=>z(()=>t.dataSources.streams.list({connectionId:o})),get:(o)=>z(()=>t.dataSources.streams.get({streamId:o})),create:(o)=>z(()=>t.dataSources.streams.create(o)),delete:(o)=>z(()=>t.dataSources.streams.delete({streamId:o}))}}}};var In=s(()=>{zy();X()});var TO;var PO=s(()=>{TO={version:2,activeProfile:"default",profiles:{default:{}}}});import*as kt from"node:fs";import*as AO from"node:os";import*as Uy from"node:path";var Le=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},jy,co,Tx=()=>{if(!kt.existsSync(jy))kt.mkdirSync(jy,{recursive:!0,mode:448})},Ey,DO=(e)=>{Ey=e},NO=(e)=>({token:Le(e.token),activeOrganizationId:Le(e.activeOrganizationId??e.organizationId),organizationName:Le(e.organizationName),activeProjectId:Le(e.activeProjectId??e.defaultProjectId),apiBaseUrl:Le(e.apiBaseUrl),authBaseUrl:Le(e.authBaseUrl),webBaseUrl:Le(e.webBaseUrl),intakeBaseUrl:Le(e.intakeBaseUrl),tailBaseUrl:Le(e.tailBaseUrl),apiDomain:Le(e.apiDomain),webDomain:Le(e.webDomain),intakeDomain:Le(e.intakeDomain),tailDomain:Le(e.tailDomain),forwardPublicKey:Le(e.forwardPublicKey)}),Px=(e)=>({version:2,activeProfile:"default",profiles:{default:NO(e)}}),Ax=(e)=>{let t=Le(e.activeProfile)??"default",o=typeof e.profiles==="object"&&e.profiles!==null?e.profiles:{},n={};for(let[r,i]of Object.entries(o)){if(typeof i!=="object"||i===null)continue;n[r]=NO(i)}if(!n[t])n[t]={};return{version:2,activeProfile:t,profiles:n}},ie=()=>{try{if(!kt.existsSync(co))return ke(TO);let e=kt.readFileSync(co,"utf-8"),t=JSON.parse(e),o=typeof t.version==="number"?t.version:void 0;if(o!==void 0&&o>2)return se("Settings file requires a newer CLI version. Please upgrade.");if(o===2)return ke(Ax(t));let n=Px(t),r=me(n);if(!r.success)return r;return ke(n)}catch(e){let t=e instanceof Error?e.message:String(e);return se(`Failed to read settings: ${t}`)}},me=(e)=>{try{return Tx(),kt.writeFileSync(co,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),ke(void 0)}catch(t){let o=t instanceof Error?t.message:String(t);return se(`Failed to write settings: ${o}`)}},ut=(e,t)=>{if(t)return t;if(Ey)return Ey;let o=process.env.SAZABI_PROFILE?.trim();if(o)return o;return e.activeProfile??"default"},Ze=(e,t)=>{let o=ut(e,t),n=e.profiles[o];if(n)return ke(n);if(o==="default")return ke({});return se(`Profile '${o}' does not exist. Run 'sazabi profiles create ${o}' first.`)},$t=()=>{let e=ie();if(!e.success)return e;return Ze(e.value)},Re=(e,t,o)=>{let n=ut(e,o);if(!e.profiles[n])return se(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`);return ke({...e,profiles:{...e.profiles,[n]:{...e.profiles[n],...t}}})};var Ve=s(()=>{PO();X();jy=Uy.join(AO.homedir(),".sazabi"),co=Uy.join(jy,"settings.json")});var ht=(e)=>{let{cliFlag:t,globalUrl:o,globalDomain:n,buildUrlFromDomain:r,defaultUrl:i}=e;if(t)return t;let a=process.env.SAZABI_API_URL?.trim();if(a)return a;if(o)return o;if(n)return r(n);return i},N=(e)=>{let{tokenFlag:t,organizationIdFlag:o,projectIdFlag:n,jsonMode:r}=e,i=t?.trim(),a=process.env.SAZABI_TOKEN?.trim(),c=process.env.SAZABI_ORGANIZATION_ID?.trim(),u=process.env.SAZABI_PROJECT_ID?.trim(),h=f($t(),"Failed to read settings",r),d=h.token?.trim(),g=(i&&i.length>0?i:void 0)||(a&&a.length>0?a:void 0)||d,b=i&&i.length>0?"flag":a&&a.length>0?"environment":"settings";if(!g||g.length===0){if(r)return v("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return p("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let y,_;if(o)y=o,_="flag";else if(c&&c.length>0)y=c,_="environment";else if(h.activeOrganizationId)y=h.activeOrganizationId,_="settings";let S,J;if(n)S=n,J="flag";else if(u&&u.length>0)S=u,J="environment";else if(h.activeProjectId)S=h.activeProjectId,J="settings";return{token:g,type:"token",projectId:S,organizationId:y,tokenSource:b,organizationSource:_,projectSource:J}},L=(e)=>{let t=f($t(),"Failed to read settings",e.jsonMode),o=ht({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"});return ft({token:e.token,baseUrl:o,organizationId:e.organizationId,projectId:e.projectId})},LO,Ry,Ma=async(e)=>{let t=f($t(),"Failed to read settings",e.jsonMode),o=ht({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(u)=>`https://api.${u}`,defaultUrl:"https://api.sazabi.com"}),n=`${e.token}@${o}@${e.projectId??""}`,r=LO.get(n);if(r)return r;let i=Ry.get(n);if(i)return i;if(!e.projectId){if(e.jsonMode)return v("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return p("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let a=e.projectId,c=(async()=>{let h=await ft({token:e.token,baseUrl:o,projectId:a}).projects.get(a),g=f(h,"Failed to fetch project info",e.jsonMode).project;return LO.set(n,g),g})();Ry.set(n,c);try{return await c}finally{Ry.delete(n)}},Ha=(e)=>{let t=e.trim().toLowerCase(),o=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,n=t;try{n=new URL(o).hostname.toLowerCase()}catch{n=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${n.replace(/^(?:app\.)+/,"")}`},fn=(e)=>{let t=(n)=>n.replace(/\/+$/,"");if(e)return t(e);let o=f($t(),"Failed to read settings");if(o.webBaseUrl)return t(o.webBaseUrl);if(o.webDomain)return Ha(o.webDomain);if(o.apiDomain)return Ha(o.apiDomain);return"https://app.sazabi.com"},wt=(e,t,o,n)=>{let r=`${fn(o)}/projects/${e}/threads/${t}`;return n?`${r}?messageId=${encodeURIComponent(n)}`:r},CO=(e,t)=>{return`https://otlp.${t}.intake.${e}`};var re=s(()=>{F();In();X();Ve();LO=new Map,Ry=new Map});var rc,rT=(e)=>{rc.set(e.name,e)},oc=(e)=>{return rc.get(e)},kn=()=>{return Array.from(rc.values())},oT=(e)=>{return rc.has(e)};var Vy=s(()=>{rc=new Map});async function Xy(e){let t=await e.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((o)=>({value:o.id,description:o.name}))}async function Zy(e){let t=await e.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((o)=>({value:o.id,description:o.name}))}async function qE(e){let t=await e.dataSources.connections.list();if(!t.success)return[];return t.value.connections.map((o)=>({value:o.id,description:o.displayName??void 0}))}async function aT(e){let t=await e.members.list();if(!t.success)return[];return t.value.members.map((o)=>({value:o.userId,description:o.name??o.email}))}var ME=3000,VE,cT=async(e,t,o)=>{try{let n=VE[e]?.[t];if(!n)return[];let r=$t();if(!r.success)return[];let i=r.value,a=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!a)return[];let c=ht({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(d)=>`https://api.${d}`,defaultUrl:"https://api.sazabi.com"}),u=ft({token:a,baseUrl:c,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([n(u),new Promise((d)=>setTimeout(()=>d([]),ME))])).filter((d)=>d.value.startsWith(o))}catch{return[]}};var lT=s(()=>{In();re();Ve();VE={threads:{get:async(e)=>{let t=await e.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((o)=>({value:o.id,description:o.title??void 0}))}},projects:{use:async(e)=>{let t=await e.projects.list();if(!t.success)return[];return t.value.projects.map((o)=>({value:o.id,description:o.name}))}},organizations:{use:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((o)=>({value:o.id,description:o.name}))},rename:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((o)=>({value:o.id,description:o.name}))}},"public-keys":{get:Xy,update:Xy,deactivate:Xy},"secret-keys":{get:Zy,update:Zy,delete:Zy},"data-sources":{"get-connection":qE},members:{"update-role":aT,remove:aT}}});var hT={};Qe(hT,{parseCompletionContext:()=>XE,getCompletions:()=>ZE});var WE,YE,XE=(e)=>{let t=e.length>0?e:[""],o=t.length-1,n=t[o]??"";return{words:t,currentIndex:o,partial:n}},ZE=async(e)=>{let{words:t,currentIndex:o,partial:n}=e,r=t[o-1];if(r==="--profile")return r4(n);let i=t4(t),a=Math.max(0,i.length-(t.length-o));if(a===0)return QE(n);let c=i[0]??"",u=oc(c);if(!u)return[];if(a===1&&u.subcommands){if(n.startsWith("-"))return uT(u.options,i);return e4(u,n)}let h=u.subcommands?i[1]:void 0,g=(h?u.subcommands?.[h]:void 0)?.options??u.options;if(n.startsWith("-"))return uT(g,i);if(r?.startsWith("--")){let b=r.slice(2);if(g?.[b]?.type==="string"){let _=`${c}:${h??""}`,S=YE[_]?.[b]??WE[b];if(S)return S.filter((J)=>J.startsWith(n)).map((J)=>({value:J}));return[]}}return cT(c,h??"",n)},QE=(e)=>{let o=kn().filter((r)=>r.name.startsWith(e)).map((r)=>({value:r.name,description:r.description})),n=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let r of n)if(r.value.startsWith(e))o.push(r);return o},e4=(e,t)=>{if(!e.subcommands)return[];return Object.values(e.subcommands).filter((o)=>o.name.startsWith(t)).map((o)=>({value:o.name,description:o.description}))},uT=(e,t)=>{let o=t[t.length-1]??"",n=new Set(t.filter((i)=>i.startsWith("--")).map((i)=>i.replace(/=.*/,""))),r=[];if(!n.has("--help")&&"--help".startsWith(o))r.push({value:"--help",description:"Show help"});if(!n.has("--profile")&&"--profile".startsWith(o))r.push({value:"--profile",description:"Use a named profile"});if(!e)return r;for(let[i,a]of Object.entries(e)){let c=`--${i}`;if(n.has(c))continue;if(!c.startsWith(o))continue;r.push({value:c,description:a.description})}return r},t4=(e)=>{let t=[];for(let o=0;o<e.length;o++){let n=e[o];if(n==="--profile"&&o+1<e.length)o++;else if(n.startsWith("--profile="));else t.push(n)}return t},r4=(e)=>{try{let t=ie();if(!t.success)return[];return Object.keys(t.value.profiles).filter((o)=>o.startsWith(e)).map((o)=>({value:o,description:o===t.value.activeProfile?"active":void 0}))}catch{return[]}};var gT=s(()=>{Vy();Ve();lT();WE={status:["regular","archived"],format:["json","text"]},YE={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});F();F();zy();import{spawn as Dx}from"node:child_process";F();import{parseArgs as wx}from"node:util";var T=(e,t,o={})=>{let n=wx({args:e,options:t,allowPositionals:Boolean(o.allowPositionals),strict:!1,tokens:!0}),r=Object.hasOwn(t,"json")&&n.values.json===!0,i=new Set(Object.keys(t)),a=new Set(Object.entries(t).map(([,u])=>u.short).filter((u)=>Boolean(u))),c=[];if(Array.isArray(n.tokens))for(let u of n.tokens){if(u.kind!=="option")continue;let h=u.name,d=h.length>1;if(!(i.has(h)||!d&&a.has(h))){let b=d?`--${h}`:`-${h}`;if(!c.includes(b))c.push(b)}}for(let u of Object.keys(n.values))if(!i.has(u)){let h=u.length>1?`--${u}`:`-${u}`;if(!c.includes(h))c.push(h)}if(c.length>0){let u=`Unknown option${c.length>1?"s":""}: ${c.join(", ")}`;if(r)v(u);p(u)}for(let[u,h]of Object.entries(t))if(h.type==="string"&&n.values[u]===!0){let g=`Option ${u.length===1?`-${u}`:`--${u}`} requires a value`;if(r)v(g);p(g)}for(let[u,h]of Object.entries(t)){let d=n.values[u];if(h.type==="string"&&typeof d==="string"){if(d.startsWith("--")||d.length===2&&d[0]==="-"&&/[a-zA-Z]/.test(d.charAt(1))){let y=`Option ${u.length===1?`-${u}`:`--${u}`} received "${d}" as its value. Did you forget to provide a value?`;if(r)v(y);p(y)}}}return{values:n.values,positionals:n.positionals}};var V={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},q={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};re();var Va=(e,t)=>{let o=e?.json;if(!o||o.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class xO{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t,o){this.name=e,this.description=t,this.handler=o}withOptions(e){return this.options=e,this}withSubcommands(e){return this.subcommands=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)Va(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)Va(t.options,`Subcommand "${this.name} ${e}"`)}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 zO{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t){this.name=e,this.description=t}withHandler(e){return this.handler=e,this}withSubcommands(e){return this.subcommands=e,this}withOptions(e){return this.options=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,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)Va(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;Va(t.options,`Subcommand "${this.name} ${e}"`)}}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 W=(e,t)=>{return new zO(e,t)},P=(e,t,o)=>{return new xO(e,t,o)};X();Ve();var lo=(e)=>{if(e==="flag")return"from flag";if(e==="environment")return"from environment";return"from settings"},Nx=async(e={})=>{let t=N({jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.me(),"Failed to fetch authentication details",e.json);if(e.json){j({credential:n,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(ce("Authentication"),n.credentialType==="user"){ne({Type:`User token (${lo(t.tokenSource)})`,User:n.user.name??n.user.email,Email:n.user.email,"Active Organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${lo(t.organizationSource)})`:_e("(none)"),"Active Project":t.projectId&&t.projectSource?`${t.projectId} (${lo(t.projectSource)})`:_e("(none)"),Organizations:n.organizations.length.toString(),"Dashboard URL":fn()});return}if(n.credentialType==="secret"){ne({Type:`Secret key (${lo(t.tokenSource)})`,Organization:n.organization.name,"Key Name":n.keyName,"Active Project":t.projectId&&t.projectSource?`${t.projectId} (${lo(t.projectSource)})`:_e("(none)"),"Dashboard URL":fn()});return}ne({Type:`Partner key (${lo(t.tokenSource)})`,Superorganization:n.superorganization.name,"Dashboard URL":fn()})},Lx=async(e,t={})=>{let o=e.trim();if(!o){if(t.json)return v("Token is required.");return p("Token is required.")}let n=f(ie(),"Failed to read settings",t.json);await Ky({token:o,options:t,cliSettings:n,status:"saved"})},jO=(e)=>{let t=process.platform,o,n;if(t==="darwin")o="open",n=[e];else if(t==="win32")o="cmd",n=["/c","start","",e];else o="xdg-open",n=[e];let r=Dx(o,n,{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()},EO=(e)=>new Promise((t)=>setTimeout(t,e)),Cx=async(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=t.profiles[o]??{},r=Gy(n,e.apiBaseUrl),i=UO(r,e.authBaseUrl??n.authBaseUrl),a;try{a=await Cy({apiBaseUrl:i})}catch(b){let y=b instanceof Error?b.message:String(b);if(e.json)return v(`Failed to initiate signup: ${y}`);return p(`Failed to initiate signup: ${y}`)}let c=KO({profile:n,publicApiBaseUrl:r,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:a.verificationUriComplete}),u=`/login/cli?user_code=${encodeURIComponent(a.userCode)}`,h=`${c}/sign-up?returnTo=${encodeURIComponent(u)}`,d=new Date(Date.now()+a.expiresIn*1000),g=a.interval*1000;if(!e.json)R(),ce("Create a Sazabi account"),R(),et(`Opening ${ae.info(h)}`),R(),jO(h),Y("Waiting for signup to complete...");while(new Date<d){await EO(g);try{let b=await xy({apiBaseUrl:i,deviceCode:a.deviceCode});if(b.status==="pending"){g=(b.interval??a.interval)*1000;continue}if(b.status==="denied"){if(e.json)return v("Signup was denied.");return R(),p("Signup was denied.")}if(b.status==="expired"){if(e.json)return v("Signup request expired. Please try again.");return R(),p("Signup request expired. Please try again.")}await Ky({token:b.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(b){let y=b instanceof Error?b.message:String(b);if(e.json)return v(`Signup failed: ${y}`);return R(),p(`Signup failed: ${y}`)}}if(e.json)return v("Signup request expired. Please try again.");return R(),p("Signup request expired. Please try again.")},xx=async(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=t.profiles[o]??{},r=Gy(n,e.apiBaseUrl),i=UO(r,e.authBaseUrl??n.authBaseUrl),a;try{a=await Cy({apiBaseUrl:i})}catch(g){let b=g instanceof Error?g.message:String(g);if(e.json)return v(`Failed to initiate login: ${b}`);return p(`Failed to initiate login: ${b}`)}let c=KO({profile:n,publicApiBaseUrl:r,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:a.verificationUriComplete}),u=Bx(a.verificationUriComplete,c),h=new Date(Date.now()+a.expiresIn*1000),d=a.interval*1000;if(!e.json)R(),ce("Login to Sazabi"),R(),et("Enter this code in your browser:"),R(),et(ae.bold(a.userCode),4),R(),et(`Opening ${ae.info(u)}`),R(),jO(u),Y("Waiting for authorization...");while(new Date<h){await EO(d);try{let g=await xy({apiBaseUrl:i,deviceCode:a.deviceCode});if(g.status==="pending"){d=(g.interval??a.interval)*1000;continue}if(g.status==="denied"){if(e.json)return v("Authorization was denied.");return R(),p("Authorization was denied.")}if(g.status==="expired"){if(e.json)return v("Authorization request expired. Please try again.");return R(),p("Authorization request expired. Please try again.")}await Ky({token:g.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(g){let b=g instanceof Error?g.message:String(g);if(e.json)return v(`Authorization failed: ${b}`);return R(),p(`Authorization failed: ${b}`)}}if(e.json)return v("Authorization request expired. Please try again.");return R(),p("Authorization request expired. Please try again.")},zx=(e)=>{let t=f(ie(),"Failed to read settings",e.json),o=f(Ze(t),"Failed to resolve profile",e.json),n=Boolean(o.token),r=f(Re(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0}),"Failed to update profile",e.json);if(f(me(r),"Failed to remove credentials",e.json),e.json){j({removed:n});return}if(n){H("Logged out successfully.");return}Y("No credentials were saved.")},Ky=async({token:e,options:t,cliSettings:o,status:n})=>{let r=ut(o),i=o.profiles[r]??{},a=Gy(i,t.apiBaseUrl),c=L({token:e,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),u=f(await c.me(),`Failed to resolve authenticated context at ${a} (pass --api-base-url to target a different environment)`,t.json);if(n==="authorized"&&u.credentialType!=="user"){if(t.json)return v("Expected a user session from device authorization.");return p("Expected a user session from device authorization.")}let h=o.profiles[r]?o:{...o,profiles:{...o.profiles,[r]:{}}},d=h.profiles[r],g=await jx({client:c,credential:u,currentProjectId:d.activeProjectId,jsonMode:t.json}),b=f(Re(h,{token:e,activeOrganizationId:g.activeOrganizationId,organizationName:g.activeOrganizationName,activeProjectId:g.activeProjectId,apiBaseUrl:t.apiBaseUrl??d.apiBaseUrl,authBaseUrl:t.authBaseUrl??d.authBaseUrl,webBaseUrl:t.webBaseUrl??d.webBaseUrl}),"Failed to update profile",t.json);if(f(me(b),"Failed to save credentials",t.json),t.json){j({status:n,credential:u,activeOrganizationId:g.activeOrganizationId,activeProjectId:g.activeProjectId,projects:g.projects});return}if(R(),H(n==="authorized"?"Successfully authenticated!":"Saved token."),R(),Ux({credential:u,activeOrganizationName:g.activeOrganizationName,activeProjectId:g.activeProjectId,projects:g.projects}),g.projects.length>0){R(),ce("Available Projects");for(let y of g.projects){let S=y.id===g.activeProjectId?ae.success(" (active)"):"";et(`${y.name} (${y.region})${S}`)}}},jx=async({client:e,credential:t,currentProjectId:o,jsonMode:n})=>{if(t.credentialType==="partner")return{projects:[]};let r=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,i=t.credentialType==="user"?t.organizations.find((c)=>c.id===r)?.name:t.organization.name,a=r?f(await e.projects.list({organizationId:r}),"Failed to fetch projects",n).projects:[];return{activeOrganizationId:r,activeOrganizationName:i,activeProjectId:Ex(a,o),projects:a}},Ex=(e,t)=>{if(t&&e.some((o)=>o.id===t))return t;return e[0]?.id},Ux=({credential:e,activeOrganizationName:t,activeProjectId:o,projects:n})=>{if(e.credentialType==="user"){ne({Type:"User token",User:e.user.name??e.user.email,Organizations:e.organizations.length.toString(),"Active Organization":t??"(none)","Active Project":n.find((r)=>r.id===o)?.name??"(none)"});return}if(e.credentialType==="secret"){ne({Type:"Secret key",Organization:e.organization.name,"Key Name":e.keyName,"Active Project":n.find((r)=>r.id===o)?.name??"(none)"});return}ne({Type:"Partner key",Superorganization:e.superorganization.name})},Gy=(e,t)=>{return ht({cliFlag:t,globalUrl:e.apiBaseUrl,globalDomain:e.apiDomain,buildUrlFromDomain:(o)=>`https://api.${o}`,defaultUrl:"https://api.sazabi.com"})},UO=(e,t)=>{if(t)return t;try{let o=new URL(e);if(["localhost","127.0.0.1"].includes(o.hostname)&&["15005","15009"].includes(o.port))return o.port="15001",o.toString().replace(/\/$/,"");if(o.hostname==="api.sazabi.com")return o.hostname="api.platform.sazabi.com",o.toString().replace(/\/$/,"");if(o.hostname==="api.staging.sazabi.dev")return o.hostname="api.platform.staging.sazabi.dev",o.toString().replace(/\/$/,"");return o.toString().replace(/\/$/,"")}catch{return e}},RO=(e)=>e.replace(/\/+$/,""),Ke=(e)=>(e?.trim().length??0)>0,Rx=(e)=>{if(!Ke(e))return;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return}},qa=(e)=>{if(!Ke(e))return;try{let o=new URL(e).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(o))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(o))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(o))return"https://app.sazabi.com"}catch{return}return},Kx=(e)=>{if(Ke(e.webBaseUrl))return RO(e.webBaseUrl);if(Ke(e.webDomain))return Ha(e.webDomain);return},Gx=({profile:e,publicApiBaseUrl:t})=>{if(!(Ke(e.authBaseUrl)||Ke(e.apiBaseUrl)||Ke(e.apiDomain)))return;if(Ke(e.authBaseUrl)){let n=qa(e.authBaseUrl);if(n)return n}return qa(t)},KO=({profile:e,publicApiBaseUrl:t,authBaseUrl:o,apiBaseUrlOverride:n,authBaseUrlOverride:r,webBaseUrlOverride:i,verificationUriComplete:a})=>{if(Ke(i))return RO(i);let c=process.env.SAZABI_API_URL?.trim(),u=Ke(r)||Ke(n)||Ke(c),h=Rx(a);if(u){let b=Ke(r)?qa(o):qa(t);if(b)return b;if(h)return h}let d=Kx(e);if(d)return d;let g=Gx({profile:e,publicApiBaseUrl:t});if(g)return g;if(h)return h;return"https://app.sazabi.com"},Bx=(e,t)=>{if(!t)return e;try{let o=new URL(e),n=new URL(t);return o.protocol=n.protocol,o.host=n.host,o.toString()}catch{return e}},GO=W("auth","Manage authentication credentials").withSubcommands({signup:P("signup","Create a new Sazabi account via browser",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Cx({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...q,"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:P("login","Authenticate via browser",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await xx({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...q,"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:P("save","Save an existing bearer token",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"web-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Token is required.");return p("Token is required.")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await Lx(n,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({...q,"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:P("logout","Remove saved credentials",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}zx({json:t.json})}).withOptions(q).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:P("whoami","Display current authentication context",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Nx({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(q).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();F();var BO=()=>`
|
|
4281
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(t===a[0]){i(a);continue}if(e.external){let h=e.external.registry.get(a[0])?.id;if(t!==a[0]&&h){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(c.cycle){i(a);continue}if(c.count>1){if(e.reused==="ref"){i(a);continue}}}}function Ut(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,h={...u},s=c.ref;if(c.ref=null,s){n(s);let b=e.seen.get(s),y=b.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(y);else Object.assign(u,y);if(Object.assign(u,h),a._zod.parent===s)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(!(S in h))delete u[S]}if(y.$ref&&b.def)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(S in b.def&&JSON.stringify(u[S])===JSON.stringify(b.def[S]))delete u[S]}}let g=a._zod.parent;if(g&&g!==s){n(g);let b=e.seen.get(g);if(b?.schema.$ref){if(u.$ref=b.schema.$ref,b.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in b.def&&JSON.stringify(u[y])===JSON.stringify(b.def[y]))delete u[y]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let r={};if(e.target==="draft-2020-12")r.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")r.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")r.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}Object.assign(r,o.def??o.schema);let i=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId)i[c.defId]=c.def}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")r.$defs=i;else r.definitions=i;try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Er(t,"input",e.processors),output:Er(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function De(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return De(n.element,o);if(n.type==="set")return De(n.valueType,o);if(n.type==="lazy")return De(n.getter(),o);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return De(n.innerType,o);if(n.type==="intersection")return De(n.left,o)||De(n.right,o);if(n.type==="record"||n.type==="map")return De(n.keyType,o)||De(n.valueType,o);if(n.type==="pipe")return De(n.in,o)||De(n.out,o);if(n.type==="object"){for(let r in n.shape)if(De(n.shape[r],o))return!0;return!1}if(n.type==="union"){for(let r of n.options)if(De(r,o))return!0;return!1}if(n.type==="tuple"){for(let r of n.items)if(De(r,o))return!0;if(n.rest&&De(n.rest,o))return!0;return!1}return!1}var Bs=(e,t={})=>(o)=>{let n=jt({...o,processors:t});return Z(e,n),Et(n,e),Ut(n,e)},Er=(e,t,o={})=>(n)=>{let{libraryOptions:r,target:i}=n??{},a=jt({...r??{},target:i,io:t,processors:o});return Z(e,a),Et(a,e),Ut(a,e)};var Qo=d(()=>{Yo()});function Ki(e,t){if("_idmap"in e){let n=e,r=jt({...t,processors:Ei}),i={};for(let u of n._idmap.entries()){let[h,s]=u;Z(s,r)}let a={},c={registry:n,uri:t?.uri,defs:i};r.external=c;for(let u of n._idmap.entries()){let[h,s]=u;Et(r,s),a[h]=Ut(r,s)}if(Object.keys(i).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let o=jt({...t,processors:Ei});return Z(e,o),Et(o,e),Ut(o,e)}var aL,Hs=(e,t,o,n)=>{let r=o;r.type="string";let{minimum:i,maximum:a,format:c,patterns:u,contentEncoding:h}=e._zod.bag;if(typeof i==="number")r.minLength=i;if(typeof a==="number")r.maxLength=a;if(c){if(r.format=aL[c]??c,r.format==="")delete r.format;if(c==="time")delete r.format}if(h)r.contentEncoding=h;if(u&&u.size>0){let s=[...u];if(s.length===1)r.pattern=s[0].source;else if(s.length>1)r.allOf=[...s.map((g)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))]}},Ms=(e,t,o,n)=>{let r=o,{minimum:i,maximum:a,format:c,multipleOf:u,exclusiveMaximum:h,exclusiveMinimum:s}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))r.type="integer";else r.type="number";if(typeof s==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")r.minimum=s,r.exclusiveMinimum=!0;else r.exclusiveMinimum=s;if(typeof i==="number"){if(r.minimum=i,typeof s==="number"&&t.target!=="draft-04")if(s>=i)delete r.minimum;else delete r.exclusiveMinimum}if(typeof h==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")r.maximum=h,r.exclusiveMaximum=!0;else r.exclusiveMaximum=h;if(typeof a==="number"){if(r.maximum=a,typeof h==="number"&&t.target!=="draft-04")if(h<=a)delete r.maximum;else delete r.exclusiveMaximum}if(typeof u==="number")r.multipleOf=u},Js=(e,t,o,n)=>{o.type="boolean"},Vs=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},qs=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Ws=(e,t,o,n)=>{if(t.target==="openapi-3.0")o.type="string",o.nullable=!0,o.enum=[null];else o.type="null"},Ys=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Xs=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Zs=(e,t,o,n)=>{o.not={}},Qs=(e,t,o,n)=>{},ed=(e,t,o,n)=>{},td=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},rd=(e,t,o,n)=>{let r=e._zod.def,i=No(r.entries);if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";o.enum=i},od=(e,t,o,n)=>{let r=e._zod.def,i=[];for(let a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(a));else i.push(a);if(i.length===0);else if(i.length===1){let a=i[0];if(o.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")o.enum=[a];else o.const=a}else{if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";if(i.every((a)=>typeof a==="boolean"))o.type="boolean";if(i.every((a)=>a===null))o.type="null";o.enum=i}},nd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},id=(e,t,o,n)=>{let r=o,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},ad=(e,t,o,n)=>{let r=o,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:u}=e._zod.bag;if(a!==void 0)i.minLength=a;if(c!==void 0)i.maxLength=c;if(u)if(u.length===1)i.contentMediaType=u[0],Object.assign(r,i);else Object.assign(r,i),r.anyOf=u.map((h)=>({contentMediaType:h}));else Object.assign(r,i)},cd=(e,t,o,n)=>{o.type="boolean"},ld=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},ud=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},hd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},gd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},sd=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},dd=(e,t,o,n)=>{let r=o,i=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;if(typeof a==="number")r.minItems=a;if(typeof c==="number")r.maxItems=c;r.type="array",r.items=Z(i.element,t,{...n,path:[...n.path,"items"]})},bd=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let h in a)r.properties[h]=Z(a[h],t,{...n,path:[...n.path,"properties",h]});let c=new Set(Object.keys(a)),u=new Set([...c].filter((h)=>{let s=i.shape[h]._zod;if(t.io==="input")return s.optin===void 0;else return s.optout===void 0}));if(u.size>0)r.required=Array.from(u);if(i.catchall?._zod.def.type==="never")r.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")r.additionalProperties=!1}else if(i.catchall)r.additionalProperties=Z(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},Ui=(e,t,o,n)=>{let r=e._zod.def,i=r.inclusive===!1,a=r.options.map((c,u)=>Z(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)o.oneOf=a;else o.anyOf=a},yd=(e,t,o,n)=>{let r=e._zod.def,i=Z(r.left,t,{...n,path:[...n.path,"allOf",0]}),a=Z(r.right,t,{...n,path:[...n.path,"allOf",1]}),c=(h)=>("allOf"in h)&&Object.keys(h).length===1,u=[...c(i)?i.allOf:[i],...c(a)?a.allOf:[a]];o.allOf=u},md=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((b,y)=>Z(b,t,{...n,path:[...n.path,a,y]})),h=i.rest?Z(i.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(r.prefixItems=u,h)r.items=h}else if(t.target==="openapi-3.0"){if(r.items={anyOf:u},h)r.items.anyOf.push(h);if(r.minItems=u.length,!h)r.maxItems=u.length}else if(r.items=u,h)r.additionalItems=h;let{minimum:s,maximum:g}=e._zod.bag;if(typeof s==="number")r.minItems=s;if(typeof g==="number")r.maxItems=g},pd=(e,t,o,n)=>{let r=o,i=e._zod.def;r.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let s=Z(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});r.patternProperties={};for(let g of u)r.patternProperties[g.source]=s}else{if(t.target==="draft-07"||t.target==="draft-2020-12")r.propertyNames=Z(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});r.additionalProperties=Z(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let h=a._zod.values;if(h){let s=[...h].filter((g)=>typeof g==="string"||typeof g==="number");if(s.length>0)r.required=s}},vd=(e,t,o,n)=>{let r=e._zod.def,i=Z(r.innerType,t,n),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=r.innerType,o.nullable=!0;else o.anyOf=[i,{type:"null"}]},Id=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},fd=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType,o.default=JSON.parse(JSON.stringify(r.defaultValue))},kd=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);if(i.ref=r.innerType,t.io==="input")o._prefault=JSON.parse(JSON.stringify(r.defaultValue))},$d=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}o.default=a},wd=(e,t,o,n)=>{let r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Z(i,t,n);let a=t.seen.get(e);a.ref=i},_d=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType,o.readOnly=!0},Od=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},Ri=(e,t,o,n)=>{let r=e._zod.def;Z(r.innerType,t,n);let i=t.seen.get(e);i.ref=r.innerType},Sd=(e,t,o,n)=>{let r=e._zod.innerType;Z(r,t,n);let i=t.seen.get(e);i.ref=r},Ei;var en=d(()=>{Qo();x();aL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ei={string:Hs,number:Ms,boolean:Js,bigint:Vs,symbol:qs,null:Ws,undefined:Ys,void:Xs,never:Zs,any:Qs,unknown:ed,date:td,enum:rd,literal:od,nan:nd,template_literal:id,file:ad,success:cd,custom:ld,function:ud,transform:hd,map:gd,set:sd,array:dd,object:bd,union:Ui,intersection:yd,tuple:md,record:pd,nullable:vd,nonoptional:Id,default:fd,prefault:kd,catch:$d,pipe:wd,readonly:_d,promise:Od,optional:Ri,lazy:Sd}});class Td{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=jt({processors:Ei,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Z(e,this.ctx,t)}emit(e,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}Et(this.ctx,e);let o=Ut(this.ctx,e),{"~standard":n,...r}=o;return r}}var s$=d(()=>{en();Qo()});var d$={};var b$=()=>{};var It={};Qe(It,{version:()=>Ju,util:()=>w,treeifyError:()=>ql,toJSONSchema:()=>Ki,toDotPath:()=>Hf,safeParseAsync:()=>Zl,safeParse:()=>Xl,safeEncodeAsync:()=>dD,safeEncode:()=>gD,safeDecodeAsync:()=>bD,safeDecode:()=>sD,registry:()=>gi,regexes:()=>Je,process:()=>Z,prettifyError:()=>Wl,parseAsync:()=>Fn,parse:()=>Kn,meta:()=>Fs,locales:()=>Wo,isValidJWT:()=>uk,isValidBase64URL:()=>lk,isValidBase64:()=>yh,initializeContext:()=>jt,globalRegistry:()=>ve,globalConfig:()=>Ao,formatError:()=>Uo,flattenError:()=>Eo,finalize:()=>Ut,extractDefs:()=>Et,encodeAsync:()=>uD,encode:()=>cD,describe:()=>Ks,decodeAsync:()=>hD,decode:()=>lD,createToJSONSchemaMethod:()=>Bs,createStandardJSONSchemaMethod:()=>Er,config:()=>ue,clone:()=>Pe,_xor:()=>UN,_xid:()=>$i,_void:()=>Ns,_uuidv7:()=>mi,_uuidv6:()=>yi,_uuidv4:()=>bi,_uuid:()=>di,_url:()=>Zo,_uppercase:()=>Sr,_unknown:()=>As,_union:()=>EN,_undefined:()=>Ss,_ulid:()=>ki,_uint64:()=>_s,_uint32:()=>vs,_tuple:()=>FN,_trim:()=>Lr,_transform:()=>qN,_toUpperCase:()=>xr,_toLowerCase:()=>Cr,_templateLiteral:()=>oL,_symbol:()=>Os,_superRefine:()=>Rs,_success:()=>QN,_stringbool:()=>Gs,_stringFormat:()=>jr,_string:()=>ns,_startsWith:()=>Pr,_slugify:()=>zr,_size:()=>Zt,_set:()=>HN,_safeParseAsync:()=>kr,_safeParse:()=>fr,_safeEncodeAsync:()=>qn,_safeEncode:()=>Jn,_safeDecodeAsync:()=>Wn,_safeDecode:()=>Vn,_regex:()=>_r,_refine:()=>Us,_record:()=>GN,_readonly:()=>rL,_property:()=>ji,_promise:()=>iL,_positive:()=>Li,_pipe:()=>tL,_parseAsync:()=>Ir,_parse:()=>vr,_overwrite:()=>Xe,_optional:()=>WN,_number:()=>ss,_nullable:()=>YN,_null:()=>Ts,_normalize:()=>Nr,_nonpositive:()=>xi,_nonoptional:()=>ZN,_nonnegative:()=>zi,_never:()=>Ds,_negative:()=>Ci,_nativeEnum:()=>JN,_nanoid:()=>vi,_nan:()=>xs,_multipleOf:()=>xt,_minSize:()=>ct,_minLength:()=>vt,_min:()=>Ae,_mime:()=>Dr,_maxSize:()=>zt,_maxLength:()=>Qt,_max:()=>Ee,_map:()=>BN,_mac:()=>as,_lte:()=>Ee,_lt:()=>it,_lowercase:()=>Or,_literal:()=>VN,_length:()=>er,_lazy:()=>nL,_ksuid:()=>wi,_jwt:()=>Ni,_isoTime:()=>hs,_isoDuration:()=>gs,_isoDateTime:()=>ls,_isoDate:()=>us,_ipv6:()=>Oi,_ipv4:()=>_i,_intersection:()=>KN,_int64:()=>ws,_int32:()=>ps,_int:()=>bs,_includes:()=>Tr,_guid:()=>Xo,_gte:()=>Ae,_gt:()=>at,_float64:()=>ms,_float32:()=>ys,_file:()=>js,_enum:()=>MN,_endsWith:()=>Ar,_encodeAsync:()=>Hn,_encode:()=>Gn,_emoji:()=>pi,_email:()=>si,_e164:()=>Di,_discriminatedUnion:()=>RN,_default:()=>XN,_decodeAsync:()=>Mn,_decode:()=>Bn,_date:()=>Ls,_custom:()=>Es,_cuid2:()=>fi,_cuid:()=>Ii,_coercedString:()=>is,_coercedNumber:()=>ds,_coercedDate:()=>Cs,_coercedBoolean:()=>fs,_coercedBigint:()=>$s,_cidrv6:()=>Ti,_cidrv4:()=>Si,_check:()=>h$,_catch:()=>eL,_boolean:()=>Is,_bigint:()=>ks,_base64url:()=>Ai,_base64:()=>Pi,_array:()=>zs,_any:()=>Ps,TimePrecision:()=>cs,NEVER:()=>El,JSONSchemaGenerator:()=>Td,JSONSchema:()=>d$,Doc:()=>ti,$output:()=>ts,$input:()=>rs,$constructor:()=>m,$brand:()=>Ul,$ZodXor:()=>Ch,$ZodXID:()=>nh,$ZodVoid:()=>Ah,$ZodUnknown:()=>Th,$ZodUnion:()=>Bo,$ZodUndefined:()=>_h,$ZodUUID:()=>Yu,$ZodURL:()=>Zu,$ZodULID:()=>oh,$ZodType:()=>E,$ZodTuple:()=>ui,$ZodTransform:()=>Gh,$ZodTemplateLiteral:()=>Qh,$ZodSymbol:()=>wh,$ZodSuccess:()=>qh,$ZodStringFormat:()=>Q,$ZodString:()=>Xt,$ZodSet:()=>Uh,$ZodRegistry:()=>os,$ZodRecord:()=>jh,$ZodRealError:()=>xe,$ZodReadonly:()=>Zh,$ZodPromise:()=>tg,$ZodPrefault:()=>Jh,$ZodPipe:()=>Xh,$ZodOptional:()=>hi,$ZodObjectJIT:()=>Lh,$ZodObject:()=>sk,$ZodNumberFormat:()=>kh,$ZodNumber:()=>ci,$ZodNullable:()=>Hh,$ZodNull:()=>Oh,$ZodNonOptional:()=>Vh,$ZodNever:()=>Ph,$ZodNanoID:()=>eh,$ZodNaN:()=>Yh,$ZodMap:()=>Eh,$ZodMAC:()=>sh,$ZodLiteral:()=>Kh,$ZodLazy:()=>rg,$ZodKSUID:()=>ih,$ZodJWT:()=>Ih,$ZodIntersection:()=>zh,$ZodISOTime:()=>lh,$ZodISODuration:()=>uh,$ZodISODateTime:()=>ah,$ZodISODate:()=>ch,$ZodIPv6:()=>gh,$ZodIPv4:()=>hh,$ZodGUID:()=>Wu,$ZodFunction:()=>eg,$ZodFile:()=>Fh,$ZodExactOptional:()=>Bh,$ZodError:()=>jo,$ZodEnum:()=>Rh,$ZodEncodeError:()=>qt,$ZodEmoji:()=>Qu,$ZodEmail:()=>Xu,$ZodE164:()=>vh,$ZodDiscriminatedUnion:()=>xh,$ZodDefault:()=>Mh,$ZodDate:()=>Dh,$ZodCustomStringFormat:()=>fh,$ZodCustom:()=>og,$ZodCodec:()=>Ho,$ZodCheckUpperCase:()=>Ru,$ZodCheckStringFormat:()=>$r,$ZodCheckStartsWith:()=>Fu,$ZodCheckSizeEquals:()=>Cu,$ZodCheckRegex:()=>Eu,$ZodCheckProperty:()=>Bu,$ZodCheckOverwrite:()=>Mu,$ZodCheckNumberFormat:()=>Au,$ZodCheckMultipleOf:()=>Pu,$ZodCheckMinSize:()=>Lu,$ZodCheckMinLength:()=>zu,$ZodCheckMimeType:()=>Hu,$ZodCheckMaxSize:()=>Nu,$ZodCheckMaxLength:()=>xu,$ZodCheckLowerCase:()=>Uu,$ZodCheckLessThan:()=>Zn,$ZodCheckLengthEquals:()=>ju,$ZodCheckIncludes:()=>Ku,$ZodCheckGreaterThan:()=>Qn,$ZodCheckEndsWith:()=>Gu,$ZodCheckBigIntFormat:()=>Du,$ZodCheck:()=>te,$ZodCatch:()=>Wh,$ZodCUID2:()=>rh,$ZodCUID:()=>th,$ZodCIDRv6:()=>bh,$ZodCIDRv4:()=>dh,$ZodBoolean:()=>Go,$ZodBigIntFormat:()=>$h,$ZodBigInt:()=>li,$ZodBase64URL:()=>ph,$ZodBase64:()=>mh,$ZodAsyncError:()=>nt,$ZodArray:()=>Nh,$ZodAny:()=>Sh});var Ue=d(()=>{x();Xn();es();en();s$();b$();br();Ql();Yl();ng();ei();Vu();Yo();g$();Qo()});var Fi={};Qe(Fi,{uppercase:()=>Sr,trim:()=>Lr,toUpperCase:()=>xr,toLowerCase:()=>Cr,startsWith:()=>Pr,slugify:()=>zr,size:()=>Zt,regex:()=>_r,property:()=>ji,positive:()=>Li,overwrite:()=>Xe,normalize:()=>Nr,nonpositive:()=>xi,nonnegative:()=>zi,negative:()=>Ci,multipleOf:()=>xt,minSize:()=>ct,minLength:()=>vt,mime:()=>Dr,maxSize:()=>zt,maxLength:()=>Qt,lte:()=>Ee,lt:()=>it,lowercase:()=>Or,length:()=>er,includes:()=>Tr,gte:()=>Ae,gt:()=>at,endsWith:()=>Ar});var Gi=d(()=>{Ue()});var Ur={};Qe(Ur,{time:()=>Dd,duration:()=>Nd,datetime:()=>Pd,date:()=>Ad,ZodISOTime:()=>Mi,ZodISODuration:()=>Ji,ZodISODateTime:()=>Bi,ZodISODate:()=>Hi});function Pd(e){return ls(Bi,e)}function Ad(e){return us(Hi,e)}function Dd(e){return hs(Mi,e)}function Nd(e){return gs(Ji,e)}var Bi,Hi,Mi,Ji;var tn=d(()=>{Ue();on();Bi=m("ZodISODateTime",(e,t)=>{ah.init(e,t),ee.init(e,t)});Hi=m("ZodISODate",(e,t)=>{ch.init(e,t),ee.init(e,t)});Mi=m("ZodISOTime",(e,t)=>{lh.init(e,t),ee.init(e,t)});Ji=m("ZodISODuration",(e,t)=>{uh.init(e,t),ee.init(e,t)})});var y$=(e,t)=>{jo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(o)=>Uo(e,o)},flatten:{value:(o)=>Eo(e,o)},addIssue:{value:(o)=>{e.issues.push(o),e.message=JSON.stringify(e.issues,yr,2)}},addIssues:{value:(o)=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,yr,2)}},isEmpty:{get(){return e.issues.length===0}}})},lL,ze;var Ld=d(()=>{Ue();Ue();x();lL=m("ZodError",y$),ze=m("ZodError",y$,{Parent:Error})});var Cd,xd,zd,jd,Ed,Ud,Rd,Kd,Fd,Gd,Bd,Hd;var Md=d(()=>{Ue();Ld();Cd=vr(ze),xd=Ir(ze),zd=fr(ze),jd=kr(ze),Ed=Gn(ze),Ud=Bn(ze),Rd=Hn(ze),Kd=Mn(ze),Fd=Jn(ze),Gd=Vn(ze),Bd=qn(ze),Hd=Wn(ze)});var rn={};Qe(rn,{xor:()=>aw,xid:()=>A$,void:()=>ew,uuidv7:()=>k$,uuidv6:()=>f$,uuidv4:()=>I$,uuid:()=>v$,url:()=>$$,unknown:()=>tr,union:()=>ba,undefined:()=>Z$,ulid:()=>P$,uint64:()=>Y$,uint32:()=>V$,tuple:()=>ub,transform:()=>ma,templateLiteral:()=>Iw,symbol:()=>X$,superRefine:()=>jb,success:()=>mw,stringbool:()=>Tw,stringFormat:()=>K$,string:()=>Vi,strictObject:()=>nw,set:()=>gw,refine:()=>zb,record:()=>hb,readonly:()=>Ab,promise:()=>fw,preprocess:()=>Aw,prefault:()=>$b,pipe:()=>ln,partialRecord:()=>lw,optional:()=>an,object:()=>ow,number:()=>Vd,nullish:()=>yw,nullable:()=>cn,null:()=>Zd,nonoptional:()=>wb,never:()=>da,nativeEnum:()=>sw,nanoid:()=>O$,nan:()=>pw,meta:()=>Ow,map:()=>hw,mac:()=>L$,looseRecord:()=>uw,looseObject:()=>iw,literal:()=>dw,lazy:()=>Lb,ksuid:()=>D$,keyof:()=>rw,jwt:()=>R$,json:()=>Pw,ipv6:()=>C$,ipv4:()=>N$,intersection:()=>cb,int64:()=>W$,int32:()=>J$,int:()=>qi,instanceof:()=>Sw,httpUrl:()=>w$,hostname:()=>F$,hex:()=>G$,hash:()=>B$,guid:()=>p$,function:()=>kw,float64:()=>M$,float32:()=>H$,file:()=>bw,exactOptional:()=>pb,enum:()=>ya,emoji:()=>_$,email:()=>m$,e164:()=>U$,discriminatedUnion:()=>cw,describe:()=>_w,date:()=>tw,custom:()=>ww,cuid2:()=>T$,cuid:()=>S$,codec:()=>vw,cidrv6:()=>z$,cidrv4:()=>x$,check:()=>$w,catch:()=>Sb,boolean:()=>qd,bigint:()=>q$,base64url:()=>E$,base64:()=>j$,array:()=>gn,any:()=>Q$,_function:()=>kw,_default:()=>fb,_ZodString:()=>Wi,ZodXor:()=>nb,ZodXID:()=>ra,ZodVoid:()=>rb,ZodUnknown:()=>eb,ZodUnion:()=>dn,ZodUndefined:()=>Yd,ZodUUID:()=>lt,ZodURL:()=>un,ZodULID:()=>ta,ZodType:()=>K,ZodTuple:()=>lb,ZodTransform:()=>yb,ZodTemplateLiteral:()=>Db,ZodSymbol:()=>Wd,ZodSuccess:()=>_b,ZodStringFormat:()=>ee,ZodString:()=>Kr,ZodSet:()=>sb,ZodRecord:()=>bn,ZodReadonly:()=>Pb,ZodPromise:()=>Cb,ZodPrefault:()=>kb,ZodPipe:()=>Ia,ZodOptional:()=>pa,ZodObject:()=>sn,ZodNumberFormat:()=>rr,ZodNumber:()=>Gr,ZodNullable:()=>vb,ZodNull:()=>Xd,ZodNonOptional:()=>va,ZodNever:()=>tb,ZodNanoID:()=>Zi,ZodNaN:()=>Tb,ZodMap:()=>gb,ZodMAC:()=>Jd,ZodLiteral:()=>db,ZodLazy:()=>Nb,ZodKSUID:()=>oa,ZodJWT:()=>ga,ZodIntersection:()=>ab,ZodIPv6:()=>ia,ZodIPv4:()=>na,ZodGUID:()=>nn,ZodFunction:()=>xb,ZodFile:()=>bb,ZodExactOptional:()=>mb,ZodEnum:()=>Rr,ZodEmoji:()=>Xi,ZodEmail:()=>Yi,ZodE164:()=>ha,ZodDiscriminatedUnion:()=>ib,ZodDefault:()=>Ib,ZodDate:()=>hn,ZodCustomStringFormat:()=>Fr,ZodCustom:()=>yn,ZodCodec:()=>fa,ZodCatch:()=>Ob,ZodCUID2:()=>ea,ZodCUID:()=>Qi,ZodCIDRv6:()=>ca,ZodCIDRv4:()=>aa,ZodBoolean:()=>Br,ZodBigIntFormat:()=>sa,ZodBigInt:()=>Hr,ZodBase64URL:()=>ua,ZodBase64:()=>la,ZodArray:()=>ob,ZodAny:()=>Qd});function Vi(e){return ns(Kr,e)}function m$(e){return si(Yi,e)}function p$(e){return Xo(nn,e)}function v$(e){return di(lt,e)}function I$(e){return bi(lt,e)}function f$(e){return yi(lt,e)}function k$(e){return mi(lt,e)}function $$(e){return Zo(un,e)}function w$(e){return Zo(un,{protocol:/^https?$/,hostname:Je.domain,...w.normalizeParams(e)})}function _$(e){return pi(Xi,e)}function O$(e){return vi(Zi,e)}function S$(e){return Ii(Qi,e)}function T$(e){return fi(ea,e)}function P$(e){return ki(ta,e)}function A$(e){return $i(ra,e)}function D$(e){return wi(oa,e)}function N$(e){return _i(na,e)}function L$(e){return as(Jd,e)}function C$(e){return Oi(ia,e)}function x$(e){return Si(aa,e)}function z$(e){return Ti(ca,e)}function j$(e){return Pi(la,e)}function E$(e){return Ai(ua,e)}function U$(e){return Di(ha,e)}function R$(e){return Ni(ga,e)}function K$(e,t,o={}){return jr(Fr,e,t,o)}function F$(e){return jr(Fr,"hostname",Je.hostname,e)}function G$(e){return jr(Fr,"hex",Je.hex,e)}function B$(e,t){let o=t?.enc??"hex",n=`${e}_${o}`,r=Je[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return jr(Fr,n,r,t)}function Vd(e){return ss(Gr,e)}function qi(e){return bs(rr,e)}function H$(e){return ys(rr,e)}function M$(e){return ms(rr,e)}function J$(e){return ps(rr,e)}function V$(e){return vs(rr,e)}function qd(e){return Is(Br,e)}function q$(e){return ks(Hr,e)}function W$(e){return ws(sa,e)}function Y$(e){return _s(sa,e)}function X$(e){return Os(Wd,e)}function Z$(e){return Ss(Yd,e)}function Zd(e){return Ts(Xd,e)}function Q$(){return Ps(Qd)}function tr(){return As(eb)}function da(e){return Ds(tb,e)}function ew(e){return Ns(rb,e)}function tw(e){return Ls(hn,e)}function gn(e,t){return zs(ob,e,t)}function rw(e){let t=e._zod.def.shape;return ya(Object.keys(t))}function ow(e,t){let o={type:"object",shape:e??{},...w.normalizeParams(t)};return new sn(o)}function nw(e,t){return new sn({type:"object",shape:e,catchall:da(),...w.normalizeParams(t)})}function iw(e,t){return new sn({type:"object",shape:e,catchall:tr(),...w.normalizeParams(t)})}function ba(e,t){return new dn({type:"union",options:e,...w.normalizeParams(t)})}function aw(e,t){return new nb({type:"union",options:e,inclusive:!1,...w.normalizeParams(t)})}function cw(e,t,o){return new ib({type:"union",options:t,discriminator:e,...w.normalizeParams(o)})}function cb(e,t){return new ab({type:"intersection",left:e,right:t})}function ub(e,t,o){let n=t instanceof E,r=n?o:t;return new lb({type:"tuple",items:e,rest:n?t:null,...w.normalizeParams(r)})}function hb(e,t,o){return new bn({type:"record",keyType:e,valueType:t,...w.normalizeParams(o)})}function lw(e,t,o){let n=Pe(e);return n._zod.values=void 0,new bn({type:"record",keyType:n,valueType:t,...w.normalizeParams(o)})}function uw(e,t,o){return new bn({type:"record",keyType:e,valueType:t,mode:"loose",...w.normalizeParams(o)})}function hw(e,t,o){return new gb({type:"map",keyType:e,valueType:t,...w.normalizeParams(o)})}function gw(e,t){return new sb({type:"set",valueType:e,...w.normalizeParams(t)})}function ya(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Rr({type:"enum",entries:o,...w.normalizeParams(t)})}function sw(e,t){return new Rr({type:"enum",entries:e,...w.normalizeParams(t)})}function dw(e,t){return new db({type:"literal",values:Array.isArray(e)?e:[e],...w.normalizeParams(t)})}function bw(e){return js(bb,e)}function ma(e){return new yb({type:"transform",transform:e})}function an(e){return new pa({type:"optional",innerType:e})}function pb(e){return new mb({type:"optional",innerType:e})}function cn(e){return new vb({type:"nullable",innerType:e})}function yw(e){return an(cn(e))}function fb(e,t){return new Ib({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():w.shallowClone(t)}})}function $b(e,t){return new kb({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():w.shallowClone(t)}})}function wb(e,t){return new va({type:"nonoptional",innerType:e,...w.normalizeParams(t)})}function mw(e){return new _b({type:"success",innerType:e})}function Sb(e,t){return new Ob({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}function pw(e){return xs(Tb,e)}function ln(e,t){return new Ia({type:"pipe",in:e,out:t})}function vw(e,t,o){return new fa({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function Ab(e){return new Pb({type:"readonly",innerType:e})}function Iw(e,t){return new Db({type:"template_literal",parts:e,...w.normalizeParams(t)})}function Lb(e){return new Nb({type:"lazy",getter:e})}function fw(e){return new Cb({type:"promise",innerType:e})}function kw(e){return new xb({type:"function",input:Array.isArray(e?.input)?ub(e?.input):e?.input??gn(tr()),output:e?.output??tr()})}function $w(e){let t=new te({check:"custom"});return t._zod.check=e,t}function ww(e,t){return Es(yn,e??(()=>!0),t)}function zb(e,t={}){return Us(yn,e,t)}function jb(e){return Rs(e)}function Sw(e,t={}){let o=new yn({type:"custom",check:"custom",fn:(n)=>n instanceof e,abort:!0,...w.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=(n)=>{if(!(n.value instanceof e))n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:o,path:[...o._zod.def.path??[]]})},o}function Pw(e){let t=Lb(()=>{return ba([Vi(e),Vd(),qd(),Zd(),gn(t),hb(Vi(),t)])});return t}function Aw(e,t){return ln(ma(e),t)}var K,Wi,Kr,ee,Yi,nn,lt,un,Xi,Zi,Qi,ea,ta,ra,oa,na,Jd,ia,aa,ca,la,ua,ha,ga,Fr,Gr,rr,Br,Hr,sa,Wd,Yd,Xd,Qd,eb,tb,rb,hn,ob,sn,dn,nb,ib,ab,lb,bn,gb,sb,Rr,db,bb,yb,pa,mb,vb,Ib,kb,va,_b,Ob,Tb,Ia,fa,Pb,Db,Nb,Cb,xb,yn,_w,Ow,Tw=(...e)=>Gs({Codec:fa,Boolean:Br,String:Kr},...e);var on=d(()=>{Ue();Ue();en();Qo();Gi();tn();Md();K=m("ZodType",(e,t)=>{return E.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Er(e,"input"),output:Er(e,"output")}}),e.toJSONSchema=Bs(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>{return e.clone(w.mergeDefs(t,{checks:[...t.checks??[],...o.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},e.with=e.check,e.clone=(o,n)=>Pe(e,o,n),e.brand=()=>e,e.register=(o,n)=>{return o.add(e,n),e},e.parse=(o,n)=>Cd(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>zd(e,o,n),e.parseAsync=async(o,n)=>xd(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>jd(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Ed(e,o,n),e.decode=(o,n)=>Ud(e,o,n),e.encodeAsync=async(o,n)=>Rd(e,o,n),e.decodeAsync=async(o,n)=>Kd(e,o,n),e.safeEncode=(o,n)=>Fd(e,o,n),e.safeDecode=(o,n)=>Gd(e,o,n),e.safeEncodeAsync=async(o,n)=>Bd(e,o,n),e.safeDecodeAsync=async(o,n)=>Hd(e,o,n),e.refine=(o,n)=>e.check(zb(o,n)),e.superRefine=(o)=>e.check(jb(o)),e.overwrite=(o)=>e.check(Xe(o)),e.optional=()=>an(e),e.exactOptional=()=>pb(e),e.nullable=()=>cn(e),e.nullish=()=>an(cn(e)),e.nonoptional=(o)=>wb(e,o),e.array=()=>gn(e),e.or=(o)=>ba([e,o]),e.and=(o)=>cb(e,o),e.transform=(o)=>ln(e,ma(o)),e.default=(o)=>fb(e,o),e.prefault=(o)=>$b(e,o),e.catch=(o)=>Sb(e,o),e.pipe=(o)=>ln(e,o),e.readonly=()=>Ab(e),e.describe=(o)=>{let n=e.clone();return ve.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return ve.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return ve.get(e);let n=e.clone();return ve.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=(o)=>o(e),e}),Wi=m("_ZodString",(e,t)=>{Xt.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hs(e,n,r,i);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(_r(...n)),e.includes=(...n)=>e.check(Tr(...n)),e.startsWith=(...n)=>e.check(Pr(...n)),e.endsWith=(...n)=>e.check(Ar(...n)),e.min=(...n)=>e.check(vt(...n)),e.max=(...n)=>e.check(Qt(...n)),e.length=(...n)=>e.check(er(...n)),e.nonempty=(...n)=>e.check(vt(1,...n)),e.lowercase=(n)=>e.check(Or(n)),e.uppercase=(n)=>e.check(Sr(n)),e.trim=()=>e.check(Lr()),e.normalize=(...n)=>e.check(Nr(...n)),e.toLowerCase=()=>e.check(Cr()),e.toUpperCase=()=>e.check(xr()),e.slugify=()=>e.check(zr())}),Kr=m("ZodString",(e,t)=>{Xt.init(e,t),Wi.init(e,t),e.email=(o)=>e.check(si(Yi,o)),e.url=(o)=>e.check(Zo(un,o)),e.jwt=(o)=>e.check(Ni(ga,o)),e.emoji=(o)=>e.check(pi(Xi,o)),e.guid=(o)=>e.check(Xo(nn,o)),e.uuid=(o)=>e.check(di(lt,o)),e.uuidv4=(o)=>e.check(bi(lt,o)),e.uuidv6=(o)=>e.check(yi(lt,o)),e.uuidv7=(o)=>e.check(mi(lt,o)),e.nanoid=(o)=>e.check(vi(Zi,o)),e.guid=(o)=>e.check(Xo(nn,o)),e.cuid=(o)=>e.check(Ii(Qi,o)),e.cuid2=(o)=>e.check(fi(ea,o)),e.ulid=(o)=>e.check(ki(ta,o)),e.base64=(o)=>e.check(Pi(la,o)),e.base64url=(o)=>e.check(Ai(ua,o)),e.xid=(o)=>e.check($i(ra,o)),e.ksuid=(o)=>e.check(wi(oa,o)),e.ipv4=(o)=>e.check(_i(na,o)),e.ipv6=(o)=>e.check(Oi(ia,o)),e.cidrv4=(o)=>e.check(Si(aa,o)),e.cidrv6=(o)=>e.check(Ti(ca,o)),e.e164=(o)=>e.check(Di(ha,o)),e.datetime=(o)=>e.check(Pd(o)),e.date=(o)=>e.check(Ad(o)),e.time=(o)=>e.check(Dd(o)),e.duration=(o)=>e.check(Nd(o))});ee=m("ZodStringFormat",(e,t)=>{Q.init(e,t),Wi.init(e,t)}),Yi=m("ZodEmail",(e,t)=>{Xu.init(e,t),ee.init(e,t)});nn=m("ZodGUID",(e,t)=>{Wu.init(e,t),ee.init(e,t)});lt=m("ZodUUID",(e,t)=>{Yu.init(e,t),ee.init(e,t)});un=m("ZodURL",(e,t)=>{Zu.init(e,t),ee.init(e,t)});Xi=m("ZodEmoji",(e,t)=>{Qu.init(e,t),ee.init(e,t)});Zi=m("ZodNanoID",(e,t)=>{eh.init(e,t),ee.init(e,t)});Qi=m("ZodCUID",(e,t)=>{th.init(e,t),ee.init(e,t)});ea=m("ZodCUID2",(e,t)=>{rh.init(e,t),ee.init(e,t)});ta=m("ZodULID",(e,t)=>{oh.init(e,t),ee.init(e,t)});ra=m("ZodXID",(e,t)=>{nh.init(e,t),ee.init(e,t)});oa=m("ZodKSUID",(e,t)=>{ih.init(e,t),ee.init(e,t)});na=m("ZodIPv4",(e,t)=>{hh.init(e,t),ee.init(e,t)});Jd=m("ZodMAC",(e,t)=>{sh.init(e,t),ee.init(e,t)});ia=m("ZodIPv6",(e,t)=>{gh.init(e,t),ee.init(e,t)});aa=m("ZodCIDRv4",(e,t)=>{dh.init(e,t),ee.init(e,t)});ca=m("ZodCIDRv6",(e,t)=>{bh.init(e,t),ee.init(e,t)});la=m("ZodBase64",(e,t)=>{mh.init(e,t),ee.init(e,t)});ua=m("ZodBase64URL",(e,t)=>{ph.init(e,t),ee.init(e,t)});ha=m("ZodE164",(e,t)=>{vh.init(e,t),ee.init(e,t)});ga=m("ZodJWT",(e,t)=>{Ih.init(e,t),ee.init(e,t)});Fr=m("ZodCustomStringFormat",(e,t)=>{fh.init(e,t),ee.init(e,t)});Gr=m("ZodNumber",(e,t)=>{ci.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ms(e,n,r,i),e.gt=(n,r)=>e.check(at(n,r)),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.lt=(n,r)=>e.check(it(n,r)),e.lte=(n,r)=>e.check(Ee(n,r)),e.max=(n,r)=>e.check(Ee(n,r)),e.int=(n)=>e.check(qi(n)),e.safe=(n)=>e.check(qi(n)),e.positive=(n)=>e.check(at(0,n)),e.nonnegative=(n)=>e.check(Ae(0,n)),e.negative=(n)=>e.check(it(0,n)),e.nonpositive=(n)=>e.check(Ee(0,n)),e.multipleOf=(n,r)=>e.check(xt(n,r)),e.step=(n,r)=>e.check(xt(n,r)),e.finite=()=>e;let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??0.5),e.isFinite=!0,e.format=o.format??null});rr=m("ZodNumberFormat",(e,t)=>{kh.init(e,t),Gr.init(e,t)});Br=m("ZodBoolean",(e,t)=>{Go.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Js(e,o,n,r)});Hr=m("ZodBigInt",(e,t)=>{li.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Vs(e,n,r,i),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.gt=(n,r)=>e.check(at(n,r)),e.gte=(n,r)=>e.check(Ae(n,r)),e.min=(n,r)=>e.check(Ae(n,r)),e.lt=(n,r)=>e.check(it(n,r)),e.lte=(n,r)=>e.check(Ee(n,r)),e.max=(n,r)=>e.check(Ee(n,r)),e.positive=(n)=>e.check(at(BigInt(0),n)),e.negative=(n)=>e.check(it(BigInt(0),n)),e.nonpositive=(n)=>e.check(Ee(BigInt(0),n)),e.nonnegative=(n)=>e.check(Ae(BigInt(0),n)),e.multipleOf=(n,r)=>e.check(xt(n,r));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});sa=m("ZodBigIntFormat",(e,t)=>{$h.init(e,t),Hr.init(e,t)});Wd=m("ZodSymbol",(e,t)=>{wh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>qs(e,o,n,r)});Yd=m("ZodUndefined",(e,t)=>{_h.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ys(e,o,n,r)});Xd=m("ZodNull",(e,t)=>{Oh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ws(e,o,n,r)});Qd=m("ZodAny",(e,t)=>{Sh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Qs(e,o,n,r)});eb=m("ZodUnknown",(e,t)=>{Th.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ed(e,o,n,r)});tb=m("ZodNever",(e,t)=>{Ph.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Zs(e,o,n,r)});rb=m("ZodVoid",(e,t)=>{Ah.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Xs(e,o,n,r)});hn=m("ZodDate",(e,t)=>{Dh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>td(e,n,r,i),e.min=(n,r)=>e.check(Ae(n,r)),e.max=(n,r)=>e.check(Ee(n,r));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});ob=m("ZodArray",(e,t)=>{Nh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>dd(e,o,n,r),e.element=t.element,e.min=(o,n)=>e.check(vt(o,n)),e.nonempty=(o)=>e.check(vt(1,o)),e.max=(o,n)=>e.check(Qt(o,n)),e.length=(o,n)=>e.check(er(o,n)),e.unwrap=()=>e.element});sn=m("ZodObject",(e,t)=>{Lh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>bd(e,o,n,r),w.defineLazy(e,"shape",()=>{return t.shape}),e.keyof=()=>ya(Object.keys(e._zod.def.shape)),e.catchall=(o)=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:tr()}),e.loose=()=>e.clone({...e._zod.def,catchall:tr()}),e.strict=()=>e.clone({...e._zod.def,catchall:da()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(o)=>{return w.extend(e,o)},e.safeExtend=(o)=>{return w.safeExtend(e,o)},e.merge=(o)=>w.merge(e,o),e.pick=(o)=>w.pick(e,o),e.omit=(o)=>w.omit(e,o),e.partial=(...o)=>w.partial(pa,e,o[0]),e.required=(...o)=>w.required(va,e,o[0])});dn=m("ZodUnion",(e,t)=>{Bo.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ui(e,o,n,r),e.options=t.options});nb=m("ZodXor",(e,t)=>{dn.init(e,t),Ch.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ui(e,o,n,r),e.options=t.options});ib=m("ZodDiscriminatedUnion",(e,t)=>{dn.init(e,t),xh.init(e,t)});ab=m("ZodIntersection",(e,t)=>{zh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>yd(e,o,n,r)});lb=m("ZodTuple",(e,t)=>{ui.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>md(e,o,n,r),e.rest=(o)=>e.clone({...e._zod.def,rest:o})});bn=m("ZodRecord",(e,t)=>{jh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>pd(e,o,n,r),e.keyType=t.keyType,e.valueType=t.valueType});gb=m("ZodMap",(e,t)=>{Eh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>gd(e,o,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(ct(...o)),e.nonempty=(o)=>e.check(ct(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Zt(...o))});sb=m("ZodSet",(e,t)=>{Uh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>sd(e,o,n,r),e.min=(...o)=>e.check(ct(...o)),e.nonempty=(o)=>e.check(ct(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Zt(...o))});Rr=m("ZodEnum",(e,t)=>{Rh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rd(e,n,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{let i={};for(let a of n)if(o.has(a))i[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new Rr({...t,checks:[],...w.normalizeParams(r),entries:i})},e.exclude=(n,r)=>{let i={...t.entries};for(let a of n)if(o.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new Rr({...t,checks:[],...w.normalizeParams(r),entries:i})}});db=m("ZodLiteral",(e,t)=>{Kh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>od(e,o,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});bb=m("ZodFile",(e,t)=>{Fh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ad(e,o,n,r),e.min=(o,n)=>e.check(ct(o,n)),e.max=(o,n)=>e.check(zt(o,n)),e.mime=(o,n)=>e.check(Dr(Array.isArray(o)?o:[o],n))});yb=m("ZodTransform",(e,t)=>{Gh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>hd(e,o,n,r),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new qt(e.constructor.name);o.addIssue=(i)=>{if(typeof i==="string")o.issues.push(w.issue(i,o.value,t));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=o.value),a.inst??(a.inst=e),o.issues.push(w.issue(a))}};let r=t.transform(o.value,o);if(r instanceof Promise)return r.then((i)=>{return o.value=i,o});return o.value=r,o}});pa=m("ZodOptional",(e,t)=>{hi.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ri(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});mb=m("ZodExactOptional",(e,t)=>{Bh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Ri(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});vb=m("ZodNullable",(e,t)=>{Hh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>vd(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Ib=m("ZodDefault",(e,t)=>{Mh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>fd(e,o,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});kb=m("ZodPrefault",(e,t)=>{Jh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>kd(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});va=m("ZodNonOptional",(e,t)=>{Vh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Id(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});_b=m("ZodSuccess",(e,t)=>{qh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>cd(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Ob=m("ZodCatch",(e,t)=>{Wh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>$d(e,o,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Tb=m("ZodNaN",(e,t)=>{Yh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>nd(e,o,n,r)});Ia=m("ZodPipe",(e,t)=>{Xh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>wd(e,o,n,r),e.in=t.in,e.out=t.out});fa=m("ZodCodec",(e,t)=>{Ia.init(e,t),Ho.init(e,t)});Pb=m("ZodReadonly",(e,t)=>{Zh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>_d(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});Db=m("ZodTemplateLiteral",(e,t)=>{Qh.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>id(e,o,n,r)});Nb=m("ZodLazy",(e,t)=>{rg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Sd(e,o,n,r),e.unwrap=()=>e._zod.def.getter()});Cb=m("ZodPromise",(e,t)=>{tg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>Od(e,o,n,r),e.unwrap=()=>e._zod.def.innerType});xb=m("ZodFunction",(e,t)=>{eg.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ud(e,o,n,r)});yn=m("ZodCustom",(e,t)=>{og.init(e,t),K.init(e,t),e._zod.processJSONSchema=(o,n,r)=>ld(e,o,n,r)});_w=Ks,Ow=Fs});function gL(e){ue({customError:e})}function sL(){return ue().customError}var hL,Eb;var Dw=d(()=>{Ue();hL={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(e){})(Eb||(Eb={}))});function bL(e,t){let o=e.$schema;if(o==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(o==="http://json-schema.org/draft-07/schema#")return"draft-7";if(o==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function yL(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===n){let r=o[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Nw(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return A.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return A.lazy(()=>{if(!t.refs.has(r))throw Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=yL(r,t),a=Oe(i,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return A.null();if(r.length===0)return A.never();if(r.length===1)return A.literal(r[0]);if(r.every((a)=>typeof a==="string"))return A.enum(r);let i=r.map((a)=>A.literal(a));if(i.length<2)return i[0];return A.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return A.literal(e.const);let o=e.type;if(Array.isArray(o)){let r=o.map((i)=>{let a={...e,type:i};return Nw(a,t)});if(r.length===0)return A.never();if(r.length===1)return r[0];return A.union(r)}if(!o)return A.any();let n;switch(o){case"string":{let r=A.string();if(e.format){let i=e.format;if(i==="email")r=r.check(A.email());else if(i==="uri"||i==="uri-reference")r=r.check(A.url());else if(i==="uuid"||i==="guid")r=r.check(A.uuid());else if(i==="date-time")r=r.check(A.iso.datetime());else if(i==="date")r=r.check(A.iso.date());else if(i==="time")r=r.check(A.iso.time());else if(i==="duration")r=r.check(A.iso.duration());else if(i==="ipv4")r=r.check(A.ipv4());else if(i==="ipv6")r=r.check(A.ipv6());else if(i==="mac")r=r.check(A.mac());else if(i==="cidr")r=r.check(A.cidrv4());else if(i==="cidr-v6")r=r.check(A.cidrv6());else if(i==="base64")r=r.check(A.base64());else if(i==="base64url")r=r.check(A.base64url());else if(i==="e164")r=r.check(A.e164());else if(i==="jwt")r=r.check(A.jwt());else if(i==="emoji")r=r.check(A.emoji());else if(i==="nanoid")r=r.check(A.nanoid());else if(i==="cuid")r=r.check(A.cuid());else if(i==="cuid2")r=r.check(A.cuid2());else if(i==="ulid")r=r.check(A.ulid());else if(i==="xid")r=r.check(A.xid());else if(i==="ksuid")r=r.check(A.ksuid())}if(typeof e.minLength==="number")r=r.min(e.minLength);if(typeof e.maxLength==="number")r=r.max(e.maxLength);if(e.pattern)r=r.regex(new RegExp(e.pattern));n=r;break}case"number":case"integer":{let r=o==="integer"?A.number().int():A.number();if(typeof e.minimum==="number")r=r.min(e.minimum);if(typeof e.maximum==="number")r=r.max(e.maximum);if(typeof e.exclusiveMinimum==="number")r=r.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")r=r.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")r=r.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")r=r.lt(e.maximum);if(typeof e.multipleOf==="number")r=r.multipleOf(e.multipleOf);n=r;break}case"boolean":{n=A.boolean();break}case"null":{n=A.null();break}case"object":{let r={},i=e.properties||{},a=new Set(e.required||[]);for(let[u,h]of Object.entries(i)){let s=Oe(h,t);r[u]=a.has(u)?s:s.optional()}if(e.propertyNames){let u=Oe(e.propertyNames,t),h=e.additionalProperties&&typeof e.additionalProperties==="object"?Oe(e.additionalProperties,t):A.any();if(Object.keys(r).length===0){n=A.record(u,h);break}let s=A.object(r).passthrough(),g=A.looseRecord(u,h);n=A.intersection(s,g);break}if(e.patternProperties){let u=e.patternProperties,h=Object.keys(u),s=[];for(let b of h){let y=Oe(u[b],t),_=A.string().regex(new RegExp(b));s.push(A.looseRecord(_,y))}let g=[];if(Object.keys(r).length>0)g.push(A.object(r).passthrough());if(g.push(...s),g.length===0)n=A.object({}).passthrough();else if(g.length===1)n=g[0];else{let b=A.intersection(g[0],g[1]);for(let y=2;y<g.length;y++)b=A.intersection(b,g[y]);n=b}break}let c=A.object(r);if(e.additionalProperties===!1)n=c.strict();else if(typeof e.additionalProperties==="object")n=c.catchall(Oe(e.additionalProperties,t));else n=c.passthrough();break}case"array":{let{prefixItems:r,items:i}=e;if(r&&Array.isArray(r)){let a=r.map((u)=>Oe(u,t)),c=i&&typeof i==="object"&&!Array.isArray(i)?Oe(i,t):void 0;if(c)n=A.tuple(a).rest(c);else n=A.tuple(a);if(typeof e.minItems==="number")n=n.check(A.minLength(e.minItems));if(typeof e.maxItems==="number")n=n.check(A.maxLength(e.maxItems))}else if(Array.isArray(i)){let a=i.map((u)=>Oe(u,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?Oe(e.additionalItems,t):void 0;if(c)n=A.tuple(a).rest(c);else n=A.tuple(a);if(typeof e.minItems==="number")n=n.check(A.minLength(e.minItems));if(typeof e.maxItems==="number")n=n.check(A.maxLength(e.maxItems))}else if(i!==void 0){let a=Oe(i,t),c=A.array(a);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);n=c}else n=A.array(A.any());break}default:throw Error(`Unsupported type: ${o}`)}if(e.description)n=n.describe(e.description);if(e.default!==void 0)n=n.default(e.default);return n}function Oe(e,t){if(typeof e==="boolean")return e?A.any():A.never();let o=Nw(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((h)=>Oe(h,t)),u=A.union(c);o=n?A.intersection(o,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((h)=>Oe(h,t)),u=A.xor(c);o=n?A.intersection(o,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=n?o:A.any();else{let c=n?o:Oe(e.allOf[0],t),u=n?0:1;for(let h=u;h<e.allOf.length;h++)c=A.intersection(c,Oe(e.allOf[h],t));o=c}if(e.nullable===!0&&t.version==="openapi-3.0")o=A.nullable(o);if(e.readOnly===!0)o=A.readonly(o);let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)if(c in e)r[c]=e[c];let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)if(c in e)r[c]=e[c];for(let c of Object.keys(e))if(!dL.has(c))r[c]=e[c];if(Object.keys(r).length>0)t.registry.add(o,r);return o}function Lw(e,t){if(typeof e==="boolean")return e?A.any():A.never();let o=bL(e,t?.defaultTarget),n=e.$defs||e.definitions||{},r={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??ve};return Oe(e,r)}var A,dL;var Cw=d(()=>{Yo();Gi();tn();on();A={...rn,...Fi,iso:Ur},dL=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 Ub={};Qe(Ub,{string:()=>mL,number:()=>pL,date:()=>fL,boolean:()=>vL,bigint:()=>IL});function mL(e){return is(Kr,e)}function pL(e){return ds(Gr,e)}function vL(e){return fs(Br,e)}function IL(e){return $s(Hr,e)}function fL(e){return Cs(hn,e)}var xw=d(()=>{Ue();on()});var l={};Qe(l,{xor:()=>aw,xid:()=>A$,void:()=>ew,uuidv7:()=>k$,uuidv6:()=>f$,uuidv4:()=>I$,uuid:()=>v$,util:()=>w,url:()=>$$,uppercase:()=>Sr,unknown:()=>tr,union:()=>ba,undefined:()=>Z$,ulid:()=>P$,uint64:()=>Y$,uint32:()=>V$,tuple:()=>ub,trim:()=>Lr,treeifyError:()=>ql,transform:()=>ma,toUpperCase:()=>xr,toLowerCase:()=>Cr,toJSONSchema:()=>Ki,templateLiteral:()=>Iw,symbol:()=>X$,superRefine:()=>jb,success:()=>mw,stringbool:()=>Tw,stringFormat:()=>K$,string:()=>Vi,strictObject:()=>nw,startsWith:()=>Pr,slugify:()=>zr,size:()=>Zt,setErrorMap:()=>gL,set:()=>gw,safeParseAsync:()=>jd,safeParse:()=>zd,safeEncodeAsync:()=>Bd,safeEncode:()=>Fd,safeDecodeAsync:()=>Hd,safeDecode:()=>Gd,registry:()=>gi,regexes:()=>Je,regex:()=>_r,refine:()=>zb,record:()=>hb,readonly:()=>Ab,property:()=>ji,promise:()=>fw,prettifyError:()=>Wl,preprocess:()=>Aw,prefault:()=>$b,positive:()=>Li,pipe:()=>ln,partialRecord:()=>lw,parseAsync:()=>xd,parse:()=>Cd,overwrite:()=>Xe,optional:()=>an,object:()=>ow,number:()=>Vd,nullish:()=>yw,nullable:()=>cn,null:()=>Zd,normalize:()=>Nr,nonpositive:()=>xi,nonoptional:()=>wb,nonnegative:()=>zi,never:()=>da,negative:()=>Ci,nativeEnum:()=>sw,nanoid:()=>O$,nan:()=>pw,multipleOf:()=>xt,minSize:()=>ct,minLength:()=>vt,mime:()=>Dr,meta:()=>Ow,maxSize:()=>zt,maxLength:()=>Qt,map:()=>hw,mac:()=>L$,lte:()=>Ee,lt:()=>it,lowercase:()=>Or,looseRecord:()=>uw,looseObject:()=>iw,locales:()=>Wo,literal:()=>dw,length:()=>er,lazy:()=>Lb,ksuid:()=>D$,keyof:()=>rw,jwt:()=>R$,json:()=>Pw,iso:()=>Ur,ipv6:()=>C$,ipv4:()=>N$,intersection:()=>cb,int64:()=>W$,int32:()=>J$,int:()=>qi,instanceof:()=>Sw,includes:()=>Tr,httpUrl:()=>w$,hostname:()=>F$,hex:()=>G$,hash:()=>B$,guid:()=>p$,gte:()=>Ae,gt:()=>at,globalRegistry:()=>ve,getErrorMap:()=>sL,function:()=>kw,fromJSONSchema:()=>Lw,formatError:()=>Uo,float64:()=>M$,float32:()=>H$,flattenError:()=>Eo,file:()=>bw,exactOptional:()=>pb,enum:()=>ya,endsWith:()=>Ar,encodeAsync:()=>Rd,encode:()=>Ed,emoji:()=>_$,email:()=>m$,e164:()=>U$,discriminatedUnion:()=>cw,describe:()=>_w,decodeAsync:()=>Kd,decode:()=>Ud,date:()=>tw,custom:()=>ww,cuid2:()=>T$,cuid:()=>S$,core:()=>It,config:()=>ue,coerce:()=>Ub,codec:()=>vw,clone:()=>Pe,cidrv6:()=>z$,cidrv4:()=>x$,check:()=>$w,catch:()=>Sb,boolean:()=>qd,bigint:()=>q$,base64url:()=>E$,base64:()=>j$,array:()=>gn,any:()=>Q$,_function:()=>kw,_default:()=>fb,_ZodString:()=>Wi,ZodXor:()=>nb,ZodXID:()=>ra,ZodVoid:()=>rb,ZodUnknown:()=>eb,ZodUnion:()=>dn,ZodUndefined:()=>Yd,ZodUUID:()=>lt,ZodURL:()=>un,ZodULID:()=>ta,ZodType:()=>K,ZodTuple:()=>lb,ZodTransform:()=>yb,ZodTemplateLiteral:()=>Db,ZodSymbol:()=>Wd,ZodSuccess:()=>_b,ZodStringFormat:()=>ee,ZodString:()=>Kr,ZodSet:()=>sb,ZodRecord:()=>bn,ZodRealError:()=>ze,ZodReadonly:()=>Pb,ZodPromise:()=>Cb,ZodPrefault:()=>kb,ZodPipe:()=>Ia,ZodOptional:()=>pa,ZodObject:()=>sn,ZodNumberFormat:()=>rr,ZodNumber:()=>Gr,ZodNullable:()=>vb,ZodNull:()=>Xd,ZodNonOptional:()=>va,ZodNever:()=>tb,ZodNanoID:()=>Zi,ZodNaN:()=>Tb,ZodMap:()=>gb,ZodMAC:()=>Jd,ZodLiteral:()=>db,ZodLazy:()=>Nb,ZodKSUID:()=>oa,ZodJWT:()=>ga,ZodIssueCode:()=>hL,ZodIntersection:()=>ab,ZodISOTime:()=>Mi,ZodISODuration:()=>Ji,ZodISODateTime:()=>Bi,ZodISODate:()=>Hi,ZodIPv6:()=>ia,ZodIPv4:()=>na,ZodGUID:()=>nn,ZodFunction:()=>xb,ZodFirstPartyTypeKind:()=>Eb,ZodFile:()=>bb,ZodExactOptional:()=>mb,ZodError:()=>lL,ZodEnum:()=>Rr,ZodEmoji:()=>Xi,ZodEmail:()=>Yi,ZodE164:()=>ha,ZodDiscriminatedUnion:()=>ib,ZodDefault:()=>Ib,ZodDate:()=>hn,ZodCustomStringFormat:()=>Fr,ZodCustom:()=>yn,ZodCodec:()=>fa,ZodCatch:()=>Ob,ZodCUID2:()=>ea,ZodCUID:()=>Qi,ZodCIDRv6:()=>ca,ZodCIDRv4:()=>aa,ZodBoolean:()=>Br,ZodBigIntFormat:()=>sa,ZodBigInt:()=>Hr,ZodBase64URL:()=>ua,ZodBase64:()=>la,ZodArray:()=>ob,ZodAny:()=>Qd,TimePrecision:()=>cs,NEVER:()=>El,$output:()=>ts,$input:()=>rs,$brand:()=>Ul});var Rb=d(()=>{Ue();Ue();dg();Ue();en();Cw();es();tn();tn();xw();on();Gi();Ld();Md();Dw();ue(Mo())});var Ie=d(()=>{Rb();Rb()});var D=(e)=>{let t={operationId:e.operationId,backend:e.backend,pagination:e.pagination,async:e.async,examples:e.examples??[]};return{...e,contract:Em.$meta(t).route({method:e.route.method,path:e.route.path,tags:e.route.tags,operationId:e.operationId,description:e.description,successStatus:e.route.successStatus,successDescription:e.route.successDescription,deprecated:e.route.deprecated,inputStructure:e.route.inputStructure}).input(e.input).output(e.output)}};var Ne=d(()=>{Bc()});var zw,Kb,kL,$L,jw,Fb,Gb,Ew,Uw,ka,Rw,Kw,Mr,Fw,Gw,$a,Bw,Hw,Jr,Mw,Jw,wa,Vw,qw,_a,Ww,Yw,Oa,Xw,Zw,Sa,Qw,e_,Ta,wL;var Bb=d(()=>{jl();Ie();Ne();zw=dr,Kb=l.enum(zw),kL=l.enum(["pending","provisioning","active","error"]),$L=l.object({name:l.string().describe("Field name used as the JSON key in metadata."),type:l.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:l.boolean().describe("Whether the field is required."),sensitive:l.boolean().describe("Whether the field contains a secret and will be encrypted."),description:l.string().nullable().describe("Human-readable description of the field.")}),jw=l.object({id:l.string().describe("Data source type identifier."),name:l.string().describe("Human-readable display name."),metadataFields:l.array($L).describe("Fields required in the metadata object when creating a connection."),setupSkill:l.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),Fb=l.object({id:l.string().uuid(),projectId:l.string().uuid(),dataSourceType:Kb,displayName:l.string().nullable(),createdAt:l.string().datetime()}),Gb=l.object({id:l.string().uuid(),connectionId:l.string().uuid(),displayName:l.string(),config:l.record(l.string(),l.unknown()),status:kL,errorMessage:l.string().nullable(),createdAt:l.string().datetime()}),Ew=l.object({}),Uw=l.object({types:l.array(jw)}),ka=D({operationId:"dataSources.listTypes",description:"List all supported data source types with their metadata requirements.",backend:"api",route:{method:"GET",path:"/data-sources/types",tags:["Data Sources"]},input:Ew,output:Uw,pagination:"none",async:"sync"}),Rw=l.object({projectId:l.string().uuid().optional().describe("Project to list connections for. Auto-filled from SDK context when omitted."),dataSourceType:Kb.optional().describe("Filter connections by data source type.")}),Kw=l.object({connections:l.array(Fb)}),Mr=D({operationId:"dataSources.listConnections",description:"List data source connections within one project.",backend:"api",route:{method:"GET",path:"/data-sources/connections",tags:["Data Sources"]},input:Rw,output:Kw,pagination:"none",async:"sync"}),Fw=l.object({connectionId:l.string().uuid().describe("Connection ID to fetch.")}),Gw=l.object({connection:Fb}),$a=D({operationId:"dataSources.getConnection",description:"Get one data source connection by ID.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}",tags:["Data Sources"]},input:Fw,output:Gw,pagination:"none",async:"sync"}),Bw=l.object({projectId:l.string().uuid().optional().describe("Project to create the connection in. Auto-filled from SDK context when omitted."),dataSourceType:Kb.describe("Data source type identifier."),metadata:l.record(l.string(),l.unknown()).describe("Platform-specific credentials. Fields vary by data source type."),displayName:l.string().optional().describe("Optional human-readable name for this connection.")}),Hw=l.object({connectionId:l.string().uuid().describe("ID of the created connection."),publicKey:l.string().describe("Auto-generated public API key for this connection. Store this securely — it is only shown once.")}),Jr=D({operationId:"dataSources.createConnection",description:"Create a new data source connection. Validates credentials, encrypts sensitive fields, and auto-generates a public API key.",backend:"api",route:{method:"POST",path:"/data-sources/connections",successStatus:201,tags:["Data Sources"]},input:Bw,output:Hw,pagination:"none",async:"sync"}),Mw=l.object({connectionId:l.string().uuid().describe("Connection ID to list streams for.")}),Jw=l.object({streams:l.array(Gb)}),wa=D({operationId:"dataSources.listStreams",description:"List streams for a data source connection.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}/streams",tags:["Data Sources"]},input:Mw,output:Jw,pagination:"none",async:"sync"}),Vw=l.object({connectionId:l.string().uuid().describe("Connection ID to create the stream under."),displayName:l.string().describe("Resource name, e.g. service or app name."),config:l.record(l.string(),l.unknown()).describe("Platform-specific stream configuration.")}),qw=l.object({streamId:l.string().uuid().describe("ID of the created stream."),publicKey:l.string().optional().describe("Auto-generated public API key for this stream. Returned only when the data source mints a per-stream key (manual-only sources). Store this securely — it is only shown once.")}),_a=D({operationId:"dataSources.createStream",description:"Create a new stream for a data source connection. Triggers async provisioning.",backend:"api",route:{method:"POST",path:"/data-sources/connections/{connectionId}/streams",successStatus:201,tags:["Data Sources"]},input:Vw,output:qw,pagination:"none",async:"sync"}),Ww=l.object({streamId:l.string().uuid().describe("Stream ID to fetch.")}),Yw=l.object({stream:Gb}),Oa=D({operationId:"dataSources.getStream",description:"Get one data source stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:Ww,output:Yw,pagination:"none",async:"sync"}),Xw=l.object({streamId:l.string().uuid().describe("Stream ID to delete.")}),Zw=l.object({success:l.boolean()}),Sa=D({operationId:"dataSources.deleteStream",description:"Delete a data source stream. For manual-only sources where streams are stored as connection API keys, deletes the underlying public key.",backend:"api",route:{method:"DELETE",path:"/data-sources/streams/{streamId}",successStatus:204,tags:["Data Sources"]},input:Xw,output:Zw,pagination:"none",async:"sync"}),Qw=l.object({connectionId:l.string().uuid().describe("Connection ID to disconnect.")}),e_=l.object({success:l.boolean(),connectionTeardownError:l.string().nullable().describe("Null when teardown succeeded; error message when remote cleanup failed.")}),Ta=D({operationId:"dataSources.disconnectConnection",description:"Disconnect a data source connection. Soft-deletes the connection, all associated streams, and all associated API keys. Triggers async backend teardown when the source supports it.",backend:"api",route:{method:"DELETE",path:"/data-sources/connections/{connectionId}",successStatus:200,tags:["Data Sources"]},input:Qw,output:e_,pagination:"none",async:"sync"}),wL={listTypes:ka.contract,listConnections:Mr.contract,getConnection:$a.contract,createConnection:Jr.contract,disconnectConnection:Ta.contract,listStreams:wa.contract,createStream:_a.contract,getStream:Oa.contract,deleteStream:Sa.contract}});var mn,_L,OL,SL,TL,PL,AL,DL,NL,LL,CL,Hb,Mb,Jb,Vb,qb,wH;var t_=d(()=>{Ie();Ne();mn=l.object({id:l.string().uuid(),projectId:l.string().uuid(),name:l.string(),whatHappened:l.string(),whyItHappened:l.string().nullable(),howToFix:l.string().nullable(),status:l.enum(["open","resolved","ignored"]),severity:l.enum(["low","medium","high","critical"]),statusComponentId:l.string().uuid().nullable(),createdAt:l.string().datetime(),resolvedAt:l.string().datetime().nullable(),mutedAt:l.string().datetime().nullable(),lastActivityAt:l.string().datetime().nullable()}),_L=l.object({projectId:l.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:l.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:l.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),statusComponentId:l.string().uuid().optional().describe("Filter by status component ID.")}),OL=l.object({issues:l.array(mn),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),SL=l.object({issueId:l.string().uuid().describe("Issue ID to retrieve.")}),TL=l.object({issue:mn}),PL=l.object({issueId:l.string().uuid().describe("Issue ID to resolve.")}),AL=l.object({issue:mn}),DL=l.object({issueId:l.string().uuid().describe("Issue ID to ignore.")}),NL=l.object({issue:mn}),LL=l.object({issueId:l.string().uuid().describe("Issue ID to unignore.")}),CL=l.object({issue:mn}),Hb=D({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:_L,output:OL,pagination:"cursor",async:"sync"}),Mb=D({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:SL,output:TL,pagination:"none",async:"sync"}),Jb=D({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:PL,output:AL,pagination:"none",async:"sync"}),Vb=D({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:DL,output:NL,pagination:"none",async:"sync"}),qb=D({operationId:"issues.unignore",description:"Unignore an ignored issue. Mute is separate from ignored status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unignore",tags:["Issues"]},input:LL,output:CL,pagination:"none",async:"sync"}),wH={list:Hb.contract,get:Mb.contract,resolve:Jb.contract,ignore:Vb.contract,unignore:qb.contract}});var Pa,r_,Aa,Da,o_,n_,i_,a_,Na,Wb,c_,l_,u_,h_,g_,s_,d_,b_,y_,m_,p_,v_,Vr,qr,Wr,Yr,Xr,La,Ca,xa,za,ja,xL,zL;var Yb=d(()=>{Ie();Ne();Pa=/^[a-zA-Z0-9\s\-_]+$/,r_=l.object({id:l.string().uuid(),name:l.string(),expiresAt:l.string().datetime().nullable(),lastUsedAt:l.string().datetime().nullable(),createdAt:l.string().datetime()}),Aa=r_.extend({projectId:l.string().uuid(),dataSourceConnectionId:l.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:l.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Da=r_.extend({projectId:l.string().uuid().nullable()}),o_=l.object({projectId:l.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),n_=l.object({publicKeys:l.array(Aa),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),i_=l.object({secretKeys:l.array(Da),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),a_=l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:l.string().uuid().describe("Key ID to fetch.")}),Na=l.object({publicKey:Aa}),Wb=l.object({secretKey:Da}),c_=l.object({projectId:l.string().uuid().optional().describe("Project to create the key in. Auto-filled from CLI and SDK context when omitted."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:l.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),l_=l.object({publicKey:Aa.extend({value:l.string()})}),u_=l.object({secretKey:Da.extend({value:l.string()})}),h_=l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:l.string().uuid().describe("Key ID to update."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:l.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),g_=l.object({params:l.object({keyId:l.string().uuid().describe("Public key ID to deactivate.")}),query:l.object({projectId:l.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),s_=Na,d_=l.void(),b_=l.object({limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),y_=l.object({keyId:l.string().uuid().describe("Key ID to fetch.")}),m_=l.object({projectId:l.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:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:l.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),p_=l.object({keyId:l.string().uuid().describe("Key ID to update."),name:l.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(Pa,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:l.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),v_=l.object({params:l.object({keyId:l.string().uuid().describe("Key ID to delete.")})}).transform(({params:e})=>({...e})),Vr=D({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:o_,output:n_,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}}]}),qr=D({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:a_,output:Na,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"}}}]}),Wr=D({operationId:"publicKeys.create",description:"Create one public key within one project.",backend:"api",route:{method:"POST",path:"/public-keys",successStatus:201,tags:["Public Keys"]},input:c_,output:l_,pagination:"none",async:"sync",examples:[{name:"create-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder"},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",value:"sazabi_public_example"}}}]}),Yr=D({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:h_,output:Na,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"}}}]}),Xr=D({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Existing successful intake-auth cache entries may continue to authenticate until their current TTL expires.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:g_,output:s_,pagination:"none",async:"sync"}),La=D({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:b_,output:i_,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}}]}),Ca=D({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:y_,output:Wb,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"}}}]}),xa=D({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:m_,output:u_,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"}}}]}),za=D({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:p_,output:Wb,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"}}}]}),ja=D({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:v_,output:d_,pagination:"none",async:"sync"}),xL={list:Vr.contract,get:qr.contract,create:Wr.contract,update:Yr.contract,deactivate:Xr.contract},zL={list:La.contract,get:Ca.contract,create:xa.contract,update:za.contract,delete:ja.contract}});var I_,f_,k_,$_,w_,__,O_,Ea,S_,T_,P_,Xb,A_,D_,N_,L_,C_,x_,z_,j_,jL,E_,U_,Zr,Qr,eo,to,ro,EL;var Zb=d(()=>{Ie();Ne();I_=l.enum(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]).describe("Filter operator: 'eq' (equals), 'neq' (not equals), 'in' (in array), 'contains' (substring), 'starts_with' (prefix), 'gt' (greater than), 'gte' (greater than or equal), 'lt' (less than), 'lte' (less than or equal), 'between' (range), 'exists' (field exists)"),f_=l.enum(["any","all","phrase"]).describe("Search mode: 'any' (match any token), 'all' (match all tokens), 'phrase' (exact phrase match)"),k_=l.object({query:l.string().min(1,"Search query must be at least 1 character").max(500,"Search query must be at most 500 characters").describe("Search query text (1-500 characters)"),fields:l.array(l.string()).optional().describe("Fields to search in (defaults to backend allowlist)"),mode:f_.optional().default("all").describe("Token matching mode")}),$_=l.object({field:l.string().describe("Field name to filter on"),op:I_.describe("Filter operator"),value:l.union([l.string(),l.number(),l.boolean(),l.array(l.union([l.string(),l.number()])),l.object({from:l.string(),to:l.string()})]).describe("Filter value (type depends on operator)")}).superRefine((e,t)=>{if(e.op==="in"&&!Array.isArray(e.value))t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be an array when op is 'in'",path:["value"]});if(e.op==="between"){let o=e.value;if(!(typeof o==="object"&&o!==null&&("from"in o)&&("to"in o)))t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be an object with from/to when op is 'between'",path:["value"]})}if(e.op==="exists"&&typeof e.value!=="boolean")t.addIssue({code:l.ZodIssueCode.custom,message:"Value must be boolean when op is 'exists'",path:["value"]})}),w_=l.object({field:l.string().describe("Field name to sort by"),direction:l.enum(["asc","desc"]).default("desc").describe("Sort direction: 'asc' for ascending, 'desc' for descending")}),__=l.object({limit:l.number().int().min(1,"Limit must be at least 1").max(1000,"Limit must be at most 1000").default(50).describe("Maximum number of rows to return"),cursor:l.string().optional().describe("Opaque cursor from previous response for pagination")}),O_=l.object({projectId:l.string().uuid().optional().describe("Project to query logs for. Auto-filled from CLI and SDK context when omitted."),search:k_.optional().describe("Full-text search configuration"),filters:l.array($_).optional().describe("Structured filter clauses (ANDed together)"),select:l.array(l.string()).optional().describe("Fields to return (defaults to backend default set)"),sort:w_.optional().describe("Sort configuration (defaults to timestamp desc)"),pagination:__.optional().describe("Pagination configuration")}),Ea=l.enum(["clickhouse","better-stack","datadog","gcp","axiom","cloudwatch","sentry","posthog","mezmo"]),S_=l.enum(["native","external"]),T_=l.object({projectId:l.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),P_=l.object({backend:l.object({id:Ea,name:l.string(),kind:S_}).describe("Active log backend for the project"),features:l.array(l.string()).describe("Backend features registered on the server"),commands:l.array(l.enum(["schema","query","volume","patterns","nativeQuery"])).describe("CLI/API commands available for this backend"),queryableFields:l.array(l.string()).describe("Fields accepted by the normalized logs.query contract"),searchableFields:l.array(l.string()).describe("Fields accepted by logs.query full-text search"),observedServiceNames:l.array(l.string()).describe("Recently observed service names for this project"),observedAttributeKeys:l.array(l.string()).describe("Recently observed log attribute keys for this project"),schemaContext:l.record(l.string(),l.any()).optional().describe("Backend-specific schema guidance and examples")}),Xb=l.enum(["1m","5m","15m","1h"]),A_=l.enum(["service_name","severity_text","environment"]),D_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),startDate:l.string().datetime({offset:!0}),endDate:l.string().datetime({offset:!0}),interval:Xb.optional().describe("Aggregation bucket size for the volume series"),groupBy:A_.optional().describe("Optional field to split volume series by"),filters:l.object({service_name:l.string().optional(),severity_text:l.string().optional(),environment:l.string().optional()}).optional()}).refine((e)=>new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),N_=l.object({total:l.number().nonnegative(),startDate:l.string().datetime({offset:!0}),endDate:l.string().datetime({offset:!0}),interval:Xb,series:l.array(l.object({group:l.string(),total:l.number().nonnegative(),points:l.array(l.object({bucket:l.string(),count:l.number().nonnegative()}))}))}),L_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:l.string().min(1).max(500).optional().describe("Optional text to match against normalized log patterns"),severity:l.string().optional().describe("Optional severity_text value, for example ERROR"),startDate:l.string().datetime({offset:!0}).optional().describe("Optional earliest last-seen timestamp"),endDate:l.string().datetime({offset:!0}).optional().describe("Optional latest last-seen timestamp"),limit:l.number().int().min(1).max(100).default(25).describe("Maximum number of log patterns to return")}).refine((e)=>!e.startDate||!e.endDate||new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),C_=l.object({fingerprint:l.string(),pattern:l.string(),severity:l.string().nullable(),occurrences:l.number().nonnegative(),firstSeen:l.string().nullable(),lastSeen:l.string().nullable(),representativeId:l.string().nullable()}),x_=l.object({patterns:l.array(C_),meta:l.object({backendId:Ea,count:l.number().int().nonnegative(),took:l.number().nonnegative()})}),z_=l.object({projectId:l.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:l.string().min(1,"Query cannot be empty").max(1e4,"Query must be 10000 characters or less")}),j_=l.object({result:l.string().describe("Backend-formatted query result"),format:l.literal("text"),meta:l.object({backendId:Ea,took:l.number().nonnegative(),truncated:l.boolean()})}),jL=l.object({cursor:l.string().nullable().describe("Cursor for next page (null if no more results)"),hasMore:l.boolean().describe("Whether more results are available")}),E_=l.object({count:l.number().int().nonnegative().describe("Number of log rows returned in this response"),took:l.number().nonnegative().describe("Query execution time in milliseconds")}),U_=l.object({data:l.array(l.record(l.string(),l.any())).describe("Array of log rows with selected fields"),nextCursor:l.string().nullable().describe("Pass as 'cursor' in the next query to fetch the next page. Null when there are no more results."),meta:E_.describe("Query execution metadata")}),Zr=D({operationId:"logs.query",description:"Query logs within one project via the platform API proxy.",backend:"api",route:{method:"POST",path:"/logs/query",tags:["Logs"]},input:O_,output:U_,pagination:"cursor",async:"sync"}),Qr=D({operationId:"logs.schema",description:"Describe the active log backend, supported commands, query fields, and schema context.",backend:"api",route:{method:"POST",path:"/logs/schema",tags:["Logs"]},input:T_,output:P_,pagination:"none",async:"sync"}),eo=D({operationId:"logs.volume",description:"Query pre-aggregated log volume for one project.",backend:"api",route:{method:"POST",path:"/logs/volume",tags:["Logs"]},input:D_,output:N_,pagination:"none",async:"sync"}),to=D({operationId:"logs.patterns",description:"Query normalized log patterns for discovery workflows.",backend:"api",route:{method:"POST",path:"/logs/patterns",tags:["Logs"]},input:L_,output:x_,pagination:"none",async:"sync"}),ro=D({operationId:"logs.nativeQuery",description:"Run the active backend's native read-only query language through server-side guardrails.",backend:"api",route:{method:"POST",path:"/logs/native-query",tags:["Logs"]},input:z_,output:j_,pagination:"none",async:"sync"}),EL={query:Zr.contract,schema:Qr.contract,volume:eo.contract,patterns:to.contract,nativeQuery:ro.contract}});var oo,UL,RL,KL,FL,GL,BL,HL,Qb,CH;var Ua=d(()=>{Ie();Ne();oo=l.enum(["admin","member"]),UL=l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional(),role:oo}),RL=l.object({id:l.string().min(1),name:l.string().nullable(),email:l.string().email()}),KL=l.object({credentialType:l.literal("user"),user:RL,activeOrganizationId:l.string().min(1).nullable(),organizations:l.array(UL).describe("Organizations the user belongs to, including membership role.")}),FL=l.object({credentialType:l.literal("secret"),organization:l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional()}),keyName:l.string()}),GL=l.object({credentialType:l.literal("partner"),superorganization:l.object({id:l.string().uuid(),name:l.string()})}),BL=l.object({}),HL=l.discriminatedUnion("credentialType",[KL,FL,GL]),Qb=D({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:BL,output:HL,pagination:"none",async:"sync"}),CH=Qb.contract});var R_,ML,JL,VL,qL,WL,YL,ey,ty,ry,UH;var K_=d(()=>{Ie();Ne();Ua();R_=l.object({membershipId:l.string().min(1).describe("Organization membership record ID."),userId:l.string().min(1).describe("User ID for the organization member."),name:l.string().nullable().describe("Display name for the member, when available."),email:l.string().email().describe("Email address for the member."),imageUrl:l.string().nullable().describe("Profile image URL for the member, when available."),role:oo.describe("Organization role."),createdAt:l.string().datetime().describe("When the membership was created.")}),ML=l.object({organizationId:l.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),JL=l.object({members:l.array(R_).describe("Members visible within the selected organization.")}),VL=l.object({organizationId:l.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),userId:l.string().min(1).describe("User ID of the member to update."),role:oo.describe("Role to assign.")}),qL=l.object({member:R_.describe("Updated organization member.")}),WL=l.object({params:l.object({userId:l.string().min(1).describe("User ID of the member to remove.")}),query:l.object({organizationId:l.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:e,query:t})=>({...t,...e})),YL=l.object({removedUserId:l.string().min(1).describe("User ID removed from the organization.")}),ey=D({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:ML,output:JL,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"}]}}]}),ty=D({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{userId}/role",tags:["Members"]},input:VL,output:qL,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",userId:"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"}}}]}),ry=D({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{userId}",tags:["Members"],inputStructure:"detailed"},input:WL,output:YL,pagination:"none",async:"sync"}),UH={list:ey.contract,updateRole:ty.contract,remove:ry.contract}});var F_,G_,XL,ZL,QL,eC,tC,pn,rC,oy,ny,iy,GH;var Ra=d(()=>{Ie();Ne();F_=l.enum(["processing","completed","aborted","error"]),G_=l.object({id:l.string().uuid(),threadId:l.string().uuid(),userMessageId:l.string().uuid().nullable(),assistantMessageId:l.string().uuid().nullable(),parentRunId:l.string().uuid().nullable(),workflowRunId:l.string().nullable(),status:F_,source:l.enum(["web","api","mcp","slack","agent","cli"]),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),completedAt:l.string().datetime().nullable()}),XL=l.object({projectId:l.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:l.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),ZL=l.object({runs:l.array(G_),nextCursor:l.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),QL=l.object({threadId:l.string().uuid().describe("Thread ID to list runs for."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:l.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),eC=l.object({runs:l.array(G_),nextCursor:l.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),tC=l.object({runId:l.string().uuid().describe("Run ID returned by a deferred operation.")}),pn=l.object({completed:l.boolean().describe("Whether the run has reached a terminal status."),threadId:l.string().uuid().describe("Thread ID associated with the run."),runId:l.string().uuid().describe("Run ID for subsequent polling."),messageId:l.string().uuid().optional().describe("ID of the user message that triggered this run."),status:F_.describe("Current run lifecycle status."),response:l.string().nullable().describe("Assistant response text when the run has completed.")}),rC=pn.describe("Current run state and, when complete, the assistant response."),oy=D({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:XL,output:ZL,pagination:"cursor",async:"sync"}),ny=D({operationId:"runs.listForThread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:QL,output:eC,pagination:"cursor",async:"sync"}),iy=D({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:tC,output:rC,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}}]}),GH={list:oy.contract,listForThread:ny.contract,get:iy.contract}});var ay,oC,nC,iC,aC,cC,lC,uC,hC,cy,gC,sC,dC,bC,yC,mC,pC,vC,IC,fC,ly,uy,hy,gy,sy,VH;var dy=d(()=>{Ie();Ne();Ra();ay=l.object({id:l.string().uuid(),projectId:l.string().uuid(),title:l.string().nullable(),status:l.enum(["regular","archived"]),createdAt:l.string().datetime(),updatedAt:l.string().datetime()}),oC=l.object({type:l.literal("message"),message:l.string()}),nC=l.object({type:l.literal("reasoning"),reasoning:l.string(),status:l.enum(["in_progress","complete"]).optional()}),iC=l.object({type:l.literal("tool_call"),name:l.string(),params:l.any().optional(),result:l.any().optional(),status:l.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:l.string().optional(),durationMs:l.number().nonnegative().optional()}),aC=l.object({type:l.literal("artifact"),name:l.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card"]),data:l.any(),toolCallId:l.string().optional()}),cC=l.object({type:l.literal("fork"),sourceThreadId:l.string(),sourceMessageId:l.string(),sourceThreadTitle:l.string().nullable()}),lC=l.object({type:l.literal("summary"),summary:l.string()}),uC=l.object({type:l.literal("slack_context"),channelId:l.string(),isTruncated:l.boolean().optional(),messages:l.array(l.object({timestamp:l.string(),slackUserId:l.string().optional(),displayName:l.string(),text:l.string(),isBot:l.boolean(),files:l.array(l.object({name:l.string(),mimetype:l.string(),size:l.number().optional(),attachmentId:l.string().uuid().optional(),ingestionStatus:l.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),hC=l.union([oC,nC,iC,aC,cC,lC,uC]),cy=l.object({id:l.string().uuid(),role:l.enum(["user","assistant"]),content:l.array(hC),createdAt:l.string().datetime()}),gC=l.object({projectId:l.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:l.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),sC=l.object({threads:l.array(ay).describe("The page of threads matching the query."),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),dC=l.object({threadId:l.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),bC=l.object({thread:ay.describe("The requested thread."),messages:l.array(cy).describe("Messages currently stored on the thread in chronological order.")}),yC=l.object({projectId:l.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:l.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters").describe("Initial user message that starts the thread."),wait:l.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:l.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),mC=pn.describe("Deferred run result for creating a thread."),pC=l.object({threadId:l.string().uuid().describe("Thread ID whose current processing status should be returned.")}),vC=l.object({status:l.enum(["idle","processing"]),lastRunStatus:l.enum(["error"]).nullable()}),IC=l.object({threadId:l.string().uuid().describe("Thread ID of the thread to update."),status:l.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),fC=l.object({thread:ay.describe("The updated thread.")}),ly=D({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:gC,output:sC,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",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),uy=D({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:dC,output:bC,pagination:"none",async:"sync"}),hy=D({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:pC,output:vC,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),gy=D({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:yC,output:mC,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}}]}),sy=D({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:IC,output:fC,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",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),VH={list:ly.contract,get:uy.contract,getStatus:hy.contract,create:gy.contract,update:sy.contract}});var kC,$C,wC,_C,B_,H_;var M_=d(()=>{Ie();Ne();Ra();dy();kC=l.object({threadId:l.string().uuid().describe("Thread ID to list messages for."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),$C=l.object({messages:l.array(cy),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),wC=l.object({threadId:l.string().uuid().describe("Thread ID to append the message to."),message:l.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters"),wait:l.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:l.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),_C=pn.describe("Deferred run result for appending a message to an existing thread."),B_=D({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:kC,output:$C,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?"}],createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),H_=D({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:wC,output:_C,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 by,OC,SC,TC,PC,AC,DC,NC,yy,my,py,oM;var J_=d(()=>{Ie();Ne();Ua();by=l.object({id:l.string().min(1),name:l.string(),slug:l.string(),logo:l.string().nullable().optional()}),OC=by.extend({role:oo.optional()}),SC=l.object({}),TC=l.object({organizations:l.array(OC).describe("Organizations available to the current credential.")}),PC=l.object({organizationId:l.string().min(1).describe("Organization ID to fetch.")}),AC=l.object({organization:by}),DC=l.object({organizationId:l.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:l.string().trim().min(1).max(100).describe("New organization name.")}),NC=l.object({organization:by.describe("Updated organization.")}),yy=D({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:SC,output:TC,pagination:"none",async:"sync"}),my=D({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:PC,output:AC,pagination:"none",async:"sync"}),py=D({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:DC,output:NC,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}}}]}),oM={list:yy.contract,get:my.contract,update:py.contract}});var Ka,vy,V_,q_,W_,Y_,Fa,Ga,LC;var Iy=d(()=>{Ie();Ne();Ka=l.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"]),vy=l.object({id:l.string().uuid(),organizationId:l.string().min(1),name:l.string(),region:Ka}),V_=l.object({organizationId:l.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),q_=l.object({projects:l.array(vy).describe("Projects visible within the selected organization.")}),W_=l.object({projectId:l.string().uuid().describe("Project ID to fetch.")}),Y_=l.object({project:vy}),Fa=D({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:V_,output:q_,pagination:"none",async:"sync"}),Ga=D({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:W_,output:Y_,pagination:"none",async:"sync"}),LC={list:Fa.contract,get:Ga.contract}});var fy,X_,Z_,Q_,eO,no,io,CC;var ky=d(()=>{Ie();Ne();fy=l.object({projectId:l.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:l.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:l.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:l.coerce.number().min(1).default(1).describe("One-based page number.")}),X_=fy.extend({status:l.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),Z_=fy.extend({threadId:l.string().uuid().optional().describe("Optional thread restriction for message search."),role:l.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),Q_=l.object({threads:l.array(l.object({id:l.string().uuid(),projectId:l.string().uuid().optional(),title:l.string(),status:l.enum(["regular","archived"]),labels:l.array(l.string()),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),highlights:l.array(l.string()),score:l.number().optional()})),pagination:l.object({page:l.number(),limit:l.number(),totalResults:l.number(),totalPages:l.number()}).describe("Page-based pagination metadata for the current search result.")}),eO=l.object({messages:l.array(l.object({id:l.string().uuid(),threadId:l.string().uuid(),threadTitle:l.string(),role:l.enum(["user","assistant"]),content:l.string(),createdAt:l.string().datetime(),updatedAt:l.string().datetime(),highlights:l.array(l.string()),score:l.number().optional()})),pagination:l.object({page:l.number(),limit:l.number(),totalResults:l.number(),totalPages:l.number()}).describe("Page-based pagination metadata for the current search result.")}),no=D({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:X_,output:Q_,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}}}]}),io=D({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:Z_,output:eO,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}}}]}),CC={threads:no.contract,messages:io.contract}});var tO,xC,zC,jC,EC,$y,wy,dM;var rO=d(()=>{Ie();Ne();tO=l.object({id:l.string().uuid(),projectId:l.string().uuid(),name:l.string(),description:l.string().nullable(),currentStatus:l.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:l.string().datetime(),lastSeenAt:l.string().datetime()}),xC=l.object({projectId:l.string().uuid().optional().describe("Project to list status components for. Auto-filled from CLI and SDK context when omitted."),limit:l.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:l.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),zC=l.object({statusComponents:l.array(tO),nextCursor:l.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),jC=l.object({componentId:l.string().uuid().describe("Status component ID to retrieve.")}),EC=l.object({statusComponent:tO}),$y=D({operationId:"statusComponents.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/status-components",tags:["Status Components"]},input:xC,output:zC,pagination:"cursor",async:"sync"}),wy=D({operationId:"statusComponents.get",description:"Get a single status component by ID.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}",tags:["Status Components"]},input:jC,output:EC,pagination:"none",async:"sync"}),dM={list:$y.contract,get:wy.contract}});var oO;var nO=d(()=>{oO=["onboarding","setup"]});var iO,aO,cO,lO,vn;var _y=d(()=>{nO();Ie();Ne();iO=l.enum(oO),aO=l.object({id:l.string().describe("Unique task identifier (e.g. install_github_app)."),label:l.string().describe("Short human-readable task name."),description:l.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:l.string().describe("Step-by-step instructions for completing this task."),completed:l.boolean().describe("Whether the task has been completed."),completedAt:l.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:iO.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),cO=l.object({projectId:l.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),lO=l.object({tasks:l.array(aO).describe("All onboarding and setup tasks with their current completion status.")}),vn=D({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:cO,output:lO,pagination:"none",async:"sync"})});var Oy;var uO=d(()=>{Bb();t_();Yb();Zb();Ua();K_();M_();J_();Iy();Ra();ky();rO();_y();dy();Oy={me:Qb.contract,logs:{query:Zr.contract,schema:Qr.contract,volume:eo.contract,patterns:to.contract,nativeQuery:ro.contract},dataSources:{listTypes:ka.contract,listConnections:Mr.contract,getConnection:$a.contract,createConnection:Jr.contract,disconnectConnection:Ta.contract,listStreams:wa.contract,createStream:_a.contract,getStream:Oa.contract,deleteStream:Sa.contract},organizations:{list:yy.contract,get:my.contract,update:py.contract},members:{list:ey.contract,updateRole:ty.contract,remove:ry.contract},publicKeys:{list:Vr.contract,get:qr.contract,create:Wr.contract,update:Yr.contract,deactivate:Xr.contract},secretKeys:{list:La.contract,get:Ca.contract,create:xa.contract,update:za.contract,delete:ja.contract},projects:{list:Fa.contract,get:Ga.contract},search:{threads:no.contract,messages:io.contract},messages:{list:B_.contract,append:H_.contract},threads:{list:ly.contract,get:uy.contract,getStatus:hy.contract,create:gy.contract,update:sy.contract},runs:{list:oy.contract,listForThread:ny.contract,get:iy.contract},issues:{list:Hb.contract,get:Mb.contract,resolve:Jb.contract,ignore:Vb.contract,unignore:qb.contract},tasks:{list:vn.contract},statusComponents:{list:$y.contract,get:wy.contract}}});var Sy=d(()=>{uO();Bb();Yb();Zb();Iy();ky();_y()});var UC,Xq,RC,Ba=(e)=>{return RC.includes(e)};var Ty=d(()=>{UC={"eu-central-1":"EU Central (Frankfurt)"},Xq={"us-west-2":"US West","us-east-1":"US East","eu-central-1":UC["eu-central-1"]},RC=["us-west-2","us-east-1","eu-central-1"]});var Py,Ay,Dy,hO;var gO=d(()=>{Ie();Py=l.object({severities:l.array(l.string()).optional().describe("Limit results to the listed severities."),services:l.array(l.string()).optional().describe("Limit results to the listed service names."),environments:l.array(l.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:l.string().optional().describe("Case-insensitive substring match against the log body."),traceId:l.string().optional().describe("Limit results to one trace ID.")}),Ay=l.object({service:l.string(),namespace:l.string(),environment:l.string(),host:l.string(),container:l.string(),pod:l.string()}),Dy=l.object({id:l.string(),timestamp:l.string().datetime(),severity:l.string(),body:l.string(),service:l.string(),traceId:l.string(),spanId:l.string(),attributes:l.record(l.string(),l.string()),resource:Ay}),hO=l.object({type:l.literal("logs"),timestamp:l.string().datetime(),data:l.array(Dy)})});var KC="https://{region}.intake.sazabi.com",FC="wss://{region}.tail.sazabi.com",GC=3,dO=500,bO="sazabi.public_key",BC=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},yO=(e)=>{let t=BC(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},HC,MC,JC,mO=(e)=>{let t=new Map;return{tail:async(o)=>{let n=await ex(e.credentialProvider,o.projectId,"logs.tail"),r=await tx(e,t,n,o.region,"logs.tail"),i=VC({projectId:n,region:r,filters:o.filters,tailBaseUrl:e.tailBaseUrl}),a=await e.credentialProvider.getToken(),c=e.webSocket??globalThis.WebSocket;if(!c)throw Error("WebSocket transport is not available in this runtime.");return nx({token:a,url:i,signal:o.signal,webSocket:c})},forward:async(o)=>{let n=await rx(e,t,o.projectId??await e.credentialProvider.getProjectId?.(),o.region,"logs.forward"),r=YC(n,e.intakeBaseUrl),i=e.fetch??globalThis.fetch,a=ZC(o.logs,o.publicKey),c=lx(a);return await cx(i,r,a),{forwardedCount:c,failedCount:0}}}},VC=(e)=>{let t=(e.tailBaseUrl??FC).replace("{region}",e.region),o=qC(t)??new URL(t);o.searchParams.set("projectId",e.projectId);let n=WC(e.filters);if(n)o.searchParams.set("filters",n);return o.toString()},qC=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!yO(t.hostname))return;return t.protocol="ws:",t.pathname="/tail",t},WC=(e)=>{if(!e)return;let t=Object.entries(e).filter(([,o])=>o!==void 0&&(!Array.isArray(o)||o.length>0)&&o!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},YC=(e,t)=>{let o=(t??KC).replace("{region}",e),n=o.endsWith("/")?o.slice(0,-1):o,r=XC(n);if(r)return r;let i=n.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${i?`https://otlp.${i[1]}.intake.${i[2]}`:n}/v1/logs`},XC=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!yO(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},ZC=(e,t)=>{let o=e.resourceLogs;if(!o||o.length===0)return{...e,resourceLogs:[{resource:{attributes:[pO(t)]},scopeLogs:[]}]};return{...e,resourceLogs:o.map((n)=>({...n,resource:{...n.resource,attributes:QC(n.resource?.attributes,t)}}))}},QC=(e,t)=>{return[...(e??[]).filter((n)=>n?.key!==bO),pO(t)]},pO=(e)=>({key:bO,value:{stringValue:e}}),ex=async(e,t,o)=>{let n=t??await e.getProjectId?.();if(n)return n;throw IO(o,"Project ID is required",["projectId"])},tx=async(e,t,o,n,r)=>{let i=n??await vO(e,t,o);return ox(i,r)},rx=async(e,t,o,n,r)=>{if(n)return n;if(!o)throw IO(r,"Project ID is required",["projectId"]);return vO(e,t,o)},vO=async(e,t,o)=>{let n=t.get(o);if(n)return n;let r=e.raw.projects.get({projectId:o}).then((i)=>i.project.region);t.set(o,r);try{return await r}catch(i){throw t.delete(o),i}},ox=(e,t)=>{if(Ba(e))return e;throw new ye("BAD_REQUEST",{message:`Log tail is not supported for project region ${e}.`,data:{operationId:t,missingContext:[]}})},nx=async(e)=>{let t=[],o=[],n=!1,r=!1,i,a=0,c,u=(y)=>{if(n)return;n=!0,i=y;while(o.length>0){let _=o.shift();if(_)_({value:void 0,done:!0})}},h=(y)=>{let _=o.shift();if(_){_({value:y,done:!1});return}t.push(y)},s=()=>{if(c&&c.readyState<c.CLOSING)c.close(1000,"Client closed stream")},g=async()=>{await new Promise((y,_)=>{let S=!1,H;try{H=new e.webSocket(e.url,[e.token])}catch(F){_(F instanceof Error?F:Error("Failed to open WebSocket connection."));return}c=H,H.onopen=()=>{if(a=0,!S)S=!0,y()},H.onmessage=(F)=>{let le=ix(F.data);for(let oe of le)h(oe)},H.onerror=()=>{if(!S)S=!0,_(Error("WebSocket connection failed. Check the close event for details."))},H.onclose=(F)=>{if(!S){S=!0,_(sO(F.code,F.reason));return}if(r||n){u();return}if(ax(F.code)&&a<GC){a+=1,globalThis.setTimeout(()=>{g().catch((le)=>{u(le instanceof Error?le:Error(String(le)))})},dO*2**(a-1));return}u(sO(F.code,F.reason))}})};e.signal?.addEventListener("abort",()=>{r=!0,s(),u()},{once:!0}),await g();let b={[Symbol.asyncIterator](){return b},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(n){if(i)throw i;return{value:void 0,done:!0}}return new Promise((y)=>{o.push(y)}).then((y)=>{if(y.done&&i)throw i;return y})},return:async()=>{return r=!0,s(),u(),{value:void 0,done:!0}},throw:async(y)=>{throw r=!0,s(),u(y instanceof Error?y:Error(String(y))),y}};return b},ix=(e)=>{let t=(()=>{if(typeof e==="string")return e;if(e instanceof ArrayBuffer)return new TextDecoder().decode(e);return null})();if(!t)return[];try{let o=hO.safeParse(JSON.parse(t));if(!o.success)return[];return o.data.data}catch{return[]}},ax=(e)=>{return![1000,1001,1008,4001,4003,4004].includes(e)},sO=(e,t)=>{if(t)return Error(t);let o={1000:"Normal closure",1001:"Endpoint going away",1002:"Protocol error",1003:"Unsupported data",1006:"Connection closed abnormally (no close frame received)",1007:"Invalid payload data",1008:"Policy violation",1009:"Message too big",1010:"Missing extension",1011:"Internal server error",1015:"TLS handshake failure",4001:"Authentication failed - check your credential",4003:"Forbidden - credential may not have access to this project",4004:"Project not found"}[e]??`Unknown close code: ${e}`;return Error(`Connection closed: ${o}`)},cx=async(e,t,o,n=3,r=1e4)=>{let i;for(let a=0;a<=n;a+=1){let c=new AbortController,u=globalThis.setTimeout(()=>c.abort(),r);try{let h=await e(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o),signal:c.signal});if(h.ok)return;let s=await h.text();if(h.status===401||h.status===403)throw Error("Authentication failed. Check your public key.");if(h.status>=400&&h.status<500&&h.status!==429)throw Error(`Client error (${h.status}): ${s}`);i=Error(h.status===429?`Rate limited (429): ${s}`:`Server error (${h.status}): ${s}`)}catch(h){let s=h instanceof Error?h.message:String(h);if(s.startsWith("Authentication failed")||s.startsWith("Client error ("))throw h instanceof Error?h:Error(s);i=h instanceof Error&&h.name==="AbortError"?Error("Request timed out"):h instanceof Error?h:Error(String(h))}finally{globalThis.clearTimeout(u)}if(a<n)await ux(dO*2**a)}throw Error(`Failed after ${n+1} attempts: ${i?.message??"Unknown error"}`)},lx=(e)=>{return e.resourceLogs?.reduce((t,o)=>t+(o.scopeLogs?.reduce((n,r)=>n+(r.logRecords?.length??0),0)??0),0)??0},ux=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},IO=(e,t,o)=>{return new ye("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:o}})};var Ny=d(()=>{gr();Ty();gO();Ie();HC=l.object({projectId:l.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:Py.optional().describe("Optional filters applied by the tail WebSocket service.")}),MC=l.object({publicKey:l.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:l.custom((e)=>typeof e==="object"&&e!==null).describe("OTLP logs export request payload to send to the intake service.")}),JC=l.object({forwardedCount:l.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:l.number().int().nonnegative().describe("Number of log records rejected by the intake request.")})});var hx="https://api.sazabi.com",kO="https://api.platform.sazabi.com",$O="sazabi-cli",gx="urn:ietf:params:oauth:grant-type:device_code",wO=(e)=>{let t=Cc(new Jc(Oy,{url:sx(e.apiBaseUrl??hx),headers:async()=>new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`}),fetch:e.fetch,customErrorResponseBodyDecoder:(n,r)=>{let i=Ix(n);if(!i)return null;return new ye(i.code,{message:i.message,status:r.status,data:{operationId:i.operationId,missingContext:i.missingContext}})}})),o=mO({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl,webSocket:e.webSocket});return{raw:t,me:async()=>t.me({}),logs:{...o,query:async(n={})=>t.logs.query(await fe(e.credentialProvider,n,Zr.operationId)),schema:async(n={})=>t.logs.schema(await fe(e.credentialProvider,n,Qr.operationId)),volume:async(n)=>t.logs.volume(await fe(e.credentialProvider,n,eo.operationId)),patterns:async(n={})=>t.logs.patterns(await fe(e.credentialProvider,n,to.operationId)),nativeQuery:async(n)=>t.logs.nativeQuery(await fe(e.credentialProvider,n,ro.operationId))},organizations:{list:async()=>t.organizations.list({}),get:async(n)=>t.organizations.get(n),update:async(n)=>t.organizations.update(await bx(e.credentialProvider,n))},members:{list:async(n={})=>t.members.list(await Ha(e.credentialProvider,n)),updateRole:async(n)=>t.members.updateRole(await Ha(e.credentialProvider,n)),remove:async(n)=>{let r=await Ha(e.credentialProvider,n);return t.members.remove({params:{userId:r.userId},query:{organizationId:r.organizationId}})}},publicKeys:{list:async(n={})=>t.publicKeys.list(await fe(e.credentialProvider,n,Vr.operationId)),get:async(n)=>t.publicKeys.get(await fe(e.credentialProvider,n,qr.operationId)),create:async(n)=>t.publicKeys.create(await fe(e.credentialProvider,n,Wr.operationId)),update:async(n)=>t.publicKeys.update(await fe(e.credentialProvider,n,Yr.operationId)),deactivate:async(n)=>{let r=await fe(e.credentialProvider,n,Xr.operationId);return t.publicKeys.deactivate({params:{keyId:r.keyId},query:{projectId:r.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 fe(e.credentialProvider,n,no.operationId)),messages:async(n)=>t.search.messages(await fe(e.credentialProvider,n,io.operationId))},projects:{list:async(n={})=>t.projects.list(await dx(e.credentialProvider,n)),get:async(n)=>t.projects.get(n)},messages:{list:async(n)=>t.messages.list(n),append:async(n)=>fO(t,await t.messages.append(vx(n)))},threads:{list:async(n={})=>t.threads.list(await yx(e.credentialProvider,n)),get:async(n)=>t.threads.get(n),getStatus:async(n)=>t.threads.getStatus(n),create:async(n)=>fO(t,await t.threads.create(await px(e.credentialProvider,n))),update:async(n)=>t.threads.update(n)},runs:{list:async(n={})=>t.runs.list(await mx(e.credentialProvider,n)),listForThread:async(n)=>t.runs.listForThread(n),get:async(n)=>t.runs.get(n)},dataSources:{listTypes:async()=>t.dataSources.listTypes({}),connections:{list:async(n={})=>t.dataSources.listConnections(await fe(e.credentialProvider,n,Mr.operationId)),get:async(n)=>t.dataSources.getConnection(n),create:async(n)=>t.dataSources.createConnection(await fe(e.credentialProvider,n,Jr.operationId)),disconnect:async(n)=>t.dataSources.disconnectConnection(n)},streams:{list:async(n)=>t.dataSources.listStreams(n),get:async(n)=>t.dataSources.getStream(n),create:async(n)=>t.dataSources.createStream(n),delete:async(n)=>t.dataSources.deleteStream(n)}},issues:{list:async(n={})=>t.issues.list(await fe(e.credentialProvider,n,"issues.list")),get:async(n)=>t.issues.get(n),resolve:async(n)=>t.issues.resolve(n),ignore:async(n)=>t.issues.ignore(n),unignore:async(n)=>t.issues.unignore(n)},statusComponents:{list:async(n={})=>t.statusComponents.list(await fe(e.credentialProvider,n,"statusComponents.list")),get:async(n)=>t.statusComponents.get(n)},tasks:{list:async(n={})=>t.tasks.list(await fe(e.credentialProvider,n,vn.operationId))}}},Cy=async(e={})=>{let t=await SO(e.fetch)(_O(e.apiBaseUrl??kO,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??$O,...e.scope?{scope:e.scope}:{}})}),o=await t.json();if(!t.ok)throw fx(o,t.status);let n=o;return{deviceCode:ao(n.device_code,"device_code"),userCode:ao(n.user_code,"user_code"),verificationUri:ao(n.verification_uri,"verification_uri"),verificationUriComplete:ao(n.verification_uri_complete,"verification_uri_complete"),expiresIn:Ly(n.expires_in,"expires_in"),interval:Ly(n.interval,"interval")}},xy=async(e)=>{let t=await SO(e.fetch)(_O(e.apiBaseUrl??kO,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:gx,device_code:e.deviceCode,client_id:e.clientId??$O})}),o=await t.json();if(t.ok){let r=o;return{status:"authorized",accessToken:ao(r.access_token,"access_token"),tokenType:ao(r.token_type,"token_type"),expiresIn:Ly(r.expires_in,"expires_in"),scope:typeof r.scope==="string"?r.scope:""}}let n=OO(o);if(!n)throw Error(`Device authorization failed with status ${t.status}`);if(n.error==="authorization_pending")return{status:"pending"};if(n.error==="slow_down")return{status:"pending",interval:10};if(n.error==="access_denied")return{status:"denied",message:n.errorDescription};if(n.error==="expired_token"||n.error==="invalid_grant")return{status:"expired",message:n.errorDescription};throw Error(n.errorDescription)},sx=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},_O=(e,t)=>{return`${e.replace(/\/+$/,"")}/api/auth${t}`},dx=async(e,t)=>{return Ha(e,t)},Ha=async(e,t)=>{let o=t.organizationId??await e.getOrganizationId?.();return o?{...t,organizationId:o}:t},bx=async(e,t)=>{let o=t.organizationId??await e.getOrganizationId?.();if(!o)throw new ye("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:o}},fe=async(e,t,o)=>{let n=t.projectId??await e.getProjectId?.();if(!n)throw new ye("BAD_REQUEST",{message:"Project ID is required",data:{operationId:o,missingContext:["projectId"]},status:400});return{...t,projectId:n}},yx=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},mx=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},px=async(e,t)=>{let o=t.projectId??await e.getProjectId?.();return o?{...t,projectId:o}:t},vx=(e)=>{return{threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20}},Ix=(e)=>{if(!e||typeof e!=="object")return null;let t=e;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((o)=>typeof o==="string"):[]}},OO=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},fx=(e,t)=>{let o=OO(e);return Error(o?.errorDescription??`Device authorization failed with status ${t}`)},SO=(e)=>{return e??globalThis.fetch},fO=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(o={})=>kx(e,t,o)}),kx=async(e,t,o)=>{if(t.completed)return t;let n=o.intervalMs??2000,r=Date.now(),i=t;while(!i.completed){if(o.timeoutMs!==void 0&&Date.now()-r>=o.timeoutMs)return i;await $x(n),i=await e.runs.get({runId:i.runId})}return i},$x=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},ao=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},Ly=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var zy=d(()=>{gr();Bm();Sy();Ny();Ny()});var ke=(e)=>({success:!0,value:e}),de=(e,t,o)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...o!==void 0&&{errorPayload:o}}),f=(e,t,o)=>{if(!e.success){let n=`${t}: ${e.error}`;if(o)return v(e.errorPayload??n);return p(n)}return e.value};var X=d(()=>{B()});var _x="https://api.sazabi.com",z=async(e)=>{try{return ke(await e())}catch(t){let o=Ox(t),n=Sx(t),r=t instanceof Error?t.message:String(t);return de(r,n,o)}},Ox=(e)=>{if(!e||typeof e!=="object")return;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let o=t.data;if(typeof o.operationId!=="string")return;return{code:t.code,message:t.message,operationId:o.operationId,missingContext:Array.isArray(o.missingContext)?o.missingContext.filter((n)=>typeof n==="string"):[]}},Sx=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},ft=(e)=>{let t=wO({apiBaseUrl:e.baseUrl??_x,credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>z(()=>t.me()),logs:{tail:(o)=>z(()=>t.logs.tail(o)),forward:(o)=>z(()=>t.logs.forward(o)),query:(o={})=>z(()=>t.logs.query(o)),schema:(o={})=>z(()=>t.logs.schema(o)),volume:(o)=>z(()=>t.logs.volume(o)),patterns:(o={})=>z(()=>t.logs.patterns(o)),nativeQuery:(o)=>z(()=>t.logs.nativeQuery(o))},organizations:{list:()=>z(()=>t.organizations.list()),get:(o)=>z(()=>t.organizations.get({organizationId:o})),rename:(o,n)=>z(()=>t.organizations.update({organizationId:n,name:o}))},members:{list:(o={})=>z(()=>t.members.list(o)),updateRole:(o,n,r)=>z(()=>t.members.updateRole({organizationId:r,userId:o,role:n})),remove:(o,n)=>z(()=>t.members.remove({organizationId:n,userId:o}))},projects:{list:(o={})=>z(()=>t.projects.list(o)),get:(o)=>z(()=>t.projects.get({projectId:o}))},threads:{list:(o={})=>z(()=>t.threads.list(o)),get:(o)=>z(()=>t.threads.get({threadId:o})),create:(o)=>z(()=>t.threads.create(o)),getStatus:(o)=>z(()=>t.threads.getStatus({threadId:o})),update:(o,n)=>z(()=>t.threads.update({threadId:o,status:n}))},messages:{list:(o,n={})=>z(()=>t.messages.list({threadId:o,...n})),append:(o,n,r,i)=>z(()=>t.messages.append({threadId:o,message:n,wait:r,timeoutSeconds:i}))},runs:{get:(o)=>z(()=>t.runs.get({runId:o}))},search:{threads:(o)=>z(()=>t.search.threads(o)),messages:(o)=>z(()=>t.search.messages(o))},publicKeys:{list:(o)=>z(()=>t.publicKeys.list(o)),get:(o,n)=>z(()=>t.publicKeys.get(n?{keyId:o,projectId:n}:{keyId:o})),create:(o)=>z(()=>t.publicKeys.create(o)),update:(o)=>z(()=>t.publicKeys.update(o)),deactivate:(o)=>z(()=>t.publicKeys.deactivate(o))},secretKeys:{list:(o)=>z(()=>t.secretKeys.list(o)),get:(o)=>z(()=>t.secretKeys.get({keyId:o})),create:(o)=>z(()=>t.secretKeys.create(o)),update:(o)=>z(()=>t.secretKeys.update(o)),delete:(o)=>z(()=>t.secretKeys.delete(o))},issues:{list:(o={})=>z(()=>t.issues.list(o)),get:(o)=>z(()=>t.issues.get({issueId:o})),resolve:(o)=>z(()=>t.issues.resolve({issueId:o})),ignore:(o)=>z(()=>t.issues.ignore({issueId:o})),unignore:(o)=>z(()=>t.issues.unignore({issueId:o}))},statusComponents:{list:(o={})=>z(()=>t.statusComponents.list(o)),get:(o)=>z(()=>t.statusComponents.get({componentId:o}))},tasks:{list:(o={})=>z(()=>t.tasks.list(o))},dataSources:{listTypes:()=>z(()=>t.dataSources.listTypes()),connections:{list:(o)=>z(()=>t.dataSources.connections.list(o)),get:(o)=>z(()=>t.dataSources.connections.get({connectionId:o})),create:(o)=>z(()=>t.dataSources.connections.create(o)),disconnect:(o)=>z(()=>t.dataSources.connections.disconnect({connectionId:o}))},streams:{list:(o)=>z(()=>t.dataSources.streams.list({connectionId:o})),get:(o)=>z(()=>t.dataSources.streams.get({streamId:o})),create:(o)=>z(()=>t.dataSources.streams.create(o)),delete:(o)=>z(()=>t.dataSources.streams.delete({streamId:o}))}}}};var In=d(()=>{zy();X()});var TO;var PO=d(()=>{TO={version:2,activeProfile:"default",profiles:{default:{}}}});import*as kt from"node:fs";import*as AO from"node:os";import*as Uy from"node:path";var Le=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},jy,co,Tx=()=>{if(!kt.existsSync(jy))kt.mkdirSync(jy,{recursive:!0,mode:448})},Ey,DO=(e)=>{Ey=e},NO=(e)=>({token:Le(e.token),activeOrganizationId:Le(e.activeOrganizationId??e.organizationId),organizationName:Le(e.organizationName),activeProjectId:Le(e.activeProjectId??e.defaultProjectId),apiBaseUrl:Le(e.apiBaseUrl),authBaseUrl:Le(e.authBaseUrl),webBaseUrl:Le(e.webBaseUrl),intakeBaseUrl:Le(e.intakeBaseUrl),tailBaseUrl:Le(e.tailBaseUrl),apiDomain:Le(e.apiDomain),webDomain:Le(e.webDomain),intakeDomain:Le(e.intakeDomain),tailDomain:Le(e.tailDomain),forwardPublicKey:Le(e.forwardPublicKey)}),Px=(e)=>({version:2,activeProfile:"default",profiles:{default:NO(e)}}),Ax=(e)=>{let t=Le(e.activeProfile)??"default",o=typeof e.profiles==="object"&&e.profiles!==null?e.profiles:{},n={};for(let[r,i]of Object.entries(o)){if(typeof i!=="object"||i===null)continue;n[r]=NO(i)}if(!n[t])n[t]={};return{version:2,activeProfile:t,profiles:n}},ie=()=>{try{if(!kt.existsSync(co))return ke(TO);let e=kt.readFileSync(co,"utf-8"),t=JSON.parse(e),o=typeof t.version==="number"?t.version:void 0;if(o!==void 0&&o>2)return de("Settings file requires a newer CLI version. Please upgrade.");if(o===2)return ke(Ax(t));let n=Px(t),r=me(n);if(!r.success)return r;return ke(n)}catch(e){let t=e instanceof Error?e.message:String(e);return de(`Failed to read settings: ${t}`)}},me=(e)=>{try{return Tx(),kt.writeFileSync(co,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),ke(void 0)}catch(t){let o=t instanceof Error?t.message:String(t);return de(`Failed to write settings: ${o}`)}},ut=(e,t)=>{if(t)return t;if(Ey)return Ey;let o=process.env.SAZABI_PROFILE?.trim();if(o)return o;return e.activeProfile??"default"},Ze=(e,t)=>{let o=ut(e,t),n=e.profiles[o];if(n)return ke(n);if(o==="default")return ke({});return de(`Profile '${o}' does not exist. Run 'sazabi profiles create ${o}' first.`)},$t=()=>{let e=ie();if(!e.success)return e;return Ze(e.value)},Re=(e,t,o)=>{let n=ut(e,o);if(!e.profiles[n])return de(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`);return ke({...e,profiles:{...e.profiles,[n]:{...e.profiles[n],...t}}})};var Ve=d(()=>{PO();X();jy=Uy.join(AO.homedir(),".sazabi"),co=Uy.join(jy,"settings.json")});var ht=(e)=>{let{cliFlag:t,globalUrl:o,globalDomain:n,buildUrlFromDomain:r,defaultUrl:i}=e;if(t)return t;let a=process.env.SAZABI_API_URL?.trim();if(a)return a;if(o)return o;if(n)return r(n);return i},N=(e)=>{let{tokenFlag:t,organizationIdFlag:o,projectIdFlag:n,jsonMode:r}=e,i=t?.trim(),a=process.env.SAZABI_TOKEN?.trim(),c=process.env.SAZABI_ORGANIZATION_ID?.trim(),u=process.env.SAZABI_PROJECT_ID?.trim(),h=f($t(),"Failed to read settings",r),s=h.token?.trim(),g=(i&&i.length>0?i:void 0)||(a&&a.length>0?a:void 0)||s,b=i&&i.length>0?"flag":a&&a.length>0?"environment":"settings";if(!g||g.length===0){if(r)return v("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return p("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let y,_;if(o)y=o,_="flag";else if(c&&c.length>0)y=c,_="environment";else if(h.activeOrganizationId)y=h.activeOrganizationId,_="settings";let S,H;if(n)S=n,H="flag";else if(u&&u.length>0)S=u,H="environment";else if(h.activeProjectId)S=h.activeProjectId,H="settings";return{token:g,type:"token",projectId:S,organizationId:y,tokenSource:b,organizationSource:_,projectSource:H}},L=(e)=>{let t=f($t(),"Failed to read settings",e.jsonMode),o=ht({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"});return ft({token:e.token,baseUrl:o,organizationId:e.organizationId,projectId:e.projectId})},LO,Ry,Ja=async(e)=>{let t=f($t(),"Failed to read settings",e.jsonMode),o=ht({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(u)=>`https://api.${u}`,defaultUrl:"https://api.sazabi.com"}),n=`${e.token}@${o}@${e.projectId??""}`,r=LO.get(n);if(r)return r;let i=Ry.get(n);if(i)return i;if(!e.projectId){if(e.jsonMode)return v("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return p("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let a=e.projectId,c=(async()=>{let h=await ft({token:e.token,baseUrl:o,projectId:a}).projects.get(a),g=f(h,"Failed to fetch project info",e.jsonMode).project;return LO.set(n,g),g})();Ry.set(n,c);try{return await c}finally{Ry.delete(n)}},Ma=(e)=>{let t=e.trim().toLowerCase(),o=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,n=t;try{n=new URL(o).hostname.toLowerCase()}catch{n=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${n.replace(/^(?:app\.)+/,"")}`},fn=(e)=>{let t=(n)=>n.replace(/\/+$/,"");if(e)return t(e);let o=f($t(),"Failed to read settings");if(o.webBaseUrl)return t(o.webBaseUrl);if(o.webDomain)return Ma(o.webDomain);if(o.apiDomain)return Ma(o.apiDomain);return"https://app.sazabi.com"},wt=(e,t,o,n)=>{let r=`${fn(o)}/projects/${e}/threads/${t}`;return n?`${r}?messageId=${encodeURIComponent(n)}`:r},CO=(e,t)=>{return`https://otlp.${t}.intake.${e}`};var re=d(()=>{B();In();X();Ve();LO=new Map,Ry=new Map});var rc,rT=(e)=>{rc.set(e.name,e)},oc=(e)=>{return rc.get(e)},kn=()=>{return Array.from(rc.values())},oT=(e)=>{return rc.has(e)};var Vy=d(()=>{rc=new Map});async function Xy(e){let t=await e.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((o)=>({value:o.id,description:o.name}))}async function Zy(e){let t=await e.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((o)=>({value:o.id,description:o.name}))}async function WE(e){let t=await e.dataSources.connections.list();if(!t.success)return[];return t.value.connections.map((o)=>({value:o.id,description:o.displayName??void 0}))}async function aT(e){let t=await e.members.list();if(!t.success)return[];return t.value.members.map((o)=>({value:o.userId,description:o.name??o.email}))}var VE=3000,qE,cT=async(e,t,o)=>{try{let n=qE[e]?.[t];if(!n)return[];let r=$t();if(!r.success)return[];let i=r.value,a=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!a)return[];let c=ht({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(s)=>`https://api.${s}`,defaultUrl:"https://api.sazabi.com"}),u=ft({token:a,baseUrl:c,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([n(u),new Promise((s)=>setTimeout(()=>s([]),VE))])).filter((s)=>s.value.startsWith(o))}catch{return[]}};var lT=d(()=>{In();re();Ve();qE={threads:{get:async(e)=>{let t=await e.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((o)=>({value:o.id,description:o.title??void 0}))}},projects:{use:async(e)=>{let t=await e.projects.list();if(!t.success)return[];return t.value.projects.map((o)=>({value:o.id,description:o.name}))}},organizations:{use:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((o)=>({value:o.id,description:o.name}))},rename:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((o)=>({value:o.id,description:o.name}))}},"public-keys":{get:Xy,update:Xy,deactivate:Xy},"secret-keys":{get:Zy,update:Zy,delete:Zy},"data-sources":{"get-connection":WE},members:{"update-role":aT,remove:aT}}});var hT={};Qe(hT,{parseCompletionContext:()=>ZE,getCompletions:()=>QE});var YE,XE,ZE=(e)=>{let t=e.length>0?e:[""],o=t.length-1,n=t[o]??"";return{words:t,currentIndex:o,partial:n}},QE=async(e)=>{let{words:t,currentIndex:o,partial:n}=e,r=t[o-1];if(r==="--profile")return o4(n);let i=r4(t),a=Math.max(0,i.length-(t.length-o));if(a===0)return e4(n);let c=i[0]??"",u=oc(c);if(!u)return[];if(a===1&&u.subcommands){if(n.startsWith("-"))return uT(u.options,i);return t4(u,n)}let h=u.subcommands?i[1]:void 0,g=(h?u.subcommands?.[h]:void 0)?.options??u.options;if(n.startsWith("-"))return uT(g,i);if(r?.startsWith("--")){let b=r.slice(2);if(g?.[b]?.type==="string"){let _=`${c}:${h??""}`,S=XE[_]?.[b]??YE[b];if(S)return S.filter((H)=>H.startsWith(n)).map((H)=>({value:H}));return[]}}return cT(c,h??"",n)},e4=(e)=>{let o=kn().filter((r)=>r.name.startsWith(e)).map((r)=>({value:r.name,description:r.description})),n=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let r of n)if(r.value.startsWith(e))o.push(r);return o},t4=(e,t)=>{if(!e.subcommands)return[];return Object.values(e.subcommands).filter((o)=>o.name.startsWith(t)).map((o)=>({value:o.name,description:o.description}))},uT=(e,t)=>{let o=t[t.length-1]??"",n=new Set(t.filter((i)=>i.startsWith("--")).map((i)=>i.replace(/=.*/,""))),r=[];if(!n.has("--help")&&"--help".startsWith(o))r.push({value:"--help",description:"Show help"});if(!n.has("--profile")&&"--profile".startsWith(o))r.push({value:"--profile",description:"Use a named profile"});if(!e)return r;for(let[i,a]of Object.entries(e)){let c=`--${i}`;if(n.has(c))continue;if(!c.startsWith(o))continue;r.push({value:c,description:a.description})}return r},r4=(e)=>{let t=[];for(let o=0;o<e.length;o++){let n=e[o];if(n==="--profile"&&o+1<e.length)o++;else if(n.startsWith("--profile="));else t.push(n)}return t},o4=(e)=>{try{let t=ie();if(!t.success)return[];return Object.keys(t.value.profiles).filter((o)=>o.startsWith(e)).map((o)=>({value:o,description:o===t.value.activeProfile?"active":void 0}))}catch{return[]}};var gT=d(()=>{Vy();Ve();lT();YE={status:["regular","archived"],format:["json","text"]},XE={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});B();B();zy();import{spawn as Dx}from"node:child_process";B();import{parseArgs as wx}from"node:util";var T=(e,t,o={})=>{let n=wx({args:e,options:t,allowPositionals:Boolean(o.allowPositionals),strict:!1,tokens:!0}),r=Object.hasOwn(t,"json")&&n.values.json===!0,i=new Set(Object.keys(t)),a=new Set(Object.entries(t).map(([,u])=>u.short).filter((u)=>Boolean(u))),c=[];if(Array.isArray(n.tokens))for(let u of n.tokens){if(u.kind!=="option")continue;let h=u.name,s=h.length>1;if(!(i.has(h)||!s&&a.has(h))){let b=s?`--${h}`:`-${h}`;if(!c.includes(b))c.push(b)}}for(let u of Object.keys(n.values))if(!i.has(u)){let h=u.length>1?`--${u}`:`-${u}`;if(!c.includes(h))c.push(h)}if(c.length>0){let u=`Unknown option${c.length>1?"s":""}: ${c.join(", ")}`;if(r)v(u);p(u)}for(let[u,h]of Object.entries(t))if(h.type==="string"&&n.values[u]===!0){let g=`Option ${u.length===1?`-${u}`:`--${u}`} requires a value`;if(r)v(g);p(g)}for(let[u,h]of Object.entries(t)){let s=n.values[u];if(h.type==="string"&&typeof s==="string"){if(s.startsWith("--")||s.length===2&&s[0]==="-"&&/[a-zA-Z]/.test(s.charAt(1))){let y=`Option ${u.length===1?`-${u}`:`--${u}`} received "${s}" as its value. Did you forget to provide a value?`;if(r)v(y);p(y)}}}return{values:n.values,positionals:n.positionals}};var V={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},q={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};re();var Va=(e,t)=>{let o=e?.json;if(!o||o.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class xO{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t,o){this.name=e,this.description=t,this.handler=o}withOptions(e){return this.options=e,this}withSubcommands(e){return this.subcommands=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)Va(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)Va(t.options,`Subcommand "${this.name} ${e}"`)}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 zO{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t){this.name=e,this.description=t}withHandler(e){return this.handler=e,this}withSubcommands(e){return this.subcommands=e,this}withOptions(e){return this.options=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,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)Va(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;Va(t.options,`Subcommand "${this.name} ${e}"`)}}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 W=(e,t)=>{return new zO(e,t)},P=(e,t,o)=>{return new xO(e,t,o)};X();Ve();var lo=(e)=>{if(e==="flag")return"from flag";if(e==="environment")return"from environment";return"from settings"},Nx=async(e={})=>{let t=N({jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.me(),"Failed to fetch authentication details",e.json);if(e.json){j({credential:n,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(ce("Authentication"),n.credentialType==="user"){ne({Type:`User token (${lo(t.tokenSource)})`,User:n.user.name??n.user.email,Email:n.user.email,"Active Organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${lo(t.organizationSource)})`:_e("(none)"),"Active Project":t.projectId&&t.projectSource?`${t.projectId} (${lo(t.projectSource)})`:_e("(none)"),Organizations:n.organizations.length.toString(),"Dashboard URL":fn()});return}if(n.credentialType==="secret"){ne({Type:`Secret key (${lo(t.tokenSource)})`,Organization:n.organization.name,"Key Name":n.keyName,"Active Project":t.projectId&&t.projectSource?`${t.projectId} (${lo(t.projectSource)})`:_e("(none)"),"Dashboard URL":fn()});return}ne({Type:`Partner key (${lo(t.tokenSource)})`,Superorganization:n.superorganization.name,"Dashboard URL":fn()})},Lx=async(e,t={})=>{let o=e.trim();if(!o){if(t.json)return v("Token is required.");return p("Token is required.")}let n=f(ie(),"Failed to read settings",t.json);await Ky({token:o,options:t,cliSettings:n,status:"saved"})},jO=(e)=>{let t=process.platform,o,n;if(t==="darwin")o="open",n=[e];else if(t==="win32")o="cmd",n=["/c","start","",e];else o="xdg-open",n=[e];let r=Dx(o,n,{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()},EO=(e)=>new Promise((t)=>setTimeout(t,e)),Cx=async(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=t.profiles[o]??{},r=Fy(n,e.apiBaseUrl),i=UO(r,e.authBaseUrl??n.authBaseUrl),a;try{a=await Cy({apiBaseUrl:i})}catch(b){let y=b instanceof Error?b.message:String(b);if(e.json)return v(`Failed to initiate signup: ${y}`);return p(`Failed to initiate signup: ${y}`)}let c=KO({profile:n,publicApiBaseUrl:r,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:a.verificationUriComplete}),u=`/login/cli?user_code=${encodeURIComponent(a.userCode)}`,h=`${c}/sign-up?returnTo=${encodeURIComponent(u)}`,s=new Date(Date.now()+a.expiresIn*1000),g=a.interval*1000;if(!e.json)R(),ce("Create a Sazabi account"),R(),et(`Opening ${ae.info(h)}`),R(),jO(h),Y("Waiting for signup to complete...");while(new Date<s){await EO(g);try{let b=await xy({apiBaseUrl:i,deviceCode:a.deviceCode});if(b.status==="pending"){g=(b.interval??a.interval)*1000;continue}if(b.status==="denied"){if(e.json)return v("Signup was denied.");return R(),p("Signup was denied.")}if(b.status==="expired"){if(e.json)return v("Signup request expired. Please try again.");return R(),p("Signup request expired. Please try again.")}await Ky({token:b.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(b){let y=b instanceof Error?b.message:String(b);if(e.json)return v(`Signup failed: ${y}`);return R(),p(`Signup failed: ${y}`)}}if(e.json)return v("Signup request expired. Please try again.");return R(),p("Signup request expired. Please try again.")},xx=async(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=t.profiles[o]??{},r=Fy(n,e.apiBaseUrl),i=UO(r,e.authBaseUrl??n.authBaseUrl),a;try{a=await Cy({apiBaseUrl:i})}catch(g){let b=g instanceof Error?g.message:String(g);if(e.json)return v(`Failed to initiate login: ${b}`);return p(`Failed to initiate login: ${b}`)}let c=KO({profile:n,publicApiBaseUrl:r,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:a.verificationUriComplete}),u=Gx(a.verificationUriComplete,c),h=new Date(Date.now()+a.expiresIn*1000),s=a.interval*1000;if(!e.json)R(),ce("Login to Sazabi"),R(),et("Enter this code in your browser:"),R(),et(ae.bold(a.userCode),4),R(),et(`Opening ${ae.info(u)}`),R(),jO(u),Y("Waiting for authorization...");while(new Date<h){await EO(s);try{let g=await xy({apiBaseUrl:i,deviceCode:a.deviceCode});if(g.status==="pending"){s=(g.interval??a.interval)*1000;continue}if(g.status==="denied"){if(e.json)return v("Authorization was denied.");return R(),p("Authorization was denied.")}if(g.status==="expired"){if(e.json)return v("Authorization request expired. Please try again.");return R(),p("Authorization request expired. Please try again.")}await Ky({token:g.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(g){let b=g instanceof Error?g.message:String(g);if(e.json)return v(`Authorization failed: ${b}`);return R(),p(`Authorization failed: ${b}`)}}if(e.json)return v("Authorization request expired. Please try again.");return R(),p("Authorization request expired. Please try again.")},zx=(e)=>{let t=f(ie(),"Failed to read settings",e.json),o=f(Ze(t),"Failed to resolve profile",e.json),n=Boolean(o.token),r=f(Re(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0}),"Failed to update profile",e.json);if(f(me(r),"Failed to remove credentials",e.json),e.json){j({removed:n});return}if(n){M("Logged out successfully.");return}Y("No credentials were saved.")},Ky=async({token:e,options:t,cliSettings:o,status:n})=>{let r=ut(o),i=o.profiles[r]??{},a=Fy(i,t.apiBaseUrl),c=L({token:e,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),u=f(await c.me(),`Failed to resolve authenticated context at ${a} (pass --api-base-url to target a different environment)`,t.json);if(n==="authorized"&&u.credentialType!=="user"){if(t.json)return v("Expected a user session from device authorization.");return p("Expected a user session from device authorization.")}let h=o.profiles[r]?o:{...o,profiles:{...o.profiles,[r]:{}}},s=h.profiles[r],g=await jx({client:c,credential:u,currentProjectId:s.activeProjectId,jsonMode:t.json}),b=f(Re(h,{token:e,activeOrganizationId:g.activeOrganizationId,organizationName:g.activeOrganizationName,activeProjectId:g.activeProjectId,apiBaseUrl:t.apiBaseUrl??s.apiBaseUrl,authBaseUrl:t.authBaseUrl??s.authBaseUrl,webBaseUrl:t.webBaseUrl??s.webBaseUrl}),"Failed to update profile",t.json);if(f(me(b),"Failed to save credentials",t.json),t.json){j({status:n,credential:u,activeOrganizationId:g.activeOrganizationId,activeProjectId:g.activeProjectId,projects:g.projects});return}if(R(),M(n==="authorized"?"Successfully authenticated!":"Saved token."),R(),Ux({credential:u,activeOrganizationName:g.activeOrganizationName,activeProjectId:g.activeProjectId,projects:g.projects}),g.projects.length>0){R(),ce("Available Projects");for(let y of g.projects){let S=y.id===g.activeProjectId?ae.success(" (active)"):"";et(`${y.name} (${y.region})${S}`)}}},jx=async({client:e,credential:t,currentProjectId:o,jsonMode:n})=>{if(t.credentialType==="partner")return{projects:[]};let r=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,i=t.credentialType==="user"?t.organizations.find((c)=>c.id===r)?.name:t.organization.name,a=r?f(await e.projects.list({organizationId:r}),"Failed to fetch projects",n).projects:[];return{activeOrganizationId:r,activeOrganizationName:i,activeProjectId:Ex(a,o),projects:a}},Ex=(e,t)=>{if(t&&e.some((o)=>o.id===t))return t;return e[0]?.id},Ux=({credential:e,activeOrganizationName:t,activeProjectId:o,projects:n})=>{if(e.credentialType==="user"){ne({Type:"User token",User:e.user.name??e.user.email,Organizations:e.organizations.length.toString(),"Active Organization":t??"(none)","Active Project":n.find((r)=>r.id===o)?.name??"(none)"});return}if(e.credentialType==="secret"){ne({Type:"Secret key",Organization:e.organization.name,"Key Name":e.keyName,"Active Project":n.find((r)=>r.id===o)?.name??"(none)"});return}ne({Type:"Partner key",Superorganization:e.superorganization.name})},Fy=(e,t)=>{return ht({cliFlag:t,globalUrl:e.apiBaseUrl,globalDomain:e.apiDomain,buildUrlFromDomain:(o)=>`https://api.${o}`,defaultUrl:"https://api.sazabi.com"})},UO=(e,t)=>{if(t)return t;try{let o=new URL(e);if(["localhost","127.0.0.1"].includes(o.hostname)&&["15005","15009"].includes(o.port))return o.port="15001",o.toString().replace(/\/$/,"");if(o.hostname==="api.sazabi.com")return o.hostname="api.platform.sazabi.com",o.toString().replace(/\/$/,"");if(o.hostname==="api.staging.sazabi.dev")return o.hostname="api.platform.staging.sazabi.dev",o.toString().replace(/\/$/,"");return o.toString().replace(/\/$/,"")}catch{return e}},RO=(e)=>e.replace(/\/+$/,""),Ke=(e)=>(e?.trim().length??0)>0,Rx=(e)=>{if(!Ke(e))return;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return}},qa=(e)=>{if(!Ke(e))return;try{let o=new URL(e).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(o))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(o))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(o))return"https://app.sazabi.com"}catch{return}return},Kx=(e)=>{if(Ke(e.webBaseUrl))return RO(e.webBaseUrl);if(Ke(e.webDomain))return Ma(e.webDomain);return},Fx=({profile:e,publicApiBaseUrl:t})=>{if(!(Ke(e.authBaseUrl)||Ke(e.apiBaseUrl)||Ke(e.apiDomain)))return;if(Ke(e.authBaseUrl)){let n=qa(e.authBaseUrl);if(n)return n}return qa(t)},KO=({profile:e,publicApiBaseUrl:t,authBaseUrl:o,apiBaseUrlOverride:n,authBaseUrlOverride:r,webBaseUrlOverride:i,verificationUriComplete:a})=>{if(Ke(i))return RO(i);let c=process.env.SAZABI_API_URL?.trim(),u=Ke(r)||Ke(n)||Ke(c),h=Rx(a);if(u){let b=Ke(r)?qa(o):qa(t);if(b)return b;if(h)return h}let s=Kx(e);if(s)return s;let g=Fx({profile:e,publicApiBaseUrl:t});if(g)return g;if(h)return h;return"https://app.sazabi.com"},Gx=(e,t)=>{if(!t)return e;try{let o=new URL(e),n=new URL(t);return o.protocol=n.protocol,o.host=n.host,o.toString()}catch{return e}},FO=W("auth","Manage authentication credentials").withSubcommands({signup:P("signup","Create a new Sazabi account via browser",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Cx({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...q,"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:P("login","Authenticate via browser",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await xx({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...q,"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:P("save","Save an existing bearer token",async(e)=>{let{values:t,positionals:o}=T(e,{...V,"web-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Token is required.");return p("Token is required.")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await Lx(n,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({...q,"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:P("logout","Remove saved credentials",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}zx({json:t.json})}).withOptions(q).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:P("whoami","Display current authentication context",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Nx({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(q).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();B();var GO=()=>`
|
|
4165
4282
|
_sazabi() {
|
|
4166
4283
|
local -a completions
|
|
4167
4284
|
local line IFS=$'\\n'
|
|
@@ -4181,7 +4298,7 @@ _sazabi() {
|
|
|
4181
4298
|
}
|
|
4182
4299
|
|
|
4183
4300
|
compdef _sazabi sazabi
|
|
4184
|
-
`.trim(),
|
|
4301
|
+
`.trim(),BO=()=>`
|
|
4185
4302
|
_sazabi() {
|
|
4186
4303
|
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
4187
4304
|
local IFS=$'\\n'
|
|
@@ -4200,11 +4317,11 @@ _sazabi() {
|
|
|
4200
4317
|
}
|
|
4201
4318
|
|
|
4202
4319
|
complete -F _sazabi sazabi
|
|
4203
|
-
`.trim();var Fx=async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}}),o=BO();if(t.json){j({shell:"zsh",script:o});return}console.log(o)},Jx=async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}}),o=FO();if(t.json){j({shell:"bash",script:o});return}console.log(o)},JO=W("completions","Shell completion scripts").withSubcommands({zsh:P("zsh","Output zsh completion script",Fx).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions zsh)" # Add to .zshrc']).build(),bash:P("bash","Output bash completion script",Jx).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions bash)" # Add to .bashrc']).build()}).withExamples(['eval "$(sazabi completions zsh)" # Enable zsh completions','eval "$(sazabi completions bash)" # Enable bash completions']).build();F();re();X();var Hx={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}}},Mx={schema:Hx,columns:["id","name"],header:"Data source types",emptyMessage:"No data source types found."},HO={id:{label:"ID",type:{kind:"string"}},dataSourceType:{label:"Type",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},projectId:{label:"Project",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}}},Vx={schema:HO,columns:["id","dataSourceType","displayName","createdAt"],header:"Connections",emptyMessage:"No data source connections found."},qx={layout:"field-list",schema:HO,fields:["id","dataSourceType","displayName","projectId","createdAt"],title:"Connection"},MO={id:{label:"ID",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"string"}},connectionId:{label:"Connection",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},errorMessage:{label:"Error",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},Wx={schema:MO,columns:["id","displayName","status","errorMessage","createdAt"],header:"Streams",emptyMessage:"No streams found for this connection."},Yx={layout:"field-list",schema:MO,fields:["id","connectionId","displayName","status","errorMessage","createdAt"],title:"Stream"},gt=(e)=>{let t=e.json,o=N({tokenFlag:e.token,jsonMode:t});return{client:L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Xx=async(e)=>{let{values:t}=T(e,V),{client:o,json:n}=gt(t),{types:r}=f(await o.dataSources.listTypes(),"Failed to list data source types",n),i=[...r].sort((a,c)=>a.name.localeCompare(c.name));M(Mx,i,{json:n})},Zx=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"},"project-id":{type:"string"}}),{client:o,json:n}=gt(t),{connections:r}=f(await o.dataSources.connections.list({projectId:t["project-id"],dataSourceType:t.type}),"Failed to list connections",n);M(Vx,r,{json:n})},Qx=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Connection ID is required.");return p("Connection ID is required.")}let{client:r,json:i}=gt(t),{connection:a}=f(await r.dataSources.connections.get(n),"Failed to get connection",i);U(qx,a,{json:i})},ez=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"},metadata:{type:"string"},"display-name":{type:"string"},"project-id":{type:"string"}});if(!t.type){if(t.json)return v("--type is required.");return p("--type is required. Use 'sazabi data-sources types' to see available types.")}if(!t.metadata){if(t.json)return v("--metadata is required.");return p("--metadata is required. Pass a JSON object with the required fields.")}let o;try{o=JSON.parse(t.metadata)}catch{if(t.json)return v("--metadata must be valid JSON.");return p("--metadata must be valid JSON.")}let{client:n,json:r}=gt(t),i=f(await n.dataSources.connections.create({dataSourceType:t.type,metadata:o,displayName:t["display-name"],projectId:t["project-id"]}),"Failed to create connection",r);if(r){j(i);return}H("Connection created."),ne({"Connection ID":i.connectionId,"Public key":i.publicKey})},tz=async(e)=>{let{values:t}=T(e,{...V,"connection-id":{type:"string"}});if(!t["connection-id"]){if(t.json)return v("--connection-id is required.");return p("--connection-id is required.")}let{client:o,json:n}=gt(t),{streams:r}=f(await o.dataSources.streams.list(t["connection-id"]),"Failed to list streams",n);M(Wx,r,{json:n})},rz=async(e)=>{let{values:t}=T(e,{...V,"connection-id":{type:"string"},"display-name":{type:"string"},config:{type:"string"}});if(!t["connection-id"]){if(t.json)return v("--connection-id is required.");return p("--connection-id is required.")}if(!t["display-name"]){if(t.json)return v("--display-name is required.");return p("--display-name is required.")}let o={};if(t.config)try{o=JSON.parse(t.config)}catch{if(t.json)return v("--config must be valid JSON.");return p("--config must be valid JSON.")}let{client:n,json:r}=gt(t),i=f(await n.dataSources.streams.create({connectionId:t["connection-id"],displayName:t["display-name"],config:o}),"Failed to create stream",r);if(r){j(i);return}H("Stream created. Provisioning started."),ne(i.publicKey?{"Stream ID":i.streamId,"Public key":i.publicKey}:{"Stream ID":i.streamId})},oz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Stream ID is required.");return p("Stream ID is required.")}let{client:r,json:i}=gt(t),{stream:a}=f(await r.dataSources.streams.get(n),"Failed to get stream",i);U(Yx,a,{json:i})},nz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Stream ID is required.");return p("Stream ID is required.")}let{client:r,json:i}=gt(t),a=f(await r.dataSources.streams.delete(n),"Failed to remove stream",i);if(i){j(a);return}H("Stream removed.")},iz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Connection ID is required.");return p("Connection ID is required.")}let{client:r,json:i}=gt(t),a=f(await r.dataSources.connections.disconnect(n),"Failed to disconnect connection",i);if(i){j(a);return}if(a.connectionTeardownError){Ge(`Connection disconnected, but remote cleanup failed: ${a.connectionTeardownError}`);return}H("Connection disconnected.")},az=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"}});if(!t.type){if(t.json)return v("--type is required.");return p("--type is required. Use 'sazabi data-sources types' to see types with skills.")}let{client:o,json:n}=gt(t),{types:r}=f(await o.dataSources.listTypes(),"Failed to list data source types",n),i=r.find((a)=>a.id===t.type);if(!i){if(n)return v(`Unknown data source type: ${t.type}`);return p(`Unknown data source type: ${t.type}`)}if(!i.setupSkill){if(n)return v(`No setup skill available for ${t.type}.`);return p(`No setup skill available for ${t.type}. This data source does not have an agent-ready skill yet.`)}if(n){j({type:t.type,setupSkill:i.setupSkill});return}Y(i.setupSkill)},VO=W("data-sources","Manage data source connections and streams").withSubcommands({types:P("types","List supported data source types",Xx).withOptions(q).withExamples(["sazabi data-sources types # List all types","sazabi data-sources types --json # Output as JSON"]).build(),connections:P("connections","Manage data source connections").withSubcommands({list:P("list","List data source connections",Zx).withOptions({...q,type:{type:"string",description:"Filter by data source type"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type"]).build(),get:P("get","Get one data source connection",Qx).withPositionalArgs("<connection-id>").withOptions(q).withExamples(["sazabi data-sources connections get <id> # Get connection details"]).build(),create:P("create","Create a data source connection",ez).withOptions({...q,type:{type:"string",description:"Data source type (required)"},metadata:{type:"string",description:"JSON metadata (required)"},"display-name":{type:"string",description:"Human-readable name"},"project-id":{type:"string",description:"Project ID"}}).withExamples([`sazabi data-sources connections create --type fly_io --metadata '{"apiToken":"..."}' # Create Fly.io connection`]).build(),disconnect:P("disconnect","Disconnect a data source connection",iz).withPositionalArgs("<connection-id>").withOptions(q).withExamples(["sazabi data-sources connections disconnect <id> # Disconnect connection"]).build()}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type","sazabi data-sources connections disconnect <id> # Disconnect a connection"]).build(),streams:P("streams","Manage data source streams").withSubcommands({list:P("list","List streams for a connection",tz).withOptions({...q,"connection-id":{type:"string",description:"Connection ID (required)"}}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams"]).build(),get:P("get","Get one stream (check provisioning status)",oz).withPositionalArgs("<stream-id>").withOptions(q).withExamples(["sazabi data-sources streams get <id> # Check stream status"]).build(),create:P("create","Create a stream for a connection",rz).withOptions({...q,"connection-id":{type:"string",description:"Connection ID (required)"},"display-name":{type:"string",description:"Resource name (required)"},config:{type:"string",description:"JSON stream config"}}).withExamples(['sazabi data-sources streams create --connection-id <id> --display-name "my-app" # Create stream']).build(),remove:P("remove","Remove a stream from a connection",nz).withPositionalArgs("<stream-id>").withOptions(q).withExamples(["sazabi data-sources streams remove <id> # Remove a stream"]).build()}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams","sazabi data-sources streams remove <id> # Remove a stream"]).build(),skill:P("skill","Show setup skill for a data source type",az).withOptions({...q,type:{type:"string",description:"Data source type (required)"}}).withExamples(["sazabi data-sources skill --type gcp # Show GCP setup skill","sazabi data-sources skill --type fly_io # Show Fly.io setup skill"]).build()}).withExamples(["sazabi data-sources types # List available types","sazabi data-sources connections create --type fly_io --metadata '{...}' # Create connection","sazabi data-sources streams list --connection-id <id> # List streams","sazabi data-sources skill --type gcp # Show agent setup skill"]).build();F();re();X();var qO={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},severity:{label:"Severity",type:{kind:"severity"}},createdAt:{label:"Created",type:{kind:"date"}},resolvedAt:{label:"Resolved",type:{kind:"nullable-date"}},mutedAt:{label:"Muted",type:{kind:"nullable-date"}},whatHappened:{label:"What Happened",type:{kind:"nullable-string"}},whyItHappened:{label:"Why It Happened",type:{kind:"nullable-string"}},howToFix:{label:"How To Fix",type:{kind:"nullable-string"}}},cz={schema:qO,columns:["id","name","status","severity","createdAt"],header:"Issues",emptyMessage:"No issues found."},Wa={layout:"sections",schema:qO,primary:{title:"Issue",fields:["id","name","status","severity","createdAt","resolvedAt","mutedAt"]},secondary:[{title:"What Happened",field:"whatHappened"},{title:"Why It Happened",field:"whyItHappened"},{title:"How To Fix",field:"howToFix"}]},lz=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.issues.list({status:e.status,severity:e.severity,statusComponentId:e.statusComponentId,limit:e.limit,cursor:e.cursor}),"Failed to list issues",e.json);M(cz,n.issues,{json:e.json,nextCursor:n.nextCursor})},uz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.get(e),"Failed to get issue",t.json);U(Wa,r.issue,{json:t.json})},hz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.resolve(e),"Failed to resolve issue",t.json);U(Wa,r.issue,{json:t.json})},gz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.ignore(e),"Failed to ignore issue",t.json);U(Wa,r.issue,{json:t.json})},dz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.unignore(e),"Failed to unignore issue",t.json);U(Wa,r.issue,{json:t.json})},WO=W("issues","Manage issues").withSubcommands({list:P("list","List issues in the active project",async(e)=>{let{values:t}=T(e,{...V,status:{type:"string"},severity:{type:"string"},"status-component":{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),o=["open","resolved","ignored"];if(t.status&&!o.includes(t.status)){let i=`Invalid --status "${t.status}". Must be one of: ${o.join(", ")}.`;if(t.json)return v(i);return p(i)}let n=["low","medium","high","critical"];if(t.severity&&!n.includes(t.severity)){let i=`Invalid --severity "${t.severity}". Must be one of: ${n.join(", ")}.`;if(t.json)return v(i);return p(i)}let r=t.limit?Number(t.limit):void 0;if(r!==void 0&&(Number.isNaN(r)||r<1||r>100)){if(t.json)return v("Invalid --limit. Must be an integer between 1 and 100.");return p("Invalid --limit. Must be an integer between 1 and 100.")}await lz({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],status:t.status,severity:t.severity,statusComponentId:t["status-component"],limit:r,cursor:t.cursor})}).withOptions({...q,status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},"status-component":{type:"string",description:"Filter by status component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi issues list # List all issues","sazabi issues list --status open # List open issues only","sazabi issues list --status-component <component-id> # List issues for a component"]).build(),get:P("get","Get one issue by ID",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await uz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues get <issue-id> # Get one issue"]).build(),resolve:P("resolve","Resolve an open issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await hz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues resolve <issue-id> # Resolve an issue"]).build(),ignore:P("ignore","Ignore an issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await gz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues ignore <issue-id> # Ignore an issue"]).build(),unignore:P("unignore","Unmute an issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await dz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues unignore <issue-id> # Unmute an issue"]).build()}).withExamples(["sazabi issues list # List all issues","sazabi issues get <issue-id> # Get one issue","sazabi issues resolve <issue-id> # Resolve an issue","sazabi issues ignore <issue-id> # Ignore an issue","sazabi issues unignore <issue-id> # Unmute an issue"]).build();F();re();X();var sz=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:e==="public"?t.projectId:void 0,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:e==="public"?o.projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(e==="public"){let i=f(await n.publicKeys.list({projectId:o.projectId,limit:t.limit,cursor:t.cursor}),"Failed to list public keys",t.json);M(YO(e),i.publicKeys.map((a)=>_t(e,a)),{json:t.json,nextCursor:i.nextCursor});return}let r=f(await n.secretKeys.list({limit:t.limit,cursor:t.cursor}),"Failed to list secret keys",t.json);M(YO(e),r.secretKeys.map((i)=>_t(e,i)),{json:t.json,nextCursor:r.nextCursor})},bz=async(e,t,o)=>{let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json});if(e==="public"){let a=f(await r.publicKeys.get(t,n.projectId),"Failed to get public key",o.json);U(or(e),_t(e,a.publicKey),{json:o.json});return}let i=f(await r.secretKeys.get(t),"Failed to get secret key",o.json);U(or(e),_t(e,i.secretKey),{json:o.json})},yz=async(e,t,o)=>{let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json});if(e==="public"){let c={projectId:n.projectId,name:t,...o.expiresAt?{expiresAt:o.expiresAt}:{}},u=f(await r.publicKeys.create(c),"Failed to create public key",o.json);if(o.json){j(u);return}H(`Created public key ${u.publicKey.name}.`),ne({Value:u.publicKey.value}),U(or(e),{..._t(e,u.publicKey)});return}let i={name:t,...o.expiresAt?{expiresAt:o.expiresAt}:{}},a=f(await r.secretKeys.create(i),"Failed to create secret key",o.json);if(o.json){j(a);return}H(`Created secret key ${a.secretKey.name}.`),ne({Value:a.secretKey.value}),U(or(e),{..._t(e,a.secretKey)})},mz=async(e,t,o)=>{if(o.name===void 0&&o.expiresAt===void 0&&!o.clearExpiresAt){if(o.json)return v("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.");return p("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.")}if(o.expiresAt&&o.clearExpiresAt){if(o.json)return v("Use either --expires-at or --clear-expires-at, not both.");return p("Use either --expires-at or --clear-expires-at, not both.")}let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json}),i=o.clearExpiresAt?null:o.expiresAt!==void 0?o.expiresAt:void 0;if(e==="public"){let u={projectId:n.projectId,keyId:t,...o.name!==void 0?{name:o.name}:{},...i!==void 0?{expiresAt:i}:{}},h=f(await r.publicKeys.update(u),"Failed to update public key",o.json);U(or(e),_t(e,h.publicKey),{json:o.json});return}let a={keyId:t,...o.name!==void 0?{name:o.name}:{},...i!==void 0?{expiresAt:i}:{}},c=f(await r.secretKeys.update(a),"Failed to update secret key",o.json);U(or(e),_t(e,c.secretKey),{json:o.json})},pz=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.projectId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.publicKeys.deactivate({projectId:o.projectId,keyId:e}),"Failed to deactivate public key",t.json);if(!t.json)H(`Deactivated public key ${e}.`);U(or("public"),_t("public",r.publicKey),{json:t.json})},vz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(f(await n.secretKeys.delete({keyId:e}),"Failed to delete secret key",t.json),t.json){j({deleted:!0,keyId:e});return}H(`Deleted secret key ${e}.`)},XO=(e)=>{let t=Iz(e),o=By(e),n=`${o} Keys`,r=e==="secret",i=r?"the organization":"the active project",a={token:{type:"string"},"project-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},h=r?{token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}:{token:{type:"string",description:"Override token"},"project-id":{type:"string",description:"Override project selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}};return W(t,`Manage ${e} API keys`).withSubcommands({list:P("list",`List ${e} keys in ${i}`,async(d)=>{let{values:g,positionals:b}=T(d,{...a,limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0});if(b.length>0){let y=b.join(", ");if(g.json)return v(`Unexpected arguments: ${y}`);return p(`Unexpected arguments: ${y}`)}await sz(e,{token:g.token,projectId:g["project-id"],limit:g.limit?Number(g.limit):void 0,cursor:g.cursor,json:g.json,apiBaseUrl:g["api-base-url"]})}).withOptions({...h,limit:{type:"string",description:"Maximum number of keys to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples([`sazabi ${t} list # List ${e} keys in ${i}`]).build(),get:P("get",`Get one ${e} key by ID`,async(d)=>{let{values:g,positionals:b}=T(d,a,{allowPositionals:!0}),y=b[0];if(!y){let _=`${o} key ID is required.`;if(g.json)return v(_);return p(_)}await bz(e,y,{token:g.token,projectId:g["project-id"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} get <key-id> # Get one ${e} key`]).build(),create:P("create",`Create one ${e} key in ${i}`,async(d)=>{let{values:g,positionals:b}=T(d,{...a,"expires-at":{type:"string"}},{allowPositionals:!0}),y=b.join(" ");if(!y){let _=`${o} key name is required.`;if(g.json)return v(_);return p(_)}await yz(e,y,{token:g.token,projectId:g["project-id"],expiresAt:g["expires-at"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<name>").withOptions({...h,"expires-at":{type:"string",description:"Optional ISO timestamp when the key should expire"}}).withExamples([`sazabi ${t} create "CI agent" # Create one ${e} key`]).build(),update:P("update",`Update one ${e} key in ${i}`,async(d)=>{let{values:g,positionals:b}=T(d,{...a,name:{type:"string"},"expires-at":{type:"string"},"clear-expires-at":{type:"boolean"}},{allowPositionals:!0}),y=b[0];if(!y){let _=`${o} key ID is required.`;if(g.json)return v(_);return p(_)}await mz(e,y,{token:g.token,projectId:g["project-id"],name:g.name,expiresAt:g["expires-at"],clearExpiresAt:g["clear-expires-at"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions({...h,name:{type:"string",description:`New ${e} key name`},"expires-at":{type:"string",description:"New ISO timestamp when the key should expire"},"clear-expires-at":{type:"boolean",description:"Clear any configured expiration"}}).withExamples([`sazabi ${t} update <key-id> --name "Renamed key" # Update one ${e} key`]).build(),...e==="public"?{deactivate:P("deactivate",`Deactivate one public key in ${i}`,async(d)=>{let{values:g,positionals:b}=T(d,a,{allowPositionals:!0}),y=b[0];if(!y){if(g.json)return v("Public key ID is required.");return p("Public key ID is required.")}await pz(y,{token:g.token,projectId:g["project-id"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} deactivate <key-id> # Deactivate one public key`]).build()}:{delete:P("delete",`Delete one secret key from ${i}`,async(d)=>{let{values:g,positionals:b}=T(d,a,{allowPositionals:!0}),y=b[0];if(!y){if(g.json)return v("Secret key ID is required.");return p("Secret key ID is required.")}await vz(y,{token:g.token,json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} delete <key-id> # Delete one secret key`]).build()}}).withExamples([`sazabi ${t} list # List ${e} keys in ${i}`,`sazabi ${t} create "CI agent" # Create one ${e} key`]).build()},ZO={keyType:{label:"Type",type:{kind:"string"}},id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},expiresAt:{label:"Expires",type:{kind:"nullable-date"}},lastUsedAt:{label:"Last Used",type:{kind:"nullable-date"}},createdAt:{label:"Created",type:{kind:"date"}}},YO=(e)=>({schema:ZO,columns:e==="public"?["id","name","status","expiresAt","lastUsedAt","createdAt"]:["id","name","expiresAt","lastUsedAt","createdAt"],header:`${By(e)} Keys`,emptyMessage:`No ${e} keys found.`}),or=(e)=>({layout:"field-list",schema:ZO,fields:e==="public"?["keyType","id","projectId","name","status","expiresAt","lastUsedAt","createdAt"]:["keyType","id","name","expiresAt","lastUsedAt","createdAt"]}),Iz=(e)=>{return e==="public"?"public-keys":"secret-keys"},By=(e)=>{return e==="public"?"Public":"Secret"},_t=(e,t)=>{let o=e==="public"&&"deactivatedAt"in t&&t.deactivatedAt!==null;return{...t,keyType:`${By(e)} key`,status:o?"Deactivated":"Active"}},QO=XO("public"),eS=XO("secret");F();F();var Se=(e,t,o,n,r)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>o){let a=`${n} must be between ${t} and ${o}`;if(r)return v(a);return p(a)}return i},dt=(e,t,o,n)=>{if(!t.includes(e)){let r=t.map((a)=>`"${a}"`).join(" or "),i=`${o} must be ${r}`;if(n)return v(i);return p(i)}return e};F();Sy();In();re();import*as st from"node:fs";import*as Xa from"node:readline";var Ya=(e)=>new Promise((t)=>setTimeout(t,e));var fz=(e)=>{return`${e.getTime()*1e6}`},tS=(e,t)=>{let n=fz(new Date),r=e.filter((i)=>i.trim().length>0).map((i)=>({timeUnixNano:n,observedTimeUnixNano:n,severityNumber:9,severityText:"INFO",body:{stringValue:i},attributes:[]}));return{resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:"sazabi-cli"}},{key:"sazabi.public_key",value:{stringValue:t}}]},scopeLogs:[{scope:{name:"sazabi-cli-forward",version:"1.0.0"},logRecords:r}]}]}};X();Ve();var kz="15003",$z=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},wz=(e)=>{let t=$z(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},_z=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!wz(t.hostname))return;return t.protocol="http:",t.port=kz,t.pathname="",t.search="",t.hash="",t.toString()},Oz=async(e,t)=>{if(!t)Y("Ensuring public key exists...");let o=await e.publicKeys.create({name:"sazabi-cli-forward"});if(!o.success){if(!t)Tt(`Failed to create public key: ${o.error}`);return null}if(!t)H(`Created new public key: ${o.value.publicKey.name}`);return o.value.publicKey.value},Fy=(e,t,o,n,r,i,a,c)=>{return async()=>{if(e.length===0)return;let u=tS(e,n),h=Az(u);if(e.length=0,h===0)return;if(!a)Y(`Forwarding ${h} logs...`);let d=await o.logs.forward({publicKey:n,logs:u,region:r,...i?{projectId:i}:{}});if(!d.success){if(Dz(d)){f(d,"Failed to forward logs",a);return}if(t.totalFailed+=h,!a)Ge(`Failed to forward logs: ${d.error}`);c?.({forwarded:0,failed:h});return}t.totalForwarded+=d.value.forwardedCount,t.totalFailed+=d.value.failedCount,c?.({forwarded:d.value.forwardedCount,failed:d.value.failedCount})}},Sz=async(e,t,o,n,r,i,a,c)=>{let u=st.createReadStream(e),h=Xa.createInterface({input:u,crlfDelay:Number.POSITIVE_INFINITY}),d=[],g={totalForwarded:0,totalFailed:0},b=Fy(d,g,t,o,n,r,a,(y)=>c?.push(y));try{for await(let y of h)if(d.push(y),d.length>=i)await b()}catch(y){Tt(`Failed to read ${e}: ${y instanceof Error?y.message:String(y)}`);return}if(await b(),a);else if(R(),Bt(ae.muted("─".repeat(80))),H(`Forwarded ${g.totalForwarded} logs`),g.totalFailed>0)Ge(`Failed to forward ${g.totalFailed} logs`)},Tz=async(e,t,o,n,r,i,a)=>{let c=Xa.createInterface({input:process.stdin,output:process.stdout,terminal:!1}),u=[],h={totalForwarded:0,totalFailed:0},d=Fy(u,h,e,t,o,n,i,(g)=>a?.push(g));try{for await(let g of c)if(u.push(g),u.length>=r)await d()}catch(g){Tt(`Failed to read from stdin: ${g instanceof Error?g.message:String(g)}`);return}if(await d(),i);else if(R(),Bt(ae.muted("─".repeat(80))),H(`Forwarded ${h.totalForwarded} logs`),h.totalFailed>0)Ge(`Failed to forward ${h.totalFailed} logs`)},Pz=async(e,t,o,n,r,i,a,c)=>{let u=[],h={totalForwarded:0,totalFailed:0},d=Fy(u,h,t,o,n,r,a,(oe)=>c?.push(oe)),g=null,b=null,y=async()=>{if(b)clearTimeout(b);if(g)g.close();if(await d(),a);else if(R(),Bt(ae.muted("─".repeat(80))),H(`Forwarded ${h.totalForwarded} logs`),h.totalFailed>0)Ge(`Failed to forward ${h.totalFailed} logs`)};process.on("SIGINT",async()=>{R(),Y("Interrupted, flushing remaining logs..."),await y(),process.exit(0)});let _=null,S=null,J=!1,G=0,le=async()=>{if(J)return;J=!0;try{if((await st.promises.stat(e)).size<G)G=0;_=st.createReadStream(e,{encoding:"utf8",start:G}),S=Xa.createInterface({input:_,crlfDelay:Number.POSITIVE_INFINITY});for await(let Te of S)if(u.push(Te),u.length>=i)await d();G=(await st.promises.stat(e)).size}catch(oe){Tt(`Failed to read ${e}: ${oe instanceof Error?oe.message:String(oe)}`)}finally{J=!1}};await le(),g=st.watch(e,async(oe)=>{if(oe==="change"){if(b)clearTimeout(b);b=setTimeout(async()=>{if(J)return;if(_)_.close();if(S)S.close();await Ya(50),await le()},100)}})},rS=async(e)=>{let t=e.batchSize??100;if(t<=0){if(e.json)return v("Batch size must be a positive number");throw p("Batch size must be a positive number"),Error("Unreachable")}if(e.follow&&!e.file){if(e.json)return v("--follow flag requires --file to be specified");throw p("--follow flag requires --file to be specified"),Error("Unreachable")}let o=(()=>{let S=ie();if(!S.success)throw p(`Failed to read settings: ${S.error}`),Error("Unreachable");return S.value})(),n=f(Ze(o),"Failed to resolve profile"),r=e.json===!0,i=N({tokenFlag:e.token,jsonMode:r}),a=ht({cliFlag:e.apiBaseUrl,globalUrl:n.apiBaseUrl,globalDomain:n.apiDomain,buildUrlFromDomain:(S)=>`https://api.${S}`,defaultUrl:"https://api.sazabi.com"});if(!r)ce("Forwarding logs...");let c=await Ma({token:i.token,projectId:i.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:r});if(!r)Y(`Project: ${c.name}`);let u;if(e.region)u=Nz(e.region,r);else u=c.region;if(!r)Y(`Region: ${u}`);if(!r)Y(`Batch size: ${t}`);let h=e.intakeBaseUrl??n.intakeBaseUrl??_z(a)??(n.intakeDomain?CO(n.intakeDomain,u):void 0)??`https://otlp.${u}.intake.sazabi.com`;try{let S=new URL(h);if(!r&&/\.intake\.sazabi\.(dev|com)$/.test(S.host)&&!S.host.startsWith("otlp."))Ge("Intake base URL may not be the OTLP endpoint. For Sazabi, prefer https://otlp.{region}.intake.sazabi.dev or .com as appropriate.")}catch{}let d=ft({token:i.token,projectId:i.projectId,baseUrl:a,intakeBaseUrl:h}),g=e.publicKey?.trim()||n.forwardPublicKey?.trim()||void 0;if(!g){let S=await Oz(d,r);if(!S)throw p("Failed to get or create public key"),Error("Unreachable");g=S;let J=Re(o,{forwardPublicKey:g});if(J.success){let G=me(J.value);if(!G.success)Ge(`Failed to store public key: ${G.error}`)}}if(!r)R(),Bt(ae.muted("─".repeat(80))),R();let b=!e.follow,y=[],_={forwarded:0,failed:0};if(e.follow&&e.file)await Pz(e.file,d,g,u,i.projectId,t,r,b?y:void 0);else if(e.file)await Sz(e.file,d,g,u,i.projectId,t,r,y);else await Tz(d,g,u,i.projectId,t,r,y);for(let S of y)_.forwarded+=S.forwarded,_.failed+=S.failed;if(r){let S={forwardedCount:_.forwarded,failedCount:_.failed,batches:y,project:{id:c.id,name:c.name,region:u},intakeBaseUrl:h,batchSize:t,follow:Boolean(e.follow),file:e.file??void 0};console.log(JSON.stringify(S))}},Az=(e)=>{return e.resourceLogs?.reduce((t,o)=>t+(o.scopeLogs?.reduce((n,r)=>n+(r.logRecords?.length??0),0)??0),0)??0},Dz=(e)=>{if(e.success)return!1;if(e.errorPayload)return!0;if(e.statusCode!==void 0&&e.statusCode<500)return!0;return e.error.startsWith("Authentication failed")||e.error.startsWith("Client error (")},Nz=(e,t)=>{let o=Ka.safeParse(e);if(o.success)return o.data;let n=`Invalid region: ${e}.`;if(t)return v(n);return p(n)};F();re();X();import{readFile as Lz}from"node:fs/promises";var Cz={result:{label:"Result",type:{kind:"string"}},format:{label:"Format",type:{kind:"string"}},meta:{label:"Meta",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}}},xz={layout:"field-list",schema:Cz,fields:["result","format","meta"]},oS=async(e)=>{if(!e.query&&!e.file){if(e.json)return v("Pass --query or --file");return p("Pass --query or --file")}if(e.query&&e.file){if(e.json)return v("Pass either --query or --file, not both");return p("Pass either --query or --file, not both")}let t;if(e.query!==void 0)t=e.query;else try{t=await Lz(e.file,"utf8")}catch(i){let a=`Failed to read query file: ${i instanceof Error?i.message:String(i)}`;if(e.json)return v(a);return p(a)}if(t.trim().length===0){if(e.json)return v("Query cannot be empty");return p("Query cannot be empty")}let o=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),r=f(await n.logs.nativeQuery({query:t}),"Failed to run native log query",e.json);if(e.json){U(xz,r,{json:!0});return}Y(`Backend ${r.meta.backendId} returned ${r.result.length} characters in ${r.meta.took}ms${r.meta.truncated?" (truncated)":""}`),process.stdout.write(r.result.endsWith(`
|
|
4320
|
+
`.trim();var Bx=async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}}),o=GO();if(t.json){j({shell:"zsh",script:o});return}console.log(o)},Hx=async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}}),o=BO();if(t.json){j({shell:"bash",script:o});return}console.log(o)},HO=W("completions","Shell completion scripts").withSubcommands({zsh:P("zsh","Output zsh completion script",Bx).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions zsh)" # Add to .zshrc']).build(),bash:P("bash","Output bash completion script",Hx).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions bash)" # Add to .bashrc']).build()}).withExamples(['eval "$(sazabi completions zsh)" # Enable zsh completions','eval "$(sazabi completions bash)" # Enable bash completions']).build();B();re();X();var Mx={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}}},Jx={schema:Mx,columns:["id","name"],header:"Data source types",emptyMessage:"No data source types found."},MO={id:{label:"ID",type:{kind:"string"}},dataSourceType:{label:"Type",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},projectId:{label:"Project",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}}},Vx={schema:MO,columns:["id","dataSourceType","displayName","createdAt"],header:"Connections",emptyMessage:"No data source connections found."},qx={layout:"field-list",schema:MO,fields:["id","dataSourceType","displayName","projectId","createdAt"],title:"Connection"},JO={id:{label:"ID",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"string"}},connectionId:{label:"Connection",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},errorMessage:{label:"Error",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},Wx={schema:JO,columns:["id","displayName","status","errorMessage","createdAt"],header:"Streams",emptyMessage:"No streams found for this connection."},Yx={layout:"field-list",schema:JO,fields:["id","connectionId","displayName","status","errorMessage","createdAt"],title:"Stream"},gt=(e)=>{let t=e.json,o=N({tokenFlag:e.token,jsonMode:t});return{client:L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Xx=async(e)=>{let{values:t}=T(e,V),{client:o,json:n}=gt(t),{types:r}=f(await o.dataSources.listTypes(),"Failed to list data source types",n),i=[...r].sort((a,c)=>a.name.localeCompare(c.name));J(Jx,i,{json:n})},Zx=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"},"project-id":{type:"string"}}),{client:o,json:n}=gt(t),{connections:r}=f(await o.dataSources.connections.list({projectId:t["project-id"],dataSourceType:t.type}),"Failed to list connections",n);J(Vx,r,{json:n})},Qx=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Connection ID is required.");return p("Connection ID is required.")}let{client:r,json:i}=gt(t),{connection:a}=f(await r.dataSources.connections.get(n),"Failed to get connection",i);U(qx,a,{json:i})},ez=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"},metadata:{type:"string"},"display-name":{type:"string"},"project-id":{type:"string"}});if(!t.type){if(t.json)return v("--type is required.");return p("--type is required. Use 'sazabi data-sources types' to see available types.")}if(!t.metadata){if(t.json)return v("--metadata is required.");return p("--metadata is required. Pass a JSON object with the required fields.")}let o;try{o=JSON.parse(t.metadata)}catch{if(t.json)return v("--metadata must be valid JSON.");return p("--metadata must be valid JSON.")}let{client:n,json:r}=gt(t),i=f(await n.dataSources.connections.create({dataSourceType:t.type,metadata:o,displayName:t["display-name"],projectId:t["project-id"]}),"Failed to create connection",r);if(r){j(i);return}M("Connection created."),ne({"Connection ID":i.connectionId,"Public key":i.publicKey})},tz=async(e)=>{let{values:t}=T(e,{...V,"connection-id":{type:"string"}});if(!t["connection-id"]){if(t.json)return v("--connection-id is required.");return p("--connection-id is required.")}let{client:o,json:n}=gt(t),{streams:r}=f(await o.dataSources.streams.list(t["connection-id"]),"Failed to list streams",n);J(Wx,r,{json:n})},rz=async(e)=>{let{values:t}=T(e,{...V,"connection-id":{type:"string"},"display-name":{type:"string"},config:{type:"string"}});if(!t["connection-id"]){if(t.json)return v("--connection-id is required.");return p("--connection-id is required.")}if(!t["display-name"]){if(t.json)return v("--display-name is required.");return p("--display-name is required.")}let o={};if(t.config)try{o=JSON.parse(t.config)}catch{if(t.json)return v("--config must be valid JSON.");return p("--config must be valid JSON.")}let{client:n,json:r}=gt(t),i=f(await n.dataSources.streams.create({connectionId:t["connection-id"],displayName:t["display-name"],config:o}),"Failed to create stream",r);if(r){j(i);return}M("Stream created. Provisioning started."),ne(i.publicKey?{"Stream ID":i.streamId,"Public key":i.publicKey}:{"Stream ID":i.streamId})},oz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Stream ID is required.");return p("Stream ID is required.")}let{client:r,json:i}=gt(t),{stream:a}=f(await r.dataSources.streams.get(n),"Failed to get stream",i);U(Yx,a,{json:i})},nz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Stream ID is required.");return p("Stream ID is required.")}let{client:r,json:i}=gt(t),a=f(await r.dataSources.streams.delete(n),"Failed to remove stream",i);if(i){j(a);return}M("Stream removed.")},iz=async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Connection ID is required.");return p("Connection ID is required.")}let{client:r,json:i}=gt(t),a=f(await r.dataSources.connections.disconnect(n),"Failed to disconnect connection",i);if(i){j(a);return}if(a.connectionTeardownError){Fe(`Connection disconnected, but remote cleanup failed: ${a.connectionTeardownError}`);return}M("Connection disconnected.")},az=async(e)=>{let{values:t}=T(e,{...V,type:{type:"string"}});if(!t.type){if(t.json)return v("--type is required.");return p("--type is required. Use 'sazabi data-sources types' to see types with skills.")}let{client:o,json:n}=gt(t),{types:r}=f(await o.dataSources.listTypes(),"Failed to list data source types",n),i=r.find((a)=>a.id===t.type);if(!i){if(n)return v(`Unknown data source type: ${t.type}`);return p(`Unknown data source type: ${t.type}`)}if(!i.setupSkill){if(n)return v(`No setup skill available for ${t.type}.`);return p(`No setup skill available for ${t.type}. This data source does not have an agent-ready skill yet.`)}if(n){j({type:t.type,setupSkill:i.setupSkill});return}Y(i.setupSkill)},VO=W("data-sources","Manage data source connections and streams").withSubcommands({types:P("types","List supported data source types",Xx).withOptions(q).withExamples(["sazabi data-sources types # List all types","sazabi data-sources types --json # Output as JSON"]).build(),connections:P("connections","Manage data source connections").withSubcommands({list:P("list","List data source connections",Zx).withOptions({...q,type:{type:"string",description:"Filter by data source type"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type"]).build(),get:P("get","Get one data source connection",Qx).withPositionalArgs("<connection-id>").withOptions(q).withExamples(["sazabi data-sources connections get <id> # Get connection details"]).build(),create:P("create","Create a data source connection",ez).withOptions({...q,type:{type:"string",description:"Data source type (required)"},metadata:{type:"string",description:"JSON metadata (required)"},"display-name":{type:"string",description:"Human-readable name"},"project-id":{type:"string",description:"Project ID"}}).withExamples([`sazabi data-sources connections create --type fly_io --metadata '{"apiToken":"..."}' # Create Fly.io connection`]).build(),disconnect:P("disconnect","Disconnect a data source connection",iz).withPositionalArgs("<connection-id>").withOptions(q).withExamples(["sazabi data-sources connections disconnect <id> # Disconnect connection"]).build()}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type","sazabi data-sources connections disconnect <id> # Disconnect a connection"]).build(),streams:P("streams","Manage data source streams").withSubcommands({list:P("list","List streams for a connection",tz).withOptions({...q,"connection-id":{type:"string",description:"Connection ID (required)"}}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams"]).build(),get:P("get","Get one stream (check provisioning status)",oz).withPositionalArgs("<stream-id>").withOptions(q).withExamples(["sazabi data-sources streams get <id> # Check stream status"]).build(),create:P("create","Create a stream for a connection",rz).withOptions({...q,"connection-id":{type:"string",description:"Connection ID (required)"},"display-name":{type:"string",description:"Resource name (required)"},config:{type:"string",description:"JSON stream config"}}).withExamples(['sazabi data-sources streams create --connection-id <id> --display-name "my-app" # Create stream']).build(),remove:P("remove","Remove a stream from a connection",nz).withPositionalArgs("<stream-id>").withOptions(q).withExamples(["sazabi data-sources streams remove <id> # Remove a stream"]).build()}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams","sazabi data-sources streams remove <id> # Remove a stream"]).build(),skill:P("skill","Show setup skill for a data source type",az).withOptions({...q,type:{type:"string",description:"Data source type (required)"}}).withExamples(["sazabi data-sources skill --type gcp # Show GCP setup skill","sazabi data-sources skill --type fly_io # Show Fly.io setup skill"]).build()}).withExamples(["sazabi data-sources types # List available types","sazabi data-sources connections create --type fly_io --metadata '{...}' # Create connection","sazabi data-sources streams list --connection-id <id> # List streams","sazabi data-sources skill --type gcp # Show agent setup skill"]).build();B();re();X();var qO={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},severity:{label:"Severity",type:{kind:"severity"}},createdAt:{label:"Created",type:{kind:"date"}},resolvedAt:{label:"Resolved",type:{kind:"nullable-date"}},mutedAt:{label:"Muted",type:{kind:"nullable-date"}},whatHappened:{label:"What Happened",type:{kind:"nullable-string"}},whyItHappened:{label:"Why It Happened",type:{kind:"nullable-string"}},howToFix:{label:"How To Fix",type:{kind:"nullable-string"}}},cz={schema:qO,columns:["id","name","status","severity","createdAt"],header:"Issues",emptyMessage:"No issues found."},Wa={layout:"sections",schema:qO,primary:{title:"Issue",fields:["id","name","status","severity","createdAt","resolvedAt","mutedAt"]},secondary:[{title:"What Happened",field:"whatHappened"},{title:"Why It Happened",field:"whyItHappened"},{title:"How To Fix",field:"howToFix"}]},lz=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.issues.list({status:e.status,severity:e.severity,statusComponentId:e.statusComponentId,limit:e.limit,cursor:e.cursor}),"Failed to list issues",e.json);J(cz,n.issues,{json:e.json,nextCursor:n.nextCursor})},uz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.get(e),"Failed to get issue",t.json);U(Wa,r.issue,{json:t.json})},hz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.resolve(e),"Failed to resolve issue",t.json);U(Wa,r.issue,{json:t.json})},gz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.ignore(e),"Failed to ignore issue",t.json);U(Wa,r.issue,{json:t.json})},sz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.issues.unignore(e),"Failed to unignore issue",t.json);U(Wa,r.issue,{json:t.json})},WO=W("issues","Manage issues").withSubcommands({list:P("list","List issues in the active project",async(e)=>{let{values:t}=T(e,{...V,status:{type:"string"},severity:{type:"string"},"status-component":{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),o=["open","resolved","ignored"];if(t.status&&!o.includes(t.status)){let i=`Invalid --status "${t.status}". Must be one of: ${o.join(", ")}.`;if(t.json)return v(i);return p(i)}let n=["low","medium","high","critical"];if(t.severity&&!n.includes(t.severity)){let i=`Invalid --severity "${t.severity}". Must be one of: ${n.join(", ")}.`;if(t.json)return v(i);return p(i)}let r=t.limit?Number(t.limit):void 0;if(r!==void 0&&(Number.isNaN(r)||r<1||r>100)){if(t.json)return v("Invalid --limit. Must be an integer between 1 and 100.");return p("Invalid --limit. Must be an integer between 1 and 100.")}await lz({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],status:t.status,severity:t.severity,statusComponentId:t["status-component"],limit:r,cursor:t.cursor})}).withOptions({...q,status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},"status-component":{type:"string",description:"Filter by status component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi issues list # List all issues","sazabi issues list --status open # List open issues only","sazabi issues list --status-component <component-id> # List issues for a component"]).build(),get:P("get","Get one issue by ID",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await uz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues get <issue-id> # Get one issue"]).build(),resolve:P("resolve","Resolve an open issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await hz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues resolve <issue-id> # Resolve an issue"]).build(),ignore:P("ignore","Ignore an issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await gz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues ignore <issue-id> # Ignore an issue"]).build(),unignore:P("unignore","Unmute an issue",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Issue ID is required.");return p("Issue ID is required.")}await sz(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(q).withExamples(["sazabi issues unignore <issue-id> # Unmute an issue"]).build()}).withExamples(["sazabi issues list # List all issues","sazabi issues get <issue-id> # Get one issue","sazabi issues resolve <issue-id> # Resolve an issue","sazabi issues ignore <issue-id> # Ignore an issue","sazabi issues unignore <issue-id> # Unmute an issue"]).build();B();re();X();var dz=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:e==="public"?t.projectId:void 0,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:e==="public"?o.projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(e==="public"){let i=f(await n.publicKeys.list({projectId:o.projectId,limit:t.limit,cursor:t.cursor}),"Failed to list public keys",t.json);J(YO(e),i.publicKeys.map((a)=>_t(e,a)),{json:t.json,nextCursor:i.nextCursor});return}let r=f(await n.secretKeys.list({limit:t.limit,cursor:t.cursor}),"Failed to list secret keys",t.json);J(YO(e),r.secretKeys.map((i)=>_t(e,i)),{json:t.json,nextCursor:r.nextCursor})},bz=async(e,t,o)=>{let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json});if(e==="public"){let a=f(await r.publicKeys.get(t,n.projectId),"Failed to get public key",o.json);U(or(e),_t(e,a.publicKey),{json:o.json});return}let i=f(await r.secretKeys.get(t),"Failed to get secret key",o.json);U(or(e),_t(e,i.secretKey),{json:o.json})},yz=async(e,t,o)=>{let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json});if(e==="public"){let c={projectId:n.projectId,name:t,...o.expiresAt?{expiresAt:o.expiresAt}:{}},u=f(await r.publicKeys.create(c),"Failed to create public key",o.json);if(o.json){j(u);return}M(`Created public key ${u.publicKey.name}.`),ne({Value:u.publicKey.value}),U(or(e),{..._t(e,u.publicKey)});return}let i={name:t,...o.expiresAt?{expiresAt:o.expiresAt}:{}},a=f(await r.secretKeys.create(i),"Failed to create secret key",o.json);if(o.json){j(a);return}M(`Created secret key ${a.secretKey.name}.`),ne({Value:a.secretKey.value}),U(or(e),{..._t(e,a.secretKey)})},mz=async(e,t,o)=>{if(o.name===void 0&&o.expiresAt===void 0&&!o.clearExpiresAt){if(o.json)return v("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.");return p("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.")}if(o.expiresAt&&o.clearExpiresAt){if(o.json)return v("Use either --expires-at or --clear-expires-at, not both.");return p("Use either --expires-at or --clear-expires-at, not both.")}let n=N({tokenFlag:o.token,projectIdFlag:e==="public"?o.projectId:void 0,jsonMode:o.json}),r=L({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:o.apiBaseUrl,jsonMode:o.json}),i=o.clearExpiresAt?null:o.expiresAt!==void 0?o.expiresAt:void 0;if(e==="public"){let u={projectId:n.projectId,keyId:t,...o.name!==void 0?{name:o.name}:{},...i!==void 0?{expiresAt:i}:{}},h=f(await r.publicKeys.update(u),"Failed to update public key",o.json);U(or(e),_t(e,h.publicKey),{json:o.json});return}let a={keyId:t,...o.name!==void 0?{name:o.name}:{},...i!==void 0?{expiresAt:i}:{}},c=f(await r.secretKeys.update(a),"Failed to update secret key",o.json);U(or(e),_t(e,c.secretKey),{json:o.json})},pz=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.projectId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.publicKeys.deactivate({projectId:o.projectId,keyId:e}),"Failed to deactivate public key",t.json);if(!t.json)M(`Deactivated public key ${e}.`);U(or("public"),_t("public",r.publicKey),{json:t.json})},vz=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(f(await n.secretKeys.delete({keyId:e}),"Failed to delete secret key",t.json),t.json){j({deleted:!0,keyId:e});return}M(`Deleted secret key ${e}.`)},XO=(e)=>{let t=Iz(e),o=Gy(e),n=`${o} Keys`,r=e==="secret",i=r?"the organization":"the active project",a={token:{type:"string"},"project-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},h=r?{token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}:{token:{type:"string",description:"Override token"},"project-id":{type:"string",description:"Override project selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}};return W(t,`Manage ${e} API keys`).withSubcommands({list:P("list",`List ${e} keys in ${i}`,async(s)=>{let{values:g,positionals:b}=T(s,{...a,limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0});if(b.length>0){let y=b.join(", ");if(g.json)return v(`Unexpected arguments: ${y}`);return p(`Unexpected arguments: ${y}`)}await dz(e,{token:g.token,projectId:g["project-id"],limit:g.limit?Number(g.limit):void 0,cursor:g.cursor,json:g.json,apiBaseUrl:g["api-base-url"]})}).withOptions({...h,limit:{type:"string",description:"Maximum number of keys to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples([`sazabi ${t} list # List ${e} keys in ${i}`]).build(),get:P("get",`Get one ${e} key by ID`,async(s)=>{let{values:g,positionals:b}=T(s,a,{allowPositionals:!0}),y=b[0];if(!y){let _=`${o} key ID is required.`;if(g.json)return v(_);return p(_)}await bz(e,y,{token:g.token,projectId:g["project-id"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} get <key-id> # Get one ${e} key`]).build(),create:P("create",`Create one ${e} key in ${i}`,async(s)=>{let{values:g,positionals:b}=T(s,{...a,"expires-at":{type:"string"}},{allowPositionals:!0}),y=b.join(" ");if(!y){let _=`${o} key name is required.`;if(g.json)return v(_);return p(_)}await yz(e,y,{token:g.token,projectId:g["project-id"],expiresAt:g["expires-at"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<name>").withOptions({...h,"expires-at":{type:"string",description:"Optional ISO timestamp when the key should expire"}}).withExamples([`sazabi ${t} create "CI agent" # Create one ${e} key`]).build(),update:P("update",`Update one ${e} key in ${i}`,async(s)=>{let{values:g,positionals:b}=T(s,{...a,name:{type:"string"},"expires-at":{type:"string"},"clear-expires-at":{type:"boolean"}},{allowPositionals:!0}),y=b[0];if(!y){let _=`${o} key ID is required.`;if(g.json)return v(_);return p(_)}await mz(e,y,{token:g.token,projectId:g["project-id"],name:g.name,expiresAt:g["expires-at"],clearExpiresAt:g["clear-expires-at"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions({...h,name:{type:"string",description:`New ${e} key name`},"expires-at":{type:"string",description:"New ISO timestamp when the key should expire"},"clear-expires-at":{type:"boolean",description:"Clear any configured expiration"}}).withExamples([`sazabi ${t} update <key-id> --name "Renamed key" # Update one ${e} key`]).build(),...e==="public"?{deactivate:P("deactivate",`Deactivate one public key in ${i}`,async(s)=>{let{values:g,positionals:b}=T(s,a,{allowPositionals:!0}),y=b[0];if(!y){if(g.json)return v("Public key ID is required.");return p("Public key ID is required.")}await pz(y,{token:g.token,projectId:g["project-id"],json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} deactivate <key-id> # Deactivate one public key`]).build()}:{delete:P("delete",`Delete one secret key from ${i}`,async(s)=>{let{values:g,positionals:b}=T(s,a,{allowPositionals:!0}),y=b[0];if(!y){if(g.json)return v("Secret key ID is required.");return p("Secret key ID is required.")}await vz(y,{token:g.token,json:g.json,apiBaseUrl:g["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(h).withExamples([`sazabi ${t} delete <key-id> # Delete one secret key`]).build()}}).withExamples([`sazabi ${t} list # List ${e} keys in ${i}`,`sazabi ${t} create "CI agent" # Create one ${e} key`]).build()},ZO={keyType:{label:"Type",type:{kind:"string"}},id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},expiresAt:{label:"Expires",type:{kind:"nullable-date"}},lastUsedAt:{label:"Last Used",type:{kind:"nullable-date"}},createdAt:{label:"Created",type:{kind:"date"}}},YO=(e)=>({schema:ZO,columns:e==="public"?["id","name","status","expiresAt","lastUsedAt","createdAt"]:["id","name","expiresAt","lastUsedAt","createdAt"],header:`${Gy(e)} Keys`,emptyMessage:`No ${e} keys found.`}),or=(e)=>({layout:"field-list",schema:ZO,fields:e==="public"?["keyType","id","projectId","name","status","expiresAt","lastUsedAt","createdAt"]:["keyType","id","name","expiresAt","lastUsedAt","createdAt"]}),Iz=(e)=>{return e==="public"?"public-keys":"secret-keys"},Gy=(e)=>{return e==="public"?"Public":"Secret"},_t=(e,t)=>{let o=e==="public"&&"deactivatedAt"in t&&t.deactivatedAt!==null;return{...t,keyType:`${Gy(e)} key`,status:o?"Deactivated":"Active"}},QO=XO("public"),eS=XO("secret");B();B();var Se=(e,t,o,n,r)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>o){let a=`${n} must be between ${t} and ${o}`;if(r)return v(a);return p(a)}return i},st=(e,t,o,n)=>{if(!t.includes(e)){let r=t.map((a)=>`"${a}"`).join(" or "),i=`${o} must be ${r}`;if(n)return v(i);return p(i)}return e};B();Sy();In();re();import*as dt from"node:fs";import*as Xa from"node:readline";var Ya=(e)=>new Promise((t)=>setTimeout(t,e));var fz=(e)=>{return`${e.getTime()*1e6}`},tS=(e,t)=>{let n=fz(new Date),r=e.filter((i)=>i.trim().length>0).map((i)=>({timeUnixNano:n,observedTimeUnixNano:n,severityNumber:9,severityText:"INFO",body:{stringValue:i},attributes:[]}));return{resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:"sazabi-cli"}},{key:"sazabi.public_key",value:{stringValue:t}}]},scopeLogs:[{scope:{name:"sazabi-cli-forward",version:"1.0.0"},logRecords:r}]}]}};X();Ve();var kz="15003",$z=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},wz=(e)=>{let t=$z(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},_z=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!wz(t.hostname))return;return t.protocol="http:",t.port=kz,t.pathname="",t.search="",t.hash="",t.toString()},Oz=async(e,t)=>{if(!t)Y("Ensuring public key exists...");let o=await e.publicKeys.create({name:"sazabi-cli-forward"});if(!o.success){if(!t)Tt(`Failed to create public key: ${o.error}`);return null}if(!t)M(`Created new public key: ${o.value.publicKey.name}`);return o.value.publicKey.value},By=(e,t,o,n,r,i,a,c)=>{return async()=>{if(e.length===0)return;let u=tS(e,n),h=Az(u);if(e.length=0,h===0)return;if(!a)Y(`Forwarding ${h} logs...`);let s=await o.logs.forward({publicKey:n,logs:u,region:r,...i?{projectId:i}:{}});if(!s.success){if(Dz(s)){f(s,"Failed to forward logs",a);return}if(t.totalFailed+=h,!a)Fe(`Failed to forward logs: ${s.error}`);c?.({forwarded:0,failed:h});return}t.totalForwarded+=s.value.forwardedCount,t.totalFailed+=s.value.failedCount,c?.({forwarded:s.value.forwardedCount,failed:s.value.failedCount})}},Sz=async(e,t,o,n,r,i,a,c)=>{let u=dt.createReadStream(e),h=Xa.createInterface({input:u,crlfDelay:Number.POSITIVE_INFINITY}),s=[],g={totalForwarded:0,totalFailed:0},b=By(s,g,t,o,n,r,a,(y)=>c?.push(y));try{for await(let y of h)if(s.push(y),s.length>=i)await b()}catch(y){Tt(`Failed to read ${e}: ${y instanceof Error?y.message:String(y)}`);return}if(await b(),a);else if(R(),Gt(ae.muted("─".repeat(80))),M(`Forwarded ${g.totalForwarded} logs`),g.totalFailed>0)Fe(`Failed to forward ${g.totalFailed} logs`)},Tz=async(e,t,o,n,r,i,a)=>{let c=Xa.createInterface({input:process.stdin,output:process.stdout,terminal:!1}),u=[],h={totalForwarded:0,totalFailed:0},s=By(u,h,e,t,o,n,i,(g)=>a?.push(g));try{for await(let g of c)if(u.push(g),u.length>=r)await s()}catch(g){Tt(`Failed to read from stdin: ${g instanceof Error?g.message:String(g)}`);return}if(await s(),i);else if(R(),Gt(ae.muted("─".repeat(80))),M(`Forwarded ${h.totalForwarded} logs`),h.totalFailed>0)Fe(`Failed to forward ${h.totalFailed} logs`)},Pz=async(e,t,o,n,r,i,a,c)=>{let u=[],h={totalForwarded:0,totalFailed:0},s=By(u,h,t,o,n,r,a,(oe)=>c?.push(oe)),g=null,b=null,y=async()=>{if(b)clearTimeout(b);if(g)g.close();if(await s(),a);else if(R(),Gt(ae.muted("─".repeat(80))),M(`Forwarded ${h.totalForwarded} logs`),h.totalFailed>0)Fe(`Failed to forward ${h.totalFailed} logs`)};process.on("SIGINT",async()=>{R(),Y("Interrupted, flushing remaining logs..."),await y(),process.exit(0)});let _=null,S=null,H=!1,F=0,le=async()=>{if(H)return;H=!0;try{if((await dt.promises.stat(e)).size<F)F=0;_=dt.createReadStream(e,{encoding:"utf8",start:F}),S=Xa.createInterface({input:_,crlfDelay:Number.POSITIVE_INFINITY});for await(let Te of S)if(u.push(Te),u.length>=i)await s();F=(await dt.promises.stat(e)).size}catch(oe){Tt(`Failed to read ${e}: ${oe instanceof Error?oe.message:String(oe)}`)}finally{H=!1}};await le(),g=dt.watch(e,async(oe)=>{if(oe==="change"){if(b)clearTimeout(b);b=setTimeout(async()=>{if(H)return;if(_)_.close();if(S)S.close();await Ya(50),await le()},100)}})},rS=async(e)=>{let t=e.batchSize??100;if(t<=0){if(e.json)return v("Batch size must be a positive number");throw p("Batch size must be a positive number"),Error("Unreachable")}if(e.follow&&!e.file){if(e.json)return v("--follow flag requires --file to be specified");throw p("--follow flag requires --file to be specified"),Error("Unreachable")}let o=(()=>{let S=ie();if(!S.success)throw p(`Failed to read settings: ${S.error}`),Error("Unreachable");return S.value})(),n=f(Ze(o),"Failed to resolve profile"),r=e.json===!0,i=N({tokenFlag:e.token,jsonMode:r}),a=ht({cliFlag:e.apiBaseUrl,globalUrl:n.apiBaseUrl,globalDomain:n.apiDomain,buildUrlFromDomain:(S)=>`https://api.${S}`,defaultUrl:"https://api.sazabi.com"});if(!r)ce("Forwarding logs...");let c=await Ja({token:i.token,projectId:i.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:r});if(!r)Y(`Project: ${c.name}`);let u;if(e.region)u=Nz(e.region,r);else u=c.region;if(!r)Y(`Region: ${u}`);if(!r)Y(`Batch size: ${t}`);let h=e.intakeBaseUrl??n.intakeBaseUrl??_z(a)??(n.intakeDomain?CO(n.intakeDomain,u):void 0)??`https://otlp.${u}.intake.sazabi.com`;try{let S=new URL(h);if(!r&&/\.intake\.sazabi\.(dev|com)$/.test(S.host)&&!S.host.startsWith("otlp."))Fe("Intake base URL may not be the OTLP endpoint. For Sazabi, prefer https://otlp.{region}.intake.sazabi.dev or .com as appropriate.")}catch{}let s=ft({token:i.token,projectId:i.projectId,baseUrl:a,intakeBaseUrl:h}),g=e.publicKey?.trim()||n.forwardPublicKey?.trim()||void 0;if(!g){let S=await Oz(s,r);if(!S)throw p("Failed to get or create public key"),Error("Unreachable");g=S;let H=Re(o,{forwardPublicKey:g});if(H.success){let F=me(H.value);if(!F.success)Fe(`Failed to store public key: ${F.error}`)}}if(!r)R(),Gt(ae.muted("─".repeat(80))),R();let b=!e.follow,y=[],_={forwarded:0,failed:0};if(e.follow&&e.file)await Pz(e.file,s,g,u,i.projectId,t,r,b?y:void 0);else if(e.file)await Sz(e.file,s,g,u,i.projectId,t,r,y);else await Tz(s,g,u,i.projectId,t,r,y);for(let S of y)_.forwarded+=S.forwarded,_.failed+=S.failed;if(r){let S={forwardedCount:_.forwarded,failedCount:_.failed,batches:y,project:{id:c.id,name:c.name,region:u},intakeBaseUrl:h,batchSize:t,follow:Boolean(e.follow),file:e.file??void 0};console.log(JSON.stringify(S))}},Az=(e)=>{return e.resourceLogs?.reduce((t,o)=>t+(o.scopeLogs?.reduce((n,r)=>n+(r.logRecords?.length??0),0)??0),0)??0},Dz=(e)=>{if(e.success)return!1;if(e.errorPayload)return!0;if(e.statusCode!==void 0&&e.statusCode<500)return!0;return e.error.startsWith("Authentication failed")||e.error.startsWith("Client error (")},Nz=(e,t)=>{let o=Ka.safeParse(e);if(o.success)return o.data;let n=`Invalid region: ${e}.`;if(t)return v(n);return p(n)};B();re();X();import{readFile as Lz}from"node:fs/promises";var Cz={result:{label:"Result",type:{kind:"string"}},format:{label:"Format",type:{kind:"string"}},meta:{label:"Meta",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}}},xz={layout:"field-list",schema:Cz,fields:["result","format","meta"]},oS=async(e)=>{if(!e.query&&!e.file){if(e.json)return v("Pass --query or --file");return p("Pass --query or --file")}if(e.query&&e.file){if(e.json)return v("Pass either --query or --file, not both");return p("Pass either --query or --file, not both")}let t;if(e.query!==void 0)t=e.query;else try{t=await Lz(e.file,"utf8")}catch(i){let a=`Failed to read query file: ${i instanceof Error?i.message:String(i)}`;if(e.json)return v(a);return p(a)}if(t.trim().length===0){if(e.json)return v("Query cannot be empty");return p("Query cannot be empty")}let o=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),r=f(await n.logs.nativeQuery({query:t}),"Failed to run native log query",e.json);if(e.json){U(xz,r,{json:!0});return}Y(`Backend ${r.meta.backendId} returned ${r.result.length} characters in ${r.meta.took}ms${r.meta.truncated?" (truncated)":""}`),process.stdout.write(r.result.endsWith(`
|
|
4204
4321
|
`)?r.result:`${r.result}
|
|
4205
|
-
`)};F();re();X();F();var zz=/^(\d+)(s|m|h|d)$/u,jz=(e,t)=>{let o=zz.exec(e.trim());if(!o){if(t)return v("Duration must use s, m, h, or d units, for example 30m");return p("Duration must use s, m, h, or d units, for example 30m")}let n=Number(o[1]),r=o[2];return n*(r==="s"?1000:r==="m"?60000:r==="h"?3600000:86400000)},nS=(e,t,o)=>{let n=new Date(e);if(Number.isNaN(n.getTime())){let r=`${t} must be a valid ISO-8601 timestamp`;if(o)return v(r);return p(r)}return n.toISOString()},uo=(e)=>{if(e.last&&(e.from||e.to)){if(e.json)return v("Use either --last or --from/--to, not both");return p("Use either --last or --from/--to, not both")}if(e.last){let n=new Date,r=new Date(n.getTime()-jz(e.last,e.json));if(!Number.isFinite(r.getTime())||!Number.isFinite(n.getTime())){if(e.json)return v("--last is out of supported date range");return p("--last is out of supported date range")}return{startDate:r.toISOString(),endDate:n.toISOString()}}let t=e.from?nS(e.from,"--from",e.json):void 0,o=e.to?nS(e.to,"--to",e.json):void 0;if(t&&o&&new Date(t)>=new Date(o)){if(e.json)return v("--from must be before --to");return p("--from must be before --to")}return{startDate:t,endDate:o}};var Ez={patterns:{label:"Patterns",type:{kind:"custom",render:(e)=>`${Array.isArray(e)?e.length:0} patterns`,serialize:(e)=>e}},meta:{label:"Meta",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}}},Uz={layout:"field-list",schema:Ez,fields:["patterns","meta"]},Rz={severity:{label:"Severity",type:{kind:"custom",render:(e)=>typeof e==="string"&&e.length>0?bt(e):"(none)",serialize:(e)=>e}},occurrences:{label:"Occurrences",type:{kind:"number"},align:"right"},lastSeen:{label:"Last Seen",type:{kind:"nullable-date",emptyLabel:"(never)"}},pattern:{label:"Pattern",type:{kind:"truncated",maxLength:140}},representativeId:{label:"Representative",type:{kind:"nullable-string",emptyLabel:"(none)"}}},Kz={schema:Rz,columns:["severity","occurrences","lastSeen","pattern","representativeId"],header:{title:"Log patterns",variant:"search"},emptyMessage:"No matching log patterns."},Gz=(e)=>{let t=uo(e);return{...e.query?{query:e.query}:{},...e.severity?{severity:e.severity}:{},...t.startDate?{startDate:t.startDate}:{},...t.endDate?{endDate:t.endDate}:{},limit:e.limit??25}},iS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.patterns(Gz(e)),"Failed to query log patterns",e.json);if(e.json){U(Uz,n,{json:!0});return}Bz(n)},Bz=(e)=>{if(e.patterns.length>0)Y(`Returned ${e.meta.count} pattern${e.meta.count===1?"":"s"} in ${e.meta.took}ms`);M(Kz,e.patterns,{count:e.meta.count})};F();re();X();var Za=500,Fz=new Set(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]),Qa=(e,t)=>{for(let o of t){let n=e[o];if(n===void 0||n===null)continue;if(typeof n==="string")return n;if(typeof n==="number"||typeof n==="boolean")return String(n)}return""},Jz=(e)=>{let t=Qa(e,["@timestamp","timestamp","time","ts","date"]);if(!t)return _e("(no time)");let o=new Date(t);if(Number.isNaN(o.getTime()))return t;return o.toISOString()},Hz=(e)=>{return Qa(e,["body","message","log","text","content","msg"])||_e("(no message)")},Mz=(e)=>{return Qa(e,["severity","level","log_level","priority"])},Vz=(e)=>{return Qa(e,["service","service_name","serviceName","source"])},qz=(e,t)=>{let o={};if(!t.omitSearch)o.search={query:e,mode:t.mode??"all",...t.searchFields?.length?{fields:t.searchFields}:{}};if(t.cursor!==void 0||t.limit!==void 0||t.all)o.pagination={limit:t.limit??(t.all?100:50),...t.cursor!==void 0?{cursor:t.cursor}:{}};if(t["sort-field"])o.sort={field:t["sort-field"],direction:t["sort-direction"]??"desc"};if(t.select){let r=t.select.split(",").map((i)=>i.trim()).filter((i)=>i.length>0);if(r.length>0)o.select=r}let n=Zz(t);if(!n.ok)return{ok:!1,errors:n.errors};if(n.filters.length>0)o.filters=n.filters;return{ok:!0,input:o}};var Wz=(e)=>{if(e==="true")return!0;if(e==="false")return!1;let t=Number(e);if(e.trim()!==""&&Number.isFinite(t))return t;return e},Yz=(e)=>{let t=Number(e);if(e.trim()!==""&&Number.isFinite(t))return t;return e},Xz=(e)=>{let t=e.indexOf("=");if(t<=0)return{ok:!1,error:"Filter must use <field>.<op>=<value>"};let o=e.slice(0,t),n=e.slice(t+1),r=o.lastIndexOf(".");if(r<=0||r===o.length-1)return{ok:!1,error:"Filter must use <field>.<op>=<value>"};let i=o.slice(0,r),a=o.slice(r+1);if(!Fz.has(a))return{ok:!1,error:`Unsupported filter operator: ${a}`};if(a==="in"){let c=n.split(",").map((u)=>Yz(u.trim())).filter((u)=>u!=="");if(c.length===0)return{ok:!1,error:"in filters must include at least one value"};return{ok:!0,filter:{field:i,op:a,value:c}}}if(a==="between"){let c=n.includes("..")?n.split(".."):n.split(",");if(c.length!==2)return{ok:!1,error:"between filters must use <from>..<to>"};let[u,h]=c.map((d)=>d.trim());if(!u||!h)return{ok:!1,error:"between filters must use <from>..<to>"};return{ok:!0,filter:{field:i,op:a,value:{from:u,to:h}}}}if(a==="exists"){if(n!=="true"&&n!=="false")return{ok:!1,error:"exists filters must use true or false"};return{ok:!0,filter:{field:i,op:a,value:n==="true"}}}return{ok:!0,filter:{field:i,op:a,value:Wz(n)}}},Zz=(e)=>{let t=[],o=[],n=uo({from:e.from,to:e.to,last:e.last,json:e.json});if(n.startDate&&n.endDate)t.push({field:"timestamp",op:"between",value:{from:n.startDate,to:n.endDate}});else if(n.startDate)t.push({field:"timestamp",op:"gte",value:n.startDate});else if(n.endDate)t.push({field:"timestamp",op:"lte",value:n.endDate});if(e.service)t.push({field:"service",op:"eq",value:e.service});if(e.severity)t.push({field:"severity",op:"eq",value:e.severity});if(e.env)t.push({field:"environment",op:"eq",value:e.env});if(e.traceId)t.push({field:"trace_id",op:"eq",value:e.traceId});for(let r of e.filters??[]){let i=Xz(r);if(i.ok)t.push(i.filter);else o.push(`${r}: ${i.error}`)}if(o.length>0)return{ok:!1,errors:o};return{ok:!0,filters:t}},aS=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.project,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:t.json}),r=qz(e,t);if(!r.ok){if(t.json)return v({success:!1,error:"Invalid log query filters",errors:r.errors});return p(`Invalid log query filters: ${r.errors.join("; ")}`)}let i=r.input,a=t.all?await Qz(n,i,t):f(await n.logs.query(i),"Failed to query logs",t.json);if(t.json){j(a);return}ej(a)},Qz=async(e,t,o)=>{let n=[],r=t.pagination?.cursor,i=0;do{let a={...t,pagination:{limit:t.pagination?.limit??o.limit??100,...r?{cursor:r}:{}}},c=f(await e.logs.query(a),"Failed to query logs",o.json);n.push(...c.data),i+=c.meta.took,r=c.nextCursor}while(r);return{data:n,nextCursor:null,meta:{count:n.length,took:i}}},ej=(e)=>{let{data:t,nextCursor:o,meta:n}=e;if(t.length===0){Rt("No matching log rows.");return}Y(`Returned ${n.count} row${n.count===1?"":"s"} in ${n.took}ms`);let r=t.map((i)=>{let a=i,c=Mz(a);return{time:Jz(a),severity:c?bt(c,c):ae.muted(_e("(sev)")),service:Vz(a)||_e("(service)"),message:qe(Hz(a),200)}});tt(r,[{header:"Time (UTC)",key:"time"},{header:"Severity",key:"severity"},{header:"Service",key:"service"},{header:"Message",key:"message"}],{header:{title:"Log query results",variant:"search",count:n.count}}),yt({type:"cursor",nextCursor:o})};F();re();X();var tj={backend:{label:"Backend",type:{kind:"custom",render:(e)=>{let t=e;return`${t.name} (${t.id})`},serialize:(e)=>e}},features:{label:"Features",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},commands:{label:"Commands",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},queryableFields:{label:"Queryable",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},searchableFields:{label:"Searchable",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},observedServiceNames:{label:"Observed Services",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},observedAttributeKeys:{label:"Observed Attributes",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},schemaContext:{label:"Schema Context",type:{kind:"custom",render:(e)=>e?JSON.stringify(e):"(none)",serialize:(e)=>e}}},rj={layout:"field-list",schema:tj,fields:["backend","features","commands","queryableFields","searchableFields","observedServiceNames","observedAttributeKeys","schemaContext"]},cS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.schema({}),"Failed to fetch log schema",e.json);if(e.json){U(rj,n,{json:!0});return}oj(n)},oj=(e)=>{if(ce("Log backend"),ne({Backend:`${e.backend.name} (${e.backend.id})`,Kind:e.backend.kind,Commands:e.commands.join(", "),Features:e.features.join(", ")||"(none)"}),ce("Normalized fields"),ne({Queryable:e.queryableFields.join(", ")||"(none)",Searchable:e.searchableFields.join(", ")||"(none)"}),e.observedServiceNames.length>0)tt(e.observedServiceNames.map((t)=>({service:qe(t,80)})),[{header:"Observed Services",key:"service"}]);if(e.observedAttributeKeys.length>0)tt(e.observedAttributeKeys.map((t)=>({attribute:qe(t,80)})),[{header:"Observed Attributes",key:"attribute"}])};F();Ty();In();re();X();Ve();var lS=["ERROR","WARN","INFO","DEBUG","TRACE"],nj="15006",ij=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},aj=(e)=>{let t=ij(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},cj=(e)=>{let t=new Date(e.timestamp).toISOString().split("T")[1],o=bt(e.severity,e.severity.padEnd(7)),n=ae.cyan(e.service.padEnd(20)),r=e.body.length>120?`${e.body.substring(0,117)}...`:e.body;return`[${t}] ${o} ${n} ${r}`},hS=async(e)=>{let t=f($t(),"Failed to read settings"),o=e.json??!1,n=hj(t,e.apiBaseUrl),r=uj(e.severities,o),i=Jy(e.services),a=Jy(e.environments),c=N({tokenFlag:e.token,jsonMode:o}),u=await sj({apiBaseUrlFlag:e.apiBaseUrl,jsonMode:o,projectId:c.projectId,regionFlag:e.region,token:c.token}),h=ft({token:c.token,projectId:c.projectId,baseUrl:n,tailBaseUrl:dj(t,e.tailBaseUrl,u,n)}),d={severities:r,services:i,environments:a,searchTerm:e.search,traceId:e.traceId},g=new AbortController,b,y=0,_,S,J=()=>{b="interrupted",g.abort()};if(!o)lj({environments:a,region:u,search:e.search,services:i,severities:r,traceId:e.traceId});let G=f(await h.logs.tail({...c.projectId?{projectId:c.projectId}:{},...u?{region:u}:{},filters:d,signal:g.signal}),"Failed to tail logs",o);if(!o)H("Connected! Waiting for logs..."),R();if(process.on("SIGINT",J),e.duration&&e.duration>0)S=setTimeout(()=>{b="duration",g.abort()},e.duration*1000);try{for await(let le of G){if(y+=1,o){j(le);continue}Bt(cj(le))}}catch(le){_=le instanceof Error?le:Error(String(le))}finally{if(process.removeListener("SIGINT",J),S)clearTimeout(S)}if(_){if(o)return v(_.message);R(),bo(),Tt(_.message);return}if(o)return;if(R(),b==="duration")Y("Duration reached, closing connection...");if(b==="interrupted")Y("Interrupted, closing connection...");bo(),Y(`Connection closed. Received ${y} logs.`)},lj=(e)=>{if(ce("Tailing logs..."),e.severities?.length)Y(`Severities: ${e.severities.join(", ")}`);if(e.services?.length)Y(`Services: ${e.services.join(", ")}`);if(e.environments?.length)Y(`Environments: ${e.environments.join(", ")}`);if(e.search)Y(`Search: ${e.search}`);if(e.traceId)Y(`Trace ID: ${e.traceId}`);if(e.region)Y(`Region: ${e.region}`);bo(),R()},Jy=(e)=>{if(!e)return;let t=e.split(",").map((o)=>o.trim()).filter((o)=>o.length>0);return t.length>0?t:void 0},uj=(e,t)=>{let o=Jy(e)?.map((i)=>i.toUpperCase());if(!o)return;let n=o.find((i)=>!lS.includes(i));if(!n)return o;let r=`Invalid severity: ${n}. Valid values: ${lS.join(", ")}`;if(t)return v(r);return p(r)},hj=(e,t)=>{return ht({cliFlag:t,globalUrl:e.apiBaseUrl,globalDomain:e.apiDomain,buildUrlFromDomain:(o)=>`https://api.${o}`,defaultUrl:"https://api.sazabi.com"})},gj=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!aj(t.hostname))return;return t.protocol="ws:",t.port=nj,t.pathname="/tail",t.search="",t.hash="",t.toString()},dj=(e,t,o,n)=>{if(t)return t;if(e.tailBaseUrl)return e.tailBaseUrl;let r=gj(n);if(r)return r;if(e.tailDomain&&o)return`wss://${o}.tail.${e.tailDomain}`;if(o)return`wss://${o}.tail.sazabi.com`;return},sj=async(e)=>{if(e.regionFlag)return uS(e.regionFlag,e.jsonMode);if(!e.projectId)return;let t=await Ma({token:e.token,projectId:e.projectId,apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return uS(t.region,e.jsonMode)},uS=(e,t)=>{if(Fa(e))return e;let o=`Log tail is not supported for project region ${e}.`;if(t)return v(o);return p(o)};F();re();X();var bj={total:{label:"Total",type:{kind:"number"}},startDate:{label:"Start",type:{kind:"date"}},endDate:{label:"End",type:{kind:"date"}},interval:{label:"Interval",type:{kind:"string"}},series:{label:"Series",type:{kind:"custom",render:(e)=>`${Array.isArray(e)?e.length:0} series`,serialize:(e)=>e}}},yj={layout:"field-list",schema:bj,fields:["total","startDate","endDate","interval","series"]},mj={group:{label:"Group",type:{kind:"string"}},total:{label:"Total",type:{kind:"number"},align:"right"},points:{label:"Points",type:{kind:"custom",render:(e)=>Array.isArray(e)?String(e.length):"0",serialize:(e)=>e},align:"right"}},pj={schema:mj,columns:["group","total","points"],header:{title:"Log volume",variant:"results"},emptyMessage:"No log volume found."},vj=(e)=>{if(e==="service")return"service_name";if(e==="severity")return"severity_text";return e},Ij=(e)=>{let t=new Date,o=uo(e),n=o.endDate??t.toISOString();return{startDate:o.startDate??new Date(new Date(n).getTime()-3600000).toISOString(),endDate:n,...e.interval?{interval:e.interval}:{},...e.groupBy?{groupBy:vj(e.groupBy)}:{},filters:{...e.service?{service_name:e.service}:{},...e.severity?{severity_text:e.severity}:{},...e.env?{environment:e.env}:{}}}},gS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.volume(Ij(e)),"Failed to query log volume",e.json);if(e.json){U(yj,n,{json:!0});return}fj(n)},fj=(e)=>{if(e.series.length>0)Y(`Total ${e.total} logs from ${e.startDate} to ${e.endDate} at ${e.interval}`);M(pj,e.series,{count:e.series.length})};var dS=(e,t)=>{let o=[],n=`--${t}=`;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===void 0)continue;if(i===`--${t}`){let a=e[r+1];if(a!==void 0&&!a.startsWith("-"))o.push(a),r+=1;continue}if(i.startsWith(n))o.push(i.slice(n.length))}return o},sS=W("logs","Stream, search, and forward logs").withSubcommands({schema:P("schema","Describe the active log backend and query fields",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"}}),o={token:t.token,project:t.project,json:t.json,"api-base-url":t["api-base-url"]};await cS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"}}).withExamples(["sazabi logs schema # Show backend, commands, and fields","sazabi logs schema --json # Machine-readable schema context"]).build(),tail:P("tail","Stream logs from current project in real-time",async(e)=>{let{values:t}=T(e,{...V,severities:{type:"string"},services:{type:"string"},environments:{type:"string"},search:{type:"string"},"trace-id":{type:"string"},duration:{type:"string"},"tail-base-url":{type:"string"},region:{type:"string"}}),o={};if(t.token)o.token=t.token;if(t.severities)o.severities=t.severities;if(t.services)o.services=t.services;if(t.environments)o.environments=t.environments;if(t.search)o.search=t.search;if(t["trace-id"])o.traceId=t["trace-id"];if(t.duration)o.duration=Se(t.duration,1,Number.MAX_SAFE_INTEGER,"Duration",t.json);if(t.json)o.json=!0;if(t["tail-base-url"])o.tailBaseUrl=t["tail-base-url"];if(t.region)o.region=t.region;if(t["api-base-url"])o.apiBaseUrl=t["api-base-url"];await hS(o)}).withOptions({...q,severities:{type:"string",description:"Filter by comma-separated severities (e.g., ERROR,WARN,INFO)"},services:{type:"string",description:"Filter by comma-separated service names"},environments:{type:"string",description:"Filter by comma-separated environments"},search:{type:"string",description:"Filter by search term (case-insensitive)"},"trace-id":{type:"string",description:"Filter by trace ID"},duration:{type:"string",description:"Duration to tail in seconds (default: unlimited)"},"tail-base-url":{type:"string",description:"Override tail WebSocket base URL"},region:{type:"string",description:"Override project region"}}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings","sazabi logs tail --services api,worker # Tail specific services","sazabi logs tail --environments production,staging # Tail specific environments",'sazabi logs tail --search "database" # Tail logs matching search term',"sazabi logs tail --json # Output as JSON"]).build(),query:P("query","Search stored logs in the current project (POST /logs/query)",async(e)=>{let{values:t,positionals:o}=T(e,{...V,project:{type:"string"},limit:{type:"string"},cursor:{type:"string"},mode:{type:"string"},"sort-field":{type:"string"},"sort-direction":{type:"string"},select:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},service:{type:"string"},severity:{type:"string"},env:{type:"string"},"trace-id":{type:"string"},filter:{type:"string"},"search-field":{type:"string"},"query-all":{type:"boolean"},all:{type:"boolean"}},{allowPositionals:!0}),n=o.join(" ").trim(),r=dS(e,"filter"),i=dS(e,"search-field"),a=Boolean(t.from||t.to||t.last||t.service||t.severity||t.env||t["trace-id"])||r.length>0;if(!n&&!t["query-all"]&&!a){if(t.json)return v("Search text, a structured filter, or --query-all is required. Usage: sazabi logs query <search-text> [options]");return p("Search text, a structured filter, or --query-all is required. Usage: sazabi logs query <search-text> [options]")}if(n.length>Za){if(t.json)return v(`Search text must be at most ${Za} characters`);return p(`Search text must be at most ${Za} characters`)}if(n&&t["query-all"]){if(t.json)return v("Pass either a search phrase or --query-all, not both");return p("Pass either a search phrase or --query-all, not both")}if(t.mode&&!n){if(t.json)return v("--mode requires search text (search is omitted)");return p("--mode requires search text (search is omitted)")}let c={token:t.token,project:t.project,json:t.json,"api-base-url":t["api-base-url"],omitSearch:t["query-all"]===!0||!n,from:t.from,to:t.to,last:t.last,service:t.service,severity:t.severity,env:t.env,traceId:t["trace-id"],filters:r,searchFields:i,all:t.all};if(t.limit)c.limit=Se(t.limit,1,1000,"Limit",t.json);if(t.cursor)c.cursor=t.cursor;if(t.mode)c.mode=dt(t.mode,["any","all","phrase"],"Mode",t.json);if(t["sort-field"])c["sort-field"]=t["sort-field"];if(t["sort-direction"]&&!t["sort-field"]){if(t.json)return v("--sort-direction requires --sort-field");return p("--sort-direction requires --sort-field")}if(t["sort-direction"])c["sort-direction"]=dt(t["sort-direction"],["asc","desc"],"Sort direction",t.json);if(t.select)c.select=t.select;await aS(n,c)}).withPositionalArgs("[search-text]").withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},limit:{type:"string",description:"Max rows to return (1-1000, default: 50)"},cursor:{type:"string",description:"Pagination cursor from a previous response"},mode:{type:"string",description:"Token match mode: any, all, or phrase (default: all)"},"sort-field":{type:"string",description:"Field to sort by (e.g. @timestamp)"},"sort-direction":{type:"string",description:"Sort direction: asc or desc (default: desc)"},select:{type:"string",description:"Comma-separated fields to return"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},service:{type:"string",description:"Filter by service name"},severity:{type:"string",description:"Filter by severity, for example ERROR"},env:{type:"string",description:"Filter by deployment environment"},"trace-id":{type:"string",description:"Filter by trace ID"},filter:{type:"string",description:"Structured filter as <field>.<op>=<value>; repeatable"},"search-field":{type:"string",description:"Restrict full-text search to a field; repeatable"},"query-all":{type:"boolean",description:"Omit full-text search and return the API default slice (sort/pagination only; server may require other filters)"},all:{type:"boolean",description:"Fetch all pages until the server returns no cursor"}}).withExamples(['sazabi logs query "connection refused" --last 1h --service api --severity ERROR # Search recent API errors',"sazabi logs query --trace-id abc123 --select timestamp,service,severity,body # Find logs for one trace","sazabi logs query --filter http_status_code.gte=500 --limit 100 --json # Machine-readable structured filter","sazabi logs query error --mode any --limit 100 # Match any token with a larger page","sazabi logs query --query-all --limit 20 --sort-field @timestamp # Recent rows without full-text search","sazabi logs query slow --json # Machine-readable output"]).build(),patterns:P("patterns","Search normalized log patterns for discovery",async(e)=>{let{values:t,positionals:o}=T(e,{...V,project:{type:"string"},severity:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},limit:{type:"string"}},{allowPositionals:!0}),n={token:t.token,project:t.project,query:o.join(" ").trim()||void 0,severity:t.severity,from:t.from,to:t.to,last:t.last,json:t.json,"api-base-url":t["api-base-url"]};if(t.limit)n.limit=Se(t.limit,1,100,"Limit",t.json);await iS(n)}).withPositionalArgs("[pattern-text]").withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},severity:{type:"string",description:"Filter by severity, for example ERROR"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},limit:{type:"string",description:"Max patterns to return (1-100, default: 25)"}}).withExamples(['sazabi logs patterns "connection refused" --severity ERROR --limit 25 # Find recurring error patterns',"sazabi logs patterns --last 24h --json # Export recent patterns"]).build(),volume:P("volume","Summarize log volume by time and optional dimension",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},interval:{type:"string"},"group-by":{type:"string"},service:{type:"string"},severity:{type:"string"},env:{type:"string"}}),o={token:t.token,project:t.project,from:t.from,to:t.to,last:t.last,service:t.service,severity:t.severity,env:t.env,json:t.json,"api-base-url":t["api-base-url"]};if(t.interval)o.interval=dt(t.interval,["1m","5m","15m","1h"],"Interval",t.json);if(t["group-by"])o.groupBy=dt(t["group-by"],["service","severity","environment"],"Group by",t.json);await gS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},interval:{type:"string",description:"Bucket interval: 1m, 5m, 15m, or 1h"},"group-by":{type:"string",description:"Group by service, severity, or environment"},service:{type:"string",description:"Filter by service name"},severity:{type:"string",description:"Filter by severity, for example ERROR"},env:{type:"string",description:"Filter by deployment environment"}}).withExamples(["sazabi logs volume --last 6h --group-by service # Compare service log volume","sazabi logs volume --last 24h --severity ERROR --interval 15m --json # Export error volume"]).build(),"native-query":P("native-query","Run a backend-native read-only log query",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"},query:{type:"string"},file:{type:"string",short:"f"}}),o={token:t.token,project:t.project,query:t.query,file:t.file,json:t.json,"api-base-url":t["api-base-url"]};await oS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},query:{type:"string",description:"Backend-native query text"},file:{type:"string",short:"f",description:"Read backend-native query text from a file"}}).withExamples(['sazabi logs native-query --query "SELECT service_name, count() FROM log_volume_per_minute GROUP BY service_name LIMIT 20" # Run backend-native query text',"sazabi logs native-query --file investigation.sql --json # Run a query from a file"]).build(),forward:P("forward","Forward plaintext logs to current project",async(e)=>{let{values:t}=T(e,{...V,file:{type:"string",short:"f"},follow:{type:"boolean"},"batch-size":{type:"string"},"intake-base-url":{type:"string"},"public-key":{type:"string"},region:{type:"string"}}),o={};if(t.token)o.token=t.token;if(t.file)o.file=t.file;if(t.follow)o.follow=t.follow;if(t["batch-size"])o.batchSize=Se(t["batch-size"],1,Number.MAX_SAFE_INTEGER,"Batch size",t.json);if(t["api-base-url"])o.apiBaseUrl=t["api-base-url"];if(t["intake-base-url"])o.intakeBaseUrl=t["intake-base-url"];if(t.region)o.region=t.region;if(t["public-key"])o.publicKey=t["public-key"];await rS({...o,json:t.json})}).withOptions({...q,json:{type:"boolean",description:"Output a final JSON summary"},file:{type:"string",short:"f",description:"Read from file instead of stdin"},follow:{type:"boolean",description:"Follow file for new lines (like tail -f)"},"batch-size":{type:"string",description:"Number of logs to batch before sending (default: 100)"},"intake-base-url":{type:"string",description:"Override intake base URL"},"public-key":{type:"string",description:"Use this public key value (skip creating/storing)"},region:{type:"string",description:"Override project region"}}).withExamples(['echo "Log message" | sazabi logs forward # Forward from stdin',"sazabi logs forward --file app.log # Forward from file","sazabi logs forward --file app.log --follow # Forward file with tail -f behavior","sazabi logs forward --file app.log --batch-size 50 # Forward with custom batch size"]).build()}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings",'sazabi logs query "timeout" # Search stored logs',"sazabi logs forward --file app.log # Forward from file"]).build();F();re();X();var bS={membershipId:{label:"Membership ID",type:{kind:"string"}},userId:{label:"User ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"nullable-string"}},email:{label:"Email",type:{kind:"string"}},role:{label:"Role",type:{kind:"string"}}},kj={schema:bS,columns:["membershipId","userId","name","email","role"],header:"Members",emptyMessage:"No members found."},$j={layout:"field-list",schema:bS,fields:["membershipId","userId","name","email","role"]},wj=async(e)=>{let t=N({tokenFlag:e.token,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.members.list({organizationId:t.organizationId}),"Failed to list members",e.json);M(kj,n.members,{json:e.json})},_j=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.members.updateRole(e,t.role,o.organizationId),"Failed to update member role",t.json);U($j,r.member,{json:t.json})},Oj=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.members.remove(e,o.organizationId),"Failed to remove member",t.json);if(t.json){j(r);return}H(`Removed ${r.removedUserId} from the active organization.`)},yS=W("members","Manage organization members").withSubcommands({list:P("list","List members in the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await wj({token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members list # List members in the active organization"]).build(),"update-role":P("update-role","Update one member's organization role",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("User ID is required.");return p("User ID is required.")}if(t.role!=="admin"&&t.role!=="member"){if(t.json)return v("Role must be either 'admin' or 'member'.");return p("Role must be either 'admin' or 'member'.")}await _j(n,{token:t.token,organizationId:t["organization-id"],role:t.role,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},role:{type:"string",description:"New role: admin or member"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members update-role user_123 --role admin # Promote a member to admin"]).build(),remove:P("remove","Remove one member from the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("User ID is required.");return p("User ID is required.")}await Oj(n,{token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members remove user_123 # Remove a member from the active organization"]).build()}).withExamples(["sazabi members list # List members in the active organization","sazabi members update-role user_123 --role admin # Promote a member to admin","sazabi members remove user_123 # Remove a member from the active organization"]).build();F();re();X();F();re();X();X();var Sj=2000,ec=async(e)=>{let t=e.pollIntervalMs??Sj,o=Date.now(),n=!1,r={completed:!1,threadId:e.threadId,runId:e.runId,status:"processing",response:null};while(!0){let i=await e.client.runs.get(e.runId);if(!i.success){if(!Pj(i))return Hy(e.printProgress,n),i}else if(r=i.value,i.value.completed)return Hy(e.printProgress,n),i;if(e.timeoutMs!==void 0&&Date.now()-o>=e.timeoutMs)return Hy(e.printProgress,n),ke(r);n=Tj(e.printProgress,n),await Ya(t)}},Tj=(e,t)=>{if(!e)return t;if(!t)process.stdout.write(`
|
|
4206
|
-
`);return process.stdout.write("."),!0},
|
|
4207
|
-
`)},Pj=(e)=>{return e.statusCode===404};var Aj={threadId:{label:"Thread ID",type:{kind:"id"}},messageId:{label:"Message ID",type:{kind:"nullable-string",emptyLabel:"(pending)"}},url:{label:"URL",type:{kind:"nullable-string"},get:(e)=>e.threadUrl??null},runId:{label:"Run ID",type:{kind:"id"}},status:{label:"Status",type:{kind:"string"}},pollWith:{label:"Poll with",type:{kind:"string"},get:(e)=>`sazabi runs get ${e.runId}`},response:{label:"Response",type:{kind:"nullable-string"},get:(e)=>e.response}},Dj={layout:"sections",schema:Aj,primary:{title:"Thread",fields:["threadId","messageId","url","runId","status","pollWith"]},secondary:[{title:"Response",field:"response"}]},pS=async(e,t={})=>{let o=Date.now(),n=N({tokenFlag:t.token,jsonMode:t.json}),r=L({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),i=await Nj({message:e,threadId:t.threadId,projectId:n.projectId,json:t.json,client:r,wait:t.wait,timeoutMs:t.timeout});if(t.wait&&i.status==="processing"){let a=t.timeout===void 0?void 0:Math.max(0,t.timeout-(Date.now()-o)),c=f(await ec({client:r,runId:i.runId,threadId:i.threadId,timeoutMs:a,printProgress:!t.json}),"Failed to get run",t.json);i={...i,status:c.status,response:c.response,messageId:i.messageId??c.messageId}}U(Dj,i,{json:t.json})},Nj=async(e)=>{if(e.threadId){let o=f(await e.client.messages.append(e.threadId,e.message,e.wait??!1,mS(e.timeoutMs)),"Failed to send message",e.json);return{threadId:e.threadId,runId:o.result.runId,messageId:o.result.messageId,status:o.result.status,response:o.result.response,threadUrl:e.projectId?wt(e.projectId,e.threadId,void 0,o.result.messageId):void 0}}let t=f(await e.client.threads.create({message:e.message,...e.projectId?{projectId:e.projectId}:{},wait:e.wait??!1,timeoutSeconds:mS(e.timeoutMs)}),"Failed to create thread",e.json);return{threadId:t.result.threadId,runId:t.result.runId,messageId:t.result.messageId,status:t.result.status,response:t.result.response,threadUrl:e.projectId?wt(e.projectId,t.result.threadId,void 0,t.result.messageId):void 0}},mS=(e)=>{if(e===void 0)return 20;return Math.max(1,Math.min(Math.ceil(e/1000),20))};var Lj={id:{label:"ID",type:{kind:"string"}},role:{label:"Role",type:{kind:"role"}},content:{label:"Content",type:{kind:"custom",render:(e)=>{let o=e.find((n)=>n.type==="message"&&Boolean(n.message));return o?qe(o.message):_e("(no text)")}}},createdAt:{label:"Created",type:{kind:"date"}}},Cj={schema:Lj,columns:["id","role","content","createdAt"],header:"Messages",emptyMessage:"No messages found."},xj={id:{label:"ID",type:{kind:"string"}},threadTitle:{label:"Thread",type:{kind:"nullable-string",emptyLabel:"(no title)"}},role:{label:"Role",type:{kind:"role"}},content:{label:"Content",type:{kind:"custom",render:(e)=>qe(e)}},score:{label:"Score",align:"right",type:{kind:"custom",render:(e)=>e!=null?e.toFixed(2):"-"}}},zj={schema:xj,columns:["id","threadTitle","role","content","score"],header:{title:"Search Results",variant:"search"},emptyMessage:"No matching messages found."},jj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{messages:r,nextCursor:i}=f(await n.messages.list(e,{limit:t.limit,cursor:t.cursor}),"Failed to list messages",t.json);M(Cj,r,{json:t.json,nextCursor:i})},Ej=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{messages:r,pagination:i}=f(await n.search.messages({query:e,limit:t.limit,page:t.page,threadId:t.threadId,role:t.role}),"Failed to search messages",t.json);if(t.json){j({messages:r,pagination:i});return}M(zj,r,{count:i.totalResults}),yt({type:"page",page:i.page,totalPages:i.totalPages})},vS=W("messages","Send, list, and search messages").withSubcommands({send:P("send","Send a message (creates new thread if --thread-id omitted)",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"thread-id":{type:"string",short:"t"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]");return p("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]")}let r=t.timeout?Se(t.timeout,1,3600,"Timeout",t.json)*1000:void 0,i={token:t.token,threadId:t["thread-id"],wait:t.wait,timeout:r,json:t.json,apiBaseUrl:t["api-base-url"]};await pS(n,i)}).withPositionalArgs("<message>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",short:"t",description:"Thread ID to append to (creates new thread if omitted)"},wait:{type:"boolean",description:"Wait for assistant response and print it"},timeout:{type:"string",description:"Timeout in seconds to wait for response before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Hello' --thread-id abc123 # Append to existing thread","sazabi messages send 'Hello' -t abc123 --wait # Append and wait for reply","sazabi messages send 'Hello' --wait # New thread, wait for reply","sazabi messages send 'Hello' --wait --timeout 120 # Wait up to 2 minutes"]).build(),list:P("list","List messages in a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi messages list <thread-id>");return p("Thread ID is required. Usage: sazabi messages list <thread-id>")}if(o.length>1){let i=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${i}`);return p(`Unexpected arguments: ${i}`)}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.cursor)r.cursor=t.cursor;await jj(n,r)}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of messages to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages list <thread-id> # List all messages in thread","sazabi messages list <thread-id> --limit 20 # List with custom limit","sazabi messages list <thread-id> --cursor xyz # List next page"]).build(),search:P("search","Search messages in current project",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},"thread-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Search query is required. Usage: sazabi messages search <query>");return p("Search query is required. Usage: sazabi messages search <query>")}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.page)r.page=Se(t.page,1,Number.MAX_SAFE_INTEGER,"Page",t.json);if(t["thread-id"])r.threadId=t["thread-id"];if(t.role)r.role=dt(t.role,["user","assistant"],"Role",t.json);await Ej(n,r)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},"thread-id":{type:"string",description:"Filter messages by thread ID"},role:{type:"string",description:"Filter by role: user or assistant"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi messages search "error handling" # Search messages','sazabi messages search "bug" --limit 50 # Search with limit','sazabi messages search "user input" --role user # Search user messages only','sazabi messages search "response" --thread-id thread-123 # Search in specific thread']).build()}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Follow up' -t <thread-id> # Append to thread","sazabi messages list <thread-id> # List messages in thread",'sazabi messages search "error" # Search messages']).build();F();re();X();Ve();var IS={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},slug:{label:"Slug",type:{kind:"string"}},role:{label:"Role",type:{kind:"nullable-string"}}},Uj={schema:IS,columns:["id","name","slug","role"],header:"Organizations",emptyMessage:"No organizations found."},Rj={layout:"field-list",schema:IS,fields:["id","name","slug","role"]},Kj=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.organizations.list(),"Failed to list organizations",e.json);M(Uj,n.organizations,{json:e.json})},Gj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=f(ie(),"Failed to read settings",t.json),r=L({token:o.token,organizationId:e,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await r.organizations.get(e),"Failed to select organization",t.json).organization,a=f(await r.projects.list({organizationId:e}),"Failed to fetch organization projects",t.json).projects,c=f(Ze(n),"Failed to resolve profile",t.json),u=f(Re(n,{activeOrganizationId:i.id,organizationName:i.name,activeProjectId:c.activeProjectId&&a.some((h)=>h.id===c.activeProjectId)?c.activeProjectId:a[0]?.id}),"Failed to update profile",t.json);if(f(me(u),"Failed to persist active organization",t.json),t.json){j({organization:i,activeProjectId:f(Ze(u),"Failed to resolve profile",t.json).activeProjectId});return}H(`Active organization set to ${i.name}.`)},Bj=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.organizations.rename(e,o.organizationId),"Failed to rename organization",t.json);Fj(r.organization.id,r.organization.name),U(Rj,r.organization,{json:t.json})},Fj=(e,t)=>{let o=ie();if(!o.success)return;let n=o.value,r=Ze(n);if(!r.success)return;if(r.value.activeOrganizationId!==e)return;let i=Re(n,{organizationName:t});if(i.success)me(i.value)},fS=W("organizations","Manage organizations").withSubcommands({list:P("list","List organizations available to the current credential",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Kj({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations list # List available organizations"]).build(),use:P("use","Set the active organization for future commands",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Organization ID is required.");return p("Organization ID is required.")}await Gj(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations use org_123 # Set the active organization"]).build(),rename:P("rename","Rename the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Organization name is required.");return p("Organization name is required.")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await Bj(n,{token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi organizations rename "Observed Platform" # Rename the active organization']).build()}).withExamples(["sazabi organizations list # List available organizations","sazabi organizations use org_123 # Set the active organization",'sazabi organizations rename "Observed Platform" # Rename the active organization']).build();F();X();Ve();var Jj={name:{label:"Profile",type:{kind:"string"}},active:{label:"Active",type:{kind:"custom",render:(e)=>e?ae.success("*"):"",serialize:(e)=>Boolean(e)}}},Hj=(e)=>{let t=f(ie(),"Failed to read settings",e.json),o=Object.keys(t.profiles).map((n)=>({name:n,active:n===t.activeProfile}));M({schema:Jj,columns:["name","active"],header:"Profiles",emptyMessage:"No profiles configured."},o,{json:e.json})},Mj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(!o.profiles[e]){let n=`Profile '${e}' does not exist. Run 'sazabi profiles list' to see available profiles.`;if(t.json)v(n);p(n)}if(o.activeProfile=e,f(me(o),"Failed to write settings",t.json),t.json){j({activeProfile:e});return}H(`Active profile set to '${e}'.`)},Vj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(o.profiles[e]){let n=`Profile '${e}' already exists.`;if(t.json)v(n);p(n)}if(o.profiles[e]={},f(me(o),"Failed to write settings",t.json),t.json){j({created:e});return}H(`Created profile '${e}'.`)},qj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(!o.profiles[e]){let n=`Profile '${e}' does not exist.`;if(t.json)v(n);p(n)}if(e===o.activeProfile){let n=`Cannot delete the active profile '${e}'. Switch to a different profile first with 'sazabi profiles use <name>'.`;if(t.json)v(n);p(n)}if(delete o.profiles[e],f(me(o),"Failed to write settings",t.json),t.json){j({deleted:e});return}H(`Deleted profile '${e}'.`)},kS=W("profiles","Manage named CLI profiles").withSubcommands({list:P("list","List all profiles",async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}});Hj({json:t.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles list # List all profiles"]).build(),use:P("use","Set the active profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles use <name>");return p("Profile name is required. Usage: sazabi profiles use <name>")}Mj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles use staging # Switch to staging profile"]).build(),create:P("create","Create a new empty profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles create <name>");return p("Profile name is required. Usage: sazabi profiles create <name>")}Vj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles create staging # Create a new profile"]).build(),delete:P("delete","Delete a profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles delete <name>");return p("Profile name is required. Usage: sazabi profiles delete <name>")}qj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles delete staging # Delete a profile"]).build()}).withExamples(["sazabi profiles list # List all profiles","sazabi profiles use staging # Switch to staging profile","sazabi profiles create local # Create a new profile","sazabi profiles delete staging # Delete a profile"]).build();F();re();X();Ve();var Wj={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},region:{label:"Region",type:{kind:"string"}},active:{label:"Active",type:{kind:"custom",render:(e)=>e?ae.success("*"):"",serialize:(e)=>e}}},Yj={schema:Wj,columns:["id","name","region","active"],header:"Projects",emptyMessage:"No projects found."},Xj=async(e)=>{let t=N({tokenFlag:e.token,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=f(await o.projects.list({organizationId:t.organizationId}),"Failed to list projects",e.json).projects.map((i)=>({...i,active:i.id===t.projectId}));M(Yj,r,{json:e.json})},Zj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=f(ie(),"Failed to read settings",t.json),r=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await r.projects.get(e),"Failed to select project",t.json).project,a=i.organizationId!==n.profiles[ut(n)]?.activeOrganizationId,c=f(Re(n,{activeOrganizationId:i.organizationId,activeProjectId:i.id,...a&&{organizationName:void 0}}),"Failed to update profile",t.json);if(f(me(c),"Failed to persist active project",t.json),t.json){j({project:i});return}H(`Active project set to ${i.name}.`)},$S=W("projects","Manage projects").withSubcommands({list:P("list","List projects in the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Xj({token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects list # List projects in the active organization"]).build(),use:P("use","Set the active project for future commands",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Project ID is required.");return p("Project ID is required.")}await Zj(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build()}).withExamples(["sazabi projects list # List projects in the active organization","sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build();F();re();X();var Qj={runId:{label:"Run ID",type:{kind:"id"}},threadId:{label:"Thread ID",type:{kind:"id"}},status:{label:"Status",type:{kind:"string"}},completed:{label:"Completed",type:{kind:"boolean"}},messageId:{label:"Message ID",type:{kind:"nullable-string",emptyLabel:"(none)"}},response:{label:"Response",type:{kind:"nullable-string"}}},eE={layout:"sections",schema:Qj,primary:{title:"Run",fields:["runId","threadId","status","completed","messageId"]},secondary:[{title:"Response",field:"response"}]},tE=async(e,t={})=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),r=f(await n.runs.get(e),"Failed to get run",t.json),i=t.wait&&!r.completed?f(await ec({client:n,runId:e,threadId:r.threadId,timeoutMs:t.timeout,printProgress:!t.json}),"Failed to get run",t.json):r;if(U(eE,i,{json:t.json}),!t.json&&!i.completed)R(),Y(`Poll with: sazabi runs get ${i.runId}`)},wS=W("runs","Inspect deferred agent runs").withSubcommands({get:P("get","Get a deferred run by run ID",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Run ID is required. Usage: sazabi runs get <run-id>");return p("Run ID is required. Usage: sazabi runs get <run-id>")}if(o.length>1){let i=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${i}`);return p(`Unexpected arguments: ${i}`)}let r=t.timeout?Se(t.timeout,1,3600,"Timeout",t.json)*1000:void 0;await tE(n,{token:t.token,wait:t.wait,timeout:r,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<run-id>").withOptions({token:{type:"string",description:"Override authentication token"},wait:{type:"boolean",description:"Wait for terminal status and print the final result"},timeout:{type:"string",description:"Timeout in seconds to wait before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal","sazabi runs get <run-id> --wait --timeout 60 # Wait up to 60 seconds","sazabi runs get <run-id> --json # Output run state as JSON"]).build()}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal"]).build();F();X();Ve();var My=["apiBaseUrl","authBaseUrl","webBaseUrl","intakeBaseUrl","tailBaseUrl","apiDomain","webDomain","intakeDomain","tailDomain","forwardPublicKey"],_S=(e)=>{return My.includes(e)},rE=["apiBaseUrl","authBaseUrl","webBaseUrl","intakeBaseUrl","tailBaseUrl"],oE=(e)=>rE.includes(e),nE={apiBaseUrl:["http:","https:"],authBaseUrl:["http:","https:"],webBaseUrl:["http:","https:"],intakeBaseUrl:["http:","https:"],tailBaseUrl:["ws:","wss:","http:","https:"]},iE=(e,t)=>{let o=(()=>{try{return new URL(t)}catch{return null}})();if(!o)return se(`Invalid URL for ${e}: '${t}'`);let n=nE[e];if(!n.includes(o.protocol))return se(`Invalid protocol '${o.protocol}' for ${e}. Allowed: ${n.join(", ")}`);return ke(o.toString().replace(/\/+$/,""))},aE=(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=f(Ze(t),"Failed to resolve profile",e.json);if(e.json){j({success:!0,settingsFile:co,profile:o,settings:n});return}ne({"Settings file":co,"Active profile":o}),R();let r=Object.entries(n).filter(([,a])=>a!=null);if(r.length===0){Rt("No settings configured.");return}let i=r.map(([a,c])=>({key:a,value:String(c)})).sort((a,c)=>a.key.localeCompare(c.key));tt(i,[{header:"Key",key:"key",width:20},{header:"Value",key:"value"}],{header:"Settings"})},cE=(e,t,o={})=>{if(!_S(e)){let a=My.join(", "),c=`Invalid setting key: '${e}'. Valid keys: ${a}`;if(o.json){v(c);return}p(c);return}let n=t;if(oE(e)){let a=iE(e,t);if(!a.success){if(o.json){v(a.error);return}p(a.error);return}n=a.value}let r=f(ie(),"Failed to read settings",o.json),i=f(Re(r,{[e]:n}),"Failed to update profile",o.json);if(f(me(i),"Failed to write settings",o.json),o.json){j({success:!0,key:e,value:n});return}H(`Set ${e} to ${n}`)},lE=(e,t={})=>{if(!_S(e)){let r=My.join(", "),i=`Invalid setting key: '${e}'. Valid keys: ${r}`;if(t.json){v(i);return}p(i);return}let o=f(ie(),"Failed to read settings",t.json),n=f(Re(o,{[e]:void 0}),"Failed to update profile",t.json);if(f(me(n),"Failed to write settings",t.json),t.json){j({success:!0,key:e});return}H(`Cleared ${e}`)},OS=W("settings","Manage global CLI settings").withSubcommands({view:P("view","Show current CLI settings and file location",async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}});aE({json:t.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings view # Show current settings","sazabi settings view --json # Output as JSON"]).build(),set:P("set","Set a global configuration value",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0],r=o[1];if(!n){if(t.json)return v("Setting key is required. Usage: sazabi settings set <key> <value>");return p("Setting key is required. Usage: sazabi settings set <key> <value>")}if(!r){if(t.json)return v("Value is required. Usage: sazabi settings set <key> <value>");return p("Value is required. Usage: sazabi settings set <key> <value>")}cE(n,r,{json:t.json})}).withPositionalArgs("<key> <value>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings set apiBaseUrl https://api.example.com # Override a base URL (also: authBaseUrl, webBaseUrl, intakeBaseUrl, tailBaseUrl)"]).build(),unset:P("unset","Clear a global configuration value",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Setting key is required. Usage: sazabi settings unset <key>");return p("Setting key is required. Usage: sazabi settings unset <key>")}lE(n,{json:t.json})}).withPositionalArgs("<key>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings unset apiBaseUrl # Clear API base URL override","sazabi settings unset --json apiBaseUrl # Output as JSON"]).build()}).withExamples(["sazabi settings view # Show current settings","sazabi settings set apiBaseUrl https://api.example.com # Set API base URL","sazabi settings unset apiBaseUrl # Clear API base URL override"]).build();F();X();import*as US from"node:os";import*as RS from"node:path";import*as Ot from"node:path";var tc=["claude-code","codex","cursor","amp","opencode"],uE={"claude-code":{user:(e)=>Ot.join(e,".claude","skills"),project:(e)=>Ot.join(e,".claude","skills")},codex:{user:(e)=>Ot.join(e,".agents","skills"),project:(e)=>Ot.join(e,".agents","skills")},amp:{user:(e)=>Ot.join(e,".config","agents","skills"),project:(e)=>Ot.join(e,".agents","skills")},opencode:{user:(e)=>Ot.join(e,".config","opencode","skills"),project:(e)=>Ot.join(e,".opencode","skills")}},hE="Cursor does not support agent skills. Use Cursor Rules (.cursor/rules/*.mdc) instead. See https://cursor.com/docs/context/rules.",SS=(e)=>{if(e.agent==="cursor")return{kind:"unsupported",agent:"cursor",reason:hE};let t=uE[e.agent],o=e.scope==="user"?t.user(e.home):t.project(e.projectDir);return{kind:"supported",agent:e.agent,scope:e.scope,root:o}};jl();import{dirname as pE,resolve as vE}from"node:path";import{fileURLToPath as IE}from"node:url";var TS=`# Sazabi CLI Reference
|
|
4322
|
+
`)};B();re();X();B();var zz=/^(\d+)(s|m|h|d)$/u,jz=(e,t)=>{let o=zz.exec(e.trim());if(!o){if(t)return v("Duration must use s, m, h, or d units, for example 30m");return p("Duration must use s, m, h, or d units, for example 30m")}let n=Number(o[1]),r=o[2];return n*(r==="s"?1000:r==="m"?60000:r==="h"?3600000:86400000)},nS=(e,t,o)=>{let n=new Date(e);if(Number.isNaN(n.getTime())){let r=`${t} must be a valid ISO-8601 timestamp`;if(o)return v(r);return p(r)}return n.toISOString()},uo=(e)=>{if(e.last&&(e.from||e.to)){if(e.json)return v("Use either --last or --from/--to, not both");return p("Use either --last or --from/--to, not both")}if(e.last){let n=new Date,r=new Date(n.getTime()-jz(e.last,e.json));if(!Number.isFinite(r.getTime())||!Number.isFinite(n.getTime())){if(e.json)return v("--last is out of supported date range");return p("--last is out of supported date range")}return{startDate:r.toISOString(),endDate:n.toISOString()}}let t=e.from?nS(e.from,"--from",e.json):void 0,o=e.to?nS(e.to,"--to",e.json):void 0;if(t&&o&&new Date(t)>=new Date(o)){if(e.json)return v("--from must be before --to");return p("--from must be before --to")}return{startDate:t,endDate:o}};var Ez={patterns:{label:"Patterns",type:{kind:"custom",render:(e)=>`${Array.isArray(e)?e.length:0} patterns`,serialize:(e)=>e}},meta:{label:"Meta",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}}},Uz={layout:"field-list",schema:Ez,fields:["patterns","meta"]},Rz={severity:{label:"Severity",type:{kind:"custom",render:(e)=>typeof e==="string"&&e.length>0?bt(e):"(none)",serialize:(e)=>e}},occurrences:{label:"Occurrences",type:{kind:"number"},align:"right"},lastSeen:{label:"Last Seen",type:{kind:"nullable-date",emptyLabel:"(never)"}},pattern:{label:"Pattern",type:{kind:"truncated",maxLength:140}},representativeId:{label:"Representative",type:{kind:"nullable-string",emptyLabel:"(none)"}}},Kz={schema:Rz,columns:["severity","occurrences","lastSeen","pattern","representativeId"],header:{title:"Log patterns",variant:"search"},emptyMessage:"No matching log patterns."},Fz=(e)=>{let t=uo(e);return{...e.query?{query:e.query}:{},...e.severity?{severity:e.severity}:{},...t.startDate?{startDate:t.startDate}:{},...t.endDate?{endDate:t.endDate}:{},limit:e.limit??25}},iS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.patterns(Fz(e)),"Failed to query log patterns",e.json);if(e.json){U(Uz,n,{json:!0});return}Gz(n)},Gz=(e)=>{if(e.patterns.length>0)Y(`Returned ${e.meta.count} pattern${e.meta.count===1?"":"s"} in ${e.meta.took}ms`);J(Kz,e.patterns,{count:e.meta.count})};B();re();X();var Za=500,Bz=new Set(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]),Hz=(e)=>{if(e==="@timestamp")return"timestamp";return e},Qa=(e,t)=>{for(let o of t){let n=e[o];if(n===void 0||n===null)continue;if(typeof n==="string")return n;if(typeof n==="number"||typeof n==="boolean")return String(n)}return""},Mz=(e)=>{let t=Qa(e,["@timestamp","timestamp","time","ts","date"]);if(!t)return _e("(no time)");let o=new Date(t);if(Number.isNaN(o.getTime()))return t;return o.toISOString()},Jz=(e)=>{return Qa(e,["body","message","log","text","content","msg"])||_e("(no message)")},Vz=(e)=>{return Qa(e,["severity","level","log_level","priority"])},qz=(e)=>{return Qa(e,["service","service_name","serviceName","source"])},Wz=(e,t)=>{let o={};if(!t.omitSearch)o.search={query:e,mode:t.mode??"all",...t.searchFields?.length?{fields:t.searchFields}:{}};if(t.cursor!==void 0||t.limit!==void 0||t.all)o.pagination={limit:t.limit??(t.all?100:50),...t.cursor!==void 0?{cursor:t.cursor}:{}};if(t["sort-field"])o.sort={field:Hz(t["sort-field"]),direction:t["sort-direction"]??"desc"};if(t.select){let r=t.select.split(",").map((i)=>i.trim()).filter((i)=>i.length>0);if(r.length>0)o.select=r}let n=Qz(t);if(!n.ok)return{ok:!1,errors:n.errors};if(n.filters.length>0)o.filters=n.filters;return{ok:!0,input:o}};var Yz=(e)=>{if(e==="true")return!0;if(e==="false")return!1;let t=Number(e);if(e.trim()!==""&&Number.isFinite(t))return t;return e},Xz=(e)=>{let t=Number(e);if(e.trim()!==""&&Number.isFinite(t))return t;return e},Zz=(e)=>{let t=e.indexOf("=");if(t<=0)return{ok:!1,error:"Filter must use <field>.<op>=<value>"};let o=e.slice(0,t),n=e.slice(t+1),r=o.lastIndexOf(".");if(r<=0||r===o.length-1)return{ok:!1,error:"Filter must use <field>.<op>=<value>"};let i=o.slice(0,r),a=o.slice(r+1);if(!Bz.has(a))return{ok:!1,error:`Unsupported filter operator: ${a}`};if(a==="in"){let c=n.split(",").map((u)=>Xz(u.trim())).filter((u)=>u!=="");if(c.length===0)return{ok:!1,error:"in filters must include at least one value"};return{ok:!0,filter:{field:i,op:a,value:c}}}if(a==="between"){let c=n.includes("..")?n.split(".."):n.split(",");if(c.length!==2)return{ok:!1,error:"between filters must use <from>..<to>"};let[u,h]=c.map((s)=>s.trim());if(!u||!h)return{ok:!1,error:"between filters must use <from>..<to>"};return{ok:!0,filter:{field:i,op:a,value:{from:u,to:h}}}}if(a==="exists"){if(n!=="true"&&n!=="false")return{ok:!1,error:"exists filters must use true or false"};return{ok:!0,filter:{field:i,op:a,value:n==="true"}}}return{ok:!0,filter:{field:i,op:a,value:Yz(n)}}},Qz=(e)=>{let t=[],o=[],n=uo({from:e.from,to:e.to,last:e.last,json:e.json});if(n.startDate&&n.endDate)t.push({field:"timestamp",op:"between",value:{from:n.startDate,to:n.endDate}});else if(n.startDate)t.push({field:"timestamp",op:"gte",value:n.startDate});else if(n.endDate)t.push({field:"timestamp",op:"lte",value:n.endDate});if(e.service)t.push({field:"service",op:"eq",value:e.service});if(e.severity)t.push({field:"severity",op:"eq",value:e.severity});if(e.env)t.push({field:"environment",op:"eq",value:e.env});if(e.traceId)t.push({field:"trace_id",op:"eq",value:e.traceId});for(let r of e.filters??[]){let i=Zz(r);if(i.ok)t.push(i.filter);else o.push(`${r}: ${i.error}`)}if(o.length>0)return{ok:!1,errors:o};return{ok:!0,filters:t}},aS=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.project,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:t.json}),r=Wz(e,t);if(!r.ok){if(t.json)return v({success:!1,error:"Invalid log query filters",errors:r.errors});return p(`Invalid log query filters: ${r.errors.join("; ")}`)}let i=r.input,a=t.all?await ej(n,i,t):f(await n.logs.query(i),"Failed to query logs",t.json);if(t.json){j(a);return}tj(a)},ej=async(e,t,o)=>{let n=[],r=t.pagination?.cursor,i=0;do{let a={...t,pagination:{limit:t.pagination?.limit??o.limit??100,...r?{cursor:r}:{}}},c=f(await e.logs.query(a),"Failed to query logs",o.json);n.push(...c.data),i+=c.meta.took,r=c.nextCursor}while(r);return{data:n,nextCursor:null,meta:{count:n.length,took:i}}},tj=(e)=>{let{data:t,nextCursor:o,meta:n}=e;if(t.length===0){Rt("No matching log rows.");return}Y(`Returned ${n.count} row${n.count===1?"":"s"} in ${n.took}ms`);let r=t.map((i)=>{let a=i,c=Vz(a);return{time:Mz(a),severity:c?bt(c,c):ae.muted(_e("(sev)")),service:qz(a)||_e("(service)"),message:qe(Jz(a),200)}});tt(r,[{header:"Time (UTC)",key:"time"},{header:"Severity",key:"severity"},{header:"Service",key:"service"},{header:"Message",key:"message"}],{header:{title:"Log query results",variant:"search",count:n.count}}),yt({type:"cursor",nextCursor:o})};B();re();X();var rj={backend:{label:"Backend",type:{kind:"custom",render:(e)=>{let t=e;return`${t.name} (${t.id})`},serialize:(e)=>e}},features:{label:"Features",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},commands:{label:"Commands",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},queryableFields:{label:"Queryable",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},searchableFields:{label:"Searchable",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},observedServiceNames:{label:"Observed Services",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},observedAttributeKeys:{label:"Observed Attributes",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"(none)",serialize:(e)=>e}},schemaContext:{label:"Schema Context",type:{kind:"custom",render:(e)=>e?JSON.stringify(e):"(none)",serialize:(e)=>e}}},oj={layout:"field-list",schema:rj,fields:["backend","features","commands","queryableFields","searchableFields","observedServiceNames","observedAttributeKeys","schemaContext"]},cS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.schema({}),"Failed to fetch log schema",e.json);if(e.json){U(oj,n,{json:!0});return}nj(n)},nj=(e)=>{if(ce("Log backend"),ne({Backend:`${e.backend.name} (${e.backend.id})`,Kind:e.backend.kind,Commands:e.commands.join(", "),Features:e.features.join(", ")||"(none)"}),ce("Normalized fields"),ne({Queryable:e.queryableFields.join(", ")||"(none)",Searchable:e.searchableFields.join(", ")||"(none)"}),e.observedServiceNames.length>0)tt(e.observedServiceNames.map((t)=>({service:qe(t,80)})),[{header:"Observed Services",key:"service"}]);if(e.observedAttributeKeys.length>0)tt(e.observedAttributeKeys.map((t)=>({attribute:qe(t,80)})),[{header:"Observed Attributes",key:"attribute"}])};B();Ty();In();re();X();Ve();var lS=["ERROR","WARN","INFO","DEBUG","TRACE"],ij="15006",aj=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},cj=(e)=>{let t=aj(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},lj=(e)=>{let t=new Date(e.timestamp).toISOString().split("T")[1],o=bt(e.severity,e.severity.padEnd(7)),n=ae.cyan(e.service.padEnd(20)),r=e.body.length>120?`${e.body.substring(0,117)}...`:e.body;return`[${t}] ${o} ${n} ${r}`},hS=async(e)=>{let t=f($t(),"Failed to read settings"),o=e.json??!1,n=gj(t,e.apiBaseUrl),r=hj(e.severities,o),i=Hy(e.services),a=Hy(e.environments),c=N({tokenFlag:e.token,jsonMode:o}),u=await bj({apiBaseUrlFlag:e.apiBaseUrl,jsonMode:o,projectId:c.projectId,regionFlag:e.region,token:c.token}),h=ft({token:c.token,projectId:c.projectId,baseUrl:n,tailBaseUrl:dj(t,e.tailBaseUrl,u,n)}),s={severities:r,services:i,environments:a,searchTerm:e.search,traceId:e.traceId},g=new AbortController,b,y=0,_,S,H=()=>{b="interrupted",g.abort()};if(!o)uj({environments:a,region:u,search:e.search,services:i,severities:r,traceId:e.traceId});let F=f(await h.logs.tail({...c.projectId?{projectId:c.projectId}:{},...u?{region:u}:{},filters:s,signal:g.signal}),"Failed to tail logs",o);if(!o)M("Connected! Waiting for logs..."),R();if(process.on("SIGINT",H),e.duration&&e.duration>0)S=setTimeout(()=>{b="duration",g.abort()},e.duration*1000);try{for await(let le of F){if(y+=1,o){j(le);continue}Gt(lj(le))}}catch(le){_=le instanceof Error?le:Error(String(le))}finally{if(process.removeListener("SIGINT",H),S)clearTimeout(S)}if(_){if(o)return v(_.message);R(),bo(),Tt(_.message);return}if(o)return;if(R(),b==="duration")Y("Duration reached, closing connection...");if(b==="interrupted")Y("Interrupted, closing connection...");bo(),Y(`Connection closed. Received ${y} logs.`)},uj=(e)=>{if(ce("Tailing logs..."),e.severities?.length)Y(`Severities: ${e.severities.join(", ")}`);if(e.services?.length)Y(`Services: ${e.services.join(", ")}`);if(e.environments?.length)Y(`Environments: ${e.environments.join(", ")}`);if(e.search)Y(`Search: ${e.search}`);if(e.traceId)Y(`Trace ID: ${e.traceId}`);if(e.region)Y(`Region: ${e.region}`);bo(),R()},Hy=(e)=>{if(!e)return;let t=e.split(",").map((o)=>o.trim()).filter((o)=>o.length>0);return t.length>0?t:void 0},hj=(e,t)=>{let o=Hy(e)?.map((i)=>i.toUpperCase());if(!o)return;let n=o.find((i)=>!lS.includes(i));if(!n)return o;let r=`Invalid severity: ${n}. Valid values: ${lS.join(", ")}`;if(t)return v(r);return p(r)},gj=(e,t)=>{return ht({cliFlag:t,globalUrl:e.apiBaseUrl,globalDomain:e.apiDomain,buildUrlFromDomain:(o)=>`https://api.${o}`,defaultUrl:"https://api.sazabi.com"})},sj=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!cj(t.hostname))return;return t.protocol="ws:",t.port=ij,t.pathname="/tail",t.search="",t.hash="",t.toString()},dj=(e,t,o,n)=>{if(t)return t;if(e.tailBaseUrl)return e.tailBaseUrl;let r=sj(n);if(r)return r;if(e.tailDomain&&o)return`wss://${o}.tail.${e.tailDomain}`;if(o)return`wss://${o}.tail.sazabi.com`;return},bj=async(e)=>{if(e.regionFlag)return uS(e.regionFlag,e.jsonMode);if(!e.projectId)return;let t=await Ja({token:e.token,projectId:e.projectId,apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return uS(t.region,e.jsonMode)},uS=(e,t)=>{if(Ba(e))return e;let o=`Log tail is not supported for project region ${e}.`;if(t)return v(o);return p(o)};B();re();X();var yj={total:{label:"Total",type:{kind:"number"}},startDate:{label:"Start",type:{kind:"date"}},endDate:{label:"End",type:{kind:"date"}},interval:{label:"Interval",type:{kind:"string"}},series:{label:"Series",type:{kind:"custom",render:(e)=>`${Array.isArray(e)?e.length:0} series`,serialize:(e)=>e}}},mj={layout:"field-list",schema:yj,fields:["total","startDate","endDate","interval","series"]},pj={group:{label:"Group",type:{kind:"string"}},total:{label:"Total",type:{kind:"number"},align:"right"},points:{label:"Points",type:{kind:"custom",render:(e)=>Array.isArray(e)?String(e.length):"0",serialize:(e)=>e},align:"right"}},vj={schema:pj,columns:["group","total","points"],header:{title:"Log volume",variant:"results"},emptyMessage:"No log volume found."},Ij=(e)=>{if(e==="service")return"service_name";if(e==="severity")return"severity_text";return e},fj=(e)=>{let t=new Date,o=uo(e),n=o.endDate??t.toISOString();return{startDate:o.startDate??new Date(new Date(n).getTime()-3600000).toISOString(),endDate:n,...e.interval?{interval:e.interval}:{},...e.groupBy?{groupBy:Ij(e.groupBy)}:{},filters:{...e.service?{service_name:e.service}:{},...e.severity?{severity_text:e.severity}:{},...e.env?{environment:e.env}:{}}}},gS=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.project,jsonMode:e.json}),o=L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:e.json}),n=f(await o.logs.volume(fj(e)),"Failed to query log volume",e.json);if(e.json){U(mj,n,{json:!0});return}kj(n)},kj=(e)=>{if(e.series.length>0)Y(`Total ${e.total} logs from ${e.startDate} to ${e.endDate} at ${e.interval}`);J(vj,e.series,{count:e.series.length})};var sS=(e,t)=>{let o=[],n=`--${t}=`;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===void 0)continue;if(i===`--${t}`){let a=e[r+1];if(a!==void 0&&!a.startsWith("-"))o.push(a),r+=1;continue}if(i.startsWith(n))o.push(i.slice(n.length))}return o},dS=W("logs","Stream, search, and forward logs").withSubcommands({schema:P("schema","Describe the active log backend and query fields",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"}}),o={token:t.token,project:t.project,json:t.json,"api-base-url":t["api-base-url"]};await cS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"}}).withExamples(["sazabi logs schema # Show backend, commands, and fields","sazabi logs schema --json # Machine-readable schema context"]).build(),tail:P("tail","Stream logs from current project in real-time",async(e)=>{let{values:t}=T(e,{...V,severities:{type:"string"},services:{type:"string"},environments:{type:"string"},search:{type:"string"},"trace-id":{type:"string"},duration:{type:"string"},"tail-base-url":{type:"string"},region:{type:"string"}}),o={};if(t.token)o.token=t.token;if(t.severities)o.severities=t.severities;if(t.services)o.services=t.services;if(t.environments)o.environments=t.environments;if(t.search)o.search=t.search;if(t["trace-id"])o.traceId=t["trace-id"];if(t.duration)o.duration=Se(t.duration,1,Number.MAX_SAFE_INTEGER,"Duration",t.json);if(t.json)o.json=!0;if(t["tail-base-url"])o.tailBaseUrl=t["tail-base-url"];if(t.region)o.region=t.region;if(t["api-base-url"])o.apiBaseUrl=t["api-base-url"];await hS(o)}).withOptions({...q,severities:{type:"string",description:"Filter by comma-separated severities (e.g., ERROR,WARN,INFO)"},services:{type:"string",description:"Filter by comma-separated service names"},environments:{type:"string",description:"Filter by comma-separated environments"},search:{type:"string",description:"Filter by search term (case-insensitive)"},"trace-id":{type:"string",description:"Filter by trace ID"},duration:{type:"string",description:"Duration to tail in seconds (default: unlimited)"},"tail-base-url":{type:"string",description:"Override tail WebSocket base URL"},region:{type:"string",description:"Override project region"}}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings","sazabi logs tail --services api,worker # Tail specific services","sazabi logs tail --environments production,staging # Tail specific environments",'sazabi logs tail --search "database" # Tail logs matching search term',"sazabi logs tail --json # Output as JSON"]).build(),query:P("query","Search stored logs in the current project (POST /logs/query)",async(e)=>{let{values:t,positionals:o}=T(e,{...V,project:{type:"string"},limit:{type:"string"},cursor:{type:"string"},mode:{type:"string"},"sort-field":{type:"string"},"sort-direction":{type:"string"},select:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},service:{type:"string"},severity:{type:"string"},env:{type:"string"},"trace-id":{type:"string"},filter:{type:"string"},"search-field":{type:"string"},"query-all":{type:"boolean"},all:{type:"boolean"}},{allowPositionals:!0}),n=o.join(" ").trim(),r=sS(e,"filter"),i=sS(e,"search-field"),a=Boolean(t.from||t.to||t.last||t.service||t.severity||t.env||t["trace-id"])||r.length>0;if(!n&&!t["query-all"]&&!a){if(t.json)return v("Search text, a structured filter, or --query-all is required. Usage: sazabi logs query <search-text> [options]");return p("Search text, a structured filter, or --query-all is required. Usage: sazabi logs query <search-text> [options]")}if(n.length>Za){if(t.json)return v(`Search text must be at most ${Za} characters`);return p(`Search text must be at most ${Za} characters`)}if(n&&t["query-all"]){if(t.json)return v("Pass either a search phrase or --query-all, not both");return p("Pass either a search phrase or --query-all, not both")}if(t.mode&&!n){if(t.json)return v("--mode requires search text (search is omitted)");return p("--mode requires search text (search is omitted)")}let c={token:t.token,project:t.project,json:t.json,"api-base-url":t["api-base-url"],omitSearch:t["query-all"]===!0||!n,from:t.from,to:t.to,last:t.last,service:t.service,severity:t.severity,env:t.env,traceId:t["trace-id"],filters:r,searchFields:i,all:t.all};if(t.limit)c.limit=Se(t.limit,1,1000,"Limit",t.json);if(t.cursor)c.cursor=t.cursor;if(t.mode)c.mode=st(t.mode,["any","all","phrase"],"Mode",t.json);if(t["sort-field"])c["sort-field"]=t["sort-field"];if(t["sort-direction"]&&!t["sort-field"]){if(t.json)return v("--sort-direction requires --sort-field");return p("--sort-direction requires --sort-field")}if(t["sort-direction"])c["sort-direction"]=st(t["sort-direction"],["asc","desc"],"Sort direction",t.json);if(t.select)c.select=t.select;await aS(n,c)}).withPositionalArgs("[search-text]").withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},limit:{type:"string",description:"Max rows to return (1-1000, default: 50)"},cursor:{type:"string",description:"Pagination cursor from a previous response"},mode:{type:"string",description:"Token match mode: any, all, or phrase (default: all)"},"sort-field":{type:"string",description:"Field to sort by (e.g. @timestamp)"},"sort-direction":{type:"string",description:"Sort direction: asc or desc (default: desc)"},select:{type:"string",description:"Comma-separated fields to return"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},service:{type:"string",description:"Filter by service name"},severity:{type:"string",description:"Filter by severity, for example ERROR"},env:{type:"string",description:"Filter by deployment environment"},"trace-id":{type:"string",description:"Filter by trace ID"},filter:{type:"string",description:"Structured filter as <field>.<op>=<value>; repeatable"},"search-field":{type:"string",description:"Restrict full-text search to a field; repeatable"},"query-all":{type:"boolean",description:"Omit full-text search and return the API default slice (sort/pagination only; server may require other filters)"},all:{type:"boolean",description:"Fetch all pages until the server returns no cursor"}}).withExamples(['sazabi logs query "connection refused" --last 1h --service api --severity ERROR # Search recent API errors',"sazabi logs query --trace-id abc123 --select timestamp,service,severity,body # Find logs for one trace","sazabi logs query --filter http_status_code.gte=500 --limit 100 --json # Machine-readable structured filter","sazabi logs query error --mode any --limit 100 # Match any token with a larger page","sazabi logs query --query-all --limit 20 --sort-field @timestamp # Recent rows without full-text search","sazabi logs query slow --json # Machine-readable output"]).build(),patterns:P("patterns","Search normalized log patterns for discovery",async(e)=>{let{values:t,positionals:o}=T(e,{...V,project:{type:"string"},severity:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},limit:{type:"string"}},{allowPositionals:!0}),n={token:t.token,project:t.project,query:o.join(" ").trim()||void 0,severity:t.severity,from:t.from,to:t.to,last:t.last,json:t.json,"api-base-url":t["api-base-url"]};if(t.limit)n.limit=Se(t.limit,1,100,"Limit",t.json);await iS(n)}).withPositionalArgs("[pattern-text]").withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},severity:{type:"string",description:"Filter by severity, for example ERROR"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},limit:{type:"string",description:"Max patterns to return (1-100, default: 25)"}}).withExamples(['sazabi logs patterns "connection refused" --severity ERROR --limit 25 # Find recurring error patterns',"sazabi logs patterns --last 24h --json # Export recent patterns"]).build(),volume:P("volume","Summarize log volume by time and optional dimension",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"},from:{type:"string"},to:{type:"string"},last:{type:"string"},interval:{type:"string"},"group-by":{type:"string"},service:{type:"string"},severity:{type:"string"},env:{type:"string"}}),o={token:t.token,project:t.project,from:t.from,to:t.to,last:t.last,service:t.service,severity:t.severity,env:t.env,json:t.json,"api-base-url":t["api-base-url"]};if(t.interval)o.interval=st(t.interval,["1m","5m","15m","1h"],"Interval",t.json);if(t["group-by"])o.groupBy=st(t["group-by"],["service","severity","environment"],"Group by",t.json);await gS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},from:{type:"string",description:"Start time as ISO-8601 timestamp"},to:{type:"string",description:"End time as ISO-8601 timestamp"},last:{type:"string",description:"Relative time window, for example 30m, 6h, or 7d"},interval:{type:"string",description:"Bucket interval: 1m, 5m, 15m, or 1h"},"group-by":{type:"string",description:"Group by service, severity, or environment"},service:{type:"string",description:"Filter by service name"},severity:{type:"string",description:"Filter by severity, for example ERROR"},env:{type:"string",description:"Filter by deployment environment"}}).withExamples(["sazabi logs volume --last 6h --group-by service # Compare service log volume","sazabi logs volume --last 24h --severity ERROR --interval 15m --json # Export error volume"]).build(),"native-query":P("native-query","Run a backend-native read-only log query",async(e)=>{let{values:t}=T(e,{...V,project:{type:"string"},query:{type:"string"},file:{type:"string",short:"f"}}),o={token:t.token,project:t.project,query:t.query,file:t.file,json:t.json,"api-base-url":t["api-base-url"]};await oS(o)}).withOptions({...q,project:{type:"string",description:"Override project ID (default: active project)"},query:{type:"string",description:"Backend-native query text"},file:{type:"string",short:"f",description:"Read backend-native query text from a file"}}).withExamples(['sazabi logs native-query --query "SELECT service_name, count() FROM log_volume_per_minute GROUP BY service_name LIMIT 20" # Run backend-native query text',"sazabi logs native-query --file investigation.sql --json # Run a query from a file"]).build(),forward:P("forward","Forward plaintext logs to current project",async(e)=>{let{values:t}=T(e,{...V,file:{type:"string",short:"f"},follow:{type:"boolean"},"batch-size":{type:"string"},"intake-base-url":{type:"string"},"public-key":{type:"string"},region:{type:"string"}}),o={};if(t.token)o.token=t.token;if(t.file)o.file=t.file;if(t.follow)o.follow=t.follow;if(t["batch-size"])o.batchSize=Se(t["batch-size"],1,Number.MAX_SAFE_INTEGER,"Batch size",t.json);if(t["api-base-url"])o.apiBaseUrl=t["api-base-url"];if(t["intake-base-url"])o.intakeBaseUrl=t["intake-base-url"];if(t.region)o.region=t.region;if(t["public-key"])o.publicKey=t["public-key"];await rS({...o,json:t.json})}).withOptions({...q,json:{type:"boolean",description:"Output a final JSON summary"},file:{type:"string",short:"f",description:"Read from file instead of stdin"},follow:{type:"boolean",description:"Follow file for new lines (like tail -f)"},"batch-size":{type:"string",description:"Number of logs to batch before sending (default: 100)"},"intake-base-url":{type:"string",description:"Override intake base URL"},"public-key":{type:"string",description:"Use this public key value (skip creating/storing)"},region:{type:"string",description:"Override project region"}}).withExamples(['echo "Log message" | sazabi logs forward # Forward from stdin',"sazabi logs forward --file app.log # Forward from file","sazabi logs forward --file app.log --follow # Forward file with tail -f behavior","sazabi logs forward --file app.log --batch-size 50 # Forward with custom batch size"]).build()}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings",'sazabi logs query "timeout" # Search stored logs',"sazabi logs forward --file app.log # Forward from file"]).build();B();re();X();var bS={membershipId:{label:"Membership ID",type:{kind:"string"}},userId:{label:"User ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"nullable-string"}},email:{label:"Email",type:{kind:"string"}},role:{label:"Role",type:{kind:"string"}}},$j={schema:bS,columns:["membershipId","userId","name","email","role"],header:"Members",emptyMessage:"No members found."},wj={layout:"field-list",schema:bS,fields:["membershipId","userId","name","email","role"]},_j=async(e)=>{let t=N({tokenFlag:e.token,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.members.list({organizationId:t.organizationId}),"Failed to list members",e.json);J($j,n.members,{json:e.json})},Oj=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.members.updateRole(e,t.role,o.organizationId),"Failed to update member role",t.json);U(wj,r.member,{json:t.json})},Sj=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.members.remove(e,o.organizationId),"Failed to remove member",t.json);if(t.json){j(r);return}M(`Removed ${r.removedUserId} from the active organization.`)},yS=W("members","Manage organization members").withSubcommands({list:P("list","List members in the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await _j({token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members list # List members in the active organization"]).build(),"update-role":P("update-role","Update one member's organization role",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("User ID is required.");return p("User ID is required.")}if(t.role!=="admin"&&t.role!=="member"){if(t.json)return v("Role must be either 'admin' or 'member'.");return p("Role must be either 'admin' or 'member'.")}await Oj(n,{token:t.token,organizationId:t["organization-id"],role:t.role,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},role:{type:"string",description:"New role: admin or member"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members update-role user_123 --role admin # Promote a member to admin"]).build(),remove:P("remove","Remove one member from the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("User ID is required.");return p("User ID is required.")}await Sj(n,{token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members remove user_123 # Remove a member from the active organization"]).build()}).withExamples(["sazabi members list # List members in the active organization","sazabi members update-role user_123 --role admin # Promote a member to admin","sazabi members remove user_123 # Remove a member from the active organization"]).build();B();re();X();B();re();X();X();var Tj=2000,ec=async(e)=>{let t=e.pollIntervalMs??Tj,o=Date.now(),n=!1,r={completed:!1,threadId:e.threadId,runId:e.runId,status:"processing",response:null};while(!0){let i=await e.client.runs.get(e.runId);if(!i.success){if(!Aj(i))return My(e.printProgress,n),i}else if(r=i.value,i.value.completed)return My(e.printProgress,n),i;if(e.timeoutMs!==void 0&&Date.now()-o>=e.timeoutMs)return My(e.printProgress,n),ke(r);n=Pj(e.printProgress,n),await Ya(t)}},Pj=(e,t)=>{if(!e)return t;if(!t)process.stdout.write(`
|
|
4323
|
+
`);return process.stdout.write("."),!0},My=(e,t)=>{if(!e||!t)return;process.stdout.write(`
|
|
4324
|
+
`)},Aj=(e)=>{return e.statusCode===404};var Dj={threadId:{label:"Thread ID",type:{kind:"id"}},messageId:{label:"Message ID",type:{kind:"nullable-string",emptyLabel:"(pending)"}},url:{label:"URL",type:{kind:"nullable-string"},get:(e)=>e.threadUrl??null},runId:{label:"Run ID",type:{kind:"id"}},status:{label:"Status",type:{kind:"string"}},pollWith:{label:"Poll with",type:{kind:"string"},get:(e)=>`sazabi runs get ${e.runId}`},response:{label:"Response",type:{kind:"nullable-string"},get:(e)=>e.response}},Nj={layout:"sections",schema:Dj,primary:{title:"Thread",fields:["threadId","messageId","url","runId","status","pollWith"]},secondary:[{title:"Response",field:"response"}]},pS=async(e,t={})=>{let o=Date.now(),n=N({tokenFlag:t.token,jsonMode:t.json}),r=L({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),i=await Lj({message:e,threadId:t.threadId,projectId:n.projectId,json:t.json,client:r,wait:t.wait,timeoutMs:t.timeout});if(t.wait&&i.status==="processing"){let a=t.timeout===void 0?void 0:Math.max(0,t.timeout-(Date.now()-o)),c=f(await ec({client:r,runId:i.runId,threadId:i.threadId,timeoutMs:a,printProgress:!t.json}),"Failed to get run",t.json);i={...i,status:c.status,response:c.response,messageId:i.messageId??c.messageId}}U(Nj,i,{json:t.json})},Lj=async(e)=>{if(e.threadId){let o=f(await e.client.messages.append(e.threadId,e.message,e.wait??!1,mS(e.timeoutMs)),"Failed to send message",e.json);return{threadId:e.threadId,runId:o.result.runId,messageId:o.result.messageId,status:o.result.status,response:o.result.response,threadUrl:e.projectId?wt(e.projectId,e.threadId,void 0,o.result.messageId):void 0}}let t=f(await e.client.threads.create({message:e.message,...e.projectId?{projectId:e.projectId}:{},wait:e.wait??!1,timeoutSeconds:mS(e.timeoutMs)}),"Failed to create thread",e.json);return{threadId:t.result.threadId,runId:t.result.runId,messageId:t.result.messageId,status:t.result.status,response:t.result.response,threadUrl:e.projectId?wt(e.projectId,t.result.threadId,void 0,t.result.messageId):void 0}},mS=(e)=>{if(e===void 0)return 20;return Math.max(1,Math.min(Math.ceil(e/1000),20))};var Cj={id:{label:"ID",type:{kind:"string"}},role:{label:"Role",type:{kind:"role"}},content:{label:"Content",type:{kind:"custom",render:(e)=>{let o=e.find((n)=>n.type==="message"&&Boolean(n.message));return o?qe(o.message):_e("(no text)")}}},createdAt:{label:"Created",type:{kind:"date"}}},xj={schema:Cj,columns:["id","role","content","createdAt"],header:"Messages",emptyMessage:"No messages found."},zj={id:{label:"ID",type:{kind:"string"}},threadTitle:{label:"Thread",type:{kind:"nullable-string",emptyLabel:"(no title)"}},role:{label:"Role",type:{kind:"role"}},content:{label:"Content",type:{kind:"custom",render:(e)=>qe(e)}},score:{label:"Score",align:"right",type:{kind:"custom",render:(e)=>e!=null?e.toFixed(2):"-"}}},jj={schema:zj,columns:["id","threadTitle","role","content","score"],header:{title:"Search Results",variant:"search"},emptyMessage:"No matching messages found."},Ej=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{messages:r,nextCursor:i}=f(await n.messages.list(e,{limit:t.limit,cursor:t.cursor}),"Failed to list messages",t.json);J(xj,r,{json:t.json,nextCursor:i})},Uj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{messages:r,pagination:i}=f(await n.search.messages({query:e,limit:t.limit,page:t.page,threadId:t.threadId,role:t.role}),"Failed to search messages",t.json);if(t.json){j({messages:r,pagination:i});return}J(jj,r,{count:i.totalResults}),yt({type:"page",page:i.page,totalPages:i.totalPages})},vS=W("messages","Send, list, and search messages").withSubcommands({send:P("send","Send a message (creates new thread if --thread-id omitted)",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"thread-id":{type:"string",short:"t"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]");return p("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]")}let r=t.timeout?Se(t.timeout,1,3600,"Timeout",t.json)*1000:void 0,i={token:t.token,threadId:t["thread-id"],wait:t.wait,timeout:r,json:t.json,apiBaseUrl:t["api-base-url"]};await pS(n,i)}).withPositionalArgs("<message>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",short:"t",description:"Thread ID to append to (creates new thread if omitted)"},wait:{type:"boolean",description:"Wait for assistant response and print it"},timeout:{type:"string",description:"Timeout in seconds to wait for response before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Hello' --thread-id abc123 # Append to existing thread","sazabi messages send 'Hello' -t abc123 --wait # Append and wait for reply","sazabi messages send 'Hello' --wait # New thread, wait for reply","sazabi messages send 'Hello' --wait --timeout 120 # Wait up to 2 minutes"]).build(),list:P("list","List messages in a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi messages list <thread-id>");return p("Thread ID is required. Usage: sazabi messages list <thread-id>")}if(o.length>1){let i=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${i}`);return p(`Unexpected arguments: ${i}`)}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.cursor)r.cursor=t.cursor;await Ej(n,r)}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of messages to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages list <thread-id> # List all messages in thread","sazabi messages list <thread-id> --limit 20 # List with custom limit","sazabi messages list <thread-id> --cursor xyz # List next page"]).build(),search:P("search","Search messages in current project",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},"thread-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Search query is required. Usage: sazabi messages search <query>");return p("Search query is required. Usage: sazabi messages search <query>")}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.page)r.page=Se(t.page,1,Number.MAX_SAFE_INTEGER,"Page",t.json);if(t["thread-id"])r.threadId=t["thread-id"];if(t.role)r.role=st(t.role,["user","assistant"],"Role",t.json);await Uj(n,r)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},"thread-id":{type:"string",description:"Filter messages by thread ID"},role:{type:"string",description:"Filter by role: user or assistant"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi messages search "error handling" # Search messages','sazabi messages search "bug" --limit 50 # Search with limit','sazabi messages search "user input" --role user # Search user messages only','sazabi messages search "response" --thread-id thread-123 # Search in specific thread']).build()}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Follow up' -t <thread-id> # Append to thread","sazabi messages list <thread-id> # List messages in thread",'sazabi messages search "error" # Search messages']).build();B();re();X();Ve();var IS={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},slug:{label:"Slug",type:{kind:"string"}},role:{label:"Role",type:{kind:"nullable-string"}}},Rj={schema:IS,columns:["id","name","slug","role"],header:"Organizations",emptyMessage:"No organizations found."},Kj={layout:"field-list",schema:IS,fields:["id","name","slug","role"]},Fj=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.organizations.list(),"Failed to list organizations",e.json);J(Rj,n.organizations,{json:e.json})},Gj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=f(ie(),"Failed to read settings",t.json),r=L({token:o.token,organizationId:e,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await r.organizations.get(e),"Failed to select organization",t.json).organization,a=f(await r.projects.list({organizationId:e}),"Failed to fetch organization projects",t.json).projects,c=f(Ze(n),"Failed to resolve profile",t.json),u=f(Re(n,{activeOrganizationId:i.id,organizationName:i.name,activeProjectId:c.activeProjectId&&a.some((h)=>h.id===c.activeProjectId)?c.activeProjectId:a[0]?.id}),"Failed to update profile",t.json);if(f(me(u),"Failed to persist active organization",t.json),t.json){j({organization:i,activeProjectId:f(Ze(u),"Failed to resolve profile",t.json).activeProjectId});return}M(`Active organization set to ${i.name}.`)},Bj=async(e,t)=>{let o=N({tokenFlag:t.token,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.organizations.rename(e,o.organizationId),"Failed to rename organization",t.json);Hj(r.organization.id,r.organization.name),U(Kj,r.organization,{json:t.json})},Hj=(e,t)=>{let o=ie();if(!o.success)return;let n=o.value,r=Ze(n);if(!r.success)return;if(r.value.activeOrganizationId!==e)return;let i=Re(n,{organizationName:t});if(i.success)me(i.value)},fS=W("organizations","Manage organizations").withSubcommands({list:P("list","List organizations available to the current credential",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Fj({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations list # List available organizations"]).build(),use:P("use","Set the active organization for future commands",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Organization ID is required.");return p("Organization ID is required.")}await Gj(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations use org_123 # Set the active organization"]).build(),rename:P("rename","Rename the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Organization name is required.");return p("Organization name is required.")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await Bj(n,{token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi organizations rename "Observed Platform" # Rename the active organization']).build()}).withExamples(["sazabi organizations list # List available organizations","sazabi organizations use org_123 # Set the active organization",'sazabi organizations rename "Observed Platform" # Rename the active organization']).build();B();X();Ve();var Mj={name:{label:"Profile",type:{kind:"string"}},active:{label:"Active",type:{kind:"custom",render:(e)=>e?ae.success("*"):"",serialize:(e)=>Boolean(e)}}},Jj=(e)=>{let t=f(ie(),"Failed to read settings",e.json),o=Object.keys(t.profiles).map((n)=>({name:n,active:n===t.activeProfile}));J({schema:Mj,columns:["name","active"],header:"Profiles",emptyMessage:"No profiles configured."},o,{json:e.json})},Vj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(!o.profiles[e]){let n=`Profile '${e}' does not exist. Run 'sazabi profiles list' to see available profiles.`;if(t.json)v(n);p(n)}if(o.activeProfile=e,f(me(o),"Failed to write settings",t.json),t.json){j({activeProfile:e});return}M(`Active profile set to '${e}'.`)},qj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(o.profiles[e]){let n=`Profile '${e}' already exists.`;if(t.json)v(n);p(n)}if(o.profiles[e]={},f(me(o),"Failed to write settings",t.json),t.json){j({created:e});return}M(`Created profile '${e}'.`)},Wj=(e,t)=>{let o=f(ie(),"Failed to read settings",t.json);if(!o.profiles[e]){let n=`Profile '${e}' does not exist.`;if(t.json)v(n);p(n)}if(e===o.activeProfile){let n=`Cannot delete the active profile '${e}'. Switch to a different profile first with 'sazabi profiles use <name>'.`;if(t.json)v(n);p(n)}if(delete o.profiles[e],f(me(o),"Failed to write settings",t.json),t.json){j({deleted:e});return}M(`Deleted profile '${e}'.`)},kS=W("profiles","Manage named CLI profiles").withSubcommands({list:P("list","List all profiles",async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}});Jj({json:t.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles list # List all profiles"]).build(),use:P("use","Set the active profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles use <name>");return p("Profile name is required. Usage: sazabi profiles use <name>")}Vj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles use staging # Switch to staging profile"]).build(),create:P("create","Create a new empty profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles create <name>");return p("Profile name is required. Usage: sazabi profiles create <name>")}qj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles create staging # Create a new profile"]).build(),delete:P("delete","Delete a profile",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Profile name is required. Usage: sazabi profiles delete <name>");return p("Profile name is required. Usage: sazabi profiles delete <name>")}Wj(n,{json:t.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles delete staging # Delete a profile"]).build()}).withExamples(["sazabi profiles list # List all profiles","sazabi profiles use staging # Switch to staging profile","sazabi profiles create local # Create a new profile","sazabi profiles delete staging # Delete a profile"]).build();B();re();X();Ve();var Yj={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},region:{label:"Region",type:{kind:"string"}},active:{label:"Active",type:{kind:"custom",render:(e)=>e?ae.success("*"):"",serialize:(e)=>e}}},Xj={schema:Yj,columns:["id","name","region","active"],header:"Projects",emptyMessage:"No projects found."},Zj=async(e)=>{let t=N({tokenFlag:e.token,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=f(await o.projects.list({organizationId:t.organizationId}),"Failed to list projects",e.json).projects.map((i)=>({...i,active:i.id===t.projectId}));J(Xj,r,{json:e.json})},Qj=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=f(ie(),"Failed to read settings",t.json),r=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await r.projects.get(e),"Failed to select project",t.json).project,a=i.organizationId!==n.profiles[ut(n)]?.activeOrganizationId,c=f(Re(n,{activeOrganizationId:i.organizationId,activeProjectId:i.id,...a&&{organizationName:void 0}}),"Failed to update profile",t.json);if(f(me(c),"Failed to persist active project",t.json),t.json){j({project:i});return}M(`Active project set to ${i.name}.`)},$S=W("projects","Manage projects").withSubcommands({list:P("list","List projects in the active organization",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(o.length>0){let n=o.join(", ");if(t.json)return v(`Unexpected arguments: ${n}`);return p(`Unexpected arguments: ${n}`)}await Zj({token:t.token,organizationId:t["organization-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects list # List projects in the active organization"]).build(),use:P("use","Set the active project for future commands",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Project ID is required.");return p("Project ID is required.")}await Qj(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build()}).withExamples(["sazabi projects list # List projects in the active organization","sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build();B();re();X();var eE={runId:{label:"Run ID",type:{kind:"id"}},threadId:{label:"Thread ID",type:{kind:"id"}},status:{label:"Status",type:{kind:"string"}},completed:{label:"Completed",type:{kind:"boolean"}},messageId:{label:"Message ID",type:{kind:"nullable-string",emptyLabel:"(none)"}},response:{label:"Response",type:{kind:"nullable-string"}}},tE={layout:"sections",schema:eE,primary:{title:"Run",fields:["runId","threadId","status","completed","messageId"]},secondary:[{title:"Response",field:"response"}]},rE=async(e,t={})=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),r=f(await n.runs.get(e),"Failed to get run",t.json),i=t.wait&&!r.completed?f(await ec({client:n,runId:e,threadId:r.threadId,timeoutMs:t.timeout,printProgress:!t.json}),"Failed to get run",t.json):r;if(U(tE,i,{json:t.json}),!t.json&&!i.completed)R(),Y(`Poll with: sazabi runs get ${i.runId}`)},wS=W("runs","Inspect deferred agent runs").withSubcommands({get:P("get","Get a deferred run by run ID",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Run ID is required. Usage: sazabi runs get <run-id>");return p("Run ID is required. Usage: sazabi runs get <run-id>")}if(o.length>1){let i=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${i}`);return p(`Unexpected arguments: ${i}`)}let r=t.timeout?Se(t.timeout,1,3600,"Timeout",t.json)*1000:void 0;await rE(n,{token:t.token,wait:t.wait,timeout:r,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<run-id>").withOptions({token:{type:"string",description:"Override authentication token"},wait:{type:"boolean",description:"Wait for terminal status and print the final result"},timeout:{type:"string",description:"Timeout in seconds to wait before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal","sazabi runs get <run-id> --wait --timeout 60 # Wait up to 60 seconds","sazabi runs get <run-id> --json # Output run state as JSON"]).build()}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal"]).build();B();X();Ve();var Jy=["apiBaseUrl","authBaseUrl","webBaseUrl","intakeBaseUrl","tailBaseUrl","apiDomain","webDomain","intakeDomain","tailDomain","forwardPublicKey"],_S=(e)=>{return Jy.includes(e)},oE=["apiBaseUrl","authBaseUrl","webBaseUrl","intakeBaseUrl","tailBaseUrl"],nE=(e)=>oE.includes(e),iE={apiBaseUrl:["http:","https:"],authBaseUrl:["http:","https:"],webBaseUrl:["http:","https:"],intakeBaseUrl:["http:","https:"],tailBaseUrl:["ws:","wss:","http:","https:"]},aE=(e,t)=>{let o=(()=>{try{return new URL(t)}catch{return null}})();if(!o)return de(`Invalid URL for ${e}: '${t}'`);let n=iE[e];if(!n.includes(o.protocol))return de(`Invalid protocol '${o.protocol}' for ${e}. Allowed: ${n.join(", ")}`);return ke(o.toString().replace(/\/+$/,""))},cE=(e={})=>{let t=f(ie(),"Failed to read settings",e.json),o=ut(t),n=f(Ze(t),"Failed to resolve profile",e.json);if(e.json){j({success:!0,settingsFile:co,profile:o,settings:n});return}ne({"Settings file":co,"Active profile":o}),R();let r=Object.entries(n).filter(([,a])=>a!=null);if(r.length===0){Rt("No settings configured.");return}let i=r.map(([a,c])=>({key:a,value:String(c)})).sort((a,c)=>a.key.localeCompare(c.key));tt(i,[{header:"Key",key:"key",width:20},{header:"Value",key:"value"}],{header:"Settings"})},lE=(e,t,o={})=>{if(!_S(e)){let a=Jy.join(", "),c=`Invalid setting key: '${e}'. Valid keys: ${a}`;if(o.json){v(c);return}p(c);return}let n=t;if(nE(e)){let a=aE(e,t);if(!a.success){if(o.json){v(a.error);return}p(a.error);return}n=a.value}let r=f(ie(),"Failed to read settings",o.json),i=f(Re(r,{[e]:n}),"Failed to update profile",o.json);if(f(me(i),"Failed to write settings",o.json),o.json){j({success:!0,key:e,value:n});return}M(`Set ${e} to ${n}`)},uE=(e,t={})=>{if(!_S(e)){let r=Jy.join(", "),i=`Invalid setting key: '${e}'. Valid keys: ${r}`;if(t.json){v(i);return}p(i);return}let o=f(ie(),"Failed to read settings",t.json),n=f(Re(o,{[e]:void 0}),"Failed to update profile",t.json);if(f(me(n),"Failed to write settings",t.json),t.json){j({success:!0,key:e});return}M(`Cleared ${e}`)},OS=W("settings","Manage global CLI settings").withSubcommands({view:P("view","Show current CLI settings and file location",async(e)=>{let{values:t}=T(e,{json:{type:"boolean"}});cE({json:t.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings view # Show current settings","sazabi settings view --json # Output as JSON"]).build(),set:P("set","Set a global configuration value",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0],r=o[1];if(!n){if(t.json)return v("Setting key is required. Usage: sazabi settings set <key> <value>");return p("Setting key is required. Usage: sazabi settings set <key> <value>")}if(!r){if(t.json)return v("Value is required. Usage: sazabi settings set <key> <value>");return p("Value is required. Usage: sazabi settings set <key> <value>")}lE(n,r,{json:t.json})}).withPositionalArgs("<key> <value>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings set apiBaseUrl https://api.example.com # Override a base URL (also: authBaseUrl, webBaseUrl, intakeBaseUrl, tailBaseUrl)"]).build(),unset:P("unset","Clear a global configuration value",async(e)=>{let{values:t,positionals:o}=T(e,{json:{type:"boolean"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Setting key is required. Usage: sazabi settings unset <key>");return p("Setting key is required. Usage: sazabi settings unset <key>")}uE(n,{json:t.json})}).withPositionalArgs("<key>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings unset apiBaseUrl # Clear API base URL override","sazabi settings unset --json apiBaseUrl # Output as JSON"]).build()}).withExamples(["sazabi settings view # Show current settings","sazabi settings set apiBaseUrl https://api.example.com # Set API base URL","sazabi settings unset apiBaseUrl # Clear API base URL override"]).build();B();X();import*as US from"node:os";import*as RS from"node:path";import*as Ot from"node:path";var tc=["claude-code","codex","cursor","amp","opencode"],hE={"claude-code":{user:(e)=>Ot.join(e,".claude","skills"),project:(e)=>Ot.join(e,".claude","skills")},codex:{user:(e)=>Ot.join(e,".agents","skills"),project:(e)=>Ot.join(e,".agents","skills")},amp:{user:(e)=>Ot.join(e,".config","agents","skills"),project:(e)=>Ot.join(e,".agents","skills")},opencode:{user:(e)=>Ot.join(e,".config","opencode","skills"),project:(e)=>Ot.join(e,".opencode","skills")}},gE="Cursor does not support agent skills. Use Cursor Rules (.cursor/rules/*.mdc) instead. See https://cursor.com/docs/context/rules.",SS=(e)=>{if(e.agent==="cursor")return{kind:"unsupported",agent:"cursor",reason:gE};let t=hE[e.agent],o=e.scope==="user"?t.user(e.home):t.project(e.projectDir);return{kind:"supported",agent:e.agent,scope:e.scope,root:o}};jl();import{dirname as vE,resolve as IE}from"node:path";import{fileURLToPath as fE}from"node:url";var TS=`# Sazabi CLI Reference
|
|
4208
4325
|
|
|
4209
4326
|
The CLI is published as \`@sazabi/cli\`. Every command supports \`--json\` for machine-readable output and \`-h\` for help.
|
|
4210
4327
|
|
|
@@ -4935,5 +5052,5 @@ The \`/docs\` snapshot reflects whatever was on disk when the Daytona snapshot
|
|
|
4935
5052
|
was last published (see \`packages/sandbox/platform/\`). If the user mentions a
|
|
4936
5053
|
very recently shipped feature and you cannot find it locally, fall back to
|
|
4937
5054
|
the hosted site to pick up the latest changes.
|
|
4938
|
-
`;var LS='---\nname: sazabi-logs-search\ndescription: Search and analyze Sazabi logs with ClickHouse-backed tools. Use for log discovery, recurring errors, log volume, service liveness, attribute keys, raw log lookups, and after ClickHouse scan-limit, TYPE_MISMATCH, or UNKNOWN_TABLE errors.\n---\n\n# Sazabi Logs Search\n\nUse `clickhouse_query` for logs. Do not use `bash` for log queries.\n\n## Tools\n\n- `get_log_schema_context`: call first in a fresh log investigation. It returns available columns, services, attribute keys, and guardrails.\n- `clickhouse_query`: read-only `SELECT`. Org filtering is added automatically; you must add project/time filters where needed and `LIMIT` for row queries.\n- `clickhouse_health_check`: use only after connection/availability errors.\n- `log_detail`, `table`, `timeseries`: render artifacts when useful.\n\n## Pick The Table\n\n- Discovery questions: "do we log X?", "what patterns mention Y?", "common errors", "what is failing now?"\n Use `log_pattern_state`. It is small and already aggregates normalized message patterns. No time filter is required for broad discovery.\n\n- Volume, liveness, intake health, bytes, per-minute trends, latest ingestion, adapter/public-key breakdown:\n Use `log_volume_per_minute`. It has a 7-day TTL and aggregate-state columns.\n\n- Attribute-key discovery: "which keys does service X emit?", "does user.id exist?", "which services emit this key?"\n Use `attributes`.\n\n- Raw rows, point lookups, structured-attribute filters, traces/spans, exact payloads:\n Use `logs`. Always filter both `otel_timestamp_time` and `otel_timestamp` unless doing a point lookup by `canonical_id`, `otel_trace_id`, or `otel_span_id`.\n\n## Hard Rules\n\n1. Table name is `logs`, never `otel_logs`.\n2. Call `get_log_schema_context` before first query in a fresh investigation.\n3. Always add `LIMIT` to non-aggregation row queries. Hard ceiling is 10000.\n4. Never `SELECT *` from `logs`; avoid `raw`.\n5. On `logs`, use both time predicates:\n `otel_timestamp_time >= ... AND otel_timestamp >= ...`.\n6. For body text search, use `hasAnyTokens(otel_body, \'lowercase needle\')`, `hasAllTokens`, or `hasPhrase`.\n7. Never use `lower(otel_body) LIKE \'%foo%\'`; it bypasses the text index and commonly hits scan limits.\n8. Low-cardinality fields like `otel_severity_text` can use `lower()`.\n9. Aggregate-state MVs need finalizers: `countMerge`, `sumMerge`, `maxMerge`.\n10. `log_pattern_state` time columns are `SimpleAggregateFunction`; finalize in `HAVING`, not `WHERE`.\n11. Use `parseDateTimeBestEffort(\'...\')` for `DateTime` and `parseDateTime64BestEffort(\'...\', 9)` for `DateTime64`.\n12. No `SETTINGS` clause. No joins except `ARRAY JOIN`. No `IN (SELECT ...)`; run the inner query first and expand explicit values.\n\n## Standard Flow\n\n1. Call `get_log_schema_context`.\n2. Pick the table using the rules above.\n3. Query with `clickhouse_query`.\n4. For an interesting pattern, drill into raw logs using its `representative_id` as `logs.canonical_id`.\n5. Use `timeseries` for bucketed numeric results, `table` for tabular results, and `log_detail` for one raw log entry.\n\n## Common Queries\n\n### Discover Patterns\n\n```sql\nSELECT\n fingerprint,\n any(pattern) AS pattern,\n sum(occurrence_count) AS occurrences,\n max(last_seen_at) AS last_seen,\n any(representative_id) AS representative_id\nFROM log_pattern_state\nWHERE pattern ILIKE \'%<topic>%\'\nGROUP BY fingerprint\nORDER BY occurrences DESC\nLIMIT 50\n```\n\n### Top Recent Errors\n\n```sql\nSELECT\n severity_text,\n fingerprint,\n any(pattern) AS pattern,\n sum(occurrence_count) AS occurrences,\n max(last_seen_at) AS last_seen,\n any(representative_id) AS representative_id\nFROM log_pattern_state\nWHERE severity_text IN (\'ERROR\', \'FATAL\')\nGROUP BY severity_text, fingerprint\nHAVING max(last_seen_at) >= now() - INTERVAL 24 HOUR\nORDER BY occurrences DESC\nLIMIT 20\n```\n\nRare recent patterns: add\n`HAVING sum(occurrence_count) <= 3 AND max(last_seen_at) >= now() - INTERVAL 24 HOUR`.\n\n### Drill Into A Pattern\n\n```sql\nSELECT\n otel_timestamp,\n otel_service_name,\n otel_severity_text,\n otel_body,\n otel_log_attributes\nFROM logs\nWHERE canonical_id = \'<representative_id>\'\nLIMIT 1\n```\n\n### Volume / Traffic\n\n```sql\nSELECT\n toStartOfInterval(minute, INTERVAL 1 HOUR) AS bucket,\n countMerge(log_count) AS log_count,\n sumMerge(bytes_sum) AS total_bytes\nFROM log_volume_per_minute\nWHERE minute >= now() - INTERVAL 24 HOUR\nGROUP BY bucket\nORDER BY bucket\n```\n\n### Service Liveness\n\n```sql\nSELECT\n service_name,\n maxMerge(last_ingested_at) AS last_ingested_at,\n countMerge(log_count) AS recent_log_count\nFROM log_volume_per_minute\nWHERE minute >= now() - INTERVAL 1 HOUR\n AND service_name = \'<service>\'\nGROUP BY service_name\n```\n\nGroup by `intake_adapter, public_api_key` for intake breakdowns.\n\n### Attribute Keys For A Service\n\n```sql\nSELECT\n key,\n maxMerge(last_seen_timestamp_state) AS last_seen\nFROM attributes\nWHERE service_name = \'<service>\'\nGROUP BY key\nORDER BY last_seen DESC\nLIMIT 100\n```\n\nWhich services emit a key:\n\n```sql\nSELECT\n service_name,\n maxMerge(last_seen_timestamp_state) AS last_seen\nFROM attributes\nWHERE key = \'<key>\'\nGROUP BY service_name\nORDER BY last_seen DESC\nLIMIT 100\n```\n\n### Raw Body Search\n\n```sql\nSELECT\n otel_timestamp,\n otel_service_name,\n otel_severity_text,\n otel_body\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 24 HOUR\n AND otel_timestamp >= now() - INTERVAL 24 HOUR\n AND hasAnyTokens(otel_body, \'connection timeout\')\nORDER BY otel_timestamp DESC\nLIMIT 100\n```\n\nUse multiple token calls for AND semantics:\n`hasAnyTokens(otel_body, \'retry\') AND hasAnyTokens(otel_body, \'backoff\')`.\nUse an array for OR semantics:\n`hasAnyTokens(otel_body, [\'429\', \'timeout\', \'5xx\'])`.\nUse `hasPhrase(otel_body, \'cannot parse string\')` for ordered phrases.\n\n### Errors By Service\n\n```sql\nSELECT\n otel_service_name,\n count(*) AS count\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 1 HOUR\n AND otel_timestamp >= now() - INTERVAL 1 HOUR\n AND lower(otel_severity_text) = \'error\'\nGROUP BY otel_service_name\nORDER BY count DESC\nLIMIT 50\n```\n\n### Structured Attribute Filter\n\n```sql\nSELECT\n otel_timestamp,\n otel_body,\n otel_log_attributes[\'user_id\'] AS user_id\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 1 HOUR\n AND otel_timestamp >= now() - INTERVAL 1 HOUR\n AND otel_log_attributes[\'user_id\'] = \'123\'\nORDER BY otel_timestamp DESC\nLIMIT 50\n```\n\nPrefer promoted alias columns when available:\n`error_message`, `error_type`, `error_stack`, `exception_message`,\n`exception_type`, `http_status_code`, `http_route`, `http_method`,\n`url_path`, `span_duration_ms`.\n\nUse map helpers for attributes:\n- `mapContainsKey(otel_log_attributes, \'foo\')`\n- `mapContainsValue(otel_log_attributes, \'AI_RetryError\')`\n- `mapContainsValueLike(otel_log_attributes, \'% AI_RetryError %\')`\n\n### Point Lookups\n\nPoint lookups do not need time filters:\n\n```sql\nSELECT otel_timestamp, otel_service_name, otel_severity_text, otel_body\nFROM logs\nWHERE canonical_id = \'<uuidv7>\'\nLIMIT 1\n```\n\nAlso valid: exact-match `otel_trace_id = \'<32 hex>\'` or\n`otel_span_id = \'<16 hex>\'`.\n\n## Pitfalls\n\n- Scan limit: switch body discovery to `log_pattern_state`, replace `lower(otel_body) LIKE` with token functions, add both time predicates, or narrow the window.\n- `TYPE_MISMATCH`: wrap time strings with the correct `parseDateTime*` function.\n- `UNKNOWN_TABLE otel_logs`: use `logs`.\n- Empty/garbage MV aggregates: add `countMerge`, `sumMerge`, or `maxMerge`.\n- Empty `log_pattern_state WHERE last_seen_at`: move finalized time checks to `HAVING max(last_seen_at) ...`.\n- Missing map column like `otel_log_attributes.user_id`: use bracket access, e.g. `otel_log_attributes[\'user_id\']`.\n- Key not found: use `attributes` to discover exact case-sensitive keys.\n- `hasToken` rejects separators: use `hasAnyTokens`.\n- `LIMIT required`: add a limit, usually 100.\n- Connection error: run `clickhouse_health_check` once, then retry or report the outage.\n\nWhen unsure, call `get_log_schema_context` again. It is cheap and authoritative.\n';var j3=vE(pE(IE(import.meta.url)),"../skills"),fE=[...sr].sort().map((e)=>({relPath:`references/data-sources/${e}.md`,contents:Vc(e)})),CS=[{name:"sazabi",files:[{relPath:"SKILL.md",contents:DS},{relPath:"references/cli/commands.md",contents:TS},{relPath:"references/cli/setup.md",contents:PS},{relPath:"references/mcp/setup.md",contents:AS},...fE]},{name:"sazabi-docs",files:[{relPath:"SKILL.md",contents:NS}]},{name:"sazabi-logs-search",files:[{relPath:"SKILL.md",contents:LS}]}];var ho=CS;X();import*as $e from"node:fs";import*as be from"node:path";var zS=(e)=>{let t=[],o=be.resolve(e.targetRoot);for(let n of e.skills){let r=be.join(o,n.name),i=be.relative(o,r);if(i.startsWith("..")||be.isAbsolute(i))return se(`Invalid skill name "${n.name}" escapes target root`);let a=[];for(let c of n.files){let u=be.resolve(r,c.relPath),h=be.relative(r,u);if(h.startsWith("..")||be.isAbsolute(h))return se(`Invalid skill file path "${c.relPath}" in skill "${n.name}" escapes skill root`);a.push({absPath:u,contents:c.contents})}t.push({skillName:n.name,files:a})}return ke(t)},jS=(e)=>{let t=[];for(let o of e)for(let n of o.files)if($e.existsSync(n.absPath))t.push(n.absPath);return t},xS=(e)=>{let t=be.resolve(e);while(!$e.existsSync(t)){let o=be.dirname(t);if(o===t)break;t=o}return t},ES=(e,t)=>{try{let o;if(t.targetRoot){let a=xS(t.targetRoot);o=$e.existsSync(a)?$e.realpathSync(a):be.resolve(t.targetRoot)}let n=[];for(let a of e)for(let c of a.files)n.push({absPath:c.absPath,contents:c.contents,existed:$e.existsSync(c.absPath)});if(!t.force){let a=n.find((c)=>c.existed);if(a)return se(`Refusing to overwrite ${a.absPath} (use --force to overwrite)`)}let r=[],i=[];for(let a of n){if(o){let u=be.dirname(a.absPath),h=xS(u);if($e.existsSync(h)){let d=$e.realpathSync(h),g=be.relative(o,d);if(g.startsWith("..")||be.isAbsolute(g))return se(`Refusing to write ${a.absPath}: symlink escape detected (resolves outside target root)`)}}$e.mkdirSync(be.dirname(a.absPath),{recursive:!0,mode:493});let c=!1;try{if($e.lstatSync(a.absPath).isSymbolicLink())c=!0}catch(u){if(!(u instanceof Error&&("code"in u)&&u.code==="ENOENT"))throw u}if(c)return se(`Refusing to write ${a.absPath}: path is a symbolic link`);if(t.force&&a.existed)try{$e.unlinkSync(a.absPath)}catch(u){if(!(u instanceof Error&&("code"in u)&&u.code==="ENOENT"))throw u}try{$e.writeFileSync(a.absPath,a.contents,{encoding:"utf-8",mode:420,flag:"wx"})}catch(u){if(u instanceof Error&&"code"in u&&u.code==="EEXIST"){let h=t.force?`Failed to write ${a.absPath}: file was recreated during operation (possible race condition)`:`Refusing to overwrite ${a.absPath} (use --force to overwrite)`;return se(h)}throw u}if(a.existed)i.push(a.absPath);else r.push(a.absPath)}return ke({written:r,overwritten:i})}catch(o){let n=o instanceof Error?o.message:String(o);return se(`Failed to write skill files: ${n}`)}};var nr=(e,t)=>{if(t)return v(e);return p(e)},kE=(e)=>e!==void 0&&tc.includes(e),KS=async(e)=>{let t=Boolean(e.json);if(!e.agent)return void nr(`Agent is required. Usage: sazabi skill install <agent>. Known agents: ${tc.join(", ")}.`,t);if(!kE(e.agent))return void nr(`Unknown agent '${e.agent}'. Known agents: ${tc.join(", ")}.`,t);let o=e.agent;if(e.user&&e.project)return void nr("--user and --project are mutually exclusive.",t);if(e.projectDir!==void 0&&!e.project)return void nr("--project-dir is only valid with --project.",t);let n=e.project?"project":"user",r=e.projectDir!==void 0?RS.resolve(e.projectDir):process.cwd(),i=SS({agent:o,scope:n,home:US.homedir(),projectDir:r});if(i.kind==="unsupported")return void nr(i.reason,t);if(ho.length===0)return void nr("No skills are available to install.",t);let a=f(zS({targetRoot:i.root,skills:ho}),"Failed to plan skill installation",t);if(!e.force){let u=jS(a);if(u.length>0)return void nr(["Refusing to overwrite existing files (use --force to overwrite):",...u.map((h)=>` ${h}`)].join(`
|
|
4939
|
-
`),t)}let c=f(ES(a,{force:Boolean(e.force),targetRoot:i.root}),"Failed to install skills",t);if(t){j({agent:o,scope:n,targetRoot:i.root,skills:ho.map((u)=>({name:u.name,files:u.files.map((h)=>h.relPath)})),written:c.written,overwritten:c.overwritten});return}ce("Installed skills"),ne({Agent:o,Scope:n,Destination:i.root});for(let u of c.written)H(`wrote ${u}`);for(let u of c.overwritten)Ge(`replaced ${u}`);H(`Installed ${ho.length} skill${ho.length===1?"":"s"} to ${i.root}`)};var GS=W("skill","Manage Sazabi agent skills").withSubcommands({install:P("install","Install Sazabi skills into your AI agent's skills directory",async(e)=>{let{values:t,positionals:o}=T(e,{user:{type:"boolean"},project:{type:"boolean"},"project-dir":{type:"string"},force:{type:"boolean"},json:{type:"boolean"}},{allowPositionals:!0});await KS({agent:o[0],user:t.user,project:t.project,projectDir:t["project-dir"],force:t.force,json:t.json})}).withPositionalArgs("<agent>").withOptions({user:{type:"boolean",description:"Install into the user-scoped skills directory (default)"},project:{type:"boolean",description:"Install into the project-scoped skills directory"},"project-dir":{type:"string",description:"Project directory for --project (default: current working directory)"},force:{type:"boolean",description:"Overwrite existing skill files"},json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi skill install claude-code # Install for Claude Code in $HOME (default --user)","sazabi skill install codex --project # Install into current repo","sazabi skill install codex --project --project-dir ../other # Install into another repo","sazabi skill install claude-code --force # Overwrite existing files"]).build()}).withExamples(["sazabi skill install claude-code # Install Sazabi skills for Claude Code in $HOME","sazabi skill install codex --project # Install Sazabi skills into the current repo"]).build();F();re();X();var $E={name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},firstSeenAt:{label:"Created At",type:{kind:"date"}}},wE={schema:$E,columns:["name","currentStatus","firstSeenAt"],emptyMessage:"All clear — no status components found."},_E=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.statusComponents.list(),"Failed to fetch status",e.json);if(e.json){j(n);return}ce("Status Page"),M(wE,n.statusComponents)},BS=W("status","Show a summary of the status page").withHandler(async(e)=>{let{values:t}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}});await _E({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi status # Show status page summary","sazabi status --json # Output as JSON"]).build();F();re();X();var FS={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created At",type:{kind:"date"}}},OE={schema:FS,columns:["id","name","currentStatus","firstSeenAt"],emptyMessage:"No status components found."},SE={layout:"field-list",schema:FS,fields:["id","name","currentStatus","description","firstSeenAt"],title:"Status Component"},TE=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.statusComponents.list({limit:e.limit,cursor:e.cursor}),"Failed to list status components",e.json);M(OE,n.statusComponents,{json:e.json,nextCursor:n.nextCursor})},PE=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.statusComponents.get(e),"Failed to get status component",t.json);U(SE,r.statusComponent,{json:t.json})},JS=W("status-components","Manage status page components").withSubcommands({list:P("list","List status components in the active project",async(e)=>{let{values:t}=T(e,{...V,limit:{type:"string"},cursor:{type:"string"}});await TE({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor})}).withOptions({...q,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi status-components list # List all status components"]).build(),get:P("get","Get one status component by ID",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Component ID is required.");return p("Component ID is required.")}await PE(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(q).withExamples(["sazabi status-components get <component-id> # Get one status component"]).build()}).withExamples(["sazabi status-components list # List all status components","sazabi status-components get <component-id> # Get one status component"]).build();F();re();X();var VS={id:{label:"ID",type:{kind:"id"}},label:{label:"Task",type:{kind:"string"}},description:{label:"Description",type:{kind:"string"}},instructions:{label:"Instructions",type:{kind:"string"}},completed:{label:"Status",type:{kind:"custom",render:(e)=>e?ae.success("✓ done"):ae.muted("○ pending"),serialize:(e)=>e}},completedAt:{label:"Completed at",type:{kind:"nullable-date",emptyLabel:"—"}},category:{label:"Category",type:{kind:"string"}}},AE={schema:VS,columns:["completed","label","id","category"],header:"Onboarding and setup tasks",emptyMessage:"No tasks found."},DE={layout:"field-list",schema:VS,fields:["id","label","completed","completedAt","category","description","instructions"],title:"Task"},NE=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.projectId,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.tasks.list(),"Failed to list tasks",e.json);M(AE,n.tasks,{json:e.json})},LE=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.projectId,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await n.tasks.list(),"Failed to list tasks",t.json).tasks.find((a)=>a.id===e);if(!i){if(t.json)return v(`Task not found: ${e}`);return p(`Task not found: ${e}`)}U(DE,i,{json:t.json})},HS={...V,"project-id":{type:"string"},"organization-id":{type:"string"}},MS={...q,"project-id":{type:"string",description:"Override active project ID"},"organization-id":{type:"string",description:"Override active organization ID"}},qS=W("tasks","View onboarding and setup tasks").withSubcommands({list:P("list","List all onboarding and setup tasks for the active project",async(e)=>{let{values:t}=T(e,HS);await NE({token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withOptions(MS).withExamples(["sazabi tasks list # List all tasks for the active project","sazabi tasks list --json # Output tasks as JSON"]).build(),get:P("get","Get one task by ID",async(e)=>{let{values:t,positionals:o}=T(e,HS,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Task ID is required.");return p("Task ID is required.")}await LE(n,{token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withPositionalArgs("<task-id>").withOptions(MS).withExamples(["sazabi tasks get install_github_app # Show task details and instructions","sazabi tasks get send_message --json # Output as JSON"]).build()}).withExamples(["sazabi tasks list # List all tasks","sazabi tasks list --json # List tasks as JSON","sazabi tasks get install_github_app # Get one task by ID","sazabi tasks get send_message --json # Get one task as JSON"]).build();F();F();re();X();var CE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},xE={layout:"field-list",schema:CE,fields:["id","url","title","status","createdAt","updatedAt"]},WS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r}=f(await n.threads.update(e,"archived"),"Failed to archive thread",t.json),i={...r,url:wt(r.projectId,r.id)};U(xE,i,{json:t.json})};F();re();X();var zE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},jE={role:{label:"Role",type:{kind:"role"}},createdAt:{label:"When",type:{kind:"date"}},text:{label:"Message",type:{kind:"truncated",maxLength:80}}},EE=(e)=>{for(let t of e.content){if(t.type==="message"&&t.message)return t.message;if(t.type==="tool_call")return`[tool: ${t.name}]`;if(t.type==="artifact")return`[artifact: ${t.name}]`;if(t.type==="summary")return"[summary]";if(t.type==="reasoning")return"[reasoning]";if(t.type==="fork")return"[fork]";if(t.type==="slack_context")return"[slack context]"}return"(empty)"},YS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r,messages:i}=f(await n.threads.get(e),"Failed to get thread",t.json);if(t.json){j({thread:r,messages:i});return}let a={...r,url:wt(r.projectId,r.id)},c=i.map((u)=>({role:u.role,createdAt:u.createdAt,text:EE(u)}));U({layout:"field-list",schema:zE,fields:["id","url","title","status","createdAt","updatedAt"],title:"Thread"},a),R(),M({schema:jE,columns:["role","createdAt","text"],header:"Messages",emptyMessage:"No messages."},c)};F();re();X();var UE={id:{label:"ID",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},updatedAt:{label:"Updated",type:{kind:"date"}}},RE={schema:UE,columns:["id","title","status","updatedAt"],header:"Threads",emptyMessage:"No threads found."},XS=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),n=await L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl}).threads.list({limit:e.limit,cursor:e.cursor,status:e.status}),{threads:r,nextCursor:i}=f(n,"Failed to list threads",e.json);M(RE,r,{json:e.json,nextCursor:i})};F();re();X();var KE={id:{label:"ID",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},score:{label:"Score",align:"right",type:{kind:"custom",render:(e)=>e!=null?e.toFixed(2):"-"}}},GE={schema:KE,columns:["id","title","status","score"],header:{title:"Search Results",variant:"search"},emptyMessage:"No matching threads found."},ZS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{threads:r,pagination:i}=f(await n.search.threads({query:e,limit:t.limit,page:t.page,status:t.status}),"Failed to search threads",t.json);if(t.json){j({threads:r,pagination:i});return}M(GE,r,{count:i.totalResults}),yt({type:"page",page:i.page,totalPages:i.totalPages})};F();re();X();var BE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},FE={layout:"field-list",schema:BE,fields:["id","url","title","status","createdAt","updatedAt"]},QS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r}=f(await n.threads.update(e,"regular"),"Failed to unarchive thread",t.json),i={...r,url:wt(r.projectId,r.id)};U(FE,i,{json:t.json})};var eT=W("threads","Manage agent threads").withSubcommands({list:P("list","List threads from current project",async(e)=>{let{values:t}=T(e,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),o={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)o.limit=Se(t.limit,1,100,"Limit",t.json);if(t.cursor)o.cursor=t.cursor;if(t.status)o.status=dt(t.status,["regular","archived"],"Status",t.json);await XS(o)}).withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of threads to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads list # List all threads","sazabi threads list --limit 50 # List with custom limit","sazabi threads list --status archived # List archived threads","sazabi threads list --cursor xyz # List next page"]).build(),get:P("get","Get thread with messages",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads get <thread-id>");return p("Thread ID is required. Usage: sazabi threads get <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await YS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads get <thread-id> # Get thread with messages","sazabi threads get <thread-id> --json # Output as JSON"]).build(),search:P("search","Search threads in current project",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Search query is required. Usage: sazabi threads search <query>");return p("Search query is required. Usage: sazabi threads search <query>")}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.page)r.page=Se(t.page,1,Number.MAX_SAFE_INTEGER,"Page",t.json);if(t.status)r.status=dt(t.status,["regular","archived"],"Status",t.json);await ZS(n,r)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi threads search "error handling" # Search threads','sazabi threads search "bug" --limit 50 # Search with limit','sazabi threads search "authentication" --status regular # Search only regular threads']).build(),archive:P("archive","Archive a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads archive <thread-id>");return p("Thread ID is required. Usage: sazabi threads archive <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await WS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads archive <thread-id> # Archive a thread","sazabi threads archive <thread-id> --json # Output as JSON"]).build(),unarchive:P("unarchive","Unarchive a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads unarchive <thread-id>");return p("Thread ID is required. Usage: sazabi threads unarchive <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await QS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads unarchive <thread-id> # Unarchive a thread","sazabi threads unarchive <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi threads list # List all threads","sazabi threads get <thread-id> # Get thread with messages",'sazabi threads search "error" # Search threads',"sazabi threads archive <thread-id> # Archive a thread","sazabi threads unarchive <thread-id> # Unarchive a thread"]).build();var tT=[GO,JO,VO,fS,yS,kS,$S,QO,eS,OS,GS,sS,eT,vS,wS,WO,JS,BS,qS];Vy();F();var{renderSubcommandHelp:qy,renderSubcommandGroupHelp:nT,renderCommandHelp:Wy,renderMainHelp:JE}=uc("sazabi");var Yy=(e)=>JE(e,{title:"Sazabi CLI",description:"Command-line interface for the Sazabi public API",examples:["sazabi auth login # Authenticate via browser",'sazabi messages send "Hello" # Start a new thread','sazabi messages send "Hi" -t <id> # Send a message to a thread',"sazabi logs tail --severities ERROR,WARN # Tail logs filtered by severity","sazabi threads list # List all threads"]});Ve();import*as nc from"node:fs";import*as $n from"node:path";import{fileURLToPath as HE}from"node:url";var iT=()=>{try{let e=$n.dirname(HE(import.meta.url));for(let t=0;t<5;t++){let o=$n.join(e,"package.json");if(nc.existsSync(o)){let n=nc.readFileSync(o,"utf-8");return JSON.parse(n).version??"0.0.0"}e=$n.dirname(e)}return"0.0.0"}catch{return"0.0.0"}};var o4=iT();for(let e of tT)rT(e);var n4=async()=>{let e=process.argv.slice(2);if(e[0]==="--get-completions"&&e[1]==="--"){let{getCompletions:g,parseCompletionContext:b}=await Promise.resolve().then(() => (gT(),hT)),y=b(e.slice(2)),_=await g(y);for(let S of _)if(S.description)console.log(`${S.value} ${S.description}`);else console.log(S.value);return}let t=[],o;for(let g=0;g<e.length;g++){let b=e[g];if(b==="--profile"){let y=e[g+1],_=e.includes("--json");if(y===void 0||y.startsWith("-")){let S=y===void 0?"--profile requires a value.":`--profile requires a value, but got '${y}'. Use '--profile <name>'.`;if(_)v(S);p(S)}o=y,g++}else if(b.startsWith("--profile=")){let y=b.slice(10),_=e.includes("--json");if(!y){if(_)v("--profile requires a value.");p("--profile requires a value.")}o=y}else t.push(b)}DO(o);let n=t[0]==="--json",r=n?t.slice(1):t,i=n||r.includes("--json");if(r.includes("--version")||r.includes("-v")){console.log(`sazabi ${o4}`);return}if(r.length===0){console.log(Yy(kn()));return}if(r[0]?.startsWith("--")||r[0]==="-h"){if(r[0]==="--help"||r[0]==="-h"){console.log(Yy(kn()));return}}let a=r[0];if(a&&!oT(a)){let b=a.startsWith("-")?`Unknown option: ${a}. Run 'sazabi -h' for usage.`:`Unknown command: ${a}. Run 'sazabi -h' for usage.`;if(i)v(b);throw p(b),Error("Unreachable")}if(!a)throw Error("Unexpected: commandName is undefined");let c=oc(a);if(!c)throw p(`Unknown command: ${a}. Run 'sazabi -h' for usage.`),Error("Unreachable");let u=r[1]??"",h=r.slice(2);if(u==="--help"||u==="-h"){console.log(Wy(c));return}if(!u&&c.subcommands&&!c.handler){console.log(Wy(c));return}let d=c.subcommands?.[u];if(!d){if(c.handler){let g=u?[u,...h]:h;await c.handler(g)}else{let b=u.startsWith("-")?`Subcommand required. Run 'sazabi ${a} -h' for usage.`:`Unknown subcommand: ${u}. Run 'sazabi ${a} -h' for usage.`;if(i)v(b);throw p(b),Error("Unreachable")}return}if(d.subcommands){let g=h[0]??"",b=h.slice(1);if(g==="--help"||g==="-h"||!g&&!d.handler){console.log(nT(a,d));return}let y=d.subcommands[g];if(y){if(b.includes("--help")||b.includes("-h")){console.log(qy(`${a} ${u}`,y));return}if(y.handler)await y.handler(b);return}if(d.handler){await d.handler(h);return}let S=g.startsWith("-")?`Subcommand required. Run 'sazabi ${a} ${u} -h' for usage.`:`Unknown subcommand: ${g}. Run 'sazabi ${a} ${u} -h' for usage.`;if(i)v(S);throw p(S),Error("Unreachable")}if(h.includes("--help")||h.includes("-h")){console.log(qy(a,d));return}if(d.handler)await d.handler(h)};n4().catch((e)=>{let t=process.argv.includes("--json"),o=`Unexpected error: ${String(e)}`;if(t)v(o);p(o)});
|
|
5055
|
+
`;var LS='---\nname: sazabi-logs-search\ndescription: Search and analyze Sazabi logs with ClickHouse-backed tools. Use for log discovery, recurring errors, log volume, service liveness, attribute keys, raw log lookups, and after ClickHouse scan-limit, TYPE_MISMATCH, or UNKNOWN_TABLE errors.\n---\n\n# Sazabi Logs Search\n\nUse `clickhouse_query` for logs. Do not use `bash` for log queries.\n\n## Tools\n\n- `get_log_schema_context`: call first in a fresh log investigation. It returns available columns, services, attribute keys, and guardrails.\n- `clickhouse_query`: read-only `SELECT`. Org filtering is added automatically; you must add project/time filters where needed and `LIMIT` for row queries.\n- `clickhouse_health_check`: use only after connection/availability errors.\n- `log_detail`, `table`, `timeseries`: render artifacts when useful.\n\n## Pick The Table\n\n- Discovery questions: "do we log X?", "what patterns mention Y?", "common errors", "what is failing now?"\n Use `log_pattern_state`. It is small and already aggregates normalized message patterns. No time filter is required for broad discovery.\n\n- Volume, liveness, intake health, bytes, per-minute trends, latest ingestion, adapter/public-key breakdown:\n Use `log_volume_per_minute`. It has a 7-day TTL and aggregate-state columns.\n\n- Attribute-key discovery: "which keys does service X emit?", "does user.id exist?", "which services emit this key?"\n Use `attributes`.\n\n- Raw rows, point lookups, structured-attribute filters, traces/spans, exact payloads:\n Use `logs`. Always filter both `otel_timestamp_time` and `otel_timestamp` unless doing a point lookup by `canonical_id`, `otel_trace_id`, or `otel_span_id`.\n\n## Hard Rules\n\n1. Table name is `logs`, never `otel_logs`.\n2. Call `get_log_schema_context` before first query in a fresh investigation.\n3. Always add `LIMIT` to non-aggregation row queries. Hard ceiling is 10000.\n4. Never `SELECT *` from `logs`; avoid `raw`.\n5. On `logs`, use both time predicates:\n `otel_timestamp_time >= ... AND otel_timestamp >= ...`.\n6. For body text search, use `hasAnyTokens(otel_body, \'lowercase needle\')`, `hasAllTokens`, or `hasPhrase`.\n7. Never use `lower(otel_body) LIKE \'%foo%\'`; it bypasses the text index and commonly hits scan limits.\n8. Low-cardinality fields like `otel_severity_text` can use `lower()`.\n9. Aggregate-state MVs need finalizers: `countMerge`, `sumMerge`, `maxMerge`.\n10. `log_pattern_state` time columns are `SimpleAggregateFunction`; finalize in `HAVING`, not `WHERE`.\n11. Use `parseDateTimeBestEffort(\'...\')` for `DateTime` and `parseDateTime64BestEffort(\'...\', 9)` for `DateTime64`.\n12. No `SETTINGS` clause. No joins except `ARRAY JOIN`. No `IN (SELECT ...)`; run the inner query first and expand explicit values.\n\n## Standard Flow\n\n1. Call `get_log_schema_context`.\n2. Pick the table using the rules above.\n3. Query with `clickhouse_query`.\n4. For an interesting pattern, drill into raw logs using its `representative_id` as `logs.canonical_id`.\n5. Use `timeseries` for bucketed numeric results, `table` for tabular results, and `log_detail` for one raw log entry.\n\n## Common Queries\n\n### Discover Patterns\n\n```sql\nSELECT\n fingerprint,\n any(pattern) AS pattern,\n sum(occurrence_count) AS occurrences,\n max(last_seen_at) AS last_seen,\n any(representative_id) AS representative_id\nFROM log_pattern_state\nWHERE pattern ILIKE \'%<topic>%\'\nGROUP BY fingerprint\nORDER BY occurrences DESC\nLIMIT 50\n```\n\n### Top Recent Errors\n\n```sql\nSELECT\n severity_text,\n fingerprint,\n any(pattern) AS pattern,\n sum(occurrence_count) AS occurrences,\n max(last_seen_at) AS last_seen,\n any(representative_id) AS representative_id\nFROM log_pattern_state\nWHERE severity_text IN (\'ERROR\', \'FATAL\')\nGROUP BY severity_text, fingerprint\nHAVING max(last_seen_at) >= now() - INTERVAL 24 HOUR\nORDER BY occurrences DESC\nLIMIT 20\n```\n\nRare recent patterns: add\n`HAVING sum(occurrence_count) <= 3 AND max(last_seen_at) >= now() - INTERVAL 24 HOUR`.\n\n### Drill Into A Pattern\n\n```sql\nSELECT\n otel_timestamp,\n otel_service_name,\n otel_severity_text,\n otel_body,\n otel_log_attributes\nFROM logs\nWHERE canonical_id = \'<representative_id>\'\nLIMIT 1\n```\n\n### Volume / Traffic\n\n```sql\nSELECT\n toStartOfInterval(minute, INTERVAL 1 HOUR) AS bucket,\n countMerge(log_count) AS log_count,\n sumMerge(bytes_sum) AS total_bytes\nFROM log_volume_per_minute\nWHERE minute >= now() - INTERVAL 24 HOUR\nGROUP BY bucket\nORDER BY bucket\n```\n\n### Service Liveness\n\n```sql\nSELECT\n service_name,\n maxMerge(last_ingested_at) AS last_ingested_at,\n countMerge(log_count) AS recent_log_count\nFROM log_volume_per_minute\nWHERE minute >= now() - INTERVAL 1 HOUR\n AND service_name = \'<service>\'\nGROUP BY service_name\n```\n\nGroup by `intake_adapter, public_api_key` for intake breakdowns.\n\n### Attribute Keys For A Service\n\n```sql\nSELECT\n key,\n maxMerge(last_seen_timestamp_state) AS last_seen\nFROM attributes\nWHERE service_name = \'<service>\'\nGROUP BY key\nORDER BY last_seen DESC\nLIMIT 100\n```\n\nWhich services emit a key:\n\n```sql\nSELECT\n service_name,\n maxMerge(last_seen_timestamp_state) AS last_seen\nFROM attributes\nWHERE key = \'<key>\'\nGROUP BY service_name\nORDER BY last_seen DESC\nLIMIT 100\n```\n\n### Raw Body Search\n\n```sql\nSELECT\n otel_timestamp,\n otel_service_name,\n otel_severity_text,\n otel_body\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 24 HOUR\n AND otel_timestamp >= now() - INTERVAL 24 HOUR\n AND hasAnyTokens(otel_body, \'connection timeout\')\nORDER BY otel_timestamp DESC\nLIMIT 100\n```\n\nUse multiple token calls for AND semantics:\n`hasAnyTokens(otel_body, \'retry\') AND hasAnyTokens(otel_body, \'backoff\')`.\nUse an array for OR semantics:\n`hasAnyTokens(otel_body, [\'429\', \'timeout\', \'5xx\'])`.\nUse `hasPhrase(otel_body, \'cannot parse string\')` for ordered phrases.\n\n### Errors By Service\n\n```sql\nSELECT\n otel_service_name,\n count(*) AS count\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 1 HOUR\n AND otel_timestamp >= now() - INTERVAL 1 HOUR\n AND lower(otel_severity_text) = \'error\'\nGROUP BY otel_service_name\nORDER BY count DESC\nLIMIT 50\n```\n\n### Structured Attribute Filter\n\n```sql\nSELECT\n otel_timestamp,\n otel_body,\n otel_log_attributes[\'user_id\'] AS user_id\nFROM logs\nWHERE otel_timestamp_time >= now() - INTERVAL 1 HOUR\n AND otel_timestamp >= now() - INTERVAL 1 HOUR\n AND otel_log_attributes[\'user_id\'] = \'123\'\nORDER BY otel_timestamp DESC\nLIMIT 50\n```\n\nPrefer promoted alias columns when available:\n`error_message`, `error_type`, `error_stack`, `exception_message`,\n`exception_type`, `http_status_code`, `http_route`, `http_method`,\n`url_path`, `span_duration_ms`.\n\nUse map helpers for attributes:\n- `mapContainsKey(otel_log_attributes, \'foo\')`\n- `mapContainsValue(otel_log_attributes, \'AI_RetryError\')`\n- `mapContainsValueLike(otel_log_attributes, \'% AI_RetryError %\')`\n\n### Point Lookups\n\nPoint lookups do not need time filters:\n\n```sql\nSELECT otel_timestamp, otel_service_name, otel_severity_text, otel_body\nFROM logs\nWHERE canonical_id = \'<uuidv7>\'\nLIMIT 1\n```\n\nAlso valid: exact-match `otel_trace_id = \'<32 hex>\'` or\n`otel_span_id = \'<16 hex>\'`.\n\n## Pitfalls\n\n- Scan limit: switch body discovery to `log_pattern_state`, replace `lower(otel_body) LIKE` with token functions, add both time predicates, or narrow the window.\n- `TYPE_MISMATCH`: wrap time strings with the correct `parseDateTime*` function.\n- `UNKNOWN_TABLE otel_logs`: use `logs`.\n- Empty/garbage MV aggregates: add `countMerge`, `sumMerge`, or `maxMerge`.\n- Empty `log_pattern_state WHERE last_seen_at`: move finalized time checks to `HAVING max(last_seen_at) ...`.\n- Missing map column like `otel_log_attributes.user_id`: use bracket access, e.g. `otel_log_attributes[\'user_id\']`.\n- Key not found: use `attributes` to discover exact case-sensitive keys.\n- `hasToken` rejects separators: use `hasAnyTokens`.\n- `LIMIT required`: add a limit, usually 100.\n- Connection error: run `clickhouse_health_check` once, then retry or report the outage.\n\nWhen unsure, call `get_log_schema_context` again. It is cheap and authoritative.\n';var E3=IE(vE(fE(import.meta.url)),"../skills"),kE=[...dr].sort().map((e)=>({relPath:`references/data-sources/${e}.md`,contents:Vc(e)})),CS=[{name:"sazabi",files:[{relPath:"SKILL.md",contents:DS},{relPath:"references/cli/commands.md",contents:TS},{relPath:"references/cli/setup.md",contents:PS},{relPath:"references/mcp/setup.md",contents:AS},...kE]},{name:"sazabi-docs",files:[{relPath:"SKILL.md",contents:NS}]},{name:"sazabi-logs-search",files:[{relPath:"SKILL.md",contents:LS}]}];var ho=CS;X();import*as $e from"node:fs";import*as be from"node:path";var zS=(e)=>{let t=[],o=be.resolve(e.targetRoot);for(let n of e.skills){let r=be.join(o,n.name),i=be.relative(o,r);if(i.startsWith("..")||be.isAbsolute(i))return de(`Invalid skill name "${n.name}" escapes target root`);let a=[];for(let c of n.files){let u=be.resolve(r,c.relPath),h=be.relative(r,u);if(h.startsWith("..")||be.isAbsolute(h))return de(`Invalid skill file path "${c.relPath}" in skill "${n.name}" escapes skill root`);a.push({absPath:u,contents:c.contents})}t.push({skillName:n.name,files:a})}return ke(t)},jS=(e)=>{let t=[];for(let o of e)for(let n of o.files)if($e.existsSync(n.absPath))t.push(n.absPath);return t},xS=(e)=>{let t=be.resolve(e);while(!$e.existsSync(t)){let o=be.dirname(t);if(o===t)break;t=o}return t},ES=(e,t)=>{try{let o;if(t.targetRoot){let a=xS(t.targetRoot);o=$e.existsSync(a)?$e.realpathSync(a):be.resolve(t.targetRoot)}let n=[];for(let a of e)for(let c of a.files)n.push({absPath:c.absPath,contents:c.contents,existed:$e.existsSync(c.absPath)});if(!t.force){let a=n.find((c)=>c.existed);if(a)return de(`Refusing to overwrite ${a.absPath} (use --force to overwrite)`)}let r=[],i=[];for(let a of n){if(o){let u=be.dirname(a.absPath),h=xS(u);if($e.existsSync(h)){let s=$e.realpathSync(h),g=be.relative(o,s);if(g.startsWith("..")||be.isAbsolute(g))return de(`Refusing to write ${a.absPath}: symlink escape detected (resolves outside target root)`)}}$e.mkdirSync(be.dirname(a.absPath),{recursive:!0,mode:493});let c=!1;try{if($e.lstatSync(a.absPath).isSymbolicLink())c=!0}catch(u){if(!(u instanceof Error&&("code"in u)&&u.code==="ENOENT"))throw u}if(c)return de(`Refusing to write ${a.absPath}: path is a symbolic link`);if(t.force&&a.existed)try{$e.unlinkSync(a.absPath)}catch(u){if(!(u instanceof Error&&("code"in u)&&u.code==="ENOENT"))throw u}try{$e.writeFileSync(a.absPath,a.contents,{encoding:"utf-8",mode:420,flag:"wx"})}catch(u){if(u instanceof Error&&"code"in u&&u.code==="EEXIST"){let h=t.force?`Failed to write ${a.absPath}: file was recreated during operation (possible race condition)`:`Refusing to overwrite ${a.absPath} (use --force to overwrite)`;return de(h)}throw u}if(a.existed)i.push(a.absPath);else r.push(a.absPath)}return ke({written:r,overwritten:i})}catch(o){let n=o instanceof Error?o.message:String(o);return de(`Failed to write skill files: ${n}`)}};var nr=(e,t)=>{if(t)return v(e);return p(e)},$E=(e)=>e!==void 0&&tc.includes(e),KS=async(e)=>{let t=Boolean(e.json);if(!e.agent)return void nr(`Agent is required. Usage: sazabi skill install <agent>. Known agents: ${tc.join(", ")}.`,t);if(!$E(e.agent))return void nr(`Unknown agent '${e.agent}'. Known agents: ${tc.join(", ")}.`,t);let o=e.agent;if(e.user&&e.project)return void nr("--user and --project are mutually exclusive.",t);if(e.projectDir!==void 0&&!e.project)return void nr("--project-dir is only valid with --project.",t);let n=e.project?"project":"user",r=e.projectDir!==void 0?RS.resolve(e.projectDir):process.cwd(),i=SS({agent:o,scope:n,home:US.homedir(),projectDir:r});if(i.kind==="unsupported")return void nr(i.reason,t);if(ho.length===0)return void nr("No skills are available to install.",t);let a=f(zS({targetRoot:i.root,skills:ho}),"Failed to plan skill installation",t);if(!e.force){let u=jS(a);if(u.length>0)return void nr(["Refusing to overwrite existing files (use --force to overwrite):",...u.map((h)=>` ${h}`)].join(`
|
|
5056
|
+
`),t)}let c=f(ES(a,{force:Boolean(e.force),targetRoot:i.root}),"Failed to install skills",t);if(t){j({agent:o,scope:n,targetRoot:i.root,skills:ho.map((u)=>({name:u.name,files:u.files.map((h)=>h.relPath)})),written:c.written,overwritten:c.overwritten});return}ce("Installed skills"),ne({Agent:o,Scope:n,Destination:i.root});for(let u of c.written)M(`wrote ${u}`);for(let u of c.overwritten)Fe(`replaced ${u}`);M(`Installed ${ho.length} skill${ho.length===1?"":"s"} to ${i.root}`)};var FS=W("skill","Manage Sazabi agent skills").withSubcommands({install:P("install","Install Sazabi skills into your AI agent's skills directory",async(e)=>{let{values:t,positionals:o}=T(e,{user:{type:"boolean"},project:{type:"boolean"},"project-dir":{type:"string"},force:{type:"boolean"},json:{type:"boolean"}},{allowPositionals:!0});await KS({agent:o[0],user:t.user,project:t.project,projectDir:t["project-dir"],force:t.force,json:t.json})}).withPositionalArgs("<agent>").withOptions({user:{type:"boolean",description:"Install into the user-scoped skills directory (default)"},project:{type:"boolean",description:"Install into the project-scoped skills directory"},"project-dir":{type:"string",description:"Project directory for --project (default: current working directory)"},force:{type:"boolean",description:"Overwrite existing skill files"},json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi skill install claude-code # Install for Claude Code in $HOME (default --user)","sazabi skill install codex --project # Install into current repo","sazabi skill install codex --project --project-dir ../other # Install into another repo","sazabi skill install claude-code --force # Overwrite existing files"]).build()}).withExamples(["sazabi skill install claude-code # Install Sazabi skills for Claude Code in $HOME","sazabi skill install codex --project # Install Sazabi skills into the current repo"]).build();B();re();X();var wE={name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},firstSeenAt:{label:"Created At",type:{kind:"date"}}},_E={schema:wE,columns:["name","currentStatus","firstSeenAt"],emptyMessage:"All clear — no status components found."},OE=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.statusComponents.list(),"Failed to fetch status",e.json);if(e.json){j(n);return}ce("Status Page"),J(_E,n.statusComponents)},GS=W("status","Show a summary of the status page").withHandler(async(e)=>{let{values:t}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}});await OE({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi status # Show status page summary","sazabi status --json # Output as JSON"]).build();B();re();X();var BS={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created At",type:{kind:"date"}}},SE={schema:BS,columns:["id","name","currentStatus","firstSeenAt"],emptyMessage:"No status components found."},TE={layout:"field-list",schema:BS,fields:["id","name","currentStatus","description","firstSeenAt"],title:"Status Component"},PE=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.statusComponents.list({limit:e.limit,cursor:e.cursor}),"Failed to list status components",e.json);J(SE,n.statusComponents,{json:e.json,nextCursor:n.nextCursor})},AE=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),r=f(await n.statusComponents.get(e),"Failed to get status component",t.json);U(TE,r.statusComponent,{json:t.json})},HS=W("status-components","Manage status page components").withSubcommands({list:P("list","List status components in the active project",async(e)=>{let{values:t}=T(e,{...V,limit:{type:"string"},cursor:{type:"string"}});await PE({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor})}).withOptions({...q,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi status-components list # List all status components"]).build(),get:P("get","Get one status component by ID",async(e)=>{let{values:t,positionals:o}=T(e,V,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Component ID is required.");return p("Component ID is required.")}await AE(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(q).withExamples(["sazabi status-components get <component-id> # Get one status component"]).build()}).withExamples(["sazabi status-components list # List all status components","sazabi status-components get <component-id> # Get one status component"]).build();B();re();X();var VS={id:{label:"ID",type:{kind:"id"}},label:{label:"Task",type:{kind:"string"}},description:{label:"Description",type:{kind:"string"}},instructions:{label:"Instructions",type:{kind:"string"}},completed:{label:"Status",type:{kind:"custom",render:(e)=>e?ae.success("✓ done"):ae.muted("○ pending"),serialize:(e)=>e}},completedAt:{label:"Completed at",type:{kind:"nullable-date",emptyLabel:"—"}},category:{label:"Category",type:{kind:"string"}}},DE={schema:VS,columns:["completed","label","id","category"],header:"Onboarding and setup tasks",emptyMessage:"No tasks found."},NE={layout:"field-list",schema:VS,fields:["id","label","completed","completedAt","category","description","instructions"],title:"Task"},LE=async(e)=>{let t=N({tokenFlag:e.token,projectIdFlag:e.projectId,organizationIdFlag:e.organizationId,jsonMode:e.json}),o=L({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),n=f(await o.tasks.list(),"Failed to list tasks",e.json);J(DE,n.tasks,{json:e.json})},CE=async(e,t)=>{let o=N({tokenFlag:t.token,projectIdFlag:t.projectId,organizationIdFlag:t.organizationId,jsonMode:t.json}),n=L({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=f(await n.tasks.list(),"Failed to list tasks",t.json).tasks.find((a)=>a.id===e);if(!i){if(t.json)return v(`Task not found: ${e}`);return p(`Task not found: ${e}`)}U(NE,i,{json:t.json})},MS={...V,"project-id":{type:"string"},"organization-id":{type:"string"}},JS={...q,"project-id":{type:"string",description:"Override active project ID"},"organization-id":{type:"string",description:"Override active organization ID"}},qS=W("tasks","View onboarding and setup tasks").withSubcommands({list:P("list","List all onboarding and setup tasks for the active project",async(e)=>{let{values:t}=T(e,MS);await LE({token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withOptions(JS).withExamples(["sazabi tasks list # List all tasks for the active project","sazabi tasks list --json # Output tasks as JSON"]).build(),get:P("get","Get one task by ID",async(e)=>{let{values:t,positionals:o}=T(e,MS,{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Task ID is required.");return p("Task ID is required.")}await CE(n,{token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withPositionalArgs("<task-id>").withOptions(JS).withExamples(["sazabi tasks get install_github_app # Show task details and instructions","sazabi tasks get send_message --json # Output as JSON"]).build()}).withExamples(["sazabi tasks list # List all tasks","sazabi tasks list --json # List tasks as JSON","sazabi tasks get install_github_app # Get one task by ID","sazabi tasks get send_message --json # Get one task as JSON"]).build();B();B();re();X();var xE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},zE={layout:"field-list",schema:xE,fields:["id","url","title","status","createdAt","updatedAt"]},WS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r}=f(await n.threads.update(e,"archived"),"Failed to archive thread",t.json),i={...r,url:wt(r.projectId,r.id)};U(zE,i,{json:t.json})};B();re();X();var jE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},EE={role:{label:"Role",type:{kind:"role"}},createdAt:{label:"When",type:{kind:"date"}},text:{label:"Message",type:{kind:"truncated",maxLength:80}}},UE=(e)=>{for(let t of e.content){if(t.type==="message"&&t.message)return t.message;if(t.type==="tool_call")return`[tool: ${t.name}]`;if(t.type==="artifact")return`[artifact: ${t.name}]`;if(t.type==="summary")return"[summary]";if(t.type==="reasoning")return"[reasoning]";if(t.type==="fork")return"[fork]";if(t.type==="slack_context")return"[slack context]"}return"(empty)"},YS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r,messages:i}=f(await n.threads.get(e),"Failed to get thread",t.json);if(t.json){j({thread:r,messages:i});return}let a={...r,url:wt(r.projectId,r.id)},c=i.map((u)=>({role:u.role,createdAt:u.createdAt,text:UE(u)}));U({layout:"field-list",schema:jE,fields:["id","url","title","status","createdAt","updatedAt"],title:"Thread"},a),R(),J({schema:EE,columns:["role","createdAt","text"],header:"Messages",emptyMessage:"No messages."},c)};B();re();X();var RE={id:{label:"ID",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},updatedAt:{label:"Updated",type:{kind:"date"}}},KE={schema:RE,columns:["id","title","status","updatedAt"],header:"Threads",emptyMessage:"No threads found."},XS=async(e)=>{let t=N({tokenFlag:e.token,jsonMode:e.json}),n=await L({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl}).threads.list({limit:e.limit,cursor:e.cursor,status:e.status}),{threads:r,nextCursor:i}=f(n,"Failed to list threads",e.json);J(KE,r,{json:e.json,nextCursor:i})};B();re();X();var FE={id:{label:"ID",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},score:{label:"Score",align:"right",type:{kind:"custom",render:(e)=>e!=null?e.toFixed(2):"-"}}},GE={schema:FE,columns:["id","title","status","score"],header:{title:"Search Results",variant:"search"},emptyMessage:"No matching threads found."},ZS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{threads:r,pagination:i}=f(await n.search.threads({query:e,limit:t.limit,page:t.page,status:t.status}),"Failed to search threads",t.json);if(t.json){j({threads:r,pagination:i});return}J(GE,r,{count:i.totalResults}),yt({type:"page",page:i.page,totalPages:i.totalPages})};B();re();X();var BE={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},HE={layout:"field-list",schema:BE,fields:["id","url","title","status","createdAt","updatedAt"]},QS=async(e,t)=>{let o=N({tokenFlag:t.token,jsonMode:t.json}),n=L({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:r}=f(await n.threads.update(e,"regular"),"Failed to unarchive thread",t.json),i={...r,url:wt(r.projectId,r.id)};U(HE,i,{json:t.json})};var eT=W("threads","Manage agent threads").withSubcommands({list:P("list","List threads from current project",async(e)=>{let{values:t}=T(e,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),o={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)o.limit=Se(t.limit,1,100,"Limit",t.json);if(t.cursor)o.cursor=t.cursor;if(t.status)o.status=st(t.status,["regular","archived"],"Status",t.json);await XS(o)}).withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of threads to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads list # List all threads","sazabi threads list --limit 50 # List with custom limit","sazabi threads list --status archived # List archived threads","sazabi threads list --cursor xyz # List next page"]).build(),get:P("get","Get thread with messages",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads get <thread-id>");return p("Thread ID is required. Usage: sazabi threads get <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await YS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads get <thread-id> # Get thread with messages","sazabi threads get <thread-id> --json # Output as JSON"]).build(),search:P("search","Search threads in current project",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o.join(" ");if(!n){if(t.json)return v("Search query is required. Usage: sazabi threads search <query>");return p("Search query is required. Usage: sazabi threads search <query>")}let r={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)r.limit=Se(t.limit,1,100,"Limit",t.json);if(t.page)r.page=Se(t.page,1,Number.MAX_SAFE_INTEGER,"Page",t.json);if(t.status)r.status=st(t.status,["regular","archived"],"Status",t.json);await ZS(n,r)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi threads search "error handling" # Search threads','sazabi threads search "bug" --limit 50 # Search with limit','sazabi threads search "authentication" --status regular # Search only regular threads']).build(),archive:P("archive","Archive a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads archive <thread-id>");return p("Thread ID is required. Usage: sazabi threads archive <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await WS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads archive <thread-id> # Archive a thread","sazabi threads archive <thread-id> --json # Output as JSON"]).build(),unarchive:P("unarchive","Unarchive a thread",async(e)=>{let{values:t,positionals:o}=T(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),n=o[0];if(!n){if(t.json)return v("Thread ID is required. Usage: sazabi threads unarchive <thread-id>");return p("Thread ID is required. Usage: sazabi threads unarchive <thread-id>")}if(o.length>1){let r=o.slice(1).join(", ");if(t.json)return v(`Unexpected arguments: ${r}`);return p(`Unexpected arguments: ${r}`)}await QS(n,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads unarchive <thread-id> # Unarchive a thread","sazabi threads unarchive <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi threads list # List all threads","sazabi threads get <thread-id> # Get thread with messages",'sazabi threads search "error" # Search threads',"sazabi threads archive <thread-id> # Archive a thread","sazabi threads unarchive <thread-id> # Unarchive a thread"]).build();var tT=[FO,HO,VO,fS,yS,kS,$S,QO,eS,OS,FS,dS,eT,vS,wS,WO,HS,GS,qS];Vy();B();var{renderSubcommandHelp:qy,renderSubcommandGroupHelp:nT,renderCommandHelp:Wy,renderMainHelp:ME}=uc("sazabi");var Yy=(e)=>ME(e,{title:"Sazabi CLI",description:"Command-line interface for the Sazabi public API",examples:["sazabi auth login # Authenticate via browser",'sazabi messages send "Hello" # Start a new thread','sazabi messages send "Hi" -t <id> # Send a message to a thread',"sazabi logs tail --severities ERROR,WARN # Tail logs filtered by severity","sazabi threads list # List all threads"]});Ve();import*as nc from"node:fs";import*as $n from"node:path";import{fileURLToPath as JE}from"node:url";var iT=()=>{try{let e=$n.dirname(JE(import.meta.url));for(let t=0;t<5;t++){let o=$n.join(e,"package.json");if(nc.existsSync(o)){let n=nc.readFileSync(o,"utf-8");return JSON.parse(n).version??"0.0.0"}e=$n.dirname(e)}return"0.0.0"}catch{return"0.0.0"}};var n4=iT();for(let e of tT)rT(e);var i4=async()=>{let e=process.argv.slice(2);if(e[0]==="--get-completions"&&e[1]==="--"){let{getCompletions:g,parseCompletionContext:b}=await Promise.resolve().then(() => (gT(),hT)),y=b(e.slice(2)),_=await g(y);for(let S of _)if(S.description)console.log(`${S.value} ${S.description}`);else console.log(S.value);return}let t=[],o;for(let g=0;g<e.length;g++){let b=e[g];if(b==="--profile"){let y=e[g+1],_=e.includes("--json");if(y===void 0||y.startsWith("-")){let S=y===void 0?"--profile requires a value.":`--profile requires a value, but got '${y}'. Use '--profile <name>'.`;if(_)v(S);p(S)}o=y,g++}else if(b.startsWith("--profile=")){let y=b.slice(10),_=e.includes("--json");if(!y){if(_)v("--profile requires a value.");p("--profile requires a value.")}o=y}else t.push(b)}DO(o);let n=t[0]==="--json",r=n?t.slice(1):t,i=n||r.includes("--json");if(r.includes("--version")||r.includes("-v")){console.log(`sazabi ${n4}`);return}if(r.length===0){console.log(Yy(kn()));return}if(r[0]?.startsWith("--")||r[0]==="-h"){if(r[0]==="--help"||r[0]==="-h"){console.log(Yy(kn()));return}}let a=r[0];if(a&&!oT(a)){let b=a.startsWith("-")?`Unknown option: ${a}. Run 'sazabi -h' for usage.`:`Unknown command: ${a}. Run 'sazabi -h' for usage.`;if(i)v(b);throw p(b),Error("Unreachable")}if(!a)throw Error("Unexpected: commandName is undefined");let c=oc(a);if(!c)throw p(`Unknown command: ${a}. Run 'sazabi -h' for usage.`),Error("Unreachable");let u=r[1]??"",h=r.slice(2);if(u==="--help"||u==="-h"){console.log(Wy(c));return}if(!u&&c.subcommands&&!c.handler){console.log(Wy(c));return}let s=c.subcommands?.[u];if(!s){if(c.handler){let g=u?[u,...h]:h;await c.handler(g)}else{let b=u.startsWith("-")?`Subcommand required. Run 'sazabi ${a} -h' for usage.`:`Unknown subcommand: ${u}. Run 'sazabi ${a} -h' for usage.`;if(i)v(b);throw p(b),Error("Unreachable")}return}if(s.subcommands){let g=h[0]??"",b=h.slice(1);if(g==="--help"||g==="-h"||!g&&!s.handler){console.log(nT(a,s));return}let y=s.subcommands[g];if(y){if(b.includes("--help")||b.includes("-h")){console.log(qy(`${a} ${u}`,y));return}if(y.handler)await y.handler(b);return}if(s.handler){await s.handler(h);return}let S=g.startsWith("-")?`Subcommand required. Run 'sazabi ${a} ${u} -h' for usage.`:`Unknown subcommand: ${g}. Run 'sazabi ${a} ${u} -h' for usage.`;if(i)v(S);throw p(S),Error("Unreachable")}if(h.includes("--help")||h.includes("-h")){console.log(qy(a,s));return}if(s.handler)await s.handler(h)};i4().catch((e)=>{let t=process.argv.includes("--json"),o=`Unexpected error: ${String(e)}`;if(t)v(o);p(o)});
|