@sentry/junior-dashboard 0.220.0 → 0.221.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/client.js CHANGED
@@ -64,7 +64,7 @@ ${s}`:s:"",d=Function,l=`return (input) => {
64
64
  ${s}
65
65
  }`,g;try{g=new d(...i,l)(...A)}catch(p){throw new Je(`this schema (generated code failed to evaluate: ${p.message})`)}return t?.debug&&(g.code=u),g}function se(e,t){for(let[r,a]of e.constants)if(a===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function ge(e){return`v${e.varCounter++}`}function Jce(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return go;let r=n;return r.issues.length===0?r.value:go}function pr(e,t,n,r,a=!0){let o=e.content.length,i=t.constants.size,A=t.constantCounter,s=t.varCounter;try{return nn(e,t,n,r,a)}catch(u){if(!(u instanceof Je)||!u.islandable)throw u;if(e.content.length=o,t.constants.size>i){let d=Array.from(t.constants.keys()).slice(i);for(let l of d)t.constants.delete(l)}return t.constantCounter=A,t.varCounter=s,Wce(e,t,n,r)}}function Wce(e,t,n,r){let a=se(t,n),o=se(t,Jce),i=ge(t);return e.write(`const ${i} = ${o}(${a}, ${r});`),e.write(`if (${i} === INVALID) return INVALID;`),i}var Zce=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Vce(e,t,n,r){let a=n._zod.def.checks;if(!a||a.length===0)return r;let o=r;for(let i of a){let A=i._zod.def;if(A.when&&!Zce.has(A.check))throw new Je('check with a custom "when" condition');switch(A.check){case"greater_than":Xce(e,t,A,o);break;case"less_than":eue(e,t,A,o);break;case"multiple_of":tue(e,t,A,o);break;case"number_format":KP(e,A,o);break;case"min_length":{let s=Gu(A.minimum,"min_length"),u=ZD(e,t,o,`${o}.length >= ${s} && ${o}.length < ${A.minimum*2}`);e.write(`if (${u} < ${s}) return INVALID;`);break}case"max_length":{let s=Gu(A.maximum,"max_length"),u=ZD(e,t,o,`${o}.length > ${s}`);e.write(`if (${u} > ${s}) return INVALID;`);break}case"length_equals":{let s=Gu(A.length,"length_equals"),u=ZD(e,t,o,`${o}.length >= ${s} && ${o}.length <= ${A.length*2}`);e.write(`if (${u} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${Gu(A.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${Gu(A.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${Gu(A.size,"size_equals")}) return INVALID;`);break;case"string_format":o=YP(e,t,A,o);break;case"custom":o=iue(e,t,i,o);break;case"bigint_format":nue(e,A,o);break;case"mime_type":aue(e,t,A,o);break;case"property":rue(e,t,A,o);break;case"overwrite":{let s=ge(t);oue(e,t,i,o,s),o=s;break}default:throw new Je(`check type ${A.check}`)}}return o}function ZD(e,t,n,r){let a=se(t,ju),o=ge(t);return e.write(`const ${o} = typeof ${n} === "string" && ${r} ? ${a}(${n}) : ${n}.length;`),o}function Gu(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Je(`${t} bound of type ${typeof e}`);return`${e}`}function zP(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Je("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Je("comparison check with Invalid Date bound");return se(e,t)}throw new Je(`comparison check bound of type ${typeof t}`)}function Xce(e,t,n,r){let a=n.inclusive?"<":"<=";e.write(`if (${r} ${a} ${zP(t,n.value)}) return INVALID;`)}function eue(e,t,n,r){let a=n.inclusive?">":">=";e.write(`if (${r} ${a} ${zP(t,n.value)}) return INVALID;`)}function tue(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Je("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let a=se(t,nf);e.write(`if (${a}(${r}, ${Gu(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function KP(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Je(`number format ${r}`)}}function nue(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Je(`bigint format ${r}`)}}function aue(e,t,n,r){let a=n.mime;if(a&&a.length>0){let o=se(t,new Set(a));e.write(`if (!${o}.has(${r}.type)) return INVALID;`)}}function rue(e,t,n,r){let a=`${r}[${JSON.stringify(n.property)}]`;nn(e,t,n.schema,a)}function oue(e,t,n,r,a){let o=n._zod.def.tx;if(!o)throw new Je("overwrite check without a transform function");if(qu(o))throw new Ci("z.compile: async overwrite transforms are not supported");let i=se(t,o);e.write(`const ${a} = ${i}(${r});`)}function VD(){throw new Hr}function t1(e){this.issues.push(e)}function iue(e,t,n,r){let a=n._zod.def;if(a.fn){if(qu(a.fn))throw new Ci("z.compile: async .refine() predicates are not supported");let o=se(t,a.fn),i=se(t,VD),A=ge(t);return e.write(`const ${A} = ${o}(${r});`),e.write(`if (${A} instanceof Promise) ${i}();`),e.write(`if (!${A}) return INVALID;`),r}if(n._zod.check){if(qu(n._zod.check))throw new Ci("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,A=se(t,u=>{let d={value:u,issues:[],addIssue:t1};return o(d)instanceof Promise&&VD(),d.issues.length===0?d.value:go}),s=ge(t);return e.write(`const ${s} = ${A}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new Je("custom check without a predicate or check function")}var Aue=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function YP(e,t,n,r){let a=n.format;if(a==="base64"){let s=se(t,mf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="base64url"){let s=se(t,wC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="jwt"){let s=se(t,kC),u=se(t,n.alg??null);return e.write(`if (!${s}(${r}, ${u})) return INVALID;`),r}if(a==="ipv6"){let s=se(t,gf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="cidrv6"){let s=se(t,CC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="credit_card"){let s=se(t,EC);return e.write(`if (!${s}(${r})) return INVALID;`),r}let o=n;if(a==="url"||a==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let s=se(t,bC),u=se(t,n),d=ge(t),l=ge(t);if(e.write(`const ${d} = ${r}.trim();`),e.write(`const ${l} = ${s}(${d}, ${u});`),e.write(`if (typeof ${l} === "number") return INVALID;`),o.hostname!==void 0){let m=se(t,BC);e.write(`if (!${m}(${l}, ${u}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=se(t,yC);e.write(`if (!${m}(${l}, ${u}.protocol)) return INVALID;`)}let g=ge(t),p=o.normalize?`${l}.href`:`${se(t,hC)}(${d})`;return e.write(`const ${g} = ${p};`),g}let i=n.fn;if(i){if(qu(i))throw new Je(`async string format ${a}`);let s=se(t,i);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(Aue.has(a)&&n.pattern){let s=se(t,n.pattern);return e.write(`${s}.lastIndex = 0;`),e.write(`if (!${s}.test(${r})) return INVALID;`),r}let A=n.format;switch(A){case"regex":throw new Je("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${jr(n.includes)})) return INVALID;`);break;case"starts_with":{let s=n.prefix;e.write(`if (${r}.slice(0, ${s.length}) !== ${jr(s)}) return INVALID;`);break}case"ends_with":{let s=n.suffix;e.write(`if (${r}.slice(-${s.length}) !== ${jr(s)}) return INVALID;`);break}default:throw new Je(`string format ${A}`)}return r}function nn(e,t,n,r,a=!0){let o=n._zod.def,i=o.type;if(o.coerce)throw new Je(`coercion (z.coerce.${i}())`);let A=a||!!o.checks?.length,s;switch(i){case"string":s=sue(e,t,n,r);break;case"number":s=cue(e,n,r);break;case"boolean":s=uue(e,r);break;case"bigint":s=due(e,n,r);break;case"symbol":s=lue(e,r);break;case"undefined":s=pue(e,r);break;case"null":s=gue(e,r);break;case"any":case"unknown":s=r;break;case"never":e.write("return INVALID;"),s=r;break;case"void":s=mue(e,r);break;case"nan":s=fue(e,r);break;case"date":s=bue(e,r);break;case"object":s=hue(e,t,n,r,A);break;case"optional":s=Bue(e,t,n,r,A);break;case"nullable":s=wue(e,t,n,r,A);break;case"array":s=Eue(e,t,n,r,A);break;case"literal":s=kue(e,t,n,r);break;case"enum":s=Que(e,t,n,r);break;case"readonly":{let u=OP(e,t,n,r),d=ge(t);e.write(`const ${d} = Object.freeze(${u});`),s=d;break}case"success":OP(e,t,n,r),s="true";break;case"default":case"prefault":s=Iue(e,t,n,r);break;case"nonoptional":s=vue(e,t,n,r);break;case"tuple":s=_ue(e,t,n,r);break;case"union":s=xue(e,t,n,r);break;case"intersection":s=Sue(e,t,n,r);break;case"record":s=Lue(e,t,n,r);break;case"map":s=Rue(e,t,n,r);break;case"set":s=$ue(e,t,n,r);break;case"file":s=Mue(e,r);break;case"template_literal":s=jue(e,t,n,r);break;case"lazy":s=Pue(e,t,n,r);break;case"pipe":s=Tue(e,t,n,r);break;case"custom":s=Hue(e,t,n,r);break;case"transform":s=Oue(e,t,n,r);break;case"catch":s=Uue(e,t,n,r);break;default:throw new Je(`schema type ${i}`)}return s===null?null:Vce(e,t,n,s)}function sue(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.def;return a.format===void 0?r:YP(e,t,a,r)}function cue(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&KP(e,{format:r.format},n),n}function uue(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function due(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function lue(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function pue(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function gue(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function mue(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function fue(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function bue(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function hue(e,t,n,r,a=!0){let o=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let i=o.shape,A=Object.keys(i),s=Object.getOwnPropertySymbols(i),u=s.length?[...A,...s]:A,d=f=>typeof f=="symbol"?se(t,f):jr(f),l=f=>typeof f=="symbol"?`[${d(f)}]`:jr(f),g=i;if(A.includes("__proto__"))throw new Je('object shape key "__proto__"');let p=new Map;for(let f of u){let y=g[f],E=d(f),Q=ge(t);if(e.write(`const ${Q} = ${r}[${E}];`),y._zod.optin!==void 0){let I=ge(t);e.write(`let ${I} = (() => {`),e.indented(v=>{let $=pr(v,t,y,Q);v.write(`return ${$};`)}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${I} === INVALID) {`),e.indented(v=>{v.write(`if (${E} in ${r}) return INVALID;`),v.write(`${I} = undefined;`)}),e.write("}")):e.write(`if (${I} === INVALID) return INVALID;`),p.set(f,I)}else{Cue(y)&&e.write(`if (!(${E} in ${r})) return INVALID;`);let I=pr(e,t,y,Q,a);I!==null&&p.set(f,I)}}let m=o.catchall,b="none";if(m){let f=m._zod.def.type;if(f==="never"){let y=A.map(E=>`k !== ${jr(E)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(E=>{E.write(`if (${y}) return INVALID;`)}),e.write("}")}else(f==="unknown"||f==="any")&&!m._zod.def.checks?.length?b="passthrough":b="schema"}let B=ge(t),h=u.some(f=>Ou(g[f])||XD(g[f]));if(!a){if(b==="schema"){let f=A.length>0?se(t,new Set(A)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{y.write('if (k === "__proto__") continue;'),f&&y.write(`if (${f}.has(k)) continue;`);let E=ge(t);y.write(`const ${E} = ${r}[k];`),pr(y,t,m,E,!1)}),e.write("}")}return null}if(h){e.write(`const ${B} = {};`);for(let f of u){let y=d(f),E=p.get(f);XD(g[f])?e.write(`if (${y} in ${r}) ${B}[${y}] = ${E};`):Ou(g[f])?e.write(`if (${E} !== undefined || ${y} in ${r}) ${B}[${y}] = ${E};`):e.write(`${B}[${y}] = ${E};`)}}else{let f=u.map(y=>`${l(y)}: ${p.get(y)}`).join(", ");e.write(`const ${B} = { ${f} };`)}if(b!=="none"){let f=A.length>0?se(t,new Set(A)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{if(y.write('if (k === "__proto__") continue;'),f&&y.write(`if (${f}.has(k)) continue;`),b==="passthrough")y.write(`${B}[k] = ${r}[k];`);else{let E=ge(t);y.write(`const ${E} = ${r}[k];`);let Q=pr(y,t,m,E);y.write(`${B}[k] = ${Q};`)}}),e.write("}")}return B}function Bue(e,t,n,r,a=!0){let o=n._zod.def;if(yue(n))return nn(e,t,o.innerType,r,a);if(o.innerType._zod.optin==="defaulted"){let A=ge(t),s=ge(t);return e.write(`let ${A};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`const ${s} = (() => {`),u.indented(d=>{let l=nn(d,t,o.innerType,r);d.write(`return ${l};`)}),u.write("})();"),u.write(`if (${s} !== INVALID) ${A} = ${s};`)}),e.write("} else {"),e.indented(u=>{let d=nn(u,t,o.innerType,r);u.write(`${A} = ${d};`)}),e.write("}"),A}let i=a?ge(t):null;return i&&e.write(`let ${i};`),e.write(`if (${r} !== undefined) {`),e.indented(A=>{let s=nn(A,t,o.innerType,r,a);i&&s!==null&&A.write(`${i} = ${s};`)}),e.write("}"),i}function yue(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function Cue(e){return e._zod.optin===void 0&&Uu(e)}function Uu(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Uu(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Uu(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Uu):!0;case"intersection":return!t.left||!t.right?!0:Uu(t.left)&&Uu(t.right);case"pipe":return t.in?Uu(t.in):!0;default:return!0}}function XD(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Ou(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?Ou(t.innerType):!0;case"union":return t.options?t.options.some(Ou):!0;case"intersection":return!t.left||!t.right||Ou(t.left)||Ou(t.right);case"pipe":return t.out?Ou(t.out):!0;default:return!0}}function wue(e,t,n,r,a=!0){let o=n._zod.def,i=a?ge(t):null;return i&&e.write(`let ${i} = null;`),e.write(`if (${r} !== null) {`),e.indented(A=>{let s=nn(A,t,o.innerType,r,a);i&&s!==null&&A.write(`${i} = ${s};`)}),e.write("}"),i}function Eue(e,t,n,r,a=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let i=a?ge(t):null,A=ge(t),s=ge(t);return i&&e.write(`const ${i} = new Array(${r}.length);`),e.write(`for (let ${A} = 0; ${A} < ${r}.length; ${A}++) {`),e.indented(u=>{u.write(`const ${s} = ${r}[${A}];`);let d=pr(u,t,o.element,s,a);i&&d!==null&&u.write(`${i}[${A}] = ${d};`)}),e.write("}"),i}function kue(e,t,n,r){let o=n._zod.def.values;if(o.length!==1){let A=se(t,new Set(o));return e.write(`if (!${A}.has(${r})) return INVALID;`),r}let i=o[0];if(typeof i=="number"&&Number.isNaN(i)){let A=se(t,new Set(o));return e.write(`if (!${A}.has(${r})) return INVALID;`),r}if(typeof i=="string")e.write(`if (${r} !== ${jr(i)}) return INVALID;`);else if(typeof i=="number"||typeof i=="boolean")e.write(`if (${r} !== ${i}) return INVALID;`);else if(i===null)e.write(`if (${r} !== null) return INVALID;`);else if(i===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof i=="bigint")e.write(`if (${r} !== ${i}n) return INVALID;`);else throw new Je(`literal type ${typeof i}`);return r}function Que(e,t,n,r){let a=n._zod.values;if(!a)throw new Je("enum schema without enumerated values");let o=se(t,a);return e.write(`if (!${o}.has(${r})) return INVALID;`),r}function OP(e,t,n,r){let a=n._zod.def;return nn(e,t,a.innerType,r)}function Iue(e,t,n,r){let a=n._zod.def,i=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!i)return nn(e,t,a.innerType,r);let s=se(t,i),u=ge(t);return e.write(`let ${u} = ${r};`),e.write(`if (${r} === undefined) ${u} = ${s}();`),nn(e,t,a.innerType,u)}let A=ge(t);if(i){let s=se(t,i),u=se(t,af);e.write(`let ${A};`),e.write(`if (${r} === undefined) {`),e.indented(d=>{d.write(`${A} = ${u}(${s}());`)}),e.write("} else {"),e.indented(d=>{let l=nn(d,t,a.innerType,r);d.write(`${A} = ${l} === undefined ? ${u}(${s}()) : ${l};`)}),e.write("}")}else e.write(`let ${A};`),e.write(`if (${r} !== undefined) {`),e.indented(s=>{let u=nn(s,t,a.innerType,r);s.write(`${A} = ${u};`)}),e.write("}");return A}function vue(e,t,n,r){let a=n._zod.def,o=nn(e,t,a.innerType,r),i=ge(t);return e.write(`const ${i} = ${o};`),e.write(`if (${i} === undefined) return INVALID;`),i}function _ue(e,t,n,r){let a=n._zod.def,o=a.items,i=a.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let A=qP(o,"optin"),s=qP(o,"optout");i?e.write(`if (${r}.length < ${A}) return INVALID;`):e.write(`if (${r}.length < ${A} || ${r}.length > ${o.length}) return INVALID;`);let u=ge(t);e.write(`const ${u} = [];`);for(let d=0;d<o.length;d++){let l=o[d];if(d>=s)e.write(`if (${u}.length === ${d}) {`),e.indented(g=>{g.write(`if (${d} < ${r}.length) {`),g.indented(p=>{let m=ge(t);p.write(`const ${m} = ${r}[${d}];`);let b=pr(p,t,l,m);p.write(`${u}[${d}] = ${b};`)}),g.write("} else {"),g.indented(p=>{if(XD(l)){p.write(`${u}.length = ${d};`);return}let m=ge(t),b=ge(t);p.write(`const ${m} = undefined;`),p.write(`const ${b} = (() => {`),p.indented(B=>{let h=pr(B,t,l,m);B.write(`return ${h};`)}),p.write("})();"),p.write(`if (${b} === INVALID || ${b} === undefined) ${u}.length = ${d};`),p.write(`else ${u}[${d}] = ${b};`)}),g.write("}")}),e.write("}");else{let g=ge(t);e.write(`const ${g} = ${r}[${d}];`);let p=pr(e,t,l,g);e.write(`${u}[${d}] = ${p};`)}}if(i){let d=ge(t),l=ge(t);e.write(`for (let ${d} = ${o.length}; ${d} < ${r}.length; ${d}++) {`),e.indented(g=>{g.write(`const ${l} = ${r}[${d}];`);let p=pr(g,t,i,l);g.write(`${u}[${d}] = ${p};`)}),e.write("}")}return u}function qP(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function xue(e,t,n,r){let a=n._zod.def,o=a.options;if(a.discriminator)return Due(e,t,a,r);if(a.inclusive===!1)throw new Je("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),r;if(o.length===1)return nn(e,t,o[0],r);if(o.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){let s=new Set(o.flatMap(d=>d._zod.def.values)),u=se(t,s);return e.write(`if (!${u}.has(${r})) return INVALID;`),r}let A=ge(t);e.write(`let ${A};`);for(let s=0;s<o.length;s++){let u=o[s];s===0?e.write(`${A} = (() => {`):e.write(`if (${A} === INVALID) ${A} = (() => {`),e.indented(d=>{let l=nn(d,t,u,r);d.write(`return ${l};`)}),e.write("})();")}return e.write(`if (${A} === INVALID) return INVALID;`),A}function Due(e,t,n,r){if(n.unionFallback)throw new Je("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let a=ge(t),o=ge(t);e.write(`const ${a} = ${r}?.[${jr(n.discriminator)}];`),e.write(`let ${o};`);let i=!0,A=new Set;for(let s of n.options){let u=s._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new Je("discriminated union option without static discriminator values");for(let g of u){if(A.has(g))throw new Je(`duplicate discriminator value ${String(g)}`);A.add(g)}let d=Array.from(u,g=>Fue(t,a,g)),l=i?"if":"else if";e.write(`${l} (${d.join(" || ")}) {`),e.indented(g=>{let p=nn(g,t,s,r);g.write(`${o} = ${p};`)}),e.write("}"),i=!1}return e.write("else { return INVALID; }"),o}function Fue(e,t,n){if(typeof n=="string")return`${t} === ${jr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=se(e,n);return`${t} === ${r}`}throw new Je(`literal discriminator value ${String(n)}`)}function Sue(e,t,n,r){let a=n._zod.def,o=pr(e,t,a.left,r),i=pr(e,t,a.right,r),A=se(t,Ap),s=ge(t);return e.write(`const ${s} = ${A}(${o}, ${i});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function Lue(e,t,n,r){let a=n._zod.def,o=se(t,Go);e.write(`if (!${o}(${r})) return INVALID;`);let i=ge(t),A=ge(t),s=ge(t);e.write(`const ${i} = {};`);let u=a,d=u.partial?void 0:a.keyType._zod.values;if(d){let m=[];for(let B of d){if(!(typeof B=="string"||typeof B=="number"||typeof B=="symbol"))throw new Je(`record key value ${String(B)}`);let h=typeof B=="number"?B.toString():B;if(h==="__proto__")throw new Je('record key "__proto__"');m.push(h);let f=se(t,B),y=nn(e,t,a.keyType,f),E=ge(t);e.write(`const ${E} = ${r}[${Nue(t,h)}];`);let Q=pr(e,t,a.valueType,E);e.write(`${i}[${y}] = ${Q};`)}let b=se(t,new Set(m));return e.write(`for (const ${A} in ${r}) {`),e.indented(B=>{B.write(`if (${b}.has(${A})) continue;`),u.mode==="loose"?B.write(`if (${A} !== "__proto__") ${i}[${A}] = ${r}[${A}];`):B.write("return INVALID;")}),e.write("}"),i}let l=a.keyType._zod.def;if(!(l.type==="string"&&l.format===void 0&&!l.coerce&&(l.checks?.length??0)===0)){let m=a.mode==="loose",b=se(t,PC(a.keyType)),B=se(t,wc),h=se(t,Object.prototype.propertyIsEnumerable),f=ge(t);return e.write(`for (const ${A} of Reflect.ownKeys(${r})) {`),e.indented(y=>{y.write(`if (${A} === "__proto__") continue;`),y.write(`if (!${h}.call(${r}, ${A})) continue;`),y.write(`let ${f} = ${b}(${A});`),y.write(`if (${f} === INVALID && typeof ${A} === "string" && ${B}.test(${A})) ${f} = ${b}(Number(${A}));`),m?y.write(`if (${f} === INVALID) { ${i}[${A}] = ${r}[${A}]; continue; }`):y.write(`if (${f} === INVALID) return INVALID;`),y.write(`if (${f} === "__proto__") continue;`);let E=ge(t);y.write(`const ${E} = ${r}[${A}];`);let Q=pr(y,t,a.valueType,E);y.write(`${i}[${f}] = ${Q};`)}),e.write("}"),i}let p=se(t,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${A} of Reflect.ownKeys(${r})) {`),e.indented(m=>{m.write(`if (${A} === "__proto__") continue;`),m.write(`if (!${p}.call(${r}, ${A})) continue;`),m.write(`if (typeof ${A} !== "string") return INVALID;`),m.write(`const ${s} = ${r}[${A}];`);let b=pr(m,t,a.valueType,s);m.write(`${i}[${A}] = ${b};`)}),e.write("}"),i}function Nue(e,t){return typeof t=="string"?jr(t):se(e,t)}function Rue(e,t,n,r){let a=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let o=ge(t),i=ge(t),A=ge(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${i}, ${A}] of ${r}) {`),e.indented(s=>{let u=nn(s,t,a.keyType,i),d=nn(s,t,a.valueType,A);s.write(`${o}.set(${u}, ${d});`)}),e.write("}"),o}function $ue(e,t,n,r){let a=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let o=ge(t),i=ge(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${i} of ${r}) {`),e.indented(A=>{let s=nn(A,t,a.valueType,i);A.write(`${o}.add(${s});`)}),e.write("}"),o}function Mue(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function jue(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.pattern;if(a){let o=se(t,a);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${r})) return INVALID;`)}return r}function Pue(e,t,n,r){let a=n._zod.def,o=se(t,a.getter),i=se(t,{parser:null});e.write(`if (!${i}.parser) {`),e.indented(s=>{s.write(`const inner = ${o}();`),s.write(`${i}.parser = function(input) {`),s.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");let A=ge(t);return e.write(`const ${A} = ${i}.parser(${r});`),e.write(`if (${A} === INVALID) return INVALID;`),A}function Tue(e,t,n,r){let a=n._zod.def,o=nn(e,t,a.in,r);if(a.transform){if(qu(a.transform))throw new Ci("z.compile: async transforms in pipes are not supported");let i=a.transform,s=se(t,d=>{let l={value:d,issues:[],addIssue:t1},g=i(d,l);return g instanceof Promise?go:l.issues.length===0?g:go}),u=ge(t);return e.write(`const ${u} = ${s}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),nn(e,t,a.out,u)}else return nn(e,t,a.out,o)}function qu(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Hue(e,t,n,r){let a=n._zod.def;if(a.fn){if(qu(a.fn))throw new Ci("z.compile: async custom predicates are not supported");let o=se(t,a.fn),i=se(t,VD),A=ge(t);e.write(`const ${A} = ${o}(${r});`),e.write(`if (${A} instanceof Promise) ${i}();`),e.write(`if (!${A}) return INVALID;`)}else throw new Je("custom schema without a predicate function");return r}function Gue(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return go;let a=r;return a.issues.length===0?a.value:t()}function Uue(e,t,n,r){let a=n._zod.def;if(!a.catchValue[Yy])throw new Je("catch with a callback (only a constant catch value compiles)",!1);let o=ge(t);e.write(`let ${o} = (() => {`),e.indented(u=>{let d=pr(u,t,a.innerType,r);u.write(`return ${d};`)}),e.write("})();");let i=se(t,a.innerType),A=se(t,a.catchValue),s=se(t,Gue);return e.write(`if (${o} === INVALID) {`),e.indented(u=>{u.write(`${o} = ${s}(${i}, ${A}, ${r});`),u.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function Oue(e,t,n,r){let a=n._zod.def;if(a.transform){if(qu(a.transform))throw new Ci("z.compile: async transforms are not supported");let o=a.transform,A=se(t,u=>{let d={value:u,issues:[],addIssue:t1},l=o(u,d);return l instanceof Promise?go:d.issues.length===0?l:go}),s=ge(t);return e.write(`const ${s} = ${A}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return r}function n1(e,t){return new e({type:"string",...K(t)})}function a1(e,t){return new e({type:"string",coerce:!0,...K(t)})}function TC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function HC(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function GC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function UC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function OC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function qC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function Ef(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function zC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function KC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function YC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function JC(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function WC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function ZC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function VC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function XC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function ew(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function r1(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...K(t)})}function tw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function nw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function aw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function rw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function ow(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function o1(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...K(t)})}function iw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}var i1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function kf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function Qf(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function If(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function vf(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function A1(e,t){return new e({type:"number",checks:[],...K(t)})}function s1(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}function c1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function u1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...K(t)})}function d1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...K(t)})}function l1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...K(t)})}function p1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...K(t)})}function g1(e,t){return new e({type:"boolean",...K(t)})}function m1(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}function f1(e,t){return new e({type:"bigint",...K(t)})}function b1(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}function h1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(t)})}function B1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(t)})}function y1(e,t){return new e({type:"symbol",...K(t)})}function C1(e,t){return new e({type:"undefined",...K(t)})}function w1(e,t){return new e({type:"null",...K(t)})}function E1(e){return new e({type:"any"})}function k1(e){return new e({type:"unknown"})}function Q1(e,t){return new e({type:"never",...K(t)})}function I1(e,t){return new e({type:"void",...K(t)})}function v1(e,t){return new e({type:"date",...K(t)})}function _1(e,t){return new e({type:"date",coerce:!0,...K(t)})}function x1(e,t){return new e({type:"nan",...K(t)})}function lA(e,t){return new cC({check:"less_than",...K(t),value:e,inclusive:!1})}function mo(e,t){return new cC({check:"less_than",...K(t),value:e,inclusive:!0})}function pA(e,t){return new uC({check:"greater_than",...K(t),value:e,inclusive:!1})}function fo(e,t){return new uC({check:"greater_than",...K(t),value:e,inclusive:!0})}function Aw(e){return pA(0,e)}function sw(e){return lA(0,e)}function cw(e){return mo(0,e)}function uw(e){return fo(0,e)}function Ec(e,t){return new mx({check:"multiple_of",...K(t),value:e})}function kc(e,t){return new hx({check:"max_size",...K(t),maximum:e})}function gA(e,t){return new Bx({check:"min_size",...K(t),minimum:e})}function zu(e,t){return new yx({check:"size_equals",...K(t),size:e})}function Ku(e,t){return new Cx({check:"max_length",...K(t),maximum:e})}function fs(e,t){return new wx({check:"min_length",...K(t),minimum:e})}function Yu(e,t){return new Ex({check:"length_equals",...K(t),length:e})}function cp(e,t){return new kx({check:"string_format",format:"regex",...K(t),pattern:e})}function up(e){return new Qx({check:"string_format",format:"lowercase",...K(e)})}function dp(e){return new Ix({check:"string_format",format:"uppercase",...K(e)})}function lp(e,t){return new vx({check:"string_format",format:"includes",...K(t),includes:e})}function pp(e,t){return new _x({check:"string_format",format:"starts_with",...K(t),prefix:e})}function gp(e,t){return new xx({check:"string_format",format:"ends_with",...K(t),suffix:e})}function dw(e,t,n){return new dC({check:"property",property:e,schema:t,...K(n)})}function lw(e){return Object.entries(e).map(([t,n])=>new dC({check:"property",property:t,schema:n}))}function mp(e,t){return new Dx({check:"mime_type",mime:e,...K(t)})}function wi(e){return new Fx({check:"overwrite",tx:e})}function fp(e){return wi(t=>t.normalize(e))}function bp(){return wi(e=>e.trim())}function hp(){return wi(e=>e.toLowerCase())}function Bp(){return wi(e=>e.toUpperCase())}function yp(){return wi(e=>m_(e))}function D1(e,t,n){return new e({type:"array",element:t,...K(n)})}function que(e,t,n){return new e({type:"union",options:t,...K(n)})}function zue(e,t,n){return new e({type:"union",options:t,inclusive:!1,...K(n)})}function Kue(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...K(r)})}function Yue(e,t,n){return new e({type:"intersection",left:t,right:n})}function Jue(e,t,n,r){let a=n instanceof we,o=a?r:n,i=a?n:null;return new e({type:"tuple",items:t,rest:i,...K(o)})}function Wue(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...K(r)})}function Zue(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...K(r)})}function Vue(e,t,n){return new e({type:"set",valueType:t,...K(n)})}function Xue(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(a=>[a,a])):t;return new e({type:"enum",entries:r,...K(n)})}function ede(e,t,n){return new e({type:"enum",entries:t,...K(n)})}function tde(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...K(n)})}function F1(e,t){return new e({type:"file",...K(t)})}function nde(e,t){return new e({type:"transform",transform:t})}function ade(e,t){return new e({type:"optional",innerType:t})}function rde(e,t){return new e({type:"nullable",innerType:t})}function ode(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():af(n)}})}function ide(e,t,n){return new e({type:"nonoptional",innerType:t,...K(n)})}function Ade(e,t){return new e({type:"success",innerType:t})}function sde(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:k_(n)})}function cde(e,t,n){return new e({type:"pipe",in:t,out:n})}function ude(e,t){return new e({type:"readonly",innerType:t})}function dde(e,t,n){return new e({type:"template_literal",parts:t,...K(n)})}function lde(e,t){return new e({type:"lazy",getter:t})}function pde(e,t){return new e({type:"promise",innerType:t})}function S1(e,t,n){let r=K(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function L1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...K(n)})}function N1(e,t){let n=JP(r=>(r.addIssue=a=>{if(typeof a=="string")r.issues.push(tp(a,r.value,n._zod.def));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(tp(o))}},e(r.value,r)),t);return n}function JP(e,t){let n=new Nt({check:"custom",...K(t)});return n._zod.check=e,n}function R1(e){let t=new Nt({check:"describe"});return t._zod.onattach=[n=>{let r=La.get(n)??{};La.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function $1(e){let t=new Nt({check:"meta"});return t._zod.onattach=[n=>{let r=La.get(n)??{};La.add(n,{...r,...e})}],t._zod.check=()=>{},t}function M1(e,t){let n=K(t),r=n.truthy??["true","1","yes","on","y","enabled"],a=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(p=>typeof p=="string"?p.toLowerCase():p),a=a.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(r),i=new Set(a),A=e.Codec??hf,s=e.Boolean??ff,u=e.String??Hu,d=new u({type:"string",error:n.error}),l=new s({type:"boolean",error:n.error}),g=new A({type:"pipe",in:d,out:l,transform:((p,m)=>{let b=p;return n.case!=="sensitive"&&(b=b.toLowerCase()),o.has(b)?!0:i.has(b)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...i],input:m.value,inst:g,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?r[0]||"true":a[0]||"false"),error:n.error});return g._zod.bag.truthy=r,g._zod.bag.falsy=a,g._zod.bag.case=n.case??"insensitive",g}function Cp(e,t,n,r={}){let a=K(r),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:A=>n.test(A),...a};return n instanceof RegExp&&(o.pattern=n),new e(o)}function _f(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&sn(e,r,n[r]);return e}function Qc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??La,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ta(e,t,n,r,a){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:a}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(a);return Object.assign(n,o),!0}function ht(e,t,n={path:[],schemaPath:[]}){var r;let a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let A=e._zod.toJSONSchema?.();if(A)i.schema=A;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let g=i.schema,p=t.processors[a.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);p(e,t,g,d)}let l=e._zod.parent;l&&(i.ref||(i.ref=l),ht(l,t,d),t.seen.get(l).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&_f(i.schema,s),t.io==="input"&&gr(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function WP(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ic(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let i of e.seen.entries()){let A=e.metadataRegistry.get(i[0])?.id;if(A){let s=r.get(A);if(s&&s!==i[0])throw new Error(`Duplicate schema id "${A}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(A,i[0])}}let a=i=>{let A=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let l=e.external.registry.get(i[0])?.id,g=e.external.uri??(m=>m);if(l)return{ref:g(l)};let p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${g("__shared")}#/${A}/${WP(p)}`}}let s="#",u=`${s}/${A}/`;if(i[1]===n&&!i[1].schema.id)return{ref:s};let d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+WP(d)}},o=i=>{if(i[1].schema.$ref)return;let A=i[1],{ref:s,defId:u}=a(i);A.def={...A.schema},u&&(A.defId=u);let d=A.schema;for(let l in d)delete d[l];d.$ref=s};if(e.cycles==="throw")for(let i of e.seen.entries()){let A=i[1];if(A.cycle)throw new Error(`Cycle detected: #/${A.cycle?.join("/")}/<root>
66
66
 
67
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let A=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(A.cycle){o(i);continue}if(A.count>1&&e.reused==="ref"){o(i);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function XP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;XP(r);let a=Object.keys(r);if(a.length!==1||a[0]!=="type")return;let o=r.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var eT=new Set(["type","properties","required","additionalProperties"]),ZP=["oneOf","anyOf"];function VP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function j1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!eT.has(i))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let A=[];for(let u of t){let d=u.properties?.[i]??VP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:j1(A)??{allOf:A};sn(n,i,s)}for(let i of o.required??[])r.add(i)}let a={type:"object",properties:n};if(r.size&&(a.required=[...r]),t.every(o=>o.additionalProperties===!1))a.additionalProperties=!1;else{let o=[];for(let i of t){let A=VP(i);A&&!o.some(s=>JSON.stringify(s)===JSON.stringify(A))&&o.push(A)}o.length===1?a.additionalProperties=o[0]:o.length>1&&(a.additionalProperties={allOf:o})}return a}function gde(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of eT)if(a in e)return;let n=t.filter(a=>ZP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=j1(t);else{let a=n[0],o=ZP.find(s=>Array.isArray(a[s]));if(Object.keys(a).length!==1)return;let i=t.filter(s=>s!==a),A=a[o].map(s=>j1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,_f(e,r))}function vc(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=A=>{let s=e.seen.get(A);if(s.ref===null)return;let u=s.def??s.schema,d={...u},l=s.ref;if(s.ref=null,l){r(l);let p=e.seen.get(l),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):_f(u,m),_f(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&p.def)for(let B in u)B==="$ref"||B==="allOf"||B in p.def&&JSON.stringify(u[B])===JSON.stringify(p.def[B])&&delete u[B]}let g=A._zod.parent;if(g&&g!==l){r(g);let p=e.seen.get(g);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:A,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let A of[...e.seen.entries()].reverse())r(A[0]);if(e.target!=="openapi-3.0")for(let A of e.seen.entries())XP(A[1].def??A[1].schema);for(let A of e.deferred)A();if(e.intersections.length){let A=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let l=A.get(d);l?l.push(u):A.set(d,[u])}for(let s of e.intersections)for(let u of A.get(s)??[])gde(u)}}let a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let A=e.external.registry.get(t)?.id;if(!A)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(A)}_f(a,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let A of e.seen.entries()){let s=A[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,sn(i,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{let A=JSON.parse(JSON.stringify(a));return Object.defineProperty(A,"~standard",{value:{...t["~standard"],jsonSchema:{input:wp(t,"input",e.processors),output:wp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function gr(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return gr(r.element,n);if(r.type==="set")return gr(r.valueType,n);if(r.type==="lazy")return gr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return gr(r.innerType,n);if(r.type==="intersection")return gr(r.left,n)||gr(r.right,n);if(r.type==="record"||r.type==="map")return gr(r.keyType,n)||gr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gr(r.in,n)||gr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(gr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(gr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(gr(a,n))return!0;return!!(r.rest&&gr(r.rest,n))}return!1}var P1=(e,t={})=>n=>{let r=Qc({...n,processors:t});return ht(e,r),Ic(r,e),vc(r,e)},wp=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=Qc({...a??{},target:o,io:t,processors:n});return ht(e,i),Ic(i,e),vc(i,e)};var mde={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G1=(e,t,n,r)=>{let a=n;a.type="string";let{minimum:o,maximum:i,format:A,patterns:s,contentEncoding:u,laxFormat:d}=e._zod.bag;if(typeof o=="number"&&(a.minLength=o),typeof i=="number"&&(a.maxLength=i),A&&(a.format=mde[A]??A,a.format===""&&delete a.format,(A==="time"||d)&&delete a.format),u&&(a.contentEncoding=u),s&&s.size>0){let l=[...s];l.length===1?a.pattern=l[0].source:l.length>1&&(a.allOf=[...l.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},U1=(e,t,n,r)=>{let a=n,{minimum:o,maximum:i,format:A,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof A=="string"&&A.includes("int")?a.type="integer":a.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),g=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";l?p?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),g?p?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof i=="number"&&(a.maximum=i),typeof s=="number"&&(Number.isFinite(s)&&s!==0?a.multipleOf=Math.abs(s):ta(e,t,a,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},O1=(e,t,n,r)=>{n.type="boolean"},q1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},z1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},K1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Y1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},J1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},W1=(e,t,n,r)=>{n.not={}},Z1=(e,t,n,r)=>{},V1=(e,t,n,r)=>{},X1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},eF=(e,t,n,r)=>{let a=e._zod.def,o=ef(a.entries);if(o.length===0){n.not={};return}o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},tF=(e,t,n,r)=>{let a=e._zod.def;if(a.values.length===0){n.not={};return}let o=[];for(let i of a.values)if(i===void 0){if(ta(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ta(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),o.every(i=>typeof i=="boolean")&&(n.type="boolean"),o.every(i=>i===null)&&(n.type="null"),n.enum=o},nF=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},aF=(e,t,n,r)=>{let a=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=o.source},rF=(e,t,n,r)=>{let a=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:A,mime:s}=e._zod.bag;i!==void 0&&(o.minLength=i),A!==void 0&&(o.maxLength=A),s?s.length===1?(o.contentMediaType=s[0],Object.assign(a,o)):(Object.assign(a,o),a.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(a,o)},oF=(e,t,n,r)=>{n.type="boolean"},iF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},AF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},sF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},cF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},uF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},dF=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:i,maximum:A}=e._zod.bag;typeof i=="number"&&(a.minItems=i),typeof A=="number"&&(a.maxItems=A),a.type="array",a.items=ht(o.element,t,{...r,path:[...r.path,"items"]})};function xf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?xf(t.out):t.type==="catch"?xf(t.innerType):e._zod.optin}var lF=(e,t,n,r)=>{let a=n,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ta(e,t,a,r,"Symbol keys cannot be represented in JSON Schema"))return;a.type="object",a.properties={};for(let d in i)sn(a.properties,d,ht(i[d],t,{...r,path:[...r.path,"properties",d]}));let s=new Set(Object.keys(i)),u=new Set([...s].filter(d=>{let l=o.shape[d];return t.io==="input"?xf(l)===void 0:l._zod.optout===void 0}));u.size>0&&(a.required=Array.from(u)),o.catchall?._zod.def.type==="never"?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ht(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},gw=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,i=a.options.map((A,s)=>ht(A,t,{...r,path:[...r.path,o?"oneOf":"anyOf",s]}));o?n.oneOf=i:n.anyOf=i},pF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.left,t,{...r,path:[...r.path,"allOf",0]}),i=ht(a.right,t,{...r,path:[...r.path,"allOf",1]}),A=u=>"allOf"in u&&Object.keys(u).length===1,s=[...A(o)?o.allOf:[o],...A(i)?i.allOf:[i]];n.allOf=s,t.intersections.push(s)},gF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",A=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=o.items.map((b,B)=>ht(b,t,{...r,path:[...r.path,i,B]})),u=o.rest?ht(o.rest,t,{...r,path:[...r.path,A,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let b=o.items[d-1];if(!(t.io==="input"?xf(b)!==void 0:b._zod.optout==="optional"))break;d--}let l=o.items.length,g=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,g?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):(a.items=s,g?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),g&&(a.maxItems=l));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(a.minItems=p),typeof m=="number"&&(a.maxItems=m)};function T1(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let b=T1(e,m,n);return b===m?t:b}for(let m of["anyOf","oneOf"]){let b=t[m];if(!Array.isArray(b))continue;let B=b.map(h=>T1(e,h,n));B.some((h,f)=>h!==b[f])&&(t={...t,[m]:B})}let r=Array.isArray(t.type)?t.type:[t.type],a=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!a&&!o?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:A,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:d,format:l,id:g,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),a&&(p.type="string",o||(p.pattern=(r.includes("number")?wc:df).source)),p}var H1=new WeakMap;function fde(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of H1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=T1(t,o,new Set);i!==o&&n.set(o,i)}if(n.size)for(let r of e.seen.values())for(let a of[r.schema,r.def]){let o=a&&n.get(a.propertyNames);o&&(a.propertyNames=o)}}var mF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="object";let i=o.keyType,s=i._zod.bag?.patterns;if(o.mode==="loose"&&s&&s.size>0){let l=ht(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(let g of s)sn(a.patternProperties,g.source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){a.propertyNames=ht(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=H1.get(t);l||(l=[],H1.set(t,l),t.deferred.push(()=>fde(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&xf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(g=>typeof g=="string"||typeof g=="number");l.length>0&&(a.required=l.map(String))}},fF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},bF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},hF=Symbol();function tT(e,t,n,r,a){let o=!1,i=JSON.stringify(e,(A,s)=>typeof s!="bigint"?s:(o=!0,null));return o?(ta(t,n,r,a,"BigInt defaults cannot be represented in JSON Schema"),hF):JSON.parse(i)}var BF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i=tT(a.defaultValue,e,t,n,r);i!==hF&&(n.default=i)},yF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);if(o.ref=a.innerType,t.io!=="input")return;let i=tT(a.defaultValue,e,t,n,r);i!==hF&&(n._prefault=i)},CF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i;try{i=a.catchValue(void 0)}catch{ta(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},wF=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?a.out:a.in:a.out;ht(i,t,r);let A=t.seen.get(e);A.ref=i},EF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},kF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},mw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},QF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},pw={string:G1,number:U1,boolean:O1,bigint:q1,symbol:z1,null:K1,undefined:Y1,void:J1,never:W1,any:Z1,unknown:V1,date:X1,enum:eF,literal:tF,nan:nF,template_literal:aF,file:rF,success:oF,custom:iF,function:AF,transform:sF,map:cF,set:uF,array:dF,object:lF,union:gw,intersection:pF,tuple:gF,record:mF,nullable:fF,nonoptional:bF,default:BF,prefault:yF,catch:CF,pipe:wF,readonly:EF,promise:kF,optional:mw,lazy:QF};function fw(e,t){if("_idmap"in e){let r=e,a=Qc({...t,processors:pw}),o={};for(let s of r._idmap.entries()){let[u,d]=s;ht(d,a)}let i={},A={registry:r,uri:t?.uri,defs:o};a.external=A;for(let s of r._idmap.entries()){let[u,d]=s;Ic(a,d),sn(i,u,vc(a,d))}if(Object.keys(o).length>0){let s=a.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:o}}return{schemas:i}}let n=Qc({...t,processors:pw});return ht(e,n),Ic(n,e),vc(n,e)}var bw=class{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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Qc({processors:pw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ht(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Ic(this.ctx,t);let r=vc(this.ctx,t),{"~standard":a,...o}=r;return o}};var nT={};var Fp={};L(Fp,{ZodAny:()=>zF,ZodArray:()=>WF,ZodBase64:()=>$w,ZodBase64URL:()=>Mw,ZodBigInt:()=>xp,ZodBigIntFormat:()=>Tw,ZodBoolean:()=>_p,ZodCIDRv4:()=>Nw,ZodCIDRv6:()=>Rw,ZodCUID:()=>vw,ZodCUID2:()=>_w,ZodCatch:()=>b8,ZodCodec:()=>Pf,ZodCreditCard:()=>PF,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>Ip,ZodDate:()=>Lf,ZodDefault:()=>d8,ZodDiscriminatedUnion:()=>VF,ZodE164:()=>jw,ZodEmail:()=>Ew,ZodEmoji:()=>Qw,ZodEnum:()=>kp,ZodExactOptional:()=>Ow,ZodFile:()=>A8,ZodFunction:()=>v8,ZodGUID:()=>kw,ZodIPv4:()=>Sw,ZodIPv6:()=>Lw,ZodISODate:()=>xc,ZodISODateTime:()=>_c,ZodISODuration:()=>Fc,ZodISOTime:()=>Dc,ZodIntersection:()=>XF,ZodJWT:()=>Pw,ZodKSUID:()=>Fw,ZodLazy:()=>k8,ZodLiteral:()=>i8,ZodMAC:()=>jF,ZodMap:()=>r8,ZodNaN:()=>B8,ZodNanoID:()=>Iw,ZodNever:()=>YF,ZodNonOptional:()=>qw,ZodNull:()=>OF,ZodNullable:()=>u8,ZodNumber:()=>vp,ZodNumberFormat:()=>Vu,ZodObject:()=>Rf,ZodOptional:()=>Mf,ZodPipe:()=>jf,ZodPrefault:()=>p8,ZodPreprocess:()=>y8,ZodPromise:()=>I8,ZodReadonly:()=>C8,ZodRecord:()=>Ep,ZodSet:()=>o8,ZodString:()=>Qp,ZodStringFormat:()=>Dt,ZodSuccess:()=>f8,ZodSymbol:()=>GF,ZodTemplateLiteral:()=>E8,ZodTransform:()=>s8,ZodTuple:()=>t8,ZodType:()=>xe,ZodULID:()=>xw,ZodURL:()=>Sf,ZodUUID:()=>mA,ZodUndefined:()=>UF,ZodUnion:()=>$f,ZodUnknown:()=>KF,ZodVoid:()=>JF,ZodXID:()=>Dw,ZodXor:()=>ZF,_ZodString:()=>ww,_default:()=>l8,_function:()=>lH,any:()=>UT,array:()=>Nf,base64:()=>QT,base64url:()=>IT,bigint:()=>jT,boolean:()=>HF,catch:()=>h8,check:()=>pH,cidrv4:()=>ET,cidrv6:()=>kT,codec:()=>sH,creditCard:()=>_T,cuid:()=>mT,cuid2:()=>fT,custom:()=>gH,date:()=>qT,describe:()=>mH,discriminatedUnion:()=>ZT,e164:()=>vT,email:()=>oT,emoji:()=>pT,enum:()=>Gw,exactOptional:()=>c8,file:()=>rH,float32:()=>NT,float64:()=>RT,function:()=>lH,guid:()=>iT,hash:()=>LT,hex:()=>ST,hostname:()=>FT,httpUrl:()=>lT,instanceof:()=>bH,int:()=>yw,int32:()=>$T,int64:()=>PT,intersection:()=>e8,invertCodec:()=>cH,ipv4:()=>yT,ipv6:()=>wT,json:()=>BH,jwt:()=>xT,keyof:()=>zT,ksuid:()=>BT,lazy:()=>Q8,literal:()=>aH,looseObject:()=>JT,looseRecord:()=>XT,mac:()=>CT,map:()=>eH,meta:()=>fH,nan:()=>AH,nanoid:()=>gT,nativeEnum:()=>nH,never:()=>Hw,nonoptional:()=>m8,null:()=>qF,nullable:()=>Ff,nullish:()=>oH,number:()=>TF,object:()=>KT,optional:()=>Wu,partialRecord:()=>VT,pipe:()=>Cw,prefault:()=>g8,preprocess:()=>yH,promise:()=>dH,readonly:()=>w8,record:()=>a8,refine:()=>_8,set:()=>tH,strictObject:()=>YT,string:()=>Df,stringFormat:()=>DT,stringbool:()=>hH,success:()=>iH,superRefine:()=>x8,symbol:()=>HT,templateLiteral:()=>uH,transform:()=>Uw,tuple:()=>n8,uint32:()=>MT,uint64:()=>TT,ulid:()=>bT,undefined:()=>GT,union:()=>Dp,unknown:()=>Ju,url:()=>dT,uuid:()=>AT,uuidv4:()=>sT,uuidv6:()=>cT,uuidv7:()=>uT,void:()=>OT,xid:()=>hT,xor:()=>WT});var hw={};L(hw,{endsWith:()=>gp,gt:()=>pA,gte:()=>fo,includes:()=>lp,length:()=>Yu,lowercase:()=>up,lt:()=>lA,lte:()=>mo,maxLength:()=>Ku,maxSize:()=>kc,mime:()=>mp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>Ec,negative:()=>sw,nonnegative:()=>uw,nonpositive:()=>cw,normalize:()=>fp,overwrite:()=>wi,positive:()=>Aw,properties:()=>lw,property:()=>dw,regex:()=>cp,size:()=>zu,slugify:()=>yp,startsWith:()=>pp,toLowerCase:()=>hp,toUpperCase:()=>Bp,trim:()=>bp,uppercase:()=>dp});var aT=new WeakSet([Object.prototype,Error.prototype]);function Bw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var rT=(e,t)=>{sf.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);aT.has(n)||(aT.add(n),Bw(n,"format",r=>a=>uf(r,a)),Bw(n,"flatten",r=>a=>cf(r,a)),Bw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Xl,2)}),Bw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Xl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},hde=_("ZodError",rT),Ur=_("ZodError",rT,void 0,{Parent:Error});var IF=np(Ur),vF=ap(Ur),_F=rp(Ur),xF=op(Ur),DF=Vy(Ur),FF=Xy(Ur),SF=eC(Ur),LF=tC(Ur),NF=nC(Ur),RF=aC(Ur),$F=rC(Ur),MF=oC(Ur);function yde(){ha.localeError||Bn(NC())}function Zu(){ha.memoizer||Bn({memoizer:yf()})}var xe=_("ZodType",(e,t)=>(yde(),we.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_8(e,t))},superRefine(e,t){return this.check(x8(e,t))},overwrite(e){return this.check(wi(e))},optional(){return Wu(this)},exactOptional(){return c8(this)},nullable(){return Ff(this)},nullish(){return Wu(Ff(this))},nonoptional(e){return m8(this,e)},array(){return Nf(this)},or(e){return Dp([this,e])},and(e){return e8(this,e)},transform(e){return Cw(this,Uw(e))},default(e){return l8(this,e)},prefault(e){return g8(this,e)},catch(e){return h8(this,e)},pipe(e){return Cw(this,e)},readonly(){return w8(this)},describe(e){let t=this.clone();return La.add(t,{description:e}),t},meta(...e){if(e.length===0)return La.get(this);let t=this.clone();return La.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...fC(this),jsonSchema:{input:wp(this,"input"),output:wp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return IF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await vF(this,t,n,{callee:e})},safeParse(e,t){return _F(this,e,t)},async safeParseAsync(e,t){return xF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return DF(this,t,n,{callee:e})},decode:function e(t,n){return FF(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await SF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await LF(this,t,n,{callee:e})},safeEncode(e,t){return NF(this,e,t)},safeDecode(e,t){return RF(this,e,t)},async safeEncodeAsync(e,t){return $F(this,e,t)},async safeDecodeAsync(e,t){return MF(this,e,t)},toJSONSchema(e){return P1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),ww=_("_ZodString",(e,t)=>{Hu.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>G1(e,r,a,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(cp(...e))},includes(...e){return this.check(lp(...e))},startsWith(...e){return this.check(pp(...e))},endsWith(...e){return this.check(gp(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(Ku(...e))},length(...e){return this.check(Yu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(up(e))},uppercase(e){return this.check(dp(e))},trim(){return this.check(bp())},normalize(...e){return this.check(fp(...e))},toLowerCase(){return this.check(hp())},toUpperCase(){return this.check(Bp())},slugify(){return this.check(yp())}}),Qp=_("ZodString",(e,t)=>{Hu.init(e,t),ww.init(e,t)},{email(e){return this.check(TC(Ew,e))},url(e){return this.check(Ef(Sf,e))},jwt(e){return this.check(iw(Pw,e))},emoji(e){return this.check(zC(Qw,e))},guid(e){return this.check(HC(kw,e))},uuid(e){return this.check(GC(mA,e))},uuidv4(e){return this.check(UC(mA,e))},uuidv6(e){return this.check(OC(mA,e))},uuidv7(e){return this.check(qC(mA,e))},nanoid(e){return this.check(KC(Iw,e))},cuid(e){return this.check(YC(vw,e))},cuid2(e){return this.check(JC(_w,e))},ulid(e){return this.check(WC(xw,e))},base64(e){return this.check(aw($w,e))},base64url(e){return this.check(rw(Mw,e))},xid(e){return this.check(ZC(Dw,e))},ksuid(e){return this.check(VC(Fw,e))},ipv4(e){return this.check(XC(Sw,e))},ipv6(e){return this.check(ew(Lw,e))},cidrv4(e){return this.check(tw(Nw,e))},cidrv6(e){return this.check(nw(Rw,e))},e164(e){return this.check(ow(jw,e))},datetime(e){return this.check(kf(_c,e))},date(e){return this.check(Qf(xc,e))},time(e){return this.check(If(Dc,e))},duration(e){return this.check(vf(Fc,e))}});function Df(e){return n1(Qp,e)}var Dt=_("ZodStringFormat",(e,t)=>{wt.init(e,t),ww.init(e,t)}),_c=_("ZodISODateTime",(e,t)=>{Kx.init(e,t),Dt.init(e,t)}),xc=_("ZodISODate",(e,t)=>{Yx.init(e,t),Dt.init(e,t)}),Dc=_("ZodISOTime",(e,t)=>{Jx.init(e,t),Dt.init(e,t)}),Fc=_("ZodISODuration",(e,t)=>{Wx.init(e,t),Dt.init(e,t)}),Ew=_("ZodEmail",(e,t)=>{$x.init(e,t),Dt.init(e,t)});function oT(e){return TC(Ew,e)}var kw=_("ZodGUID",(e,t)=>{Nx.init(e,t),Dt.init(e,t)});function iT(e){return HC(kw,e)}var mA=_("ZodUUID",(e,t)=>{Rx.init(e,t),Dt.init(e,t)});function AT(e){return GC(mA,e)}function sT(e){return UC(mA,e)}function cT(e){return OC(mA,e)}function uT(e){return qC(mA,e)}var Sf=_("ZodURL",(e,t)=>{Px.init(e,t),Dt.init(e,t)});function dT(e){return Ef(Sf,e)}function lT(e){return Ef(Sf,{protocol:lr.httpProtocol,hostname:lr.domain,...G.normalizeParams(e)})}var Qw=_("ZodEmoji",(e,t)=>{Tx.init(e,t),Dt.init(e,t)});function pT(e){return zC(Qw,e)}var Iw=_("ZodNanoID",(e,t)=>{Hx.init(e,t),Dt.init(e,t)});function gT(e){return KC(Iw,e)}var vw=_("ZodCUID",(e,t)=>{Gx.init(e,t),Dt.init(e,t)});function mT(e){return YC(vw,e)}var _w=_("ZodCUID2",(e,t)=>{Ux.init(e,t),Dt.init(e,t)});function fT(e){return JC(_w,e)}var xw=_("ZodULID",(e,t)=>{Ox.init(e,t),Dt.init(e,t)});function bT(e){return WC(xw,e)}var Dw=_("ZodXID",(e,t)=>{qx.init(e,t),Dt.init(e,t)});function hT(e){return ZC(Dw,e)}var Fw=_("ZodKSUID",(e,t)=>{zx.init(e,t),Dt.init(e,t)});function BT(e){return VC(Fw,e)}var Sw=_("ZodIPv4",(e,t)=>{Zx.init(e,t),Dt.init(e,t)});function yT(e){return XC(Sw,e)}var jF=_("ZodMAC",(e,t)=>{Xx.init(e,t),Dt.init(e,t)});function CT(e){return r1(jF,e)}var Lw=_("ZodIPv6",(e,t)=>{Vx.init(e,t),Dt.init(e,t)});function wT(e){return ew(Lw,e)}var Nw=_("ZodCIDRv4",(e,t)=>{eD.init(e,t),Dt.init(e,t)});function ET(e){return tw(Nw,e)}var Rw=_("ZodCIDRv6",(e,t)=>{tD.init(e,t),Dt.init(e,t)});function kT(e){return nw(Rw,e)}var $w=_("ZodBase64",(e,t)=>{nD.init(e,t),Dt.init(e,t)});function QT(e){return aw($w,e)}var Mw=_("ZodBase64URL",(e,t)=>{aD.init(e,t),Dt.init(e,t)});function IT(e){return rw(Mw,e)}var jw=_("ZodE164",(e,t)=>{rD.init(e,t),Dt.init(e,t)});function vT(e){return ow(jw,e)}var PF=_("ZodCreditCard",(e,t)=>{oD.init(e,t),Dt.init(e,t)});function _T(e){return o1(PF,e)}var Pw=_("ZodJWT",(e,t)=>{iD.init(e,t),Dt.init(e,t)});function xT(e){return iw(Pw,e)}var Ip=_("ZodCustomStringFormat",(e,t)=>{AD.init(e,t),Dt.init(e,t)});function DT(e,t,n={}){return Cp(Ip,e,t,n)}function FT(e){return Cp(Ip,"hostname",lr.hostname,e)}function ST(e){return Cp(Ip,"hex",lr.hex,e)}function LT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=lr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return Cp(Ip,r,a,t)}var vp=_("ZodNumber",(e,t)=>{QC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>U1(e,r,a,o);let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(pA(e,t))},gte(e,t){return this.check(fo(e,t))},min(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(mo(e,t))},max(e,t){return this.check(mo(e,t))},int(e){return this.check(yw(e))},safe(e){return this.check(yw(e))},positive(e){return this.check(pA(0,e))},nonnegative(e){return this.check(fo(0,e))},negative(e){return this.check(lA(0,e))},nonpositive(e){return this.check(mo(0,e))},multipleOf(e,t){return this.check(Ec(e,t))},step(e,t){return this.check(Ec(e,t))},finite(){return this}});function TF(e){return A1(vp,e)}var Vu=_("ZodNumberFormat",(e,t)=>{sD.init(e,t),vp.init(e,t)});function yw(e){return c1(Vu,e)}function NT(e){return u1(Vu,e)}function RT(e){return d1(Vu,e)}function $T(e){return l1(Vu,e)}function MT(e){return p1(Vu,e)}var _p=_("ZodBoolean",(e,t)=>{ff.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function HF(e){return g1(_p,e)}var xp=_("ZodBigInt",(e,t)=>{IC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>q1(e,r,a,o);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(fo(e,t))},min(e,t){return this.check(fo(e,t))},gt(e,t){return this.check(pA(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(mo(e,t))},max(e,t){return this.check(mo(e,t))},positive(e){return this.check(pA(BigInt(0),e))},negative(e){return this.check(lA(BigInt(0),e))},nonpositive(e){return this.check(mo(BigInt(0),e))},nonnegative(e){return this.check(fo(BigInt(0),e))},multipleOf(e,t){return this.check(Ec(e,t))}});function jT(e){return f1(xp,e)}var Tw=_("ZodBigIntFormat",(e,t)=>{cD.init(e,t),xp.init(e,t)});function PT(e){return h1(Tw,e)}function TT(e){return B1(Tw,e)}var GF=_("ZodSymbol",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function HT(e){return y1(GF,e)}var UF=_("ZodUndefined",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Y1(e,n,r,a)});function GT(e){return C1(UF,e)}var OF=_("ZodNull",(e,t)=>{lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>K1(e,n,r,a)});function qF(e){return w1(OF,e)}var zF=_("ZodAny",(e,t)=>{pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Z1(e,n,r,a)});function UT(){return E1(zF)}var KF=_("ZodUnknown",(e,t)=>{gD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(e,n,r,a)});function Ju(){return k1(KF)}var YF=_("ZodNever",(e,t)=>{mD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>W1(e,n,r,a)});function Hw(e){return Q1(YF,e)}var JF=_("ZodVoid",(e,t)=>{fD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a)});function OT(e){return I1(JF,e)}var Lf=_("ZodDate",(e,t)=>{bD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>X1(e,r,a,o),e.min=(r,a)=>e.check(fo(r,a)),e.max=(r,a)=>e.check(mo(r,a));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function qT(e){return v1(Lf,e)}var WF=_("ZodArray",(e,t)=>{Zu(),hD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(e,n,r,a),e.element=t.element},{min(e,t){return this.check(fs(e,t))},nonempty(e){return this.check(fs(1,e))},max(e,t){return this.check(Ku(e,t))},length(e,t){return this.check(Yu(e,t))},unwrap(){return this.element}});function Nf(e,t){return D1(WF,e,t)}function zT(e){let t=e._zod.def.shape;return Gw(Object.keys(t))}var Rf=_("ZodObject",(e,t)=>{Zu(),BD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Gw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ju()})},loose(){return this.clone({...this._zod.def,catchall:Ju()})},strict(){return this.clone({...this._zod.def,catchall:Hw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(Mf,this,e[0])},exactPartial(...e){return G.partial(Ow,this,e[0],"exactPartial")},required(...e){return G.required(qw,this,e[0])}});function KT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Rf(n)}function YT(e,t){return new Rf({type:"object",shape:e,catchall:Hw(),...G.normalizeParams(t)})}function JT(e,t){return new Rf({type:"object",shape:e,catchall:Ju(),...G.normalizeParams(t)})}var $f=_("ZodUnion",(e,t)=>{bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gw(e,n,r,a),e.options=t.options});function Dp(e,t){return new $f({type:"union",options:e,...G.normalizeParams(t)})}var ZF=_("ZodXor",(e,t)=>{$f.init(e,t),yD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gw(e,n,r,a),e.options=t.options});function WT(e,t){return new ZF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var VF=_("ZodDiscriminatedUnion",(e,t)=>{$f.init(e,t),wD.init(e,t)});function ZT(e,t,n){return new VF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var XF=_("ZodIntersection",(e,t)=>{ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a)});function e8(e,t){return new XF({type:"intersection",left:e,right:t})}var t8=_("ZodTuple",(e,t)=>{Zu(),vC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gF(e,n,r,a)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Mf({type:"optional",innerType:t}))})}});function n8(e,t,n){let r=t instanceof we,a=r?n:t,o=r?t:null;return new t8({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var Ep=_("ZodRecord",(e,t)=>{Zu(),kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function a8(e,t,n){return!t||!t._zod?new Ep({type:"record",keyType:Df(),valueType:e,...G.normalizeParams(t)}):new Ep({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function VT(e,t,n){return new Ep({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function XT(e,t,n){return new Ep({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var r8=_("ZodMap",(e,t)=>{Zu(),QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(kc(...n)),e.size=(...n)=>e.check(zu(...n))});function eH(e,t,n){return new r8({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var o8=_("ZodSet",(e,t)=>{Zu(),ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a),e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(kc(...n)),e.size=(...n)=>e.check(zu(...n))});function tH(e,t){return new o8({type:"set",valueType:e,...G.normalizeParams(t)})}var kp=_("ZodEnum",(e,t)=>{vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>eF(e,r,a,o),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{let o={};for(let i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new kp({...t,checks:[],...G.normalizeParams(a),entries:o})},e.exclude=(r,a)=>{let o={...t.entries};for(let i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new kp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Gw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new kp({type:"enum",entries:n,...G.normalizeParams(t)})}function nH(e,t){return new kp({type:"enum",entries:e,...G.normalizeParams(t)})}var i8=_("ZodLiteral",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(e,n,r,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function aH(e,t){return new i8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var A8=_("ZodFile",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a),e.min=(n,r)=>e.check(gA(n,r)),e.max=(n,r)=>e.check(kc(n,r)),e.mime=(n,r)=>e.check(mp(Array.isArray(n)?n:[n],r))});function rH(e){return F1(A8,e)}var s8=_("ZodTransform",(e,t)=>{Zu(),DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(e,n,r,a),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Cc(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(G.issue(i))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(o=>(n.value=o,n)):(n.value=a,n)}});function Uw(e){return new s8({type:"transform",transform:e})}var Mf=_("ZodOptional",(e,t)=>{_C.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Wu(e){return new Mf({type:"optional",innerType:e})}var Ow=_("ZodExactOptional",(e,t)=>{FD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function c8(e){return new Ow({type:"optional",innerType:e})}var u8=_("ZodNullable",(e,t)=>{SD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new u8({type:"nullable",innerType:e})}function oH(e){return Wu(Ff(e))}var d8=_("ZodDefault",(e,t)=>{LD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function l8(e,t){return new d8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var p8=_("ZodPrefault",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>yF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function g8(e,t){return new p8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var qw=_("ZodNonOptional",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function m8(e,t){return new qw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var f8=_("ZodSuccess",(e,t)=>{$D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function iH(e){return new f8({type:"success",innerType:e})}var b8=_("ZodCatch",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function h8(e,t){return new b8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var B8=_("ZodNaN",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a)});function AH(e){return x1(B8,e)}var jf=_("ZodPipe",(e,t)=>{xC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wF(e,n,r,a),e.in=t.in,e.out=t.out});function Cw(e,t){return new jf({type:"pipe",in:e,out:t})}var Pf=_("ZodCodec",(e,t)=>{jf.init(e,t),hf.init(e,t)});function sH(e,t,n){return new Pf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function cH(e){let t=e._zod.def;return new Pf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var y8=_("ZodPreprocess",(e,t)=>{jf.init(e,t),PD.init(e,t)}),C8=_("ZodReadonly",(e,t)=>{TD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>EF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function w8(e){return new C8({type:"readonly",innerType:e})}var E8=_("ZodTemplateLiteral",(e,t)=>{HD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a)});function uH(e,t){return new E8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var k8=_("ZodLazy",(e,t)=>{Bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>QF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function Q8(e){return new k8({type:"lazy",getter:e})}var I8=_("ZodPromise",(e,t)=>{UD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>kF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function dH(e){return new I8({type:"promise",innerType:e})}var v8=_("ZodFunction",(e,t)=>{GD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(e,n,r,a)});function lH(e){return new v8({type:"function",input:Array.isArray(e?.input)?n8(e?.input):e?.input??Nf(Ju()),output:e?.output??Ju()})}var Tf=_("ZodCustom",(e,t)=>{OD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(e,n,r,a)});function pH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function gH(e,t){return S1(Tf,e??(()=>!0),t)}function _8(e,t={}){return L1(Tf,e,t)}function x8(e,t){return N1(e,t)}var mH=R1,fH=$1;function bH(e,t={}){let n=new Tf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var hH=(...e)=>M1({Codec:Pf,Boolean:_p,String:Qp},...e);function BH(e){let t=Q8(()=>Dp([Df(e),TF(),HF(),qF(),Nf(t),a8(Df(),t)]));return t}function yH(e,t){return new y8({type:"pipe",in:Uw(e),out:t})}var Cde={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 wde(e){Bn({customError:e})}function Ede(){return Bn().customError}var D8;D8||(D8={});var Hf={};L(Hf,{ZodISODate:()=>xc,ZodISODateTime:()=>_c,ZodISODuration:()=>Fc,ZodISOTime:()=>Dc,date:()=>Qde,datetime:()=>kde,duration:()=>vde,time:()=>Ide});function kde(e){return kf(_c,e)}function Qde(e){return Qf(xc,e)}function Ide(e){return If(Dc,e)}function vde(e){return vf(Fc,e)}var X={...Fp,...hw,iso:Hf},_de=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"]);function xde(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function CH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function Dde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Fde(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let a=n[1]===void 0?void 0:Dde(n[1]);if(!a||!t.defs[a])throw new Error(`Reference not found: ${e}`);return t.defs[a]}throw new Error(`Reference not found: ${e}`)}function Sde(e,t){return X.transform(r=>r).check(r=>{let a=r.value;if(!(typeof a!="object"||a===null||Array.isArray(a)))for(let o of Object.getOwnPropertyNames(a)){let i=t.safeParse(o);i.success||r.issues.push({code:"invalid_key",origin:"record",issues:i.error.issues,input:o,path:[o],continue:!0})}}).pipe(e)}function wH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var Lde=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function EH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return X.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let a=e.$ref;if(t.refs.has(a))return t.refs.get(a);if(t.processing.has(a))return X.lazy(()=>{if(!t.refs.has(a))throw new Error(`Circular reference not resolved: ${a}`);return t.refs.get(a)});t.processing.add(a);let o=Fde(a,t),i=Or(o,t);return t.refs.set(a,i),t.processing.delete(a),i}if(e.enum!==void 0){let a=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&a.length===1&&a[0]===null)return X.null();if(a.length===0)return X.never();if(a.length===1)return X.literal(a[0]);if(a.every(i=>typeof i=="string"))return X.enum(a);let o=a.map(i=>X.literal(i));return o.length<2?o[0]:X.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return X.literal(e.const);let n=e.type;if(Array.isArray(n)){let a=n.map(o=>{let i={...e,type:o};return EH(i,t)});return a.length===0?X.never():a.length===1?a[0]:X.union(a)}if(!n)return X.any();let r;switch(n){case"string":{let a=X.string();if(e.format){let o=e.format;o==="email"?a=a.check(X.email()):o==="uri"||o==="uri-reference"?a=a.check(X.url()):o==="uuid"||o==="guid"?a=a.check(X.uuid()):o==="date-time"?a=a.check(X.iso.datetime({offset:!0})):o==="date"?a=a.check(X.iso.date()):o==="time"?a=a.check(X.regex(Lde)):o==="duration"?a=a.check(X.iso.duration()):o==="hostname"?a=a.check(X.hostname()):o==="ipv4"?a=a.check(X.ipv4()):o==="ipv6"?a=a.check(X.ipv6()):o==="mac"?a=a.check(X.mac()):o==="cidr"?a=a.check(X.cidrv4()):o==="cidr-v6"?a=a.check(X.cidrv6()):o==="base64"?a=a.check(X.base64()):o==="base64url"?a=a.check(X.base64url()):o==="e164"?a=a.check(X.e164()):o==="credit_card"?a=a.check(X.creditCard()):o==="jwt"?a=a.check(X.jwt()):o==="emoji"?a=a.check(X.emoji()):o==="nanoid"?a=a.check(X.nanoid()):o==="cuid"?a=a.check(X.cuid()):o==="cuid2"?a=a.check(X.cuid2()):o==="ulid"?a=a.check(X.ulid()):o==="xid"?a=a.check(X.xid()):o==="ksuid"&&(a=a.check(X.ksuid()))}typeof e.minLength=="number"&&(a=a.min(e.minLength)),typeof e.maxLength=="number"&&(a=a.max(e.maxLength)),e.pattern&&(a=a.regex(new RegExp(e.pattern))),r=a;break}case"number":case"integer":{let a=n==="integer"?X.number().int():X.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(a=a.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(a=a.max(e.maximum)),typeof e.exclusiveMinimum=="number"?a=a.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(a=a.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?a=a.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(a=a.lt(e.maximum)),typeof e.multipleOf=="number"&&(a=a.multipleOf(e.multipleOf)),r=a;break}case"boolean":{r=X.boolean();break}case"null":{r=X.null();break}case"object":{let a={},o=e.properties||{},i=new Set(e.required||[]),A=typeof e.additionalProperties=="object"?Or(e.additionalProperties,t):void 0;for(let[s,u]of Object.entries(o)){let d=Or(u,t);sn(a,s,i.has(s)?d:d.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),d=[];for(let g of u){let p=Or(s[g],t),m=X.string().regex(new RegExp(g));d.push(X.looseRecord(m,p))}let l=[];if(Object.keys(a).length>0&&l.push(X.object(a).passthrough()),l.push(...d),l.length===0)r=X.object({}).passthrough();else if(l.length===1)r=l[0];else{let g=X.intersection(l[0],l[1]);for(let p=2;p<l.length;p++)g=X.intersection(g,l[p]);r=g}if(e.additionalProperties===!1){let g=Object.keys(a),p=u.map(b=>new RegExp(b)),m=r;r=r.check(b=>{if(!Go(b.value))return;let B=[];for(let h of Object.keys(b.value))g.includes(h)||p.some(f=>f.test(h))||B.push(h);B.length&&b.issues.push({code:"unrecognized_keys",keys:B,input:b.value,inst:m})})}}else{let s=X.object(a);e.additionalProperties===!1?r=s.strict():A?r=s.catchall(A):r=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;r=Sde(r,Or(s,t))}break}case"array":{let a=e.prefixItems,o=e.items;if(a&&Array.isArray(a)){let i=typeof e.minItems=="number"?e.minItems:0,A=a.map(l=>Or(l,t)),s=CH(A,i),u=Array.isArray(o)?void 0:wH(o,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,A=o.map(l=>Or(l,t)),s=CH(A,i),u=wH(e.additionalItems,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(o!==void 0){let i=Or(o,t),A=X.array(i);typeof e.minItems=="number"&&(A=A.min(e.minItems)),typeof e.maxItems=="number"&&(A=A.max(e.maxItems)),r=A}else r=X.array(X.any());break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Or(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n=EH(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let A=e.anyOf.map(u=>Or(u,t)),s=X.union(A);n=r?X.intersection(n,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let A=e.oneOf.map(u=>Or(u,t)),s=X.xor(A);n=r?X.intersection(n,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:X.any();else{let A=r?n:Or(e.allOf[0],t),s=r?0:1;for(let u=s;u<e.allOf.length;u++)A=X.intersection(A,Or(e.allOf[u],t));n=A}e.nullable===!0&&t.version==="openapi-3.0"&&(n=X.nullable(n)),e.readOnly===!0&&(n=X.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let a={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let A of o)A in e&&(a[A]=e[A]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let A of i)A in e&&(a[A]=e[A]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(a.propertyNames=e.propertyNames);for(let A of Object.keys(e))_de.has(A)||sn(a,A,e[A]);return Object.keys(a).length>0&&t.registry.add(n,a),e.description&&(n=n.describe(e.description)),n}function kH(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=xde(n,t?.defaultTarget),a=n.$defs||n.definitions||{},o={version:r,defs:a,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??La};return Or(n,o)}var QH=Symbol("z.visit/resolving");function Gf(e,t){let n=typeof t=="function"?t:(i,A)=>{let s=t[i._zod.def.type];return s?s(i,A):i},r=new Map;function a(i){let A=r.get(i);if(A===QH)return new Bf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,QH);let s=o(i),u=n(s,s!==i);return r.set(i,u),u}function o(i){let A=i._zod.def,s=A.type;switch(s){case"object":{let u=A.shape,d=Object.keys(u),l=!1,g={};for(let m of d){let b=a(u[m]);b!==u[m]&&(l=!0),g[m]=b}let p=A.catchall;return A.catchall&&(p=a(A.catchall),p!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:g,catchall:p}):i}case"array":{let u=a(A.element);return u===A.element?i:bt(i,{...A,element:u})}case"tuple":{let u=A.items,d=!1,l=[];for(let p of u){let m=a(p);m!==p&&(d=!0),l.push(m)}let g=A.rest;return A.rest&&(g=a(A.rest),g!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:g}):i}case"record":case"map":{let u=a(A.keyType),d=a(A.valueType);return u===A.keyType&&d===A.valueType?i:bt(i,{...A,keyType:u,valueType:d})}case"set":{let u=a(A.valueType);return u===A.valueType?i:bt(i,{...A,valueType:u})}case"union":{let u=A.options,d=!1,l=[];for(let g of u){let p=a(g);p!==g&&(d=!0),l.push(p)}return d?bt(i,{...A,options:l}):i}case"intersection":{let u=a(A.left),d=a(A.right);return u===A.left&&d===A.right?i:bt(i,{...A,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=a(A.innerType);return u===A.innerType?i:bt(i,{...A,innerType:u})}case"pipe":{let u=a(A.in),d=a(A.out);return u===A.in&&d===A.out?i:bt(i,{...A,in:u,out:d})}case"function":{let u=a(A.input),d=a(A.output);return u===A.input&&d===A.output?i:bt(i,{...A,input:u,output:d})}case"lazy":{let u=A.getter,{_cachedInner:d,...l}=A;return bt(i,{...l,getter:()=>a(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return i;default:return i}}return a(e)}function IH(e){return Gf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Dp(n.options)}})}function Nde(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,yi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function vH(e){return Nde(e.out,e.checks)}function Rde(e){return e.in._zod.traits.has("$ZodTransform")?vH(e):e.in}function _H(e){return Gf(e,{pipe:t=>Rde(t._zod.def),default:(t,n)=>n?Wu(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function xH(e){return Gf(e,{pipe:t=>vH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var F8={};L(F8,{bigint:()=>Pde,boolean:()=>jde,date:()=>Tde,number:()=>Mde,string:()=>$de});function $de(e){return a1(Qp,e)}function Mde(e){return s1(vp,e)}function jde(e){return m1(_p,e)}function Pde(e){return b1(xp,e)}function Tde(e){return _1(Lf,e)}var DH=["none","low","medium","high","xhigh"];var zw=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Hde(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var Gde=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Hde,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),SH=c.discriminatedUnion("kind",[Gde]),Ude=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),LH=c.object({icon:Ude.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Of=c.enum(["closed","merged","open"]),P9e=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Of,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),H9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Ode=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),qde=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),NH=c.object({details:c.array(qde).max(100).optional(),icon:Ode.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var Yw=c.string().regex(/^T[A-Z0-9]+$/),S8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),RH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),zde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),Kw=zde,he=c.string().refine(e=>e.trim().length>0),Ja=he.refine(e=>e===e.trim()),Kde=c.object({id:he,provider:Ja}).strict(),Yde=Kde.extend({provider:c.literal("slack"),teamId:Yw,channelId:S8,threadTs:Ja.optional()}).strict(),U9e=c.discriminatedUnion("provider",[Yde]),O9e=c.enum(["slack","local"]),$H=c.enum(["public","private"]),Jde=c.enum(["public","private"]),Wde=c.object({platform:c.literal("slack"),teamId:Yw,channelId:S8,threadTs:Ja.optional()}).strict(),L8=Wde,Zde=c.object({platform:c.literal("local"),conversationId:RH}).strict(),Vde=c.discriminatedUnion("platform",[L8,Zde]),MH=c.object({action:c.literal("send_message"),destination:L8}).strict(),Xde=c.object({kind:c.literal("slack"),teamId:Yw,channelId:S8,visibility:$H,messageTs:he.optional(),threadTs:he.optional()}).strict(),ele=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:RH}).strict(),tle=c.object({kind:c.literal("web"),visibility:$H,conversationId:Ja}).strict(),nle=c.object({kind:c.literal("event"),eventKey:Ja,eventType:Ja,identifier:Ja,namespace:Ja}).strict(),ale=c.object({kind:c.literal("scheduled_automation")}).strict(),rle=c.object({kind:c.literal("event_automation")}).strict(),ole=c.object({kind:c.literal("plugin_dispatch")}).strict(),ile=c.object({kind:c.literal("agent_invocation")}).strict(),Ale=c.discriminatedUnion("kind",[Xde,ele,tle,nle,ale,rle,ole,ile]);function sle(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var cle=c.preprocess(sle,Ale),ule=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:Kw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:Kw,allowedWhen:c.literal("scheduled-automation"),taskId:Ja}).strict()]),N8={email:he.optional(),fullName:he.optional(),userId:Kw,userName:he.optional()},dle=c.object({...N8,platform:c.literal("slack"),teamId:Yw}).strict(),lle=c.object({...N8,platform:c.literal("local")}).strict(),ple=c.object({...N8,platform:c.literal("web")}).strict(),gle=c.object({platform:c.literal("system"),name:Kw}).strict(),Uf=c.discriminatedUnion("platform",[dle,lle,ple,gle]),mle=c.object({displayName:he.optional(),handle:he.optional(),id:Ja,provider:Ja,providerSubjectId:Ja,providerTenantId:Ja.optional()}).strict(),q9e=c.object({displayName:he.optional(),email:he.max(320),id:Ja,identities:c.array(mle).max(100)}).strict(),fle=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),ble=c.object({label:Ja.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Ja.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),z9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:ule.optional(),destination:L8,destinationVisibility:Jde,input:he.pipe(c.string().max(32e3)),metadata:fle.optional(),replyAttribution:ble.optional()}).strict();var hle=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),Y9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),J9e=c.object({kind:hle,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var Ble=4e3,yle=8e3,Sp=32,FH=4e3,Cle=1e3,wle=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event data may include at most ${Sp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>FH&&t.addIssue({code:"custom",message:`Event data may be at most ${FH} JSON bytes.`})}),Xu=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),jH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),PH=/^[a-z][a-zA-Z0-9]*$/,Ele=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),kle=c.record(c.string().regex(PH),Ele).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Sp} keys.`})}),Z9e=c.record(c.string().regex(PH),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event match may include at most ${Sp} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var Qle=c.object({type:jH,supportedEvents:c.array(Xu).min(1),suggestedEvents:c.array(Xu).optional(),matchFields:kle.optional(),guidance:c.record(Xu,c.string().trim().min(1).max(Cle)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),V9e=c.object({resourceTypes:c.array(Qle).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var X9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Xu).optional(),supportedEvents:c.array(Xu),type:jH}).strict(),e6e=c.object({events:c.array(Xu).min(1),id:c.string().min(1)}).strict(),Ile=c.object({eventKey:c.string().min(1),eventType:Xu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,Ble)),data:wle.optional(),untrustedText:c.string().transform(e=>e.slice(0,yle)).optional()}).strict(),t6e=Ile.extend({namespace:c.string().min(1)}),vle=c.object({authority:c.enum(["instruction","context"]),actor:Uf.optional()}).strict(),_le=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:vle.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),a6e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Vde,locationId:c.string().min(1).optional(),actors:c.array(Uf),actor:Uf.optional(),runId:c.string().min(1),source:cle,transcript:c.array(_le)}).strict();var o6e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),xle=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),i6e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:xle.optional()}).passthrough(),A6e=c.enum(["auto","review","approve"]);var c6e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:he}).strict(),Dle=c.string().regex(/^[a-z][a-z0-9-]*$/),Fle=c.string().regex(/^[a-z][a-z0-9.-]*$/),Sle=c.union([c.literal("read"),c.literal("write")]),TH=c.object({provider:Dle,scope:he.optional(),type:c.literal("oauth")}).strict(),HH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),d6e=c.object({account:HH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),l6e=c.object({access:Sle,leaseScope:he.optional(),name:Fle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),Lle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Nle=c.object({account:HH.optional(),authorization:TH.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Lle).min(1)}).strict(),p6e=c.discriminatedUnion("type",[c.object({lease:Nle,type:c.literal("lease")}).strict(),c.object({authorization:TH.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var Rle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),$le=he.max(80),Mle=he.max(500),jle=c.enum(["primary","profile"]),Ple=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Tle=c.object({label:he.max(80),value:he.max(500)}).strict(),Hle=c.object({confirmation:he.max(500).optional(),href:he.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:he.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),Gle=c.object({actions:c.array(Hle).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Tle).max(8).optional(),title:he.max(4e3)}).strict(),m6e=c.object({emptyText:he.max(500).optional(),metrics:c.array(Ple).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array(Gle).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),Ule=c.object({description:Mle,id:Rle,label:$le,navigation:jle,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),f6e=c.array(Ule),Ole=he.max(1e3).optional(),qle=he.max(64).optional(),zle=c.string().trim().max(200).optional(),b6e=c.object({cursor:Ole,filter:qle,limit:c.number().int().min(1).max(50),query:zle}).strict();var Kle=c.object({input:c.number().finite().nonnegative().optional(),output:c.number().finite().nonnegative().optional(),cacheRead:c.number().finite().nonnegative().optional(),cacheWrite:c.number().finite().nonnegative().optional(),total:c.number().finite().nonnegative().optional()}).strict(),Yle=c.object({inputTokens:c.number().int().nonnegative().optional(),outputTokens:c.number().int().nonnegative().optional(),cachedInputTokens:c.number().int().nonnegative().optional(),cacheCreationTokens:c.number().int().nonnegative().optional(),reasoningTokens:c.number().int().nonnegative().optional(),totalTokens:c.number().int().nonnegative().optional(),cost:Kle.optional()}).strict(),Jle=c.union([c.literal("instruction"),c.literal("context")]),Wle=c.object({authority:Jle,actor:Uf.optional()}).strict();var Zle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Wle}).passthrough(),Vle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),Xle=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),UH=c.discriminatedUnion("type",[Zle,Vle,Xle]),epe=c.object({item:UH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),GH=c.array(epe),tpe=c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict(),OH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:zw,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:GH}).strict(),c.object({type:c.literal("compaction"),modelProfile:zw,modelId:c.string().min(1),details:tpe.optional(),summary:c.string().min(1).optional(),replacementHistory:GH}).strict()]),w6e=c.object({data:OH,createdAtMs:c.number().finite()}).strict(),npe=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),ape=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),qH=c.union([c.literal("plugin"),c.literal("mcp")]),rpe=c.object({type:c.literal("authorization_requested"),kind:qH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1),delivery:c.union([c.literal("private_link_sent"),c.literal("private_link_reused")])}).strict(),ope=c.object({type:c.literal("authorization_completed"),kind:qH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),ipe=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),Ape=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),spe=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),zH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:spe,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),cpe=zH.extend({type:c.literal("message_updated")}),upe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),dpe=c.object({type:c.literal("messages_summarized"),historyFromSeq:c.number().int().nonnegative(),compactions:c.array(c.object({coveredMessageCount:c.number().int().nonnegative(),createdAtMs:c.number(),id:c.string().min(1),summary:c.string()}).strict())}).strict(),lpe=c.enum(["slack","api","scheduler","internal"]),j8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),P8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),ppe=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:lpe}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),gpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:zw,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(DH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),mpe=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1).max(64),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),fpe=c.object({type:c.literal("structured_event"),namespace:c.string().regex(/^[a-z][a-z0-9-]*$/),name:c.string().regex(/^[a-z][a-z0-9_]*$/),version:c.number().int().positive(),turnId:c.string().min(1).optional(),content:c.record(c.string(),c.unknown())}).strict(),bpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),hpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(bpe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),Bpe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),ype=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:j8,failureReason:P8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),Cpe=c.object({type:c.literal("subagent_started"),subagentInvocationId:c.string().min(1),subagentKind:c.string().min(1),modelId:c.string().min(1).optional(),parentToolCallId:c.string().min(1).optional(),reasoningLevel:c.string().min(1).optional(),childConversationId:c.string().min(1)}).strict(),wpe=c.object({type:c.literal("subagent_ended"),subagentInvocationId:c.string().min(1),outcome:c.union([c.literal("success"),c.literal("error"),c.literal("aborted")]),errorCode:c.string().min(1).optional()}).strict(),KH=c.union([zH,cpe,UH,npe,rpe,ope,ipe,Ape,upe,dpe,ppe,mpe,fpe,hpe,gpe,Bpe,ype,Cpe,wpe]),Epe=c.union([KH,OH,ape]),kpe=["message","message_updated","user_message","assistant_message","tool_result","mcp_provider_connected","mcp_provider_connected_unowned","authorization_requested","authorization_completed","tool_execution_started","guardian_action_reviewed","message_handled","messages_summarized","turn_started","turn_context","structured_event","attachments_delivered","turn_routed","turn_completed","turn_failed","subagent_started","subagent_ended","handoff","compaction"],E6e=c.enum(kpe),Qpe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),M8=c.object({schemaVersion:c.number().int().nonnegative(),seq:c.number().int().nonnegative(),historyVersion:c.number().int().nonnegative(),idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),k6e=c.union([M8.extend({schemaVersion:c.literal(1),data:Epe}),M8.extend({data:Qpe})]),Q6e=M8.extend({type:c.string().min(1),payload:c.unknown()});var I6e=c.object({data:KH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),Wa=c.string().trim().min(1).max(400),T8=c.string().url().max(2048),qf=c.string().datetime(),YH=c.object({provider:c.string().trim().min(1).max(100),channelName:Wa.optional()}).strict(),Ipe=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),JH=c.object({repository:Wa,number:c.number().int().positive(),title:Wa.optional(),url:T8,state:Of,openedAt:qf.optional(),mergedAt:qf.optional(),closedAt:qf.optional()}).strict(),vpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Wa,url:T8,status:Wa.optional()}).strict(),_pe=c.object({startedAt:qf,lastActivityAt:qf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Wa,messages:c.number().int().positive()}).strict()),userMessages:c.number().int().nonnegative(),assistantMessages:c.number().int().nonnegative(),toolResults:c.number().int().nonnegative(),events:c.number().int().nonnegative(),turns:c.number().int().positive().optional(),location:YH.optional(),codeChanges:c.array(JH)}).strict(),xpe=c.object({schemaVersion:c.literal(1),record:_pe,summary:c.string().trim().min(1).max(600),intent:Wa,outcome:c.object({status:Ipe,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Wa,by:Wa.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Wa,owner:Wa.optional()}).strict()).max(20),facts:c.array(Wa).max(30),links:c.array(vpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),Dpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Wa.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),Fpe=c.object({label:Wa,url:T8,status:Wa.optional()}).strict(),v6e=c.object({conversationId:c.string().min(1),title:Wa.optional(),visibility:c.enum(["private","public"]),location:YH.optional(),entries:c.array(Dpe),codeChanges:c.array(JH),resources:c.array(Fpe)}).strict();var Spe=c.enum(["active","completed","failed"]),Lpe=c.enum(["api","internal","scheduler","slack"]),WH=Yle,Npe=c.object({conversationId:c.string().min(1)}).strict(),_6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),Rpe=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),$pe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Mpe=c.object({actorEmail:c.string().trim().email().transform(e=>e.toLowerCase()).optional(),q:c.string().trim().max(200).optional(),status:c.enum(["active","archived"]).default("active")}).strict(),jpe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),H8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),Ppe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3),visibility:c.enum(["private","public"]).optional()}).strict(),Tpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Jw=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),ed=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),ZH=c.enum(["defer","interrupt"]),VH=c.object({actorIdentity:ed.optional(),createdAt:c.string().datetime(),delivery:ZH,inboundMessageId:c.string().min(1),messageId:c.string().min(1),receivedAt:c.string().datetime(),role:c.literal("user"),source:c.enum(["slack","web"]),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"pending message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted pending messages must not expose actor identity"})}),XH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),G8=c.object({authorization:XH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(VH)}).strict(),Hpe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),U8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),eG=c.object({costUsd:c.number().finite().nonnegative(),operations:c.array(c.object({costUsd:c.number().finite().nonnegative(),events:c.number().int().positive(),name:c.string().min(1),namespace:c.string().min(1)}).strict()).min(1)}).strict(),Gpe=c.object({id:c.string().min(1).optional(),kind:c.enum(["scheduled","event"]),label:c.string().min(1).optional(),title:c.string().min(1).optional()}).strict().superRefine((e,t)=>{!!e.id!=!!e.label&&t.addIssue({code:"custom",message:"sourceTask id and label must both be set or both omitted"})}),Upe=SH.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),tG=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Lp=c.object({displayTitle:c.string(),activityPreview:tG.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:WH.optional(),auxiliaryCosts:eG.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:Spe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:Lpe,actorIdentity:ed.optional(),participants:c.array(ed).optional(),archivedAt:c.string().datetime().nullable().optional(),channel:c.string().optional(),channelName:c.string().optional(),channelNameRedacted:c.boolean().optional(),locationId:c.string().optional(),sentryTraceUrl:c.string().optional(),locationUrl:c.string().url().optional(),traceId:c.string().optional(),annotations:c.array(Upe).optional(),sidebarAnnotations:c.array(LH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),Ope=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:ed.optional(),eventType:c.string().min(1).optional(),explicitMention:c.boolean().optional(),trustedSummary:c.string().min(1).optional(),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted messages must not expose actor identity"})}),qpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),zpe=c.object({toolCallId:c.string().min(1),name:c.string().min(1),status:c.enum(["running","completed","error"]),startedAt:c.string().datetime().optional(),startedSeq:c.number().int().nonnegative().optional(),input:c.unknown().optional(),output:c.unknown().optional()}).strict().superRefine((e,t)=>{e.startedAt===void 0!=(e.startedSeq===void 0)&&t.addIssue({code:"custom",message:"tool start sequence and timestamp must be provided together"})}),nG=c.object({type:c.literal("reasoning"),text:c.string().min(1).optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"reasoning content must be text or explicitly redacted"})}),Kpe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Ype=c.object({parts:c.array(c.discriminatedUnion("type",[nG,Kpe])).min(1)}).strict(),Jpe=c.object({type:c.literal("tool_calls"),calls:c.array(zpe).min(1),assistant:Ype.optional()}).strict().superRefine((e,t)=>{if(!e.assistant)return;let n=new Map;for(let a of e.calls)n.set(a.toolCallId,(n.get(a.toolCallId)??0)+1);let r=new Map;for(let a of e.assistant.parts)a.type==="tool_call"&&r.set(a.toolCallId,(r.get(a.toolCallId)??0)+1);(n.size!==r.size||[...n].some(([a,o])=>r.get(a)!==o))&&t.addIssue({code:"custom",path:["assistant","parts"],message:"assistant tool parts must reference every call exactly once"})}),Wpe=c.object({type:c.literal("assistant_message"),parts:c.array(nG).min(1)}).strict(),Zpe=c.discriminatedUnion("state",[c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.enum(["succeeded","no_reply"])}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("started"),inputMessageIds:c.array(c.string().min(1)).min(1).optional()}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("failed"),failureCode:j8,failureReason:P8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),Vpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:c.string().min(1),modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.string().min(1),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),Xpe=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),ege=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),tge=c.object({type:c.literal("structured_event"),namespace:c.string().min(1),name:c.string().min(1),version:c.number().int().positive(),turnId:c.string().min(1).optional(),presentation:NH}).strict(),nge=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),age=c.object({type:c.literal("attachments_delivered"),attachments:c.array(nge).min(1)}).strict(),rge=c.object({type:c.literal("compaction"),modelProfile:c.string().min(1).optional(),modelId:c.string().min(1).optional(),summary:c.string().min(1).optional(),details:c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict().optional()}).strict(),oge=c.object({type:c.literal("handoff"),modelProfile:c.string().min(1),modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional()}).strict(),ige=c.object({type:c.literal("subagent"),startedSeq:c.number().int().nonnegative(),startedAt:c.string().datetime(),childConversationId:c.string().min(1),subagentKind:c.string().min(1),parentToolCallId:c.string().min(1).optional(),status:c.enum(["running","completed","error","aborted"])}).strict(),aG=c.discriminatedUnion("type",[Ope,qpe,Wpe,Jpe,Zpe,ege,tge,age,Vpe,Xpe,rge,oge,ige]),O8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:aG}).strict(),q8=c.discriminatedUnion("status",[c.object({status:c.literal("available")}).strict(),c.object({status:c.literal("redacted"),reason:c.literal("non_public_conversation")}).strict(),c.object({status:c.literal("expired"),expiredAt:c.string().datetime()}).strict()]),Age=c.object({modelId:c.string(),usage:WH}).strict();function rG(e,t){e.eventHistory.status==="expired"&&e.events.length>0&&t.addIssue({code:"custom",path:["events"],message:"expired event history must not contain events"});for(let n=1;n<e.events.length;n+=1)e.events[n].seq<=e.events[n-1].seq&&t.addIssue({code:"custom",path:["events",n,"seq"],message:"report event sequences must be strictly increasing"});for(let[n,r]of e.events.entries())r.data.type==="message"&&(e.eventHistory.status==="redacted"&&r.data.redacted!==!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact messages"}),e.eventHistory.status==="available"&&r.data.redacted===!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose messages"})),e.eventHistory.status==="redacted"&&r.data.type==="tool_calls"&&r.data.calls.some(a=>a.input!==void 0||a.output!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact tool payloads"}),e.eventHistory.status==="redacted"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.text!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact assistant messages"}),e.eventHistory.status==="available"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.redacted===!0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose reasoning"}),r.data.type==="tool_calls"&&(e.eventHistory.status==="redacted"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.text!==void 0)||e.eventHistory.status==="available"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.redacted===!0))&&t.addIssue({code:"custom",path:["events",n,"data","assistant"],message:"assistant reasoning must match event history visibility"})}var z8=Lp.extend({brief:c.object({content:xpe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(Age).optional(),events:c.array(O8),eventHistory:q8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:Gpe.optional()}).strict().superRefine(rG),K8=c.object({events:c.array(O8),eventHistory:q8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(rG),Y8=c.object({conversations:c.array(Lp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),td=c.object({active:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),label:c.string(),costUsd:c.number().optional(),tokens:c.number().optional()}).strict(),oG=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),R8=c.object({cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:oG,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),$8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:oG,deny:c.number(),requests:c.number()}).strict(),sge=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array($8),metricHours:c.array($8).optional(),metricSixHours:c.array($8).optional(),requests:c.number()}).strict(),J8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:sge,metricDays:c.array(R8),metricHours:c.array(R8).optional(),metricSixHours:c.array(R8).optional(),locations:c.array(td),actors:c.array(td),source:c.literal("conversation_index"),costUsd:c.number().optional(),inputTokens:c.number().optional(),tokens:c.number().optional(),windowEnd:c.string(),windowStart:c.string()}).strict();var cge=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),iG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),W8=c.array(iG),Z8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),V8=c.array(Z8),AG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),sG=c.object({packageNames:c.array(c.string()),packages:c.array(AG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),uge=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(Z8),packagedContent:sG}).strict(),X8=c.enum(["danger","good","neutral","warning"]),dge=c.object({label:c.string(),tone:X8.optional(),value:c.string()}).strict(),lge=c.object({key:c.string(),label:c.string()}).strict(),pge=c.object({id:c.string(),tone:X8.optional(),values:c.record(c.string(),c.string())}).strict(),gge=c.object({fields:c.array(lge).optional(),emptyText:c.string().optional(),records:c.array(pge).optional(),title:c.string()}).strict(),mge=c.object({categories:c.array(c.object({id:c.string().min(1),label:c.string().min(1),values:c.record(c.string(),c.number().finite())}).strict()).max(100),description:c.string().optional(),emptyText:c.string().optional(),id:c.string().min(1),series:c.array(c.object({format:c.literal("usd").optional(),key:c.string().min(1),label:c.string().min(1),tone:X8.optional()}).strict()).min(1).max(8),timeRangeDays:c.array(c.union([c.literal(1),c.literal(7),c.literal(30),c.literal(90)])).min(1).max(4).optional(),title:c.string().min(1),type:c.literal("bar_chart")}).strict(),cG=c.object({generatedAt:c.string().optional(),metrics:c.array(dge).optional(),recordSets:c.array(gge).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(mge).max(12).optional()}).strict(),Ww=c.object({generatedAt:c.string(),reports:c.array(cG),source:c.literal("plugins")}).strict();var D=Symbol.for("drizzle:entityKind");function On(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,D))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(D in n&&n[D]===t[D])return!0;n=Object.getPrototypeOf(n)}return!1}var nd=class{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[D]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};var Zw=class{static[D]="ColumnBuilder";config;constructor(t,n,r){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}};var hs=Symbol.for("drizzle:Name");var Vw=class{static[D]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(t,n){this.reference=()=>{let{name:r,columns:a,foreignColumns:o}=t();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t===void 0?"no action":t,this}onDelete(t){return this._onDelete=t===void 0?"no action":t,this}build(t){return new e2(t,this)}},e2=class{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[D]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:t,columns:n,foreignColumns:r}=this.reference(),a=n.map(A=>A.name),o=r.map(A=>A.name),i=[this.table[hs],...a,r[0].table[hs],...o];return t??`${i.join("_")}_fk`}};function Xw(e,...t){return e(...t)}function a2(e,t){return`${e[hs]}_${t.join("_")}_unique`}var t2=class{constructor(t,n){this.name=n,this.columns=t}static[D]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(t){return new n2(t,this.columns,this.nullsNotDistinctConfig,this.name)}},uG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new t2(t,this.name)}},n2=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??a2(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function dG(e,t,n){for(let r=t;r<e.length;r++){let a=e[r];if(a==="\\"){r++;continue}if(a==='"')return[e.slice(t,r).replace(/\\/g,""),r+1];if(!n&&(a===","||a==="}"))return[e.slice(t,r).replace(/\\/g,""),r]}return[e.slice(t).replace(/\\/g,""),e.length]}function lG(e,t=0){let n=[],r=t,a=!1;for(;r<e.length;){let o=e[r];if(o===","){(a||r===t)&&n.push(""),a=!0,r++;continue}if(a=!1,o==="\\"){r+=2;continue}if(o==='"'){let[s,u]=dG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=lG(e,r+1);n.push(s),r=u;continue}let[i,A]=dG(e,r,!1);n.push(i),r=A}return[n,r]}function pG(e){let[t]=lG(e,1);return t}function r2(e){return`{${e.map(t=>Array.isArray(t)?r2(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends Zw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new i2(this.config.name,this,t)}references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t,n){return this.config.isUnique=!0,this.config.uniqueName=t,this.config.uniqueType=n?.nulls,this}generatedAlwaysAs(t){return this.config.generated={as:t,type:"always",mode:"stored"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:r,actions:a})=>Xw((o,i)=>{let A=new Vw(()=>{let s=o();return{columns:[t],foreignColumns:[s]}});return i.onUpdate&&A.onUpdate(i.onUpdate),i.onDelete&&A.onDelete(i.onDelete),A.build(n)},r,a))}buildExtraConfigColumn(t){return new o2(t,this.config)}},W=class extends nd{constructor(t,n){n.uniqueName||(n.uniqueName=a2(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},o2=class extends W{static[D]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(t){return this.indexConfig.opClass=t,this}},Np=class{static[D]="IndexedColumn";constructor(t,n,r,a){this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=a}name;keyAsName;type;indexConfig},i2=class extends ee{static[D]="PgArrayBuilder";constructor(t,n,r){super(t,"array","PgArray"),this.config.baseBuilder=n,this.config.size=r}build(t){let n=this.config.baseBuilder.build(t);return new A2(t,this.config,n)}},A2=class e extends W{constructor(t,n,r,a){super(t,n),this.baseColumn=r,this.range=a,this.size=n.size}size;static[D]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(t){return typeof t=="string"&&(t=pG(t)),t.map(n=>this.baseColumn.mapFromDriverValue(n))}mapToDriverValue(t,n=!1){let r=t.map(a=>a===null?null:On(this.baseColumn,e)?this.baseColumn.mapToDriverValue(a,!0):this.baseColumn.mapToDriverValue(a));return n?r:r2(r)}};var gG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new s2(t,this.config)}},s2=class extends W{static[D]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}},mG=Symbol.for("drizzle:isPgEnum");function bG(e){return!!e&&typeof e=="function"&&mG in e&&e[mG]===!0}var fG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new c2(t,this.config)}},c2=class extends W{static[D]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}};var Rp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},hG=class extends Rp{static[D]="WithSubquery"};var BG="0.45.2";var u2,d2,yG={startActiveSpan(e,t){return u2?(d2||(d2=u2.trace.getTracer("drizzle-orm",BG)),Xw((n,r)=>r.startActiveSpan(e,a=>{try{return t(a)}catch(o){throw a.setStatus({code:n.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{a.end()}}),u2,d2)):t()}};var $p=Symbol.for("drizzle:ViewBaseConfig");var l2=Symbol.for("drizzle:Schema"),CG=Symbol.for("drizzle:Columns"),wG=Symbol.for("drizzle:ExtraConfigColumns"),p2=Symbol.for("drizzle:OriginalName"),g2=Symbol.for("drizzle:BaseName"),zf=Symbol.for("drizzle:IsAlias"),EG=Symbol.for("drizzle:ExtraConfigBuilder"),fge=Symbol.for("drizzle:IsDrizzleTable"),_n=class{static[D]="Table";static Symbol={Name:hs,Schema:l2,OriginalName:p2,Columns:CG,ExtraConfigColumns:wG,BaseName:g2,IsAlias:zf,ExtraConfigBuilder:EG};[hs];[p2];[l2];[CG];[wG];[g2];[zf]=!1;[fge]=!0;[EG]=void 0;constructor(t,n,r){this[hs]=this[p2]=t,this[l2]=n,this[g2]=r}};var kG=class{static[D]="FakePrimitiveParam"};function bge(e){return e!=null&&typeof e.getSQL=="function"}function hge(e){let t={sql:"",params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var bo=class{static[D]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new xn([this])}},xn=class e{constructor(t){this.queryChunks=t;for(let n of t)if(On(n,_n)){let r=n[_n.Symbol.Schema];this.usedTables.push(r===void 0?n[_n.Symbol.Name]:r+"."+n[_n.Symbol.Name])}}static[D]="SQL";decoder=QG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return yG.startActiveSpan("drizzle.buildSQL",n=>{let r=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:i,prepareTyping:A,inlineParams:s,paramStartIndex:u}=r;return hge(t.map(d=>{if(On(d,bo))return{sql:d.value.join(""),params:[]};if(On(d,Kf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new bo("(")];for(let[g,p]of d.entries())l.push(p),g<d.length-1&&l.push(new bo(", "));return l.push(new bo(")")),this.buildQueryFromSourceParams(l,r)}if(On(d,e))return this.buildQueryFromSourceParams(d.queryChunks,{...r,inlineParams:s||d.shouldInlineParams});if(On(d,_n)){let l=d[_n.Symbol.Schema],g=d[_n.Symbol.Name];return{sql:l===void 0||d[zf]?o(g):o(l)+"."+o(g),params:[]}}if(On(d,nd)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let g=d.table[_n.Symbol.Schema];return{sql:d.table[zf]||g===void 0?o(d.table[_n.Symbol.Name])+"."+o(l):o(g)+"."+o(d.table[_n.Symbol.Name])+"."+o(l),params:[]}}if(On(d,m2)){let l=d[$p].schema,g=d[$p].name;return{sql:l===void 0||d[$p].isAlias?o(g):o(l)+"."+o(g),params:[]}}if(On(d,eE)){if(On(d.value,Yf))return{sql:i(u.value++,d),params:[d],typings:["none"]};let l=d.value===null?null:d.encoder.mapToDriverValue(d.value);if(On(l,e))return this.buildQueryFromSourceParams([l],r);if(s)return{sql:this.mapInlineParam(l,r),params:[]};let g=["none"];return A&&(g=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:g}}return On(d,Yf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:On(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:On(d,Rp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new bo("("),d._.sql,new bo(") "),new Kf(d._.alias)],r):bG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:bge(d)?d.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([d.getSQL()],r):this.buildQueryFromSourceParams([new bo("("),d.getSQL(),new bo(")")],r):s?{sql:this.mapInlineParam(d,r),params:[]}:{sql:i(u.value++,d),params:[d],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){let r=t.toString();return n(r==="[object Object]"?JSON.stringify(t):r)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}},Kf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new xn([this])}};var QG={mapFromDriverValue:e=>e},IG={mapToDriverValue:e=>e},yLe={...QG,...IG},eE=class{constructor(t,n=IG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new xn([this])}};function Mp(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new bo(e[0]));for(let[r,a]of t.entries())n.push(a,new bo(e[r+1]));return new xn(n)}(e=>{function t(){return new xn([])}e.empty=t;function n(s){return new xn(s)}e.fromList=n;function r(s){return new xn([new bo(s)])}e.raw=r;function a(s,u){let d=[];for(let[l,g]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(g);return new xn(d)}e.join=a;function o(s){return new Kf(s)}e.identifier=o;function i(s){return new Yf(s)}e.placeholder=i;function A(s,u){return new eE(s,u)}e.param=A})(Mp||(Mp={}));(e=>{class t{constructor(r,a){this.sql=r,this.fieldAlias=a}static[D]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(xn||(xn={}));var Yf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new xn([this])}};var Bge=Symbol.for("drizzle:IsDrizzleView"),m2=class{static[D]="View";[$p];[Bge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[$p]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new xn([this])}};nd.prototype.getSQL=function(){return new xn([this])};_n.prototype.getSQL=function(){return new xn([this])};Rp.prototype.getSQL=function(){return new xn([this])};function We(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}var wLe=typeof TextDecoder>"u"?null:new TextDecoder;var Bs=class extends ee{static[D]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"always",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"byDefault",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var f2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new b2(t,this.config)}},b2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},h2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new B2(t,this.config)}},B2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function vG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new f2(n):new h2(n)}var y2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new C2(t,this.config)}},C2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},w2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new E2(t,this.config)}},E2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function _G(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new y2(n):new w2(n)}var k2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new Q2(t,this.config)}},Q2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function xG(e){return new k2(e??"")}var I2=class extends ee{static[D]="PgCharBuilder";constructor(t,n){super(t,"string","PgChar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new v2(t,this.config)}},v2=class extends W{static[D]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function DG(e,t={}){let{name:n,config:r}=We(e,t);return new I2(n,r)}var _2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new x2(t,this.config)}},x2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function FG(e){return new _2(e??"")}var D2=class extends ee{static[D]="PgCustomColumnBuilder";constructor(t,n,r){super(t,"custom","PgCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(t){return new F2(t,this.config)}},F2=class extends W{static[D]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}};function SG(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new D2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Mp`now()`)}};var S2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new L2(t,this.config)}},L2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},N2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new R2(t,this.config)}},R2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function LG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new S2(n):new N2(n)}var $2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new M2(t,this.config)}},M2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function NG(e){return new $2(e??"")}var j2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new P2(t,this.config)}},P2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function RG(e){return new j2(e??"")}var T2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new H2(t,this.config)}},H2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function $G(e){return new T2(e??"")}var G2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new U2(t,this.config)}},U2=class extends W{static[D]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let t=this.fields?` ${this.fields}`:"",n=this.precision?`(${this.precision})`:"";return`interval${t}${n}`}};function MG(e,t={}){let{name:n,config:r}=We(e,t);return new G2(n,r)}var O2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new q2(t,this.config)}},q2=class extends W{static[D]="PgJson";constructor(t,n){super(t,n)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function jG(e){return new O2(e??"")}var z2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new K2(t,this.config)}},K2=class extends W{static[D]="PgJsonb";constructor(t,n){super(t,n)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function tE(e){return new z2(e??"")}var Y2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new J2(t,this.config)}},J2=class extends W{static[D]="PgLine";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r),Number.parseFloat(a)]}mapToDriverValue(t){return`{${t[0]},${t[1]},${t[2]}}`}},W2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new Z2(t,this.config)}},Z2=class extends W{static[D]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return{a:Number.parseFloat(n),b:Number.parseFloat(r),c:Number.parseFloat(a)}}mapToDriverValue(t){return`{${t.a},${t.b},${t.c}}`}};function PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new Y2(n):new W2(n)}var V2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new X2(t,this.config)}},X2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function TG(e){return new V2(e??"")}var eS=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new tS(t,this.config)}},tS=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function HG(e){return new eS(e??"")}var nS=class extends ee{static[D]="PgNumericBuilder";constructor(t,n,r){super(t,"string","PgNumeric"),this.config.precision=n,this.config.scale=r}build(t){return new aS(t,this.config)}},aS=class extends W{static[D]="PgNumeric";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},rS=class extends ee{static[D]="PgNumericNumberBuilder";constructor(t,n,r){super(t,"number","PgNumericNumber"),this.config.precision=n,this.config.scale=r}build(t){return new oS(t,this.config)}},oS=class extends W{static[D]="PgNumericNumber";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},iS=class extends ee{static[D]="PgNumericBigIntBuilder";constructor(t,n,r){super(t,"bigint","PgNumericBigInt"),this.config.precision=n,this.config.scale=r}build(t){return new AS(t,this.config)}},AS=class extends W{static[D]="PgNumericBigInt";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function GG(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new rS(n,r?.precision,r?.scale):a==="bigint"?new iS(n,r?.precision,r?.scale):new nS(n,r?.precision,r?.scale)}var sS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new cS(t,this.config)}},cS=class extends W{static[D]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r)]}return[t.x,t.y]}mapToDriverValue(t){return`(${t[0]},${t[1]})`}},uS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new dS(t,this.config)}},dS=class extends W{static[D]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return{x:Number.parseFloat(n),y:Number.parseFloat(r)}}return t}mapToDriverValue(t){return`(${t.x},${t.y})`}};function UG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new sS(n):new uS(n)}function yge(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function OG(e,t){let n=new ArrayBuffer(8),r=new DataView(n);for(let a=0;a<8;a++)r.setUint8(a,e[t+a]);return r.getFloat64(0,!0)}function lS(e){let t=yge(e),n=0,r=t[n];n+=1;let a=new DataView(t.buffer),o=a.getUint32(n,r===1);n+=4;let i;if(o&536870912&&(i=a.getUint32(n,r===1),n+=4),(o&65535)===1){let A=OG(t,n);n+=8;let s=OG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var pS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new gS(t,this.config)}},gS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return lS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},mS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new fS(t,this.config)}},fS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=lS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function qG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new pS(n):new mS(n)}var bS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new hS(t,this.config)}},hS=class extends W{static[D]="PgReal";constructor(t,n){super(t,n)}getSQLType(){return"real"}mapFromDriverValue=t=>typeof t=="string"?Number.parseFloat(t):t};function zG(e){return new bS(e??"")}var BS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new yS(t,this.config)}},yS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function KG(e){return new BS(e??"")}var CS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new wS(t,this.config)}},wS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function YG(e){return new CS(e??"")}var ES=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new kS(t,this.config)}},kS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function JG(e){return new ES(e??"")}var QS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new IS(t,this.config)}},IS=class extends W{static[D]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}};function Ei(e,t={}){let{name:n,config:r}=We(e,t);return new QS(n,r)}var vS=class extends fA{constructor(t,n,r){super(t,"string","PgTime"),this.withTimezone=n,this.precision=r,this.config.withTimezone=n,this.config.precision=r}static[D]="PgTimeBuilder";build(t){return new _S(t,this.config)}},_S=class extends W{static[D]="PgTime";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function WG(e,t={}){let{name:n,config:r}=We(e,t);return new vS(n,r.withTimezone??!1,r.precision)}var xS=class extends fA{static[D]="PgTimestampBuilder";constructor(t,n,r){super(t,"date","PgTimestamp"),this.config.withTimezone=n,this.config.precision=r}build(t){return new DS(t,this.config)}},DS=class extends W{static[D]="PgTimestamp";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){return typeof t=="string"?new Date(this.withTimezone?t:t+"+0000"):t}mapToDriverValue=t=>t.toISOString()},FS=class extends fA{static[D]="PgTimestampStringBuilder";constructor(t,n,r){super(t,"string","PgTimestampString"),this.config.withTimezone=n,this.config.precision=r}build(t){return new SS(t,this.config)}},SS=class extends W{static[D]="PgTimestampString";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){if(typeof t=="string")return t;let n=t.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=t.getTimezoneOffset(),a=r<=0?"+":"-";return`${n}${a}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return n}};function nE(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new FS(n,r.withTimezone??!1,r.precision):new xS(n,r?.withTimezone??!1,r?.precision)}var LS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Mp`gen_random_uuid()`)}build(t){return new NS(t,this.config)}},NS=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function ZG(e){return new LS(e??"")}var RS=class extends ee{static[D]="PgVarcharBuilder";constructor(t,n){super(t,"string","PgVarchar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new $S(t,this.config)}},$S=class extends W{static[D]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function VG(e,t={}){let{name:n,config:r}=We(e,t);return new RS(n,r)}var MS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new jS(t,this.config)}},jS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function XG(e,t){let{name:n,config:r}=We(e,t);return new MS(n,r)}var PS=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new TS(t,this.config)}},TS=class extends W{static[D]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function e5(e,t){let{name:n,config:r}=We(e,t);return new PS(n,r)}var HS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new GS(t,this.config)}},GS=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function t5(e,t){let{name:n,config:r}=We(e,t);return new HS(n,r)}var US=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new OS(t,this.config)}},OS=class extends W{static[D]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function n5(e,t){let{name:n,config:r}=We(e,t);return new US(n,r)}function a5(){return{bigint:vG,bigserial:_G,boolean:xG,char:DG,cidr:FG,customType:SG,date:LG,doublePrecision:NG,inet:RG,integer:$G,interval:MG,json:jG,jsonb:tE,line:PG,macaddr:TG,macaddr8:HG,numeric:GG,point:UG,geometry:qG,real:zG,serial:KG,smallint:YG,smallserial:JG,text:Ei,time:WG,timestamp:nE,uuid:ZG,varchar:VG,bit:XG,halfvec:e5,sparsevec:t5,vector:n5}}var qS=Symbol.for("drizzle:PgInlineForeignKeys"),r5=Symbol.for("drizzle:EnableRLS"),Jf=class extends _n{static[D]="PgTable";static Symbol=Object.assign({},_n.Symbol,{InlineForeignKeys:qS,EnableRLS:r5});[qS]=[];[r5]=!1;[_n.Symbol.ExtraConfigBuilder]=void 0;[_n.Symbol.ExtraConfigColumns]={}};function Cge(e,t,n,r,a=e){let o=new Jf(e,r,a),i=typeof t=="function"?t(a5()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.build(o);return o[qS].push(...g.buildForeignKeys(p,o)),[d,p]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.buildExtraConfigColumn(o);return[d,p]})),u=Object.assign(o,A);return u[_n.Symbol.Columns]=A,u[_n.Symbol.ExtraConfigColumns]=s,n&&(u[Jf.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Jf.Symbol.EnableRLS]=!0,u)})}var o5=(e,t,n)=>Cge(e,t,n,void 0);var aE=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new Wf(t.map(n=>{if(On(n,xn))return n;n=n;let r=new Np(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,!1,this.name)}onOnly(...t){return new Wf(t.map(n=>{if(On(n,xn))return n;n=n;let r=new Np(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new Wf(n.map(r=>{if(On(r,xn))return r;r=r;let a=new Np(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},Wf=class{static[D]="PgIndexBuilder";config;constructor(t,n,r,a,o="btree"){this.config={name:a,columns:t,unique:n,only:r,method:o}}concurrently(){return this.config.concurrently=!0,this}with(t){return this.config.with=t,this}where(t){return this.config.where=t,this}build(t){return new zS(this.config,t)}},zS=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function i5(e){return new aE(!1,e)}function A5(e){return new aE(!0,e)}var s5=e=>nE(e,{withTimezone:!0}),c5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),RRe=o5("junior_destinations",{id:Ei("id").primaryKey(),provider:Ei("provider").notNull(),providerTenantId:Ei("provider_tenant_id").notNull().default(""),providerDestinationId:Ei("provider_destination_id").notNull(),kind:Ei("kind").$type().notNull(),parentDestinationId:Ei("parent_destination_id"),displayName:Ei("display_name"),visibility:Ei("visibility").$type().notNull().default("unknown"),metadata:tE("metadata_json"),createdAt:s5("created_at").notNull(),updatedAt:s5("updated_at").notNull()},e=>[A5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),i5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var wge=c.object({error:c.string().min(1)}).strict(),d5=36e5,GRe=6*d5,URe=24*d5;var WS=c.object({closed:c.number().int().nonnegative(),costUsd:c.number().nonnegative().optional(),created:c.number().int().nonnegative(),medianCostUsd:c.number().nonnegative().optional(),medianMergeTimeMs:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),open:c.number().int().nonnegative()}).strict(),Ege=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),ad=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:Ege,merged:c.number().int().nonnegative()}).strict(),l5=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),id:c.string().uuid(),medianCostUsd:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),name:c.string().min(1),open:c.number().int().nonnegative(),provider:c.string().min(1),url:c.string().url().optional()}).strict(),p5=c.object({closedAt:c.string().optional(),id:c.string().uuid(),mergedAt:c.string().optional(),number:c.number().int().positive(),openedAt:c.string(),provider:c.string().min(1),repository:c.string().min(1),state:Of,title:c.string().optional(),url:c.string().url().optional()}).strict(),ZS=c.object({activityDays:c.array(ad),activityHours:c.array(ad).optional(),activitySixHours:c.array(ad).optional(),changes:c.array(p5),generatedAt:c.string(),repositories:c.array(l5),summary:WS,windowEnd:c.string(),windowStart:c.string()}).strict(),VS=c.object({activityDays:c.array(ad),activityHours:c.array(ad).optional(),activitySixHours:c.array(ad).optional(),generatedAt:c.string(),summary:WS,windowEnd:c.string(),windowStart:c.string()}).strict(),oE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var kge=c.object({locationId:c.string().min(1)}).strict(),g5=td.extend({id:c.string(),firstSeenAt:c.string(),kind:c5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),Qge=td.extend({actor:ed}).strict(),Ige=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),iE=c.object({date:Ige,privateConversations:c.number(),publicConversations:c.number()}).strict(),XS=c.object({activityDays:c.array(iE),activityHours:c.array(iE).optional(),activitySixHours:c.array(iE).optional(),generatedAt:c.string(),locations:c.array(g5),privateActivity:td,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),e4=g5.extend({activityDays:c.array(oE),activityHours:c.array(oE).optional(),activitySixHours:c.array(oE).optional(),actors:c.array(Qge),generatedAt:c.string(),recentConversations:c.array(Lp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),vge=c.object({email:c.string().trim().min(1)}).strict(),u5=td.omit({costUsd:!0}),m5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),KS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:m5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),YS=c.object({activePeople:c.number(),conversations:c.number(),date:m5}).strict(),f5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),rE=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),_ge=c.object({1:rE,7:rE,30:rE,90:rE}).strict(),b5=ed.extend({email:c.string().min(1)}).strict(),xge=f5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:b5,windows:_ge}).strict(),t4=c.object({activityDays:c.array(YS),activityHours:c.array(YS).optional(),activitySixHours:c.array(YS).optional(),generatedAt:c.string(),people:c.array(xge),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),n4=c.object({activityDays:c.array(KS),activityHours:c.array(KS).optional(),activitySixHours:c.array(KS).optional(),generatedAt:c.string(),locations:c.array(u5),recentConversations:c.array(Lp),actor:b5,source:c.literal("conversation_index"),surfaces:c.array(u5),totals:f5,windowEnd:c.string(),windowStart:c.string()}).strict(),a4=c.object({generatedAt:c.string(),sevenDaysUsd:c.number().finite().nonnegative(),source:c.literal("conversation_index"),thirtyDaysUsd:c.number().finite().nonnegative(),windowEnd:c.string(),windowStart:c.string()}).strict(),r4=c.object({id:c.string().uuid(),name:c.string(),tokenSuffix:c.string(),createdAt:c.string().datetime(),expiresAt:c.string().datetime(),lastUsedAt:c.string().datetime().nullable()}).strict(),o4=c.object({tokens:c.array(r4)}).strict(),Dge=c.object({name:c.string().trim().min(1).max(80)}).strict(),i4=r4.extend({token:c.string().startsWith("jr_pat_")}).strict(),Fge=c.object({id:c.string().uuid()}).strict(),Sge=c.object({revoked:c.literal(!0)}).strict(),Lge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),h5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),B5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:Lge,id:c.string().min(1),instruction:c.string().min(1),lastConversationId:c.string().min(1).optional(),lastRunAt:c.string().datetime().optional(),ownedByViewer:c.boolean(),runs:h5,outcomes:c.array(MH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),y5=B5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),C5=B5.extend({events:c.array(c.string().min(1)).min(1),kind:c.literal("event"),resource:c.string().min(1),source:c.string().min(1),triggerAvailable:c.boolean()}).strict(),A4=c.discriminatedUnion("kind",[y5,C5]),w5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),JS=c.object({costUsd:c.number().finite().nonnegative(),date:w5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),Nge=c.object({q:c.string().trim().max(200).optional()}).strict(),s4=c.object({executionDays:c.array(JS),executionHours:c.array(JS).optional(),executionSixHours:c.array(JS).optional(),automations:c.array(A4),truncated:c.boolean()}).strict(),Rge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),E5=c.enum(["blocked","completed","failed"]),c4=c.object({conversationId:c.string().min(1).optional(),costUsd:c.number().finite().nonnegative().optional(),durationMs:c.number().finite().nonnegative().optional(),executedAt:c.string().datetime(),executionId:c.string().min(1),status:E5,title:c.string().min(1).optional(),totalTokens:c.number().int().nonnegative().optional()}).strict(),AE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:w5,failed:c.number().int().nonnegative()}).strict(),u4=c.object({executionDays:c.array(AE),executionHours:c.array(AE).optional(),executionSixHours:c.array(AE).optional(),executions:c.array(c4),automation:A4,truncated:c.boolean()}).strict(),k5=c4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),d4=c.object({runs:c.array(k5),truncated:c.boolean()}).strict(),$ge=c.object({provider:c.string(),repo:c.string()}).strict(),Q5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),Mge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),I5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),jp=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(Q5),snapshot:Mge.nullable()}).strict(),l4=c.object({baselineSnapshot:I5.nullable(),workspaces:c.array(jp)}).strict(),jge=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array($ge)}).strict(),Pge=c.object({id:c.string().uuid()}).strict(),Tge=c.object({deleted:c.literal(!0)}).strict(),v5=c.object({count:c.number().int().nonnegative(),date:c.string(),metric:c.string().min(1),name:c.string().min(1),namespace:c.string().min(1)}).strict(),p4=c.object({generatedAt:c.string().datetime(),stats:c.array(v5),windowEnd:c.string(),windowStart:c.string()}).strict();function Hge(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var Gge=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Hge,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),WRe=c.discriminatedUnion("kind",[Gge]),Uge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),ZRe=c.object({icon:Uge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Oge=c.enum(["closed","merged","open"]),XRe=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Oge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),t$e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),qge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),zge=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),n$e=c.object({details:c.array(zge).max(100).optional(),icon:qge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var cE=c.string().regex(/^T[A-Z0-9]+$/),m4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),x5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Kge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),sE=Kge,Be=c.string().refine(e=>e.trim().length>0),Za=Be.refine(e=>e===e.trim()),Yge=c.object({id:Be,provider:Za}).strict(),Jge=Yge.extend({provider:c.literal("slack"),teamId:cE,channelId:m4,threadTs:Za.optional()}).strict(),r$e=c.discriminatedUnion("provider",[Jge]),o$e=c.enum(["slack","local"]),D5=c.enum(["public","private"]),Wge=c.enum(["public","private"]),Zge=c.object({platform:c.literal("slack"),teamId:cE,channelId:m4,threadTs:Za.optional()}).strict(),f4=Zge,Vge=c.object({platform:c.literal("local"),conversationId:x5}).strict(),Xge=c.discriminatedUnion("platform",[f4,Vge]),i$e=c.object({action:c.literal("send_message"),destination:f4}).strict(),eme=c.object({kind:c.literal("slack"),teamId:cE,channelId:m4,visibility:D5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),tme=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:x5}).strict(),nme=c.object({kind:c.literal("web"),visibility:D5,conversationId:Za}).strict(),ame=c.object({kind:c.literal("event"),eventKey:Za,eventType:Za,identifier:Za,namespace:Za}).strict(),rme=c.object({kind:c.literal("scheduled_automation")}).strict(),ome=c.object({kind:c.literal("event_automation")}).strict(),ime=c.object({kind:c.literal("plugin_dispatch")}).strict(),Ame=c.object({kind:c.literal("agent_invocation")}).strict(),sme=c.discriminatedUnion("kind",[eme,tme,nme,ame,rme,ome,ime,Ame]);function cme(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var ume=c.preprocess(cme,sme),dme=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:sE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:sE,allowedWhen:c.literal("scheduled-automation"),taskId:Za}).strict()]),b4={email:Be.optional(),fullName:Be.optional(),userId:sE,userName:Be.optional()},lme=c.object({...b4,platform:c.literal("slack"),teamId:cE}).strict(),pme=c.object({...b4,platform:c.literal("local")}).strict(),gme=c.object({...b4,platform:c.literal("web")}).strict(),mme=c.object({platform:c.literal("system"),name:sE}).strict(),g4=c.discriminatedUnion("platform",[lme,pme,gme,mme]),fme=c.object({displayName:Be.optional(),handle:Be.optional(),id:Za,provider:Za,providerSubjectId:Za,providerTenantId:Za.optional()}).strict(),A$e=c.object({displayName:Be.optional(),email:Be.max(320),id:Za,identities:c.array(fme).max(100)}).strict(),bme=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),hme=c.object({label:Za.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Za.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),s$e=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:dme.optional(),destination:f4,destinationVisibility:Wge,input:Be.pipe(c.string().max(32e3)),metadata:bme.optional(),replyAttribution:hme.optional()}).strict();var Bme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),u$e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),d$e=c.object({kind:Bme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var yme=4e3,Cme=8e3,Pp=32,_5=4e3,wme=1e3,Eme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event data may include at most ${Pp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>_5&&t.addIssue({code:"custom",message:`Event data may be at most ${_5} JSON bytes.`})}),rd=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),F5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),S5=/^[a-z][a-zA-Z0-9]*$/,kme=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),Qme=c.record(c.string().regex(S5),kme).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Pp} keys.`})}),p$e=c.record(c.string().regex(S5),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event match may include at most ${Pp} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var Ime=c.object({type:F5,supportedEvents:c.array(rd).min(1),suggestedEvents:c.array(rd).optional(),matchFields:Qme.optional(),guidance:c.record(rd,c.string().trim().min(1).max(wme)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),g$e=c.object({resourceTypes:c.array(Ime).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var m$e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(rd).optional(),supportedEvents:c.array(rd),type:F5}).strict(),f$e=c.object({events:c.array(rd).min(1),id:c.string().min(1)}).strict(),vme=c.object({eventKey:c.string().min(1),eventType:rd,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,yme)),data:Eme.optional(),untrustedText:c.string().transform(e=>e.slice(0,Cme)).optional()}).strict(),b$e=vme.extend({namespace:c.string().min(1)}),_me=c.object({authority:c.enum(["instruction","context"]),actor:g4.optional()}).strict(),xme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:_me.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),B$e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Xge,locationId:c.string().min(1).optional(),actors:c.array(g4),actor:g4.optional(),runId:c.string().min(1),source:ume,transcript:c.array(xme)}).strict();var C$e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),Dme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),w$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:Dme.optional()}).passthrough(),E$e=c.enum(["auto","review","approve"]);var Q$e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:Be}).strict(),Fme=c.string().regex(/^[a-z][a-z0-9-]*$/),Sme=c.string().regex(/^[a-z][a-z0-9.-]*$/),Lme=c.union([c.literal("read"),c.literal("write")]),L5=c.object({provider:Fme,scope:Be.optional(),type:c.literal("oauth")}).strict(),N5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),v$e=c.object({account:N5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),_$e=c.object({access:Lme,leaseScope:Be.optional(),name:Sme,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),Nme=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Rme=c.object({account:N5.optional(),authorization:L5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Nme).min(1)}).strict(),x$e=c.discriminatedUnion("type",[c.object({lease:Rme,type:c.literal("lease")}).strict(),c.object({authorization:L5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var $me=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),Mme=Be.max(80),jme=Be.max(500),Pme=c.enum(["primary","profile"]),Tme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Hme=c.object({label:Be.max(80),value:Be.max(500)}).strict(),Gme=c.object({confirmation:Be.max(500).optional(),href:Be.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:Be.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),Ume=c.object({actions:c.array(Gme).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Hme).max(8).optional(),title:Be.max(4e3)}).strict(),R5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Tme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(Ume).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),Ome=c.object({description:jme,id:$me,label:Mme,navigation:Pme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),$5=c.array(Ome),qme=Be.max(1e3).optional(),zme=Be.max(64).optional(),Kme=c.string().trim().max(200).optional(),F$e=c.object({cursor:qme,filter:zme,limit:c.number().int().min(1).max(50),query:Kme}).strict();var uE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),N$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),M5=c.object({allowedEmailCount:c.number(),allowedGoogleDomainCount:c.number(),authRequired:c.boolean(),authPath:c.string(),basePath:c.string(),componentGallery:c.boolean(),sentryConversationLinks:c.boolean(),timeZone:c.string().optional(),version:c.string().min(1)}).strict();var Zf=C(q(),1);var j5="x-junior-version";var h4="junior:dashboard-version";function P5(e){let t=e.headers.get(j5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(h4,{detail:t}))}function T5(e){let[t,n]=(0,Zf.useState)(e);return(0,Zf.useEffect)(()=>{e&&n(e)},[e]),(0,Zf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(h4,r),()=>window.removeEventListener(h4,r)},[]),t}var ys=class extends Error{status;apiError;constructor(t,n,r){super(`${t} returned ${n}`),this.status=n,r?.trim()&&(this.apiError=r.trim())}};async function od(e,t){let n;try{let r=await t.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ys(e,t.status,n)}function Tp(){if(typeof window>"u")return;let e=window.__JUNIOR_DASHBOARD_BASE_PATH__??"/",t=e==="/"?"/auth/login":`${e}/auth/login`;if(window.location.pathname!==t){let n=`${window.location.pathname}${window.location.search||""}`,r=new URLSearchParams;n!=="/"&&r.set("next",n);let a=r.toString();window.location.assign(a?`${t}?${a}`:t)}}async function dE(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function id(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function H5(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function Sc(e){let t=await Hp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&Tp(),t.ok||await od(e,t)}async function G5(e,t,n={}){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function Hp(e,t){let n=await fetch(e,t);return P5(n),n}async function je(e,t,n){let r=await Hp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(Tp(),await od(t,r)),r.ok||await od(t,r),e.parse(await r.json())}var lE=5*6e4,B4=5*6e4,Yme=1e3;function Jme(e,t=Date.now()){if(!e)return B4;let n=Date.parse(e);if(!Number.isFinite(n))return B4;let r=Math.max(0,t-n);return Math.max(Yme,B4-r)}function U5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(uE,"/api/me",e),je(M5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:lE})}function Wme(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(W8,"/api/plugins",e),retry:!1,staleTime:lE})}function O5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je($5,"/api/user-pages",e),retry:!1,staleTime:lE})}function pE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(Y8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:Wh,retry:!1})}function q5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(ZS,"/api/code",e),retry:!1})}function z5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(s4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:Wh,retry:!1})}function K5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(d4,"/api/automations/runs",t),retry:!1})}function Y5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(u4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function J5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(t4,"/api/people",e),retry:!1})}function W5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(n4,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function Z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(Ww,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function V5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(VS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function X5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(a4,"/api/people/me/spend",t),refetchInterval:t=>Jme(t.state.data?.generatedAt),retry:!1,staleTime:0})}function eU(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(XS,"/api/locations",e),retry:!1})}function tU(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(e4,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function Zme(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(V8,"/api/skills",e),retry:!1,staleTime:lE})}function Vme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(Ww,"/api/plugin-reports",e),retry:!1})}function nU(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(p4,"/api/stats",e),retry:!1})}function aU(e){let t=Wme(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(J8,"/api/conversations/stats",i),retry:!1}),r=Zme(),a=Vme();return{data:t.data&&r.data?{...e,conversationStatsError:!!n.error,...n.data?{conversationStats:n.data}:void 0,conversationStatsLoading:n.isPending,pluginReportsError:!!a.error,...a.data?{pluginReports:a.data}:void 0,pluginReportsLoading:a.isPending,plugins:t.data,skills:r.data}:void 0,error:t.error??r.error,isPending:t.isPending||r.isPending}}var rU=C(q(),1);function gE(){return(0,rU.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var iU=C(w(),1);function oU(){return gE()?null:(0,iU.jsx)("div",{"aria-live":"polite",className:"border-t border-amber-300/15 bg-amber-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-amber-100/80",role:"status",children:"You\u2019re offline. Drafts stay on this device."})}var y4=C(w(),1);function mE(){return(0,y4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,y4.jsx)("img",{alt:"",className:"relative size-11 max-w-none -translate-y-0.5 object-contain opacity-90 drop-shadow-[0_0_7px_rgba(255,255,255,0.16)]",draggable:!1,src:"/_junior/dashboard/avatar.png"})})}var AU=["relative","overflow-hidden","bg-white/15","before:absolute","before:inset-0","before:content-['']","before:bg-[linear-gradient(90deg,#ff4d6d,#ffb703,#56f39a,#4cc9f0,#9b5de5,#ff4d6d)]","before:bg-[length:200%_100%]","before:animate-[junior-rainbow-flow_1.2s_linear_infinite]","motion-reduce:before:animate-none"].join(" ");function k(...e){return e.filter(Boolean).join(" ")}var yn="mx-auto w-full min-w-0 max-w-screen-xl",bA="text-dashboard-text-muted hover:text-dashboard-text",sU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",cU="dashboard-shell-bg";var Lc=C(w(),1);function qn(e){return(0,Lc.jsx)("div",{className:k(yn,"grid min-h-[calc(100dvh-5rem)] place-items-center px-4 py-8 md:px-8"),children:(0,Lc.jsxs)("section",{className:"grid w-full max-w-lg grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-lg border border-dashboard-border-emphasis bg-dashboard-surface-raised p-4",children:[(0,Lc.jsx)(mE,{}),(0,Lc.jsxs)("div",{children:[(0,Lc.jsx)("div",{className:"font-bold",children:e.label}),(0,Lc.jsx)("div",{"aria-label":e.label,className:`${AU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var C4="0.220.0",fE=typeof C4=="string"&&C4.trim()?C4:"unknown";var Vf=C(w(),1);function uU(e){return Xme(e.serverVersion)?(0,Vf.jsxs)("div",{"aria-live":"polite",className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-t border-cyan-300/15 bg-cyan-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-cyan-100/80",role:"status",children:[(0,Vf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Vf.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0 font-mono font-semibold text-cyan-100 underline decoration-cyan-300/40 underline-offset-2 hover:text-dashboard-text-solid",onClick:()=>window.location.reload(),type:"button",children:"Refresh"})]}):null}function Xme(e){return!!e&&fE!=="unknown"&&e!=="unknown"&&e!==fE}var dU=C(w(),1);function T(e){let t=e.as??"div",n={none:"",sm:"p-4",md:"p-5 sm:p-6"}[e.padding??"none"],r=e.variant==="section"?"mb-4 border-dashboard-border-subtle bg-dashboard-fill-faint shadow-[0_24px_80px_rgba(0,0,0,0.18)]":e.variant==="raised"?"border-dashboard-border-emphasis bg-dashboard-surface-raised":"border-dashboard-border-subtle bg-dashboard-fill-faint";return(0,dU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var lU=C(w(),1);function De(e){let t=e.as??"div";return(0,lU.jsx)(t,{"aria-hidden":"true",className:k("animate-pulse rounded bg-dashboard-fill-soft motion-reduce:animate-none",e.className)})}var Fe=C(w(),1);function Na(e){let t=e.variant??"panel";return(0,Fe.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:k("grid gap-4",e.className),role:"status",children:[(0,Fe.jsx)("span",{className:"sr-only",children:e.label}),efe(t)]})}function efe(e){switch(e){case"stats":return(0,Fe.jsx)(tfe,{});case"overview":return(0,Fe.jsx)(nfe,{});case"list":return(0,Fe.jsx)(afe,{});case"library":return(0,Fe.jsx)(rfe,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function tfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4},(e,t)=>(0,Fe.jsx)(hA,{className:"min-h-[7.5rem] p-4 sm:min-h-32 sm:p-5"},t))}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]})}function nfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-[17rem]"}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]}),(0,Fe.jsx)(Gp,{className:"h-24 border-y border-dashboard-border-subtle bg-dashboard-fill-faint"}),(0,Fe.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-56"}),(0,Fe.jsx)(hA,{className:"min-h-56"})]})]})}function afe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Gp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function rfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,Fe.jsx)(Gp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Gp,{className:"h-10 w-full max-w-md rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint sm:w-72"})]}),(0,Fe.jsx)("div",{"aria-hidden":"true",className:"grid min-w-0 grid-cols-3 gap-1 border-b border-dashboard-border-subtle sm:flex",children:Array.from({length:3},(e,t)=>(0,Fe.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:justify-start",children:[(0,Fe.jsx)(Gp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Gp,{className:"h-5 w-8 rounded-sm border border-dashboard-border-subtle bg-dashboard-fill-faint"})]},t))}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function hA(e){return(0,Fe.jsx)(T,{className:k("animate-pulse motion-reduce:animate-none",e.className),children:(0,Fe.jsx)("span",{"aria-hidden":"true"})})}function Gp(e){return(0,Fe.jsx)(De,{className:e.className})}var bE=C(w(),1),pU="inline-flex h-9 max-w-full items-center gap-2 rounded border border-dashboard-border-emphasis bg-dashboard-surface-raised px-3 font-mono text-sm font-semibold leading-none text-dashboard-text transition-colors hover:border-dashboard-border-heavy hover:bg-dashboard-surface-hover hover:text-dashboard-text",ofe="inline-flex h-9 max-w-full items-center justify-center gap-1.5 rounded border border-dashboard-border-strong bg-transparent px-3 font-mono text-xs font-semibold text-dashboard-text-muted transition-colors hover:border-rose-300/40 hover:text-rose-300";function Ze({className:e,size:t="default",tone:n="default",type:r="button",...a}){let o=n==="danger";return(0,bE.jsx)("button",{...a,className:k("font-mono transition-colors disabled:cursor-not-allowed disabled:opacity-50",t==="icon"?k("grid size-9 place-items-center rounded-md border-0 bg-transparent p-0 focus-visible:outline focus-visible:outline-1 disabled:hover:!bg-transparent",o?"text-dashboard-text-muted hover:!bg-rose-300/10 hover:!text-rose-300 focus-visible:outline-rose-300/55 disabled:hover:!text-dashboard-text-muted":"text-dashboard-text-muted hover:!bg-dashboard-fill-strong hover:!text-dashboard-text focus-visible:outline-cyan-300/55 disabled:hover:!text-dashboard-text-muted"):o?k(ofe,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(pU,"disabled:hover:border-dashboard-border-emphasis disabled:hover:bg-dashboard-surface-raised disabled:hover:text-dashboard-text"),a.disabled?"":"cursor-pointer",e),type:r})}function gU({className:e,...t}){return(0,bE.jsx)(pe,{...t,className:k(pU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,bE.jsx)("button",{...a,"aria-pressed":t,className:k(ife[r],t?Afe[r]:sfe[r],e),type:n})}var ife={pill:"cursor-pointer rounded border px-2 py-1 font-mono text-xs font-semibold uppercase leading-tight transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",segment:"h-7 min-w-10 cursor-pointer rounded border px-2 font-mono text-xs transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",text:"cursor-pointer border-0 bg-transparent px-1.5 py-1 font-mono uppercase tracking-normal underline-offset-4 transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55"},Afe={pill:"border-dashboard-border-heavy bg-dashboard-text-solid text-dashboard-text-inverse",segment:"border-amber-500/30 bg-amber-500/20 text-amber-400",text:"text-dashboard-text underline decoration-dashboard-text-solid"},sfe={pill:"border-dashboard-border-strong bg-dashboard-surface-raised text-dashboard-text-muted hover:border-dashboard-border-interactive hover:bg-dashboard-surface-hover hover:text-dashboard-text",segment:"border-dashboard-border-strong bg-dashboard-fill-faint text-dashboard-text-muted hover:bg-dashboard-fill-strong hover:text-dashboard-text",text:"text-dashboard-text-muted hover:text-dashboard-text"};var w4=C(w(),1),cfe=[1,7,30,90];function E4(e){return e===1?"24h":`${e}d`}function Up(e){return e===1?"last 24 hours":`last ${e} days`}function Cn(e){return e===1?"hour":e===7?"6hour":"day"}function mU(e){return e===1}function ufe(e){return e===7}function Va(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function hE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Xf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function Dn(e){return mU(e.range)&&e.hours?.length?e.hours.slice(-24):mU(e.range)?e.days.slice(-1):ufe(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?dfe({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function dfe(e){let t=new Map;for(let n of e.hours){let r=Date.parse(`${n.date}:00:00.000Z`);if(Number.isNaN(r))continue;let a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=a.toISOString().slice(0,13),A={...t.get(o)??e.empty(o),date:o};for(let[s,u]of Object.entries(n))if(s!=="date"&&typeof u=="number"){let d=A[s];A[s]=(typeof d=="number"?d:0)+u}t.set(o,A)}if(e.hours.length>=24){let n=e.hours[e.hours.length-1]?.date,r=n?Date.parse(`${n}:00:00.000Z`):Date.now(),a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=new Date(a.getTime()-9720*60*1e3),i=[];for(let A=new Date(o);A.getTime()<=a.getTime();A.setTime(A.getTime()+360*60*1e3)){let s=A.toISOString().slice(0,13);i.push(t.get(s)??e.empty(s))}return i}return[...t.values()].sort((n,r)=>n.date.localeCompare(r.date))}function BE(e){return(0,w4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??cfe).map(t=>(0,w4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:E4(t)},t))})}var Nc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Nc.jsx)(BE,{onChange:e.onRangeChange,...e.rangeOptions?{options:e.rangeOptions}:{},value:e.range}):void 0,n=e.actions??t;return(0,Nc.jsxs)("header",{className:"flex min-w-0 items-center justify-between gap-6 border-b border-white/[0.05] pb-4 sm:pb-6 max-md:flex-col max-md:items-stretch",children:[(0,Nc.jsxs)("div",{className:"min-w-0",children:[(0,Nc.jsx)("h2",{className:"m-0 font-display text-3xl font-light leading-none tracking-[-0.03em] text-dashboard-text sm:text-4xl",children:e.title}),(0,Nc.jsx)("div",{className:"mt-2 max-w-2xl font-mono text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",children:e.description})]}),n?(0,Nc.jsx)("div",{className:"shrink-0",children:n}):null]})}var fU=C(w(),1);function Oo(e){return(0,fU.jsx)("div",{className:k(yn,"grid min-w-0 content-start gap-4 px-4 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:gap-6 sm:px-8 sm:py-8 sm:pb-8",e.className),children:e.children})}var eb=C(w(),1);function Ad(e){return(0,eb.jsxs)(Oo,{children:[(0,eb.jsx)(He,{description:e.description,title:e.title}),(0,eb.jsx)(Na,{label:e.label,variant:e.variant})]})}var wE=C(q(),1);var yE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var bU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var hU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var k4=e=>{let t=hU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var tb=C(q(),1);var CE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var BU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Op=C(q(),1);var lfe=(0,Op.createContext)({});var yU=()=>(0,Op.useContext)(lfe);var CU=(0,tb.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...A},s)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:l=!1,color:g="currentColor",className:p=""}=yU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,tb.createElement)("svg",{ref:s,...CE,width:t??u??CE.width,height:t??u??CE.height,stroke:e??g,strokeWidth:m,className:yE("lucide",p,a),...!o&&!BU(A)&&{"aria-hidden":"true"},...A},[...i.map(([b,B])=>(0,tb.createElement)(b,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,wE.forwardRef)(({className:r,...a},o)=>(0,wE.createElement)(CU,{ref:o,iconNode:t,className:yE(`lucide-${bU(k4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=k4(e),n};var pfe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],ki=F("activity",pfe);var gfe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],qo=F("archive-restore",gfe);var mfe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Cs=F("archive",mfe);var ffe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],nb=F("arrow-down-to-line",ffe);var bfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",bfe);var hfe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ab=F("arrow-right",hfe);var Bfe=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],rb=F("bookmark",Bfe);var yfe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],yA=F("bot",yfe);var Cfe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],ho=F("boxes",Cfe);var wfe=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],CA=F("braces",wfe);var Efe=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Rc=F("brain-circuit",Efe);var kfe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ws=F("brain",kfe);var Qfe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Es=F("calendar-clock",Qfe);var Ife=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ob=F("calendar",Ife);var vfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sd=F("check",vfe);var _fe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ib=F("chevron-down",_fe);var xfe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ab=F("chevron-left",xfe);var Dfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",Dfe);var Ffe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ra=F("circle-alert",Ffe);var Sfe=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],sb=F("circle-dashed",Sfe);var Lfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],cd=F("circle-dollar-sign",Lfe);var Nfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],cb=F("circle-dot",Nfe);var Rfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],$c=F("circle-x",Rfe);var $fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Qi=F("clock-3",$fe);var Mfe=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],Ii=F("coins",Mfe);var jfe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ud=F("copy",jfe);var Pfe=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Mc=F("database",Pfe);var Tfe=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mr=F("earth",Tfe);var Hfe=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],jc=F("ellipsis",Hfe);var Gfe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],dd=F("external-link",Gfe);var Ufe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ub=F("file-text",Ufe);var Ofe=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Pc=F("fingerprint-pattern",Ofe);var qfe=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],db=F("folder-git-2",qfe);var zfe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],lb=F("gauge",zfe);var Kfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],pb=F("git-merge",Kfe);var Yfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ks=F("git-pull-request",Yfe);var Jfe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],gb=F("hash",Jfe);var Wfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tc=F("info",Wfe);var Zfe=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],vi=F("key-round",Zfe);var Vfe=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Hc=F("layers",Vfe);var Xfe=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],ld=F("library-big",Xfe);var ebe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],mb=F("lightbulb",ebe);var tbe=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],fb=F("list-checks",tbe);var nbe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],bb=F("link",nbe);var abe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",abe);var rbe=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],fr=F("lock-keyhole",rbe);var obe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],hb=F("lock",obe);var ibe=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Bb=F("log-out",ibe);var Abe=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],pd=F("map-pin",Abe);var sbe=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],yb=F("map-pinned",sbe);var cbe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],gd=F("menu",cbe);var ube=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],Cb=F("message-square-text",ube);var dbe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Bo=F("message-square",dbe);var lbe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],qp=F("messages-square",lbe);var pbe=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],wb=F("minimize-2",pbe);var gbe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Eb=F("paperclip",gbe);var mbe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],md=F("plus",mbe);var fbe=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],kb=F("radio-tower",fbe);var bbe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],zp=F("scroll-text",bbe);var hbe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gc=F("search",hbe);var Bbe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fd=F("send",Bbe);var ybe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qb=F("settings",ybe);var Cbe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Ib=F("sigma",Cbe);var wbe=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],vb=F("skip-forward",wbe);var Ebe=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Xa=F("sparkles",Ebe);var kbe=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qr=F("square-pen",kbe);var Qbe=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],_i=F("timer",Qbe);var Ibe=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ba=F("trash-2",Ibe);var vbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],_b=F("trending-up",vbe);var _be=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zr=F("triangle-alert",_be);var xbe=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],br=F("user-round",xbe);var Dbe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bd=F("users",Dbe);var Fbe=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],xb=F("webhook",Fbe);var Sbe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=F("x",Sbe);var Lbe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Db=F("zap",Lbe);var MA=C(q(),1);var Q4=Object.defineProperty,Nbe=Object.getOwnPropertyDescriptor,Rbe=Object.getOwnPropertyNames,$be=Object.prototype.hasOwnProperty,EU=(e,t)=>{let n={};for(var r in e)Q4(n,r,{get:e[r],enumerable:!0});return t||Q4(n,Symbol.toStringTag,{value:"Module"}),n},wU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Rbe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!$be.call(e,A)&&A!==n&&Q4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=Nbe(t,A))||r.enumerable});return e},kU=(e,t,n)=>(wU(e,t,"default"),n&&wU(n,t,"default"));var x4={};L(x4,{createOnigurumaEngine:()=>Xbe,getDefaultWasmLoader:()=>Vbe,loadWasm:()=>IU,setDefaultWasmLoader:()=>Zbe});var _4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Mbe(){return 2147483648}function jbe(){return typeof performance<"u"?performance.now():Date.now()}var Pbe=(e,t)=>e+(t-e%t)%t;async function Tbe(e){let t,n,r={};function a(p){n=p,r.HEAPU8=new Uint8Array(p),r.HEAPU32=new Uint32Array(p)}function o(p,m,b){r.HEAPU8.copyWithin(p,m,m+b)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(p){let m=r.HEAPU8.length;p=p>>>0;let b=Mbe();if(p>b)return!1;for(let B=1;B<=4;B*=2){let h=m*(1+.2/B);h=Math.min(h,p+100663296);let f=Math.min(b,Pbe(Math.max(p,h),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(p,m,b=1024){let B=m+b,h=m;for(;p[h]&&!(h>=B);)++h;if(h-m>16&&p.buffer&&s)return s.decode(p.subarray(m,h));let f="";for(;m<h;){let y=p[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=p[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let Q=p[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|Q:y=(y&7)<<18|E<<12|Q<<6|p[m++]&63,y<65536)f+=String.fromCharCode(y);else{let I=y-65536;f+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return f}function d(p,m){return p?u(r.HEAPU8,p,m):""}let l={emscripten_get_now:jbe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function g(){let m=await e({env:l,wasi_snapshot_preview1:l});t=m.memory,a(t.buffer),Object.assign(r,m),r.UTF8ToString=d}return await g(),r}var Hbe=Object.defineProperty,Gbe=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>Gbe(e,typeof t!="symbol"?t+"":t,n),ya=null;function Ube(e){throw new _4(e.UTF8ToString(e.getLastOnigError()))}var kE=class e{constructor(t){ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16Value"),ra(this,"utf8Value"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16");let n=t.length,r=e._utf8ByteLength(t),a=r!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=r);let i=a?new Uint32Array(r+1):null;a&&(i[r]=n);let A=new Uint8Array(r),s=0;for(let u=0;u<n;u++){let d=t.charCodeAt(u),l=d,g=!1;if(d>=55296&&d<=56319&&u+1<n){let p=t.charCodeAt(u+1);p>=56320&&p<=57343&&(l=(d-55296<<10)+65536|p-56320,g=!0)}a&&(o[u]=s,g&&(o[u+1]=s),l<=127?i[s+0]=u:l<=2047?(i[s+0]=u,i[s+1]=u):l<=65535?(i[s+0]=u,i[s+1]=u,i[s+2]=u):(i[s+0]=u,i[s+1]=u,i[s+2]=u,i[s+3]=u)),l<=127?A[s++]=l:l<=2047?(A[s++]=192|(l&1984)>>>6,A[s++]=128|(l&63)>>>0):l<=65535?(A[s++]=224|(l&61440)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0):(A[s++]=240|(l&1835008)>>>18,A[s++]=128|(l&258048)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0),g&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=A,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){let o=t.charCodeAt(r),i=o,A=!1;if(o>=55296&&o<=56319&&r+1<a){let s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(i=(o-55296<<10)+65536|s-56320,A=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,A&&r++}return n}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},QE=class wA{constructor(t){if(ra(this,"id",++wA.LAST_ID),ra(this,"_onigBinding"),ra(this,"content"),ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16"),ra(this,"ptr"),!ya)throw new _4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new kE(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!wA._sharedPtrInUse?(wA._sharedPtr||(wA._sharedPtr=ya.omalloc(1e4)),wA._sharedPtrInUse=!0,ya.HEAPU8.set(n.utf8Value,wA._sharedPtr),this.ptr=wA._sharedPtr):this.ptr=n.createString(ya)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wA._sharedPtr?wA._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ra(QE,"LAST_ID",0);ra(QE,"_sharedPtr",0);ra(QE,"_sharedPtrInUse",!1);var QU=QE,v4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new _4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new kE(t[A]);n[A]=u.createString(ya),r[A]=u.utf8Length}let a=ya.omalloc(4*t.length);ya.HEAPU32.set(n,a/4);let o=ya.omalloc(4*t.length);ya.HEAPU32.set(r,o/4);let i=ya.createOnigScanner(a,o,t.length);for(let A=0,s=t.length;A<s;A++)ya.ofree(n[A]);ya.ofree(o),ya.ofree(a),i===0&&Ube(ya),this._onigBinding=ya,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new QU(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){let o=this._onigBinding,i=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(i===0)return null;let A=o.HEAPU32,s=i/4,u=A[s++],d=A[s++],l=[];for(let g=0;g<d;g++){let p=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[g]={start:p,end:m,length:m-p}}return{index:u,captureIndices:l}}};function Obe(e){return typeof e.instantiator=="function"}function qbe(e){return typeof e.default=="function"}function zbe(e){return typeof e.data<"u"}function Kbe(e){return typeof Response<"u"&&e instanceof Response}function Ybe(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}var EE;function IU(e){if(EE)return EE;async function t(){ya=await Tbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Obe(r)?r=await r.instantiator(n):qbe(r)?r=await r.default(n):(zbe(r)&&(r=r.data),Kbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Jbe(r)(n):r=await Wbe(r)(n):Ybe(r)?r=await I4(r)(n):r instanceof WebAssembly.Module?r=await I4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await I4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return EE=t(),EE}function I4(e){return t=>WebAssembly.instantiate(e,t)}function Jbe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Wbe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var vU;function Zbe(e){vU=e}function Vbe(){return vU}async function Xbe(e){return e&&await IU(e),{createScanner(t){return new v4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new QU(t)}}}var D4=EU({});kU(D4,x4);var Wq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(qq(),Oq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Kq(),zq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(Jq(),Yq)))}],Zq=Object.fromEntries(Wq.map(e=>[e.id,e.import]));var Et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function dBe(e){return T4(e)}function T4(e){return Array.isArray(e)?lBe(e):e instanceof RegExp?e:typeof e=="object"?pBe(e):e}function lBe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=T4(e[n]);return t}function pBe(e){let t={};for(let n in e)t[n]=T4(e[n]);return t}function iz(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Az(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Az(e.substring(0,e.length-1)):e.substr(~t+1)}var F4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,IE=class{static hasCaptures(e){return e===null?!1:(F4.lastIndex=0,F4.test(e))}static replaceCaptures(e,t,n){return e.replace(F4,(r,a,o,i)=>{let A=n[parseInt(a||o,10)];if(A){let s=t.substring(A.start,A.end);for(;s[0]===".";)s=s.substring(1);switch(i){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return r})}};function sz(e,t){return e<t?-1:e>t?1:0}function cz(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let o=sz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function Vq(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function uz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var dz=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Lb=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(fBe(e),t)}static createFromParsedTheme(e,t){return hBe(e,t)}_cachedMatchRoot=new dz(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>gBe(e.parent,a.parentScopes));return r?new lz(r.fontStyle,r.foreground,r.background):null}},S4=class vE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new vE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new vE(n,t[r]);return n}push(t){return new vE(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function gBe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!mBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function mBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function fBe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,o=t.length;a<o;a++){let i=t[a];if(!i.settings)continue;let A;if(typeof i.scope=="string"){let l=i.scope;l=l.replace(/^[,]+/,""),l=l.replace(/[,]+$/,""),A=l.split(",")}else Array.isArray(i.scope)?A=i.scope:A=[""];let s=-1;if(typeof i.settings.fontStyle=="string"){s=0;let l=i.settings.fontStyle.split(" ");for(let g=0,p=l.length;g<p;g++)switch(l[g]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof i.settings.foreground=="string"&&Vq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Vq(i.settings.background)&&(d=i.settings.background);for(let l=0,g=A.length;l<g;l++){let m=A[l].trim().split(" "),b=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new bBe(b,B,a,s,u,d)}}return n}var bBe=class{constructor(e,t,n,r,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=o}},$a=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($a||{});function hBe(e,t){e.sort((s,u)=>{let d=sz(s.scope,u.scope);return d!==0||(d=cz(s.parentScopes,u.parentScopes),d!==0)?d:s.index-u.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(r=s.foreground),s.background!==null&&(a=s.background)}let o=new BBe(t),i=new lz(n,o.getId(r),o.getId(a)),A=new CBe(new N4(0,null,-1,0,0),[]);for(let s=0,u=e.length;s<u;s++){let d=e[s];A.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new Lb(o,i,A)}var BBe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},yBe=Object.freeze([]),N4=class pz{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||yBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new pz(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},CBe=class R4{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[r].length;if(o!==0)return o;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,o;if(r===-1?(a=t,o=""):(a=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(R4._cmpBySpecificity),n}insert(t,n,r,a,o,i){if(n===""){this._doInsertHere(t,r,a,o,i);return}let A=n.indexOf("."),s,u;A===-1?(s=n,u=""):(s=n.substring(0,A),u=n.substring(A+1));let d;this._children.hasOwnProperty(s)?d=this._children[s]:(d=new R4(this._mainRule.clone(),N4.cloneArr(this._rulesWithParentScopes)),this._children[s]=d),d.insert(t+1,u,r,a,o,i)}_doInsertHere(t,n,r,a,o){if(n===null){this._mainRule.acceptOverwrite(t,r,a,o);return}for(let i=0,A=this._rulesWithParentScopes.length;i<A;i++){let s=this._rulesWithParentScopes[i];if(cz(s.parentScopes,n)===0){s.acceptOverwrite(t,r,a,o);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new N4(t,n,r,a,o))}},Bd=class zo{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=zo.getLanguageId(t),r=zo.getTokenType(t),a=zo.getFontStyle(t),o=zo.getForeground(t),i=zo.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:o,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,a,o,i,A){let s=zo.getLanguageId(t),u=zo.getTokenType(t),d=zo.containsBalancedBrackets(t)?1:0,l=zo.getFontStyle(t),g=zo.getForeground(t),p=zo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(g=i),A!==0&&(p=A),(s<<0|u<<8|d<<10|l<<11|g<<15|p<<24)>>>0}};function xE(e,t){let n=[],r=wBe(e),a=r.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let u=i();if(n.push({matcher:u,priority:s}),a!==",")break;a=r.next()}return n;function o(){if(a==="-"){a=r.next();let s=o();return u=>!!s&&!s(u)}if(a==="("){a=r.next();let s=A();return a===")"&&(a=r.next()),s}if(Xq(a)){let s=[];do s.push(a),a=r.next();while(Xq(a));return u=>t(s,u)}return null}function i(){let s=[],u=o();for(;u;)s.push(u),u=o();return d=>s.every(l=>l(d))}function A(){let s=[],u=i();for(;u&&(s.push(u),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");u=i()}return d=>s.some(l=>l(d))}}function Xq(e){return!!e&&!!e.match(/[\w\.:]+/)}function wBe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function gz(e){typeof e.dispose=="function"&&e.dispose()}var Nb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},EBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},kBe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},QBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Nb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new kBe;for(let n of e)IBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Nb){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function IBe(e,t,n,r){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof Nb?_E({baseGrammar:o,selfGrammar:a},r):$4(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},r);let i=n.injections(e.scopeName);if(i)for(let A of i)r.add(new Nb(A))}function $4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];DE([r],t,n)}}function _E(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&DE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&DE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function DE(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?iz({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&DE(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=mz(o);switch(i.kind){case 0:_E({...t,selfGrammar:t.baseGrammar},n);break;case 1:_E(t,n);break;case 2:$4(i.ruleName,{...t,repository:a},n);break;case 3:case 4:let A=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(A){let s={baseGrammar:t.baseGrammar,selfGrammar:A,repository:a};i.kind===4?$4(i.ruleName,s,n):_E(s,n)}else i.kind===4?n.add(new EBe(i.scopeName,i.ruleName)):n.add(new Nb(i.scopeName));break}}}var vBe=class{kind=0},_Be=class{kind=1},xBe=class{constructor(e){this.ruleName=e}kind=2},DBe=class{constructor(e){this.scopeName=e}kind=3},FBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function mz(e){if(e==="$base")return new vBe;if(e==="$self")return new _Be;let t=e.indexOf("#");if(t===-1)return new DBe(e);if(t===0)return new xBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new FBe(n,r)}}var SBe=/\\(\d+)/,ez=/\\(\d+)/g;var LBe=-1,fz=-2;var Mb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=IE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=IE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Az(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:IE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:IE.replaceCaptures(this._contentName,e,t)}},NBe=class extends Mb{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},RBe=class extends Mb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Rb(r,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new $b,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tz=class extends Mb{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new $b,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},M4=class extends Mb{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,o,i,A,s,u){super(e,t,n,r),this._begin=new Rb(a,this.id),this.beginCaptures=o,this._end=new Rb(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=A,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new $b;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},FE=class extends Mb{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,o,i,A,s){super(e,t,n,r),this._begin=new Rb(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Rb(i,fz),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new $b;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new $b,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},bz=class tr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new NBe(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new RBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,tr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=iz({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new tz(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,tr._compilePatterns(o,n,r))}return t.while?new FE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,tr._compileCaptures(t.whileCaptures||t.captures,n,r),tr._compilePatterns(t.patterns,n,r)):new M4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,tr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,tr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let o=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10);A>o&&(o=A)}for(let i=0;i<=o;i++)a[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10),s=0;t[i].patterns&&(s=tr.getCompiledRuleId(t[i],n,r)),a[A]=tr.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,s)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let o=0,i=t.length;o<i;o++){let A=t[o],s=-1;if(A.include){let u=mz(A.include);switch(u.kind){case 0:case 1:s=tr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=tr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,g=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(l,r);if(p)if(g){let m=p.repository[g];m&&(s=tr.getCompiledRuleId(m,n,p.repository))}else s=tr.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=tr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof tz||u instanceof M4||u instanceof FE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Rb=class hz{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,a=0,o=[],i=!1;for(let A=0;A<r;A++)if(t.charAt(A)==="\\"&&A+1<r){let u=t.charAt(A+1);u==="z"?(o.push(t.substring(a,A)),o.push("$(?!\\n)(?<!\\n)"),a=A+2):(u==="A"||u==="G")&&(i=!0),A++}this.hasAnchor=i,a===0?this.source=t:(o.push(t.substring(a,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=SBe.test(this.source):this.hasBackReferences=!1}clone(){return new hz(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(a=>t.substring(a.start,a.end));return ez.lastIndex=0,this.source.replace(ez,(a,o)=>uz(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],a=[],o,i,A,s;for(o=0,i=this.source.length;o<i;o++)A=this.source.charAt(o),t[o]=A,n[o]=A,r[o]=A,a[o]=A,A==="\\"&&o+1<i&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",r[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",r[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,r[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},$b=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new nz(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(a=>a.resolveAnchors(t,n));return new nz(e,r,this._items.map(a=>a.ruleId))}},nz=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let A=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(A.cycle){o(i);continue}if(A.count>1&&e.reused==="ref"){o(i);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function XP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;XP(r);let a=Object.keys(r);if(a.length!==1||a[0]!=="type")return;let o=r.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var eT=new Set(["type","properties","required","additionalProperties"]),ZP=["oneOf","anyOf"];function VP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function j1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!eT.has(i))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let A=[];for(let u of t){let d=u.properties?.[i]??VP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:j1(A)??{allOf:A};sn(n,i,s)}for(let i of o.required??[])r.add(i)}let a={type:"object",properties:n};if(r.size&&(a.required=[...r]),t.every(o=>o.additionalProperties===!1))a.additionalProperties=!1;else{let o=[];for(let i of t){let A=VP(i);A&&!o.some(s=>JSON.stringify(s)===JSON.stringify(A))&&o.push(A)}o.length===1?a.additionalProperties=o[0]:o.length>1&&(a.additionalProperties={allOf:o})}return a}function gde(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of eT)if(a in e)return;let n=t.filter(a=>ZP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=j1(t);else{let a=n[0],o=ZP.find(s=>Array.isArray(a[s]));if(Object.keys(a).length!==1)return;let i=t.filter(s=>s!==a),A=a[o].map(s=>j1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,_f(e,r))}function vc(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=A=>{let s=e.seen.get(A);if(s.ref===null)return;let u=s.def??s.schema,d={...u},l=s.ref;if(s.ref=null,l){r(l);let p=e.seen.get(l),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):_f(u,m),_f(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&p.def)for(let B in u)B==="$ref"||B==="allOf"||B in p.def&&JSON.stringify(u[B])===JSON.stringify(p.def[B])&&delete u[B]}let g=A._zod.parent;if(g&&g!==l){r(g);let p=e.seen.get(g);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:A,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let A of[...e.seen.entries()].reverse())r(A[0]);if(e.target!=="openapi-3.0")for(let A of e.seen.entries())XP(A[1].def??A[1].schema);for(let A of e.deferred)A();if(e.intersections.length){let A=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let l=A.get(d);l?l.push(u):A.set(d,[u])}for(let s of e.intersections)for(let u of A.get(s)??[])gde(u)}}let a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let A=e.external.registry.get(t)?.id;if(!A)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(A)}_f(a,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let A of e.seen.entries()){let s=A[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,sn(i,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{let A=JSON.parse(JSON.stringify(a));return Object.defineProperty(A,"~standard",{value:{...t["~standard"],jsonSchema:{input:wp(t,"input",e.processors),output:wp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function gr(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return gr(r.element,n);if(r.type==="set")return gr(r.valueType,n);if(r.type==="lazy")return gr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return gr(r.innerType,n);if(r.type==="intersection")return gr(r.left,n)||gr(r.right,n);if(r.type==="record"||r.type==="map")return gr(r.keyType,n)||gr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gr(r.in,n)||gr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(gr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(gr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(gr(a,n))return!0;return!!(r.rest&&gr(r.rest,n))}return!1}var P1=(e,t={})=>n=>{let r=Qc({...n,processors:t});return ht(e,r),Ic(r,e),vc(r,e)},wp=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=Qc({...a??{},target:o,io:t,processors:n});return ht(e,i),Ic(i,e),vc(i,e)};var mde={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G1=(e,t,n,r)=>{let a=n;a.type="string";let{minimum:o,maximum:i,format:A,patterns:s,contentEncoding:u,laxFormat:d}=e._zod.bag;if(typeof o=="number"&&(a.minLength=o),typeof i=="number"&&(a.maxLength=i),A&&(a.format=mde[A]??A,a.format===""&&delete a.format,(A==="time"||d)&&delete a.format),u&&(a.contentEncoding=u),s&&s.size>0){let l=[...s];l.length===1?a.pattern=l[0].source:l.length>1&&(a.allOf=[...l.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},U1=(e,t,n,r)=>{let a=n,{minimum:o,maximum:i,format:A,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof A=="string"&&A.includes("int")?a.type="integer":a.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),g=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";l?p?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),g?p?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof i=="number"&&(a.maximum=i),typeof s=="number"&&(Number.isFinite(s)&&s!==0?a.multipleOf=Math.abs(s):ta(e,t,a,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},O1=(e,t,n,r)=>{n.type="boolean"},q1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},z1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},K1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Y1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},J1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},W1=(e,t,n,r)=>{n.not={}},Z1=(e,t,n,r)=>{},V1=(e,t,n,r)=>{},X1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},eF=(e,t,n,r)=>{let a=e._zod.def,o=ef(a.entries);if(o.length===0){n.not={};return}o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},tF=(e,t,n,r)=>{let a=e._zod.def;if(a.values.length===0){n.not={};return}let o=[];for(let i of a.values)if(i===void 0){if(ta(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ta(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),o.every(i=>typeof i=="boolean")&&(n.type="boolean"),o.every(i=>i===null)&&(n.type="null"),n.enum=o},nF=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},aF=(e,t,n,r)=>{let a=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=o.source},rF=(e,t,n,r)=>{let a=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:A,mime:s}=e._zod.bag;i!==void 0&&(o.minLength=i),A!==void 0&&(o.maxLength=A),s?s.length===1?(o.contentMediaType=s[0],Object.assign(a,o)):(Object.assign(a,o),a.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(a,o)},oF=(e,t,n,r)=>{n.type="boolean"},iF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},AF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},sF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},cF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},uF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},dF=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:i,maximum:A}=e._zod.bag;typeof i=="number"&&(a.minItems=i),typeof A=="number"&&(a.maxItems=A),a.type="array",a.items=ht(o.element,t,{...r,path:[...r.path,"items"]})};function xf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?xf(t.out):t.type==="catch"?xf(t.innerType):e._zod.optin}var lF=(e,t,n,r)=>{let a=n,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ta(e,t,a,r,"Symbol keys cannot be represented in JSON Schema"))return;a.type="object",a.properties={};for(let d in i)sn(a.properties,d,ht(i[d],t,{...r,path:[...r.path,"properties",d]}));let s=new Set(Object.keys(i)),u=new Set([...s].filter(d=>{let l=o.shape[d];return t.io==="input"?xf(l)===void 0:l._zod.optout===void 0}));u.size>0&&(a.required=Array.from(u)),o.catchall?._zod.def.type==="never"?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ht(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},gw=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,i=a.options.map((A,s)=>ht(A,t,{...r,path:[...r.path,o?"oneOf":"anyOf",s]}));o?n.oneOf=i:n.anyOf=i},pF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.left,t,{...r,path:[...r.path,"allOf",0]}),i=ht(a.right,t,{...r,path:[...r.path,"allOf",1]}),A=u=>"allOf"in u&&Object.keys(u).length===1,s=[...A(o)?o.allOf:[o],...A(i)?i.allOf:[i]];n.allOf=s,t.intersections.push(s)},gF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",A=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=o.items.map((b,B)=>ht(b,t,{...r,path:[...r.path,i,B]})),u=o.rest?ht(o.rest,t,{...r,path:[...r.path,A,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let b=o.items[d-1];if(!(t.io==="input"?xf(b)!==void 0:b._zod.optout==="optional"))break;d--}let l=o.items.length,g=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,g?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):(a.items=s,g?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),g&&(a.maxItems=l));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(a.minItems=p),typeof m=="number"&&(a.maxItems=m)};function T1(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let b=T1(e,m,n);return b===m?t:b}for(let m of["anyOf","oneOf"]){let b=t[m];if(!Array.isArray(b))continue;let B=b.map(h=>T1(e,h,n));B.some((h,f)=>h!==b[f])&&(t={...t,[m]:B})}let r=Array.isArray(t.type)?t.type:[t.type],a=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!a&&!o?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:A,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:d,format:l,id:g,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),a&&(p.type="string",o||(p.pattern=(r.includes("number")?wc:df).source)),p}var H1=new WeakMap;function fde(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of H1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=T1(t,o,new Set);i!==o&&n.set(o,i)}if(n.size)for(let r of e.seen.values())for(let a of[r.schema,r.def]){let o=a&&n.get(a.propertyNames);o&&(a.propertyNames=o)}}var mF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="object";let i=o.keyType,s=i._zod.bag?.patterns;if(o.mode==="loose"&&s&&s.size>0){let l=ht(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(let g of s)sn(a.patternProperties,g.source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){a.propertyNames=ht(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=H1.get(t);l||(l=[],H1.set(t,l),t.deferred.push(()=>fde(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&xf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(g=>typeof g=="string"||typeof g=="number");l.length>0&&(a.required=l.map(String))}},fF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},bF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},hF=Symbol();function tT(e,t,n,r,a){let o=!1,i=JSON.stringify(e,(A,s)=>typeof s!="bigint"?s:(o=!0,null));return o?(ta(t,n,r,a,"BigInt defaults cannot be represented in JSON Schema"),hF):JSON.parse(i)}var BF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i=tT(a.defaultValue,e,t,n,r);i!==hF&&(n.default=i)},yF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);if(o.ref=a.innerType,t.io!=="input")return;let i=tT(a.defaultValue,e,t,n,r);i!==hF&&(n._prefault=i)},CF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i;try{i=a.catchValue(void 0)}catch{ta(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},wF=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?a.out:a.in:a.out;ht(i,t,r);let A=t.seen.get(e);A.ref=i},EF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},kF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},mw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},QF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},pw={string:G1,number:U1,boolean:O1,bigint:q1,symbol:z1,null:K1,undefined:Y1,void:J1,never:W1,any:Z1,unknown:V1,date:X1,enum:eF,literal:tF,nan:nF,template_literal:aF,file:rF,success:oF,custom:iF,function:AF,transform:sF,map:cF,set:uF,array:dF,object:lF,union:gw,intersection:pF,tuple:gF,record:mF,nullable:fF,nonoptional:bF,default:BF,prefault:yF,catch:CF,pipe:wF,readonly:EF,promise:kF,optional:mw,lazy:QF};function fw(e,t){if("_idmap"in e){let r=e,a=Qc({...t,processors:pw}),o={};for(let s of r._idmap.entries()){let[u,d]=s;ht(d,a)}let i={},A={registry:r,uri:t?.uri,defs:o};a.external=A;for(let s of r._idmap.entries()){let[u,d]=s;Ic(a,d),sn(i,u,vc(a,d))}if(Object.keys(o).length>0){let s=a.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:o}}return{schemas:i}}let n=Qc({...t,processors:pw});return ht(e,n),Ic(n,e),vc(n,e)}var bw=class{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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Qc({processors:pw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ht(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Ic(this.ctx,t);let r=vc(this.ctx,t),{"~standard":a,...o}=r;return o}};var nT={};var Fp={};L(Fp,{ZodAny:()=>zF,ZodArray:()=>WF,ZodBase64:()=>$w,ZodBase64URL:()=>Mw,ZodBigInt:()=>xp,ZodBigIntFormat:()=>Tw,ZodBoolean:()=>_p,ZodCIDRv4:()=>Nw,ZodCIDRv6:()=>Rw,ZodCUID:()=>vw,ZodCUID2:()=>_w,ZodCatch:()=>b8,ZodCodec:()=>Pf,ZodCreditCard:()=>PF,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>Ip,ZodDate:()=>Lf,ZodDefault:()=>d8,ZodDiscriminatedUnion:()=>VF,ZodE164:()=>jw,ZodEmail:()=>Ew,ZodEmoji:()=>Qw,ZodEnum:()=>kp,ZodExactOptional:()=>Ow,ZodFile:()=>A8,ZodFunction:()=>v8,ZodGUID:()=>kw,ZodIPv4:()=>Sw,ZodIPv6:()=>Lw,ZodISODate:()=>xc,ZodISODateTime:()=>_c,ZodISODuration:()=>Fc,ZodISOTime:()=>Dc,ZodIntersection:()=>XF,ZodJWT:()=>Pw,ZodKSUID:()=>Fw,ZodLazy:()=>k8,ZodLiteral:()=>i8,ZodMAC:()=>jF,ZodMap:()=>r8,ZodNaN:()=>B8,ZodNanoID:()=>Iw,ZodNever:()=>YF,ZodNonOptional:()=>qw,ZodNull:()=>OF,ZodNullable:()=>u8,ZodNumber:()=>vp,ZodNumberFormat:()=>Vu,ZodObject:()=>Rf,ZodOptional:()=>Mf,ZodPipe:()=>jf,ZodPrefault:()=>p8,ZodPreprocess:()=>y8,ZodPromise:()=>I8,ZodReadonly:()=>C8,ZodRecord:()=>Ep,ZodSet:()=>o8,ZodString:()=>Qp,ZodStringFormat:()=>Dt,ZodSuccess:()=>f8,ZodSymbol:()=>GF,ZodTemplateLiteral:()=>E8,ZodTransform:()=>s8,ZodTuple:()=>t8,ZodType:()=>xe,ZodULID:()=>xw,ZodURL:()=>Sf,ZodUUID:()=>mA,ZodUndefined:()=>UF,ZodUnion:()=>$f,ZodUnknown:()=>KF,ZodVoid:()=>JF,ZodXID:()=>Dw,ZodXor:()=>ZF,_ZodString:()=>ww,_default:()=>l8,_function:()=>lH,any:()=>UT,array:()=>Nf,base64:()=>QT,base64url:()=>IT,bigint:()=>jT,boolean:()=>HF,catch:()=>h8,check:()=>pH,cidrv4:()=>ET,cidrv6:()=>kT,codec:()=>sH,creditCard:()=>_T,cuid:()=>mT,cuid2:()=>fT,custom:()=>gH,date:()=>qT,describe:()=>mH,discriminatedUnion:()=>ZT,e164:()=>vT,email:()=>oT,emoji:()=>pT,enum:()=>Gw,exactOptional:()=>c8,file:()=>rH,float32:()=>NT,float64:()=>RT,function:()=>lH,guid:()=>iT,hash:()=>LT,hex:()=>ST,hostname:()=>FT,httpUrl:()=>lT,instanceof:()=>bH,int:()=>yw,int32:()=>$T,int64:()=>PT,intersection:()=>e8,invertCodec:()=>cH,ipv4:()=>yT,ipv6:()=>wT,json:()=>BH,jwt:()=>xT,keyof:()=>zT,ksuid:()=>BT,lazy:()=>Q8,literal:()=>aH,looseObject:()=>JT,looseRecord:()=>XT,mac:()=>CT,map:()=>eH,meta:()=>fH,nan:()=>AH,nanoid:()=>gT,nativeEnum:()=>nH,never:()=>Hw,nonoptional:()=>m8,null:()=>qF,nullable:()=>Ff,nullish:()=>oH,number:()=>TF,object:()=>KT,optional:()=>Wu,partialRecord:()=>VT,pipe:()=>Cw,prefault:()=>g8,preprocess:()=>yH,promise:()=>dH,readonly:()=>w8,record:()=>a8,refine:()=>_8,set:()=>tH,strictObject:()=>YT,string:()=>Df,stringFormat:()=>DT,stringbool:()=>hH,success:()=>iH,superRefine:()=>x8,symbol:()=>HT,templateLiteral:()=>uH,transform:()=>Uw,tuple:()=>n8,uint32:()=>MT,uint64:()=>TT,ulid:()=>bT,undefined:()=>GT,union:()=>Dp,unknown:()=>Ju,url:()=>dT,uuid:()=>AT,uuidv4:()=>sT,uuidv6:()=>cT,uuidv7:()=>uT,void:()=>OT,xid:()=>hT,xor:()=>WT});var hw={};L(hw,{endsWith:()=>gp,gt:()=>pA,gte:()=>fo,includes:()=>lp,length:()=>Yu,lowercase:()=>up,lt:()=>lA,lte:()=>mo,maxLength:()=>Ku,maxSize:()=>kc,mime:()=>mp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>Ec,negative:()=>sw,nonnegative:()=>uw,nonpositive:()=>cw,normalize:()=>fp,overwrite:()=>wi,positive:()=>Aw,properties:()=>lw,property:()=>dw,regex:()=>cp,size:()=>zu,slugify:()=>yp,startsWith:()=>pp,toLowerCase:()=>hp,toUpperCase:()=>Bp,trim:()=>bp,uppercase:()=>dp});var aT=new WeakSet([Object.prototype,Error.prototype]);function Bw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var rT=(e,t)=>{sf.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);aT.has(n)||(aT.add(n),Bw(n,"format",r=>a=>uf(r,a)),Bw(n,"flatten",r=>a=>cf(r,a)),Bw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Xl,2)}),Bw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Xl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},hde=_("ZodError",rT),Ur=_("ZodError",rT,void 0,{Parent:Error});var IF=np(Ur),vF=ap(Ur),_F=rp(Ur),xF=op(Ur),DF=Vy(Ur),FF=Xy(Ur),SF=eC(Ur),LF=tC(Ur),NF=nC(Ur),RF=aC(Ur),$F=rC(Ur),MF=oC(Ur);function yde(){ha.localeError||Bn(NC())}function Zu(){ha.memoizer||Bn({memoizer:yf()})}var xe=_("ZodType",(e,t)=>(yde(),we.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_8(e,t))},superRefine(e,t){return this.check(x8(e,t))},overwrite(e){return this.check(wi(e))},optional(){return Wu(this)},exactOptional(){return c8(this)},nullable(){return Ff(this)},nullish(){return Wu(Ff(this))},nonoptional(e){return m8(this,e)},array(){return Nf(this)},or(e){return Dp([this,e])},and(e){return e8(this,e)},transform(e){return Cw(this,Uw(e))},default(e){return l8(this,e)},prefault(e){return g8(this,e)},catch(e){return h8(this,e)},pipe(e){return Cw(this,e)},readonly(){return w8(this)},describe(e){let t=this.clone();return La.add(t,{description:e}),t},meta(...e){if(e.length===0)return La.get(this);let t=this.clone();return La.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...fC(this),jsonSchema:{input:wp(this,"input"),output:wp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return IF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await vF(this,t,n,{callee:e})},safeParse(e,t){return _F(this,e,t)},async safeParseAsync(e,t){return xF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return DF(this,t,n,{callee:e})},decode:function e(t,n){return FF(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await SF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await LF(this,t,n,{callee:e})},safeEncode(e,t){return NF(this,e,t)},safeDecode(e,t){return RF(this,e,t)},async safeEncodeAsync(e,t){return $F(this,e,t)},async safeDecodeAsync(e,t){return MF(this,e,t)},toJSONSchema(e){return P1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),ww=_("_ZodString",(e,t)=>{Hu.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>G1(e,r,a,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(cp(...e))},includes(...e){return this.check(lp(...e))},startsWith(...e){return this.check(pp(...e))},endsWith(...e){return this.check(gp(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(Ku(...e))},length(...e){return this.check(Yu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(up(e))},uppercase(e){return this.check(dp(e))},trim(){return this.check(bp())},normalize(...e){return this.check(fp(...e))},toLowerCase(){return this.check(hp())},toUpperCase(){return this.check(Bp())},slugify(){return this.check(yp())}}),Qp=_("ZodString",(e,t)=>{Hu.init(e,t),ww.init(e,t)},{email(e){return this.check(TC(Ew,e))},url(e){return this.check(Ef(Sf,e))},jwt(e){return this.check(iw(Pw,e))},emoji(e){return this.check(zC(Qw,e))},guid(e){return this.check(HC(kw,e))},uuid(e){return this.check(GC(mA,e))},uuidv4(e){return this.check(UC(mA,e))},uuidv6(e){return this.check(OC(mA,e))},uuidv7(e){return this.check(qC(mA,e))},nanoid(e){return this.check(KC(Iw,e))},cuid(e){return this.check(YC(vw,e))},cuid2(e){return this.check(JC(_w,e))},ulid(e){return this.check(WC(xw,e))},base64(e){return this.check(aw($w,e))},base64url(e){return this.check(rw(Mw,e))},xid(e){return this.check(ZC(Dw,e))},ksuid(e){return this.check(VC(Fw,e))},ipv4(e){return this.check(XC(Sw,e))},ipv6(e){return this.check(ew(Lw,e))},cidrv4(e){return this.check(tw(Nw,e))},cidrv6(e){return this.check(nw(Rw,e))},e164(e){return this.check(ow(jw,e))},datetime(e){return this.check(kf(_c,e))},date(e){return this.check(Qf(xc,e))},time(e){return this.check(If(Dc,e))},duration(e){return this.check(vf(Fc,e))}});function Df(e){return n1(Qp,e)}var Dt=_("ZodStringFormat",(e,t)=>{wt.init(e,t),ww.init(e,t)}),_c=_("ZodISODateTime",(e,t)=>{Kx.init(e,t),Dt.init(e,t)}),xc=_("ZodISODate",(e,t)=>{Yx.init(e,t),Dt.init(e,t)}),Dc=_("ZodISOTime",(e,t)=>{Jx.init(e,t),Dt.init(e,t)}),Fc=_("ZodISODuration",(e,t)=>{Wx.init(e,t),Dt.init(e,t)}),Ew=_("ZodEmail",(e,t)=>{$x.init(e,t),Dt.init(e,t)});function oT(e){return TC(Ew,e)}var kw=_("ZodGUID",(e,t)=>{Nx.init(e,t),Dt.init(e,t)});function iT(e){return HC(kw,e)}var mA=_("ZodUUID",(e,t)=>{Rx.init(e,t),Dt.init(e,t)});function AT(e){return GC(mA,e)}function sT(e){return UC(mA,e)}function cT(e){return OC(mA,e)}function uT(e){return qC(mA,e)}var Sf=_("ZodURL",(e,t)=>{Px.init(e,t),Dt.init(e,t)});function dT(e){return Ef(Sf,e)}function lT(e){return Ef(Sf,{protocol:lr.httpProtocol,hostname:lr.domain,...G.normalizeParams(e)})}var Qw=_("ZodEmoji",(e,t)=>{Tx.init(e,t),Dt.init(e,t)});function pT(e){return zC(Qw,e)}var Iw=_("ZodNanoID",(e,t)=>{Hx.init(e,t),Dt.init(e,t)});function gT(e){return KC(Iw,e)}var vw=_("ZodCUID",(e,t)=>{Gx.init(e,t),Dt.init(e,t)});function mT(e){return YC(vw,e)}var _w=_("ZodCUID2",(e,t)=>{Ux.init(e,t),Dt.init(e,t)});function fT(e){return JC(_w,e)}var xw=_("ZodULID",(e,t)=>{Ox.init(e,t),Dt.init(e,t)});function bT(e){return WC(xw,e)}var Dw=_("ZodXID",(e,t)=>{qx.init(e,t),Dt.init(e,t)});function hT(e){return ZC(Dw,e)}var Fw=_("ZodKSUID",(e,t)=>{zx.init(e,t),Dt.init(e,t)});function BT(e){return VC(Fw,e)}var Sw=_("ZodIPv4",(e,t)=>{Zx.init(e,t),Dt.init(e,t)});function yT(e){return XC(Sw,e)}var jF=_("ZodMAC",(e,t)=>{Xx.init(e,t),Dt.init(e,t)});function CT(e){return r1(jF,e)}var Lw=_("ZodIPv6",(e,t)=>{Vx.init(e,t),Dt.init(e,t)});function wT(e){return ew(Lw,e)}var Nw=_("ZodCIDRv4",(e,t)=>{eD.init(e,t),Dt.init(e,t)});function ET(e){return tw(Nw,e)}var Rw=_("ZodCIDRv6",(e,t)=>{tD.init(e,t),Dt.init(e,t)});function kT(e){return nw(Rw,e)}var $w=_("ZodBase64",(e,t)=>{nD.init(e,t),Dt.init(e,t)});function QT(e){return aw($w,e)}var Mw=_("ZodBase64URL",(e,t)=>{aD.init(e,t),Dt.init(e,t)});function IT(e){return rw(Mw,e)}var jw=_("ZodE164",(e,t)=>{rD.init(e,t),Dt.init(e,t)});function vT(e){return ow(jw,e)}var PF=_("ZodCreditCard",(e,t)=>{oD.init(e,t),Dt.init(e,t)});function _T(e){return o1(PF,e)}var Pw=_("ZodJWT",(e,t)=>{iD.init(e,t),Dt.init(e,t)});function xT(e){return iw(Pw,e)}var Ip=_("ZodCustomStringFormat",(e,t)=>{AD.init(e,t),Dt.init(e,t)});function DT(e,t,n={}){return Cp(Ip,e,t,n)}function FT(e){return Cp(Ip,"hostname",lr.hostname,e)}function ST(e){return Cp(Ip,"hex",lr.hex,e)}function LT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=lr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return Cp(Ip,r,a,t)}var vp=_("ZodNumber",(e,t)=>{QC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>U1(e,r,a,o);let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(pA(e,t))},gte(e,t){return this.check(fo(e,t))},min(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(mo(e,t))},max(e,t){return this.check(mo(e,t))},int(e){return this.check(yw(e))},safe(e){return this.check(yw(e))},positive(e){return this.check(pA(0,e))},nonnegative(e){return this.check(fo(0,e))},negative(e){return this.check(lA(0,e))},nonpositive(e){return this.check(mo(0,e))},multipleOf(e,t){return this.check(Ec(e,t))},step(e,t){return this.check(Ec(e,t))},finite(){return this}});function TF(e){return A1(vp,e)}var Vu=_("ZodNumberFormat",(e,t)=>{sD.init(e,t),vp.init(e,t)});function yw(e){return c1(Vu,e)}function NT(e){return u1(Vu,e)}function RT(e){return d1(Vu,e)}function $T(e){return l1(Vu,e)}function MT(e){return p1(Vu,e)}var _p=_("ZodBoolean",(e,t)=>{ff.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function HF(e){return g1(_p,e)}var xp=_("ZodBigInt",(e,t)=>{IC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>q1(e,r,a,o);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(fo(e,t))},min(e,t){return this.check(fo(e,t))},gt(e,t){return this.check(pA(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(mo(e,t))},max(e,t){return this.check(mo(e,t))},positive(e){return this.check(pA(BigInt(0),e))},negative(e){return this.check(lA(BigInt(0),e))},nonpositive(e){return this.check(mo(BigInt(0),e))},nonnegative(e){return this.check(fo(BigInt(0),e))},multipleOf(e,t){return this.check(Ec(e,t))}});function jT(e){return f1(xp,e)}var Tw=_("ZodBigIntFormat",(e,t)=>{cD.init(e,t),xp.init(e,t)});function PT(e){return h1(Tw,e)}function TT(e){return B1(Tw,e)}var GF=_("ZodSymbol",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function HT(e){return y1(GF,e)}var UF=_("ZodUndefined",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Y1(e,n,r,a)});function GT(e){return C1(UF,e)}var OF=_("ZodNull",(e,t)=>{lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>K1(e,n,r,a)});function qF(e){return w1(OF,e)}var zF=_("ZodAny",(e,t)=>{pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Z1(e,n,r,a)});function UT(){return E1(zF)}var KF=_("ZodUnknown",(e,t)=>{gD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(e,n,r,a)});function Ju(){return k1(KF)}var YF=_("ZodNever",(e,t)=>{mD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>W1(e,n,r,a)});function Hw(e){return Q1(YF,e)}var JF=_("ZodVoid",(e,t)=>{fD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a)});function OT(e){return I1(JF,e)}var Lf=_("ZodDate",(e,t)=>{bD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>X1(e,r,a,o),e.min=(r,a)=>e.check(fo(r,a)),e.max=(r,a)=>e.check(mo(r,a));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function qT(e){return v1(Lf,e)}var WF=_("ZodArray",(e,t)=>{Zu(),hD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(e,n,r,a),e.element=t.element},{min(e,t){return this.check(fs(e,t))},nonempty(e){return this.check(fs(1,e))},max(e,t){return this.check(Ku(e,t))},length(e,t){return this.check(Yu(e,t))},unwrap(){return this.element}});function Nf(e,t){return D1(WF,e,t)}function zT(e){let t=e._zod.def.shape;return Gw(Object.keys(t))}var Rf=_("ZodObject",(e,t)=>{Zu(),BD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Gw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ju()})},loose(){return this.clone({...this._zod.def,catchall:Ju()})},strict(){return this.clone({...this._zod.def,catchall:Hw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(Mf,this,e[0])},exactPartial(...e){return G.partial(Ow,this,e[0],"exactPartial")},required(...e){return G.required(qw,this,e[0])}});function KT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Rf(n)}function YT(e,t){return new Rf({type:"object",shape:e,catchall:Hw(),...G.normalizeParams(t)})}function JT(e,t){return new Rf({type:"object",shape:e,catchall:Ju(),...G.normalizeParams(t)})}var $f=_("ZodUnion",(e,t)=>{bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gw(e,n,r,a),e.options=t.options});function Dp(e,t){return new $f({type:"union",options:e,...G.normalizeParams(t)})}var ZF=_("ZodXor",(e,t)=>{$f.init(e,t),yD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gw(e,n,r,a),e.options=t.options});function WT(e,t){return new ZF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var VF=_("ZodDiscriminatedUnion",(e,t)=>{$f.init(e,t),wD.init(e,t)});function ZT(e,t,n){return new VF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var XF=_("ZodIntersection",(e,t)=>{ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a)});function e8(e,t){return new XF({type:"intersection",left:e,right:t})}var t8=_("ZodTuple",(e,t)=>{Zu(),vC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gF(e,n,r,a)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Mf({type:"optional",innerType:t}))})}});function n8(e,t,n){let r=t instanceof we,a=r?n:t,o=r?t:null;return new t8({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var Ep=_("ZodRecord",(e,t)=>{Zu(),kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function a8(e,t,n){return!t||!t._zod?new Ep({type:"record",keyType:Df(),valueType:e,...G.normalizeParams(t)}):new Ep({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function VT(e,t,n){return new Ep({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function XT(e,t,n){return new Ep({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var r8=_("ZodMap",(e,t)=>{Zu(),QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(kc(...n)),e.size=(...n)=>e.check(zu(...n))});function eH(e,t,n){return new r8({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var o8=_("ZodSet",(e,t)=>{Zu(),ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a),e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(kc(...n)),e.size=(...n)=>e.check(zu(...n))});function tH(e,t){return new o8({type:"set",valueType:e,...G.normalizeParams(t)})}var kp=_("ZodEnum",(e,t)=>{vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>eF(e,r,a,o),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{let o={};for(let i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new kp({...t,checks:[],...G.normalizeParams(a),entries:o})},e.exclude=(r,a)=>{let o={...t.entries};for(let i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new kp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Gw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new kp({type:"enum",entries:n,...G.normalizeParams(t)})}function nH(e,t){return new kp({type:"enum",entries:e,...G.normalizeParams(t)})}var i8=_("ZodLiteral",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(e,n,r,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function aH(e,t){return new i8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var A8=_("ZodFile",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a),e.min=(n,r)=>e.check(gA(n,r)),e.max=(n,r)=>e.check(kc(n,r)),e.mime=(n,r)=>e.check(mp(Array.isArray(n)?n:[n],r))});function rH(e){return F1(A8,e)}var s8=_("ZodTransform",(e,t)=>{Zu(),DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(e,n,r,a),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Cc(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(G.issue(i))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(o=>(n.value=o,n)):(n.value=a,n)}});function Uw(e){return new s8({type:"transform",transform:e})}var Mf=_("ZodOptional",(e,t)=>{_C.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Wu(e){return new Mf({type:"optional",innerType:e})}var Ow=_("ZodExactOptional",(e,t)=>{FD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function c8(e){return new Ow({type:"optional",innerType:e})}var u8=_("ZodNullable",(e,t)=>{SD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new u8({type:"nullable",innerType:e})}function oH(e){return Wu(Ff(e))}var d8=_("ZodDefault",(e,t)=>{LD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function l8(e,t){return new d8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var p8=_("ZodPrefault",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>yF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function g8(e,t){return new p8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var qw=_("ZodNonOptional",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function m8(e,t){return new qw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var f8=_("ZodSuccess",(e,t)=>{$D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function iH(e){return new f8({type:"success",innerType:e})}var b8=_("ZodCatch",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function h8(e,t){return new b8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var B8=_("ZodNaN",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a)});function AH(e){return x1(B8,e)}var jf=_("ZodPipe",(e,t)=>{xC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wF(e,n,r,a),e.in=t.in,e.out=t.out});function Cw(e,t){return new jf({type:"pipe",in:e,out:t})}var Pf=_("ZodCodec",(e,t)=>{jf.init(e,t),hf.init(e,t)});function sH(e,t,n){return new Pf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function cH(e){let t=e._zod.def;return new Pf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var y8=_("ZodPreprocess",(e,t)=>{jf.init(e,t),PD.init(e,t)}),C8=_("ZodReadonly",(e,t)=>{TD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>EF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function w8(e){return new C8({type:"readonly",innerType:e})}var E8=_("ZodTemplateLiteral",(e,t)=>{HD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a)});function uH(e,t){return new E8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var k8=_("ZodLazy",(e,t)=>{Bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>QF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function Q8(e){return new k8({type:"lazy",getter:e})}var I8=_("ZodPromise",(e,t)=>{UD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>kF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function dH(e){return new I8({type:"promise",innerType:e})}var v8=_("ZodFunction",(e,t)=>{GD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(e,n,r,a)});function lH(e){return new v8({type:"function",input:Array.isArray(e?.input)?n8(e?.input):e?.input??Nf(Ju()),output:e?.output??Ju()})}var Tf=_("ZodCustom",(e,t)=>{OD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(e,n,r,a)});function pH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function gH(e,t){return S1(Tf,e??(()=>!0),t)}function _8(e,t={}){return L1(Tf,e,t)}function x8(e,t){return N1(e,t)}var mH=R1,fH=$1;function bH(e,t={}){let n=new Tf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var hH=(...e)=>M1({Codec:Pf,Boolean:_p,String:Qp},...e);function BH(e){let t=Q8(()=>Dp([Df(e),TF(),HF(),qF(),Nf(t),a8(Df(),t)]));return t}function yH(e,t){return new y8({type:"pipe",in:Uw(e),out:t})}var Cde={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 wde(e){Bn({customError:e})}function Ede(){return Bn().customError}var D8;D8||(D8={});var Hf={};L(Hf,{ZodISODate:()=>xc,ZodISODateTime:()=>_c,ZodISODuration:()=>Fc,ZodISOTime:()=>Dc,date:()=>Qde,datetime:()=>kde,duration:()=>vde,time:()=>Ide});function kde(e){return kf(_c,e)}function Qde(e){return Qf(xc,e)}function Ide(e){return If(Dc,e)}function vde(e){return vf(Fc,e)}var X={...Fp,...hw,iso:Hf},_de=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"]);function xde(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function CH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function Dde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Fde(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let a=n[1]===void 0?void 0:Dde(n[1]);if(!a||!t.defs[a])throw new Error(`Reference not found: ${e}`);return t.defs[a]}throw new Error(`Reference not found: ${e}`)}function Sde(e,t){return X.transform(r=>r).check(r=>{let a=r.value;if(!(typeof a!="object"||a===null||Array.isArray(a)))for(let o of Object.getOwnPropertyNames(a)){let i=t.safeParse(o);i.success||r.issues.push({code:"invalid_key",origin:"record",issues:i.error.issues,input:o,path:[o],continue:!0})}}).pipe(e)}function wH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var Lde=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function EH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return X.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let a=e.$ref;if(t.refs.has(a))return t.refs.get(a);if(t.processing.has(a))return X.lazy(()=>{if(!t.refs.has(a))throw new Error(`Circular reference not resolved: ${a}`);return t.refs.get(a)});t.processing.add(a);let o=Fde(a,t),i=Or(o,t);return t.refs.set(a,i),t.processing.delete(a),i}if(e.enum!==void 0){let a=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&a.length===1&&a[0]===null)return X.null();if(a.length===0)return X.never();if(a.length===1)return X.literal(a[0]);if(a.every(i=>typeof i=="string"))return X.enum(a);let o=a.map(i=>X.literal(i));return o.length<2?o[0]:X.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return X.literal(e.const);let n=e.type;if(Array.isArray(n)){let a=n.map(o=>{let i={...e,type:o};return EH(i,t)});return a.length===0?X.never():a.length===1?a[0]:X.union(a)}if(!n)return X.any();let r;switch(n){case"string":{let a=X.string();if(e.format){let o=e.format;o==="email"?a=a.check(X.email()):o==="uri"||o==="uri-reference"?a=a.check(X.url()):o==="uuid"||o==="guid"?a=a.check(X.uuid()):o==="date-time"?a=a.check(X.iso.datetime({offset:!0})):o==="date"?a=a.check(X.iso.date()):o==="time"?a=a.check(X.regex(Lde)):o==="duration"?a=a.check(X.iso.duration()):o==="hostname"?a=a.check(X.hostname()):o==="ipv4"?a=a.check(X.ipv4()):o==="ipv6"?a=a.check(X.ipv6()):o==="mac"?a=a.check(X.mac()):o==="cidr"?a=a.check(X.cidrv4()):o==="cidr-v6"?a=a.check(X.cidrv6()):o==="base64"?a=a.check(X.base64()):o==="base64url"?a=a.check(X.base64url()):o==="e164"?a=a.check(X.e164()):o==="credit_card"?a=a.check(X.creditCard()):o==="jwt"?a=a.check(X.jwt()):o==="emoji"?a=a.check(X.emoji()):o==="nanoid"?a=a.check(X.nanoid()):o==="cuid"?a=a.check(X.cuid()):o==="cuid2"?a=a.check(X.cuid2()):o==="ulid"?a=a.check(X.ulid()):o==="xid"?a=a.check(X.xid()):o==="ksuid"&&(a=a.check(X.ksuid()))}typeof e.minLength=="number"&&(a=a.min(e.minLength)),typeof e.maxLength=="number"&&(a=a.max(e.maxLength)),e.pattern&&(a=a.regex(new RegExp(e.pattern))),r=a;break}case"number":case"integer":{let a=n==="integer"?X.number().int():X.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(a=a.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(a=a.max(e.maximum)),typeof e.exclusiveMinimum=="number"?a=a.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(a=a.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?a=a.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(a=a.lt(e.maximum)),typeof e.multipleOf=="number"&&(a=a.multipleOf(e.multipleOf)),r=a;break}case"boolean":{r=X.boolean();break}case"null":{r=X.null();break}case"object":{let a={},o=e.properties||{},i=new Set(e.required||[]),A=typeof e.additionalProperties=="object"?Or(e.additionalProperties,t):void 0;for(let[s,u]of Object.entries(o)){let d=Or(u,t);sn(a,s,i.has(s)?d:d.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),d=[];for(let g of u){let p=Or(s[g],t),m=X.string().regex(new RegExp(g));d.push(X.looseRecord(m,p))}let l=[];if(Object.keys(a).length>0&&l.push(X.object(a).passthrough()),l.push(...d),l.length===0)r=X.object({}).passthrough();else if(l.length===1)r=l[0];else{let g=X.intersection(l[0],l[1]);for(let p=2;p<l.length;p++)g=X.intersection(g,l[p]);r=g}if(e.additionalProperties===!1){let g=Object.keys(a),p=u.map(b=>new RegExp(b)),m=r;r=r.check(b=>{if(!Go(b.value))return;let B=[];for(let h of Object.keys(b.value))g.includes(h)||p.some(f=>f.test(h))||B.push(h);B.length&&b.issues.push({code:"unrecognized_keys",keys:B,input:b.value,inst:m})})}}else{let s=X.object(a);e.additionalProperties===!1?r=s.strict():A?r=s.catchall(A):r=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;r=Sde(r,Or(s,t))}break}case"array":{let a=e.prefixItems,o=e.items;if(a&&Array.isArray(a)){let i=typeof e.minItems=="number"?e.minItems:0,A=a.map(l=>Or(l,t)),s=CH(A,i),u=Array.isArray(o)?void 0:wH(o,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,A=o.map(l=>Or(l,t)),s=CH(A,i),u=wH(e.additionalItems,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(o!==void 0){let i=Or(o,t),A=X.array(i);typeof e.minItems=="number"&&(A=A.min(e.minItems)),typeof e.maxItems=="number"&&(A=A.max(e.maxItems)),r=A}else r=X.array(X.any());break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Or(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n=EH(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let A=e.anyOf.map(u=>Or(u,t)),s=X.union(A);n=r?X.intersection(n,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let A=e.oneOf.map(u=>Or(u,t)),s=X.xor(A);n=r?X.intersection(n,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:X.any();else{let A=r?n:Or(e.allOf[0],t),s=r?0:1;for(let u=s;u<e.allOf.length;u++)A=X.intersection(A,Or(e.allOf[u],t));n=A}e.nullable===!0&&t.version==="openapi-3.0"&&(n=X.nullable(n)),e.readOnly===!0&&(n=X.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let a={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let A of o)A in e&&(a[A]=e[A]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let A of i)A in e&&(a[A]=e[A]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(a.propertyNames=e.propertyNames);for(let A of Object.keys(e))_de.has(A)||sn(a,A,e[A]);return Object.keys(a).length>0&&t.registry.add(n,a),e.description&&(n=n.describe(e.description)),n}function kH(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=xde(n,t?.defaultTarget),a=n.$defs||n.definitions||{},o={version:r,defs:a,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??La};return Or(n,o)}var QH=Symbol("z.visit/resolving");function Gf(e,t){let n=typeof t=="function"?t:(i,A)=>{let s=t[i._zod.def.type];return s?s(i,A):i},r=new Map;function a(i){let A=r.get(i);if(A===QH)return new Bf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,QH);let s=o(i),u=n(s,s!==i);return r.set(i,u),u}function o(i){let A=i._zod.def,s=A.type;switch(s){case"object":{let u=A.shape,d=Object.keys(u),l=!1,g={};for(let m of d){let b=a(u[m]);b!==u[m]&&(l=!0),g[m]=b}let p=A.catchall;return A.catchall&&(p=a(A.catchall),p!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:g,catchall:p}):i}case"array":{let u=a(A.element);return u===A.element?i:bt(i,{...A,element:u})}case"tuple":{let u=A.items,d=!1,l=[];for(let p of u){let m=a(p);m!==p&&(d=!0),l.push(m)}let g=A.rest;return A.rest&&(g=a(A.rest),g!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:g}):i}case"record":case"map":{let u=a(A.keyType),d=a(A.valueType);return u===A.keyType&&d===A.valueType?i:bt(i,{...A,keyType:u,valueType:d})}case"set":{let u=a(A.valueType);return u===A.valueType?i:bt(i,{...A,valueType:u})}case"union":{let u=A.options,d=!1,l=[];for(let g of u){let p=a(g);p!==g&&(d=!0),l.push(p)}return d?bt(i,{...A,options:l}):i}case"intersection":{let u=a(A.left),d=a(A.right);return u===A.left&&d===A.right?i:bt(i,{...A,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=a(A.innerType);return u===A.innerType?i:bt(i,{...A,innerType:u})}case"pipe":{let u=a(A.in),d=a(A.out);return u===A.in&&d===A.out?i:bt(i,{...A,in:u,out:d})}case"function":{let u=a(A.input),d=a(A.output);return u===A.input&&d===A.output?i:bt(i,{...A,input:u,output:d})}case"lazy":{let u=A.getter,{_cachedInner:d,...l}=A;return bt(i,{...l,getter:()=>a(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return i;default:return i}}return a(e)}function IH(e){return Gf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Dp(n.options)}})}function Nde(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,yi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function vH(e){return Nde(e.out,e.checks)}function Rde(e){return e.in._zod.traits.has("$ZodTransform")?vH(e):e.in}function _H(e){return Gf(e,{pipe:t=>Rde(t._zod.def),default:(t,n)=>n?Wu(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function xH(e){return Gf(e,{pipe:t=>vH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var F8={};L(F8,{bigint:()=>Pde,boolean:()=>jde,date:()=>Tde,number:()=>Mde,string:()=>$de});function $de(e){return a1(Qp,e)}function Mde(e){return s1(vp,e)}function jde(e){return m1(_p,e)}function Pde(e){return b1(xp,e)}function Tde(e){return _1(Lf,e)}var DH=["none","low","medium","high","xhigh"];var zw=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Hde(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var Gde=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Hde,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),SH=c.discriminatedUnion("kind",[Gde]),Ude=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),LH=c.object({icon:Ude.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Of=c.enum(["closed","merged","open"]),P9e=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Of,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),H9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Ode=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),qde=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),NH=c.object({details:c.array(qde).max(100).optional(),icon:Ode.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var Yw=c.string().regex(/^T[A-Z0-9]+$/),S8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),RH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),zde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),Kw=zde,he=c.string().refine(e=>e.trim().length>0),Ja=he.refine(e=>e===e.trim()),Kde=c.object({id:he,provider:Ja}).strict(),Yde=Kde.extend({provider:c.literal("slack"),teamId:Yw,channelId:S8,threadTs:Ja.optional()}).strict(),U9e=c.discriminatedUnion("provider",[Yde]),O9e=c.enum(["slack","local"]),$H=c.enum(["public","private"]),Jde=c.enum(["public","private"]),Wde=c.object({platform:c.literal("slack"),teamId:Yw,channelId:S8,threadTs:Ja.optional()}).strict(),L8=Wde,Zde=c.object({platform:c.literal("local"),conversationId:RH}).strict(),Vde=c.discriminatedUnion("platform",[L8,Zde]),MH=c.object({action:c.literal("send_message"),destination:L8}).strict(),Xde=c.object({kind:c.literal("slack"),teamId:Yw,channelId:S8,visibility:$H,messageTs:he.optional(),threadTs:he.optional()}).strict(),ele=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:RH}).strict(),tle=c.object({kind:c.literal("web"),visibility:$H,conversationId:Ja}).strict(),nle=c.object({kind:c.literal("event"),eventKey:Ja,eventType:Ja,identifier:Ja,namespace:Ja}).strict(),ale=c.object({kind:c.literal("scheduled_automation")}).strict(),rle=c.object({kind:c.literal("event_automation")}).strict(),ole=c.object({kind:c.literal("plugin_dispatch")}).strict(),ile=c.object({kind:c.literal("agent_invocation")}).strict(),Ale=c.discriminatedUnion("kind",[Xde,ele,tle,nle,ale,rle,ole,ile]);function sle(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var cle=c.preprocess(sle,Ale),ule=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:Kw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:Kw,allowedWhen:c.literal("scheduled-automation"),taskId:Ja}).strict()]),N8={email:he.optional(),fullName:he.optional(),userId:Kw,userName:he.optional()},dle=c.object({...N8,platform:c.literal("slack"),teamId:Yw}).strict(),lle=c.object({...N8,platform:c.literal("local")}).strict(),ple=c.object({...N8,platform:c.literal("web")}).strict(),gle=c.object({platform:c.literal("system"),name:Kw}).strict(),Uf=c.discriminatedUnion("platform",[dle,lle,ple,gle]),mle=c.object({displayName:he.optional(),handle:he.optional(),id:Ja,provider:Ja,providerSubjectId:Ja,providerTenantId:Ja.optional()}).strict(),q9e=c.object({displayName:he.optional(),email:he.max(320),id:Ja,identities:c.array(mle).max(100)}).strict(),fle=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),ble=c.object({label:Ja.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Ja.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),z9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:ule.optional(),destination:L8,destinationVisibility:Jde,input:he.pipe(c.string().max(32e3)),metadata:fle.optional(),replyAttribution:ble.optional()}).strict();var hle=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),Y9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),J9e=c.object({kind:hle,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var Ble=4e3,yle=8e3,Sp=32,FH=4e3,Cle=1e3,wle=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event data may include at most ${Sp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>FH&&t.addIssue({code:"custom",message:`Event data may be at most ${FH} JSON bytes.`})}),Xu=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),jH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),PH=/^[a-z][a-zA-Z0-9]*$/,Ele=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),kle=c.record(c.string().regex(PH),Ele).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Sp} keys.`})}),Z9e=c.record(c.string().regex(PH),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>Sp&&t.addIssue({code:"custom",message:`Event match may include at most ${Sp} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var Qle=c.object({type:jH,supportedEvents:c.array(Xu).min(1),suggestedEvents:c.array(Xu).optional(),matchFields:kle.optional(),guidance:c.record(Xu,c.string().trim().min(1).max(Cle)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),V9e=c.object({resourceTypes:c.array(Qle).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var X9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Xu).optional(),supportedEvents:c.array(Xu),type:jH}).strict(),e6e=c.object({events:c.array(Xu).min(1),id:c.string().min(1)}).strict(),Ile=c.object({eventKey:c.string().min(1),eventType:Xu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,Ble)),data:wle.optional(),untrustedText:c.string().transform(e=>e.slice(0,yle)).optional()}).strict(),t6e=Ile.extend({namespace:c.string().min(1)}),vle=c.object({authority:c.enum(["instruction","context"]),actor:Uf.optional()}).strict(),_le=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:vle.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),a6e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Vde,locationId:c.string().min(1).optional(),actors:c.array(Uf),actor:Uf.optional(),runId:c.string().min(1),source:cle,transcript:c.array(_le)}).strict();var o6e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),xle=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),i6e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:xle.optional()}).passthrough(),A6e=c.enum(["auto","review","approve"]);var c6e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:he}).strict(),Dle=c.string().regex(/^[a-z][a-z0-9-]*$/),Fle=c.string().regex(/^[a-z][a-z0-9.-]*$/),Sle=c.union([c.literal("read"),c.literal("write")]),TH=c.object({provider:Dle,scope:he.optional(),type:c.literal("oauth")}).strict(),HH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),d6e=c.object({account:HH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),l6e=c.object({access:Sle,leaseScope:he.optional(),name:Fle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),Lle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Nle=c.object({account:HH.optional(),authorization:TH.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Lle).min(1)}).strict(),p6e=c.discriminatedUnion("type",[c.object({lease:Nle,type:c.literal("lease")}).strict(),c.object({authorization:TH.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var Rle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),$le=he.max(80),Mle=he.max(500),jle=c.enum(["primary","profile"]),Ple=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Tle=c.object({label:he.max(80),value:he.max(500)}).strict(),Hle=c.object({confirmation:he.max(500).optional(),href:he.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:he.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),Gle=c.object({actions:c.array(Hle).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Tle).max(8).optional(),title:he.max(4e3)}).strict(),m6e=c.object({emptyText:he.max(500).optional(),metrics:c.array(Ple).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array(Gle).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),Ule=c.object({description:Mle,id:Rle,label:$le,navigation:jle,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),f6e=c.array(Ule),Ole=he.max(1e3).optional(),qle=he.max(64).optional(),zle=c.string().trim().max(200).optional(),b6e=c.object({cursor:Ole,filter:qle,limit:c.number().int().min(1).max(50),query:zle}).strict();var Kle=c.object({input:c.number().finite().nonnegative().optional(),output:c.number().finite().nonnegative().optional(),cacheRead:c.number().finite().nonnegative().optional(),cacheWrite:c.number().finite().nonnegative().optional(),total:c.number().finite().nonnegative().optional()}).strict(),Yle=c.object({inputTokens:c.number().int().nonnegative().optional(),outputTokens:c.number().int().nonnegative().optional(),cachedInputTokens:c.number().int().nonnegative().optional(),cacheCreationTokens:c.number().int().nonnegative().optional(),reasoningTokens:c.number().int().nonnegative().optional(),totalTokens:c.number().int().nonnegative().optional(),cost:Kle.optional()}).strict(),Jle=c.union([c.literal("instruction"),c.literal("context")]),Wle=c.object({authority:Jle,actor:Uf.optional()}).strict();var Zle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Wle}).passthrough(),Vle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),Xle=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),UH=c.discriminatedUnion("type",[Zle,Vle,Xle]),epe=c.object({item:UH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),GH=c.array(epe),tpe=c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict(),OH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:zw,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:GH}).strict(),c.object({type:c.literal("compaction"),modelProfile:zw,modelId:c.string().min(1),details:tpe.optional(),summary:c.string().min(1).optional(),replacementHistory:GH}).strict()]),w6e=c.object({data:OH,createdAtMs:c.number().finite()}).strict(),npe=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),ape=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),qH=c.union([c.literal("plugin"),c.literal("mcp")]),rpe=c.object({type:c.literal("authorization_requested"),kind:qH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1),delivery:c.union([c.literal("private_link_sent"),c.literal("private_link_reused")])}).strict(),ope=c.object({type:c.literal("authorization_completed"),kind:qH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),ipe=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),Ape=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),spe=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),zH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:spe,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),cpe=zH.extend({type:c.literal("message_updated")}),upe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),dpe=c.object({type:c.literal("messages_summarized"),historyFromSeq:c.number().int().nonnegative(),compactions:c.array(c.object({coveredMessageCount:c.number().int().nonnegative(),createdAtMs:c.number(),id:c.string().min(1),summary:c.string()}).strict())}).strict(),lpe=c.enum(["slack","api","scheduler","internal"]),j8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),P8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),ppe=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:lpe}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),gpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:zw,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(DH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),mpe=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1).max(64),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),fpe=c.object({type:c.literal("structured_event"),namespace:c.string().regex(/^[a-z][a-z0-9-]*$/),name:c.string().regex(/^[a-z][a-z0-9_]*$/),version:c.number().int().positive(),turnId:c.string().min(1).optional(),content:c.record(c.string(),c.unknown())}).strict(),bpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),hpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(bpe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),Bpe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),ype=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:j8,failureReason:P8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),Cpe=c.object({type:c.literal("subagent_started"),subagentInvocationId:c.string().min(1),subagentKind:c.string().min(1),modelId:c.string().min(1).optional(),parentToolCallId:c.string().min(1).optional(),reasoningLevel:c.string().min(1).optional(),childConversationId:c.string().min(1)}).strict(),wpe=c.object({type:c.literal("subagent_ended"),subagentInvocationId:c.string().min(1),outcome:c.union([c.literal("success"),c.literal("error"),c.literal("aborted")]),errorCode:c.string().min(1).optional()}).strict(),KH=c.union([zH,cpe,UH,npe,rpe,ope,ipe,Ape,upe,dpe,ppe,mpe,fpe,hpe,gpe,Bpe,ype,Cpe,wpe]),Epe=c.union([KH,OH,ape]),kpe=["message","message_updated","user_message","assistant_message","tool_result","mcp_provider_connected","mcp_provider_connected_unowned","authorization_requested","authorization_completed","tool_execution_started","guardian_action_reviewed","message_handled","messages_summarized","turn_started","turn_context","structured_event","attachments_delivered","turn_routed","turn_completed","turn_failed","subagent_started","subagent_ended","handoff","compaction"],E6e=c.enum(kpe),Qpe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),M8=c.object({schemaVersion:c.number().int().nonnegative(),seq:c.number().int().nonnegative(),historyVersion:c.number().int().nonnegative(),idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),k6e=c.union([M8.extend({schemaVersion:c.literal(1),data:Epe}),M8.extend({data:Qpe})]),Q6e=M8.extend({type:c.string().min(1),payload:c.unknown()});var I6e=c.object({data:KH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),Wa=c.string().trim().min(1).max(400),T8=c.string().url().max(2048),qf=c.string().datetime(),YH=c.object({provider:c.string().trim().min(1).max(100),channelName:Wa.optional()}).strict(),Ipe=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),JH=c.object({repository:Wa,number:c.number().int().positive(),title:Wa.optional(),url:T8,state:Of,openedAt:qf.optional(),mergedAt:qf.optional(),closedAt:qf.optional()}).strict(),vpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Wa,url:T8,status:Wa.optional()}).strict(),_pe=c.object({startedAt:qf,lastActivityAt:qf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Wa,messages:c.number().int().positive()}).strict()),userMessages:c.number().int().nonnegative(),assistantMessages:c.number().int().nonnegative(),toolResults:c.number().int().nonnegative(),events:c.number().int().nonnegative(),turns:c.number().int().positive().optional(),location:YH.optional(),codeChanges:c.array(JH)}).strict(),xpe=c.object({schemaVersion:c.literal(1),record:_pe,summary:c.string().trim().min(1).max(600),intent:Wa,outcome:c.object({status:Ipe,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Wa,by:Wa.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Wa,owner:Wa.optional()}).strict()).max(20),facts:c.array(Wa).max(30),links:c.array(vpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),Dpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Wa.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),Fpe=c.object({label:Wa,url:T8,status:Wa.optional()}).strict(),v6e=c.object({conversationId:c.string().min(1),title:Wa.optional(),visibility:c.enum(["private","public"]),location:YH.optional(),entries:c.array(Dpe),codeChanges:c.array(JH),resources:c.array(Fpe)}).strict();var Spe=c.enum(["active","completed","failed"]),Lpe=c.enum(["api","internal","scheduler","slack"]),WH=Yle,Npe=c.object({conversationId:c.string().min(1)}).strict(),_6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),Rpe=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),$pe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Mpe=c.object({actorEmail:c.string().trim().email().transform(e=>e.toLowerCase()).optional(),q:c.string().trim().max(200).optional(),status:c.enum(["active","archived"]).default("active")}).strict(),jpe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),H8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),Ppe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3),visibility:c.enum(["private","public"]).optional()}).strict(),Tpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Jw=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),ed=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),ZH=c.enum(["defer","interrupt"]),VH=c.object({actorIdentity:ed.optional(),createdAt:c.string().datetime(),delivery:ZH,inboundMessageId:c.string().min(1),messageId:c.string().min(1),receivedAt:c.string().datetime(),role:c.literal("user"),source:c.enum(["slack","web"]),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"pending message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted pending messages must not expose actor identity"})}),XH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),G8=c.object({authorization:XH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(VH)}).strict(),Hpe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),U8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),eG=c.object({costUsd:c.number().finite().nonnegative(),operations:c.array(c.object({costUsd:c.number().finite().nonnegative(),events:c.number().int().positive(),name:c.string().min(1),namespace:c.string().min(1)}).strict()).min(1)}).strict(),Gpe=c.object({id:c.string().min(1).optional(),kind:c.enum(["scheduled","event"]),label:c.string().min(1).optional(),title:c.string().min(1).optional()}).strict().superRefine((e,t)=>{!!e.id!=!!e.label&&t.addIssue({code:"custom",message:"sourceTask id and label must both be set or both omitted"})}),Upe=SH.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),tG=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Lp=c.object({displayTitle:c.string(),activityPreview:tG.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:WH.optional(),auxiliaryCosts:eG.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:Spe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:Lpe,actorIdentity:ed.optional(),participants:c.array(ed).optional(),archivedAt:c.string().datetime().nullable().optional(),channel:c.string().optional(),channelName:c.string().optional(),channelNameRedacted:c.boolean().optional(),locationId:c.string().optional(),sentryTraceUrl:c.string().optional(),locationUrl:c.string().url().optional(),traceId:c.string().optional(),annotations:c.array(Upe).optional(),sidebarAnnotations:c.array(LH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),Ope=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:ed.optional(),eventType:c.string().min(1).optional(),explicitMention:c.boolean().optional(),trustedSummary:c.string().min(1).optional(),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted messages must not expose actor identity"})}),qpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),zpe=c.object({toolCallId:c.string().min(1),name:c.string().min(1),status:c.enum(["running","completed","error"]),startedAt:c.string().datetime().optional(),startedSeq:c.number().int().nonnegative().optional(),input:c.unknown().optional(),output:c.unknown().optional()}).strict().superRefine((e,t)=>{e.startedAt===void 0!=(e.startedSeq===void 0)&&t.addIssue({code:"custom",message:"tool start sequence and timestamp must be provided together"})}),nG=c.object({type:c.literal("reasoning"),text:c.string().min(1).optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"reasoning content must be text or explicitly redacted"})}),Kpe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Ype=c.object({parts:c.array(c.discriminatedUnion("type",[nG,Kpe])).min(1)}).strict(),Jpe=c.object({type:c.literal("tool_calls"),calls:c.array(zpe).min(1),assistant:Ype.optional()}).strict().superRefine((e,t)=>{if(!e.assistant)return;let n=new Map;for(let a of e.calls)n.set(a.toolCallId,(n.get(a.toolCallId)??0)+1);let r=new Map;for(let a of e.assistant.parts)a.type==="tool_call"&&r.set(a.toolCallId,(r.get(a.toolCallId)??0)+1);(n.size!==r.size||[...n].some(([a,o])=>r.get(a)!==o))&&t.addIssue({code:"custom",path:["assistant","parts"],message:"assistant tool parts must reference every call exactly once"})}),Wpe=c.object({type:c.literal("assistant_message"),parts:c.array(nG).min(1)}).strict(),Zpe=c.discriminatedUnion("state",[c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.enum(["succeeded","no_reply"])}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("started"),inputMessageIds:c.array(c.string().min(1)).min(1).optional()}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("failed"),failureCode:j8,failureReason:P8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),Vpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:c.string().min(1),modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.string().min(1),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),Xpe=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),ege=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),tge=c.object({type:c.literal("structured_event"),namespace:c.string().min(1),name:c.string().min(1),version:c.number().int().positive(),turnId:c.string().min(1).optional(),presentation:NH}).strict(),nge=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),age=c.object({type:c.literal("attachments_delivered"),attachments:c.array(nge).min(1)}).strict(),rge=c.object({type:c.literal("compaction"),modelProfile:c.string().min(1).optional(),modelId:c.string().min(1).optional(),summary:c.string().min(1).optional(),details:c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict().optional()}).strict(),oge=c.object({type:c.literal("handoff"),modelProfile:c.string().min(1),modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional()}).strict(),ige=c.object({type:c.literal("subagent"),startedSeq:c.number().int().nonnegative(),startedAt:c.string().datetime(),childConversationId:c.string().min(1),subagentKind:c.string().min(1),parentToolCallId:c.string().min(1).optional(),status:c.enum(["running","completed","error","aborted"])}).strict(),aG=c.discriminatedUnion("type",[Ope,qpe,Wpe,Jpe,Zpe,ege,tge,age,Vpe,Xpe,rge,oge,ige]),O8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:aG}).strict(),q8=c.discriminatedUnion("status",[c.object({status:c.literal("available")}).strict(),c.object({status:c.literal("redacted"),reason:c.literal("non_public_conversation")}).strict(),c.object({status:c.literal("expired"),expiredAt:c.string().datetime()}).strict()]),Age=c.object({modelId:c.string(),usage:WH}).strict();function rG(e,t){e.eventHistory.status==="expired"&&e.events.length>0&&t.addIssue({code:"custom",path:["events"],message:"expired event history must not contain events"});for(let n=1;n<e.events.length;n+=1)e.events[n].seq<=e.events[n-1].seq&&t.addIssue({code:"custom",path:["events",n,"seq"],message:"report event sequences must be strictly increasing"});for(let[n,r]of e.events.entries())r.data.type==="message"&&(e.eventHistory.status==="redacted"&&r.data.redacted!==!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact messages"}),e.eventHistory.status==="available"&&r.data.redacted===!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose messages"})),e.eventHistory.status==="redacted"&&r.data.type==="tool_calls"&&r.data.calls.some(a=>a.input!==void 0||a.output!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact tool payloads"}),e.eventHistory.status==="redacted"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.text!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact assistant messages"}),e.eventHistory.status==="available"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.redacted===!0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose reasoning"}),r.data.type==="tool_calls"&&(e.eventHistory.status==="redacted"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.text!==void 0)||e.eventHistory.status==="available"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.redacted===!0))&&t.addIssue({code:"custom",path:["events",n,"data","assistant"],message:"assistant reasoning must match event history visibility"})}var z8=Lp.extend({brief:c.object({content:xpe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(Age).optional(),events:c.array(O8),eventHistory:q8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:Gpe.optional()}).strict().superRefine(rG),K8=c.object({events:c.array(O8),eventHistory:q8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(rG),Y8=c.object({conversations:c.array(Lp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),td=c.object({active:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),label:c.string(),costUsd:c.number().optional(),tokens:c.number().optional()}).strict(),oG=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),R8=c.object({cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:oG,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),$8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:oG,deny:c.number(),requests:c.number()}).strict(),sge=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array($8),metricHours:c.array($8).optional(),metricSixHours:c.array($8).optional(),requests:c.number()}).strict(),J8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:sge,metricDays:c.array(R8),metricHours:c.array(R8).optional(),metricSixHours:c.array(R8).optional(),locations:c.array(td),actors:c.array(td),source:c.literal("conversation_index"),costUsd:c.number().optional(),inputTokens:c.number().optional(),tokens:c.number().optional(),windowEnd:c.string(),windowStart:c.string()}).strict();var cge=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),iG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),W8=c.array(iG),Z8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),V8=c.array(Z8),AG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),sG=c.object({packageNames:c.array(c.string()),packages:c.array(AG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),uge=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(Z8),packagedContent:sG}).strict(),X8=c.enum(["danger","good","neutral","warning"]),dge=c.object({label:c.string(),tone:X8.optional(),value:c.string()}).strict(),lge=c.object({key:c.string(),label:c.string()}).strict(),pge=c.object({id:c.string(),tone:X8.optional(),values:c.record(c.string(),c.string())}).strict(),gge=c.object({fields:c.array(lge).optional(),emptyText:c.string().optional(),records:c.array(pge).optional(),title:c.string()}).strict(),mge=c.object({categories:c.array(c.object({id:c.string().min(1),label:c.string().min(1),values:c.record(c.string(),c.number().finite())}).strict()).max(100),description:c.string().optional(),emptyText:c.string().optional(),id:c.string().min(1),series:c.array(c.object({format:c.literal("usd").optional(),key:c.string().min(1),label:c.string().min(1),tone:X8.optional()}).strict()).min(1).max(8),timeRangeDays:c.array(c.union([c.literal(1),c.literal(7),c.literal(30),c.literal(90)])).min(1).max(4).optional(),title:c.string().min(1),type:c.literal("bar_chart")}).strict(),cG=c.object({generatedAt:c.string().optional(),metrics:c.array(dge).optional(),recordSets:c.array(gge).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(mge).max(12).optional()}).strict(),Ww=c.object({generatedAt:c.string(),reports:c.array(cG),source:c.literal("plugins")}).strict();var D=Symbol.for("drizzle:entityKind");function On(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,D))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(D in n&&n[D]===t[D])return!0;n=Object.getPrototypeOf(n)}return!1}var nd=class{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[D]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};var Zw=class{static[D]="ColumnBuilder";config;constructor(t,n,r){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}};var hs=Symbol.for("drizzle:Name");var Vw=class{static[D]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(t,n){this.reference=()=>{let{name:r,columns:a,foreignColumns:o}=t();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t===void 0?"no action":t,this}onDelete(t){return this._onDelete=t===void 0?"no action":t,this}build(t){return new e2(t,this)}},e2=class{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[D]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:t,columns:n,foreignColumns:r}=this.reference(),a=n.map(A=>A.name),o=r.map(A=>A.name),i=[this.table[hs],...a,r[0].table[hs],...o];return t??`${i.join("_")}_fk`}};function Xw(e,...t){return e(...t)}function a2(e,t){return`${e[hs]}_${t.join("_")}_unique`}var t2=class{constructor(t,n){this.name=n,this.columns=t}static[D]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(t){return new n2(t,this.columns,this.nullsNotDistinctConfig,this.name)}},uG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new t2(t,this.name)}},n2=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??a2(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function dG(e,t,n){for(let r=t;r<e.length;r++){let a=e[r];if(a==="\\"){r++;continue}if(a==='"')return[e.slice(t,r).replace(/\\/g,""),r+1];if(!n&&(a===","||a==="}"))return[e.slice(t,r).replace(/\\/g,""),r]}return[e.slice(t).replace(/\\/g,""),e.length]}function lG(e,t=0){let n=[],r=t,a=!1;for(;r<e.length;){let o=e[r];if(o===","){(a||r===t)&&n.push(""),a=!0,r++;continue}if(a=!1,o==="\\"){r+=2;continue}if(o==='"'){let[s,u]=dG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=lG(e,r+1);n.push(s),r=u;continue}let[i,A]=dG(e,r,!1);n.push(i),r=A}return[n,r]}function pG(e){let[t]=lG(e,1);return t}function r2(e){return`{${e.map(t=>Array.isArray(t)?r2(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends Zw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new i2(this.config.name,this,t)}references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t,n){return this.config.isUnique=!0,this.config.uniqueName=t,this.config.uniqueType=n?.nulls,this}generatedAlwaysAs(t){return this.config.generated={as:t,type:"always",mode:"stored"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:r,actions:a})=>Xw((o,i)=>{let A=new Vw(()=>{let s=o();return{columns:[t],foreignColumns:[s]}});return i.onUpdate&&A.onUpdate(i.onUpdate),i.onDelete&&A.onDelete(i.onDelete),A.build(n)},r,a))}buildExtraConfigColumn(t){return new o2(t,this.config)}},W=class extends nd{constructor(t,n){n.uniqueName||(n.uniqueName=a2(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},o2=class extends W{static[D]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(t){return this.indexConfig.opClass=t,this}},Np=class{static[D]="IndexedColumn";constructor(t,n,r,a){this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=a}name;keyAsName;type;indexConfig},i2=class extends ee{static[D]="PgArrayBuilder";constructor(t,n,r){super(t,"array","PgArray"),this.config.baseBuilder=n,this.config.size=r}build(t){let n=this.config.baseBuilder.build(t);return new A2(t,this.config,n)}},A2=class e extends W{constructor(t,n,r,a){super(t,n),this.baseColumn=r,this.range=a,this.size=n.size}size;static[D]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(t){return typeof t=="string"&&(t=pG(t)),t.map(n=>this.baseColumn.mapFromDriverValue(n))}mapToDriverValue(t,n=!1){let r=t.map(a=>a===null?null:On(this.baseColumn,e)?this.baseColumn.mapToDriverValue(a,!0):this.baseColumn.mapToDriverValue(a));return n?r:r2(r)}};var gG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new s2(t,this.config)}},s2=class extends W{static[D]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}},mG=Symbol.for("drizzle:isPgEnum");function bG(e){return!!e&&typeof e=="function"&&mG in e&&e[mG]===!0}var fG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new c2(t,this.config)}},c2=class extends W{static[D]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}};var Rp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},hG=class extends Rp{static[D]="WithSubquery"};var BG="0.45.2";var u2,d2,yG={startActiveSpan(e,t){return u2?(d2||(d2=u2.trace.getTracer("drizzle-orm",BG)),Xw((n,r)=>r.startActiveSpan(e,a=>{try{return t(a)}catch(o){throw a.setStatus({code:n.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{a.end()}}),u2,d2)):t()}};var $p=Symbol.for("drizzle:ViewBaseConfig");var l2=Symbol.for("drizzle:Schema"),CG=Symbol.for("drizzle:Columns"),wG=Symbol.for("drizzle:ExtraConfigColumns"),p2=Symbol.for("drizzle:OriginalName"),g2=Symbol.for("drizzle:BaseName"),zf=Symbol.for("drizzle:IsAlias"),EG=Symbol.for("drizzle:ExtraConfigBuilder"),fge=Symbol.for("drizzle:IsDrizzleTable"),_n=class{static[D]="Table";static Symbol={Name:hs,Schema:l2,OriginalName:p2,Columns:CG,ExtraConfigColumns:wG,BaseName:g2,IsAlias:zf,ExtraConfigBuilder:EG};[hs];[p2];[l2];[CG];[wG];[g2];[zf]=!1;[fge]=!0;[EG]=void 0;constructor(t,n,r){this[hs]=this[p2]=t,this[l2]=n,this[g2]=r}};var kG=class{static[D]="FakePrimitiveParam"};function bge(e){return e!=null&&typeof e.getSQL=="function"}function hge(e){let t={sql:"",params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var bo=class{static[D]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new xn([this])}},xn=class e{constructor(t){this.queryChunks=t;for(let n of t)if(On(n,_n)){let r=n[_n.Symbol.Schema];this.usedTables.push(r===void 0?n[_n.Symbol.Name]:r+"."+n[_n.Symbol.Name])}}static[D]="SQL";decoder=QG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return yG.startActiveSpan("drizzle.buildSQL",n=>{let r=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:i,prepareTyping:A,inlineParams:s,paramStartIndex:u}=r;return hge(t.map(d=>{if(On(d,bo))return{sql:d.value.join(""),params:[]};if(On(d,Kf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new bo("(")];for(let[g,p]of d.entries())l.push(p),g<d.length-1&&l.push(new bo(", "));return l.push(new bo(")")),this.buildQueryFromSourceParams(l,r)}if(On(d,e))return this.buildQueryFromSourceParams(d.queryChunks,{...r,inlineParams:s||d.shouldInlineParams});if(On(d,_n)){let l=d[_n.Symbol.Schema],g=d[_n.Symbol.Name];return{sql:l===void 0||d[zf]?o(g):o(l)+"."+o(g),params:[]}}if(On(d,nd)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let g=d.table[_n.Symbol.Schema];return{sql:d.table[zf]||g===void 0?o(d.table[_n.Symbol.Name])+"."+o(l):o(g)+"."+o(d.table[_n.Symbol.Name])+"."+o(l),params:[]}}if(On(d,m2)){let l=d[$p].schema,g=d[$p].name;return{sql:l===void 0||d[$p].isAlias?o(g):o(l)+"."+o(g),params:[]}}if(On(d,eE)){if(On(d.value,Yf))return{sql:i(u.value++,d),params:[d],typings:["none"]};let l=d.value===null?null:d.encoder.mapToDriverValue(d.value);if(On(l,e))return this.buildQueryFromSourceParams([l],r);if(s)return{sql:this.mapInlineParam(l,r),params:[]};let g=["none"];return A&&(g=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:g}}return On(d,Yf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:On(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:On(d,Rp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new bo("("),d._.sql,new bo(") "),new Kf(d._.alias)],r):bG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:bge(d)?d.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([d.getSQL()],r):this.buildQueryFromSourceParams([new bo("("),d.getSQL(),new bo(")")],r):s?{sql:this.mapInlineParam(d,r),params:[]}:{sql:i(u.value++,d),params:[d],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){let r=t.toString();return n(r==="[object Object]"?JSON.stringify(t):r)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}},Kf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new xn([this])}};var QG={mapFromDriverValue:e=>e},IG={mapToDriverValue:e=>e},yLe={...QG,...IG},eE=class{constructor(t,n=IG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new xn([this])}};function Mp(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new bo(e[0]));for(let[r,a]of t.entries())n.push(a,new bo(e[r+1]));return new xn(n)}(e=>{function t(){return new xn([])}e.empty=t;function n(s){return new xn(s)}e.fromList=n;function r(s){return new xn([new bo(s)])}e.raw=r;function a(s,u){let d=[];for(let[l,g]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(g);return new xn(d)}e.join=a;function o(s){return new Kf(s)}e.identifier=o;function i(s){return new Yf(s)}e.placeholder=i;function A(s,u){return new eE(s,u)}e.param=A})(Mp||(Mp={}));(e=>{class t{constructor(r,a){this.sql=r,this.fieldAlias=a}static[D]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(xn||(xn={}));var Yf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new xn([this])}};var Bge=Symbol.for("drizzle:IsDrizzleView"),m2=class{static[D]="View";[$p];[Bge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[$p]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new xn([this])}};nd.prototype.getSQL=function(){return new xn([this])};_n.prototype.getSQL=function(){return new xn([this])};Rp.prototype.getSQL=function(){return new xn([this])};function We(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}var wLe=typeof TextDecoder>"u"?null:new TextDecoder;var Bs=class extends ee{static[D]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"always",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"byDefault",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var f2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new b2(t,this.config)}},b2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},h2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new B2(t,this.config)}},B2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function vG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new f2(n):new h2(n)}var y2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new C2(t,this.config)}},C2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},w2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new E2(t,this.config)}},E2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function _G(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new y2(n):new w2(n)}var k2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new Q2(t,this.config)}},Q2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function xG(e){return new k2(e??"")}var I2=class extends ee{static[D]="PgCharBuilder";constructor(t,n){super(t,"string","PgChar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new v2(t,this.config)}},v2=class extends W{static[D]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function DG(e,t={}){let{name:n,config:r}=We(e,t);return new I2(n,r)}var _2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new x2(t,this.config)}},x2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function FG(e){return new _2(e??"")}var D2=class extends ee{static[D]="PgCustomColumnBuilder";constructor(t,n,r){super(t,"custom","PgCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(t){return new F2(t,this.config)}},F2=class extends W{static[D]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}};function SG(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new D2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Mp`now()`)}};var S2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new L2(t,this.config)}},L2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},N2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new R2(t,this.config)}},R2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function LG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new S2(n):new N2(n)}var $2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new M2(t,this.config)}},M2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function NG(e){return new $2(e??"")}var j2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new P2(t,this.config)}},P2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function RG(e){return new j2(e??"")}var T2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new H2(t,this.config)}},H2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function $G(e){return new T2(e??"")}var G2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new U2(t,this.config)}},U2=class extends W{static[D]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let t=this.fields?` ${this.fields}`:"",n=this.precision?`(${this.precision})`:"";return`interval${t}${n}`}};function MG(e,t={}){let{name:n,config:r}=We(e,t);return new G2(n,r)}var O2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new q2(t,this.config)}},q2=class extends W{static[D]="PgJson";constructor(t,n){super(t,n)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function jG(e){return new O2(e??"")}var z2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new K2(t,this.config)}},K2=class extends W{static[D]="PgJsonb";constructor(t,n){super(t,n)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function tE(e){return new z2(e??"")}var Y2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new J2(t,this.config)}},J2=class extends W{static[D]="PgLine";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r),Number.parseFloat(a)]}mapToDriverValue(t){return`{${t[0]},${t[1]},${t[2]}}`}},W2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new Z2(t,this.config)}},Z2=class extends W{static[D]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return{a:Number.parseFloat(n),b:Number.parseFloat(r),c:Number.parseFloat(a)}}mapToDriverValue(t){return`{${t.a},${t.b},${t.c}}`}};function PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new Y2(n):new W2(n)}var V2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new X2(t,this.config)}},X2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function TG(e){return new V2(e??"")}var eS=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new tS(t,this.config)}},tS=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function HG(e){return new eS(e??"")}var nS=class extends ee{static[D]="PgNumericBuilder";constructor(t,n,r){super(t,"string","PgNumeric"),this.config.precision=n,this.config.scale=r}build(t){return new aS(t,this.config)}},aS=class extends W{static[D]="PgNumeric";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},rS=class extends ee{static[D]="PgNumericNumberBuilder";constructor(t,n,r){super(t,"number","PgNumericNumber"),this.config.precision=n,this.config.scale=r}build(t){return new oS(t,this.config)}},oS=class extends W{static[D]="PgNumericNumber";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},iS=class extends ee{static[D]="PgNumericBigIntBuilder";constructor(t,n,r){super(t,"bigint","PgNumericBigInt"),this.config.precision=n,this.config.scale=r}build(t){return new AS(t,this.config)}},AS=class extends W{static[D]="PgNumericBigInt";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function GG(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new rS(n,r?.precision,r?.scale):a==="bigint"?new iS(n,r?.precision,r?.scale):new nS(n,r?.precision,r?.scale)}var sS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new cS(t,this.config)}},cS=class extends W{static[D]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r)]}return[t.x,t.y]}mapToDriverValue(t){return`(${t[0]},${t[1]})`}},uS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new dS(t,this.config)}},dS=class extends W{static[D]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return{x:Number.parseFloat(n),y:Number.parseFloat(r)}}return t}mapToDriverValue(t){return`(${t.x},${t.y})`}};function UG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new sS(n):new uS(n)}function yge(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function OG(e,t){let n=new ArrayBuffer(8),r=new DataView(n);for(let a=0;a<8;a++)r.setUint8(a,e[t+a]);return r.getFloat64(0,!0)}function lS(e){let t=yge(e),n=0,r=t[n];n+=1;let a=new DataView(t.buffer),o=a.getUint32(n,r===1);n+=4;let i;if(o&536870912&&(i=a.getUint32(n,r===1),n+=4),(o&65535)===1){let A=OG(t,n);n+=8;let s=OG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var pS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new gS(t,this.config)}},gS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return lS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},mS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new fS(t,this.config)}},fS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=lS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function qG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new pS(n):new mS(n)}var bS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new hS(t,this.config)}},hS=class extends W{static[D]="PgReal";constructor(t,n){super(t,n)}getSQLType(){return"real"}mapFromDriverValue=t=>typeof t=="string"?Number.parseFloat(t):t};function zG(e){return new bS(e??"")}var BS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new yS(t,this.config)}},yS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function KG(e){return new BS(e??"")}var CS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new wS(t,this.config)}},wS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function YG(e){return new CS(e??"")}var ES=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new kS(t,this.config)}},kS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function JG(e){return new ES(e??"")}var QS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new IS(t,this.config)}},IS=class extends W{static[D]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}};function Ei(e,t={}){let{name:n,config:r}=We(e,t);return new QS(n,r)}var vS=class extends fA{constructor(t,n,r){super(t,"string","PgTime"),this.withTimezone=n,this.precision=r,this.config.withTimezone=n,this.config.precision=r}static[D]="PgTimeBuilder";build(t){return new _S(t,this.config)}},_S=class extends W{static[D]="PgTime";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function WG(e,t={}){let{name:n,config:r}=We(e,t);return new vS(n,r.withTimezone??!1,r.precision)}var xS=class extends fA{static[D]="PgTimestampBuilder";constructor(t,n,r){super(t,"date","PgTimestamp"),this.config.withTimezone=n,this.config.precision=r}build(t){return new DS(t,this.config)}},DS=class extends W{static[D]="PgTimestamp";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){return typeof t=="string"?new Date(this.withTimezone?t:t+"+0000"):t}mapToDriverValue=t=>t.toISOString()},FS=class extends fA{static[D]="PgTimestampStringBuilder";constructor(t,n,r){super(t,"string","PgTimestampString"),this.config.withTimezone=n,this.config.precision=r}build(t){return new SS(t,this.config)}},SS=class extends W{static[D]="PgTimestampString";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){if(typeof t=="string")return t;let n=t.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=t.getTimezoneOffset(),a=r<=0?"+":"-";return`${n}${a}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return n}};function nE(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new FS(n,r.withTimezone??!1,r.precision):new xS(n,r?.withTimezone??!1,r?.precision)}var LS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Mp`gen_random_uuid()`)}build(t){return new NS(t,this.config)}},NS=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function ZG(e){return new LS(e??"")}var RS=class extends ee{static[D]="PgVarcharBuilder";constructor(t,n){super(t,"string","PgVarchar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new $S(t,this.config)}},$S=class extends W{static[D]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function VG(e,t={}){let{name:n,config:r}=We(e,t);return new RS(n,r)}var MS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new jS(t,this.config)}},jS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function XG(e,t){let{name:n,config:r}=We(e,t);return new MS(n,r)}var PS=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new TS(t,this.config)}},TS=class extends W{static[D]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function e5(e,t){let{name:n,config:r}=We(e,t);return new PS(n,r)}var HS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new GS(t,this.config)}},GS=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function t5(e,t){let{name:n,config:r}=We(e,t);return new HS(n,r)}var US=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new OS(t,this.config)}},OS=class extends W{static[D]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function n5(e,t){let{name:n,config:r}=We(e,t);return new US(n,r)}function a5(){return{bigint:vG,bigserial:_G,boolean:xG,char:DG,cidr:FG,customType:SG,date:LG,doublePrecision:NG,inet:RG,integer:$G,interval:MG,json:jG,jsonb:tE,line:PG,macaddr:TG,macaddr8:HG,numeric:GG,point:UG,geometry:qG,real:zG,serial:KG,smallint:YG,smallserial:JG,text:Ei,time:WG,timestamp:nE,uuid:ZG,varchar:VG,bit:XG,halfvec:e5,sparsevec:t5,vector:n5}}var qS=Symbol.for("drizzle:PgInlineForeignKeys"),r5=Symbol.for("drizzle:EnableRLS"),Jf=class extends _n{static[D]="PgTable";static Symbol=Object.assign({},_n.Symbol,{InlineForeignKeys:qS,EnableRLS:r5});[qS]=[];[r5]=!1;[_n.Symbol.ExtraConfigBuilder]=void 0;[_n.Symbol.ExtraConfigColumns]={}};function Cge(e,t,n,r,a=e){let o=new Jf(e,r,a),i=typeof t=="function"?t(a5()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.build(o);return o[qS].push(...g.buildForeignKeys(p,o)),[d,p]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.buildExtraConfigColumn(o);return[d,p]})),u=Object.assign(o,A);return u[_n.Symbol.Columns]=A,u[_n.Symbol.ExtraConfigColumns]=s,n&&(u[Jf.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Jf.Symbol.EnableRLS]=!0,u)})}var o5=(e,t,n)=>Cge(e,t,n,void 0);var aE=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new Wf(t.map(n=>{if(On(n,xn))return n;n=n;let r=new Np(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,!1,this.name)}onOnly(...t){return new Wf(t.map(n=>{if(On(n,xn))return n;n=n;let r=new Np(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new Wf(n.map(r=>{if(On(r,xn))return r;r=r;let a=new Np(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},Wf=class{static[D]="PgIndexBuilder";config;constructor(t,n,r,a,o="btree"){this.config={name:a,columns:t,unique:n,only:r,method:o}}concurrently(){return this.config.concurrently=!0,this}with(t){return this.config.with=t,this}where(t){return this.config.where=t,this}build(t){return new zS(this.config,t)}},zS=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function i5(e){return new aE(!1,e)}function A5(e){return new aE(!0,e)}var s5=e=>nE(e,{withTimezone:!0}),c5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),RRe=o5("junior_destinations",{id:Ei("id").primaryKey(),provider:Ei("provider").notNull(),providerTenantId:Ei("provider_tenant_id").notNull().default(""),providerDestinationId:Ei("provider_destination_id").notNull(),kind:Ei("kind").$type().notNull(),parentDestinationId:Ei("parent_destination_id"),displayName:Ei("display_name"),visibility:Ei("visibility").$type().notNull().default("unknown"),metadata:tE("metadata_json"),createdAt:s5("created_at").notNull(),updatedAt:s5("updated_at").notNull()},e=>[A5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),i5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var wge=c.object({error:c.string().min(1)}).strict(),d5=36e5,GRe=6*d5,URe=24*d5;var WS=c.object({closed:c.number().int().nonnegative(),costUsd:c.number().nonnegative().optional(),created:c.number().int().nonnegative(),medianCostUsd:c.number().nonnegative().optional(),medianMergeTimeMs:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),open:c.number().int().nonnegative()}).strict(),Ege=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),ad=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:Ege,merged:c.number().int().nonnegative()}).strict(),l5=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),id:c.string().uuid(),medianCostUsd:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),name:c.string().min(1),open:c.number().int().nonnegative(),provider:c.string().min(1),url:c.string().url().optional()}).strict(),p5=c.object({closedAt:c.string().optional(),id:c.string().uuid(),mergedAt:c.string().optional(),number:c.number().int().positive(),openedAt:c.string(),provider:c.string().min(1),repository:c.string().min(1),state:Of,title:c.string().optional(),url:c.string().url().optional()}).strict(),ZS=c.object({activityDays:c.array(ad),activityHours:c.array(ad).optional(),activitySixHours:c.array(ad).optional(),changes:c.array(p5),generatedAt:c.string(),repositories:c.array(l5),summary:WS,windowEnd:c.string(),windowStart:c.string()}).strict(),VS=c.object({activityDays:c.array(ad),activityHours:c.array(ad).optional(),activitySixHours:c.array(ad).optional(),generatedAt:c.string(),summary:WS,windowEnd:c.string(),windowStart:c.string()}).strict(),oE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var kge=c.object({locationId:c.string().min(1)}).strict(),g5=td.extend({id:c.string(),firstSeenAt:c.string(),kind:c5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),Qge=td.extend({actor:ed}).strict(),Ige=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),iE=c.object({date:Ige,privateConversations:c.number(),publicConversations:c.number()}).strict(),XS=c.object({activityDays:c.array(iE),activityHours:c.array(iE).optional(),activitySixHours:c.array(iE).optional(),generatedAt:c.string(),locations:c.array(g5),privateActivity:td,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),e4=g5.extend({activityDays:c.array(oE),activityHours:c.array(oE).optional(),activitySixHours:c.array(oE).optional(),actors:c.array(Qge),generatedAt:c.string(),recentConversations:c.array(Lp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),vge=c.object({email:c.string().trim().min(1)}).strict(),u5=td.omit({costUsd:!0}),m5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),KS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:m5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),YS=c.object({activePeople:c.number(),conversations:c.number(),date:m5}).strict(),f5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),rE=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),_ge=c.object({1:rE,7:rE,30:rE,90:rE}).strict(),b5=ed.extend({email:c.string().min(1)}).strict(),xge=f5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:b5,windows:_ge}).strict(),t4=c.object({activityDays:c.array(YS),activityHours:c.array(YS).optional(),activitySixHours:c.array(YS).optional(),generatedAt:c.string(),people:c.array(xge),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),n4=c.object({activityDays:c.array(KS),activityHours:c.array(KS).optional(),activitySixHours:c.array(KS).optional(),generatedAt:c.string(),locations:c.array(u5),recentConversations:c.array(Lp),actor:b5,source:c.literal("conversation_index"),surfaces:c.array(u5),totals:f5,windowEnd:c.string(),windowStart:c.string()}).strict(),a4=c.object({generatedAt:c.string(),sevenDaysUsd:c.number().finite().nonnegative(),source:c.literal("conversation_index"),thirtyDaysUsd:c.number().finite().nonnegative(),windowEnd:c.string(),windowStart:c.string()}).strict(),r4=c.object({id:c.string().uuid(),name:c.string(),tokenSuffix:c.string(),createdAt:c.string().datetime(),expiresAt:c.string().datetime(),lastUsedAt:c.string().datetime().nullable()}).strict(),o4=c.object({tokens:c.array(r4)}).strict(),Dge=c.object({name:c.string().trim().min(1).max(80)}).strict(),i4=r4.extend({token:c.string().startsWith("jr_pat_")}).strict(),Fge=c.object({id:c.string().uuid()}).strict(),Sge=c.object({revoked:c.literal(!0)}).strict(),Lge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),h5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),B5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:Lge,id:c.string().min(1),instruction:c.string().min(1),lastConversationId:c.string().min(1).optional(),lastRunAt:c.string().datetime().optional(),ownedByViewer:c.boolean(),runs:h5,outcomes:c.array(MH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),y5=B5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),C5=B5.extend({events:c.array(c.string().min(1)).min(1),kind:c.literal("event"),resource:c.string().min(1),source:c.string().min(1),triggerAvailable:c.boolean()}).strict(),A4=c.discriminatedUnion("kind",[y5,C5]),w5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),JS=c.object({costUsd:c.number().finite().nonnegative(),date:w5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),Nge=c.object({q:c.string().trim().max(200).optional()}).strict(),s4=c.object({executionDays:c.array(JS),executionHours:c.array(JS).optional(),executionSixHours:c.array(JS).optional(),automations:c.array(A4),truncated:c.boolean()}).strict(),Rge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),E5=c.enum(["blocked","completed","failed"]),c4=c.object({conversationId:c.string().min(1).optional(),costUsd:c.number().finite().nonnegative().optional(),durationMs:c.number().finite().nonnegative().optional(),executedAt:c.string().datetime(),executionId:c.string().min(1),status:E5,title:c.string().min(1).optional(),totalTokens:c.number().int().nonnegative().optional()}).strict(),AE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:w5,failed:c.number().int().nonnegative()}).strict(),u4=c.object({executionDays:c.array(AE),executionHours:c.array(AE).optional(),executionSixHours:c.array(AE).optional(),executions:c.array(c4),automation:A4,truncated:c.boolean()}).strict(),k5=c4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),d4=c.object({runs:c.array(k5),truncated:c.boolean()}).strict(),$ge=c.object({provider:c.string(),repo:c.string()}).strict(),Q5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),Mge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),I5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),jp=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(Q5),snapshot:Mge.nullable()}).strict(),l4=c.object({baselineSnapshot:I5.nullable(),workspaces:c.array(jp)}).strict(),jge=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array($ge)}).strict(),Pge=c.object({id:c.string().uuid()}).strict(),Tge=c.object({deleted:c.literal(!0)}).strict(),v5=c.object({count:c.number().int().nonnegative(),date:c.string(),metric:c.string().min(1),name:c.string().min(1),namespace:c.string().min(1)}).strict(),p4=c.object({generatedAt:c.string().datetime(),stats:c.array(v5),windowEnd:c.string(),windowStart:c.string()}).strict();function Hge(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var Gge=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Hge,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),WRe=c.discriminatedUnion("kind",[Gge]),Uge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),ZRe=c.object({icon:Uge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Oge=c.enum(["closed","merged","open"]),XRe=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Oge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),t$e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),qge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),zge=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),n$e=c.object({details:c.array(zge).max(100).optional(),icon:qge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var cE=c.string().regex(/^T[A-Z0-9]+$/),m4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),x5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Kge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),sE=Kge,Be=c.string().refine(e=>e.trim().length>0),Za=Be.refine(e=>e===e.trim()),Yge=c.object({id:Be,provider:Za}).strict(),Jge=Yge.extend({provider:c.literal("slack"),teamId:cE,channelId:m4,threadTs:Za.optional()}).strict(),r$e=c.discriminatedUnion("provider",[Jge]),o$e=c.enum(["slack","local"]),D5=c.enum(["public","private"]),Wge=c.enum(["public","private"]),Zge=c.object({platform:c.literal("slack"),teamId:cE,channelId:m4,threadTs:Za.optional()}).strict(),f4=Zge,Vge=c.object({platform:c.literal("local"),conversationId:x5}).strict(),Xge=c.discriminatedUnion("platform",[f4,Vge]),i$e=c.object({action:c.literal("send_message"),destination:f4}).strict(),eme=c.object({kind:c.literal("slack"),teamId:cE,channelId:m4,visibility:D5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),tme=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:x5}).strict(),nme=c.object({kind:c.literal("web"),visibility:D5,conversationId:Za}).strict(),ame=c.object({kind:c.literal("event"),eventKey:Za,eventType:Za,identifier:Za,namespace:Za}).strict(),rme=c.object({kind:c.literal("scheduled_automation")}).strict(),ome=c.object({kind:c.literal("event_automation")}).strict(),ime=c.object({kind:c.literal("plugin_dispatch")}).strict(),Ame=c.object({kind:c.literal("agent_invocation")}).strict(),sme=c.discriminatedUnion("kind",[eme,tme,nme,ame,rme,ome,ime,Ame]);function cme(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var ume=c.preprocess(cme,sme),dme=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:sE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:sE,allowedWhen:c.literal("scheduled-automation"),taskId:Za}).strict()]),b4={email:Be.optional(),fullName:Be.optional(),userId:sE,userName:Be.optional()},lme=c.object({...b4,platform:c.literal("slack"),teamId:cE}).strict(),pme=c.object({...b4,platform:c.literal("local")}).strict(),gme=c.object({...b4,platform:c.literal("web")}).strict(),mme=c.object({platform:c.literal("system"),name:sE}).strict(),g4=c.discriminatedUnion("platform",[lme,pme,gme,mme]),fme=c.object({displayName:Be.optional(),handle:Be.optional(),id:Za,provider:Za,providerSubjectId:Za,providerTenantId:Za.optional()}).strict(),A$e=c.object({displayName:Be.optional(),email:Be.max(320),id:Za,identities:c.array(fme).max(100)}).strict(),bme=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),hme=c.object({label:Za.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Za.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),s$e=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:dme.optional(),destination:f4,destinationVisibility:Wge,input:Be.pipe(c.string().max(32e3)),metadata:bme.optional(),replyAttribution:hme.optional()}).strict();var Bme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),u$e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),d$e=c.object({kind:Bme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var yme=4e3,Cme=8e3,Pp=32,_5=4e3,wme=1e3,Eme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event data may include at most ${Pp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>_5&&t.addIssue({code:"custom",message:`Event data may be at most ${_5} JSON bytes.`})}),rd=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),F5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),S5=/^[a-z][a-zA-Z0-9]*$/,kme=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),Qme=c.record(c.string().regex(S5),kme).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Pp} keys.`})}),p$e=c.record(c.string().regex(S5),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>Pp&&t.addIssue({code:"custom",message:`Event match may include at most ${Pp} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var Ime=c.object({type:F5,supportedEvents:c.array(rd).min(1),suggestedEvents:c.array(rd).optional(),matchFields:Qme.optional(),guidance:c.record(rd,c.string().trim().min(1).max(wme)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),g$e=c.object({resourceTypes:c.array(Ime).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var m$e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(rd).optional(),supportedEvents:c.array(rd),type:F5}).strict(),f$e=c.object({events:c.array(rd).min(1),id:c.string().min(1)}).strict(),vme=c.object({eventKey:c.string().min(1),eventType:rd,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,yme)),data:Eme.optional(),untrustedText:c.string().transform(e=>e.slice(0,Cme)).optional()}).strict(),b$e=vme.extend({namespace:c.string().min(1)}),_me=c.object({authority:c.enum(["instruction","context"]),actor:g4.optional()}).strict(),xme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:_me.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),B$e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Xge,locationId:c.string().min(1).optional(),actors:c.array(g4),actor:g4.optional(),runId:c.string().min(1),source:ume,transcript:c.array(xme)}).strict();var C$e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),Dme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),w$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:Dme.optional()}).passthrough(),E$e=c.enum(["auto","review","approve"]);var Q$e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:Be}).strict(),Fme=c.string().regex(/^[a-z][a-z0-9-]*$/),Sme=c.string().regex(/^[a-z][a-z0-9.-]*$/),Lme=c.union([c.literal("read"),c.literal("write")]),L5=c.object({provider:Fme,scope:Be.optional(),type:c.literal("oauth")}).strict(),N5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),v$e=c.object({account:N5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),_$e=c.object({access:Lme,leaseScope:Be.optional(),name:Sme,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),Nme=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Rme=c.object({account:N5.optional(),authorization:L5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Nme).min(1)}).strict(),x$e=c.discriminatedUnion("type",[c.object({lease:Rme,type:c.literal("lease")}).strict(),c.object({authorization:L5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var $me=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),Mme=Be.max(80),jme=Be.max(500),Pme=c.enum(["primary","profile"]),Tme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Hme=c.object({label:Be.max(80),value:Be.max(500)}).strict(),Gme=c.object({confirmation:Be.max(500).optional(),href:Be.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:Be.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),Ume=c.object({actions:c.array(Gme).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Hme).max(8).optional(),title:Be.max(4e3)}).strict(),R5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Tme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(Ume).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),Ome=c.object({description:jme,id:$me,label:Mme,navigation:Pme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),$5=c.array(Ome),qme=Be.max(1e3).optional(),zme=Be.max(64).optional(),Kme=c.string().trim().max(200).optional(),F$e=c.object({cursor:qme,filter:zme,limit:c.number().int().min(1).max(50),query:Kme}).strict();var uE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),N$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),M5=c.object({allowedEmailCount:c.number(),allowedGoogleDomainCount:c.number(),authRequired:c.boolean(),authPath:c.string(),basePath:c.string(),componentGallery:c.boolean(),sentryConversationLinks:c.boolean(),timeZone:c.string().optional(),version:c.string().min(1)}).strict();var Zf=C(q(),1);var j5="x-junior-version";var h4="junior:dashboard-version";function P5(e){let t=e.headers.get(j5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(h4,{detail:t}))}function T5(e){let[t,n]=(0,Zf.useState)(e);return(0,Zf.useEffect)(()=>{e&&n(e)},[e]),(0,Zf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(h4,r),()=>window.removeEventListener(h4,r)},[]),t}var ys=class extends Error{status;apiError;constructor(t,n,r){super(`${t} returned ${n}`),this.status=n,r?.trim()&&(this.apiError=r.trim())}};async function od(e,t){let n;try{let r=await t.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ys(e,t.status,n)}function Tp(){if(typeof window>"u")return;let e=window.__JUNIOR_DASHBOARD_BASE_PATH__??"/",t=e==="/"?"/auth/login":`${e}/auth/login`;if(window.location.pathname!==t){let n=`${window.location.pathname}${window.location.search||""}`,r=new URLSearchParams;n!=="/"&&r.set("next",n);let a=r.toString();window.location.assign(a?`${t}?${a}`:t)}}async function dE(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function id(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function H5(e,t,n){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function Sc(e){let t=await Hp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&Tp(),t.ok||await od(e,t)}async function G5(e,t,n={}){let r=await Hp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&Tp(),r.ok||await od(t,r),e.parse(await r.json())}async function Hp(e,t){let n=await fetch(e,t);return P5(n),n}async function je(e,t,n){let r=await Hp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(Tp(),await od(t,r)),r.ok||await od(t,r),e.parse(await r.json())}var lE=5*6e4,B4=5*6e4,Yme=1e3;function Jme(e,t=Date.now()){if(!e)return B4;let n=Date.parse(e);if(!Number.isFinite(n))return B4;let r=Math.max(0,t-n);return Math.max(Yme,B4-r)}function U5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(uE,"/api/me",e),je(M5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:lE})}function Wme(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(W8,"/api/plugins",e),retry:!1,staleTime:lE})}function O5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je($5,"/api/user-pages",e),retry:!1,staleTime:lE})}function pE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(Y8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:Wh,retry:!1})}function q5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(ZS,"/api/code",e),retry:!1})}function z5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(s4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:Wh,retry:!1})}function K5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(d4,"/api/automations/runs",t),retry:!1})}function Y5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(u4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function J5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(t4,"/api/people",e),retry:!1})}function W5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(n4,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function Z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(Ww,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function V5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(VS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function X5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(a4,"/api/people/me/spend",t),refetchInterval:t=>Jme(t.state.data?.generatedAt),retry:!1,staleTime:0})}function eU(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(XS,"/api/locations",e),retry:!1})}function tU(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(e4,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function Zme(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(V8,"/api/skills",e),retry:!1,staleTime:lE})}function Vme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(Ww,"/api/plugin-reports",e),retry:!1})}function nU(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(p4,"/api/stats",e),retry:!1})}function aU(e){let t=Wme(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(J8,"/api/conversations/stats",i),retry:!1}),r=Zme(),a=Vme();return{data:t.data&&r.data?{...e,conversationStatsError:!!n.error,...n.data?{conversationStats:n.data}:void 0,conversationStatsLoading:n.isPending,pluginReportsError:!!a.error,...a.data?{pluginReports:a.data}:void 0,pluginReportsLoading:a.isPending,plugins:t.data,skills:r.data}:void 0,error:t.error??r.error,isPending:t.isPending||r.isPending}}var rU=C(q(),1);function gE(){return(0,rU.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var iU=C(w(),1);function oU(){return gE()?null:(0,iU.jsx)("div",{"aria-live":"polite",className:"border-t border-amber-300/15 bg-amber-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-amber-100/80",role:"status",children:"You\u2019re offline. Drafts stay on this device."})}var y4=C(w(),1);function mE(){return(0,y4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,y4.jsx)("img",{alt:"",className:"relative size-11 max-w-none -translate-y-0.5 object-contain opacity-90 drop-shadow-[0_0_7px_rgba(255,255,255,0.16)]",draggable:!1,src:"/_junior/dashboard/avatar.png"})})}var AU=["relative","overflow-hidden","bg-white/15","before:absolute","before:inset-0","before:content-['']","before:bg-[linear-gradient(90deg,#ff4d6d,#ffb703,#56f39a,#4cc9f0,#9b5de5,#ff4d6d)]","before:bg-[length:200%_100%]","before:animate-[junior-rainbow-flow_1.2s_linear_infinite]","motion-reduce:before:animate-none"].join(" ");function k(...e){return e.filter(Boolean).join(" ")}var yn="mx-auto w-full min-w-0 max-w-screen-xl",bA="text-dashboard-text-muted hover:text-dashboard-text",sU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",cU="dashboard-shell-bg";var Lc=C(w(),1);function qn(e){return(0,Lc.jsx)("div",{className:k(yn,"grid min-h-[calc(100dvh-5rem)] place-items-center px-4 py-8 md:px-8"),children:(0,Lc.jsxs)("section",{className:"grid w-full max-w-lg grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-lg border border-dashboard-border-emphasis bg-dashboard-surface-raised p-4",children:[(0,Lc.jsx)(mE,{}),(0,Lc.jsxs)("div",{children:[(0,Lc.jsx)("div",{className:"font-bold",children:e.label}),(0,Lc.jsx)("div",{"aria-label":e.label,className:`${AU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var C4="0.221.0",fE=typeof C4=="string"&&C4.trim()?C4:"unknown";var Vf=C(w(),1);function uU(e){return Xme(e.serverVersion)?(0,Vf.jsxs)("div",{"aria-live":"polite",className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-t border-cyan-300/15 bg-cyan-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-cyan-100/80",role:"status",children:[(0,Vf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Vf.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0 font-mono font-semibold text-cyan-100 underline decoration-cyan-300/40 underline-offset-2 hover:text-dashboard-text-solid",onClick:()=>window.location.reload(),type:"button",children:"Refresh"})]}):null}function Xme(e){return!!e&&fE!=="unknown"&&e!=="unknown"&&e!==fE}var dU=C(w(),1);function T(e){let t=e.as??"div",n={none:"",sm:"p-4",md:"p-5 sm:p-6"}[e.padding??"none"],r=e.variant==="section"?"mb-4 border-dashboard-border-subtle bg-dashboard-fill-faint shadow-[0_24px_80px_rgba(0,0,0,0.18)]":e.variant==="raised"?"border-dashboard-border-emphasis bg-dashboard-surface-raised":"border-dashboard-border-subtle bg-dashboard-fill-faint";return(0,dU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var lU=C(w(),1);function De(e){let t=e.as??"div";return(0,lU.jsx)(t,{"aria-hidden":"true",className:k("animate-pulse rounded bg-dashboard-fill-soft motion-reduce:animate-none",e.className)})}var Fe=C(w(),1);function Na(e){let t=e.variant??"panel";return(0,Fe.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:k("grid gap-4",e.className),role:"status",children:[(0,Fe.jsx)("span",{className:"sr-only",children:e.label}),efe(t)]})}function efe(e){switch(e){case"stats":return(0,Fe.jsx)(tfe,{});case"overview":return(0,Fe.jsx)(nfe,{});case"list":return(0,Fe.jsx)(afe,{});case"library":return(0,Fe.jsx)(rfe,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function tfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4},(e,t)=>(0,Fe.jsx)(hA,{className:"min-h-[7.5rem] p-4 sm:min-h-32 sm:p-5"},t))}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]})}function nfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-[17rem]"}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]}),(0,Fe.jsx)(Gp,{className:"h-24 border-y border-dashboard-border-subtle bg-dashboard-fill-faint"}),(0,Fe.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-56"}),(0,Fe.jsx)(hA,{className:"min-h-56"})]})]})}function afe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Gp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function rfe(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,Fe.jsx)(Gp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Gp,{className:"h-10 w-full max-w-md rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint sm:w-72"})]}),(0,Fe.jsx)("div",{"aria-hidden":"true",className:"grid min-w-0 grid-cols-3 gap-1 border-b border-dashboard-border-subtle sm:flex",children:Array.from({length:3},(e,t)=>(0,Fe.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:justify-start",children:[(0,Fe.jsx)(Gp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Gp,{className:"h-5 w-8 rounded-sm border border-dashboard-border-subtle bg-dashboard-fill-faint"})]},t))}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function hA(e){return(0,Fe.jsx)(T,{className:k("animate-pulse motion-reduce:animate-none",e.className),children:(0,Fe.jsx)("span",{"aria-hidden":"true"})})}function Gp(e){return(0,Fe.jsx)(De,{className:e.className})}var bE=C(w(),1),pU="inline-flex h-9 max-w-full items-center gap-2 rounded border border-dashboard-border-emphasis bg-dashboard-surface-raised px-3 font-mono text-sm font-semibold leading-none text-dashboard-text transition-colors hover:border-dashboard-border-heavy hover:bg-dashboard-surface-hover hover:text-dashboard-text",ofe="inline-flex h-9 max-w-full items-center justify-center gap-1.5 rounded border border-dashboard-border-strong bg-transparent px-3 font-mono text-xs font-semibold text-dashboard-text-muted transition-colors hover:border-rose-300/40 hover:text-rose-300";function Ze({className:e,size:t="default",tone:n="default",type:r="button",...a}){let o=n==="danger";return(0,bE.jsx)("button",{...a,className:k("font-mono transition-colors disabled:cursor-not-allowed disabled:opacity-50",t==="icon"?k("grid size-9 place-items-center rounded-md border-0 bg-transparent p-0 focus-visible:outline focus-visible:outline-1 disabled:hover:!bg-transparent",o?"text-dashboard-text-muted hover:!bg-rose-300/10 hover:!text-rose-300 focus-visible:outline-rose-300/55 disabled:hover:!text-dashboard-text-muted":"text-dashboard-text-muted hover:!bg-dashboard-fill-strong hover:!text-dashboard-text focus-visible:outline-cyan-300/55 disabled:hover:!text-dashboard-text-muted"):o?k(ofe,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(pU,"disabled:hover:border-dashboard-border-emphasis disabled:hover:bg-dashboard-surface-raised disabled:hover:text-dashboard-text"),a.disabled?"":"cursor-pointer",e),type:r})}function gU({className:e,...t}){return(0,bE.jsx)(pe,{...t,className:k(pU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,bE.jsx)("button",{...a,"aria-pressed":t,className:k(ife[r],t?Afe[r]:sfe[r],e),type:n})}var ife={pill:"cursor-pointer rounded border px-2 py-1 font-mono text-xs font-semibold uppercase leading-tight transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",segment:"h-7 min-w-10 cursor-pointer rounded border px-2 font-mono text-xs transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",text:"cursor-pointer border-0 bg-transparent px-1.5 py-1 font-mono uppercase tracking-normal underline-offset-4 transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55"},Afe={pill:"border-dashboard-border-heavy bg-dashboard-text-solid text-dashboard-text-inverse",segment:"border-amber-500/30 bg-amber-500/20 text-amber-400",text:"text-dashboard-text underline decoration-dashboard-text-solid"},sfe={pill:"border-dashboard-border-strong bg-dashboard-surface-raised text-dashboard-text-muted hover:border-dashboard-border-interactive hover:bg-dashboard-surface-hover hover:text-dashboard-text",segment:"border-dashboard-border-strong bg-dashboard-fill-faint text-dashboard-text-muted hover:bg-dashboard-fill-strong hover:text-dashboard-text",text:"text-dashboard-text-muted hover:text-dashboard-text"};var w4=C(w(),1),cfe=[1,7,30,90];function E4(e){return e===1?"24h":`${e}d`}function Up(e){return e===1?"last 24 hours":`last ${e} days`}function Cn(e){return e===1?"hour":e===7?"6hour":"day"}function mU(e){return e===1}function ufe(e){return e===7}function Va(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function hE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Xf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function Dn(e){return mU(e.range)&&e.hours?.length?e.hours.slice(-24):mU(e.range)?e.days.slice(-1):ufe(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?dfe({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function dfe(e){let t=new Map;for(let n of e.hours){let r=Date.parse(`${n.date}:00:00.000Z`);if(Number.isNaN(r))continue;let a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=a.toISOString().slice(0,13),A={...t.get(o)??e.empty(o),date:o};for(let[s,u]of Object.entries(n))if(s!=="date"&&typeof u=="number"){let d=A[s];A[s]=(typeof d=="number"?d:0)+u}t.set(o,A)}if(e.hours.length>=24){let n=e.hours[e.hours.length-1]?.date,r=n?Date.parse(`${n}:00:00.000Z`):Date.now(),a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=new Date(a.getTime()-9720*60*1e3),i=[];for(let A=new Date(o);A.getTime()<=a.getTime();A.setTime(A.getTime()+360*60*1e3)){let s=A.toISOString().slice(0,13);i.push(t.get(s)??e.empty(s))}return i}return[...t.values()].sort((n,r)=>n.date.localeCompare(r.date))}function BE(e){return(0,w4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??cfe).map(t=>(0,w4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:E4(t)},t))})}var Nc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Nc.jsx)(BE,{onChange:e.onRangeChange,...e.rangeOptions?{options:e.rangeOptions}:{},value:e.range}):void 0,n=e.actions??t;return(0,Nc.jsxs)("header",{className:"flex min-w-0 items-center justify-between gap-6 border-b border-white/[0.05] pb-4 sm:pb-6 max-md:flex-col max-md:items-stretch",children:[(0,Nc.jsxs)("div",{className:"min-w-0",children:[(0,Nc.jsx)("h2",{className:"m-0 font-display text-3xl font-light leading-none tracking-[-0.03em] text-dashboard-text sm:text-4xl",children:e.title}),(0,Nc.jsx)("div",{className:"mt-2 max-w-2xl font-mono text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",children:e.description})]}),n?(0,Nc.jsx)("div",{className:"shrink-0",children:n}):null]})}var fU=C(w(),1);function Oo(e){return(0,fU.jsx)("div",{className:k(yn,"grid min-w-0 content-start gap-4 px-4 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:gap-6 sm:px-8 sm:py-8 sm:pb-8",e.className),children:e.children})}var eb=C(w(),1);function Ad(e){return(0,eb.jsxs)(Oo,{children:[(0,eb.jsx)(He,{description:e.description,title:e.title}),(0,eb.jsx)(Na,{label:e.label,variant:e.variant})]})}var wE=C(q(),1);var yE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var bU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var hU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var k4=e=>{let t=hU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var tb=C(q(),1);var CE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var BU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Op=C(q(),1);var lfe=(0,Op.createContext)({});var yU=()=>(0,Op.useContext)(lfe);var CU=(0,tb.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...A},s)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:l=!1,color:g="currentColor",className:p=""}=yU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,tb.createElement)("svg",{ref:s,...CE,width:t??u??CE.width,height:t??u??CE.height,stroke:e??g,strokeWidth:m,className:yE("lucide",p,a),...!o&&!BU(A)&&{"aria-hidden":"true"},...A},[...i.map(([b,B])=>(0,tb.createElement)(b,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,wE.forwardRef)(({className:r,...a},o)=>(0,wE.createElement)(CU,{ref:o,iconNode:t,className:yE(`lucide-${bU(k4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=k4(e),n};var pfe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],ki=F("activity",pfe);var gfe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],qo=F("archive-restore",gfe);var mfe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Cs=F("archive",mfe);var ffe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],nb=F("arrow-down-to-line",ffe);var bfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",bfe);var hfe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ab=F("arrow-right",hfe);var Bfe=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],rb=F("bookmark",Bfe);var yfe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],yA=F("bot",yfe);var Cfe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],ho=F("boxes",Cfe);var wfe=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],CA=F("braces",wfe);var Efe=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Rc=F("brain-circuit",Efe);var kfe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ws=F("brain",kfe);var Qfe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Es=F("calendar-clock",Qfe);var Ife=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ob=F("calendar",Ife);var vfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sd=F("check",vfe);var _fe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ib=F("chevron-down",_fe);var xfe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ab=F("chevron-left",xfe);var Dfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",Dfe);var Ffe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ra=F("circle-alert",Ffe);var Sfe=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],sb=F("circle-dashed",Sfe);var Lfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],cd=F("circle-dollar-sign",Lfe);var Nfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],cb=F("circle-dot",Nfe);var Rfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],$c=F("circle-x",Rfe);var $fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Qi=F("clock-3",$fe);var Mfe=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],Ii=F("coins",Mfe);var jfe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ud=F("copy",jfe);var Pfe=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Mc=F("database",Pfe);var Tfe=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mr=F("earth",Tfe);var Hfe=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],jc=F("ellipsis",Hfe);var Gfe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],dd=F("external-link",Gfe);var Ufe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ub=F("file-text",Ufe);var Ofe=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Pc=F("fingerprint-pattern",Ofe);var qfe=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],db=F("folder-git-2",qfe);var zfe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],lb=F("gauge",zfe);var Kfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],pb=F("git-merge",Kfe);var Yfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ks=F("git-pull-request",Yfe);var Jfe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],gb=F("hash",Jfe);var Wfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tc=F("info",Wfe);var Zfe=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],vi=F("key-round",Zfe);var Vfe=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Hc=F("layers",Vfe);var Xfe=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],ld=F("library-big",Xfe);var ebe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],mb=F("lightbulb",ebe);var tbe=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],fb=F("list-checks",tbe);var nbe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],bb=F("link",nbe);var abe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",abe);var rbe=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],fr=F("lock-keyhole",rbe);var obe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],hb=F("lock",obe);var ibe=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Bb=F("log-out",ibe);var Abe=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],pd=F("map-pin",Abe);var sbe=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],yb=F("map-pinned",sbe);var cbe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],gd=F("menu",cbe);var ube=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],Cb=F("message-square-text",ube);var dbe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Bo=F("message-square",dbe);var lbe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],qp=F("messages-square",lbe);var pbe=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],wb=F("minimize-2",pbe);var gbe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Eb=F("paperclip",gbe);var mbe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],md=F("plus",mbe);var fbe=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],kb=F("radio-tower",fbe);var bbe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],zp=F("scroll-text",bbe);var hbe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gc=F("search",hbe);var Bbe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fd=F("send",Bbe);var ybe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qb=F("settings",ybe);var Cbe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Ib=F("sigma",Cbe);var wbe=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],vb=F("skip-forward",wbe);var Ebe=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Xa=F("sparkles",Ebe);var kbe=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qr=F("square-pen",kbe);var Qbe=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],_i=F("timer",Qbe);var Ibe=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ba=F("trash-2",Ibe);var vbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],_b=F("trending-up",vbe);var _be=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zr=F("triangle-alert",_be);var xbe=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],br=F("user-round",xbe);var Dbe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bd=F("users",Dbe);var Fbe=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],xb=F("webhook",Fbe);var Sbe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=F("x",Sbe);var Lbe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Db=F("zap",Lbe);var MA=C(q(),1);var Q4=Object.defineProperty,Nbe=Object.getOwnPropertyDescriptor,Rbe=Object.getOwnPropertyNames,$be=Object.prototype.hasOwnProperty,EU=(e,t)=>{let n={};for(var r in e)Q4(n,r,{get:e[r],enumerable:!0});return t||Q4(n,Symbol.toStringTag,{value:"Module"}),n},wU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Rbe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!$be.call(e,A)&&A!==n&&Q4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=Nbe(t,A))||r.enumerable});return e},kU=(e,t,n)=>(wU(e,t,"default"),n&&wU(n,t,"default"));var x4={};L(x4,{createOnigurumaEngine:()=>Xbe,getDefaultWasmLoader:()=>Vbe,loadWasm:()=>IU,setDefaultWasmLoader:()=>Zbe});var _4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Mbe(){return 2147483648}function jbe(){return typeof performance<"u"?performance.now():Date.now()}var Pbe=(e,t)=>e+(t-e%t)%t;async function Tbe(e){let t,n,r={};function a(p){n=p,r.HEAPU8=new Uint8Array(p),r.HEAPU32=new Uint32Array(p)}function o(p,m,b){r.HEAPU8.copyWithin(p,m,m+b)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(p){let m=r.HEAPU8.length;p=p>>>0;let b=Mbe();if(p>b)return!1;for(let B=1;B<=4;B*=2){let h=m*(1+.2/B);h=Math.min(h,p+100663296);let f=Math.min(b,Pbe(Math.max(p,h),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(p,m,b=1024){let B=m+b,h=m;for(;p[h]&&!(h>=B);)++h;if(h-m>16&&p.buffer&&s)return s.decode(p.subarray(m,h));let f="";for(;m<h;){let y=p[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=p[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let Q=p[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|Q:y=(y&7)<<18|E<<12|Q<<6|p[m++]&63,y<65536)f+=String.fromCharCode(y);else{let I=y-65536;f+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return f}function d(p,m){return p?u(r.HEAPU8,p,m):""}let l={emscripten_get_now:jbe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function g(){let m=await e({env:l,wasi_snapshot_preview1:l});t=m.memory,a(t.buffer),Object.assign(r,m),r.UTF8ToString=d}return await g(),r}var Hbe=Object.defineProperty,Gbe=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>Gbe(e,typeof t!="symbol"?t+"":t,n),ya=null;function Ube(e){throw new _4(e.UTF8ToString(e.getLastOnigError()))}var kE=class e{constructor(t){ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16Value"),ra(this,"utf8Value"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16");let n=t.length,r=e._utf8ByteLength(t),a=r!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=r);let i=a?new Uint32Array(r+1):null;a&&(i[r]=n);let A=new Uint8Array(r),s=0;for(let u=0;u<n;u++){let d=t.charCodeAt(u),l=d,g=!1;if(d>=55296&&d<=56319&&u+1<n){let p=t.charCodeAt(u+1);p>=56320&&p<=57343&&(l=(d-55296<<10)+65536|p-56320,g=!0)}a&&(o[u]=s,g&&(o[u+1]=s),l<=127?i[s+0]=u:l<=2047?(i[s+0]=u,i[s+1]=u):l<=65535?(i[s+0]=u,i[s+1]=u,i[s+2]=u):(i[s+0]=u,i[s+1]=u,i[s+2]=u,i[s+3]=u)),l<=127?A[s++]=l:l<=2047?(A[s++]=192|(l&1984)>>>6,A[s++]=128|(l&63)>>>0):l<=65535?(A[s++]=224|(l&61440)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0):(A[s++]=240|(l&1835008)>>>18,A[s++]=128|(l&258048)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0),g&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=A,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){let o=t.charCodeAt(r),i=o,A=!1;if(o>=55296&&o<=56319&&r+1<a){let s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(i=(o-55296<<10)+65536|s-56320,A=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,A&&r++}return n}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},QE=class wA{constructor(t){if(ra(this,"id",++wA.LAST_ID),ra(this,"_onigBinding"),ra(this,"content"),ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16"),ra(this,"ptr"),!ya)throw new _4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new kE(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!wA._sharedPtrInUse?(wA._sharedPtr||(wA._sharedPtr=ya.omalloc(1e4)),wA._sharedPtrInUse=!0,ya.HEAPU8.set(n.utf8Value,wA._sharedPtr),this.ptr=wA._sharedPtr):this.ptr=n.createString(ya)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wA._sharedPtr?wA._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ra(QE,"LAST_ID",0);ra(QE,"_sharedPtr",0);ra(QE,"_sharedPtrInUse",!1);var QU=QE,v4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new _4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new kE(t[A]);n[A]=u.createString(ya),r[A]=u.utf8Length}let a=ya.omalloc(4*t.length);ya.HEAPU32.set(n,a/4);let o=ya.omalloc(4*t.length);ya.HEAPU32.set(r,o/4);let i=ya.createOnigScanner(a,o,t.length);for(let A=0,s=t.length;A<s;A++)ya.ofree(n[A]);ya.ofree(o),ya.ofree(a),i===0&&Ube(ya),this._onigBinding=ya,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new QU(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){let o=this._onigBinding,i=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(i===0)return null;let A=o.HEAPU32,s=i/4,u=A[s++],d=A[s++],l=[];for(let g=0;g<d;g++){let p=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[g]={start:p,end:m,length:m-p}}return{index:u,captureIndices:l}}};function Obe(e){return typeof e.instantiator=="function"}function qbe(e){return typeof e.default=="function"}function zbe(e){return typeof e.data<"u"}function Kbe(e){return typeof Response<"u"&&e instanceof Response}function Ybe(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}var EE;function IU(e){if(EE)return EE;async function t(){ya=await Tbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Obe(r)?r=await r.instantiator(n):qbe(r)?r=await r.default(n):(zbe(r)&&(r=r.data),Kbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Jbe(r)(n):r=await Wbe(r)(n):Ybe(r)?r=await I4(r)(n):r instanceof WebAssembly.Module?r=await I4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await I4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return EE=t(),EE}function I4(e){return t=>WebAssembly.instantiate(e,t)}function Jbe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Wbe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var vU;function Zbe(e){vU=e}function Vbe(){return vU}async function Xbe(e){return e&&await IU(e),{createScanner(t){return new v4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new QU(t)}}}var D4=EU({});kU(D4,x4);var Wq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(qq(),Oq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Kq(),zq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(Jq(),Yq)))}],Zq=Object.fromEntries(Wq.map(e=>[e.id,e.import]));var Et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function dBe(e){return T4(e)}function T4(e){return Array.isArray(e)?lBe(e):e instanceof RegExp?e:typeof e=="object"?pBe(e):e}function lBe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=T4(e[n]);return t}function pBe(e){let t={};for(let n in e)t[n]=T4(e[n]);return t}function iz(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Az(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Az(e.substring(0,e.length-1)):e.substr(~t+1)}var F4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,IE=class{static hasCaptures(e){return e===null?!1:(F4.lastIndex=0,F4.test(e))}static replaceCaptures(e,t,n){return e.replace(F4,(r,a,o,i)=>{let A=n[parseInt(a||o,10)];if(A){let s=t.substring(A.start,A.end);for(;s[0]===".";)s=s.substring(1);switch(i){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return r})}};function sz(e,t){return e<t?-1:e>t?1:0}function cz(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let o=sz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function Vq(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function uz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var dz=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Lb=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(fBe(e),t)}static createFromParsedTheme(e,t){return hBe(e,t)}_cachedMatchRoot=new dz(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>gBe(e.parent,a.parentScopes));return r?new lz(r.fontStyle,r.foreground,r.background):null}},S4=class vE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new vE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new vE(n,t[r]);return n}push(t){return new vE(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function gBe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!mBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function mBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function fBe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,o=t.length;a<o;a++){let i=t[a];if(!i.settings)continue;let A;if(typeof i.scope=="string"){let l=i.scope;l=l.replace(/^[,]+/,""),l=l.replace(/[,]+$/,""),A=l.split(",")}else Array.isArray(i.scope)?A=i.scope:A=[""];let s=-1;if(typeof i.settings.fontStyle=="string"){s=0;let l=i.settings.fontStyle.split(" ");for(let g=0,p=l.length;g<p;g++)switch(l[g]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof i.settings.foreground=="string"&&Vq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Vq(i.settings.background)&&(d=i.settings.background);for(let l=0,g=A.length;l<g;l++){let m=A[l].trim().split(" "),b=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new bBe(b,B,a,s,u,d)}}return n}var bBe=class{constructor(e,t,n,r,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=o}},$a=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($a||{});function hBe(e,t){e.sort((s,u)=>{let d=sz(s.scope,u.scope);return d!==0||(d=cz(s.parentScopes,u.parentScopes),d!==0)?d:s.index-u.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(r=s.foreground),s.background!==null&&(a=s.background)}let o=new BBe(t),i=new lz(n,o.getId(r),o.getId(a)),A=new CBe(new N4(0,null,-1,0,0),[]);for(let s=0,u=e.length;s<u;s++){let d=e[s];A.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new Lb(o,i,A)}var BBe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},yBe=Object.freeze([]),N4=class pz{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||yBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new pz(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},CBe=class R4{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[r].length;if(o!==0)return o;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,o;if(r===-1?(a=t,o=""):(a=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(R4._cmpBySpecificity),n}insert(t,n,r,a,o,i){if(n===""){this._doInsertHere(t,r,a,o,i);return}let A=n.indexOf("."),s,u;A===-1?(s=n,u=""):(s=n.substring(0,A),u=n.substring(A+1));let d;this._children.hasOwnProperty(s)?d=this._children[s]:(d=new R4(this._mainRule.clone(),N4.cloneArr(this._rulesWithParentScopes)),this._children[s]=d),d.insert(t+1,u,r,a,o,i)}_doInsertHere(t,n,r,a,o){if(n===null){this._mainRule.acceptOverwrite(t,r,a,o);return}for(let i=0,A=this._rulesWithParentScopes.length;i<A;i++){let s=this._rulesWithParentScopes[i];if(cz(s.parentScopes,n)===0){s.acceptOverwrite(t,r,a,o);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new N4(t,n,r,a,o))}},Bd=class zo{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=zo.getLanguageId(t),r=zo.getTokenType(t),a=zo.getFontStyle(t),o=zo.getForeground(t),i=zo.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:o,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,a,o,i,A){let s=zo.getLanguageId(t),u=zo.getTokenType(t),d=zo.containsBalancedBrackets(t)?1:0,l=zo.getFontStyle(t),g=zo.getForeground(t),p=zo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(g=i),A!==0&&(p=A),(s<<0|u<<8|d<<10|l<<11|g<<15|p<<24)>>>0}};function xE(e,t){let n=[],r=wBe(e),a=r.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let u=i();if(n.push({matcher:u,priority:s}),a!==",")break;a=r.next()}return n;function o(){if(a==="-"){a=r.next();let s=o();return u=>!!s&&!s(u)}if(a==="("){a=r.next();let s=A();return a===")"&&(a=r.next()),s}if(Xq(a)){let s=[];do s.push(a),a=r.next();while(Xq(a));return u=>t(s,u)}return null}function i(){let s=[],u=o();for(;u;)s.push(u),u=o();return d=>s.every(l=>l(d))}function A(){let s=[],u=i();for(;u&&(s.push(u),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");u=i()}return d=>s.some(l=>l(d))}}function Xq(e){return!!e&&!!e.match(/[\w\.:]+/)}function wBe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function gz(e){typeof e.dispose=="function"&&e.dispose()}var Nb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},EBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},kBe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},QBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Nb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new kBe;for(let n of e)IBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Nb){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function IBe(e,t,n,r){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof Nb?_E({baseGrammar:o,selfGrammar:a},r):$4(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},r);let i=n.injections(e.scopeName);if(i)for(let A of i)r.add(new Nb(A))}function $4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];DE([r],t,n)}}function _E(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&DE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&DE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function DE(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?iz({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&DE(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=mz(o);switch(i.kind){case 0:_E({...t,selfGrammar:t.baseGrammar},n);break;case 1:_E(t,n);break;case 2:$4(i.ruleName,{...t,repository:a},n);break;case 3:case 4:let A=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(A){let s={baseGrammar:t.baseGrammar,selfGrammar:A,repository:a};i.kind===4?$4(i.ruleName,s,n):_E(s,n)}else i.kind===4?n.add(new EBe(i.scopeName,i.ruleName)):n.add(new Nb(i.scopeName));break}}}var vBe=class{kind=0},_Be=class{kind=1},xBe=class{constructor(e){this.ruleName=e}kind=2},DBe=class{constructor(e){this.scopeName=e}kind=3},FBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function mz(e){if(e==="$base")return new vBe;if(e==="$self")return new _Be;let t=e.indexOf("#");if(t===-1)return new DBe(e);if(t===0)return new xBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new FBe(n,r)}}var SBe=/\\(\d+)/,ez=/\\(\d+)/g;var LBe=-1,fz=-2;var Mb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=IE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=IE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Az(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:IE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:IE.replaceCaptures(this._contentName,e,t)}},NBe=class extends Mb{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},RBe=class extends Mb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Rb(r,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new $b,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tz=class extends Mb{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new $b,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},M4=class extends Mb{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,o,i,A,s,u){super(e,t,n,r),this._begin=new Rb(a,this.id),this.beginCaptures=o,this._end=new Rb(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=A,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new $b;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},FE=class extends Mb{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,o,i,A,s){super(e,t,n,r),this._begin=new Rb(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Rb(i,fz),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new $b;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new $b,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},bz=class tr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new NBe(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new RBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,tr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=iz({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new tz(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,tr._compilePatterns(o,n,r))}return t.while?new FE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,tr._compileCaptures(t.whileCaptures||t.captures,n,r),tr._compilePatterns(t.patterns,n,r)):new M4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,tr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,tr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let o=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10);A>o&&(o=A)}for(let i=0;i<=o;i++)a[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10),s=0;t[i].patterns&&(s=tr.getCompiledRuleId(t[i],n,r)),a[A]=tr.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,s)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let o=0,i=t.length;o<i;o++){let A=t[o],s=-1;if(A.include){let u=mz(A.include);switch(u.kind){case 0:case 1:s=tr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=tr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,g=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(l,r);if(p)if(g){let m=p.repository[g];m&&(s=tr.getCompiledRuleId(m,n,p.repository))}else s=tr.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=tr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof tz||u instanceof M4||u instanceof FE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Rb=class hz{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,a=0,o=[],i=!1;for(let A=0;A<r;A++)if(t.charAt(A)==="\\"&&A+1<r){let u=t.charAt(A+1);u==="z"?(o.push(t.substring(a,A)),o.push("$(?!\\n)(?<!\\n)"),a=A+2):(u==="A"||u==="G")&&(i=!0),A++}this.hasAnchor=i,a===0?this.source=t:(o.push(t.substring(a,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=SBe.test(this.source):this.hasBackReferences=!1}clone(){return new hz(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(a=>t.substring(a.start,a.end));return ez.lastIndex=0,this.source.replace(ez,(a,o)=>uz(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],a=[],o,i,A,s;for(o=0,i=this.source.length;o<i;o++)A=this.source.charAt(o),t[o]=A,n[o]=A,r[o]=A,a[o]=A,A==="\\"&&o+1<i&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",r[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",r[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,r[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},$b=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new nz(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(a=>a.resolveAnchors(t,n));return new nz(e,r,this._items.map(a=>a.ruleId))}},nz=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
68
68
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},L4=class{constructor(e,t){this.languageId=e,this.tokenType=t}},$Be=class j4{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new L4(t,8),this._embeddedLanguagesMatcher=new MBe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?j4._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new L4(0,0);_getBasicScopeAttributes=new dz(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new L4(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(j4.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},MBe=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,r])=>uz(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},gHe={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},Bz=!1,az=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function yz(e,t,n,r,a,o,i,A){let s=t.content.length,u=!1,d=-1;if(i){let p=jBe(e,t,n,r,a,o);a=p.stack,r=p.linePos,n=p.isFirstLine,d=p.anchorPosition}let l=Date.now();for(;!u;){if(A!==0&&Date.now()-l>A)return new az(a,!0);g()}return new az(a,!1);function g(){let p=PBe(e,t,n,r,a,d);if(!p){o.produce(a,s),u=!0;return}let m=p.captureIndices,b=p.matchedRuleId,B=m&&m.length>0?m[0].end>r:!1;if(b===LBe){let h=a.getRule(e);o.produce(a,m[0].start),a=a.withContentNameScopesList(a.nameScopesList),Fb(e,t,n,a,o,h.endCaptures,m),o.produce(a,m[0].end);let f=a;if(a=a.parent,d=f.getAnchorPos(),!B&&f.getEnterPos()===r){a=f,o.produce(a,s),u=!0;return}}else{let h=e.getRule(b);o.produce(a,m[0].start);let f=a,y=h.getName(t.content,m),E=a.contentNameScopesList.pushAttributed(y,e);if(a=a.push(b,r,d,m[0].end===s,null,E,E),h instanceof M4){let Q=h;Fb(e,t,n,a,o,Q.beginCaptures,m),o.produce(a,m[0].end),d=m[0].end;let I=Q.getContentName(t.content,m),v=E.pushAttributed(I,e);if(a=a.withContentNameScopesList(v),Q.endHasBackReferences&&(a=a.withEndRule(Q.getEndWithResolvedBackReferences(t.content,m))),!B&&f.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),u=!0;return}}else if(h instanceof FE){let Q=h;Fb(e,t,n,a,o,Q.beginCaptures,m),o.produce(a,m[0].end),d=m[0].end;let I=Q.getContentName(t.content,m),v=E.pushAttributed(I,e);if(a=a.withContentNameScopesList(v),Q.whileHasBackReferences&&(a=a.withEndRule(Q.getWhileWithResolvedBackReferences(t.content,m))),!B&&f.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),u=!0;return}}else if(Fb(e,t,n,a,o,h.captures,m),o.produce(a,m[0].end),a=a.pop(),!B){a=a.safePop(),o.produce(a,s),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function jBe(e,t,n,r,a,o){let i=a.beginRuleCapturedEOL?0:-1,A=[];for(let s=a;s;s=s.pop()){let u=s.getRule(e);u instanceof FE&&A.push({rule:u,stack:s})}for(let s=A.pop();s;s=A.pop()){let{ruleScanner:u,findOptions:d}=GBe(s.rule,e,s.stack.endRule,n,r===i),l=u.findNextMatchSync(t,r,d);if(l){if(l.ruleId!==fz){a=s.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(o.produce(s.stack,l.captureIndices[0].start),Fb(e,t,n,s.stack,o,s.rule.whileCaptures,l.captureIndices),o.produce(s.stack,l.captureIndices[0].end),i=l.captureIndices[0].end,l.captureIndices[0].end>r&&(r=l.captureIndices[0].end,n=!1))}else{a=s.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:i,isFirstLine:n}}function PBe(e,t,n,r,a,o){let i=TBe(e,t,n,r,a,o),A=e.getInjections();if(A.length===0)return i;let s=HBe(A,e,t,n,r,a,o);if(!s)return i;if(!i)return s;let u=i.captureIndices[0].start,d=s.captureIndices[0].start;return d<u||s.priorityMatch&&d===u?s:i}function TBe(e,t,n,r,a,o){let i=a.getRule(e),{ruleScanner:A,findOptions:s}=Cz(i,e,a.endRule,n,r===o),u=A.findNextMatchSync(t,r,s);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function HBe(e,t,n,r,a,o,i){let A=Number.MAX_VALUE,s=null,u,d=0,l=o.contentNameScopesList.getScopeNames();for(let g=0,p=e.length;g<p;g++){let m=e[g];if(!m.matcher(l))continue;let b=t.getRule(m.ruleId),{ruleScanner:B,findOptions:h}=Cz(b,t,null,r,a===i),f=B.findNextMatchSync(n,a,h);if(!f)continue;let y=f.captureIndices[0].start;if(!(y>=A)&&(A=y,s=f.captureIndices,u=f.ruleId,d=m.priority,A===a))break}return s?{priorityMatch:d===-1,captureIndices:s,matchedRuleId:u}:null}function Cz(e,t,n,r,a){if(Bz){let i=e.compile(t,n),A=wz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function GBe(e,t,n,r,a){if(Bz){let i=e.compileWhile(t,n),A=wz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function wz(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Fb(e,t,n,r,a,o,i){if(o.length===0)return;let A=t.content,s=Math.min(o.length,i.length),u=[],d=i[0].end;for(let l=0;l<s;l++){let g=o[l];if(g===null)continue;let p=i[l];if(p.length===0)continue;if(p.start>d)break;for(;u.length>0&&u[u.length-1].endPos<=p.start;)a.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?a.produceFromScopes(u[u.length-1].scopes,p.start):a.produce(r,p.start),g.retokenizeCapturedWithRuleId){let b=g.getName(A,i),B=r.contentNameScopesList.pushAttributed(b,e),h=g.getContentName(A,i),f=B.pushAttributed(h,e),y=r.push(g.retokenizeCapturedWithRuleId,p.start,-1,!1,null,B,f),E=e.createOnigString(A.substring(0,p.end));yz(e,E,n&&p.start===0,p.start,y,a,!1,0),gz(E);continue}let m=g.getName(A,i);if(m!==null){let B=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new UBe(B,p.end))}}for(;u.length>0;)a.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var UBe=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function OBe(e,t,n,r,a,o,i,A){return new zBe(e,t,n,r,a,o,i,A)}function rz(e,t,n,r,a){let o=xE(t,SE),i=bz.getCompiledRuleId(n,r,a.repository);for(let A of o)e.push({debugSelector:t,matcher:A.matcher,ruleId:i,grammar:a,priority:A.priority})}function SE(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let a=n;a<t.length;a++)if(qBe(t[a],r))return n=a+1,!0;return!1})}function qBe(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var zBe=class{constructor(e,t,n,r,a,o,i,A){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=A,this._basicScopeAttributesProvider=new $Be(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=oz(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(let s of Object.keys(a)){let u=xE(s,SE);for(let d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:a[s]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let a=r.injections;if(a)for(let i in a)rz(t,i,a[i],this,r);let o=this._grammarRepository.injections(n);o&&o.forEach(i=>{let A=this.getExternalGrammar(i);if(A){let s=A.injectionSelector;s&&rz(t,s,A,this,A)}})}return t.sort((a,o)=>a.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=oz(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=bz.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===P4.NULL){a=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),l=Bd.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),g=this.getRule(this._rootId).getName(null,null),p;g?p=Sb.createRootAndLookUpScopeName(g,l,this):p=Sb.createRoot("unknown",l),t=new P4(null,this._rootId,-1,-1,!1,null,p,p)}else a=!1,t.reset();e=e+`
69
69
  `;let o=this.createOnigString(e),i=o.content.length,A=new YBe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),s=yz(this,o,a,0,t,A,!0,r);return gz(o),{lineLength:i,lineTokens:A,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function oz(e,t){return e=dBe(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Sb=class EA{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,a=t?.scopePath??null;for(let o of n)a=S4.push(a,o.scopeNames),r=new EA(r,a,o.encodedTokenAttributes);return r}static createRoot(t,n){return new EA(null,new S4(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let a=r.getMetadataForScope(t),o=new S4(null,t),i=r.themeProvider.themeMatch(o),A=EA.mergeAttributes(n,a,i);return new EA(null,o,A)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return EA.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let a=-1,o=0,i=0;return r!==null&&(a=r.fontStyle,o=r.foregroundId,i=r.backgroundId),Bd.set(t,n.languageId,n.tokenType,null,a,o,i)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return EA._pushAttributed(this,t,n);let r=t.split(/ /g),a=this;for(let o of r)a=EA._pushAttributed(a,o,n);return a}static _pushAttributed(t,n,r){let a=r.getMetadataForScope(n),o=t.scopePath.push(n),i=r.themeProvider.themeMatch(o),A=EA.mergeAttributes(t.tokenAttributes,a,i);return new EA(t,o,A)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},P4=class hd{constructor(t,n,r,a,o,i,A,s){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=A,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new hd(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:hd._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Sb.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){hd._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,o,i,A){return new hd(this,t,n,r,a,o,i,A)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new hd(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Sb.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new hd(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Sb.fromExtension(r,n.contentNameScopesList))}},KBe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):xE(n,SE).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>xE(n,SE).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},YBe=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let o=e?.getScopeNames()??[];for(let i of this._tokenTypeOverrides)i.matcher(o)&&(r=Bd.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(o))}if(a&&(r=Bd.set(r,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,a=this._binaryTokens.length;r<a;r++)n[r]=this._binaryTokens[r];return n}},JBe=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,a){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,OBe(e,o,t,n,r,a,this,this._onigLib))}return this._grammars.get(e)}},Ez=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new JBe(Lb.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Lb.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new KBe(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,a){let o=new QBe(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(i=>this._loadSingleGrammar(i.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,r,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,a=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,a)}},LE=P4.NULL;function Pb(e,t){let n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(let[a,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[a]=o:a===r&&Object.assign(n,o);return n}function Is(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _z(e){return Array.isArray(e)?e:[e]}async function H4(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Tb(e){return!e||["plaintext","txt","text","plain"].includes(e)}function G4(e){return e==="ansi"||Tb(e)}function Hb(e){return e==="none"}function U4(e){return Hb(e)}var WBe=/(\r?\n)/g;function Kp(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(WBe),r=0,a=[];for(let o=0;o<n.length;o+=2){let i=t?n[o]+(n[o+1]||""):n[o];a.push([i,r]),r+=n[o].length,r+=n[o+1]?.length||0}return a}var kz={light:"#333333",dark:"#bbbbbb"},Qz={light:"#fffffe",dark:"#1e1e1e"},Iz="__shiki_resolved";function NE(e){if(e?.[Iz])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let A=t.settings?t.settings.find(s=>!s.name&&!s.scope):void 0;A?.settings?.foreground&&(r=A.settings.foreground),A?.settings?.background&&(n=A.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?kz.light:kz.dark),n||(n=t.type==="light"?Qz.light:Qz.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let a=0,o=new Map;function i(A){if(o.has(A))return o.get(A);a+=1;let s=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${s}`]?i(A):(o.set(A,s),s)}t.settings=t.settings.map(A=>{let s=A.settings?.foreground&&!A.settings.foreground.startsWith("#"),u=A.settings?.background&&!A.settings.background.startsWith("#");if(!s&&!u)return A;let d={...A,settings:{...A.settings}};if(s){let l=i(A.settings.foreground);t.colorReplacements[l]=A.settings.foreground,d.settings.foreground=l}if(u){let l=i(A.settings.background);t.colorReplacements[l]=A.settings.background,d.settings.background=l}return d});for(let A of Object.keys(t.colors||{}))if((A==="editor.foreground"||A==="editor.background"||A.startsWith("terminal.ansi"))&&!t.colors[A]?.startsWith("#")){let s=i(t.colors[A]);t.colorReplacements[s]=t.colors[A],t.colors[A]=s}return Object.defineProperty(t,Iz,{enumerable:!1,writable:!1,value:!0}),t}async function xz(e){return[...new Set((await Promise.all(e.filter(t=>!G4(t)).map(async t=>await H4(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Dz(e){return(await Promise.all(e.map(async t=>U4(t)?null:NE(await H4(t))))).filter(t=>!!t)}function Fz(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Et(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var ZBe=class extends Ez{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=NE(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Lb.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Fz(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(let a of t)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let r of e)this.resolveEmbeddedLanguages(r);let t=[...this._langGraph.entries()],n=t.filter(([r,a])=>!a);if(n.length){let r=t.filter(([a,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(i=>n.map(([A])=>A).includes(i)):!1).filter(a=>!n.includes(a));throw new Et(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${r.map(([a])=>`\`${a}\``).join(", ")}`)}for(let[r,a]of t)this._resolver.addLanguage(a);for(let[r,a]of t)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let n of t)this._langGraph.set(n,this._langMap.get(n))}},VBe=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let r=1;r<=t.length;r++){let a=t.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}},jb=0;function O4(e){jb+=1,e.warnings!==!1&&jb>=10&&jb%10===0&&console.warn(`[Shiki] ${jb} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Et("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(NE),a=new ZBe(new VBe(e.engine,n),r,n,e.langAlias),o;function i(f){return Fz(f,e.langAlias)}function A(f){B();let y=a.getGrammar(typeof f=="string"?f:f.name);if(!y)throw new Et(`Language \`${f}\` not found, you may need to load it first`);return y}function s(f){if(f==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let y=a.getTheme(f);if(!y)throw new Et(`Theme \`${f}\` not found, you may need to load it first`);return y}function u(f){B();let y=s(f);return o!==f&&(a.setTheme(y),o=f),{theme:y,colorMap:a.getColorMap()}}function d(){return B(),a.getLoadedThemes()}function l(){return B(),a.getLoadedLanguages()}function g(...f){B(),a.loadLanguages(f.flat(1))}async function p(...f){return g(await xz(f))}function m(...f){B();for(let y of f.flat(1))a.loadTheme(y)}async function b(...f){return B(),m(await Dz(f))}function B(){if(t)throw new Et("Shiki instance has been disposed")}function h(){t||(t=!0,a.dispose(),jb-=1)}return{setTheme:u,getTheme:s,getLanguage:A,getLoadedThemes:d,getLoadedLanguages:l,resolveLangAlias:i,loadLanguage:p,loadLanguageSync:g,loadTheme:b,loadThemeSync:m,dispose:h,[Symbol.dispose]:h}}async function q4(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Dz(e.themes||[]),xz(e.langs||[]),e.engine]);return O4({...e,themes:t,langs:n,engine:r})}var Sz=new WeakMap;function Gb(e,t){Sz.set(e,t)}function Yp(e){return Sz.get(e)}var RE=class Lz{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Lz(Object.fromEntries(_z(n).map(r=>[r,LE])),t)}constructor(...t){if(t.length===2){let[n,r]=t;this.lang=r,this._stacks=n}else{let[n,r,a]=t;this.lang=r,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return XBe(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function XBe(e){let t=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);let o=a?.nameScopesList?.scopeName;o&&t.push(o),a.parent&&r(a.parent)}return r(e),t}function eye(e,t){if(!(e instanceof RE))throw new Et("Invalid grammar state");return e.getInternalStack(t)}var tye=/,/,nye=/ /;function z4(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Tb(e.resolveLangAlias(n.lang||"text"))||Hb(r))return Kp(t).map(A=>[{content:A[0],offset:A[1]}]);let{theme:a,colorMap:o}=e.setTheme(r),i=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new Et(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Et(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Rz(t,i,a,o,n)}function Nz(...e){if(e.length===2)return Yp(e[1]);let[t,n,r={}]=e,{lang:a="text",theme:o=t.getLoadedThemes()[0]}=r;if(Tb(a)||Hb(o))throw new Et("Plain language does not have grammar state");if(a==="ansi")throw new Et("ANSI language does not have grammar state");let{theme:i,colorMap:A}=t.setTheme(o),s=t.getLanguage(a);return new RE(K4(n,s,i,A,r).stateStack,s.name,i.name)}function Rz(e,t,n,r,a){let o=K4(e,t,n,r,a),i=new RE(o.stateStack,t.name,n.name);return Gb(o.tokens,i),o.tokens}function K4(e,t,n,r,a){let o=Pb(n,a),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:A=500}=a,s=Kp(e),u=a.grammarState?eye(a.grammarState,n.name)??LE:a.grammarContextCode!=null?K4(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:LE,d=[],l=[];for(let g=0,p=s.length;g<p;g++){let[m,b]=s[g];if(m===""){d=[],l.push([]);continue}if(i>0&&m.length>=i){d=[],l.push([{content:m,offset:b,color:"",fontStyle:0}]);continue}let B,h,f;a.includeExplanation&&(B=t.tokenizeLine(m,u,A),h=B.tokens,f=0);let y=t.tokenizeLine2(m,u,A),E=y.tokens.length/2;for(let Q=0;Q<E;Q++){let I=y.tokens[2*Q],v=Q+1<E?y.tokens[2*Q+2]:m.length;if(I===v)continue;let $=y.tokens[2*Q+1],P=Is(r[Bd.getForeground($)],o),U=Bd.getFontStyle($),de={content:m.substring(I,v),offset:b+I,color:P,fontStyle:U};if(a.includeExplanation){let O=[];if(a.includeExplanation!=="scopeName")for(let ne of n.settings){let ve;switch(typeof ne.scope){case"string":ve=ne.scope.split(tye).map(ot=>ot.trim());break;case"object":ve=ne.scope;break;default:continue}O.push({settings:ne,selectors:ve.map(ot=>ot.split(nye))})}de.explanation=[];let V=0;for(;I+V<v;){let ne=h[f],ve=m.substring(ne.startIndex,ne.endIndex);V+=ve.length,de.explanation.push({content:ve,scopes:a.includeExplanation==="scopeName"?aye(ne.scopes):rye(O,ne.scopes)}),f+=1}}d.push(de)}l.push(d),d=[],u=y.ruleStack}return{tokens:l,stateStack:u}}function aye(e){return e.map(t=>({scopeName:t}))}function rye(e,t){let n=[];for(let r=0,a=t.length;r<a;r++){let o=t[r];n[r]={scopeName:o,themeMatches:iye(e,o,t.slice(0,r))}}return n}function vz(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oye(e,t,n){if(!vz(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)vz(e[r],n[a])&&(r-=1),a-=1;return r===-1}function iye(e,t,n){let r=[];for(let{selectors:a,settings:o}of e)for(let i of a)if(oye(i,t,n)){r.push(o);break}return r}function $E(e,t,n,r=z4){let a=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=a.map(u=>{let d=r(e,t,{...n,theme:u.theme});return{tokens:d,state:Yp(d),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),i=Aye(...o.map(u=>u.tokens)),A=i[0].map((u,d)=>u.map((l,g)=>{let p={content:l.content,variants:{},offset:l.offset};return"includeExplanation"in n&&n.includeExplanation&&(p.explanation=l.explanation),i.forEach((m,b)=>{let{content:B,explanation:h,offset:f,...y}=m[d][g];p.variants[a[b].color]=y}),p})),s=o[0].state?new RE(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return s&&Gb(A,s),A}function Aye(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let a=e.map(s=>s[r]),o=t.map(()=>[]);t.forEach((s,u)=>s.push(o[u]));let i=a.map(()=>0),A=a.map(s=>s[0]);for(;A.every(s=>s);){let s=Math.min(...A.map(u=>u.content.length));for(let u=0;u<n;u++){let d=A[u];d.content.length===s?(o[u].push(d),i[u]+=1,A[u]=a[u][i[u]]):(o[u].push({...d,content:d.content.slice(0,s)}),A[u]={...d,content:d.content.slice(s),offset:d.offset+s})}}}return t}var $z=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var vs=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};vs.prototype.normal={};vs.prototype.property={};vs.prototype.space=void 0;function Y4(e,t){let n={},r={};for(let a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new vs(n,r,t)}function Ub(e){return e.toLowerCase()}var Ca=class{constructor(t,n){this.attribute=n,this.property=t}};Ca.prototype.attribute="";Ca.prototype.booleanish=!1;Ca.prototype.boolean=!1;Ca.prototype.commaOrSpaceSeparated=!1;Ca.prototype.commaSeparated=!1;Ca.prototype.defined=!1;Ca.prototype.mustUseProperty=!1;Ca.prototype.number=!1;Ca.prototype.overloadedBoolean=!1;Ca.prototype.property="";Ca.prototype.spaceSeparated=!1;Ca.prototype.space=void 0;var Ob={};L(Ob,{boolean:()=>Ie,booleanish:()=>wn,commaOrSpaceSeparated:()=>Kr,commaSeparated:()=>Uc,number:()=>z,overloadedBoolean:()=>ME,spaceSeparated:()=>kt});var sye=0,Ie=yd(),wn=yd(),ME=yd(),z=yd(),kt=yd(),Uc=yd(),Kr=yd();function yd(){return 2**++sye}var J4=Object.keys(Ob),Cd=class extends Ca{constructor(t,n,r,a){let o=-1;if(super(t,n),Mz(this,"space",a),typeof r=="number")for(;++o<J4.length;){let i=J4[o];Mz(this,J4[o],(r&Ob[i])===Ob[i])}}};Cd.prototype.defined=!0;function Mz(e,t,n){n&&(e[t]=n)}function Ko(e){let t={},n={};for(let[r,a]of Object.entries(e.properties)){let o=new Cd(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ub(r)]=r,n[Ub(o.attribute)]=r}return new vs(t,n,e.space)}var W4=Ko({properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:kt,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:z,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:kt,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:wn,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function jE(e,t){return t in e?e[t]:t}function PE(e,t){return jE(e,t.toLowerCase())}var jz=Ko({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Uc,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:kt,autoFocus:Ie,autoPlay:Ie,blocking:kt,capture:null,charSet:null,checked:Ie,cite:null,className:kt,cols:z,colSpan:null,content:null,contentEditable:wn,controls:Ie,controlsList:kt,coords:z|Uc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:ME,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:kt,height:z,hidden:ME,high:z,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ie,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:z,pattern:null,ping:kt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:kt,required:Ie,reversed:Ie,rows:z,rowSpan:z,sandbox:kt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:wn,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:PE});var Pz=Ko({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Kr,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Uc,g2:Uc,glyphName:Uc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kr,rev:Kr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kr,requiredFeatures:Kr,requiredFonts:Kr,requiredFormats:Kr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kr,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:jE});var Z4=Ko({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var V4=Ko({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:PE});var X4=Ko({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var cye=/[A-Z]/g,Tz=/-[a-z]/g,uye=/^data[-\w.:]+$/i;function e9(e,t){let n=Ub(t),r=t,a=Ca;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&uye.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(Tz,lye);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!Tz.test(o)){let i=o.replace(cye,dye);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}a=Cd}return new a(r,t)}function dye(e){return"-"+e.toLowerCase()}function lye(e){return e.charAt(1).toUpperCase()}var Hz=Y4([W4,jz,Z4,V4,X4],"html"),TE=Y4([W4,Pz,Z4,V4,X4],"svg");var Gz={}.hasOwnProperty;function Uz(e,t){let n=t||{};function r(a,...o){let i=r.invalid,A=r.handlers;if(a&&Gz.call(a,e)){let s=String(a[e]);i=Gz.call(A,s)?A[s]:r.unknown}if(i)return i.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var pye=/["&'<>`]/g,gye=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,mye=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,fye=/[|\\{}()[\]^$+*?.]/g,Oz=new WeakMap;function qz(e,t){if(e=e.replace(t.subset?bye(t.subset):pye,r),t.subset||t.escapeOnly)return e;return e.replace(gye,n).replace(mye,r);function n(a,o,i){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),t)}function r(a,o,i){return t.format(a.charCodeAt(0),i.charCodeAt(o+1),t)}}function bye(e){let t=Oz.get(e);return t||(t=hye(e),Oz.set(e,t)),t}function hye(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(fye,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var Bye=/[\dA-Fa-f]/;function zz(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Bye.test(String.fromCharCode(t))?r:r+";"}var yye=/\d/;function Kz(e,t,n){let r="&#"+String(e);return n&&t&&!yye.test(String.fromCharCode(t))?r:r+";"}var Yz=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var HE={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Jz=["cent","copy","divide","gt","lt","not","para","times"];var Wz={}.hasOwnProperty,t9={},GE;for(GE in HE)Wz.call(HE,GE)&&(t9[HE[GE]]=GE);var Cye=/[^\dA-Za-z]/;function Zz(e,t,n,r){let a=String.fromCharCode(e);if(Wz.call(t9,a)){let o=t9[a],i="&"+o;return n&&Yz.includes(o)&&!Jz.includes(o)&&(!r||t&&t!==61&&Cye.test(String.fromCharCode(t)))?i:i+";"}return""}function Vz(e,t,n){let r=zz(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=Zz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let o=Kz(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function _s(e,t){return qz(e,Object.assign({format:Vz},t))}var wye=/^>|^->|<!--|-->|--!>|<!-$/g,Eye=[">"],kye=["<",">"];function Xz(e,t,n,r){return r.settings.bogusComments?"<?"+_s(e.value,Object.assign({},r.settings.characterReferences,{subset:Eye}))+">":"<!--"+e.value.replace(wye,a)+"-->";function a(o){return _s(o,Object.assign({},r.settings.characterReferences,{subset:kye}))}}function eK(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function n9(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function tK(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function nK(e){return e.join(" ").trim()}var Qye=/[ \t\n\f\r]/g;function wd(e){return typeof e=="object"?e.type==="text"?aK(e.value):!1:aK(e)}function aK(e){return e.replace(Qye,"")===""}var Fn=rK(1),a9=rK(-1),Iye=[];function rK(e){return t;function t(n,r,a){let o=n?n.children:Iye,i=(r||0)+e,A=o[i];if(!a)for(;A&&wd(A);)i+=e,A=o[i];return A}}var vye={}.hasOwnProperty;function UE(e){return t;function t(n,r,a){return vye.call(e,n.tagName)&&e[n.tagName](n,r,a)}}var qb=UE({body:xye,caption:r9,colgroup:r9,dd:Lye,dt:Sye,head:r9,html:_ye,li:Fye,optgroup:Nye,option:Rye,p:Dye,rp:oK,rt:oK,tbody:Mye,td:iK,tfoot:jye,th:iK,thead:$ye,tr:Pye});function r9(e,t,n){let r=Fn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&wd(r.value.charAt(0)))}function _ye(e,t,n){let r=Fn(n,t);return!r||r.type!=="comment"}function xye(e,t,n){let r=Fn(n,t);return!r||r.type!=="comment"}function Dye(e,t,n){let r=Fn(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Fye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Sye(e,t,n){let r=Fn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Lye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function oK(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Nye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Rye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function $ye(e,t,n){let r=Fn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Mye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function jye(e,t,n){return!Fn(n,t)}function Pye(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function iK(e,t,n){let r=Fn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var AK=UE({body:Gye,colgroup:Uye,head:Hye,html:Tye,tbody:Oye});function Tye(e){let t=Fn(e,-1);return!t||t.type!=="comment"}function Hye(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function Gye(e){let t=Fn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&wd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Uye(e,t,n){let r=a9(n,t),a=Fn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&qb(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function Oye(e,t,n){let r=a9(n,t),a=Fn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&qb(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}var OE={name:[[`
70
70
  \f\r &/=>`.split(""),`