@rizom/brain 0.2.0-alpha.323 → 0.2.0-alpha.324
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/brain.js +312 -312
- package/dist/chunks/{app-9e2hk8hm.js → app-hysmat2h.js} +2 -2
- package/dist/chunks/{index-nr2d60q5.js → index-4bdrecpy.js} +2 -2
- package/dist/chunks/{index-zkdjr45a.js → index-asb4vsnz.js} +3 -3
- package/dist/chunks/{index-zkdjr45a.js.map → index-asb4vsnz.js.map} +1 -1
- package/dist/chunks/{index-gc0s0sy8.js → index-ppnstspp.js} +2 -2
- package/dist/git-broker.js +43 -43
- package/dist/index.js +1 -1
- package/dist/model.js +39 -39
- package/dist/model.js.map +1 -1
- package/package.json +1 -1
- /package/dist/chunks/{app-9e2hk8hm.js.map → app-hysmat2h.js.map} +0 -0
- /package/dist/chunks/{index-nr2d60q5.js.map → index-4bdrecpy.js.map} +0 -0
- /package/dist/chunks/{index-gc0s0sy8.js.map → index-ppnstspp.js.map} +0 -0
package/dist/git-broker.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var Ute=Object.create;var{getPrototypeOf:qte,defineProperty:qw,getOwnPropertyNames:Jte}=Object;var Hte=Object.prototype.hasOwnProperty;function Wte(e){return this[e]}var Zte,Vte,Rs=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?Zte??=new WeakMap:Vte??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?Ute(qte(e)):{};let s=t||!e||!e.__esModule?qw(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of Jte(e))if(!Hte.call(s,c))qw(s,c,{get:Wte.bind(e,c),enumerable:!0})}if(i)n.set(e,s);return s};var De=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Gte=(e)=>e;function Kte(e,t){this[e]=Gte.bind(null,t)}var pi=(e,t)=>{for(var r in t)qw(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Kte.bind(t,r)})};var Xi=import.meta.require;var SL=De(function(MLe,xL){var wl=1000,kl=wl*60,Il=kl*60,ac=Il*24,toe=ac*7,roe=ac*365.25;xL.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return noe(e);else if(r==="number"&&isFinite(e))return t.long?ooe(e):ioe(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function noe(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*roe;case"weeks":case"week":case"w":return r*toe;case"days":case"day":case"d":return r*ac;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Il;case"minutes":case"minute":case"mins":case"min":case"m":return r*kl;case"seconds":case"second":case"secs":case"sec":case"s":return r*wl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function ioe(e){var t=Math.abs(e);if(t>=ac)return Math.round(e/ac)+"d";if(t>=Il)return Math.round(e/Il)+"h";if(t>=kl)return Math.round(e/kl)+"m";if(t>=wl)return Math.round(e/wl)+"s";return e+"ms"}function ooe(e){var t=Math.abs(e);if(t>=ac)return Ny(e,t,ac,"day");if(t>=Il)return Ny(e,t,Il,"hour");if(t>=kl)return Ny(e,t,kl,"minute");if(t>=wl)return Ny(e,t,wl,"second");return e+" ms"}function Ny(e,t,r,i){var n=t>=r*1.5;return Math.round(e/r)+" "+i+(n?"s":"")}});var wR=De(function(FLe,vL){function soe(e){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=n,r.enabled=c,r.humanize=SL(),r.destroy=l,Object.keys(e).forEach((p)=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let m=0;for(let f=0;f<p.length;f++)m=(m<<5)-m+p.charCodeAt(f),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=t;function r(p){let m,f=null,g,S;function P(...D){if(!P.enabled)return;let L=P,Se=Number(new Date),Q=Se-(m||Se);if(L.diff=Q,L.prev=m,L.curr=Se,m=Se,D[0]=r.coerce(D[0]),typeof D[0]!=="string")D.unshift("%O");let se=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(F,Be)=>{if(F==="%%")return"%";se++;let Te=r.formatters[Be];if(typeof Te==="function"){let Pe=D[se];F=Te.call(L,Pe),D.splice(se,1),se--}return F}),r.formatArgs.call(L,D),(L.log||r.log).apply(L,D)}if(P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=i,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(g!==r.namespaces)g=r.namespaces,S=r.enabled(p);return S},set:(D)=>{f=D}}),typeof r.init==="function")r.init(P);return P}function i(p,m){let f=r(this.namespace+(typeof m>"u"?":":m)+p);return f.log=this.log,f}function n(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m=(typeof p==="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of m)if(f[0]==="-")r.skips.push(f.slice(1));else r.names.push(f)}function o(p,m){let f=0,g=0,S=-1,P=0;while(f<p.length)if(g<m.length&&(m[g]===p[f]||m[g]==="*"))if(m[g]==="*")S=g,P=f,g++;else f++,g++;else if(S!==-1)g=S+1,P++,f=P;else return!1;while(g<m.length&&m[g]==="*")g++;return g===m.length}function s(){let p=[...r.names,...r.skips.map((m)=>"-"+m)].join(",");return r.enable(""),p}function c(p){for(let m of r.skips)if(o(p,m))return!1;for(let m of r.names)if(o(p,m))return!0;return!1}function u(p){if(p instanceof Error)return p.stack||p.message;return p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}vL.exports=soe});var kL=De(function(wL,zy){wL.formatArgs=coe;wL.save=uoe;wL.load=loe;wL.useColors=aoe;wL.storage=poe();wL.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();wL.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function aoe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function coe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+zy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(n)=>{if(n==="%%")return;if(r++,n==="%c")i=r}),e.splice(i,0,t)}wL.log=console.debug||console.log||(()=>{});function uoe(e){try{if(e)wL.storage.setItem("debug",e);else wL.storage.removeItem("debug")}catch(t){}}function loe(){let e;try{e=wL.storage.getItem("debug")||wL.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function poe(){try{return localStorage}catch(e){}}zy.exports=wR()(wL);var{formatters:doe}=zy.exports;doe.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var TL=De(function(jLe,IL){IL.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var PL=De(function(NLe,CL){var Soe=Xi("os"),EL=Xi("tty"),mi=TL(),{env:Tr}=process,Hs;if(mi("no-color")||mi("no-colors")||mi("color=false")||mi("color=never"))Hs=0;else if(mi("color")||mi("colors")||mi("color=true")||mi("color=always"))Hs=1;if("FORCE_COLOR"in Tr)if(Tr.FORCE_COLOR==="true")Hs=1;else if(Tr.FORCE_COLOR==="false")Hs=0;else Hs=Tr.FORCE_COLOR.length===0?1:Math.min(parseInt(Tr.FORCE_COLOR,10),3);function kR(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function IR(e,t){if(Hs===0)return 0;if(mi("color=16m")||mi("color=full")||mi("color=truecolor"))return 3;if(mi("color=256"))return 2;if(e&&!t&&Hs===void 0)return 0;let r=Hs||0;if(Tr.TERM==="dumb")return r;if(process.platform==="win32"){let i=Soe.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in Tr){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((i)=>(i in Tr))||Tr.CI_NAME==="codeship")return 1;return r}if("TEAMCITY_VERSION"in Tr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tr.TEAMCITY_VERSION)?1:0;if(Tr.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Tr){let i=parseInt((Tr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tr.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Tr.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tr.TERM))return 1;if("COLORTERM"in Tr)return 1;return r}function voe(e){let t=IR(e,e&&e.isTTY);return kR(t)}CL.exports={supportsColor:voe,stdout:kR(IR(!0,EL.isatty(1))),stderr:kR(IR(!0,EL.isatty(2)))}});var OL=De(function(AL,By){var woe=Xi("tty"),Ly=Xi("util");AL.init=Roe;AL.log=Eoe;AL.formatArgs=Ioe;AL.save=Coe;AL.load=Poe;AL.useColors=koe;AL.destroy=Ly.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");AL.colors=[6,2,3,4,5,1];try{let e=PL();if(e&&(e.stderr||e).level>=2)AL.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}AL.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),i=process.env[t];if(/^(yes|on|true|enabled)$/i.test(i))i=!0;else if(/^(no|off|false|disabled)$/i.test(i))i=!1;else if(i==="null")i=null;else i=Number(i);return e[r]=i,e},{});function koe(){return"colors"in AL.inspectOpts?Boolean(AL.inspectOpts.colors):woe.isatty(process.stderr.fd)}function Ioe(e){let{namespace:t,useColors:r}=this;if(r){let i=this.color,n="\x1B[3"+(i<8?i:"8;5;"+i),o=` ${n};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
|
|
3
|
+
var Ute=Object.create;var{getPrototypeOf:qte,defineProperty:qw,getOwnPropertyNames:Jte}=Object;var Hte=Object.prototype.hasOwnProperty;function Wte(e){return this[e]}var Zte,Vte,Rs=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?Zte??=new WeakMap:Vte??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?Ute(qte(e)):{};let s=t||!e||!e.__esModule?qw(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of Jte(e))if(!Hte.call(s,c))qw(s,c,{get:Wte.bind(e,c),enumerable:!0})}if(i)n.set(e,s);return s};var De=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Gte=(e)=>e;function Kte(e,t){this[e]=Gte.bind(null,t)}var pi=(e,t)=>{for(var r in t)qw(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Kte.bind(t,r)})};var Xi=import.meta.require;var SL=De(function(FLe,xL){var wl=1000,kl=wl*60,Il=kl*60,ac=Il*24,toe=ac*7,roe=ac*365.25;xL.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return noe(e);else if(r==="number"&&isFinite(e))return t.long?ooe(e):ioe(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function noe(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*roe;case"weeks":case"week":case"w":return r*toe;case"days":case"day":case"d":return r*ac;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Il;case"minutes":case"minute":case"mins":case"min":case"m":return r*kl;case"seconds":case"second":case"secs":case"sec":case"s":return r*wl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function ioe(e){var t=Math.abs(e);if(t>=ac)return Math.round(e/ac)+"d";if(t>=Il)return Math.round(e/Il)+"h";if(t>=kl)return Math.round(e/kl)+"m";if(t>=wl)return Math.round(e/wl)+"s";return e+"ms"}function ooe(e){var t=Math.abs(e);if(t>=ac)return Ny(e,t,ac,"day");if(t>=Il)return Ny(e,t,Il,"hour");if(t>=kl)return Ny(e,t,kl,"minute");if(t>=wl)return Ny(e,t,wl,"second");return e+" ms"}function Ny(e,t,r,i){var n=t>=r*1.5;return Math.round(e/r)+" "+i+(n?"s":"")}});var wR=De(function($Le,vL){function soe(e){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=n,r.enabled=c,r.humanize=SL(),r.destroy=l,Object.keys(e).forEach((p)=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let m=0;for(let f=0;f<p.length;f++)m=(m<<5)-m+p.charCodeAt(f),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=t;function r(p){let m,f=null,g,S;function P(...D){if(!P.enabled)return;let L=P,Se=Number(new Date),Q=Se-(m||Se);if(L.diff=Q,L.prev=m,L.curr=Se,m=Se,D[0]=r.coerce(D[0]),typeof D[0]!=="string")D.unshift("%O");let se=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(F,Be)=>{if(F==="%%")return"%";se++;let Te=r.formatters[Be];if(typeof Te==="function"){let Pe=D[se];F=Te.call(L,Pe),D.splice(se,1),se--}return F}),r.formatArgs.call(L,D),(L.log||r.log).apply(L,D)}if(P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=i,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(g!==r.namespaces)g=r.namespaces,S=r.enabled(p);return S},set:(D)=>{f=D}}),typeof r.init==="function")r.init(P);return P}function i(p,m){let f=r(this.namespace+(typeof m>"u"?":":m)+p);return f.log=this.log,f}function n(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m=(typeof p==="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of m)if(f[0]==="-")r.skips.push(f.slice(1));else r.names.push(f)}function o(p,m){let f=0,g=0,S=-1,P=0;while(f<p.length)if(g<m.length&&(m[g]===p[f]||m[g]==="*"))if(m[g]==="*")S=g,P=f,g++;else f++,g++;else if(S!==-1)g=S+1,P++,f=P;else return!1;while(g<m.length&&m[g]==="*")g++;return g===m.length}function s(){let p=[...r.names,...r.skips.map((m)=>"-"+m)].join(",");return r.enable(""),p}function c(p){for(let m of r.skips)if(o(p,m))return!1;for(let m of r.names)if(o(p,m))return!0;return!1}function u(p){if(p instanceof Error)return p.stack||p.message;return p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}vL.exports=soe});var kL=De(function(wL,zy){wL.formatArgs=coe;wL.save=uoe;wL.load=loe;wL.useColors=aoe;wL.storage=poe();wL.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();wL.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function aoe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function coe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+zy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(n)=>{if(n==="%%")return;if(r++,n==="%c")i=r}),e.splice(i,0,t)}wL.log=console.debug||console.log||(()=>{});function uoe(e){try{if(e)wL.storage.setItem("debug",e);else wL.storage.removeItem("debug")}catch(t){}}function loe(){let e;try{e=wL.storage.getItem("debug")||wL.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function poe(){try{return localStorage}catch(e){}}zy.exports=wR()(wL);var{formatters:doe}=zy.exports;doe.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var TL=De(function(NLe,IL){IL.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}});var PL=De(function(zLe,CL){var Soe=Xi("os"),EL=Xi("tty"),mi=TL(),{env:Tr}=process,Hs;if(mi("no-color")||mi("no-colors")||mi("color=false")||mi("color=never"))Hs=0;else if(mi("color")||mi("colors")||mi("color=true")||mi("color=always"))Hs=1;if("FORCE_COLOR"in Tr)if(Tr.FORCE_COLOR==="true")Hs=1;else if(Tr.FORCE_COLOR==="false")Hs=0;else Hs=Tr.FORCE_COLOR.length===0?1:Math.min(parseInt(Tr.FORCE_COLOR,10),3);function kR(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function IR(e,t){if(Hs===0)return 0;if(mi("color=16m")||mi("color=full")||mi("color=truecolor"))return 3;if(mi("color=256"))return 2;if(e&&!t&&Hs===void 0)return 0;let r=Hs||0;if(Tr.TERM==="dumb")return r;if(process.platform==="win32"){let i=Soe.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in Tr){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((i)=>(i in Tr))||Tr.CI_NAME==="codeship")return 1;return r}if("TEAMCITY_VERSION"in Tr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tr.TEAMCITY_VERSION)?1:0;if(Tr.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Tr){let i=parseInt((Tr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tr.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Tr.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Tr.TERM))return 1;if("COLORTERM"in Tr)return 1;return r}function voe(e){let t=IR(e,e&&e.isTTY);return kR(t)}CL.exports={supportsColor:voe,stdout:kR(IR(!0,EL.isatty(1))),stderr:kR(IR(!0,EL.isatty(2)))}});var OL=De(function(AL,By){var woe=Xi("tty"),Ly=Xi("util");AL.init=Roe;AL.log=Eoe;AL.formatArgs=Ioe;AL.save=Coe;AL.load=Poe;AL.useColors=koe;AL.destroy=Ly.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");AL.colors=[6,2,3,4,5,1];try{let e=PL();if(e&&(e.stderr||e).level>=2)AL.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}AL.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),i=process.env[t];if(/^(yes|on|true|enabled)$/i.test(i))i=!0;else if(/^(no|off|false|disabled)$/i.test(i))i=!1;else if(i==="null")i=null;else i=Number(i);return e[r]=i,e},{});function koe(){return"colors"in AL.inspectOpts?Boolean(AL.inspectOpts.colors):woe.isatty(process.stderr.fd)}function Ioe(e){let{namespace:t,useColors:r}=this;if(r){let i=this.color,n="\x1B[3"+(i<8?i:"8;5;"+i),o=` ${n};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+o),e.push(n+"m+"+By.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Toe()+t+" "+e[0]}function Toe(){if(AL.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Eoe(...e){return process.stderr.write(Ly.formatWithOptions(AL.inspectOpts,...e)+`
|
|
6
6
|
`)}function Coe(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function Poe(){return process.env.DEBUG}function Roe(e){e.inspectOpts={};let t=Object.keys(AL.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=AL.inspectOpts[t[r]]}By.exports=wR()(AL);var{formatters:RL}=By.exports;RL.o=function(e){return this.inspectOpts.colors=this.useColors,Ly.inspect(e,this.inspectOpts).split(`
|
|
7
|
-
`).map((t)=>t.trim()).join(" ")};RL.O=function(e){return this.inspectOpts.colors=this.useColors,Ly.inspect(e,this.inspectOpts)}});var Uy=De(function(
|
|
7
|
+
`).map((t)=>t.trim()).join(" ")};RL.O=function(e){return this.inspectOpts.colors=this.useColors,Ly.inspect(e,this.inspectOpts)}});var Uy=De(function(BLe,TR){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)TR.exports=kL();else TR.exports=OL()});var DL=De(function(Zn){var joe=Zn&&Zn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zn,"__esModule",{value:!0});var Noe=Xi("fs"),zoe=joe(Uy()),Tl=zoe.default("@kwsites/file-exists");function Loe(e,t,r){Tl("checking %s",e);try{let i=Noe.statSync(e);if(i.isFile()&&t)return Tl("[OK] path represents a file"),!0;if(i.isDirectory()&&r)return Tl("[OK] path represents a directory"),!0;return Tl("[FAIL] path represents something other than a file or directory"),!1}catch(i){if(i.code==="ENOENT")return Tl("[FAIL] path is not accessible: %o",i),!1;throw Tl("[FATAL] %o",i),i}}function Boe(e,t=Zn.READABLE){return Loe(e,(t&Zn.FILE)>0,(t&Zn.FOLDER)>0)}Zn.exists=Boe;Zn.FILE=1;Zn.FOLDER=2;Zn.READABLE=Zn.FILE+Zn.FOLDER});var ML=De(function(ER){function Uoe(e){for(var t in e)if(!ER.hasOwnProperty(t))ER[t]=e[t]}Object.defineProperty(ER,"__esModule",{value:!0});Uoe(DL())});var RR=De(function(FL){Object.defineProperty(FL,"__esModule",{value:!0});FL.createDeferred=FL.deferred=void 0;function PR(){let e,t,r="pending";return{promise:new Promise((n,o)=>{e=n,t=o}),done(n){if(r==="pending")r="resolved",e(n)},fail(n){if(r==="pending")r="rejected",t(n)},get fulfilled(){return r!=="pending"},get status(){return r}}}FL.deferred=PR;FL.createDeferred=PR;FL.default=PR});var xg=De(function(e3e,ZQ){var ATe=Object.prototype.toString;ZQ.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return FTe(t)?"generatorfunction":"function";if(_Te(t))return"array";if(NTe(t))return"buffer";if(jTe(t))return"arguments";if(DTe(t))return"date";if(OTe(t))return"error";if(MTe(t))return"regexp";switch(WQ(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if($Te(t))return"generator";switch(r=ATe.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function WQ(e){return typeof e.constructor==="function"?e.constructor.name:null}function _Te(e){if(Array.isArray)return Array.isArray(e);return e instanceof Array}function OTe(e){return e instanceof Error||typeof e.message==="string"&&e.constructor&&typeof e.constructor.stackTraceLimit==="number"}function DTe(e){if(e instanceof Date)return!0;return typeof e.toDateString==="function"&&typeof e.getDate==="function"&&typeof e.setDate==="function"}function MTe(e){if(e instanceof RegExp)return!0;return typeof e.flags==="string"&&typeof e.ignoreCase==="boolean"&&typeof e.multiline==="boolean"&&typeof e.global==="boolean"}function FTe(e,t){return WQ(e)==="GeneratorFunction"}function $Te(e){return typeof e.throw==="function"&&typeof e.return==="function"&&typeof e.next==="function"}function jTe(e){try{if(typeof e.length==="number"&&typeof e.callee==="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function NTe(e){if(e.constructor&&typeof e.constructor.isBuffer==="function")return e.constructor.isBuffer(e);return!1}});var GQ=De(function(t3e,VQ){/*!
|
|
8
8
|
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) 2015, Jon Schlinkert.
|
|
11
11
|
* Licensed under the MIT License.
|
|
12
|
-
*/VQ.exports=function(t){return typeof t<"u"&&t!==null&&(typeof t==="object"||typeof t==="function")}});var YQ=De(function(
|
|
12
|
+
*/VQ.exports=function(t){return typeof t<"u"&&t!==null&&(typeof t==="object"||typeof t==="function")}});var YQ=De(function(r3e,QQ){var KQ=GQ();QQ.exports=function(t){if(!KQ(t))t={};var r=arguments.length;for(var i=1;i<r;i++){var n=arguments[i];if(KQ(n))zTe(t,n)}return t};function zTe(e,t){for(var r in t)if(LTe(t,r))e[r]=t[r]}function LTe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var t9=De(function(n3e,e9){var BTe=xg(),UTe=YQ();e9.exports=function(e,t){if(typeof t==="function")t={parse:t};var r=JTe(e),i={section_delimiter:"---",parse:WTe},n=UTe({},i,t),o=n.section_delimiter,s=r.content.split(/\r?\n/),c=null,u=XQ(),l=[],p=[];function m(L){r.content=L,c=[],l=[]}function f(L){if(p.length)u.key=HTe(p[0],o),u.content=L,n.parse(u,c),c.push(u),u=XQ(),l=[],p=[]}for(var g=0;g<s.length;g++){var S=s[g],P=p.length,D=S.trim();if(qTe(D,o)){if(D.length===3&&g!==0){if(P===0||P===2){l.push(S);continue}p.push(D),u.data=l.join(`
|
|
13
13
|
`),l=[];continue}if(c===null)m(l.join(`
|
|
14
14
|
`));if(P===2)f(l.join(`
|
|
15
15
|
`));p.push(D);continue}l.push(S)}if(c===null)m(l.join(`
|
|
16
16
|
`));else f(l.join(`
|
|
17
|
-
`));return r.sections=c,r};function
|
|
17
|
+
`));return r.sections=c,r};function qTe(e,t){if(e.slice(0,t.length)!==t)return!1;if(e.charAt(t.length+1)===t.slice(-1))return!1;return!0}function JTe(e){if(BTe(e)!=="object")e={content:e};if(typeof e.content!=="string"&&!ZTe(e.content))throw TypeError("expected a buffer or string");return e.content=e.content.toString(),e.sections=[],e}function HTe(e,t){return e?e.slice(t.length).trim():""}function XQ(){return{key:"",data:"",content:""}}function WTe(e){return e}function ZTe(e){if(e&&e.constructor&&typeof e.constructor.isBuffer==="function")return e.constructor.isBuffer(e);return!1}});var ku=De(function(XTe,wu){function r9(e){return typeof e>"u"||e===null}function VTe(e){return typeof e==="object"&&e!==null}function GTe(e){if(Array.isArray(e))return e;else if(r9(e))return[];return[e]}function KTe(e,t){var r,i,n,o;if(t){o=Object.keys(t);for(r=0,i=o.length;r<i;r+=1)n=o[r],e[n]=t[n]}return e}function QTe(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function YTe(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}XTe.isNothing=r9;XTe.isObject=VTe;XTe.toArray=GTe;XTe.repeat=QTe;XTe.isNegativeZero=YTe;XTe.extend=KTe});var Vp=De(function(i3e,n9){function Sg(e,t){if(Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}Sg.prototype=Object.create(Error.prototype);Sg.prototype.constructor=Sg;Sg.prototype.toString=function(t){var r=this.name+": ";if(r+=this.reason||"(unknown reason)",!t&&this.mark)r+=" "+this.mark.toString();return r};n9.exports=Sg});var s9=De(function(o3e,o9){var i9=ku();function JM(e,t,r,i,n){this.name=e,this.buffer=t,this.position=r,this.line=i,this.column=n}JM.prototype.getSnippet=function(t,r){var i,n,o,s,c;if(!this.buffer)return null;t=t||4,r=r||75,i="",n=this.position;while(n>0&&`\x00\r
|
|
18
18
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1)if(n-=1,this.position-n>r/2-1){i=" ... ",n+=5;break}o="",s=this.position;while(s<this.buffer.length&&`\x00\r
|
|
19
19
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(s))===-1)if(s+=1,s-this.position>r/2-1){o=" ... ",s-=5;break}return c=this.buffer.slice(n,s),i9.repeat(" ",t)+i+c+o+`
|
|
20
20
|
`+i9.repeat(" ",t+this.position-n+i.length)+"^"};JM.prototype.toString=function(t){var r,i="";if(this.name)i+='in "'+this.name+'" ';if(i+="at line "+(this.line+1)+", column "+(this.column+1),!t){if(r=this.getSnippet(),r)i+=`:
|
|
21
|
-
`+r}return i};o9.exports=JM});var Ir=De(function(
|
|
22
|
-
\r`;function
|
|
23
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function
|
|
24
|
-
`,t-1)}function
|
|
21
|
+
`+r}return i};o9.exports=JM});var Ir=De(function(s3e,c9){var a9=Vp(),sEe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],aEe=["scalar","sequence","mapping"];function cEe(e){var t={};if(e!==null)Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})});return t}function uEe(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(sEe.indexOf(r)===-1)throw new a9('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=cEe(t.styleAliases||null),aEe.indexOf(this.kind)===-1)throw new a9('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}c9.exports=uEe});var Iu=De(function(a3e,l9){var u9=ku(),_v=Vp(),lEe=Ir();function HM(e,t,r){var i=[];return e.include.forEach(function(n){r=HM(n,t,r)}),e[t].forEach(function(n){r.forEach(function(o,s){if(o.tag===n.tag&&o.kind===n.kind)i.push(s)}),r.push(n)}),r.filter(function(n,o){return i.indexOf(o)===-1})}function pEe(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function i(n){e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Gp(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new _v("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=HM(this,"implicit",[]),this.compiledExplicit=HM(this,"explicit",[]),this.compiledTypeMap=pEe(this.compiledImplicit,this.compiledExplicit)}Gp.DEFAULT=null;Gp.create=function(){var t,r;switch(arguments.length){case 1:t=Gp.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new _v("Wrong number of arguments for Schema.create function")}if(t=u9.toArray(t),r=u9.toArray(r),!t.every(function(i){return i instanceof Gp}))throw new _v("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(i){return i instanceof lEe}))throw new _v("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Gp({include:t,explicit:r})};l9.exports=Gp});var d9=De(function(c3e,p9){var dEe=Ir();p9.exports=new dEe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var f9=De(function(u3e,m9){var mEe=Ir();m9.exports=new mEe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var h9=De(function(l3e,g9){var fEe=Ir();g9.exports=new fEe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var Ov=De(function(p3e,y9){var gEe=Iu();y9.exports=new gEe({explicit:[d9(),f9(),h9()]})});var x9=De(function(d3e,b9){var hEe=Ir();function yEe(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function bEe(){return null}function xEe(e){return e===null}b9.exports=new hEe("tag:yaml.org,2002:null",{kind:"scalar",resolve:yEe,construct:bEe,predicate:xEe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var v9=De(function(m3e,S9){var SEe=Ir();function vEe(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function wEe(e){return e==="true"||e==="True"||e==="TRUE"}function kEe(e){return Object.prototype.toString.call(e)==="[object Boolean]"}S9.exports=new SEe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:vEe,construct:wEe,predicate:kEe,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var k9=De(function(f3e,w9){var IEe=ku(),TEe=Ir();function EEe(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function CEe(e){return 48<=e&&e<=55}function PEe(e){return 48<=e&&e<=57}function REe(e){if(e===null)return!1;var t=e.length,r=0,i=!1,n;if(!t)return!1;if(n=e[r],n==="-"||n==="+")n=e[++r];if(n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){r++;for(;r<t;r++){if(n=e[r],n==="_")continue;if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){r++;for(;r<t;r++){if(n=e[r],n==="_")continue;if(!EEe(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}for(;r<t;r++){if(n=e[r],n==="_")continue;if(!CEe(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="_")return!1;for(;r<t;r++){if(n=e[r],n==="_")continue;if(n===":")break;if(!PEe(e.charCodeAt(r)))return!1;i=!0}if(!i||n==="_")return!1;if(n!==":")return!0;return/^(:[0-5]?[0-9])+$/.test(e.slice(r))}function AEe(e){var t=e,r=1,i,n,o=[];if(t.indexOf("_")!==-1)t=t.replace(/_/g,"");if(i=t[0],i==="-"||i==="+"){if(i==="-")r=-1;t=t.slice(1),i=t[0]}if(t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t,16);return r*parseInt(t,8)}if(t.indexOf(":")!==-1)return t.split(":").forEach(function(s){o.unshift(parseInt(s,10))}),t=0,n=1,o.forEach(function(s){t+=s*n,n*=60}),r*t;return r*parseInt(t,10)}function _Ee(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1===0&&!IEe.isNegativeZero(e))}w9.exports=new TEe("tag:yaml.org,2002:int",{kind:"scalar",resolve:REe,construct:AEe,predicate:_Ee,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var E9=De(function(g3e,T9){var I9=ku(),OEe=Ir(),DEe=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function MEe(e){if(e===null)return!1;if(!DEe.test(e)||e[e.length-1]==="_")return!1;return!0}function FEe(e){var t,r,i,n;if(t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,n=[],"+-".indexOf(t[0])>=0)t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(t===".nan")return NaN;else if(t.indexOf(":")>=0)return t.split(":").forEach(function(o){n.unshift(parseFloat(o,10))}),t=0,i=1,n.forEach(function(o){t+=o*i,i*=60}),r*t;return r*parseFloat(t,10)}var $Ee=/^[-+]?[0-9]+e/;function jEe(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(I9.isNegativeZero(e))return"-0.0";return r=e.toString(10),$Ee.test(r)?r.replace("e",".e"):r}function NEe(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||I9.isNegativeZero(e))}T9.exports=new OEe("tag:yaml.org,2002:float",{kind:"scalar",resolve:MEe,construct:FEe,predicate:NEe,represent:jEe,defaultStyle:"lowercase"})});var WM=De(function(h3e,C9){var zEe=Iu();C9.exports=new zEe({include:[Ov()],implicit:[x9(),v9(),k9(),E9()]})});var ZM=De(function(y3e,P9){var LEe=Iu();P9.exports=new LEe({include:[WM()]})});var O9=De(function(b3e,_9){var BEe=Ir(),R9=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),A9=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function UEe(e){if(e===null)return!1;if(R9.exec(e)!==null)return!0;if(A9.exec(e)!==null)return!0;return!1}function qEe(e){var t,r,i,n,o,s,c,u=0,l=null,p,m,f;if(t=R9.exec(e),t===null)t=A9.exec(e);if(t===null)throw Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));if(o=+t[4],s=+t[5],c=+t[6],t[7]){u=t[7].slice(0,3);while(u.length<3)u+="0";u=+u}if(t[9]){if(p=+t[10],m=+(t[11]||0),l=(p*60+m)*60000,t[9]==="-")l=-l}if(f=new Date(Date.UTC(r,i,n,o,s,c,u)),l)f.setTime(f.getTime()-l);return f}function JEe(e){return e.toISOString()}_9.exports=new BEe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:UEe,construct:qEe,instanceOf:Date,represent:JEe})});var M9=De(function(x3e,D9){var HEe=Ir();function WEe(e){return e==="<<"||e===null}D9.exports=new HEe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:WEe})});var $9=De(function(S3e,F9){var Tu;try{VM=Xi,Tu=VM("buffer").Buffer}catch(e){}var VM,ZEe=Ir(),GM=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
22
|
+
\r`;function VEe(e){if(e===null)return!1;var t,r,i=0,n=e.length,o=GM;for(r=0;r<n;r++){if(t=o.indexOf(e.charAt(r)),t>64)continue;if(t<0)return!1;i+=6}return i%8===0}function GEe(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,o=GM,s=0,c=[];for(t=0;t<n;t++){if(t%4===0&&t)c.push(s>>16&255),c.push(s>>8&255),c.push(s&255);s=s<<6|o.indexOf(i.charAt(t))}if(r=n%4*6,r===0)c.push(s>>16&255),c.push(s>>8&255),c.push(s&255);else if(r===18)c.push(s>>10&255),c.push(s>>2&255);else if(r===12)c.push(s>>4&255);if(Tu)return Tu.from?Tu.from(c):new Tu(c);return c}function KEe(e){var t="",r=0,i,n,o=e.length,s=GM;for(i=0;i<o;i++){if(i%3===0&&i)t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63];r=(r<<8)+e[i]}if(n=o%3,n===0)t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63];else if(n===2)t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64];else if(n===1)t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64];return t}function QEe(e){return Tu&&Tu.isBuffer(e)}F9.exports=new ZEe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:VEe,construct:GEe,predicate:QEe,represent:KEe})});var N9=De(function(w3e,j9){var YEe=Ir(),XEe=Object.prototype.hasOwnProperty,eCe=Object.prototype.toString;function tCe(e){if(e===null)return!0;var t=[],r,i,n,o,s,c=e;for(r=0,i=c.length;r<i;r+=1){if(n=c[r],s=!1,eCe.call(n)!=="[object Object]")return!1;for(o in n)if(XEe.call(n,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function rCe(e){return e!==null?e:[]}j9.exports=new YEe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:tCe,construct:rCe})});var L9=De(function(k3e,z9){var nCe=Ir(),iCe=Object.prototype.toString;function oCe(e){if(e===null)return!0;var t,r,i,n,o,s=e;o=Array(s.length);for(t=0,r=s.length;t<r;t+=1){if(i=s[t],iCe.call(i)!=="[object Object]")return!1;if(n=Object.keys(i),n.length!==1)return!1;o[t]=[n[0],i[n[0]]]}return!0}function sCe(e){if(e===null)return[];var t,r,i,n,o,s=e;o=Array(s.length);for(t=0,r=s.length;t<r;t+=1)i=s[t],n=Object.keys(i),o[t]=[n[0],i[n[0]]];return o}z9.exports=new nCe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:oCe,construct:sCe})});var U9=De(function(I3e,B9){var aCe=Ir(),cCe=Object.prototype.hasOwnProperty;function uCe(e){if(e===null)return!0;var t,r=e;for(t in r)if(cCe.call(r,t)){if(r[t]!==null)return!1}return!0}function lCe(e){return e!==null?e:{}}B9.exports=new aCe("tag:yaml.org,2002:set",{kind:"mapping",resolve:uCe,construct:lCe})});var Kp=De(function(T3e,q9){var pCe=Iu();q9.exports=new pCe({include:[ZM()],implicit:[O9(),M9()],explicit:[$9(),N9(),L9(),U9()]})});var H9=De(function(E3e,J9){var dCe=Ir();function mCe(){return!0}function fCe(){return}function gCe(){return""}function hCe(e){return typeof e>"u"}J9.exports=new dCe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:mCe,construct:fCe,predicate:hCe,represent:gCe})});var Z9=De(function(C3e,W9){var yCe=Ir();function bCe(e){if(e===null)return!1;if(e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),i="";if(t[0]==="/"){if(r)i=r[1];if(i.length>3)return!1;if(t[t.length-i.length-1]!=="/")return!1}return!0}function xCe(e){var t=e,r=/\/([gim]*)$/.exec(e),i="";if(t[0]==="/"){if(r)i=r[1];t=t.slice(1,t.length-i.length-1)}return new RegExp(t,i)}function SCe(e){var t="/"+e.source+"/";if(e.global)t+="g";if(e.multiline)t+="m";if(e.ignoreCase)t+="i";return t}function vCe(e){return Object.prototype.toString.call(e)==="[object RegExp]"}W9.exports=new yCe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:bCe,construct:xCe,predicate:vCe,represent:SCe})});var G9=De(function(P3e,V9){var Dv;try{KM=Xi,Dv=KM("esprima")}catch(e){if(typeof window<"u")Dv=window.esprima}var KM,wCe=Ir();function kCe(e){if(e===null)return!1;try{var t="("+e+")",r=Dv.parse(t,{range:!0});if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")return!1;return!0}catch(i){return!1}}function ICe(e){var t="("+e+")",r=Dv.parse(t,{range:!0}),i=[],n;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw Error("Failed to resolve function");if(r.body[0].expression.params.forEach(function(o){i.push(o.name)}),n=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement")return Function(i,t.slice(n[0]+1,n[1]-1));return Function(i,"return "+t.slice(n[0],n[1]))}function TCe(e){return e.toString()}function ECe(e){return Object.prototype.toString.call(e)==="[object Function]"}V9.exports=new wCe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:kCe,construct:ICe,predicate:ECe,represent:TCe})});var vg=De(function(A3e,Q9){var K9=Iu();Q9.exports=K9.DEFAULT=new K9({include:[Kp()],explicit:[H9(),Z9(),G9()]})});var y5=De(function(KCe,wg){var Is=ku(),i5=Vp(),CCe=s9(),o5=Kp(),PCe=vg(),La=Object.prototype.hasOwnProperty,Mv=1,s5=2,a5=3,Fv=4,QM=1,RCe=2,Y9=3,ACe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_Ce=/[\x85\u2028\u2029]/,OCe=/[,\[\]\{\}]/,c5=/^(?:!|!!|![a-z\-]+!)$/i,u5=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function X9(e){return Object.prototype.toString.call(e)}function Po(e){return e===10||e===13}function Eu(e){return e===9||e===32}function qn(e){return e===9||e===32||e===10||e===13}function Qp(e){return e===44||e===91||e===93||e===123||e===125}function DCe(e){var t;if(48<=e&&e<=57)return e-48;if(t=e|32,97<=t&&t<=102)return t-97+10;return-1}function MCe(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function FCe(e){if(48<=e&&e<=57)return e-48;return-1}function e5(e){return e===48?"\x00":e===97?"\x07":e===98?"\b":e===116?"\t":e===9?"\t":e===110?`
|
|
23
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function $Ce(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function l5(e,t,r){if(t==="__proto__")Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r});else e[t]=r}var p5=Array(256),d5=Array(256);for(Na=0;Na<256;Na++)p5[Na]=e5(Na)?1:0,d5[Na]=e5(Na);var Na;function jCe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||PCe,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.maxTotalMergeKeys=typeof t.maxTotalMergeKeys==="number"?t.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.totalMergeKeys=0,this.documents=[]}function m5(e,t){return new i5(t,new CCe(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Le(e,t){throw m5(e,t)}function $v(e,t){if(e.onWarning)e.onWarning.call(null,m5(e,t))}var t5={YAML:function(t,r,i){var n,o,s;if(t.version!==null)Le(t,"duplication of %YAML directive");if(i.length!==1)Le(t,"YAML directive accepts exactly one argument");if(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null)Le(t,"ill-formed argument of the YAML directive");if(o=parseInt(n[1],10),s=parseInt(n[2],10),o!==1)Le(t,"unacceptable YAML version of the document");if(t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2)$v(t,"unsupported YAML version of the document")},TAG:function(t,r,i){var n,o;if(i.length!==2)Le(t,"TAG directive accepts exactly two arguments");if(n=i[0],o=i[1],!c5.test(n))Le(t,"ill-formed tag handle (first argument) of the TAG directive");if(La.call(t.tagMap,n))Le(t,'there is a previously declared suffix for "'+n+'" tag handle');if(!u5.test(o))Le(t,"ill-formed tag prefix (second argument) of the TAG directive");t.tagMap[n]=o}};function za(e,t,r,i){var n,o,s,c;if(t<r){if(c=e.input.slice(t,r),i){for(n=0,o=c.length;n<o;n+=1)if(s=c.charCodeAt(n),!(s===9||32<=s&&s<=1114111))Le(e,"expected valid JSON character")}else if(ACe.test(c))Le(e,"the stream contains non-printable characters");e.result+=c}}function r5(e,t,r,i){var n,o,s,c;if(!Is.isObject(r))Le(e,"cannot merge mappings; the provided source object is unacceptable");n=Object.keys(r);for(s=0,c=n.length;s<c;s+=1){if(o=n[s],e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys)Le(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")");if(!La.call(t,o))l5(t,o,r[o]),i[o]=!0}}function Yp(e,t,r,i,n,o,s,c){var u,l;if(Array.isArray(n)){n=Array.prototype.slice.call(n);for(u=0,l=n.length;u<l;u+=1){if(Array.isArray(n[u]))Le(e,"nested arrays are not supported inside keys");if(typeof n==="object"&&X9(n[u])==="[object Object]")n[u]="[object Object]"}}if(typeof n==="object"&&X9(n)==="[object Object]")n="[object Object]";if(n=String(n),t===null)t={};if(i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,l=o.length;u<l;u+=1)r5(e,t,o[u],r);else r5(e,t,o,r);else{if(!e.json&&!La.call(r,n)&&La.call(t,n))e.line=s||e.line,e.position=c||e.position,Le(e,"duplicated mapping key");l5(t,n,o),delete r[n]}return t}function YM(e){var t=e.input.charCodeAt(e.position);if(t===10)e.position++;else if(t===13){if(e.position++,e.input.charCodeAt(e.position)===10)e.position++}else Le(e,"a line break is expected");e.line+=1,e.lineStart=e.position}function mr(e,t,r){var i=0,n=e.input.charCodeAt(e.position);while(n!==0){while(Eu(n))n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(Po(n)){YM(e),n=e.input.charCodeAt(e.position),i++,e.lineIndent=0;while(n===32)e.lineIndent++,n=e.input.charCodeAt(++e.position)}else break}if(r!==-1&&i!==0&&e.lineIndent<r)$v(e,"deficient indentation");return i}function jv(e){var t=e.position,r;if(r=e.input.charCodeAt(t),(r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)){if(t+=3,r=e.input.charCodeAt(t),r===0||qn(r))return!0}return!1}function XM(e,t){if(t===1)e.result+=" ";else if(t>1)e.result+=Is.repeat(`
|
|
24
|
+
`,t-1)}function NCe(e,t,r){var i,n,o,s,c,u,l,p,m=e.kind,f=e.result,g;if(g=e.input.charCodeAt(e.position),qn(g)||Qp(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){if(n=e.input.charCodeAt(e.position+1),qn(n)||r&&Qp(n))return!1}e.kind="scalar",e.result="",o=s=e.position,c=!1;while(g!==0){if(g===58){if(n=e.input.charCodeAt(e.position+1),qn(n)||r&&Qp(n))break}else if(g===35){if(i=e.input.charCodeAt(e.position-1),qn(i))break}else if(e.position===e.lineStart&&jv(e)||r&&Qp(g))break;else if(Po(g))if(u=e.line,l=e.lineStart,p=e.lineIndent,mr(e,!1,-1),e.lineIndent>=t){c=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=u,e.lineStart=l,e.lineIndent=p;break}if(c)za(e,o,s,!1),XM(e,e.line-u),o=s=e.position,c=!1;if(!Eu(g))s=e.position+1;g=e.input.charCodeAt(++e.position)}if(za(e,o,s,!1),e.result)return!0;return e.kind=m,e.result=f,!1}function zCe(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;e.kind="scalar",e.result="",e.position++,i=n=e.position;while((r=e.input.charCodeAt(e.position))!==0)if(r===39)if(za(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else if(Po(r))za(e,i,n,!0),XM(e,mr(e,!1,t)),i=n=e.position;else if(e.position===e.lineStart&&jv(e))Le(e,"unexpected end of the document within a single quoted scalar");else e.position++,n=e.position;Le(e,"unexpected end of the stream within a single quoted scalar")}function LCe(e,t){var r,i,n,o,s,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;e.kind="scalar",e.result="",e.position++,r=i=e.position;while((c=e.input.charCodeAt(e.position))!==0)if(c===34)return za(e,r,e.position,!0),e.position++,!0;else if(c===92){if(za(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),Po(c))mr(e,!1,t);else if(c<256&&p5[c])e.result+=d5[c],e.position++;else if((s=MCe(c))>0){n=s,o=0;for(;n>0;n--)if(c=e.input.charCodeAt(++e.position),(s=DCe(c))>=0)o=(o<<4)+s;else Le(e,"expected hexadecimal character");e.result+=$Ce(o),e.position++}else Le(e,"unknown escape sequence");r=i=e.position}else if(Po(c))za(e,r,i,!0),XM(e,mr(e,!1,t)),r=i=e.position;else if(e.position===e.lineStart&&jv(e))Le(e,"unexpected end of the document within a double quoted scalar");else e.position++,i=e.position;Le(e,"unexpected end of the stream within a double quoted scalar")}function BCe(e,t){var r=!0,i,n=e.tag,o,s=e.anchor,c,u,l,p,m,f={},g,S,P,D;if(D=e.input.charCodeAt(e.position),D===91)u=93,m=!1,o=[];else if(D===123)u=125,m=!0,o={};else return!1;if(e.anchor!==null)e.anchorMap[e.anchor]=o;D=e.input.charCodeAt(++e.position);while(D!==0){if(mr(e,!0,t),D=e.input.charCodeAt(e.position),D===u)return e.position++,e.tag=n,e.anchor=s,e.kind=m?"mapping":"sequence",e.result=o,!0;else if(!r)Le(e,"missed comma between flow collection entries");if(S=g=P=null,l=p=!1,D===63){if(c=e.input.charCodeAt(e.position+1),qn(c))l=p=!0,e.position++,mr(e,!0,t)}if(i=e.line,Xp(e,t,Mv,!1,!0),S=e.tag,g=e.result,mr(e,!0,t),D=e.input.charCodeAt(e.position),(p||e.line===i)&&D===58)l=!0,D=e.input.charCodeAt(++e.position),mr(e,!0,t),Xp(e,t,Mv,!1,!0),P=e.result;if(m)Yp(e,o,f,S,g,P);else if(l)o.push(Yp(e,null,f,S,g,P));else o.push(g);if(mr(e,!0,t),D=e.input.charCodeAt(e.position),D===44)r=!0,D=e.input.charCodeAt(++e.position);else r=!1}Le(e,"unexpected end of the stream within a flow collection")}function UCe(e,t){var r,i,n=QM,o=!1,s=!1,c=t,u=0,l=!1,p,m;if(m=e.input.charCodeAt(e.position),m===124)i=!1;else if(m===62)i=!0;else return!1;e.kind="scalar",e.result="";while(m!==0)if(m=e.input.charCodeAt(++e.position),m===43||m===45)if(QM===n)n=m===43?Y9:RCe;else Le(e,"repeat of a chomping mode identifier");else if((p=FCe(m))>=0)if(p===0)Le(e,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!s)c=t+p-1,s=!0;else Le(e,"repeat of an indentation width identifier");else break;if(Eu(m)){do m=e.input.charCodeAt(++e.position);while(Eu(m));if(m===35)do m=e.input.charCodeAt(++e.position);while(!Po(m)&&m!==0)}while(m!==0){YM(e),e.lineIndent=0,m=e.input.charCodeAt(e.position);while((!s||e.lineIndent<c)&&m===32)e.lineIndent++,m=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>c)c=e.lineIndent;if(Po(m)){u++;continue}if(e.lineIndent<c){if(n===Y9)e.result+=Is.repeat(`
|
|
25
25
|
`,o?1+u:u);else if(n===QM){if(o)e.result+=`
|
|
26
26
|
`}break}if(i)if(Eu(m))l=!0,e.result+=Is.repeat(`
|
|
27
27
|
`,o?1+u:u);else if(l)l=!1,e.result+=Is.repeat(`
|
|
28
28
|
`,u+1);else if(u===0){if(o)e.result+=" "}else e.result+=Is.repeat(`
|
|
29
29
|
`,u);else e.result+=Is.repeat(`
|
|
30
|
-
`,o?1+u:u);o=!0,s=!0,u=0,r=e.position;while(!Po(m)&&m!==0)m=e.input.charCodeAt(++e.position);za(e,r,e.position,!1)}return!0}function n5(e,t){var r,i=e.tag,n=e.anchor,o=[],s,c=!1,u;if(e.anchor!==null)e.anchorMap[e.anchor]=o;u=e.input.charCodeAt(e.position);while(u!==0){if(u!==45)break;if(s=e.input.charCodeAt(e.position+1),!qn(s))break;if(c=!0,e.position++,mr(e,!0,-1)){if(e.lineIndent<=t){o.push(null),u=e.input.charCodeAt(e.position);continue}}if(r=e.line,Xp(e,t,a5,!1,!0),o.push(e.result),mr(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&u!==0)Le(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}if(c)return e.tag=i,e.anchor=n,e.kind="sequence",e.result=o,!0;return!1}function
|
|
31
|
-
`;if(e.charCodeAt(0)===65279)e=e.slice(1)}var r=new
|
|
30
|
+
`,o?1+u:u);o=!0,s=!0,u=0,r=e.position;while(!Po(m)&&m!==0)m=e.input.charCodeAt(++e.position);za(e,r,e.position,!1)}return!0}function n5(e,t){var r,i=e.tag,n=e.anchor,o=[],s,c=!1,u;if(e.anchor!==null)e.anchorMap[e.anchor]=o;u=e.input.charCodeAt(e.position);while(u!==0){if(u!==45)break;if(s=e.input.charCodeAt(e.position+1),!qn(s))break;if(c=!0,e.position++,mr(e,!0,-1)){if(e.lineIndent<=t){o.push(null),u=e.input.charCodeAt(e.position);continue}}if(r=e.line,Xp(e,t,a5,!1,!0),o.push(e.result),mr(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&u!==0)Le(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}if(c)return e.tag=i,e.anchor=n,e.kind="sequence",e.result=o,!0;return!1}function qCe(e,t,r){var i,n,o,s,c=e.tag,u=e.anchor,l={},p={},m=null,f=null,g=null,S=!1,P=!1,D;if(e.anchor!==null)e.anchorMap[e.anchor]=l;D=e.input.charCodeAt(e.position);while(D!==0){if(i=e.input.charCodeAt(e.position+1),o=e.line,s=e.position,(D===63||D===58)&&qn(i)){if(D===63){if(S)Yp(e,l,p,m,f,null),m=f=g=null;P=!0,S=!0,n=!0}else if(S)S=!1,n=!0;else Le(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");e.position+=1,D=i}else if(Xp(e,r,s5,!1,!0))if(e.line===o){D=e.input.charCodeAt(e.position);while(Eu(D))D=e.input.charCodeAt(++e.position);if(D===58){if(D=e.input.charCodeAt(++e.position),!qn(D))Le(e,"a whitespace character is expected after the key-value separator within a block mapping");if(S)Yp(e,l,p,m,f,null),m=f=g=null;P=!0,S=!1,n=!1,m=e.tag,f=e.result}else if(P)Le(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(P)Le(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0;else break;if(e.line===o||e.lineIndent>t){if(Xp(e,t,Fv,!0,n))if(S)f=e.result;else g=e.result;if(!S)Yp(e,l,p,m,f,g,o,s),m=f=g=null;mr(e,!0,-1),D=e.input.charCodeAt(e.position)}if(e.lineIndent>t&&D!==0)Le(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(S)Yp(e,l,p,m,f,null);if(P)e.tag=c,e.anchor=u,e.kind="mapping",e.result=l;return P}function JCe(e){var t,r=!1,i=!1,n,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null)Le(e,"duplication of a tag property");if(s=e.input.charCodeAt(++e.position),s===60)r=!0,s=e.input.charCodeAt(++e.position);else if(s===33)i=!0,n="!!",s=e.input.charCodeAt(++e.position);else n="!";if(t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);if(e.position<e.length)o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position);else Le(e,"unexpected end of the stream within a verbatim tag")}else{while(s!==0&&!qn(s)){if(s===33)if(!i){if(n=e.input.slice(t-1,e.position+1),!c5.test(n))Le(e,"named tag handle cannot contain such characters");i=!0,t=e.position+1}else Le(e,"tag suffix cannot contain exclamation marks");s=e.input.charCodeAt(++e.position)}if(o=e.input.slice(t,e.position),OCe.test(o))Le(e,"tag suffix cannot contain flow indicator characters")}if(o&&!u5.test(o))Le(e,"tag name cannot contain such characters: "+o);if(r)e.tag=o;else if(La.call(e.tagMap,n))e.tag=e.tagMap[n]+o;else if(n==="!")e.tag="!"+o;else if(n==="!!")e.tag="tag:yaml.org,2002:"+o;else Le(e,'undeclared tag handle "'+n+'"');return!0}function HCe(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;if(e.anchor!==null)Le(e,"duplication of an anchor property");r=e.input.charCodeAt(++e.position),t=e.position;while(r!==0&&!qn(r)&&!Qp(r))r=e.input.charCodeAt(++e.position);if(e.position===t)Le(e,"name of an anchor node must contain at least one character");return e.anchor=e.input.slice(t,e.position),!0}function WCe(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;i=e.input.charCodeAt(++e.position),t=e.position;while(i!==0&&!qn(i)&&!Qp(i))i=e.input.charCodeAt(++e.position);if(e.position===t)Le(e,"name of an alias node must contain at least one character");if(r=e.input.slice(t,e.position),!La.call(e.anchorMap,r))Le(e,'unidentified alias "'+r+'"');return e.result=e.anchorMap[r],mr(e,!0,-1),!0}function Xp(e,t,r,i,n){var o,s,c,u=1,l=!1,p=!1,m,f,g,S,P;if(e.listener!==null)e.listener("open",e);if(e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=c=Fv===r||a5===r,i){if(mr(e,!0,-1)){if(l=!0,e.lineIndent>t)u=1;else if(e.lineIndent===t)u=0;else if(e.lineIndent<t)u=-1}}if(u===1)while(JCe(e)||HCe(e))if(mr(e,!0,-1)){if(l=!0,c=o,e.lineIndent>t)u=1;else if(e.lineIndent===t)u=0;else if(e.lineIndent<t)u=-1}else c=!1;if(c)c=l||n;if(u===1||Fv===r){if(Mv===r||s5===r)S=t;else S=t+1;if(P=e.position-e.lineStart,u===1)if(c&&(n5(e,P)||qCe(e,P,S))||BCe(e,S))p=!0;else{if(s&&UCe(e,S)||zCe(e,S)||LCe(e,S))p=!0;else if(WCe(e)){if(p=!0,e.tag!==null||e.anchor!==null)Le(e,"alias node should not have any properties")}else if(NCe(e,S,Mv===r)){if(p=!0,e.tag===null)e.tag="?"}if(e.anchor!==null)e.anchorMap[e.anchor]=e.result}else if(u===0)p=c&&n5(e,P)}if(e.tag!==null&&e.tag!=="!")if(e.tag==="?"){if(e.result!==null&&e.kind!=="scalar")Le(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(m=0,f=e.implicitTypes.length;m<f;m+=1)if(g=e.implicitTypes[m],g.resolve(e.result)){if(e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null)e.anchorMap[e.anchor]=e.result;break}}else if(La.call(e.typeMap[e.kind||"fallback"],e.tag)){if(g=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&g.kind!==e.kind)Le(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"');if(!g.resolve(e.result))Le(e,"cannot resolve a node with !<"+e.tag+"> explicit tag");else if(e.result=g.construct(e.result),e.anchor!==null)e.anchorMap[e.anchor]=e.result}else Le(e,"unknown tag !<"+e.tag+">");if(e.listener!==null)e.listener("close",e);return e.tag!==null||e.anchor!==null||p}function ZCe(e){var t=e.position,r,i,n,o=!1,s;e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};while((s=e.input.charCodeAt(e.position))!==0){if(mr(e,!0,-1),s=e.input.charCodeAt(e.position),e.lineIndent>0||s!==37)break;o=!0,s=e.input.charCodeAt(++e.position),r=e.position;while(s!==0&&!qn(s))s=e.input.charCodeAt(++e.position);if(i=e.input.slice(r,e.position),n=[],i.length<1)Le(e,"directive name must not be less than one character in length");while(s!==0){while(Eu(s))s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Po(s));break}if(Po(s))break;r=e.position;while(s!==0&&!qn(s))s=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}if(s!==0)YM(e);if(La.call(t5,i))t5[i](e,i,n);else $v(e,'unknown document directive "'+i+'"')}if(mr(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45)e.position+=3,mr(e,!0,-1);else if(o)Le(e,"directives end mark is expected");if(Xp(e,e.lineIndent-1,Fv,!1,!0),mr(e,!0,-1),e.checkLineBreaks&&_Ce.test(e.input.slice(t,e.position)))$v(e,"non-ASCII line breaks are interpreted as content");if(e.documents.push(e.result),e.position===e.lineStart&&jv(e)){if(e.input.charCodeAt(e.position)===46)e.position+=3,mr(e,!0,-1);return}if(e.position<e.length-1)Le(e,"end of the stream or a document separator is expected");else return}function f5(e,t){if(e=String(e),t=t||{},e.length!==0){if(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13)e+=`
|
|
31
|
+
`;if(e.charCodeAt(0)===65279)e=e.slice(1)}var r=new jCe(e,t),i=e.indexOf("\x00");if(i!==-1)r.position=i,Le(r,"null byte is not allowed in input");r.input+="\x00";while(r.input.charCodeAt(r.position)===32)r.lineIndent+=1,r.position+=1;while(r.position<r.length-1)ZCe(r);return r.documents}function g5(e,t,r){if(t!==null&&typeof t==="object"&&typeof r>"u")r=t,t=null;var i=f5(e,r);if(typeof t!=="function")return i;for(var n=0,o=i.length;n<o;n+=1)t(i[n])}function h5(e,t){var r=f5(e,t);if(r.length===0)return;else if(r.length===1)return r[0];throw new i5("expected a single document in the stream, but found more")}function VCe(e,t,r){if(typeof t==="object"&&t!==null&&typeof r>"u")r=t,t=null;return g5(e,t,Is.extend({schema:o5},r))}function GCe(e,t){return h5(e,Is.extend({schema:o5},t))}KCe.loadAll=g5;KCe.load=h5;KCe.safeLoadAll=VCe;KCe.safeLoad=GCe});var L5=De(function(FPe,nF){var Ig=ku(),Tg=Vp(),tPe=vg(),rPe=Kp(),T5=Object.prototype.toString,E5=Object.prototype.hasOwnProperty,nPe=9,kg=10,iPe=13,oPe=32,sPe=33,aPe=34,C5=35,cPe=37,uPe=38,lPe=39,pPe=42,P5=44,dPe=45,R5=58,mPe=61,fPe=62,gPe=63,hPe=64,A5=91,_5=93,yPe=96,O5=123,bPe=124,D5=125,on={};on[0]="\\0";on[7]="\\a";on[8]="\\b";on[9]="\\t";on[10]="\\n";on[11]="\\v";on[12]="\\f";on[13]="\\r";on[27]="\\e";on[34]="\\\"";on[92]="\\\\";on[133]="\\N";on[160]="\\_";on[8232]="\\L";on[8233]="\\P";var xPe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function SPe(e,t){var r,i,n,o,s,c,u;if(t===null)return{};r={},i=Object.keys(t);for(n=0,o=i.length;n<o;n+=1){if(s=i[n],c=String(t[s]),s.slice(0,2)==="!!")s="tag:yaml.org,2002:"+s.slice(2);if(u=e.compiledTypeMap.fallback[s],u&&E5.call(u.styleAliases,c))c=u.styleAliases[c];r[s]=c}return r}function b5(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Tg("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ig.repeat("0",i-t.length)+t}function vPe(e){this.schema=e.schema||tPe,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ig.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=SPe(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function x5(e,t){var r=Ig.repeat(" ",t),i=0,n=-1,o="",s,c=e.length;while(i<c){if(n=e.indexOf(`
|
|
32
32
|
`,i),n===-1)s=e.slice(i),i=c;else s=e.slice(i,n+1),i=n+1;if(s.length&&s!==`
|
|
33
33
|
`)o+=r;o+=s}return o}function eF(e,t){return`
|
|
34
|
-
`+Ig.repeat(" ",e.indent*t)}function
|
|
34
|
+
`+Ig.repeat(" ",e.indent*t)}function wPe(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function rF(e){return e===oPe||e===nPe}function ed(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function kPe(e){return ed(e)&&!rF(e)&&e!==65279&&e!==iPe&&e!==kg}function S5(e,t){return ed(e)&&e!==65279&&e!==P5&&e!==A5&&e!==_5&&e!==O5&&e!==D5&&e!==R5&&(e!==C5||t&&kPe(t))}function IPe(e){return ed(e)&&e!==65279&&!rF(e)&&e!==dPe&&e!==gPe&&e!==R5&&e!==P5&&e!==A5&&e!==_5&&e!==O5&&e!==D5&&e!==C5&&e!==uPe&&e!==pPe&&e!==sPe&&e!==bPe&&e!==mPe&&e!==fPe&&e!==lPe&&e!==aPe&&e!==cPe&&e!==hPe&&e!==yPe}function M5(e){var t=/^\n* /;return t.test(e)}var F5=1,$5=2,j5=3,N5=4,Nv=5;function TPe(e,t,r,i,n){var o,s,c,u=!1,l=!1,p=i!==-1,m=-1,f=IPe(e.charCodeAt(0))&&!rF(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(s=e.charCodeAt(o),!ed(s))return Nv;c=o>0?e.charCodeAt(o-1):null,f=f&&S5(s,c)}else{for(o=0;o<e.length;o++){if(s=e.charCodeAt(o),s===kg){if(u=!0,p)l=l||o-m-1>i&&e[m+1]!==" ",m=o}else if(!ed(s))return Nv;c=o>0?e.charCodeAt(o-1):null,f=f&&S5(s,c)}l=l||p&&(o-m-1>i&&e[m+1]!==" ")}if(!u&&!l)return f&&!n(e)?F5:$5;if(r>9&&M5(e))return Nv;return l?N5:j5}function EPe(e,t,r,i){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&xPe.indexOf(t)!==-1)return"'"+t+"'";var n=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-n),s=i||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return wPe(e,u)}switch(TPe(t,s,e.indent,o,c)){case F5:return t;case $5:return"'"+t.replace(/'/g,"''")+"'";case j5:return"|"+v5(t,e.indent)+w5(x5(t,n));case N5:return">"+v5(t,e.indent)+w5(x5(CPe(t,o),n));case Nv:return'"'+PPe(t,o)+'"';default:throw new Tg("impossible error: invalid scalar style")}}()}function v5(e,t){var r=M5(e)?String(t):"",i=e[e.length-1]===`
|
|
35
35
|
`,n=i&&(e[e.length-2]===`
|
|
36
36
|
`||e===`
|
|
37
37
|
`),o=n?"+":i?"":"-";return r+o+`
|
|
38
38
|
`}function w5(e){return e[e.length-1]===`
|
|
39
|
-
`?e.slice(0,-1):e}function
|
|
39
|
+
`?e.slice(0,-1):e}function CPe(e,t){var r=/(\n+)([^\n]*)/g,i=function(){var l=e.indexOf(`
|
|
40
40
|
`);return l=l!==-1?l:e.length,r.lastIndex=l,k5(e.slice(0,l),t)}(),n=e[0]===`
|
|
41
41
|
`||e[0]===" ",o,s;while(s=r.exec(e)){var c=s[1],u=s[2];o=u[0]===" ",i+=c+(!n&&!o&&u!==""?`
|
|
42
42
|
`:"")+k5(u,t),n=o}return i}function k5(e,t){if(e===""||e[0]===" ")return e;var r=/ [^ ]/g,i,n=0,o,s=0,c=0,u="";while(i=r.exec(e)){if(c=i.index,c-n>t)o=s>n?s:c,u+=`
|
|
43
43
|
`+e.slice(n,o),n=o+1;s=c}if(u+=`
|
|
44
44
|
`,e.length-n>t&&s>n)u+=e.slice(n,s)+`
|
|
45
|
-
`+e.slice(s+1);else u+=e.slice(n);return u.slice(1)}function
|
|
46
|
-
`;return""}function
|
|
45
|
+
`+e.slice(s+1);else u+=e.slice(n);return u.slice(1)}function PPe(e){var t="",r,i,n;for(var o=0;o<e.length;o++){if(r=e.charCodeAt(o),r>=55296&&r<=56319){if(i=e.charCodeAt(o+1),i>=56320&&i<=57343){t+=b5((r-55296)*1024+i-56320+65536),o++;continue}}n=on[r],t+=!n&&ed(r)?e[o]:n||b5(r)}return t}function RPe(e,t,r){var i="",n=e.tag,o,s;for(o=0,s=r.length;o<s;o+=1)if(Cu(e,t,r[o],!1,!1)){if(o!==0)i+=","+(!e.condenseFlow?" ":"");i+=e.dump}e.tag=n,e.dump="["+i+"]"}function APe(e,t,r,i){var n="",o=e.tag,s,c;for(s=0,c=r.length;s<c;s+=1)if(Cu(e,t+1,r[s],!0,!0)){if(!i||s!==0)n+=eF(e,t);if(e.dump&&kg===e.dump.charCodeAt(0))n+="-";else n+="- ";n+=e.dump}e.tag=o,e.dump=n||"[]"}function _Pe(e,t,r){var i="",n=e.tag,o=Object.keys(r),s,c,u,l,p;for(s=0,c=o.length;s<c;s+=1){if(p="",s!==0)p+=", ";if(e.condenseFlow)p+='"';if(u=o[s],l=r[u],!Cu(e,t,u,!1,!1))continue;if(e.dump.length>1024)p+="? ";if(p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!Cu(e,t,l,!1,!1))continue;p+=e.dump,i+=p}e.tag=n,e.dump="{"+i+"}"}function OPe(e,t,r,i){var n="",o=e.tag,s=Object.keys(r),c,u,l,p,m,f;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys==="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Tg("sortKeys must be a boolean or a function");for(c=0,u=s.length;c<u;c+=1){if(f="",!i||c!==0)f+=eF(e,t);if(l=s[c],p=r[l],!Cu(e,t+1,l,!0,!0,!0))continue;if(m=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,m)if(e.dump&&kg===e.dump.charCodeAt(0))f+="?";else f+="? ";if(f+=e.dump,m)f+=eF(e,t);if(!Cu(e,t+1,p,!0,m))continue;if(e.dump&&kg===e.dump.charCodeAt(0))f+=":";else f+=": ";f+=e.dump,n+=f}e.tag=o,e.dump=n||"{}"}function I5(e,t,r){var i,n,o,s,c,u;n=r?e.explicitTypes:e.implicitTypes;for(o=0,s=n.length;o<s;o+=1)if(c=n[o],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t==="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(e.tag=r?c.tag:"?",c.represent){if(u=e.styleMap[c.tag]||c.defaultStyle,T5.call(c.represent)==="[object Function]")i=c.represent(t,u);else if(E5.call(c.represent,u))i=c.represent[u](t,u);else throw new Tg("!<"+c.tag+'> tag resolver accepts not "'+u+'" style');e.dump=i}return!0}return!1}function Cu(e,t,r,i,n,o){if(e.tag=null,e.dump=r,!I5(e,r,!1))I5(e,r,!0);var s=T5.call(e.dump);if(i)i=e.flowLevel<0||e.flowLevel>t;var c=s==="[object Object]"||s==="[object Array]",u,l;if(c)u=e.duplicates.indexOf(r),l=u!==-1;if(e.tag!==null&&e.tag!=="?"||l||e.indent!==2&&t>0)n=!1;if(l&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(c&&l&&!e.usedDuplicates[u])e.usedDuplicates[u]=!0;if(s==="[object Object]"){if(i&&Object.keys(e.dump).length!==0){if(OPe(e,t,e.dump,n),l)e.dump="&ref_"+u+e.dump}else if(_Pe(e,t,e.dump),l)e.dump="&ref_"+u+" "+e.dump}else if(s==="[object Array]"){var p=e.noArrayIndent&&t>0?t-1:t;if(i&&e.dump.length!==0){if(APe(e,p,e.dump,n),l)e.dump="&ref_"+u+e.dump}else if(RPe(e,p,e.dump),l)e.dump="&ref_"+u+" "+e.dump}else if(s==="[object String]"){if(e.tag!=="?")EPe(e,e.dump,t,o)}else{if(e.skipInvalid)return!1;throw new Tg("unacceptable kind of an object to dump "+s)}if(e.tag!==null&&e.tag!=="?")e.dump="!<"+e.tag+"> "+e.dump}return!0}function DPe(e,t){var r=[],i=[],n,o;tF(e,r,i);for(n=0,o=i.length;n<o;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=Array(o)}function tF(e,t,r){var i,n,o;if(e!==null&&typeof e==="object")if(n=t.indexOf(e),n!==-1){if(r.indexOf(n)===-1)r.push(n)}else if(t.push(e),Array.isArray(e))for(n=0,o=e.length;n<o;n+=1)tF(e[n],t,r);else{i=Object.keys(e);for(n=0,o=i.length;n<o;n+=1)tF(e[i[n]],t,r)}}function z5(e,t){t=t||{};var r=new vPe(t);if(!r.noRefs)DPe(e,r);if(Cu(r,0,e,!0,!0))return r.dump+`
|
|
46
|
+
`;return""}function MPe(e,t){return z5(e,Ig.extend({schema:rPe},t))}FPe.dump=z5;FPe.safeDump=MPe});var U5=De(function(NPe,rr){var zv=y5(),B5=L5();function Lv(e){return function(){throw Error("Function "+e+" is deprecated and cannot be used.")}}NPe.Type=Ir();NPe.Schema=Iu();NPe.FAILSAFE_SCHEMA=Ov();NPe.JSON_SCHEMA=WM();NPe.CORE_SCHEMA=ZM();NPe.DEFAULT_SAFE_SCHEMA=Kp();NPe.DEFAULT_FULL_SCHEMA=vg();NPe.load=zv.load;NPe.loadAll=zv.loadAll;NPe.safeLoad=zv.safeLoad;NPe.safeLoadAll=zv.safeLoadAll;NPe.dump=B5.dump;NPe.safeDump=B5.safeDump;NPe.YAMLException=Vp();NPe.MINIMAL_SCHEMA=Ov();NPe.SAFE_SCHEMA=Kp();NPe.DEFAULT_SCHEMA=vg();NPe.scan=Lv("scan");NPe.parse=Lv("parse");NPe.compose=Lv("compose");NPe.addConstructor=Lv("addConstructor")});var J5=De(function(_3e,q5){var sRe=U5();q5.exports=sRe});var aF=De(function(oF,sF){var Bv=J5(),iF=oF=sF.exports;iF.yaml={parse:Bv.safeLoad.bind(Bv),stringify:Bv.safeDump.bind(Bv)};iF.json={parse:JSON.parse.bind(JSON),stringify:function(e,t){let r=Object.assign({replacer:null,space:2},t);return JSON.stringify(e,r.replacer,r.space)}};iF.javascript={parse:function parse(str,options,wrap){try{if(wrap!==!1)str=`(function() {
|
|
47
47
|
return `+str.trim()+`;
|
|
48
|
-
}());`;return eval(str)||{}}catch(e){if(wrap!==!1&&/(unexpected|identifier)/i.test(e.message))return parse(str,options,!1);throw SyntaxError(e)}},stringify:function(){throw Error("stringifying JavaScript is not supported")}}});var W5=De(function(
|
|
48
|
+
}());`;return eval(str)||{}}catch(e){if(wrap!==!1&&/(unexpected|identifier)/i.test(e.message))return parse(str,options,!1);throw SyntaxError(e)}},stringify:function(){throw Error("stringifying JavaScript is not supported")}}});var W5=De(function(O3e,H5){/*!
|
|
49
49
|
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
50
50
|
*
|
|
51
51
|
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
52
52
|
* Released under the MIT License.
|
|
53
|
-
*/H5.exports=function(e){if(typeof e==="string"&&e.charAt(0)==="\uFEFF")return e.slice(1);return e}});var Uv=De(function(
|
|
53
|
+
*/H5.exports=function(e){if(typeof e==="string"&&e.charAt(0)==="\uFEFF")return e.slice(1);return e}});var Uv=De(function(aRe){var Z5=W5(),V5=xg();aRe.define=function(e,t,r){Reflect.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:r})};aRe.isBuffer=function(e){return V5(e)==="buffer"};aRe.isObject=function(e){return V5(e)==="object"};aRe.toBuffer=function(e){return typeof e==="string"?Buffer.from(e):e};aRe.toString=function(e){if(aRe.isBuffer(e))return Z5(String(e));if(typeof e!=="string")throw TypeError("expected input to be a string or buffer");return Z5(e)};aRe.arrayify=function(e){return e?Array.isArray(e)?e:[e]:[]};aRe.startsWith=function(e,t,r){if(typeof r!=="number")r=t.length;return e.slice(0,r)===t}});var Eg=De(function(M3e,K5){var fRe=aF(),gRe=Uv();K5.exports=function(e){let t=Object.assign({},e);if(t.delimiters=gRe.arrayify(t.delims||t.delimiters||"---"),t.delimiters.length===1)t.delimiters.push(t.delimiters[0]);return t.language=(t.language||t.lang||"yaml").toLowerCase(),t.engines=Object.assign({},fRe,t.parsers,t.engines),t}});var cF=De(function(F3e,Q5){Q5.exports=function(e,t){let r=t.engines[e]||t.engines[hRe(e)];if(typeof r>"u")throw Error('gray-matter engine "'+e+'" is not registered');if(typeof r==="function")r={parse:r};return r};function hRe(e){switch(e.toLowerCase()){case"js":case"javascript":return"javascript";case"coffee":case"coffeescript":case"cson":return"coffee";case"yaml":case"yml":return"yaml";default:return e}}});var uF=De(function($3e,Y5){var yRe=xg(),bRe=cF(),xRe=Eg();Y5.exports=function(e,t,r){if(t==null&&r==null)switch(yRe(e)){case"object":t=e.data,r={};break;case"string":return e;default:throw TypeError("expected file to be a string or object")}let i=e.content,n=xRe(r);if(t==null){if(!n.data)return e;t=n.data}let o=e.language||n.language,s=bRe(o,n);if(typeof s.stringify!=="function")throw TypeError('expected "'+o+'.stringify" to be a function');t=Object.assign({},e.data,t);let c=n.delimiters[0],u=n.delimiters[1],l=s.stringify(t,r).trim(),p="";if(l!=="{}")p=td(c)+td(l)+td(u);if(typeof e.excerpt==="string"&&e.excerpt!==""){if(i.indexOf(e.excerpt.trim())===-1)p+=td(e.excerpt)+td(u)}return p+td(i)};function td(e){return e.slice(-1)!==`
|
|
54
54
|
`?e+`
|
|
55
|
-
`:e}});var eY=De(function(
|
|
56
|
-
`+r.delimiters[1],o=e.content;if(r.language)e.language=r.language;let s=i.length;if(!aY.startsWith(o,i,s))return sY(e,r),e;if(o.charAt(s)===i.slice(-1))return e;o=o.slice(s);let c=o.length,u=wn.language(o,r);if(u.name)e.language=u.name,o=o.slice(u.raw.length);let l=o.indexOf(n);if(l===-1)l=c;if(e.matter=o.slice(0,l),e.matter.replace(/^\s*#[^\n]+/gm,"").trim()==="")e.isEmpty=!0,e.empty=e.content,e.data={};else e.data=
|
|
57
|
-
`)e.content=e.content.slice(1)}if(sY(e,r),r.sections===!0||typeof r.section==="function")
|
|
55
|
+
`:e}});var eY=De(function(j3e,X5){var SRe=Eg();X5.exports=function(e,t){let r=SRe(t);if(e.data==null)e.data={};if(typeof r.excerpt==="function")return r.excerpt(e,r);let i=e.data.excerpt_separator||r.excerpt_separator;if(i==null&&(r.excerpt===!1||r.excerpt==null))return e;let n=typeof r.excerpt==="string"?r.excerpt:i||r.delimiters[0],o=e.content.indexOf(n);if(o!==-1)e.excerpt=e.content.slice(0,o);return e}});var nY=De(function(N3e,rY){var tY=xg(),vRe=uF(),rd=Uv();rY.exports=function(e){if(tY(e)!=="object")e={content:e};if(tY(e.data)!=="object")e.data={};if(e.contents&&e.content==null)e.content=e.contents;return rd.define(e,"orig",rd.toBuffer(e.content)),rd.define(e,"language",e.language||""),rd.define(e,"matter",e.matter||""),rd.define(e,"stringify",function(t,r){if(r&&r.language)e.language=r.language;return vRe(e,t,r)}),e.content=rd.toString(e.content),e.isEmpty=!1,e.excerpt="",e}});var oY=De(function(z3e,iY){var wRe=cF(),kRe=Eg();iY.exports=function(e,t,r){let i=kRe(r),n=wRe(e,i);if(typeof n.parse!=="function")throw TypeError('expected "'+e+'.parse" to be a function');return n.parse(t,i)}});var pF=De(function(L3e,cY){var IRe=Xi("fs"),TRe=t9(),lF=Eg(),ERe=uF(),sY=eY(),CRe=aF(),PRe=nY(),RRe=oY(),aY=Uv();function wn(e,t){if(e==="")return{data:{},content:e,excerpt:"",orig:e};let r=PRe(e),i=wn.cache[r.content];if(!t){if(i)return r=Object.assign({},i),r.orig=i.orig,r;wn.cache[r.content]=r}return ARe(r,t)}function ARe(e,t){let r=lF(t),i=r.delimiters[0],n=`
|
|
56
|
+
`+r.delimiters[1],o=e.content;if(r.language)e.language=r.language;let s=i.length;if(!aY.startsWith(o,i,s))return sY(e,r),e;if(o.charAt(s)===i.slice(-1))return e;o=o.slice(s);let c=o.length,u=wn.language(o,r);if(u.name)e.language=u.name,o=o.slice(u.raw.length);let l=o.indexOf(n);if(l===-1)l=c;if(e.matter=o.slice(0,l),e.matter.replace(/^\s*#[^\n]+/gm,"").trim()==="")e.isEmpty=!0,e.empty=e.content,e.data={};else e.data=RRe(e.language,e.matter,r);if(l===c)e.content="";else{if(e.content=o.slice(l+n.length),e.content[0]==="\r")e.content=e.content.slice(1);if(e.content[0]===`
|
|
57
|
+
`)e.content=e.content.slice(1)}if(sY(e,r),r.sections===!0||typeof r.section==="function")TRe(e,r.section);return e}wn.engines=CRe;wn.stringify=function(e,t,r){if(typeof e==="string")e=wn(e,r);return ERe(e,t,r)};wn.read=function(e,t){let r=IRe.readFileSync(e,"utf8"),i=wn(r,t);return i.path=e,i};wn.test=function(e,t){return aY.startsWith(e,lF(t).delimiters[0])};wn.language=function(e,t){let i=lF(t).delimiters[0];if(wn.test(e))e=e.slice(i.length);let n=e.slice(0,e.search(/\r?\n/));return{raw:n,name:n?n.trim():""}};wn.cache={};wn.clearCache=function(){wn.cache={}};cY.exports=wn});var R8=De(function(ket,P8){var cw=Object.prototype.hasOwnProperty,C8=Object.prototype.toString,v8=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,k8=function(t){if(typeof Array.isArray==="function")return Array.isArray(t);return C8.call(t)==="[object Array]"},I8=function(t){if(!t||C8.call(t)!=="[object Object]")return!1;var r=cw.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&cw.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!i)return!1;var n;for(n in t);return typeof n>"u"||cw.call(t,n)},T8=function(t,r){if(v8&&r.name==="__proto__")v8(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0});else t[r.name]=r.newValue},E8=function(t,r){if(r==="__proto__"){if(!cw.call(t,r))return;else if(w8)return w8(t,r).value}return t[r]};P8.exports=function e(){var t,r,i,n,o,s,c=arguments[0],u=1,l=arguments.length,p=!1;if(typeof c==="boolean")p=c,c=arguments[1]||{},u=2;if(c==null||typeof c!=="object"&&typeof c!=="function")c={};for(;u<l;++u)if(t=arguments[u],t!=null){for(r in t)if(i=E8(c,r),n=E8(t,r),c!==n){if(p&&n&&(I8(n)||(o=k8(n)))){if(o)o=!1,s=i&&k8(i)?i:[];else s=i&&I8(i)?i:{};T8(c,{name:r,newValue:e(p,s,n)})}else if(typeof n<"u")T8(c,{name:r,newValue:n})}}return c}});import{readFileSync as D$e}from"fs";import{join as M$e}from"path";function _e(e,t){if(e instanceof Error)return e.message;return t??String(e)}function Qte(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zr={},nh={},As={},gj;function Ed(){if(gj)return As;gj=1;function e(s){return typeof s>"u"||s===null}function t(s){return typeof s==="object"&&s!==null}function r(s){if(Array.isArray(s))return s;else if(e(s))return[];return[s]}function i(s,c){if(c){let u=Object.keys(c);for(let l=0,p=u.length;l<p;l+=1){let m=u[l];s[m]=c[m]}}return s}function n(s,c){let u="";for(let l=0;l<c;l+=1)u+=s;return u}function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return As.isNothing=e,As.isObject=t,As.toArray=r,As.repeat=n,As.isNegativeZero=o,As.extend=i,As}var Jw,hj;function Cd(){if(hj)return Jw;hj=1;function e(r,i){let n="",o=r.reason||"(unknown reason)";if(!r.mark)return o;if(r.mark.name)n+='in "'+r.mark.name+'" ';if(n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet)n+=`
|
|
58
58
|
|
|
59
59
|
`+r.mark.snippet;return o+" "+n}function t(r,i){if(Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(i){return this.name+": "+e(this,i)},Jw=t,Jw}var Hw,yj;function Yte(){if(yj)return Hw;yj=1;let e=Ed();function t(n,o,s,c,u){let l="",p="",m=Math.floor(u/2)-1;if(c-o>m)l=" ... ",o=c-m+l.length;if(s-c>m)p=" ...",s=c+m-p.length;return{str:l+n.slice(o,s).replace(/\t/g,"\u2192")+p,pos:c-o+l.length}}function r(n,o){return e.repeat(" ",o-n.length)+n}function i(n,o){if(o=Object.create(o||null),!n.buffer)return null;if(!o.maxLength)o.maxLength=79;if(typeof o.indent!=="number")o.indent=1;if(typeof o.linesBefore!=="number")o.linesBefore=3;if(typeof o.linesAfter!=="number")o.linesAfter=2;let s=/\r?\n|\r|\0/g,c=[0],u=[],l,p=-1;while(l=s.exec(n.buffer))if(u.push(l.index),c.push(l.index+l[0].length),n.position<=l.index&&p<0)p=c.length-2;if(p<0)p=c.length-1;let m="",f=Math.min(n.line+o.linesAfter,u.length).toString().length,g=o.maxLength-(o.indent+f+3);for(let P=1;P<=o.linesBefore;P++){if(p-P<0)break;let D=t(n.buffer,c[p-P],u[p-P],n.position-(c[p]-c[p-P]),g);m=e.repeat(" ",o.indent)+r((n.line-P+1).toString(),f)+" | "+D.str+`
|
|
60
60
|
`+m}let S=t(n.buffer,c[p],u[p],n.position,g);m+=e.repeat(" ",o.indent)+r((n.line+1).toString(),f)+" | "+S.str+`
|
|
@@ -85,7 +85,7 @@ return `+str.trim()+`;
|
|
|
85
85
|
`+x.slice(U,Y),U=Y+1;G=ke}if(ve+=`
|
|
86
86
|
`,x.length-U>R&&G>U)ve+=x.slice(U,G)+`
|
|
87
87
|
`+x.slice(G+1);else ve+=x.slice(U);return ve.slice(1)}function kd(x){let R="",J=0;for(let B=0;B<x.length;J>=65536?B+=2:B++){J=Ie(x,B);let U=xe[J];if(!U&&En(J)){if(R+=x[B],J>=65536)R+=x[B+1]}else R+=U||ft(J)}return R}function Lu(x,R,J){let B="",U=x.tag;for(let Y=0,G=J.length;Y<G;Y+=1){let ke=J[Y];if(x.replacer)ke=x.replacer.call(J,String(Y),ke);if(A(x,R,ke,!1,!1)||typeof ke>"u"&&A(x,R,null,!1,!1)){if(B!=="")B+=","+(!x.condenseFlow?" ":"");B+=x.dump}}x.tag=U,x.dump="["+B+"]"}function j(x,R,J,B){let U="",Y=x.tag;for(let G=0,ke=J.length;G<ke;G+=1){let ve=J[G];if(x.replacer)ve=x.replacer.call(J,String(G),ve);if(A(x,R+1,ve,!0,!0,!1,!0)||typeof ve>"u"&&A(x,R+1,null,!0,!0,!1,!0)){if(!B||U!=="")U+=I(x,R);if(x.dump&&c===x.dump.charCodeAt(0))U+="-";else U+="- ";U+=x.dump}}x.tag=Y,x.dump=U||"[]"}function N(x,R,J){let B="",U=x.tag,Y=Object.keys(J);for(let G=0,ke=Y.length;G<ke;G+=1){let ve="";if(B!=="")ve+=", ";if(x.condenseFlow)ve+='"';let Oe=Y[G],ze=J[Oe];if(x.replacer)ze=x.replacer.call(J,Oe,ze);if(!A(x,R,Oe,!1,!1))continue;if(x.dump.length>1024)ve+="? ";if(ve+=x.dump+(x.condenseFlow?'"':"")+":"+(x.condenseFlow?"":" "),!A(x,R,ze,!1,!1))continue;ve+=x.dump,B+=ve}x.tag=U,x.dump="{"+B+"}"}function d(x,R,J,B){let U="",Y=x.tag,G=Object.keys(J);if(x.sortKeys===!0)G.sort();else if(typeof x.sortKeys==="function")G.sort(x.sortKeys);else if(x.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let ke=0,ve=G.length;ke<ve;ke+=1){let Oe="";if(!B||U!=="")Oe+=I(x,R);let ze=G[ke],ut=J[ze];if(x.replacer)ut=x.replacer.call(J,ze,ut);if(!A(x,R+1,ze,!0,!0,!0))continue;let Mt=x.tag!==null&&x.tag!=="?"||x.dump&&x.dump.length>1024;if(Mt)if(x.dump&&c===x.dump.charCodeAt(0))Oe+="?";else Oe+="? ";if(Oe+=x.dump,Mt)Oe+=I(x,R);if(!A(x,R+1,ut,!0,Mt))continue;if(x.dump&&c===x.dump.charCodeAt(0))Oe+=":";else Oe+=": ";Oe+=x.dump,U+=Oe}x.tag=Y,x.dump=U||"{}"}function T(x,R,J){let B=J?x.explicitTypes:x.implicitTypes;for(let U=0,Y=B.length;U<Y;U+=1){let G=B[U];if((G.instanceOf||G.predicate)&&(!G.instanceOf||typeof R==="object"&&R instanceof G.instanceOf)&&(!G.predicate||G.predicate(R))){if(J)if(G.multi&&G.representName)x.tag=G.representName(R);else x.tag=G.tag;else x.tag="?";if(G.represent){let ke=x.styleMap[G.tag]||G.defaultStyle,ve;if(i.call(G.represent)==="[object Function]")ve=G.represent(R,ke);else if(n.call(G.represent,ke))ve=G.represent[ke](R,ke);else throw new t("!<"+G.tag+'> tag resolver accepts not "'+ke+'" style');x.dump=ve}return!0}}return!1}function A(x,R,J,B,U,Y,G){if(x.tag=null,x.dump=J,!T(x,J,!1))T(x,J,!0);let ke=i.call(x.dump),ve=B;if(B)B=x.flowLevel<0||x.flowLevel>R;let Oe=ke==="[object Object]"||ke==="[object Array]",ze,ut;if(Oe)ze=x.duplicates.indexOf(J),ut=ze!==-1;if(x.tag!==null&&x.tag!=="?"||ut||x.indent!==2&&R>0)U=!1;if(ut&&x.usedDuplicates[ze])x.dump="*ref_"+ze;else{if(Oe&&ut&&!x.usedDuplicates[ze])x.usedDuplicates[ze]=!0;if(ke==="[object Object]"){if(B&&Object.keys(x.dump).length!==0){if(d(x,R,x.dump,U),ut)x.dump="&ref_"+ze+x.dump}else if(N(x,R,x.dump),ut)x.dump="&ref_"+ze+" "+x.dump}else if(ke==="[object Array]"){if(B&&x.dump.length!==0){if(x.noArrayIndent&&!G&&R>0)j(x,R-1,x.dump,U);else j(x,R,x.dump,U);if(ut)x.dump="&ref_"+ze+x.dump}else if(Lu(x,R,x.dump),ut)x.dump="&ref_"+ze+" "+x.dump}else if(ke==="[object String]"){if(x.tag!=="?")Nu(x,x.dump,R,Y,ve)}else if(ke==="[object Undefined]")return!1;else{if(x.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+ke)}if(x.tag!==null&&x.tag!=="?"){let Mt=encodeURI(x.tag[0]==="!"?x.tag.slice(1):x.tag).replace(/!/g,"%21");if(x.tag[0]==="!")Mt="!"+Mt;else if(Mt.slice(0,18)==="tag:yaml.org,2002:")Mt="!!"+Mt.slice(18);else Mt="!<"+Mt+">";x.dump=Mt+" "+x.dump}}return!0}function z(x,R){let J=[],B=[];M(x,J,B);let U=B.length;for(let Y=0;Y<U;Y+=1)R.duplicates.push(J[B[Y]]);R.usedDuplicates=Array(U)}function M(x,R,J){if(x!==null&&typeof x==="object"){let B=R.indexOf(x);if(B!==-1){if(J.indexOf(B)===-1)J.push(B)}else if(R.push(x),Array.isArray(x))for(let U=0,Y=x.length;U<Y;U+=1)M(x[U],R,J);else{let U=Object.keys(x);for(let Y=0,G=U.length;Y<G;Y+=1)M(x[U[Y]],R,J)}}}function Z(x,R){R=R||{};let J=new zt(R);if(!J.noRefs)z(x,J);let B=x;if(J.replacer)B=J.replacer.call({"":B},"",B);if(A(J,0,B,!0,!0))return J.dump+`
|
|
88
|
-
`;return""}return pk.dump=Z,pk}var zj;function tre(){if(zj)return Zr;zj=1;let e=Xte(),t=ere();function r(i,n){return function(){throw Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Zr.Type=cn(),Zr.Schema=Lj(),Zr.FAILSAFE_SCHEMA=Jj(),Zr.JSON_SCHEMA=Gj(),Zr.CORE_SCHEMA=Kj(),Zr.DEFAULT_SCHEMA=dk(),Zr.load=e.load,Zr.loadAll=e.loadAll,Zr.dump=t.dump,Zr.YAMLException=Cd(),Zr.types={binary:Xj(),float:Vj(),map:qj(),null:Hj(),pairs:tN(),set:rN(),timestamp:Qj(),bool:Wj(),int:Zj(),merge:Yj(),omap:eN(),seq:Uj(),str:Bj()},Zr.safeLoad=r("safeLoad","load"),Zr.safeLoadAll=r("safeLoadAll","loadAll"),Zr.safeDump=r("safeDump","dump"),Zr}var rre=tre(),nre=Qte(rre),{Type:N$e,Schema:z$e,FAILSAFE_SCHEMA:L$e,JSON_SCHEMA:B$e,CORE_SCHEMA:U$e,DEFAULT_SCHEMA:q$e,load:mk,loadAll:J$e,dump:nN,YAMLException:H$e,types:W$e,safeLoad:Z$e,safeLoadAll:V$e,safeDump:G$e}=nre;function gk(e){return mk(e)}var a={};pi(a,{$brand:()=>yk,$input:()=>OE,$output:()=>_E,NEVER:()=>hk,TimePrecision:()=>jE,ZodAny:()=>CP,ZodArray:()=>_P,ZodBase64:()=>Ty,ZodBase64URL:()=>Ey,ZodBigInt:()=>yl,ZodBigIntFormat:()=>Ry,ZodBoolean:()=>hl,ZodCIDRv4:()=>ky,ZodCIDRv6:()=>Iy,ZodCUID:()=>hy,ZodCUID2:()=>yy,ZodCatch:()=>XP,ZodCodec:()=>cm,ZodCustom:()=>um,ZodCustomStringFormat:()=>fl,ZodDate:()=>nm,ZodDefault:()=>ZP,ZodDiscriminatedUnion:()=>DP,ZodE164:()=>Cy,ZodEmail:()=>my,ZodEmoji:()=>fy,ZodEnum:()=>dl,ZodError:()=>JN,ZodExactOptional:()=>JP,ZodFile:()=>UP,ZodFirstPartyTypeKind:()=>dR,ZodFunction:()=>uR,ZodGUID:()=>Yd,ZodIPv4:()=>vy,ZodIPv6:()=>wy,ZodISODate:()=>ay,ZodISODateTime:()=>sy,ZodISODuration:()=>uy,ZodISOTime:()=>cy,ZodIntersection:()=>MP,ZodIssueCode:()=>Fie,ZodJWT:()=>Py,ZodKSUID:()=>Sy,ZodLazy:()=>sR,ZodLiteral:()=>BP,ZodMAC:()=>SP,ZodMap:()=>zP,ZodNaN:()=>tR,ZodNanoID:()=>gy,ZodNever:()=>RP,ZodNonOptional:()=>Fy,ZodNull:()=>TP,ZodNullable:()=>WP,ZodNumber:()=>gl,ZodNumberFormat:()=>sc,ZodObject:()=>om,ZodOptional:()=>My,ZodPipe:()=>am,ZodPrefault:()=>GP,ZodPreprocess:()=>rR,ZodPromise:()=>cR,ZodReadonly:()=>nR,ZodRealError:()=>Rn,ZodRecord:()=>pl,ZodSet:()=>LP,ZodString:()=>ml,ZodStringFormat:()=>wt,ZodSuccess:()=>YP,ZodSymbol:()=>kP,ZodTemplateLiteral:()=>oR,ZodTransform:()=>qP,ZodTuple:()=>$P,ZodType:()=>nt,ZodULID:()=>by,ZodURL:()=>rm,ZodUUID:()=>io,ZodUndefined:()=>IP,ZodUnion:()=>sm,ZodUnknown:()=>PP,ZodVoid:()=>AP,ZodXID:()=>xy,ZodXor:()=>OP,_ZodString:()=>dy,_default:()=>VP,_function:()=>Yz,any:()=>Rz,array:()=>im,base64:()=>dz,base64url:()=>mz,bigint:()=>Iz,boolean:()=>wP,catch:()=>eR,check:()=>Xz,cidrv4:()=>lz,cidrv6:()=>pz,clone:()=>un,codec:()=>Vz,coerce:()=>mR,config:()=>Kt,core:()=>Mo,cuid:()=>rz,cuid2:()=>nz,custom:()=>eL,date:()=>_z,decode:()=>mP,decodeAsync:()=>gP,describe:()=>tL,discriminatedUnion:()=>jz,e164:()=>fz,email:()=>WN,emoji:()=>ez,encode:()=>dP,encodeAsync:()=>fP,endsWith:()=>tl,enum:()=>Oy,exactOptional:()=>HP,file:()=>Jz,flattenError:()=>Fd,float32:()=>Sz,float64:()=>vz,formatError:()=>$d,fromJSONSchema:()=>cL,function:()=>Yz,getErrorMap:()=>jie,globalRegistry:()=>$r,gt:()=>ro,gte:()=>pn,guid:()=>ZN,hash:()=>xz,hex:()=>bz,hostname:()=>yz,httpUrl:()=>XN,includes:()=>Xu,instanceof:()=>nL,int:()=>ly,int32:()=>wz,int64:()=>Tz,intersection:()=>FP,invertCodec:()=>Gz,ipv4:()=>az,ipv6:()=>uz,iso:()=>ll,json:()=>oL,jwt:()=>gz,keyof:()=>Oz,ksuid:()=>sz,lazy:()=>aR,length:()=>ic,literal:()=>qz,locales:()=>Zd,looseObject:()=>Fz,looseRecord:()=>zz,lowercase:()=>Qu,lt:()=>to,lte:()=>Wn,mac:()=>cz,map:()=>Lz,maxLength:()=>nc,maxSize:()=>$s,meta:()=>rL,mime:()=>rl,minLength:()=>Do,minSize:()=>no,multipleOf:()=>Fs,nan:()=>Zz,nanoid:()=>tz,nativeEnum:()=>Uz,negative:()=>Qh,never:()=>Ay,nonnegative:()=>Xh,nonoptional:()=>QP,nonpositive:()=>Yh,normalize:()=>nl,null:()=>EP,nullable:()=>em,nullish:()=>Hz,number:()=>vP,object:()=>Dz,optional:()=>Xd,overwrite:()=>Fi,parse:()=>cP,parseAsync:()=>uP,partialRecord:()=>Nz,pipe:()=>py,positive:()=>Kh,prefault:()=>KP,preprocess:()=>sL,prettifyError:()=>Rk,promise:()=>Qz,property:()=>ey,readonly:()=>iR,record:()=>NP,refine:()=>lR,regex:()=>Ku,regexes:()=>Hn,registry:()=>Rh,safeDecode:()=>yP,safeDecodeAsync:()=>xP,safeEncode:()=>hP,safeEncodeAsync:()=>bP,safeParse:()=>lP,safeParseAsync:()=>pP,set:()=>Bz,setErrorMap:()=>$ie,size:()=>rc,slugify:()=>al,startsWith:()=>el,strictObject:()=>Mz,string:()=>Qd,stringFormat:()=>hz,stringbool:()=>iL,success:()=>Wz,superRefine:()=>pR,symbol:()=>Cz,templateLiteral:()=>Kz,toJSONSchema:()=>iy,toLowerCase:()=>ol,toUpperCase:()=>sl,transform:()=>Dy,treeifyError:()=>Pk,trim:()=>il,tuple:()=>jP,uint32:()=>kz,uint64:()=>Ez,ulid:()=>iz,undefined:()=>Pz,union:()=>_y,unknown:()=>oc,uppercase:()=>Yu,url:()=>YN,util:()=>te,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>KN,uuidv7:()=>QN,void:()=>Az,xid:()=>oz,xor:()=>$z});var Mo={};pi(Mo,{$ZodAny:()=>iT,$ZodArray:()=>uT,$ZodAsyncError:()=>eo,$ZodBase64:()=>VI,$ZodBase64URL:()=>GI,$ZodBigInt:()=>Th,$ZodBigIntFormat:()=>eT,$ZodBoolean:()=>Ld,$ZodCIDRv4:()=>HI,$ZodCIDRv6:()=>WI,$ZodCUID:()=>DI,$ZodCUID2:()=>MI,$ZodCatch:()=>CT,$ZodCheck:()=>Et,$ZodCheckBigIntFormat:()=>uI,$ZodCheckEndsWith:()=>vI,$ZodCheckGreaterThan:()=>bh,$ZodCheckIncludes:()=>xI,$ZodCheckLengthEquals:()=>gI,$ZodCheckLessThan:()=>yh,$ZodCheckLowerCase:()=>yI,$ZodCheckMaxLength:()=>mI,$ZodCheckMaxSize:()=>lI,$ZodCheckMimeType:()=>kI,$ZodCheckMinLength:()=>fI,$ZodCheckMinSize:()=>pI,$ZodCheckMultipleOf:()=>aI,$ZodCheckNumberFormat:()=>cI,$ZodCheckOverwrite:()=>II,$ZodCheckProperty:()=>wI,$ZodCheckRegex:()=>hI,$ZodCheckSizeEquals:()=>dI,$ZodCheckStartsWith:()=>SI,$ZodCheckStringFormat:()=>Vu,$ZodCheckUpperCase:()=>bI,$ZodCodec:()=>Ud,$ZodCustom:()=>FT,$ZodCustomStringFormat:()=>YI,$ZodDate:()=>cT,$ZodDefault:()=>kT,$ZodDiscriminatedUnion:()=>dT,$ZodE164:()=>KI,$ZodEmail:()=>RI,$ZodEmoji:()=>_I,$ZodEncodeError:()=>Ya,$ZodEnum:()=>yT,$ZodError:()=>Md,$ZodExactOptional:()=>vT,$ZodFile:()=>xT,$ZodFunction:()=>OT,$ZodGUID:()=>CI,$ZodIPv4:()=>UI,$ZodIPv6:()=>qI,$ZodISODate:()=>zI,$ZodISODateTime:()=>NI,$ZodISODuration:()=>BI,$ZodISOTime:()=>LI,$ZodIntersection:()=>mT,$ZodJWT:()=>QI,$ZodKSUID:()=>jI,$ZodLazy:()=>MT,$ZodLiteral:()=>bT,$ZodMAC:()=>JI,$ZodMap:()=>gT,$ZodNaN:()=>PT,$ZodNanoID:()=>OI,$ZodNever:()=>sT,$ZodNonOptional:()=>TT,$ZodNull:()=>nT,$ZodNullable:()=>wT,$ZodNumber:()=>Ih,$ZodNumberFormat:()=>XI,$ZodObject:()=>FN,$ZodObjectJIT:()=>lT,$ZodOptional:()=>Ch,$ZodPipe:()=>Ph,$ZodPrefault:()=>IT,$ZodPreprocess:()=>RT,$ZodPromise:()=>DT,$ZodReadonly:()=>AT,$ZodRealError:()=>Pn,$ZodRecord:()=>fT,$ZodRegistry:()=>DE,$ZodSet:()=>hT,$ZodString:()=>tc,$ZodStringFormat:()=>vt,$ZodSuccess:()=>ET,$ZodSymbol:()=>tT,$ZodTemplateLiteral:()=>_T,$ZodTransform:()=>ST,$ZodTuple:()=>Eh,$ZodType:()=>Ve,$ZodULID:()=>FI,$ZodURL:()=>AI,$ZodUUID:()=>PI,$ZodUndefined:()=>rT,$ZodUnion:()=>Bd,$ZodUnknown:()=>oT,$ZodVoid:()=>aT,$ZodXID:()=>$I,$ZodXor:()=>pT,$brand:()=>yk,$constructor:()=>C,$input:()=>OE,$output:()=>_E,Doc:()=>xh,JSONSchema:()=>UN,JSONSchemaGenerator:()=>nP,NEVER:()=>hk,TimePrecision:()=>jE,_any:()=>iC,_array:()=>pC,_base64:()=>Wh,_base64url:()=>Zh,_bigint:()=>QE,_boolean:()=>GE,_catch:()=>Eie,_check:()=>BN,_cidrv4:()=>Jh,_cidrv6:()=>Hh,_coercedBigint:()=>YE,_coercedBoolean:()=>KE,_coercedDate:()=>uC,_coercedNumber:()=>qE,_coercedString:()=>FE,_cuid:()=>jh,_cuid2:()=>Nh,_custom:()=>mC,_date:()=>cC,_decode:()=>uh,_decodeAsync:()=>ph,_default:()=>kie,_discriminatedUnion:()=>pie,_e164:()=>Vh,_email:()=>Ah,_emoji:()=>Fh,_encode:()=>ch,_encodeAsync:()=>lh,_endsWith:()=>tl,_enum:()=>yie,_file:()=>dC,_float32:()=>HE,_float64:()=>WE,_gt:()=>ro,_gte:()=>pn,_guid:()=>Vd,_includes:()=>Xu,_int:()=>JE,_int32:()=>ZE,_int64:()=>XE,_intersection:()=>die,_ipv4:()=>Uh,_ipv6:()=>qh,_isoDate:()=>zE,_isoDateTime:()=>NE,_isoDuration:()=>BE,_isoTime:()=>LE,_jwt:()=>Gh,_ksuid:()=>Bh,_lazy:()=>Aie,_length:()=>ic,_literal:()=>xie,_lowercase:()=>Qu,_lt:()=>to,_lte:()=>Wn,_mac:()=>$E,_map:()=>gie,_max:()=>Wn,_maxLength:()=>nc,_maxSize:()=>$s,_mime:()=>rl,_min:()=>pn,_minLength:()=>Do,_minSize:()=>no,_multipleOf:()=>Fs,_nan:()=>lC,_nanoid:()=>$h,_nativeEnum:()=>bie,_negative:()=>Qh,_never:()=>sC,_nonnegative:()=>Xh,_nonoptional:()=>Iie,_nonpositive:()=>Yh,_normalize:()=>nl,_null:()=>nC,_nullable:()=>wie,_number:()=>UE,_optional:()=>vie,_overwrite:()=>Fi,_parse:()=>Ju,_parseAsync:()=>Hu,_pipe:()=>Cie,_positive:()=>Kh,_promise:()=>_ie,_property:()=>ey,_readonly:()=>Pie,_record:()=>fie,_refine:()=>fC,_regex:()=>Ku,_safeDecode:()=>mh,_safeDecodeAsync:()=>gh,_safeEncode:()=>dh,_safeEncodeAsync:()=>fh,_safeParse:()=>Wu,_safeParseAsync:()=>Zu,_set:()=>hie,_size:()=>rc,_slugify:()=>al,_startsWith:()=>el,_string:()=>ME,_stringFormat:()=>cl,_stringbool:()=>bC,_success:()=>Tie,_superRefine:()=>gC,_symbol:()=>tC,_templateLiteral:()=>Rie,_toLowerCase:()=>ol,_toUpperCase:()=>sl,_transform:()=>Sie,_trim:()=>il,_tuple:()=>mie,_uint32:()=>VE,_uint64:()=>eC,_ulid:()=>zh,_undefined:()=>rC,_union:()=>uie,_unknown:()=>oC,_uppercase:()=>Yu,_url:()=>Gd,_uuid:()=>_h,_uuidv4:()=>Oh,_uuidv6:()=>Dh,_uuidv7:()=>Mh,_void:()=>aC,_xid:()=>Lh,_xor:()=>lie,clone:()=>un,config:()=>Kt,createStandardJSONSchemaMethod:()=>ul,createToJSONSchemaMethod:()=>xC,decode:()=>_re,decodeAsync:()=>Dre,describe:()=>hC,encode:()=>Are,encodeAsync:()=>Ore,extractDefs:()=>Ns,finalize:()=>zs,flattenError:()=>Fd,formatError:()=>$d,globalConfig:()=>Qa,globalRegistry:()=>$r,initializeContext:()=>js,isValidBase64:()=>ZI,isValidBase64URL:()=>_N,isValidJWT:()=>ON,locales:()=>Zd,meta:()=>yC,parse:()=>sh,parseAsync:()=>ah,prettifyError:()=>Rk,process:()=>yt,regexes:()=>Hn,registry:()=>Rh,safeDecode:()=>Fre,safeDecodeAsync:()=>jre,safeEncode:()=>Mre,safeEncodeAsync:()=>$re,safeParse:()=>Ak,safeParseAsync:()=>_k,toDotPath:()=>lN,toJSONSchema:()=>iy,treeifyError:()=>Pk,util:()=>te,version:()=>TI});var iN,hk=Object.freeze({status:"aborted"});function C(e,t,r){function i(c,u){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=s.prototype,p=Object.keys(l);for(let m=0;m<p.length;m++){let f=p[m];if(!(f in c))c[f]=l[f].bind(c)}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(c){var u;let l=r?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:(c)=>{if(r?.Parent&&c instanceof r.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var yk=Symbol("zod_brand");class eo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ya extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(iN=globalThis).__zod_globalConfig??(iN.__zod_globalConfig={});var Qa=globalThis.__zod_globalConfig;function Kt(e){if(e)Object.assign(Qa,e);return Qa}var te={};pi(te,{BIGINT_FORMAT_RANGES:()=>Ek,Class:()=>cN,NUMBER_FORMAT_RANGES:()=>Tk,aborted:()=>Ms,allowsEval:()=>vk,assert:()=>cre,assertEqual:()=>ire,assertIs:()=>sre,assertNever:()=>are,assertNotEqual:()=>ore,assignProp:()=>Os,base64ToUint8Array:()=>sN,base64urlToUint8Array:()=>Tre,cached:()=>Uu,captureStackTrace:()=>oh,cleanEnum:()=>Ire,cleanRegex:()=>Ad,clone:()=>un,cloneDef:()=>lre,createTransparentProxy:()=>hre,defineLazy:()=>ct,esc:()=>ih,escapeRegex:()=>di,explicitlyAborted:()=>Ck,extend:()=>xre,finalizeIssue:()=>ln,floatSafeRemainder:()=>xk,getElementAtPath:()=>pre,getEnumValues:()=>Rd,getLengthableOrigin:()=>Dd,getParsedType:()=>gre,getSizableOrigin:()=>Od,hexToUint8Array:()=>Cre,isObject:()=>Xa,isPlainObject:()=>Ds,issue:()=>qu,joinValues:()=>_,jsonStringifyReplacer:()=>Bu,merge:()=>vre,mergeDefs:()=>Oo,normalizeParams:()=>ce,nullish:()=>_s,numKeys:()=>fre,objectClone:()=>ure,omit:()=>bre,optionalKeys:()=>Ik,parsedType:()=>K,partial:()=>wre,pick:()=>yre,prefixIssues:()=>Cn,primitiveTypes:()=>kk,promiseAllObject:()=>dre,propertyKeyTypes:()=>_d,randomString:()=>mre,required:()=>kre,safeExtend:()=>Sre,shallowClone:()=>wk,slugify:()=>Sk,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>aN,uint8ArrayToBase64url:()=>Ere,uint8ArrayToHex:()=>Pre,unwrapMessage:()=>Pd});function ire(e){return e}function ore(e){return e}function sre(e){}function are(e){throw Error("Unexpected value in exhaustive check")}function cre(e){}function Rd(e){let t=Object.values(e).filter((i)=>typeof i==="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function _(e,t="|"){return e.map((r)=>V(r)).join(t)}function Bu(e,t){if(typeof t==="bigint")return t.toString();return t}function Uu(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function _s(e){return e===null||e===void 0}function Ad(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function xk(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-i)<n)return 0;return r-i}var oN=Symbol("evaluating");function ct(e,t,r){let i=void 0;Object.defineProperty(e,t,{get(){if(i===oN)return;if(i===void 0)i=oN,i=r();return i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ure(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Os(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Oo(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function lre(e){return Oo(e._zod.def)}function pre(e,t){if(!t)return e;return t.reduce((r,i)=>r?.[i],e)}function dre(e){let t=Object.keys(e),r=t.map((i)=>e[i]);return Promise.all(r).then((i)=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function mre(e=10){let r="";for(let i=0;i<e;i++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function ih(e){return JSON.stringify(e)}function Sk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var oh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xa(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vk=Uu(()=>{if(Qa.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ds(e){if(Xa(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Xa(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function wk(e){if(Ds(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function fre(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var gre=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},_d=new Set(["string","number","symbol"]),kk=new Set(["string","number","bigint","boolean","symbol","undefined"]);function di(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function un(e,t,r){let i=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)i._zod.parent=e;return i}function ce(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function hre(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function V(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ik(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Tk={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ek={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yre(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let o=Oo(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;s[c]=r.shape[c]}return Os(this,"shape",s),s},checks:[]});return un(e,o)}function bre(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let o=Oo(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete s[c]}return Os(this,"shape",s),s},checks:[]});return un(e,o)}function xre(e,t){if(!Ds(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Oo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Os(this,"shape",o),o}});return un(e,n)}function Sre(e,t){if(!Ds(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=Oo(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Os(this,"shape",i),i}});return un(e,r)}function vre(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Oo(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Os(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return un(e,r)}function wre(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=Oo(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;u[l]=e?new e({type:"optional",innerType:c[l]}):c[l]}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Os(this,"shape",u),u},checks:[]});return un(t,s)}function kre(e,t,r){let i=Oo(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);if(!r[s])continue;o[s]=new e({type:"nonoptional",innerType:n[s]})}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return Os(this,"shape",o),o}});return un(t,i)}function Ms(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ck(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Cn(e,t){return t.map((r)=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Pd(e){return typeof e==="string"?e:e?.message}function ln(e,t,r){let i=e.message?e.message:Pd(e.inst?._zod.def?.error?.(e))??Pd(t?.error?.(e))??Pd(r.customError?.(e))??Pd(r.localeError?.(e))??"Invalid input",{inst:n,continue:o,input:s,...c}=e;if(c.path??(c.path=[]),c.message=i,t?.reportInput)c.input=s;return c}function Od(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Dd(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function K(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function qu(...e){let[t,r,i]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:i};return{...t}}function Ire(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function sN(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function aN(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Tre(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return sN(t+r)}function Ere(e){return aN(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cre(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function Pre(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class cN{constructor(...e){}}var uN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bu,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Md=C("$ZodError",uN),Pn=C("$ZodError",uN,{Parent:Error});function Fd(e,t=(r)=>r.message){let r={},i=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else i.push(t(n));return{formErrors:i,fieldErrors:r}}function $d(e,t=(r)=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,l=0;while(l<c.length){let p=c[l];if(l!==c.length-1)u[p]=u[p]||{_errors:[]};else u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(s));u=u[p],l++}}}};return i(e),r}function Pk(e,t=(r)=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,c;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((l)=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){r.errors.push(t(u));continue}let p=r,m=0;while(m<l.length){let f=l[m],g=m===l.length-1;if(typeof f==="string")p.properties??(p.properties={}),(s=p.properties)[f]??(s[f]={errors:[]}),p=p.properties[f];else p.items??(p.items=[]),(c=p.items)[f]??(c[f]={errors:[]}),p=p.items[f];if(g)p.errors.push(t(u));m++}}};return i(e),r}function lN(e){let t=[],r=e.map((i)=>typeof i==="object"?i.key:i);for(let i of r)if(typeof i==="number")t.push(`[${i}]`);else if(typeof i==="symbol")t.push(`[${JSON.stringify(String(i))}]`);else if(/[^\w$]/.test(i))t.push(`[${JSON.stringify(i)}]`);else{if(t.length)t.push(".");t.push(i)}return t.join("")}function Rk(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)if(t.push(`\u2716 ${i.message}`),i.path?.length)t.push(` \u2192 at ${lN(i.path)}`);return t.join(`
|
|
88
|
+
`;return""}return pk.dump=Z,pk}var zj;function tre(){if(zj)return Zr;zj=1;let e=Xte(),t=ere();function r(i,n){return function(){throw Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Zr.Type=cn(),Zr.Schema=Lj(),Zr.FAILSAFE_SCHEMA=Jj(),Zr.JSON_SCHEMA=Gj(),Zr.CORE_SCHEMA=Kj(),Zr.DEFAULT_SCHEMA=dk(),Zr.load=e.load,Zr.loadAll=e.loadAll,Zr.dump=t.dump,Zr.YAMLException=Cd(),Zr.types={binary:Xj(),float:Vj(),map:qj(),null:Hj(),pairs:tN(),set:rN(),timestamp:Qj(),bool:Wj(),int:Zj(),merge:Yj(),omap:eN(),seq:Uj(),str:Bj()},Zr.safeLoad=r("safeLoad","load"),Zr.safeLoadAll=r("safeLoadAll","loadAll"),Zr.safeDump=r("safeDump","dump"),Zr}var rre=tre(),nre=Qte(rre),{Type:z$e,Schema:L$e,FAILSAFE_SCHEMA:B$e,JSON_SCHEMA:U$e,CORE_SCHEMA:q$e,DEFAULT_SCHEMA:J$e,load:mk,loadAll:H$e,dump:nN,YAMLException:W$e,types:Z$e,safeLoad:V$e,safeLoadAll:G$e,safeDump:K$e}=nre;function gk(e){return mk(e)}var a={};pi(a,{$brand:()=>yk,$input:()=>OE,$output:()=>_E,NEVER:()=>hk,TimePrecision:()=>jE,ZodAny:()=>CP,ZodArray:()=>_P,ZodBase64:()=>Ty,ZodBase64URL:()=>Ey,ZodBigInt:()=>yl,ZodBigIntFormat:()=>Ry,ZodBoolean:()=>hl,ZodCIDRv4:()=>ky,ZodCIDRv6:()=>Iy,ZodCUID:()=>hy,ZodCUID2:()=>yy,ZodCatch:()=>XP,ZodCodec:()=>cm,ZodCustom:()=>um,ZodCustomStringFormat:()=>fl,ZodDate:()=>nm,ZodDefault:()=>ZP,ZodDiscriminatedUnion:()=>DP,ZodE164:()=>Cy,ZodEmail:()=>my,ZodEmoji:()=>fy,ZodEnum:()=>dl,ZodError:()=>JN,ZodExactOptional:()=>JP,ZodFile:()=>UP,ZodFirstPartyTypeKind:()=>dR,ZodFunction:()=>uR,ZodGUID:()=>Yd,ZodIPv4:()=>vy,ZodIPv6:()=>wy,ZodISODate:()=>ay,ZodISODateTime:()=>sy,ZodISODuration:()=>uy,ZodISOTime:()=>cy,ZodIntersection:()=>MP,ZodIssueCode:()=>Fie,ZodJWT:()=>Py,ZodKSUID:()=>Sy,ZodLazy:()=>sR,ZodLiteral:()=>BP,ZodMAC:()=>SP,ZodMap:()=>zP,ZodNaN:()=>tR,ZodNanoID:()=>gy,ZodNever:()=>RP,ZodNonOptional:()=>Fy,ZodNull:()=>TP,ZodNullable:()=>WP,ZodNumber:()=>gl,ZodNumberFormat:()=>sc,ZodObject:()=>om,ZodOptional:()=>My,ZodPipe:()=>am,ZodPrefault:()=>GP,ZodPreprocess:()=>rR,ZodPromise:()=>cR,ZodReadonly:()=>nR,ZodRealError:()=>Rn,ZodRecord:()=>pl,ZodSet:()=>LP,ZodString:()=>ml,ZodStringFormat:()=>wt,ZodSuccess:()=>YP,ZodSymbol:()=>kP,ZodTemplateLiteral:()=>oR,ZodTransform:()=>qP,ZodTuple:()=>$P,ZodType:()=>nt,ZodULID:()=>by,ZodURL:()=>rm,ZodUUID:()=>io,ZodUndefined:()=>IP,ZodUnion:()=>sm,ZodUnknown:()=>PP,ZodVoid:()=>AP,ZodXID:()=>xy,ZodXor:()=>OP,_ZodString:()=>dy,_default:()=>VP,_function:()=>Yz,any:()=>Rz,array:()=>im,base64:()=>dz,base64url:()=>mz,bigint:()=>Iz,boolean:()=>wP,catch:()=>eR,check:()=>Xz,cidrv4:()=>lz,cidrv6:()=>pz,clone:()=>un,codec:()=>Vz,coerce:()=>mR,config:()=>Kt,core:()=>Mo,cuid:()=>rz,cuid2:()=>nz,custom:()=>eL,date:()=>_z,decode:()=>mP,decodeAsync:()=>gP,describe:()=>tL,discriminatedUnion:()=>jz,e164:()=>fz,email:()=>WN,emoji:()=>ez,encode:()=>dP,encodeAsync:()=>fP,endsWith:()=>tl,enum:()=>Oy,exactOptional:()=>HP,file:()=>Jz,flattenError:()=>Fd,float32:()=>Sz,float64:()=>vz,formatError:()=>$d,fromJSONSchema:()=>cL,function:()=>Yz,getErrorMap:()=>jie,globalRegistry:()=>$r,gt:()=>ro,gte:()=>pn,guid:()=>ZN,hash:()=>xz,hex:()=>bz,hostname:()=>yz,httpUrl:()=>XN,includes:()=>Xu,instanceof:()=>nL,int:()=>ly,int32:()=>wz,int64:()=>Tz,intersection:()=>FP,invertCodec:()=>Gz,ipv4:()=>az,ipv6:()=>uz,iso:()=>ll,json:()=>oL,jwt:()=>gz,keyof:()=>Oz,ksuid:()=>sz,lazy:()=>aR,length:()=>ic,literal:()=>qz,locales:()=>Zd,looseObject:()=>Fz,looseRecord:()=>zz,lowercase:()=>Qu,lt:()=>to,lte:()=>Wn,mac:()=>cz,map:()=>Lz,maxLength:()=>nc,maxSize:()=>$s,meta:()=>rL,mime:()=>rl,minLength:()=>Do,minSize:()=>no,multipleOf:()=>Fs,nan:()=>Zz,nanoid:()=>tz,nativeEnum:()=>Uz,negative:()=>Qh,never:()=>Ay,nonnegative:()=>Xh,nonoptional:()=>QP,nonpositive:()=>Yh,normalize:()=>nl,null:()=>EP,nullable:()=>em,nullish:()=>Hz,number:()=>vP,object:()=>Dz,optional:()=>Xd,overwrite:()=>Fi,parse:()=>cP,parseAsync:()=>uP,partialRecord:()=>Nz,pipe:()=>py,positive:()=>Kh,prefault:()=>KP,preprocess:()=>sL,prettifyError:()=>Rk,promise:()=>Qz,property:()=>ey,readonly:()=>iR,record:()=>NP,refine:()=>lR,regex:()=>Ku,regexes:()=>Hn,registry:()=>Rh,safeDecode:()=>yP,safeDecodeAsync:()=>xP,safeEncode:()=>hP,safeEncodeAsync:()=>bP,safeParse:()=>lP,safeParseAsync:()=>pP,set:()=>Bz,setErrorMap:()=>$ie,size:()=>rc,slugify:()=>al,startsWith:()=>el,strictObject:()=>Mz,string:()=>Qd,stringFormat:()=>hz,stringbool:()=>iL,success:()=>Wz,superRefine:()=>pR,symbol:()=>Cz,templateLiteral:()=>Kz,toJSONSchema:()=>iy,toLowerCase:()=>ol,toUpperCase:()=>sl,transform:()=>Dy,treeifyError:()=>Pk,trim:()=>il,tuple:()=>jP,uint32:()=>kz,uint64:()=>Ez,ulid:()=>iz,undefined:()=>Pz,union:()=>_y,unknown:()=>oc,uppercase:()=>Yu,url:()=>YN,util:()=>te,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>KN,uuidv7:()=>QN,void:()=>Az,xid:()=>oz,xor:()=>$z});var Mo={};pi(Mo,{$ZodAny:()=>iT,$ZodArray:()=>uT,$ZodAsyncError:()=>eo,$ZodBase64:()=>VI,$ZodBase64URL:()=>GI,$ZodBigInt:()=>Th,$ZodBigIntFormat:()=>eT,$ZodBoolean:()=>Ld,$ZodCIDRv4:()=>HI,$ZodCIDRv6:()=>WI,$ZodCUID:()=>DI,$ZodCUID2:()=>MI,$ZodCatch:()=>CT,$ZodCheck:()=>Et,$ZodCheckBigIntFormat:()=>uI,$ZodCheckEndsWith:()=>vI,$ZodCheckGreaterThan:()=>bh,$ZodCheckIncludes:()=>xI,$ZodCheckLengthEquals:()=>gI,$ZodCheckLessThan:()=>yh,$ZodCheckLowerCase:()=>yI,$ZodCheckMaxLength:()=>mI,$ZodCheckMaxSize:()=>lI,$ZodCheckMimeType:()=>kI,$ZodCheckMinLength:()=>fI,$ZodCheckMinSize:()=>pI,$ZodCheckMultipleOf:()=>aI,$ZodCheckNumberFormat:()=>cI,$ZodCheckOverwrite:()=>II,$ZodCheckProperty:()=>wI,$ZodCheckRegex:()=>hI,$ZodCheckSizeEquals:()=>dI,$ZodCheckStartsWith:()=>SI,$ZodCheckStringFormat:()=>Vu,$ZodCheckUpperCase:()=>bI,$ZodCodec:()=>Ud,$ZodCustom:()=>FT,$ZodCustomStringFormat:()=>YI,$ZodDate:()=>cT,$ZodDefault:()=>kT,$ZodDiscriminatedUnion:()=>dT,$ZodE164:()=>KI,$ZodEmail:()=>RI,$ZodEmoji:()=>_I,$ZodEncodeError:()=>Ya,$ZodEnum:()=>yT,$ZodError:()=>Md,$ZodExactOptional:()=>vT,$ZodFile:()=>xT,$ZodFunction:()=>OT,$ZodGUID:()=>CI,$ZodIPv4:()=>UI,$ZodIPv6:()=>qI,$ZodISODate:()=>zI,$ZodISODateTime:()=>NI,$ZodISODuration:()=>BI,$ZodISOTime:()=>LI,$ZodIntersection:()=>mT,$ZodJWT:()=>QI,$ZodKSUID:()=>jI,$ZodLazy:()=>MT,$ZodLiteral:()=>bT,$ZodMAC:()=>JI,$ZodMap:()=>gT,$ZodNaN:()=>PT,$ZodNanoID:()=>OI,$ZodNever:()=>sT,$ZodNonOptional:()=>TT,$ZodNull:()=>nT,$ZodNullable:()=>wT,$ZodNumber:()=>Ih,$ZodNumberFormat:()=>XI,$ZodObject:()=>FN,$ZodObjectJIT:()=>lT,$ZodOptional:()=>Ch,$ZodPipe:()=>Ph,$ZodPrefault:()=>IT,$ZodPreprocess:()=>RT,$ZodPromise:()=>DT,$ZodReadonly:()=>AT,$ZodRealError:()=>Pn,$ZodRecord:()=>fT,$ZodRegistry:()=>DE,$ZodSet:()=>hT,$ZodString:()=>tc,$ZodStringFormat:()=>vt,$ZodSuccess:()=>ET,$ZodSymbol:()=>tT,$ZodTemplateLiteral:()=>_T,$ZodTransform:()=>ST,$ZodTuple:()=>Eh,$ZodType:()=>Ve,$ZodULID:()=>FI,$ZodURL:()=>AI,$ZodUUID:()=>PI,$ZodUndefined:()=>rT,$ZodUnion:()=>Bd,$ZodUnknown:()=>oT,$ZodVoid:()=>aT,$ZodXID:()=>$I,$ZodXor:()=>pT,$brand:()=>yk,$constructor:()=>C,$input:()=>OE,$output:()=>_E,Doc:()=>xh,JSONSchema:()=>UN,JSONSchemaGenerator:()=>nP,NEVER:()=>hk,TimePrecision:()=>jE,_any:()=>iC,_array:()=>pC,_base64:()=>Wh,_base64url:()=>Zh,_bigint:()=>QE,_boolean:()=>GE,_catch:()=>Eie,_check:()=>BN,_cidrv4:()=>Jh,_cidrv6:()=>Hh,_coercedBigint:()=>YE,_coercedBoolean:()=>KE,_coercedDate:()=>uC,_coercedNumber:()=>qE,_coercedString:()=>FE,_cuid:()=>jh,_cuid2:()=>Nh,_custom:()=>mC,_date:()=>cC,_decode:()=>uh,_decodeAsync:()=>ph,_default:()=>kie,_discriminatedUnion:()=>pie,_e164:()=>Vh,_email:()=>Ah,_emoji:()=>Fh,_encode:()=>ch,_encodeAsync:()=>lh,_endsWith:()=>tl,_enum:()=>yie,_file:()=>dC,_float32:()=>HE,_float64:()=>WE,_gt:()=>ro,_gte:()=>pn,_guid:()=>Vd,_includes:()=>Xu,_int:()=>JE,_int32:()=>ZE,_int64:()=>XE,_intersection:()=>die,_ipv4:()=>Uh,_ipv6:()=>qh,_isoDate:()=>zE,_isoDateTime:()=>NE,_isoDuration:()=>BE,_isoTime:()=>LE,_jwt:()=>Gh,_ksuid:()=>Bh,_lazy:()=>Aie,_length:()=>ic,_literal:()=>xie,_lowercase:()=>Qu,_lt:()=>to,_lte:()=>Wn,_mac:()=>$E,_map:()=>gie,_max:()=>Wn,_maxLength:()=>nc,_maxSize:()=>$s,_mime:()=>rl,_min:()=>pn,_minLength:()=>Do,_minSize:()=>no,_multipleOf:()=>Fs,_nan:()=>lC,_nanoid:()=>$h,_nativeEnum:()=>bie,_negative:()=>Qh,_never:()=>sC,_nonnegative:()=>Xh,_nonoptional:()=>Iie,_nonpositive:()=>Yh,_normalize:()=>nl,_null:()=>nC,_nullable:()=>wie,_number:()=>UE,_optional:()=>vie,_overwrite:()=>Fi,_parse:()=>Ju,_parseAsync:()=>Hu,_pipe:()=>Cie,_positive:()=>Kh,_promise:()=>_ie,_property:()=>ey,_readonly:()=>Pie,_record:()=>fie,_refine:()=>fC,_regex:()=>Ku,_safeDecode:()=>mh,_safeDecodeAsync:()=>gh,_safeEncode:()=>dh,_safeEncodeAsync:()=>fh,_safeParse:()=>Wu,_safeParseAsync:()=>Zu,_set:()=>hie,_size:()=>rc,_slugify:()=>al,_startsWith:()=>el,_string:()=>ME,_stringFormat:()=>cl,_stringbool:()=>bC,_success:()=>Tie,_superRefine:()=>gC,_symbol:()=>tC,_templateLiteral:()=>Rie,_toLowerCase:()=>ol,_toUpperCase:()=>sl,_transform:()=>Sie,_trim:()=>il,_tuple:()=>mie,_uint32:()=>VE,_uint64:()=>eC,_ulid:()=>zh,_undefined:()=>rC,_union:()=>uie,_unknown:()=>oC,_uppercase:()=>Yu,_url:()=>Gd,_uuid:()=>_h,_uuidv4:()=>Oh,_uuidv6:()=>Dh,_uuidv7:()=>Mh,_void:()=>aC,_xid:()=>Lh,_xor:()=>lie,clone:()=>un,config:()=>Kt,createStandardJSONSchemaMethod:()=>ul,createToJSONSchemaMethod:()=>xC,decode:()=>_re,decodeAsync:()=>Dre,describe:()=>hC,encode:()=>Are,encodeAsync:()=>Ore,extractDefs:()=>Ns,finalize:()=>zs,flattenError:()=>Fd,formatError:()=>$d,globalConfig:()=>Qa,globalRegistry:()=>$r,initializeContext:()=>js,isValidBase64:()=>ZI,isValidBase64URL:()=>_N,isValidJWT:()=>ON,locales:()=>Zd,meta:()=>yC,parse:()=>sh,parseAsync:()=>ah,prettifyError:()=>Rk,process:()=>yt,regexes:()=>Hn,registry:()=>Rh,safeDecode:()=>Fre,safeDecodeAsync:()=>jre,safeEncode:()=>Mre,safeEncodeAsync:()=>$re,safeParse:()=>Ak,safeParseAsync:()=>_k,toDotPath:()=>lN,toJSONSchema:()=>iy,treeifyError:()=>Pk,util:()=>te,version:()=>TI});var iN,hk=Object.freeze({status:"aborted"});function C(e,t,r){function i(c,u){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=s.prototype,p=Object.keys(l);for(let m=0;m<p.length;m++){let f=p[m];if(!(f in c))c[f]=l[f].bind(c)}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(c){var u;let l=r?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:(c)=>{if(r?.Parent&&c instanceof r.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var yk=Symbol("zod_brand");class eo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ya extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(iN=globalThis).__zod_globalConfig??(iN.__zod_globalConfig={});var Qa=globalThis.__zod_globalConfig;function Kt(e){if(e)Object.assign(Qa,e);return Qa}var te={};pi(te,{BIGINT_FORMAT_RANGES:()=>Ek,Class:()=>cN,NUMBER_FORMAT_RANGES:()=>Tk,aborted:()=>Ms,allowsEval:()=>vk,assert:()=>cre,assertEqual:()=>ire,assertIs:()=>sre,assertNever:()=>are,assertNotEqual:()=>ore,assignProp:()=>Os,base64ToUint8Array:()=>sN,base64urlToUint8Array:()=>Tre,cached:()=>Uu,captureStackTrace:()=>oh,cleanEnum:()=>Ire,cleanRegex:()=>Ad,clone:()=>un,cloneDef:()=>lre,createTransparentProxy:()=>hre,defineLazy:()=>ct,esc:()=>ih,escapeRegex:()=>di,explicitlyAborted:()=>Ck,extend:()=>xre,finalizeIssue:()=>ln,floatSafeRemainder:()=>xk,getElementAtPath:()=>pre,getEnumValues:()=>Rd,getLengthableOrigin:()=>Dd,getParsedType:()=>gre,getSizableOrigin:()=>Od,hexToUint8Array:()=>Cre,isObject:()=>Xa,isPlainObject:()=>Ds,issue:()=>qu,joinValues:()=>_,jsonStringifyReplacer:()=>Bu,merge:()=>vre,mergeDefs:()=>Oo,normalizeParams:()=>ce,nullish:()=>_s,numKeys:()=>fre,objectClone:()=>ure,omit:()=>bre,optionalKeys:()=>Ik,parsedType:()=>K,partial:()=>wre,pick:()=>yre,prefixIssues:()=>Cn,primitiveTypes:()=>kk,promiseAllObject:()=>dre,propertyKeyTypes:()=>_d,randomString:()=>mre,required:()=>kre,safeExtend:()=>Sre,shallowClone:()=>wk,slugify:()=>Sk,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>aN,uint8ArrayToBase64url:()=>Ere,uint8ArrayToHex:()=>Pre,unwrapMessage:()=>Pd});function ire(e){return e}function ore(e){return e}function sre(e){}function are(e){throw Error("Unexpected value in exhaustive check")}function cre(e){}function Rd(e){let t=Object.values(e).filter((i)=>typeof i==="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function _(e,t="|"){return e.map((r)=>V(r)).join(t)}function Bu(e,t){if(typeof t==="bigint")return t.toString();return t}function Uu(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function _s(e){return e===null||e===void 0}function Ad(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function xk(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-i)<n)return 0;return r-i}var oN=Symbol("evaluating");function ct(e,t,r){let i=void 0;Object.defineProperty(e,t,{get(){if(i===oN)return;if(i===void 0)i=oN,i=r();return i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ure(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Os(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Oo(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function lre(e){return Oo(e._zod.def)}function pre(e,t){if(!t)return e;return t.reduce((r,i)=>r?.[i],e)}function dre(e){let t=Object.keys(e),r=t.map((i)=>e[i]);return Promise.all(r).then((i)=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function mre(e=10){let r="";for(let i=0;i<e;i++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function ih(e){return JSON.stringify(e)}function Sk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var oh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xa(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var vk=Uu(()=>{if(Qa.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ds(e){if(Xa(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Xa(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function wk(e){if(Ds(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function fre(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var gre=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},_d=new Set(["string","number","symbol"]),kk=new Set(["string","number","bigint","boolean","symbol","undefined"]);function di(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function un(e,t,r){let i=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)i._zod.parent=e;return i}function ce(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function hre(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function V(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ik(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Tk={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ek={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yre(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let o=Oo(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;s[c]=r.shape[c]}return Os(this,"shape",s),s},checks:[]});return un(e,o)}function bre(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let o=Oo(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete s[c]}return Os(this,"shape",s),s},checks:[]});return un(e,o)}function xre(e,t){if(!Ds(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Oo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Os(this,"shape",o),o}});return un(e,n)}function Sre(e,t){if(!Ds(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=Oo(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Os(this,"shape",i),i}});return un(e,r)}function vre(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Oo(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Os(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return un(e,r)}function wre(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=Oo(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;u[l]=e?new e({type:"optional",innerType:c[l]}):c[l]}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Os(this,"shape",u),u},checks:[]});return un(t,s)}function kre(e,t,r){let i=Oo(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);if(!r[s])continue;o[s]=new e({type:"nonoptional",innerType:n[s]})}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return Os(this,"shape",o),o}});return un(t,i)}function Ms(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ck(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Cn(e,t){return t.map((r)=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Pd(e){return typeof e==="string"?e:e?.message}function ln(e,t,r){let i=e.message?e.message:Pd(e.inst?._zod.def?.error?.(e))??Pd(t?.error?.(e))??Pd(r.customError?.(e))??Pd(r.localeError?.(e))??"Invalid input",{inst:n,continue:o,input:s,...c}=e;if(c.path??(c.path=[]),c.message=i,t?.reportInput)c.input=s;return c}function Od(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Dd(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function K(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function qu(...e){let[t,r,i]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:i};return{...t}}function Ire(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function sN(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function aN(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Tre(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return sN(t+r)}function Ere(e){return aN(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cre(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function Pre(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class cN{constructor(...e){}}var uN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bu,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Md=C("$ZodError",uN),Pn=C("$ZodError",uN,{Parent:Error});function Fd(e,t=(r)=>r.message){let r={},i=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else i.push(t(n));return{formErrors:i,fieldErrors:r}}function $d(e,t=(r)=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,l=0;while(l<c.length){let p=c[l];if(l!==c.length-1)u[p]=u[p]||{_errors:[]};else u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(s));u=u[p],l++}}}};return i(e),r}function Pk(e,t=(r)=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,c;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((l)=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){r.errors.push(t(u));continue}let p=r,m=0;while(m<l.length){let f=l[m],g=m===l.length-1;if(typeof f==="string")p.properties??(p.properties={}),(s=p.properties)[f]??(s[f]={errors:[]}),p=p.properties[f];else p.items??(p.items=[]),(c=p.items)[f]??(c[f]={errors:[]}),p=p.items[f];if(g)p.errors.push(t(u));m++}}};return i(e),r}function lN(e){let t=[],r=e.map((i)=>typeof i==="object"?i.key:i);for(let i of r)if(typeof i==="number")t.push(`[${i}]`);else if(typeof i==="symbol")t.push(`[${JSON.stringify(String(i))}]`);else if(/[^\w$]/.test(i))t.push(`[${JSON.stringify(i)}]`);else{if(t.length)t.push(".");t.push(i)}return t.join("")}function Rk(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)if(t.push(`\u2716 ${i.message}`),i.path?.length)t.push(` \u2192 at ${lN(i.path)}`);return t.join(`
|
|
89
89
|
`)}var Ju=(e)=>(t,r,i,n)=>{let o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new eo;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map((u)=>ln(u,o,Kt())));throw oh(c,n?.callee),c}return s.value},sh=Ju(Pn),Hu=(e)=>async(t,r,i,n)=>{let o=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map((u)=>ln(u,o,Kt())));throw oh(c,n?.callee),c}return s.value},ah=Hu(Pn),Wu=(e)=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new eo;return o.issues.length?{success:!1,error:new(e??Md)(o.issues.map((s)=>ln(s,n,Kt())))}:{success:!0,data:o.value}},Ak=Wu(Pn),Zu=(e)=>async(t,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length?{success:!1,error:new e(o.issues.map((s)=>ln(s,n,Kt())))}:{success:!0,data:o.value}},_k=Zu(Pn),ch=(e)=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ju(e)(t,r,n)},Are=ch(Pn),uh=(e)=>(t,r,i)=>Ju(e)(t,r,i),_re=uh(Pn),lh=(e)=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Hu(e)(t,r,n)},Ore=lh(Pn),ph=(e)=>async(t,r,i)=>Hu(e)(t,r,i),Dre=ph(Pn),dh=(e)=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Wu(e)(t,r,n)},Mre=dh(Pn),mh=(e)=>(t,r,i)=>Wu(e)(t,r,i),Fre=mh(Pn),fh=(e)=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Zu(e)(t,r,n)},$re=fh(Pn),gh=(e)=>async(t,r,i)=>Zu(e)(t,r,i),jre=gh(Pn);var Hn={};pi(Hn,{base64:()=>Zk,base64url:()=>hh,bigint:()=>eI,boolean:()=>rI,browserEmail:()=>Hre,cidrv4:()=>Hk,cidrv6:()=>Wk,cuid:()=>Ok,cuid2:()=>Dk,date:()=>Kk,datetime:()=>Yk,domain:()=>Vre,duration:()=>Nk,e164:()=>Gk,email:()=>Lk,emoji:()=>Bk,extendedDuration:()=>Nre,guid:()=>zk,hex:()=>Gre,hostname:()=>Zre,html5Email:()=>Ure,httpProtocol:()=>Vk,idnEmail:()=>Jre,integer:()=>tI,ipv4:()=>Uk,ipv6:()=>qk,ksuid:()=>$k,lowercase:()=>oI,mac:()=>Jk,md5_base64:()=>Qre,md5_base64url:()=>Yre,md5_hex:()=>Kre,nanoid:()=>jk,null:()=>nI,number:()=>jd,rfc5322Email:()=>qre,sha1_base64:()=>ene,sha1_base64url:()=>tne,sha1_hex:()=>Xre,sha256_base64:()=>nne,sha256_base64url:()=>ine,sha256_hex:()=>rne,sha384_base64:()=>sne,sha384_base64url:()=>ane,sha384_hex:()=>one,sha512_base64:()=>une,sha512_base64url:()=>lne,sha512_hex:()=>cne,string:()=>Xk,time:()=>Qk,ulid:()=>Mk,undefined:()=>iI,unicodeEmail:()=>pN,uppercase:()=>sI,uuid:()=>ec,uuid4:()=>zre,uuid6:()=>Lre,uuid7:()=>Bre,xid:()=>Fk});var Ok=/^[cC][0-9a-z]{6,}$/,Dk=/^[0-9a-z]+$/,Mk=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fk=/^[0-9a-vA-V]{20}$/,$k=/^[A-Za-z0-9]{27}$/,jk=/^[a-zA-Z0-9_-]{21}$/,Nk=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Nre=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ec=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},zre=ec(4),Lre=ec(6),Bre=ec(7),Lk=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ure=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qre=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,pN=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Jre=pN,Hre=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wre="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bk(){return new RegExp(Wre,"u")}var Uk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Jk=(e)=>{let t=di(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Hk=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wk=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zk=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hh=/^[A-Za-z0-9_-]*$/,Zre=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Vre=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Vk=/^https?$/,Gk=/^\+[1-9]\d{6,14}$/,dN="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Kk=new RegExp(`^${dN}$`);function mN(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Qk(e){return new RegExp(`^${mN(e)}$`)}function Yk(e){let t=mN({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${dN}T(?:${i})$`)}var Xk=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eI=/^-?\d+n?$/,tI=/^-?\d+$/,jd=/^-?\d+(?:\.\d+)?$/,rI=/^(?:true|false)$/i,nI=/^null$/i;var iI=/^undefined$/i;var oI=/^[^A-Z]*$/,sI=/^[^a-z]*$/,Gre=/^[0-9a-fA-F]*$/;function Nd(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function zd(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Kre=/^[0-9a-fA-F]{32}$/,Qre=Nd(22,"=="),Yre=zd(22),Xre=/^[0-9a-fA-F]{40}$/,ene=Nd(27,"="),tne=zd(27),rne=/^[0-9a-fA-F]{64}$/,nne=Nd(43,"="),ine=zd(43),one=/^[0-9a-fA-F]{96}$/,sne=Nd(64,""),ane=zd(64),cne=/^[0-9a-fA-F]{128}$/,une=Nd(86,"=="),lne=zd(86);var Et=C("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),gN={number:"number",bigint:"bigint",object:"date"},yh=C("$ZodCheckLessThan",(e,t)=>{Et.init(e,t);let r=gN[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<o)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value<=t.value:i.value<t.value)return;i.issues.push({origin:r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bh=C("$ZodCheckGreaterThan",(e,t)=>{Et.init(e,t);let r=gN[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>o)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value>=t.value:i.value>t.value)return;i.issues.push({origin:r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aI=C("$ZodCheckMultipleOf",(e,t)=>{Et.init(e,t),e._zod.onattach.push((r)=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):xk(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cI=C("$ZodCheckNumberFormat",(e,t)=>{Et.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=Tk[t.format];e._zod.onattach.push((s)=>{let c=s._zod.bag;if(c.format=t.format,c.minimum=n,c.maximum=o,r)c.pattern=tI}),e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}if(c<n)s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>o)s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),uI=C("$ZodCheckBigIntFormat",(e,t)=>{Et.init(e,t);let[r,i]=Ek[t.format];e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=(n)=>{let o=n.value;if(o<r)n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(o>i)n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),lI=C("$ZodCheckMaxSize",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.size!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)i._zod.bag.maximum=t.maximum}),e._zod.check=(i)=>{let n=i.value;if(n.size<=t.maximum)return;i.issues.push({origin:Od(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pI=C("$ZodCheckMinSize",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.size!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)i._zod.bag.minimum=t.minimum}),e._zod.check=(i)=>{let n=i.value;if(n.size>=t.minimum)return;i.issues.push({origin:Od(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dI=C("$ZodCheckSizeEquals",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.size!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=(i)=>{let n=i.value,o=n.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Od(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),mI=C("$ZodCheckMaxLength",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.length!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)i._zod.bag.maximum=t.maximum}),e._zod.check=(i)=>{let n=i.value;if(n.length<=t.maximum)return;let s=Dd(n);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fI=C("$ZodCheckMinLength",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.length!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)i._zod.bag.minimum=t.minimum}),e._zod.check=(i)=>{let n=i.value;if(n.length>=t.minimum)return;let s=Dd(n);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gI=C("$ZodCheckLengthEquals",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=(i)=>{let n=i.value;return!_s(n)&&n.length!==void 0}),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=(i)=>{let n=i.value,o=n.length;if(o===t.length)return;let s=Dd(n),c=o>t.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Vu=C("$ZodCheckStringFormat",(e,t)=>{var r,i;if(Et.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;if(o.format=t.format,t.pattern)o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(i=e._zod).check??(i.check=()=>{})}),hI=C("$ZodCheckRegex",(e,t)=>{Vu.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),yI=C("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oI),Vu.init(e,t)}),bI=C("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=sI),Vu.init(e,t)}),xI=C("$ZodCheckIncludes",(e,t)=>{Et.init(e,t);let r=di(t.includes),i=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),SI=C("$ZodCheckStartsWith",(e,t)=>{Et.init(e,t);let r=new RegExp(`^${di(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.startsWith(t.prefix))return;i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),vI=C("$ZodCheckEndsWith",(e,t)=>{Et.init(e,t);let r=new RegExp(`.*${di(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.endsWith(t.suffix))return;i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function fN(e,t,r){if(e.issues.length)t.issues.push(...Cn(r,e.issues))}var wI=C("$ZodCheckProperty",(e,t)=>{Et.init(e,t),e._zod.check=(r)=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then((n)=>fN(n,r,t.property));fN(i,r,t.property);return}}),kI=C("$ZodCheckMimeType",(e,t)=>{Et.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((i)=>{i._zod.bag.mime=t.mime}),e._zod.check=(i)=>{if(r.has(i.value.type))return;i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),II=C("$ZodCheckOverwrite",(e,t)=>{Et.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class xh{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
90
90
|
`).filter((o)=>o),i=Math.min(...r.map((o)=>o.length-o.trimStart().length)),n=r.map((o)=>o.slice(i)).map((o)=>" ".repeat(this.indent*2)+o);for(let o of n)this.content.push(o)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,i.join(`
|
|
91
91
|
`))}}var TI={major:4,minor:4,patch:3};var Ve=C("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=TI;let i=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,c,u)=>{let l=Ms(s),p;for(let m of c){if(m._zod.def.when){if(Ck(s))continue;if(!m._zod.def.when(s))continue}else if(l)continue;let f=s.issues.length,g=m._zod.check(s);if(g instanceof Promise&&u?.async===!1)throw new eo;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{if(await g,s.issues.length===f)return;if(!l)l=Ms(s,f)});else{if(s.issues.length===f)continue;if(!l)l=Ms(s,f)}}if(p)return p.then(()=>s);return s},o=(s,c,u)=>{if(Ms(s))return s.aborted=!0,s;let l=n(c,i,u);if(l instanceof Promise){if(u.async===!1)throw new eo;return l.then((p)=>e._zod.parse(p,u))}return e._zod.parse(l,u)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((p)=>o(p,s,c));return o(l,s,c)}let u=e._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new eo;return u.then((l)=>n(l,i,c))}return n(u,i,c)}}ct(e,"~standard",()=>({validate:(n)=>{try{let o=Ak(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch(o){return _k(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),tc=C("$ZodString",(e,t)=>{Ve.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Xk(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),vt=C("$ZodStringFormat",(e,t)=>{Vu.init(e,t),tc.init(e,t)}),CI=C("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zk),vt.init(e,t)}),PI=C("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ec(i))}else t.pattern??(t.pattern=ec());vt.init(e,t)}),RI=C("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lk),vt.init(e,t)}),AI=C("$ZodURL",(e,t)=>{vt.init(e,t),e._zod.check=(r)=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===Vk.source){if(!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}}let n=new URL(i);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(n.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(t.normalize)r.value=n.href;else r.value=i;return}catch(i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),_I=C("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bk()),vt.init(e,t)}),OI=C("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jk),vt.init(e,t)}),DI=C("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ok),vt.init(e,t)}),MI=C("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dk),vt.init(e,t)}),FI=C("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mk),vt.init(e,t)}),$I=C("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fk),vt.init(e,t)}),jI=C("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$k),vt.init(e,t)}),NI=C("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Yk(t)),vt.init(e,t)}),zI=C("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kk),vt.init(e,t)}),LI=C("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Qk(t)),vt.init(e,t)}),BI=C("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Nk),vt.init(e,t)}),UI=C("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Uk),vt.init(e,t),e._zod.bag.format="ipv4"}),qI=C("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=qk),vt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),JI=C("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Jk(t.delimiter)),vt.init(e,t),e._zod.bag.format="mac"}),HI=C("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hk),vt.init(e,t)}),WI=C("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Wk),vt.init(e,t),e._zod.check=(r)=>{let i=r.value.split("/");try{if(i.length!==2)throw Error();let[n,o]=i;if(!o)throw Error();let s=Number(o);if(`${s}`!==o)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ZI(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var VI=C("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zk),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(ZI(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function _N(e){if(!hh.test(e))return!1;let t=e.replace(/[-_]/g,(i)=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ZI(r)}var GI=C("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=hh),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(_N(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),KI=C("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gk),vt.init(e,t)});function ON(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var QI=C("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=(r)=>{if(ON(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),YI=C("$ZodCustomStringFormat",(e,t)=>{vt.init(e,t),e._zod.check=(r)=>{if(t.fn(r.value))return;r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ih=C("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??jd,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),XI=C("$ZodNumberFormat",(e,t)=>{cI.init(e,t),Ih.init(e,t)}),Ld=C("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=rI,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(o){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Th=C("$ZodBigInt",(e,t)=>{Ve.init(e,t),e._zod.pattern=eI,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(n){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),eT=C("$ZodBigIntFormat",(e,t)=>{uI.init(e,t),Th.init(e,t)}),tT=C("$ZodSymbol",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n==="symbol")return r;return r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),rT=C("$ZodUndefined",(e,t)=>{Ve.init(e,t),e._zod.pattern=iI,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),nT=C("$ZodNull",(e,t)=>{Ve.init(e,t),e._zod.pattern=nI,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),iT=C("$ZodAny",(e,t)=>{Ve.init(e,t),e._zod.parse=(r)=>r}),oT=C("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=(r)=>r}),sT=C("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),aT=C("$ZodVoid",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),cT=C("$ZodDate",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(c){}let n=r.value,o=n instanceof Date;if(o&&!Number.isNaN(n.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function yN(e,t,r){if(e.issues.length)t.issues.push(...Cn(r,e.issues));t.value[r]=e.value}var uT=C("$ZodArray",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let c=n[s],u=t.element._zod.run({value:c,issues:[]},i);if(u instanceof Promise)o.push(u.then((l)=>yN(l,r,s)));else yN(u,r,s)}if(o.length)return Promise.all(o).then(()=>r);return r}});function kh(e,t,r,i,n,o){let s=r in i;if(e.issues.length){if(n&&o&&!s)return;t.issues.push(...Cn(r,e.issues))}if(!s&&!n){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}function DN(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Ik(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function MN(e,t,r,i,n,o){let s=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,p=u.optin==="optional",m=u.optout==="optional";for(let f in t){if(f==="__proto__")continue;if(c.has(f))continue;if(l==="never"){s.push(f);continue}let g=u.run({value:t[f],issues:[]},i);if(g instanceof Promise)e.push(g.then((S)=>kh(S,r,f,t,p,m)));else kh(g,r,f,t,p,m)}if(s.length)r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o});if(!e.length)return r;return Promise.all(e).then(()=>r)}var FN=C("$ZodObject",(e,t)=>{if(Ve.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}let i=Uu(()=>DN(t));ct(e._zod,"propValues",()=>{let c=t.shape,u={};for(let l in c){let p=c[l]._zod;if(p.values){u[l]??(u[l]=new Set);for(let m of p.values)u[l].add(m)}}return u});let n=Xa,o=t.catchall,s;e._zod.parse=(c,u)=>{s??(s=i.value);let l=c.value;if(!n(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let p=[],m=s.shape;for(let f of s.keys){let g=m[f],S=g._zod.optin==="optional",P=g._zod.optout==="optional",D=g._zod.run({value:l[f],issues:[]},u);if(D instanceof Promise)p.push(D.then((L)=>kh(L,c,f,l,S,P)));else kh(D,c,f,l,S,P)}if(!o)return p.length?Promise.all(p).then(()=>c):c;return MN(p,l,c,u,i.value,e)}}),lT=C("$ZodObjectJIT",(e,t)=>{FN.init(e,t);let r=e._zod.parse,i=Uu(()=>DN(t)),n=(f)=>{let g=new xh(["shape","payload","ctx"]),S=i.value,P=(Q)=>{let se=ih(Q);return`shape[${se}]._zod.run({ value: input[${se}], issues: [] }, ctx)`};g.write("const input = payload.value;");let D=Object.create(null),L=0;for(let Q of S.keys)D[Q]=`key_${L++}`;g.write("const newResult = {};");for(let Q of S.keys){let se=D[Q],me=ih(Q),F=f[Q],Be=F?._zod?.optin==="optional",Te=F?._zod?.optout==="optional";if(g.write(`const ${se} = ${P(Q)};`),Be&&Te)g.write(`
|
|
@@ -149,11 +149,11 @@ return `+str.trim()+`;
|
|
|
149
149
|
|
|
150
150
|
`)}g.write("payload.value = newResult;"),g.write("return payload;");let Se=g.compile();return(Q,se)=>Se(f,Q,se)},o,s=Xa,c=!Qa.jitless,l=c&&vk.value,p=t.catchall,m;e._zod.parse=(f,g)=>{m??(m=i.value);let S=f.value;if(!s(S))return f.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),f;if(c&&l&&g?.async===!1&&g.jitless!==!0){if(!o)o=n(t.shape);if(f=o(f,g),!p)return f;return MN([],S,f,g,m,e)}return r(f,g)}});function bN(e,t,r,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter((o)=>!Ms(o));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((o)=>o.issues.map((s)=>ln(s,i,Kt())))}),t}var Bd=C("$ZodUnion",(e,t)=>{Ve.init(e,t),ct(e._zod,"optin",()=>t.options.some((i)=>i._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>t.options.some((i)=>i._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(t.options.every((i)=>i._zod.values))return new Set(t.options.flatMap((i)=>Array.from(i._zod.values)));return}),ct(e._zod,"pattern",()=>{if(t.options.every((i)=>i._zod.pattern)){let i=t.options.map((n)=>n._zod.pattern);return new RegExp(`^(${i.map((n)=>Ad(n.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},n);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!o)return bN(s,i,e,n);return Promise.all(s).then((c)=>bN(c,i,e,n))}});function xN(e,t,r,i){let n=e.filter((o)=>o.issues.length===0);if(n.length===1)return t.value=n[0].value,t;if(n.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((o)=>o.issues.map((s)=>ln(s,i,Kt())))});else t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1});return t}var pT=C("$ZodXor",(e,t)=>{Bd.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},n);if(u instanceof Promise)s.push(u),o=!0;else s.push(u)}if(!o)return xN(s,i,e,n);return Promise.all(s).then((c)=>xN(c,i,e,n))}}),dT=C("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bd.init(e,t);let r=e._zod.parse;ct(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){if(!n[c])n[c]=new Set;for(let l of u)n[c].add(l)}}return n});let i=Uu(()=>{let n=t.options,o=new Map;for(let s of n){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!Xa(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=i.value.get(s?.[t.discriminator]);if(c)return c._zod.run(n,o);if(t.unionFallback||o.direction==="backward")return r(n,o);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:s,path:[t.discriminator],inst:e}),n}}),mT=C("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);if(o instanceof Promise||s instanceof Promise)return Promise.all([o,s]).then(([u,l])=>SN(r,u,l));return SN(r,o,s)}});function EI(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ds(e)&&Ds(t)){let r=Object.keys(t),i=Object.keys(e).filter((o)=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=EI(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=EI(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function SN(e,t,r){let i=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let u of c.keys){if(!i.has(u))i.set(u,{});i.get(u).l=!0}}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys){if(!i.has(u))i.set(u,{});i.get(u).r=!0}else e.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&n)e.issues.push({...n,keys:o});if(Ms(e))return e;let s=EI(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Eh=C("$ZodTuple",(e,t)=>{Ve.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=vN(r,"optin"),u=vN(r,"optout");if(!t.rest){if(o.length<c)return i.issues.push({code:"too_small",minimum:c,inclusive:!0,input:o,inst:e,origin:"array"}),i;if(o.length>r.length)i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:e,origin:"array"})}let l=Array(r.length);for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:o[p],issues:[]},n);if(m instanceof Promise)s.push(m.then((f)=>{l[p]=f}));else l[p]=m}if(t.rest){let p=r.length-1,m=o.slice(r.length);for(let f of m){p++;let g=t.rest._zod.run({value:f,issues:[]},n);if(g instanceof Promise)s.push(g.then((S)=>wN(S,i,p)));else wN(g,i,p)}}if(s.length)return Promise.all(s).then(()=>kN(l,i,r,o,u));return kN(l,i,r,o,u)}});function vN(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function wN(e,t,r){if(e.issues.length)t.issues.push(...Cn(r,e.issues));t.value[r]=e.value}function kN(e,t,r,i,n){for(let o=0;o<r.length;o++){let s=e[o],c=o<i.length;if(s.issues.length){if(!c&&o>=n){t.value.length=o;break}t.issues.push(...Cn(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=i.length;o--)if(r[o]._zod.optout==="optional"&&t.value[o]===void 0)t.value.length=o;else break;return t}var fT=C("$ZodRecord",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Ds(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let l of s)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){c.add(typeof l==="number"?l.toString():l);let p=t.keyType._zod.run({value:l,issues:[]},i);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map((g)=>ln(g,i,Kt())),input:l,path:[l],inst:e});continue}let m=p.value,f=t.valueType._zod.run({value:n[l],issues:[]},i);if(f instanceof Promise)o.push(f.then((g)=>{if(g.issues.length)r.issues.push(...Cn(l,g.issues));r.value[m]=g.value}));else{if(f.issues.length)r.issues.push(...Cn(l,f.issues));r.value[m]=f.value}}let u;for(let l in n)if(!c.has(l))u=u??[],u.push(l);if(u&&u.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(n,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&jd.test(c)&&u.issues.length){let m=t.keyType._zod.run({value:Number(c),issues:[]},i);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length===0)u=m}if(u.issues.length){if(t.mode==="loose")r.value[c]=n[c];else r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map((m)=>ln(m,i,Kt())),input:c,path:[c],inst:e});continue}let p=t.valueType._zod.run({value:n[c],issues:[]},i);if(p instanceof Promise)o.push(p.then((m)=>{if(m.issues.length)r.issues.push(...Cn(c,m.issues));r.value[u.value]=m.value}));else{if(p.issues.length)r.issues.push(...Cn(c,p.issues));r.value[u.value]=p.value}}}if(o.length)return Promise.all(o).then(()=>r);return r}}),gT=C("$ZodMap",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,c]of n){let u=t.keyType._zod.run({value:s,issues:[]},i),l=t.valueType._zod.run({value:c,issues:[]},i);if(u instanceof Promise||l instanceof Promise)o.push(Promise.all([u,l]).then(([p,m])=>{IN(p,m,r,s,n,e,i)}));else IN(u,l,r,s,n,e,i)}if(o.length)return Promise.all(o).then(()=>r);return r}});function IN(e,t,r,i,n,o,s){if(e.issues.length)if(_d.has(typeof i))r.issues.push(...Cn(i,e.issues));else r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map((c)=>ln(c,s,Kt()))});if(t.issues.length)if(_d.has(typeof i))r.issues.push(...Cn(i,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map((c)=>ln(c,s,Kt()))});r.value.set(e.value,t.value)}var hT=C("$ZodSet",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},i);if(c instanceof Promise)o.push(c.then((u)=>TN(u,r)));else TN(c,r)}if(o.length)return Promise.all(o).then(()=>r);return r}});function TN(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var yT=C("$ZodEnum",(e,t)=>{Ve.init(e,t);let r=Rd(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter((n)=>_d.has(typeof n)).map((n)=>typeof n==="string"?di(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;if(i.has(s))return n;return n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),bT=C("$ZodLiteral",(e,t)=>{if(Ve.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map((i)=>typeof i==="string"?di(i):i?di(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;if(r.has(o))return i;return i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),xT=C("$ZodFile",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(n instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),ST=C("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ya(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new eo;return r.value=n,r.fallback=!0,r}});function EN(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var Ch=C("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ct(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ad(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,o=t.innerType._zod.run(r,i);if(o instanceof Promise)return o.then((s)=>EN(s,n));return EN(o,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,i)}}),vT=C("$ZodExactOptional",(e,t)=>{Ch.init(e,t),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),wT=C("$ZodNullable",(e,t)=>{Ve.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ad(r.source)}|null)$`):void 0}),ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>{if(r.value===null)return r;return t.innerType._zod.run(r,i)}}),kT=C("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>CN(o,t));return CN(n,t)}});function CN(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var IT=C("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,i)}}),TT=C("$ZodNonOptional",(e,t)=>{Ve.init(e,t),ct(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((i)=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>PN(o,e));return PN(n,e)}});function PN(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var ET=C("$ZodSuccess",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ya("ZodSuccess");let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>(r.value=o.issues.length===0,r));return r.value=n.issues.length===0,r}}),CT=C("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>{if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>ln(s,i,Kt()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((o)=>ln(o,i,Kt()))},input:r.value}),r.issues=[],r.fallback=!0;return r}}),PT=C("$ZodNaN",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),Ph=C("$ZodPipe",(e,t)=>{Ve.init(e,t),ct(e._zod,"values",()=>t.in._zod.values),ct(e._zod,"optin",()=>t.in._zod.optin),ct(e._zod,"optout",()=>t.out._zod.optout),ct(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(r,i);if(o instanceof Promise)return o.then((s)=>Sh(s,t.in,i));return Sh(o,t.in,i)}let n=t.in._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>Sh(o,t.out,i));return Sh(n,t.out,i)}});function Sh(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var Ud=C("$ZodCodec",(e,t)=>{Ve.init(e,t),ct(e._zod,"values",()=>t.in._zod.values),ct(e._zod,"optin",()=>t.in._zod.optin),ct(e._zod,"optout",()=>t.out._zod.optout),ct(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(r,i);if(o instanceof Promise)return o.then((s)=>vh(s,t,i));return vh(o,t,i)}else{let o=t.out._zod.run(r,i);if(o instanceof Promise)return o.then((s)=>vh(s,t,i));return vh(o,t,i)}}});function vh(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);if(n instanceof Promise)return n.then((o)=>wh(e,o,t.out,r));return wh(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);if(n instanceof Promise)return n.then((o)=>wh(e,o,t.in,r));return wh(e,n,t.in,r)}}function wh(e,t,r,i){if(e.issues.length)return e.aborted=!0,e;return r._zod.run({value:t,issues:e.issues},i)}var RT=C("$ZodPreprocess",(e,t)=>{Ph.init(e,t)}),AT=C("$ZodReadonly",(e,t)=>{Ve.init(e,t),ct(e._zod,"propValues",()=>t.innerType._zod.propValues),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"optin",()=>t.innerType?._zod?.optin),ct(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then(RN);return RN(n)}});function RN(e){return e.value=Object.freeze(e.value),e}var _T=C("$ZodTemplateLiteral",(e,t)=>{Ve.init(e,t);let r=[];for(let i of t.parts)if(typeof i==="object"&&i!==null){if(!i._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||kk.has(typeof i))r.push(di(`${i}`));else throw Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i;return i}}),OT=C("$ZodFunction",(e,t)=>(Ve.init(e,t),e._def=t,e._zod.def=t,e.implement=(r)=>{if(typeof r!=="function")throw Error("implement() must be called with a function");return function(...i){let n=e._def.input?sh(e._def.input,i):i,o=Reflect.apply(r,this,n);if(e._def.output)return sh(e._def.output,o);return o}},e.implementAsync=(r)=>{if(typeof r!=="function")throw Error("implementAsync() must be called with a function");return async function(...i){let n=e._def.input?await ah(e._def.input,i):i,o=await Reflect.apply(r,this,n);if(e._def.output)return await ah(e._def.output,o);return o}},e._zod.parse=(r,i)=>{if(typeof r.value!=="function")return r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r;if(e._def.output&&e._def.output._zod.def.type==="promise")r.value=e.implementAsync(r.value);else r.value=e.implement(r.value);return r},e.input=(...r)=>{let i=e.constructor;if(Array.isArray(r[0]))return new i({type:"function",input:new Eh({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output});return new i({type:"function",input:r[0],output:e._def.output})},e.output=(r)=>new e.constructor({type:"function",input:e._def.input,output:r}),e)),DT=C("$ZodPromise",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}),MT=C("$ZodLazy",(e,t)=>{Ve.init(e,t),ct(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),ct(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ct(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ct(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ct(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),FT=C("$ZodCustom",(e,t)=>{Et.init(e,t),Ve.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=(r)=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then((o)=>AN(o,r,i,e));AN(n,r,i,e);return}});function AN(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};if(i._zod.def.params)n.params=i._zod.def.params;t.issues.push(qu(n))}}var Zd={};pi(Zd,{ar:()=>$T,az:()=>jT,be:()=>NT,bg:()=>zT,ca:()=>LT,cs:()=>BT,da:()=>UT,de:()=>qT,el:()=>JT,en:()=>qd,eo:()=>HT,es:()=>WT,fa:()=>ZT,fi:()=>VT,fr:()=>GT,frCA:()=>KT,he:()=>QT,hr:()=>YT,hu:()=>XT,hy:()=>eE,id:()=>tE,is:()=>rE,it:()=>nE,ja:()=>iE,ka:()=>oE,kh:()=>sE,km:()=>Jd,ko:()=>aE,lt:()=>cE,mk:()=>uE,ms:()=>lE,nl:()=>pE,no:()=>dE,ota:()=>mE,pl:()=>gE,ps:()=>fE,pt:()=>hE,ro:()=>yE,ru:()=>bE,sl:()=>xE,sv:()=>SE,ta:()=>vE,th:()=>wE,tr:()=>kE,ua:()=>IE,uk:()=>Wd,ur:()=>TE,uz:()=>EE,vi:()=>CE,yo:()=>AE,zhCN:()=>PE,zhTW:()=>RE});var dne=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`;return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":if(n.values.length===1)return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(n.values[0])}`;return`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`;return`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`;if(o.format==="ends_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`;if(o.format==="includes")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`;if(o.format==="regex")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`;return`${r[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${_(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function $T(){return{localeError:dne()}}var mne=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":if(n.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(n.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;if(o.format==="ends_with")return`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`;if(o.format==="includes")return`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`;if(o.format==="regex")return`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;return`Yanl\u0131\u015F ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function jT(){return{localeError:mne()}}function $N(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var fne=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":if(n.values.length===1)return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(n.values[0])}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=$N(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=$N(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`;if(o.format==="regex")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function NT(){return{localeError:fne()}}var gne=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(n.values[0])}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";if(o.format==="emoji")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(o.format==="datetime")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(o.format==="date")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";if(o.format==="time")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(o.format==="duration")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";return`${s} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function zT(){return{localeError:gne()}}var hne=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`;return`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":if(n.values.length===1)return`Valor inv\xE0lid: s'esperava ${V(n.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${_(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);if(s)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);if(s)return`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`;if(o.format==="ends_with")return`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`;if(o.format==="includes")return`Format inv\xE0lid: ha d'incloure "${o.includes}"`;if(o.format==="regex")return`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`;return`Format inv\xE0lid per a ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function LT(){return{localeError:hne()}}var yne=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":if(n.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(n.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`;if(o.format==="ends_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`;if(o.format==="includes")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`;if(o.format==="regex")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`;return`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${_(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function BT(){return{localeError:yne()}}var bne=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`;return`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":if(n.values.length===1)return`Ugyldig v\xE6rdi: forventede ${V(n.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`For stor: forventede ${c??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`For lille: forventede ${c} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`;return`For lille: forventede ${c} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: skal starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: skal ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: skal indeholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`;return`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function UT(){return{localeError:bne()}}var xne=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`;return`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":if(n.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${V(n.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ung\xFCltiger String: muss mit "${o.suffix}" enden`;if(o.format==="includes")return`Ung\xFCltiger String: muss "${o.includes}" enthalten`;if(o.format==="regex")return`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`;return`Ung\xFCltig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function qT(){return{localeError:xne()}}var Sne=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(typeof n.expected==="string"&&/^[A-Z]/.test(n.expected))return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":if(n.values.length===1)return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${V(n.values[0])}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.minimum.toString()} ${s.unit}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`;if(o.format==="ends_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`;if(o.format==="includes")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`;if(o.format==="regex")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function JT(){return{localeError:Sne()}}var vne=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${V(n.values[0])}`;return`Invalid option: expected one of ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`;return`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Invalid string: must start with "${o.prefix}"`;if(o.format==="ends_with")return`Invalid string: must end with "${o.suffix}"`;if(o.format==="includes")return`Invalid string: must include "${o.includes}"`;if(o.format==="regex")return`Invalid string: must match pattern ${o.pattern}`;return`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((s)=>`'${s}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function qd(){return{localeError:vne()}}var wne=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`;return`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendi\u011Dis ${V(n.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`;return`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`;if(o.format==="ends_with")return`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`;if(o.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${o.includes}"`;if(o.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`;return`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function HT(){return{localeError:wne()}}var kne=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`;return`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":if(n.values.length===1)return`Entrada inv\xE1lida: se esperaba ${V(n.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${n.minimum.toString()} ${s.unit}`;return`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`;if(o.format==="ends_with")return`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`;if(o.format==="includes")return`Cadena inv\xE1lida: debe incluir "${o.includes}"`;if(o.format==="regex")return`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`;return`Inv\xE1lido ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function WT(){return{localeError:kne()}}var Ine=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":if(n.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;return`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${_(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;if(o.format==="ends_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;if(o.format==="includes")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`;if(o.format==="regex")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;return`${r[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${_(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function ZT(){return{localeError:Ine()}}var Tne=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`;return`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":if(n.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(n.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`;if(o.format==="ends_with")return`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`;if(o.format==="includes")return`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`;if(o.format==="regex")return`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`;return`Virheellinen ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function VT(){return{localeError:Tne()}}var Ene=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`;return`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":if(n.values.length===1)return`Entr\xE9e invalide : ${V(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${_(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Trop grand : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Trop petit : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Cha\xEEne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`;return`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function GT(){return{localeError:Ene()}}var Cne=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`;return`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":if(n.values.length===1)return`Entr\xE9e invalide : attendu ${V(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=t(n.origin);if(s)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=t(n.origin);if(s)return`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Cha\xEEne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`;return`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function KT(){return{localeError:Cne()}}var Pne=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=(l)=>l?e[l]:void 0,i=(l)=>{let p=r(l);if(p)return p.label;return l??e.unknown.label},n=(l)=>`\u05D4${i(l)}`,o=(l)=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=(l)=>{if(!l)return null;return t[l]??null},c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return(l)=>{switch(l.code){case"invalid_type":{let p=l.expected,m=u[p??""]??i(p),f=K(l.input),g=u[f]??e[f]?.label??f;if(/^[A-Z]/.test(l.expected))return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${V(l.values[0])}`;let p=l.values.map((g)=>V(g));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let m=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let p=s(l.origin),m=n(l.origin??"value");if(l.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let S=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${S}`}if(l.origin==="array"||l.origin==="set"){let S=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",P=l.inclusive?`${l.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${S} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let f=l.inclusive?"<=":"<",g=o(l.origin??"value");if(p?.unit)return`${p.longLabel} \u05DE\u05D3\u05D9: ${m} ${g} ${f}${l.maximum.toString()} ${p.unit}`;return`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${g} ${f}${l.maximum.toString()}`}case"too_small":{let p=s(l.origin),m=n(l.origin??"value");if(l.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let S=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${S}`}if(l.origin==="array"||l.origin==="set"){let S=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let D=l.origin==="set"?"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3":"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${S} \u05DC\u05D4\u05DB\u05D9\u05DC ${D}`}let P=l.inclusive?`${l.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${S} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let f=l.inclusive?">=":">",g=o(l.origin??"value");if(p?.unit)return`${p.shortLabel} \u05DE\u05D3\u05D9: ${m} ${g} ${f}${l.minimum.toString()} ${p.unit}`;return`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${g} ${f}${l.minimum.toString()}`}case"invalid_format":{let p=l;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let m=c[p.format],f=m?.label??p.format,S=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${S}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${_(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function QT(){return{localeError:Pne()}}var Rne=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${c}`;return`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${c}`}case"invalid_value":if(n.values.length===1)return`Neispravna vrijednost: o\u010Dekivano ${V(n.values[0])}`;return`Neispravna opcija: o\u010Dekivano jedno od ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${o}${n.maximum.toString()} ${s.unit??"elemenata"}`;return`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;if(s)return`Premalo: o\u010Dekivano da ${c} ima ${o}${n.minimum.toString()} ${s.unit}`;return`Premalo: o\u010Dekivano da ${c} bude ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`;if(o.format==="ends_with")return`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`;if(o.format==="includes")return`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`;if(o.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`;return`Neispravna ${r[o.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function YT(){return{localeError:Rne()}}var Ane=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`;return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":if(n.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(n.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;if(o.format==="ends_with")return`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;if(o.format==="includes")return`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`;if(o.format==="regex")return`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`;return`\xC9rv\xE9nytelen ${r[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function XT(){return{localeError:Ane()}}function jN(e,t,r){return Math.abs(e)===1?t:r}function Gu(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var _ne=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`;return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":if(n.values.length===1)return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${V(n.values[1])}`;return`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=jN(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gu(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gu(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=jN(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gu(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Gu(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`;if(o.format==="ends_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`;if(o.format==="includes")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`;if(o.format==="regex")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;return`\u054D\u056D\u0561\u056C ${r[o.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${_(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Gu(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Gu(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function eE(){return{localeError:_ne()}}var One=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`;return`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${V(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak valid: harus dimulai dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak valid: harus berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak valid: harus menyertakan "${o.includes}"`;if(o.format==="regex")return`String tidak valid: harus sesuai pola ${o.pattern}`;return`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function tE(){return{localeError:One()}}var Dne=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":if(n.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${V(n.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`;if(o.format==="ends_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`;if(o.format==="includes")return`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`;if(o.format==="regex")return`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`;return`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${_(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function rE(){return{localeError:Dne()}}var Mne=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`;return`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${V(n.values[0])}`;return`Opzione non valida: atteso uno tra ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Stringa non valida: deve iniziare con "${o.prefix}"`;if(o.format==="ends_with")return`Stringa non valida: deve terminare con "${o.suffix}"`;if(o.format==="includes")return`Stringa non valida: deve includere "${o.includes}"`;if(o.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${o.pattern}`;return`Input non valido: ${r[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${_(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function nE(){return{localeError:Mne()}}var Fne=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":if(n.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${V(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${_(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);if(s)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);if(s)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(o.format==="ends_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(o.format==="includes")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(o.format==="regex")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u7121\u52B9\u306A${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${_(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function iE(){return{localeError:Fne()}}var $ne=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":if(n.values.length===1)return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(n.values[0])}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${_(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`;if(o.format==="ends_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`;if(o.format==="includes")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`;if(o.format==="regex")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function oE(){return{localeError:$ne()}}var jne=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`;return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":if(n.values.length===1)return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(n.values[0])}`;return`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`;if(o.format==="ends_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`;if(o.format==="includes")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`;if(o.format==="regex")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`;return`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${_(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Jd(){return{localeError:jne()}}function sE(){return Jd()}var Nne=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":if(n.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${_(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";if(c)return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${o}${s}`;return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";if(c)return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${o}${s}`;return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;if(o.format==="ends_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;if(o.format==="includes")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;if(o.format==="regex")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C ${r[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${_(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function aE(){return{localeError:Nne()}}var Hd=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function NN(e){let t=Math.abs(e),r=t%10,i=t%100;if(i>=11&&i<=19||r===0)return"many";if(r===1)return"one";return"few"}var zne=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,o,s,c){let u=e[n]??null;if(u===null)return u;return{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`;return`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":if(n.values.length===1)return`Privalo b\u016Bti ${V(n.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${_(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=t(n.origin,NN(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Hd(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Hd(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=t(n.origin,NN(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Hd(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Hd(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`;if(o.format==="ends_with")return`Eilut\u0117 privalo pasibaigti "${o.suffix}"`;if(o.format==="includes")return`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`;if(o.format==="regex")return`Eilut\u0117 privalo atitikti ${o.pattern}`;return`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${_(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${Hd(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function cE(){return{localeError:zne()}}var Lne=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`;return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${V(n.values[0])}`;return`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`;return`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function uE(){return{localeError:Lne()}}var Bne=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`;return`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${V(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak sah: mesti bermula dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak sah: mesti mengandungi "${o.includes}"`;if(o.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${o.pattern}`;return`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function lE(){return{localeError:Bne()}}var Une=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`;return`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${V(n.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";if(s)return`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`;return`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";if(s)return`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`;return`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ongeldige tekst: moet met "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ongeldige tekst: moet op "${o.suffix}" eindigen`;if(o.format==="includes")return`Ongeldige tekst: moet "${o.includes}" bevatten`;if(o.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`;return`Ongeldig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function pE(){return{localeError:Une()}}var qne=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`;return`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${V(n.values[0])}`;return`Ugyldig valg: forventet en av ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: m\xE5 starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: m\xE5 ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: m\xE5 inneholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`;return`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function dE(){return{localeError:qne()}}var Jne=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`;return`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":if(n.values.length===1)return`F\xE2sit giren: umulan ${V(n.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`;if(o.format==="ends_with")return`F\xE2sit metin: "${o.suffix}" ile bitmeli.`;if(o.format==="includes")return`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`;if(o.format==="regex")return`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`;return`F\xE2sit ${r[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function mE(){return{localeError:Jne()}}var Hne=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":if(n.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(n.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${_(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;if(o.format==="ends_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;if(o.format==="includes")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`;if(o.format==="regex")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;return`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${_(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function fE(){return{localeError:Hne()}}var Wne=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":if(n.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(n.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`;if(o.format==="ends_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`;if(o.format==="includes")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`;if(o.format==="regex")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`;return`Nieprawid\u0142ow(y/a/e) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function gE(){return{localeError:Wne()}}var Zne=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`;return`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":if(n.values.length===1)return`Entrada inv\xE1lida: esperado ${V(n.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`;if(o.format==="ends_with")return`Texto inv\xE1lido: deve terminar com "${o.suffix}"`;if(o.format==="includes")return`Texto inv\xE1lido: deve incluir "${o.includes}"`;if(o.format==="regex")return`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`;return`${r[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${_(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function hE(){return{localeError:Zne()}}var Vne=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${c}`}case"invalid_value":if(n.values.length===1)return`Intrare invalid\u0103: a\u0219teptat ${V(n.values[0])}`;return`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemente"}`;return`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`;if(o.format==="ends_with")return`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`;if(o.format==="includes")return`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`;if(o.format==="regex")return`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`;return`Format invalid: ${r[o.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${_(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function yE(){return{localeError:Vne()}}function zN(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var Gne=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(n.values[0])}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=zN(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=zN(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function bE(){return{localeError:Gne()}}var Kne=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`;return`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${V(n.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`;if(o.format==="ends_with")return`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`;if(o.format==="includes")return`Neveljaven niz: mora vsebovati "${o.includes}"`;if(o.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`;return`Neveljaven ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${_(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function xE(){return{localeError:Kne()}}var Qne=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(n.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`;if(o.format==="ends_with")return`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`;if(o.format==="includes")return`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`;if(o.format==="regex")return`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`;return`Ogiltig(t) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${_(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function SE(){return{localeError:Qne()}}var Yne=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":if(n.values.length===1)return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(n.values[0])}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${_(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(o.format==="ends_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(o.format==="includes")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(o.format==="regex")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function vE(){return{localeError:Yne()}}var Xne=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`;return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":if(n.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(n.values[0])}`;return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);if(s)return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);if(s)return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`;if(o.format==="ends_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`;if(o.format==="includes")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;if(o.format==="regex")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`;return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${_(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function wE(){return{localeError:Xne()}}var eie=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":if(n.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${V(n.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`;if(o.format==="ends_with")return`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`;if(o.format==="includes")return`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`;if(o.format==="regex")return`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`;return`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function kE(){return{localeError:eie()}}var tie=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(n.values[0])}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${_(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Wd(){return{localeError:tie()}}function IE(){return Wd()}var rie=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":if(n.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${_(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(o.format==="ends_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(o.format==="includes")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(o.format==="regex")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;return`\u063A\u0644\u0637 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${_(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function TE(){return{localeError:rie()}}var nie=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":if(n.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${V(n.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`;return`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`;return`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`;if(o.format==="ends_with")return`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`;if(o.format==="includes")return`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`;if(o.format==="regex")return`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`;return`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function EE(){return{localeError:nie()}}var iie=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`;return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":if(n.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(n.values[0])}`;return`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`;if(o.format==="ends_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`;if(o.format==="includes")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`;if(o.format==="regex")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`;return`${r[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${_(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function CE(){return{localeError:iie()}}var oie=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`;return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":if(n.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(n.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`;if(o.format==="ends_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`;if(o.format==="includes")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`;if(o.format==="regex")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`;return`\u65E0\u6548${r[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${_(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function PE(){return{localeError:oie()}}var sie=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`;return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":if(n.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(n.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`;if(o.format==="ends_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`;if(o.format==="includes")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`;if(o.format==="regex")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`;return`\u7121\u6548\u7684 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${_(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function RE(){return{localeError:sie()}}var aie=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return(n)=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=K(n.input),c=i[s]??s;if(/^[A-Z]/.test(n.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`;return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":if(n.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(n.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${_(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`;if(o.format==="ends_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`;if(o.format==="includes")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`;if(o.format==="regex")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`;return`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${_(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function AE(){return{localeError:aie()}}var LN,_E=Symbol("ZodOutput"),OE=Symbol("ZodInput");class DE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Rh(){return new DE}(LN=globalThis).__zod_globalRegistry??(LN.__zod_globalRegistry=Rh());var $r=globalThis.__zod_globalRegistry;function ME(e,t){return new e({type:"string",...ce(t)})}function FE(e,t){return new e({type:"string",coerce:!0,...ce(t)})}function Ah(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function Vd(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function _h(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function Oh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function Dh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function Mh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function Gd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function Fh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function $h(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function jh(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function Nh(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function zh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function Lh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function Bh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function Uh(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function qh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function $E(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ce(t)})}function Jh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function Hh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function Wh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function Zh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function Vh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function Gh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}var jE={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function NE(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function zE(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function LE(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function BE(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function UE(e,t){return new e({type:"number",checks:[],...ce(t)})}function qE(e,t){return new e({type:"number",coerce:!0,checks:[],...ce(t)})}function JE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function HE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ce(t)})}function WE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ce(t)})}function ZE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ce(t)})}function VE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ce(t)})}function GE(e,t){return new e({type:"boolean",...ce(t)})}function KE(e,t){return new e({type:"boolean",coerce:!0,...ce(t)})}function QE(e,t){return new e({type:"bigint",...ce(t)})}function YE(e,t){return new e({type:"bigint",coerce:!0,...ce(t)})}function XE(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ce(t)})}function eC(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ce(t)})}function tC(e,t){return new e({type:"symbol",...ce(t)})}function rC(e,t){return new e({type:"undefined",...ce(t)})}function nC(e,t){return new e({type:"null",...ce(t)})}function iC(e){return new e({type:"any"})}function oC(e){return new e({type:"unknown"})}function sC(e,t){return new e({type:"never",...ce(t)})}function aC(e,t){return new e({type:"void",...ce(t)})}function cC(e,t){return new e({type:"date",...ce(t)})}function uC(e,t){return new e({type:"date",coerce:!0,...ce(t)})}function lC(e,t){return new e({type:"nan",...ce(t)})}function to(e,t){return new yh({check:"less_than",...ce(t),value:e,inclusive:!1})}function Wn(e,t){return new yh({check:"less_than",...ce(t),value:e,inclusive:!0})}function ro(e,t){return new bh({check:"greater_than",...ce(t),value:e,inclusive:!1})}function pn(e,t){return new bh({check:"greater_than",...ce(t),value:e,inclusive:!0})}function Kh(e){return ro(0,e)}function Qh(e){return to(0,e)}function Yh(e){return Wn(0,e)}function Xh(e){return pn(0,e)}function Fs(e,t){return new aI({check:"multiple_of",...ce(t),value:e})}function $s(e,t){return new lI({check:"max_size",...ce(t),maximum:e})}function no(e,t){return new pI({check:"min_size",...ce(t),minimum:e})}function rc(e,t){return new dI({check:"size_equals",...ce(t),size:e})}function nc(e,t){return new mI({check:"max_length",...ce(t),maximum:e})}function Do(e,t){return new fI({check:"min_length",...ce(t),minimum:e})}function ic(e,t){return new gI({check:"length_equals",...ce(t),length:e})}function Ku(e,t){return new hI({check:"string_format",format:"regex",...ce(t),pattern:e})}function Qu(e){return new yI({check:"string_format",format:"lowercase",...ce(e)})}function Yu(e){return new bI({check:"string_format",format:"uppercase",...ce(e)})}function Xu(e,t){return new xI({check:"string_format",format:"includes",...ce(t),includes:e})}function el(e,t){return new SI({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function tl(e,t){return new vI({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function ey(e,t,r){return new wI({check:"property",property:e,schema:t,...ce(r)})}function rl(e,t){return new kI({check:"mime_type",mime:e,...ce(t)})}function Fi(e){return new II({check:"overwrite",tx:e})}function nl(e){return Fi((t)=>t.normalize(e))}function il(){return Fi((e)=>e.trim())}function ol(){return Fi((e)=>e.toLowerCase())}function sl(){return Fi((e)=>e.toUpperCase())}function al(){return Fi((e)=>Sk(e))}function pC(e,t,r){return new e({type:"array",element:t,...ce(r)})}function uie(e,t,r){return new e({type:"union",options:t,...ce(r)})}function lie(e,t,r){return new e({type:"union",options:t,inclusive:!1,...ce(r)})}function pie(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...ce(i)})}function die(e,t,r){return new e({type:"intersection",left:t,right:r})}function mie(e,t,r,i){let n=r instanceof Ve;return new e({type:"tuple",items:t,rest:n?r:null,...ce(n?i:r)})}function fie(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...ce(i)})}function gie(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...ce(i)})}function hie(e,t,r){return new e({type:"set",valueType:t,...ce(r)})}function yie(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new e({type:"enum",entries:i,...ce(r)})}function bie(e,t,r){return new e({type:"enum",entries:t,...ce(r)})}function xie(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ce(r)})}function dC(e,t){return new e({type:"file",...ce(t)})}function Sie(e,t){return new e({type:"transform",transform:t})}function vie(e,t){return new e({type:"optional",innerType:t})}function wie(e,t){return new e({type:"nullable",innerType:t})}function kie(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():wk(r)}})}function Iie(e,t,r){return new e({type:"nonoptional",innerType:t,...ce(r)})}function Tie(e,t){return new e({type:"success",innerType:t})}function Eie(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function Cie(e,t,r){return new e({type:"pipe",in:t,out:r})}function Pie(e,t){return new e({type:"readonly",innerType:t})}function Rie(e,t,r){return new e({type:"template_literal",parts:t,...ce(r)})}function Aie(e,t){return new e({type:"lazy",getter:t})}function _ie(e,t){return new e({type:"promise",innerType:t})}function mC(e,t,r){let i=ce(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function fC(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function gC(e,t){let r=BN((i)=>(i.addIssue=(n)=>{if(typeof n==="string")i.issues.push(qu(n,i.value,r._zod.def));else{let o=n;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(qu(o))}},e(i.value,i)),t);return r}function BN(e,t){let r=new Et({check:"custom",...ce(t)});return r._zod.check=e,r}function hC(e){let t=new Et({check:"describe"});return t._zod.onattach=[(r)=>{let i=$r.get(r)??{};$r.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function yC(e){let t=new Et({check:"meta"});return t._zod.onattach=[(r)=>{let i=$r.get(r)??{};$r.add(r,{...i,...e})}],t._zod.check=()=>{},t}function bC(e,t){let r=ce(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")i=i.map((g)=>typeof g==="string"?g.toLowerCase():g),n=n.map((g)=>typeof g==="string"?g.toLowerCase():g);let o=new Set(i),s=new Set(n),c=e.Codec??Ud,u=e.Boolean??Ld,p=new(e.String??tc)({type:"string",error:r.error}),m=new u({type:"boolean",error:r.error}),f=new c({type:"pipe",in:p,out:m,transform:(g,S)=>{let P=g;if(r.case!=="sensitive")P=P.toLowerCase();if(o.has(P))return!0;else if(s.has(P))return!1;else return S.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:S.value,inst:f,continue:!1}),{}},reverseTransform:(g,S)=>{if(g===!0)return i[0]||"true";else return n[0]||"false"},error:r.error});return f}function cl(e,t,r,i={}){let n=ce(i),o={...ce(i),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(c)=>r.test(c),...n};if(r instanceof RegExp)o.pattern=r;return new e(o)}function js(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??$r,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function yt(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o=t.seen.get(e);if(o){if(o.count++,r.schemaPath.includes(e))o.cycle=r.path;return o.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let f=s.schema,g=t.processors[n.type];if(!g)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,f,p)}let m=e._zod.parent;if(m){if(!s.ref)s.ref=m;yt(m,t,p),t.seen.get(m).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)Object.assign(s.schema,u);if(t.io==="input"&&dn(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(i=s.schema).default??(i.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Ns(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let n=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(s[0])?.id,f=e.external.uri??((S)=>S);if(m)return{ref:f(m)};let g=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=g,{defId:g,ref:`${f("__shared")}#/${c}/${g}`}}if(s[1]===r)return{ref:"#"};let l=`${"#"}/${c}/`,p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:l+p}},o=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=n(s);if(c.def={...c.schema},l)c.defId=l;let p=c.schema;for(let m in p)delete p[m];p.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
151
151
|
|
|
152
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1){if(e.reused==="ref"){o(s);continue}}}}function zs(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,p={...l},m=u.ref;if(u.ref=null,m){i(m);let g=e.seen.get(m),S=g.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(S);else Object.assign(l,S);if(Object.assign(l,p),c._zod.parent===m)for(let D in l){if(D==="$ref"||D==="allOf")continue;if(!(D in p))delete l[D]}if(S.$ref&&g.def)for(let D in l){if(D==="$ref"||D==="allOf")continue;if(D in g.def&&JSON.stringify(l[D])===JSON.stringify(g.def[D]))delete l[D]}}let f=c._zod.parent;if(f&&f!==m){i(f);let g=e.seen.get(f);if(g?.schema.$ref){if(l.$ref=g.schema.$ref,g.def)for(let S in l){if(S==="$ref"||S==="allOf")continue;if(S in g.def&&JSON.stringify(l[S])===JSON.stringify(g.def[S]))delete l[S]}}}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};for(let c of[...e.seen.entries()].reverse())i(c[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;if(o!==void 0&&n.id===o)delete n.id;let s=e.external?.defs??{};for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;s[u.defId]=u.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:ul(t,"input",e.processors),output:ul(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function dn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return dn(i.element,r);if(i.type==="set")return dn(i.valueType,r);if(i.type==="lazy")return dn(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return dn(i.innerType,r);if(i.type==="intersection")return dn(i.left,r)||dn(i.right,r);if(i.type==="record"||i.type==="map")return dn(i.keyType,r)||dn(i.valueType,r);if(i.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return dn(i.in,r)||dn(i.out,r)}if(i.type==="object"){for(let n in i.shape)if(dn(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(dn(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(dn(n,r))return!0;if(i.rest&&dn(i.rest,r))return!0;return!1}return!1}var xC=(e,t={})=>(r)=>{let i=js({...r,processors:t});return yt(e,i),Ns(i,e),zs(i,e)},ul=(e,t,r={})=>(i)=>{let{libraryOptions:n,target:o}=i??{},s=js({...n??{},target:o,io:t,processors:r});return yt(e,s),Ns(s,e),zs(s,e)};var Oie={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},SC=(e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o==="number")n.minLength=o;if(typeof s==="number")n.maxLength=s;if(c){if(n.format=Oie[c]??c,n.format==="")delete n.format;if(c==="time")delete n.format}if(l)n.contentEncoding=l;if(u&&u.size>0){let p=[...u];if(p.length===1)n.pattern=p[0].source;else if(p.length>1)n.allOf=[...p.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},vC=(e,t,r,i)=>{let n=r,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:p}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))n.type="integer";else n.type="number";let m=typeof p==="number"&&p>=(o??Number.NEGATIVE_INFINITY),f=typeof l==="number"&&l<=(s??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";if(m)if(g)n.minimum=p,n.exclusiveMinimum=!0;else n.exclusiveMinimum=p;else if(typeof o==="number")n.minimum=o;if(f)if(g)n.maximum=l,n.exclusiveMaximum=!0;else n.exclusiveMaximum=l;else if(typeof s==="number")n.maximum=s;if(typeof u==="number")n.multipleOf=u},wC=(e,t,r,i)=>{r.type="boolean"},kC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},IC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},TC=(e,t,r,i)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},EC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},CC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},PC=(e,t,r,i)=>{r.not={}},RC=(e,t,r,i)=>{},AC=(e,t,r,i)=>{},_C=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},OC=(e,t,r,i)=>{let n=e._zod.def,o=Rd(n.entries);if(o.every((s)=>typeof s==="number"))r.type="number";if(o.every((s)=>typeof s==="string"))r.type="string";r.enum=o},DC=(e,t,r,i)=>{let n=e._zod.def,o=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(s));else o.push(s);if(o.length===0);else if(o.length===1){let s=o[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(o.every((s)=>typeof s==="number"))r.type="number";if(o.every((s)=>typeof s==="string"))r.type="string";if(o.every((s)=>typeof s==="boolean"))r.type="boolean";if(o.every((s)=>s===null))r.type="null";r.enum=o}},MC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},FC=(e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},$C=(e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;if(s!==void 0)o.minLength=s;if(c!==void 0)o.maxLength=c;if(u)if(u.length===1)o.contentMediaType=u[0],Object.assign(n,o);else Object.assign(n,o),n.anyOf=u.map((l)=>({contentMediaType:l}));else Object.assign(n,o)},jC=(e,t,r,i)=>{r.type="boolean"},NC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},zC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},LC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},BC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},UC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},qC=(e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;if(typeof s==="number")n.minItems=s;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=yt(o.element,t,{...i,path:[...i.path,"items"]})},JC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=yt(s[l],t,{...i,path:[...i.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter((l)=>{let p=o.shape[l]._zod;if(t.io==="input")return p.optin===void 0;else return p.optout===void 0}));if(u.size>0)n.required=Array.from(u);if(o.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!o.catchall){if(t.io==="output")n.additionalProperties=!1}else if(o.catchall)n.additionalProperties=yt(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},ry=(e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,s=n.options.map((c,u)=>yt(c,t,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));if(o)r.oneOf=s;else r.anyOf=s},HC=(e,t,r,i)=>{let n=e._zod.def,o=yt(n.left,t,{...i,path:[...i.path,"allOf",0]}),s=yt(n.right,t,{...i,path:[...i.path,"allOf",1]}),c=(l)=>("allOf"in l)&&Object.keys(l).length===1,u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];r.allOf=u},WC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((f,g)=>yt(f,t,{...i,path:[...i.path,s,g]})),l=o.rest?yt(o.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=u,l)n.items=l}else if(t.target==="openapi-3.0"){if(n.items={anyOf:u},l)n.items.anyOf.push(l);if(n.minItems=u.length,!l)n.maxItems=u.length}else if(n.items=u,l)n.additionalItems=l;let{minimum:p,maximum:m}=e._zod.bag;if(typeof p==="number")n.minItems=p;if(typeof m==="number")n.maxItems=m},ZC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let p=yt(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let m of u)n.patternProperties[m.source]=p}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=yt(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=yt(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let l=s._zod.values;if(l){let p=[...l].filter((m)=>typeof m==="string"||typeof m==="number");if(p.length>0)n.required=p}},VC=(e,t,r,i)=>{let n=e._zod.def,o=yt(n.innerType,t,i),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[o,{type:"null"}]},GC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},KC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},QC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);if(o.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},YC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},XC=(e,t,r,i)=>{let n=e._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?n.out:n.in:n.out;yt(s,t,i);let c=t.seen.get(e);c.ref=s},eP=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},tP=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},ny=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},rP=(e,t,r,i)=>{let n=e._zod.innerType;yt(n,t,i);let o=t.seen.get(e);o.ref=n},ty={string:SC,number:vC,boolean:wC,bigint:kC,symbol:IC,null:TC,undefined:EC,void:CC,never:PC,any:RC,unknown:AC,date:_C,enum:OC,literal:DC,nan:MC,template_literal:FC,file:$C,success:jC,custom:NC,function:zC,transform:LC,map:BC,set:UC,array:qC,object:JC,union:ry,intersection:HC,tuple:WC,record:ZC,nullable:VC,nonoptional:GC,default:KC,prefault:QC,catch:YC,pipe:XC,readonly:eP,promise:tP,optional:ny,lazy:rP};function iy(e,t){if("_idmap"in e){let i=e,n=js({...t,processors:ty}),o={};for(let u of i._idmap.entries()){let[l,p]=u;yt(p,n)}let s={},c={registry:i,uri:t?.uri,defs:o};n.external=c;for(let u of i._idmap.entries()){let[l,p]=u;Ns(n,p),s[l]=zs(n,p)}if(Object.keys(o).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let r=js({...t,processors:ty});return yt(e,r),Ns(r,e),zs(r,e)}class nP{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=js({processors:ty,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return yt(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}Ns(this.ctx,e);let r=zs(this.ctx,e),{"~standard":i,...n}=r;return n}}var UN={};var Kd={};pi(Kd,{ZodAny:()=>CP,ZodArray:()=>_P,ZodBase64:()=>Ty,ZodBase64URL:()=>Ey,ZodBigInt:()=>yl,ZodBigIntFormat:()=>Ry,ZodBoolean:()=>hl,ZodCIDRv4:()=>ky,ZodCIDRv6:()=>Iy,ZodCUID:()=>hy,ZodCUID2:()=>yy,ZodCatch:()=>XP,ZodCodec:()=>cm,ZodCustom:()=>um,ZodCustomStringFormat:()=>fl,ZodDate:()=>nm,ZodDefault:()=>ZP,ZodDiscriminatedUnion:()=>DP,ZodE164:()=>Cy,ZodEmail:()=>my,ZodEmoji:()=>fy,ZodEnum:()=>dl,ZodExactOptional:()=>JP,ZodFile:()=>UP,ZodFunction:()=>uR,ZodGUID:()=>Yd,ZodIPv4:()=>vy,ZodIPv6:()=>wy,ZodIntersection:()=>MP,ZodJWT:()=>Py,ZodKSUID:()=>Sy,ZodLazy:()=>sR,ZodLiteral:()=>BP,ZodMAC:()=>SP,ZodMap:()=>zP,ZodNaN:()=>tR,ZodNanoID:()=>gy,ZodNever:()=>RP,ZodNonOptional:()=>Fy,ZodNull:()=>TP,ZodNullable:()=>WP,ZodNumber:()=>gl,ZodNumberFormat:()=>sc,ZodObject:()=>om,ZodOptional:()=>My,ZodPipe:()=>am,ZodPrefault:()=>GP,ZodPreprocess:()=>rR,ZodPromise:()=>cR,ZodReadonly:()=>nR,ZodRecord:()=>pl,ZodSet:()=>LP,ZodString:()=>ml,ZodStringFormat:()=>wt,ZodSuccess:()=>YP,ZodSymbol:()=>kP,ZodTemplateLiteral:()=>oR,ZodTransform:()=>qP,ZodTuple:()=>$P,ZodType:()=>nt,ZodULID:()=>by,ZodURL:()=>rm,ZodUUID:()=>io,ZodUndefined:()=>IP,ZodUnion:()=>sm,ZodUnknown:()=>PP,ZodVoid:()=>AP,ZodXID:()=>xy,ZodXor:()=>OP,_ZodString:()=>dy,_default:()=>VP,_function:()=>Yz,any:()=>Rz,array:()=>im,base64:()=>dz,base64url:()=>mz,bigint:()=>Iz,boolean:()=>wP,catch:()=>eR,check:()=>Xz,cidrv4:()=>lz,cidrv6:()=>pz,codec:()=>Vz,cuid:()=>rz,cuid2:()=>nz,custom:()=>eL,date:()=>_z,describe:()=>tL,discriminatedUnion:()=>jz,e164:()=>fz,email:()=>WN,emoji:()=>ez,enum:()=>Oy,exactOptional:()=>HP,file:()=>Jz,float32:()=>Sz,float64:()=>vz,function:()=>Yz,guid:()=>ZN,hash:()=>xz,hex:()=>bz,hostname:()=>yz,httpUrl:()=>XN,instanceof:()=>nL,int:()=>ly,int32:()=>wz,int64:()=>Tz,intersection:()=>FP,invertCodec:()=>Gz,ipv4:()=>az,ipv6:()=>uz,json:()=>oL,jwt:()=>gz,keyof:()=>Oz,ksuid:()=>sz,lazy:()=>aR,literal:()=>qz,looseObject:()=>Fz,looseRecord:()=>zz,mac:()=>cz,map:()=>Lz,meta:()=>rL,nan:()=>Zz,nanoid:()=>tz,nativeEnum:()=>Uz,never:()=>Ay,nonoptional:()=>QP,null:()=>EP,nullable:()=>em,nullish:()=>Hz,number:()=>vP,object:()=>Dz,optional:()=>Xd,partialRecord:()=>Nz,pipe:()=>py,prefault:()=>KP,preprocess:()=>sL,promise:()=>Qz,readonly:()=>iR,record:()=>NP,refine:()=>lR,set:()=>Bz,strictObject:()=>Mz,string:()=>Qd,stringFormat:()=>hz,stringbool:()=>iL,success:()=>Wz,superRefine:()=>pR,symbol:()=>Cz,templateLiteral:()=>Kz,transform:()=>Dy,tuple:()=>jP,uint32:()=>kz,uint64:()=>Ez,ulid:()=>iz,undefined:()=>Pz,union:()=>_y,unknown:()=>oc,url:()=>YN,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>KN,uuidv7:()=>QN,void:()=>Az,xid:()=>oz,xor:()=>$z});var oy={};pi(oy,{endsWith:()=>tl,gt:()=>ro,gte:()=>pn,includes:()=>Xu,length:()=>ic,lowercase:()=>Qu,lt:()=>to,lte:()=>Wn,maxLength:()=>nc,maxSize:()=>$s,mime:()=>rl,minLength:()=>Do,minSize:()=>no,multipleOf:()=>Fs,negative:()=>Qh,nonnegative:()=>Xh,nonpositive:()=>Yh,normalize:()=>nl,overwrite:()=>Fi,positive:()=>Kh,property:()=>ey,regex:()=>Ku,size:()=>rc,slugify:()=>al,startsWith:()=>el,toLowerCase:()=>ol,toUpperCase:()=>sl,trim:()=>il,uppercase:()=>Yu});var ll={};pi(ll,{ZodISODate:()=>ay,ZodISODateTime:()=>sy,ZodISODuration:()=>uy,ZodISOTime:()=>cy,date:()=>oP,datetime:()=>iP,duration:()=>aP,time:()=>sP});var sy=C("ZodISODateTime",(e,t)=>{NI.init(e,t),wt.init(e,t)});function iP(e){return NE(sy,e)}var ay=C("ZodISODate",(e,t)=>{zI.init(e,t),wt.init(e,t)});function oP(e){return zE(ay,e)}var cy=C("ZodISOTime",(e,t)=>{LI.init(e,t),wt.init(e,t)});function sP(e){return LE(cy,e)}var uy=C("ZodISODuration",(e,t)=>{BI.init(e,t),wt.init(e,t)});function aP(e){return BE(uy,e)}var qN=(e,t)=>{Md.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>$d(e,r)},flatten:{value:(r)=>Fd(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Bu,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Bu,2)}},isEmpty:{get(){return e.issues.length===0}}})},JN=C("ZodError",qN),Rn=C("ZodError",qN,{Parent:Error});var cP=Ju(Rn),uP=Hu(Rn),lP=Wu(Rn),pP=Zu(Rn),dP=ch(Rn),mP=uh(Rn),fP=lh(Rn),gP=ph(Rn),hP=dh(Rn),yP=mh(Rn),bP=fh(Rn),xP=gh(Rn);var HN=new WeakMap;function tm(e,t,r){let i=Object.getPrototypeOf(e),n=HN.get(i);if(!n)n=new Set,HN.set(i,n);if(n.has(t))return;n.add(t);for(let o in r){let s=r[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}var nt=C("ZodType",(e,t)=>(Ve.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ul(e,"input"),output:ul(e,"output")}}),e.toJSONSchema=xC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>cP(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>lP(e,r,i),e.parseAsync=async(r,i)=>uP(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>pP(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>dP(e,r,i),e.decode=(r,i)=>mP(e,r,i),e.encodeAsync=async(r,i)=>fP(e,r,i),e.decodeAsync=async(r,i)=>gP(e,r,i),e.safeEncode=(r,i)=>hP(e,r,i),e.safeDecode=(r,i)=>yP(e,r,i),e.safeEncodeAsync=async(r,i)=>bP(e,r,i),e.safeDecodeAsync=async(r,i)=>xP(e,r,i),tm(e,"ZodType",{check(...r){let i=this.def;return this.clone(te.mergeDefs(i,{checks:[...i.checks??[],...r.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return un(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(lR(r,i))},superRefine(r,i){return this.check(pR(r,i))},overwrite(r){return this.check(Fi(r))},optional(){return Xd(this)},exactOptional(){return HP(this)},nullable(){return em(this)},nullish(){return Xd(em(this))},nonoptional(r){return QP(this,r)},array(){return im(this)},or(r){return _y([this,r])},and(r){return FP(this,r)},transform(r){return py(this,Dy(r))},default(r){return VP(this,r)},prefault(r){return KP(this,r)},catch(r){return eR(this,r)},pipe(r){return py(this,r)},readonly(){return iR(this)},describe(r){let i=this.clone();return $r.add(i,{description:r}),i},meta(...r){if(r.length===0)return $r.get(this);let i=this.clone();return $r.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return $r.get(e)?.description},configurable:!0}),e)),dy=C("_ZodString",(e,t)=>{tc.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>SC(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,tm(e,"_ZodString",{regex(...i){return this.check(Ku(...i))},includes(...i){return this.check(Xu(...i))},startsWith(...i){return this.check(el(...i))},endsWith(...i){return this.check(tl(...i))},min(...i){return this.check(Do(...i))},max(...i){return this.check(nc(...i))},length(...i){return this.check(ic(...i))},nonempty(...i){return this.check(Do(1,...i))},lowercase(i){return this.check(Qu(i))},uppercase(i){return this.check(Yu(i))},trim(){return this.check(il())},normalize(...i){return this.check(nl(...i))},toLowerCase(){return this.check(ol())},toUpperCase(){return this.check(sl())},slugify(){return this.check(al())}})}),ml=C("ZodString",(e,t)=>{tc.init(e,t),dy.init(e,t),e.email=(r)=>e.check(Ah(my,r)),e.url=(r)=>e.check(Gd(rm,r)),e.jwt=(r)=>e.check(Gh(Py,r)),e.emoji=(r)=>e.check(Fh(fy,r)),e.guid=(r)=>e.check(Vd(Yd,r)),e.uuid=(r)=>e.check(_h(io,r)),e.uuidv4=(r)=>e.check(Oh(io,r)),e.uuidv6=(r)=>e.check(Dh(io,r)),e.uuidv7=(r)=>e.check(Mh(io,r)),e.nanoid=(r)=>e.check($h(gy,r)),e.guid=(r)=>e.check(Vd(Yd,r)),e.cuid=(r)=>e.check(jh(hy,r)),e.cuid2=(r)=>e.check(Nh(yy,r)),e.ulid=(r)=>e.check(zh(by,r)),e.base64=(r)=>e.check(Wh(Ty,r)),e.base64url=(r)=>e.check(Zh(Ey,r)),e.xid=(r)=>e.check(Lh(xy,r)),e.ksuid=(r)=>e.check(Bh(Sy,r)),e.ipv4=(r)=>e.check(Uh(vy,r)),e.ipv6=(r)=>e.check(qh(wy,r)),e.cidrv4=(r)=>e.check(Jh(ky,r)),e.cidrv6=(r)=>e.check(Hh(Iy,r)),e.e164=(r)=>e.check(Vh(Cy,r)),e.datetime=(r)=>e.check(iP(r)),e.date=(r)=>e.check(oP(r)),e.time=(r)=>e.check(sP(r)),e.duration=(r)=>e.check(aP(r))});function Qd(e){return ME(ml,e)}var wt=C("ZodStringFormat",(e,t)=>{vt.init(e,t),dy.init(e,t)}),my=C("ZodEmail",(e,t)=>{RI.init(e,t),wt.init(e,t)});function WN(e){return Ah(my,e)}var Yd=C("ZodGUID",(e,t)=>{CI.init(e,t),wt.init(e,t)});function ZN(e){return Vd(Yd,e)}var io=C("ZodUUID",(e,t)=>{PI.init(e,t),wt.init(e,t)});function VN(e){return _h(io,e)}function GN(e){return Oh(io,e)}function KN(e){return Dh(io,e)}function QN(e){return Mh(io,e)}var rm=C("ZodURL",(e,t)=>{AI.init(e,t),wt.init(e,t)});function YN(e){return Gd(rm,e)}function XN(e){return Gd(rm,{protocol:Hn.httpProtocol,hostname:Hn.domain,...te.normalizeParams(e)})}var fy=C("ZodEmoji",(e,t)=>{_I.init(e,t),wt.init(e,t)});function ez(e){return Fh(fy,e)}var gy=C("ZodNanoID",(e,t)=>{OI.init(e,t),wt.init(e,t)});function tz(e){return $h(gy,e)}var hy=C("ZodCUID",(e,t)=>{DI.init(e,t),wt.init(e,t)});function rz(e){return jh(hy,e)}var yy=C("ZodCUID2",(e,t)=>{MI.init(e,t),wt.init(e,t)});function nz(e){return Nh(yy,e)}var by=C("ZodULID",(e,t)=>{FI.init(e,t),wt.init(e,t)});function iz(e){return zh(by,e)}var xy=C("ZodXID",(e,t)=>{$I.init(e,t),wt.init(e,t)});function oz(e){return Lh(xy,e)}var Sy=C("ZodKSUID",(e,t)=>{jI.init(e,t),wt.init(e,t)});function sz(e){return Bh(Sy,e)}var vy=C("ZodIPv4",(e,t)=>{UI.init(e,t),wt.init(e,t)});function az(e){return Uh(vy,e)}var SP=C("ZodMAC",(e,t)=>{JI.init(e,t),wt.init(e,t)});function cz(e){return $E(SP,e)}var wy=C("ZodIPv6",(e,t)=>{qI.init(e,t),wt.init(e,t)});function uz(e){return qh(wy,e)}var ky=C("ZodCIDRv4",(e,t)=>{HI.init(e,t),wt.init(e,t)});function lz(e){return Jh(ky,e)}var Iy=C("ZodCIDRv6",(e,t)=>{WI.init(e,t),wt.init(e,t)});function pz(e){return Hh(Iy,e)}var Ty=C("ZodBase64",(e,t)=>{VI.init(e,t),wt.init(e,t)});function dz(e){return Wh(Ty,e)}var Ey=C("ZodBase64URL",(e,t)=>{GI.init(e,t),wt.init(e,t)});function mz(e){return Zh(Ey,e)}var Cy=C("ZodE164",(e,t)=>{KI.init(e,t),wt.init(e,t)});function fz(e){return Vh(Cy,e)}var Py=C("ZodJWT",(e,t)=>{QI.init(e,t),wt.init(e,t)});function gz(e){return Gh(Py,e)}var fl=C("ZodCustomStringFormat",(e,t)=>{YI.init(e,t),wt.init(e,t)});function hz(e,t,r={}){return cl(fl,e,t,r)}function yz(e){return cl(fl,"hostname",Hn.hostname,e)}function bz(e){return cl(fl,"hex",Hn.hex,e)}function xz(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=Hn[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return cl(fl,i,n,t)}var gl=C("ZodNumber",(e,t)=>{Ih.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>vC(e,i,n,o),tm(e,"ZodNumber",{gt(i,n){return this.check(ro(i,n))},gte(i,n){return this.check(pn(i,n))},min(i,n){return this.check(pn(i,n))},lt(i,n){return this.check(to(i,n))},lte(i,n){return this.check(Wn(i,n))},max(i,n){return this.check(Wn(i,n))},int(i){return this.check(ly(i))},safe(i){return this.check(ly(i))},positive(i){return this.check(ro(0,i))},nonnegative(i){return this.check(pn(0,i))},negative(i){return this.check(to(0,i))},nonpositive(i){return this.check(Wn(0,i))},multipleOf(i,n){return this.check(Fs(i,n))},step(i,n){return this.check(Fs(i,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function vP(e){return UE(gl,e)}var sc=C("ZodNumberFormat",(e,t)=>{XI.init(e,t),gl.init(e,t)});function ly(e){return JE(sc,e)}function Sz(e){return HE(sc,e)}function vz(e){return WE(sc,e)}function wz(e){return ZE(sc,e)}function kz(e){return VE(sc,e)}var hl=C("ZodBoolean",(e,t)=>{Ld.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>wC(e,r,i,n)});function wP(e){return GE(hl,e)}var yl=C("ZodBigInt",(e,t)=>{Th.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>kC(e,i,n,o),e.gte=(i,n)=>e.check(pn(i,n)),e.min=(i,n)=>e.check(pn(i,n)),e.gt=(i,n)=>e.check(ro(i,n)),e.gte=(i,n)=>e.check(pn(i,n)),e.min=(i,n)=>e.check(pn(i,n)),e.lt=(i,n)=>e.check(to(i,n)),e.lte=(i,n)=>e.check(Wn(i,n)),e.max=(i,n)=>e.check(Wn(i,n)),e.positive=(i)=>e.check(ro(BigInt(0),i)),e.negative=(i)=>e.check(to(BigInt(0),i)),e.nonpositive=(i)=>e.check(Wn(BigInt(0),i)),e.nonnegative=(i)=>e.check(pn(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Fs(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Iz(e){return QE(yl,e)}var Ry=C("ZodBigIntFormat",(e,t)=>{eT.init(e,t),yl.init(e,t)});function Tz(e){return XE(Ry,e)}function Ez(e){return eC(Ry,e)}var kP=C("ZodSymbol",(e,t)=>{tT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>IC(e,r,i,n)});function Cz(e){return tC(kP,e)}var IP=C("ZodUndefined",(e,t)=>{rT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>EC(e,r,i,n)});function Pz(e){return rC(IP,e)}var TP=C("ZodNull",(e,t)=>{nT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>TC(e,r,i,n)});function EP(e){return nC(TP,e)}var CP=C("ZodAny",(e,t)=>{iT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>RC(e,r,i,n)});function Rz(){return iC(CP)}var PP=C("ZodUnknown",(e,t)=>{oT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>AC(e,r,i,n)});function oc(){return oC(PP)}var RP=C("ZodNever",(e,t)=>{sT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>PC(e,r,i,n)});function Ay(e){return sC(RP,e)}var AP=C("ZodVoid",(e,t)=>{aT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>CC(e,r,i,n)});function Az(e){return aC(AP,e)}var nm=C("ZodDate",(e,t)=>{cT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>_C(e,i,n,o),e.min=(i,n)=>e.check(pn(i,n)),e.max=(i,n)=>e.check(Wn(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function _z(e){return cC(nm,e)}var _P=C("ZodArray",(e,t)=>{uT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>qC(e,r,i,n),e.element=t.element,tm(e,"ZodArray",{min(r,i){return this.check(Do(r,i))},nonempty(r){return this.check(Do(1,r))},max(r,i){return this.check(nc(r,i))},length(r,i){return this.check(ic(r,i))},unwrap(){return this.element}})});function im(e,t){return pC(_P,e,t)}function Oz(e){let t=e._zod.def.shape;return Oy(Object.keys(t))}var om=C("ZodObject",(e,t)=>{lT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>JC(e,r,i,n),te.defineLazy(e,"shape",()=>t.shape),tm(e,"ZodObject",{keyof(){return Oy(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:oc()})},loose(){return this.clone({...this._zod.def,catchall:oc()})},strict(){return this.clone({...this._zod.def,catchall:Ay()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(My,this,r[0])},required(...r){return te.required(Fy,this,r[0])}})});function Dz(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new om(r)}function Mz(e,t){return new om({type:"object",shape:e,catchall:Ay(),...te.normalizeParams(t)})}function Fz(e,t){return new om({type:"object",shape:e,catchall:oc(),...te.normalizeParams(t)})}var sm=C("ZodUnion",(e,t)=>{Bd.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ry(e,r,i,n),e.options=t.options});function _y(e,t){return new sm({type:"union",options:e,...te.normalizeParams(t)})}var OP=C("ZodXor",(e,t)=>{sm.init(e,t),pT.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ry(e,r,i,n),e.options=t.options});function $z(e,t){return new OP({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}var DP=C("ZodDiscriminatedUnion",(e,t)=>{sm.init(e,t),dT.init(e,t)});function jz(e,t,r){return new DP({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}var MP=C("ZodIntersection",(e,t)=>{mT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>HC(e,r,i,n)});function FP(e,t){return new MP({type:"intersection",left:e,right:t})}var $P=C("ZodTuple",(e,t)=>{Eh.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>WC(e,r,i,n),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function jP(e,t,r){let i=t instanceof Ve,n=i?r:t;return new $P({type:"tuple",items:e,rest:i?t:null,...te.normalizeParams(n)})}var pl=C("ZodRecord",(e,t)=>{fT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ZC(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function NP(e,t,r){if(!t||!t._zod)return new pl({type:"record",keyType:Qd(),valueType:e,...te.normalizeParams(t)});return new pl({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}function Nz(e,t,r){let i=un(e);return i._zod.values=void 0,new pl({type:"record",keyType:i,valueType:t,...te.normalizeParams(r)})}function zz(e,t,r){return new pl({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}var zP=C("ZodMap",(e,t)=>{gT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>BC(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(no(...r)),e.nonempty=(r)=>e.check(no(1,r)),e.max=(...r)=>e.check($s(...r)),e.size=(...r)=>e.check(rc(...r))});function Lz(e,t,r){return new zP({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}var LP=C("ZodSet",(e,t)=>{hT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>UC(e,r,i,n),e.min=(...r)=>e.check(no(...r)),e.nonempty=(r)=>e.check(no(1,r)),e.max=(...r)=>e.check($s(...r)),e.size=(...r)=>e.check(rc(...r))});function Bz(e,t){return new LP({type:"set",valueType:e,...te.normalizeParams(t)})}var dl=C("ZodEnum",(e,t)=>{yT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>OC(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new dl({...t,checks:[],...te.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new dl({...t,checks:[],...te.normalizeParams(n),entries:o})}});function Oy(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((i)=>[i,i])):e;return new dl({type:"enum",entries:r,...te.normalizeParams(t)})}function Uz(e,t){return new dl({type:"enum",entries:e,...te.normalizeParams(t)})}var BP=C("ZodLiteral",(e,t)=>{bT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>DC(e,r,i,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qz(e,t){return new BP({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}var UP=C("ZodFile",(e,t)=>{xT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>$C(e,r,i,n),e.min=(r,i)=>e.check(no(r,i)),e.max=(r,i)=>e.check($s(r,i)),e.mime=(r,i)=>e.check(rl(Array.isArray(r)?r:[r],i))});function Jz(e){return dC(UP,e)}var qP=C("ZodTransform",(e,t)=>{ST.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>LC(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ya(e.constructor.name);r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(te.issue(o,r.value,t));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(te.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((o)=>(r.value=o,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function Dy(e){return new qP({type:"transform",transform:e})}var My=C("ZodOptional",(e,t)=>{Ch.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ny(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Xd(e){return new My({type:"optional",innerType:e})}var JP=C("ZodExactOptional",(e,t)=>{vT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ny(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function HP(e){return new JP({type:"optional",innerType:e})}var WP=C("ZodNullable",(e,t)=>{wT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>VC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function em(e){return new WP({type:"nullable",innerType:e})}function Hz(e){return Xd(em(e))}var ZP=C("ZodDefault",(e,t)=>{kT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>KC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VP(e,t){return new ZP({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():te.shallowClone(t)}})}var GP=C("ZodPrefault",(e,t)=>{IT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>QC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function KP(e,t){return new GP({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():te.shallowClone(t)}})}var Fy=C("ZodNonOptional",(e,t)=>{TT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>GC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function QP(e,t){return new Fy({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}var YP=C("ZodSuccess",(e,t)=>{ET.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>jC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Wz(e){return new YP({type:"success",innerType:e})}var XP=C("ZodCatch",(e,t)=>{CT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>YC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eR(e,t){return new XP({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var tR=C("ZodNaN",(e,t)=>{PT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>MC(e,r,i,n)});function Zz(e){return lC(tR,e)}var am=C("ZodPipe",(e,t)=>{Ph.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>XC(e,r,i,n),e.in=t.in,e.out=t.out});function py(e,t){return new am({type:"pipe",in:e,out:t})}var cm=C("ZodCodec",(e,t)=>{am.init(e,t),Ud.init(e,t)});function Vz(e,t,r){return new cm({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Gz(e){let t=e._zod.def;return new cm({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var rR=C("ZodPreprocess",(e,t)=>{am.init(e,t),RT.init(e,t)}),nR=C("ZodReadonly",(e,t)=>{AT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>eP(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function iR(e){return new nR({type:"readonly",innerType:e})}var oR=C("ZodTemplateLiteral",(e,t)=>{_T.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>FC(e,r,i,n)});function Kz(e,t){return new oR({type:"template_literal",parts:e,...te.normalizeParams(t)})}var sR=C("ZodLazy",(e,t)=>{MT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rP(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function aR(e){return new sR({type:"lazy",getter:e})}var cR=C("ZodPromise",(e,t)=>{DT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>tP(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Qz(e){return new cR({type:"promise",innerType:e})}var uR=C("ZodFunction",(e,t)=>{OT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>zC(e,r,i,n)});function Yz(e){return new uR({type:"function",input:Array.isArray(e?.input)?jP(e?.input):e?.input??im(oc()),output:e?.output??oc()})}var um=C("ZodCustom",(e,t)=>{FT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>NC(e,r,i,n)});function Xz(e){let t=new Et({check:"custom"});return t._zod.check=e,t}function eL(e,t){return mC(um,e??(()=>!0),t)}function lR(e,t={}){return fC(um,e,t)}function pR(e,t){return gC(e,t)}var tL=hC,rL=yC;function nL(e,t={}){let r=new um({type:"custom",check:"custom",fn:(i)=>i instanceof e,abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=(i)=>{if(!(i.value instanceof e))i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var iL=(...e)=>bC({Codec:cm,Boolean:hl,String:ml},...e);function oL(e){let t=aR(()=>_y([Qd(e),vP(),wP(),EP(),im(t),NP(Qd(),t)]));return t}function sL(e,t){return new rR({type:"pipe",in:Dy(e),out:t})}var Fie={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 $ie(e){Kt({customError:e})}function jie(){return Kt().customError}var dR;(function(e){})(dR||(dR={}));var ye={...Kd,...oy,iso:ll},Nie=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 zie(e,t){let r=e.$schema;if(r==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(r==="http://json-schema.org/draft-07/schema#")return"draft-7";if(r==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function Lie(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function aL(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return ye.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return ye.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=Lie(n,t),s=Vr(o,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return ye.null();if(n.length===0)return ye.never();if(n.length===1)return ye.literal(n[0]);if(n.every((s)=>typeof s==="string"))return ye.enum(n);let o=n.map((s)=>ye.literal(s));if(o.length<2)return o[0];return ye.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ye.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map((o)=>{let s={...e,type:o};return aL(s,t)});if(n.length===0)return ye.never();if(n.length===1)return n[0];return ye.union(n)}if(!r)return ye.any();let i;switch(r){case"string":{let n=ye.string();if(e.format){let o=e.format;if(o==="email")n=n.check(ye.email());else if(o==="uri"||o==="uri-reference")n=n.check(ye.url());else if(o==="uuid"||o==="guid")n=n.check(ye.uuid());else if(o==="date-time")n=n.check(ye.iso.datetime());else if(o==="date")n=n.check(ye.iso.date());else if(o==="time")n=n.check(ye.iso.time());else if(o==="duration")n=n.check(ye.iso.duration());else if(o==="ipv4")n=n.check(ye.ipv4());else if(o==="ipv6")n=n.check(ye.ipv6());else if(o==="mac")n=n.check(ye.mac());else if(o==="cidr")n=n.check(ye.cidrv4());else if(o==="cidr-v6")n=n.check(ye.cidrv6());else if(o==="base64")n=n.check(ye.base64());else if(o==="base64url")n=n.check(ye.base64url());else if(o==="e164")n=n.check(ye.e164());else if(o==="jwt")n=n.check(ye.jwt());else if(o==="emoji")n=n.check(ye.emoji());else if(o==="nanoid")n=n.check(ye.nanoid());else if(o==="cuid")n=n.check(ye.cuid());else if(o==="cuid2")n=n.check(ye.cuid2());else if(o==="ulid")n=n.check(ye.ulid());else if(o==="xid")n=n.check(ye.xid());else if(o==="ksuid")n=n.check(ye.ksuid())}if(typeof e.minLength==="number")n=n.min(e.minLength);if(typeof e.maxLength==="number")n=n.max(e.maxLength);if(e.pattern)n=n.regex(new RegExp(e.pattern));i=n;break}case"number":case"integer":{let n=r==="integer"?ye.number().int():ye.number();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);if(typeof e.exclusiveMinimum==="number")n=n.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")n=n.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")n=n.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")n=n.lt(e.maximum);if(typeof e.multipleOf==="number")n=n.multipleOf(e.multipleOf);i=n;break}case"boolean":{i=ye.boolean();break}case"null":{i=ye.null();break}case"object":{let n={},o=e.properties||{},s=new Set(e.required||[]);for(let[u,l]of Object.entries(o)){let p=Vr(l,t);n[u]=s.has(u)?p:p.optional()}if(e.propertyNames){let u=Vr(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties==="object"?Vr(e.additionalProperties,t):ye.any();if(Object.keys(n).length===0){i=ye.record(u,l);break}let p=ye.object(n).passthrough(),m=ye.looseRecord(u,l);i=ye.intersection(p,m);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),p=[];for(let f of l){let g=Vr(u[f],t),S=ye.string().regex(new RegExp(f));p.push(ye.looseRecord(S,g))}let m=[];if(Object.keys(n).length>0)m.push(ye.object(n).passthrough());if(m.push(...p),m.length===0)i=ye.object({}).passthrough();else if(m.length===1)i=m[0];else{let f=ye.intersection(m[0],m[1]);for(let g=2;g<m.length;g++)f=ye.intersection(f,m[g]);i=f}break}let c=ye.object(n);if(e.additionalProperties===!1)i=c.strict();else if(typeof e.additionalProperties==="object")i=c.catchall(Vr(e.additionalProperties,t));else i=c.passthrough();break}case"array":{let{prefixItems:n,items:o}=e;if(n&&Array.isArray(n)){let s=n.map((u)=>Vr(u,t)),c=o&&typeof o==="object"&&!Array.isArray(o)?Vr(o,t):void 0;if(c)i=ye.tuple(s).rest(c);else i=ye.tuple(s);if(typeof e.minItems==="number")i=i.check(ye.minLength(e.minItems));if(typeof e.maxItems==="number")i=i.check(ye.maxLength(e.maxItems))}else if(Array.isArray(o)){let s=o.map((u)=>Vr(u,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?Vr(e.additionalItems,t):void 0;if(c)i=ye.tuple(s).rest(c);else i=ye.tuple(s);if(typeof e.minItems==="number")i=i.check(ye.minLength(e.minItems));if(typeof e.maxItems==="number")i=i.check(ye.maxLength(e.maxItems))}else if(o!==void 0){let s=Vr(o,t),c=ye.array(s);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);i=c}else i=ye.array(ye.any());break}default:throw Error(`Unsupported type: ${r}`)}return i}function Vr(e,t){if(typeof e==="boolean")return e?ye.any():ye.never();let r=aL(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((l)=>Vr(l,t)),u=ye.union(c);r=i?ye.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((l)=>Vr(l,t)),u=ye.xor(c);r=i?ye.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:ye.any();else{let c=i?r:Vr(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=ye.intersection(c,Vr(e.allOf[l],t));r=c}if(e.nullable===!0&&t.version==="openapi-3.0")r=ye.nullable(r);if(e.readOnly===!0)r=ye.readonly(r);if(e.default!==void 0)r=r.default(e.default);let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)if(c in e)n[c]=e[c];let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)if(c in e)n[c]=e[c];for(let c of Object.keys(e))if(!Nie.has(c))n[c]=e[c];if(Object.keys(n).length>0)t.registry.add(r,n);if(e.description)r=r.describe(e.description);return r}function cL(e,t){if(typeof e==="boolean")return e?ye.any():ye.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=zie(r,t?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??$r};return Vr(r,o)}var mR={};pi(mR,{bigint:()=>Jie,boolean:()=>qie,date:()=>Hie,number:()=>Uie,string:()=>Bie});function Bie(e){return FE(ml,e)}function Uie(e){return qE(gl,e)}function qie(e){return KE(hl,e)}function Jie(e){return YE(yl,e)}function Hie(e){return uC(nm,e)}Kt(qd());import{createHash as Wie}from"crypto";function lm(e){return Wie("sha256").update(e).digest("hex")}var fR=120000;function uL(e){let t;try{t=new URL(e)}catch{return{remoteUrl:e,token:void 0}}if(!t.username&&!t.password)return{remoteUrl:e,token:void 0};let r=t.password||t.username;return t.username="",t.password="",{remoteUrl:t.toString(),token:r||void 0}}function gR(e){let t=e.gitUrl??(e.repo?`https://github.com/${e.repo}.git`:"");return uL(t).remoteUrl}function lL(e){if(e.authToken)return e.authToken;let t=e.gitUrl??"";return uL(t).token}function $y(e){let t=e;try{let r=new URL(e);r.username="",r.password="",t=r.toString()}catch{}return lm(t)}import{webcrypto as dL}from"crypto";var pL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Zie=128,Ls,bl;function Vie(e){if(e<0)throw RangeError("Wrong ID size");try{if(!Ls||Ls.length<e)Ls=Buffer.allocUnsafe(e*Zie),dL.getRandomValues(Ls),bl=0;else if(bl+e>Ls.length)dL.getRandomValues(Ls),bl=0}catch(t){throw Ls=void 0,t}bl+=e}function mL(e=21){Vie(e|=0);let t="";for(let r=bl-e;r<bl;r++)t+=pL[Ls[r]&63];return t}function jr(e=12){return mL(e)}var fL=["initialize","get-status","has-local-changes","commit","push","commit-and-push","pull","get-reconciliation-delta","get-checkpoint","log-file","show-file"],Gie=new Set(["initialize","commit","push","commit-and-push","pull"]),pm=a.object({remoteFingerprint:a.string().min(1),branch:a.string().min(1),lastReconciledGitHead:a.string().min(1),lastObservedRemoteHead:a.string().optional()}).strict(),gL=a.discriminatedUnion("name",[a.object({name:a.literal("initialize")}).strict(),a.object({name:a.literal("get-status")}).strict(),a.object({name:a.literal("has-local-changes")}).strict(),a.object({name:a.literal("commit"),message:a.string().optional()}).strict(),a.object({name:a.literal("push")}).strict(),a.object({name:a.literal("commit-and-push")}).strict(),a.object({name:a.literal("pull")}).strict(),a.object({name:a.literal("get-reconciliation-delta"),checkpoint:pm.optional()}).strict(),a.object({name:a.literal("get-checkpoint")}).strict(),a.object({name:a.literal("log-file"),filePath:a.string().min(1),limit:a.number().int().positive().optional()}).strict(),a.object({name:a.literal("show-file"),sha:a.string().min(1),filePath:a.string().min(1)}).strict()]);function xl(e){return Gie.has(e.name)}var hR=a.union([a.null(),a.undefined()]).transform(()=>{return}),Kie={initialize:hR,commit:hR,push:hR,"has-local-changes":a.boolean(),"show-file":a.string(),"get-checkpoint":pm,"get-status":a.object({isRepo:a.boolean(),hasChanges:a.boolean(),ahead:a.number().int(),behind:a.number().int(),branch:a.string(),lastCommit:a.string().optional(),remote:a.string().optional(),files:a.array(a.object({path:a.string(),status:a.string()}).strict())}).strict(),"commit-and-push":a.object({pushed:a.boolean(),checkpoint:pm.nullable()}).strict(),pull:a.object({files:a.array(a.string()),deletedFiles:a.array(a.string()).optional()}).strict(),"get-reconciliation-delta":a.discriminatedUnion("mode",[a.object({mode:a.literal("incremental"),checkpoint:pm,files:a.array(a.string()),deletedFiles:a.array(a.string())}).strict(),a.object({mode:a.literal("full"),checkpoint:pm,reason:a.enum(["missing-checkpoint","repository-identity-mismatch","branch-mismatch","missing-local-checkpoint","non-ancestor-local-checkpoint","remote-checkpoint-mismatch"])}).strict()]),"log-file":a.array(a.object({sha:a.string(),date:a.string(),message:a.string()}).strict())};function yR(e,t){return Kie[e].parse(t)}var Js=1,Sl=8388608,bR=4194304,Us=4;class qs extends Error{code;constructor(e,t){super(t);this.name="ProtocolError",this.code=e}}var oo=a.string().min(8).max(64).regex(/^[A-Za-z0-9_-]+$/),Bs=a.number().int().nonnegative(),hL=a.string().min(1).max(64),Qie=a.discriminatedUnion("type",[a.object({type:a.literal("register-checkout"),version:Bs,requestId:oo,checkoutPath:a.string().min(1),branch:a.string().min(1),remoteFingerprint:a.string().min(1)}).strict(),a.object({type:a.literal("execute-operation"),version:Bs,requestId:oo,checkoutPath:a.string().min(1),operation:gL}).strict(),a.object({type:a.literal("progress"),version:Bs,requestId:oo,phase:a.literal("running"),observedAt:hL}).strict(),a.object({type:a.literal("result"),version:Bs,requestId:oo,outcome:a.enum(["ok","error"]),value:a.unknown(),error:a.string().nullable()}).strict(),a.object({type:a.literal("query"),version:Bs,requestId:oo}).strict(),a.object({type:a.literal("open-admission"),version:Bs,requestId:oo}).strict(),a.object({type:a.literal("status"),version:Bs,requestId:oo,brokerId:a.string().min(1),checkouts:a.array(a.string()),activeRequestIds:a.array(oo),queuedRequestIds:a.array(oo),ambiguousRequestIds:a.array(oo),evidenceComplete:a.boolean(),recoveryPending:a.boolean(),admitsMutations:a.boolean(),oldestActiveProgressAt:a.number().int().nonnegative().nullable()}).strict(),a.object({type:a.literal("heartbeat"),version:Bs,brokerId:a.string().min(1),observedAt:hL}).strict()]);function xR(e){let t=new TextEncoder().encode(JSON.stringify(e));if(t.length>Sl)throw new qs("frame-too-large",`Refusing to send a ${t.length}-byte frame; the limit is ${Sl}`);let r=new Uint8Array(Us+t.length);return new DataView(r.buffer).setUint32(0,t.length,!1),r.set(t,Us),r}function Yie(e){let t=(()=>{try{return JSON.parse(new TextDecoder().decode(e))}catch{throw new qs("malformed","Frame body is not valid JSON")}})(),r=Qie.safeParse(t);if(!r.success)throw new qs("malformed",`Frame body does not match any broker message: ${r.error.issues.map((i)=>`${i.path.join(".")} ${i.message}`).join("; ")}`);if(r.data.version!==Js)throw new qs("version-mismatch",`Broker protocol version ${r.data.version} is not ${Js}`);return r.data}class dm{#t=new Uint8Array(0);push(e){let t=new Uint8Array(this.#t.length+e.length);return t.set(this.#t),t.set(e,this.#t.length),this.#t=t,this.#e([])}#e(e){if(this.#t.length<Us)return e;let t=new DataView(this.#t.buffer,this.#t.byteOffset,Us).getUint32(0,!1);if(t>Sl)throw new qs("frame-too-large",`Frame declares ${t} bytes; the limit is ${Sl}`);if(this.#t.length<Us+t)return e;let r=Yie(this.#t.subarray(Us,Us+t));return this.#t=this.#t.slice(Us+t),this.#e([...e,r])}}var yL=Sl*2;class jy{#t;#e=new Uint8Array(0);constructor(e){this.#t=e}get pendingBytes(){return this.#e.length}send(e){if(this.#e.length+e.length>yL)throw new qs("frame-too-large",`Refusing to buffer ${this.#e.length+e.length} bytes for a peer that is not draining; the limit is ${yL}`);let t=new Uint8Array(this.#e.length+e.length);t.set(this.#e),t.set(e,this.#e.length),this.#e=t,this.flush()}flush(){if(this.#e.length===0)return;try{let e=this.#t.write(this.#e);this.#e=e>=this.#e.length?new Uint8Array(0):this.#e.slice(e)}catch{this.#e=new Uint8Array(0)}}}var mm="BRAIN_GIT_BROKER_SOCKET";import{dirname as iTe,resolve as oTe}from"path";import{resolve as Xie}from"path";import{realpath as eoe}from"fs/promises";async function fm(e){return eoe(e).catch(()=>Xie(e))}var SR=5242880;var vl=a.object({syncPath:a.string().optional().describe("Optional override for sync directory (defaults to shell dataDir)"),autoSync:a.boolean().describe("Enable bidirectional auto-sync").default(!0),watchInterval:a.number().describe("File watch polling interval in ms").default(1000),includeMetadata:a.boolean().describe("Include frontmatter metadata").default(!0),entityTypes:a.array(a.string()).optional().describe("Specific entity types to sync"),initialSync:a.boolean().optional().describe("Run initial directory import during startup coordination").default(!0),syncBatchSize:a.number().optional().describe("Batch size for sync operations").default(10),syncPriority:a.number().min(1).max(10).optional().describe("Job priority (1-10)").default(3),seedContent:a.boolean().optional().describe("Copy seed content on first initialization").default(!0),seedContentPath:a.string().optional().describe("Custom path to seed content directory (defaults to CWD/seed-content)"),strictSeedEntityTypes:a.boolean().optional().describe("Fail startup when seed content uses an unregistered entity type").default(!1),deleteOnFileRemoval:a.boolean().optional().describe("Delete entities from database when files are deleted").default(!0),syncInterval:a.number().min(1).optional().describe("Pull/push interval in minutes (requires git)").default(2),commitDebounce:a.number().min(100).optional().describe("Debounce delay in ms before git commit after entity changes").default(5000),maxImportFileBytes:a.number().int().positive().optional().describe("Maximum bytes for text and inline base64 binary imports").default(SR),git:a.object({repo:a.string().optional().describe("GitHub repo (owner/name)"),gitUrl:a.string().optional().describe("Full git remote URL (overrides repo)"),branch:a.string().default("main").describe("Git branch to sync"),authToken:a.string().optional().describe("Auth token for private repos"),authorName:a.string().default("Brain").describe("Git commit author name"),authorEmail:a.string().default("brain@localhost").describe("Git commit author email"),bootstrapFromSeed:a.boolean().optional().default(!0).describe("Bootstrap a missing/empty local file:// content remote from seedContentPath")}).optional()});import{chmod as FQ,mkdir as eTe,unlink as $Q}from"fs/promises";import{join as tTe}from"path";class vR{#t=new Map;accept(e,t,r){this.#t.set(e,{checkoutPath:t,queuedAt:r,startedAt:void 0,progressAt:void 0})}start(e,t){let r=this.#t.get(e);if(!r)return;r.startedAt=t,r.progressAt=t}progress(e,t){let r=this.#t.get(e);if(r?.startedAt===void 0)return;r.progressAt=t}finish(e){this.#t.delete(e)}snapshot(){let e=[...this.#t.entries()],t=e.filter(([,i])=>i.progressAt!==void 0),r=t.map(([,i])=>i.progressAt).filter((i)=>i!==void 0);return{activeRequestIds:t.map(([i])=>i).sort(),queuedRequestIds:e.filter(([,i])=>i.progressAt===void 0).map(([i])=>i).sort(),oldestActiveProgressAt:r.length?Math.min(...r):null}}}var Yy=Rs(ML(),1);var CR=new WeakMap;function El(...e){let t=new String(e);return CR.set(t,e),t}function fi(e){return e instanceof String&&CR.has(e)}function Cl(e){return CR.get(e)??[]}var Ky=Rs(Uy(),1);import{spawn as sae}from"child_process";var VB=Rs(RR(),1);import{normalize as Ice}from"path";function*jL(e,t){let r=t==="global";for(let i of e)i.isGlobal===r&&(yield i)}var Hoe=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Woe=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),Zoe=new Set(["edit","remove-section","rename-section","set","unset"]),Voe=new Set(["get","get-color","get-colorbool","list"]);function Goe(e,t){for(let{name:i}of jL(e,"task")){if(Hoe.has(i))return Pl(!0,t);if(Woe.has(i))return Pl(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:Zoe.has(r)?Pl(!0,t.slice(1)):Voe.has(r)?Pl(!1,t.slice(1)):t.length===1?Pl(!1,t):Pl(!0,t)}function Pl(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function Koe(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function Qoe(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function Yoe(e){for(let{name:t}of jL(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function Xoe({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*ese(e){for(let t of e){let r=Xoe(t),i=r&&Qoe(t.value);i&&(yield{...i,scope:r})}}function tse(e,t,r){let i={read:[],write:[...ese(t)]};return e==="config"&&rse(i,Yoe(t),Goe(t,r)),i}function rse(e,t,r){if(r===null)return;let i=Koe(t,r);r.isWrite?e.write.push(i):e.read.push(i)}var NL={short:new Map([["c",!0]])},nse={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...NL.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},ise={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},ose={short:new Map,long:new Set};function sse(e){let t=ise[e??""]??ose;return{short:new Map([...NL.short.entries(),...t.short.entries()]),long:t.long}}function zL(e,t=nse){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let i=e.slice(2);return[{name:e,needsNext:t.long.has(i)}]}if(e.length===2){let r=e.charAt(1),i=t.short.get(r);return[{name:e,needsNext:i===!0}]}return ase(e,t.short)}function ase(e,t){let r=e.slice(1).split(""),i=[];for(let n=0;n<r.length;n++){let o=r[n],s=t.get(o);if(s===void 0)return[{name:e,needsNext:!1}];if(s){let c=r.slice(n+1).join("");if(c&&![...c].every((u)=>t.has(u)))return i.push({name:`-${o}`,value:c,needsNext:!1}),i}i.push({name:`-${o}`,needsNext:s})}return i}function cse(e,t=[]){let r=0;for(;r<e.length;){let i=String(e[r]);if(!i.startsWith("-")||i.length<2)break;let n=zL(i),o=r+1;for(let s of n){let c={name:s.name,value:s.value,absorbedNext:!1,isGlobal:!0};s.needsNext&&c.value===void 0&&o<e.length&&(c.value=String(e[o]),c.absorbedNext=!0,o++),t.push(c)}r=o}return{flags:t,taskIndex:r}}function use(e,t,r=[]){let i=sse(t),n=[],o=[],s=0;for(;s<e.length;){let c=e[s];if(fi(c)){o.push(...Cl(c)),s++;continue}let u=String(c);if(u==="--"){for(let m=s+1;m<e.length;m++){let f=e[m];fi(f)?o.push(...Cl(f)):o.push(String(f))}break}if(!u.startsWith("-")||u.length<2){n.push(u),s++;continue}let l=zL(u,i),p=s+1;for(let m of l){let f={name:m.name,value:m.value,absorbedNext:!1,isGlobal:!1};m.needsNext&&f.value===void 0&&p<e.length&&!fi(e[p])&&(f.value=String(e[p]),f.absorbedNext=!0,p++),r.push(f)}s=p}return{flags:r,positionals:n,pathspecs:o}}function*lse({write:e}){for(let t of e)for(let r of pse){let i=r(t.key);i&&(yield i)}}function hi(e,t,r=String(e)){let i=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(n){if(i.test(n))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function gi(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return hi(r,t,e)}var pse=[hi("alias","allowUnsafeAlias"),hi("core.askPass","allowUnsafeAskPass"),hi("core.editor","allowUnsafeEditor"),hi("core.fsmonitor","allowUnsafeFsMonitor"),hi("core.gitProxy","allowUnsafeGitProxy"),hi("core.hooksPath","allowUnsafeHooksPath"),hi("core.pager","allowUnsafePager"),hi("core.sshCommand","allowUnsafeSshCommand"),gi("credential.helper","allowUnsafeCredentialHelper"),gi("diff.command","allowUnsafeDiffExternal"),hi("diff.external","allowUnsafeDiffExternal"),gi("diff.textconv","allowUnsafeDiffTextConv"),gi("filter.clean","allowUnsafeFilter"),gi("filter.smudge","allowUnsafeFilter"),gi("gpg.program","allowUnsafeGpgProgram"),hi("init.templateDir","allowUnsafeTemplateDir"),gi("merge.driver","allowUnsafeMergeDriver"),gi("mergetool.path","allowUnsafeMergeDriver"),gi("mergetool.cmd","allowUnsafeMergeDriver"),gi("protocol.allow","allowUnsafeProtocolOverride"),gi("remote.receivepack","allowUnsafePack"),gi("remote.uploadpack","allowUnsafePack"),hi("sequence.editor","allowUnsafeEditor")];function*dse(e,t){for(let r of t)for(let i of mse){let n=i(e,r.name);n&&(yield n)}}function hm(e,t,r,i=String(t)){let n=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,o=`Use of ${e?`${e} with option `:""}${i} is not permitted without enabling ${r}`;return function(s,c){if((!e||s===e)&&n.test(c))return{category:r,message:o}}}var mse=[hm(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),hm("clone",/^-\w*u/,"allowUnsafePack"),hm("clone","--u","allowUnsafePack"),hm("push","--exec","allowUnsafePack"),hm(null,"--template","allowUnsafeTemplateDir")];function LL(e,t,r){return[...dse(e,t),...lse(r)]}function fse(...e){let{flags:t,taskIndex:r}=cse(e),i=r<e.length?String(e[r]).toLowerCase():null,n=i!==null?e.slice(r+1):[],{positionals:o,pathspecs:s}=use(n,i,t),c=tse(i,t,o);return{task:i,flags:t.map(hse),paths:s,config:c,vulnerabilities:gse(LL(i,t,c))}}function gse(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function hse({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}var BL={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*yse(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let i=e[`git_config_key_${r}`],n=e[`git_config_value_${r}`];i!==void 0&&(yield{key:i.toLowerCase().trim(),value:n,scope:"env"})}}function*bse(e){for(let t of Object.keys(e))if(UL(t)){let r=BL[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function UL(e){return Object.hasOwn(BL,e)}function xse(e){let t={};for(let[r,i]of Object.entries(e)){let n=r.toLowerCase().trim();(UL(n)||n.startsWith("git"))&&(t[n]=String(i))}return t}function Sse(e){let t=xse(e),r={read:[],write:[...yse(t)]},i=[...bse(t),...LL(null,[],r)];return{config:r,vulnerabilities:i}}function qL(e,t){return[...fse(...e).vulnerabilities,...Sse(t).vulnerabilities]}var Rl=Rs(RR(),1);import{EventEmitter as Sue}from"events";var{defineProperty:KR,getOwnPropertyDescriptor:vse,getOwnPropertyNames:QR}=Object,wse=Object.prototype.hasOwnProperty,fe=(e,t)=>function(){return e&&(t=(0,e[QR(e)[0]])(e=0)),t},kse=(e,t)=>function(){return t||(0,e[QR(e)[0]])((t={exports:{}}).exports,t),t.exports},lr=(e,t)=>{for(var r in t)KR(e,r,{get:t[r],enumerable:!0})},Ise=(e,t,r,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let n of QR(t))if(!wse.call(e,n)&&n!==r)KR(e,n,{get:()=>t[n],enumerable:!(i=vse(t,n))||i.enumerable})}return e},ir=(e)=>Ise(KR({},"__esModule",{value:!0}),e),Fo,Zs=fe({"src/lib/errors/git-error.ts"(){Fo=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Sm,Ol=fe({"src/lib/errors/git-response-error.ts"(){Zs(),Sm=class extends Fo{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),v1,w1=fe({"src/lib/errors/task-configuration-error.ts"(){Zs(),v1=class extends Fo{constructor(e){super(void 0,e)}}}});function k1(e){if(typeof e!=="function")return pc;return e}function I1(e){return typeof e==="function"&&e!==pc}function T1(e,t){let r=e.indexOf(t);if(r<=0)return[e,""];return[e.substr(0,r),e.substr(r+1)]}function E1(e,t=0){return C1(e)&&e.length>t?e[t]:void 0}function lc(e,t=0){if(C1(e)&&e.length>t)return e[e.length-1-t]}function C1(e){return rb(e)}function vm(e="",t=!0,r=`
|
|
152
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1){if(e.reused==="ref"){o(s);continue}}}}function zs(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,p={...l},m=u.ref;if(u.ref=null,m){i(m);let g=e.seen.get(m),S=g.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(S);else Object.assign(l,S);if(Object.assign(l,p),c._zod.parent===m)for(let D in l){if(D==="$ref"||D==="allOf")continue;if(!(D in p))delete l[D]}if(S.$ref&&g.def)for(let D in l){if(D==="$ref"||D==="allOf")continue;if(D in g.def&&JSON.stringify(l[D])===JSON.stringify(g.def[D]))delete l[D]}}let f=c._zod.parent;if(f&&f!==m){i(f);let g=e.seen.get(f);if(g?.schema.$ref){if(l.$ref=g.schema.$ref,g.def)for(let S in l){if(S==="$ref"||S==="allOf")continue;if(S in g.def&&JSON.stringify(l[S])===JSON.stringify(g.def[S]))delete l[S]}}}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};for(let c of[...e.seen.entries()].reverse())i(c[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;if(o!==void 0&&n.id===o)delete n.id;let s=e.external?.defs??{};for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;s[u.defId]=u.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:ul(t,"input",e.processors),output:ul(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function dn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return dn(i.element,r);if(i.type==="set")return dn(i.valueType,r);if(i.type==="lazy")return dn(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return dn(i.innerType,r);if(i.type==="intersection")return dn(i.left,r)||dn(i.right,r);if(i.type==="record"||i.type==="map")return dn(i.keyType,r)||dn(i.valueType,r);if(i.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return dn(i.in,r)||dn(i.out,r)}if(i.type==="object"){for(let n in i.shape)if(dn(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(dn(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(dn(n,r))return!0;if(i.rest&&dn(i.rest,r))return!0;return!1}return!1}var xC=(e,t={})=>(r)=>{let i=js({...r,processors:t});return yt(e,i),Ns(i,e),zs(i,e)},ul=(e,t,r={})=>(i)=>{let{libraryOptions:n,target:o}=i??{},s=js({...n??{},target:o,io:t,processors:r});return yt(e,s),Ns(s,e),zs(s,e)};var Oie={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},SC=(e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o==="number")n.minLength=o;if(typeof s==="number")n.maxLength=s;if(c){if(n.format=Oie[c]??c,n.format==="")delete n.format;if(c==="time")delete n.format}if(l)n.contentEncoding=l;if(u&&u.size>0){let p=[...u];if(p.length===1)n.pattern=p[0].source;else if(p.length>1)n.allOf=[...p.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},vC=(e,t,r,i)=>{let n=r,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:p}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))n.type="integer";else n.type="number";let m=typeof p==="number"&&p>=(o??Number.NEGATIVE_INFINITY),f=typeof l==="number"&&l<=(s??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";if(m)if(g)n.minimum=p,n.exclusiveMinimum=!0;else n.exclusiveMinimum=p;else if(typeof o==="number")n.minimum=o;if(f)if(g)n.maximum=l,n.exclusiveMaximum=!0;else n.exclusiveMaximum=l;else if(typeof s==="number")n.maximum=s;if(typeof u==="number")n.multipleOf=u},wC=(e,t,r,i)=>{r.type="boolean"},kC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},IC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},TC=(e,t,r,i)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},EC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},CC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},PC=(e,t,r,i)=>{r.not={}},RC=(e,t,r,i)=>{},AC=(e,t,r,i)=>{},_C=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},OC=(e,t,r,i)=>{let n=e._zod.def,o=Rd(n.entries);if(o.every((s)=>typeof s==="number"))r.type="number";if(o.every((s)=>typeof s==="string"))r.type="string";r.enum=o},DC=(e,t,r,i)=>{let n=e._zod.def,o=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(s));else o.push(s);if(o.length===0);else if(o.length===1){let s=o[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(o.every((s)=>typeof s==="number"))r.type="number";if(o.every((s)=>typeof s==="string"))r.type="string";if(o.every((s)=>typeof s==="boolean"))r.type="boolean";if(o.every((s)=>s===null))r.type="null";r.enum=o}},MC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},FC=(e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},$C=(e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;if(s!==void 0)o.minLength=s;if(c!==void 0)o.maxLength=c;if(u)if(u.length===1)o.contentMediaType=u[0],Object.assign(n,o);else Object.assign(n,o),n.anyOf=u.map((l)=>({contentMediaType:l}));else Object.assign(n,o)},jC=(e,t,r,i)=>{r.type="boolean"},NC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},zC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},LC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},BC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},UC=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},qC=(e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;if(typeof s==="number")n.minItems=s;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=yt(o.element,t,{...i,path:[...i.path,"items"]})},JC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=yt(s[l],t,{...i,path:[...i.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter((l)=>{let p=o.shape[l]._zod;if(t.io==="input")return p.optin===void 0;else return p.optout===void 0}));if(u.size>0)n.required=Array.from(u);if(o.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!o.catchall){if(t.io==="output")n.additionalProperties=!1}else if(o.catchall)n.additionalProperties=yt(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},ry=(e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,s=n.options.map((c,u)=>yt(c,t,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));if(o)r.oneOf=s;else r.anyOf=s},HC=(e,t,r,i)=>{let n=e._zod.def,o=yt(n.left,t,{...i,path:[...i.path,"allOf",0]}),s=yt(n.right,t,{...i,path:[...i.path,"allOf",1]}),c=(l)=>("allOf"in l)&&Object.keys(l).length===1,u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];r.allOf=u},WC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((f,g)=>yt(f,t,{...i,path:[...i.path,s,g]})),l=o.rest?yt(o.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=u,l)n.items=l}else if(t.target==="openapi-3.0"){if(n.items={anyOf:u},l)n.items.anyOf.push(l);if(n.minItems=u.length,!l)n.maxItems=u.length}else if(n.items=u,l)n.additionalItems=l;let{minimum:p,maximum:m}=e._zod.bag;if(typeof p==="number")n.minItems=p;if(typeof m==="number")n.maxItems=m},ZC=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let p=yt(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let m of u)n.patternProperties[m.source]=p}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=yt(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=yt(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let l=s._zod.values;if(l){let p=[...l].filter((m)=>typeof m==="string"||typeof m==="number");if(p.length>0)n.required=p}},VC=(e,t,r,i)=>{let n=e._zod.def,o=yt(n.innerType,t,i),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[o,{type:"null"}]},GC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},KC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},QC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);if(o.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},YC=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},XC=(e,t,r,i)=>{let n=e._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?n.out:n.in:n.out;yt(s,t,i);let c=t.seen.get(e);c.ref=s},eP=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},tP=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},ny=(e,t,r,i)=>{let n=e._zod.def;yt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},rP=(e,t,r,i)=>{let n=e._zod.innerType;yt(n,t,i);let o=t.seen.get(e);o.ref=n},ty={string:SC,number:vC,boolean:wC,bigint:kC,symbol:IC,null:TC,undefined:EC,void:CC,never:PC,any:RC,unknown:AC,date:_C,enum:OC,literal:DC,nan:MC,template_literal:FC,file:$C,success:jC,custom:NC,function:zC,transform:LC,map:BC,set:UC,array:qC,object:JC,union:ry,intersection:HC,tuple:WC,record:ZC,nullable:VC,nonoptional:GC,default:KC,prefault:QC,catch:YC,pipe:XC,readonly:eP,promise:tP,optional:ny,lazy:rP};function iy(e,t){if("_idmap"in e){let i=e,n=js({...t,processors:ty}),o={};for(let u of i._idmap.entries()){let[l,p]=u;yt(p,n)}let s={},c={registry:i,uri:t?.uri,defs:o};n.external=c;for(let u of i._idmap.entries()){let[l,p]=u;Ns(n,p),s[l]=zs(n,p)}if(Object.keys(o).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let r=js({...t,processors:ty});return yt(e,r),Ns(r,e),zs(r,e)}class nP{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=js({processors:ty,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return yt(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}Ns(this.ctx,e);let r=zs(this.ctx,e),{"~standard":i,...n}=r;return n}}var UN={};var Kd={};pi(Kd,{ZodAny:()=>CP,ZodArray:()=>_P,ZodBase64:()=>Ty,ZodBase64URL:()=>Ey,ZodBigInt:()=>yl,ZodBigIntFormat:()=>Ry,ZodBoolean:()=>hl,ZodCIDRv4:()=>ky,ZodCIDRv6:()=>Iy,ZodCUID:()=>hy,ZodCUID2:()=>yy,ZodCatch:()=>XP,ZodCodec:()=>cm,ZodCustom:()=>um,ZodCustomStringFormat:()=>fl,ZodDate:()=>nm,ZodDefault:()=>ZP,ZodDiscriminatedUnion:()=>DP,ZodE164:()=>Cy,ZodEmail:()=>my,ZodEmoji:()=>fy,ZodEnum:()=>dl,ZodExactOptional:()=>JP,ZodFile:()=>UP,ZodFunction:()=>uR,ZodGUID:()=>Yd,ZodIPv4:()=>vy,ZodIPv6:()=>wy,ZodIntersection:()=>MP,ZodJWT:()=>Py,ZodKSUID:()=>Sy,ZodLazy:()=>sR,ZodLiteral:()=>BP,ZodMAC:()=>SP,ZodMap:()=>zP,ZodNaN:()=>tR,ZodNanoID:()=>gy,ZodNever:()=>RP,ZodNonOptional:()=>Fy,ZodNull:()=>TP,ZodNullable:()=>WP,ZodNumber:()=>gl,ZodNumberFormat:()=>sc,ZodObject:()=>om,ZodOptional:()=>My,ZodPipe:()=>am,ZodPrefault:()=>GP,ZodPreprocess:()=>rR,ZodPromise:()=>cR,ZodReadonly:()=>nR,ZodRecord:()=>pl,ZodSet:()=>LP,ZodString:()=>ml,ZodStringFormat:()=>wt,ZodSuccess:()=>YP,ZodSymbol:()=>kP,ZodTemplateLiteral:()=>oR,ZodTransform:()=>qP,ZodTuple:()=>$P,ZodType:()=>nt,ZodULID:()=>by,ZodURL:()=>rm,ZodUUID:()=>io,ZodUndefined:()=>IP,ZodUnion:()=>sm,ZodUnknown:()=>PP,ZodVoid:()=>AP,ZodXID:()=>xy,ZodXor:()=>OP,_ZodString:()=>dy,_default:()=>VP,_function:()=>Yz,any:()=>Rz,array:()=>im,base64:()=>dz,base64url:()=>mz,bigint:()=>Iz,boolean:()=>wP,catch:()=>eR,check:()=>Xz,cidrv4:()=>lz,cidrv6:()=>pz,codec:()=>Vz,cuid:()=>rz,cuid2:()=>nz,custom:()=>eL,date:()=>_z,describe:()=>tL,discriminatedUnion:()=>jz,e164:()=>fz,email:()=>WN,emoji:()=>ez,enum:()=>Oy,exactOptional:()=>HP,file:()=>Jz,float32:()=>Sz,float64:()=>vz,function:()=>Yz,guid:()=>ZN,hash:()=>xz,hex:()=>bz,hostname:()=>yz,httpUrl:()=>XN,instanceof:()=>nL,int:()=>ly,int32:()=>wz,int64:()=>Tz,intersection:()=>FP,invertCodec:()=>Gz,ipv4:()=>az,ipv6:()=>uz,json:()=>oL,jwt:()=>gz,keyof:()=>Oz,ksuid:()=>sz,lazy:()=>aR,literal:()=>qz,looseObject:()=>Fz,looseRecord:()=>zz,mac:()=>cz,map:()=>Lz,meta:()=>rL,nan:()=>Zz,nanoid:()=>tz,nativeEnum:()=>Uz,never:()=>Ay,nonoptional:()=>QP,null:()=>EP,nullable:()=>em,nullish:()=>Hz,number:()=>vP,object:()=>Dz,optional:()=>Xd,partialRecord:()=>Nz,pipe:()=>py,prefault:()=>KP,preprocess:()=>sL,promise:()=>Qz,readonly:()=>iR,record:()=>NP,refine:()=>lR,set:()=>Bz,strictObject:()=>Mz,string:()=>Qd,stringFormat:()=>hz,stringbool:()=>iL,success:()=>Wz,superRefine:()=>pR,symbol:()=>Cz,templateLiteral:()=>Kz,transform:()=>Dy,tuple:()=>jP,uint32:()=>kz,uint64:()=>Ez,ulid:()=>iz,undefined:()=>Pz,union:()=>_y,unknown:()=>oc,url:()=>YN,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>KN,uuidv7:()=>QN,void:()=>Az,xid:()=>oz,xor:()=>$z});var oy={};pi(oy,{endsWith:()=>tl,gt:()=>ro,gte:()=>pn,includes:()=>Xu,length:()=>ic,lowercase:()=>Qu,lt:()=>to,lte:()=>Wn,maxLength:()=>nc,maxSize:()=>$s,mime:()=>rl,minLength:()=>Do,minSize:()=>no,multipleOf:()=>Fs,negative:()=>Qh,nonnegative:()=>Xh,nonpositive:()=>Yh,normalize:()=>nl,overwrite:()=>Fi,positive:()=>Kh,property:()=>ey,regex:()=>Ku,size:()=>rc,slugify:()=>al,startsWith:()=>el,toLowerCase:()=>ol,toUpperCase:()=>sl,trim:()=>il,uppercase:()=>Yu});var ll={};pi(ll,{ZodISODate:()=>ay,ZodISODateTime:()=>sy,ZodISODuration:()=>uy,ZodISOTime:()=>cy,date:()=>oP,datetime:()=>iP,duration:()=>aP,time:()=>sP});var sy=C("ZodISODateTime",(e,t)=>{NI.init(e,t),wt.init(e,t)});function iP(e){return NE(sy,e)}var ay=C("ZodISODate",(e,t)=>{zI.init(e,t),wt.init(e,t)});function oP(e){return zE(ay,e)}var cy=C("ZodISOTime",(e,t)=>{LI.init(e,t),wt.init(e,t)});function sP(e){return LE(cy,e)}var uy=C("ZodISODuration",(e,t)=>{BI.init(e,t),wt.init(e,t)});function aP(e){return BE(uy,e)}var qN=(e,t)=>{Md.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>$d(e,r)},flatten:{value:(r)=>Fd(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Bu,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Bu,2)}},isEmpty:{get(){return e.issues.length===0}}})},JN=C("ZodError",qN),Rn=C("ZodError",qN,{Parent:Error});var cP=Ju(Rn),uP=Hu(Rn),lP=Wu(Rn),pP=Zu(Rn),dP=ch(Rn),mP=uh(Rn),fP=lh(Rn),gP=ph(Rn),hP=dh(Rn),yP=mh(Rn),bP=fh(Rn),xP=gh(Rn);var HN=new WeakMap;function tm(e,t,r){let i=Object.getPrototypeOf(e),n=HN.get(i);if(!n)n=new Set,HN.set(i,n);if(n.has(t))return;n.add(t);for(let o in r){let s=r[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}var nt=C("ZodType",(e,t)=>(Ve.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ul(e,"input"),output:ul(e,"output")}}),e.toJSONSchema=xC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>cP(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>lP(e,r,i),e.parseAsync=async(r,i)=>uP(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>pP(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>dP(e,r,i),e.decode=(r,i)=>mP(e,r,i),e.encodeAsync=async(r,i)=>fP(e,r,i),e.decodeAsync=async(r,i)=>gP(e,r,i),e.safeEncode=(r,i)=>hP(e,r,i),e.safeDecode=(r,i)=>yP(e,r,i),e.safeEncodeAsync=async(r,i)=>bP(e,r,i),e.safeDecodeAsync=async(r,i)=>xP(e,r,i),tm(e,"ZodType",{check(...r){let i=this.def;return this.clone(te.mergeDefs(i,{checks:[...i.checks??[],...r.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return un(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(lR(r,i))},superRefine(r,i){return this.check(pR(r,i))},overwrite(r){return this.check(Fi(r))},optional(){return Xd(this)},exactOptional(){return HP(this)},nullable(){return em(this)},nullish(){return Xd(em(this))},nonoptional(r){return QP(this,r)},array(){return im(this)},or(r){return _y([this,r])},and(r){return FP(this,r)},transform(r){return py(this,Dy(r))},default(r){return VP(this,r)},prefault(r){return KP(this,r)},catch(r){return eR(this,r)},pipe(r){return py(this,r)},readonly(){return iR(this)},describe(r){let i=this.clone();return $r.add(i,{description:r}),i},meta(...r){if(r.length===0)return $r.get(this);let i=this.clone();return $r.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return $r.get(e)?.description},configurable:!0}),e)),dy=C("_ZodString",(e,t)=>{tc.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>SC(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,tm(e,"_ZodString",{regex(...i){return this.check(Ku(...i))},includes(...i){return this.check(Xu(...i))},startsWith(...i){return this.check(el(...i))},endsWith(...i){return this.check(tl(...i))},min(...i){return this.check(Do(...i))},max(...i){return this.check(nc(...i))},length(...i){return this.check(ic(...i))},nonempty(...i){return this.check(Do(1,...i))},lowercase(i){return this.check(Qu(i))},uppercase(i){return this.check(Yu(i))},trim(){return this.check(il())},normalize(...i){return this.check(nl(...i))},toLowerCase(){return this.check(ol())},toUpperCase(){return this.check(sl())},slugify(){return this.check(al())}})}),ml=C("ZodString",(e,t)=>{tc.init(e,t),dy.init(e,t),e.email=(r)=>e.check(Ah(my,r)),e.url=(r)=>e.check(Gd(rm,r)),e.jwt=(r)=>e.check(Gh(Py,r)),e.emoji=(r)=>e.check(Fh(fy,r)),e.guid=(r)=>e.check(Vd(Yd,r)),e.uuid=(r)=>e.check(_h(io,r)),e.uuidv4=(r)=>e.check(Oh(io,r)),e.uuidv6=(r)=>e.check(Dh(io,r)),e.uuidv7=(r)=>e.check(Mh(io,r)),e.nanoid=(r)=>e.check($h(gy,r)),e.guid=(r)=>e.check(Vd(Yd,r)),e.cuid=(r)=>e.check(jh(hy,r)),e.cuid2=(r)=>e.check(Nh(yy,r)),e.ulid=(r)=>e.check(zh(by,r)),e.base64=(r)=>e.check(Wh(Ty,r)),e.base64url=(r)=>e.check(Zh(Ey,r)),e.xid=(r)=>e.check(Lh(xy,r)),e.ksuid=(r)=>e.check(Bh(Sy,r)),e.ipv4=(r)=>e.check(Uh(vy,r)),e.ipv6=(r)=>e.check(qh(wy,r)),e.cidrv4=(r)=>e.check(Jh(ky,r)),e.cidrv6=(r)=>e.check(Hh(Iy,r)),e.e164=(r)=>e.check(Vh(Cy,r)),e.datetime=(r)=>e.check(iP(r)),e.date=(r)=>e.check(oP(r)),e.time=(r)=>e.check(sP(r)),e.duration=(r)=>e.check(aP(r))});function Qd(e){return ME(ml,e)}var wt=C("ZodStringFormat",(e,t)=>{vt.init(e,t),dy.init(e,t)}),my=C("ZodEmail",(e,t)=>{RI.init(e,t),wt.init(e,t)});function WN(e){return Ah(my,e)}var Yd=C("ZodGUID",(e,t)=>{CI.init(e,t),wt.init(e,t)});function ZN(e){return Vd(Yd,e)}var io=C("ZodUUID",(e,t)=>{PI.init(e,t),wt.init(e,t)});function VN(e){return _h(io,e)}function GN(e){return Oh(io,e)}function KN(e){return Dh(io,e)}function QN(e){return Mh(io,e)}var rm=C("ZodURL",(e,t)=>{AI.init(e,t),wt.init(e,t)});function YN(e){return Gd(rm,e)}function XN(e){return Gd(rm,{protocol:Hn.httpProtocol,hostname:Hn.domain,...te.normalizeParams(e)})}var fy=C("ZodEmoji",(e,t)=>{_I.init(e,t),wt.init(e,t)});function ez(e){return Fh(fy,e)}var gy=C("ZodNanoID",(e,t)=>{OI.init(e,t),wt.init(e,t)});function tz(e){return $h(gy,e)}var hy=C("ZodCUID",(e,t)=>{DI.init(e,t),wt.init(e,t)});function rz(e){return jh(hy,e)}var yy=C("ZodCUID2",(e,t)=>{MI.init(e,t),wt.init(e,t)});function nz(e){return Nh(yy,e)}var by=C("ZodULID",(e,t)=>{FI.init(e,t),wt.init(e,t)});function iz(e){return zh(by,e)}var xy=C("ZodXID",(e,t)=>{$I.init(e,t),wt.init(e,t)});function oz(e){return Lh(xy,e)}var Sy=C("ZodKSUID",(e,t)=>{jI.init(e,t),wt.init(e,t)});function sz(e){return Bh(Sy,e)}var vy=C("ZodIPv4",(e,t)=>{UI.init(e,t),wt.init(e,t)});function az(e){return Uh(vy,e)}var SP=C("ZodMAC",(e,t)=>{JI.init(e,t),wt.init(e,t)});function cz(e){return $E(SP,e)}var wy=C("ZodIPv6",(e,t)=>{qI.init(e,t),wt.init(e,t)});function uz(e){return qh(wy,e)}var ky=C("ZodCIDRv4",(e,t)=>{HI.init(e,t),wt.init(e,t)});function lz(e){return Jh(ky,e)}var Iy=C("ZodCIDRv6",(e,t)=>{WI.init(e,t),wt.init(e,t)});function pz(e){return Hh(Iy,e)}var Ty=C("ZodBase64",(e,t)=>{VI.init(e,t),wt.init(e,t)});function dz(e){return Wh(Ty,e)}var Ey=C("ZodBase64URL",(e,t)=>{GI.init(e,t),wt.init(e,t)});function mz(e){return Zh(Ey,e)}var Cy=C("ZodE164",(e,t)=>{KI.init(e,t),wt.init(e,t)});function fz(e){return Vh(Cy,e)}var Py=C("ZodJWT",(e,t)=>{QI.init(e,t),wt.init(e,t)});function gz(e){return Gh(Py,e)}var fl=C("ZodCustomStringFormat",(e,t)=>{YI.init(e,t),wt.init(e,t)});function hz(e,t,r={}){return cl(fl,e,t,r)}function yz(e){return cl(fl,"hostname",Hn.hostname,e)}function bz(e){return cl(fl,"hex",Hn.hex,e)}function xz(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=Hn[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return cl(fl,i,n,t)}var gl=C("ZodNumber",(e,t)=>{Ih.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>vC(e,i,n,o),tm(e,"ZodNumber",{gt(i,n){return this.check(ro(i,n))},gte(i,n){return this.check(pn(i,n))},min(i,n){return this.check(pn(i,n))},lt(i,n){return this.check(to(i,n))},lte(i,n){return this.check(Wn(i,n))},max(i,n){return this.check(Wn(i,n))},int(i){return this.check(ly(i))},safe(i){return this.check(ly(i))},positive(i){return this.check(ro(0,i))},nonnegative(i){return this.check(pn(0,i))},negative(i){return this.check(to(0,i))},nonpositive(i){return this.check(Wn(0,i))},multipleOf(i,n){return this.check(Fs(i,n))},step(i,n){return this.check(Fs(i,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function vP(e){return UE(gl,e)}var sc=C("ZodNumberFormat",(e,t)=>{XI.init(e,t),gl.init(e,t)});function ly(e){return JE(sc,e)}function Sz(e){return HE(sc,e)}function vz(e){return WE(sc,e)}function wz(e){return ZE(sc,e)}function kz(e){return VE(sc,e)}var hl=C("ZodBoolean",(e,t)=>{Ld.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>wC(e,r,i,n)});function wP(e){return GE(hl,e)}var yl=C("ZodBigInt",(e,t)=>{Th.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>kC(e,i,n,o),e.gte=(i,n)=>e.check(pn(i,n)),e.min=(i,n)=>e.check(pn(i,n)),e.gt=(i,n)=>e.check(ro(i,n)),e.gte=(i,n)=>e.check(pn(i,n)),e.min=(i,n)=>e.check(pn(i,n)),e.lt=(i,n)=>e.check(to(i,n)),e.lte=(i,n)=>e.check(Wn(i,n)),e.max=(i,n)=>e.check(Wn(i,n)),e.positive=(i)=>e.check(ro(BigInt(0),i)),e.negative=(i)=>e.check(to(BigInt(0),i)),e.nonpositive=(i)=>e.check(Wn(BigInt(0),i)),e.nonnegative=(i)=>e.check(pn(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Fs(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Iz(e){return QE(yl,e)}var Ry=C("ZodBigIntFormat",(e,t)=>{eT.init(e,t),yl.init(e,t)});function Tz(e){return XE(Ry,e)}function Ez(e){return eC(Ry,e)}var kP=C("ZodSymbol",(e,t)=>{tT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>IC(e,r,i,n)});function Cz(e){return tC(kP,e)}var IP=C("ZodUndefined",(e,t)=>{rT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>EC(e,r,i,n)});function Pz(e){return rC(IP,e)}var TP=C("ZodNull",(e,t)=>{nT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>TC(e,r,i,n)});function EP(e){return nC(TP,e)}var CP=C("ZodAny",(e,t)=>{iT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>RC(e,r,i,n)});function Rz(){return iC(CP)}var PP=C("ZodUnknown",(e,t)=>{oT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>AC(e,r,i,n)});function oc(){return oC(PP)}var RP=C("ZodNever",(e,t)=>{sT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>PC(e,r,i,n)});function Ay(e){return sC(RP,e)}var AP=C("ZodVoid",(e,t)=>{aT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>CC(e,r,i,n)});function Az(e){return aC(AP,e)}var nm=C("ZodDate",(e,t)=>{cT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>_C(e,i,n,o),e.min=(i,n)=>e.check(pn(i,n)),e.max=(i,n)=>e.check(Wn(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function _z(e){return cC(nm,e)}var _P=C("ZodArray",(e,t)=>{uT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>qC(e,r,i,n),e.element=t.element,tm(e,"ZodArray",{min(r,i){return this.check(Do(r,i))},nonempty(r){return this.check(Do(1,r))},max(r,i){return this.check(nc(r,i))},length(r,i){return this.check(ic(r,i))},unwrap(){return this.element}})});function im(e,t){return pC(_P,e,t)}function Oz(e){let t=e._zod.def.shape;return Oy(Object.keys(t))}var om=C("ZodObject",(e,t)=>{lT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>JC(e,r,i,n),te.defineLazy(e,"shape",()=>t.shape),tm(e,"ZodObject",{keyof(){return Oy(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:oc()})},loose(){return this.clone({...this._zod.def,catchall:oc()})},strict(){return this.clone({...this._zod.def,catchall:Ay()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(My,this,r[0])},required(...r){return te.required(Fy,this,r[0])}})});function Dz(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new om(r)}function Mz(e,t){return new om({type:"object",shape:e,catchall:Ay(),...te.normalizeParams(t)})}function Fz(e,t){return new om({type:"object",shape:e,catchall:oc(),...te.normalizeParams(t)})}var sm=C("ZodUnion",(e,t)=>{Bd.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ry(e,r,i,n),e.options=t.options});function _y(e,t){return new sm({type:"union",options:e,...te.normalizeParams(t)})}var OP=C("ZodXor",(e,t)=>{sm.init(e,t),pT.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ry(e,r,i,n),e.options=t.options});function $z(e,t){return new OP({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}var DP=C("ZodDiscriminatedUnion",(e,t)=>{sm.init(e,t),dT.init(e,t)});function jz(e,t,r){return new DP({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}var MP=C("ZodIntersection",(e,t)=>{mT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>HC(e,r,i,n)});function FP(e,t){return new MP({type:"intersection",left:e,right:t})}var $P=C("ZodTuple",(e,t)=>{Eh.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>WC(e,r,i,n),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function jP(e,t,r){let i=t instanceof Ve,n=i?r:t;return new $P({type:"tuple",items:e,rest:i?t:null,...te.normalizeParams(n)})}var pl=C("ZodRecord",(e,t)=>{fT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ZC(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function NP(e,t,r){if(!t||!t._zod)return new pl({type:"record",keyType:Qd(),valueType:e,...te.normalizeParams(t)});return new pl({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}function Nz(e,t,r){let i=un(e);return i._zod.values=void 0,new pl({type:"record",keyType:i,valueType:t,...te.normalizeParams(r)})}function zz(e,t,r){return new pl({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}var zP=C("ZodMap",(e,t)=>{gT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>BC(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(no(...r)),e.nonempty=(r)=>e.check(no(1,r)),e.max=(...r)=>e.check($s(...r)),e.size=(...r)=>e.check(rc(...r))});function Lz(e,t,r){return new zP({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}var LP=C("ZodSet",(e,t)=>{hT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>UC(e,r,i,n),e.min=(...r)=>e.check(no(...r)),e.nonempty=(r)=>e.check(no(1,r)),e.max=(...r)=>e.check($s(...r)),e.size=(...r)=>e.check(rc(...r))});function Bz(e,t){return new LP({type:"set",valueType:e,...te.normalizeParams(t)})}var dl=C("ZodEnum",(e,t)=>{yT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(i,n,o)=>OC(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new dl({...t,checks:[],...te.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new dl({...t,checks:[],...te.normalizeParams(n),entries:o})}});function Oy(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((i)=>[i,i])):e;return new dl({type:"enum",entries:r,...te.normalizeParams(t)})}function Uz(e,t){return new dl({type:"enum",entries:e,...te.normalizeParams(t)})}var BP=C("ZodLiteral",(e,t)=>{bT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>DC(e,r,i,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qz(e,t){return new BP({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}var UP=C("ZodFile",(e,t)=>{xT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>$C(e,r,i,n),e.min=(r,i)=>e.check(no(r,i)),e.max=(r,i)=>e.check($s(r,i)),e.mime=(r,i)=>e.check(rl(Array.isArray(r)?r:[r],i))});function Jz(e){return dC(UP,e)}var qP=C("ZodTransform",(e,t)=>{ST.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>LC(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ya(e.constructor.name);r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(te.issue(o,r.value,t));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(te.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((o)=>(r.value=o,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function Dy(e){return new qP({type:"transform",transform:e})}var My=C("ZodOptional",(e,t)=>{Ch.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ny(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Xd(e){return new My({type:"optional",innerType:e})}var JP=C("ZodExactOptional",(e,t)=>{vT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ny(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function HP(e){return new JP({type:"optional",innerType:e})}var WP=C("ZodNullable",(e,t)=>{wT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>VC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function em(e){return new WP({type:"nullable",innerType:e})}function Hz(e){return Xd(em(e))}var ZP=C("ZodDefault",(e,t)=>{kT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>KC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VP(e,t){return new ZP({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():te.shallowClone(t)}})}var GP=C("ZodPrefault",(e,t)=>{IT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>QC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function KP(e,t){return new GP({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():te.shallowClone(t)}})}var Fy=C("ZodNonOptional",(e,t)=>{TT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>GC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function QP(e,t){return new Fy({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}var YP=C("ZodSuccess",(e,t)=>{ET.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>jC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Wz(e){return new YP({type:"success",innerType:e})}var XP=C("ZodCatch",(e,t)=>{CT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>YC(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eR(e,t){return new XP({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var tR=C("ZodNaN",(e,t)=>{PT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>MC(e,r,i,n)});function Zz(e){return lC(tR,e)}var am=C("ZodPipe",(e,t)=>{Ph.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>XC(e,r,i,n),e.in=t.in,e.out=t.out});function py(e,t){return new am({type:"pipe",in:e,out:t})}var cm=C("ZodCodec",(e,t)=>{am.init(e,t),Ud.init(e,t)});function Vz(e,t,r){return new cm({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Gz(e){let t=e._zod.def;return new cm({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var rR=C("ZodPreprocess",(e,t)=>{am.init(e,t),RT.init(e,t)}),nR=C("ZodReadonly",(e,t)=>{AT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>eP(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function iR(e){return new nR({type:"readonly",innerType:e})}var oR=C("ZodTemplateLiteral",(e,t)=>{_T.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>FC(e,r,i,n)});function Kz(e,t){return new oR({type:"template_literal",parts:e,...te.normalizeParams(t)})}var sR=C("ZodLazy",(e,t)=>{MT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rP(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function aR(e){return new sR({type:"lazy",getter:e})}var cR=C("ZodPromise",(e,t)=>{DT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>tP(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Qz(e){return new cR({type:"promise",innerType:e})}var uR=C("ZodFunction",(e,t)=>{OT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>zC(e,r,i,n)});function Yz(e){return new uR({type:"function",input:Array.isArray(e?.input)?jP(e?.input):e?.input??im(oc()),output:e?.output??oc()})}var um=C("ZodCustom",(e,t)=>{FT.init(e,t),nt.init(e,t),e._zod.processJSONSchema=(r,i,n)=>NC(e,r,i,n)});function Xz(e){let t=new Et({check:"custom"});return t._zod.check=e,t}function eL(e,t){return mC(um,e??(()=>!0),t)}function lR(e,t={}){return fC(um,e,t)}function pR(e,t){return gC(e,t)}var tL=hC,rL=yC;function nL(e,t={}){let r=new um({type:"custom",check:"custom",fn:(i)=>i instanceof e,abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=(i)=>{if(!(i.value instanceof e))i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var iL=(...e)=>bC({Codec:cm,Boolean:hl,String:ml},...e);function oL(e){let t=aR(()=>_y([Qd(e),vP(),wP(),EP(),im(t),NP(Qd(),t)]));return t}function sL(e,t){return new rR({type:"pipe",in:Dy(e),out:t})}var Fie={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 $ie(e){Kt({customError:e})}function jie(){return Kt().customError}var dR;(function(e){})(dR||(dR={}));var ye={...Kd,...oy,iso:ll},Nie=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 zie(e,t){let r=e.$schema;if(r==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(r==="http://json-schema.org/draft-07/schema#")return"draft-7";if(r==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function Lie(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function aL(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return ye.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return ye.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=Lie(n,t),s=Vr(o,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return ye.null();if(n.length===0)return ye.never();if(n.length===1)return ye.literal(n[0]);if(n.every((s)=>typeof s==="string"))return ye.enum(n);let o=n.map((s)=>ye.literal(s));if(o.length<2)return o[0];return ye.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ye.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map((o)=>{let s={...e,type:o};return aL(s,t)});if(n.length===0)return ye.never();if(n.length===1)return n[0];return ye.union(n)}if(!r)return ye.any();let i;switch(r){case"string":{let n=ye.string();if(e.format){let o=e.format;if(o==="email")n=n.check(ye.email());else if(o==="uri"||o==="uri-reference")n=n.check(ye.url());else if(o==="uuid"||o==="guid")n=n.check(ye.uuid());else if(o==="date-time")n=n.check(ye.iso.datetime());else if(o==="date")n=n.check(ye.iso.date());else if(o==="time")n=n.check(ye.iso.time());else if(o==="duration")n=n.check(ye.iso.duration());else if(o==="ipv4")n=n.check(ye.ipv4());else if(o==="ipv6")n=n.check(ye.ipv6());else if(o==="mac")n=n.check(ye.mac());else if(o==="cidr")n=n.check(ye.cidrv4());else if(o==="cidr-v6")n=n.check(ye.cidrv6());else if(o==="base64")n=n.check(ye.base64());else if(o==="base64url")n=n.check(ye.base64url());else if(o==="e164")n=n.check(ye.e164());else if(o==="jwt")n=n.check(ye.jwt());else if(o==="emoji")n=n.check(ye.emoji());else if(o==="nanoid")n=n.check(ye.nanoid());else if(o==="cuid")n=n.check(ye.cuid());else if(o==="cuid2")n=n.check(ye.cuid2());else if(o==="ulid")n=n.check(ye.ulid());else if(o==="xid")n=n.check(ye.xid());else if(o==="ksuid")n=n.check(ye.ksuid())}if(typeof e.minLength==="number")n=n.min(e.minLength);if(typeof e.maxLength==="number")n=n.max(e.maxLength);if(e.pattern)n=n.regex(new RegExp(e.pattern));i=n;break}case"number":case"integer":{let n=r==="integer"?ye.number().int():ye.number();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);if(typeof e.exclusiveMinimum==="number")n=n.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")n=n.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")n=n.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")n=n.lt(e.maximum);if(typeof e.multipleOf==="number")n=n.multipleOf(e.multipleOf);i=n;break}case"boolean":{i=ye.boolean();break}case"null":{i=ye.null();break}case"object":{let n={},o=e.properties||{},s=new Set(e.required||[]);for(let[u,l]of Object.entries(o)){let p=Vr(l,t);n[u]=s.has(u)?p:p.optional()}if(e.propertyNames){let u=Vr(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties==="object"?Vr(e.additionalProperties,t):ye.any();if(Object.keys(n).length===0){i=ye.record(u,l);break}let p=ye.object(n).passthrough(),m=ye.looseRecord(u,l);i=ye.intersection(p,m);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),p=[];for(let f of l){let g=Vr(u[f],t),S=ye.string().regex(new RegExp(f));p.push(ye.looseRecord(S,g))}let m=[];if(Object.keys(n).length>0)m.push(ye.object(n).passthrough());if(m.push(...p),m.length===0)i=ye.object({}).passthrough();else if(m.length===1)i=m[0];else{let f=ye.intersection(m[0],m[1]);for(let g=2;g<m.length;g++)f=ye.intersection(f,m[g]);i=f}break}let c=ye.object(n);if(e.additionalProperties===!1)i=c.strict();else if(typeof e.additionalProperties==="object")i=c.catchall(Vr(e.additionalProperties,t));else i=c.passthrough();break}case"array":{let{prefixItems:n,items:o}=e;if(n&&Array.isArray(n)){let s=n.map((u)=>Vr(u,t)),c=o&&typeof o==="object"&&!Array.isArray(o)?Vr(o,t):void 0;if(c)i=ye.tuple(s).rest(c);else i=ye.tuple(s);if(typeof e.minItems==="number")i=i.check(ye.minLength(e.minItems));if(typeof e.maxItems==="number")i=i.check(ye.maxLength(e.maxItems))}else if(Array.isArray(o)){let s=o.map((u)=>Vr(u,t)),c=e.additionalItems&&typeof e.additionalItems==="object"?Vr(e.additionalItems,t):void 0;if(c)i=ye.tuple(s).rest(c);else i=ye.tuple(s);if(typeof e.minItems==="number")i=i.check(ye.minLength(e.minItems));if(typeof e.maxItems==="number")i=i.check(ye.maxLength(e.maxItems))}else if(o!==void 0){let s=Vr(o,t),c=ye.array(s);if(typeof e.minItems==="number")c=c.min(e.minItems);if(typeof e.maxItems==="number")c=c.max(e.maxItems);i=c}else i=ye.array(ye.any());break}default:throw Error(`Unsupported type: ${r}`)}return i}function Vr(e,t){if(typeof e==="boolean")return e?ye.any():ye.never();let r=aL(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map((l)=>Vr(l,t)),u=ye.union(c);r=i?ye.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map((l)=>Vr(l,t)),u=ye.xor(c);r=i?ye.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:ye.any();else{let c=i?r:Vr(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=ye.intersection(c,Vr(e.allOf[l],t));r=c}if(e.nullable===!0&&t.version==="openapi-3.0")r=ye.nullable(r);if(e.readOnly===!0)r=ye.readonly(r);if(e.default!==void 0)r=r.default(e.default);let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)if(c in e)n[c]=e[c];let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)if(c in e)n[c]=e[c];for(let c of Object.keys(e))if(!Nie.has(c))n[c]=e[c];if(Object.keys(n).length>0)t.registry.add(r,n);if(e.description)r=r.describe(e.description);return r}function cL(e,t){if(typeof e==="boolean")return e?ye.any():ye.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=zie(r,t?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??$r};return Vr(r,o)}var mR={};pi(mR,{bigint:()=>Jie,boolean:()=>qie,date:()=>Hie,number:()=>Uie,string:()=>Bie});function Bie(e){return FE(ml,e)}function Uie(e){return qE(gl,e)}function qie(e){return KE(hl,e)}function Jie(e){return YE(yl,e)}function Hie(e){return uC(nm,e)}Kt(qd());import{createHash as Wie}from"crypto";function lm(e){return Wie("sha256").update(e).digest("hex")}var fR=120000;function uL(e){let t;try{t=new URL(e)}catch{return{remoteUrl:e,token:void 0}}if(!t.username&&!t.password)return{remoteUrl:e,token:void 0};let r=t.password||t.username;return t.username="",t.password="",{remoteUrl:t.toString(),token:r||void 0}}function gR(e){let t=e.gitUrl??(e.repo?`https://github.com/${e.repo}.git`:"");return uL(t).remoteUrl}function lL(e){if(e.authToken)return e.authToken;let t=e.gitUrl??"";return uL(t).token}function $y(e){let t=e;try{let r=new URL(e);r.username="",r.password="",t=r.toString()}catch{}return lm(t)}import{webcrypto as dL}from"crypto";var pL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Zie=128,Ls,bl;function Vie(e){if(e<0)throw RangeError("Wrong ID size");try{if(!Ls||Ls.length<e)Ls=Buffer.allocUnsafe(e*Zie),dL.getRandomValues(Ls),bl=0;else if(bl+e>Ls.length)dL.getRandomValues(Ls),bl=0}catch(t){throw Ls=void 0,t}bl+=e}function mL(e=21){Vie(e|=0);let t="";for(let r=bl-e;r<bl;r++)t+=pL[Ls[r]&63];return t}function jr(e=12){return mL(e)}var fL=["initialize","get-status","has-local-changes","commit","push","commit-and-push","pull","get-reconciliation-delta","get-checkpoint","log-file","show-file"],Gie=new Set(["initialize","commit","push","commit-and-push","pull"]),pm=a.object({remoteFingerprint:a.string().min(1),branch:a.string().min(1),lastReconciledGitHead:a.string().min(1),lastObservedRemoteHead:a.string().optional()}).strict(),gL=a.discriminatedUnion("name",[a.object({name:a.literal("initialize")}).strict(),a.object({name:a.literal("get-status")}).strict(),a.object({name:a.literal("has-local-changes")}).strict(),a.object({name:a.literal("commit"),message:a.string().optional()}).strict(),a.object({name:a.literal("push")}).strict(),a.object({name:a.literal("commit-and-push")}).strict(),a.object({name:a.literal("pull")}).strict(),a.object({name:a.literal("get-reconciliation-delta"),checkpoint:pm.optional()}).strict(),a.object({name:a.literal("get-checkpoint")}).strict(),a.object({name:a.literal("log-file"),filePath:a.string().min(1),limit:a.number().int().positive().optional()}).strict(),a.object({name:a.literal("show-file"),sha:a.string().min(1),filePath:a.string().min(1)}).strict()]);function xl(e){return Gie.has(e.name)}var hR=a.union([a.null(),a.undefined()]).transform(()=>{return}),Kie={initialize:hR,commit:hR,push:hR,"has-local-changes":a.boolean(),"show-file":a.string(),"get-checkpoint":pm,"get-status":a.object({isRepo:a.boolean(),hasChanges:a.boolean(),ahead:a.number().int(),behind:a.number().int(),branch:a.string(),lastCommit:a.string().optional(),remote:a.string().optional(),files:a.array(a.object({path:a.string(),status:a.string()}).strict())}).strict(),"commit-and-push":a.object({pushed:a.boolean(),checkpoint:pm.nullable()}).strict(),pull:a.object({files:a.array(a.string()),deletedFiles:a.array(a.string()).optional()}).strict(),"get-reconciliation-delta":a.discriminatedUnion("mode",[a.object({mode:a.literal("incremental"),checkpoint:pm,files:a.array(a.string()),deletedFiles:a.array(a.string())}).strict(),a.object({mode:a.literal("full"),checkpoint:pm,reason:a.enum(["missing-checkpoint","repository-identity-mismatch","branch-mismatch","missing-local-checkpoint","non-ancestor-local-checkpoint","remote-checkpoint-mismatch"])}).strict()]),"log-file":a.array(a.object({sha:a.string(),date:a.string(),message:a.string()}).strict())};function yR(e,t){return Kie[e].parse(t)}var Js=1,Sl=8388608,bR=4194304,Us=4;class qs extends Error{code;constructor(e,t){super(t);this.name="ProtocolError",this.code=e}}var oo=a.string().min(8).max(64).regex(/^[A-Za-z0-9_-]+$/),Bs=a.number().int().nonnegative(),hL=a.string().min(1).max(64),Qie=a.discriminatedUnion("type",[a.object({type:a.literal("register-checkout"),version:Bs,requestId:oo,checkoutPath:a.string().min(1),branch:a.string().min(1),remoteFingerprint:a.string().min(1)}).strict(),a.object({type:a.literal("execute-operation"),version:Bs,requestId:oo,checkoutPath:a.string().min(1),operation:gL}).strict(),a.object({type:a.literal("progress"),version:Bs,requestId:oo,phase:a.literal("running"),observedAt:hL}).strict(),a.object({type:a.literal("result"),version:Bs,requestId:oo,outcome:a.enum(["ok","error"]),value:a.unknown(),error:a.string().nullable()}).strict(),a.object({type:a.literal("query"),version:Bs,requestId:oo}).strict(),a.object({type:a.literal("open-admission"),version:Bs,requestId:oo}).strict(),a.object({type:a.literal("status"),version:Bs,requestId:oo,brokerId:a.string().min(1),checkouts:a.array(a.string()),activeRequestIds:a.array(oo),queuedRequestIds:a.array(oo),ambiguousRequestIds:a.array(oo),evidenceComplete:a.boolean(),recoveryPending:a.boolean(),admitsMutations:a.boolean(),oldestActiveProgressAt:a.number().int().nonnegative().nullable()}).strict(),a.object({type:a.literal("heartbeat"),version:Bs,brokerId:a.string().min(1),observedAt:hL}).strict()]);function xR(e){let t=new TextEncoder().encode(JSON.stringify(e));if(t.length>Sl)throw new qs("frame-too-large",`Refusing to send a ${t.length}-byte frame; the limit is ${Sl}`);let r=new Uint8Array(Us+t.length);return new DataView(r.buffer).setUint32(0,t.length,!1),r.set(t,Us),r}function Yie(e){let t=(()=>{try{return JSON.parse(new TextDecoder().decode(e))}catch{throw new qs("malformed","Frame body is not valid JSON")}})(),r=Qie.safeParse(t);if(!r.success)throw new qs("malformed",`Frame body does not match any broker message: ${r.error.issues.map((i)=>`${i.path.join(".")} ${i.message}`).join("; ")}`);if(r.data.version!==Js)throw new qs("version-mismatch",`Broker protocol version ${r.data.version} is not ${Js}`);return r.data}class dm{#t=new Uint8Array(0);push(e){let t=new Uint8Array(this.#t.length+e.length);return t.set(this.#t),t.set(e,this.#t.length),this.#t=t,this.#e([])}#e(e){if(this.#t.length<Us)return e;let t=new DataView(this.#t.buffer,this.#t.byteOffset,Us).getUint32(0,!1);if(t>Sl)throw new qs("frame-too-large",`Frame declares ${t} bytes; the limit is ${Sl}`);if(this.#t.length<Us+t)return e;let r=Yie(this.#t.subarray(Us,Us+t));return this.#t=this.#t.slice(Us+t),this.#e([...e,r])}}var yL=Sl*2;class jy{#t;#e=new Uint8Array(0);constructor(e){this.#t=e}get pendingBytes(){return this.#e.length}send(e){if(this.#e.length+e.length>yL)throw new qs("frame-too-large",`Refusing to buffer ${this.#e.length+e.length} bytes for a peer that is not draining; the limit is ${yL}`);let t=new Uint8Array(this.#e.length+e.length);t.set(this.#e),t.set(e,this.#e.length),this.#e=t,this.flush()}flush(){if(this.#e.length===0)return;try{let e=this.#t.write(this.#e);this.#e=e>=this.#e.length?new Uint8Array(0):this.#e.slice(e)}catch{this.#e=new Uint8Array(0)}}}var mm="BRAIN_GIT_BROKER_SOCKET";import{dirname as oTe,resolve as sTe}from"path";import{resolve as Xie}from"path";import{realpath as eoe}from"fs/promises";async function fm(e){return eoe(e).catch(()=>Xie(e))}var SR=5242880;var vl=a.object({syncPath:a.string().optional().describe("Optional override for sync directory (defaults to shell dataDir)"),autoSync:a.boolean().describe("Enable bidirectional auto-sync").default(!0),watchInterval:a.number().describe("File watch polling interval in ms").default(1000),includeMetadata:a.boolean().describe("Include frontmatter metadata").default(!0),entityTypes:a.array(a.string()).optional().describe("Specific entity types to sync"),initialSync:a.boolean().optional().describe("Run initial directory import during startup coordination").default(!0),syncBatchSize:a.number().optional().describe("Batch size for sync operations").default(10),syncPriority:a.number().min(1).max(10).optional().describe("Job priority (1-10)").default(3),seedContent:a.boolean().optional().describe("Copy seed content on first initialization").default(!0),seedContentPath:a.string().optional().describe("Custom path to seed content directory (defaults to CWD/seed-content)"),strictSeedEntityTypes:a.boolean().optional().describe("Fail startup when seed content uses an unregistered entity type").default(!1),deleteOnFileRemoval:a.boolean().optional().describe("Delete entities from database when files are deleted").default(!0),syncInterval:a.number().min(1).optional().describe("Pull/push interval in minutes (requires git)").default(2),commitDebounce:a.number().min(100).optional().describe("Debounce delay in ms before git commit after entity changes").default(5000),maxImportFileBytes:a.number().int().positive().optional().describe("Maximum bytes for text and inline base64 binary imports").default(SR),git:a.object({repo:a.string().optional().describe("GitHub repo (owner/name)"),gitUrl:a.string().optional().describe("Full git remote URL (overrides repo)"),branch:a.string().default("main").describe("Git branch to sync"),authToken:a.string().optional().describe("Auth token for private repos"),authorName:a.string().default("Brain").describe("Git commit author name"),authorEmail:a.string().default("brain@localhost").describe("Git commit author email"),bootstrapFromSeed:a.boolean().optional().default(!0).describe("Bootstrap a missing/empty local file:// content remote from seedContentPath")}).optional()});import{chmod as FQ,mkdir as tTe,unlink as $Q}from"fs/promises";import{join as rTe}from"path";class vR{#t=new Map;accept(e,t,r){this.#t.set(e,{checkoutPath:t,queuedAt:r,startedAt:void 0,progressAt:void 0})}start(e,t){let r=this.#t.get(e);if(!r)return;r.startedAt=t,r.progressAt=t}progress(e,t){let r=this.#t.get(e);if(r?.startedAt===void 0)return;r.progressAt=t}finish(e){this.#t.delete(e)}snapshot(){let e=[...this.#t.entries()],t=e.filter(([,i])=>i.progressAt!==void 0),r=t.map(([,i])=>i.progressAt).filter((i)=>i!==void 0);return{activeRequestIds:t.map(([i])=>i).sort(),queuedRequestIds:e.filter(([,i])=>i.progressAt===void 0).map(([i])=>i).sort(),oldestActiveProgressAt:r.length?Math.min(...r):null}}}var Yy=Rs(ML(),1);var CR=new WeakMap;function El(...e){let t=new String(e);return CR.set(t,e),t}function fi(e){return e instanceof String&&CR.has(e)}function Cl(e){return CR.get(e)??[]}var Ky=Rs(Uy(),1);import{spawn as sae}from"child_process";var VB=Rs(RR(),1);import{normalize as Ice}from"path";function*jL(e,t){let r=t==="global";for(let i of e)i.isGlobal===r&&(yield i)}var Hoe=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Woe=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),Zoe=new Set(["edit","remove-section","rename-section","set","unset"]),Voe=new Set(["get","get-color","get-colorbool","list"]);function Goe(e,t){for(let{name:i}of jL(e,"task")){if(Hoe.has(i))return Pl(!0,t);if(Woe.has(i))return Pl(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:Zoe.has(r)?Pl(!0,t.slice(1)):Voe.has(r)?Pl(!1,t.slice(1)):t.length===1?Pl(!1,t):Pl(!0,t)}function Pl(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function Koe(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function Qoe(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function Yoe(e){for(let{name:t}of jL(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function Xoe({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*ese(e){for(let t of e){let r=Xoe(t),i=r&&Qoe(t.value);i&&(yield{...i,scope:r})}}function tse(e,t,r){let i={read:[],write:[...ese(t)]};return e==="config"&&rse(i,Yoe(t),Goe(t,r)),i}function rse(e,t,r){if(r===null)return;let i=Koe(t,r);r.isWrite?e.write.push(i):e.read.push(i)}var NL={short:new Map([["c",!0]])},nse={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...NL.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},ise={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},ose={short:new Map,long:new Set};function sse(e){let t=ise[e??""]??ose;return{short:new Map([...NL.short.entries(),...t.short.entries()]),long:t.long}}function zL(e,t=nse){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let i=e.slice(2);return[{name:e,needsNext:t.long.has(i)}]}if(e.length===2){let r=e.charAt(1),i=t.short.get(r);return[{name:e,needsNext:i===!0}]}return ase(e,t.short)}function ase(e,t){let r=e.slice(1).split(""),i=[];for(let n=0;n<r.length;n++){let o=r[n],s=t.get(o);if(s===void 0)return[{name:e,needsNext:!1}];if(s){let c=r.slice(n+1).join("");if(c&&![...c].every((u)=>t.has(u)))return i.push({name:`-${o}`,value:c,needsNext:!1}),i}i.push({name:`-${o}`,needsNext:s})}return i}function cse(e,t=[]){let r=0;for(;r<e.length;){let i=String(e[r]);if(!i.startsWith("-")||i.length<2)break;let n=zL(i),o=r+1;for(let s of n){let c={name:s.name,value:s.value,absorbedNext:!1,isGlobal:!0};s.needsNext&&c.value===void 0&&o<e.length&&(c.value=String(e[o]),c.absorbedNext=!0,o++),t.push(c)}r=o}return{flags:t,taskIndex:r}}function use(e,t,r=[]){let i=sse(t),n=[],o=[],s=0;for(;s<e.length;){let c=e[s];if(fi(c)){o.push(...Cl(c)),s++;continue}let u=String(c);if(u==="--"){for(let m=s+1;m<e.length;m++){let f=e[m];fi(f)?o.push(...Cl(f)):o.push(String(f))}break}if(!u.startsWith("-")||u.length<2){n.push(u),s++;continue}let l=zL(u,i),p=s+1;for(let m of l){let f={name:m.name,value:m.value,absorbedNext:!1,isGlobal:!1};m.needsNext&&f.value===void 0&&p<e.length&&!fi(e[p])&&(f.value=String(e[p]),f.absorbedNext=!0,p++),r.push(f)}s=p}return{flags:r,positionals:n,pathspecs:o}}function*lse({write:e}){for(let t of e)for(let r of pse){let i=r(t.key);i&&(yield i)}}function hi(e,t,r=String(e)){let i=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(n){if(i.test(n))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function gi(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return hi(r,t,e)}var pse=[hi("alias","allowUnsafeAlias"),hi("core.askPass","allowUnsafeAskPass"),hi("core.editor","allowUnsafeEditor"),hi("core.fsmonitor","allowUnsafeFsMonitor"),hi("core.gitProxy","allowUnsafeGitProxy"),hi("core.hooksPath","allowUnsafeHooksPath"),hi("core.pager","allowUnsafePager"),hi("core.sshCommand","allowUnsafeSshCommand"),gi("credential.helper","allowUnsafeCredentialHelper"),gi("diff.command","allowUnsafeDiffExternal"),hi("diff.external","allowUnsafeDiffExternal"),gi("diff.textconv","allowUnsafeDiffTextConv"),gi("filter.clean","allowUnsafeFilter"),gi("filter.smudge","allowUnsafeFilter"),gi("gpg.program","allowUnsafeGpgProgram"),hi("init.templateDir","allowUnsafeTemplateDir"),gi("merge.driver","allowUnsafeMergeDriver"),gi("mergetool.path","allowUnsafeMergeDriver"),gi("mergetool.cmd","allowUnsafeMergeDriver"),gi("protocol.allow","allowUnsafeProtocolOverride"),gi("remote.receivepack","allowUnsafePack"),gi("remote.uploadpack","allowUnsafePack"),hi("sequence.editor","allowUnsafeEditor")];function*dse(e,t){for(let r of t)for(let i of mse){let n=i(e,r.name);n&&(yield n)}}function hm(e,t,r,i=String(t)){let n=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,o=`Use of ${e?`${e} with option `:""}${i} is not permitted without enabling ${r}`;return function(s,c){if((!e||s===e)&&n.test(c))return{category:r,message:o}}}var mse=[hm(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),hm("clone",/^-\w*u/,"allowUnsafePack"),hm("clone","--u","allowUnsafePack"),hm("push","--exec","allowUnsafePack"),hm(null,"--template","allowUnsafeTemplateDir")];function LL(e,t,r){return[...dse(e,t),...lse(r)]}function fse(...e){let{flags:t,taskIndex:r}=cse(e),i=r<e.length?String(e[r]).toLowerCase():null,n=i!==null?e.slice(r+1):[],{positionals:o,pathspecs:s}=use(n,i,t),c=tse(i,t,o);return{task:i,flags:t.map(hse),paths:s,config:c,vulnerabilities:gse(LL(i,t,c))}}function gse(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function hse({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}var BL={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*yse(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let i=e[`git_config_key_${r}`],n=e[`git_config_value_${r}`];i!==void 0&&(yield{key:i.toLowerCase().trim(),value:n,scope:"env"})}}function*bse(e){for(let t of Object.keys(e))if(UL(t)){let r=BL[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function UL(e){return Object.hasOwn(BL,e)}function xse(e){let t={};for(let[r,i]of Object.entries(e)){let n=r.toLowerCase().trim();(UL(n)||n.startsWith("git"))&&(t[n]=String(i))}return t}function Sse(e){let t=xse(e),r={read:[],write:[...yse(t)]},i=[...bse(t),...LL(null,[],r)];return{config:r,vulnerabilities:i}}function qL(e,t){return[...fse(...e).vulnerabilities,...Sse(t).vulnerabilities]}var Rl=Rs(RR(),1);import{EventEmitter as Sue}from"events";var{defineProperty:KR,getOwnPropertyDescriptor:vse,getOwnPropertyNames:QR}=Object,wse=Object.prototype.hasOwnProperty,fe=(e,t)=>function(){return e&&(t=(0,e[QR(e)[0]])(e=0)),t},kse=(e,t)=>function(){return t||(0,e[QR(e)[0]])((t={exports:{}}).exports,t),t.exports},lr=(e,t)=>{for(var r in t)KR(e,r,{get:t[r],enumerable:!0})},Ise=(e,t,r,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let n of QR(t))if(!wse.call(e,n)&&n!==r)KR(e,n,{get:()=>t[n],enumerable:!(i=vse(t,n))||i.enumerable})}return e},ir=(e)=>Ise(KR({},"__esModule",{value:!0}),e),Fo,Zs=fe({"src/lib/errors/git-error.ts"(){Fo=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Sm,Ol=fe({"src/lib/errors/git-response-error.ts"(){Zs(),Sm=class extends Fo{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),v1,w1=fe({"src/lib/errors/task-configuration-error.ts"(){Zs(),v1=class extends Fo{constructor(e){super(void 0,e)}}}});function k1(e){if(typeof e!=="function")return pc;return e}function I1(e){return typeof e==="function"&&e!==pc}function T1(e,t){let r=e.indexOf(t);if(r<=0)return[e,""];return[e.substr(0,r),e.substr(r+1)]}function E1(e,t=0){return C1(e)&&e.length>t?e[t]:void 0}function lc(e,t=0){if(C1(e)&&e.length>t)return e[e.length-1-t]}function C1(e){return rb(e)}function vm(e="",t=!0,r=`
|
|
153
153
|
`){return e.split(r).reduce((i,n)=>{let o=t?n.trim():n;if(o)i.push(o);return i},[])}function YR(e,t){return vm(e,!0).map((r)=>t(r))}function XR(e){return Yy.exists(e,Yy.FOLDER)}function yi(e,t){if(Array.isArray(e)){if(!e.includes(t))e.push(t)}else e.add(t);return t}function P1(e,t){if(Array.isArray(e)&&!e.includes(t))e.push(t);return e}function Xy(e,t){if(Array.isArray(e)){let r=e.indexOf(t);if(r>=0)e.splice(r,1)}else e.delete(t);return t}function so(e){return Array.isArray(e)?e:[e]}function R1(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Dl(e){return so(e).map((t)=>t instanceof String?t:String(t))}function At(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function bm(e,t){let r=[];for(let i=0,n=e.length;i<n;i++)r.push(t,e[i]);return r}function xm(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function A1(e,t){let r={};return t.forEach((i)=>{if(e[i]!==void 0)r[i]=e[i]}),r}function $R(e=0){return new Promise((t)=>setTimeout(t,e))}function jR(e){if(e===!1)return;return e}var Al,pc,wm,eb=fe({"src/lib/utils/util.ts"(){eA(),Al="\x00",pc=()=>{},wm=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Gr(e,t,r){if(t(e))return e;return arguments.length>2?r:void 0}function NR(e,t){let r=fi(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function tb(e){return!!e&&wm(e)==="[object Object]"}function _1(e){return typeof e==="function"}var km,O1,Qt,Vy,rb,eA=fe({"src/lib/utils/argument-filters.ts"(){eb(),km=(e)=>Array.isArray(e),O1=(e)=>typeof e==="number",Qt=(e)=>typeof e==="string"||fi(e),Vy=(e)=>Qt(e)||Array.isArray(e)&&e.every(Qt),rb=(e)=>{if(e==null||"number|boolean|function".includes(typeof e))return!1;return typeof e.length==="number"}}}),zR,Tse=fe({"src/lib/utils/exit-codes.ts"(){zR=((e)=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(zR||{})}}),Gy,Ese=fe({"src/lib/utils/git-output-streams.ts"(){Gy=class e{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function Cse(){throw Error("LineParser:useMatches not implemented")}var Ye,Ws,Pse=fe({"src/lib/utils/line-parser.ts"(){Ye=class{constructor(e,t){if(this.matches=[],this.useMatches=Cse,this.parse=(r,i)=>{if(this.resetMatches(),!this._regExp.every((n,o)=>this.addMatch(n,o,r(o))))return!1;return this.useMatches(i,this.prepareMatches())!==!1},this._regExp=Array.isArray(e)?e:[e],t)this.useMatches=t}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let i=r&&e.exec(r);if(i)this.pushMatch(t,i);return!!i}pushMatch(e,t){this.matches.push(...t.slice(1))}},Ws=class extends Ye{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){if(e>0||t.length>1)super.pushMatch(e,t)}}}});function D1(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...M1},...e.filter((i)=>typeof i==="object"&&i));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var M1,Rse=fe({"src/lib/utils/simple-git-options.ts"(){M1={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function tA(e,t=[]){if(!tb(e))return t;return Object.keys(e).reduce((r,i)=>{let n=e[i];if(fi(n))r.push(n);else if(NR(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n)){for(let o of n)if(!NR(o,["string","number"]))r.push(i+"="+o)}else r.push(i);return r},t)}function mn(e,t=0,r=!1){let i=[];for(let n=0,o=t<0?e.length:t;n<o;n++)if("string|number".includes(typeof e[n]))i.push(String(e[n]));if(tA(rA(e),i),!r)i.push(...Ase(e));return i}function Ase(e){let t=typeof lc(e)==="function";return Dl(Gr(lc(e,t?1:0),km,[]))}function rA(e){let t=_1(lc(e));return Gr(lc(e,t?1:0),tb)}function Lt(e,t=!0){let r=k1(lc(e));return t||I1(r)?r:void 0}var _se=fe({"src/lib/utils/task-options.ts"(){eA(),eb()}});function LR(e,t){return e(t.stdOut,t.stdErr)}function _n(e,t,r,i=!0){return so(r).forEach((n)=>{for(let o=vm(n,i),s=0,c=o.length;s<c;s++){let u=(l=0)=>{if(s+l>=c)return;return o[s+l]};t.some(({parse:l})=>l(u,e))}}),e}var Ose=fe({"src/lib/utils/task-parser.ts"(){eb()}}),F1={};lr(F1,{ExitCodes:()=>zR,GitOutputStreams:()=>Gy,LineParser:()=>Ye,NOOP:()=>pc,NULL:()=>Al,RemoteLineParser:()=>Ws,append:()=>yi,appendTaskOptions:()=>tA,asArray:()=>so,asCamelCase:()=>R1,asFunction:()=>k1,asNumber:()=>At,asStringArray:()=>Dl,bufferToString:()=>xm,callTaskParser:()=>LR,createInstanceConfig:()=>D1,delay:()=>$R,filterArray:()=>km,filterFunction:()=>_1,filterHasLength:()=>rb,filterNumber:()=>O1,filterPlainObject:()=>tb,filterPrimitives:()=>NR,filterString:()=>Qt,filterStringOrStringArray:()=>Vy,filterType:()=>Gr,first:()=>E1,folderExists:()=>XR,forEachLineWithContent:()=>YR,getTrailingOptions:()=>mn,including:()=>P1,isUserFunction:()=>I1,last:()=>lc,objectToString:()=>wm,orVoid:()=>jR,parseStringResponse:()=>_n,pick:()=>A1,prefixedArray:()=>bm,remove:()=>Xy,splitOn:()=>T1,toLinesWithContent:()=>vm,trailingFunctionArgument:()=>Lt,trailingOptionsArgument:()=>rA});var We=fe({"src/lib/utils/index.ts"(){eA(),Tse(),Ese(),Pse(),Rse(),_se(),Ose(),eb()}}),$1={};lr($1,{CheckRepoActions:()=>BR,checkIsBareRepoTask:()=>N1,checkIsRepoRootTask:()=>j1,checkIsRepoTask:()=>Dse});function Dse(e){switch(e){case"bare":return N1();case"root":return j1()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:nb,parser:nA}}function j1(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:nb,parser(t){return/^\.(git)?$/.test(t.trim())}}}function N1(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:nb,parser:nA}}function Mse(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var BR,nb,nA,z1=fe({"src/lib/tasks/check-is-repo.ts"(){We(),BR=((e)=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(BR||{}),nb=({exitCode:e},t,r,i)=>{if(e===128&&Mse(t))return r(Buffer.from("false"));i(t)},nA=(e)=>e.trim()==="true"}});function Fse(e,t){let r=new L1(e),i=e?U1:B1;return vm(t).forEach((n)=>{let o=n.replace(i,"");r.paths.push(o),(q1.test(o)?r.folders:r.files).push(o)}),r}var L1,B1,U1,q1,$se=fe({"src/lib/responses/CleanSummary.ts"(){We(),L1=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},B1=/^[a-z]+\s*/i,U1=/^[a-z]+\s+[a-z]+\s*/i,q1=/\/$/}}),UR={};lr(UR,{EMPTY_COMMANDS:()=>ib,adhocExecTask:()=>J1,configurationErrorTask:()=>An,isBufferTask:()=>W1,isEmptyTask:()=>Z1,straightThroughBufferTask:()=>H1,straightThroughStringTask:()=>fn});function J1(e){return{commands:ib,format:"empty",parser:e}}function An(e){return{commands:ib,format:"empty",parser(){throw typeof e==="string"?new v1(e):e}}}function fn(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function H1(e){return{commands:e,format:"buffer",parser(t){return t}}}function W1(e){return e.format==="buffer"}function Z1(e){return e.format==="empty"||!e.commands.length}var ib,or=fe({"src/lib/tasks/task.ts"(){w1(),ib=[]}}),V1={};lr(V1,{CONFIG_ERROR_INTERACTIVE_MODE:()=>iA,CONFIG_ERROR_MODE_REQUIRED:()=>oA,CONFIG_ERROR_UNKNOWN_OPTION:()=>sA,CleanOptions:()=>Jy,cleanTask:()=>G1,cleanWithOptionsTask:()=>jse,isCleanOptionsArray:()=>Nse});function jse(e,t){let{cleanMode:r,options:i,valid:n}=zse(e);if(!r)return An(oA);if(!n.options)return An(sA+JSON.stringify(e));if(i.push(...t),i.some(Use))return An(iA);return G1(r,i)}function G1(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(i){return Fse(e==="n",i)}}}function Nse(e){return Array.isArray(e)&&e.every((t)=>aA.has(t))}function zse(e){let t,r=[],i={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((n)=>{if(Lse(n))t=n,i.cleanMode=!0;else i.options=i.options&&Bse(r[r.length]=`-${n}`)}),{cleanMode:t,options:r,valid:i}}function Lse(e){return e==="f"||e==="n"}function Bse(e){return/^-[a-z]$/i.test(e)&&aA.has(e.charAt(1))}function Use(e){if(/^-[^\-]/.test(e))return e.indexOf("i")>0;return e==="--interactive"}var iA,oA,sA,Jy,aA,K1=fe({"src/lib/tasks/clean.ts"(){$se(),We(),or(),iA="Git clean interactive mode is not supported",oA='Git clean mode parameter ("n" or "f") is required',sA="Git clean unknown option found in: ",Jy=((e)=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Jy||{}),aA=new Set(["i",...Dl(Object.values(Jy))])}});function qse(e){let t=new Y1;for(let r of Q1(e))t.addValue(r.file,String(r.key),r.value);return t}function Jse(e,t){let r=null,i=[],n=new Map;for(let o of Q1(e,t)){if(o.key!==t)continue;if(i.push(r=o.value),!n.has(o.file))n.set(o.file,[]);n.get(o.file).push(r)}return{key:t,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function Hse(e){return e.replace(/^(file):/,"")}function*Q1(e,t=null){let r=e.split("\x00");for(let i=0,n=r.length-1;i<n;){let o=Hse(r[i++]),s=r[i++],c=t;if(s.includes(`
|
|
154
154
|
`)){let u=T1(s,`
|
|
155
155
|
`);c=u[0],s=u[1]}yield{file:o,key:c,value:s}}}var Y1,Wse=fe({"src/lib/responses/ConfigList.ts"(){We(),Y1=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){if(!this._all)this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{});return this._all}addFile(e){if(!(e in this.values)){let t=lc(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let i=this.addFile(e);if(!Object.hasOwn(i,t))i[t]=r;else if(Array.isArray(i[t]))i[t].push(r);else i[t]=[i[t],r];this._all=void 0}}}});function AR(e,t){if(typeof e==="string"&&Object.hasOwn(qR,e))return e;return t}function Zse(e,t,r,i){let n=["config",`--${i}`];if(r)n.push("--add");return n.push(e,t),{commands:n,format:"utf-8",parser(o){return o}}}function Vse(e,t){let r=["config","--null","--show-origin","--get-all",e];if(t)r.splice(1,0,`--${t}`);return{commands:r,format:"utf-8",parser(i){return Jse(i,e)}}}function Gse(e){let t=["config","--list","--show-origin","--null"];if(e)t.push(`--${e}`);return{commands:t,format:"utf-8",parser(r){return qse(r)}}}function Kse(){return{addConfig(e,t,...r){return this._runTask(Zse(e,t,r[0]===!0,AR(r[1],"local")),Lt(arguments))},getConfig(e,t){return this._runTask(Vse(e,AR(t,void 0)),Lt(arguments))},listConfig(...e){return this._runTask(Gse(AR(e[0],void 0)),Lt(arguments))}}}var qR,X1=fe({"src/lib/tasks/config.ts"(){Wse(),We(),qR=((e)=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(qR||{})}});function Qse(e){return eB.has(e)}var _R,eB,tB=fe({"src/lib/tasks/diff-name-status.ts"(){_R=((e)=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(_R||{}),eB=new Set(Object.values(_R))}});function Yse(...e){return new nB().param(...e)}function Xse(e){let t=new Set,r={};return YR(e,(i)=>{let[n,o,s]=i.split(Al);t.add(n),(r[n]=r[n]||[]).push({line:At(o),path:n,preview:s})}),{paths:t,results:r}}function eae(){return{grep(e){let t=Lt(arguments),r=mn(arguments);for(let n of rB)if(r.includes(n))return this._runTask(An(`git.grep: use of "${n}" is not supported.`),t);if(typeof e==="string")e=Yse().param(e);let i=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:i,format:"utf-8",parser(n){return Xse(n)}},t)}}}var rB,ym,JL,nB,iB=fe({"src/lib/tasks/grep.ts"(){We(),or(),rB=["-h"],ym=Symbol("grepQuery"),nB=class{constructor(){this[JL]=[]}*[(JL=ym,Symbol.iterator)](){for(let e of this[ym])yield e}and(...e){return e.length&&this[ym].push("--and","(",...bm(e,"-e"),")"),this}param(...e){return this[ym].push(...bm(e,"-e")),this}}}}),oB={};lr(oB,{ResetMode:()=>Hy,getResetMode:()=>rae,resetTask:()=>tae});function tae(e,t){let r=["reset"];if(sB(e))r.push(`--${e}`);return r.push(...t),fn(r)}function rae(e){if(sB(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}return}function sB(e){return typeof e==="string"&&aB.includes(e)}var Hy,aB,cB=fe({"src/lib/tasks/reset.ts"(){We(),or(),Hy=((e)=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Hy||{}),aB=Dl(Object.values(Hy))}});function nae(){return Ky.default("simple-git")}function HL(e,t,r){if(!t||!String(t).replace(/\s*/,""))return!r?e:(i,...n)=>{e(i,...n),r(i,...n)};return(i,...n)=>{if(e(`%s ${i}`,t,...n),r)r(i,...n)}}function iae(e,t,{namespace:r}){if(typeof e==="string")return e;let i=t&&t.namespace||"";if(i.startsWith(r))return i.substr(r.length+1);return i||r}function cA(e,t,r,i=nae()){let n=e&&`[${e}]`||"",o=[],s=typeof t==="string"?i.extend(t):t,c=iae(Gr(t,Qt),s,i);return l(r);function u(p,m){return yi(o,cA(e,c.replace(/^[^:]+/,p),m,i))}function l(p){let m=p&&`[${p}]`||"",f=s&&HL(s,m)||pc,g=HL(i,`${n} ${m}`,f);return Object.assign(s?f:g,{label:e,sibling:u,info:g,step:l})}}var uB=fe({"src/lib/git-logger.ts"(){We(),Ky.default.formatters.L=(e)=>String(rb(e)?e.length:"-"),Ky.default.formatters.B=(e)=>{if(Buffer.isBuffer(e))return e.toString("utf8");return wm(e)}}}),lB,oae=fe({"src/lib/runners/tasks-pending-queue.ts"(){Zs(),uB(),lB=class e{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=e.getName(t.commands[0]),i=cA(this.logLabel,r);return{task:t,logger:i,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:i}]of Array.from(this._queue.entries())){if(r===t.task)i.info("Failed %o",t),i("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted");else i.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message);this.complete(r)}if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){if(this.withProgress(t))this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new Fo(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function uc(e,t){return{method:E1(e.commands)||"",commands:t}}function aae(e,t){return(r)=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function WL(e,t,r,i){return(n)=>{r("%s received %L bytes",t,n),i("%B",n),e.push(n)}}var JR,cae=fe({"src/lib/runners/git-executor-chain.ts"(){Zs(),or(),We(),oae(),JR=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new lB}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:i}=this._queue.attempt(e);return await(Z1(e)?this.attemptEmptyTask(e,i):this.attemptRemoteTask(e,i))}catch(i){throw this.onFatalException(e,i)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof Fo?Object.assign(t,{task:e}):new Fo(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",uc(e,e.commands)),i=this._plugins.exec("spawn.args",[...e.commands],{...uc(e,e.commands),env:{...this.env}}),n=await this.gitResponse(e,r,i,this.outputHandler,t.step("SPAWN")),o=await this.handleTaskData(e,i,n,t.step("HANDLE"));if(t("passing response to task's parser as a %s",e.format),W1(e))return LR(e.parser,o);return LR(e.parser,o.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,i){let{exitCode:n,rejection:o,stdOut:s,stdErr:c}=r;return new Promise((u,l)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:p}=this._plugins.exec("task.error",{error:o},{...uc(e,t),...r});if(p&&e.onError)return i.info("exitCode=%s handling with custom error handler"),e.onError(r,p,(m)=>{i.info("custom error handler treated as success"),i("custom error returned a %s",wm(m)),u(new Gy(Array.isArray(m)?Buffer.concat(m):m,Buffer.concat(c)))},l);if(p)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,c.length,o),l(p);i.info("retrieving task output complete"),u(new Gy(Buffer.concat(s),Buffer.concat(c)))})}async gitResponse(e,t,r,i,n){let o=n.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},uc(e,e.commands));return new Promise((c)=>{let u=[],l=[];n.info("%s %o",t,r),n("%O",s);let p=this._beforeSpawn(e,r);if(p)return c({stdOut:u,stdErr:l,exitCode:9901,rejection:p});this._plugins.exec("spawn.before",void 0,{...uc(e,r),kill(f){p=f||p}});let m=sae(t,r,s);if(m.stdout.on("data",WL(u,"stdOut",n,o.step("stdOut"))),m.stderr.on("data",WL(l,"stdErr",n,o.step("stdErr"))),m.on("error",aae(l,n)),i)n("Passing child process stdOut/stdErr to custom outputHandler"),i(t,m.stdout,m.stderr,[...r]);this._plugins.exec("spawn.after",void 0,{...uc(e,r),spawned:m,close(f,g){c({stdOut:u,stdErr:l,exitCode:f,rejection:p||g})},kill(f){if(m.killed)return;p=f,m.kill("SIGINT")}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...uc(e,t),kill(i){r=i||r}}),r}}}}),pB={};lr(pB,{GitExecutor:()=>dB});var dB,uae=fe({"src/lib/runners/git-executor.ts"(){cae(),dB=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new JR(this,this._scheduler,this._plugins)}chain(){return new JR(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function lae(e,t,r=pc){let i=(o)=>{r(null,o)},n=(o)=>{if(o?.task===e)r(o instanceof Sm?pae(o):o,void 0)};t.then(i,n)}function pae(e){let t=(i)=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),t=pc};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(i,n){if(n in e)return i;return i[n]={enumerable:!1,configurable:!1,get(){return t(n),e.git[n]}},i}}var dae=fe({"src/lib/task-callback.ts"(){Ol(),We()}});function ZL(e,t){return J1((r)=>{if(!XR(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var mae=fe({"src/lib/tasks/change-working-directory.ts"(){We(),or()}});function OR(e){let t=["checkout",...e];if(t[1]==="-b"&&t.includes("-B"))t[1]=Xy(t,"-B");return fn(t)}function fae(){return{checkout(){return this._runTask(OR(mn(arguments,1)),Lt(arguments))},checkoutBranch(e,t){return this._runTask(OR(["-b",e,t,...mn(arguments)]),Lt(arguments))},checkoutLocalBranch(e){return this._runTask(OR(["-b",e,...mn(arguments)]),Lt(arguments))}}}var gae=fe({"src/lib/tasks/checkout.ts"(){We(),or()}});function hae(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function yae(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return _n(hae(),[mB],e)}})}}}var mB,bae=fe({"src/lib/tasks/count-objects.ts"(){We(),mB=new Ye(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let i=R1(t);if(Object.hasOwn(e,i))e[i]=At(r)})}});function xae(e){return _n({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},fB,e)}var fB,Sae=fe({"src/lib/parsers/parse-commit.ts"(){We(),fB=[new Ye(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,i])=>{e.branch=t,e.commit=i,e.root=!!r}),new Ye(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),i=r.pop();if(!i||!i.includes("@"))return;e.author={email:i.substr(0,i.length-1),name:r.join("<").trim()}}),new Ye(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,i])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(i,10)||0}),new Ye(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,i])=>{e.summary.changes=parseInt(t,10)||0;let n=parseInt(r,10)||0;if(i==="-")e.summary.deletions=n;else if(i==="+")e.summary.insertions=n})]}});function vae(e,t,r){return{commands:["-c","core.abbrev=40","commit",...bm(e,"-m"),...t,...r],format:"utf-8",parser:xae}}function wae(){return{commit(t,...r){let i=Lt(arguments),n=e(t)||vae(so(t),so(Gr(r[0],Vy,[])),[...Dl(Gr(r[1],km,[])),...mn(arguments,0,!0)]);return this._runTask(n,i)}};function e(t){return!Vy(t)&&An("git.commit: requires the commit message to be supplied as a string/string[]")}}var kae=fe({"src/lib/tasks/commit.ts"(){Sae(),We(),or()}});function Iae(){return{firstCommit(){return this._runTask(fn(["rev-list","--max-parents=0","HEAD"],!0),Lt(arguments))}}}var Tae=fe({"src/lib/tasks/first-commit.ts"(){We(),or()}});function Eae(e,t){let r=["hash-object",e];if(t)r.push("-w");return fn(r,!0)}var Cae=fe({"src/lib/tasks/hash-object.ts"(){or()}});function Pae(e,t,r){let i=String(r).trim(),n;if(n=gB.exec(i))return new Wy(e,t,!1,n[1]);if(n=hB.exec(i))return new Wy(e,t,!0,n[1]);let o="",s=i.split(" ");while(s.length)if(s.shift()==="in"){o=s.join(" ");break}return new Wy(e,t,/^re/i.test(i),o)}var Wy,gB,hB,Rae=fe({"src/lib/responses/InitSummary.ts"(){Wy=class{constructor(e,t,r,i){this.bare=e,this.path=t,this.existing=r,this.gitDir=i}},gB=/^Init.+ repository in (.+)$/,hB=/^Rein.+ in (.+)$/}});function Aae(e){return e.includes(uA)}function _ae(e=!1,t,r){let i=["init",...r];if(e&&!Aae(i))i.splice(1,0,uA);return{commands:i,format:"utf-8",parser(n){return Pae(i.includes("--bare"),t,n)}}}var uA,Oae=fe({"src/lib/tasks/init.ts"(){Rae(),uA="--bare"}});function lA(e){for(let t=0;t<e.length;t++){let r=pA.exec(e[t]);if(r)return`--${r[1]}`}return""}function Dae(e){return pA.test(e)}var pA,Im=fe({"src/lib/args/log-format.ts"(){pA=/^--(stat|numstat|name-only|name-status)(=|$)/}}),yB,Mae=fe({"src/lib/responses/DiffSummary.ts"(){yB=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function bB(e=""){let t=xB[e];return(r)=>_n(new yB,t,r,!1)}var DR,VL,GL,KL,xB,SB=fe({"src/lib/parsers/parse-diff-summary.ts"(){Im(),Mae(),tB(),We(),DR=[new Ye(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,i=""])=>{e.files.push({file:t.trim(),changes:At(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new Ye(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,i])=>{e.files.push({file:t.trim(),before:At(r),after:At(i),binary:!0})}),new Ye(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);e.changed=At(t),e.insertions=At(i?.[1]),e.deletions=At(n?.[1])})],VL=[new Ye(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,i])=>{let n=At(t),o=At(r);e.changed++,e.insertions+=n,e.deletions+=o,e.files.push({file:i,changes:n+o,insertions:n,deletions:o,binary:!1})}),new Ye(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],GL=[new Ye(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],KL=[new Ye(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,i,n,o])=>{e.changed++,e.files.push({file:o??i,changes:0,insertions:0,deletions:0,binary:!1,status:jR(Qse(t)&&t),from:jR(!!o&&i!==o&&i),similarity:At(r)})})],xB={[""]:DR,["--stat"]:DR,["--numstat"]:VL,["--name-status"]:KL,["--name-only"]:GL}}});function Fae(e,t){return t.reduce((r,i,n)=>(r[i]=e[n]||"",r),Object.create({diff:null}))}function vB(e=fA,t=wB,r=""){let i=bB(r);return function(n){let o=vm(n.trim(),!1,dA).map(function(s){let c=s.split(mA),u=Fae(c[0].split(e),t);if(c.length>1&&!!c[1].trim())u.diff=i(c[1]);return u});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var dA,mA,fA,wB,kB=fe({"src/lib/parsers/parse-list-log-summary.ts"(){We(),SB(),Im(),dA="\xF2\xF2\xF2\xF2\xF2\xF2 ",mA=" \xF2\xF2",fA=" \xF2 ",wB=["hash","date","message","refs","author_name","author_email"]}}),IB={};lr(IB,{diffSummaryTask:()=>$ae,validateLogFormatConfig:()=>ob});function $ae(e){let t=lA(e),r=["diff"];if(t==="")t="--stat",r.push("--stat=4096");return r.push(...e),ob(r)||{commands:r,format:"utf-8",parser:bB(t)}}function ob(e){let t=e.filter(Dae);if(t.length>1)return An(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return An(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var gA=fe({"src/lib/tasks/diff.ts"(){Im(),SB(),or()}});function jae(e,t){let r=[],i=[];return Object.keys(e).forEach((n)=>{r.push(n),i.push(String(e[n]))}),[r,i.join(t)]}function Nae(e){return Object.keys(e).reduce((t,r)=>{if(!(r in HR))t[r]=e[r];return t},{})}function TB(e={},t=[]){let r=Gr(e.splitter,Qt,fA),i=tb(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[n,o]=jae(i,r),s=[],c=[`--pretty=format:${dA}${o}${mA}`,...t],u=e.n||e["max-count"]||e.maxCount;if(u)c.push(`--max-count=${u}`);if(e.from||e.to){let l=e.symmetric!==!1?"...":"..";s.push(`${e.from||""}${l}${e.to||""}`)}if(Qt(e.file))c.push("--follow",El(e.file));return tA(Nae(e),c),{fields:n,splitter:r,commands:[...c,...s]}}function zae(e,t,r){let i=vB(e,t,lA(r));return{commands:["log",...r],format:"utf-8",parser:i}}function Lae(){return{log(...r){let i=Lt(arguments),n=TB(rA(arguments),Dl(Gr(arguments[0],km,[]))),o=t(...r)||ob(n.commands)||e(n);return this._runTask(o,i)}};function e(r){return zae(r.splitter,r.fields,r.commands)}function t(r,i){return Qt(r)&&Qt(i)&&An("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var HR,EB=fe({"src/lib/tasks/log.ts"(){Im(),kB(),We(),or(),gA(),HR=((e)=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(HR||{})}}),Zy,CB,Bae=fe({"src/lib/responses/MergeSummary.ts"(){Zy=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},CB=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length)return`CONFLICTS: ${this.conflicts.join(", ")}`;return"OK"}}}}),WR,PB,Uae=fe({"src/lib/responses/PullSummary.ts"(){WR=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},PB=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function MR(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function QL(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:At(t&&t[1]||"0"),delta:At(r&&r[1]||"0")}}var RB,qae=fe({"src/lib/parsers/parse-remote-objects.ts"(){We(),RB=[new Ws(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let i=t.toLowerCase(),n=MR(e.remoteMessages);Object.assign(n,{[i]:At(r)})}),new Ws(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let i=t.toLowerCase(),n=MR(e.remoteMessages);Object.assign(n,{[i]:At(r)})}),new Ws(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,i])=>{let n=MR(e.remoteMessages);n.total=QL(t),n.reused=QL(r),n.packReused=At(i)})]}});function AB(e,t){return _n({remoteMessages:new OB},_B,t)}var _B,OB,DB=fe({"src/lib/parsers/parse-remote-messages.ts"(){We(),qae(),_B=[new Ws(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...RB,new Ws([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Ws([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,i])=>{e.remoteMessages.vulnerabilities={count:At(t),summary:r,url:i}})],OB=class{constructor(){this.all=[]}}}});function Jae(e,t){let r=_n(new PB,MB,[e,t]);return r.message&&r}var YL,XL,e1,t1,MB,r1,hA,FB=fe({"src/lib/parsers/parse-pull.ts"(){Uae(),We(),DB(),YL=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,XL=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,e1=/^(create|delete) mode \d+ (.+)/,t1=[new Ye(YL,(e,[t,r,i])=>{if(e.files.push(t),r)e.insertions[t]=r.length;if(i)e.deletions[t]=i.length}),new Ye(XL,(e,[t,,r,,i])=>{if(r!==void 0||i!==void 0)return e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+i||0,!0;return!1}),new Ye(e1,(e,[t,r])=>{yi(e.files,r),yi(t==="create"?e.created:e.deleted,r)})],MB=[new Ye(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new Ye(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new Ye(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,i,n])=>{e.branch.local=i,e.hash.local=t,e.branch.remote=n,e.hash.remote=r})],r1=(e,t)=>_n(new WR,t1,[e,t]),hA=(e,t)=>Object.assign(new WR,r1(e,t),AB(e,t))}}),n1,$B,i1,Hae=fe({"src/lib/parsers/parse-merge.ts"(){Bae(),We(),FB(),n1=[new Ye(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new Ye(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Zy(t,r))}),new Ye(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,i])=>{e.conflicts.push(new Zy(t,r,{deleteRef:i}))}),new Ye(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Zy(t,null))}),new Ye(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],$B=(e,t)=>Object.assign(i1(e,t),hA(e,t)),i1=(e)=>_n(new CB,n1,e)}});function o1(e){if(!e.length)return An("Git.merge requires at least one option");return{commands:["merge",...e],format:"utf-8",parser(t,r){let i=$B(t,r);if(i.failed)throw new Sm(i);return i}}}var Wae=fe({"src/lib/tasks/merge.ts"(){Ol(),Hae(),or()}});function Zae(e,t,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!o,alreadyUpdated:o,local:e,remote:t}}var s1,jB,a1,Vae=fe({"src/lib/parsers/parse-push.ts"(){We(),DB(),s1=[new Ye(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new Ye(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new Ye(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,i])=>{e.pushed.push(Zae(t,r,i))}),new Ye(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,i])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:i}}),new Ye(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,i,n])=>{e.update={head:{local:t,remote:r},hash:{from:i,to:n}}})],jB=(e,t)=>{let r=a1(e,t),i=AB(e,t);return{...r,...i}},a1=(e,t)=>_n({pushed:[]},s1,[e,t])}}),NB={};lr(NB,{pushTagsTask:()=>Gae,pushTask:()=>yA});function Gae(e={},t){return yi(t,"--tags"),yA(e,t)}function yA(e={},t){let r=["push",...t];if(e.branch)r.splice(1,0,e.branch);if(e.remote)r.splice(1,0,e.remote);return Xy(r,"-v"),yi(r,"--verbose"),yi(r,"--porcelain"),{commands:r,format:"utf-8",parser:jB}}var zB=fe({"src/lib/tasks/push.ts"(){Vae(),We()}});function Kae(){return{showBuffer(){let e=["show",...mn(arguments,1)];if(!e.includes("--binary"))e.splice(1,0,"--binary");return this._runTask(H1(e),Lt(arguments))},show(){let e=["show",...mn(arguments,1)];return this._runTask(fn(e),Lt(arguments))}}}var Qae=fe({"src/lib/tasks/show.ts"(){We(),or()}}),c1,LB,Yae=fe({"src/lib/responses/FileStatusSummary.ts"(){c1=/^(.+)\0(.+)$/,LB=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let i=c1.exec(e)||[null,e,e];this.from=i[2]||"",this.path=i[1]||""}}}}});function u1(e){let[t,r]=e.split(Al);return{from:r||t,to:t}}function Vn(e,t,r){return[`${e}${t}`,r]}function FR(e,...t){return t.map((r)=>Vn(e,r,(i,n)=>i.conflicted.push(n)))}function Xae(e,t){let r=t.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return i(" ",r.charAt(0),r.slice(2));default:return}function i(n,o,s){let c=`${n}${o}`,u=BB.get(c);if(u)u(e,s);if(c!=="##"&&c!=="!!")e.files.push(new LB(s,n,o))}}var l1,BB,UB,ece=fe({"src/lib/responses/StatusSummary.ts"(){We(),Yae(),l1=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},BB=new Map([Vn(" ","A",(e,t)=>e.created.push(t)),Vn(" ","D",(e,t)=>e.deleted.push(t)),Vn(" ","M",(e,t)=>e.modified.push(t)),Vn("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),Vn("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Vn("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Vn("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Vn("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Vn("R"," ",(e,t)=>{e.renamed.push(u1(t))}),Vn("R","M",(e,t)=>{let r=u1(t);e.renamed.push(r),e.modified.push(r.to)}),Vn("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Vn("?","?",(e,t)=>e.not_added.push(t)),...FR("A","A","U"),...FR("D","D","U"),...FR("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,s=/\son\s(\S+?)(?=\.{3}|$)/,c=r.exec(t);if(e.ahead=c&&+c[1]||0,c=i.exec(t),e.behind=c&&+c[1]||0,c=n.exec(t),e.current=Gr(c?.[1],Qt,null),c=o.exec(t),e.tracking=Gr(c?.[1],Qt,null),c=s.exec(t),c)e.current=Gr(c?.[1],Qt,e.current);e.detached=/\(no branch\)/.test(t)}]]),UB=function(e){let t=e.split(Al),r=new l1;for(let i=0,n=t.length;i<n;){let o=t[i++].trim();if(!o)continue;if(o.charAt(0)==="R")o+=Al+(t[i++]||"");Xae(r,o)}return r}}});function tce(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter((r)=>!qB.includes(r))],parser(r){return UB(r)}}}var qB,rce=fe({"src/lib/tasks/status.ts"(){ece(),qB=["--null","-z"]}});function Qy(e=0,t=0,r=0,i="",n=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function nce(){return Qy(0,0,0,"",!1)}function ice(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:oce,onError(e,t,r,i){if(e.exitCode===-2)return r(Buffer.from(bA));i(t)}})}}}function oce(e){if(e===bA)return nce();return _n(Qy(0,0,0,e),JB,e)}var bA,JB,sce=fe({"src/lib/tasks/version.ts"(){We(),bA="installed=false",JB=[new Ye(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,i,n=""])=>{Object.assign(e,Qy(At(t),At(r),At(i),n))}),new Ye(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,i,n=""])=>{Object.assign(e,Qy(At(t),At(r),i,n))})]}});function p1(e,t,r,...i){if(!Qt(r))return An(`git.${e}() requires a string 'repoPath'`);return t(r,Gr(i[0],Qt),mn(arguments))}function ace(){return{clone(e,...t){return this._runTask(p1("clone",ZR,Gr(e,Qt),...t),Lt(arguments))},mirror(e,...t){return this._runTask(p1("mirror",HB,Gr(e,Qt),...t),Lt(arguments))}}}var ZR,HB,cce=fe({"src/lib/tasks/clone.ts"(){or(),We(),ZR=(e,t,r)=>{let i=["clone",...r];return Qt(e)&&i.push(El(e)),Qt(t)&&i.push(El(t)),fn(i)},HB=(e,t,r)=>(yi(r,"--mirror"),ZR(e,t,r))}}),WB={};lr(WB,{SimpleGitApi:()=>VR});var VR,uce=fe({"src/lib/simple-git-api.ts"(){dae(),mae(),gae(),bae(),kae(),X1(),Tae(),iB(),Cae(),Oae(),EB(),Wae(),zB(),Qae(),rce(),or(),sce(),We(),cce(),VR=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),i=r.push(e);if(t)lae(e,i,t);return Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(e){return this._runTask(fn(["add",...so(e)]),Lt(arguments))}cwd(e){let t=Lt(arguments);if(typeof e==="string")return this._runTask(ZL(e,this._executor),t);if(typeof e?.path==="string")return this._runTask(ZL(e.path,e.root&&this._executor||void 0),t);return this._runTask(An("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Eae(e,t===!0),Lt(arguments))}init(e){return this._runTask(_ae(e===!0,this._executor.cwd,mn(arguments)),Lt(arguments))}merge(){return this._runTask(o1(mn(arguments)),Lt(arguments))}mergeFromTo(e,t){if(!(Qt(e)&&Qt(t)))return this._runTask(An("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"));return this._runTask(o1([e,t,...mn(arguments)]),Lt(arguments,!1))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=yA({remote:Gr(arguments[0],Qt),branch:Gr(arguments[1],Qt)},mn(arguments));return this._runTask(e,Lt(arguments))}stash(){return this._runTask(fn(["stash",...mn(arguments)]),Lt(arguments))}status(){return this._runTask(tce(mn(arguments)),Lt(arguments))}},Object.assign(VR.prototype,fae(),ace(),wae(),Kse(),yae(),Iae(),eae(),Lae(),Kae(),ice())}}),ZB={};lr(ZB,{Scheduler:()=>GB});var d1,GB,lce=fe({"src/lib/runners/scheduler.ts"(){We(),uB(),d1=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=VB.createDeferred();return{promise:t,done:r,id:e}}})(),GB=class{constructor(e=2){this.concurrency=e,this.logger=cA("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=yi(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Xy(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=yi(this.pending,d1());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),KB={};lr(KB,{applyPatchTask:()=>pce});function pce(e,t){return fn(["apply",...t,...e])}var dce=fe({"src/lib/tasks/apply-patch.ts"(){or()}});function mce(e,t){return{branch:e,hash:t,success:!0}}function fce(e){return{branch:e,hash:null,success:!1}}var QB,gce=fe({"src/lib/responses/BranchDeleteSummary.ts"(){QB=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function YB(e,t){return t===1&&GR.test(e)}var m1,GR,f1,sb,hce=fe({"src/lib/parsers/parse-branch-delete.ts"(){gce(),We(),m1=/(\S+)\s+\(\S+\s([^)]+)\)/,GR=/^error[^']+'([^']+)'/m,f1=[new Ye(m1,(e,[t,r])=>{let i=mce(t,r);e.all.push(i),e.branches[t]=i}),new Ye(GR,(e,[t])=>{let r=fce(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],sb=(e,t)=>_n(new QB,f1,[e,t])}}),XB,yce=fe({"src/lib/responses/BranchSummary.ts"(){XB=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,i,n){if(e==="*")this.detached=t,this.current=r;this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:i,label:n}}}}});function g1(e){return e?e.charAt(0):""}function eU(e,t=!1){return _n(new XB,t?[rU]:tU,e)}var tU,rU,bce=fe({"src/lib/parsers/parse-branch.ts"(){yce(),We(),tU=[new Ye(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,i,n])=>{e.push(g1(t),!0,r,i,n)}),new Ye(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,i,n])=>{e.push(g1(t),!1,r,i,n)})],rU=new Ye(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),nU={};lr(nU,{branchLocalTask:()=>Sce,branchTask:()=>xce,containsDeleteBranchCommand:()=>iU,deleteBranchTask:()=>wce,deleteBranchesTask:()=>vce});function iU(e){let t=["-d","-D","--delete"];return e.some((r)=>t.includes(r))}function xce(e){let t=iU(e),r=e.includes("--show-current"),i=["branch",...e];if(i.length===1)i.push("-a");if(!i.includes("-v"))i.splice(1,0,"-v");return{format:"utf-8",commands:i,parser(n,o){if(t)return sb(n,o).all[0];return eU(n,r)}}}function Sce(){return{format:"utf-8",commands:["branch","-v"],parser(e){return eU(e)}}}function vce(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,i){return sb(r,i)},onError({exitCode:r,stdOut:i},n,o,s){if(!YB(String(n),r))return s(n);o(i)}}}function wce(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(i,n){return sb(i,n).branches[e]},onError({exitCode:i,stdErr:n,stdOut:o},s,c,u){if(!YB(String(s),i))return u(s);throw new Sm(r.parser(xm(o),xm(n)),String(s))}};return r}var kce=fe({"src/lib/tasks/branch.ts"(){Ol(),hce(),bce(),We()}});function Tce(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&Ice(t)}var oU,Ece=fe({"src/lib/responses/CheckIgnore.ts"(){oU=(e)=>e.split(/\n/g).map(Tce).filter(Boolean)}}),sU={};lr(sU,{checkIgnoreTask:()=>Cce});function Cce(e){return{commands:["check-ignore",...e],format:"utf-8",parser:oU}}var Pce=fe({"src/lib/tasks/check-ignore.ts"(){Ece()}});function Rce(e,t){return _n({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},aU,[e,t])}var aU,Ace=fe({"src/lib/parsers/parse-fetch.ts"(){We(),aU=[new Ye(/From (.+)$/,(e,[t])=>{e.remote=t}),new Ye(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new Ye(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new Ye(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new Ye(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,i,n])=>{e.updated.push({name:i,tracking:n,to:r,from:t})})]}}),cU={};lr(cU,{fetchTask:()=>Oce});function _ce(e){return/^--upload-pack(=|$)/.test(e)}function Oce(e,t,r){let i=["fetch",...r];if(e&&t)i.push(e,t);if(i.find(_ce))return An("git.fetch: potential exploit argument blocked.");return{commands:i,format:"utf-8",parser:Rce}}var Dce=fe({"src/lib/tasks/fetch.ts"(){Ace(),or()}});function Mce(e){return _n({moves:[]},uU,e)}var uU,Fce=fe({"src/lib/parsers/parse-move.ts"(){We(),uU=[new Ye(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),lU={};lr(lU,{moveTask:()=>$ce});function $ce(e,t){return{commands:["mv","-v",...so(e),t],format:"utf-8",parser:Mce}}var jce=fe({"src/lib/tasks/move.ts"(){Fce(),We()}}),pU={};lr(pU,{pullTask:()=>Nce});function Nce(e,t,r){let i=["pull",...r];if(e&&t)i.splice(1,0,e,t);return{commands:i,format:"utf-8",parser(n,o){return hA(n,o)},onError(n,o,s,c){let u=Jae(xm(n.stdOut),xm(n.stdErr));if(u)return c(new Sm(u));c(o)}}}var zce=fe({"src/lib/tasks/pull.ts"(){Ol(),FB(),We()}});function Lce(e){let t={};return dU(e,([r])=>t[r]={name:r}),Object.values(t)}function Bce(e){let t={};return dU(e,([r,i,n])=>{if(!Object.hasOwn(t,r))t[r]={name:r,refs:{fetch:"",push:""}};if(n&&i)t[r].refs[n.replace(/[^a-z]/g,"")]=i}),Object.values(t)}function dU(e,t){YR(e,(r)=>t(r.split(/\s+/)))}var Uce=fe({"src/lib/responses/GetRemoteSummary.ts"(){We()}}),mU={};lr(mU,{addRemoteTask:()=>qce,getRemotesTask:()=>Jce,listRemotesTask:()=>Hce,remoteTask:()=>Wce,removeRemoteTask:()=>Zce});function qce(e,t,r){return fn(["remote","add",...r,e,t])}function Jce(e){let t=["remote"];if(e)t.push("-v");return{commands:t,format:"utf-8",parser:e?Bce:Lce}}function Hce(e){let t=[...e];if(t[0]!=="ls-remote")t.unshift("ls-remote");return fn(t)}function Wce(e){let t=[...e];if(t[0]!=="remote")t.unshift("remote");return fn(t)}function Zce(e){return fn(["remote","remove",e])}var Vce=fe({"src/lib/tasks/remote.ts"(){Uce(),or()}}),fU={};lr(fU,{stashListTask:()=>Gce});function Gce(e={},t){let r=TB(e),i=["stash","list",...r.commands,...t],n=vB(r.splitter,r.fields,lA(i));return ob(i)||{commands:i,format:"utf-8",parser:n}}var Kce=fe({"src/lib/tasks/stash-list.ts"(){Im(),kB(),gA(),EB()}}),gU={};lr(gU,{addSubModuleTask:()=>Qce,initSubModuleTask:()=>Yce,subModuleTask:()=>ab,updateSubModuleTask:()=>Xce});function Qce(e,t){return ab(["add",e,t])}function Yce(e){return ab(["init",...e])}function ab(e){let t=[...e];if(t[0]!=="submodule")t.unshift("submodule");return fn(t)}function Xce(e){return ab(["update",...e])}var eue=fe({"src/lib/tasks/sub-module.ts"(){or()}});function tue(e,t){let r=Number.isNaN(e),i=Number.isNaN(t);if(r!==i)return r?1:-1;return r?hU(e,t):0}function hU(e,t){return e===t?0:e>t?1:-1}function rue(e){return e.trim()}function qy(e){if(typeof e==="string")return parseInt(e.replace(/^\D+/g,""),10)||0;return 0}var h1,yU,nue=fe({"src/lib/responses/TagList.ts"(){h1=class{constructor(e,t){this.all=e,this.latest=t}},yU=function(e,t=!1){let r=e.split(`
|
|
156
|
-
`).map(rue).filter(Boolean);if(!t)r.sort(function(n,o){let s=n.split("."),c=o.split(".");if(s.length===1||c.length===1)return tue(qy(s[0]),qy(c[0]));for(let u=0,l=Math.max(s.length,c.length);u<l;u++){let p=hU(qy(s[u]),qy(c[u]));if(p)return p}return 0});let i=t?r[0]:[...r].reverse().find((n)=>n.indexOf(".")>=0);return new h1(r,i)}}}),bU={};lr(bU,{addAnnotatedTagTask:()=>sue,addTagTask:()=>oue,tagListTask:()=>iue});function iue(e=[]){let t=e.some((r)=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return yU(r,t)}}}function oue(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function sue(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var aue=fe({"src/lib/tasks/tag.ts"(){nue()}}),cue=kse({"src/git.js"(e,t){var{GitExecutor:r}=(uae(),ir(pB)),{SimpleGitApi:i}=(uce(),ir(WB)),{Scheduler:n}=(lce(),ir(ZB)),{adhocExecTask:o,configurationErrorTask:s}=(or(),ir(UR)),{asArray:c,filterArray:u,filterPrimitives:l,filterString:p,filterStringOrStringArray:m,filterType:f,getTrailingOptions:g,trailingFunctionArgument:S,trailingOptionsArgument:P}=(We(),ir(F1)),{applyPatchTask:D}=(dce(),ir(KB)),{branchTask:L,branchLocalTask:Se,deleteBranchesTask:Q,deleteBranchTask:se}=(kce(),ir(nU)),{checkIgnoreTask:me}=(Pce(),ir(sU)),{checkIsRepoTask:F}=(z1(),ir($1)),{cleanWithOptionsTask:Be,isCleanOptionsArray:Te}=(K1(),ir(V1)),{diffSummaryTask:Pe}=(gA(),ir(IB)),{fetchTask:Je}=(Dce(),ir(cU)),{moveTask:Xe}=(jce(),ir(lU)),{pullTask:He}=(zce(),ir(pU)),{pushTagsTask:ge}=(zB(),ir(NB)),{addRemoteTask:xe,getRemotesTask:Me,listRemotesTask:ee,remoteTask:at,removeRemoteTask:ft}=(Vce(),ir(mU)),{getResetMode:cr,resetTask:w}=(cB(),ir(oB)),{stashListTask:zt}=(Kce(),ir(fU)),{addSubModuleTask:Fr,initSubModuleTask:I,subModuleTask:ur,updateSubModuleTask:qt}=(eue(),ir(gU)),{addAnnotatedTagTask:En,addTagTask:Hr,tagListTask:St}=(aue(),ir(bU)),{straightThroughBufferTask:ht,straightThroughStringTask:Tt}=(or(),ir(UR));function Ie(oe,Ee){this._plugins=Ee,this._executor=new r(oe.baseDir,new n(oe.maxConcurrentProcesses),Ee),this._trimmed=oe.trimmed}(Ie.prototype=Object.create(i.prototype)).constructor=Ie,Ie.prototype.customBinary=function(oe){return this._plugins.reconfigure("binary",oe),this},Ie.prototype.env=function(oe,Ee){if(arguments.length===1&&typeof oe==="object")this._executor.env=oe;else(this._executor.env=this._executor.env||{})[oe]=Ee;return this},Ie.prototype.stashList=function(oe){return this._runTask(zt(P(arguments)||{},u(oe)&&oe||[]),S(arguments))},Ie.prototype.mv=function(oe,Ee){return this._runTask(Xe(oe,Ee),S(arguments))},Ie.prototype.checkoutLatestTag=function(oe){var Ee=this;return this.pull(function(){Ee.tags(function(gt,nr){Ee.checkout(nr.latest,oe)})})},Ie.prototype.pull=function(oe,Ee,gt,nr){return this._runTask(He(f(oe,p),f(Ee,p),g(arguments)),S(arguments))},Ie.prototype.fetch=function(oe,Ee){return this._runTask(Je(f(oe,p),f(Ee,p),g(arguments)),S(arguments))},Ie.prototype.silent=function(oe){return this._runTask(o(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Ie.prototype.tags=function(oe,Ee){return this._runTask(St(g(arguments)),S(arguments))},Ie.prototype.rebase=function(){return this._runTask(Tt(["rebase",...g(arguments)]),S(arguments))},Ie.prototype.reset=function(oe){return this._runTask(w(cr(oe),g(arguments)),S(arguments))},Ie.prototype.revert=function(oe){let Ee=S(arguments);if(typeof oe!=="string")return this._runTask(s("Commit must be a string"),Ee);return this._runTask(Tt(["revert",...g(arguments,0,!0),oe]),Ee)},Ie.prototype.addTag=function(oe){let Ee=typeof oe==="string"?Hr(oe):s("Git.addTag requires a tag name");return this._runTask(Ee,S(arguments))},Ie.prototype.addAnnotatedTag=function(oe,Ee){return this._runTask(En(oe,Ee),S(arguments))},Ie.prototype.deleteLocalBranch=function(oe,Ee,gt){return this._runTask(se(oe,typeof Ee==="boolean"?Ee:!1),S(arguments))},Ie.prototype.deleteLocalBranches=function(oe,Ee,gt){return this._runTask(Q(oe,typeof Ee==="boolean"?Ee:!1),S(arguments))},Ie.prototype.branch=function(oe,Ee){return this._runTask(L(g(arguments)),S(arguments))},Ie.prototype.branchLocal=function(oe){return this._runTask(Se(),S(arguments))},Ie.prototype.raw=function(oe){let Ee=!Array.isArray(oe),gt=[].slice.call(Ee?arguments:oe,0);for(let hr=0;hr<gt.length&&Ee;hr++)if(!l(gt[hr])){gt.splice(hr,gt.length-hr);break}gt.push(...g(arguments,0,!0));var nr=S(arguments);if(!gt.length)return this._runTask(s("Raw: must supply one or more command to execute"),nr);return this._runTask(Tt(gt,this._trimmed),nr)},Ie.prototype.submoduleAdd=function(oe,Ee,gt){return this._runTask(Fr(oe,Ee),S(arguments))},Ie.prototype.submoduleUpdate=function(oe,Ee){return this._runTask(qt(g(arguments,!0)),S(arguments))},Ie.prototype.submoduleInit=function(oe,Ee){return this._runTask(I(g(arguments,!0)),S(arguments))},Ie.prototype.subModule=function(oe,Ee){return this._runTask(ur(g(arguments)),S(arguments))},Ie.prototype.listRemote=function(){return this._runTask(ee(g(arguments)),S(arguments))},Ie.prototype.addRemote=function(oe,Ee,gt){return this._runTask(xe(oe,Ee,g(arguments)),S(arguments))},Ie.prototype.removeRemote=function(oe,Ee){return this._runTask(ft(oe),S(arguments))},Ie.prototype.getRemotes=function(oe,Ee){return this._runTask(Me(oe===!0),S(arguments))},Ie.prototype.remote=function(oe,Ee){return this._runTask(at(g(arguments)),S(arguments))},Ie.prototype.tag=function(oe,Ee){let gt=g(arguments);if(gt[0]!=="tag")gt.unshift("tag");return this._runTask(Tt(gt),S(arguments))},Ie.prototype.updateServerInfo=function(oe){return this._runTask(Tt(["update-server-info"]),S(arguments))},Ie.prototype.pushTags=function(oe,Ee){let gt=ge({remote:f(oe,p)},g(arguments));return this._runTask(gt,S(arguments))},Ie.prototype.rm=function(oe){return this._runTask(Tt(["rm","-f",...c(oe)]),S(arguments))},Ie.prototype.rmKeepLocal=function(oe){return this._runTask(Tt(["rm","--cached",...c(oe)]),S(arguments))},Ie.prototype.catFile=function(oe,Ee){return this._catFile("utf-8",arguments)},Ie.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},Ie.prototype._catFile=function(oe,Ee){var gt=S(Ee),nr=["cat-file"],hr=Ee[0];if(typeof hr==="string")return this._runTask(s("Git.catFile: options must be supplied as an array of strings"),gt);if(Array.isArray(hr))nr.push.apply(nr,hr);let Wr=oe==="buffer"?ht(nr):Tt(nr);return this._runTask(Wr,gt)},Ie.prototype.diff=function(oe,Ee){let gt=p(oe)?s("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Tt(["diff",...g(arguments)]);return this._runTask(gt,S(arguments))},Ie.prototype.diffSummary=function(){return this._runTask(Pe(g(arguments,1)),S(arguments))},Ie.prototype.applyPatch=function(oe){let Ee=!m(oe)?s("git.applyPatch requires one or more string patches as the first argument"):D(c(oe),g([].slice.call(arguments,1)));return this._runTask(Ee,S(arguments))},Ie.prototype.revparse=function(){let oe=["rev-parse",...g(arguments,!0)];return this._runTask(Tt(oe,!0),S(arguments))},Ie.prototype.clean=function(oe,Ee,gt){let nr=Te(oe),hr=nr&&oe.join("")||f(oe,p)||"",Wr=g([].slice.call(arguments,nr?1:0));return this._runTask(Be(hr,Wr),S(arguments))},Ie.prototype.exec=function(oe){let Ee={commands:[],format:"utf-8",parser(){if(typeof oe==="function")oe()}};return this._runTask(Ee)},Ie.prototype.clearQueue=function(){return this._runTask(o(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},Ie.prototype.checkIgnore=function(oe,Ee){return this._runTask(me(c(f(oe,m,[]))),S(arguments))},Ie.prototype.checkIsRepo=function(oe,Ee){return this._runTask(F(f(oe,p)),S(arguments))},t.exports=Ie}});Zs();var uue=class extends Fo{constructor(e,t){super(void 0,t);this.config=e}};Zs();Zs();var _l=class extends Fo{constructor(e,t,r){super(e,r);this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Ol();w1();z1();K1();X1();tB();iB();cB();function lue(e){if(!e)return;return[{type:"spawn.before",action(i,n){if(e.aborted)n.kill(new _l(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(i,n){function o(){n.kill(new _l(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),n.spawned.on("close",()=>e.removeEventListener("abort",o))}}]}function pue(e={}){return{type:"spawn.args",action(t,{env:r}){for(let i of qL(t,r))if(e[i.category]!==!0)throw new _l(void 0,"unsafe",i.message);return t}}}We();function due(e){let t=bm(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}We();var y1=Rl.deferred().promise;function mue({onClose:e=!0,onExit:t=50}={}){function r(){let n=-1,o={close:Rl.deferred(),closeTimeout:Rl.deferred(),exit:Rl.deferred(),exitTimeout:Rl.deferred()},s=Promise.race([e===!1?y1:o.closeTimeout.promise,t===!1?y1:o.exitTimeout.promise]);return i(e,o.close,o.closeTimeout),i(t,o.exit,o.exitTimeout),{close(c){n=c,o.close.done()},exit(c){n=c,o.exit.done()},get exitCode(){return n},result:s}}function i(n,o,s){if(n===!1)return;(n===!0?o.promise:o.promise.then(()=>$R(n))).then(s.done)}return{type:"spawn.after",async action(n,{spawned:o,close:s}){let c=r(),u=!0,l=()=>void(u=!1);o.stdout?.on("data",l),o.stderr?.on("data",l),o.on("error",l),o.on("close",(p)=>c.close(p)),o.on("exit",(p)=>c.exit(p));try{if(await c.result,u)await $R(50);s(c.exitCode)}catch(p){s(c.exitCode,p)}}}}We();var fue="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",b1="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function gue(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function x1(e,t){if(e.length<1||e.length>2)throw new _l(void 0,"binary",fue);if(e.some(gue))if(t)console.warn(b1);else throw new _l(void 0,"binary",b1);let[i,n]=e;return{binary:i,prefix:n}}function hue(e,t=["git"],r=!1){let i=x1(so(t),r);e.on("binary",(n)=>{i=x1(so(n),r)}),e.append("spawn.binary",()=>i.binary),e.append("spawn.args",(n)=>i.prefix?[i.prefix,...n]:n)}Zs();function yue(e){return!!(e.exitCode&&e.stdErr.length)}function bue(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function xue(e=!1,t=yue,r=bue){return(i,n)=>{if(!e&&i||!t(n))return i;return r(n)}}function S1(e){return{type:"task.error",action(t,r){let i=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});if(Buffer.isBuffer(i))return{error:new Fo(void 0,i.toString("utf-8"))};return{error:i}}}}We();var vue=class{constructor(){this.plugins=new Set,this.events=new Sue}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=yi(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return so(e).forEach((r)=>r&&this.plugins.add(yi(t,r))),()=>{t.forEach((r)=>this.plugins.delete(r))}}exec(e,t,r){let i=t,n=Object.freeze(Object.create(r));for(let o of this.plugins)if(o.type===e)i=o.action(i,n);return i}};We();function wue(e){let r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,s){if(!r.includes(s.method))return o;return P1(o,"--progress")}},{type:"spawn.after",action(o,s){if(!s.commands.includes("--progress"))return;s.spawned.stderr?.on("data",(c)=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));if(!u)return;e({method:s.method,stage:kue(u[1]),progress:At(u[2]),processed:At(u[3]),total:At(u[4])})})}}]}function kue(e){return String(e.toLowerCase().split(" ",1))||"unknown"}We();function Iue(e){let t=A1(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Tue({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(i,n){let o;function s(){o&&clearTimeout(o),o=setTimeout(u,e)}function c(){n.spawned.stdout?.off("data",s),n.spawned.stderr?.off("data",s),n.spawned.off("exit",c),n.spawned.off("close",c),o&&clearTimeout(o)}function u(){c(),n.kill(new _l(void 0,"timeout","block timeout reached"))}r&&n.spawned.stdout?.on("data",s),t&&n.spawned.stderr?.on("data",s),n.spawned.on("exit",c),n.spawned.on("close",c),s()}}}function Eue(){return{type:"spawn.args",action(e){let t=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;n<e.length;n++){let o=e[n];if(fi(o)){i(Cl(o));continue}if(o==="--"){i(e.slice(n+1).flatMap((s)=>fi(s)&&Cl(s)||s));break}t.push(o)}return!r?t:[...t,"--",...r.map(String)]}}}We();var Cue=cue();function Pue(e,t){let r=new vue,i=D1(e&&(typeof e==="string"?{baseDir:e}:e)||{},t);if(!XR(i.baseDir))throw new uue(i,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(i.config))r.add(due(i.config));return r.add(pue(i.unsafe)),r.add(mue(i.completion)),i.abort&&r.add(lue(i.abort)),i.progress&&r.add(wue(i.progress)),i.timeout&&r.add(Tue(i.timeout)),i.spawnOptions&&r.add(Iue(i.spawnOptions)),r.add(Eue()),r.add(S1(xue(!0))),i.errors&&r.add(S1(i.errors)),hue(r,i.binary,i.unsafe?.allowUnsafeCustomBinary),new Cue(i,r)}Ol();var cb=Pue;class ub{tail=Promise.resolve();run(e,t){if(t?.aborted)return Promise.reject(t.reason);let r=this.tail,i=()=>{};this.tail=new Promise((s)=>{i=s});let n=!1,o=r.then(async()=>{try{return n=!0,t?.throwIfAborted(),await e()}finally{i()}});return Rue(o,()=>n,t)}async idle(){await this.tail}}class xA{tails=new Map;async run(e,t){let r=this.tails.get(e),i=()=>{},n=new Promise((o)=>{i=o});this.tails.set(e,n),await r;try{return await t()}finally{if(i(),this.tails.get(e)===n)this.tails.delete(e)}}}function Rue(e,t,r){if(!r)return e;return new Promise((i,n)=>{let o=()=>{if(!t())n(r.reason)};r.addEventListener("abort",o,{once:!0}),e.then(i,n).finally(()=>{r.removeEventListener("abort",o)})})}import{readdir as fIe,readFile as gIe}from"fs/promises";var SA=(e)=>typeof e==="function",h=function(e,t){if(typeof e==="function")return function(){if(e(arguments))return t.apply(this,arguments);return(r)=>t(r,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(r,i){if(arguments.length>=2)return t(r,i);return function(n){return t(n,r)}};case 3:return function(r,i,n){if(arguments.length>=3)return t(r,i,n);return function(o){return t(o,r,i)}};case 4:return function(r,i,n,o){if(arguments.length>=4)return t(r,i,n,o);return function(s){return t(s,r,i,n)}};case 5:return function(r,i,n,o,s){if(arguments.length>=5)return t(r,i,n,o,s);return function(c){return t(c,r,i,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(i){return t(i,...r)}}}};var Ze=(e)=>e;var Tm=(e)=>()=>e,$o=Tm(!0),$i=Tm(!1);var lb=Tm(void 0),ao=lb;function v(e,t,r,i,n,o,s,c,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return r(t(e));case 4:return i(r(t(e)));case 5:return n(i(r(t(e))));case 6:return o(n(i(r(t(e)))));case 7:return s(o(n(i(r(t(e))))));case 8:return c(s(o(n(i(r(t(e)))))));case 9:return u(c(s(o(n(i(r(t(e))))))));default:{let l=arguments[0];for(let p=1;p<arguments.length;p++)l=arguments[p](l);return l}}}var pb=(e)=>(t,r)=>t===r||e(t,r);var xU=h(2,(e,t)=>pb((r,i)=>e(t(r),t(i))));var SU=(e)=>pb((t,r)=>{if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++)if(!e(t[i],r[i]))return!1;return!0});var vU=(e)=>h(3,(t,r,i)=>e(t,(n)=>({...n,[r]:i(n)}))),wU=(e)=>h(2,(t,r)=>e(t,(i)=>({[r]:i}))),kU=(e,t)=>h(3,(r,i,n)=>t(r,(o)=>e(n(o),(s)=>({...o,[i]:s}))));var Em,Fe=(e,t)=>{if(!Em)globalThis["effect/GlobalValue"]??=new Map,Em=globalThis["effect/GlobalValue"];if(!Em.has(e))Em.set(e,t());return Em.get(e)};var Cm=(e)=>typeof e==="string",Pm=(e)=>typeof e==="number";var wA=(e)=>typeof e==="bigint";var Gs=SA;var _ue=(e)=>typeof e==="object"&&e!==null,Ks=(e)=>_ue(e)||Gs(e),pe=h(2,(e,t)=>Ks(e)&&(t in e)),Qs=h(2,(e,t)=>pe(e,"_tag")&&e._tag===t),dc=(e)=>e===null||e===void 0;var bi=(e)=>typeof e==="string"||pe(e,Symbol.iterator);var kA=(e)=>pe(e,"then")&&Gs(e.then);var mc=(e)=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;var IU=Symbol.for("effect/Gen/GenKind");class Oue{value;constructor(e){this.value=e}get _F(){return Ze}get _R(){return(e)=>e}get _O(){return(e)=>e}get _E(){return(e)=>e}[IU]=IU;[Symbol.iterator](){return new fc(this)}}class fc{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new fc(this.self)}}var Due=335903614,Mue=4150755663,Fue=1481765933,$ue=1284865837,jue=9007199254740992,Nue=134217728;class TA{_state;constructor(e,t,r,i){if(dc(t)&&dc(e))t=Math.random()*4294967295>>>0,e=0;else if(dc(t))t=e,e=0;if(dc(i)&&dc(r))i=this._state?this._state[3]:Mue,r=this._state?this._state[2]:Due;else if(dc(i))i=r,r=0;return this._state=new Int32Array([0,0,r>>>0,((i||0)|1)>>>0]),this._next(),TU(this._state,this._state[0],this._state[1],e>>>0,t>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(e){this._state[0]=e[0],this._state[1]=e[1],this._state[2]=e[2],this._state[3]=e[3]|1}integer(e){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%e}number(){let e=(this._next()&67108863)*1,t=(this._next()&134217727)*1;return(e*Nue+t)/jue}_next(){let e=this._state[0]>>>0,t=this._state[1]>>>0;zue(this._state,e,t,Fue,$ue),TU(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=e>>>18,i=(t>>>18|e<<14)>>>0;r=(r^e)>>>0,i=(i^t)>>>0;let n=(i>>>27|r<<5)>>>0,o=e>>>27,s=(-o>>>0&31)>>>0;return(n>>>o|n<<s)>>>0}}function zue(e,t,r,i,n){let o=(r>>>16)*(n&65535)>>>0,s=(r&65535)*(n>>>16)>>>0,c=(r&65535)*(n&65535)>>>0,u=(r>>>16)*(n>>>16)+((s>>>16)+(o>>>16))>>>0;if(s=s<<16>>>0,c=c+s>>>0,c>>>0<s>>>0)u=u+1>>>0;if(o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0)u=u+1>>>0;u=u+Math.imul(r,i)>>>0,u=u+Math.imul(t,n)>>>0,e[0]=u,e[1]=c}function TU(e,t,r,i,n){let o=t+i>>>0,s=r+n>>>0;if(s>>>0<r>>>0)o=o+1|0;e[0]=o,e[1]=s}var IA=Symbol.for("effect/Utils/YieldWrap");class jo{#t;constructor(e){this.#t=e}[IA](){return this.#t}}function EA(e){if(typeof e==="object"&&e!==null&&IA in e)return e[IA]();throw Error(mc("yieldWrapGet"))}var On=Fe("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0}));var EU={effect_internal_function:(e)=>e()},Lue={effect_internal_function:(e)=>{try{return e()}finally{}}},Bue=EU.effect_internal_function(()=>Error().stack)?.includes("effect_internal_function")===!0,Jt=Bue?EU.effect_internal_function:Lue.effect_internal_function,Uue=function*(){}.constructor,CU=(e)=>Ks(e)&&e.constructor===Uue;var CA=Fe(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),be=Symbol.for("effect/Hash"),ue=(e)=>{if(On.enabled===!0)return 0;switch(typeof e){case"number":return fb(e);case"bigint":return lt(e.toString(10));case"boolean":return lt(String(e));case"symbol":return lt(String(e));case"string":return lt(e);case"undefined":return lt("undefined");case"function":case"object":if(e===null)return lt("null");else if(e instanceof Date){if(Number.isNaN(e.getTime()))return lt("Invalid Date");return ue(e.toISOString())}else if(e instanceof URL)return ue(e.href);else if(Jue(e))return e[be]();else return Ml(e);default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Ml=(e)=>{if(!CA.has(e))CA.set(e,fb(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return CA.get(e)},Re=(e)=>(t)=>t*53^e,mb=(e)=>e&3221225471|e>>>1&1073741824,Jue=(e)=>pe(e,be),fb=(e)=>{if(e!==e||e===1/0)return 0;let t=e|0;if(t!==e)t^=e*4294967295;while(e>4294967295)t^=e/=4294967295;return mb(t)},lt=(e)=>{let t=5381,r=e.length;while(r)t=t*33^e.charCodeAt(--r);return mb(t)},Hue=(e,t)=>{let r=12289;for(let i=0;i<t.length;i++)r^=v(lt(t[i]),Re(ue(e[t[i]])));return mb(r)},gb=(e)=>Hue(e,Object.keys(e)),Dn=(e)=>{let t=6151;for(let r=0;r<e.length;r++)t=v(t,Re(ue(e[r])));return mb(t)},Ue=function(){if(arguments.length===1){let r=arguments[0];return function(i){return Object.defineProperty(r,be,{value(){return i},enumerable:!1}),i}}let e=arguments[0],t=arguments[1];return Object.defineProperty(e,be,{value(){return t},enumerable:!1}),t};var he=Symbol.for("effect/Equal");function le(){if(arguments.length===1)return(e)=>hb(e,arguments[0]);return hb(arguments[0],arguments[1])}function hb(e,t){if(e===t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r==="object"||r==="function"){if(e!==null&&t!==null){if(Fl(e)&&Fl(t))if(ue(e)===ue(t)&&e[he](t))return!0;else return On.enabled&&On.tester?On.tester(e,t):!1;else if(e instanceof Date&&t instanceof Date){let i=e.getTime(),n=t.getTime();return i===n||Number.isNaN(i)&&Number.isNaN(n)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(On.enabled){if(e===null||t===null)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((i,n)=>hb(i,t[n]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let i=Object.keys(e),n=Object.keys(t);if(i.length===n.length){for(let o of i)if(!((o in t)&&hb(e[o],t[o])))return On.tester?On.tester(e,t):!1;return!0}}return On.tester?On.tester(e,t):!1}}return On.enabled&&On.tester?On.tester(e,t):!1}var Fl=(e)=>pe(e,he),Rm=()=>le;var qe=Symbol.for("nodejs.util.inspect.custom"),et=(e)=>{try{if(pe(e,"toJSON")&&Gs(e.toJSON)&&e.toJSON.length===0)return e.toJSON();else if(Array.isArray(e))return e.map(et)}catch{return{}}return AU(e)};var it=(e)=>JSON.stringify(e,null,2),Y1e={toJSON(){return et(this)},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}};class Wue{[qe](){return this.toJSON()}toString(){return it(this.toJSON())}}var No=(e,t=2)=>{if(typeof e==="string")return e;try{return typeof e==="object"?yb(e,t):String(e)}catch{return String(e)}},yb=(e,t)=>{let r=[],i=JSON.stringify(e,(n,o)=>typeof o==="object"&&o!==null?r.includes(o)?void 0:r.push(o)&&(gc.fiberRefs!==void 0&&PU(o)?o[PA](gc.fiberRefs):o):o,t);return r=void 0,i},PA=Symbol.for("effect/Inspectable/Redactable"),PU=(e)=>typeof e==="object"&&e!==null&&(PA in e),gc=Fe("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),RU=(e,t)=>{let r=gc.fiberRefs;gc.fiberRefs=e;try{return t()}finally{gc.fiberRefs=r}},AU=(e)=>{if(PU(e)&&gc.fiberRefs!==void 0)return e[PA](gc.fiberRefs);return e};var ae=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let i=0,n=t.length;i<n;i++)r=t[i](r);return r}}};var hc="Async",yc="Commit",Ht="Failure",$l="OnFailure",jl="OnSuccess",Nl="OnSuccessAndFailure",Wt="Success",bb="Sync",_U="Tag",zo="UpdateRuntimeFlags",zl="While",bc="Iterator",xb="WithRuntime",Ll="Yield",Am="RevertFlags";var Zue="3.22.0",Om=()=>Zue;var DU=Symbol.for("effect/Effect"),MU=Symbol.for("effect/Stream"),FU=Symbol.for("effect/Sink"),$U=Symbol.for("effect/Channel"),Ys={_R:(e)=>e,_E:(e)=>e,_A:(e)=>e,_V:Om()},Vue={_A:(e)=>e,_In:(e)=>e,_L:(e)=>e,_E:(e)=>e,_R:(e)=>e},Gue={_Env:(e)=>e,_InErr:(e)=>e,_InElem:(e)=>e,_InDone:(e)=>e,_OutErr:(e)=>e,_OutElem:(e)=>e,_OutDone:(e)=>e},Lo={[DU]:Ys,[MU]:Ys,[FU]:Vue,[$U]:Gue,[he](e){return this===e},[be](){return Ue(this,Ml(this))},[Symbol.iterator](){return new fc(new jo(this))},pipe(){return ae(this,arguments)}},Bl={[be](){return Ue(this,gb(this))},[he](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let i of t)if(!((i in e)&&le(this[i],e[i])))return!1;return!0}},xi={...Lo,_op:yc},AA={...xi,...Bl},jU=function(){function e(){}return e.prototype=xi,e}();var zU=Symbol.for("effect/Option"),LU={...Lo,[zU]:{_A:(e)=>e},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}},Kue=Object.assign(Object.create(LU),{_tag:"Some",_op:"Some",[he](e){return _A(e)&&OA(e)&&le(this.value,e.value)},[be](){return Ue(this,Re(ue(this._tag))(ue(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:et(this.value)}}}),Que=ue("None"),Yue=Object.assign(Object.create(LU),{_tag:"None",_op:"None",[he](e){return _A(e)&&Ul(e)},[be](){return Que},toJSON(){return{_id:"Option",_tag:this._tag}}}),_A=(e)=>pe(e,zU),Ul=(e)=>e._tag==="None",OA=(e)=>e._tag==="Some",Sb=Object.create(Yue),Xs=(e)=>{let t=Object.create(Kue);return t.value=e,t};var MA=Symbol.for("effect/Either"),BU={...Lo,[MA]:{_R:(e)=>e},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}},Xue=Object.assign(Object.create(BU),{_tag:"Right",_op:"Right",[he](e){return FA(e)&&jA(e)&&le(this.right,e.right)},[be](){return Re(ue(this._tag))(ue(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:et(this.right)}}}),ele=Object.assign(Object.create(BU),{_tag:"Left",_op:"Left",[he](e){return FA(e)&&$A(e)&&le(this.left,e.left)},[be](){return Re(ue(this._tag))(ue(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:et(this.left)}}}),FA=(e)=>pe(e,MA),$A=(e)=>e._tag==="Left",jA=(e)=>e._tag==="Right",UU=(e)=>{let t=Object.create(ele);return t.left=e,t},qU=(e)=>{let t=Object.create(Xue);return t.right=e,t};var Nr=qU;var Mn=UU;var co=$A,ql=jA;var nle=h(2,(e,{onLeft:t,onRight:r})=>co(e)?t(e.left):r(e.right));var vb=nle({onLeft:Ze,onRight:Ze});var NA=(e)=>e.length>0;var zA=(e)=>(t,r)=>t===r?0:e(t,r);var JU=zA((e,t)=>e<t?-1:1);var wb=h(2,(e,t)=>zA((r,i)=>e(t(r),t(i))));var ole=(e)=>zA((t,r)=>{let i=Math.min(t.length,r.length),n=0;for(let o of e){if(n>=i)break;let s=o(t[n],r[n]);if(s!==0)return s;n++}return 0});var HU=(...e)=>ole(e);var LA=(e)=>h(2,(t,r)=>e(t,r)===1);var H=()=>Sb,re=Xs;var Ft=Ul,Bt=OA,yr=h(2,(e,{onNone:t,onSome:r})=>Ft(e)?t():r(e.value));var br=h(2,(e,t)=>Ft(e)?t():e.value);var WU=h(2,(e,t)=>Ft(e)?re(t()):e);var Bo=(e)=>e==null?H():re(e);var Kr=br(lb);var sle=h(2,(e,t)=>{if(Bt(e))return e.value;throw t()}),ZU=sle(()=>Error("getOrThrow called on a None")),Gn=h(2,(e,t)=>Ft(e)?H():re(t(e.value)));var xc=h(2,(e,t)=>Ft(e)?H():t(e.value));var ale=(e)=>h(2,(t,r)=>Ft(t)?!1:e(t.value,r)),cle=Rm(),VU=ale(cle);var Dm=(e)=>(t,r)=>{if(Ft(t))return r;else if(Ft(r))return t;return re(e(t.value,r.value))};var GU=(...e)=>e;var Mm=(e)=>Array(e),UA=h(2,(e,t)=>{let r=Math.max(1,Math.floor(e)),i=Array(r);for(let n=0;n<r;n++)i[n]=t(n);return i});var ot=(e)=>Array.isArray(e)?e:Array.from(e),KU=(e)=>Array.isArray(e)?e:[e];var Jl=h(2,(e,t)=>[t,...e]);var QU=h(2,(e,t)=>[...e,t]),qA=h(2,(e,t)=>ot(e).concat(ot(t)));var lle=(e)=>e.length===0,YU=lle,kb=NA,Qr=NA;var XU=(e,t)=>e<0||e>=t.length,ple=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),dle=h(2,(e,t)=>{let r=Math.floor(t);return XU(r,e)?H():re(e[r])}),JA=h(2,(e,t)=>{let r=Math.floor(t);if(XU(r,e))throw Error(`Index ${r} out of bounds`);return e[r]});var ea=dle(0),Er=JA(0),Ib=(e)=>Qr(e)?re(HA(e)):H(),HA=(e)=>e[e.length-1];var uo=(e)=>e.slice(1);var mle=(e,t)=>{let r=0;for(let i of e){if(!t(i,r))break;r++}return r},eq=h(2,(e,t)=>gle(e,mle(e,t))),tq=h(2,(e,t)=>{let r=ot(e);return r.slice(ple(t,r),r.length)});var WA=(e)=>Array.from(e).reverse(),Sc=h(2,(e,t)=>{let r=Array.from(e);return r.sort(t),r});var ZA=h(2,(e,t)=>rq(e,t,GU)),rq=h(3,(e,t,r)=>{let i=ot(e),n=ot(t);if(Qr(i)&&Qr(n)){let o=[r(Er(i),Er(n))],s=Math.min(i.length,n.length);for(let c=1;c<s;c++)o[c]=r(i[c],n[c]);return o}return[]});var fle=Rm();var gle=h(2,(e,t)=>{let r=Array.from(e),i=Math.floor(t);if(Qr(r)){if(i>=1)return hle(r,i);return[[],r]}return[r,[]]}),hle=h(2,(e,t)=>{let r=Math.max(1,Math.floor(t));return r>=e.length?[yle(e),[]]:[Jl(e.slice(1,r),Er(e)),e.slice(r)]});var yle=(e)=>e.slice();var ble=h(3,(e,t,r)=>{let i=ot(e),n=ot(t);if(Qr(i)){if(Qr(n))return oq(r)(qA(i,n));return i}return n}),Ni=h(2,(e,t)=>ble(e,t,fle));var zi=()=>[],gn=(e)=>[e],lo=h(2,(e,t)=>e.map(t)),nq=h(2,(e,t)=>{if(YU(e))return[];let r=[];for(let i=0;i<e.length;i++){let n=t(e[i],i);for(let o=0;o<n.length;o++)r.push(n[o])}return r}),Tb=nq(Ze),Hl=h(2,(e,t)=>{let r=ot(e),i=[];for(let n=0;n<r.length;n++){let o=t(r[n],n);if(Bt(o))i.push(o.value)}return i});var VA=h(2,(e,t)=>{let r=[],i=[],n=ot(e);for(let o=0;o<n.length;o++){let s=t(n[o],o);if(co(s))r.push(s.left);else i.push(s.right)}return[r,i]}),iq=Hl(Ze);var ta=h(3,(e,t,r)=>ot(e).reduce((i,n,o)=>r(i,n,o),t)),Eb=h(3,(e,t,r)=>ot(e).reduceRight((i,n,o)=>r(i,n,o),t));var GA=(e,t)=>{let r=[],i=e,n;while(Bt(n=t(i))){let[o,s]=n.value;r.push(o),i=s}return r};var Wl=SU;var oq=h(2,(e,t)=>{let r=ot(e);if(Qr(r)){let i=[Er(r)],n=uo(r);for(let o of n)if(i.every((s)=>!t(o,s)))i.push(o);return i}return[]}),KA=(e)=>oq(e,Rm());var Uo=h(2,(e,t)=>ot(e).join(t));var sq=Symbol.for("effect/Chunk");function xle(e,t,r,i,n){for(let o=t;o<Math.min(e.length,t+n);o++)r[i+o-t]=e[o];return r}var aq=[],Sle=(e)=>pb((t,r)=>t.length===r.length&&Si(t).every((i,n)=>e(i,vc(r,n)))),vle=Sle(le),wle={[sq]:{_A:(e)=>e},toString(){return it(this.toJSON())},toJSON(){return{_id:"Chunk",values:Si(this).map(et)}},[qe](){return this.toJSON()},[he](e){return cq(e)&&vle(this,e)},[be](){return Ue(this,Dn(Si(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return aq[Symbol.iterator]();default:return Si(this)[Symbol.iterator]()}},pipe(){return ae(this,arguments)}},xr=(e)=>{let t=Object.create(wle);switch(t.backing=e,e._tag){case"IEmpty":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case"IConcat":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case"IArray":{t.length=e.array.length,t.depth=0,t.left=po,t.right=po;break}case"ISingleton":{t.length=1,t.depth=0,t.left=po,t.right=po;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=po,t.right=po;break}}return t},cq=(e)=>pe(e,sq),po=xr({_tag:"IEmpty"}),hn=()=>po,Fm=(...e)=>Ele(e),Zt=(e)=>xr({_tag:"ISingleton",a:e}),wc=(e)=>cq(e)?e:$m(ot(e)),QA=(e,t,r)=>{switch(e.backing._tag){case"IArray":{xle(e.backing.array,0,t,r,e.length);break}case"IConcat":{QA(e.left,t,r),QA(e.right,t,r+e.left.length);break}case"ISingleton":{t[r]=e.backing.a;break}case"ISlice":{let i=0,n=r;while(i<e.length)t[n]=vc(e,i),i+=1,n+=1;break}}};var kle=(e)=>{switch(e.backing._tag){case"IEmpty":return aq;case"IArray":return e.backing.array;default:{let t=Array(e.length);return QA(e,t,0),e.backing={_tag:"IArray",array:t},e.left=po,e.right=po,e.depth=0,t}}},Si=kle,Ile=(e)=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return xr({_tag:"IArray",array:WA(e.backing.array)});case"IConcat":return xr({_tag:"IConcat",left:mo(e.backing.right),right:mo(e.backing.left)});case"ISlice":return $m(WA(Si(e)))}},mo=Ile,Tle=h(2,(e,t)=>t<0||t>=e.length?H():re(vc(e,t))),$m=(e)=>e.length===0?hn():e.length===1?Zt(e[0]):xr({_tag:"IArray",array:e}),Ele=(e)=>$m(e),vc=h(2,(e,t)=>{switch(e.backing._tag){case"IEmpty":throw Error("Index out of bounds");case"ISingleton":{if(t!==0)throw Error("Index out of bounds");return e.backing.a}case"IArray":{if(t>=e.length||t<0)throw Error("Index out of bounds");return e.backing.array[t]}case"IConcat":return t<e.left.length?vc(e.left,t):vc(e.right,t-e.left.length);case"ISlice":return vc(e.backing.chunk,t+e.backing.offset)}}),Cb=h(2,(e,t)=>Kn(e,Zt(t))),Cr=h(2,(e,t)=>Kn(Zt(t),e));var YA=h(2,(e,t)=>{if(t<=0)return e;else if(t>=e.length)return po;else switch(e.backing._tag){case"ISlice":return xr({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":{if(t>e.left.length)return YA(e.right,t-e.left.length);return xr({_tag:"IConcat",left:YA(e.left,t),right:e.right})}default:return xr({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}});var Kn=h(2,(e,t)=>{if(e.backing._tag==="IEmpty")return t;if(t.backing._tag==="IEmpty")return e;let r=t.depth-e.depth;if(Math.abs(r)<=1)return xr({_tag:"IConcat",left:e,right:t});else if(r<-1)if(e.left.depth>=e.right.depth){let i=Kn(e.right,t);return xr({_tag:"IConcat",left:e.left,right:i})}else{let i=Kn(e.right.right,t);if(i.depth===e.depth-3){let n=xr({_tag:"IConcat",left:e.right.left,right:i});return xr({_tag:"IConcat",left:e.left,right:n})}else{let n=xr({_tag:"IConcat",left:e.left,right:e.right.left});return xr({_tag:"IConcat",left:n,right:i})}}else if(t.right.depth>=t.left.depth){let i=Kn(e,t.left);return xr({_tag:"IConcat",left:i,right:t.right})}else{let i=Kn(e,t.left.left);if(i.depth===t.depth-3){let n=xr({_tag:"IConcat",left:i,right:t.left.right});return xr({_tag:"IConcat",left:n,right:t.right})}else{let n=xr({_tag:"IConcat",left:t.left.right,right:t.right});return xr({_tag:"IConcat",left:i,right:n})}}});var XA=(e)=>e.length===0,zr=(e)=>e.length>0,Pb=Tle(0),e_=(e)=>vc(e,0),Pr=e_;var Yr=(e)=>YA(e,1);var ra=5,t_=Math.pow(2,5),uq=t_-1,lq=t_/2,pq=t_/4;function Cle(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function na(e,t){return t>>>e&uq}function ia(e){return 1<<e}function Rb(e,t){return Cle(e&t-1)}var dq=(e,t)=>({value:e,previous:t});function kc(e,t,r,i){let n=i;if(!e){let o=i.length;n=Array(o);for(let s=0;s<o;++s)n[s]=i[s]}return n[t]=r,n}function r_(e,t,r){let i=r.length-1,n=0,o=0,s=r;if(e)n=o=t;else{s=Array(i);while(n<t)s[o++]=r[n++]}++n;while(n<=i)s[o++]=r[n++];if(e)s.length=i;return s}function mq(e,t,r,i){let n=i.length;if(e){let u=n;while(u>=t)i[u--]=i[u];return i[t]=r,i}let o=0,s=0,c=Array(n+1);while(o<t)c[s++]=i[o++];c[t]=r;while(o<n)c[++s]=i[o++];return c}class qo{_tag="EmptyNode";modify(e,t,r,i,n,o){let s=r(H());if(Ft(s))return new qo;return++o.value,new Ic(e,i,n,s)}}function wi(e){return Qs(e,"EmptyNode")}function Rle(e){return wi(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function Ab(e,t){return wi(e)?!1:t===e.edit}class Ic{edit;hash;key;value;_tag="LeafNode";constructor(e,t,r,i){this.edit=e,this.hash=t,this.key=r,this.value=i}modify(e,t,r,i,n,o){if(le(n,this.key)){let c=r(this.value);if(c===this.value)return this;else if(Ft(c))return--o.value,new qo;if(Ab(this,e))return this.value=c,this;return new Ic(e,i,n,c)}let s=r(H());if(Ft(s))return this;return++o.value,fq(e,t,this.hash,this,i,new Ic(e,i,n,s))}}class n_{edit;hash;children;_tag="CollisionNode";constructor(e,t,r){this.edit=e,this.hash=t,this.children=r}modify(e,t,r,i,n,o){if(i===this.hash){let c=Ab(this,e),u=this.updateCollisionList(c,e,this.hash,this.children,r,n,o);if(u===this.children)return this;return u.length>1?new n_(e,this.hash,u):u[0]}let s=r(H());if(Ft(s))return this;return++o.value,fq(e,t,this.hash,this,i,new Ic(e,i,n,s))}updateCollisionList(e,t,r,i,n,o,s){let c=i.length;for(let l=0;l<c;++l){let p=i[l];if("key"in p&&le(o,p.key)){let m=p.value,f=n(m);if(f===m)return i;if(Ft(f))return--s.value,r_(e,l,i);return kc(e,l,new Ic(t,r,o,f),i)}}let u=n(H());if(Ft(u))return i;return++s.value,kc(e,c,new Ic(t,r,o,u),i)}}class Zl{edit;mask;children;_tag="IndexedNode";constructor(e,t,r){this.edit=e,this.mask=t,this.children=r}modify(e,t,r,i,n,o){let s=this.mask,c=this.children,u=na(t,i),l=ia(u),p=Rb(s,l),m=s&l,f=Ab(this,e);if(!m){let L=new qo().modify(e,t+ra,r,i,n,o);if(!L)return this;return c.length>=lq?_le(e,u,L,s,c):new Zl(e,s|l,mq(f,p,L,c))}let g=c[p],S=g.modify(e,t+ra,r,i,n,o);if(g===S)return this;let P=s,D;if(wi(S)){if(P&=~l,!P)return new qo;if(c.length<=2&&Rle(c[p^1]))return c[p^1];D=r_(f,p,c)}else D=kc(f,p,S,c);if(f)return this.mask=P,this.children=D,this;return new Zl(e,P,D)}}class i_{edit;size;children;_tag="ArrayNode";constructor(e,t,r){this.edit=e,this.size=t,this.children=r}modify(e,t,r,i,n,o){let s=this.size,c=this.children,u=na(t,i),l=c[u],p=(l||new qo).modify(e,t+ra,r,i,n,o);if(l===p)return this;let m=Ab(this,e),f;if(wi(l)&&!wi(p))++s,f=kc(m,u,p,c);else if(!wi(l)&&wi(p)){if(--s,s<=pq)return Ale(e,s,u,c);f=kc(m,u,new qo,c)}else f=kc(m,u,p,c);if(m)return this.size=s,this.children=f,this;return new i_(e,s,f)}}function Ale(e,t,r,i){let n=Array(t-1),o=0,s=0;for(let c=0,u=i.length;c<u;++c)if(c!==r){let l=i[c];if(l&&!wi(l))n[o++]=l,s|=1<<c}return new Zl(e,s,n)}function _le(e,t,r,i,n){let o=[],s=i,c=0;for(let u=0;s;++u){if(s&1)o[u]=n[c++];s>>>=1}return o[t]=r,new i_(e,c+1,o)}function Ole(e,t,r,i,n,o){if(r===n)return new n_(e,r,[o,i]);let s=na(t,r),c=na(t,n);if(s===c)return(u)=>new Zl(e,ia(s)|ia(c),[u]);else{let u=s<c?[i,o]:[o,i];return new Zl(e,ia(s)|ia(c),u)}}function fq(e,t,r,i,n,o){let s=void 0,c=t;while(!0){let u=Ole(e,c,r,i,n,o);if(typeof u==="function")s=dq(u,s),c=c+ra;else{let l=u;while(s!=null)l=s.value(l),s=s.previous;return l}}}var gq="effect/HashMap",_b=Symbol.for(gq),Mle={[_b]:_b,[Symbol.iterator](){return new Db(this,(e,t)=>[e,t])},[be](){let e=ue(gq);for(let t of this)e^=v(ue(t[0]),Re(ue(t[1])));return Ue(this,e)},[he](e){if(xq(e)){if(e._size!==this._size)return!1;for(let t of this){let r=v(e,Mb(t[0],ue(t[0])));if(Ft(r))return!1;else if(!le(t[1],r.value))return!1}return!0}return!1},toString(){return it(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},o_=(e,t,r,i)=>{let n=Object.create(Mle);return n._editable=e,n._edit=t,n._root=r,n._size=i,n};class Db{map;f;v;constructor(e,t){this.map=e,this.f=t,this.v=hq(this.map._root,this.f,void 0)}next(){if(Ft(this.v))return{done:!0,value:void 0};let e=this.v.value;return this.v=Ob(e.cont),{done:!1,value:e.value}}[Symbol.iterator](){return new Db(this.map,this.f)}}var Ob=(e)=>e?yq(e[0],e[1],e[2],e[3],e[4]):H(),hq=(e,t,r=void 0)=>{switch(e._tag){case"LeafNode":{if(Bt(e.value))return re({value:t(e.key,e.value.value),cont:r});return Ob(r)}case"CollisionNode":case"ArrayNode":case"IndexedNode":{let i=e.children;return yq(i.length,i,0,t,r)}default:return Ob(r)}},yq=(e,t,r,i,n)=>{while(r<e){let o=t[r++];if(o&&!wi(o))return hq(o,i,[e,t,r,i,n])}return Ob(n)},Fle=o_(!1,0,new qo,0),Vl=()=>Fle;var bq=(e)=>{let t=Nm(Vl());for(let r of e)Tc(t,r[0],r[1]);return a_(t)},xq=(e)=>pe(e,_b),Sq=(e)=>e&&wi(e._root),vq=h(2,(e,t)=>Mb(e,t,ue(t))),Mb=h(3,(e,t,r)=>{let i=e._root,n=0;while(!0)switch(i._tag){case"LeafNode":return le(t,i.key)?i.value:H();case"CollisionNode":{if(r===i.hash){let o=i.children;for(let s=0,c=o.length;s<c;++s){let u=o[s];if("key"in u&&le(t,u.key))return u.value}}return H()}case"IndexedNode":{let o=na(n,r),s=ia(o);if(i.mask&s){i=i.children[Rb(i.mask,s)],n+=ra;break}return H()}case"ArrayNode":{if(i=i.children[na(n,r)],i){n+=ra;break}return H()}default:return H()}});var s_=h(2,(e,t)=>Bt(Mb(e,t,ue(t))));var Tc=h(3,(e,t,r)=>$b(e,t,()=>re(r))),$le=h(3,(e,t,r)=>{if(e._editable)return e._root=t,e._size=r,e;return t===e._root?e:o_(e._editable,e._edit,t,r)}),Fb=(e)=>new Db(e,(t)=>t);var jm=(e)=>e._size;var Nm=(e)=>o_(!0,e._edit+1,e._root,e._size),a_=(e)=>(e._editable=!1,e),wq=h(2,(e,t)=>{let r=Nm(e);return t(r),a_(r)}),$b=h(3,(e,t,r)=>kq(e,t,ue(t),r)),kq=h(4,(e,t,r,i)=>{let n={value:e._size},o=e._root.modify(e._editable?e._edit:NaN,0,i,r,t,n);return v(e,$le(o,n.value))});var jb=h(2,(e,t)=>$b(e,t,H));var Iq=h(2,(e,t)=>Gl(e,Vl(),(r,i,n)=>Tc(r,n,t(i,n))));var Nb=h(2,(e,t)=>Gl(e,void 0,(r,i,n)=>t(i,n))),Gl=h(3,(e,t,r)=>{let i=e._root;if(i._tag==="LeafNode")return Bt(i.value)?r(t,i.value.value,i.key):t;if(i._tag==="EmptyNode")return t;let n=[i.children],o;while(o=n.pop())for(let s=0,c=o.length;s<c;){let u=o[s++];if(u&&!wi(u))if(u._tag==="LeafNode"){if(Bt(u.value))t=r(t,u.value.value,u.key)}else n.push(u.children)}return t});var Eq="effect/HashSet",zb=Symbol.for(Eq),jle={[zb]:zb,[Symbol.iterator](){return Fb(this._keyMap)},[be](){return Ue(this,Re(ue(this._keyMap))(ue(Eq)))},[he](e){if(Cq(e))return jm(this._keyMap)===jm(e._keyMap)&&le(this._keyMap,e._keyMap);return!1},toString(){return it(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Lb=(e)=>{let t=Object.create(jle);return t._keyMap=e,t},Cq=(e)=>pe(e,zb),Nle=Lb(Vl()),zm=()=>Nle,Pq=(e)=>{let t=Bb(zm());for(let r of e)Kl(t,r);return Ub(t)},Rq=(...e)=>{let t=Bb(zm());for(let r of e)Kl(t,r);return Ub(t)},Aq=h(2,(e,t)=>s_(e._keyMap,t)),_q=h(2,(e,t)=>{let r=!1;for(let i of e)if(r=t(i),r)break;return r}),Oq=h(2,(e,t)=>!_q(e,(r)=>!t(r)));var Dq=(e)=>jm(e._keyMap),Bb=(e)=>Lb(Nm(e._keyMap)),Ub=(e)=>(e._keyMap._editable=!1,e),c_=h(2,(e,t)=>{let r=Bb(e);return t(r),Ub(r)}),Kl=h(2,(e,t)=>e._keyMap._editable?(Tc(t,!0)(e._keyMap),e):Lb(Tc(t,!0)(e._keyMap))),u_=h(2,(e,t)=>e._keyMap._editable?(jb(t)(e._keyMap),e):Lb(jb(t)(e._keyMap))),Mq=h(2,(e,t)=>c_(e,(r)=>{for(let i of t)u_(r,i)}));var Fq=h(2,(e,t)=>c_(zm(),(r)=>{$q(e,(i)=>Kl(r,i));for(let i of t)Kl(r,i)}));var $q=h(2,(e,t)=>Nb(e._keyMap,(r,i)=>t(i))),jq=h(3,(e,t,r)=>Gl(e._keyMap,t,(i,n,o)=>r(i,o)));var Li=zm,qb=Pq,oa=Rq,Nq=Aq;var zq=Oq;var Jo=Dq;var Ec=Kl,l_=u_,p_=Mq;var fo=Fq;var Cc=jq;var Pc="Die",sa="Empty",Rc="Fail",Ac="Interrupt",_c="Parallel",Oc="Sequential";var Uq="effect/Cause",qq=Symbol.for(Uq),Ble={_E:(e)=>e},Yl={[qq]:Ble,[be](){return v(ue(Uq),Re(ue(Hle(this))),Ue(this))},[he](e){return f_(e)&&Jle(this,e)},pipe(){return ae(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:et(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:et(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:et(this.left),right:et(this.right)}}},toString(){return Zo(this)},[qe](){return this.toJSON()}},Fn=(()=>{let e=Object.create(Yl);return e._tag=sa,e})(),Mc=(e)=>{let t=Object.create(Yl);return t._tag=Rc,t.error=e,t},Sr=(e)=>{let t=Object.create(Yl);return t._tag=Pc,t.defect=e,t},ki=(e)=>{let t=Object.create(Yl);return t._tag=Ac,t.fiberId=e,t},Xr=(e,t)=>{let r=Object.create(Yl);return r._tag=_c,r.left=e,r.right=t,r},Vt=(e,t)=>{let r=Object.create(Yl);return r._tag=Oc,r.left=e,r.right=t,r},f_=(e)=>pe(e,qq),Jq=(e)=>e._tag===sa;var Lm=(e)=>e._tag===Pc;var g_=(e)=>{if(e._tag===sa)return!0;return Ql(e,!0,(t,r)=>{switch(r._tag){case sa:return re(t);case Pc:case Rc:case Ac:return re(!1);default:return H()}})};var h_=(e)=>Bt(Ule(e)),Bm=(e)=>x_(void 0,Zle)(e),Jb=(e)=>mo(Ql(e,hn(),(t,r)=>r._tag===Rc?re(v(t,Cr(r.error))):H())),y_=(e)=>mo(Ql(e,hn(),(t,r)=>r._tag===Pc?re(v(t,Cr(r.defect))):H())),Hb=(e)=>Ql(e,Li(),(t,r)=>r._tag===Ac?re(v(t,Ec(r.fiberId))):H()),Hq=(e)=>Fc(e,(t)=>t._tag===Rc?re(t.error):H()),Wo=(e)=>{let t=Hq(e);switch(t._tag){case"None":return Nr(e);case"Some":return Mn(t.value)}};var Ule=(e)=>Fc(e,(t)=>t._tag===Ac?re(t.fiberId):H()),Wq=(e)=>Um(e,{onEmpty:H(),onFail:()=>H(),onDie:(t)=>re(Sr(t)),onInterrupt:()=>H(),onSequential:Dm(Vt),onParallel:Dm(Xr)}),Zq=(e)=>Um(e,{onEmpty:H(),onFail:(t)=>re(Sr(t)),onDie:(t)=>re(Sr(t)),onInterrupt:()=>H(),onSequential:Dm(Vt),onParallel:Dm(Xr)});var b_=(e)=>Um(e,{onEmpty:Fn,onFail:()=>Fn,onDie:Sr,onInterrupt:ki,onSequential:Vt,onParallel:Xr}),Vq=(e)=>Um(e,{onEmpty:Fn,onFail:Sr,onDie:Sr,onInterrupt:ki,onSequential:Vt,onParallel:Xr});var qle=h(2,(e,t)=>Um(e,{onEmpty:Fn,onFail:(r)=>t(r),onDie:(r)=>Sr(r),onInterrupt:(r)=>ki(r),onSequential:(r,i)=>Vt(r,i),onParallel:(r,i)=>Xr(r,i)})),Gq=(e)=>qle(e,Ze);var Jle=(e,t)=>{let r=Zt(e),i=Zt(t);while(zr(r)&&zr(i)){let[n,o]=v(Pr(r),Ql([Li(),hn()],([u,l],p)=>{let[m,f]=d_(p);return re([v(u,fo(m)),v(l,Kn(f))])})),[s,c]=v(Pr(i),Ql([Li(),hn()],([u,l],p)=>{let[m,f]=d_(p);return re([v(u,fo(m)),v(l,Kn(f))])}));if(!le(n,s))return!1;r=o,i=c}return!0},Hle=(e)=>Wle(Zt(e),hn()),Wle=(e,t)=>{while(!0){let[r,i]=v(e,ta([Li(),hn()],([o,s],c)=>{let[u,l]=d_(c);return[v(o,fo(u)),v(s,Kn(l))]})),n=Jo(r)>0?v(t,Cr(r)):t;if(XA(i))return mo(n);e=i,t=n}throw Error(mc("Cause.flattenCauseLoop"))},Fc=h(2,(e,t)=>{let r=[e];while(r.length>0){let i=r.pop(),n=t(i);switch(n._tag){case"None":{switch(i._tag){case Oc:case _c:{r.push(i.right),r.push(i.left);break}}break}case"Some":return n}}return H()});var d_=(e)=>{let t=e,r=[],i=Li(),n=hn();while(t!==void 0)switch(t._tag){case sa:{if(r.length===0)return[i,n];t=r.pop();break}case Rc:{if(i=Ec(i,Fm(t._tag,t.error)),r.length===0)return[i,n];t=r.pop();break}case Pc:{if(i=Ec(i,Fm(t._tag,t.defect)),r.length===0)return[i,n];t=r.pop();break}case Ac:{if(i=Ec(i,Fm(t._tag,t.fiberId)),r.length===0)return[i,n];t=r.pop();break}case Oc:{switch(t.left._tag){case sa:{t=t.right;break}case Oc:{t=Vt(t.left.left,Vt(t.left.right,t.right));break}case _c:{t=Xr(Vt(t.left.left,t.right),Vt(t.left.right,t.right));break}default:{n=Cr(n,t.right),t=t.left;break}}break}case _c:{r.push(t.right),t=t.left;break}}throw Error(mc("Cause.evaluateCauseLoop"))};var Zle={emptyCase:$o,failCase:$i,dieCase:$i,interruptCase:$o,sequentialCase:(e,t,r)=>t&&r,parallelCase:(e,t,r)=>t&&r};var Lq="SequentialCase",Bq="ParallelCase",Um=h(2,(e,{onDie:t,onEmpty:r,onFail:i,onInterrupt:n,onParallel:o,onSequential:s})=>x_(e,void 0,{emptyCase:()=>r,failCase:(c,u)=>i(u),dieCase:(c,u)=>t(u),interruptCase:(c,u)=>n(u),sequentialCase:(c,u,l)=>s(u,l),parallelCase:(c,u,l)=>o(u,l)})),Ql=h(3,(e,t,r)=>{let i=t,n=e,o=[];while(n!==void 0){let s=r(i,n);switch(i=Bt(s)?s.value:i,n._tag){case Oc:{o.push(n.right),n=n.left;break}case _c:{o.push(n.right),n=n.left;break}default:{n=void 0;break}}if(n===void 0&&o.length>0)n=o.pop()}return i}),x_=h(3,(e,t,r)=>{let i=[e],n=[];while(i.length>0){let s=i.pop();switch(s._tag){case sa:{n.push(Nr(r.emptyCase(t)));break}case Rc:{n.push(Nr(r.failCase(t,s.error)));break}case Pc:{n.push(Nr(r.dieCase(t,s.defect)));break}case Ac:{n.push(Nr(r.interruptCase(t,s.fiberId)));break}case Oc:{i.push(s.right),i.push(s.left),n.push(Mn({_tag:Lq}));break}case _c:{i.push(s.right),i.push(s.left),n.push(Mn({_tag:Bq}));break}}}let o=[];while(n.length>0){let s=n.pop();switch(s._tag){case"Left":{switch(s.left._tag){case Lq:{let c=o.pop(),u=o.pop(),l=r.sequentialCase(t,c,u);o.push(l);break}case Bq:{let c=o.pop(),u=o.pop(),l=r.parallelCase(t,c,u);o.push(l);break}}break}case"Right":{o.push(s.right);break}}}if(o.length===0)throw Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return o.pop()}),Zo=(e,t)=>{if(Bm(e))return"All fibers interrupted without errors.";return Wb(e).map(function(r){if(t?.renderErrorCause!==!0||r.cause===void 0)return r.stack;return`${r.stack} {
|
|
156
|
+
`).map(rue).filter(Boolean);if(!t)r.sort(function(n,o){let s=n.split("."),c=o.split(".");if(s.length===1||c.length===1)return tue(qy(s[0]),qy(c[0]));for(let u=0,l=Math.max(s.length,c.length);u<l;u++){let p=hU(qy(s[u]),qy(c[u]));if(p)return p}return 0});let i=t?r[0]:[...r].reverse().find((n)=>n.indexOf(".")>=0);return new h1(r,i)}}}),bU={};lr(bU,{addAnnotatedTagTask:()=>sue,addTagTask:()=>oue,tagListTask:()=>iue});function iue(e=[]){let t=e.some((r)=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return yU(r,t)}}}function oue(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function sue(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var aue=fe({"src/lib/tasks/tag.ts"(){nue()}}),cue=kse({"src/git.js"(e,t){var{GitExecutor:r}=(uae(),ir(pB)),{SimpleGitApi:i}=(uce(),ir(WB)),{Scheduler:n}=(lce(),ir(ZB)),{adhocExecTask:o,configurationErrorTask:s}=(or(),ir(UR)),{asArray:c,filterArray:u,filterPrimitives:l,filterString:p,filterStringOrStringArray:m,filterType:f,getTrailingOptions:g,trailingFunctionArgument:S,trailingOptionsArgument:P}=(We(),ir(F1)),{applyPatchTask:D}=(dce(),ir(KB)),{branchTask:L,branchLocalTask:Se,deleteBranchesTask:Q,deleteBranchTask:se}=(kce(),ir(nU)),{checkIgnoreTask:me}=(Pce(),ir(sU)),{checkIsRepoTask:F}=(z1(),ir($1)),{cleanWithOptionsTask:Be,isCleanOptionsArray:Te}=(K1(),ir(V1)),{diffSummaryTask:Pe}=(gA(),ir(IB)),{fetchTask:Je}=(Dce(),ir(cU)),{moveTask:Xe}=(jce(),ir(lU)),{pullTask:He}=(zce(),ir(pU)),{pushTagsTask:ge}=(zB(),ir(NB)),{addRemoteTask:xe,getRemotesTask:Me,listRemotesTask:ee,remoteTask:at,removeRemoteTask:ft}=(Vce(),ir(mU)),{getResetMode:cr,resetTask:w}=(cB(),ir(oB)),{stashListTask:zt}=(Kce(),ir(fU)),{addSubModuleTask:Fr,initSubModuleTask:I,subModuleTask:ur,updateSubModuleTask:qt}=(eue(),ir(gU)),{addAnnotatedTagTask:En,addTagTask:Hr,tagListTask:St}=(aue(),ir(bU)),{straightThroughBufferTask:ht,straightThroughStringTask:Tt}=(or(),ir(UR));function Ie(oe,Ee){this._plugins=Ee,this._executor=new r(oe.baseDir,new n(oe.maxConcurrentProcesses),Ee),this._trimmed=oe.trimmed}(Ie.prototype=Object.create(i.prototype)).constructor=Ie,Ie.prototype.customBinary=function(oe){return this._plugins.reconfigure("binary",oe),this},Ie.prototype.env=function(oe,Ee){if(arguments.length===1&&typeof oe==="object")this._executor.env=oe;else(this._executor.env=this._executor.env||{})[oe]=Ee;return this},Ie.prototype.stashList=function(oe){return this._runTask(zt(P(arguments)||{},u(oe)&&oe||[]),S(arguments))},Ie.prototype.mv=function(oe,Ee){return this._runTask(Xe(oe,Ee),S(arguments))},Ie.prototype.checkoutLatestTag=function(oe){var Ee=this;return this.pull(function(){Ee.tags(function(gt,nr){Ee.checkout(nr.latest,oe)})})},Ie.prototype.pull=function(oe,Ee,gt,nr){return this._runTask(He(f(oe,p),f(Ee,p),g(arguments)),S(arguments))},Ie.prototype.fetch=function(oe,Ee){return this._runTask(Je(f(oe,p),f(Ee,p),g(arguments)),S(arguments))},Ie.prototype.silent=function(oe){return this._runTask(o(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Ie.prototype.tags=function(oe,Ee){return this._runTask(St(g(arguments)),S(arguments))},Ie.prototype.rebase=function(){return this._runTask(Tt(["rebase",...g(arguments)]),S(arguments))},Ie.prototype.reset=function(oe){return this._runTask(w(cr(oe),g(arguments)),S(arguments))},Ie.prototype.revert=function(oe){let Ee=S(arguments);if(typeof oe!=="string")return this._runTask(s("Commit must be a string"),Ee);return this._runTask(Tt(["revert",...g(arguments,0,!0),oe]),Ee)},Ie.prototype.addTag=function(oe){let Ee=typeof oe==="string"?Hr(oe):s("Git.addTag requires a tag name");return this._runTask(Ee,S(arguments))},Ie.prototype.addAnnotatedTag=function(oe,Ee){return this._runTask(En(oe,Ee),S(arguments))},Ie.prototype.deleteLocalBranch=function(oe,Ee,gt){return this._runTask(se(oe,typeof Ee==="boolean"?Ee:!1),S(arguments))},Ie.prototype.deleteLocalBranches=function(oe,Ee,gt){return this._runTask(Q(oe,typeof Ee==="boolean"?Ee:!1),S(arguments))},Ie.prototype.branch=function(oe,Ee){return this._runTask(L(g(arguments)),S(arguments))},Ie.prototype.branchLocal=function(oe){return this._runTask(Se(),S(arguments))},Ie.prototype.raw=function(oe){let Ee=!Array.isArray(oe),gt=[].slice.call(Ee?arguments:oe,0);for(let hr=0;hr<gt.length&&Ee;hr++)if(!l(gt[hr])){gt.splice(hr,gt.length-hr);break}gt.push(...g(arguments,0,!0));var nr=S(arguments);if(!gt.length)return this._runTask(s("Raw: must supply one or more command to execute"),nr);return this._runTask(Tt(gt,this._trimmed),nr)},Ie.prototype.submoduleAdd=function(oe,Ee,gt){return this._runTask(Fr(oe,Ee),S(arguments))},Ie.prototype.submoduleUpdate=function(oe,Ee){return this._runTask(qt(g(arguments,!0)),S(arguments))},Ie.prototype.submoduleInit=function(oe,Ee){return this._runTask(I(g(arguments,!0)),S(arguments))},Ie.prototype.subModule=function(oe,Ee){return this._runTask(ur(g(arguments)),S(arguments))},Ie.prototype.listRemote=function(){return this._runTask(ee(g(arguments)),S(arguments))},Ie.prototype.addRemote=function(oe,Ee,gt){return this._runTask(xe(oe,Ee,g(arguments)),S(arguments))},Ie.prototype.removeRemote=function(oe,Ee){return this._runTask(ft(oe),S(arguments))},Ie.prototype.getRemotes=function(oe,Ee){return this._runTask(Me(oe===!0),S(arguments))},Ie.prototype.remote=function(oe,Ee){return this._runTask(at(g(arguments)),S(arguments))},Ie.prototype.tag=function(oe,Ee){let gt=g(arguments);if(gt[0]!=="tag")gt.unshift("tag");return this._runTask(Tt(gt),S(arguments))},Ie.prototype.updateServerInfo=function(oe){return this._runTask(Tt(["update-server-info"]),S(arguments))},Ie.prototype.pushTags=function(oe,Ee){let gt=ge({remote:f(oe,p)},g(arguments));return this._runTask(gt,S(arguments))},Ie.prototype.rm=function(oe){return this._runTask(Tt(["rm","-f",...c(oe)]),S(arguments))},Ie.prototype.rmKeepLocal=function(oe){return this._runTask(Tt(["rm","--cached",...c(oe)]),S(arguments))},Ie.prototype.catFile=function(oe,Ee){return this._catFile("utf-8",arguments)},Ie.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},Ie.prototype._catFile=function(oe,Ee){var gt=S(Ee),nr=["cat-file"],hr=Ee[0];if(typeof hr==="string")return this._runTask(s("Git.catFile: options must be supplied as an array of strings"),gt);if(Array.isArray(hr))nr.push.apply(nr,hr);let Wr=oe==="buffer"?ht(nr):Tt(nr);return this._runTask(Wr,gt)},Ie.prototype.diff=function(oe,Ee){let gt=p(oe)?s("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Tt(["diff",...g(arguments)]);return this._runTask(gt,S(arguments))},Ie.prototype.diffSummary=function(){return this._runTask(Pe(g(arguments,1)),S(arguments))},Ie.prototype.applyPatch=function(oe){let Ee=!m(oe)?s("git.applyPatch requires one or more string patches as the first argument"):D(c(oe),g([].slice.call(arguments,1)));return this._runTask(Ee,S(arguments))},Ie.prototype.revparse=function(){let oe=["rev-parse",...g(arguments,!0)];return this._runTask(Tt(oe,!0),S(arguments))},Ie.prototype.clean=function(oe,Ee,gt){let nr=Te(oe),hr=nr&&oe.join("")||f(oe,p)||"",Wr=g([].slice.call(arguments,nr?1:0));return this._runTask(Be(hr,Wr),S(arguments))},Ie.prototype.exec=function(oe){let Ee={commands:[],format:"utf-8",parser(){if(typeof oe==="function")oe()}};return this._runTask(Ee)},Ie.prototype.clearQueue=function(){return this._runTask(o(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},Ie.prototype.checkIgnore=function(oe,Ee){return this._runTask(me(c(f(oe,m,[]))),S(arguments))},Ie.prototype.checkIsRepo=function(oe,Ee){return this._runTask(F(f(oe,p)),S(arguments))},t.exports=Ie}});Zs();var uue=class extends Fo{constructor(e,t){super(void 0,t);this.config=e}};Zs();Zs();var _l=class extends Fo{constructor(e,t,r){super(e,r);this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Ol();w1();z1();K1();X1();tB();iB();cB();function lue(e){if(!e)return;return[{type:"spawn.before",action(i,n){if(e.aborted)n.kill(new _l(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(i,n){function o(){n.kill(new _l(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),n.spawned.on("close",()=>e.removeEventListener("abort",o))}}]}function pue(e={}){return{type:"spawn.args",action(t,{env:r}){for(let i of qL(t,r))if(e[i.category]!==!0)throw new _l(void 0,"unsafe",i.message);return t}}}We();function due(e){let t=bm(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}We();var y1=Rl.deferred().promise;function mue({onClose:e=!0,onExit:t=50}={}){function r(){let n=-1,o={close:Rl.deferred(),closeTimeout:Rl.deferred(),exit:Rl.deferred(),exitTimeout:Rl.deferred()},s=Promise.race([e===!1?y1:o.closeTimeout.promise,t===!1?y1:o.exitTimeout.promise]);return i(e,o.close,o.closeTimeout),i(t,o.exit,o.exitTimeout),{close(c){n=c,o.close.done()},exit(c){n=c,o.exit.done()},get exitCode(){return n},result:s}}function i(n,o,s){if(n===!1)return;(n===!0?o.promise:o.promise.then(()=>$R(n))).then(s.done)}return{type:"spawn.after",async action(n,{spawned:o,close:s}){let c=r(),u=!0,l=()=>void(u=!1);o.stdout?.on("data",l),o.stderr?.on("data",l),o.on("error",l),o.on("close",(p)=>c.close(p)),o.on("exit",(p)=>c.exit(p));try{if(await c.result,u)await $R(50);s(c.exitCode)}catch(p){s(c.exitCode,p)}}}}We();var fue="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",b1="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function gue(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function x1(e,t){if(e.length<1||e.length>2)throw new _l(void 0,"binary",fue);if(e.some(gue))if(t)console.warn(b1);else throw new _l(void 0,"binary",b1);let[i,n]=e;return{binary:i,prefix:n}}function hue(e,t=["git"],r=!1){let i=x1(so(t),r);e.on("binary",(n)=>{i=x1(so(n),r)}),e.append("spawn.binary",()=>i.binary),e.append("spawn.args",(n)=>i.prefix?[i.prefix,...n]:n)}Zs();function yue(e){return!!(e.exitCode&&e.stdErr.length)}function bue(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function xue(e=!1,t=yue,r=bue){return(i,n)=>{if(!e&&i||!t(n))return i;return r(n)}}function S1(e){return{type:"task.error",action(t,r){let i=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});if(Buffer.isBuffer(i))return{error:new Fo(void 0,i.toString("utf-8"))};return{error:i}}}}We();var vue=class{constructor(){this.plugins=new Set,this.events=new Sue}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=yi(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return so(e).forEach((r)=>r&&this.plugins.add(yi(t,r))),()=>{t.forEach((r)=>this.plugins.delete(r))}}exec(e,t,r){let i=t,n=Object.freeze(Object.create(r));for(let o of this.plugins)if(o.type===e)i=o.action(i,n);return i}};We();function wue(e){let r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,s){if(!r.includes(s.method))return o;return P1(o,"--progress")}},{type:"spawn.after",action(o,s){if(!s.commands.includes("--progress"))return;s.spawned.stderr?.on("data",(c)=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));if(!u)return;e({method:s.method,stage:kue(u[1]),progress:At(u[2]),processed:At(u[3]),total:At(u[4])})})}}]}function kue(e){return String(e.toLowerCase().split(" ",1))||"unknown"}We();function Iue(e){let t=A1(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Tue({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(i,n){let o;function s(){o&&clearTimeout(o),o=setTimeout(u,e)}function c(){n.spawned.stdout?.off("data",s),n.spawned.stderr?.off("data",s),n.spawned.off("exit",c),n.spawned.off("close",c),o&&clearTimeout(o)}function u(){c(),n.kill(new _l(void 0,"timeout","block timeout reached"))}r&&n.spawned.stdout?.on("data",s),t&&n.spawned.stderr?.on("data",s),n.spawned.on("exit",c),n.spawned.on("close",c),s()}}}function Eue(){return{type:"spawn.args",action(e){let t=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;n<e.length;n++){let o=e[n];if(fi(o)){i(Cl(o));continue}if(o==="--"){i(e.slice(n+1).flatMap((s)=>fi(s)&&Cl(s)||s));break}t.push(o)}return!r?t:[...t,"--",...r.map(String)]}}}We();var Cue=cue();function Pue(e,t){let r=new vue,i=D1(e&&(typeof e==="string"?{baseDir:e}:e)||{},t);if(!XR(i.baseDir))throw new uue(i,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(i.config))r.add(due(i.config));return r.add(pue(i.unsafe)),r.add(mue(i.completion)),i.abort&&r.add(lue(i.abort)),i.progress&&r.add(wue(i.progress)),i.timeout&&r.add(Tue(i.timeout)),i.spawnOptions&&r.add(Iue(i.spawnOptions)),r.add(Eue()),r.add(S1(xue(!0))),i.errors&&r.add(S1(i.errors)),hue(r,i.binary,i.unsafe?.allowUnsafeCustomBinary),new Cue(i,r)}Ol();var cb=Pue;class ub{tail=Promise.resolve();run(e,t){if(t?.aborted)return Promise.reject(t.reason);let r=this.tail,i=()=>{};this.tail=new Promise((s)=>{i=s});let n=!1,o=r.then(async()=>{try{return n=!0,t?.throwIfAborted(),await e()}finally{i()}});return Rue(o,()=>n,t)}async idle(){await this.tail}}class xA{tails=new Map;async run(e,t){let r=this.tails.get(e),i=()=>{},n=new Promise((o)=>{i=o});this.tails.set(e,n),await r;try{return await t()}finally{if(i(),this.tails.get(e)===n)this.tails.delete(e)}}}function Rue(e,t,r){if(!r)return e;return new Promise((i,n)=>{let o=()=>{if(!t())n(r.reason)};r.addEventListener("abort",o,{once:!0}),e.then(i,n).finally(()=>{r.removeEventListener("abort",o)})})}import{readdir as fIe,readFile as gIe}from"fs/promises";var SA=(e)=>typeof e==="function",h=function(e,t){if(typeof e==="function")return function(){if(e(arguments))return t.apply(this,arguments);return(r)=>t(r,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(r,i){if(arguments.length>=2)return t(r,i);return function(n){return t(n,r)}};case 3:return function(r,i,n){if(arguments.length>=3)return t(r,i,n);return function(o){return t(o,r,i)}};case 4:return function(r,i,n,o){if(arguments.length>=4)return t(r,i,n,o);return function(s){return t(s,r,i,n)}};case 5:return function(r,i,n,o,s){if(arguments.length>=5)return t(r,i,n,o,s);return function(c){return t(c,r,i,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(i){return t(i,...r)}}}};var Ze=(e)=>e;var Tm=(e)=>()=>e,$o=Tm(!0),$i=Tm(!1);var lb=Tm(void 0),ao=lb;function v(e,t,r,i,n,o,s,c,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return r(t(e));case 4:return i(r(t(e)));case 5:return n(i(r(t(e))));case 6:return o(n(i(r(t(e)))));case 7:return s(o(n(i(r(t(e))))));case 8:return c(s(o(n(i(r(t(e)))))));case 9:return u(c(s(o(n(i(r(t(e))))))));default:{let l=arguments[0];for(let p=1;p<arguments.length;p++)l=arguments[p](l);return l}}}var pb=(e)=>(t,r)=>t===r||e(t,r);var xU=h(2,(e,t)=>pb((r,i)=>e(t(r),t(i))));var SU=(e)=>pb((t,r)=>{if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++)if(!e(t[i],r[i]))return!1;return!0});var vU=(e)=>h(3,(t,r,i)=>e(t,(n)=>({...n,[r]:i(n)}))),wU=(e)=>h(2,(t,r)=>e(t,(i)=>({[r]:i}))),kU=(e,t)=>h(3,(r,i,n)=>t(r,(o)=>e(n(o),(s)=>({...o,[i]:s}))));var Em,Fe=(e,t)=>{if(!Em)globalThis["effect/GlobalValue"]??=new Map,Em=globalThis["effect/GlobalValue"];if(!Em.has(e))Em.set(e,t());return Em.get(e)};var Cm=(e)=>typeof e==="string",Pm=(e)=>typeof e==="number";var wA=(e)=>typeof e==="bigint";var Gs=SA;var _ue=(e)=>typeof e==="object"&&e!==null,Ks=(e)=>_ue(e)||Gs(e),pe=h(2,(e,t)=>Ks(e)&&(t in e)),Qs=h(2,(e,t)=>pe(e,"_tag")&&e._tag===t),dc=(e)=>e===null||e===void 0;var bi=(e)=>typeof e==="string"||pe(e,Symbol.iterator);var kA=(e)=>pe(e,"then")&&Gs(e.then);var mc=(e)=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;var IU=Symbol.for("effect/Gen/GenKind");class Oue{value;constructor(e){this.value=e}get _F(){return Ze}get _R(){return(e)=>e}get _O(){return(e)=>e}get _E(){return(e)=>e}[IU]=IU;[Symbol.iterator](){return new fc(this)}}class fc{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new fc(this.self)}}var Due=335903614,Mue=4150755663,Fue=1481765933,$ue=1284865837,jue=9007199254740992,Nue=134217728;class TA{_state;constructor(e,t,r,i){if(dc(t)&&dc(e))t=Math.random()*4294967295>>>0,e=0;else if(dc(t))t=e,e=0;if(dc(i)&&dc(r))i=this._state?this._state[3]:Mue,r=this._state?this._state[2]:Due;else if(dc(i))i=r,r=0;return this._state=new Int32Array([0,0,r>>>0,((i||0)|1)>>>0]),this._next(),TU(this._state,this._state[0],this._state[1],e>>>0,t>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(e){this._state[0]=e[0],this._state[1]=e[1],this._state[2]=e[2],this._state[3]=e[3]|1}integer(e){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%e}number(){let e=(this._next()&67108863)*1,t=(this._next()&134217727)*1;return(e*Nue+t)/jue}_next(){let e=this._state[0]>>>0,t=this._state[1]>>>0;zue(this._state,e,t,Fue,$ue),TU(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=e>>>18,i=(t>>>18|e<<14)>>>0;r=(r^e)>>>0,i=(i^t)>>>0;let n=(i>>>27|r<<5)>>>0,o=e>>>27,s=(-o>>>0&31)>>>0;return(n>>>o|n<<s)>>>0}}function zue(e,t,r,i,n){let o=(r>>>16)*(n&65535)>>>0,s=(r&65535)*(n>>>16)>>>0,c=(r&65535)*(n&65535)>>>0,u=(r>>>16)*(n>>>16)+((s>>>16)+(o>>>16))>>>0;if(s=s<<16>>>0,c=c+s>>>0,c>>>0<s>>>0)u=u+1>>>0;if(o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0)u=u+1>>>0;u=u+Math.imul(r,i)>>>0,u=u+Math.imul(t,n)>>>0,e[0]=u,e[1]=c}function TU(e,t,r,i,n){let o=t+i>>>0,s=r+n>>>0;if(s>>>0<r>>>0)o=o+1|0;e[0]=o,e[1]=s}var IA=Symbol.for("effect/Utils/YieldWrap");class jo{#t;constructor(e){this.#t=e}[IA](){return this.#t}}function EA(e){if(typeof e==="object"&&e!==null&&IA in e)return e[IA]();throw Error(mc("yieldWrapGet"))}var On=Fe("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0}));var EU={effect_internal_function:(e)=>e()},Lue={effect_internal_function:(e)=>{try{return e()}finally{}}},Bue=EU.effect_internal_function(()=>Error().stack)?.includes("effect_internal_function")===!0,Jt=Bue?EU.effect_internal_function:Lue.effect_internal_function,Uue=function*(){}.constructor,CU=(e)=>Ks(e)&&e.constructor===Uue;var CA=Fe(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),be=Symbol.for("effect/Hash"),ue=(e)=>{if(On.enabled===!0)return 0;switch(typeof e){case"number":return fb(e);case"bigint":return lt(e.toString(10));case"boolean":return lt(String(e));case"symbol":return lt(String(e));case"string":return lt(e);case"undefined":return lt("undefined");case"function":case"object":if(e===null)return lt("null");else if(e instanceof Date){if(Number.isNaN(e.getTime()))return lt("Invalid Date");return ue(e.toISOString())}else if(e instanceof URL)return ue(e.href);else if(Jue(e))return e[be]();else return Ml(e);default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Ml=(e)=>{if(!CA.has(e))CA.set(e,fb(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return CA.get(e)},Re=(e)=>(t)=>t*53^e,mb=(e)=>e&3221225471|e>>>1&1073741824,Jue=(e)=>pe(e,be),fb=(e)=>{if(e!==e||e===1/0)return 0;let t=e|0;if(t!==e)t^=e*4294967295;while(e>4294967295)t^=e/=4294967295;return mb(t)},lt=(e)=>{let t=5381,r=e.length;while(r)t=t*33^e.charCodeAt(--r);return mb(t)},Hue=(e,t)=>{let r=12289;for(let i=0;i<t.length;i++)r^=v(lt(t[i]),Re(ue(e[t[i]])));return mb(r)},gb=(e)=>Hue(e,Object.keys(e)),Dn=(e)=>{let t=6151;for(let r=0;r<e.length;r++)t=v(t,Re(ue(e[r])));return mb(t)},Ue=function(){if(arguments.length===1){let r=arguments[0];return function(i){return Object.defineProperty(r,be,{value(){return i},enumerable:!1}),i}}let e=arguments[0],t=arguments[1];return Object.defineProperty(e,be,{value(){return t},enumerable:!1}),t};var he=Symbol.for("effect/Equal");function le(){if(arguments.length===1)return(e)=>hb(e,arguments[0]);return hb(arguments[0],arguments[1])}function hb(e,t){if(e===t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r==="object"||r==="function"){if(e!==null&&t!==null){if(Fl(e)&&Fl(t))if(ue(e)===ue(t)&&e[he](t))return!0;else return On.enabled&&On.tester?On.tester(e,t):!1;else if(e instanceof Date&&t instanceof Date){let i=e.getTime(),n=t.getTime();return i===n||Number.isNaN(i)&&Number.isNaN(n)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(On.enabled){if(e===null||t===null)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((i,n)=>hb(i,t[n]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let i=Object.keys(e),n=Object.keys(t);if(i.length===n.length){for(let o of i)if(!((o in t)&&hb(e[o],t[o])))return On.tester?On.tester(e,t):!1;return!0}}return On.tester?On.tester(e,t):!1}}return On.enabled&&On.tester?On.tester(e,t):!1}var Fl=(e)=>pe(e,he),Rm=()=>le;var qe=Symbol.for("nodejs.util.inspect.custom"),et=(e)=>{try{if(pe(e,"toJSON")&&Gs(e.toJSON)&&e.toJSON.length===0)return e.toJSON();else if(Array.isArray(e))return e.map(et)}catch{return{}}return AU(e)};var it=(e)=>JSON.stringify(e,null,2),X1e={toJSON(){return et(this)},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}};class Wue{[qe](){return this.toJSON()}toString(){return it(this.toJSON())}}var No=(e,t=2)=>{if(typeof e==="string")return e;try{return typeof e==="object"?yb(e,t):String(e)}catch{return String(e)}},yb=(e,t)=>{let r=[],i=JSON.stringify(e,(n,o)=>typeof o==="object"&&o!==null?r.includes(o)?void 0:r.push(o)&&(gc.fiberRefs!==void 0&&PU(o)?o[PA](gc.fiberRefs):o):o,t);return r=void 0,i},PA=Symbol.for("effect/Inspectable/Redactable"),PU=(e)=>typeof e==="object"&&e!==null&&(PA in e),gc=Fe("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),RU=(e,t)=>{let r=gc.fiberRefs;gc.fiberRefs=e;try{return t()}finally{gc.fiberRefs=r}},AU=(e)=>{if(PU(e)&&gc.fiberRefs!==void 0)return e[PA](gc.fiberRefs);return e};var ae=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let i=0,n=t.length;i<n;i++)r=t[i](r);return r}}};var hc="Async",yc="Commit",Ht="Failure",$l="OnFailure",jl="OnSuccess",Nl="OnSuccessAndFailure",Wt="Success",bb="Sync",_U="Tag",zo="UpdateRuntimeFlags",zl="While",bc="Iterator",xb="WithRuntime",Ll="Yield",Am="RevertFlags";var Zue="3.22.0",Om=()=>Zue;var DU=Symbol.for("effect/Effect"),MU=Symbol.for("effect/Stream"),FU=Symbol.for("effect/Sink"),$U=Symbol.for("effect/Channel"),Ys={_R:(e)=>e,_E:(e)=>e,_A:(e)=>e,_V:Om()},Vue={_A:(e)=>e,_In:(e)=>e,_L:(e)=>e,_E:(e)=>e,_R:(e)=>e},Gue={_Env:(e)=>e,_InErr:(e)=>e,_InElem:(e)=>e,_InDone:(e)=>e,_OutErr:(e)=>e,_OutElem:(e)=>e,_OutDone:(e)=>e},Lo={[DU]:Ys,[MU]:Ys,[FU]:Vue,[$U]:Gue,[he](e){return this===e},[be](){return Ue(this,Ml(this))},[Symbol.iterator](){return new fc(new jo(this))},pipe(){return ae(this,arguments)}},Bl={[be](){return Ue(this,gb(this))},[he](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let i of t)if(!((i in e)&&le(this[i],e[i])))return!1;return!0}},xi={...Lo,_op:yc},AA={...xi,...Bl},jU=function(){function e(){}return e.prototype=xi,e}();var zU=Symbol.for("effect/Option"),LU={...Lo,[zU]:{_A:(e)=>e},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}},Kue=Object.assign(Object.create(LU),{_tag:"Some",_op:"Some",[he](e){return _A(e)&&OA(e)&&le(this.value,e.value)},[be](){return Ue(this,Re(ue(this._tag))(ue(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:et(this.value)}}}),Que=ue("None"),Yue=Object.assign(Object.create(LU),{_tag:"None",_op:"None",[he](e){return _A(e)&&Ul(e)},[be](){return Que},toJSON(){return{_id:"Option",_tag:this._tag}}}),_A=(e)=>pe(e,zU),Ul=(e)=>e._tag==="None",OA=(e)=>e._tag==="Some",Sb=Object.create(Yue),Xs=(e)=>{let t=Object.create(Kue);return t.value=e,t};var MA=Symbol.for("effect/Either"),BU={...Lo,[MA]:{_R:(e)=>e},[qe](){return this.toJSON()},toString(){return it(this.toJSON())}},Xue=Object.assign(Object.create(BU),{_tag:"Right",_op:"Right",[he](e){return FA(e)&&jA(e)&&le(this.right,e.right)},[be](){return Re(ue(this._tag))(ue(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:et(this.right)}}}),ele=Object.assign(Object.create(BU),{_tag:"Left",_op:"Left",[he](e){return FA(e)&&$A(e)&&le(this.left,e.left)},[be](){return Re(ue(this._tag))(ue(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:et(this.left)}}}),FA=(e)=>pe(e,MA),$A=(e)=>e._tag==="Left",jA=(e)=>e._tag==="Right",UU=(e)=>{let t=Object.create(ele);return t.left=e,t},qU=(e)=>{let t=Object.create(Xue);return t.right=e,t};var Nr=qU;var Mn=UU;var co=$A,ql=jA;var nle=h(2,(e,{onLeft:t,onRight:r})=>co(e)?t(e.left):r(e.right));var vb=nle({onLeft:Ze,onRight:Ze});var NA=(e)=>e.length>0;var zA=(e)=>(t,r)=>t===r?0:e(t,r);var JU=zA((e,t)=>e<t?-1:1);var wb=h(2,(e,t)=>zA((r,i)=>e(t(r),t(i))));var ole=(e)=>zA((t,r)=>{let i=Math.min(t.length,r.length),n=0;for(let o of e){if(n>=i)break;let s=o(t[n],r[n]);if(s!==0)return s;n++}return 0});var HU=(...e)=>ole(e);var LA=(e)=>h(2,(t,r)=>e(t,r)===1);var H=()=>Sb,re=Xs;var Ft=Ul,Bt=OA,yr=h(2,(e,{onNone:t,onSome:r})=>Ft(e)?t():r(e.value));var br=h(2,(e,t)=>Ft(e)?t():e.value);var WU=h(2,(e,t)=>Ft(e)?re(t()):e);var Bo=(e)=>e==null?H():re(e);var Kr=br(lb);var sle=h(2,(e,t)=>{if(Bt(e))return e.value;throw t()}),ZU=sle(()=>Error("getOrThrow called on a None")),Gn=h(2,(e,t)=>Ft(e)?H():re(t(e.value)));var xc=h(2,(e,t)=>Ft(e)?H():t(e.value));var ale=(e)=>h(2,(t,r)=>Ft(t)?!1:e(t.value,r)),cle=Rm(),VU=ale(cle);var Dm=(e)=>(t,r)=>{if(Ft(t))return r;else if(Ft(r))return t;return re(e(t.value,r.value))};var GU=(...e)=>e;var Mm=(e)=>Array(e),UA=h(2,(e,t)=>{let r=Math.max(1,Math.floor(e)),i=Array(r);for(let n=0;n<r;n++)i[n]=t(n);return i});var ot=(e)=>Array.isArray(e)?e:Array.from(e),KU=(e)=>Array.isArray(e)?e:[e];var Jl=h(2,(e,t)=>[t,...e]);var QU=h(2,(e,t)=>[...e,t]),qA=h(2,(e,t)=>ot(e).concat(ot(t)));var lle=(e)=>e.length===0,YU=lle,kb=NA,Qr=NA;var XU=(e,t)=>e<0||e>=t.length,ple=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),dle=h(2,(e,t)=>{let r=Math.floor(t);return XU(r,e)?H():re(e[r])}),JA=h(2,(e,t)=>{let r=Math.floor(t);if(XU(r,e))throw Error(`Index ${r} out of bounds`);return e[r]});var ea=dle(0),Er=JA(0),Ib=(e)=>Qr(e)?re(HA(e)):H(),HA=(e)=>e[e.length-1];var uo=(e)=>e.slice(1);var mle=(e,t)=>{let r=0;for(let i of e){if(!t(i,r))break;r++}return r},eq=h(2,(e,t)=>gle(e,mle(e,t))),tq=h(2,(e,t)=>{let r=ot(e);return r.slice(ple(t,r),r.length)});var WA=(e)=>Array.from(e).reverse(),Sc=h(2,(e,t)=>{let r=Array.from(e);return r.sort(t),r});var ZA=h(2,(e,t)=>rq(e,t,GU)),rq=h(3,(e,t,r)=>{let i=ot(e),n=ot(t);if(Qr(i)&&Qr(n)){let o=[r(Er(i),Er(n))],s=Math.min(i.length,n.length);for(let c=1;c<s;c++)o[c]=r(i[c],n[c]);return o}return[]});var fle=Rm();var gle=h(2,(e,t)=>{let r=Array.from(e),i=Math.floor(t);if(Qr(r)){if(i>=1)return hle(r,i);return[[],r]}return[r,[]]}),hle=h(2,(e,t)=>{let r=Math.max(1,Math.floor(t));return r>=e.length?[yle(e),[]]:[Jl(e.slice(1,r),Er(e)),e.slice(r)]});var yle=(e)=>e.slice();var ble=h(3,(e,t,r)=>{let i=ot(e),n=ot(t);if(Qr(i)){if(Qr(n))return oq(r)(qA(i,n));return i}return n}),Ni=h(2,(e,t)=>ble(e,t,fle));var zi=()=>[],gn=(e)=>[e],lo=h(2,(e,t)=>e.map(t)),nq=h(2,(e,t)=>{if(YU(e))return[];let r=[];for(let i=0;i<e.length;i++){let n=t(e[i],i);for(let o=0;o<n.length;o++)r.push(n[o])}return r}),Tb=nq(Ze),Hl=h(2,(e,t)=>{let r=ot(e),i=[];for(let n=0;n<r.length;n++){let o=t(r[n],n);if(Bt(o))i.push(o.value)}return i});var VA=h(2,(e,t)=>{let r=[],i=[],n=ot(e);for(let o=0;o<n.length;o++){let s=t(n[o],o);if(co(s))r.push(s.left);else i.push(s.right)}return[r,i]}),iq=Hl(Ze);var ta=h(3,(e,t,r)=>ot(e).reduce((i,n,o)=>r(i,n,o),t)),Eb=h(3,(e,t,r)=>ot(e).reduceRight((i,n,o)=>r(i,n,o),t));var GA=(e,t)=>{let r=[],i=e,n;while(Bt(n=t(i))){let[o,s]=n.value;r.push(o),i=s}return r};var Wl=SU;var oq=h(2,(e,t)=>{let r=ot(e);if(Qr(r)){let i=[Er(r)],n=uo(r);for(let o of n)if(i.every((s)=>!t(o,s)))i.push(o);return i}return[]}),KA=(e)=>oq(e,Rm());var Uo=h(2,(e,t)=>ot(e).join(t));var sq=Symbol.for("effect/Chunk");function xle(e,t,r,i,n){for(let o=t;o<Math.min(e.length,t+n);o++)r[i+o-t]=e[o];return r}var aq=[],Sle=(e)=>pb((t,r)=>t.length===r.length&&Si(t).every((i,n)=>e(i,vc(r,n)))),vle=Sle(le),wle={[sq]:{_A:(e)=>e},toString(){return it(this.toJSON())},toJSON(){return{_id:"Chunk",values:Si(this).map(et)}},[qe](){return this.toJSON()},[he](e){return cq(e)&&vle(this,e)},[be](){return Ue(this,Dn(Si(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return aq[Symbol.iterator]();default:return Si(this)[Symbol.iterator]()}},pipe(){return ae(this,arguments)}},xr=(e)=>{let t=Object.create(wle);switch(t.backing=e,e._tag){case"IEmpty":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case"IConcat":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case"IArray":{t.length=e.array.length,t.depth=0,t.left=po,t.right=po;break}case"ISingleton":{t.length=1,t.depth=0,t.left=po,t.right=po;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=po,t.right=po;break}}return t},cq=(e)=>pe(e,sq),po=xr({_tag:"IEmpty"}),hn=()=>po,Fm=(...e)=>Ele(e),Zt=(e)=>xr({_tag:"ISingleton",a:e}),wc=(e)=>cq(e)?e:$m(ot(e)),QA=(e,t,r)=>{switch(e.backing._tag){case"IArray":{xle(e.backing.array,0,t,r,e.length);break}case"IConcat":{QA(e.left,t,r),QA(e.right,t,r+e.left.length);break}case"ISingleton":{t[r]=e.backing.a;break}case"ISlice":{let i=0,n=r;while(i<e.length)t[n]=vc(e,i),i+=1,n+=1;break}}};var kle=(e)=>{switch(e.backing._tag){case"IEmpty":return aq;case"IArray":return e.backing.array;default:{let t=Array(e.length);return QA(e,t,0),e.backing={_tag:"IArray",array:t},e.left=po,e.right=po,e.depth=0,t}}},Si=kle,Ile=(e)=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return xr({_tag:"IArray",array:WA(e.backing.array)});case"IConcat":return xr({_tag:"IConcat",left:mo(e.backing.right),right:mo(e.backing.left)});case"ISlice":return $m(WA(Si(e)))}},mo=Ile,Tle=h(2,(e,t)=>t<0||t>=e.length?H():re(vc(e,t))),$m=(e)=>e.length===0?hn():e.length===1?Zt(e[0]):xr({_tag:"IArray",array:e}),Ele=(e)=>$m(e),vc=h(2,(e,t)=>{switch(e.backing._tag){case"IEmpty":throw Error("Index out of bounds");case"ISingleton":{if(t!==0)throw Error("Index out of bounds");return e.backing.a}case"IArray":{if(t>=e.length||t<0)throw Error("Index out of bounds");return e.backing.array[t]}case"IConcat":return t<e.left.length?vc(e.left,t):vc(e.right,t-e.left.length);case"ISlice":return vc(e.backing.chunk,t+e.backing.offset)}}),Cb=h(2,(e,t)=>Kn(e,Zt(t))),Cr=h(2,(e,t)=>Kn(Zt(t),e));var YA=h(2,(e,t)=>{if(t<=0)return e;else if(t>=e.length)return po;else switch(e.backing._tag){case"ISlice":return xr({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":{if(t>e.left.length)return YA(e.right,t-e.left.length);return xr({_tag:"IConcat",left:YA(e.left,t),right:e.right})}default:return xr({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}});var Kn=h(2,(e,t)=>{if(e.backing._tag==="IEmpty")return t;if(t.backing._tag==="IEmpty")return e;let r=t.depth-e.depth;if(Math.abs(r)<=1)return xr({_tag:"IConcat",left:e,right:t});else if(r<-1)if(e.left.depth>=e.right.depth){let i=Kn(e.right,t);return xr({_tag:"IConcat",left:e.left,right:i})}else{let i=Kn(e.right.right,t);if(i.depth===e.depth-3){let n=xr({_tag:"IConcat",left:e.right.left,right:i});return xr({_tag:"IConcat",left:e.left,right:n})}else{let n=xr({_tag:"IConcat",left:e.left,right:e.right.left});return xr({_tag:"IConcat",left:n,right:i})}}else if(t.right.depth>=t.left.depth){let i=Kn(e,t.left);return xr({_tag:"IConcat",left:i,right:t.right})}else{let i=Kn(e,t.left.left);if(i.depth===t.depth-3){let n=xr({_tag:"IConcat",left:i,right:t.left.right});return xr({_tag:"IConcat",left:n,right:t.right})}else{let n=xr({_tag:"IConcat",left:t.left.right,right:t.right});return xr({_tag:"IConcat",left:i,right:n})}}});var XA=(e)=>e.length===0,zr=(e)=>e.length>0,Pb=Tle(0),e_=(e)=>vc(e,0),Pr=e_;var Yr=(e)=>YA(e,1);var ra=5,t_=Math.pow(2,5),uq=t_-1,lq=t_/2,pq=t_/4;function Cle(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function na(e,t){return t>>>e&uq}function ia(e){return 1<<e}function Rb(e,t){return Cle(e&t-1)}var dq=(e,t)=>({value:e,previous:t});function kc(e,t,r,i){let n=i;if(!e){let o=i.length;n=Array(o);for(let s=0;s<o;++s)n[s]=i[s]}return n[t]=r,n}function r_(e,t,r){let i=r.length-1,n=0,o=0,s=r;if(e)n=o=t;else{s=Array(i);while(n<t)s[o++]=r[n++]}++n;while(n<=i)s[o++]=r[n++];if(e)s.length=i;return s}function mq(e,t,r,i){let n=i.length;if(e){let u=n;while(u>=t)i[u--]=i[u];return i[t]=r,i}let o=0,s=0,c=Array(n+1);while(o<t)c[s++]=i[o++];c[t]=r;while(o<n)c[++s]=i[o++];return c}class qo{_tag="EmptyNode";modify(e,t,r,i,n,o){let s=r(H());if(Ft(s))return new qo;return++o.value,new Ic(e,i,n,s)}}function wi(e){return Qs(e,"EmptyNode")}function Rle(e){return wi(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function Ab(e,t){return wi(e)?!1:t===e.edit}class Ic{edit;hash;key;value;_tag="LeafNode";constructor(e,t,r,i){this.edit=e,this.hash=t,this.key=r,this.value=i}modify(e,t,r,i,n,o){if(le(n,this.key)){let c=r(this.value);if(c===this.value)return this;else if(Ft(c))return--o.value,new qo;if(Ab(this,e))return this.value=c,this;return new Ic(e,i,n,c)}let s=r(H());if(Ft(s))return this;return++o.value,fq(e,t,this.hash,this,i,new Ic(e,i,n,s))}}class n_{edit;hash;children;_tag="CollisionNode";constructor(e,t,r){this.edit=e,this.hash=t,this.children=r}modify(e,t,r,i,n,o){if(i===this.hash){let c=Ab(this,e),u=this.updateCollisionList(c,e,this.hash,this.children,r,n,o);if(u===this.children)return this;return u.length>1?new n_(e,this.hash,u):u[0]}let s=r(H());if(Ft(s))return this;return++o.value,fq(e,t,this.hash,this,i,new Ic(e,i,n,s))}updateCollisionList(e,t,r,i,n,o,s){let c=i.length;for(let l=0;l<c;++l){let p=i[l];if("key"in p&&le(o,p.key)){let m=p.value,f=n(m);if(f===m)return i;if(Ft(f))return--s.value,r_(e,l,i);return kc(e,l,new Ic(t,r,o,f),i)}}let u=n(H());if(Ft(u))return i;return++s.value,kc(e,c,new Ic(t,r,o,u),i)}}class Zl{edit;mask;children;_tag="IndexedNode";constructor(e,t,r){this.edit=e,this.mask=t,this.children=r}modify(e,t,r,i,n,o){let s=this.mask,c=this.children,u=na(t,i),l=ia(u),p=Rb(s,l),m=s&l,f=Ab(this,e);if(!m){let L=new qo().modify(e,t+ra,r,i,n,o);if(!L)return this;return c.length>=lq?_le(e,u,L,s,c):new Zl(e,s|l,mq(f,p,L,c))}let g=c[p],S=g.modify(e,t+ra,r,i,n,o);if(g===S)return this;let P=s,D;if(wi(S)){if(P&=~l,!P)return new qo;if(c.length<=2&&Rle(c[p^1]))return c[p^1];D=r_(f,p,c)}else D=kc(f,p,S,c);if(f)return this.mask=P,this.children=D,this;return new Zl(e,P,D)}}class i_{edit;size;children;_tag="ArrayNode";constructor(e,t,r){this.edit=e,this.size=t,this.children=r}modify(e,t,r,i,n,o){let s=this.size,c=this.children,u=na(t,i),l=c[u],p=(l||new qo).modify(e,t+ra,r,i,n,o);if(l===p)return this;let m=Ab(this,e),f;if(wi(l)&&!wi(p))++s,f=kc(m,u,p,c);else if(!wi(l)&&wi(p)){if(--s,s<=pq)return Ale(e,s,u,c);f=kc(m,u,new qo,c)}else f=kc(m,u,p,c);if(m)return this.size=s,this.children=f,this;return new i_(e,s,f)}}function Ale(e,t,r,i){let n=Array(t-1),o=0,s=0;for(let c=0,u=i.length;c<u;++c)if(c!==r){let l=i[c];if(l&&!wi(l))n[o++]=l,s|=1<<c}return new Zl(e,s,n)}function _le(e,t,r,i,n){let o=[],s=i,c=0;for(let u=0;s;++u){if(s&1)o[u]=n[c++];s>>>=1}return o[t]=r,new i_(e,c+1,o)}function Ole(e,t,r,i,n,o){if(r===n)return new n_(e,r,[o,i]);let s=na(t,r),c=na(t,n);if(s===c)return(u)=>new Zl(e,ia(s)|ia(c),[u]);else{let u=s<c?[i,o]:[o,i];return new Zl(e,ia(s)|ia(c),u)}}function fq(e,t,r,i,n,o){let s=void 0,c=t;while(!0){let u=Ole(e,c,r,i,n,o);if(typeof u==="function")s=dq(u,s),c=c+ra;else{let l=u;while(s!=null)l=s.value(l),s=s.previous;return l}}}var gq="effect/HashMap",_b=Symbol.for(gq),Mle={[_b]:_b,[Symbol.iterator](){return new Db(this,(e,t)=>[e,t])},[be](){let e=ue(gq);for(let t of this)e^=v(ue(t[0]),Re(ue(t[1])));return Ue(this,e)},[he](e){if(xq(e)){if(e._size!==this._size)return!1;for(let t of this){let r=v(e,Mb(t[0],ue(t[0])));if(Ft(r))return!1;else if(!le(t[1],r.value))return!1}return!0}return!1},toString(){return it(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},o_=(e,t,r,i)=>{let n=Object.create(Mle);return n._editable=e,n._edit=t,n._root=r,n._size=i,n};class Db{map;f;v;constructor(e,t){this.map=e,this.f=t,this.v=hq(this.map._root,this.f,void 0)}next(){if(Ft(this.v))return{done:!0,value:void 0};let e=this.v.value;return this.v=Ob(e.cont),{done:!1,value:e.value}}[Symbol.iterator](){return new Db(this.map,this.f)}}var Ob=(e)=>e?yq(e[0],e[1],e[2],e[3],e[4]):H(),hq=(e,t,r=void 0)=>{switch(e._tag){case"LeafNode":{if(Bt(e.value))return re({value:t(e.key,e.value.value),cont:r});return Ob(r)}case"CollisionNode":case"ArrayNode":case"IndexedNode":{let i=e.children;return yq(i.length,i,0,t,r)}default:return Ob(r)}},yq=(e,t,r,i,n)=>{while(r<e){let o=t[r++];if(o&&!wi(o))return hq(o,i,[e,t,r,i,n])}return Ob(n)},Fle=o_(!1,0,new qo,0),Vl=()=>Fle;var bq=(e)=>{let t=Nm(Vl());for(let r of e)Tc(t,r[0],r[1]);return a_(t)},xq=(e)=>pe(e,_b),Sq=(e)=>e&&wi(e._root),vq=h(2,(e,t)=>Mb(e,t,ue(t))),Mb=h(3,(e,t,r)=>{let i=e._root,n=0;while(!0)switch(i._tag){case"LeafNode":return le(t,i.key)?i.value:H();case"CollisionNode":{if(r===i.hash){let o=i.children;for(let s=0,c=o.length;s<c;++s){let u=o[s];if("key"in u&&le(t,u.key))return u.value}}return H()}case"IndexedNode":{let o=na(n,r),s=ia(o);if(i.mask&s){i=i.children[Rb(i.mask,s)],n+=ra;break}return H()}case"ArrayNode":{if(i=i.children[na(n,r)],i){n+=ra;break}return H()}default:return H()}});var s_=h(2,(e,t)=>Bt(Mb(e,t,ue(t))));var Tc=h(3,(e,t,r)=>$b(e,t,()=>re(r))),$le=h(3,(e,t,r)=>{if(e._editable)return e._root=t,e._size=r,e;return t===e._root?e:o_(e._editable,e._edit,t,r)}),Fb=(e)=>new Db(e,(t)=>t);var jm=(e)=>e._size;var Nm=(e)=>o_(!0,e._edit+1,e._root,e._size),a_=(e)=>(e._editable=!1,e),wq=h(2,(e,t)=>{let r=Nm(e);return t(r),a_(r)}),$b=h(3,(e,t,r)=>kq(e,t,ue(t),r)),kq=h(4,(e,t,r,i)=>{let n={value:e._size},o=e._root.modify(e._editable?e._edit:NaN,0,i,r,t,n);return v(e,$le(o,n.value))});var jb=h(2,(e,t)=>$b(e,t,H));var Iq=h(2,(e,t)=>Gl(e,Vl(),(r,i,n)=>Tc(r,n,t(i,n))));var Nb=h(2,(e,t)=>Gl(e,void 0,(r,i,n)=>t(i,n))),Gl=h(3,(e,t,r)=>{let i=e._root;if(i._tag==="LeafNode")return Bt(i.value)?r(t,i.value.value,i.key):t;if(i._tag==="EmptyNode")return t;let n=[i.children],o;while(o=n.pop())for(let s=0,c=o.length;s<c;){let u=o[s++];if(u&&!wi(u))if(u._tag==="LeafNode"){if(Bt(u.value))t=r(t,u.value.value,u.key)}else n.push(u.children)}return t});var Eq="effect/HashSet",zb=Symbol.for(Eq),jle={[zb]:zb,[Symbol.iterator](){return Fb(this._keyMap)},[be](){return Ue(this,Re(ue(this._keyMap))(ue(Eq)))},[he](e){if(Cq(e))return jm(this._keyMap)===jm(e._keyMap)&&le(this._keyMap,e._keyMap);return!1},toString(){return it(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Lb=(e)=>{let t=Object.create(jle);return t._keyMap=e,t},Cq=(e)=>pe(e,zb),Nle=Lb(Vl()),zm=()=>Nle,Pq=(e)=>{let t=Bb(zm());for(let r of e)Kl(t,r);return Ub(t)},Rq=(...e)=>{let t=Bb(zm());for(let r of e)Kl(t,r);return Ub(t)},Aq=h(2,(e,t)=>s_(e._keyMap,t)),_q=h(2,(e,t)=>{let r=!1;for(let i of e)if(r=t(i),r)break;return r}),Oq=h(2,(e,t)=>!_q(e,(r)=>!t(r)));var Dq=(e)=>jm(e._keyMap),Bb=(e)=>Lb(Nm(e._keyMap)),Ub=(e)=>(e._keyMap._editable=!1,e),c_=h(2,(e,t)=>{let r=Bb(e);return t(r),Ub(r)}),Kl=h(2,(e,t)=>e._keyMap._editable?(Tc(t,!0)(e._keyMap),e):Lb(Tc(t,!0)(e._keyMap))),u_=h(2,(e,t)=>e._keyMap._editable?(jb(t)(e._keyMap),e):Lb(jb(t)(e._keyMap))),Mq=h(2,(e,t)=>c_(e,(r)=>{for(let i of t)u_(r,i)}));var Fq=h(2,(e,t)=>c_(zm(),(r)=>{$q(e,(i)=>Kl(r,i));for(let i of t)Kl(r,i)}));var $q=h(2,(e,t)=>Nb(e._keyMap,(r,i)=>t(i))),jq=h(3,(e,t,r)=>Gl(e._keyMap,t,(i,n,o)=>r(i,o)));var Li=zm,qb=Pq,oa=Rq,Nq=Aq;var zq=Oq;var Jo=Dq;var Ec=Kl,l_=u_,p_=Mq;var fo=Fq;var Cc=jq;var Pc="Die",sa="Empty",Rc="Fail",Ac="Interrupt",_c="Parallel",Oc="Sequential";var Uq="effect/Cause",qq=Symbol.for(Uq),Ble={_E:(e)=>e},Yl={[qq]:Ble,[be](){return v(ue(Uq),Re(ue(Hle(this))),Ue(this))},[he](e){return f_(e)&&Jle(this,e)},pipe(){return ae(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:et(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:et(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:et(this.left),right:et(this.right)}}},toString(){return Zo(this)},[qe](){return this.toJSON()}},Fn=(()=>{let e=Object.create(Yl);return e._tag=sa,e})(),Mc=(e)=>{let t=Object.create(Yl);return t._tag=Rc,t.error=e,t},Sr=(e)=>{let t=Object.create(Yl);return t._tag=Pc,t.defect=e,t},ki=(e)=>{let t=Object.create(Yl);return t._tag=Ac,t.fiberId=e,t},Xr=(e,t)=>{let r=Object.create(Yl);return r._tag=_c,r.left=e,r.right=t,r},Vt=(e,t)=>{let r=Object.create(Yl);return r._tag=Oc,r.left=e,r.right=t,r},f_=(e)=>pe(e,qq),Jq=(e)=>e._tag===sa;var Lm=(e)=>e._tag===Pc;var g_=(e)=>{if(e._tag===sa)return!0;return Ql(e,!0,(t,r)=>{switch(r._tag){case sa:return re(t);case Pc:case Rc:case Ac:return re(!1);default:return H()}})};var h_=(e)=>Bt(Ule(e)),Bm=(e)=>x_(void 0,Zle)(e),Jb=(e)=>mo(Ql(e,hn(),(t,r)=>r._tag===Rc?re(v(t,Cr(r.error))):H())),y_=(e)=>mo(Ql(e,hn(),(t,r)=>r._tag===Pc?re(v(t,Cr(r.defect))):H())),Hb=(e)=>Ql(e,Li(),(t,r)=>r._tag===Ac?re(v(t,Ec(r.fiberId))):H()),Hq=(e)=>Fc(e,(t)=>t._tag===Rc?re(t.error):H()),Wo=(e)=>{let t=Hq(e);switch(t._tag){case"None":return Nr(e);case"Some":return Mn(t.value)}};var Ule=(e)=>Fc(e,(t)=>t._tag===Ac?re(t.fiberId):H()),Wq=(e)=>Um(e,{onEmpty:H(),onFail:()=>H(),onDie:(t)=>re(Sr(t)),onInterrupt:()=>H(),onSequential:Dm(Vt),onParallel:Dm(Xr)}),Zq=(e)=>Um(e,{onEmpty:H(),onFail:(t)=>re(Sr(t)),onDie:(t)=>re(Sr(t)),onInterrupt:()=>H(),onSequential:Dm(Vt),onParallel:Dm(Xr)});var b_=(e)=>Um(e,{onEmpty:Fn,onFail:()=>Fn,onDie:Sr,onInterrupt:ki,onSequential:Vt,onParallel:Xr}),Vq=(e)=>Um(e,{onEmpty:Fn,onFail:Sr,onDie:Sr,onInterrupt:ki,onSequential:Vt,onParallel:Xr});var qle=h(2,(e,t)=>Um(e,{onEmpty:Fn,onFail:(r)=>t(r),onDie:(r)=>Sr(r),onInterrupt:(r)=>ki(r),onSequential:(r,i)=>Vt(r,i),onParallel:(r,i)=>Xr(r,i)})),Gq=(e)=>qle(e,Ze);var Jle=(e,t)=>{let r=Zt(e),i=Zt(t);while(zr(r)&&zr(i)){let[n,o]=v(Pr(r),Ql([Li(),hn()],([u,l],p)=>{let[m,f]=d_(p);return re([v(u,fo(m)),v(l,Kn(f))])})),[s,c]=v(Pr(i),Ql([Li(),hn()],([u,l],p)=>{let[m,f]=d_(p);return re([v(u,fo(m)),v(l,Kn(f))])}));if(!le(n,s))return!1;r=o,i=c}return!0},Hle=(e)=>Wle(Zt(e),hn()),Wle=(e,t)=>{while(!0){let[r,i]=v(e,ta([Li(),hn()],([o,s],c)=>{let[u,l]=d_(c);return[v(o,fo(u)),v(s,Kn(l))]})),n=Jo(r)>0?v(t,Cr(r)):t;if(XA(i))return mo(n);e=i,t=n}throw Error(mc("Cause.flattenCauseLoop"))},Fc=h(2,(e,t)=>{let r=[e];while(r.length>0){let i=r.pop(),n=t(i);switch(n._tag){case"None":{switch(i._tag){case Oc:case _c:{r.push(i.right),r.push(i.left);break}}break}case"Some":return n}}return H()});var d_=(e)=>{let t=e,r=[],i=Li(),n=hn();while(t!==void 0)switch(t._tag){case sa:{if(r.length===0)return[i,n];t=r.pop();break}case Rc:{if(i=Ec(i,Fm(t._tag,t.error)),r.length===0)return[i,n];t=r.pop();break}case Pc:{if(i=Ec(i,Fm(t._tag,t.defect)),r.length===0)return[i,n];t=r.pop();break}case Ac:{if(i=Ec(i,Fm(t._tag,t.fiberId)),r.length===0)return[i,n];t=r.pop();break}case Oc:{switch(t.left._tag){case sa:{t=t.right;break}case Oc:{t=Vt(t.left.left,Vt(t.left.right,t.right));break}case _c:{t=Xr(Vt(t.left.left,t.right),Vt(t.left.right,t.right));break}default:{n=Cr(n,t.right),t=t.left;break}}break}case _c:{r.push(t.right),t=t.left;break}}throw Error(mc("Cause.evaluateCauseLoop"))};var Zle={emptyCase:$o,failCase:$i,dieCase:$i,interruptCase:$o,sequentialCase:(e,t,r)=>t&&r,parallelCase:(e,t,r)=>t&&r};var Lq="SequentialCase",Bq="ParallelCase",Um=h(2,(e,{onDie:t,onEmpty:r,onFail:i,onInterrupt:n,onParallel:o,onSequential:s})=>x_(e,void 0,{emptyCase:()=>r,failCase:(c,u)=>i(u),dieCase:(c,u)=>t(u),interruptCase:(c,u)=>n(u),sequentialCase:(c,u,l)=>s(u,l),parallelCase:(c,u,l)=>o(u,l)})),Ql=h(3,(e,t,r)=>{let i=t,n=e,o=[];while(n!==void 0){let s=r(i,n);switch(i=Bt(s)?s.value:i,n._tag){case Oc:{o.push(n.right),n=n.left;break}case _c:{o.push(n.right),n=n.left;break}default:{n=void 0;break}}if(n===void 0&&o.length>0)n=o.pop()}return i}),x_=h(3,(e,t,r)=>{let i=[e],n=[];while(i.length>0){let s=i.pop();switch(s._tag){case sa:{n.push(Nr(r.emptyCase(t)));break}case Rc:{n.push(Nr(r.failCase(t,s.error)));break}case Pc:{n.push(Nr(r.dieCase(t,s.defect)));break}case Ac:{n.push(Nr(r.interruptCase(t,s.fiberId)));break}case Oc:{i.push(s.right),i.push(s.left),n.push(Mn({_tag:Lq}));break}case _c:{i.push(s.right),i.push(s.left),n.push(Mn({_tag:Bq}));break}}}let o=[];while(n.length>0){let s=n.pop();switch(s._tag){case"Left":{switch(s.left._tag){case Lq:{let c=o.pop(),u=o.pop(),l=r.sequentialCase(t,c,u);o.push(l);break}case Bq:{let c=o.pop(),u=o.pop(),l=r.parallelCase(t,c,u);o.push(l);break}}break}case"Right":{o.push(s.right);break}}}if(o.length===0)throw Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return o.pop()}),Zo=(e,t)=>{if(Bm(e))return"All fibers interrupted without errors.";return Wb(e).map(function(r){if(t?.renderErrorCause!==!0||r.cause===void 0)return r.stack;return`${r.stack} {
|
|
157
157
|
${Kq(r.cause," ")}
|
|
158
158
|
}`}).join(`
|
|
159
159
|
`)},Kq=(e,t)=>{let r=e.stack.split(`
|
|
@@ -166,45 +166,45 @@ ${t}}`;return i},m_=(e)=>{let t=typeof e==="object"&&e!==null,r=Error.stackTrace
|
|
|
166
166
|
`)},Dc=Symbol.for("effect/SpanAnnotation"),Wb=(e)=>x_(e,void 0,{emptyCase:()=>[],dieCase:(t,r)=>[m_(r)],failCase:(t,r)=>[m_(r)],interruptCase:()=>[],parallelCase:(t,r,i)=>[...r,...i],sequentialCase:(t,r,i)=>[...r,...i]});var v_=Symbol.for("effect/Context/Tag"),Jm=Symbol.for("effect/Context/Reference"),Qle="effect/STM",Yle=Symbol.for(Qle),Hm={...Lo,_op:"Tag",[Yle]:Ys,[v_]:{_Service:(e)=>e,_Identifier:(e)=>e},toString(){return it(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[qe](){return this.toJSON()},of(e){return e},context(e){return I_(this,e)}},Xle={...Hm,[Jm]:Jm},Qq=(e)=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let r=Error();Error.stackTraceLimit=t;let i=Object.create(Hm);return Object.defineProperty(i,"stack",{get(){return r.stack}}),i.key=e,i};var Yq=()=>(e,t)=>{let r=Error.stackTraceLimit;Error.stackTraceLimit=2;let i=Error();Error.stackTraceLimit=r;function n(){}return Object.setPrototypeOf(n,Xle),n.key=e,n.defaultValue=t.defaultValue,Object.defineProperty(n,"stack",{get(){return i.stack}}),n},w_=Symbol.for("effect/Context"),epe={[w_]:{_Services:(e)=>e},[he](e){if(k_(e)){if(this.unsafeMap.size===e.unsafeMap.size){for(let t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!le(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}}return!1},[be](){return Ue(this,fb(this.unsafeMap.size))},pipe(){return ae(this,arguments)},toString(){return it(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(et)}},[qe](){return this.toJSON()}},Vo=(e)=>{let t=Object.create(epe);return t.unsafeMap=e,t},tpe=(e)=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){let r=e.stack.split(`
|
|
167
167
|
`);if(r.length>2){let i=r[2].match(/at (.*)/);if(i)t.message=t.message+` (defined at ${i[1]})`}}if(t.stack){let r=t.stack.split(`
|
|
168
168
|
`);r.splice(1,3),t.stack=r.join(`
|
|
169
|
-
`)}return t},k_=(e)=>pe(e,w_),Xq=(e)=>pe(e,v_),e2=(e)=>pe(e,Jm),rpe=Vo(new Map),t2=()=>rpe,I_=(e,t)=>Vo(new Map([[e.key,t]])),r2=h(3,(e,t,r)=>{let i=new Map(e.unsafeMap);return i.set(t.key,r),Vo(i)}),S_=Fe("effect/Context/defaultValueCache",()=>new Map),T_=(e)=>{if(S_.has(e.key))return S_.get(e.key);let t=e.defaultValue();return S_.set(e.key,t),t},n2=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):T_(t),E_=h(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Jm in t)return T_(t);throw tpe(t)}return e.unsafeMap.get(t.key)}),i2=E_;var o2=h(2,(e,t)=>{if(!e.unsafeMap.has(t.key))return e2(t)?Xs(T_(t)):Sb;return Xs(e.unsafeMap.get(t.key))}),s2=h(2,(e,t)=>{let r=new Map(e.unsafeMap);for(let[i,n]of t.unsafeMap)r.set(i,n);return Vo(r)}),a2=(...e)=>{let t=new Map;for(let r=0;r<e.length;r++)e[r].unsafeMap.forEach((i,n)=>{t.set(n,i)});return Vo(t)};var yn=Qq;var u2=k_,Wm=Xq;var Qn=t2,$c=I_,Ot=r2,$n=i2;var ca=E_,Ii=o2,Go=s2,l2=a2;var go=Yq;var C_=Symbol.for("effect/Duration"),g2=BigInt(0),p2=BigInt(24),Zb=BigInt(60),P_=BigInt(1000),d2=BigInt(1e6),m2=BigInt(1e9),npe=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,vr=(e)=>{if(h2(e))return e;else if(Pm(e))return ua(e);else if(wA(e))return Zm(e);else if(Array.isArray(e)&&e.length===2&&e.every(Pm)){if(e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1]))return la;if(e[0]===1/0||e[1]===1/0)return ape;return Zm(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])))}else if(Cm(e)){let t=npe.exec(e);if(t){let[r,i,n]=t,o=Number(i);switch(n){case"nano":case"nanos":return Zm(BigInt(i));case"micro":case"micros":return cpe(BigInt(i));case"milli":case"millis":return ua(o);case"second":case"seconds":return R_(o);case"minute":case"minutes":return upe(o);case"hour":case"hours":return lpe(o);case"day":case"days":return ppe(o);case"week":case"weeks":return dpe(o)}}}throw Error("Invalid DurationInput")};var f2={_tag:"Millis",millis:0},ipe={_tag:"Infinity"},ope={[C_]:C_,[be](){return Ue(this,gb(this.value))},[he](e){return h2(e)&&ype(this,e)},toString(){return`Duration(${O_(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:fpe(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},yo=(e)=>{let t=Object.create(ope);if(Pm(e))if(isNaN(e)||e<=0)t.value=f2;else if(!Number.isFinite(e))t.value=ipe;else if(!Number.isInteger(e))t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))};else t.value={_tag:"Millis",millis:e};else if(e<=g2)t.value=f2;else t.value={_tag:"Nanos",nanos:e};return t},h2=(e)=>pe(e,C_);var spe=(e)=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===g2;case"Infinity":return!1}},la=yo(0),ape=yo(1/0),Zm=(e)=>yo(e),cpe=(e)=>yo(e*P_),ua=(e)=>yo(e),R_=(e)=>yo(e*1000),upe=(e)=>yo(e*60000),lpe=(e)=>yo(e*3600000),ppe=(e)=>yo(e*86400000),dpe=(e)=>yo(e*604800000),ho=(e)=>gpe(e,{onMillis:(t)=>t,onNanos:(t)=>Number(t)/1e6});var mpe=(e)=>{let t=vr(e);switch(t.value._tag){case"Infinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return BigInt(Math.round(t.value.millis*1e6))}},fpe=(e)=>{let t=vr(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/m2),Number(t.value.nanos%m2)];case"Millis":return[Math.floor(t.value.millis/1000),Math.round(t.value.millis%1000*1e6)]}},gpe=h(2,(e,t)=>{let r=vr(e);switch(r.value._tag){case"Nanos":return t.onNanos(r.value.nanos);case"Infinity":return t.onMillis(1/0);case"Millis":return t.onMillis(r.value.millis)}}),A_=h(3,(e,t,r)=>{let i=vr(e),n=vr(t);if(i.value._tag==="Infinity"||n.value._tag==="Infinity")return r.onMillis(ho(i),ho(n));else if(i.value._tag==="Nanos"||n.value._tag==="Nanos"){let o=i.value._tag==="Nanos"?i.value.nanos:BigInt(Math.round(i.value.millis*1e6)),s=n.value._tag==="Nanos"?n.value.nanos:BigInt(Math.round(n.value.millis*1e6));return r.onNanos(o,s)}return r.onMillis(i.value.millis,n.value.millis)});var hpe=(e,t)=>A_(e,t,{onMillis:(r,i)=>r===i,onNanos:(r,i)=>r===i});var y2=h(2,(e,t)=>A_(e,t,{onMillis:(r,i)=>r<=i,onNanos:(r,i)=>r<=i}));var __=h(2,(e,t)=>A_(e,t,{onMillis:(r,i)=>r>=i,onNanos:(r,i)=>r>=i})),ype=h(2,(e,t)=>hpe(vr(e),vr(t))),bpe=(e)=>{let t=vr(e);if(t.value._tag==="Infinity")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};let r=mpe(t),i=r/d2,n=i/P_,o=n/Zb,s=o/Zb,c=s/p2;return{days:Number(c),hours:Number(s%p2),minutes:Number(o%Zb),seconds:Number(n%Zb),millis:Number(i%P_),nanos:Number(r%d2)}},O_=(e)=>{let t=vr(e);if(t.value._tag==="Infinity")return"Infinity";if(spe(t))return"0";let r=bpe(t),i=[];if(r.days!==0)i.push(`${r.days}d`);if(r.hours!==0)i.push(`${r.hours}h`);if(r.minutes!==0)i.push(`${r.minutes}m`);if(r.seconds!==0)i.push(`${r.seconds}s`);if(r.millis!==0)i.push(`${r.millis}ms`);if(r.nanos!==0)i.push(`${r.nanos}ns`);return i.join(" ")};var b2=Symbol.for("effect/MutableRef"),xpe={[b2]:b2,toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableRef",current:et(this.current)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},bo=(e)=>{let t=Object.create(xpe);return t.current=e,t},Vb=h(3,(e,t,r)=>{if(le(t,e.current))return e.current=r,!0;return!1});var jn=(e)=>e.current;var Ti=h(2,(e,t)=>(e.current=t,e));var Yb="effect/FiberId",da=Symbol.for(Yb),ma="None",Gb="Runtime",Kb="Composite",Spe=lt(`${Yb}-${ma}`);class S2{[da]=da;_tag=ma;id=-1;startTimeMillis=-1;[be](){return Spe}[he](e){return ex(e)&&e._tag===ma}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[qe](){return this.toJSON()}}class v2{id;startTimeMillis;[da]=da;_tag=Gb;constructor(e,t){this.id=e,this.startTimeMillis=t}[be](){return Ue(this,lt(`${Yb}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[he](e){return ex(e)&&e._tag===Gb&&this.id===e.id&&this.startTimeMillis===e.startTimeMillis}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[qe](){return this.toJSON()}}class w2{left;right;[da]=da;_tag=Kb;constructor(e,t){this.left=e,this.right=t}_hash;[be](){return v(lt(`${Yb}-${this._tag}`),Re(ue(this.left)),Re(ue(this.right)),Ue(this))}[he](e){return ex(e)&&e._tag===Kb&&le(this.left,e.left)&&le(this.right,e.right)}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:et(this.left),right:et(this.right)}}[qe](){return this.toJSON()}}var Xb=new S2;var ex=(e)=>pe(e,da),D_=(e)=>e._tag===ma||v(Qb(e),zq((t)=>D_(t)));var k2=h(2,(e,t)=>{if(e._tag===ma)return t;if(t._tag===ma)return e;return new w2(e,t)});var I2=h(2,(e,t)=>D_(e)?t:e),Vm=(e)=>{switch(e._tag){case ma:return Li();case Gb:return oa(e.id);case Kb:return v(Vm(e.left),fo(Vm(e.right)))}},x2=Fe(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>bo(0));var tx=(e)=>Array.from(Vm(e)).map((r)=>`#${r}`).join(",");var Qb=(e)=>{switch(e._tag){case ma:return Li();case Gb:return oa(e);case Kb:return v(Qb(e.left),fo(Qb(e.right)))}},T2=()=>{let e=jn(x2);return v(x2,Ti(e+1)),new v2(e,Date.now())};var bn=Xb;var M_=k2;var rx=I2,F_=Vm;var C2=tx;var nx=T2;var jc=Vl;var P2=bq,R2=Sq,$_=vq;var Bi=Tc,j_=Fb;var A2=wq,_2=$b;var O2=Iq;var D2=Nb,N_=Gl;var Km=Symbol.for("effect/List"),z_=(e)=>ot(e),vpe=(e)=>xU(Wl(e),z_),wpe=vpe(le),kpe={[Km]:Km,_tag:"Cons",toString(){return it(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:z_(this).map(et)}},[qe](){return this.toJSON()},[he](e){return F2(e)&&this._tag===e._tag&&wpe(this,e)},[be](){return Ue(this,Dn(z_(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag==="Nil")return e=!0,this.return();let r=t.head;return t=t.tail,{done:e,value:r}},return(r){if(!e)e=!0;return{done:!0,value:r}}}},pipe(){return ae(this,arguments)}},ix=(e,t)=>{let r=Object.create(kpe);return r.head=e,r.tail=t,r},Ipe=lt("Nil"),Tpe={[Km]:Km,_tag:"Nil",toString(){return it(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[qe](){return this.toJSON()},[be](){return Ipe},[he](e){return F2(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return ae(this,arguments)}},M2=Object.create(Tpe),F2=(e)=>pe(e,Km),xo=(e)=>e._tag==="Nil",L_=(e)=>e._tag==="Cons";var Epe=()=>M2,Ko=(e,t)=>ix(e,t),So=Epe,Qm=(e)=>ix(e,M2);var $2=h(2,(e,t)=>Cpe(t,e)),ox=h(2,(e,t)=>Ko(t,e)),Cpe=h(2,(e,t)=>{if(xo(e))return t;else if(xo(t))return e;else{let r=ix(t.head,e),i=r,n=t.tail;while(!xo(n)){let o=ix(n.head,e);i.tail=o,i=o,n=n.tail}return r}});var j2=h(3,(e,t,r)=>{let i=t,n=e;while(!xo(n))i=r(i,n.head),n=n.tail;return i});var N2=(e)=>{let t=So(),r=e;while(!xo(r))t=ox(t,r.head),r=r.tail;return t};var gqe=Object.assign(Object.create(Array.prototype),{[be](){return Ue(this,Dn(this))},[he](e){if(Array.isArray(e)&&this.length===e.length)return this.every((t,r)=>le(t,e[r]));else return!1}}),tp=function(){function e(t){if(t)Object.assign(this,t)}return e.prototype=Bl,e}(),ax=(e)=>Object.assign(Object.create(Bl),e);var Ppe=Symbol.for("effect/DifferContextPatch");function L2(e){return e}var Xm={...tp.prototype,[Ppe]:{_Value:L2,_Patch:L2}},Rpe=Object.assign(Object.create(Xm),{_tag:"Empty"}),Ape=Object.create(Rpe),B_=()=>Ape,_pe=Object.assign(Object.create(Xm),{_tag:"AndThen"}),Ope=(e,t)=>{let r=Object.create(_pe);return r.first=e,r.second=t,r},Dpe=Object.assign(Object.create(Xm),{_tag:"AddService"}),Mpe=(e,t)=>{let r=Object.create(Dpe);return r.key=e,r.service=t,r},Fpe=Object.assign(Object.create(Xm),{_tag:"RemoveService"}),$pe=(e)=>{let t=Object.create(Fpe);return t.key=e,t},jpe=Object.assign(Object.create(Xm),{_tag:"UpdateService"}),Npe=(e,t)=>{let r=Object.create(jpe);return r.key=e,r.update=t,r},B2=(e,t)=>{let r=new Map(e.unsafeMap),i=B_();for(let[n,o]of t.unsafeMap.entries())if(r.has(n)){let s=r.get(n);if(r.delete(n),!le(s,o))i=Ym(Npe(n,()=>o))(i)}else r.delete(n),i=Ym(Mpe(n,o))(i);for(let[n]of r.entries())i=Ym($pe(n))(i);return i},Ym=h(2,(e,t)=>Ope(e,t)),U2=h(2,(e,t)=>{if(e._tag==="Empty")return t;let r=!1,i=Zt(e),n=new Map(t.unsafeMap);while(zr(i)){let s=Pr(i),c=Yr(i);switch(s._tag){case"Empty":{i=c;break}case"AddService":{n.set(s.key,s.service),i=c;break}case"AndThen":{i=Cr(Cr(c,s.second),s.first);break}case"RemoveService":{n.delete(s.key),i=c;break}case"UpdateService":{n.set(s.key,s.update(n.get(s.key))),r=!0,i=c;break}}}if(!r)return Vo(n);let o=new Map;for(let[s]of t.unsafeMap)if(n.has(s))o.set(s,n.get(s)),n.delete(s);for(let[s,c]of n)o.set(s,c);return Vo(o)});var Lpe=Symbol.for("effect/DifferHashSetPatch");function U_(e){return e}var ux={...tp.prototype,[Lpe]:{_Value:U_,_Key:U_,_Patch:U_}},Bpe=Object.assign(Object.create(ux),{_tag:"Empty"}),Upe=Object.create(Bpe),q_=()=>Upe,qpe=Object.assign(Object.create(ux),{_tag:"AndThen"}),Jpe=(e,t)=>{let r=Object.create(qpe);return r.first=e,r.second=t,r},Hpe=Object.assign(Object.create(ux),{_tag:"Add"}),Wpe=(e)=>{let t=Object.create(Hpe);return t.value=e,t},Zpe=Object.assign(Object.create(ux),{_tag:"Remove"}),Vpe=(e)=>{let t=Object.create(Zpe);return t.value=e,t},q2=(e,t)=>{let[r,i]=Cc([e,q_()],([n,o],s)=>{if(Nq(s)(n))return[l_(s)(n),o];return[n,cx(Wpe(s))(o)]})(t);return Cc(i,(n,o)=>cx(Vpe(o))(n))(r)},cx=h(2,(e,t)=>Jpe(e,t)),J2=h(2,(e,t)=>{if(e._tag==="Empty")return t;let r=t,i=Zt(e);while(zr(i)){let n=Pr(i),o=Yr(i);switch(n._tag){case"Empty":{i=o;break}case"AndThen":{i=Cr(n.first)(Cr(n.second)(o));break}case"Add":{r=Ec(n.value)(r),i=o;break}case"Remove":r=l_(n.value)(r),i=o}}return r});var Kpe=Symbol.for("effect/DifferReadonlyArrayPatch");function H2(e){return e}var tf={...tp.prototype,[Kpe]:{_Value:H2,_Patch:H2}},Qpe=Object.assign(Object.create(tf),{_tag:"Empty"}),Ype=Object.create(Qpe),J_=()=>Ype,Xpe=Object.assign(Object.create(tf),{_tag:"AndThen"}),ede=(e,t)=>{let r=Object.create(Xpe);return r.first=e,r.second=t,r},tde=Object.assign(Object.create(tf),{_tag:"Append"}),rde=(e)=>{let t=Object.create(tde);return t.values=e,t},nde=Object.assign(Object.create(tf),{_tag:"Slice"}),ide=(e,t)=>{let r=Object.create(nde);return r.from=e,r.until=t,r},ode=Object.assign(Object.create(tf),{_tag:"Update"}),sde=(e,t)=>{let r=Object.create(ode);return r.index=e,r.patch=t,r},W2=(e)=>{let t=0,r=J_();while(t<e.oldValue.length&&t<e.newValue.length){let i=e.oldValue[t],n=e.newValue[t],o=e.differ.diff(i,n);if(!le(o,e.differ.empty))r=ef(r,sde(t,o));t=t+1}if(t<e.oldValue.length)r=ef(r,ide(0,t));if(t<e.newValue.length)r=ef(r,rde(tq(t)(e.newValue)));return r},ef=h(2,(e,t)=>ede(e,t)),Z2=h(3,(e,t,r)=>{if(e._tag==="Empty")return t;let i=t.slice(),n=gn(e);while(kb(n)){let o=Er(n),s=uo(n);switch(o._tag){case"Empty":{n=s;break}case"AndThen":{s.unshift(o.first,o.second),n=s;break}case"Append":{for(let c of o.values)i.push(c);n=s;break}case"Slice":{i=i.slice(o.from,o.until),n=s;break}case"Update":{i[o.index]=r.patch(o.patch,i[o.index]),n=s;break}}}return i});var V2=Symbol.for("effect/Differ"),cde={[V2]:{_P:Ze,_V:Ze},pipe(){return ae(this,arguments)}},fa=(e)=>{let t=Object.create(cde);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},H_=()=>fa({empty:B_(),combine:(e,t)=>Ym(t)(e),diff:(e,t)=>B2(e,t),patch:(e,t)=>U2(t)(e)});var W_=()=>fa({empty:q_(),combine:(e,t)=>cx(t)(e),diff:(e,t)=>q2(e,t),patch:(e,t)=>J2(t)(e)});var Z_=(e)=>fa({empty:J_(),combine:(t,r)=>ef(t,r),diff:(t,r)=>W2({oldValue:t,newValue:r,differ:e}),patch:(t,r)=>Z2(t,r,e)});var lx=()=>G2((e,t)=>t),G2=(e)=>fa({empty:Ze,combine:(t,r)=>{if(t===Ze)return r;if(r===Ze)return t;return(i)=>r(t(i))},diff:(t,r)=>{if(le(t,r))return Ze;return Tm(r)},patch:(t,r)=>e(r,t(r))});var rf=255,K2=8,px=(e)=>e&rf,dx=(e)=>e>>K2&rf,Nc=(e,t)=>(e&rf)+((t&e&rf)<<K2),mx=Nc(0,0),Q2=(e)=>Nc(e,e),Y2=(e)=>Nc(e,0);var X2=h(2,(e,t)=>Nc(px(e)&~t,dx(e)));var G_=h(2,(e,t)=>e|t);var eJ=(e)=>~e>>>0&rf;var ude=0,Ui=1,rJ=2,K_=4,fx=16,Q_=32;var nJ=(e)=>gx(e,Q_),Y_=h(2,(e,t)=>e&~t);var X_=h(2,(e,t)=>e|t);var qi=(e)=>nf(e)&&!lde(e),nf=(e)=>gx(e,Ui);var gx=h(2,(e,t)=>(e&t)!==0),eO=(...e)=>e.reduce((t,r)=>t|r,0),iJ=eO(ude);var tO=(e)=>gx(e,K_);var lde=(e)=>gx(e,fx);var Ei=h(2,(e,t)=>Nc(e^t,t)),Qo=h(2,(e,t)=>e&(eJ(px(t))|dx(t))|px(t)&dx(t));var rO=fa({empty:mx,diff:(e,t)=>Ei(e,t),combine:(e,t)=>G_(t)(e),patch:(e,t)=>Qo(t,e)});var oJ=mx;var nO=Q2,iO=Y2;var oO=X2;var aJ={_tag:"Empty"},aO=(e,t)=>({_tag:"Par",left:e,right:t}),hx=(e,t)=>({_tag:"Seq",left:e,right:t}),cO=(e,t)=>({_tag:"Single",dataSource:e,blockedRequest:t});var cJ=(e)=>{let t=Qm(e),r=So();while(!0){let[i,n]=j2(t,[lJ(),So()],([o,s],c)=>{let[u,l]=pde(c);return[bde(o,u),$2(s,l)]});if(r=dde(r,i),xo(n))return N2(r);t=n}throw Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},pde=(e)=>{let t=e,r=lJ(),i=So(),n=So();while(!0)switch(t._tag){case"Empty":{if(xo(i))return[r,n];t=i.head,i=i.tail;break}case"Par":{i=Ko(t.right,i),t=t.left;break}case"Seq":{let{left:o,right:s}=t;switch(o._tag){case"Empty":{t=s;break}case"Par":{let{left:c,right:u}=o;t=aO(hx(c,s),hx(u,s));break}case"Seq":{let{left:c,right:u}=o;t=hx(c,hx(u,s));break}case"Single":{t=o,n=Ko(s,n);break}}break}case"Single":{if(r=yde(r,t),xo(i))return[r,n];t=i.head,i=i.tail;break}}throw Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},dde=(e,t)=>{if(xo(e))return Qm(sO(t));if(xde(t))return e;let r=Tde(e.head),i=Sde(t);if(r.length===1&&i.length===1&&le(r[0],i[0]))return Ko(Ide(e.head,sO(t)),e.tail);return Ko(sO(t),e)},mde=Symbol.for("effect/RequestBlock/Entry");class uJ{request;result;listeners;ownerId;state;[mde]=fde;constructor(e,t,r,i,n){this.request=e,this.result=t,this.listeners=r,this.ownerId=i,this.state=n}}var fde={_R:(e)=>e};var uO=(e)=>new uJ(e.request,e.result,e.listeners,e.ownerId,e.state),gde=Symbol.for("effect/RequestBlock/RequestBlockParallel"),hde={_R:(e)=>e};class yx{map;[gde]=hde;constructor(e){this.map=e}}var lJ=()=>new yx(jc());var yde=(e,t)=>new yx(_2(e.map,t.dataSource,(r)=>WU(Gn(r,Cb(t.blockedRequest)),()=>Zt(t.blockedRequest)))),bde=(e,t)=>new yx(N_(e.map,t.map,(r,i,n)=>Bi(r,n,yr($_(r,n),{onNone:()=>i,onSome:(o)=>Kn(i,o)})))),xde=(e)=>R2(e.map),Sde=(e)=>Array.from(j_(e.map)),sO=(e)=>kde(O2(e.map,(t)=>Zt(t))),vde=Symbol.for("effect/RequestBlock/RequestBlockSequential"),wde={_R:(e)=>e};class lO{map;[vde]=wde;constructor(e){this.map=e}}var kde=(e)=>new lO(e),Ide=(e,t)=>new lO(N_(t.map,e.map,(r,i,n)=>Bi(r,n,yr($_(r,n),{onNone:()=>hn(),onSome:(o)=>Kn(o,i)}))));var Tde=(e)=>Array.from(j_(e.map)),pJ=(e)=>Array.from(e.map);var zc="Pending",of="Done";var Ede="effect/Deferred",fJ=Symbol.for(Ede),gJ={_E:(e)=>e,_A:(e)=>e},hJ=(e)=>({_tag:zc,joiners:e}),pO=(e)=>({_tag:of,effect:e});class np{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new np(this.self)}}var Yo=(e,t)=>{let r=new Yt("Blocked");return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r},xx=(e)=>{let t=new Yt("RunBlocked");return t.effect_instruction_i0=e,t},Xo=Symbol.for("effect/Effect");class fO{patch;op;_op=Am;constructor(e,t){this.patch=e,this.op=t}}class Yt{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e}[he](e){return this===e}[be](){return Ue(this,Ml(this))}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:et(this.effect_instruction_i0),effect_instruction_i1:et(this.effect_instruction_i1),effect_instruction_i2:et(this.effect_instruction_i2)}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}class gO{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e,this._tag=e}[he](e){return up(e)&&e._op==="Failure"&&le(this.effect_instruction_i0,e.effect_instruction_i0)}[be](){return v(lt(this._tag),Re(ue(this.effect_instruction_i0)),Ue(this))}get cause(){return this.effect_instruction_i0}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}class hO{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e,this._tag=e}[he](e){return up(e)&&e._op==="Success"&&le(this.effect_instruction_i0,e.effect_instruction_i0)}[be](){return v(lt(this._tag),Re(ue(this.effect_instruction_i0)),Ue(this))}get value(){return this.effect_instruction_i0}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:et(this.value)}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}var mt=(e)=>pe(e,Xo),Qe=(e)=>{let t=new Yt(xb);return t.effect_instruction_i0=e,t},Sx=h(3,(e,t,r)=>Gt((i)=>E(e,(n)=>E(Pt(we(()=>i(t(n)))),(o)=>we(()=>r(n,o)).pipe(Dt({onFailure:(s)=>{switch(o._tag){case Ht:return tt(Vt(o.effect_instruction_i0,s));case Wt:return tt(s)}},onSuccess:()=>o})))))),kt=h(2,(e,t)=>E(e,()=>O(t))),$t=(e)=>kt(e,void 0),cf=function(){let e=new Yt(yc);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw Error(mc("you're not supposed to end up here"))}return e},ip=(e,t=bn)=>{let r=new Yt(hc),i=void 0;return r.effect_instruction_i0=(n)=>{i=e(n)},r.effect_instruction_i1=t,ko(r,(n)=>mt(i)?i:$e)},uf=(e,t=bn)=>we(()=>ip(e,t)),en=(e,t=bn)=>cf(e,function(){let r=void 0,i=void 0;function n(u){if(r)r(u);else if(i===void 0)i=u}let o=new Yt(hc);o.effect_instruction_i0=(u)=>{if(r=u,i)u(i)},o.effect_instruction_i1=t;let s=void 0,c=void 0;if(this.effect_instruction_i0.length!==1)c=new AbortController,s=Jt(()=>this.effect_instruction_i0(n,c.signal));else s=Jt(()=>this.effect_instruction_i0(n));return s||c?ko(o,(u)=>{if(c)c.abort();return s??$e}):o});var vo=h(2,(e,t)=>{let r=new Yt($l);return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r}),Ji=h(2,(e,t)=>dr(e,{onFailure:t,onSuccess:O})),lf=h(3,(e,t,r)=>vo(e,(i)=>{let n=Wo(i);switch(n._tag){case"Left":return t(n.left)?r(n.left):tt(i);case"Right":return tt(n.right)}})),IJ=h(2,(e,t)=>vo(e,(r)=>{let i=Wo(r);switch(i._tag){case"Left":return v(t(i.left),br(()=>tt(r)));case"Right":return tt(i.right)}})),TJ=(e)=>Qe((t,r)=>e(nf(r.runtimeFlags))),yJ=Symbol.for("effect/OriginalAnnotation");var vx=(e,t)=>{if(Bt(t))return new Proxy(e,{has(r,i){return i===Dc||i===yJ||i in r},get(r,i){if(i===Dc)return t.value;if(i===yJ)return e;return r[i]}});return e},xn=(e)=>Ks(e)&&!(Dc in e)?Qe((t)=>tt(Sr(vx(e,zx(t))))):tt(Sr(e)),ga=(e)=>ya(()=>Sr(new jde(e))),ha=(e)=>E(q(e),xn),Ci=(e)=>dr(e,{onFailure:(t)=>O(Mn(t)),onSuccess:(t)=>O(Nr(t))}),Pt=(e)=>pf(e,{onFailure:pt,onSuccess:Rt}),Ge=(e)=>Ks(e)&&!(Dc in e)?Qe((t)=>tt(Mc(vx(e,zx(t))))):tt(Mc(e)),Pi=(e)=>E(q(e),Ge),tt=(e)=>{let t=new gO(Ht);return t.effect_instruction_i0=e,t},ya=(e)=>E(q(e),tt),es=Qe((e)=>O(e.id())),Nn=(e)=>Qe((t)=>e(t.id())),E=h(2,(e,t)=>{let r=new Yt(jl);return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r}),ba=h(2,(e,t)=>E(e,(r)=>{let i=typeof t==="function"?t(r):t;if(mt(i))return i;else if(kA(i))return ip((n)=>{i.then((o)=>n(O(o)),(o)=>n(Ge(new gf(o,"An unknown error occurred in Effect.andThen"))))});return O(i)})),wx=(e)=>{let t=new Yt("OnStep");return t.effect_instruction_i0=e,t},tn=(e)=>E(e,Ze),xa=(e)=>dr(e,{onFailure:O,onSuccess:Ge}),pf=h(2,(e,t)=>Dt(e,{onFailure:(r)=>O(t.onFailure(r)),onSuccess:(r)=>O(t.onSuccess(r))})),Dt=h(2,(e,t)=>{let r=new Yt(Nl);return r.effect_instruction_i0=e,r.effect_instruction_i1=t.onFailure,r.effect_instruction_i2=t.onSuccess,r}),dr=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{if(y_(r).length>0)return tt(Vq(r));let n=Jb(r);if(n.length>0)return t.onFailure(e_(n));return tt(r)},onSuccess:t.onSuccess})),Rr=h(2,(e,t)=>we(()=>{let r=ot(e),i=Mm(r.length),n=0;return kt(wa({while:()=>n<r.length,body:()=>t(r[n],n),step:(o)=>{i[n++]=o}}),i)})),Yn=h(2,(e,t)=>we(()=>{let r=ot(e),i=0;return wa({while:()=>i<r.length,body:()=>t(r[i],i),step:()=>{i++}})})),kx=h((e)=>typeof e[0]==="boolean"||mt(e[0]),(e,t)=>mt(e)?E(e,(r)=>r?t.onTrue():t.onFalse()):e?t.onTrue():t.onFalse()),Ix=E(es,(e)=>Tx(e)),Tx=(e)=>tt(ki(e)),ts=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=nO(Ui),t.effect_instruction_i1=()=>e,t},EJ=(e)=>cf(e,function(){let t=new Yt(zo);return t.effect_instruction_i0=nO(Ui),t.effect_instruction_i1=(r)=>nf(r)?Jt(()=>this.effect_instruction_i0(ts)):Jt(()=>this.effect_instruction_i0(rs)),t}),wo=h(2,(e,t)=>Gt((r)=>E(Pt(r(e)),(i)=>RO(t,i)))),W=h(2,(e,t)=>E(e,(r)=>q(()=>t(r)))),df=h(2,(e,t)=>dr(e,{onFailure:(r)=>Pi(()=>t.onFailure(r)),onSuccess:(r)=>q(()=>t.onSuccess(r))})),Sa=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=Wo(r);switch(i._tag){case"Left":return Pi(()=>t(i.left));case"Right":return tt(i.right)}},onSuccess:O})),Ex=h(2,(e,t)=>Sn(e,(r)=>hf(r)?$e:t(r.effect_instruction_i0))),Sn=h(2,(e,t)=>Gt((r)=>Dt(r(e),{onFailure:(i)=>{let n=pt(i);return Dt(t(n),{onFailure:(o)=>pt(Vt(i,o)),onSuccess:()=>n})},onSuccess:(i)=>{let n=Rt(i);return st(t(n),n)}}))),ko=h(2,(e,t)=>Sn(e,Yc({onFailure:(r)=>Bm(r)?$t(t(Hb(r))):$e,onSuccess:()=>$e}))),Bc=h(2,(e,t)=>Pde(e,t,O)),Uc=(e)=>yO(e,Ze),yO=h(2,(e,t)=>dr(e,{onFailure:(r)=>xn(t(r)),onSuccess:O})),CJ=VA,op=Qe((e,t)=>O(t.runtimeFlags)),O=(e)=>{let t=new hO(Wt);return t.effect_instruction_i0=e,t},we=(e)=>{let t=new Yt(yc);return t.commit=e,t},q=(e)=>{let t=new Yt(bb);return t.effect_instruction_i0=e,t},Hi=h((e)=>e.length===3||e.length===2&&!(Ks(e[1])&&("onlyEffect"in e[1])),(e,t)=>E(e,(r)=>{let i=typeof t==="function"?t(r):t;if(mt(i))return kt(i,r);else if(kA(i))return ip((n)=>{i.then((o)=>n(O(r)),(o)=>n(Ge(new gf(o,"An unknown error occurred in Effect.tap"))))});return O(r)})),Cx=(e)=>Qe((t)=>{let r=t.getFiberRef(af),i=v(r,br(()=>t.scope()));return e(Xt(af,re(i)))}),Pde=h(3,(e,t,r)=>Dt(e,{onFailure:(i)=>{if(y_(i).length>0)return tt(ZU(Zq(i)));return t()},onSuccess:r})),rs=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=iO(Ui),t.effect_instruction_i1=()=>e,t},Gt=(e)=>cf(e,function(){let t=new Yt(zo);return t.effect_instruction_i0=iO(Ui),t.effect_instruction_i1=(r)=>nf(r)?Jt(()=>this.effect_instruction_i0(ts)):Jt(()=>this.effect_instruction_i0(rs)),t}),$e=O(void 0);var va=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},sp=h(2,(e,t)=>E(t,(r)=>{if(r)return v(e,W(re));return O(H())})),wa=(e)=>{let t=new Yt(zl);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},sf=(e)=>we(()=>{let t=new Yt(bc);return t.effect_instruction_i0=e(),t}),Px=function(){let e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return sf(()=>e(v))},ap=(e,...t)=>Object.defineProperty(t.length===0?function(...r){return sf(()=>e.apply(this,r))}:function(...r){let i=sf(()=>e.apply(this,r));for(let n of t)i=n(i,...r);return i},"length",{value:e.length,configurable:!0}),PJ=h(2,(e,t)=>Xt(e,Dx,t)),RJ=h(2,(e,t)=>Xt(e,kO,t)),Rx=h(2,(e,t)=>{let r=new Yt(zo);return r.effect_instruction_i0=t,r.effect_instruction_i1=()=>e,r}),AJ=h(2,(e,t)=>Xt(e,TO,t)),_J=h(2,(e,t)=>Xt(e,cp,t)),Io=(e)=>{let t=new Yt(Ll);return typeof e?.priority<"u"?wO(t,e.priority):t},qc=h(2,(e,t)=>E(e,(r)=>W(t,(i)=>[r,i])));var Jc=h(2,(e,t)=>E(e,(r)=>kt(t,r))),st=h(2,(e,t)=>E(e,()=>t)),Xn=h(3,(e,t,r)=>E(e,(i)=>W(t,(n)=>r(i,n)))),Hc=uf(()=>{let e=setInterval(()=>{},2147483647);return q(()=>clearInterval(e))}),ka=(e)=>E(es,(t)=>v(e,rn(t))),rn=h(2,(e,t)=>E(e.interruptAsFork(t),()=>e.await)),OJ={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return ae(this,arguments)}},DJ={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:50000,pipe(){return ae(this,arguments)}},MJ={_tag:"Error",syslog:3,label:"ERROR",ordinal:40000,pipe(){return ae(this,arguments)}},bO={_tag:"Warning",syslog:4,label:"WARN",ordinal:30000,pipe(){return ae(this,arguments)}},xO={_tag:"Info",syslog:6,label:"INFO",ordinal:20000,pipe(){return ae(this,arguments)}},SO={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return ae(this,arguments)}},FJ={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return ae(this,arguments)}},$J={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return ae(this,arguments)}};var Rde="effect/FiberRef",Ade=Symbol.for(Rde),_de={_A:(e)=>e},ei=(e)=>Qe((t)=>Rt(t.getFiberRef(e)));var Br=h(2,(e,t)=>E(ei(e),t)),Lc=h(2,(e,t)=>Ode(e,()=>[void 0,t]));var Ode=h(2,(e,t)=>Qe((r)=>{let[i,n]=t(r.getFiberRef(e));return r.setFiberRef(e,n),O(i)}));var Dde="effect/RequestResolver",jJ=Symbol.for(Dde),Mde={_A:(e)=>e,_R:(e)=>e};class NJ{runAll;target;[jJ]=Mde;constructor(e,t){this.runAll=e,this.target=t}[be](){return Ue(this,this.target?ue(this.target):Ml(this))}[he](e){return this.target?Fde(e)&&le(this.target,e.target):this===e}identified(...e){return new NJ(this.runAll,wc(e))}pipe(){return ae(this,arguments)}}var Fde=(e)=>pe(e,jJ);var Xt=h(3,(e,t,r)=>Sx(Jc(ei(t),Lc(t,r)),()=>e,(i)=>Lc(t,i))),wr=h(3,(e,t,r)=>Br(t,(i)=>Xt(e,t,r(i)))),Ut=(e,t)=>Wc(e,{differ:lx(),fork:t?.fork??Ze,join:t?.join}),zJ=(e)=>{let t=W_();return Wc(e,{differ:t,fork:t.empty})},$de=(e)=>{let t=Z_(lx());return Wc(e,{differ:t,fork:t.empty})},Ax=(e)=>{let t=H_();return Wc(e,{differ:t,fork:t.empty})},Wc=(e,t)=>({...xi,[Ade]:_de,initial:e,commit(){return ei(this)},diff:(i,n)=>t.differ.diff(i,n),combine:(i,n)=>t.differ.combine(i,n),patch:(i)=>(n)=>t.differ.patch(i,n),fork:t.fork,join:t.join??((i,n)=>n)}),LJ=(e)=>Wc(e,{differ:rO,fork:rO.empty}),zn=Fe(Symbol.for("effect/FiberRef/currentContext"),()=>Ax(Qn())),ns=Fe(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Ut(0)),_x=Fe(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Ut(2048)),Ia=Fe(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Ut(jc())),vO=Fe(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Ut(xO)),Ox=Fe(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Ut(So())),wO=h(2,(e,t)=>Xt(e,ns,t)),BJ=h(2,(e,t)=>Xt(e,_x,t)),Dx=Fe(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Ut("unbounded")),kO=Fe(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Ut(!0)),IO=Fe(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Ut(re(SO))),UJ=Fe(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Ut(re(bO))),qJ=h(2,(e,t)=>Xt(e,IO,t)),is=Fe(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>$de(zi())),JJ=ei(is),af=Fe(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Ut(H(),{fork:()=>H(),join:(e,t)=>e})),Zc=Fe(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Ut(Fn,{fork:()=>Fn,join:(e,t)=>e})),TO=Fe(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Ut(!0)),cp=Fe(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Ut(!0)),mf=Fe(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Ut(jc())),Mx=Fe(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Ut(hn())),Fx=Symbol.for("effect/Scope"),$x=Symbol.for("effect/CloseableScope"),jx=(e,t)=>e.addFinalizer(()=>$t(t)),Vc=(e,t)=>e.addFinalizer(t),Gc=(e,t)=>e.close(t),ti=(e,t)=>e.fork(t);var HJ=function(){class e extends globalThis.Error{commit(){return Ge(this)}toJSON(){let t={...this};if(this.message)t.message=this.message;if(this.cause)t.cause=this.cause;return t}[qe](){if(this.toString!==globalThis.Error.prototype.toString)return this.stack?`${this.toString()}
|
|
169
|
+
`)}return t},k_=(e)=>pe(e,w_),Xq=(e)=>pe(e,v_),e2=(e)=>pe(e,Jm),rpe=Vo(new Map),t2=()=>rpe,I_=(e,t)=>Vo(new Map([[e.key,t]])),r2=h(3,(e,t,r)=>{let i=new Map(e.unsafeMap);return i.set(t.key,r),Vo(i)}),S_=Fe("effect/Context/defaultValueCache",()=>new Map),T_=(e)=>{if(S_.has(e.key))return S_.get(e.key);let t=e.defaultValue();return S_.set(e.key,t),t},n2=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):T_(t),E_=h(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Jm in t)return T_(t);throw tpe(t)}return e.unsafeMap.get(t.key)}),i2=E_;var o2=h(2,(e,t)=>{if(!e.unsafeMap.has(t.key))return e2(t)?Xs(T_(t)):Sb;return Xs(e.unsafeMap.get(t.key))}),s2=h(2,(e,t)=>{let r=new Map(e.unsafeMap);for(let[i,n]of t.unsafeMap)r.set(i,n);return Vo(r)}),a2=(...e)=>{let t=new Map;for(let r=0;r<e.length;r++)e[r].unsafeMap.forEach((i,n)=>{t.set(n,i)});return Vo(t)};var yn=Qq;var u2=k_,Wm=Xq;var Qn=t2,$c=I_,Ot=r2,$n=i2;var ca=E_,Ii=o2,Go=s2,l2=a2;var go=Yq;var C_=Symbol.for("effect/Duration"),g2=BigInt(0),p2=BigInt(24),Zb=BigInt(60),P_=BigInt(1000),d2=BigInt(1e6),m2=BigInt(1e9),npe=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,vr=(e)=>{if(h2(e))return e;else if(Pm(e))return ua(e);else if(wA(e))return Zm(e);else if(Array.isArray(e)&&e.length===2&&e.every(Pm)){if(e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1]))return la;if(e[0]===1/0||e[1]===1/0)return ape;return Zm(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])))}else if(Cm(e)){let t=npe.exec(e);if(t){let[r,i,n]=t,o=Number(i);switch(n){case"nano":case"nanos":return Zm(BigInt(i));case"micro":case"micros":return cpe(BigInt(i));case"milli":case"millis":return ua(o);case"second":case"seconds":return R_(o);case"minute":case"minutes":return upe(o);case"hour":case"hours":return lpe(o);case"day":case"days":return ppe(o);case"week":case"weeks":return dpe(o)}}}throw Error("Invalid DurationInput")};var f2={_tag:"Millis",millis:0},ipe={_tag:"Infinity"},ope={[C_]:C_,[be](){return Ue(this,gb(this.value))},[he](e){return h2(e)&&ype(this,e)},toString(){return`Duration(${O_(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:fpe(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},yo=(e)=>{let t=Object.create(ope);if(Pm(e))if(isNaN(e)||e<=0)t.value=f2;else if(!Number.isFinite(e))t.value=ipe;else if(!Number.isInteger(e))t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))};else t.value={_tag:"Millis",millis:e};else if(e<=g2)t.value=f2;else t.value={_tag:"Nanos",nanos:e};return t},h2=(e)=>pe(e,C_);var spe=(e)=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===g2;case"Infinity":return!1}},la=yo(0),ape=yo(1/0),Zm=(e)=>yo(e),cpe=(e)=>yo(e*P_),ua=(e)=>yo(e),R_=(e)=>yo(e*1000),upe=(e)=>yo(e*60000),lpe=(e)=>yo(e*3600000),ppe=(e)=>yo(e*86400000),dpe=(e)=>yo(e*604800000),ho=(e)=>gpe(e,{onMillis:(t)=>t,onNanos:(t)=>Number(t)/1e6});var mpe=(e)=>{let t=vr(e);switch(t.value._tag){case"Infinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return BigInt(Math.round(t.value.millis*1e6))}},fpe=(e)=>{let t=vr(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/m2),Number(t.value.nanos%m2)];case"Millis":return[Math.floor(t.value.millis/1000),Math.round(t.value.millis%1000*1e6)]}},gpe=h(2,(e,t)=>{let r=vr(e);switch(r.value._tag){case"Nanos":return t.onNanos(r.value.nanos);case"Infinity":return t.onMillis(1/0);case"Millis":return t.onMillis(r.value.millis)}}),A_=h(3,(e,t,r)=>{let i=vr(e),n=vr(t);if(i.value._tag==="Infinity"||n.value._tag==="Infinity")return r.onMillis(ho(i),ho(n));else if(i.value._tag==="Nanos"||n.value._tag==="Nanos"){let o=i.value._tag==="Nanos"?i.value.nanos:BigInt(Math.round(i.value.millis*1e6)),s=n.value._tag==="Nanos"?n.value.nanos:BigInt(Math.round(n.value.millis*1e6));return r.onNanos(o,s)}return r.onMillis(i.value.millis,n.value.millis)});var hpe=(e,t)=>A_(e,t,{onMillis:(r,i)=>r===i,onNanos:(r,i)=>r===i});var y2=h(2,(e,t)=>A_(e,t,{onMillis:(r,i)=>r<=i,onNanos:(r,i)=>r<=i}));var __=h(2,(e,t)=>A_(e,t,{onMillis:(r,i)=>r>=i,onNanos:(r,i)=>r>=i})),ype=h(2,(e,t)=>hpe(vr(e),vr(t))),bpe=(e)=>{let t=vr(e);if(t.value._tag==="Infinity")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};let r=mpe(t),i=r/d2,n=i/P_,o=n/Zb,s=o/Zb,c=s/p2;return{days:Number(c),hours:Number(s%p2),minutes:Number(o%Zb),seconds:Number(n%Zb),millis:Number(i%P_),nanos:Number(r%d2)}},O_=(e)=>{let t=vr(e);if(t.value._tag==="Infinity")return"Infinity";if(spe(t))return"0";let r=bpe(t),i=[];if(r.days!==0)i.push(`${r.days}d`);if(r.hours!==0)i.push(`${r.hours}h`);if(r.minutes!==0)i.push(`${r.minutes}m`);if(r.seconds!==0)i.push(`${r.seconds}s`);if(r.millis!==0)i.push(`${r.millis}ms`);if(r.nanos!==0)i.push(`${r.nanos}ns`);return i.join(" ")};var b2=Symbol.for("effect/MutableRef"),xpe={[b2]:b2,toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableRef",current:et(this.current)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},bo=(e)=>{let t=Object.create(xpe);return t.current=e,t},Vb=h(3,(e,t,r)=>{if(le(t,e.current))return e.current=r,!0;return!1});var jn=(e)=>e.current;var Ti=h(2,(e,t)=>(e.current=t,e));var Yb="effect/FiberId",da=Symbol.for(Yb),ma="None",Gb="Runtime",Kb="Composite",Spe=lt(`${Yb}-${ma}`);class S2{[da]=da;_tag=ma;id=-1;startTimeMillis=-1;[be](){return Spe}[he](e){return ex(e)&&e._tag===ma}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[qe](){return this.toJSON()}}class v2{id;startTimeMillis;[da]=da;_tag=Gb;constructor(e,t){this.id=e,this.startTimeMillis=t}[be](){return Ue(this,lt(`${Yb}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[he](e){return ex(e)&&e._tag===Gb&&this.id===e.id&&this.startTimeMillis===e.startTimeMillis}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[qe](){return this.toJSON()}}class w2{left;right;[da]=da;_tag=Kb;constructor(e,t){this.left=e,this.right=t}_hash;[be](){return v(lt(`${Yb}-${this._tag}`),Re(ue(this.left)),Re(ue(this.right)),Ue(this))}[he](e){return ex(e)&&e._tag===Kb&&le(this.left,e.left)&&le(this.right,e.right)}toString(){return it(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:et(this.left),right:et(this.right)}}[qe](){return this.toJSON()}}var Xb=new S2;var ex=(e)=>pe(e,da),D_=(e)=>e._tag===ma||v(Qb(e),zq((t)=>D_(t)));var k2=h(2,(e,t)=>{if(e._tag===ma)return t;if(t._tag===ma)return e;return new w2(e,t)});var I2=h(2,(e,t)=>D_(e)?t:e),Vm=(e)=>{switch(e._tag){case ma:return Li();case Gb:return oa(e.id);case Kb:return v(Vm(e.left),fo(Vm(e.right)))}},x2=Fe(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>bo(0));var tx=(e)=>Array.from(Vm(e)).map((r)=>`#${r}`).join(",");var Qb=(e)=>{switch(e._tag){case ma:return Li();case Gb:return oa(e);case Kb:return v(Qb(e.left),fo(Qb(e.right)))}},T2=()=>{let e=jn(x2);return v(x2,Ti(e+1)),new v2(e,Date.now())};var bn=Xb;var M_=k2;var rx=I2,F_=Vm;var C2=tx;var nx=T2;var jc=Vl;var P2=bq,R2=Sq,$_=vq;var Bi=Tc,j_=Fb;var A2=wq,_2=$b;var O2=Iq;var D2=Nb,N_=Gl;var Km=Symbol.for("effect/List"),z_=(e)=>ot(e),vpe=(e)=>xU(Wl(e),z_),wpe=vpe(le),kpe={[Km]:Km,_tag:"Cons",toString(){return it(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:z_(this).map(et)}},[qe](){return this.toJSON()},[he](e){return F2(e)&&this._tag===e._tag&&wpe(this,e)},[be](){return Ue(this,Dn(z_(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag==="Nil")return e=!0,this.return();let r=t.head;return t=t.tail,{done:e,value:r}},return(r){if(!e)e=!0;return{done:!0,value:r}}}},pipe(){return ae(this,arguments)}},ix=(e,t)=>{let r=Object.create(kpe);return r.head=e,r.tail=t,r},Ipe=lt("Nil"),Tpe={[Km]:Km,_tag:"Nil",toString(){return it(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[qe](){return this.toJSON()},[be](){return Ipe},[he](e){return F2(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return ae(this,arguments)}},M2=Object.create(Tpe),F2=(e)=>pe(e,Km),xo=(e)=>e._tag==="Nil",L_=(e)=>e._tag==="Cons";var Epe=()=>M2,Ko=(e,t)=>ix(e,t),So=Epe,Qm=(e)=>ix(e,M2);var $2=h(2,(e,t)=>Cpe(t,e)),ox=h(2,(e,t)=>Ko(t,e)),Cpe=h(2,(e,t)=>{if(xo(e))return t;else if(xo(t))return e;else{let r=ix(t.head,e),i=r,n=t.tail;while(!xo(n)){let o=ix(n.head,e);i.tail=o,i=o,n=n.tail}return r}});var j2=h(3,(e,t,r)=>{let i=t,n=e;while(!xo(n))i=r(i,n.head),n=n.tail;return i});var N2=(e)=>{let t=So(),r=e;while(!xo(r))t=ox(t,r.head),r=r.tail;return t};var hqe=Object.assign(Object.create(Array.prototype),{[be](){return Ue(this,Dn(this))},[he](e){if(Array.isArray(e)&&this.length===e.length)return this.every((t,r)=>le(t,e[r]));else return!1}}),tp=function(){function e(t){if(t)Object.assign(this,t)}return e.prototype=Bl,e}(),ax=(e)=>Object.assign(Object.create(Bl),e);var Ppe=Symbol.for("effect/DifferContextPatch");function L2(e){return e}var Xm={...tp.prototype,[Ppe]:{_Value:L2,_Patch:L2}},Rpe=Object.assign(Object.create(Xm),{_tag:"Empty"}),Ape=Object.create(Rpe),B_=()=>Ape,_pe=Object.assign(Object.create(Xm),{_tag:"AndThen"}),Ope=(e,t)=>{let r=Object.create(_pe);return r.first=e,r.second=t,r},Dpe=Object.assign(Object.create(Xm),{_tag:"AddService"}),Mpe=(e,t)=>{let r=Object.create(Dpe);return r.key=e,r.service=t,r},Fpe=Object.assign(Object.create(Xm),{_tag:"RemoveService"}),$pe=(e)=>{let t=Object.create(Fpe);return t.key=e,t},jpe=Object.assign(Object.create(Xm),{_tag:"UpdateService"}),Npe=(e,t)=>{let r=Object.create(jpe);return r.key=e,r.update=t,r},B2=(e,t)=>{let r=new Map(e.unsafeMap),i=B_();for(let[n,o]of t.unsafeMap.entries())if(r.has(n)){let s=r.get(n);if(r.delete(n),!le(s,o))i=Ym(Npe(n,()=>o))(i)}else r.delete(n),i=Ym(Mpe(n,o))(i);for(let[n]of r.entries())i=Ym($pe(n))(i);return i},Ym=h(2,(e,t)=>Ope(e,t)),U2=h(2,(e,t)=>{if(e._tag==="Empty")return t;let r=!1,i=Zt(e),n=new Map(t.unsafeMap);while(zr(i)){let s=Pr(i),c=Yr(i);switch(s._tag){case"Empty":{i=c;break}case"AddService":{n.set(s.key,s.service),i=c;break}case"AndThen":{i=Cr(Cr(c,s.second),s.first);break}case"RemoveService":{n.delete(s.key),i=c;break}case"UpdateService":{n.set(s.key,s.update(n.get(s.key))),r=!0,i=c;break}}}if(!r)return Vo(n);let o=new Map;for(let[s]of t.unsafeMap)if(n.has(s))o.set(s,n.get(s)),n.delete(s);for(let[s,c]of n)o.set(s,c);return Vo(o)});var Lpe=Symbol.for("effect/DifferHashSetPatch");function U_(e){return e}var ux={...tp.prototype,[Lpe]:{_Value:U_,_Key:U_,_Patch:U_}},Bpe=Object.assign(Object.create(ux),{_tag:"Empty"}),Upe=Object.create(Bpe),q_=()=>Upe,qpe=Object.assign(Object.create(ux),{_tag:"AndThen"}),Jpe=(e,t)=>{let r=Object.create(qpe);return r.first=e,r.second=t,r},Hpe=Object.assign(Object.create(ux),{_tag:"Add"}),Wpe=(e)=>{let t=Object.create(Hpe);return t.value=e,t},Zpe=Object.assign(Object.create(ux),{_tag:"Remove"}),Vpe=(e)=>{let t=Object.create(Zpe);return t.value=e,t},q2=(e,t)=>{let[r,i]=Cc([e,q_()],([n,o],s)=>{if(Nq(s)(n))return[l_(s)(n),o];return[n,cx(Wpe(s))(o)]})(t);return Cc(i,(n,o)=>cx(Vpe(o))(n))(r)},cx=h(2,(e,t)=>Jpe(e,t)),J2=h(2,(e,t)=>{if(e._tag==="Empty")return t;let r=t,i=Zt(e);while(zr(i)){let n=Pr(i),o=Yr(i);switch(n._tag){case"Empty":{i=o;break}case"AndThen":{i=Cr(n.first)(Cr(n.second)(o));break}case"Add":{r=Ec(n.value)(r),i=o;break}case"Remove":r=l_(n.value)(r),i=o}}return r});var Kpe=Symbol.for("effect/DifferReadonlyArrayPatch");function H2(e){return e}var tf={...tp.prototype,[Kpe]:{_Value:H2,_Patch:H2}},Qpe=Object.assign(Object.create(tf),{_tag:"Empty"}),Ype=Object.create(Qpe),J_=()=>Ype,Xpe=Object.assign(Object.create(tf),{_tag:"AndThen"}),ede=(e,t)=>{let r=Object.create(Xpe);return r.first=e,r.second=t,r},tde=Object.assign(Object.create(tf),{_tag:"Append"}),rde=(e)=>{let t=Object.create(tde);return t.values=e,t},nde=Object.assign(Object.create(tf),{_tag:"Slice"}),ide=(e,t)=>{let r=Object.create(nde);return r.from=e,r.until=t,r},ode=Object.assign(Object.create(tf),{_tag:"Update"}),sde=(e,t)=>{let r=Object.create(ode);return r.index=e,r.patch=t,r},W2=(e)=>{let t=0,r=J_();while(t<e.oldValue.length&&t<e.newValue.length){let i=e.oldValue[t],n=e.newValue[t],o=e.differ.diff(i,n);if(!le(o,e.differ.empty))r=ef(r,sde(t,o));t=t+1}if(t<e.oldValue.length)r=ef(r,ide(0,t));if(t<e.newValue.length)r=ef(r,rde(tq(t)(e.newValue)));return r},ef=h(2,(e,t)=>ede(e,t)),Z2=h(3,(e,t,r)=>{if(e._tag==="Empty")return t;let i=t.slice(),n=gn(e);while(kb(n)){let o=Er(n),s=uo(n);switch(o._tag){case"Empty":{n=s;break}case"AndThen":{s.unshift(o.first,o.second),n=s;break}case"Append":{for(let c of o.values)i.push(c);n=s;break}case"Slice":{i=i.slice(o.from,o.until),n=s;break}case"Update":{i[o.index]=r.patch(o.patch,i[o.index]),n=s;break}}}return i});var V2=Symbol.for("effect/Differ"),cde={[V2]:{_P:Ze,_V:Ze},pipe(){return ae(this,arguments)}},fa=(e)=>{let t=Object.create(cde);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},H_=()=>fa({empty:B_(),combine:(e,t)=>Ym(t)(e),diff:(e,t)=>B2(e,t),patch:(e,t)=>U2(t)(e)});var W_=()=>fa({empty:q_(),combine:(e,t)=>cx(t)(e),diff:(e,t)=>q2(e,t),patch:(e,t)=>J2(t)(e)});var Z_=(e)=>fa({empty:J_(),combine:(t,r)=>ef(t,r),diff:(t,r)=>W2({oldValue:t,newValue:r,differ:e}),patch:(t,r)=>Z2(t,r,e)});var lx=()=>G2((e,t)=>t),G2=(e)=>fa({empty:Ze,combine:(t,r)=>{if(t===Ze)return r;if(r===Ze)return t;return(i)=>r(t(i))},diff:(t,r)=>{if(le(t,r))return Ze;return Tm(r)},patch:(t,r)=>e(r,t(r))});var rf=255,K2=8,px=(e)=>e&rf,dx=(e)=>e>>K2&rf,Nc=(e,t)=>(e&rf)+((t&e&rf)<<K2),mx=Nc(0,0),Q2=(e)=>Nc(e,e),Y2=(e)=>Nc(e,0);var X2=h(2,(e,t)=>Nc(px(e)&~t,dx(e)));var G_=h(2,(e,t)=>e|t);var eJ=(e)=>~e>>>0&rf;var ude=0,Ui=1,rJ=2,K_=4,fx=16,Q_=32;var nJ=(e)=>gx(e,Q_),Y_=h(2,(e,t)=>e&~t);var X_=h(2,(e,t)=>e|t);var qi=(e)=>nf(e)&&!lde(e),nf=(e)=>gx(e,Ui);var gx=h(2,(e,t)=>(e&t)!==0),eO=(...e)=>e.reduce((t,r)=>t|r,0),iJ=eO(ude);var tO=(e)=>gx(e,K_);var lde=(e)=>gx(e,fx);var Ei=h(2,(e,t)=>Nc(e^t,t)),Qo=h(2,(e,t)=>e&(eJ(px(t))|dx(t))|px(t)&dx(t));var rO=fa({empty:mx,diff:(e,t)=>Ei(e,t),combine:(e,t)=>G_(t)(e),patch:(e,t)=>Qo(t,e)});var oJ=mx;var nO=Q2,iO=Y2;var oO=X2;var aJ={_tag:"Empty"},aO=(e,t)=>({_tag:"Par",left:e,right:t}),hx=(e,t)=>({_tag:"Seq",left:e,right:t}),cO=(e,t)=>({_tag:"Single",dataSource:e,blockedRequest:t});var cJ=(e)=>{let t=Qm(e),r=So();while(!0){let[i,n]=j2(t,[lJ(),So()],([o,s],c)=>{let[u,l]=pde(c);return[bde(o,u),$2(s,l)]});if(r=dde(r,i),xo(n))return N2(r);t=n}throw Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},pde=(e)=>{let t=e,r=lJ(),i=So(),n=So();while(!0)switch(t._tag){case"Empty":{if(xo(i))return[r,n];t=i.head,i=i.tail;break}case"Par":{i=Ko(t.right,i),t=t.left;break}case"Seq":{let{left:o,right:s}=t;switch(o._tag){case"Empty":{t=s;break}case"Par":{let{left:c,right:u}=o;t=aO(hx(c,s),hx(u,s));break}case"Seq":{let{left:c,right:u}=o;t=hx(c,hx(u,s));break}case"Single":{t=o,n=Ko(s,n);break}}break}case"Single":{if(r=yde(r,t),xo(i))return[r,n];t=i.head,i=i.tail;break}}throw Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},dde=(e,t)=>{if(xo(e))return Qm(sO(t));if(xde(t))return e;let r=Tde(e.head),i=Sde(t);if(r.length===1&&i.length===1&&le(r[0],i[0]))return Ko(Ide(e.head,sO(t)),e.tail);return Ko(sO(t),e)},mde=Symbol.for("effect/RequestBlock/Entry");class uJ{request;result;listeners;ownerId;state;[mde]=fde;constructor(e,t,r,i,n){this.request=e,this.result=t,this.listeners=r,this.ownerId=i,this.state=n}}var fde={_R:(e)=>e};var uO=(e)=>new uJ(e.request,e.result,e.listeners,e.ownerId,e.state),gde=Symbol.for("effect/RequestBlock/RequestBlockParallel"),hde={_R:(e)=>e};class yx{map;[gde]=hde;constructor(e){this.map=e}}var lJ=()=>new yx(jc());var yde=(e,t)=>new yx(_2(e.map,t.dataSource,(r)=>WU(Gn(r,Cb(t.blockedRequest)),()=>Zt(t.blockedRequest)))),bde=(e,t)=>new yx(N_(e.map,t.map,(r,i,n)=>Bi(r,n,yr($_(r,n),{onNone:()=>i,onSome:(o)=>Kn(i,o)})))),xde=(e)=>R2(e.map),Sde=(e)=>Array.from(j_(e.map)),sO=(e)=>kde(O2(e.map,(t)=>Zt(t))),vde=Symbol.for("effect/RequestBlock/RequestBlockSequential"),wde={_R:(e)=>e};class lO{map;[vde]=wde;constructor(e){this.map=e}}var kde=(e)=>new lO(e),Ide=(e,t)=>new lO(N_(t.map,e.map,(r,i,n)=>Bi(r,n,yr($_(r,n),{onNone:()=>hn(),onSome:(o)=>Kn(o,i)}))));var Tde=(e)=>Array.from(j_(e.map)),pJ=(e)=>Array.from(e.map);var zc="Pending",of="Done";var Ede="effect/Deferred",fJ=Symbol.for(Ede),gJ={_E:(e)=>e,_A:(e)=>e},hJ=(e)=>({_tag:zc,joiners:e}),pO=(e)=>({_tag:of,effect:e});class np{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new np(this.self)}}var Yo=(e,t)=>{let r=new Yt("Blocked");return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r},xx=(e)=>{let t=new Yt("RunBlocked");return t.effect_instruction_i0=e,t},Xo=Symbol.for("effect/Effect");class fO{patch;op;_op=Am;constructor(e,t){this.patch=e,this.op=t}}class Yt{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e}[he](e){return this===e}[be](){return Ue(this,Ml(this))}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:et(this.effect_instruction_i0),effect_instruction_i1:et(this.effect_instruction_i1),effect_instruction_i2:et(this.effect_instruction_i2)}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}class gO{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e,this._tag=e}[he](e){return up(e)&&e._op==="Failure"&&le(this.effect_instruction_i0,e.effect_instruction_i0)}[be](){return v(lt(this._tag),Re(ue(this.effect_instruction_i0)),Ue(this))}get cause(){return this.effect_instruction_i0}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}class hO{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Xo]=Ys;constructor(e){this._op=e,this._tag=e}[he](e){return up(e)&&e._op==="Success"&&le(this.effect_instruction_i0,e.effect_instruction_i0)}[be](){return v(lt(this._tag),Re(ue(this.effect_instruction_i0)),Ue(this))}get value(){return this.effect_instruction_i0}pipe(){return ae(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:et(this.value)}}toString(){return it(this.toJSON())}[qe](){return this.toJSON()}[Symbol.iterator](){return new np(new jo(this))}}var mt=(e)=>pe(e,Xo),Qe=(e)=>{let t=new Yt(xb);return t.effect_instruction_i0=e,t},Sx=h(3,(e,t,r)=>Gt((i)=>E(e,(n)=>E(Pt(we(()=>i(t(n)))),(o)=>we(()=>r(n,o)).pipe(Dt({onFailure:(s)=>{switch(o._tag){case Ht:return tt(Vt(o.effect_instruction_i0,s));case Wt:return tt(s)}},onSuccess:()=>o})))))),kt=h(2,(e,t)=>E(e,()=>O(t))),$t=(e)=>kt(e,void 0),cf=function(){let e=new Yt(yc);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw Error(mc("you're not supposed to end up here"))}return e},ip=(e,t=bn)=>{let r=new Yt(hc),i=void 0;return r.effect_instruction_i0=(n)=>{i=e(n)},r.effect_instruction_i1=t,ko(r,(n)=>mt(i)?i:$e)},uf=(e,t=bn)=>we(()=>ip(e,t)),en=(e,t=bn)=>cf(e,function(){let r=void 0,i=void 0;function n(u){if(r)r(u);else if(i===void 0)i=u}let o=new Yt(hc);o.effect_instruction_i0=(u)=>{if(r=u,i)u(i)},o.effect_instruction_i1=t;let s=void 0,c=void 0;if(this.effect_instruction_i0.length!==1)c=new AbortController,s=Jt(()=>this.effect_instruction_i0(n,c.signal));else s=Jt(()=>this.effect_instruction_i0(n));return s||c?ko(o,(u)=>{if(c)c.abort();return s??$e}):o});var vo=h(2,(e,t)=>{let r=new Yt($l);return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r}),Ji=h(2,(e,t)=>dr(e,{onFailure:t,onSuccess:O})),lf=h(3,(e,t,r)=>vo(e,(i)=>{let n=Wo(i);switch(n._tag){case"Left":return t(n.left)?r(n.left):tt(i);case"Right":return tt(n.right)}})),IJ=h(2,(e,t)=>vo(e,(r)=>{let i=Wo(r);switch(i._tag){case"Left":return v(t(i.left),br(()=>tt(r)));case"Right":return tt(i.right)}})),TJ=(e)=>Qe((t,r)=>e(nf(r.runtimeFlags))),yJ=Symbol.for("effect/OriginalAnnotation");var vx=(e,t)=>{if(Bt(t))return new Proxy(e,{has(r,i){return i===Dc||i===yJ||i in r},get(r,i){if(i===Dc)return t.value;if(i===yJ)return e;return r[i]}});return e},xn=(e)=>Ks(e)&&!(Dc in e)?Qe((t)=>tt(Sr(vx(e,zx(t))))):tt(Sr(e)),ga=(e)=>ya(()=>Sr(new jde(e))),ha=(e)=>E(q(e),xn),Ci=(e)=>dr(e,{onFailure:(t)=>O(Mn(t)),onSuccess:(t)=>O(Nr(t))}),Pt=(e)=>pf(e,{onFailure:pt,onSuccess:Rt}),Ge=(e)=>Ks(e)&&!(Dc in e)?Qe((t)=>tt(Mc(vx(e,zx(t))))):tt(Mc(e)),Pi=(e)=>E(q(e),Ge),tt=(e)=>{let t=new gO(Ht);return t.effect_instruction_i0=e,t},ya=(e)=>E(q(e),tt),es=Qe((e)=>O(e.id())),Nn=(e)=>Qe((t)=>e(t.id())),E=h(2,(e,t)=>{let r=new Yt(jl);return r.effect_instruction_i0=e,r.effect_instruction_i1=t,r}),ba=h(2,(e,t)=>E(e,(r)=>{let i=typeof t==="function"?t(r):t;if(mt(i))return i;else if(kA(i))return ip((n)=>{i.then((o)=>n(O(o)),(o)=>n(Ge(new gf(o,"An unknown error occurred in Effect.andThen"))))});return O(i)})),wx=(e)=>{let t=new Yt("OnStep");return t.effect_instruction_i0=e,t},tn=(e)=>E(e,Ze),xa=(e)=>dr(e,{onFailure:O,onSuccess:Ge}),pf=h(2,(e,t)=>Dt(e,{onFailure:(r)=>O(t.onFailure(r)),onSuccess:(r)=>O(t.onSuccess(r))})),Dt=h(2,(e,t)=>{let r=new Yt(Nl);return r.effect_instruction_i0=e,r.effect_instruction_i1=t.onFailure,r.effect_instruction_i2=t.onSuccess,r}),dr=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{if(y_(r).length>0)return tt(Vq(r));let n=Jb(r);if(n.length>0)return t.onFailure(e_(n));return tt(r)},onSuccess:t.onSuccess})),Rr=h(2,(e,t)=>we(()=>{let r=ot(e),i=Mm(r.length),n=0;return kt(wa({while:()=>n<r.length,body:()=>t(r[n],n),step:(o)=>{i[n++]=o}}),i)})),Yn=h(2,(e,t)=>we(()=>{let r=ot(e),i=0;return wa({while:()=>i<r.length,body:()=>t(r[i],i),step:()=>{i++}})})),kx=h((e)=>typeof e[0]==="boolean"||mt(e[0]),(e,t)=>mt(e)?E(e,(r)=>r?t.onTrue():t.onFalse()):e?t.onTrue():t.onFalse()),Ix=E(es,(e)=>Tx(e)),Tx=(e)=>tt(ki(e)),ts=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=nO(Ui),t.effect_instruction_i1=()=>e,t},EJ=(e)=>cf(e,function(){let t=new Yt(zo);return t.effect_instruction_i0=nO(Ui),t.effect_instruction_i1=(r)=>nf(r)?Jt(()=>this.effect_instruction_i0(ts)):Jt(()=>this.effect_instruction_i0(rs)),t}),wo=h(2,(e,t)=>Gt((r)=>E(Pt(r(e)),(i)=>RO(t,i)))),W=h(2,(e,t)=>E(e,(r)=>q(()=>t(r)))),df=h(2,(e,t)=>dr(e,{onFailure:(r)=>Pi(()=>t.onFailure(r)),onSuccess:(r)=>q(()=>t.onSuccess(r))})),Sa=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=Wo(r);switch(i._tag){case"Left":return Pi(()=>t(i.left));case"Right":return tt(i.right)}},onSuccess:O})),Ex=h(2,(e,t)=>Sn(e,(r)=>hf(r)?$e:t(r.effect_instruction_i0))),Sn=h(2,(e,t)=>Gt((r)=>Dt(r(e),{onFailure:(i)=>{let n=pt(i);return Dt(t(n),{onFailure:(o)=>pt(Vt(i,o)),onSuccess:()=>n})},onSuccess:(i)=>{let n=Rt(i);return st(t(n),n)}}))),ko=h(2,(e,t)=>Sn(e,Yc({onFailure:(r)=>Bm(r)?$t(t(Hb(r))):$e,onSuccess:()=>$e}))),Bc=h(2,(e,t)=>Pde(e,t,O)),Uc=(e)=>yO(e,Ze),yO=h(2,(e,t)=>dr(e,{onFailure:(r)=>xn(t(r)),onSuccess:O})),CJ=VA,op=Qe((e,t)=>O(t.runtimeFlags)),O=(e)=>{let t=new hO(Wt);return t.effect_instruction_i0=e,t},we=(e)=>{let t=new Yt(yc);return t.commit=e,t},q=(e)=>{let t=new Yt(bb);return t.effect_instruction_i0=e,t},Hi=h((e)=>e.length===3||e.length===2&&!(Ks(e[1])&&("onlyEffect"in e[1])),(e,t)=>E(e,(r)=>{let i=typeof t==="function"?t(r):t;if(mt(i))return kt(i,r);else if(kA(i))return ip((n)=>{i.then((o)=>n(O(r)),(o)=>n(Ge(new gf(o,"An unknown error occurred in Effect.tap"))))});return O(r)})),Cx=(e)=>Qe((t)=>{let r=t.getFiberRef(af),i=v(r,br(()=>t.scope()));return e(Xt(af,re(i)))}),Pde=h(3,(e,t,r)=>Dt(e,{onFailure:(i)=>{if(y_(i).length>0)return tt(ZU(Zq(i)));return t()},onSuccess:r})),rs=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=iO(Ui),t.effect_instruction_i1=()=>e,t},Gt=(e)=>cf(e,function(){let t=new Yt(zo);return t.effect_instruction_i0=iO(Ui),t.effect_instruction_i1=(r)=>nf(r)?Jt(()=>this.effect_instruction_i0(ts)):Jt(()=>this.effect_instruction_i0(rs)),t}),$e=O(void 0);var va=(e)=>{let t=new Yt(zo);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},sp=h(2,(e,t)=>E(t,(r)=>{if(r)return v(e,W(re));return O(H())})),wa=(e)=>{let t=new Yt(zl);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},sf=(e)=>we(()=>{let t=new Yt(bc);return t.effect_instruction_i0=e(),t}),Px=function(){let e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return sf(()=>e(v))},ap=(e,...t)=>Object.defineProperty(t.length===0?function(...r){return sf(()=>e.apply(this,r))}:function(...r){let i=sf(()=>e.apply(this,r));for(let n of t)i=n(i,...r);return i},"length",{value:e.length,configurable:!0}),PJ=h(2,(e,t)=>Xt(e,Dx,t)),RJ=h(2,(e,t)=>Xt(e,kO,t)),Rx=h(2,(e,t)=>{let r=new Yt(zo);return r.effect_instruction_i0=t,r.effect_instruction_i1=()=>e,r}),AJ=h(2,(e,t)=>Xt(e,TO,t)),_J=h(2,(e,t)=>Xt(e,cp,t)),Io=(e)=>{let t=new Yt(Ll);return typeof e?.priority<"u"?wO(t,e.priority):t},qc=h(2,(e,t)=>E(e,(r)=>W(t,(i)=>[r,i])));var Jc=h(2,(e,t)=>E(e,(r)=>kt(t,r))),st=h(2,(e,t)=>E(e,()=>t)),Xn=h(3,(e,t,r)=>E(e,(i)=>W(t,(n)=>r(i,n)))),Hc=uf(()=>{let e=setInterval(()=>{},2147483647);return q(()=>clearInterval(e))}),ka=(e)=>E(es,(t)=>v(e,rn(t))),rn=h(2,(e,t)=>E(e.interruptAsFork(t),()=>e.await)),OJ={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return ae(this,arguments)}},DJ={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:50000,pipe(){return ae(this,arguments)}},MJ={_tag:"Error",syslog:3,label:"ERROR",ordinal:40000,pipe(){return ae(this,arguments)}},bO={_tag:"Warning",syslog:4,label:"WARN",ordinal:30000,pipe(){return ae(this,arguments)}},xO={_tag:"Info",syslog:6,label:"INFO",ordinal:20000,pipe(){return ae(this,arguments)}},SO={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return ae(this,arguments)}},FJ={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return ae(this,arguments)}},$J={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return ae(this,arguments)}};var Rde="effect/FiberRef",Ade=Symbol.for(Rde),_de={_A:(e)=>e},ei=(e)=>Qe((t)=>Rt(t.getFiberRef(e)));var Br=h(2,(e,t)=>E(ei(e),t)),Lc=h(2,(e,t)=>Ode(e,()=>[void 0,t]));var Ode=h(2,(e,t)=>Qe((r)=>{let[i,n]=t(r.getFiberRef(e));return r.setFiberRef(e,n),O(i)}));var Dde="effect/RequestResolver",jJ=Symbol.for(Dde),Mde={_A:(e)=>e,_R:(e)=>e};class NJ{runAll;target;[jJ]=Mde;constructor(e,t){this.runAll=e,this.target=t}[be](){return Ue(this,this.target?ue(this.target):Ml(this))}[he](e){return this.target?Fde(e)&&le(this.target,e.target):this===e}identified(...e){return new NJ(this.runAll,wc(e))}pipe(){return ae(this,arguments)}}var Fde=(e)=>pe(e,jJ);var Xt=h(3,(e,t,r)=>Sx(Jc(ei(t),Lc(t,r)),()=>e,(i)=>Lc(t,i))),wr=h(3,(e,t,r)=>Br(t,(i)=>Xt(e,t,r(i)))),Ut=(e,t)=>Wc(e,{differ:lx(),fork:t?.fork??Ze,join:t?.join}),zJ=(e)=>{let t=W_();return Wc(e,{differ:t,fork:t.empty})},$de=(e)=>{let t=Z_(lx());return Wc(e,{differ:t,fork:t.empty})},Ax=(e)=>{let t=H_();return Wc(e,{differ:t,fork:t.empty})},Wc=(e,t)=>({...xi,[Ade]:_de,initial:e,commit(){return ei(this)},diff:(i,n)=>t.differ.diff(i,n),combine:(i,n)=>t.differ.combine(i,n),patch:(i)=>(n)=>t.differ.patch(i,n),fork:t.fork,join:t.join??((i,n)=>n)}),LJ=(e)=>Wc(e,{differ:rO,fork:rO.empty}),zn=Fe(Symbol.for("effect/FiberRef/currentContext"),()=>Ax(Qn())),ns=Fe(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Ut(0)),_x=Fe(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Ut(2048)),Ia=Fe(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Ut(jc())),vO=Fe(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Ut(xO)),Ox=Fe(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Ut(So())),wO=h(2,(e,t)=>Xt(e,ns,t)),BJ=h(2,(e,t)=>Xt(e,_x,t)),Dx=Fe(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Ut("unbounded")),kO=Fe(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Ut(!0)),IO=Fe(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Ut(re(SO))),UJ=Fe(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Ut(re(bO))),qJ=h(2,(e,t)=>Xt(e,IO,t)),is=Fe(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>$de(zi())),JJ=ei(is),af=Fe(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Ut(H(),{fork:()=>H(),join:(e,t)=>e})),Zc=Fe(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Ut(Fn,{fork:()=>Fn,join:(e,t)=>e})),TO=Fe(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Ut(!0)),cp=Fe(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Ut(!0)),mf=Fe(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Ut(jc())),Mx=Fe(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Ut(hn())),Fx=Symbol.for("effect/Scope"),$x=Symbol.for("effect/CloseableScope"),jx=(e,t)=>e.addFinalizer(()=>$t(t)),Vc=(e,t)=>e.addFinalizer(t),Gc=(e,t)=>e.close(t),ti=(e,t)=>e.fork(t);var HJ=function(){class e extends globalThis.Error{commit(){return Ge(this)}toJSON(){let t={...this};if(this.message)t.message=this.message;if(this.cause)t.cause=this.cause;return t}[qe](){if(this.toString!==globalThis.Error.prototype.toString)return this.stack?`${this.toString()}
|
|
170
170
|
${this.stack.split(`
|
|
171
171
|
`).slice(1).join(`
|
|
172
|
-
`)}`:this.toString();else if("Bun"in globalThis)return Zo(Mc(this),{renderErrorCause:!0});return this}}return Object.assign(e.prototype,AA),e}(),Kc=(e,t)=>{class r extends HJ{_tag=t}return Object.assign(r.prototype,e),r.prototype.name=t,r},bJ=Symbol.for("effect/Cause/errors/RuntimeException"),jde=Kc({[bJ]:bJ},"RuntimeException");var dO=Symbol.for("effect/Cause/errors/InterruptedException"),Jqe=Kc({[dO]:dO},"InterruptedException"),WJ=(e)=>pe(e,dO),xJ=Symbol.for("effect/Cause/errors/IllegalArgument"),ff=Kc({[xJ]:xJ},"IllegalArgumentException");var mO=Symbol.for("effect/Cause/errors/NoSuchElement"),Ln=Kc({[mO]:mO},"NoSuchElementException"),ZJ=(e)=>pe(e,mO),SJ=Symbol.for("effect/Cause/errors/InvalidPubSubCapacityException"),Hqe=Kc({[SJ]:SJ},"InvalidPubSubCapacityException"),vJ=Symbol.for("effect/Cause/errors/ExceededCapacityException"),Wqe=Kc({[vJ]:vJ},"ExceededCapacityException");var wJ=Symbol.for("effect/Cause/errors/Timeout"),Nde=Kc({[wJ]:wJ},"TimeoutException"),VJ=(e)=>new Nde(`Operation timed out after '${O_(e)}'`);var kJ=Symbol.for("effect/Cause/errors/UnknownException"),gf=function(){class e extends HJ{_tag="UnknownException";error;constructor(t,r){super(r??"An unknown error occurred",{cause:t});this.error=t}}return Object.assign(e.prototype,{[kJ]:kJ,name:"UnknownException"}),e}();var up=(e)=>mt(e)&&("_tag"in e)&&(e._tag==="Success"||e._tag==="Failure"),EO=(e)=>e._tag==="Failure",hf=(e)=>e._tag==="Success";var GJ=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return Rt(t)}}),yf=(e)=>GJ(e,void 0);var Qc=(e,t)=>zde(e,t?.parallel?Xr:Vt),CO=(e)=>pt(Sr(e));var lp=(e)=>pt(Mc(e)),pt=(e)=>{let t=new gO(Ht);return t.effect_instruction_i0=e,t},KJ=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return t(e.effect_instruction_i0)}});var QJ=(e)=>v(e,KJ(Ze)),YJ=h(2,(e,t)=>{switch(e._tag){case Ht:return O(pt(e.effect_instruction_i0));case Wt:return Pt(t(e.effect_instruction_i0))}});var bf=(e)=>pt(ki(e)),bx=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return Rt(t(e.effect_instruction_i0))}});var Yc=h(2,(e,{onFailure:t,onSuccess:r})=>{switch(e._tag){case Ht:return t(e.effect_instruction_i0);case Wt:return r(e.effect_instruction_i0)}}),pp=h(2,(e,{onFailure:t,onSuccess:r})=>{switch(e._tag){case Ht:return t(e.effect_instruction_i0);case Wt:return r(e.effect_instruction_i0)}}),Rt=(e)=>{let t=new hO(Wt);return t.effect_instruction_i0=e,t},vn=Rt(void 0);var dp=h(3,(e,t,{onFailure:r,onSuccess:i})=>{switch(e._tag){case Ht:switch(t._tag){case Wt:return pt(e.effect_instruction_i0);case Ht:return pt(r(e.effect_instruction_i0,t.effect_instruction_i0))}case Wt:switch(t._tag){case Wt:return Rt(i(e.effect_instruction_i0,t.effect_instruction_i0));case Ht:return pt(t.effect_instruction_i0)}}}),zde=(e,t)=>{let r=wc(e);if(!zr(r))return H();return v(Yr(r),ta(v(Pr(r),bx(Zt)),(i,n)=>v(i,dp(n,{onSuccess:(o,s)=>v(o,Cr(s)),onFailure:t}))),bx(mo),bx((i)=>Si(i)),re)},xf=(e)=>({...xi,[fJ]:gJ,state:bo(hJ([])),commit(){return kr(this)},blockingOn:e}),ri=()=>E(es,(e)=>XJ(e)),XJ=(e)=>q(()=>xf(e)),kr=(e)=>uf((t)=>{let r=jn(e.state);switch(r._tag){case of:return t(r.effect);case zc:return r.joiners.push(t),Lde(e,t)}},e.blockingOn),PO=h(2,(e,t)=>wo(t,e)),Sf=h(2,(e,t)=>q(()=>{let r=jn(e.state);switch(r._tag){case of:return!1;case zc:{Ti(e.state,pO(t));for(let i=0,n=r.joiners.length;i<n;i++)r.joiners[i](t);return!0}}})),RO=h(2,(e,t)=>Sf(e,t));var vf=h(2,(e,t)=>Sf(e,tt(t)));var eH=(e)=>E(es,(t)=>Sf(e,Tx(t)));var AO=h(2,(e,t)=>Sf(e,O(t)));var wf=(e,t)=>{let r=jn(e.state);if(r._tag===zc){Ti(e.state,pO(t));for(let i=0,n=r.joiners.length;i<n;i++)r.joiners[i](t)}},Lde=(e,t)=>q(()=>{let r=jn(e.state);if(r._tag===zc){let i=r.joiners.indexOf(t);if(i>=0)r.joiners.splice(i,1)}}),Bde=Qe((e)=>Rt(e.currentContext)),Bn=()=>Bde;var Ri=(e)=>E(Bn(),e),Wi=h(2,(e,t)=>Xt(zn,t)(e)),Nx=h(2,(e,t)=>wr(zn,(r)=>Go(r,t))(e)),Xc=h(2,(e,t)=>Ri((r)=>Wi(e,t(r)))),_O=h(2,(e,t)=>E(e,(r)=>E(t.predicate(r),(i)=>i?O(r):t.orElse(r)))),tH=h(2,(e,t)=>_O(e,{predicate:t.predicate,orElse:(r)=>Ge(t.orFailWith(r))})),zx=(e)=>{let t=e.currentSpan;return t!==void 0&&t._tag==="Span"?re(t):H()},Ude={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:vn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},rH=(e)=>Object.assign(Object.create(Ude),e);var qde="effect/Clock",OO=Symbol.for(qde),ni=yn("effect/Clock"),Jde=2147483647,nH={unsafeSchedule(e,t){let r=ho(t);if(r>Jde)return $i;let i=!1,n=setTimeout(()=>{i=!0,e()},r);return()=>(clearTimeout(n),!i)}},iH=function(){let e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now!=="function")return()=>BigInt(Date.now())*e;let t;return()=>{if(t===void 0)t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return t+BigInt(Math.round(performance.now()*1e6))}}(),Hde=function(){let e=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!e)return iH;let t=iH()-e.bigint();return()=>t+e.bigint()}();class oH{[OO]=OO;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Hde()}currentTimeMillis=q(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=q(()=>this.unsafeCurrentTimeNanos());scheduler(){return O(nH)}sleep(e){return en((t)=>{let r=nH.unsafeSchedule(()=>t($e),e);return $t(q(r))})}}var DO=()=>new oH;var Zi=JU;var sH=(e)=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var FO="And",$O="Or",jO="InvalidData",NO="MissingData",zO="SourceUnavailable",LO="Unsupported";var Qde="effect/ConfigError",aH=Symbol.for(Qde),mp={_tag:"ConfigError",[aH]:aH},BO=(e,t)=>{let r=Object.create(mp);return r._op=FO,r.left=e,r.right=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},UO=(e,t)=>{let r=Object.create(mp);return r._op=$O,r.left=e,r.right=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Yde=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=jO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Invalid data at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i},os=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=NO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Missing data at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i},Xde=(e,t,r,i={pathDelim:"."})=>{let n=Object.create(mp);return n._op=zO,n.path=e,n.message=t,n.cause=r,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Source unavailable at ${v(this.path,Uo(i.pathDelim))}: "${this.message}")`}}),n},eme=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=LO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i};var Ta=h(2,(e,t)=>{switch(e._op){case FO:return BO(Ta(e.left,t),Ta(e.right,t));case $O:return UO(Ta(e.left,t),Ta(e.right,t));case jO:return Yde([...t,...e.path],e.message);case NO:return os([...t,...e.path],e.message);case zO:return Xde([...t,...e.path],e.message,e.cause);case LO:return eme([...t,...e.path],e.message)}});var uH={_tag:"Empty"};var Bx=h(2,(e,t)=>{let r=Qm(t),i=e;while(L_(r)){let n=r.head;switch(n._tag){case"Empty":{r=r.tail;break}case"AndThen":{r=Ko(n.first,Ko(n.second,r.tail));break}case"MapName":{i=lo(i,n.f),r=r.tail;break}case"Nested":{i=Jl(i,n.name),r=r.tail;break}case"Unnested":{if(v(ea(i),VU(n.name)))i=uo(i),r=r.tail;else return Mn(os(i,`Expected ${n.name} to be in path in ConfigProvider#unnested`));break}}}return Nr(i)});var lH="Constant",pH="Fail",dH="Fallback",mH="Described",fH="Lazy",gH="MapOrFail",hH="Nested",yH="Primitive",bH="Sequence",xH="HashMap",SH="ZipWith";var Ux=(e,t)=>[...e,...t],nme="effect/ConfigProvider",vH=Symbol.for(nme),fp=yn("effect/ConfigProvider"),ime="effect/ConfigProviderFlat",wH=Symbol.for(ime),ome=(e)=>({[vH]:vH,pipe(){return ae(this,arguments)},...e}),sme=(e)=>({[wH]:wH,patch:e.patch,load:(t,r,i=!0)=>e.load(t,r,i),enumerateChildren:e.enumerateChildren}),ame=(e)=>ome({load:(t)=>E(Ai(e,zi(),t,!1),(r)=>yr(ea(r),{onNone:()=>Ge(os(zi(),`Expected a single value having structure: ${t}`)),onSome:O})),flattened:e}),kH=(e)=>{let{pathDelim:t,seqDelim:r}=Object.assign({},{pathDelim:"_",seqDelim:","},e),i=(u)=>v(u,Uo(t)),n=(u)=>u.split(t),o=()=>typeof process<"u"&&("env"in process)&&typeof process.env==="object"?process.env:{};return ame(sme({load:(u,l,p=!0)=>{let m=i(u),f=o(),g=m in f?re(f[m]):H();return v(g,Sa(()=>os(u,`Expected ${m} to exist in the process context`)),E((S)=>dme(S,u,l,r,p)))},enumerateChildren:(u)=>q(()=>{let l=o(),f=Object.keys(l).map((g)=>n(g.toUpperCase())).filter((g)=>{for(let S=0;S<u.length;S++){let P=v(u,JA(S)),D=g[S];if(D===void 0||P!==D)return!1}return!0}).flatMap((g)=>g.slice(u.length,u.length+1));return qb(f)}),patch:uH}))};var cme=(e,t,r,i)=>{let n=GA(r.length,(u)=>u>=i.length?H():re([e(u),u+1])),o=GA(i.length,(u)=>u>=r.length?H():re([t(u),u+1])),s=Ux(r,n),c=Ux(i,o);return[s,c]},ume=(e,t)=>{let r=t;if(r._tag==="Nested"){let i=e.slice();while(r._tag==="Nested")i.push(r.name),r=r.config;return i}return e},Ai=(e,t,r,i)=>{let n=r;switch(n._tag){case lH:return O(gn(n.value));case mH:return we(()=>Ai(e,t,n.config,i));case pH:return Ge(os(t,n.message));case dH:return v(we(()=>Ai(e,t,n.first,i)),Ji((o)=>{if(n.condition(o))return v(Ai(e,t,n.second,i),Ji((s)=>Ge(UO(o,s))));return Ge(o)}));case fH:return we(()=>Ai(e,t,n.config(),i));case gH:return we(()=>v(Ai(e,t,n.original,i),E(Rr((o)=>v(n.mapOrFail(o),Sa(Ta(ume(t,n.original))))))));case hH:return we(()=>Ai(e,Ux(t,gn(n.name)),n.config,i));case yH:return v(Bx(t,e.patch),E((o)=>v(e.load(o,n,i),E((s)=>{if(s.length===0){let c=v(Ib(o),br(()=>"<n/a>"));return Ge(os([],`Expected ${n.description} with name ${c}`))}return O(s)}))));case bH:return v(Bx(t,e.patch),E((o)=>v(e.enumerateChildren(o),E(fme),E((s)=>{if(s.length===0)return we(()=>W(Ai(e,t,n.config,!0),gn));return v(Rr(s,(c)=>Ai(e,QU(t,`[${c}]`),n.config,!0)),W((c)=>{let u=Tb(c);if(u.length===0)return gn(zi());return gn(u)}))}))));case xH:return we(()=>v(Bx(t,e.patch),E((o)=>v(e.enumerateChildren(o),E((s)=>v(s,Rr((c)=>Ai(e,Ux(o,gn(c)),n.valueConfig,i)),W((c)=>{if(c.length===0)return gn(jc());return v(mme(c),lo((u)=>P2(ZA(ot(s),u))))})))))));case SH:return we(()=>v(Ai(e,t,n.left,i),Ci,E((o)=>v(Ai(e,t,n.right,i),Ci,E((s)=>{if(co(o)&&co(s))return Ge(BO(o.left,s.left));if(co(o)&&ql(s))return Ge(o.left);if(ql(o)&&co(s))return Ge(s.left);if(ql(o)&&ql(s)){let c=v(t,Uo(".")),u=lme(t,c),[l,p]=cme(u,u,v(o.right,lo(Nr)),v(s.right,lo(Nr)));return v(l,ZA(p),Rr(([m,f])=>v(qc(m,f),W(([g,S])=>n.zip(g,S)))))}throw Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},lme=(e,t)=>(r)=>Mn(os(e,`The element at index ${r} in a sequence at path "${t}" was missing`));var pme=(e,t)=>e.split(new RegExp(`\\s*${sH(t)}\\s*`)),dme=(e,t,r,i,n)=>{if(!n)return v(r.parse(e),df({onFailure:Ta(t),onSuccess:gn}));return v(pme(e,i),Rr((o)=>r.parse(o.trim())),Sa(Ta(t)))},mme=(e)=>Object.keys(e[0]).map((t)=>e.map((r)=>r[t])),fme=(e)=>v(Rr(e,hme),df({onFailure:()=>zi(),onSuccess:Sc(Zi)}),Ci,W(vb));var gme=/^(\[(\d+)\])$/,hme=(e)=>{let t=e.match(gme);if(t!==null){let r=t[2];return v(r!==void 0&&r.length>0?re(r):H(),xc(yme))}return H()};var yme=(e)=>{let t=Number.parseInt(e);return Number.isNaN(t)?H():re(t)};var IH=Symbol.for("effect/Console"),ss=yn("effect/Console"),TH={[IH]:IH,assert(e,...t){return q(()=>{console.assert(e,...t)})},clear:q(()=>{console.clear()}),count(e){return q(()=>{console.count(e)})},countReset(e){return q(()=>{console.countReset(e)})},debug(...e){return q(()=>{console.debug(...e)})},dir(e,t){return q(()=>{console.dir(e,t)})},dirxml(...e){return q(()=>{console.dirxml(...e)})},error(...e){return q(()=>{console.error(...e)})},group(e){return e?.collapsed?q(()=>console.groupCollapsed(e?.label)):q(()=>console.group(e?.label))},groupEnd:q(()=>{console.groupEnd()}),info(...e){return q(()=>{console.info(...e)})},log(...e){return q(()=>{console.log(...e)})},table(e,t){return q(()=>{console.table(e,t)})},time(e){return q(()=>console.time(e))},timeEnd(e){return q(()=>console.timeEnd(e))},timeLog(e,...t){return q(()=>{console.timeLog(e,...t)})},trace(...e){return q(()=>{console.trace(...e)})},warn(...e){return q(()=>{console.warn(...e)})},unsafe:console};var xme="effect/Random",kf=Symbol.for(xme),eu=yn("effect/Random");class CH{seed;[kf]=kf;PRNG;constructor(e){this.seed=e,this.PRNG=new TA(e)}get next(){return q(()=>this.PRNG.number())}get nextBoolean(){return W(this.next,(e)=>e>0.5)}get nextInt(){return q(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(e,t){return W(this.next,(r)=>(t-e)*r+e)}nextIntBetween(e,t){return q(()=>this.PRNG.integer(t-e)+e)}shuffle(e){return PH(e,(t)=>this.nextIntBetween(0,t))}}var PH=(e,t)=>we(()=>v(q(()=>Array.from(e)),E((r)=>{let i=[];for(let n=r.length;n>=2;n=n-1)i.push(n);return v(i,Yn((n)=>v(t(n),W((o)=>Sme(r,n-1,o)))),kt(wc(r)))}))),Sme=(e,t,r)=>{let i=e[t];return e[t]=e[r],e[r]=i,e},qO=(e)=>new CH(ue(e));class RH{values;[kf]=kf;index=0;constructor(e){if(this.values=e,e.length===0)throw Error("Requires at least one value")}getNextValue(){let e=this.values[this.index];return this.index=(this.index+1)%this.values.length,e}get next(){return q(()=>{let e=this.getNextValue();if(typeof e==="number")return Math.max(0,Math.min(1,e));return ue(e)/2147483647})}get nextBoolean(){return q(()=>{let e=this.getNextValue();if(typeof e==="boolean")return e;return ue(e)%2===0})}get nextInt(){return q(()=>{let e=this.getNextValue();if(typeof e==="number"&&Number.isFinite(e))return Math.round(e);return Math.abs(ue(e))})}nextRange(e,t){return W(this.next,(r)=>(t-e)*r+e)}nextIntBetween(e,t){return q(()=>{let r=this.getNextValue();if(typeof r==="number"&&Number.isFinite(r))return Math.max(e,Math.min(t-1,Math.round(r)));let i=Math.abs(ue(r));return e+i%(t-e)})}shuffle(e){return PH(e,(t)=>this.nextIntBetween(0,t))}}var AH=(e)=>new RH(e);var OH=Symbol.for("effect/Tracer"),vme=(e)=>({[OH]:OH,...e}),as=yn("effect/Tracer"),Vi=yn("effect/ParentSpan"),DH=function(){return function(r){let i="";for(let n=0;n<r;n++)i+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return i}}();class MH{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(e,t,r,i,n,o){this.name=e,this.parent=t,this.context=r,this.startTime=n,this.kind=o,this.status={_tag:"Started",startTime:n},this.attributes=new Map,this.traceId=t._tag==="Some"?t.value.traceId:DH(32),this.spanId=DH(16),this.links=Array.from(i)}end(e,t){this.status={_tag:"Ended",endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,r){this.events.push([e,t,r??{}])}addLinks(e){this.links.push(...e)}}var FH=vme({span:(e,t,r,i,n,o)=>new MH(e,t,r,i,n,o),context:(e)=>e()});var cs=(e)=>{if(e?.captureStackTrace===!1)return e;else if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=="boolean")return e;let t=Error.stackTraceLimit;Error.stackTraceLimit=3;let r=Error();Error.stackTraceLimit=t;let i=!1;return{...e,captureStackTrace:()=>{if(i!==!1)return i;if(r.stack!==void 0){let n=r.stack.split(`
|
|
172
|
+
`)}`:this.toString();else if("Bun"in globalThis)return Zo(Mc(this),{renderErrorCause:!0});return this}}return Object.assign(e.prototype,AA),e}(),Kc=(e,t)=>{class r extends HJ{_tag=t}return Object.assign(r.prototype,e),r.prototype.name=t,r},bJ=Symbol.for("effect/Cause/errors/RuntimeException"),jde=Kc({[bJ]:bJ},"RuntimeException");var dO=Symbol.for("effect/Cause/errors/InterruptedException"),Hqe=Kc({[dO]:dO},"InterruptedException"),WJ=(e)=>pe(e,dO),xJ=Symbol.for("effect/Cause/errors/IllegalArgument"),ff=Kc({[xJ]:xJ},"IllegalArgumentException");var mO=Symbol.for("effect/Cause/errors/NoSuchElement"),Ln=Kc({[mO]:mO},"NoSuchElementException"),ZJ=(e)=>pe(e,mO),SJ=Symbol.for("effect/Cause/errors/InvalidPubSubCapacityException"),Wqe=Kc({[SJ]:SJ},"InvalidPubSubCapacityException"),vJ=Symbol.for("effect/Cause/errors/ExceededCapacityException"),Zqe=Kc({[vJ]:vJ},"ExceededCapacityException");var wJ=Symbol.for("effect/Cause/errors/Timeout"),Nde=Kc({[wJ]:wJ},"TimeoutException"),VJ=(e)=>new Nde(`Operation timed out after '${O_(e)}'`);var kJ=Symbol.for("effect/Cause/errors/UnknownException"),gf=function(){class e extends HJ{_tag="UnknownException";error;constructor(t,r){super(r??"An unknown error occurred",{cause:t});this.error=t}}return Object.assign(e.prototype,{[kJ]:kJ,name:"UnknownException"}),e}();var up=(e)=>mt(e)&&("_tag"in e)&&(e._tag==="Success"||e._tag==="Failure"),EO=(e)=>e._tag==="Failure",hf=(e)=>e._tag==="Success";var GJ=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return Rt(t)}}),yf=(e)=>GJ(e,void 0);var Qc=(e,t)=>zde(e,t?.parallel?Xr:Vt),CO=(e)=>pt(Sr(e));var lp=(e)=>pt(Mc(e)),pt=(e)=>{let t=new gO(Ht);return t.effect_instruction_i0=e,t},KJ=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return t(e.effect_instruction_i0)}});var QJ=(e)=>v(e,KJ(Ze)),YJ=h(2,(e,t)=>{switch(e._tag){case Ht:return O(pt(e.effect_instruction_i0));case Wt:return Pt(t(e.effect_instruction_i0))}});var bf=(e)=>pt(ki(e)),bx=h(2,(e,t)=>{switch(e._tag){case Ht:return pt(e.effect_instruction_i0);case Wt:return Rt(t(e.effect_instruction_i0))}});var Yc=h(2,(e,{onFailure:t,onSuccess:r})=>{switch(e._tag){case Ht:return t(e.effect_instruction_i0);case Wt:return r(e.effect_instruction_i0)}}),pp=h(2,(e,{onFailure:t,onSuccess:r})=>{switch(e._tag){case Ht:return t(e.effect_instruction_i0);case Wt:return r(e.effect_instruction_i0)}}),Rt=(e)=>{let t=new hO(Wt);return t.effect_instruction_i0=e,t},vn=Rt(void 0);var dp=h(3,(e,t,{onFailure:r,onSuccess:i})=>{switch(e._tag){case Ht:switch(t._tag){case Wt:return pt(e.effect_instruction_i0);case Ht:return pt(r(e.effect_instruction_i0,t.effect_instruction_i0))}case Wt:switch(t._tag){case Wt:return Rt(i(e.effect_instruction_i0,t.effect_instruction_i0));case Ht:return pt(t.effect_instruction_i0)}}}),zde=(e,t)=>{let r=wc(e);if(!zr(r))return H();return v(Yr(r),ta(v(Pr(r),bx(Zt)),(i,n)=>v(i,dp(n,{onSuccess:(o,s)=>v(o,Cr(s)),onFailure:t}))),bx(mo),bx((i)=>Si(i)),re)},xf=(e)=>({...xi,[fJ]:gJ,state:bo(hJ([])),commit(){return kr(this)},blockingOn:e}),ri=()=>E(es,(e)=>XJ(e)),XJ=(e)=>q(()=>xf(e)),kr=(e)=>uf((t)=>{let r=jn(e.state);switch(r._tag){case of:return t(r.effect);case zc:return r.joiners.push(t),Lde(e,t)}},e.blockingOn),PO=h(2,(e,t)=>wo(t,e)),Sf=h(2,(e,t)=>q(()=>{let r=jn(e.state);switch(r._tag){case of:return!1;case zc:{Ti(e.state,pO(t));for(let i=0,n=r.joiners.length;i<n;i++)r.joiners[i](t);return!0}}})),RO=h(2,(e,t)=>Sf(e,t));var vf=h(2,(e,t)=>Sf(e,tt(t)));var eH=(e)=>E(es,(t)=>Sf(e,Tx(t)));var AO=h(2,(e,t)=>Sf(e,O(t)));var wf=(e,t)=>{let r=jn(e.state);if(r._tag===zc){Ti(e.state,pO(t));for(let i=0,n=r.joiners.length;i<n;i++)r.joiners[i](t)}},Lde=(e,t)=>q(()=>{let r=jn(e.state);if(r._tag===zc){let i=r.joiners.indexOf(t);if(i>=0)r.joiners.splice(i,1)}}),Bde=Qe((e)=>Rt(e.currentContext)),Bn=()=>Bde;var Ri=(e)=>E(Bn(),e),Wi=h(2,(e,t)=>Xt(zn,t)(e)),Nx=h(2,(e,t)=>wr(zn,(r)=>Go(r,t))(e)),Xc=h(2,(e,t)=>Ri((r)=>Wi(e,t(r)))),_O=h(2,(e,t)=>E(e,(r)=>E(t.predicate(r),(i)=>i?O(r):t.orElse(r)))),tH=h(2,(e,t)=>_O(e,{predicate:t.predicate,orElse:(r)=>Ge(t.orFailWith(r))})),zx=(e)=>{let t=e.currentSpan;return t!==void 0&&t._tag==="Span"?re(t):H()},Ude={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:vn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},rH=(e)=>Object.assign(Object.create(Ude),e);var qde="effect/Clock",OO=Symbol.for(qde),ni=yn("effect/Clock"),Jde=2147483647,nH={unsafeSchedule(e,t){let r=ho(t);if(r>Jde)return $i;let i=!1,n=setTimeout(()=>{i=!0,e()},r);return()=>(clearTimeout(n),!i)}},iH=function(){let e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now!=="function")return()=>BigInt(Date.now())*e;let t;return()=>{if(t===void 0)t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return t+BigInt(Math.round(performance.now()*1e6))}}(),Hde=function(){let e=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!e)return iH;let t=iH()-e.bigint();return()=>t+e.bigint()}();class oH{[OO]=OO;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Hde()}currentTimeMillis=q(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=q(()=>this.unsafeCurrentTimeNanos());scheduler(){return O(nH)}sleep(e){return en((t)=>{let r=nH.unsafeSchedule(()=>t($e),e);return $t(q(r))})}}var DO=()=>new oH;var Zi=JU;var sH=(e)=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var FO="And",$O="Or",jO="InvalidData",NO="MissingData",zO="SourceUnavailable",LO="Unsupported";var Qde="effect/ConfigError",aH=Symbol.for(Qde),mp={_tag:"ConfigError",[aH]:aH},BO=(e,t)=>{let r=Object.create(mp);return r._op=FO,r.left=e,r.right=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},UO=(e,t)=>{let r=Object.create(mp);return r._op=$O,r.left=e,r.right=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Yde=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=jO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Invalid data at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i},os=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=NO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Missing data at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i},Xde=(e,t,r,i={pathDelim:"."})=>{let n=Object.create(mp);return n._op=zO,n.path=e,n.message=t,n.cause=r,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Source unavailable at ${v(this.path,Uo(i.pathDelim))}: "${this.message}")`}}),n},eme=(e,t,r={pathDelim:"."})=>{let i=Object.create(mp);return i._op=LO,i.path=e,i.message=t,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${v(this.path,Uo(r.pathDelim))}: "${this.message}")`}}),i};var Ta=h(2,(e,t)=>{switch(e._op){case FO:return BO(Ta(e.left,t),Ta(e.right,t));case $O:return UO(Ta(e.left,t),Ta(e.right,t));case jO:return Yde([...t,...e.path],e.message);case NO:return os([...t,...e.path],e.message);case zO:return Xde([...t,...e.path],e.message,e.cause);case LO:return eme([...t,...e.path],e.message)}});var uH={_tag:"Empty"};var Bx=h(2,(e,t)=>{let r=Qm(t),i=e;while(L_(r)){let n=r.head;switch(n._tag){case"Empty":{r=r.tail;break}case"AndThen":{r=Ko(n.first,Ko(n.second,r.tail));break}case"MapName":{i=lo(i,n.f),r=r.tail;break}case"Nested":{i=Jl(i,n.name),r=r.tail;break}case"Unnested":{if(v(ea(i),VU(n.name)))i=uo(i),r=r.tail;else return Mn(os(i,`Expected ${n.name} to be in path in ConfigProvider#unnested`));break}}}return Nr(i)});var lH="Constant",pH="Fail",dH="Fallback",mH="Described",fH="Lazy",gH="MapOrFail",hH="Nested",yH="Primitive",bH="Sequence",xH="HashMap",SH="ZipWith";var Ux=(e,t)=>[...e,...t],nme="effect/ConfigProvider",vH=Symbol.for(nme),fp=yn("effect/ConfigProvider"),ime="effect/ConfigProviderFlat",wH=Symbol.for(ime),ome=(e)=>({[vH]:vH,pipe(){return ae(this,arguments)},...e}),sme=(e)=>({[wH]:wH,patch:e.patch,load:(t,r,i=!0)=>e.load(t,r,i),enumerateChildren:e.enumerateChildren}),ame=(e)=>ome({load:(t)=>E(Ai(e,zi(),t,!1),(r)=>yr(ea(r),{onNone:()=>Ge(os(zi(),`Expected a single value having structure: ${t}`)),onSome:O})),flattened:e}),kH=(e)=>{let{pathDelim:t,seqDelim:r}=Object.assign({},{pathDelim:"_",seqDelim:","},e),i=(u)=>v(u,Uo(t)),n=(u)=>u.split(t),o=()=>typeof process<"u"&&("env"in process)&&typeof process.env==="object"?process.env:{};return ame(sme({load:(u,l,p=!0)=>{let m=i(u),f=o(),g=m in f?re(f[m]):H();return v(g,Sa(()=>os(u,`Expected ${m} to exist in the process context`)),E((S)=>dme(S,u,l,r,p)))},enumerateChildren:(u)=>q(()=>{let l=o(),f=Object.keys(l).map((g)=>n(g.toUpperCase())).filter((g)=>{for(let S=0;S<u.length;S++){let P=v(u,JA(S)),D=g[S];if(D===void 0||P!==D)return!1}return!0}).flatMap((g)=>g.slice(u.length,u.length+1));return qb(f)}),patch:uH}))};var cme=(e,t,r,i)=>{let n=GA(r.length,(u)=>u>=i.length?H():re([e(u),u+1])),o=GA(i.length,(u)=>u>=r.length?H():re([t(u),u+1])),s=Ux(r,n),c=Ux(i,o);return[s,c]},ume=(e,t)=>{let r=t;if(r._tag==="Nested"){let i=e.slice();while(r._tag==="Nested")i.push(r.name),r=r.config;return i}return e},Ai=(e,t,r,i)=>{let n=r;switch(n._tag){case lH:return O(gn(n.value));case mH:return we(()=>Ai(e,t,n.config,i));case pH:return Ge(os(t,n.message));case dH:return v(we(()=>Ai(e,t,n.first,i)),Ji((o)=>{if(n.condition(o))return v(Ai(e,t,n.second,i),Ji((s)=>Ge(UO(o,s))));return Ge(o)}));case fH:return we(()=>Ai(e,t,n.config(),i));case gH:return we(()=>v(Ai(e,t,n.original,i),E(Rr((o)=>v(n.mapOrFail(o),Sa(Ta(ume(t,n.original))))))));case hH:return we(()=>Ai(e,Ux(t,gn(n.name)),n.config,i));case yH:return v(Bx(t,e.patch),E((o)=>v(e.load(o,n,i),E((s)=>{if(s.length===0){let c=v(Ib(o),br(()=>"<n/a>"));return Ge(os([],`Expected ${n.description} with name ${c}`))}return O(s)}))));case bH:return v(Bx(t,e.patch),E((o)=>v(e.enumerateChildren(o),E(fme),E((s)=>{if(s.length===0)return we(()=>W(Ai(e,t,n.config,!0),gn));return v(Rr(s,(c)=>Ai(e,QU(t,`[${c}]`),n.config,!0)),W((c)=>{let u=Tb(c);if(u.length===0)return gn(zi());return gn(u)}))}))));case xH:return we(()=>v(Bx(t,e.patch),E((o)=>v(e.enumerateChildren(o),E((s)=>v(s,Rr((c)=>Ai(e,Ux(o,gn(c)),n.valueConfig,i)),W((c)=>{if(c.length===0)return gn(jc());return v(mme(c),lo((u)=>P2(ZA(ot(s),u))))})))))));case SH:return we(()=>v(Ai(e,t,n.left,i),Ci,E((o)=>v(Ai(e,t,n.right,i),Ci,E((s)=>{if(co(o)&&co(s))return Ge(BO(o.left,s.left));if(co(o)&&ql(s))return Ge(o.left);if(ql(o)&&co(s))return Ge(s.left);if(ql(o)&&ql(s)){let c=v(t,Uo(".")),u=lme(t,c),[l,p]=cme(u,u,v(o.right,lo(Nr)),v(s.right,lo(Nr)));return v(l,ZA(p),Rr(([m,f])=>v(qc(m,f),W(([g,S])=>n.zip(g,S)))))}throw Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},lme=(e,t)=>(r)=>Mn(os(e,`The element at index ${r} in a sequence at path "${t}" was missing`));var pme=(e,t)=>e.split(new RegExp(`\\s*${sH(t)}\\s*`)),dme=(e,t,r,i,n)=>{if(!n)return v(r.parse(e),df({onFailure:Ta(t),onSuccess:gn}));return v(pme(e,i),Rr((o)=>r.parse(o.trim())),Sa(Ta(t)))},mme=(e)=>Object.keys(e[0]).map((t)=>e.map((r)=>r[t])),fme=(e)=>v(Rr(e,hme),df({onFailure:()=>zi(),onSuccess:Sc(Zi)}),Ci,W(vb));var gme=/^(\[(\d+)\])$/,hme=(e)=>{let t=e.match(gme);if(t!==null){let r=t[2];return v(r!==void 0&&r.length>0?re(r):H(),xc(yme))}return H()};var yme=(e)=>{let t=Number.parseInt(e);return Number.isNaN(t)?H():re(t)};var IH=Symbol.for("effect/Console"),ss=yn("effect/Console"),TH={[IH]:IH,assert(e,...t){return q(()=>{console.assert(e,...t)})},clear:q(()=>{console.clear()}),count(e){return q(()=>{console.count(e)})},countReset(e){return q(()=>{console.countReset(e)})},debug(...e){return q(()=>{console.debug(...e)})},dir(e,t){return q(()=>{console.dir(e,t)})},dirxml(...e){return q(()=>{console.dirxml(...e)})},error(...e){return q(()=>{console.error(...e)})},group(e){return e?.collapsed?q(()=>console.groupCollapsed(e?.label)):q(()=>console.group(e?.label))},groupEnd:q(()=>{console.groupEnd()}),info(...e){return q(()=>{console.info(...e)})},log(...e){return q(()=>{console.log(...e)})},table(e,t){return q(()=>{console.table(e,t)})},time(e){return q(()=>console.time(e))},timeEnd(e){return q(()=>console.timeEnd(e))},timeLog(e,...t){return q(()=>{console.timeLog(e,...t)})},trace(...e){return q(()=>{console.trace(...e)})},warn(...e){return q(()=>{console.warn(...e)})},unsafe:console};var xme="effect/Random",kf=Symbol.for(xme),eu=yn("effect/Random");class CH{seed;[kf]=kf;PRNG;constructor(e){this.seed=e,this.PRNG=new TA(e)}get next(){return q(()=>this.PRNG.number())}get nextBoolean(){return W(this.next,(e)=>e>0.5)}get nextInt(){return q(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(e,t){return W(this.next,(r)=>(t-e)*r+e)}nextIntBetween(e,t){return q(()=>this.PRNG.integer(t-e)+e)}shuffle(e){return PH(e,(t)=>this.nextIntBetween(0,t))}}var PH=(e,t)=>we(()=>v(q(()=>Array.from(e)),E((r)=>{let i=[];for(let n=r.length;n>=2;n=n-1)i.push(n);return v(i,Yn((n)=>v(t(n),W((o)=>Sme(r,n-1,o)))),kt(wc(r)))}))),Sme=(e,t,r)=>{let i=e[t];return e[t]=e[r],e[r]=i,e},qO=(e)=>new CH(ue(e));class RH{values;[kf]=kf;index=0;constructor(e){if(this.values=e,e.length===0)throw Error("Requires at least one value")}getNextValue(){let e=this.values[this.index];return this.index=(this.index+1)%this.values.length,e}get next(){return q(()=>{let e=this.getNextValue();if(typeof e==="number")return Math.max(0,Math.min(1,e));return ue(e)/2147483647})}get nextBoolean(){return q(()=>{let e=this.getNextValue();if(typeof e==="boolean")return e;return ue(e)%2===0})}get nextInt(){return q(()=>{let e=this.getNextValue();if(typeof e==="number"&&Number.isFinite(e))return Math.round(e);return Math.abs(ue(e))})}nextRange(e,t){return W(this.next,(r)=>(t-e)*r+e)}nextIntBetween(e,t){return q(()=>{let r=this.getNextValue();if(typeof r==="number"&&Number.isFinite(r))return Math.max(e,Math.min(t-1,Math.round(r)));let i=Math.abs(ue(r));return e+i%(t-e)})}shuffle(e){return PH(e,(t)=>this.nextIntBetween(0,t))}}var AH=(e)=>new RH(e);var OH=Symbol.for("effect/Tracer"),vme=(e)=>({[OH]:OH,...e}),as=yn("effect/Tracer"),Vi=yn("effect/ParentSpan"),DH=function(){return function(r){let i="";for(let n=0;n<r;n++)i+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return i}}();class MH{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(e,t,r,i,n,o){this.name=e,this.parent=t,this.context=r,this.startTime=n,this.kind=o,this.status={_tag:"Started",startTime:n},this.attributes=new Map,this.traceId=t._tag==="Some"?t.value.traceId:DH(32),this.spanId=DH(16),this.links=Array.from(i)}end(e,t){this.status={_tag:"Ended",endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,r){this.events.push([e,t,r??{}])}addLinks(e){this.links.push(...e)}}var FH=vme({span:(e,t,r,i,n,o)=>new MH(e,t,r,i,n,o),context:(e)=>e()});var cs=(e)=>{if(e?.captureStackTrace===!1)return e;else if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=="boolean")return e;let t=Error.stackTraceLimit;Error.stackTraceLimit=3;let r=Error();Error.stackTraceLimit=t;let i=!1;return{...e,captureStackTrace:()=>{if(i!==!1)return i;if(r.stack!==void 0){let n=r.stack.split(`
|
|
173
173
|
`);if(n[3]!==void 0)return i=n[3].trim(),i}}}},gp=go()("effect/Tracer/DisablePropagation",{defaultValue:$i});var wme=v(Qn(),Ot(ni,DO()),Ot(ss,TH),Ot(eu,qO(Math.random())),Ot(fp,kH()),Ot(as,FH)),er=Fe(Symbol.for("effect/DefaultServices/currentServices"),()=>Ax(wme)),$H=(e)=>{let t=vr(e);return If((r)=>r.sleep(t))},Jx=(e)=>Qe((t)=>e(t.currentDefaultServices)),If=(e)=>Jx((t)=>e(t.unsafeMap.get(ni.key))),jH=If((e)=>e.currentTimeMillis),NH=If((e)=>e.currentTimeNanos),zH=h(2,(e,t)=>wr(er,Ot(ni,t))(e)),LH=h(2,(e,t)=>wr(er,Ot(fp,t))(e)),BH=(e)=>Jx((t)=>e(t.unsafeMap.get(fp.key)));var Hx=(e)=>Jx((t)=>e(t.unsafeMap.get(eu.key))),UH=h(2,(e,t)=>wr(er,Ot(eu,t))(e));var Wx=(e)=>Jx((t)=>e(t.unsafeMap.get(as.key))),qH=h(2,(e,t)=>wr(er,Ot(as,t))(e));var JO=$H,yp=jH,JH=NH,HH=If,WH=ni;var tr={};pi(tr,{Do:()=>kve,EffectTypeId:()=>fbe,Service:()=>aIe,Tag:()=>sIe,acquireRelease:()=>nSe,acquireReleaseInterruptible:()=>iSe,acquireUseRelease:()=>oSe,addFinalizer:()=>sSe,all:()=>vbe,allSuccesses:()=>kbe,allWith:()=>wbe,allowInterrupt:()=>Mxe,andThen:()=>Wve,annotateCurrentSpan:()=>Uke,annotateLogs:()=>zwe,annotateLogsScoped:()=>Lwe,annotateSpans:()=>Bke,ap:()=>Eke,as:()=>Hxe,asSome:()=>Wxe,asSomeError:()=>Zxe,asVoid:()=>Vxe,async:()=>Hbe,asyncEffect:()=>Wbe,awaitAllChildren:()=>xSe,bind:()=>Ive,bindAll:()=>Tve,bindTo:()=>Eve,blocked:()=>Cke,cacheRequestResult:()=>_ke,cached:()=>bbe,cachedFunction:()=>xbe,cachedInvalidateWithTTL:()=>ybe,cachedWithTTL:()=>hbe,catch:()=>lxe,catchAll:()=>pxe,catchAllCause:()=>dxe,catchAllDefect:()=>mxe,catchIf:()=>fxe,catchSome:()=>gxe,catchSomeCause:()=>hxe,catchSomeDefect:()=>yxe,catchTag:()=>bxe,catchTags:()=>xxe,cause:()=>Sxe,checkInterruptible:()=>Fxe,clock:()=>USe,clockWith:()=>qSe,configProviderWith:()=>ove,console:()=>WSe,consoleWith:()=>ZSe,context:()=>cve,contextWith:()=>uve,contextWithEffect:()=>lve,currentParentSpan:()=>Hke,currentPropagatedSpan:()=>Jke,currentSpan:()=>qke,custom:()=>Zbe,daemonChildren:()=>SSe,delay:()=>KSe,descriptor:()=>vSe,descriptorWith:()=>wSe,die:()=>PM,dieMessage:()=>Ybe,dieSync:()=>Xbe,diffFiberRefs:()=>kSe,disconnect:()=>$xe,dropUntil:()=>Ibe,dropWhile:()=>Tbe,either:()=>Rve,ensureErrorType:()=>pIe,ensureRequirementsType:()=>dIe,ensureSuccessType:()=>lIe,ensuring:()=>aSe,ensuringChild:()=>ISe,ensuringChildren:()=>TSe,eventually:()=>vxe,every:()=>Pbe,exists:()=>Rbe,exit:()=>Ave,fail:()=>Gbe,failCause:()=>mQ,failCauseSync:()=>Qbe,failSync:()=>Kbe,fiberId:()=>ESe,fiberIdWith:()=>CSe,filter:()=>Abe,filterEffectOrElse:()=>jve,filterEffectOrFail:()=>Nve,filterMap:()=>_be,filterOrDie:()=>Dve,filterOrDieMessage:()=>Mve,filterOrElse:()=>Fve,filterOrFail:()=>$ve,finalizersMask:()=>dSe,findFirst:()=>Obe,firstSuccessOf:()=>Gwe,flatMap:()=>Hve,flatten:()=>Zve,flip:()=>Gxe,flipWith:()=>Kxe,fn:()=>cIe,fnUntraced:()=>uIe,forEach:()=>Dbe,forever:()=>owe,fork:()=>PSe,forkAll:()=>ASe,forkDaemon:()=>RSe,forkIn:()=>_Se,forkScoped:()=>OSe,forkWithErrorHandler:()=>DSe,fromFiber:()=>MSe,fromFiberEffect:()=>FSe,fromNullable:()=>rIe,functionWithSpan:()=>Xke,gen:()=>exe,getFiberRefs:()=>gwe,getRuntimeFlags:()=>tke,head:()=>Mbe,if:()=>Ove,ignore:()=>wxe,ignoreLogged:()=>kxe,inheritFiberRefs:()=>hwe,interrupt:()=>jxe,interruptWith:()=>Nxe,interruptible:()=>zxe,interruptibleMask:()=>Lxe,intoDeferred:()=>_ve,isEffect:()=>gbe,isFailure:()=>Iwe,isSuccess:()=>Twe,iterate:()=>swe,labelMetrics:()=>ske,labelMetricsScoped:()=>cke,let:()=>Cve,liftPredicate:()=>Jxe,linkSpanCurrent:()=>Gke,linkSpans:()=>Vke,locally:()=>ywe,locallyScoped:()=>xwe,locallyScopedWith:()=>Swe,locallyWith:()=>bwe,log:()=>Awe,logAnnotations:()=>Bwe,logDebug:()=>Dwe,logError:()=>$we,logFatal:()=>jwe,logInfo:()=>Mwe,logTrace:()=>Owe,logWarning:()=>Fwe,logWithLevel:()=>_we,loop:()=>awe,makeLatch:()=>fke,makeSemaphore:()=>dke,makeSpan:()=>Kke,makeSpanScoped:()=>Qke,map:()=>xu,mapAccum:()=>Qxe,mapBoth:()=>Yxe,mapError:()=>Xxe,mapErrorCause:()=>eSe,mapInputContext:()=>pve,match:()=>Ewe,matchCause:()=>Cwe,matchCauseEffect:()=>Pwe,matchEffect:()=>Rwe,merge:()=>tSe,mergeAll:()=>Fbe,metricLabels:()=>uke,negate:()=>rSe,never:()=>txe,none:()=>rxe,onError:()=>cSe,onExit:()=>uSe,onInterrupt:()=>Bxe,once:()=>Sbe,option:()=>Pve,optionFromOptional:()=>nIe,orDie:()=>Jwe,orDieWith:()=>Hwe,orElse:()=>Wwe,orElseFail:()=>Zwe,orElseSucceed:()=>Vwe,parallelErrors:()=>Ixe,parallelFinalizers:()=>lSe,partition:()=>$be,patchFiberRefs:()=>vwe,patchRuntimeFlags:()=>rke,promise:()=>nxe,provide:()=>dve,provideService:()=>mve,provideServiceEffect:()=>fve,race:()=>Vve,raceAll:()=>Gve,raceFirst:()=>Kve,raceWith:()=>Qve,random:()=>Kwe,randomWith:()=>Qwe,reduce:()=>jbe,reduceEffect:()=>Lbe,reduceRight:()=>zbe,reduceWhile:()=>Nbe,repeat:()=>cwe,repeatN:()=>uwe,repeatOrElse:()=>lwe,replicate:()=>Bbe,replicateEffect:()=>Ube,request:()=>Ake,retry:()=>Exe,retryOrElse:()=>Pxe,runCallback:()=>hke,runFork:()=>gke,runPromise:()=>yke,runPromiseExit:()=>bke,runRequestBlock:()=>Pke,runSync:()=>xke,runSyncExit:()=>Ske,runtime:()=>eke,sandbox:()=>Txe,schedule:()=>pwe,scheduleForked:()=>dwe,scheduleFrom:()=>mwe,scope:()=>mSe,scopeWith:()=>fSe,scoped:()=>hSe,scopedWith:()=>gSe,sequentialFinalizers:()=>pSe,serviceConstants:()=>bve,serviceFunction:()=>gve,serviceFunctionEffect:()=>hve,serviceFunctions:()=>yve,serviceMembers:()=>xve,serviceOption:()=>Sve,serviceOptional:()=>vve,setFiberRefs:()=>wwe,sleep:()=>QSe,spanAnnotations:()=>Wke,spanLinks:()=>Zke,step:()=>Rke,succeed:()=>ixe,succeedNone:()=>RM,succeedSome:()=>oxe,summarized:()=>Yve,supervised:()=>$Se,suspend:()=>sxe,sync:()=>axe,tagMetrics:()=>oke,tagMetricsScoped:()=>ake,takeUntil:()=>Ebe,takeWhile:()=>Cbe,tap:()=>Xve,tapBoth:()=>ewe,tapDefect:()=>twe,tapError:()=>rwe,tapErrorCause:()=>iwe,tapErrorTag:()=>nwe,timed:()=>YSe,timedWith:()=>XSe,timeout:()=>eve,timeoutFail:()=>rve,timeoutFailCause:()=>nve,timeoutOption:()=>tve,timeoutTo:()=>ive,tracer:()=>Fke,tracerWith:()=>$ke,transplant:()=>jSe,transposeMapOption:()=>oIe,transposeOption:()=>iIe,try:()=>Rxe,tryMap:()=>Axe,tryMapPromise:()=>_xe,tryPromise:()=>Oxe,uninterruptible:()=>Uxe,uninterruptibleMask:()=>qxe,unless:()=>zve,unlessEffect:()=>Lve,unsafeMakeLatch:()=>mke,unsafeMakeSemaphore:()=>pke,unsandbox:()=>Dxe,updateFiberRefs:()=>kwe,updateService:()=>wve,useSpan:()=>Yke,using:()=>ySe,validate:()=>vke,validateAll:()=>qbe,validateFirst:()=>Jbe,validateWith:()=>wke,void:()=>cxe,when:()=>Bve,whenEffect:()=>Uve,whenFiberRef:()=>qve,whenLogLevel:()=>qwe,whenRef:()=>Jve,whileLoop:()=>fwe,withClock:()=>HSe,withClockScoped:()=>JSe,withConcurrency:()=>NSe,withConfigProvider:()=>sve,withConfigProviderScoped:()=>ave,withConsole:()=>GSe,withConsoleScoped:()=>VSe,withEarlyRelease:()=>bSe,withExecutionPlan:()=>Cxe,withFiberRuntime:()=>Vbe,withLogSpan:()=>Nwe,withMaxOpsBeforeYield:()=>BSe,withMetric:()=>lke,withParentSpan:()=>tIe,withRandom:()=>fQ,withRandomFixed:()=>Ywe,withRandomScoped:()=>Xwe,withRequestBatching:()=>Oke,withRequestCache:()=>Mke,withRequestCaching:()=>Dke,withRuntimeFlagsPatch:()=>nke,withRuntimeFlagsPatchScoped:()=>ike,withScheduler:()=>zSe,withSchedulingPriority:()=>LSe,withSpan:()=>hQ,withSpanScoped:()=>eIe,withTracer:()=>jke,withTracerEnabled:()=>zke,withTracerScoped:()=>Nke,withTracerTiming:()=>Lke,withUnhandledErrorLogLevel:()=>Uwe,yieldNow:()=>uxe,zip:()=>kke,zipLeft:()=>Ike,zipRight:()=>Tke,zipWith:()=>gQ});var ZH=(e)=>!e;var VH=Lo,Zx=xi;var Ime=jU;class Ea extends Ime{}var GH="Sequential",KH="Parallel",Tme="ParallelN",_i={_tag:GH},Tf={_tag:KH},QH=(e)=>({_tag:Tme,parallelism:e}),HO=(e)=>e._tag===GH,WO=(e)=>e._tag===KH;var Kx=_i,Qx=Tf,Yx=QH;function YH(e){return new us(e)}function XH(){return YH(new Map)}var ZO=Symbol.for("effect/FiberRefs");class us{locals;[ZO]=ZO;constructor(e){this.locals=e}pipe(){return ae(this,arguments)}}var Cme=(e,t,r,i=!1)=>{let n=e,o=t,s=r,c=i,u=void 0;while(u===void 0)if(Qr(o)&&Qr(s)){let l=Er(o)[0],p=uo(o),m=Er(s)[0],f=Er(s)[1],g=uo(s);if(l.startTimeMillis<m.startTimeMillis)s=g,c=!0;else if(l.startTimeMillis>m.startTimeMillis)o=p;else if(l.id<m.id)s=g,c=!0;else if(l.id>m.id)o=p;else u=[f,c]}else u=[n.initial,!0];return u},Xx=h(3,(e,t,r)=>{let i=new Map(e.locals);return r.locals.forEach((n,o)=>{let s=n[0][1];if(!n[0][0][he](t)){if(!i.has(o)){if(le(s,o.initial))return;i.set(o,[[t,o.join(o.initial,s)]]);return}let c=i.get(o),[u,l]=Cme(o,c,n);if(l){let p=o.diff(u,s),m=c[0][1],f=o.join(m,o.patch(p)(m));if(!le(m,f)){let g,S=c[0][0];if(S[he](t))g=[[S,f],...c.slice(1)];else g=[[t,f],...c];i.set(o,g)}}}}),new us(i)}),GO=h(2,(e,t)=>{let r=new Map;return eW(e,r,t),new us(r)}),eW=(e,t,r)=>{e.locals.forEach((i,n)=>{let o=i[0][1],s=n.patch(n.fork)(o);if(le(o,s))t.set(n,i);else t.set(n,[[r,s],...i])})},tW=(e)=>qb(e.locals.keys()),rW=(e)=>Yn(tW(e),(t)=>Lc(t,ls(e,t))),Ef=h(2,(e,t)=>{let r=new Map(e.locals);return r.delete(t),new us(r)}),eS=h(2,(e,t)=>{if(!e.locals.has(t))return H();return re(Er(e.locals.get(t))[1])}),ls=h(2,(e,t)=>v(eS(e,t),br(()=>t.initial))),xp=h(2,(e,{fiberId:t,fiberRef:r,value:i})=>{if(e.locals.size===0)return new us(new Map([[r,[[t,i]]]]));let n=new Map(e.locals);return VO(n,t,r,i),new us(n)}),VO=(e,t,r,i)=>{let n=e.get(r)??[],o;if(Qr(n)){let[s,c]=Er(n);if(s[he](t))if(le(c,i))return;else o=[[t,i],...n.slice(1)];else o=[[t,i],...n]}else o=[[t,i]];e.set(r,o)},nW=h(2,(e,{entries:t,forkAs:r})=>{if(e.locals.size===0)return new us(new Map(t));let i=new Map(e.locals);if(r!==void 0)eW(e,i,r);return t.forEach(([n,o])=>{if(o.length===1)VO(i,o[0][0],n,o[0][1]);else o.forEach(([s,c])=>{VO(i,s,n,c)})}),new us(i)});var QO=eS,iW=ls,oW=Xx,sW=rW;var aW=nW;var cW=XH;var uW="Empty",lW="Add",pW="Remove",dW="Update",mW="AndThen",fW={_tag:uW},Cf=(e,t)=>{let r=new Map(e.locals),i=fW;for(let[n,o]of t.locals.entries()){let s=Er(o)[1],c=r.get(n);if(c!==void 0){let u=Er(c)[1];if(!le(u,s))i=tS({_tag:dW,fiberRef:n,patch:n.diff(u,s)})(i)}else i=tS({_tag:lW,fiberRef:n,value:s})(i);r.delete(n)}for(let[n]of r.entries())i=tS({_tag:pW,fiberRef:n})(i);return i},tS=h(2,(e,t)=>({_tag:mW,first:e,second:t})),rS=h(3,(e,t,r)=>{let i=r,n=gn(e);while(Qr(n)){let o=Er(n),s=uo(n);switch(o._tag){case uW:{n=s;break}case lW:{i=xp(i,{fiberId:t,fiberRef:o.fiberRef,value:o.value}),n=s;break}case pW:{i=Ef(i,o.fiberRef),n=s;break}case dW:{let c=ls(i,o.fiberRef);i=xp(i,{fiberId:t,fiberRef:o.fiberRef,value:o.fiberRef.patch(o.patch)(c)}),n=s;break}case mW:{n=Jl(o.first)(Jl(o.second)(s));break}}}return i});var tu=Cf;var ru=rS;var iS="effect/FiberStatus",Ca=Symbol.for(iS),nS="Done",XO="Running",eD="Suspended",Pme=lt(`${iS}-${nS}`);class yW{[Ca]=Ca;_tag=nS;[be](){return Pme}[he](e){return oS(e)&&e._tag===nS}}class bW{runtimeFlags;[Ca]=Ca;_tag=XO;constructor(e){this.runtimeFlags=e}[be](){return v(ue(iS),Re(ue(this._tag)),Re(ue(this.runtimeFlags)),Ue(this))}[he](e){return oS(e)&&e._tag===XO&&this.runtimeFlags===e.runtimeFlags}}class xW{runtimeFlags;blockingOn;[Ca]=Ca;_tag=eD;constructor(e,t){this.runtimeFlags=e,this.blockingOn=t}[be](){return v(ue(iS),Re(ue(this._tag)),Re(ue(this.runtimeFlags)),Re(ue(this.blockingOn)),Ue(this))}[he](e){return oS(e)&&e._tag===eD&&this.runtimeFlags===e.runtimeFlags&&le(this.blockingOn,e.blockingOn)}}var SW=new yW,vW=(e)=>new bW(e),wW=(e,t)=>new xW(e,t),oS=(e)=>pe(e,Ca),kW=(e)=>e._tag===nS,IW=(e)=>e._tag===XO,TW=(e)=>e._tag===eD;var EW=SW,tD=vW,CW=wW;var sS=kW,PW=IW,RW=TW;var Ame=OJ,rD=DJ,nD=MJ,iD=bO,oD=xO,sD=SO,aD=FJ,_me=$J;var Ome=v(Zi,wb((e)=>e.ordinal));var cD=LA(Ome);var uD=(e)=>{switch(e){case"All":return Ame;case"Debug":return sD;case"Error":return nD;case"Fatal":return rD;case"Info":return oD;case"Trace":return aD;case"None":return _me;case"Warning":return iD}};var Dme=Symbol.for("effect/Micro"),aS=Symbol.for("effect/Micro/MicroExit");var OW=Symbol.for("effect/Micro/MicroCause");var Mme={_E:Ze};class dD extends globalThis.Error{_tag;traces;[OW];constructor(e,t,r){let i=`MicroCause.${e}`,n,o,s;if(t instanceof globalThis.Error){n=`(${i}) ${t.name}`,o=t.message;let c=o.split(`
|
|
174
174
|
`).length;s=t.stack?`(${i}) ${t.stack.split(`
|
|
175
175
|
`).slice(0,c+3).join(`
|
|
176
176
|
`)}`:`${n}: ${o}`}else n=i,o=No(t,0),s=`${n}: ${o}`;if(r.length>0)s+=`
|
|
177
177
|
${r.join(`
|
|
178
|
-
`)}`;super(o);this._tag=e,this.traces=r,this[OW]=Mme,this.name=n,this.stack=s}pipe(){return ae(this,arguments)}toString(){return this.stack}[qe](){return this.stack}}class FW extends dD{defect;constructor(e,t=[]){super("Die",e,t);this.defect=e}}var Fme=(e,t=[])=>new FW(e,t);class $W extends dD{constructor(e=[]){super("Interrupt","interrupted",e)}}var $me=(e=[])=>new $W(e);var jW=(e)=>e._tag==="Interrupt";var DW=Symbol.for("effect/Micro/MicroFiber"),jme={_A:Ze,_E:Ze};class mD{context;interruptible;[DW];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(e,t=!0){this.context=e,this.interruptible=t,this[DW]=jme}getRef(e){return n2(this.context,e)}addObserver(e){if(this._exit)return e(this._exit),ao;return this._observers.push(e),()=>{let t=this._observers.indexOf(e);if(t>=0)this._observers.splice(t,1)}}_interrupted=!1;unsafeInterrupt(){if(this._exit)return;if(this._interrupted=!0,this.interruptible)this.evaluate(fD)}unsafePoll(){return this._exit}evaluate(e){if(this._exit)return;else if(this._yielded!==void 0){let i=this._yielded;this._yielded=void 0,i()}let t=this.runLoop(e);if(t===Sp)return;let r=MW.interruptChildren&&MW.interruptChildren(this);if(r!==void 0)return this.evaluate(nu(r,()=>t));this._exit=t;for(let i=0;i<this._observers.length;i++)this._observers[i](t);this._observers.length=0}runLoop(e){let t=!1,r=e;this.currentOpCount=0;try{while(!0){if(this.currentOpCount++,!t&&this.getRef(Rf).shouldYield(this)){t=!0;let i=r;r=nu(qme,()=>i)}if(r=r[pD](this),r===Sp){let i=this._yielded;if(aS in i)return this._yielded=void 0,i;return Sp}}}catch(i){if(!pe(r,pD))return dS(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`);return dS(i)}}getCont(e){while(!0){let t=this._stack.pop();if(!t)return;let r=t[cS]&&t[cS](this);if(r)return{[e]:r};if(t[e])return t}}_yielded=void 0;yieldWith(e){return this._yielded=e,Sp}children(){return this._children??=new Set}}var MW=Fe("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0}));var Nme=(e)=>Pf(()=>{for(let i of e)i.unsafeInterrupt();let t=e[Symbol.iterator](),r=Pf(()=>{let i=t.next();while(!i.done){if(i.value.unsafePoll()){i=t.next();continue}let n=i.value;return LW((o)=>{n.addObserver((s)=>{o(r)})})}return kp});return r}),NW=Symbol.for("effect/Micro/identifier"),xt=Symbol.for("effect/Micro/args"),pD=Symbol.for("effect/Micro/evaluate"),Pa=Symbol.for("effect/Micro/successCont"),vp=Symbol.for("effect/Micro/failureCont"),cS=Symbol.for("effect/Micro/ensureCont"),Sp=Symbol.for("effect/Micro/Yield"),zme={_A:Ze,_E:Ze,_R:Ze},Lme={...VH,_op:"Micro",[Dme]:zme,pipe(){return ae(this,arguments)},[Symbol.iterator](){return new fc(new jo(this))},toJSON(){return{_id:"Micro",op:this[NW],...xt in this?{args:this[xt]}:void 0}},toString(){return it(this)},[qe](){return it(this)}};function Bme(e){return dS("Micro.evaluate: Not implemented")}var mS=(e)=>({...Lme,[NW]:e.op,[pD]:e.eval??Bme,[Pa]:e.contA,[vp]:e.contE,[cS]:e.ensure}),Ra=(e)=>{let t=mS(e);return function(){let r=Object.create(t);return r[xt]=e.single===!1?arguments:arguments[0],r}},zW=(e)=>{let t={...mS(e),[aS]:aS,_tag:e.op,get[e.prop](){return this[xt]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[xt]}},[he](r){return Kme(r)&&r._tag===e.op&&le(this[xt],r[xt])},[be](){return Ue(this,Re(lt(e.op))(ue(this[xt])))}};return function(r){let i=Object.create(t);return i[xt]=r,i[Pa]=void 0,i[vp]=void 0,i[cS]=void 0,i}},wp=zW({op:"Success",prop:"value",eval(e){let t=e.getCont(Pa);return t?t[Pa](this[xt],e):e.yieldWith(this)}}),uS=zW({op:"Failure",prop:"cause",eval(e){let t=e.getCont(vp);while(jW(this[xt])&&t&&e.interruptible)t=e.getCont(vp);return t?t[vp](this[xt],e):e.yieldWith(this)}});var lS=Ra({op:"Sync",eval(e){let t=this[xt](),r=e.getCont(Pa);return r?r[Pa](t,e):e.yieldWith(gS(t))}}),Pf=Ra({op:"Suspend",eval(e){return this[xt]()}}),Ume=Ra({op:"Yield",eval(e){let t=!1;return e.getRef(Rf).scheduleTask(()=>{if(t)return;e.evaluate(kp)},this[xt]??0),e.yieldWith(()=>{t=!0})}}),qme=Ume(0);var pS=wp(void 0);var fS=Ra({op:"WithMicroFiber",eval(e){return this[xt](e)}});var Jme=Ra({op:"Async",single:!1,eval(e){let t=this[xt][0],r=!1,i=!1,n=this[xt][1]?new AbortController:void 0,o=t((s)=>{if(r)return;if(r=!0,i)e.evaluate(s);else i=s},n?.signal);if(i!==!1)return i;if(i=!0,e._yielded=()=>{r=!0},n===void 0&&o===void 0)return Sp;return e._stack.push(Hme(()=>(r=!0,n?.abort(),o??kp))),Sp}}),Hme=Ra({op:"AsyncFinalizer",ensure(e){if(e.interruptible)e.interruptible=!1,e._stack.push(hD(!0))},contE(e,t){return jW(e)?nu(this[xt](),()=>uS(e)):uS(e)}}),LW=(e)=>Jme(e,e.length>=2);var Wme=h(2,(e,t)=>Gme(e,(r)=>t));var Zme=(e)=>tfe(e,{onFailure:hS,onSuccess:gS});var nu=h(2,(e,t)=>{let r=Object.create(Vme);return r[xt]=e,r[Pa]=t,r}),Vme=mS({op:"OnSuccess",eval(e){return e._stack.push(this),this[xt]}});var Gme=h(2,(e,t)=>nu(e,(r)=>wp(t(r)))),Kme=(e)=>pe(e,aS),gS=wp,hS=uS,fD=hS($me());var dS=(e)=>hS(Fme(e));var kp=gS(void 0),Qme=(e)=>{for(let t of e)if(t._tag==="Failure")return t;return kp},Yme="setImmediate"in globalThis?globalThis.setImmediate:(e)=>setTimeout(e,0);class gD{tasks=[];running=!1;scheduleTask(e,t){if(this.tasks.push(e),!this.running)this.running=!0,Yme(this.afterScheduled)}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){let e=this.tasks;this.tasks=[];for(let t=0,r=e.length;t<r;t++)e[t]()}shouldYield(e){return e.currentOpCount>=e.getRef(UW)}flush(){while(this.tasks.length>0)this.runTasks()}}var Xme=h(2,(e,t)=>fS((r)=>{let i=r.context;return r.context=t(i),rfe(e,()=>(r.context=i,pS))}));var BW=h(2,(e,t)=>Xme(e,Go(t)));class UW extends go()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class qW extends go()("effect/Micro/currentConcurrency",{defaultValue:()=>"unbounded"}){}class Rf extends go()("effect/Micro/currentScheduler",{defaultValue:()=>new gD}){}var JW=h(2,(e,t)=>{let r=Object.create(efe);return r[xt]=e,r[Pa]=t.onSuccess,r[vp]=t.onFailure,r}),efe=mS({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[xt]}}),tfe=h(2,(e,t)=>JW(e,{onFailure:(r)=>lS(()=>t.onFailure(r)),onSuccess:(r)=>lS(()=>t.onSuccess(r))}));var lD=Symbol.for("effect/Micro/MicroScope");class HW{[lD];state={_tag:"Open",finalizers:new Set};constructor(){this[lD]=lD}unsafeAddFinalizer(e){if(this.state._tag==="Open")this.state.finalizers.add(e)}addFinalizer(e){return Pf(()=>{if(this.state._tag==="Open")return this.state.finalizers.add(e),pS;return e(this.state.exit)})}unsafeRemoveFinalizer(e){if(this.state._tag==="Open")this.state.finalizers.delete(e)}close(e){return Pf(()=>{if(this.state._tag==="Open"){let t=Array.from(this.state.finalizers).reverse();return this.state={_tag:"Closed",exit:e},nu(sfe(t,(r)=>Zme(r(e))),Qme)}return pS})}get fork(){return lS(()=>{let e=new HW;if(this.state._tag==="Closed")return e.state=this.state,e;function t(r){return e.close(r)}return this.state.finalizers.add(t),e.unsafeAddFinalizer((r)=>lS(()=>this.unsafeRemoveFinalizer(t))),e})}}var rfe=h(2,(e,t)=>ife((r)=>JW(r(e),{onFailure:(i)=>nu(t(hS(i)),()=>uS(i)),onSuccess:(i)=>nu(t(gS(i)),()=>wp(i))})));var hD=Ra({op:"SetInterruptible",ensure(e){if(e.interruptible=this[xt],e._interrupted&&e.interruptible)return()=>fD}}),nfe=(e)=>fS((t)=>{if(t.interruptible)return e;if(t.interruptible=!0,t._stack.push(hD(!1)),t._interrupted)return fD;return e}),ife=(e)=>fS((t)=>{if(!t.interruptible)return e(Ze);return t.interruptible=!1,t._stack.push(hD(!0)),e(nfe)});var ofe=Ra({op:"While",contA(e,t){if(this[xt].step(e),this[xt].while())return t._stack.push(this),this[xt].body();return kp},eval(e){if(this[xt].while())return e._stack.push(this),this[xt].body();return kp}}),sfe=(e,t,r)=>fS((i)=>{let n=r?.concurrency==="inherit"?i.getRef(qW):r?.concurrency??1,o=n==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,n),s=ot(e),c=s.length;if(c===0)return r?.discard?pS:wp([]);let u=r?.discard?void 0:Array(c),l=0;if(o===1)return Wme(ofe({while:()=>l<s.length,body:()=>t(s[l],l),step:u?(p)=>u[l++]=p:(p)=>l++}),u);return LW((p)=>{let m=new Set,f=void 0,g=0,S=0,P=!1,D=!1;function L(){P=!0;while(g<o&&l<c){let Se=l,Q=s[Se];l++,g++;try{let se=afe(i,t(Q,Se),!0,!0);m.add(se),se.addObserver((me)=>{if(m.delete(se),D)return;else if(me._tag==="Failure"){if(f===void 0)f=me,c=l,m.forEach((F)=>F.unsafeInterrupt())}else if(u!==void 0)u[Se]=me.value;if(S++,g--,S===c)p(f??wp(u));else if(!P&&g<o)L()})}catch(se){f=dS(se),c=l,m.forEach((me)=>me.unsafeInterrupt())}}P=!1}return L(),Pf(()=>(D=!0,l=c,Nme(m)))})});var afe=(e,t,r=!1,i=!1)=>{let n=new mD(e.context,e.interruptible);if(!i)e.children().add(n),n.addObserver(()=>e.children().delete(n));if(r)n.evaluate(t);else e.getRef(Rf).scheduleTask(()=>n.evaluate(t),0);return n};var WW=(e,t)=>{let r=new mD(Rf.context(t?.scheduler??new gD));if(r.evaluate(e),t?.signal)if(t.signal.aborted)r.unsafeInterrupt();else{let i=()=>r.unsafeInterrupt();t.signal.addEventListener("abort",i,{once:!0}),r.addObserver(()=>t.signal.removeEventListener("abort",i))}return r};var Aa=Symbol.for("effect/Readable");var _2e={[Aa]:Aa,pipe(){return ae(this,arguments)}};var yS=Symbol.for("effect/Ref"),yD={_A:(e)=>e};class VW extends Ea{ref;commit(){return this.get}[yS]=yD;[Aa]=Aa;constructor(e){super();this.ref=e,this.get=q(()=>jn(this.ref))}get;modify(e){return q(()=>{let t=jn(this.ref),[r,i]=e(t);if(t!==i)Ti(i)(this.ref);return r})}}var Ip=(e)=>new VW(bo(e)),iu=(e)=>q(()=>Ip(e)),Ur=(e)=>e.get,To=h(2,(e,t)=>e.modify(()=>[void 0,t])),GW=h(2,(e,t)=>e.modify((r)=>[r,t]));var bD=h(2,(e,t)=>e.modify(t));var ou=h(2,(e,t)=>e.modify((r)=>[void 0,t(r)]));var xS=iu,SS=Ur,KW=GW;var QW=ou;class vS{scheduleDrain;running=!1;tasks=new xD;constructor(e){this.scheduleDrain=e}starveInternal=(e)=>{let t=this.tasks.buckets;this.tasks.buckets=[];for(let[r,i]of t)for(let n=0;n<i.length;n++)i[n]();if(this.tasks.buckets.length===0)this.running=!1;else this.starve(e)};starve(e=0){this.scheduleDrain(e,this.starveInternal)}scheduleTask(e,t){if(this.tasks.scheduleTask(e,t),!this.running)this.running=!0,this.starve()}static cached(e){let t=new vS(e),r=new WeakMap;return(i)=>{if(i===void 0)return t;let n=r.get(i);if(n===void 0)n=new vS(e),r.set(i,n);return n}}}class xD{buckets=[];scheduleTask(e,t){let r=this.buckets.length,i=void 0,n=0;for(;n<r;n++)if(this.buckets[n][0]<=t)i=this.buckets[n];else break;if(i&&i[0]===t)i[1].push(e);else if(n===r)this.buckets.push([t,[e]]);else this.buckets.splice(n,0,[t,[e]])}}class XW{maxNextTickBeforeTimer;getRunner=vS.cached((e,t)=>{if(e>=this.maxNextTickBeforeTimer)setTimeout(()=>t(0),0);else Promise.resolve(void 0).then(()=>t(e+1))});constructor(e){this.maxNextTickBeforeTimer=e}shouldYield(e){return e.currentOpCount>e.getFiberRef(_x)?e.getFiberRef(ns):!1}scheduleTask(e,t,r){this.getRunner(r).scheduleTask(e,t)}}var eZ=Fe(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new XW(2048));class SD{tasks=new xD;deferred=!1;scheduleTask(e,t,r){if(this.deferred)eZ.scheduleTask(e,t,r);else this.tasks.scheduleTask(e,t)}shouldYield(e){return e.currentOpCount>e.getFiberRef(_x)?e.getFiberRef(ns):!1}flush(){while(this.tasks.buckets.length>0){let e=this.tasks.buckets;this.tasks.buckets=[];for(let[t,r]of e)for(let i=0;i<r.length;i++)r[i]()}this.deferred=!0}}var su=Fe(Symbol.for("effect/FiberRef/currentScheduler"),()=>Ut(eZ)),tZ=h(2,(e,t)=>Xt(e,su,t));var wS=Fe(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Ut(new Map));var vD=(e,t,r,i)=>{switch(e){case void 0:return t();case"unbounded":return r();case"inherit":return Br(Dx,(n)=>n==="unbounded"?r():n>1?i(n):t());default:return e>1?i(e):t()}},Af=(e,t,r)=>{switch(e){case void 0:return t();case"unbounded":return r();case"inherit":return Br(Dx,(i)=>i==="unbounded"||i>1?r():t());default:return e>1?r():t()}};var nZ=(e,t)=>({label:e,startTime:t}),wD=(e)=>e.replace(/[\s="]/g,"_"),kD=(e)=>(t)=>`${wD(t.label)}=${e-t.startTime}ms`;var oZ=nZ;var sZ=Wx;var aZ="effect/MetricLabel",ID=Symbol.for(aZ);class cZ{key;value;[ID]=ID;_hash;constructor(e,t){this.key=e,this.value=t,this._hash=lt(aZ+this.key+this.value)}[be](){return this._hash}[he](e){return mfe(e)&&this.key===e.key&&this.value===e.value}pipe(){return ae(this,arguments)}}var au=(e,t)=>new cZ(e,t),mfe=(e)=>pe(e,ID);var uZ=h((e)=>mt(e[0]),function(){let e=arguments;return wr(e[0],Ia,typeof e[1]==="string"?Bi(e[1],e[2]):(t)=>Object.entries(e[1]).reduce((r,[i,n])=>Bi(r,i,n),t))}),Tp=(e)=>W(e,re),lZ=(e)=>Sa(e,re),ED=(e)=>{let t,r=void 0;if(typeof e==="function")t=e;else t=e.try,r=e.catch;return we(()=>{try{return O(Jt(t))}catch(i){return Ge(r?Jt(()=>r(i)):new gf(i,"An unknown error occurred in Effect.try"))}})},pZ=h(3,(e,t,r)=>Ji(e,(i)=>{if(pe(i,t)&&i[t]===r.failure)return r.onFailure(i);return Ge(i)})),dZ=h(2,(e,t)=>vo(e,(r)=>{let i=Fc(r,(n)=>Lm(n)?re(n):H());switch(i._tag){case"None":return tt(r);case"Some":return t(i.value.defect)}})),mZ=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=t(r);switch(i._tag){case"None":return tt(r);case"Some":return i.value}},onSuccess:O})),fZ=h(2,(e,t)=>vo(e,(r)=>{let i=Fc(r,(n)=>Lm(n)?re(n):H());switch(i._tag){case"None":return tt(r);case"Some":{let n=t(i.value.defect);return n._tag==="Some"?n.value:tt(r)}}})),gZ=h((e)=>mt(e[0]),(e,...t)=>{let r=t[t.length-1],i;if(t.length===2)i=Qs(t[0]);else i=(n)=>{let o=pe(n,"_tag")?n._tag:void 0;if(!o)return!1;for(let s=0;s<t.length-1;s++)if(t[s]===o)return!0;return!1};return lf(e,i,r)}),hZ=h(2,(e,t)=>{let r;return lf(e,(i)=>(r??=Object.keys(t),pe(i,"_tag")&&Cm(i._tag)&&r.includes(i._tag)),(i)=>t[i._tag](i))}),yZ=(e)=>pf(e,{onFailure:Ze,onSuccess:()=>Fn}),Eo=HH,bZ=Eo(O),xZ=h(2,(e,t)=>st(JO(t),e)),TS=(e)=>Qe((t,r)=>e({id:t.id(),status:r,interruptors:Hb(t.getFiberRef(Zc))})),SZ=TS((e)=>Jo(e.interruptors)>0?Ix:$e),vZ=TS(O),Ep=(e)=>Df(e,ES,Cf),ffe=(e)=>Df(e,qc(ES,op),([t,r],[i,n])=>[Cf(t,i),Ei(r,n)]),wZ=O({}),kZ=kU(W,E),IZ=wU(W),TZ=vU(W),EZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!1),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>{if(l)return i.push(c),O(!0);return t(c,u)})}return W(o,()=>i)})),CZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!0),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>W(l?t(c,u):O(!1),(p)=>{if(!p)i.push(c);return p}))}return W(o,()=>i)})),PZ=(e)=>W(Bn(),e),CD=(e)=>Bc(e,()=>E(Io(),()=>CD(e))),RZ=h(2,(e,t)=>W(Rr(e,Ze),Hl(t))),AZ=h(3,(e,t,r)=>_f(e,t,(i)=>ha(()=>r(i)))),_Z=h(3,(e,t,r)=>_f(e,t,()=>ga(r))),_f=h(3,(e,t,r)=>E(e,(i)=>t(i)?O(i):r(i))),OZ=h(3,(e,t,r)=>we(()=>t(e)?O(e):Ge(r(e)))),DZ=h((e)=>mt(e[0]),(e,t,r)=>_f(e,t,(i)=>r===void 0?Ge(new Ln):Pi(()=>r(i)))),MZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=r.next();if(!i.done)return FZ(r,0,t,i.value);return O(H())})),FZ=(e,t,r,i)=>E(r(i,t),(n)=>{if(n)return O(re(i));let o=e.next();if(!o.done)return FZ(e,t+1,r,o.value);return O(H())}),$Z=(e)=>we(()=>{let t=wc(e);if(!zr(t))return ha(()=>new ff("Received an empty collection of effects"));return v(Yr(t),ta(Pr(t),(r,i)=>Bc(r,()=>i)))}),jZ=h(2,(e,t)=>xa(t(xa(e)))),Of=h(2,(e,t)=>dr(e,{onFailure:(r)=>O(t.onFailure(r)),onSuccess:(r)=>O(t.onSuccess(r))})),NZ=h(2,(e,t)=>we(()=>zZ(e[Symbol.iterator](),0,t))),zZ=(e,t,r)=>{let i=e.next();return i.done?O(!0):E(r(i.value,t),(n)=>n?zZ(e,t+1,r):O(n))},PD=(e)=>{let t=E(E(e,()=>Io()),()=>t);return t},ES=Qe((e)=>O(e.getFiberRefs())),LZ=(e)=>E(e,(t)=>{let i=t[Symbol.iterator]().next();if(i.done)return Ge(new Ln);return O(i.value)}),CS=(e)=>Of(e,{onFailure:ao,onSuccess:ao}),BZ=(e)=>Dt(e,{onFailure:(t)=>AD(t,"An error was silently ignored because it is not anticipated to be useful"),onSuccess:()=>$e}),UZ=(e)=>RS((t,r)=>oW(r,t,e)),qZ=(e)=>Of(e,{onFailure:$o,onSuccess:$i}),JZ=(e)=>Of(e,{onFailure:$i,onSuccess:$o}),RD=(e,t)=>we(()=>{if(t.while(e))return E(t.body(e),(r)=>RD(r,t));return O(e)}),ps=(e)=>(...t)=>{let r=Bo(e),i=void 0;for(let n=0,o=t.length;n<o;n++){let s=t[n];if(f_(s)){if(i!==void 0)i=Vt(i,s);else i=s;t=[...t.slice(0,n),...t.slice(n+1)],n--}}if(i===void 0)i=Fn;return Qe((n)=>(n.log(t,i,r),$e))},HZ=ps(),WZ=ps(aD),AD=ps(sD),ZZ=ps(oD),VZ=ps(iD),GZ=ps(nD),KZ=ps(rD),QZ=h(2,(e,t)=>E(yp,(r)=>wr(e,Ox,ox(oZ(t,r))))),YZ=ei(Ia),XZ=(e,t)=>t.discard?tV(e,t.while,t.step,t.body):W(eV(e,t.while,t.step,t.body),ot),eV=(e,t,r,i)=>we(()=>t(e)?E(i(e),(n)=>W(eV(r(e),t,r,i),ox(n))):q(()=>So())),tV=(e,t,r,i)=>we(()=>t(e)?E(i(e),()=>tV(r(e),t,r,i)):$e),rV=h(3,(e,t,r)=>we(()=>{let i=e[Symbol.iterator](),n=[],o=O(t),s,c=0;while(!(s=i.next()).done){let u=c++,l=s.value;o=E(o,(p)=>W(r(p,l,u),([m,f])=>(n.push(f),m)))}return W(o,(u)=>[u,n])})),Cp=h(2,(e,t)=>Dt(e,{onFailure:(r)=>ya(()=>t(r)),onSuccess:O})),_D=(e)=>v(ri(),E((t)=>v(ffe(e),wo(t),OD,W((r)=>st(r,v(kr(t),E(([i,n])=>kt(qc(cu(i[0]),va(i[1])),n)))))))),nV=(e)=>dr(e,{onFailure:(t)=>O(t),onSuccess:O}),PS=(e)=>W(e,(t)=>!t),iV=(e)=>E(e,(t)=>{switch(t._tag){case"None":return $e;case"Some":return Ge(new Ln)}}),OD=(e)=>W(xS(!0),(t)=>$t(sp(e,KW(t,!1)))),oV=(e)=>dr(e,{onFailure:()=>O(H()),onSuccess:(t)=>O(re(t))}),sV=h(2,(e,t)=>Bc(e,()=>Pi(t))),aV=h(2,(e,t)=>Bc(e,()=>q(t))),cV=(e)=>Dt(e,{onFailure:(t)=>{let r=ot(Jb(t));return r.length===0?tt(t):Ge(r)},onSuccess:O}),cu=(e)=>RS((t,r)=>v(e,rS(t,r))),uV=(e)=>e.length>=1?en((t,r)=>{try{e(r).then((i)=>t(O(i)),(i)=>t(xn(i)))}catch(i){t(xn(i))}}):en((t)=>{try{e().then((r)=>t(O(r)),(r)=>t(xn(r)))}catch(r){t(xn(r))}}),_a=h(3,(e,t,r)=>Ri((i)=>Wi(e,Ot(i,t,r)))),Oa=h(3,(e,t,r)=>Ri((i)=>E(r,(n)=>Wi(e,v(i,Ot(t,n)))))),lV=Hx(O),pV=h(3,(e,t,r)=>ot(e).reduce((i,n,o)=>E(i,(s)=>r(s,n,o)),O(t))),dV=h(3,(e,t,r)=>ot(e).reduceRight((i,n,o)=>E(i,(s)=>r(n,s,o)),O(t))),mV=h(3,(e,t,r)=>E(q(()=>e[Symbol.iterator]()),(i)=>fV(i,0,t,r.while,r.body))),fV=(e,t,r,i,n)=>{let o=e.next();if(!o.done&&i(r))return E(n(r,o.value,t),(s)=>fV(e,t+1,s,i,n));return O(r)},gV=h(2,(e,t)=>we(()=>hV(e,t))),hV=(e,t)=>E(e,(r)=>t<=0?O(r):st(Io(),hV(e,t-1))),yV=(e)=>Dt(e,{onFailure:Ge,onSuccess:O}),bV=(e)=>we(()=>sW(e)),uu=JO,lu=O(H()),xV=(e)=>O(re(e)),Df=h(3,(e,t,r)=>E(t,(i)=>E(e,(n)=>W(t,(o)=>[r(i,o),n])))),SV=h((e)=>mt(e[0]),function(){return DD(arguments[0],typeof arguments[1]==="string"?[au(arguments[1],arguments[2])]:Object.entries(arguments[1]).map(([e,t])=>au(e,t)))}),DD=h(2,(e,t)=>wr(e,is,(r)=>Ni(r,t))),vV=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!1),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>{if(l)return O(!0);return i.push(c),t(c,u)})}return W(o,()=>i)})),wV=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!0),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>v(l?t(c,u):O(!1),W((p)=>{if(p)i.push(c);return p})))}return W(o,()=>i)})),kV=h(2,(e,{onFailure:t,onSuccess:r})=>Dt(e,{onFailure:(i)=>{let n=Wo(i);switch(n._tag){case"Left":return st(t(n.left),tt(i));case"Right":return tt(i)}},onSuccess:(i)=>kt(r(i),i)})),IV=h(2,(e,t)=>vo(e,(r)=>yr(Wq(r),{onNone:()=>tt(r),onSome:(i)=>st(t(i),tt(r))}))),MD=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=Wo(r);switch(i._tag){case"Left":return st(t(i.left),tt(r));case"Right":return tt(r)}},onSuccess:O})),TV=h(3,(e,t,r)=>MD(e,(i)=>{if(Qs(i,t))return r(i);return $e})),EV=h(2,(e,t)=>Dt(e,{onFailure:(r)=>st(t(r),tt(r)),onSuccess:O})),CV=(e)=>FD(e,JH),FD=h(2,(e,t)=>Df(e,t,(r,i)=>Zm(i-r))),gfe=sZ,PV=gfe(O),$D=(e)=>{let t,r=void 0;if(typeof e==="function")t=e;else t=e.try,r=e.catch;let i=(n)=>r?Pi(()=>r(n)):Ge(new gf(n,"An unknown error occurred in Effect.tryPromise"));if(t.length>=1)return en((n,o)=>{try{t(o).then((s)=>n(O(s)),(s)=>n(i(s)))}catch(s){n(i(s))}});return en((n)=>{try{t().then((o)=>n(O(o)),(o)=>n(i(o)))}catch(o){n(i(o))}})},RV=h(2,(e,t)=>E(e,(r)=>ED({try:()=>t.try(r),catch:t.catch}))),AV=h(2,(e,t)=>E(e,(r)=>$D({try:t.try.length>=1?(i)=>t.try(r,i):()=>t.try(r),catch:t.catch}))),_V=h(2,(e,t)=>we(()=>t()?lu:Tp(e))),OV=h(2,(e,t)=>E(t,(r)=>r?lu:Tp(e))),DV=(e)=>Cp(e,Gq),RS=(e)=>Qe((t)=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),$e)),MV=h(3,(e,t,r)=>Xc(e,(i)=>Ot(i,t,r(ca(i,t))))),AS=h(2,(e,t)=>we(()=>t()?W(e,re):O(H()))),FV=h(3,(e,t,r)=>E(ei(t),(i)=>r(i)?W(e,(n)=>[i,re(n)]):O([i,H()]))),$V=h(3,(e,t,r)=>E(SS(t),(i)=>r(i)?W(e,(n)=>[i,re(n)]):O([i,H()]))),jV=h(2,(e,t)=>t(e)),NV=(e,t)=>(...r)=>E(e,(i)=>t(i)(...r)),zV=(e,t)=>(...r)=>W(e,(i)=>t(i)(...r)),jD=(e)=>new Proxy({},{get(t,r,i){return(...n)=>E(e,(o)=>o[r](...n))}}),ND=(e)=>new Proxy({},{get(t,r,i){return E(e,(n)=>mt(n[r])?n[r]:O(n[r]))}}),LV=(e)=>({functions:jD(e),constants:ND(e)}),BV=(e)=>W(Bn(),Ii(e)),zD=(e)=>E(Bn(),Ii(e)),UV=function(){let e=arguments;return CS(E(BD,(t)=>q(()=>{if(typeof e[0]==="string")t.attribute(e[0],e[1]);else for(let r in e[0])t.attribute(r,e[0][r])})))},qV=function(){let e=arguments,t=Array.isArray(e[0])?e[0]:[{_tag:"SpanLink",span:e[0],attributes:e[1]??{}}];return CS(E(LD,(r)=>q(()=>r.addLinks(t))))},JV=h((e)=>mt(e[0]),function(){let e=arguments;return wr(e[0],mf,typeof e[1]==="string"?Bi(e[1],e[2]):(t)=>Object.entries(e[1]).reduce((r,[i,n])=>Bi(r,i,n),t))}),HV=zD(Vi),LD=E(Bn(),(e)=>{let t=e.unsafeMap.get(Vi.key);return t!==void 0&&t._tag==="Span"?O(t):Ge(new Ln)}),BD=E(Bn(),(e)=>{let t=Mf(Ii(e,Vi));return t._tag==="Some"&&t.value._tag==="Span"?O(t.value):Ge(new Ln)}),WV=h((e)=>mt(e[0]),(e,t,r)=>wr(e,Mx,Cb({_tag:"SpanLink",span:t,attributes:r??{}}))),ZV=BigInt(0),Mf=xc((e)=>$n(e.context,gp)?e._tag==="Span"?Mf(e.parent):H():re(e)),_S=(e,t,r)=>{let i=!e.getFiberRef(TO)||r.context&&$n(r.context,gp),n=e.getFiberRef(zn),o=r.parent?re(r.parent):r.root?H():Mf(Ii(n,Vi)),s;if(i)s=rH({name:t,parent:o,context:Ot(r.context??Qn(),gp,!0)});else{let c=e.getFiberRef(er),u=$n(c,as),l=$n(c,WH),p=e.getFiberRef(cp),m=e.getFiberRefs(),f=QO(m,mf),g=QO(m,Mx),S=g._tag==="Some"?r.links!==void 0?[...Si(g.value),...r.links??[]]:Si(g.value):r.links??zi();if(s=u.span(t,o,r.context??Qn(),S,p?l.unsafeCurrentTimeNanos():ZV,r.kind??"internal",r),f._tag==="Some")D2(f.value,(P,D)=>s.attribute(D,P));if(r.attributes!==void 0)Object.entries(r.attributes).forEach(([P,D])=>s.attribute(P,D))}if(typeof r.captureStackTrace==="function")qm.set(s,r.captureStackTrace);return s},VV=(e,t)=>(t=cs(t),Qe((r)=>O(_S(r,e,t)))),GV=ei(mf),KV=ei(Mx),UD=(e,t,r,i)=>q(()=>{if(e.status._tag==="Ended")return;if(EO(t)&&qm.has(e))e.attribute("code.stacktrace",qm.get(e)());e.end(i?r.unsafeCurrentTimeNanos():ZV,t)}),kS=(e,...t)=>{let r=cs(t.length===1?void 0:t[0]),i=t[t.length-1];return Qe((n)=>{let o=_S(n,e,r),s=n.getFiberRef(cp),c=$n(n.getFiberRef(er),ni);return Sn(i(o),(u)=>UD(o,u,c,s))})},IS=h(2,(e,t)=>_a(e,Vi,t)),qD=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],r=cs(e?arguments[2]:arguments[1]);if(e){let i=arguments[0];return kS(t,r,(n)=>IS(i,n))}return(i)=>kS(t,r,(n)=>IS(i,n))},QV=(e)=>function(){let t=e.captureStackTrace??!1;if(e.captureStackTrace!==!1){let r=Error.stackTraceLimit;Error.stackTraceLimit=2;let i=Error();Error.stackTraceLimit=r;let n=!1;t=()=>{if(n!==!1)return n;if(i.stack)return n=i.stack.trim().split(`
|
|
178
|
+
`)}`;super(o);this._tag=e,this.traces=r,this[OW]=Mme,this.name=n,this.stack=s}pipe(){return ae(this,arguments)}toString(){return this.stack}[qe](){return this.stack}}class FW extends dD{defect;constructor(e,t=[]){super("Die",e,t);this.defect=e}}var Fme=(e,t=[])=>new FW(e,t);class $W extends dD{constructor(e=[]){super("Interrupt","interrupted",e)}}var $me=(e=[])=>new $W(e);var jW=(e)=>e._tag==="Interrupt";var DW=Symbol.for("effect/Micro/MicroFiber"),jme={_A:Ze,_E:Ze};class mD{context;interruptible;[DW];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(e,t=!0){this.context=e,this.interruptible=t,this[DW]=jme}getRef(e){return n2(this.context,e)}addObserver(e){if(this._exit)return e(this._exit),ao;return this._observers.push(e),()=>{let t=this._observers.indexOf(e);if(t>=0)this._observers.splice(t,1)}}_interrupted=!1;unsafeInterrupt(){if(this._exit)return;if(this._interrupted=!0,this.interruptible)this.evaluate(fD)}unsafePoll(){return this._exit}evaluate(e){if(this._exit)return;else if(this._yielded!==void 0){let i=this._yielded;this._yielded=void 0,i()}let t=this.runLoop(e);if(t===Sp)return;let r=MW.interruptChildren&&MW.interruptChildren(this);if(r!==void 0)return this.evaluate(nu(r,()=>t));this._exit=t;for(let i=0;i<this._observers.length;i++)this._observers[i](t);this._observers.length=0}runLoop(e){let t=!1,r=e;this.currentOpCount=0;try{while(!0){if(this.currentOpCount++,!t&&this.getRef(Rf).shouldYield(this)){t=!0;let i=r;r=nu(qme,()=>i)}if(r=r[pD](this),r===Sp){let i=this._yielded;if(aS in i)return this._yielded=void 0,i;return Sp}}}catch(i){if(!pe(r,pD))return dS(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`);return dS(i)}}getCont(e){while(!0){let t=this._stack.pop();if(!t)return;let r=t[cS]&&t[cS](this);if(r)return{[e]:r};if(t[e])return t}}_yielded=void 0;yieldWith(e){return this._yielded=e,Sp}children(){return this._children??=new Set}}var MW=Fe("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0}));var Nme=(e)=>Pf(()=>{for(let i of e)i.unsafeInterrupt();let t=e[Symbol.iterator](),r=Pf(()=>{let i=t.next();while(!i.done){if(i.value.unsafePoll()){i=t.next();continue}let n=i.value;return LW((o)=>{n.addObserver((s)=>{o(r)})})}return kp});return r}),NW=Symbol.for("effect/Micro/identifier"),xt=Symbol.for("effect/Micro/args"),pD=Symbol.for("effect/Micro/evaluate"),Pa=Symbol.for("effect/Micro/successCont"),vp=Symbol.for("effect/Micro/failureCont"),cS=Symbol.for("effect/Micro/ensureCont"),Sp=Symbol.for("effect/Micro/Yield"),zme={_A:Ze,_E:Ze,_R:Ze},Lme={...VH,_op:"Micro",[Dme]:zme,pipe(){return ae(this,arguments)},[Symbol.iterator](){return new fc(new jo(this))},toJSON(){return{_id:"Micro",op:this[NW],...xt in this?{args:this[xt]}:void 0}},toString(){return it(this)},[qe](){return it(this)}};function Bme(e){return dS("Micro.evaluate: Not implemented")}var mS=(e)=>({...Lme,[NW]:e.op,[pD]:e.eval??Bme,[Pa]:e.contA,[vp]:e.contE,[cS]:e.ensure}),Ra=(e)=>{let t=mS(e);return function(){let r=Object.create(t);return r[xt]=e.single===!1?arguments:arguments[0],r}},zW=(e)=>{let t={...mS(e),[aS]:aS,_tag:e.op,get[e.prop](){return this[xt]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[xt]}},[he](r){return Kme(r)&&r._tag===e.op&&le(this[xt],r[xt])},[be](){return Ue(this,Re(lt(e.op))(ue(this[xt])))}};return function(r){let i=Object.create(t);return i[xt]=r,i[Pa]=void 0,i[vp]=void 0,i[cS]=void 0,i}},wp=zW({op:"Success",prop:"value",eval(e){let t=e.getCont(Pa);return t?t[Pa](this[xt],e):e.yieldWith(this)}}),uS=zW({op:"Failure",prop:"cause",eval(e){let t=e.getCont(vp);while(jW(this[xt])&&t&&e.interruptible)t=e.getCont(vp);return t?t[vp](this[xt],e):e.yieldWith(this)}});var lS=Ra({op:"Sync",eval(e){let t=this[xt](),r=e.getCont(Pa);return r?r[Pa](t,e):e.yieldWith(gS(t))}}),Pf=Ra({op:"Suspend",eval(e){return this[xt]()}}),Ume=Ra({op:"Yield",eval(e){let t=!1;return e.getRef(Rf).scheduleTask(()=>{if(t)return;e.evaluate(kp)},this[xt]??0),e.yieldWith(()=>{t=!0})}}),qme=Ume(0);var pS=wp(void 0);var fS=Ra({op:"WithMicroFiber",eval(e){return this[xt](e)}});var Jme=Ra({op:"Async",single:!1,eval(e){let t=this[xt][0],r=!1,i=!1,n=this[xt][1]?new AbortController:void 0,o=t((s)=>{if(r)return;if(r=!0,i)e.evaluate(s);else i=s},n?.signal);if(i!==!1)return i;if(i=!0,e._yielded=()=>{r=!0},n===void 0&&o===void 0)return Sp;return e._stack.push(Hme(()=>(r=!0,n?.abort(),o??kp))),Sp}}),Hme=Ra({op:"AsyncFinalizer",ensure(e){if(e.interruptible)e.interruptible=!1,e._stack.push(hD(!0))},contE(e,t){return jW(e)?nu(this[xt](),()=>uS(e)):uS(e)}}),LW=(e)=>Jme(e,e.length>=2);var Wme=h(2,(e,t)=>Gme(e,(r)=>t));var Zme=(e)=>tfe(e,{onFailure:hS,onSuccess:gS});var nu=h(2,(e,t)=>{let r=Object.create(Vme);return r[xt]=e,r[Pa]=t,r}),Vme=mS({op:"OnSuccess",eval(e){return e._stack.push(this),this[xt]}});var Gme=h(2,(e,t)=>nu(e,(r)=>wp(t(r)))),Kme=(e)=>pe(e,aS),gS=wp,hS=uS,fD=hS($me());var dS=(e)=>hS(Fme(e));var kp=gS(void 0),Qme=(e)=>{for(let t of e)if(t._tag==="Failure")return t;return kp},Yme="setImmediate"in globalThis?globalThis.setImmediate:(e)=>setTimeout(e,0);class gD{tasks=[];running=!1;scheduleTask(e,t){if(this.tasks.push(e),!this.running)this.running=!0,Yme(this.afterScheduled)}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){let e=this.tasks;this.tasks=[];for(let t=0,r=e.length;t<r;t++)e[t]()}shouldYield(e){return e.currentOpCount>=e.getRef(UW)}flush(){while(this.tasks.length>0)this.runTasks()}}var Xme=h(2,(e,t)=>fS((r)=>{let i=r.context;return r.context=t(i),rfe(e,()=>(r.context=i,pS))}));var BW=h(2,(e,t)=>Xme(e,Go(t)));class UW extends go()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class qW extends go()("effect/Micro/currentConcurrency",{defaultValue:()=>"unbounded"}){}class Rf extends go()("effect/Micro/currentScheduler",{defaultValue:()=>new gD}){}var JW=h(2,(e,t)=>{let r=Object.create(efe);return r[xt]=e,r[Pa]=t.onSuccess,r[vp]=t.onFailure,r}),efe=mS({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[xt]}}),tfe=h(2,(e,t)=>JW(e,{onFailure:(r)=>lS(()=>t.onFailure(r)),onSuccess:(r)=>lS(()=>t.onSuccess(r))}));var lD=Symbol.for("effect/Micro/MicroScope");class HW{[lD];state={_tag:"Open",finalizers:new Set};constructor(){this[lD]=lD}unsafeAddFinalizer(e){if(this.state._tag==="Open")this.state.finalizers.add(e)}addFinalizer(e){return Pf(()=>{if(this.state._tag==="Open")return this.state.finalizers.add(e),pS;return e(this.state.exit)})}unsafeRemoveFinalizer(e){if(this.state._tag==="Open")this.state.finalizers.delete(e)}close(e){return Pf(()=>{if(this.state._tag==="Open"){let t=Array.from(this.state.finalizers).reverse();return this.state={_tag:"Closed",exit:e},nu(sfe(t,(r)=>Zme(r(e))),Qme)}return pS})}get fork(){return lS(()=>{let e=new HW;if(this.state._tag==="Closed")return e.state=this.state,e;function t(r){return e.close(r)}return this.state.finalizers.add(t),e.unsafeAddFinalizer((r)=>lS(()=>this.unsafeRemoveFinalizer(t))),e})}}var rfe=h(2,(e,t)=>ife((r)=>JW(r(e),{onFailure:(i)=>nu(t(hS(i)),()=>uS(i)),onSuccess:(i)=>nu(t(gS(i)),()=>wp(i))})));var hD=Ra({op:"SetInterruptible",ensure(e){if(e.interruptible=this[xt],e._interrupted&&e.interruptible)return()=>fD}}),nfe=(e)=>fS((t)=>{if(t.interruptible)return e;if(t.interruptible=!0,t._stack.push(hD(!1)),t._interrupted)return fD;return e}),ife=(e)=>fS((t)=>{if(!t.interruptible)return e(Ze);return t.interruptible=!1,t._stack.push(hD(!0)),e(nfe)});var ofe=Ra({op:"While",contA(e,t){if(this[xt].step(e),this[xt].while())return t._stack.push(this),this[xt].body();return kp},eval(e){if(this[xt].while())return e._stack.push(this),this[xt].body();return kp}}),sfe=(e,t,r)=>fS((i)=>{let n=r?.concurrency==="inherit"?i.getRef(qW):r?.concurrency??1,o=n==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,n),s=ot(e),c=s.length;if(c===0)return r?.discard?pS:wp([]);let u=r?.discard?void 0:Array(c),l=0;if(o===1)return Wme(ofe({while:()=>l<s.length,body:()=>t(s[l],l),step:u?(p)=>u[l++]=p:(p)=>l++}),u);return LW((p)=>{let m=new Set,f=void 0,g=0,S=0,P=!1,D=!1;function L(){P=!0;while(g<o&&l<c){let Se=l,Q=s[Se];l++,g++;try{let se=afe(i,t(Q,Se),!0,!0);m.add(se),se.addObserver((me)=>{if(m.delete(se),D)return;else if(me._tag==="Failure"){if(f===void 0)f=me,c=l,m.forEach((F)=>F.unsafeInterrupt())}else if(u!==void 0)u[Se]=me.value;if(S++,g--,S===c)p(f??wp(u));else if(!P&&g<o)L()})}catch(se){f=dS(se),c=l,m.forEach((me)=>me.unsafeInterrupt())}}P=!1}return L(),Pf(()=>(D=!0,l=c,Nme(m)))})});var afe=(e,t,r=!1,i=!1)=>{let n=new mD(e.context,e.interruptible);if(!i)e.children().add(n),n.addObserver(()=>e.children().delete(n));if(r)n.evaluate(t);else e.getRef(Rf).scheduleTask(()=>n.evaluate(t),0);return n};var WW=(e,t)=>{let r=new mD(Rf.context(t?.scheduler??new gD));if(r.evaluate(e),t?.signal)if(t.signal.aborted)r.unsafeInterrupt();else{let i=()=>r.unsafeInterrupt();t.signal.addEventListener("abort",i,{once:!0}),r.addObserver(()=>t.signal.removeEventListener("abort",i))}return r};var Aa=Symbol.for("effect/Readable");var O2e={[Aa]:Aa,pipe(){return ae(this,arguments)}};var yS=Symbol.for("effect/Ref"),yD={_A:(e)=>e};class VW extends Ea{ref;commit(){return this.get}[yS]=yD;[Aa]=Aa;constructor(e){super();this.ref=e,this.get=q(()=>jn(this.ref))}get;modify(e){return q(()=>{let t=jn(this.ref),[r,i]=e(t);if(t!==i)Ti(i)(this.ref);return r})}}var Ip=(e)=>new VW(bo(e)),iu=(e)=>q(()=>Ip(e)),Ur=(e)=>e.get,To=h(2,(e,t)=>e.modify(()=>[void 0,t])),GW=h(2,(e,t)=>e.modify((r)=>[r,t]));var bD=h(2,(e,t)=>e.modify(t));var ou=h(2,(e,t)=>e.modify((r)=>[void 0,t(r)]));var xS=iu,SS=Ur,KW=GW;var QW=ou;class vS{scheduleDrain;running=!1;tasks=new xD;constructor(e){this.scheduleDrain=e}starveInternal=(e)=>{let t=this.tasks.buckets;this.tasks.buckets=[];for(let[r,i]of t)for(let n=0;n<i.length;n++)i[n]();if(this.tasks.buckets.length===0)this.running=!1;else this.starve(e)};starve(e=0){this.scheduleDrain(e,this.starveInternal)}scheduleTask(e,t){if(this.tasks.scheduleTask(e,t),!this.running)this.running=!0,this.starve()}static cached(e){let t=new vS(e),r=new WeakMap;return(i)=>{if(i===void 0)return t;let n=r.get(i);if(n===void 0)n=new vS(e),r.set(i,n);return n}}}class xD{buckets=[];scheduleTask(e,t){let r=this.buckets.length,i=void 0,n=0;for(;n<r;n++)if(this.buckets[n][0]<=t)i=this.buckets[n];else break;if(i&&i[0]===t)i[1].push(e);else if(n===r)this.buckets.push([t,[e]]);else this.buckets.splice(n,0,[t,[e]])}}class XW{maxNextTickBeforeTimer;getRunner=vS.cached((e,t)=>{if(e>=this.maxNextTickBeforeTimer)setTimeout(()=>t(0),0);else Promise.resolve(void 0).then(()=>t(e+1))});constructor(e){this.maxNextTickBeforeTimer=e}shouldYield(e){return e.currentOpCount>e.getFiberRef(_x)?e.getFiberRef(ns):!1}scheduleTask(e,t,r){this.getRunner(r).scheduleTask(e,t)}}var eZ=Fe(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new XW(2048));class SD{tasks=new xD;deferred=!1;scheduleTask(e,t,r){if(this.deferred)eZ.scheduleTask(e,t,r);else this.tasks.scheduleTask(e,t)}shouldYield(e){return e.currentOpCount>e.getFiberRef(_x)?e.getFiberRef(ns):!1}flush(){while(this.tasks.buckets.length>0){let e=this.tasks.buckets;this.tasks.buckets=[];for(let[t,r]of e)for(let i=0;i<r.length;i++)r[i]()}this.deferred=!0}}var su=Fe(Symbol.for("effect/FiberRef/currentScheduler"),()=>Ut(eZ)),tZ=h(2,(e,t)=>Xt(e,su,t));var wS=Fe(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Ut(new Map));var vD=(e,t,r,i)=>{switch(e){case void 0:return t();case"unbounded":return r();case"inherit":return Br(Dx,(n)=>n==="unbounded"?r():n>1?i(n):t());default:return e>1?i(e):t()}},Af=(e,t,r)=>{switch(e){case void 0:return t();case"unbounded":return r();case"inherit":return Br(Dx,(i)=>i==="unbounded"||i>1?r():t());default:return e>1?r():t()}};var nZ=(e,t)=>({label:e,startTime:t}),wD=(e)=>e.replace(/[\s="]/g,"_"),kD=(e)=>(t)=>`${wD(t.label)}=${e-t.startTime}ms`;var oZ=nZ;var sZ=Wx;var aZ="effect/MetricLabel",ID=Symbol.for(aZ);class cZ{key;value;[ID]=ID;_hash;constructor(e,t){this.key=e,this.value=t,this._hash=lt(aZ+this.key+this.value)}[be](){return this._hash}[he](e){return mfe(e)&&this.key===e.key&&this.value===e.value}pipe(){return ae(this,arguments)}}var au=(e,t)=>new cZ(e,t),mfe=(e)=>pe(e,ID);var uZ=h((e)=>mt(e[0]),function(){let e=arguments;return wr(e[0],Ia,typeof e[1]==="string"?Bi(e[1],e[2]):(t)=>Object.entries(e[1]).reduce((r,[i,n])=>Bi(r,i,n),t))}),Tp=(e)=>W(e,re),lZ=(e)=>Sa(e,re),ED=(e)=>{let t,r=void 0;if(typeof e==="function")t=e;else t=e.try,r=e.catch;return we(()=>{try{return O(Jt(t))}catch(i){return Ge(r?Jt(()=>r(i)):new gf(i,"An unknown error occurred in Effect.try"))}})},pZ=h(3,(e,t,r)=>Ji(e,(i)=>{if(pe(i,t)&&i[t]===r.failure)return r.onFailure(i);return Ge(i)})),dZ=h(2,(e,t)=>vo(e,(r)=>{let i=Fc(r,(n)=>Lm(n)?re(n):H());switch(i._tag){case"None":return tt(r);case"Some":return t(i.value.defect)}})),mZ=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=t(r);switch(i._tag){case"None":return tt(r);case"Some":return i.value}},onSuccess:O})),fZ=h(2,(e,t)=>vo(e,(r)=>{let i=Fc(r,(n)=>Lm(n)?re(n):H());switch(i._tag){case"None":return tt(r);case"Some":{let n=t(i.value.defect);return n._tag==="Some"?n.value:tt(r)}}})),gZ=h((e)=>mt(e[0]),(e,...t)=>{let r=t[t.length-1],i;if(t.length===2)i=Qs(t[0]);else i=(n)=>{let o=pe(n,"_tag")?n._tag:void 0;if(!o)return!1;for(let s=0;s<t.length-1;s++)if(t[s]===o)return!0;return!1};return lf(e,i,r)}),hZ=h(2,(e,t)=>{let r;return lf(e,(i)=>(r??=Object.keys(t),pe(i,"_tag")&&Cm(i._tag)&&r.includes(i._tag)),(i)=>t[i._tag](i))}),yZ=(e)=>pf(e,{onFailure:Ze,onSuccess:()=>Fn}),Eo=HH,bZ=Eo(O),xZ=h(2,(e,t)=>st(JO(t),e)),TS=(e)=>Qe((t,r)=>e({id:t.id(),status:r,interruptors:Hb(t.getFiberRef(Zc))})),SZ=TS((e)=>Jo(e.interruptors)>0?Ix:$e),vZ=TS(O),Ep=(e)=>Df(e,ES,Cf),ffe=(e)=>Df(e,qc(ES,op),([t,r],[i,n])=>[Cf(t,i),Ei(r,n)]),wZ=O({}),kZ=kU(W,E),IZ=wU(W),TZ=vU(W),EZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!1),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>{if(l)return i.push(c),O(!0);return t(c,u)})}return W(o,()=>i)})),CZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!0),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>W(l?t(c,u):O(!1),(p)=>{if(!p)i.push(c);return p}))}return W(o,()=>i)})),PZ=(e)=>W(Bn(),e),CD=(e)=>Bc(e,()=>E(Io(),()=>CD(e))),RZ=h(2,(e,t)=>W(Rr(e,Ze),Hl(t))),AZ=h(3,(e,t,r)=>_f(e,t,(i)=>ha(()=>r(i)))),_Z=h(3,(e,t,r)=>_f(e,t,()=>ga(r))),_f=h(3,(e,t,r)=>E(e,(i)=>t(i)?O(i):r(i))),OZ=h(3,(e,t,r)=>we(()=>t(e)?O(e):Ge(r(e)))),DZ=h((e)=>mt(e[0]),(e,t,r)=>_f(e,t,(i)=>r===void 0?Ge(new Ln):Pi(()=>r(i)))),MZ=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=r.next();if(!i.done)return FZ(r,0,t,i.value);return O(H())})),FZ=(e,t,r,i)=>E(r(i,t),(n)=>{if(n)return O(re(i));let o=e.next();if(!o.done)return FZ(e,t+1,r,o.value);return O(H())}),$Z=(e)=>we(()=>{let t=wc(e);if(!zr(t))return ha(()=>new ff("Received an empty collection of effects"));return v(Yr(t),ta(Pr(t),(r,i)=>Bc(r,()=>i)))}),jZ=h(2,(e,t)=>xa(t(xa(e)))),Of=h(2,(e,t)=>dr(e,{onFailure:(r)=>O(t.onFailure(r)),onSuccess:(r)=>O(t.onSuccess(r))})),NZ=h(2,(e,t)=>we(()=>zZ(e[Symbol.iterator](),0,t))),zZ=(e,t,r)=>{let i=e.next();return i.done?O(!0):E(r(i.value,t),(n)=>n?zZ(e,t+1,r):O(n))},PD=(e)=>{let t=E(E(e,()=>Io()),()=>t);return t},ES=Qe((e)=>O(e.getFiberRefs())),LZ=(e)=>E(e,(t)=>{let i=t[Symbol.iterator]().next();if(i.done)return Ge(new Ln);return O(i.value)}),CS=(e)=>Of(e,{onFailure:ao,onSuccess:ao}),BZ=(e)=>Dt(e,{onFailure:(t)=>AD(t,"An error was silently ignored because it is not anticipated to be useful"),onSuccess:()=>$e}),UZ=(e)=>RS((t,r)=>oW(r,t,e)),qZ=(e)=>Of(e,{onFailure:$o,onSuccess:$i}),JZ=(e)=>Of(e,{onFailure:$i,onSuccess:$o}),RD=(e,t)=>we(()=>{if(t.while(e))return E(t.body(e),(r)=>RD(r,t));return O(e)}),ps=(e)=>(...t)=>{let r=Bo(e),i=void 0;for(let n=0,o=t.length;n<o;n++){let s=t[n];if(f_(s)){if(i!==void 0)i=Vt(i,s);else i=s;t=[...t.slice(0,n),...t.slice(n+1)],n--}}if(i===void 0)i=Fn;return Qe((n)=>(n.log(t,i,r),$e))},HZ=ps(),WZ=ps(aD),AD=ps(sD),ZZ=ps(oD),VZ=ps(iD),GZ=ps(nD),KZ=ps(rD),QZ=h(2,(e,t)=>E(yp,(r)=>wr(e,Ox,ox(oZ(t,r))))),YZ=ei(Ia),XZ=(e,t)=>t.discard?tV(e,t.while,t.step,t.body):W(eV(e,t.while,t.step,t.body),ot),eV=(e,t,r,i)=>we(()=>t(e)?E(i(e),(n)=>W(eV(r(e),t,r,i),ox(n))):q(()=>So())),tV=(e,t,r,i)=>we(()=>t(e)?E(i(e),()=>tV(r(e),t,r,i)):$e),rV=h(3,(e,t,r)=>we(()=>{let i=e[Symbol.iterator](),n=[],o=O(t),s,c=0;while(!(s=i.next()).done){let u=c++,l=s.value;o=E(o,(p)=>W(r(p,l,u),([m,f])=>(n.push(f),m)))}return W(o,(u)=>[u,n])})),Cp=h(2,(e,t)=>Dt(e,{onFailure:(r)=>ya(()=>t(r)),onSuccess:O})),_D=(e)=>v(ri(),E((t)=>v(ffe(e),wo(t),OD,W((r)=>st(r,v(kr(t),E(([i,n])=>kt(qc(cu(i[0]),va(i[1])),n)))))))),nV=(e)=>dr(e,{onFailure:(t)=>O(t),onSuccess:O}),PS=(e)=>W(e,(t)=>!t),iV=(e)=>E(e,(t)=>{switch(t._tag){case"None":return $e;case"Some":return Ge(new Ln)}}),OD=(e)=>W(xS(!0),(t)=>$t(sp(e,KW(t,!1)))),oV=(e)=>dr(e,{onFailure:()=>O(H()),onSuccess:(t)=>O(re(t))}),sV=h(2,(e,t)=>Bc(e,()=>Pi(t))),aV=h(2,(e,t)=>Bc(e,()=>q(t))),cV=(e)=>Dt(e,{onFailure:(t)=>{let r=ot(Jb(t));return r.length===0?tt(t):Ge(r)},onSuccess:O}),cu=(e)=>RS((t,r)=>v(e,rS(t,r))),uV=(e)=>e.length>=1?en((t,r)=>{try{e(r).then((i)=>t(O(i)),(i)=>t(xn(i)))}catch(i){t(xn(i))}}):en((t)=>{try{e().then((r)=>t(O(r)),(r)=>t(xn(r)))}catch(r){t(xn(r))}}),_a=h(3,(e,t,r)=>Ri((i)=>Wi(e,Ot(i,t,r)))),Oa=h(3,(e,t,r)=>Ri((i)=>E(r,(n)=>Wi(e,v(i,Ot(t,n)))))),lV=Hx(O),pV=h(3,(e,t,r)=>ot(e).reduce((i,n,o)=>E(i,(s)=>r(s,n,o)),O(t))),dV=h(3,(e,t,r)=>ot(e).reduceRight((i,n,o)=>E(i,(s)=>r(n,s,o)),O(t))),mV=h(3,(e,t,r)=>E(q(()=>e[Symbol.iterator]()),(i)=>fV(i,0,t,r.while,r.body))),fV=(e,t,r,i,n)=>{let o=e.next();if(!o.done&&i(r))return E(n(r,o.value,t),(s)=>fV(e,t+1,s,i,n));return O(r)},gV=h(2,(e,t)=>we(()=>hV(e,t))),hV=(e,t)=>E(e,(r)=>t<=0?O(r):st(Io(),hV(e,t-1))),yV=(e)=>Dt(e,{onFailure:Ge,onSuccess:O}),bV=(e)=>we(()=>sW(e)),uu=JO,lu=O(H()),xV=(e)=>O(re(e)),Df=h(3,(e,t,r)=>E(t,(i)=>E(e,(n)=>W(t,(o)=>[r(i,o),n])))),SV=h((e)=>mt(e[0]),function(){return DD(arguments[0],typeof arguments[1]==="string"?[au(arguments[1],arguments[2])]:Object.entries(arguments[1]).map(([e,t])=>au(e,t)))}),DD=h(2,(e,t)=>wr(e,is,(r)=>Ni(r,t))),vV=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!1),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>{if(l)return O(!0);return i.push(c),t(c,u)})}return W(o,()=>i)})),wV=h(2,(e,t)=>we(()=>{let r=e[Symbol.iterator](),i=[],n,o=O(!0),s=0;while((n=r.next())&&!n.done){let c=n.value,u=s++;o=E(o,(l)=>v(l?t(c,u):O(!1),W((p)=>{if(p)i.push(c);return p})))}return W(o,()=>i)})),kV=h(2,(e,{onFailure:t,onSuccess:r})=>Dt(e,{onFailure:(i)=>{let n=Wo(i);switch(n._tag){case"Left":return st(t(n.left),tt(i));case"Right":return tt(i)}},onSuccess:(i)=>kt(r(i),i)})),IV=h(2,(e,t)=>vo(e,(r)=>yr(Wq(r),{onNone:()=>tt(r),onSome:(i)=>st(t(i),tt(r))}))),MD=h(2,(e,t)=>Dt(e,{onFailure:(r)=>{let i=Wo(r);switch(i._tag){case"Left":return st(t(i.left),tt(r));case"Right":return tt(r)}},onSuccess:O})),TV=h(3,(e,t,r)=>MD(e,(i)=>{if(Qs(i,t))return r(i);return $e})),EV=h(2,(e,t)=>Dt(e,{onFailure:(r)=>st(t(r),tt(r)),onSuccess:O})),CV=(e)=>FD(e,JH),FD=h(2,(e,t)=>Df(e,t,(r,i)=>Zm(i-r))),gfe=sZ,PV=gfe(O),$D=(e)=>{let t,r=void 0;if(typeof e==="function")t=e;else t=e.try,r=e.catch;let i=(n)=>r?Pi(()=>r(n)):Ge(new gf(n,"An unknown error occurred in Effect.tryPromise"));if(t.length>=1)return en((n,o)=>{try{t(o).then((s)=>n(O(s)),(s)=>n(i(s)))}catch(s){n(i(s))}});return en((n)=>{try{t().then((o)=>n(O(o)),(o)=>n(i(o)))}catch(o){n(i(o))}})},RV=h(2,(e,t)=>E(e,(r)=>ED({try:()=>t.try(r),catch:t.catch}))),AV=h(2,(e,t)=>E(e,(r)=>$D({try:t.try.length>=1?(i)=>t.try(r,i):()=>t.try(r),catch:t.catch}))),_V=h(2,(e,t)=>we(()=>t()?lu:Tp(e))),OV=h(2,(e,t)=>E(t,(r)=>r?lu:Tp(e))),DV=(e)=>Cp(e,Gq),RS=(e)=>Qe((t)=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),$e)),MV=h(3,(e,t,r)=>Xc(e,(i)=>Ot(i,t,r(ca(i,t))))),AS=h(2,(e,t)=>we(()=>t()?W(e,re):O(H()))),FV=h(3,(e,t,r)=>E(ei(t),(i)=>r(i)?W(e,(n)=>[i,re(n)]):O([i,H()]))),$V=h(3,(e,t,r)=>E(SS(t),(i)=>r(i)?W(e,(n)=>[i,re(n)]):O([i,H()]))),jV=h(2,(e,t)=>t(e)),NV=(e,t)=>(...r)=>E(e,(i)=>t(i)(...r)),zV=(e,t)=>(...r)=>W(e,(i)=>t(i)(...r)),jD=(e)=>new Proxy({},{get(t,r,i){return(...n)=>E(e,(o)=>o[r](...n))}}),ND=(e)=>new Proxy({},{get(t,r,i){return E(e,(n)=>mt(n[r])?n[r]:O(n[r]))}}),LV=(e)=>({functions:jD(e),constants:ND(e)}),BV=(e)=>W(Bn(),Ii(e)),zD=(e)=>E(Bn(),Ii(e)),UV=function(){let e=arguments;return CS(E(BD,(t)=>q(()=>{if(typeof e[0]==="string")t.attribute(e[0],e[1]);else for(let r in e[0])t.attribute(r,e[0][r])})))},qV=function(){let e=arguments,t=Array.isArray(e[0])?e[0]:[{_tag:"SpanLink",span:e[0],attributes:e[1]??{}}];return CS(E(LD,(r)=>q(()=>r.addLinks(t))))},JV=h((e)=>mt(e[0]),function(){let e=arguments;return wr(e[0],mf,typeof e[1]==="string"?Bi(e[1],e[2]):(t)=>Object.entries(e[1]).reduce((r,[i,n])=>Bi(r,i,n),t))}),HV=zD(Vi),LD=E(Bn(),(e)=>{let t=e.unsafeMap.get(Vi.key);return t!==void 0&&t._tag==="Span"?O(t):Ge(new Ln)}),BD=E(Bn(),(e)=>{let t=Mf(Ii(e,Vi));return t._tag==="Some"&&t.value._tag==="Span"?O(t.value):Ge(new Ln)}),WV=h((e)=>mt(e[0]),(e,t,r)=>wr(e,Mx,Cb({_tag:"SpanLink",span:t,attributes:r??{}}))),ZV=BigInt(0),Mf=xc((e)=>$n(e.context,gp)?e._tag==="Span"?Mf(e.parent):H():re(e)),_S=(e,t,r)=>{let i=!e.getFiberRef(TO)||r.context&&$n(r.context,gp),n=e.getFiberRef(zn),o=r.parent?re(r.parent):r.root?H():Mf(Ii(n,Vi)),s;if(i)s=rH({name:t,parent:o,context:Ot(r.context??Qn(),gp,!0)});else{let c=e.getFiberRef(er),u=$n(c,as),l=$n(c,WH),p=e.getFiberRef(cp),m=e.getFiberRefs(),f=QO(m,mf),g=QO(m,Mx),S=g._tag==="Some"?r.links!==void 0?[...Si(g.value),...r.links??[]]:Si(g.value):r.links??zi();if(s=u.span(t,o,r.context??Qn(),S,p?l.unsafeCurrentTimeNanos():ZV,r.kind??"internal",r),f._tag==="Some")D2(f.value,(P,D)=>s.attribute(D,P));if(r.attributes!==void 0)Object.entries(r.attributes).forEach(([P,D])=>s.attribute(P,D))}if(typeof r.captureStackTrace==="function")qm.set(s,r.captureStackTrace);return s},VV=(e,t)=>(t=cs(t),Qe((r)=>O(_S(r,e,t)))),GV=ei(mf),KV=ei(Mx),UD=(e,t,r,i)=>q(()=>{if(e.status._tag==="Ended")return;if(EO(t)&&qm.has(e))e.attribute("code.stacktrace",qm.get(e)());e.end(i?r.unsafeCurrentTimeNanos():ZV,t)}),kS=(e,...t)=>{let r=cs(t.length===1?void 0:t[0]),i=t[t.length-1];return Qe((n)=>{let o=_S(n,e,r),s=n.getFiberRef(cp),c=$n(n.getFiberRef(er),ni);return Sn(i(o),(u)=>UD(o,u,c,s))})},IS=h(2,(e,t)=>_a(e,Vi,t)),qD=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],r=cs(e?arguments[2]:arguments[1]);if(e){let i=arguments[0];return kS(t,r,(n)=>IS(i,n))}return(i)=>kS(t,r,(n)=>IS(i,n))},QV=(e)=>function(){let t=e.captureStackTrace??!1;if(e.captureStackTrace!==!1){let r=Error.stackTraceLimit;Error.stackTraceLimit=2;let i=Error();Error.stackTraceLimit=r;let n=!1;t=()=>{if(n!==!1)return n;if(i.stack)return n=i.stack.trim().split(`
|
|
179
179
|
`).slice(2).join(`
|
|
180
180
|
`).trim(),n}}return we(()=>{let r=typeof e.options==="function"?e.options.apply(null,arguments):e.options;return qD(we(()=>Jt(()=>e.body.apply(this,arguments))),r.name,{...r,captureStackTrace:t})})},YV=(e)=>e==null?Ge(new Ln):O(e),XV=(e)=>Ji(W(e,re),(t)=>ZJ(t)?lu:Ge(t));var JD=hf;var eG=lp,tG=pt;var rG=QJ,HD=YJ;var nG=bf;var iG=Yc;var OS=Rt;var oG=dp;var WD="InterruptSignal",ZD="Stateful",VD="Resume",GD="YieldNow",DS=(e)=>({_tag:"InterruptSignal",cause:e}),Rp=(e)=>({_tag:"Stateful",onFiber:e}),pu=(e)=>({_tag:"Resume",effect:e}),sG=()=>({_tag:"YieldNow"});var hfe="effect/FiberScope",MS=Symbol.for(hfe);class cG{[MS]=MS;fiberId=bn;roots=new Set;add(e,t){this.roots.add(t),t.addObserver(()=>{this.roots.delete(t)})}}class uG{fiberId;parent;[MS]=MS;constructor(e,t){this.fiberId=e,this.parent=t}add(e,t){this.parent.tell(Rp((r)=>{r.addChild(t),t.addObserver(()=>{r.removeChild(t)})}))}}var lG=(e)=>new uG(e.id(),e),Gi=Fe(Symbol.for("effect/FiberScope/Global"),()=>new cG);var yfe="effect/Fiber",ds=Symbol.for(yfe),Ap={_E:(e)=>e,_A:(e)=>e},$S={[ds]:Ap,pipe(){return ae(this,arguments)}},bfe="effect/Fiber",$f=Symbol.for(bfe),pG=v(HU(Zi,Zi),wb((e)=>[e.id().startTimeMillis,e.id().id])),dG=(e)=>pe(e,ds),Ff=(e)=>($f in e),jS=(e)=>e.await,mG=(e)=>e.children,du=(e)=>({...xi,commit(){return Ar(this)},...$S,id:()=>bn,await:O(e),children:O([]),inheritAll:$e,poll:O(re(e)),interruptAsFork:()=>$e}),NS=(e)=>W(e.status,(t)=>({id:e.id(),status:t})),fG=(e)=>Rr(e,NS),gG=(e)=>du(eG(e)),QD=(e)=>du(tG(e)),hG=(e)=>W(Pt(e),du),yG=(e)=>e.id(),zS=(e)=>e.inheritAll,bG=(e)=>du(nG(e)),xG=(e)=>E(es,(t)=>v(e,jf(t))),jf=h(2,ap(function*(e,t){for(let r of e){if(Ff(r)){r.unsafeInterruptAsFork(t);continue}yield*r.interruptAsFork(t)}for(let r of e){if(Ff(r)&&r.unsafePoll())continue;yield*r.await}})),LS=h(2,(e,t)=>e.interruptAsFork(t)),Ar=(e)=>Jc(tn(e.await),e.inheritAll),FS=h(2,(e,t)=>YD(e,(r)=>q(()=>t(r)))),YD=h(2,(e,t)=>({...xi,commit(){return Ar(this)},...$S,id:()=>e.id(),await:E(e.await,HD(t)),children:e.children,inheritAll:e.inheritAll,poll:E(e.poll,(i)=>{switch(i._tag){case"None":return O(H());case"Some":return v(HD(i.value,t),W(re))}}),interruptAsFork:(i)=>e.interruptAsFork(i)})),SG=h(2,(e,t)=>W(e.await,iG({onFailure:(r)=>QD(r),onSuccess:(r)=>t(r)}))),vG=h(2,(e,{onFiber:t,onRuntimeFiber:r})=>{if(Ff(e))return r(e);return t(e)}),xfe={...xi,commit(){return Ar(this)},...$S,id:()=>bn,await:Hc,children:O([]),inheritAll:Hc,poll:O(H()),interruptAsFork:()=>Hc},wG=xfe,XD=h(2,(e,t)=>({...xi,commit(){return Ar(this)},...$S,id:()=>rx(e.id(),t.id()),await:Xn(e.await,t.await,(r,i)=>JD(r)?r:i),children:e.children,inheritAll:st(t.inheritAll,e.inheritAll),poll:Xn(e.poll,t.poll,(r,i)=>{switch(r._tag){case"None":return H();case"Some":return JD(r.value)?r:i}}),interruptAsFork:(r)=>v(rn(e,r),st(v(t,rn(r))),$t)})),kG=h(2,(e,t)=>XD(FS(e,Mn),FS(t,Nr))),IG=(e)=>e.poll,Sfe=(e)=>{let t=e>0?Math.floor:Math.ceil;return{days:t(e/86400000),hours:t(e/3600000)%24,minutes:t(e/60000)%60,seconds:t(e/1000)%60,milliseconds:t(e)%1000,microseconds:t(e*1000)%1000,nanoseconds:t(e*1e6)%1000}},vfe=(e)=>{if(sS(e))return"Done";if(PW(e))return"Running";return`Suspended(${qi(e.runtimeFlags)?"interruptible":"uninterruptible"})`},TG=(e)=>E(yp,(t)=>W(NS(e),(r)=>{let i=t-r.id.startTimeMillis,{days:n,hours:o,milliseconds:s,minutes:c,seconds:u}=Sfe(i),l=(n===0?"":`${n}d`)+(n===0&&o===0?"":`${o}h`)+(n===0&&o===0&&c===0?"":`${c}m`)+(n===0&&o===0&&c===0&&u===0?"":`${u}s`)+`${s}ms`,p=RW(r.status)?(()=>{let f=F_(r.status.blockingOn);return Jo(f)>0?"waiting on "+Array.from(f).map((g)=>`${g}`).join(", "):""})():"",m=vfe(r.status);return`[Fiber](#${r.id.id}) (${l}) ${p}
|
|
181
|
-
Status: ${m}`})),e0=()=>Array.from(Gi.roots),EG=q(e0),CG=(e)=>e.status,t0=(e)=>du(OS(e)),PG=t0(void 0);var ms="effect/FiberCurrent",RG=()=>Bo(globalThis[ms]);var wfe="effect/Logger",AG=Symbol.for(wfe),_G={_Message:(e)=>e,_Output:(e)=>e},BS=(e)=>({[AG]:_G,log:e,pipe(){return ae(this,arguments)}});var yJe={[AG]:_G,log:ao,pipe(){return ae(this,arguments)}};var kfe=/^[^\s"=]*$/,Ife=(e,t)=>({annotations:r,cause:i,date:n,fiberId:o,logLevel:s,message:c,spans:u})=>{let l=(S)=>S.match(kfe)?S:e(S),p=(S,P)=>`${wD(S)}=${l(P)}`,m=(S,P)=>" "+p(S,P),f=p("timestamp",n.toISOString());f+=m("level",s.label),f+=m("fiber",tx(o));let g=KU(c);for(let S=0;S<g.length;S++)f+=m("message",No(g[S],t));if(!Jq(i))f+=m("cause",Zo(i,{renderErrorCause:!0}));for(let S of u)f+=" "+kD(n.getTime())(S);for(let[S,P]of r)f+=m(S,No(P,t));return f},Tfe=(e)=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,OG=BS(Ife(Tfe));var mu={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},bJe={None:[],All:[],Trace:[mu.gray],Debug:[mu.blue],Info:[mu.green],Warning:[mu.yellow],Error:[mu.red],Fatal:[mu.bgBrightRed,mu.black]};var DG=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,xJe=DG&&process.stdout.isTTY===!0,SJe=DG||"Deno"in globalThis;var MG="effect/MetricBoundaries",n0=Symbol.for(MG);class FG{values;[n0]=n0;constructor(e){this.values=e,this._hash=v(lt(MG),Re(Dn(this.values)))}_hash;[be](){return this._hash}[he](e){return Cfe(e)&&le(this.values,e.values)}pipe(){return ae(this,arguments)}}var Cfe=(e)=>pe(e,n0),Pfe=(e)=>{let t=v(e,qA(Zt(Number.POSITIVE_INFINITY)),KA);return new FG(t)};var $G=(e)=>v(UA(e.count-1,(t)=>e.start*Math.pow(e.factor,t)),$m,Pfe);var Afe="effect/MetricKeyType",Nf=Symbol.for(Afe),jG="effect/MetricKeyType/Counter",i0=Symbol.for(jG),NG="effect/MetricKeyType/Frequency",o0=Symbol.for(NG),zG="effect/MetricKeyType/Gauge",s0=Symbol.for(zG),LG="effect/MetricKeyType/Histogram",a0=Symbol.for(LG),BG="effect/MetricKeyType/Summary",c0=Symbol.for(BG),zf={_In:(e)=>e,_Out:(e)=>e};class UG{incremental;bigint;[Nf]=zf;[i0]=i0;constructor(e,t){this.incremental=e,this.bigint=t,this._hash=lt(jG)}_hash;[be](){return this._hash}[he](e){return u0(e)}pipe(){return ae(this,arguments)}}var _fe=lt(NG);class Ofe{preregisteredWords;[Nf]=zf;[o0]=o0;constructor(e){this.preregisteredWords=e}[be](){return _fe}[he](e){return l0(e)}pipe(){return ae(this,arguments)}}var Dfe=lt(zG);class Mfe{bigint;[Nf]=zf;[s0]=s0;constructor(e){this.bigint=e}[be](){return Dfe}[he](e){return p0(e)}pipe(){return ae(this,arguments)}}class qG{boundaries;[Nf]=zf;[a0]=a0;constructor(e){this.boundaries=e,this._hash=v(lt(LG),Re(ue(this.boundaries)))}_hash;[be](){return this._hash}[he](e){return d0(e)&&le(this.boundaries,e.boundaries)}pipe(){return ae(this,arguments)}}class Ffe{maxAge;maxSize;error;quantiles;[Nf]=zf;[c0]=c0;constructor(e,t,r,i){this.maxAge=e,this.maxSize=t,this.error=r,this.quantiles=i,this._hash=v(lt(BG),Re(ue(this.maxAge)),Re(ue(this.maxSize)),Re(ue(this.error)),Re(Dn(this.quantiles)))}_hash;[be](){return this._hash}[he](e){return m0(e)&&le(this.maxAge,e.maxAge)&&this.maxSize===e.maxSize&&this.error===e.error&&le(this.quantiles,e.quantiles)}pipe(){return ae(this,arguments)}}var JG=(e)=>new UG(e?.incremental??!1,e?.bigint??!1);var HG=(e)=>new qG(e);var u0=(e)=>pe(e,i0),l0=(e)=>pe(e,o0),p0=(e)=>pe(e,s0),d0=(e)=>pe(e,a0),m0=(e)=>pe(e,c0);var $fe="effect/MetricKey",ZG=Symbol.for($fe),jfe={_Type:(e)=>e},Nfe=Wl(le);class US{name;keyType;description;tags;[ZG]=jfe;constructor(e,t,r,i=[]){this.name=e,this.keyType=t,this.description=r,this.tags=i,this._hash=v(lt(this.name+this.description),Re(ue(this.keyType)),Re(Dn(this.tags)))}_hash;[be](){return this._hash}[he](e){return zfe(e)&&this.name===e.name&&le(this.keyType,e.keyType)&&le(this.description,e.description)&&Nfe(this.tags,e.tags)}pipe(){return ae(this,arguments)}}var zfe=(e)=>pe(e,ZG),VG=(e,t)=>new US(e,JG(t),Bo(t?.description));var GG=(e,t,r)=>new US(e,HG(t),Bo(r));var KG=h(2,(e,t)=>t.length===0?e:new US(e.name,e.keyType,e.description,Ni(e.tags,t)));var QG=Symbol.for("effect/MutableHashMap"),Bfe={[QG]:QG,[Symbol.iterator](){return new f0(this)},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}};class f0{self;referentialIterator;bucketIterator;constructor(e){this.self=e,this.referentialIterator=e.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();let e=this.referentialIterator.next();if(e.done)return this.bucketIterator=new YG(this.self.buckets.values()),this.next();return e}[Symbol.iterator](){return new f0(this.self)}}class YG{backing;constructor(e){this.backing=e}currentBucket;next(){if(this.currentBucket===void 0){let t=this.backing.next();if(t.done)return t;this.currentBucket=t.value[Symbol.iterator]()}let e=this.currentBucket.next();if(e.done)return this.currentBucket=void 0,this.next();return e}}var fu=()=>{let e=Object.create(Bfe);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e};var sr=h(2,(e,t)=>{if(Fl(t)===!1)return e.referential.has(t)?re(e.referential.get(t)):H();let r=t[be](),i=e.buckets.get(r);if(i===void 0)return H();return Ufe(e,i,t)});var Ufe=(e,t,r,i=!1)=>{for(let n=0,o=t.length;n<o;n++)if(r[he](t[n][0])){let s=t[n][1];if(i)t.splice(n,1),e.bucketsSize--;return re(s)}return H()},Ki=h(2,(e,t)=>Bt(sr(e,t))),Un=h(3,(e,t,r)=>{if(Fl(t)===!1)return e.referential.set(t,r),e;let i=t[be](),n=e.buckets.get(i);if(n===void 0)return e.buckets.set(i,[[t,r]]),e.bucketsSize++,e;return XG(e,n,t),n.push([t,r]),e.bucketsSize++,e}),XG=(e,t,r)=>{for(let i=0,n=t.length;i<n;i++)if(r[he](t[i][0])){t.splice(i,1),e.bucketsSize--;return}};var gu=h(2,(e,t)=>{if(Fl(t)===!1)return e.referential.delete(t),e;let r=t[be](),i=e.buckets.get(r);if(i===void 0)return e;if(XG(e,i,t),i.length===0)e.buckets.delete(r);return e});var qS=(e)=>e.referential.size+e.bucketsSize;var qfe="effect/MetricState",Lf=Symbol.for(qfe),e6="effect/MetricState/Counter",h0=Symbol.for(e6),t6="effect/MetricState/Frequency",y0=Symbol.for(t6),r6="effect/MetricState/Gauge",b0=Symbol.for(r6),n6="effect/MetricState/Histogram",x0=Symbol.for(n6),i6="effect/MetricState/Summary",S0=Symbol.for(i6),Bf={_A:(e)=>e};class o6{count;[Lf]=Bf;[h0]=h0;constructor(e){this.count=e}[be](){return v(ue(e6),Re(ue(this.count)),Ue(this))}[he](e){return Hfe(e)&&this.count===e.count}pipe(){return ae(this,arguments)}}var Jfe=Wl(le);class s6{occurrences;[Lf]=Bf;[y0]=y0;constructor(e){this.occurrences=e}_hash;[be](){return v(lt(t6),Re(Dn(ot(this.occurrences.entries()))),Ue(this))}[he](e){return Wfe(e)&&Jfe(ot(this.occurrences.entries()),ot(e.occurrences.entries()))}pipe(){return ae(this,arguments)}}class a6{value;[Lf]=Bf;[b0]=b0;constructor(e){this.value=e}[be](){return v(ue(r6),Re(ue(this.value)),Ue(this))}[he](e){return Zfe(e)&&this.value===e.value}pipe(){return ae(this,arguments)}}class c6{buckets;count;min;max;sum;[Lf]=Bf;[x0]=x0;constructor(e,t,r,i,n){this.buckets=e,this.count=t,this.min=r,this.max=i,this.sum=n}[be](){return v(ue(n6),Re(ue(this.buckets)),Re(ue(this.count)),Re(ue(this.min)),Re(ue(this.max)),Re(ue(this.sum)),Ue(this))}[he](e){return Vfe(e)&&le(this.buckets,e.buckets)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return ae(this,arguments)}}class u6{error;quantiles;count;min;max;sum;[Lf]=Bf;[S0]=S0;constructor(e,t,r,i,n,o){this.error=e,this.quantiles=t,this.count=r,this.min=i,this.max=n,this.sum=o}[be](){return v(ue(i6),Re(ue(this.error)),Re(ue(this.quantiles)),Re(ue(this.count)),Re(ue(this.min)),Re(ue(this.max)),Re(ue(this.sum)),Ue(this))}[he](e){return Gfe(e)&&this.error===e.error&&le(this.quantiles,e.quantiles)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return ae(this,arguments)}}var l6=(e)=>new o6(e),p6=(e)=>new s6(e),d6=(e)=>new a6(e),m6=(e)=>new c6(e.buckets,e.count,e.min,e.max,e.sum),f6=(e)=>new u6(e.error,e.quantiles,e.count,e.min,e.max,e.sum);var Hfe=(e)=>pe(e,h0),Wfe=(e)=>pe(e,y0),Zfe=(e)=>pe(e,b0),Vfe=(e)=>pe(e,x0),Gfe=(e)=>pe(e,S0);var Qfe="effect/MetricHook",Yfe=Symbol.for(Qfe),Xfe={_In:(e)=>e,_Out:(e)=>e},Uf=(e)=>({[Yfe]:Xfe,pipe(){return ae(this,arguments)},...e});var g6=BigInt(0),y6=(e)=>{let t=e.keyType.bigint?g6:0,r=e.keyType.incremental?e.keyType.bigint?(n)=>n>=g6:(n)=>n>=0:(n)=>!0,i=(n)=>{if(r(n))t=t+n};return Uf({get:()=>l6(t),update:i,modify:i})},b6=(e)=>{let t=new Map;for(let i of e.keyType.preregisteredWords)t.set(i,0);let r=(i)=>{let n=t.get(i)??0;t.set(i,n+1)};return Uf({get:()=>p6(t),update:r,modify:r})},x6=(e,t)=>{let r=t;return Uf({get:()=>d6(r),update:(i)=>{r=i},modify:(i)=>{r=r+i}})},S6=(e)=>{let t=e.keyType.boundaries.values,r=t.length,i=new Uint32Array(r+1),n=new Float64Array(r),o=0,s=0,c=Number.MAX_VALUE,u=Number.MIN_VALUE;v(t,Sc(Zi),lo((m,f)=>{n[f]=m}));let l=(m)=>{let f=0,g=r;while(f!==g){let S=Math.floor(f+(g-f)/2),P=n[S];if(m<=P)g=S;else f=S;if(g===f+1)if(m<=n[f])g=f;else f=g}if(i[f]=i[f]+1,o=o+1,s=s+m,m<c)c=m;if(m>u)u=m},p=()=>{let m=Mm(r),f=0;for(let g=0;g<r;g++){let S=n[g],P=i[g];f=f+P,m[g]=[S,f]}return m};return Uf({get:()=>m6({buckets:p(),count:o,min:c,max:u,sum:s}),update:l,modify:l})},v6=(e)=>{let{error:t,maxAge:r,maxSize:i,quantiles:n}=e.keyType,o=v(n,Sc(Zi)),s=Mm(i),c=0,u=0,l=0,p=0,m=0,f=(S)=>{let P=[],D=0;while(D!==i-1){let L=s[D];if(L!=null){let[Se,Q]=L,se=ua(S-Se);if(__(se,la)&&y2(se,r))P.push(Q)}D=D+1}return ege(t,o,Sc(P,Zi))},g=(S,P)=>{if(i>0){c=c+1;let D=c%i;s[D]=[P,S]}p=u===0?S:Math.min(p,S),m=u===0?S:Math.max(m,S),u=u+1,l=l+S};return Uf({get:()=>f6({error:t,quantiles:f(Date.now()),count:u,min:p,max:m,sum:l}),update:([S,P])=>g(S,P),modify:([S,P])=>g(S,P)})},ege=(e,t,r)=>{let i=r.length;if(!Qr(t))return zi();let n=t[0],o=t.slice(1),s=h6(e,i,H(),0,n,r),c=gn(s);return o.forEach((u)=>{c.push(h6(e,i,s.value,s.consumed,u,s.rest))}),lo(c,(u)=>[u.quantile,u.value])},h6=(e,t,r,i,n,o)=>{let s=e,c=t,u=r,l=i,p=n,m=o,f=e,g=t,S=r,P=i,D=n,L=o;while(!0){if(!Qr(m))return{quantile:p,value:H(),consumed:l,rest:[]};if(p===1)return{quantile:p,value:re(HA(m)),consumed:l+m.length,rest:[]};let Se=Er(m),Q=eq(m,(Te)=>Te===Se),se=p*c,me=s/2*se,F=l+Q[0].length,Be=Math.abs(F-se);if(F<se-me){f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}if(F>se+me){let Te=Ft(u)?re(Se):u;return{quantile:p,value:Te,consumed:l,rest:m}}switch(u._tag){case"None":{f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}case"Some":{let Te=Math.abs(se-u.value);if(Be<Te){f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}return{quantile:p,value:re(u.value),consumed:l,rest:m}}}}throw Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")};var rge="effect/MetricPair",nge=Symbol.for(rge),ige={_Type:(e)=>e};var w6=(e,t)=>({[nge]:ige,metricKey:e,metricState:t,pipe(){return ae(this,arguments)}});var sge="effect/MetricRegistry",k6=Symbol.for(sge);class I6{[k6]=k6;map=fu();snapshot(){let e=[];for(let[t,r]of this.map)e.push(w6(t,r.get()));return e}get(e){let t=v(this.map,sr(e),Kr);if(t==null){if(u0(e.keyType))return this.getCounter(e);if(p0(e.keyType))return this.getGauge(e);if(l0(e.keyType))return this.getFrequency(e);if(d0(e.keyType))return this.getHistogram(e);if(m0(e.keyType))return this.getSummary(e);throw Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}else return t}getCounter(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=y6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getFrequency(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=b6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getGauge(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=x6(e,e.keyType.bigint?BigInt(0):0);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getHistogram(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=S6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getSummary(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=v6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}}var T6=()=>new I6;var cge="effect/Metric",uge=Symbol.for(cge),lge={_Type:(e)=>e,_In:(e)=>e,_Out:(e)=>e},E6=Fe(Symbol.for("effect/Metric/globalMetricRegistry"),()=>T6()),C6=function(e,t,r,i){let n=Object.assign((o)=>Hi(o,(s)=>dge(n,s)),{[uge]:lge,keyType:e,unsafeUpdate:t,unsafeValue:r,unsafeModify:i,register(){return this.unsafeValue([]),this},pipe(){return ae(this,arguments)}});return n};var qf=(e,t)=>P6(VG(e,t));var P6=(e)=>{let t,r=new WeakMap,i=(n)=>{if(n.length===0){if(t!==void 0)return t;return t=E6.get(e),t}let o=r.get(n);if(o!==void 0)return o;return o=E6.get(KG(e,n)),r.set(n,o),o};return C6(e.keyType,(n,o)=>i(o).update(n),(n)=>i(n).get(),(n,o)=>i(o).modify(n))};var R6=(e,t,r)=>P6(GG(e,t,r));var A6=h(3,(e,t,r)=>pge(e,[au(t,r)]));var pge=h(2,(e,t)=>C6(e.keyType,(r,i)=>e.unsafeUpdate(r,Ni(t,i)),(r)=>e.unsafeValue(Ni(t,r)),(r,i)=>e.unsafeModify(r,Ni(t,i))));var dge=h(2,(e,t)=>Br(is,(r)=>q(()=>e.unsafeUpdate(t,r))));var fge="effect/Request",v0=Symbol.for(fge),gge={_E:(e)=>e,_A:(e)=>e},YJe={...Bl,[v0]:gge},_6=(e)=>pe(e,v0);var w0=h(2,(e,t)=>Br(wS,(r)=>q(()=>{if(r.has(e)){let i=r.get(e);if(!i.state.completed)i.state.completed=!0,wf(i.result,t)}})));class Jf{count=0;observers=new Set;interrupted=!1;addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}increment(){this.count++,this.observers.forEach((e)=>e(this.count))}decrement(){this.count--,this.observers.forEach((e)=>e(this.count))}}var Da={Forward:0,Backward:1};class Hf{self;stack;direction;count=0;constructor(e,t,r){this.self=e,this.stack=t,this.direction=r}clone(){return new Hf(this.self,this.stack.slice(),this.direction)}reversed(){return new Hf(this.self,this.stack.slice(),this.direction===Da.Forward?Da.Backward:Da.Forward)}next(){let e=this.entry;if(this.count++,this.direction===Da.Forward)this.moveNext();else this.movePrev();switch(e._tag){case"None":return{done:!0,value:this.count};case"Some":return{done:!1,value:e.value}}}get key(){if(this.stack.length>0)return re(this.stack[this.stack.length-1].key);return H()}get value(){if(this.stack.length>0)return re(this.stack[this.stack.length-1].value);return H()}get entry(){return Gn(Ib(this.stack),(e)=>[e.key,e.value])}get index(){let e=0,t=this.stack;if(t.length===0){let r=this.self._root;if(r!=null)return r.count;return 0}else if(t[t.length-1].left!=null)e=t[t.length-1].left.count;for(let r=t.length-2;r>=0;--r)if(t[r+1]===t[r].right){if(++e,t[r].left!=null)e+=t[r].left.count}return e}moveNext(){let e=this.stack;if(e.length===0)return;let t=e[e.length-1];if(t.right!=null){t=t.right;while(t!=null)e.push(t),t=t.left}else{e.pop();while(e.length>0&&e[e.length-1].right===t)t=e[e.length-1],e.pop()}}get hasNext(){let e=this.stack;if(e.length===0)return!1;if(e[e.length-1].right!=null)return!0;for(let t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}movePrev(){let e=this.stack;if(e.length===0)return;let t=e[e.length-1];if(t!=null&&t.left!=null){t=t.left;while(t!=null)e.push(t),t=t.right}else{e.pop();while(e.length>0&&e[e.length-1].left===t)t=e[e.length-1],e.pop()}}get hasPrev(){let e=this.stack;if(e.length===0)return!1;if(e[e.length-1].left!=null)return!0;for(let t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}}var Ae={Red:0,Black:1},Qi=({color:e,count:t,key:r,left:i,right:n,value:o})=>({color:e,key:r,value:o,left:i,right:n,count:t});function k0(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e.color=t.color,e.count=t.count}var fs=({count:e,key:t,left:r,right:i,value:n},o)=>({color:o,key:t,value:n,left:r,right:i,count:e}),jt=(e)=>{e.count=1+(e.left?.count??0)+(e.right?.count??0)};var O6="effect/RedBlackTree",I0=Symbol.for(O6),bge={_Key:(e)=>e,_Value:(e)=>e},xge={[I0]:bge,[be](){let e=ue(O6);for(let t of this)e^=v(ue(t[0]),Re(ue(t[1])));return Ue(this,e)},[he](e){if(D6(e)){if((this._root?.count??0)!==(e._root?.count??0))return!1;let t=Array.from(e);return Array.from(this).every((r,i)=>{let n=t[i];return le(r[0],n[0])&&le(r[1],n[1])})}return!1},[Symbol.iterator](){let e=[],t=this._root;while(t!=null)e.push(t),t=t.left;return new Hf(this,e,Da.Forward)},toString(){return it(this.toJSON())},toJSON(){return{_id:"RedBlackTree",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Wf=(e,t)=>{let r=Object.create(xge);return r._ord=e,r._root=t,r},D6=(e)=>pe(e,I0);var M6=h(2,(e,t)=>{let{_ord:r,_root:i}=e;while(i!==void 0){let n=r(t,i.key);if(le(t,i.key))return re(i.value);if(n<=0)i=i.left;else i=i.right}return H()});var T0=h(2,(e,t)=>Bt(M6(e,t))),F6=h(3,(e,t,r)=>{let{_ord:i,_root:n}=e,o=[],s=[];while(n!=null){let c=i(t,n.key);if(o.push(n),s.push(c),c<=0)n=n.left;else n=n.right}o.push({color:Ae.Red,key:t,value:r,left:void 0,right:void 0,count:1});for(let c=o.length-2;c>=0;--c){let u=o[c];if(s[c]<=0)o[c]={color:u.color,key:u.key,value:u.value,left:o[c+1],right:u.right,count:u.count+1};else o[c]={color:u.color,key:u.key,value:u.value,left:u.left,right:o[c+1],count:u.count+1}}for(let c=o.length-1;c>1;--c){let u=o[c-1],l=o[c];if(u.color===Ae.Black||l.color===Ae.Black)break;let p=o[c-2];if(p.left===u)if(u.left===l){let m=p.right;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.right=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(p.color=Ae.Red,p.left=u.right,u.color=Ae.Black,u.right=p,o[c-2]=u,o[c-1]=l,jt(p),jt(u),c>=3){let f=o[c-3];if(f.left===p)f.left=u;else f.right=u}break}}else{let m=p.right;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.right=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(u.right=l.left,p.color=Ae.Red,p.left=l.right,l.color=Ae.Black,l.left=u,l.right=p,o[c-2]=l,o[c-1]=u,jt(p),jt(u),jt(l),c>=3){let f=o[c-3];if(f.left===p)f.left=l;else f.right=l}break}}else if(u.right===l){let m=p.left;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.left=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(p.color=Ae.Red,p.right=u.left,u.color=Ae.Black,u.left=p,o[c-2]=u,o[c-1]=l,jt(p),jt(u),c>=3){let f=o[c-3];if(f.right===p)f.right=u;else f.left=u}break}}else{let m=p.left;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.left=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(u.left=l.right,p.color=Ae.Red,p.right=l.left,l.color=Ae.Black,l.right=u,l.left=p,o[c-2]=l,o[c-1]=u,jt(p),jt(u),jt(l),c>=3){let f=o[c-3];if(f.right===p)f.right=l;else f.left=l}break}}}return o[0].color=Ae.Black,Wf(e._ord,o[0])}),$6=(e)=>j6(e,Da.Forward);var j6=(e,t)=>{let r=e[Symbol.iterator](),i=0;return{[Symbol.iterator]:()=>j6(e,t),next:()=>{i++;let n=r.key;if(t===Da.Forward)r.moveNext();else r.movePrev();switch(n._tag){case"None":return{done:!0,value:i};case"Some":return{done:!1,value:n.value}}}}};var N6=h(2,(e,t)=>{if(!T0(e,t))return e;let r=e._ord,i=r,n=e._root,o=[];while(n!==void 0){let u=i(t,n.key);if(o.push(n),le(t,n.key))n=void 0;else if(u<=0)n=n.left;else n=n.right}if(o.length===0)return e;let s=Array(o.length),c=o[o.length-1];s[s.length-1]={color:c.color,key:c.key,value:c.value,left:c.left,right:c.right,count:c.count};for(let u=o.length-2;u>=0;--u)if(c=o[u],c.left===o[u+1])s[u]={color:c.color,key:c.key,value:c.value,left:s[u+1],right:c.right,count:c.count};else s[u]={color:c.color,key:c.key,value:c.value,left:c.left,right:s[u+1],count:c.count};if(c=s[s.length-1],c.left!==void 0&&c.right!==void 0){let u=s.length;c=c.left;while(c.right!=null)s.push(c),c=c.right;let l=s[u-1];s.push({color:c.color,key:l.key,value:l.value,left:c.left,right:c.right,count:c.count}),s[u-1].key=c.key,s[u-1].value=c.value;for(let p=s.length-2;p>=u;--p)c=s[p],s[p]={color:c.color,key:c.key,value:c.value,left:c.left,right:s[p+1],count:c.count};s[u-1].left=s[u]}if(c=s[s.length-1],c.color===Ae.Red){let u=s[s.length-2];if(u.left===c)u.left=void 0;else if(u.right===c)u.right=void 0;s.pop();for(let l=0;l<s.length;++l)s[l].count--;return Wf(r,s[0])}else if(c.left!==void 0||c.right!==void 0){if(c.left!==void 0)k0(c,c.left);else if(c.right!==void 0)k0(c,c.right);c.color=Ae.Black;for(let u=0;u<s.length-1;++u)s[u].count--;return Wf(r,s[0])}else if(s.length===1)return Wf(r,void 0);else{for(let l=0;l<s.length;++l)s[l].count--;let u=s[s.length-2];if(Sge(s),u.left===c)u.left=void 0;else u.right=void 0}return Wf(r,s[0])});var Sge=(e)=>{let t,r,i,n;for(let o=e.length-1;o>=0;--o){if(t=e[o],o===0){t.color=Ae.Black;return}if(r=e[o-1],r.left===t){if(i=r.right,i!==void 0&&i.right!==void 0&&i.right.color===Ae.Red){if(i=r.right=Qi(i),n=i.right=Qi(i.right),r.right=i.left,i.left=r,i.right=n,i.color=r.color,t.color=Ae.Black,r.color=Ae.Black,n.color=Ae.Black,jt(r),jt(i),o>1){let s=e[o-2];if(s.left===r)s.left=i;else s.right=i}e[o-1]=i;return}else if(i!==void 0&&i.left!==void 0&&i.left.color===Ae.Red){if(i=r.right=Qi(i),n=i.left=Qi(i.left),r.right=n.left,i.left=n.right,n.left=r,n.right=i,n.color=r.color,r.color=Ae.Black,i.color=Ae.Black,t.color=Ae.Black,jt(r),jt(i),jt(n),o>1){let s=e[o-2];if(s.left===r)s.left=n;else s.right=n}e[o-1]=n;return}if(i!==void 0&&i.color===Ae.Black)if(r.color===Ae.Red){r.color=Ae.Black,r.right=fs(i,Ae.Red);return}else{r.right=fs(i,Ae.Red);continue}else if(i!==void 0){if(i=Qi(i),r.right=i.left,i.left=r,i.color=r.color,r.color=Ae.Red,jt(r),jt(i),o>1){let s=e[o-2];if(s.left===r)s.left=i;else s.right=i}if(e[o-1]=i,e[o]=r,o+1<e.length)e[o+1]=t;else e.push(t);o=o+2}}else{if(i=r.left,i!==void 0&&i.left!==void 0&&i.left.color===Ae.Red){if(i=r.left=Qi(i),n=i.left=Qi(i.left),r.left=i.right,i.right=r,i.left=n,i.color=r.color,t.color=Ae.Black,r.color=Ae.Black,n.color=Ae.Black,jt(r),jt(i),o>1){let s=e[o-2];if(s.right===r)s.right=i;else s.left=i}e[o-1]=i;return}else if(i!==void 0&&i.right!==void 0&&i.right.color===Ae.Red){if(i=r.left=Qi(i),n=i.right=Qi(i.right),r.left=n.right,i.right=n.left,n.right=r,n.left=i,n.color=r.color,r.color=Ae.Black,i.color=Ae.Black,t.color=Ae.Black,jt(r),jt(i),jt(n),o>1){let s=e[o-2];if(s.right===r)s.right=n;else s.left=n}e[o-1]=n;return}if(i!==void 0&&i.color===Ae.Black)if(r.color===Ae.Red){r.color=Ae.Black,r.left=fs(i,Ae.Red);return}else{r.left=fs(i,Ae.Red);continue}else if(i!==void 0){if(i=Qi(i),r.left=i.right,i.right=r,i.color=r.color,r.color=Ae.Red,jt(r),jt(i),o>1){let s=e[o-2];if(s.right===r)s.right=i;else s.left=i}if(e[o-1]=i,e[o]=r,o+1<e.length)e[o+1]=t;else e.push(t);o=o+2}}}};var z6=T0,L6=F6,B6=$6;var U6=N6;var E0=Symbol.for("effect/SortedSet"),kge={[E0]:{_A:(e)=>e},[be](){return v(ue(this.keyTree),Re(ue(E0)),Ue(this))},[he](e){return Ige(e)&&le(this.keyTree,e.keyTree)},[Symbol.iterator](){return B6(this.keyTree)},toString(){return it(this.toJSON())},toJSON(){return{_id:"SortedSet",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},q6=(e)=>{let t=Object.create(kge);return t.keyTree=e,t},Ige=(e)=>pe(e,E0);var J6=h(2,(e,t)=>z6(e.keyTree,t)?e:q6(L6(e.keyTree,t,!0)));var H6=h(2,(e,t)=>q6(U6(e.keyTree,t)));var Ege="effect/Supervisor",_p=Symbol.for(Ege),Zf={_T:(e)=>e};class Op{underlying;value0;[_p]=Zf;constructor(e,t){this.underlying=e,this.value0=t}get value(){return this.value0}onStart(e,t,r,i){this.underlying.onStart(e,t,r,i)}onEnd(e,t){this.underlying.onEnd(e,t)}onEffect(e,t){this.underlying.onEffect(e,t)}onSuspend(e){this.underlying.onSuspend(e)}onResume(e){this.underlying.onResume(e)}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}}class Dp{left;right;_tag="Zip";[_p]=Zf;constructor(e,t){this.left=e,this.right=t}get value(){return qc(this.left.value,this.right.value)}onStart(e,t,r,i){this.left.onStart(e,t,r,i),this.right.onStart(e,t,r,i)}onEnd(e,t){this.left.onEnd(e,t),this.right.onEnd(e,t)}onEffect(e,t){this.left.onEffect(e,t),this.right.onEffect(e,t)}onSuspend(e){this.left.onSuspend(e),this.right.onSuspend(e)}onResume(e){this.left.onResume(e),this.right.onResume(e)}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}}var C0=(e)=>pe(e,_p)&&Qs(e,"Zip");class W6{[_p]=Zf;fibers=new Set;get value(){return q(()=>Array.from(this.fibers))}onStart(e,t,r,i){this.fibers.add(i)}onEnd(e,t){this.fibers.delete(t)}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}class Z6{effect;[_p]=Zf;constructor(e){this.effect=e}get value(){return this.effect}onStart(e,t,r,i){}onEnd(e,t){}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}class Cge{ref;[_p]=Zf;constructor(e){this.ref=e}get value(){return q(()=>jn(this.ref))}onStart(e,t,r,i){v(this.ref,Ti(v(jn(this.ref),J6(i))))}onEnd(e,t){v(this.ref,Ti(v(jn(this.ref),H6(t))))}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}var Pge=()=>new W6,V6=q(Pge),Rge=(e)=>new Z6(e),hu=Fe("effect/Supervisor/none",()=>Rge($e));var G6=fa;var K6="Empty",Q6="AddSupervisor",Y6="RemoveSupervisor",X6="AndThen",Mp={_tag:K6},HS=(e,t)=>({_tag:X6,first:e,second:t}),_ge=(e,t)=>Oge(t,Zt(e)),Oge=(e,t)=>{let r=e,i=t;while(zr(i)){let n=Pr(i);switch(n._tag){case K6:{i=Yr(i);break}case Q6:{r=r.zip(n.supervisor),i=Yr(i);break}case Y6:{r=P0(r,n.supervisor),i=Yr(i);break}case X6:{i=Cr(n.first)(Cr(n.second)(Yr(i)));break}}}return r},P0=(e,t)=>{if(le(e,t))return hu;else if(C0(e))return P0(e.left,t).zip(P0(e.right,t));else return e},WS=(e)=>{if(le(e,hu))return Li();else if(C0(e))return v(WS(e.left),fo(WS(e.right)));else return oa(e)},Dge=(e,t)=>{if(le(e,t))return Mp;let r=WS(e),i=WS(t),n=v(i,p_(r),Cc(Mp,(s,c)=>HS(s,{_tag:Q6,supervisor:c}))),o=v(r,p_(i),Cc(Mp,(s,c)=>HS(s,{_tag:Y6,supervisor:c})));return HS(n,o)},e4=G6({empty:Mp,patch:_ge,combine:HS,diff:Dge});var Fge=qf("effect_fiber_started",{incremental:!0}),t4=qf("effect_fiber_active"),$ge=qf("effect_fiber_successes",{incremental:!0}),jge=qf("effect_fiber_failures",{incremental:!0}),Nge=A6(R6("effect_fiber_lifetimes",$G({start:0.5,factor:2,count:35})),"time_unit","milliseconds"),Vf="Continue",zge="Done",r4="Yield",Lge={_E:(e)=>e,_A:(e)=>e},ZS=(e)=>{throw Error(`BUG: FiberRuntime - ${No(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},gs=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),hs=Fe("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),Gf={[jl]:(e,t,r)=>Jt(()=>t.effect_instruction_i1(r)),["OnStep"]:(e,t,r)=>Rt(Rt(r)),[Nl]:(e,t,r)=>Jt(()=>t.effect_instruction_i2(r)),[Am]:(e,t,r)=>{if(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),qi(e.currentRuntimeFlags)&&e.isInterrupted())return pt(e.getInterruptedCause());else return Rt(r)},[zl]:(e,t,r)=>{if(Jt(()=>t.effect_instruction_i2(r)),Jt(()=>t.effect_instruction_i0()))return e.pushStack(t),Jt(()=>t.effect_instruction_i1());else return $e},[bc]:(e,t,r)=>{while(!0){let i=Jt(()=>t.effect_instruction_i0.next(r));if(i.done)return Rt(i.value);let n=EA(i.value);if(!up(n))return e.pushStack(t),n;else if(n._tag==="Failure")return n;r=n.value}}},Bge={[WD]:(e,t,r,i)=>(e.processNewInterruptSignal(i.cause),qi(t)?pt(i.cause):r),[VD]:(e,t,r,i)=>{throw Error("It is illegal to have multiple concurrent run loops in a single fiber")},[ZD]:(e,t,r,i)=>(i.onFiber(e,tD(t)),r),[GD]:(e,t,r,i)=>E(Io(),()=>r)},Uge=(e)=>Yn(cJ(e),(t)=>ys(pJ(t),([r,i])=>{let n=new Map,o=[];for(let c of i){o.push(Si(c));for(let u of c)n.set(u.request,u)}let s=o.flat();return Xt(nhe(r.runAll(o),s,()=>s.forEach((c)=>{c.listeners.interrupted=!0})),wS,n)},!1,!1)),qge=Om();class YS extends Ea{[ds]=Ap;[$f]=Lge;_fiberRefs;_fiberId;_queue=[];_children=null;_observers=[];_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(e,t,r){super();if(this.currentRuntimeFlags=r,this._fiberId=e,this._fiberRefs=t,tO(r)){let i=this.getFiberRef(is);Fge.unsafeUpdate(1,i),t4.unsafeUpdate(1,i)}this.refreshRefCache()}commit(){return Ar(this)}id(){return this._fiberId}resume(e){this.tell(pu(e))}get status(){return this.ask((e,t)=>t)}get runtimeFlags(){return this.ask((e,t)=>{if(sS(t))return e.currentRuntimeFlags;return t.runtimeFlags})}scope(){return lG(this)}get children(){return this.ask((e)=>Array.from(e.getChildren()))}getChildren(){if(this._children===null)this._children=new Set;return this._children}getInterruptedCause(){return this.getFiberRef(Zc)}fiberRefs(){return this.ask((e)=>e.getFiberRefs())}ask(e){return we(()=>{let t=xf(this._fiberId);return this.tell(Rp((r,i)=>{wf(t,q(()=>e(r,i)))})),kr(t)})}tell(e){if(this._queue.push(e),!this._running)this._running=!0,this.drainQueueLaterOnExecutor()}get await(){return en((e)=>{let t=(r)=>e(O(r));if(this._exitValue!==null){t(this._exitValue);return}return this.tell(Rp((r,i)=>{if(r._exitValue!==null)t(this._exitValue);else r.addObserver(t)})),q(()=>this.tell(Rp((r,i)=>{r.removeObserver(t)})))},this.id())}get inheritAll(){return Qe((e,t)=>{let r=e.id(),i=e.getFiberRefs(),n=t.runtimeFlags,o=this.getFiberRefs(),s=Xx(i,r,o);e.setFiberRefs(s);let c=e.getFiberRef(o4),u=v(Ei(n,c),oO(Ui),oO(fx));return va(u)})}get poll(){return q(()=>Bo(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(e){return q(()=>this.tell(DS(ki(e))))}unsafeInterruptAsFork(e){this.tell(DS(ki(e)))}addObserver(e){if(this._exitValue!==null)e(this._exitValue);else this._observers.push(e)}removeObserver(e){this._observers=this._observers.filter((t)=>t!==e)}getFiberRefs(){return this.setFiberRef(o4,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(e){this._fiberRefs=Ef(this._fiberRefs,e)}getFiberRef(e){if(this._fiberRefs.locals.has(e))return this._fiberRefs.locals.get(e)[0][1];return e.initial}setFiberRef(e,t){this._fiberRefs=xp(this._fiberRefs,{fiberId:this._fiberId,fiberRef:e,value:t}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(er),this.currentTracer=this.currentDefaultServices.unsafeMap.get(as.key),this.currentSupervisor=this.getFiberRef(j0),this.currentScheduler=this.getFiberRef(su),this.currentContext=this.getFiberRef(zn),this.currentSpan=this.currentContext.unsafeMap.get(Vi.key)}setFiberRefs(e){this._fiberRefs=e,this.refreshRefCache()}addChild(e){this.getChildren().add(e)}removeChild(e){this.getChildren().delete(e)}transferChildren(e){let t=this._children;if(this._children=null,t!==null&&t.size>0){for(let r of t)if(r._exitValue===null)e.add(this.currentRuntimeFlags,r)}}drainQueueOnCurrentThread(){let e=!0;while(e){let t=Vf,r=globalThis[ms];globalThis[ms]=this;try{while(t===Vf)t=this._queue.length===0?zge:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[ms]=r}if(this._queue.length>0&&!this._running)if(this._running=!0,t===r4)this.drainQueueLaterOnExecutor(),e=!1;else e=!0;else e=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(ns),this)}drainQueueWhileRunning(e,t){let r=t;while(this._queue.length>0){let i=this._queue.splice(0,1)[0];r=Bge[i._tag](this,e,r,i)}return r}isInterrupted(){return!g_(this.getFiberRef(Zc))}addInterruptedCause(e){let t=this.getFiberRef(Zc);this.setFiberRef(Zc,Vt(t,e))}processNewInterruptSignal(e){this.addInterruptedCause(e),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let e=!1;for(let t of this._children)t.tell(DS(ki(this.id()))),e=!0;return e}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){let e=this._children.values();this._children=null;let t=!1;return wa({while:()=>!t,body:()=>{let i=e.next();if(!i.done)return $t(i.value.await);else return q(()=>{t=!0})},step:()=>{}})}return null}reportExitValue(e){if(tO(this.currentRuntimeFlags)){let t=this.getFiberRef(is),r=this.id().startTimeMillis,i=Date.now();switch(Nge.unsafeUpdate(i-r,t),t4.unsafeUpdate(-1,t),e._tag){case Wt:{$ge.unsafeUpdate(1,t);break}case Ht:{jge.unsafeUpdate(1,t);break}}}if(e._tag==="Failure"){let t=this.getFiberRef(IO);if(!Bm(e.cause)&&t._tag==="Some")this.log("Fiber terminated with an unhandled error",e.cause,t)}}setExitValue(e){this._exitValue=e,this.reportExitValue(e);for(let t=this._observers.length-1;t>=0;t--)this._observers[t](e);this._observers=[]}getLoggers(){return this.getFiberRef(Zge)}log(e,t,r){let i=Bt(r)?r.value:this.getFiberRef(vO),n=this.getFiberRef(a4);if(cD(n,i))return;let o=this.getFiberRef(Ox),s=this.getFiberRef(Ia),c=this.getLoggers(),u=this.getFiberRefs();if(Jo(c)>0){let l=$n(this.getFiberRef(er),ni),p=new Date(l.unsafeCurrentTimeMillis());RU(u,()=>{for(let m of c)m.log({fiberId:this.id(),logLevel:i,message:e,cause:t,context:u,spans:o,annotations:s,date:p})})}}evaluateMessageWhileSuspended(e){switch(e._tag){case GD:return r4;case WD:{if(this.processNewInterruptSignal(e.cause),this._asyncInterruptor!==null)this._asyncInterruptor(pt(e.cause)),this._asyncInterruptor=null;return Vf}case VD:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(e.effect),Vf;case ZD:return e.onFiber(this,this._exitValue!==null?EW:CW(this.currentRuntimeFlags,this._asyncBlockingOn)),Vf;default:return ZS(e)}}evaluateEffect(e){this.currentSupervisor.onResume(this);try{let t=qi(this.currentRuntimeFlags)&&this.isInterrupted()?pt(this.getInterruptedCause()):e;while(t!==null){let r=t,i=this.runLoop(r);if(i===gs){let n=hs.currentOp;if(hs.currentOp=null,n._op===Ll)if(nJ(this.currentRuntimeFlags))this.tell(sG()),this.tell(pu(vn)),t=null;else t=vn;else if(n._op===hc)t=null}else{this.currentRuntimeFlags=v(this.currentRuntimeFlags,X_(fx));let n=this.interruptAllChildren();if(n!==null)t=E(n,()=>i);else{if(this._queue.length===0)this.setExitValue(i);else this.tell(pu(i));t=null}}}}finally{this.currentSupervisor.onSuspend(this)}}start(e){if(!this._running){this._running=!0;let t=globalThis[ms];globalThis[ms]=this;try{this.evaluateEffect(e)}finally{if(this._running=!1,globalThis[ms]=t,this._queue.length>0)this.drainQueueLaterOnExecutor()}}else this.tell(pu(e))}startFork(e){this.tell(pu(e))}patchRuntimeFlags(e,t){let r=Qo(e,t);return globalThis[ms]=this,this.currentRuntimeFlags=r,r}initiateAsync(e,t){let r=!1,i=(n)=>{if(!r)r=!0,this.tell(pu(n))};if(qi(e))this._asyncInterruptor=i;try{t(i)}catch(n){i(tt(Sr(n)))}}pushStack(e){if(this._stack.push(e),e._op==="OnStep")this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){let e=this._stack.pop();if(e){if(e._op==="OnStep")this._steps.pop();return e}return}getNextSuccessCont(){let e=this.popStack();while(e){if(e._op!==$l)return e;e=this.popStack()}}getNextFailCont(){let e=this.popStack();while(e){if(e._op!==jl&&e._op!==zl&&e._op!==bc)return e;e=this.popStack()}}[_U](e){return q(()=>ca(this.currentContext,e))}["Left"](e){return Ge(e.left)}["None"](e){return Ge(new Ln)}["Right"](e){return Rt(e.right)}["Some"](e){return Rt(e.value)}["Micro"](e){return ip((t)=>{let r=t,i=WW(BW(e,this.currentContext));return i.addObserver((n)=>{if(n._tag==="Success")return r(Rt(n.value));switch(n.cause._tag){case"Interrupt":return r(pt(ki(bn)));case"Fail":return r(Ge(n.cause.error));case"Die":return r(xn(n.cause.defect))}}),ip((n)=>{r=(o)=>{n($e)},i.unsafeInterrupt()})})}[bb](e){let t=Jt(()=>e.effect_instruction_i0()),r=this.getNextSuccessCont();if(r!==void 0){if(!(r._op in Gf))ZS(r);return Gf[r._op](this,r,t)}else return hs.currentOp=Rt(t),gs}[Wt](e){let t=e,r=this.getNextSuccessCont();if(r!==void 0){if(!(r._op in Gf))ZS(r);return Gf[r._op](this,r,t.effect_instruction_i0)}else return hs.currentOp=t,gs}[Ht](e){let t=e.effect_instruction_i0,r=this.getNextFailCont();if(r!==void 0)switch(r._op){case $l:case Nl:if(!(qi(this.currentRuntimeFlags)&&this.isInterrupted()))return Jt(()=>r.effect_instruction_i1(t));else return pt(b_(t));case"OnStep":if(!(qi(this.currentRuntimeFlags)&&this.isInterrupted()))return Rt(pt(t));else return pt(b_(t));case Am:if(this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),qi(this.currentRuntimeFlags)&&this.isInterrupted())return pt(Vt(t,this.getInterruptedCause()));else return pt(t);default:ZS(r)}else return hs.currentOp=pt(t),gs}[xb](e){return Jt(()=>e.effect_instruction_i0(this,tD(this.currentRuntimeFlags)))}["Blocked"](e){let t=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){let i=[],n=this._steps[this._steps.length-1],o=this.popStack();while(o&&o._op!=="OnStep")i.push(o),o=this.popStack();this.setFiberRefs(n.refs),this.currentRuntimeFlags=n.flags;let s=tu(n.refs,t),c=Ei(n.flags,r);return Rt(Yo(e.effect_instruction_i0,Qe((u)=>{while(i.length>0)u.pushStack(i.pop());return u.setFiberRefs(ru(u.id(),u.getFiberRefs())(s)),u.currentRuntimeFlags=Qo(c)(u.currentRuntimeFlags),e.effect_instruction_i1})))}return Gt((i)=>E(jp(xx(e.effect_instruction_i0)),()=>i(e.effect_instruction_i1)))}["RunBlocked"](e){return Uge(e.effect_instruction_i0)}[zo](e){let t=e.effect_instruction_i0,r=this.currentRuntimeFlags,i=Qo(r,t);if(qi(i)&&this.isInterrupted())return pt(this.getInterruptedCause());else if(this.patchRuntimeFlags(this.currentRuntimeFlags,t),e.effect_instruction_i1){let n=Ei(i,r);return this.pushStack(new fO(n,e)),Jt(()=>e.effect_instruction_i1(r))}else return vn}[jl](e){return this.pushStack(e),e.effect_instruction_i0}["OnStep"](e){return this.pushStack(e),e.effect_instruction_i0}[$l](e){return this.pushStack(e),e.effect_instruction_i0}[Nl](e){return this.pushStack(e),e.effect_instruction_i0}[hc](e){return this._asyncBlockingOn=e.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,e.effect_instruction_i0),hs.currentOp=e,gs}[Ll](e){return this._isYielding=!1,hs.currentOp=e,gs}[zl](e){let{effect_instruction_i0:t,effect_instruction_i1:r}=e;if(t())return this.pushStack(e),r();else return vn}[bc](e){return Gf[bc](this,e,void 0)}[yc](e){return Jt(()=>e.commit())}runLoop(e){let t=e;this.currentOpCount=0;while(!0){if((this.currentRuntimeFlags&rJ)!==0)this.currentSupervisor.onEffect(this,t);if(this._queue.length>0)t=this.drainQueueWhileRunning(this.currentRuntimeFlags,t);if(!this._isYielding){this.currentOpCount+=1;let r=this.currentScheduler.shouldYield(this);if(r!==!1){this._isYielding=!0,this.currentOpCount=0;let i=t;t=E(Io({priority:r}),()=>i)}}try{if(t=this.currentTracer.context(()=>{if(qge!==t[Xo]._V){let r=this.getFiberRef(UJ);if(r._tag==="Some"){let i=t[Xo]._V;this.log(`Executing an Effect versioned ${i} with a Runtime of version ${Om()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Fn,r)}}return this[t._op](t)},this),t===gs){let r=hs.currentOp;if(r._op===Ll||r._op===hc)return gs;return hs.currentOp=null,r._op===Wt||r._op===Ht?r:pt(Sr(r))}}catch(r){if(t!==gs&&!pe(t,"_op")||!(t._op in this))t=ga(`Not a valid effect: ${No(t)}`);else if(WJ(r))t=pt(Vt(Sr(r),ki(bn)));else t=xn(r)}}}run=()=>{this.drainQueueOnCurrentThread()}}var a4=Fe("effect/FiberRef/currentMinimumLogLevel",()=>Ut(uD("Info"))),Jge=(e)=>BS((t)=>{let r=iW(t.context,er);$n(r,ss).unsafe.log(e.log(t))});var Hge=Fe(Symbol.for("effect/Logger/defaultLogger"),()=>Jge(OG));var Wge=Fe(Symbol.for("effect/Logger/tracerLogger"),()=>BS(({annotations:e,cause:t,context:r,fiberId:i,logLevel:n,message:o})=>{let s=Mf(Ii(ls(r,zn),Vi));if(s._tag==="None"||s.value._tag==="ExternalSpan")return;let c=ca(ls(r,er),ni),u={};for(let[l,p]of e)u[l]=p;if(u["effect.fiberId"]=C2(i),u["effect.logLevel"]=n.label,t!==null&&t._tag!=="Empty")u["effect.cause"]=Zo(t,{renderErrorCause:!0});s.value.event(No(Array.isArray(o)&&o.length===1?o[0]:o),c.unsafeCurrentTimeNanos(),u)}));var Zge=Fe(Symbol.for("effect/FiberRef/currentLoggers"),()=>zJ(oa(Hge,Wge)));var c4=function(){if(typeof arguments[0]==="string")return Oi(Ia,Bi(arguments[0],arguments[1]));let e=Object.entries(arguments[0]);return Oi(Ia,A2((t)=>{for(let r=0;r<e.length;r++){let[i,n]=e[r];Bi(t,i,n)}return t}))},u4=h(2,(e,t)=>{let r=typeof t==="string"?uD(t):t;return Qe((i)=>{let n=i.getFiberRef(a4);if(cD(n,r))return O(H());return W(e,re)})}),Fp=h((e)=>mt(e[0]),(e,t)=>rs(Hi(e,(r)=>$p((i)=>t(r,i))))),l4=h((e)=>mt(e[0]),(e,t)=>oi(e,$p((r)=>t(r)))),$p=(e)=>Qe((t)=>{let r=t.getFiberRefs(),i=Y_(t.currentRuntimeFlags,Ui);return E($0,(n)=>Vc(n,(o)=>Qe((s)=>{let c=s.getFiberRefs(),u=s.currentRuntimeFlags,l=tu(c,r),p=Ei(u,i),m=tu(r,c);return s.setFiberRefs(ru(l,s.id(),r)),oi(Rx(e(o),p),q(()=>{s.setFiberRefs(ru(m,s.id(),s.getFiberRefs()))}))})))}),p4=(e)=>Xt(af,re(Gi))(e),n4=Symbol.for("effect/Effect/existsPar/found"),d4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r)=>Af(r?.concurrency,()=>we(()=>m4(e[Symbol.iterator](),0,t)),()=>dr(ii(e,(i,n)=>kx(t(i,n),{onTrue:()=>Ge(n4),onFalse:()=>$e}),r),{onFailure:(i)=>i===n4?O(!0):Ge(i),onSuccess:()=>O(!1)}))),m4=(e,t,r)=>{let i=e.next();if(i.done)return O(!1);return E(r(i.value,t),(n)=>n?O(n):m4(e,t+1,r))},f4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r)=>{let i=r?.negate?(n,o)=>W(t(n,o),ZH):t;return Af(r?.concurrency,()=>we(()=>ot(e).reduceRight((n,o,s)=>Xn(n,we(()=>i(o,s)),(c,u)=>u?[o,...c]:c),q(()=>[]))),()=>W(ii(e,(n,o)=>W(i(n,o),(s)=>s?re(n):H()),r),iq))}),Vge=(e)=>{if(Array.isArray(e)||bi(e))return[e,H()];let t=Object.keys(e),r=t.length;return[t.map((i)=>e[i]),re((i)=>{let n={};for(let o=0;o<r;o++)n[t[o]]=i[o];return n})]},Gge=(e,t,r)=>{let i=[];for(let n of e)i.push(Ci(n));return E(ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(n)=>{let o=H(),s=n.length,c=Array(s),u=Array(s),l=!1;for(let p=0;p<s;p++){let m=n[p];if(m._tag==="Left")c[p]=re(m.left),l=!0;else u[p]=m.right,c[p]=o}if(l)return t._tag==="Some"?Ge(t.value(c)):Ge(c);else if(r?.discard)return $e;return t._tag==="Some"?O(t.value(u)):O(u)})},Kge=(e,t,r)=>{let i=[];for(let n of e)i.push(Ci(n));if(r?.discard)return ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,discard:!0,concurrentFinalizers:r?.concurrentFinalizers});return W(ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(n)=>t._tag==="Some"?t.value(n):n)},Ma=(e,t)=>{let[r,i]=Vge(e);if(t?.mode==="validate")return Gge(r,i,t);else if(t?.mode==="either")return Kge(r,i,t);return t?.discard!==!0&&i._tag==="Some"?W(ii(r,Ze,t),i.value):ii(r,Ze,t)},g4=(e)=>(t)=>Ma(t,e),h4=(e,t)=>W(Ma(ot(e).map(Pt),t),Hl((r)=>hf(r)?re(r.effect_instruction_i0):H())),A0=h(2,(e,t)=>Array.from({length:t},()=>e)),y4=h((e)=>mt(e[0]),(e,t,r)=>Ma(A0(e,t),r)),ii=h((e)=>bi(e[0]),(e,t,r)=>Qe((i)=>{let n=r?.batching===!0||r?.batching==="inherit"&&i.getFiberRef(kO);if(r?.discard)return vD(r.concurrency,()=>yu(Kx,r?.concurrentFinalizers)((o)=>n?ys(e,(s,c)=>o(t(s,c)),!0,!1,1):Yn(e,(s,c)=>o(t(s,c)))),()=>yu(Qx,r?.concurrentFinalizers)((o)=>ys(e,(s,c)=>o(t(s,c)),n,!1)),(o)=>yu(Yx(o),r?.concurrentFinalizers)((s)=>ys(e,(c,u)=>s(t(c,u)),n,!1,o)));return vD(r?.concurrency,()=>yu(Kx,r?.concurrentFinalizers)((o)=>n?R0(e,1,(s,c)=>o(t(s,c)),!0):Rr(e,(s,c)=>o(t(s,c)))),()=>yu(Qx,r?.concurrentFinalizers)((o)=>VS(e,(s,c)=>o(t(s,c)),n)),(o)=>yu(Yx(o),r?.concurrentFinalizers)((s)=>R0(e,o,(c,u)=>s(t(c,u)),n)))})),VS=(e,t,r)=>we(()=>{let i=ot(e),n=Array(i.length);return st(ys(i,(s,c)=>E(t(s,c),(u)=>q(()=>n[c]=u)),r,!1),O(n))}),ys=(e,t,r,i,n)=>Gt((o)=>Cx((s)=>Qe((c)=>{let u=Array.from(e).reverse(),l=u.length;if(l===0)return $e;let p=0,m=!1,f=n?Math.min(u.length,n):u.length,g=new Set,S=[],P=()=>g.forEach((Te)=>{Te.currentScheduler.scheduleTask(()=>{Te.unsafeInterruptAsFork(c.id())},0,Te)}),D=[],L=[],Se=[],Q=()=>{let Te=S.filter(({exit:Pe})=>Pe._tag==="Failure").sort((Pe,Je)=>Pe.index<Je.index?-1:Pe.index===Je.index?0:1).map(({exit:Pe})=>Pe);if(Te.length===0)Te.push(vn);return Te},se=(Te,Pe=!1)=>{let Je=rs(s(Te)),Xe=Qge(Je,c,c.currentRuntimeFlags,Gi);return c.currentScheduler.scheduleTask(()=>{if(Pe)Xe.unsafeInterruptAsFork(c.id());Xe.resume(Je)},0,Xe),Xe},me=()=>{if(!i)l-=u.length,u=[];m=!0,P()},F=r?wx:Pt,Be=se(en((Te)=>{let Pe=(Xe,He)=>{if(Xe._op==="Blocked")Se.push(Xe);else if(S.push({index:He,exit:Xe}),Xe._op==="Failure"&&!m)me()},Je=()=>{if(u.length>0){let Xe=u.pop(),He=p++,ge=()=>{let at=u.pop();return He=p++,E(Io(),()=>E(F(o(t(at,He))),xe))},xe=(at)=>{if(u.length>0){if(Pe(at,He),u.length>0)return ge()}return O(at)},Me=E(F(o(t(Xe,He))),xe),ee=se(Me);if(D.push(ee),g.add(ee),m)ee.currentScheduler.scheduleTask(()=>{ee.unsafeInterruptAsFork(c.id())},0,ee);ee.addObserver((at)=>{let ft;if(at._op==="Failure")ft=at;else ft=at.effect_instruction_i0;if(L.push(ee),g.delete(ee),Pe(ft,He),S.length===l)Te(O(br(Qc(Q(),{parallel:!0}),()=>vn)));else if(Se.length+S.length===l){let cr=Q(),w=Se.map((zt)=>zt.effect_instruction_i0).reduce(aO);Te(O(Yo(w,ys([br(Qc(cr,{parallel:!0}),()=>vn),...Se.map((zt)=>zt.effect_instruction_i1)],(zt)=>zt,r,!0,n))))}else Je()})}};for(let Xe=0;Xe<f;Xe++)Je()}));return $t(Sn(tn(o(Ar(Be))),Yc({onFailure:(Te)=>{me();let Pe=Se.length+1,Je=Math.min(typeof n==="number"?n:Se.length,Se.length),Xe=Array.from(Se);return en((He)=>{let ge=[],xe=0,Me=0,ee=(ft,cr)=>(w)=>{if(ge[ft]=w,xe++,xe===Pe)He(Rt(pt(Te)));if(Xe.length>0&&cr)at()},at=()=>{se(Xe.pop(),!0).addObserver(ee(Me,!0)),Me++};Be.addObserver(ee(Me,!1)),Me++;for(let ft=0;ft<Je;ft++)at()})},onSuccess:()=>Rr(L,(Te)=>Te.inheritAll)})))}))),R0=(e,t,r,i)=>we(()=>{let n=ot(e),o=Array(n.length);return st(ys(n,(c,u)=>W(r(c,u),(l)=>o[u]=l),i,!1,t),O(o))}),bs=(e)=>Qe((t,r)=>O(Qf(e,t,r.runtimeFlags))),jp=(e)=>Yge(e,Gi),b4=h(2,(e,t)=>bs(Ex(e,(r)=>{let i=Wo(r);switch(i._tag){case"Left":return t(i.left);case"Right":return tt(i.right)}}))),Qf=(e,t,r,i=null)=>{let n=GS(e,t,r,i);return n.resume(e),n},Qge=(e,t,r,i=null)=>GS(e,t,r,i),GS=(e,t,r,i=null)=>{let n=nx(),o=t.getFiberRefs(),s=GO(o,n),c=new YS(n,s,r),u=ls(s,zn),l=c.currentSupervisor;return l.onStart(u,e,re(t),c),c.addObserver((m)=>l.onEnd(m,c)),(i!==null?i:v(t.getFiberRef(af),br(()=>t.scope()))).add(r,c),c},Yge=(e,t)=>Qe((r,i)=>O(Qf(e,r,i.runtimeFlags,t))),_0=h((e)=>Gs(e[2]),(e,t,r,i)=>Af(i?.concurrency,()=>ot(e).reduce((n,o,s)=>Xn(n,o,(c,u)=>r(c,u,s)),O(t)),()=>E(xS(t),(n)=>E(ii(e,(o,s)=>E(o,(c)=>QW(n,(u)=>r(u,c,s))),i),()=>SS(n))))),O0=h((e)=>bi(e[0]),(e,t,r)=>v(ii(e,(i,n)=>Ci(t(i,n)),r),W((i)=>CJ(i,Ze)))),x4=h((e)=>bi(e[0]),(e,t,r)=>E(O0(e,t,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([i,n])=>kb(i)?Ge(i):r?.discard?$e:O(n))),S4=(e)=>Qe((t,r)=>en((i)=>{let n=new Set,o,s=Fn,c=()=>{for(let p of n)p.unsafeInterruptAsFork(t.id())},u=!1,l=!0;for(let p of e){l=!1;let m=Qf(ts(p),t,r.runtimeFlags);if(n.add(m),m.addObserver((f)=>{if(n.delete(m),!o)if(f._tag==="Success")u=!0,o=m,s=Fn,c();else s=Xr(f.cause,s);if(u&&n.size===0)i(o?st(zS(o),o.unsafePoll()):tt(s))}),o)break}if(l)return i(ha(()=>new ff("Received an empty collection of effects")));return u=!0,jf(n,t.id())})),v4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r,i)=>Af(i?.concurrency,()=>ot(e).reduce((n,o,s)=>Xn(n,o,(c,u)=>r(c,u,s)),t),()=>we(()=>v(_0([t,...e],H(),(n,o,s)=>{switch(n._tag){case"None":return re(o);case"Some":return re(r(n.value,o,s))}},i),W((n)=>{switch(n._tag){case"None":throw Error("BUG: Effect.reduceEffect - please report an issue at https://github.com/Effect-TS/effect/issues");case"Some":return n.value}}))))),KS=(e)=>Ri((t)=>yr(Ii(t,Fa),{onNone:()=>e,onSome:(r)=>{switch(r.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return E(ti(r,Qx),(i)=>$a(e,i))}}})),i4=(e)=>(t)=>Ri((r)=>yr(Ii(r,Fa),{onNone:()=>t,onSome:(i)=>{if(i.strategy._tag==="ParallelN"&&i.strategy.parallelism===e)return t;return E(ti(i,Yx(e)),(n)=>$a(t,n))}})),w4=(e)=>(t)=>yu(e,!0)(t),yu=(e,t)=>(r)=>Ri((i)=>yr(Ii(i,Fa),{onNone:()=>r(Ze),onSome:(n)=>{if(t===!0){let o=e._tag==="Parallel"?KS:e._tag==="Sequential"?QS:i4(e.parallelism);switch(n.strategy._tag){case"Parallel":return o(r(KS));case"Sequential":return o(r(QS));case"ParallelN":return o(r(i4(n.strategy.parallelism)))}}else return r(Ze)}})),bu=(e)=>E(Fa,e),Yf=(e)=>E(XS(),(t)=>Sn(e(t),(r)=>t.close(r))),D0=(e)=>E(XS(),(t)=>the(e,t)),QS=(e)=>Ri((t)=>yr(Ii(t,Fa),{onNone:()=>e,onSome:(r)=>{switch(r.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return E(ti(r,Kx),(i)=>$a(e,i))}}})),k4=(e,t)=>M0([au(e,t)]),M0=(e)=>Oi(is,(t)=>Ni(t,e)),I4=h(2,(e,t)=>Yf((r)=>E($a(e,r),t))),T4=h((e)=>mt(e[1]),(e,t,r)=>F0(e,t,(i,n)=>[i,n],r)),F0=h((e)=>mt(e[1]),(e,t,r,i)=>tn(Co(Pt(e),Pt(t),(n,o)=>dp(n,o,{onSuccess:r,onFailure:(s,c)=>i?.concurrent?Xr(s,c):Vt(s,c)}),i)));var E4=h((e)=>bi(e[0]),(e,t,r)=>xa(ii(e,(i,n)=>xa(t(i,n)),r))),C4=(e)=>Oi(er,Ot(ni,e)),P4=(e)=>Oi(er,Ot(eu,e)),R4=(e)=>Oi(er,Ot(fp,e)),A4=(e)=>bu((t)=>E(ti(t,_i),(r)=>v(e,$a(r),W((i)=>[Nn((n)=>Gc(r,bf(n))),i])))),_4=h((e)=>mt(e[1]),(e,t,r)=>Co(e,t,(i,n)=>[i,n],r)),O4=h((e)=>mt(e[1]),(e,t,r)=>{if(r?.concurrent!==!0&&(r?.batching===void 0||r.batching===!1))return Jc(e,t);return Co(e,t,(i,n)=>i,r)}),D4=h((e)=>mt(e[1]),(e,t,r)=>{if(r?.concurrent!==!0&&(r?.batching===void 0||r.batching===!1))return st(e,t);return Co(e,t,(i,n)=>n,r)}),Co=h((e)=>mt(e[1]),(e,t,r,i)=>W(Ma([e,t],{concurrency:i?.concurrent?2:1,batching:i?.batching,concurrentFinalizers:i?.concurrentFinalizers}),([n,o])=>r(n,o))),M4=(e)=>{if(e===oJ)return $e;return v(op,E((t)=>{let r=Qo(t,e),i=Ei(r,t);return v(va(e),st($p(()=>va(i))),$t)}),rs)},Fa=yn("effect/Scope"),$0=Fa,Xge=(e,t)=>{if(e.state._tag==="Open")e.state.finalizers.set({},t)},ehe={[Fx]:Fx,[$x]:$x,pipe(){return ae(this,arguments)},fork(e){return q(()=>{let t=F4(e);if(this.state._tag==="Closed")return t.state=this.state,t;let r={},i=(n)=>t.close(n);return this.state.finalizers.set(r,i),Xge(t,(n)=>q(()=>{if(this.state._tag==="Open")this.state.finalizers.delete(r)})),t})},close(e){return we(()=>{if(this.state._tag==="Closed")return $e;let t=Array.from(this.state.finalizers.values()).reverse();if(this.state={_tag:"Closed",exit:e},t.length===0)return $e;return HO(this.strategy)?v(Rr(t,(r)=>Pt(r(e))),E((r)=>v(Qc(r),Gn(yf),br(()=>vn)))):WO(this.strategy)?v(VS(t,(r)=>Pt(r(e)),!1),E((r)=>v(Qc(r,{parallel:!0}),Gn(yf),br(()=>vn)))):v(R0(t,this.strategy.parallelism,(r)=>Pt(r(e)),!1),E((r)=>v(Qc(r,{parallel:!0}),Gn(yf),br(()=>vn))))})},addFinalizer(e){return we(()=>{if(this.state._tag==="Closed")return e(this.state.exit);return this.state.finalizers.set({},e),$e})}},F4=(e=_i)=>{let t=Object.create(ehe);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},XS=(e=_i)=>q(()=>F4(e)),$a=h(2,(e,t)=>Xc(e,Go($c(Fa,t)))),the=h(2,(e,t)=>v(e,$a(t),Sn((r)=>t.close(r)))),rhe=(e)=>Wc(e,{differ:e4,fork:Mp}),ev=h(2,(e,t)=>$t(Fp(E(ei(e),(r)=>kt(Lc(e,t),r)),(r)=>Lc(e,r)))),Oi=h(2,(e,t)=>Br(e,(r)=>ev(e,t(r))));var o4=LJ(iJ),j0=rhe(hu),tv=(e)=>ii(e,jS),Np=(e)=>({...Zx,commit(){return Ar(this)},[ds]:Ap,id:()=>ot(e).reduce((r,i)=>M_(r,i.id()),bn),await:Pt(VS(e,(r)=>tn(r.await),!1)),children:W(VS(e,(r)=>r.children,!1),Tb),inheritAll:Yn(e,(r)=>r.inheritAll),poll:W(Rr(e,(r)=>r.poll),Eb(re(Rt([])),(r,i)=>{switch(i._tag){case"None":return H();case"Some":switch(r._tag){case"None":return H();case"Some":return re(dp(i.value,r.value,{onSuccess:(n,o)=>[n,...o],onFailure:Xr}))}}})),interruptAsFork:(r)=>Yn(e,(i)=>i.interruptAsFork(r))}),$4=(e)=>$t(jp(ka(e))),j4=(e)=>Ar(Np(e)),N4=(e)=>Fp(O(e),ka),N0=h(3,(e,t,r)=>z0(e,t,{onSelfWin:(i,n)=>E(i.await,(o)=>{switch(o._tag){case Wt:return E(i.inheritAll,()=>r.onSelfDone(o,n));case Ht:return r.onSelfDone(o,n)}}),onOtherWin:(i,n)=>E(i.await,(o)=>{switch(o._tag){case Wt:return E(i.inheritAll,()=>r.onOtherDone(o,n));case Ht:return r.onOtherDone(o,n)}})})),z4=(e)=>Gt((t)=>Nn((r)=>E(jp(t(e)),(i)=>v(t(Ar(i)),ko(()=>v(i,LS(r))))))),rv=h(2,(e,t)=>Nn((r)=>N0(e,t,{onSelfDone:(i,n)=>pp(i,{onFailure:(o)=>v(Ar(n),Cp((s)=>Xr(o,s))),onSuccess:(o)=>v(n,rn(r),kt(o))}),onOtherDone:(i,n)=>pp(i,{onFailure:(o)=>v(Ar(n),Cp((s)=>Xr(s,o))),onSuccess:(o)=>v(n,rn(r),kt(o))})}))),z0=h(3,(e,t,r)=>Qe((i,n)=>{let o=n.runtimeFlags,s=bo(!0),c=GS(e,i,o,r.selfScope),u=GS(t,i,o,r.otherScope);return en((l)=>{c.addObserver(()=>s4(c,u,r.onSelfWin,s,l)),u.addObserver(()=>s4(u,c,r.onOtherWin,s,l)),c.startFork(e),u.startFork(t)},M_(c.id(),u.id()))})),s4=(e,t,r,i,n)=>{if(Vb(!0,!1)(i))n(r(e,t))},oi=h(2,(e,t)=>Gt((r)=>Dt(r(e),{onFailure:(i)=>Dt(t,{onFailure:(n)=>tt(Vt(i,n)),onSuccess:()=>tt(i)}),onSuccess:(i)=>kt(t,i)}))),nhe=(e,t,r)=>Nn((i)=>oi(E(jp(ts(e)),(n)=>en((o)=>{let s=t.map((l)=>l.listeners.count),c=()=>{if(s.every((l)=>l===0)){if(t.every((l)=>{if(l.result.state.current._tag==="Pending")return!0;else if(l.result.state.current._tag==="Done"&&up(l.result.state.current.effect)&&l.result.state.current.effect._tag==="Failure"&&h_(l.result.state.current.effect.cause))return!0;else return!1}))u.forEach((l)=>l()),r?.(),o(ka(n))}};n.addObserver((l)=>{u.forEach((p)=>p()),o(l)});let u=t.map((l,p)=>{let m=(f)=>{s[p]=f,c()};return l.listeners.addObserver(m),()=>l.listeners.removeObserver(m)});return c(),q(()=>{u.forEach((l)=>l())})})),we(()=>{let n=t.flatMap((o)=>{if(!o.state.completed)return[o];return[]});return Yn(n,(o)=>w0(o.request,bf(i)))})));var Kf=(e,t)=>(t=cs(t),rs(Qe((r)=>{let i=ca(r.getFiberRef(zn),Fa),n=_S(r,e,t),o=r.getFiberRef(cp),s=$n(r.getFiberRef(er),ni);return kt(Vc(i,(c)=>UD(n,c,s,o)),n)}))),L4=(e)=>Oi(er,Ot(as,e)),B4=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],r=cs(e?arguments[2]:arguments[1]);if(e){let i=arguments[0];return E(Kf(t,cs(r)),(n)=>_a(i,Vi,n))}return(i)=>E(Kf(t,cs(r)),(n)=>_a(i,Vi,n))};var ihe="effect/ScheduleInterval",Xf=Symbol.for(ihe),L0={[Xf]:Xf,startMillis:0,endMillis:0},B0=(e,t)=>{if(e>t)return L0;return{[Xf]:Xf,startMillis:e,endMillis:t}},U4=h(2,(e,t)=>q4(e,t)===e),q4=h(2,(e,t)=>{if(e.endMillis<=t.startMillis)return e;if(t.endMillis<=e.startMillis)return t;if(e.startMillis<t.startMillis)return e;if(t.startMillis<e.startMillis)return t;if(e.endMillis<=t.endMillis)return e;return t});var J4=(e)=>e.startMillis>=e.endMillis;var H4=h(2,(e,t)=>{let r=Math.max(e.startMillis,t.startMillis),i=Math.min(e.endMillis,t.endMillis);return B0(r,i)});var W4=(e)=>B0(e,Number.POSITIVE_INFINITY);var U0=L0,Z4=U4;var V4=J4;var G4=H4;var K4=W4;var ahe="effect/ScheduleIntervals",q0=Symbol.for(ahe),J0=(e)=>({[q0]:q0,intervals:e});var Y4=h(2,(e,t)=>che(e.intervals,t.intervals,hn())),che=(e,t,r)=>{let i=e,n=t,o=r;while(zr(i)&&zr(n)){let s=v(Pr(i),G4(Pr(n))),c=V4(s)?o:v(o,Cr(s));if(v(Pr(i),Z4(Pr(n))))i=Yr(i);else n=Yr(n);o=c}return J0(mo(o))},nv=(e)=>v(e.intervals,Pb,br(()=>U0)).startMillis,X4=(e)=>v(e.intervals,Pb,br(()=>U0)).endMillis,eK=h(2,(e,t)=>nv(e)<nv(t)),tK=(e)=>zr(e.intervals);var rK=J0;var nK=Y4,iK=nv,H0=X4,oK=eK,sK=tK;var W0="Continue",cK="Done",uK=(e)=>({_tag:W0,intervals:e}),lK=(e)=>({_tag:W0,intervals:rK(Zt(e))}),pK={_tag:cK},dK=(e)=>e._tag===W0,mK=(e)=>e._tag===cK;var fK=uK;var gK=lK,Lp=pK,Z0=dK,eg=mK;var hK=Gc;var yK=ti;class xK{permits;waiters=new Set;taken=0;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take=(e)=>uf((t)=>{if(this.free<e){let r=()=>{if(this.free<e)return;this.waiters.delete(r),t(we(()=>{if(this.free<e)return this.take(e);return this.taken+=e,O(e)}))};return this.waiters.add(r),q(()=>{this.waiters.delete(r)})}t(we(()=>{if(this.free<e)return this.take(e);return this.taken+=e,O(e)}))});updateTakenUnsafe(e,t){if(this.taken=t(this.taken),this.waiters.size>0)e.getFiberRef(su).scheduleTask(()=>{let r=this.waiters.values(),i=r.next();while(i.done===!1&&this.free>0)i.value(),i=r.next()},e.getFiberRef(ns),e);return O(this.free)}updateTaken(e){return Qe((t)=>this.updateTakenUnsafe(t,e))}resize=(e)=>$t(Qe((t)=>{if(this.permits=e,this.free<0)return $e;return this.updateTakenUnsafe(t,(r)=>r)}));release=(e)=>this.updateTaken((t)=>t-e);releaseAll=this.updateTaken((e)=>0);withPermits=(e)=>(t)=>Gt((r)=>E(r(this.take(e)),(i)=>oi(r(t),this.release(i))));withPermitsIfAvailable=(e)=>(t)=>Gt((r)=>we(()=>{if(this.free<e)return lu;return this.taken+=e,oi(r(Tp(t)),this.release(e))}))}var iv=(e)=>new xK(e),SK=(e)=>q(()=>iv(e));class vK extends Ea{isOpen;waiters=[];scheduled=!1;constructor(e){super();this.isOpen=e}commit(){return this.await}unsafeSchedule(e){if(this.scheduled||this.waiters.length===0)return $e;return this.scheduled=!0,e.currentScheduler.scheduleTask(this.flushWaiters,e.getFiberRef(ns),e),$e}flushWaiters=()=>{this.scheduled=!1;let e=this.waiters;this.waiters=[];for(let t=0;t<e.length;t++)e[t](vn)};open=Qe((e)=>{if(this.isOpen)return $e;return this.isOpen=!0,this.unsafeSchedule(e)});unsafeOpen(){if(this.isOpen)return;this.isOpen=!0,this.flushWaiters()}release=Qe((e)=>{if(this.isOpen)return $e;return this.unsafeSchedule(e)});await=uf((e)=>{if(this.isOpen)return e($e);return this.waiters.push(e),q(()=>{let t=this.waiters.indexOf(e);if(t!==-1)this.waiters.splice(t,1)})});unsafeClose(){this.isOpen=!1}close=q(()=>{this.isOpen=!1});whenOpen=(e)=>st(this.await,e)}var K0=(e)=>new vK(e??!1),wK=(e)=>q(()=>K0(e)),kK=(e)=>ov(e,tv),IK=h(2,(e,t)=>W(Q0(e,t),(r)=>r[0])),Q0=h(2,(e,t)=>{let r=vr(t);return E(Bn(),(i)=>W(av(H()),(n)=>[Wi(dhe(e,r,n),i),mhe(n)]))}),bK=(e,t,r)=>{let i=ho(vr(t));return v(ri(),Hi((n)=>wo(e,n)),W((n)=>re([r+i,n])))},dhe=(e,t,r)=>Gt((i)=>v(Eo((n)=>n.currentTimeMillis),E((n)=>yhe(r,(o)=>{switch(o._tag){case"None":return re(bK(e,t,n));case"Some":{let[s]=o.value;return s-n<=0?re(bK(e,t,n)):H()}}})),E((n)=>Ft(n)?ga("BUG: Effect.cachedInvalidate - please report an issue at https://github.com/Effect-TS/effect/issues"):i(kr(n.value[1]))))),mhe=(e)=>To(e,H()),TK=h(2,(e,t)=>ov(e,(r)=>t(Np(r)))),ov=h(2,(e,t)=>E(V6,(r)=>v(X0(e,r),oi(E(r.value,t))))),EK=h((e)=>bi(e[0]),(e,t)=>t?.discard?Yn(e,bs):W(Rr(e,bs),Np)),Y0=h(2,(e,t)=>Qe((r,i)=>{let n=t,o=Qf(e,r,i.runtimeFlags,Gi);if(n.state._tag==="Open"){let s=()=>Nn((u)=>le(u,o.id())?$e:$t(ka(o))),c={};n.state.finalizers.set(c,s),o.addObserver(()=>{if(n.state._tag==="Closed")return;n.state.finalizers.delete(c)})}else o.unsafeInterruptAsFork(r.id());return O(o)})),sv=(e)=>bu((t)=>Y0(e,t)),CK=(e)=>Ar(e),PK=(e)=>we(()=>E(e,Ar)),V0=Symbol.for("effect/Effect/memoizeFunction.key");class G0{a;eq;[V0]=V0;constructor(e,t){this.a=e,this.eq=t}[he](e){if(pe(e,V0))if(this.eq)return this.eq(this.a,e.a);else return le(this.a,e.a);return!1}[be](){return this.eq?0:Ue(this,ue(this.a))}}var RK=(e,t)=>v(q(()=>fu()),E(av),W((r)=>(i)=>v(r.modifyEffect((n)=>{let o=v(n,sr(new G0(i,t)));if(Ft(o))return v(ri(),Hi((s)=>v(Ep(e(i)),wo(s),bs)),W((s)=>[s,v(n,Un(new G0(i,t),s))]));return O([o.value,n])}),E(kr),E(([n,o])=>v(cu(n),kt(o)))))),AK=h(2,(e,t)=>v(Pt(e),rv(Pt(t)),(r)=>tn(r))),X0=h(2,(e,t)=>wr(j0,(i)=>i.zip(t))(e)),_K=h(2,(e,t)=>eM(e,{onTimeout:()=>VJ(t),duration:t})),eM=h(2,(e,{duration:t,onTimeout:r})=>tn(tg(e,{onTimeout:()=>Pi(r),onSuccess:O,duration:t}))),OK=h(2,(e,{duration:t,onTimeout:r})=>tn(tg(e,{onTimeout:()=>ya(r),onSuccess:O,duration:t}))),DK=h(2,(e,t)=>tg(e,{duration:t,onSuccess:re,onTimeout:H})),tg=h(2,(e,{duration:t,onSuccess:r,onTimeout:i})=>Nn((n)=>Gt((o)=>z0(o(e),ts(uu(t)),{onSelfWin:(s,c)=>E(s.await,(u)=>{if(u._tag==="Success")return E(s.inheritAll,()=>kt(rn(c,n),r(u.value)));else return E(rn(c,n),()=>pt(u.cause))}),onOtherWin:(s,c)=>E(s.await,(u)=>{if(u._tag==="Success")return E(s.inheritAll,()=>kt(rn(c,n),i()));else return E(rn(c,n),()=>pt(u.cause))}),otherScope:Gi})))),fhe="effect/Ref/SynchronizedRef",ghe=Symbol.for(fhe),hhe={_A:(e)=>e};class MK extends Ea{ref;withLock;[ghe]=hhe;[yS]=yD;[Aa]=Aa;constructor(e,t){super();this.ref=e,this.withLock=t,this.get=Ur(this.ref)}get;commit(){return this.get}modify(e){return this.modifyEffect((t)=>O(e(t)))}modifyEffect(e){return this.withLock(v(E(Ur(this.ref),e),E(([t,r])=>kt(To(this.ref,r),t))))}}var av=(e)=>q(()=>tM(e)),tM=(e)=>{let t=Ip(e),r=iv(1);return new MK(t,r.withPermits(1))},yhe=h(2,(e,t)=>e.modifyEffect((r)=>{let i=t(r);switch(i._tag){case"None":return O([r,r]);case"Some":return W(i.value,(n)=>[n,n])}})),FK=h(2,(e,t)=>rg(e,t,(r,i)=>[r,i])),$K=h(2,(e,t)=>rg(e,t,(r,i)=>r)),jK=h(2,(e,t)=>rg(e,t,(r,i)=>i)),rg=h(3,(e,t,r)=>({...Zx,commit(){return Ar(this)},[ds]:Ap,id:()=>v(e.id(),rx(t.id())),await:v(e.await,tn,Co(tn(t.await),r,{concurrent:!0}),Pt),children:e.children,inheritAll:st(t.inheritAll,e.inheritAll),poll:Xn(e.poll,t.poll,(i,n)=>v(i,xc((o)=>v(n,Gn((s)=>oG(o,s,{onSuccess:r,onFailure:Xr})))))),interruptAsFork:(i)=>st(e.interruptAsFork(i),t.interruptAsFork(i)),pipe(){return ae(this,arguments)}})),NK=h((e)=>mt(e[0]),(e,t,r)=>E(e,(i)=>Ma(t(i),r).pipe(W((n)=>Object.assign({},i,n)))));var zK=Symbol.for("effect/ManagedRuntime");var LK="Fresh",BK="FromEffect",UK="Scoped",qK="Suspend",JK="Provide",HK="ProvideMerge",WK="MergeAll";var Ss={};pi(Ss,{FiberTypeId:()=>She,Order:()=>whe,RuntimeFiberTypeId:()=>vhe,all:()=>Rhe,await:()=>Ehe,awaitAll:()=>Che,children:()=>Phe,done:()=>Ahe,dump:()=>_he,dumpAll:()=>Ohe,fail:()=>Dhe,failCause:()=>Mhe,fromEffect:()=>Fhe,getCurrentFiber:()=>$he,id:()=>The,inheritAll:()=>jhe,interrupt:()=>Nhe,interruptAll:()=>Bhe,interruptAllAs:()=>Uhe,interruptAs:()=>nM,interruptAsFork:()=>Lhe,interruptFork:()=>qhe,interrupted:()=>zhe,isFiber:()=>khe,isRuntimeFiber:()=>Ihe,join:()=>Jhe,joinAll:()=>Hhe,map:()=>Whe,mapEffect:()=>Zhe,mapFiber:()=>Vhe,match:()=>Ghe,never:()=>Khe,orElse:()=>Qhe,orElseEither:()=>Yhe,poll:()=>Xhe,pretty:()=>eye,roots:()=>tye,scoped:()=>nye,status:()=>iye,succeed:()=>oye,unsafeRoots:()=>rye,void:()=>sye,zip:()=>aye,zipLeft:()=>cye,zipRight:()=>uye,zipWith:()=>lye});var She=ds,vhe=$f,whe=pG,khe=dG,Ihe=Ff,The=yG,Ehe=jS;var Che=tv,Phe=mG,Rhe=Np,Ahe=du,_he=NS,Ohe=fG,Dhe=gG,Mhe=QD,Fhe=hG,$he=RG,jhe=zS,Nhe=ka,zhe=bG,nM=rn,Lhe=LS,Bhe=xG,Uhe=jf,qhe=$4,Jhe=Ar,Hhe=j4,Whe=FS,Zhe=YD,Vhe=SG,Ghe=vG,Khe=wG,Qhe=XD,Yhe=kG,Xhe=IG,eye=TG,tye=EG,rye=e0,nye=N4,iye=CG,oye=t0,sye=PG;var aye=FK,cye=$K,uye=jK,lye=rg;var Bp=(e)=>function(){if(arguments.length===1){let t=arguments[0];return(r,...i)=>e(t,r,...i)}return e.apply(this,arguments)},uv=Bp((e,t,r)=>{let i=nx(),n=[[zn,[[i,e.context]]]];if(r?.scheduler)n.push([su,[[i,r.scheduler]]]);let o=aW(e.fiberRefs,{entries:n,forkAs:i});if(r?.updateRefs)o=r.updateRefs(o,i);let s=new YS(i,o,e.runtimeFlags),c=t;if(r?.scope)c=E(yK(r.scope,_i),(l)=>st(jx(l,Nn((p)=>le(p,s.id())?$e:rn(s,p))),Sn(t,(p)=>hK(l,p))));let u=s.currentSupervisor;if(u!==hu)u.onStart(e.context,c,H(),s),s.addObserver((l)=>u.onEnd(l,s));if(Gi.add(e.runtimeFlags,s),r?.immediate===!1)s.resume(c);else s.start(c);return s}),oM=Bp((e,t,r={})=>{let i=uv(e,t,r);if(r.onExit)i.addObserver((n)=>{r.onExit(n)});return(n,o)=>oM(e)(v(i,nM(n??bn)),{...o,onExit:o?.onExit?(s)=>o.onExit(rG(s)):void 0})}),pye=Bp((e,t)=>{let r=QK(e)(t);if(r._tag==="Failure")throw GK(r.effect_instruction_i0);return r.effect_instruction_i0});class ZK extends Error{fiber;_tag="AsyncFiberException";constructor(e){super(`Fiber #${e.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);this.fiber=e,this.name=this._tag,this.stack=this.message}}var dye=(e)=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let r=new ZK(e);return Error.stackTraceLimit=t,r};var iM=Symbol.for("effect/Runtime/FiberFailure"),cv=Symbol.for("effect/Runtime/FiberFailure/Cause");class VK extends Error{[iM];[cv];constructor(e){let t=Wb(e)[0];super(t?.message||"An error has occurred");if(this[iM]=iM,this[cv]=e,this.name=t?`(FiberFailure) ${t.name}`:"FiberFailure",t?.stack)this.stack=t.stack}toJSON(){return{_id:"FiberFailure",cause:this[cv].toJSON()}}toString(){return"(FiberFailure) "+Zo(this[cv],{renderErrorCause:!0})}[qe](){return this.toString()}}var GK=(e)=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let r=new VK(e);return Error.stackTraceLimit=t,r};var KK=(e)=>{let t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return lp(t.left);case"Right":return Rt(t.right);case"Some":return Rt(t.value);case"None":return lp(new Ln)}},QK=Bp((e,t)=>{let r=KK(t);if(r)return r;let i=new SD,n=uv(e)(t,{scheduler:i});i.flush();let o=n.unsafePoll();if(o)return o;return CO(vx(dye(n),zx(n)))}),mye=Bp((e,t,r)=>YK(e,t,r).then((i)=>{switch(i._tag){case Wt:return i.effect_instruction_i0;case Ht:throw GK(i.effect_instruction_i0)}})),YK=Bp((e,t,r)=>new Promise((i)=>{let n=KK(t);if(n)i(n);let o=uv(e)(t);if(o.addObserver((s)=>{i(s)}),r?.signal!==void 0)if(r.signal.aborted)o.unsafeInterruptAsFork(o.id());else r.signal.addEventListener("abort",()=>{o.unsafeInterruptAsFork(o.id())},{once:!0})}));class sM{context;runtimeFlags;fiberRefs;constructor(e,t,r){this.context=e,this.runtimeFlags=t,this.fiberRefs=r}pipe(){return ae(this,arguments)}}var fye=(e)=>new sM(e.context,e.runtimeFlags,e.fiberRefs),lv=()=>Qe((e,t)=>O(new sM(e.getFiberRef(zn),t.runtimeFlags,e.getFiberRefs()))),gye=eO(Ui,Q_,K_),vs=fye({context:Qn(),runtimeFlags:gye,fiberRefs:cW()});var XK=oM(vs),e3=uv(vs),t3=mye(vs),r3=YK(vs),n3=pye(vs),i3=QK(vs),o3=(e)=>we(()=>{let t=void 0;return E(ri(),(r)=>E(lv(),(i)=>Gt((n)=>st(bs(n(Dt(e((o)=>oM(i)(wo(o,r))),{onFailure:(o)=>vf(r,o),onSuccess:(o)=>(t=o,$e)}))),n(ko(kr(r),()=>t??$e))))))});var a3=h(2,(e,t)=>e.modifyEffect(t));var yye="effect/Layer",l3=Symbol.for(yye),bye={_RIn:(e)=>e,_E:(e)=>e,_ROut:(e)=>e},Up={[l3]:bye,pipe(){return ae(this,arguments)}},xye="effect/Layer/MemoMap",aM=Symbol.for(xye),Sye=go()("effect/Layer/CurrentMemoMap",{defaultValue:()=>Iye()}),vye=(e)=>pe(e,l3),wye=(e)=>e._op_layer===LK;class cM{ref;[aM];constructor(e){this.ref=e,this[aM]=aM}getOrElseMemoize(e,t){return v(a3(this.ref,(r)=>{let i=r.get(e);if(i!==void 0){let[n,o]=i,s=v(n,E(([c,u])=>v(cu(c),kt(u))),Sn(Yc({onFailure:()=>$e,onSuccess:()=>Vc(t,o)})));return O([s,r])}return v(iu(0),E((n)=>v(ri(),E((o)=>v(iu(()=>$e),W((s)=>{let c=Gt((l)=>v(XS(),E((p)=>v(l(E(d3(e,p,!0),(m)=>Ep(m(this)))),Pt,E((m)=>{switch(m._tag){case Ht:return v(vf(o,m.effect_instruction_i0),st(Gc(p,m)),st(tt(m.effect_instruction_i0)));case Wt:return v(To(s,(f)=>v(Gc(p,f),sp(bD(n,(g)=>[g===1,g-1])),$t)),st(ou(n,(f)=>f+1)),st(Vc(t,(f)=>v(q(()=>r.delete(e)),st(Ur(s)),E((g)=>g(f))))),st(AO(o,m.effect_instruction_i0)),kt(m.effect_instruction_i0[1]))}}))))),u=[v(kr(o),Sn(pp({onFailure:()=>$e,onSuccess:()=>ou(n,(l)=>l+1)}))),(l)=>v(Ur(s),E((p)=>p(l)))];return[c,wye(e)?r:r.set(e,u)]}))))))}),tn)}}var kye=we(()=>W(av(new Map),(e)=>new cM(e))),Iye=()=>new cM(tM(new Map));var p3=h(2,(e,t)=>E(kye,(r)=>Tye(e,r,t))),Tye=h(3,(e,t,r)=>E(d3(e,r),(i)=>_a(i(t),Sye,t))),d3=(e,t,r=!1)=>{let i=e;switch(i._op_layer){case"Locally":return q(()=>(n)=>i.f(n.getOrElseMemoize(i.self,t)));case"ExtendScope":return q(()=>(n)=>bu((o)=>n.getOrElseMemoize(i.layer,o)));case"Fold":return q(()=>(n)=>v(n.getOrElseMemoize(i.layer,t),Dt({onFailure:(o)=>n.getOrElseMemoize(i.failureK(o),t),onSuccess:(o)=>n.getOrElseMemoize(i.successK(o),t)})));case"Fresh":return q(()=>(n)=>v(i.layer,p3(t)));case"FromEffect":return r?q(()=>(n)=>i.effect):q(()=>(n)=>n.getOrElseMemoize(e,t));case"Provide":return q(()=>(n)=>v(n.getOrElseMemoize(i.first,t),E((o)=>v(n.getOrElseMemoize(i.second,t),Wi(o)))));case"Scoped":return r?q(()=>(n)=>$a(i.effect,t)):q(()=>(n)=>n.getOrElseMemoize(e,t));case"Suspend":return q(()=>(n)=>n.getOrElseMemoize(i.evaluate(),t));case"ProvideMerge":return q(()=>(n)=>v(n.getOrElseMemoize(i.first,t),Xn(n.getOrElseMemoize(i.second,t),i.zipK)));case"ZipWith":return Px(function*(){let n=yield*ti(t,Tf),o=yield*ti(n,_i),s=yield*ti(n,_i);return(c)=>v(c.getOrElseMemoize(i.first,o),Co(c.getOrElseMemoize(i.second,s),i.zipK,{concurrent:!0}))});case"MergeAll":{let n=i.layers;return W(ti(t,Tf),(o)=>(s)=>{let c=Array(n.length);return W(ys(n,ap(function*(u,l){let p=yield*ti(o,_i),m=yield*s.getOrElseMemoize(u,p);c[l]=m}),!1,!1),()=>l2(...c))})}}};var Eye=()=>pv(Bn());var uM=h(2,(e,t)=>{let r=Wm(e),i=r?e:t;return pv(W(r?t:e,(o)=>$c(i,o)))});function pv(e){let t=Object.create(Up);return t._op_layer=BK,t.effect=e,t}var m3=(...e)=>{let t=Object.create(Up);return t._op_layer=WK,t.layers=e,t};var lM=h(2,(e,t)=>{let r=Wm(e),i=r?e:t;return Cye(W(r?t:e,(o)=>$c(i,o)))});var Cye=(e)=>{let t=Object.create(Up);return t._op_layer=UK,t.effect=e,t};var f3=h(2,(e,t)=>{let r=Wm(e);return pv(O($c(r?e:t,r?t:e)))});var Pye=(e)=>{let t=Object.create(Up);return t._op_layer=qK,t.evaluate=e,t},g3=h(2,(e,t)=>{let r=Wm(e),i=r?e:t,n=r?t:e;return pv(q(()=>$c(i,n())))});var pM=h(2,(e,t)=>Pye(()=>{let r=Object.create(Up);return r._op_layer=JK,r.first=Object.create(Up,{_op_layer:{value:HK,enumerable:!0},first:{value:Eye(),enumerable:!0},second:{value:Array.isArray(t)?m3(...t):t},zipK:{value:(i,n)=>v(i,Go(n))}}),r.second=e,r}));var c3=h(2,(e,t)=>Yf((r)=>E(p3(t,r),(i)=>Nx(e,i)))),u3=h(2,(e,t)=>{let r=tu(vs.fiberRefs,t.fiberRefs),i=Ei(vs.runtimeFlags,t.runtimeFlags);return Gt((n)=>Qe((o)=>{let s=o.getFiberRef(zn),c=o.getFiberRefs(),u=ru(o.id(),c)(r),l=o.currentRuntimeFlags,p=Qo(i)(l),m=tu(u,c),f=Ei(p,l);return o.setFiberRefs(u),o.currentRuntimeFlags=p,oi(Nx(n(e),Go(s,t.context)),Qe((g)=>(g.setFiberRefs(ru(g.id(),g.getFiberRefs())(m)),g.currentRuntimeFlags=Qo(f)(g.currentRuntimeFlags),$e)))}))}),dv=h(2,(e,t)=>{if(Array.isArray(t))return c3(e,m3(...t));else if(vye(t))return c3(e,t);else if(u2(t))return Nx(e,t);else if(zK in t)return E(t.runtimeEffect,(r)=>u3(e,r));else return u3(e,t)});var y3=W(ei(er),$n(ss)),b3=(e)=>Br(er,(t)=>e($n(t,ss))),x3=h(2,(e,t)=>wr(e,er,Ot(ss,t))),S3=(e)=>Oi(er,Ot(ss,e));var v3=AH;var _ye="effect/Schedule",I3=Symbol.for(_ye),T3=(e)=>pe(e,I3),Oye="effect/ScheduleDriver",Dye=Symbol.for(Oye),dM={start:0,now:0,input:void 0,output:void 0,elapsed:la,elapsedSincePrevious:la,recurrence:0},ng=go()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>dM}),Mye={_Out:(e)=>e,_In:(e)=>e,_R:(e)=>e},Fye={_Out:(e)=>e,_In:(e)=>e,_R:(e)=>e};class E3{initial;step;[I3]=Mye;constructor(e,t){this.initial=e,this.step=t}pipe(){return ae(this,arguments)}}var w3=(e,t,r,i)=>ou(e,(n)=>n.recurrence===0?{now:t,input:r,output:i,recurrence:n.recurrence+1,elapsed:la,elapsedSincePrevious:la,start:t}:{now:t,input:r,output:i,recurrence:n.recurrence+1,elapsed:ua(t-n.start),elapsedSincePrevious:ua(t-n.now),start:n.start});class C3{schedule;ref;[Dye]=Fye;constructor(e,t){this.schedule=e,this.ref=t}get state(){return W(Ur(this.ref),(e)=>e[1])}get last(){return E(Ur(this.ref),([e,t])=>{switch(e._tag){case"None":return Pi(()=>new Ln);case"Some":return O(e.value)}})}iterationMeta=Ip(dM);get reset(){return To(this.ref,[H(),this.schedule.initial]).pipe(Jc(To(this.iterationMeta,dM)))}next(e){return v(W(Ur(this.ref),(t)=>t[1]),E((t)=>v(yp,E((r)=>v(we(()=>this.schedule.step(r,e,t)),E(([i,n,o])=>{let s=To(this.ref,[re(n),i]);if(eg(o))return s.pipe(st(Ge(H())));let c=iK(o.intervals)-r;if(c<=0)return s.pipe(st(w3(this.iterationMeta,r,e,n)),kt(n));let u=ua(c);return v(s,st(w3(this.iterationMeta,r,e,n)),st(uu(u)),kt(n))}))))))}}var og=(e,t)=>new E3(e,t);var $ye=(e)=>R3(e,ao);var jye=h(2,(e,t)=>fM(e,(r,i)=>q(()=>t(r,i)))),fM=h(2,(e,t)=>og(e.initial,(r,i,n)=>E(e.step(r,i,n),([o,s,c])=>{if(eg(c))return O([o,s,Lp]);return W(t(i,s),(u)=>u?[o,s,c]:[o,s,Lp])})));var gM=(e)=>v(iu([H(),e.initial]),W((t)=>new C3(e,t)));var P3=h(2,(e,t)=>Nye(e,t,nK)),Nye=h(3,(e,t,r)=>og([e.initial,t.initial],(i,n,o)=>v(Xn(e.step(i,n,o[0]),t.step(i,n,o[1]),(s,c)=>[s,c]),E(([[s,c,u],[l,p,m]])=>{if(Z0(u)&&Z0(m))return mM(e,t,n,s,c,u.intervals,l,p,m.intervals,r);return O([[s,l],[c,p],Lp])})))),mM=(e,t,r,i,n,o,s,c,u,l)=>{let p=l(o,u);if(sK(p))return O([[i,s],[n,c],fK(p)]);if(v(o,oK(u)))return E(e.step(H0(o),r,i),([m,f,g])=>{if(eg(g))return O([[m,s],[f,c],Lp]);return mM(e,t,r,m,f,g.intervals,s,c,u,l)});return E(t.step(H0(u),r,s),([m,f,g])=>{if(eg(g))return O([[i,m],[n,f],Lp]);return mM(e,t,r,i,n,o,m,f,g.intervals,l)})};var R3=h(2,(e,t)=>zye(e,(r)=>q(()=>t(r)))),zye=h(2,(e,t)=>og(e.initial,(r,i,n)=>E(e.step(r,i,n),([o,s,c])=>W(t(s),(u)=>[o,u,c]))));var Lye=(e)=>og(e.initial,(t,r,i)=>v(e.step(t,r,i),W(([n,o,s])=>[n,r,s])));var hM=(e)=>Uye(vM,(t)=>t<e);var Bye=(e,t)=>og(e,(r,i,n)=>q(()=>[t(n),n,gK(K4(r))]));var A3=h(2,(e,t)=>fM(e,(r,i)=>PS(t(r))));var _3=h(2,(e,t)=>fM(e,(r,i)=>t(r))),Uye=h(2,(e,t)=>jye(e,(r,i)=>t(i)));var mv=Symbol.for("effect/Schedule/ScheduleDefect");class O3{error;[mv];constructor(e){this.error=e,this[mv]=mv}}var qye=(e)=>pe(e,mv),fv=(e)=>Ji(e,(t)=>xn(new O3(t))),Jye=(e)=>yr(Fc(e,(t)=>Lm(t)&&qye(t.defect)?re(t.defect):H()),{onNone:()=>e,onSome:(t)=>Mc(t.error)}),sg=(e)=>vo(e,(t)=>tt(Jye(t))),k3=h(2,(e,t)=>yM(e,t,(r,i)=>Ge(r))),D3=h(2,(e,t)=>{if(T3(t))return k3(e,t);let r=t.schedule??Lye(vM),i=t.while?_3(r,(s)=>{let c=t.while(s);if(typeof c==="boolean")return O(c);return fv(c)}):r,n=t.until?A3(i,(s)=>{let c=t.until(s);if(typeof c==="boolean")return O(c);return fv(c)}):i,o=t.times?P3(n,hM(t.times)).pipe(R3((s)=>s[0])):n;return sg(k3(e,o))}),yM=h(3,(e,t,r)=>E(gM(t),(i)=>dr(e,{onFailure:(n)=>r(n,H()),onSuccess:(n)=>M3(Oa(e,ng,Ur(i.iterationMeta)),i,(o,s)=>Oa(r(o,s),ng,Ur(i.iterationMeta)),n)}))),M3=(e,t,r,i)=>dr(t.next(i),{onFailure:()=>Uc(t.last),onSuccess:(n)=>dr(e,{onFailure:(o)=>r(o,re(n)),onSuccess:(o)=>M3(e,t,r,o)})}),ig=h(2,(e,t)=>bM(e,t,(r,i)=>Ge(r))),F3=h(2,(e,t)=>{if(T3(t))return ig(e,t);return sg(ig(e,gv(t)))}),gv=(e)=>{let t=e.schedule??vM,r=e.while?_3(t,(n)=>{let o=e.while(n);if(typeof o==="boolean")return O(o);return fv(o)}):t,i=e.until?A3(r,(n)=>{let o=e.until(n);if(typeof o==="boolean")return O(o);return fv(o)}):r;return e.times!==void 0?P3(i,hM(e.times)):i},bM=h(3,(e,t,r)=>E(gM(t),(i)=>$3(Oa(e,ng,Ur(i.iterationMeta)),i,(n,o)=>Oa(r(n,o),ng,Ur(i.iterationMeta))))),$3=(e,t,r)=>Ji(e,(i)=>dr(t.next(i),{onFailure:()=>v(t.last,Uc,E((n)=>r(i,n))),onSuccess:()=>$3(e,t,r)})),xM=h(2,(e,t)=>SM(e,void 0,t)),SM=h(3,(e,t,r)=>E(gM(r),(i)=>j3(Oa(e,ng,Ur(i.iterationMeta)),t,i))),j3=(e,t,r)=>dr(r.next(t),{onFailure:()=>Uc(r.last),onSuccess:()=>E(e,(i)=>j3(e,i,r))});var vM=Bye(0,(e)=>e+1),N3=$ye(hM(1));var z3=h(2,(e,t)=>sv(xM(e,t)));var U3=h(2,(e,t)=>we(()=>{let r=0,i;return E(wa({while:()=>r<t.steps.length&&(i===void 0||co(i)),body:()=>{let n=t.steps[r],o=dv(e,n.provide);if(i){let s=!1,c=o;o=we(()=>{if(s)return c;return s=!0,i}),o=sg(ig(o,B3(n,!1)))}else{let s=B3(n,!0);o=s?sg(ig(o,s)):o}return Ci(o)},step:(n)=>{i=n,r++}}),()=>i)})),B3=(e,t)=>{if(!t)return gv({schedule:e.schedule?e.schedule:e.attempts?void 0:N3,times:e.attempts,while:e.while});else if(e.attempts===1||!(e.schedule||e.attempts))return;return gv({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})};var ag=kr;var q3=RO;var J3=eH;var wM=xf;var H3=Symbol.for("effect/MutableList"),Zye={[H3]:H3,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();let r=t.value;return t=t.next,{done:e,value:r}},return(r){if(!e)e=!0;return{done:!0,value:r}}}},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Vye=(e)=>({value:e,removed:!1,prev:void 0,next:void 0}),W3=()=>{let e=Object.create(Zye);return e.head=void 0,e.tail=void 0,e._length=0,e};var Z3=(e)=>kM(e)===0,kM=(e)=>e._length;var V3=h(2,(e,t)=>{let r=Vye(t);if(e.head===void 0)e.head=r;if(e.tail===void 0)e.tail=r;else e.tail.next=r,r.prev=e.tail,e.tail=r;return e._length+=1,e}),G3=(e)=>{let t=e.head;if(t!==void 0)return Gye(e,t),t.value;return};var Gye=(e,t)=>{if(t.removed)return;if(t.removed=!0,t.prev!==void 0&&t.next!==void 0)t.prev.next=t.next,t.next.prev=t.prev;else if(t.prev!==void 0)e.tail=t.prev,t.prev.next=void 0;else if(t.next!==void 0)e.head=t.next,t.next.prev=void 0;else e.tail=void 0,e.head=void 0;if(e._length>0)e._length-=1};var K3=Symbol.for("effect/MutableQueue"),IM=Symbol.for("effect/mutable/MutableQueue/Empty"),Qye={[K3]:K3,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Yye=(e)=>{let t=Object.create(Qye);return t.queue=W3(),t.capacity=e,t};var Q3=()=>Yye(void 0);var Y3=h(2,(e,t)=>{let r=kM(e.queue);if(e.capacity!==void 0&&r===e.capacity)return!1;return V3(t)(e.queue),!0});var X3=h(2,(e,t)=>{if(Z3(e.queue))return t;return G3(e.queue)});var eQ=(e,t,r,i)=>ax({_tag:"Complete",key:e,exit:t,entryStats:r,timeToLiveMillis:i}),tQ=(e,t)=>ax({_tag:"Pending",key:e,deferred:t}),ebe=(e,t)=>ax({_tag:"Refreshing",deferred:e,complete:t}),TM=Symbol.for("effect/Cache/MapKey");class rQ{current;[TM]=TM;previous=void 0;next=void 0;constructor(e){this.current=e}[be](){return v(ue(this.current),Re(ue(this.previous)),Re(ue(this.next)),Ue(this))}[he](e){if(this===e)return!0;return tbe(e)&&le(this.current,e.current)&&le(this.previous,e.previous)&&le(this.next,e.next)}}var qp=(e)=>new rQ(e),tbe=(e)=>pe(e,TM);class nQ{head=void 0;tail=void 0;add(e){if(e!==this.tail)if(this.tail===void 0)this.head=e,this.tail=e;else{let{previous:t,next:r}=e;if(r!==void 0)if(e.next=void 0,t!==void 0)t.next=r,r.previous=t;else this.head=r,this.head.previous=void 0;this.tail.next=e,e.previous=this.tail,this.tail=e}}remove(){let e=this.head;if(e!==void 0){let t=e.next;if(t!==void 0)e.next=void 0,this.head=t,this.head.previous=void 0;else this.head=void 0,this.tail=void 0}return e}}var rbe=()=>new nQ,nbe=(e,t,r,i,n,o)=>({map:e,keys:t,accesses:r,updating:i,hits:n,misses:o}),ibe=()=>nbe(fu(),rbe(),Q3(),bo(!1),0,0),obe="effect/Cache",sbe=Symbol.for(obe),abe={_Key:(e)=>e,_Error:(e)=>e,_Value:(e)=>e},cbe="effect/ConsumerCache",ube=Symbol.for(cbe),lbe={_Key:(e)=>e,_Error:(e)=>e,_Value:(e)=>e},pbe=(e)=>e,hv=(e)=>({loadedMillis:e});class iQ{capacity;context;fiberId;lookup;timeToLive;[sbe]=abe;[ube]=lbe;cacheState;constructor(e,t,r,i,n){this.capacity=e,this.context=t,this.fiberId=r,this.lookup=i,this.timeToLive=n,this.cacheState=ibe()}get(e){return W(this.getEither(e),vb)}get cacheStats(){return q(()=>pbe({hits:this.cacheState.hits,misses:this.cacheState.misses,size:qS(this.cacheState.map)}))}getOption(e){return we(()=>yr(sr(this.cacheState.map,e),{onNone:()=>{let t=qp(e);return this.trackAccess(t),this.trackMiss(),O(H())},onSome:(t)=>this.resolveMapValue(t)}))}getOptionComplete(e){return we(()=>yr(sr(this.cacheState.map,e),{onNone:()=>{let t=qp(e);return this.trackAccess(t),this.trackMiss(),O(H())},onSome:(t)=>this.resolveMapValue(t,!0)}))}contains(e){return q(()=>Ki(this.cacheState.map,e))}entryStats(e){return q(()=>{let t=sr(this.cacheState.map,e);if(Bt(t))switch(t.value._tag){case"Complete":{let r=t.value.entryStats.loadedMillis;return re(hv(r))}case"Pending":return H();case"Refreshing":{let r=t.value.complete.entryStats.loadedMillis;return re(hv(r))}}return H()})}getEither(e){return we(()=>{let t=e,r=void 0,i=void 0,n=Kr(sr(this.cacheState.map,t));if(n===void 0)if(i=wM(this.fiberId),r=qp(t),Ki(this.cacheState.map,t))n=Kr(sr(this.cacheState.map,t));else Un(this.cacheState.map,t,tQ(r,i));if(n===void 0)return this.trackAccess(r),this.trackMiss(),W(this.lookupValueOf(e,i),Nr);else return E(this.resolveMapValue(n),yr({onNone:()=>this.getEither(e),onSome:(o)=>O(Mn(o))}))})}invalidate(e){return q(()=>{gu(this.cacheState.map,e)})}invalidateWhen(e,t){return q(()=>{let r=sr(this.cacheState.map,e);if(Bt(r)&&r.value._tag==="Complete"){if(r.value.exit._tag==="Success"){if(t(r.value.exit.value))gu(this.cacheState.map,e)}}})}get invalidateAll(){return q(()=>{this.cacheState.map=fu()})}refresh(e){return Eo((t)=>we(()=>{let r=e,i=wM(this.fiberId),n=Kr(sr(this.cacheState.map,r));if(n===void 0)if(Ki(this.cacheState.map,r))n=Kr(sr(this.cacheState.map,r));else Un(this.cacheState.map,r,tQ(qp(r),i));if(n===void 0)return $t(this.lookupValueOf(e,i));else switch(n._tag){case"Complete":{if(this.hasExpired(t,n.timeToLiveMillis)){let o=Kr(sr(this.cacheState.map,r));if(le(o,n))gu(this.cacheState.map,r);return $t(this.get(e))}return v(this.lookupValueOf(e,i),AS(()=>{let o=Kr(sr(this.cacheState.map,r));if(le(o,n)){let s=ebe(i,n);return Un(this.cacheState.map,r,s),!0}return!1}),$t)}case"Pending":return ag(n.deferred);case"Refreshing":return ag(n.deferred)}}))}set(e,t){return Eo((r)=>q(()=>{let i=r.unsafeCurrentTimeMillis(),n=e,o=OS(t),s=eQ(qp(n),o,hv(i),i+ho(vr(this.timeToLive(o))));Un(this.cacheState.map,n,s)}))}get size(){return q(()=>qS(this.cacheState.map))}get values(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push(t[1].exit.value);return e})}get entries(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push([t[0],t[1].exit.value]);return e})}get keys(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push(t[0]);return e})}resolveMapValue(e,t=!1){return Eo((r)=>{switch(e._tag){case"Complete":{if(this.trackAccess(e.key),this.hasExpired(r,e.timeToLiveMillis))return gu(this.cacheState.map,e.key.current),O(H());return this.trackHit(),W(e.exit,re)}case"Pending":{if(this.trackAccess(e.key),this.trackHit(),t)return O(H());return W(ag(e.deferred),re)}case"Refreshing":{if(this.trackAccess(e.complete.key),this.trackHit(),this.hasExpired(r,e.complete.timeToLiveMillis)){if(t)return O(H());return W(ag(e.deferred),re)}return W(e.complete.exit,re)}}})}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(e){if(Y3(this.cacheState.accesses,e),Vb(this.cacheState.updating,!1,!0)){let t=!0;while(t){let i=X3(this.cacheState.accesses,IM);if(i===IM)t=!1;else this.cacheState.keys.add(i)}let r=qS(this.cacheState.map);t=r>this.capacity;while(t){let i=this.cacheState.keys.remove();if(i!==void 0){if(Ki(this.cacheState.map,i.current))gu(this.cacheState.map,i.current),r=r-1,t=r>this.capacity}else t=!1}Ti(this.cacheState.updating,!1)}}hasExpired(e,t){return e.unsafeCurrentTimeMillis()>t}lookupValueOf(e,t){return Eo((r)=>we(()=>{let i=e;return v(this.lookup(e),Wi(this.context),Pt,E((n)=>{let o=r.unsafeCurrentTimeMillis(),s=hv(o),c=eQ(qp(i),n,s,o+ho(vr(this.timeToLive(n))));return Un(this.cacheState.map,i,c),st(q3(t,n),n)}),ko(()=>st(J3(t),q(()=>{gu(this.cacheState.map,i)}))))}))}}var oQ=(e,t,r)=>new iQ(e,Qn(),Xb,t,(i)=>vr(r(i)));var EM=Fe(Symbol.for("effect/FiberRef/currentCache"),()=>Ut(oQ(65536,()=>W(ri(),(e)=>({listeners:new Jf,handle:e})),()=>R_(60)))),CM=Fe(Symbol.for("effect/FiberRef/currentCacheEnabled"),()=>Ut(!1)),sQ=(e,t)=>E(mt(t)?t:O(t),(r)=>Nn((i)=>{let n=new Proxy(e,{});return Br(CM,(o)=>{if(o){let c=Br(EM,(u)=>E(u.getEither(n),(l)=>{switch(l._tag){case"Left":{if(l.left.listeners.interrupted)return E(u.invalidateWhen(n,(p)=>p.handle===l.left.handle),()=>c);return l.left.listeners.increment(),Gt((p)=>E(Pt(Yo(aJ,p(kr(l.left.handle)))),(m)=>(l.left.listeners.decrement(),m)))}case"Right":return l.right.listeners.increment(),Gt((p)=>E(Pt(Yo(cO(r,uO({request:n,result:l.right.handle,listeners:l.right.listeners,ownerId:i,state:{completed:!1}})),p(kr(l.right.handle)))),()=>(l.right.listeners.decrement(),kr(l.right.handle))))}}));return c}let s=new Jf;return s.increment(),E(ri(),(c)=>oi(Yo(cO(r,uO({request:n,result:c,listeners:s,ownerId:i,state:{completed:!1}})),kr(c)),q(()=>s.decrement())))})})),aQ=(e,t)=>Br(CM,(r)=>{if(r)return Br(EM,(i)=>E(i.getEither(e),(n)=>{switch(n._tag){case"Left":return $e;case"Right":return PO(n.right.handle,t)}}));return $e}),cQ=h(2,(e,t)=>Xt(e,CM,t)),uQ=h(2,(e,t)=>Xt(e,EM,t));var lQ=_6;var fbe=Xo,gbe=mt,hbe=IK,ybe=Q0,bbe=_D,xbe=RK,Sbe=OD,vbe=Ma,wbe=g4,kbe=h4,Ibe=EZ,Tbe=CZ,Ebe=vV,Cbe=wV,Pbe=NZ,Rbe=d4,Abe=f4,_be=RZ,Obe=MZ,Dbe=ii,Mbe=LZ,Fbe=_0,$be=O0,jbe=pV,Nbe=mV,zbe=dV,Lbe=v4,Bbe=A0,Ube=y4,qbe=x4,Jbe=E4,Hbe=en,Wbe=o3,Zbe=cf,Vbe=Qe,Gbe=Ge,Kbe=Pi,mQ=tt,Qbe=ya,PM=xn,Ybe=ga,Xbe=ha,exe=Px,txe=Hc,rxe=iV,nxe=uV,ixe=O,RM=lu,oxe=xV,sxe=we,axe=q,cxe=$e;var uxe=Io,lxe=pZ;var pxe=Ji,dxe=vo,mxe=dZ,fxe=lf,gxe=IJ,hxe=mZ,yxe=fZ,bxe=gZ,xxe=hZ,Sxe=yZ,vxe=CD,wxe=CS,kxe=BZ,Ixe=cV,Txe=yV,Exe=F3,Cxe=U3,Pxe=bM,Rxe=ED;var Axe=RV,_xe=AV,Oxe=$D,Dxe=DV,Mxe=SZ,Fxe=TJ,$xe=z4,jxe=Ix,Nxe=Tx,zxe=ts,Lxe=EJ,Bxe=ko,Uxe=rs,qxe=Gt,Jxe=OZ,Hxe=kt,Wxe=Tp,Zxe=lZ,Vxe=$t,Gxe=xa,Kxe=jZ,xu=W,Qxe=rV,Yxe=df,Xxe=Sa,eSe=Cp,tSe=nV,rSe=PS,nSe=Fp,iSe=l4,oSe=Sx,sSe=$p,aSe=oi,cSe=Ex,uSe=Sn,lSe=KS,pSe=QS,dSe=w4,mSe=$0,fSe=bu,gSe=Yf,hSe=D0,ySe=I4,bSe=A4,xSe=kK,SSe=p4,vSe=vZ,wSe=TS,kSe=Ep,ISe=TK,TSe=ov,ESe=es,CSe=Nn,PSe=bs,RSe=jp,ASe=EK,_Se=Y0,OSe=sv,DSe=b4,MSe=CK,FSe=PK,$Se=X0,jSe=Cx,NSe=PJ,zSe=tZ,LSe=wO,BSe=BJ,USe=bZ,qSe=Eo,JSe=C4,HSe=zH,WSe=y3,ZSe=b3,VSe=S3,GSe=x3,KSe=xZ,QSe=uu,YSe=CV,XSe=FD,eve=_K,tve=DK,rve=eM,nve=OK,ive=tg,ove=BH,sve=LH,ave=R4,cve=Bn,uve=PZ,lve=Ri,pve=Xc,dve=dv,mve=_a,fve=Oa,gve=zV,hve=NV,yve=jD,bve=ND,xve=LV,Sve=BV,vve=zD,wve=MV,kve=wZ,Ive=kZ,Tve=NK,Eve=IZ,Cve=TZ;var Pve=oV,Rve=Ci,Ave=Pt,_ve=wo,Ove=kx;var Dve=AZ,Mve=_Z,Fve=_f,$ve=DZ,jve=_O,Nve=tH,zve=_V,Lve=OV,Bve=AS,Uve=sp,qve=FV,Jve=$V,Hve=E,Wve=ba,Zve=tn,Vve=rv,Gve=S4,Kve=AK,Qve=N0,Yve=Df,Xve=Hi,ewe=kV,twe=IV,rwe=MD,nwe=TV,iwe=EV,owe=PD,swe=RD,awe=XZ,cwe=D3,uwe=gV,lwe=yM,pwe=xM,dwe=z3,mwe=SM,fwe=wa,gwe=ES,hwe=UZ,ywe=Xt,bwe=wr,xwe=ev,Swe=Oi,vwe=cu,wwe=bV,kwe=RS,Iwe=qZ,Twe=JZ,Ewe=Of,Cwe=pf,Pwe=Dt,Rwe=dr,Awe=HZ,_we=(e,...t)=>ps(e)(...t),Owe=WZ,Dwe=AD,Mwe=ZZ,Fwe=VZ,$we=GZ,jwe=KZ,Nwe=QZ,zwe=uZ,Lwe=c4,Bwe=YZ,Uwe=qJ,qwe=u4,Jwe=Uc,Hwe=yO,Wwe=Bc,Zwe=sV,Vwe=aV,Gwe=$Z,Kwe=lV,Qwe=Hx,fQ=UH,Ywe=h(2,(e,t)=>fQ(e,v3(t))),Xwe=P4,eke=lv,tke=op,rke=va,nke=Rx,ike=M4,oke=SV,ske=DD,ake=k4,cke=M0,uke=JJ,lke=jV,pke=iv,dke=SK,mke=K0,fke=wK,gke=e3,hke=XK,yke=t3,bke=r3,xke=n3,Ske=i3,vke=T4,wke=F0,kke=_4,Ike=O4,Tke=D4,gQ=Co,Eke=h(2,(e,t)=>gQ(e,t,(r,i)=>r(i))),Cke=Yo,Pke=xx,Rke=wx,Ake=h((e)=>lQ(e[0]),sQ),_ke=aQ,Oke=RJ,Dke=cQ,Mke=uQ,Fke=PV,$ke=Wx,jke=qH,Nke=L4,zke=AJ,Lke=_J,Bke=JV,Uke=UV,qke=LD,Jke=BD,Hke=HV,Wke=GV,Zke=KV,Vke=WV,Gke=qV,Kke=VV,Qke=Kf,Yke=kS,hQ=qD,Xke=QV,eIe=B4,tIe=IS,rIe=YV,nIe=XV,iIe=(e)=>Ul(e)?RM:xu(e.value,Xs),oIe=h(2,(e,t)=>Ul(e)?RM:xu(t(e.value),Xs)),yQ=(e)=>{let t=new Map;return new Proxy(e,{get(r,i,n){if(i in r)return Reflect.get(r,i,n);if(t.has(i))return t.get(i);let o=(...m)=>ba(r,(f)=>{if(typeof f[i]==="function")return t.set(i,(...g)=>ba(r,(S)=>S[i](...g))),f[i](...m);return t.set(i,ba(r,(g)=>g[i])),f[i]}),s=ba(r,(m)=>m[i]);Object.assign(o,s);let{apply:c,bind:u,call:l}=o,p=Object.setPrototypeOf({},Object.getPrototypeOf(s));return p.apply=c,p.bind=u,p.call=l,Object.setPrototypeOf(o,p),t.set(i,o),o}})},sIe=(e)=>()=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let r=Error();Error.stackTraceLimit=t;function i(){}return Object.setPrototypeOf(i,Hm),i.key=e,Object.defineProperty(i,"use",{get(){return(n)=>ba(this,n)}}),Object.defineProperty(i,"stack",{get(){return r.stack}}),yQ(i)},aIe=function(){return function(){let[e,t]=arguments,r="accessors"in t?t.accessors:!1,i=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=i;let o="unchecked",s=function(m){if(o==="unchecked"){let f=Object.getPrototypeOf(m);if(f===Object.prototype||f===null)o="plain";else{let g=Object.getPrototypeOf(this);Object.setPrototypeOf(g,f),o="patched"}}if(o==="plain")Object.assign(this,m);else if(o==="patched")return Object.setPrototypeOf(m,Object.getPrototypeOf(this)),m};s.prototype._tag=e,Object.defineProperty(s,"make",{get(){return(m)=>new this(m)}}),Object.defineProperty(s,"use",{get(){return(m)=>ba(this,m)}}),s.key=e,Object.assign(s,Hm),Object.defineProperty(s,"stack",{get(){return n.stack}});let c="dependencies"in t&&t.dependencies.length>0,u=c?"DefaultWithoutDependencies":"Default",l,p=!1;if("effect"in t)p=typeof t.effect==="function",Object.defineProperty(s,u,{get(){if(p)return function(){return uM(s,xu(t.effect.apply(null,arguments),(m)=>new this(m)))}.bind(this);return l??=uM(s,xu(t.effect,(m)=>new this(m)))}});else if("scoped"in t)p=typeof t.scoped==="function",Object.defineProperty(s,u,{get(){if(p)return function(){return lM(s,xu(t.scoped.apply(null,arguments),(m)=>new this(m)))}.bind(this);return l??=lM(s,xu(t.scoped,(m)=>new this(m)))}});else if("sync"in t)Object.defineProperty(s,u,{get(){return l??=g3(s,()=>new this(t.sync()))}});else Object.defineProperty(s,u,{get(){return l??=f3(s,new this(t.succeed))}});if(c){let m;Object.defineProperty(s,"Default",{get(){if(p)return function(){return pM(this.DefaultWithoutDependencies.apply(null,arguments),t.dependencies)};return m??=pM(this.DefaultWithoutDependencies,t.dependencies)}})}return r===!0?yQ(s):s}},cIe=function(e,...t){let r=Error.stackTraceLimit;Error.stackTraceLimit=2;let i=Error();if(Error.stackTraceLimit=r,typeof e!=="string")return pQ(e.length,function(...s){let c=Error.stackTraceLimit;Error.stackTraceLimit=2;let u=Error();return Error.stackTraceLimit=c,dQ({self:this,body:e,args:s,pipeables:t,spanName:"<anonymous>",spanOptions:{context:gp.context(!0)},errorDef:i,errorCall:u})});let n=e,o=t[0];return(s,...c)=>pQ(s.length,{[n](...u){let l=Error.stackTraceLimit;Error.stackTraceLimit=2;let p=Error();return Error.stackTraceLimit=l,dQ({self:this,body:s,args:u,pipeables:c,spanName:n,spanOptions:o,errorDef:i,errorCall:p})}}[n])};function pQ(e,t){return Object.defineProperty(t,"length",{value:e,configurable:!0})}function dQ(e){let t,r=void 0;if(CU(e.body))t=sf(()=>e.body.apply(e.self,e.args));else try{t=e.body.apply(e.self,e.args)}catch(s){r=s,t=PM(s)}if(e.pipeables.length>0)try{for(let s of e.pipeables)t=s(t,...e.args)}catch(s){t=r?mQ(Vt(Sr(r),Sr(s))):PM(s)}let i=!1,n=()=>{if(i!==!1)return i;if(e.errorCall.stack){let s=e.errorDef.stack.trim().split(`
|
|
181
|
+
Status: ${m}`})),e0=()=>Array.from(Gi.roots),EG=q(e0),CG=(e)=>e.status,t0=(e)=>du(OS(e)),PG=t0(void 0);var ms="effect/FiberCurrent",RG=()=>Bo(globalThis[ms]);var wfe="effect/Logger",AG=Symbol.for(wfe),_G={_Message:(e)=>e,_Output:(e)=>e},BS=(e)=>({[AG]:_G,log:e,pipe(){return ae(this,arguments)}});var bJe={[AG]:_G,log:ao,pipe(){return ae(this,arguments)}};var kfe=/^[^\s"=]*$/,Ife=(e,t)=>({annotations:r,cause:i,date:n,fiberId:o,logLevel:s,message:c,spans:u})=>{let l=(S)=>S.match(kfe)?S:e(S),p=(S,P)=>`${wD(S)}=${l(P)}`,m=(S,P)=>" "+p(S,P),f=p("timestamp",n.toISOString());f+=m("level",s.label),f+=m("fiber",tx(o));let g=KU(c);for(let S=0;S<g.length;S++)f+=m("message",No(g[S],t));if(!Jq(i))f+=m("cause",Zo(i,{renderErrorCause:!0}));for(let S of u)f+=" "+kD(n.getTime())(S);for(let[S,P]of r)f+=m(S,No(P,t));return f},Tfe=(e)=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,OG=BS(Ife(Tfe));var mu={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},xJe={None:[],All:[],Trace:[mu.gray],Debug:[mu.blue],Info:[mu.green],Warning:[mu.yellow],Error:[mu.red],Fatal:[mu.bgBrightRed,mu.black]};var DG=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,SJe=DG&&process.stdout.isTTY===!0,vJe=DG||"Deno"in globalThis;var MG="effect/MetricBoundaries",n0=Symbol.for(MG);class FG{values;[n0]=n0;constructor(e){this.values=e,this._hash=v(lt(MG),Re(Dn(this.values)))}_hash;[be](){return this._hash}[he](e){return Cfe(e)&&le(this.values,e.values)}pipe(){return ae(this,arguments)}}var Cfe=(e)=>pe(e,n0),Pfe=(e)=>{let t=v(e,qA(Zt(Number.POSITIVE_INFINITY)),KA);return new FG(t)};var $G=(e)=>v(UA(e.count-1,(t)=>e.start*Math.pow(e.factor,t)),$m,Pfe);var Afe="effect/MetricKeyType",Nf=Symbol.for(Afe),jG="effect/MetricKeyType/Counter",i0=Symbol.for(jG),NG="effect/MetricKeyType/Frequency",o0=Symbol.for(NG),zG="effect/MetricKeyType/Gauge",s0=Symbol.for(zG),LG="effect/MetricKeyType/Histogram",a0=Symbol.for(LG),BG="effect/MetricKeyType/Summary",c0=Symbol.for(BG),zf={_In:(e)=>e,_Out:(e)=>e};class UG{incremental;bigint;[Nf]=zf;[i0]=i0;constructor(e,t){this.incremental=e,this.bigint=t,this._hash=lt(jG)}_hash;[be](){return this._hash}[he](e){return u0(e)}pipe(){return ae(this,arguments)}}var _fe=lt(NG);class Ofe{preregisteredWords;[Nf]=zf;[o0]=o0;constructor(e){this.preregisteredWords=e}[be](){return _fe}[he](e){return l0(e)}pipe(){return ae(this,arguments)}}var Dfe=lt(zG);class Mfe{bigint;[Nf]=zf;[s0]=s0;constructor(e){this.bigint=e}[be](){return Dfe}[he](e){return p0(e)}pipe(){return ae(this,arguments)}}class qG{boundaries;[Nf]=zf;[a0]=a0;constructor(e){this.boundaries=e,this._hash=v(lt(LG),Re(ue(this.boundaries)))}_hash;[be](){return this._hash}[he](e){return d0(e)&&le(this.boundaries,e.boundaries)}pipe(){return ae(this,arguments)}}class Ffe{maxAge;maxSize;error;quantiles;[Nf]=zf;[c0]=c0;constructor(e,t,r,i){this.maxAge=e,this.maxSize=t,this.error=r,this.quantiles=i,this._hash=v(lt(BG),Re(ue(this.maxAge)),Re(ue(this.maxSize)),Re(ue(this.error)),Re(Dn(this.quantiles)))}_hash;[be](){return this._hash}[he](e){return m0(e)&&le(this.maxAge,e.maxAge)&&this.maxSize===e.maxSize&&this.error===e.error&&le(this.quantiles,e.quantiles)}pipe(){return ae(this,arguments)}}var JG=(e)=>new UG(e?.incremental??!1,e?.bigint??!1);var HG=(e)=>new qG(e);var u0=(e)=>pe(e,i0),l0=(e)=>pe(e,o0),p0=(e)=>pe(e,s0),d0=(e)=>pe(e,a0),m0=(e)=>pe(e,c0);var $fe="effect/MetricKey",ZG=Symbol.for($fe),jfe={_Type:(e)=>e},Nfe=Wl(le);class US{name;keyType;description;tags;[ZG]=jfe;constructor(e,t,r,i=[]){this.name=e,this.keyType=t,this.description=r,this.tags=i,this._hash=v(lt(this.name+this.description),Re(ue(this.keyType)),Re(Dn(this.tags)))}_hash;[be](){return this._hash}[he](e){return zfe(e)&&this.name===e.name&&le(this.keyType,e.keyType)&&le(this.description,e.description)&&Nfe(this.tags,e.tags)}pipe(){return ae(this,arguments)}}var zfe=(e)=>pe(e,ZG),VG=(e,t)=>new US(e,JG(t),Bo(t?.description));var GG=(e,t,r)=>new US(e,HG(t),Bo(r));var KG=h(2,(e,t)=>t.length===0?e:new US(e.name,e.keyType,e.description,Ni(e.tags,t)));var QG=Symbol.for("effect/MutableHashMap"),Bfe={[QG]:QG,[Symbol.iterator](){return new f0(this)},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}};class f0{self;referentialIterator;bucketIterator;constructor(e){this.self=e,this.referentialIterator=e.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();let e=this.referentialIterator.next();if(e.done)return this.bucketIterator=new YG(this.self.buckets.values()),this.next();return e}[Symbol.iterator](){return new f0(this.self)}}class YG{backing;constructor(e){this.backing=e}currentBucket;next(){if(this.currentBucket===void 0){let t=this.backing.next();if(t.done)return t;this.currentBucket=t.value[Symbol.iterator]()}let e=this.currentBucket.next();if(e.done)return this.currentBucket=void 0,this.next();return e}}var fu=()=>{let e=Object.create(Bfe);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e};var sr=h(2,(e,t)=>{if(Fl(t)===!1)return e.referential.has(t)?re(e.referential.get(t)):H();let r=t[be](),i=e.buckets.get(r);if(i===void 0)return H();return Ufe(e,i,t)});var Ufe=(e,t,r,i=!1)=>{for(let n=0,o=t.length;n<o;n++)if(r[he](t[n][0])){let s=t[n][1];if(i)t.splice(n,1),e.bucketsSize--;return re(s)}return H()},Ki=h(2,(e,t)=>Bt(sr(e,t))),Un=h(3,(e,t,r)=>{if(Fl(t)===!1)return e.referential.set(t,r),e;let i=t[be](),n=e.buckets.get(i);if(n===void 0)return e.buckets.set(i,[[t,r]]),e.bucketsSize++,e;return XG(e,n,t),n.push([t,r]),e.bucketsSize++,e}),XG=(e,t,r)=>{for(let i=0,n=t.length;i<n;i++)if(r[he](t[i][0])){t.splice(i,1),e.bucketsSize--;return}};var gu=h(2,(e,t)=>{if(Fl(t)===!1)return e.referential.delete(t),e;let r=t[be](),i=e.buckets.get(r);if(i===void 0)return e;if(XG(e,i,t),i.length===0)e.buckets.delete(r);return e});var qS=(e)=>e.referential.size+e.bucketsSize;var qfe="effect/MetricState",Lf=Symbol.for(qfe),e6="effect/MetricState/Counter",h0=Symbol.for(e6),t6="effect/MetricState/Frequency",y0=Symbol.for(t6),r6="effect/MetricState/Gauge",b0=Symbol.for(r6),n6="effect/MetricState/Histogram",x0=Symbol.for(n6),i6="effect/MetricState/Summary",S0=Symbol.for(i6),Bf={_A:(e)=>e};class o6{count;[Lf]=Bf;[h0]=h0;constructor(e){this.count=e}[be](){return v(ue(e6),Re(ue(this.count)),Ue(this))}[he](e){return Hfe(e)&&this.count===e.count}pipe(){return ae(this,arguments)}}var Jfe=Wl(le);class s6{occurrences;[Lf]=Bf;[y0]=y0;constructor(e){this.occurrences=e}_hash;[be](){return v(lt(t6),Re(Dn(ot(this.occurrences.entries()))),Ue(this))}[he](e){return Wfe(e)&&Jfe(ot(this.occurrences.entries()),ot(e.occurrences.entries()))}pipe(){return ae(this,arguments)}}class a6{value;[Lf]=Bf;[b0]=b0;constructor(e){this.value=e}[be](){return v(ue(r6),Re(ue(this.value)),Ue(this))}[he](e){return Zfe(e)&&this.value===e.value}pipe(){return ae(this,arguments)}}class c6{buckets;count;min;max;sum;[Lf]=Bf;[x0]=x0;constructor(e,t,r,i,n){this.buckets=e,this.count=t,this.min=r,this.max=i,this.sum=n}[be](){return v(ue(n6),Re(ue(this.buckets)),Re(ue(this.count)),Re(ue(this.min)),Re(ue(this.max)),Re(ue(this.sum)),Ue(this))}[he](e){return Vfe(e)&&le(this.buckets,e.buckets)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return ae(this,arguments)}}class u6{error;quantiles;count;min;max;sum;[Lf]=Bf;[S0]=S0;constructor(e,t,r,i,n,o){this.error=e,this.quantiles=t,this.count=r,this.min=i,this.max=n,this.sum=o}[be](){return v(ue(i6),Re(ue(this.error)),Re(ue(this.quantiles)),Re(ue(this.count)),Re(ue(this.min)),Re(ue(this.max)),Re(ue(this.sum)),Ue(this))}[he](e){return Gfe(e)&&this.error===e.error&&le(this.quantiles,e.quantiles)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return ae(this,arguments)}}var l6=(e)=>new o6(e),p6=(e)=>new s6(e),d6=(e)=>new a6(e),m6=(e)=>new c6(e.buckets,e.count,e.min,e.max,e.sum),f6=(e)=>new u6(e.error,e.quantiles,e.count,e.min,e.max,e.sum);var Hfe=(e)=>pe(e,h0),Wfe=(e)=>pe(e,y0),Zfe=(e)=>pe(e,b0),Vfe=(e)=>pe(e,x0),Gfe=(e)=>pe(e,S0);var Qfe="effect/MetricHook",Yfe=Symbol.for(Qfe),Xfe={_In:(e)=>e,_Out:(e)=>e},Uf=(e)=>({[Yfe]:Xfe,pipe(){return ae(this,arguments)},...e});var g6=BigInt(0),y6=(e)=>{let t=e.keyType.bigint?g6:0,r=e.keyType.incremental?e.keyType.bigint?(n)=>n>=g6:(n)=>n>=0:(n)=>!0,i=(n)=>{if(r(n))t=t+n};return Uf({get:()=>l6(t),update:i,modify:i})},b6=(e)=>{let t=new Map;for(let i of e.keyType.preregisteredWords)t.set(i,0);let r=(i)=>{let n=t.get(i)??0;t.set(i,n+1)};return Uf({get:()=>p6(t),update:r,modify:r})},x6=(e,t)=>{let r=t;return Uf({get:()=>d6(r),update:(i)=>{r=i},modify:(i)=>{r=r+i}})},S6=(e)=>{let t=e.keyType.boundaries.values,r=t.length,i=new Uint32Array(r+1),n=new Float64Array(r),o=0,s=0,c=Number.MAX_VALUE,u=Number.MIN_VALUE;v(t,Sc(Zi),lo((m,f)=>{n[f]=m}));let l=(m)=>{let f=0,g=r;while(f!==g){let S=Math.floor(f+(g-f)/2),P=n[S];if(m<=P)g=S;else f=S;if(g===f+1)if(m<=n[f])g=f;else f=g}if(i[f]=i[f]+1,o=o+1,s=s+m,m<c)c=m;if(m>u)u=m},p=()=>{let m=Mm(r),f=0;for(let g=0;g<r;g++){let S=n[g],P=i[g];f=f+P,m[g]=[S,f]}return m};return Uf({get:()=>m6({buckets:p(),count:o,min:c,max:u,sum:s}),update:l,modify:l})},v6=(e)=>{let{error:t,maxAge:r,maxSize:i,quantiles:n}=e.keyType,o=v(n,Sc(Zi)),s=Mm(i),c=0,u=0,l=0,p=0,m=0,f=(S)=>{let P=[],D=0;while(D!==i-1){let L=s[D];if(L!=null){let[Se,Q]=L,se=ua(S-Se);if(__(se,la)&&y2(se,r))P.push(Q)}D=D+1}return ege(t,o,Sc(P,Zi))},g=(S,P)=>{if(i>0){c=c+1;let D=c%i;s[D]=[P,S]}p=u===0?S:Math.min(p,S),m=u===0?S:Math.max(m,S),u=u+1,l=l+S};return Uf({get:()=>f6({error:t,quantiles:f(Date.now()),count:u,min:p,max:m,sum:l}),update:([S,P])=>g(S,P),modify:([S,P])=>g(S,P)})},ege=(e,t,r)=>{let i=r.length;if(!Qr(t))return zi();let n=t[0],o=t.slice(1),s=h6(e,i,H(),0,n,r),c=gn(s);return o.forEach((u)=>{c.push(h6(e,i,s.value,s.consumed,u,s.rest))}),lo(c,(u)=>[u.quantile,u.value])},h6=(e,t,r,i,n,o)=>{let s=e,c=t,u=r,l=i,p=n,m=o,f=e,g=t,S=r,P=i,D=n,L=o;while(!0){if(!Qr(m))return{quantile:p,value:H(),consumed:l,rest:[]};if(p===1)return{quantile:p,value:re(HA(m)),consumed:l+m.length,rest:[]};let Se=Er(m),Q=eq(m,(Te)=>Te===Se),se=p*c,me=s/2*se,F=l+Q[0].length,Be=Math.abs(F-se);if(F<se-me){f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}if(F>se+me){let Te=Ft(u)?re(Se):u;return{quantile:p,value:Te,consumed:l,rest:m}}switch(u._tag){case"None":{f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}case"Some":{let Te=Math.abs(se-u.value);if(Be<Te){f=s,g=c,S=ea(m),P=F,D=p,L=Q[1],s=f,c=g,u=S,l=P,p=D,m=L;continue}return{quantile:p,value:re(u.value),consumed:l,rest:m}}}}throw Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")};var rge="effect/MetricPair",nge=Symbol.for(rge),ige={_Type:(e)=>e};var w6=(e,t)=>({[nge]:ige,metricKey:e,metricState:t,pipe(){return ae(this,arguments)}});var sge="effect/MetricRegistry",k6=Symbol.for(sge);class I6{[k6]=k6;map=fu();snapshot(){let e=[];for(let[t,r]of this.map)e.push(w6(t,r.get()));return e}get(e){let t=v(this.map,sr(e),Kr);if(t==null){if(u0(e.keyType))return this.getCounter(e);if(p0(e.keyType))return this.getGauge(e);if(l0(e.keyType))return this.getFrequency(e);if(d0(e.keyType))return this.getHistogram(e);if(m0(e.keyType))return this.getSummary(e);throw Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}else return t}getCounter(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=y6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getFrequency(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=b6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getGauge(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=x6(e,e.keyType.bigint?BigInt(0):0);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getHistogram(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=S6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}getSummary(e){let t=v(this.map,sr(e),Kr);if(t==null){let r=v6(e);if(!v(this.map,Ki(e)))v(this.map,Un(e,r));t=r}return t}}var T6=()=>new I6;var cge="effect/Metric",uge=Symbol.for(cge),lge={_Type:(e)=>e,_In:(e)=>e,_Out:(e)=>e},E6=Fe(Symbol.for("effect/Metric/globalMetricRegistry"),()=>T6()),C6=function(e,t,r,i){let n=Object.assign((o)=>Hi(o,(s)=>dge(n,s)),{[uge]:lge,keyType:e,unsafeUpdate:t,unsafeValue:r,unsafeModify:i,register(){return this.unsafeValue([]),this},pipe(){return ae(this,arguments)}});return n};var qf=(e,t)=>P6(VG(e,t));var P6=(e)=>{let t,r=new WeakMap,i=(n)=>{if(n.length===0){if(t!==void 0)return t;return t=E6.get(e),t}let o=r.get(n);if(o!==void 0)return o;return o=E6.get(KG(e,n)),r.set(n,o),o};return C6(e.keyType,(n,o)=>i(o).update(n),(n)=>i(n).get(),(n,o)=>i(o).modify(n))};var R6=(e,t,r)=>P6(GG(e,t,r));var A6=h(3,(e,t,r)=>pge(e,[au(t,r)]));var pge=h(2,(e,t)=>C6(e.keyType,(r,i)=>e.unsafeUpdate(r,Ni(t,i)),(r)=>e.unsafeValue(Ni(t,r)),(r,i)=>e.unsafeModify(r,Ni(t,i))));var dge=h(2,(e,t)=>Br(is,(r)=>q(()=>e.unsafeUpdate(t,r))));var fge="effect/Request",v0=Symbol.for(fge),gge={_E:(e)=>e,_A:(e)=>e},XJe={...Bl,[v0]:gge},_6=(e)=>pe(e,v0);var w0=h(2,(e,t)=>Br(wS,(r)=>q(()=>{if(r.has(e)){let i=r.get(e);if(!i.state.completed)i.state.completed=!0,wf(i.result,t)}})));class Jf{count=0;observers=new Set;interrupted=!1;addObserver(e){this.observers.add(e)}removeObserver(e){this.observers.delete(e)}increment(){this.count++,this.observers.forEach((e)=>e(this.count))}decrement(){this.count--,this.observers.forEach((e)=>e(this.count))}}var Da={Forward:0,Backward:1};class Hf{self;stack;direction;count=0;constructor(e,t,r){this.self=e,this.stack=t,this.direction=r}clone(){return new Hf(this.self,this.stack.slice(),this.direction)}reversed(){return new Hf(this.self,this.stack.slice(),this.direction===Da.Forward?Da.Backward:Da.Forward)}next(){let e=this.entry;if(this.count++,this.direction===Da.Forward)this.moveNext();else this.movePrev();switch(e._tag){case"None":return{done:!0,value:this.count};case"Some":return{done:!1,value:e.value}}}get key(){if(this.stack.length>0)return re(this.stack[this.stack.length-1].key);return H()}get value(){if(this.stack.length>0)return re(this.stack[this.stack.length-1].value);return H()}get entry(){return Gn(Ib(this.stack),(e)=>[e.key,e.value])}get index(){let e=0,t=this.stack;if(t.length===0){let r=this.self._root;if(r!=null)return r.count;return 0}else if(t[t.length-1].left!=null)e=t[t.length-1].left.count;for(let r=t.length-2;r>=0;--r)if(t[r+1]===t[r].right){if(++e,t[r].left!=null)e+=t[r].left.count}return e}moveNext(){let e=this.stack;if(e.length===0)return;let t=e[e.length-1];if(t.right!=null){t=t.right;while(t!=null)e.push(t),t=t.left}else{e.pop();while(e.length>0&&e[e.length-1].right===t)t=e[e.length-1],e.pop()}}get hasNext(){let e=this.stack;if(e.length===0)return!1;if(e[e.length-1].right!=null)return!0;for(let t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}movePrev(){let e=this.stack;if(e.length===0)return;let t=e[e.length-1];if(t!=null&&t.left!=null){t=t.left;while(t!=null)e.push(t),t=t.right}else{e.pop();while(e.length>0&&e[e.length-1].left===t)t=e[e.length-1],e.pop()}}get hasPrev(){let e=this.stack;if(e.length===0)return!1;if(e[e.length-1].left!=null)return!0;for(let t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}}var Ae={Red:0,Black:1},Qi=({color:e,count:t,key:r,left:i,right:n,value:o})=>({color:e,key:r,value:o,left:i,right:n,count:t});function k0(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e.color=t.color,e.count=t.count}var fs=({count:e,key:t,left:r,right:i,value:n},o)=>({color:o,key:t,value:n,left:r,right:i,count:e}),jt=(e)=>{e.count=1+(e.left?.count??0)+(e.right?.count??0)};var O6="effect/RedBlackTree",I0=Symbol.for(O6),bge={_Key:(e)=>e,_Value:(e)=>e},xge={[I0]:bge,[be](){let e=ue(O6);for(let t of this)e^=v(ue(t[0]),Re(ue(t[1])));return Ue(this,e)},[he](e){if(D6(e)){if((this._root?.count??0)!==(e._root?.count??0))return!1;let t=Array.from(e);return Array.from(this).every((r,i)=>{let n=t[i];return le(r[0],n[0])&&le(r[1],n[1])})}return!1},[Symbol.iterator](){let e=[],t=this._root;while(t!=null)e.push(t),t=t.left;return new Hf(this,e,Da.Forward)},toString(){return it(this.toJSON())},toJSON(){return{_id:"RedBlackTree",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Wf=(e,t)=>{let r=Object.create(xge);return r._ord=e,r._root=t,r},D6=(e)=>pe(e,I0);var M6=h(2,(e,t)=>{let{_ord:r,_root:i}=e;while(i!==void 0){let n=r(t,i.key);if(le(t,i.key))return re(i.value);if(n<=0)i=i.left;else i=i.right}return H()});var T0=h(2,(e,t)=>Bt(M6(e,t))),F6=h(3,(e,t,r)=>{let{_ord:i,_root:n}=e,o=[],s=[];while(n!=null){let c=i(t,n.key);if(o.push(n),s.push(c),c<=0)n=n.left;else n=n.right}o.push({color:Ae.Red,key:t,value:r,left:void 0,right:void 0,count:1});for(let c=o.length-2;c>=0;--c){let u=o[c];if(s[c]<=0)o[c]={color:u.color,key:u.key,value:u.value,left:o[c+1],right:u.right,count:u.count+1};else o[c]={color:u.color,key:u.key,value:u.value,left:u.left,right:o[c+1],count:u.count+1}}for(let c=o.length-1;c>1;--c){let u=o[c-1],l=o[c];if(u.color===Ae.Black||l.color===Ae.Black)break;let p=o[c-2];if(p.left===u)if(u.left===l){let m=p.right;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.right=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(p.color=Ae.Red,p.left=u.right,u.color=Ae.Black,u.right=p,o[c-2]=u,o[c-1]=l,jt(p),jt(u),c>=3){let f=o[c-3];if(f.left===p)f.left=u;else f.right=u}break}}else{let m=p.right;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.right=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(u.right=l.left,p.color=Ae.Red,p.left=l.right,l.color=Ae.Black,l.left=u,l.right=p,o[c-2]=l,o[c-1]=u,jt(p),jt(u),jt(l),c>=3){let f=o[c-3];if(f.left===p)f.left=l;else f.right=l}break}}else if(u.right===l){let m=p.left;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.left=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(p.color=Ae.Red,p.right=u.left,u.color=Ae.Black,u.left=p,o[c-2]=u,o[c-1]=l,jt(p),jt(u),c>=3){let f=o[c-3];if(f.right===p)f.right=u;else f.left=u}break}}else{let m=p.left;if(m&&m.color===Ae.Red)u.color=Ae.Black,p.left=fs(m,Ae.Black),p.color=Ae.Red,c-=1;else{if(u.left=l.right,p.color=Ae.Red,p.right=l.left,l.color=Ae.Black,l.right=u,l.left=p,o[c-2]=l,o[c-1]=u,jt(p),jt(u),jt(l),c>=3){let f=o[c-3];if(f.right===p)f.right=l;else f.left=l}break}}}return o[0].color=Ae.Black,Wf(e._ord,o[0])}),$6=(e)=>j6(e,Da.Forward);var j6=(e,t)=>{let r=e[Symbol.iterator](),i=0;return{[Symbol.iterator]:()=>j6(e,t),next:()=>{i++;let n=r.key;if(t===Da.Forward)r.moveNext();else r.movePrev();switch(n._tag){case"None":return{done:!0,value:i};case"Some":return{done:!1,value:n.value}}}}};var N6=h(2,(e,t)=>{if(!T0(e,t))return e;let r=e._ord,i=r,n=e._root,o=[];while(n!==void 0){let u=i(t,n.key);if(o.push(n),le(t,n.key))n=void 0;else if(u<=0)n=n.left;else n=n.right}if(o.length===0)return e;let s=Array(o.length),c=o[o.length-1];s[s.length-1]={color:c.color,key:c.key,value:c.value,left:c.left,right:c.right,count:c.count};for(let u=o.length-2;u>=0;--u)if(c=o[u],c.left===o[u+1])s[u]={color:c.color,key:c.key,value:c.value,left:s[u+1],right:c.right,count:c.count};else s[u]={color:c.color,key:c.key,value:c.value,left:c.left,right:s[u+1],count:c.count};if(c=s[s.length-1],c.left!==void 0&&c.right!==void 0){let u=s.length;c=c.left;while(c.right!=null)s.push(c),c=c.right;let l=s[u-1];s.push({color:c.color,key:l.key,value:l.value,left:c.left,right:c.right,count:c.count}),s[u-1].key=c.key,s[u-1].value=c.value;for(let p=s.length-2;p>=u;--p)c=s[p],s[p]={color:c.color,key:c.key,value:c.value,left:c.left,right:s[p+1],count:c.count};s[u-1].left=s[u]}if(c=s[s.length-1],c.color===Ae.Red){let u=s[s.length-2];if(u.left===c)u.left=void 0;else if(u.right===c)u.right=void 0;s.pop();for(let l=0;l<s.length;++l)s[l].count--;return Wf(r,s[0])}else if(c.left!==void 0||c.right!==void 0){if(c.left!==void 0)k0(c,c.left);else if(c.right!==void 0)k0(c,c.right);c.color=Ae.Black;for(let u=0;u<s.length-1;++u)s[u].count--;return Wf(r,s[0])}else if(s.length===1)return Wf(r,void 0);else{for(let l=0;l<s.length;++l)s[l].count--;let u=s[s.length-2];if(Sge(s),u.left===c)u.left=void 0;else u.right=void 0}return Wf(r,s[0])});var Sge=(e)=>{let t,r,i,n;for(let o=e.length-1;o>=0;--o){if(t=e[o],o===0){t.color=Ae.Black;return}if(r=e[o-1],r.left===t){if(i=r.right,i!==void 0&&i.right!==void 0&&i.right.color===Ae.Red){if(i=r.right=Qi(i),n=i.right=Qi(i.right),r.right=i.left,i.left=r,i.right=n,i.color=r.color,t.color=Ae.Black,r.color=Ae.Black,n.color=Ae.Black,jt(r),jt(i),o>1){let s=e[o-2];if(s.left===r)s.left=i;else s.right=i}e[o-1]=i;return}else if(i!==void 0&&i.left!==void 0&&i.left.color===Ae.Red){if(i=r.right=Qi(i),n=i.left=Qi(i.left),r.right=n.left,i.left=n.right,n.left=r,n.right=i,n.color=r.color,r.color=Ae.Black,i.color=Ae.Black,t.color=Ae.Black,jt(r),jt(i),jt(n),o>1){let s=e[o-2];if(s.left===r)s.left=n;else s.right=n}e[o-1]=n;return}if(i!==void 0&&i.color===Ae.Black)if(r.color===Ae.Red){r.color=Ae.Black,r.right=fs(i,Ae.Red);return}else{r.right=fs(i,Ae.Red);continue}else if(i!==void 0){if(i=Qi(i),r.right=i.left,i.left=r,i.color=r.color,r.color=Ae.Red,jt(r),jt(i),o>1){let s=e[o-2];if(s.left===r)s.left=i;else s.right=i}if(e[o-1]=i,e[o]=r,o+1<e.length)e[o+1]=t;else e.push(t);o=o+2}}else{if(i=r.left,i!==void 0&&i.left!==void 0&&i.left.color===Ae.Red){if(i=r.left=Qi(i),n=i.left=Qi(i.left),r.left=i.right,i.right=r,i.left=n,i.color=r.color,t.color=Ae.Black,r.color=Ae.Black,n.color=Ae.Black,jt(r),jt(i),o>1){let s=e[o-2];if(s.right===r)s.right=i;else s.left=i}e[o-1]=i;return}else if(i!==void 0&&i.right!==void 0&&i.right.color===Ae.Red){if(i=r.left=Qi(i),n=i.right=Qi(i.right),r.left=n.right,i.right=n.left,n.right=r,n.left=i,n.color=r.color,r.color=Ae.Black,i.color=Ae.Black,t.color=Ae.Black,jt(r),jt(i),jt(n),o>1){let s=e[o-2];if(s.right===r)s.right=n;else s.left=n}e[o-1]=n;return}if(i!==void 0&&i.color===Ae.Black)if(r.color===Ae.Red){r.color=Ae.Black,r.left=fs(i,Ae.Red);return}else{r.left=fs(i,Ae.Red);continue}else if(i!==void 0){if(i=Qi(i),r.left=i.right,i.right=r,i.color=r.color,r.color=Ae.Red,jt(r),jt(i),o>1){let s=e[o-2];if(s.right===r)s.right=i;else s.left=i}if(e[o-1]=i,e[o]=r,o+1<e.length)e[o+1]=t;else e.push(t);o=o+2}}}};var z6=T0,L6=F6,B6=$6;var U6=N6;var E0=Symbol.for("effect/SortedSet"),kge={[E0]:{_A:(e)=>e},[be](){return v(ue(this.keyTree),Re(ue(E0)),Ue(this))},[he](e){return Ige(e)&&le(this.keyTree,e.keyTree)},[Symbol.iterator](){return B6(this.keyTree)},toString(){return it(this.toJSON())},toJSON(){return{_id:"SortedSet",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},q6=(e)=>{let t=Object.create(kge);return t.keyTree=e,t},Ige=(e)=>pe(e,E0);var J6=h(2,(e,t)=>z6(e.keyTree,t)?e:q6(L6(e.keyTree,t,!0)));var H6=h(2,(e,t)=>q6(U6(e.keyTree,t)));var Ege="effect/Supervisor",_p=Symbol.for(Ege),Zf={_T:(e)=>e};class Op{underlying;value0;[_p]=Zf;constructor(e,t){this.underlying=e,this.value0=t}get value(){return this.value0}onStart(e,t,r,i){this.underlying.onStart(e,t,r,i)}onEnd(e,t){this.underlying.onEnd(e,t)}onEffect(e,t){this.underlying.onEffect(e,t)}onSuspend(e){this.underlying.onSuspend(e)}onResume(e){this.underlying.onResume(e)}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}}class Dp{left;right;_tag="Zip";[_p]=Zf;constructor(e,t){this.left=e,this.right=t}get value(){return qc(this.left.value,this.right.value)}onStart(e,t,r,i){this.left.onStart(e,t,r,i),this.right.onStart(e,t,r,i)}onEnd(e,t){this.left.onEnd(e,t),this.right.onEnd(e,t)}onEffect(e,t){this.left.onEffect(e,t),this.right.onEffect(e,t)}onSuspend(e){this.left.onSuspend(e),this.right.onSuspend(e)}onResume(e){this.left.onResume(e),this.right.onResume(e)}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}}var C0=(e)=>pe(e,_p)&&Qs(e,"Zip");class W6{[_p]=Zf;fibers=new Set;get value(){return q(()=>Array.from(this.fibers))}onStart(e,t,r,i){this.fibers.add(i)}onEnd(e,t){this.fibers.delete(t)}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}class Z6{effect;[_p]=Zf;constructor(e){this.effect=e}get value(){return this.effect}onStart(e,t,r,i){}onEnd(e,t){}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}class Cge{ref;[_p]=Zf;constructor(e){this.ref=e}get value(){return q(()=>jn(this.ref))}onStart(e,t,r,i){v(this.ref,Ti(v(jn(this.ref),J6(i))))}onEnd(e,t){v(this.ref,Ti(v(jn(this.ref),H6(t))))}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new Op(this,v(this.value,W(e)))}zip(e){return new Dp(this,e)}onRun(e,t){return e()}}var Pge=()=>new W6,V6=q(Pge),Rge=(e)=>new Z6(e),hu=Fe("effect/Supervisor/none",()=>Rge($e));var G6=fa;var K6="Empty",Q6="AddSupervisor",Y6="RemoveSupervisor",X6="AndThen",Mp={_tag:K6},HS=(e,t)=>({_tag:X6,first:e,second:t}),_ge=(e,t)=>Oge(t,Zt(e)),Oge=(e,t)=>{let r=e,i=t;while(zr(i)){let n=Pr(i);switch(n._tag){case K6:{i=Yr(i);break}case Q6:{r=r.zip(n.supervisor),i=Yr(i);break}case Y6:{r=P0(r,n.supervisor),i=Yr(i);break}case X6:{i=Cr(n.first)(Cr(n.second)(Yr(i)));break}}}return r},P0=(e,t)=>{if(le(e,t))return hu;else if(C0(e))return P0(e.left,t).zip(P0(e.right,t));else return e},WS=(e)=>{if(le(e,hu))return Li();else if(C0(e))return v(WS(e.left),fo(WS(e.right)));else return oa(e)},Dge=(e,t)=>{if(le(e,t))return Mp;let r=WS(e),i=WS(t),n=v(i,p_(r),Cc(Mp,(s,c)=>HS(s,{_tag:Q6,supervisor:c}))),o=v(r,p_(i),Cc(Mp,(s,c)=>HS(s,{_tag:Y6,supervisor:c})));return HS(n,o)},e4=G6({empty:Mp,patch:_ge,combine:HS,diff:Dge});var Fge=qf("effect_fiber_started",{incremental:!0}),t4=qf("effect_fiber_active"),$ge=qf("effect_fiber_successes",{incremental:!0}),jge=qf("effect_fiber_failures",{incremental:!0}),Nge=A6(R6("effect_fiber_lifetimes",$G({start:0.5,factor:2,count:35})),"time_unit","milliseconds"),Vf="Continue",zge="Done",r4="Yield",Lge={_E:(e)=>e,_A:(e)=>e},ZS=(e)=>{throw Error(`BUG: FiberRuntime - ${No(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},gs=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),hs=Fe("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),Gf={[jl]:(e,t,r)=>Jt(()=>t.effect_instruction_i1(r)),["OnStep"]:(e,t,r)=>Rt(Rt(r)),[Nl]:(e,t,r)=>Jt(()=>t.effect_instruction_i2(r)),[Am]:(e,t,r)=>{if(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),qi(e.currentRuntimeFlags)&&e.isInterrupted())return pt(e.getInterruptedCause());else return Rt(r)},[zl]:(e,t,r)=>{if(Jt(()=>t.effect_instruction_i2(r)),Jt(()=>t.effect_instruction_i0()))return e.pushStack(t),Jt(()=>t.effect_instruction_i1());else return $e},[bc]:(e,t,r)=>{while(!0){let i=Jt(()=>t.effect_instruction_i0.next(r));if(i.done)return Rt(i.value);let n=EA(i.value);if(!up(n))return e.pushStack(t),n;else if(n._tag==="Failure")return n;r=n.value}}},Bge={[WD]:(e,t,r,i)=>(e.processNewInterruptSignal(i.cause),qi(t)?pt(i.cause):r),[VD]:(e,t,r,i)=>{throw Error("It is illegal to have multiple concurrent run loops in a single fiber")},[ZD]:(e,t,r,i)=>(i.onFiber(e,tD(t)),r),[GD]:(e,t,r,i)=>E(Io(),()=>r)},Uge=(e)=>Yn(cJ(e),(t)=>ys(pJ(t),([r,i])=>{let n=new Map,o=[];for(let c of i){o.push(Si(c));for(let u of c)n.set(u.request,u)}let s=o.flat();return Xt(nhe(r.runAll(o),s,()=>s.forEach((c)=>{c.listeners.interrupted=!0})),wS,n)},!1,!1)),qge=Om();class YS extends Ea{[ds]=Ap;[$f]=Lge;_fiberRefs;_fiberId;_queue=[];_children=null;_observers=[];_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(e,t,r){super();if(this.currentRuntimeFlags=r,this._fiberId=e,this._fiberRefs=t,tO(r)){let i=this.getFiberRef(is);Fge.unsafeUpdate(1,i),t4.unsafeUpdate(1,i)}this.refreshRefCache()}commit(){return Ar(this)}id(){return this._fiberId}resume(e){this.tell(pu(e))}get status(){return this.ask((e,t)=>t)}get runtimeFlags(){return this.ask((e,t)=>{if(sS(t))return e.currentRuntimeFlags;return t.runtimeFlags})}scope(){return lG(this)}get children(){return this.ask((e)=>Array.from(e.getChildren()))}getChildren(){if(this._children===null)this._children=new Set;return this._children}getInterruptedCause(){return this.getFiberRef(Zc)}fiberRefs(){return this.ask((e)=>e.getFiberRefs())}ask(e){return we(()=>{let t=xf(this._fiberId);return this.tell(Rp((r,i)=>{wf(t,q(()=>e(r,i)))})),kr(t)})}tell(e){if(this._queue.push(e),!this._running)this._running=!0,this.drainQueueLaterOnExecutor()}get await(){return en((e)=>{let t=(r)=>e(O(r));if(this._exitValue!==null){t(this._exitValue);return}return this.tell(Rp((r,i)=>{if(r._exitValue!==null)t(this._exitValue);else r.addObserver(t)})),q(()=>this.tell(Rp((r,i)=>{r.removeObserver(t)})))},this.id())}get inheritAll(){return Qe((e,t)=>{let r=e.id(),i=e.getFiberRefs(),n=t.runtimeFlags,o=this.getFiberRefs(),s=Xx(i,r,o);e.setFiberRefs(s);let c=e.getFiberRef(o4),u=v(Ei(n,c),oO(Ui),oO(fx));return va(u)})}get poll(){return q(()=>Bo(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(e){return q(()=>this.tell(DS(ki(e))))}unsafeInterruptAsFork(e){this.tell(DS(ki(e)))}addObserver(e){if(this._exitValue!==null)e(this._exitValue);else this._observers.push(e)}removeObserver(e){this._observers=this._observers.filter((t)=>t!==e)}getFiberRefs(){return this.setFiberRef(o4,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(e){this._fiberRefs=Ef(this._fiberRefs,e)}getFiberRef(e){if(this._fiberRefs.locals.has(e))return this._fiberRefs.locals.get(e)[0][1];return e.initial}setFiberRef(e,t){this._fiberRefs=xp(this._fiberRefs,{fiberId:this._fiberId,fiberRef:e,value:t}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(er),this.currentTracer=this.currentDefaultServices.unsafeMap.get(as.key),this.currentSupervisor=this.getFiberRef(j0),this.currentScheduler=this.getFiberRef(su),this.currentContext=this.getFiberRef(zn),this.currentSpan=this.currentContext.unsafeMap.get(Vi.key)}setFiberRefs(e){this._fiberRefs=e,this.refreshRefCache()}addChild(e){this.getChildren().add(e)}removeChild(e){this.getChildren().delete(e)}transferChildren(e){let t=this._children;if(this._children=null,t!==null&&t.size>0){for(let r of t)if(r._exitValue===null)e.add(this.currentRuntimeFlags,r)}}drainQueueOnCurrentThread(){let e=!0;while(e){let t=Vf,r=globalThis[ms];globalThis[ms]=this;try{while(t===Vf)t=this._queue.length===0?zge:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[ms]=r}if(this._queue.length>0&&!this._running)if(this._running=!0,t===r4)this.drainQueueLaterOnExecutor(),e=!1;else e=!0;else e=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(ns),this)}drainQueueWhileRunning(e,t){let r=t;while(this._queue.length>0){let i=this._queue.splice(0,1)[0];r=Bge[i._tag](this,e,r,i)}return r}isInterrupted(){return!g_(this.getFiberRef(Zc))}addInterruptedCause(e){let t=this.getFiberRef(Zc);this.setFiberRef(Zc,Vt(t,e))}processNewInterruptSignal(e){this.addInterruptedCause(e),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let e=!1;for(let t of this._children)t.tell(DS(ki(this.id()))),e=!0;return e}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){let e=this._children.values();this._children=null;let t=!1;return wa({while:()=>!t,body:()=>{let i=e.next();if(!i.done)return $t(i.value.await);else return q(()=>{t=!0})},step:()=>{}})}return null}reportExitValue(e){if(tO(this.currentRuntimeFlags)){let t=this.getFiberRef(is),r=this.id().startTimeMillis,i=Date.now();switch(Nge.unsafeUpdate(i-r,t),t4.unsafeUpdate(-1,t),e._tag){case Wt:{$ge.unsafeUpdate(1,t);break}case Ht:{jge.unsafeUpdate(1,t);break}}}if(e._tag==="Failure"){let t=this.getFiberRef(IO);if(!Bm(e.cause)&&t._tag==="Some")this.log("Fiber terminated with an unhandled error",e.cause,t)}}setExitValue(e){this._exitValue=e,this.reportExitValue(e);for(let t=this._observers.length-1;t>=0;t--)this._observers[t](e);this._observers=[]}getLoggers(){return this.getFiberRef(Zge)}log(e,t,r){let i=Bt(r)?r.value:this.getFiberRef(vO),n=this.getFiberRef(a4);if(cD(n,i))return;let o=this.getFiberRef(Ox),s=this.getFiberRef(Ia),c=this.getLoggers(),u=this.getFiberRefs();if(Jo(c)>0){let l=$n(this.getFiberRef(er),ni),p=new Date(l.unsafeCurrentTimeMillis());RU(u,()=>{for(let m of c)m.log({fiberId:this.id(),logLevel:i,message:e,cause:t,context:u,spans:o,annotations:s,date:p})})}}evaluateMessageWhileSuspended(e){switch(e._tag){case GD:return r4;case WD:{if(this.processNewInterruptSignal(e.cause),this._asyncInterruptor!==null)this._asyncInterruptor(pt(e.cause)),this._asyncInterruptor=null;return Vf}case VD:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(e.effect),Vf;case ZD:return e.onFiber(this,this._exitValue!==null?EW:CW(this.currentRuntimeFlags,this._asyncBlockingOn)),Vf;default:return ZS(e)}}evaluateEffect(e){this.currentSupervisor.onResume(this);try{let t=qi(this.currentRuntimeFlags)&&this.isInterrupted()?pt(this.getInterruptedCause()):e;while(t!==null){let r=t,i=this.runLoop(r);if(i===gs){let n=hs.currentOp;if(hs.currentOp=null,n._op===Ll)if(nJ(this.currentRuntimeFlags))this.tell(sG()),this.tell(pu(vn)),t=null;else t=vn;else if(n._op===hc)t=null}else{this.currentRuntimeFlags=v(this.currentRuntimeFlags,X_(fx));let n=this.interruptAllChildren();if(n!==null)t=E(n,()=>i);else{if(this._queue.length===0)this.setExitValue(i);else this.tell(pu(i));t=null}}}}finally{this.currentSupervisor.onSuspend(this)}}start(e){if(!this._running){this._running=!0;let t=globalThis[ms];globalThis[ms]=this;try{this.evaluateEffect(e)}finally{if(this._running=!1,globalThis[ms]=t,this._queue.length>0)this.drainQueueLaterOnExecutor()}}else this.tell(pu(e))}startFork(e){this.tell(pu(e))}patchRuntimeFlags(e,t){let r=Qo(e,t);return globalThis[ms]=this,this.currentRuntimeFlags=r,r}initiateAsync(e,t){let r=!1,i=(n)=>{if(!r)r=!0,this.tell(pu(n))};if(qi(e))this._asyncInterruptor=i;try{t(i)}catch(n){i(tt(Sr(n)))}}pushStack(e){if(this._stack.push(e),e._op==="OnStep")this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){let e=this._stack.pop();if(e){if(e._op==="OnStep")this._steps.pop();return e}return}getNextSuccessCont(){let e=this.popStack();while(e){if(e._op!==$l)return e;e=this.popStack()}}getNextFailCont(){let e=this.popStack();while(e){if(e._op!==jl&&e._op!==zl&&e._op!==bc)return e;e=this.popStack()}}[_U](e){return q(()=>ca(this.currentContext,e))}["Left"](e){return Ge(e.left)}["None"](e){return Ge(new Ln)}["Right"](e){return Rt(e.right)}["Some"](e){return Rt(e.value)}["Micro"](e){return ip((t)=>{let r=t,i=WW(BW(e,this.currentContext));return i.addObserver((n)=>{if(n._tag==="Success")return r(Rt(n.value));switch(n.cause._tag){case"Interrupt":return r(pt(ki(bn)));case"Fail":return r(Ge(n.cause.error));case"Die":return r(xn(n.cause.defect))}}),ip((n)=>{r=(o)=>{n($e)},i.unsafeInterrupt()})})}[bb](e){let t=Jt(()=>e.effect_instruction_i0()),r=this.getNextSuccessCont();if(r!==void 0){if(!(r._op in Gf))ZS(r);return Gf[r._op](this,r,t)}else return hs.currentOp=Rt(t),gs}[Wt](e){let t=e,r=this.getNextSuccessCont();if(r!==void 0){if(!(r._op in Gf))ZS(r);return Gf[r._op](this,r,t.effect_instruction_i0)}else return hs.currentOp=t,gs}[Ht](e){let t=e.effect_instruction_i0,r=this.getNextFailCont();if(r!==void 0)switch(r._op){case $l:case Nl:if(!(qi(this.currentRuntimeFlags)&&this.isInterrupted()))return Jt(()=>r.effect_instruction_i1(t));else return pt(b_(t));case"OnStep":if(!(qi(this.currentRuntimeFlags)&&this.isInterrupted()))return Rt(pt(t));else return pt(b_(t));case Am:if(this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),qi(this.currentRuntimeFlags)&&this.isInterrupted())return pt(Vt(t,this.getInterruptedCause()));else return pt(t);default:ZS(r)}else return hs.currentOp=pt(t),gs}[xb](e){return Jt(()=>e.effect_instruction_i0(this,tD(this.currentRuntimeFlags)))}["Blocked"](e){let t=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){let i=[],n=this._steps[this._steps.length-1],o=this.popStack();while(o&&o._op!=="OnStep")i.push(o),o=this.popStack();this.setFiberRefs(n.refs),this.currentRuntimeFlags=n.flags;let s=tu(n.refs,t),c=Ei(n.flags,r);return Rt(Yo(e.effect_instruction_i0,Qe((u)=>{while(i.length>0)u.pushStack(i.pop());return u.setFiberRefs(ru(u.id(),u.getFiberRefs())(s)),u.currentRuntimeFlags=Qo(c)(u.currentRuntimeFlags),e.effect_instruction_i1})))}return Gt((i)=>E(jp(xx(e.effect_instruction_i0)),()=>i(e.effect_instruction_i1)))}["RunBlocked"](e){return Uge(e.effect_instruction_i0)}[zo](e){let t=e.effect_instruction_i0,r=this.currentRuntimeFlags,i=Qo(r,t);if(qi(i)&&this.isInterrupted())return pt(this.getInterruptedCause());else if(this.patchRuntimeFlags(this.currentRuntimeFlags,t),e.effect_instruction_i1){let n=Ei(i,r);return this.pushStack(new fO(n,e)),Jt(()=>e.effect_instruction_i1(r))}else return vn}[jl](e){return this.pushStack(e),e.effect_instruction_i0}["OnStep"](e){return this.pushStack(e),e.effect_instruction_i0}[$l](e){return this.pushStack(e),e.effect_instruction_i0}[Nl](e){return this.pushStack(e),e.effect_instruction_i0}[hc](e){return this._asyncBlockingOn=e.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,e.effect_instruction_i0),hs.currentOp=e,gs}[Ll](e){return this._isYielding=!1,hs.currentOp=e,gs}[zl](e){let{effect_instruction_i0:t,effect_instruction_i1:r}=e;if(t())return this.pushStack(e),r();else return vn}[bc](e){return Gf[bc](this,e,void 0)}[yc](e){return Jt(()=>e.commit())}runLoop(e){let t=e;this.currentOpCount=0;while(!0){if((this.currentRuntimeFlags&rJ)!==0)this.currentSupervisor.onEffect(this,t);if(this._queue.length>0)t=this.drainQueueWhileRunning(this.currentRuntimeFlags,t);if(!this._isYielding){this.currentOpCount+=1;let r=this.currentScheduler.shouldYield(this);if(r!==!1){this._isYielding=!0,this.currentOpCount=0;let i=t;t=E(Io({priority:r}),()=>i)}}try{if(t=this.currentTracer.context(()=>{if(qge!==t[Xo]._V){let r=this.getFiberRef(UJ);if(r._tag==="Some"){let i=t[Xo]._V;this.log(`Executing an Effect versioned ${i} with a Runtime of version ${Om()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Fn,r)}}return this[t._op](t)},this),t===gs){let r=hs.currentOp;if(r._op===Ll||r._op===hc)return gs;return hs.currentOp=null,r._op===Wt||r._op===Ht?r:pt(Sr(r))}}catch(r){if(t!==gs&&!pe(t,"_op")||!(t._op in this))t=ga(`Not a valid effect: ${No(t)}`);else if(WJ(r))t=pt(Vt(Sr(r),ki(bn)));else t=xn(r)}}}run=()=>{this.drainQueueOnCurrentThread()}}var a4=Fe("effect/FiberRef/currentMinimumLogLevel",()=>Ut(uD("Info"))),Jge=(e)=>BS((t)=>{let r=iW(t.context,er);$n(r,ss).unsafe.log(e.log(t))});var Hge=Fe(Symbol.for("effect/Logger/defaultLogger"),()=>Jge(OG));var Wge=Fe(Symbol.for("effect/Logger/tracerLogger"),()=>BS(({annotations:e,cause:t,context:r,fiberId:i,logLevel:n,message:o})=>{let s=Mf(Ii(ls(r,zn),Vi));if(s._tag==="None"||s.value._tag==="ExternalSpan")return;let c=ca(ls(r,er),ni),u={};for(let[l,p]of e)u[l]=p;if(u["effect.fiberId"]=C2(i),u["effect.logLevel"]=n.label,t!==null&&t._tag!=="Empty")u["effect.cause"]=Zo(t,{renderErrorCause:!0});s.value.event(No(Array.isArray(o)&&o.length===1?o[0]:o),c.unsafeCurrentTimeNanos(),u)}));var Zge=Fe(Symbol.for("effect/FiberRef/currentLoggers"),()=>zJ(oa(Hge,Wge)));var c4=function(){if(typeof arguments[0]==="string")return Oi(Ia,Bi(arguments[0],arguments[1]));let e=Object.entries(arguments[0]);return Oi(Ia,A2((t)=>{for(let r=0;r<e.length;r++){let[i,n]=e[r];Bi(t,i,n)}return t}))},u4=h(2,(e,t)=>{let r=typeof t==="string"?uD(t):t;return Qe((i)=>{let n=i.getFiberRef(a4);if(cD(n,r))return O(H());return W(e,re)})}),Fp=h((e)=>mt(e[0]),(e,t)=>rs(Hi(e,(r)=>$p((i)=>t(r,i))))),l4=h((e)=>mt(e[0]),(e,t)=>oi(e,$p((r)=>t(r)))),$p=(e)=>Qe((t)=>{let r=t.getFiberRefs(),i=Y_(t.currentRuntimeFlags,Ui);return E($0,(n)=>Vc(n,(o)=>Qe((s)=>{let c=s.getFiberRefs(),u=s.currentRuntimeFlags,l=tu(c,r),p=Ei(u,i),m=tu(r,c);return s.setFiberRefs(ru(l,s.id(),r)),oi(Rx(e(o),p),q(()=>{s.setFiberRefs(ru(m,s.id(),s.getFiberRefs()))}))})))}),p4=(e)=>Xt(af,re(Gi))(e),n4=Symbol.for("effect/Effect/existsPar/found"),d4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r)=>Af(r?.concurrency,()=>we(()=>m4(e[Symbol.iterator](),0,t)),()=>dr(ii(e,(i,n)=>kx(t(i,n),{onTrue:()=>Ge(n4),onFalse:()=>$e}),r),{onFailure:(i)=>i===n4?O(!0):Ge(i),onSuccess:()=>O(!1)}))),m4=(e,t,r)=>{let i=e.next();if(i.done)return O(!1);return E(r(i.value,t),(n)=>n?O(n):m4(e,t+1,r))},f4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r)=>{let i=r?.negate?(n,o)=>W(t(n,o),ZH):t;return Af(r?.concurrency,()=>we(()=>ot(e).reduceRight((n,o,s)=>Xn(n,we(()=>i(o,s)),(c,u)=>u?[o,...c]:c),q(()=>[]))),()=>W(ii(e,(n,o)=>W(i(n,o),(s)=>s?re(n):H()),r),iq))}),Vge=(e)=>{if(Array.isArray(e)||bi(e))return[e,H()];let t=Object.keys(e),r=t.length;return[t.map((i)=>e[i]),re((i)=>{let n={};for(let o=0;o<r;o++)n[t[o]]=i[o];return n})]},Gge=(e,t,r)=>{let i=[];for(let n of e)i.push(Ci(n));return E(ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(n)=>{let o=H(),s=n.length,c=Array(s),u=Array(s),l=!1;for(let p=0;p<s;p++){let m=n[p];if(m._tag==="Left")c[p]=re(m.left),l=!0;else u[p]=m.right,c[p]=o}if(l)return t._tag==="Some"?Ge(t.value(c)):Ge(c);else if(r?.discard)return $e;return t._tag==="Some"?O(t.value(u)):O(u)})},Kge=(e,t,r)=>{let i=[];for(let n of e)i.push(Ci(n));if(r?.discard)return ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,discard:!0,concurrentFinalizers:r?.concurrentFinalizers});return W(ii(i,Ze,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(n)=>t._tag==="Some"?t.value(n):n)},Ma=(e,t)=>{let[r,i]=Vge(e);if(t?.mode==="validate")return Gge(r,i,t);else if(t?.mode==="either")return Kge(r,i,t);return t?.discard!==!0&&i._tag==="Some"?W(ii(r,Ze,t),i.value):ii(r,Ze,t)},g4=(e)=>(t)=>Ma(t,e),h4=(e,t)=>W(Ma(ot(e).map(Pt),t),Hl((r)=>hf(r)?re(r.effect_instruction_i0):H())),A0=h(2,(e,t)=>Array.from({length:t},()=>e)),y4=h((e)=>mt(e[0]),(e,t,r)=>Ma(A0(e,t),r)),ii=h((e)=>bi(e[0]),(e,t,r)=>Qe((i)=>{let n=r?.batching===!0||r?.batching==="inherit"&&i.getFiberRef(kO);if(r?.discard)return vD(r.concurrency,()=>yu(Kx,r?.concurrentFinalizers)((o)=>n?ys(e,(s,c)=>o(t(s,c)),!0,!1,1):Yn(e,(s,c)=>o(t(s,c)))),()=>yu(Qx,r?.concurrentFinalizers)((o)=>ys(e,(s,c)=>o(t(s,c)),n,!1)),(o)=>yu(Yx(o),r?.concurrentFinalizers)((s)=>ys(e,(c,u)=>s(t(c,u)),n,!1,o)));return vD(r?.concurrency,()=>yu(Kx,r?.concurrentFinalizers)((o)=>n?R0(e,1,(s,c)=>o(t(s,c)),!0):Rr(e,(s,c)=>o(t(s,c)))),()=>yu(Qx,r?.concurrentFinalizers)((o)=>VS(e,(s,c)=>o(t(s,c)),n)),(o)=>yu(Yx(o),r?.concurrentFinalizers)((s)=>R0(e,o,(c,u)=>s(t(c,u)),n)))})),VS=(e,t,r)=>we(()=>{let i=ot(e),n=Array(i.length);return st(ys(i,(s,c)=>E(t(s,c),(u)=>q(()=>n[c]=u)),r,!1),O(n))}),ys=(e,t,r,i,n)=>Gt((o)=>Cx((s)=>Qe((c)=>{let u=Array.from(e).reverse(),l=u.length;if(l===0)return $e;let p=0,m=!1,f=n?Math.min(u.length,n):u.length,g=new Set,S=[],P=()=>g.forEach((Te)=>{Te.currentScheduler.scheduleTask(()=>{Te.unsafeInterruptAsFork(c.id())},0,Te)}),D=[],L=[],Se=[],Q=()=>{let Te=S.filter(({exit:Pe})=>Pe._tag==="Failure").sort((Pe,Je)=>Pe.index<Je.index?-1:Pe.index===Je.index?0:1).map(({exit:Pe})=>Pe);if(Te.length===0)Te.push(vn);return Te},se=(Te,Pe=!1)=>{let Je=rs(s(Te)),Xe=Qge(Je,c,c.currentRuntimeFlags,Gi);return c.currentScheduler.scheduleTask(()=>{if(Pe)Xe.unsafeInterruptAsFork(c.id());Xe.resume(Je)},0,Xe),Xe},me=()=>{if(!i)l-=u.length,u=[];m=!0,P()},F=r?wx:Pt,Be=se(en((Te)=>{let Pe=(Xe,He)=>{if(Xe._op==="Blocked")Se.push(Xe);else if(S.push({index:He,exit:Xe}),Xe._op==="Failure"&&!m)me()},Je=()=>{if(u.length>0){let Xe=u.pop(),He=p++,ge=()=>{let at=u.pop();return He=p++,E(Io(),()=>E(F(o(t(at,He))),xe))},xe=(at)=>{if(u.length>0){if(Pe(at,He),u.length>0)return ge()}return O(at)},Me=E(F(o(t(Xe,He))),xe),ee=se(Me);if(D.push(ee),g.add(ee),m)ee.currentScheduler.scheduleTask(()=>{ee.unsafeInterruptAsFork(c.id())},0,ee);ee.addObserver((at)=>{let ft;if(at._op==="Failure")ft=at;else ft=at.effect_instruction_i0;if(L.push(ee),g.delete(ee),Pe(ft,He),S.length===l)Te(O(br(Qc(Q(),{parallel:!0}),()=>vn)));else if(Se.length+S.length===l){let cr=Q(),w=Se.map((zt)=>zt.effect_instruction_i0).reduce(aO);Te(O(Yo(w,ys([br(Qc(cr,{parallel:!0}),()=>vn),...Se.map((zt)=>zt.effect_instruction_i1)],(zt)=>zt,r,!0,n))))}else Je()})}};for(let Xe=0;Xe<f;Xe++)Je()}));return $t(Sn(tn(o(Ar(Be))),Yc({onFailure:(Te)=>{me();let Pe=Se.length+1,Je=Math.min(typeof n==="number"?n:Se.length,Se.length),Xe=Array.from(Se);return en((He)=>{let ge=[],xe=0,Me=0,ee=(ft,cr)=>(w)=>{if(ge[ft]=w,xe++,xe===Pe)He(Rt(pt(Te)));if(Xe.length>0&&cr)at()},at=()=>{se(Xe.pop(),!0).addObserver(ee(Me,!0)),Me++};Be.addObserver(ee(Me,!1)),Me++;for(let ft=0;ft<Je;ft++)at()})},onSuccess:()=>Rr(L,(Te)=>Te.inheritAll)})))}))),R0=(e,t,r,i)=>we(()=>{let n=ot(e),o=Array(n.length);return st(ys(n,(c,u)=>W(r(c,u),(l)=>o[u]=l),i,!1,t),O(o))}),bs=(e)=>Qe((t,r)=>O(Qf(e,t,r.runtimeFlags))),jp=(e)=>Yge(e,Gi),b4=h(2,(e,t)=>bs(Ex(e,(r)=>{let i=Wo(r);switch(i._tag){case"Left":return t(i.left);case"Right":return tt(i.right)}}))),Qf=(e,t,r,i=null)=>{let n=GS(e,t,r,i);return n.resume(e),n},Qge=(e,t,r,i=null)=>GS(e,t,r,i),GS=(e,t,r,i=null)=>{let n=nx(),o=t.getFiberRefs(),s=GO(o,n),c=new YS(n,s,r),u=ls(s,zn),l=c.currentSupervisor;return l.onStart(u,e,re(t),c),c.addObserver((m)=>l.onEnd(m,c)),(i!==null?i:v(t.getFiberRef(af),br(()=>t.scope()))).add(r,c),c},Yge=(e,t)=>Qe((r,i)=>O(Qf(e,r,i.runtimeFlags,t))),_0=h((e)=>Gs(e[2]),(e,t,r,i)=>Af(i?.concurrency,()=>ot(e).reduce((n,o,s)=>Xn(n,o,(c,u)=>r(c,u,s)),O(t)),()=>E(xS(t),(n)=>E(ii(e,(o,s)=>E(o,(c)=>QW(n,(u)=>r(u,c,s))),i),()=>SS(n))))),O0=h((e)=>bi(e[0]),(e,t,r)=>v(ii(e,(i,n)=>Ci(t(i,n)),r),W((i)=>CJ(i,Ze)))),x4=h((e)=>bi(e[0]),(e,t,r)=>E(O0(e,t,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([i,n])=>kb(i)?Ge(i):r?.discard?$e:O(n))),S4=(e)=>Qe((t,r)=>en((i)=>{let n=new Set,o,s=Fn,c=()=>{for(let p of n)p.unsafeInterruptAsFork(t.id())},u=!1,l=!0;for(let p of e){l=!1;let m=Qf(ts(p),t,r.runtimeFlags);if(n.add(m),m.addObserver((f)=>{if(n.delete(m),!o)if(f._tag==="Success")u=!0,o=m,s=Fn,c();else s=Xr(f.cause,s);if(u&&n.size===0)i(o?st(zS(o),o.unsafePoll()):tt(s))}),o)break}if(l)return i(ha(()=>new ff("Received an empty collection of effects")));return u=!0,jf(n,t.id())})),v4=h((e)=>bi(e[0])&&!mt(e[0]),(e,t,r,i)=>Af(i?.concurrency,()=>ot(e).reduce((n,o,s)=>Xn(n,o,(c,u)=>r(c,u,s)),t),()=>we(()=>v(_0([t,...e],H(),(n,o,s)=>{switch(n._tag){case"None":return re(o);case"Some":return re(r(n.value,o,s))}},i),W((n)=>{switch(n._tag){case"None":throw Error("BUG: Effect.reduceEffect - please report an issue at https://github.com/Effect-TS/effect/issues");case"Some":return n.value}}))))),KS=(e)=>Ri((t)=>yr(Ii(t,Fa),{onNone:()=>e,onSome:(r)=>{switch(r.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return E(ti(r,Qx),(i)=>$a(e,i))}}})),i4=(e)=>(t)=>Ri((r)=>yr(Ii(r,Fa),{onNone:()=>t,onSome:(i)=>{if(i.strategy._tag==="ParallelN"&&i.strategy.parallelism===e)return t;return E(ti(i,Yx(e)),(n)=>$a(t,n))}})),w4=(e)=>(t)=>yu(e,!0)(t),yu=(e,t)=>(r)=>Ri((i)=>yr(Ii(i,Fa),{onNone:()=>r(Ze),onSome:(n)=>{if(t===!0){let o=e._tag==="Parallel"?KS:e._tag==="Sequential"?QS:i4(e.parallelism);switch(n.strategy._tag){case"Parallel":return o(r(KS));case"Sequential":return o(r(QS));case"ParallelN":return o(r(i4(n.strategy.parallelism)))}}else return r(Ze)}})),bu=(e)=>E(Fa,e),Yf=(e)=>E(XS(),(t)=>Sn(e(t),(r)=>t.close(r))),D0=(e)=>E(XS(),(t)=>the(e,t)),QS=(e)=>Ri((t)=>yr(Ii(t,Fa),{onNone:()=>e,onSome:(r)=>{switch(r.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return E(ti(r,Kx),(i)=>$a(e,i))}}})),k4=(e,t)=>M0([au(e,t)]),M0=(e)=>Oi(is,(t)=>Ni(t,e)),I4=h(2,(e,t)=>Yf((r)=>E($a(e,r),t))),T4=h((e)=>mt(e[1]),(e,t,r)=>F0(e,t,(i,n)=>[i,n],r)),F0=h((e)=>mt(e[1]),(e,t,r,i)=>tn(Co(Pt(e),Pt(t),(n,o)=>dp(n,o,{onSuccess:r,onFailure:(s,c)=>i?.concurrent?Xr(s,c):Vt(s,c)}),i)));var E4=h((e)=>bi(e[0]),(e,t,r)=>xa(ii(e,(i,n)=>xa(t(i,n)),r))),C4=(e)=>Oi(er,Ot(ni,e)),P4=(e)=>Oi(er,Ot(eu,e)),R4=(e)=>Oi(er,Ot(fp,e)),A4=(e)=>bu((t)=>E(ti(t,_i),(r)=>v(e,$a(r),W((i)=>[Nn((n)=>Gc(r,bf(n))),i])))),_4=h((e)=>mt(e[1]),(e,t,r)=>Co(e,t,(i,n)=>[i,n],r)),O4=h((e)=>mt(e[1]),(e,t,r)=>{if(r?.concurrent!==!0&&(r?.batching===void 0||r.batching===!1))return Jc(e,t);return Co(e,t,(i,n)=>i,r)}),D4=h((e)=>mt(e[1]),(e,t,r)=>{if(r?.concurrent!==!0&&(r?.batching===void 0||r.batching===!1))return st(e,t);return Co(e,t,(i,n)=>n,r)}),Co=h((e)=>mt(e[1]),(e,t,r,i)=>W(Ma([e,t],{concurrency:i?.concurrent?2:1,batching:i?.batching,concurrentFinalizers:i?.concurrentFinalizers}),([n,o])=>r(n,o))),M4=(e)=>{if(e===oJ)return $e;return v(op,E((t)=>{let r=Qo(t,e),i=Ei(r,t);return v(va(e),st($p(()=>va(i))),$t)}),rs)},Fa=yn("effect/Scope"),$0=Fa,Xge=(e,t)=>{if(e.state._tag==="Open")e.state.finalizers.set({},t)},ehe={[Fx]:Fx,[$x]:$x,pipe(){return ae(this,arguments)},fork(e){return q(()=>{let t=F4(e);if(this.state._tag==="Closed")return t.state=this.state,t;let r={},i=(n)=>t.close(n);return this.state.finalizers.set(r,i),Xge(t,(n)=>q(()=>{if(this.state._tag==="Open")this.state.finalizers.delete(r)})),t})},close(e){return we(()=>{if(this.state._tag==="Closed")return $e;let t=Array.from(this.state.finalizers.values()).reverse();if(this.state={_tag:"Closed",exit:e},t.length===0)return $e;return HO(this.strategy)?v(Rr(t,(r)=>Pt(r(e))),E((r)=>v(Qc(r),Gn(yf),br(()=>vn)))):WO(this.strategy)?v(VS(t,(r)=>Pt(r(e)),!1),E((r)=>v(Qc(r,{parallel:!0}),Gn(yf),br(()=>vn)))):v(R0(t,this.strategy.parallelism,(r)=>Pt(r(e)),!1),E((r)=>v(Qc(r,{parallel:!0}),Gn(yf),br(()=>vn))))})},addFinalizer(e){return we(()=>{if(this.state._tag==="Closed")return e(this.state.exit);return this.state.finalizers.set({},e),$e})}},F4=(e=_i)=>{let t=Object.create(ehe);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},XS=(e=_i)=>q(()=>F4(e)),$a=h(2,(e,t)=>Xc(e,Go($c(Fa,t)))),the=h(2,(e,t)=>v(e,$a(t),Sn((r)=>t.close(r)))),rhe=(e)=>Wc(e,{differ:e4,fork:Mp}),ev=h(2,(e,t)=>$t(Fp(E(ei(e),(r)=>kt(Lc(e,t),r)),(r)=>Lc(e,r)))),Oi=h(2,(e,t)=>Br(e,(r)=>ev(e,t(r))));var o4=LJ(iJ),j0=rhe(hu),tv=(e)=>ii(e,jS),Np=(e)=>({...Zx,commit(){return Ar(this)},[ds]:Ap,id:()=>ot(e).reduce((r,i)=>M_(r,i.id()),bn),await:Pt(VS(e,(r)=>tn(r.await),!1)),children:W(VS(e,(r)=>r.children,!1),Tb),inheritAll:Yn(e,(r)=>r.inheritAll),poll:W(Rr(e,(r)=>r.poll),Eb(re(Rt([])),(r,i)=>{switch(i._tag){case"None":return H();case"Some":switch(r._tag){case"None":return H();case"Some":return re(dp(i.value,r.value,{onSuccess:(n,o)=>[n,...o],onFailure:Xr}))}}})),interruptAsFork:(r)=>Yn(e,(i)=>i.interruptAsFork(r))}),$4=(e)=>$t(jp(ka(e))),j4=(e)=>Ar(Np(e)),N4=(e)=>Fp(O(e),ka),N0=h(3,(e,t,r)=>z0(e,t,{onSelfWin:(i,n)=>E(i.await,(o)=>{switch(o._tag){case Wt:return E(i.inheritAll,()=>r.onSelfDone(o,n));case Ht:return r.onSelfDone(o,n)}}),onOtherWin:(i,n)=>E(i.await,(o)=>{switch(o._tag){case Wt:return E(i.inheritAll,()=>r.onOtherDone(o,n));case Ht:return r.onOtherDone(o,n)}})})),z4=(e)=>Gt((t)=>Nn((r)=>E(jp(t(e)),(i)=>v(t(Ar(i)),ko(()=>v(i,LS(r))))))),rv=h(2,(e,t)=>Nn((r)=>N0(e,t,{onSelfDone:(i,n)=>pp(i,{onFailure:(o)=>v(Ar(n),Cp((s)=>Xr(o,s))),onSuccess:(o)=>v(n,rn(r),kt(o))}),onOtherDone:(i,n)=>pp(i,{onFailure:(o)=>v(Ar(n),Cp((s)=>Xr(s,o))),onSuccess:(o)=>v(n,rn(r),kt(o))})}))),z0=h(3,(e,t,r)=>Qe((i,n)=>{let o=n.runtimeFlags,s=bo(!0),c=GS(e,i,o,r.selfScope),u=GS(t,i,o,r.otherScope);return en((l)=>{c.addObserver(()=>s4(c,u,r.onSelfWin,s,l)),u.addObserver(()=>s4(u,c,r.onOtherWin,s,l)),c.startFork(e),u.startFork(t)},M_(c.id(),u.id()))})),s4=(e,t,r,i,n)=>{if(Vb(!0,!1)(i))n(r(e,t))},oi=h(2,(e,t)=>Gt((r)=>Dt(r(e),{onFailure:(i)=>Dt(t,{onFailure:(n)=>tt(Vt(i,n)),onSuccess:()=>tt(i)}),onSuccess:(i)=>kt(t,i)}))),nhe=(e,t,r)=>Nn((i)=>oi(E(jp(ts(e)),(n)=>en((o)=>{let s=t.map((l)=>l.listeners.count),c=()=>{if(s.every((l)=>l===0)){if(t.every((l)=>{if(l.result.state.current._tag==="Pending")return!0;else if(l.result.state.current._tag==="Done"&&up(l.result.state.current.effect)&&l.result.state.current.effect._tag==="Failure"&&h_(l.result.state.current.effect.cause))return!0;else return!1}))u.forEach((l)=>l()),r?.(),o(ka(n))}};n.addObserver((l)=>{u.forEach((p)=>p()),o(l)});let u=t.map((l,p)=>{let m=(f)=>{s[p]=f,c()};return l.listeners.addObserver(m),()=>l.listeners.removeObserver(m)});return c(),q(()=>{u.forEach((l)=>l())})})),we(()=>{let n=t.flatMap((o)=>{if(!o.state.completed)return[o];return[]});return Yn(n,(o)=>w0(o.request,bf(i)))})));var Kf=(e,t)=>(t=cs(t),rs(Qe((r)=>{let i=ca(r.getFiberRef(zn),Fa),n=_S(r,e,t),o=r.getFiberRef(cp),s=$n(r.getFiberRef(er),ni);return kt(Vc(i,(c)=>UD(n,c,s,o)),n)}))),L4=(e)=>Oi(er,Ot(as,e)),B4=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],r=cs(e?arguments[2]:arguments[1]);if(e){let i=arguments[0];return E(Kf(t,cs(r)),(n)=>_a(i,Vi,n))}return(i)=>E(Kf(t,cs(r)),(n)=>_a(i,Vi,n))};var ihe="effect/ScheduleInterval",Xf=Symbol.for(ihe),L0={[Xf]:Xf,startMillis:0,endMillis:0},B0=(e,t)=>{if(e>t)return L0;return{[Xf]:Xf,startMillis:e,endMillis:t}},U4=h(2,(e,t)=>q4(e,t)===e),q4=h(2,(e,t)=>{if(e.endMillis<=t.startMillis)return e;if(t.endMillis<=e.startMillis)return t;if(e.startMillis<t.startMillis)return e;if(t.startMillis<e.startMillis)return t;if(e.endMillis<=t.endMillis)return e;return t});var J4=(e)=>e.startMillis>=e.endMillis;var H4=h(2,(e,t)=>{let r=Math.max(e.startMillis,t.startMillis),i=Math.min(e.endMillis,t.endMillis);return B0(r,i)});var W4=(e)=>B0(e,Number.POSITIVE_INFINITY);var U0=L0,Z4=U4;var V4=J4;var G4=H4;var K4=W4;var ahe="effect/ScheduleIntervals",q0=Symbol.for(ahe),J0=(e)=>({[q0]:q0,intervals:e});var Y4=h(2,(e,t)=>che(e.intervals,t.intervals,hn())),che=(e,t,r)=>{let i=e,n=t,o=r;while(zr(i)&&zr(n)){let s=v(Pr(i),G4(Pr(n))),c=V4(s)?o:v(o,Cr(s));if(v(Pr(i),Z4(Pr(n))))i=Yr(i);else n=Yr(n);o=c}return J0(mo(o))},nv=(e)=>v(e.intervals,Pb,br(()=>U0)).startMillis,X4=(e)=>v(e.intervals,Pb,br(()=>U0)).endMillis,eK=h(2,(e,t)=>nv(e)<nv(t)),tK=(e)=>zr(e.intervals);var rK=J0;var nK=Y4,iK=nv,H0=X4,oK=eK,sK=tK;var W0="Continue",cK="Done",uK=(e)=>({_tag:W0,intervals:e}),lK=(e)=>({_tag:W0,intervals:rK(Zt(e))}),pK={_tag:cK},dK=(e)=>e._tag===W0,mK=(e)=>e._tag===cK;var fK=uK;var gK=lK,Lp=pK,Z0=dK,eg=mK;var hK=Gc;var yK=ti;class xK{permits;waiters=new Set;taken=0;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take=(e)=>uf((t)=>{if(this.free<e){let r=()=>{if(this.free<e)return;this.waiters.delete(r),t(we(()=>{if(this.free<e)return this.take(e);return this.taken+=e,O(e)}))};return this.waiters.add(r),q(()=>{this.waiters.delete(r)})}t(we(()=>{if(this.free<e)return this.take(e);return this.taken+=e,O(e)}))});updateTakenUnsafe(e,t){if(this.taken=t(this.taken),this.waiters.size>0)e.getFiberRef(su).scheduleTask(()=>{let r=this.waiters.values(),i=r.next();while(i.done===!1&&this.free>0)i.value(),i=r.next()},e.getFiberRef(ns),e);return O(this.free)}updateTaken(e){return Qe((t)=>this.updateTakenUnsafe(t,e))}resize=(e)=>$t(Qe((t)=>{if(this.permits=e,this.free<0)return $e;return this.updateTakenUnsafe(t,(r)=>r)}));release=(e)=>this.updateTaken((t)=>t-e);releaseAll=this.updateTaken((e)=>0);withPermits=(e)=>(t)=>Gt((r)=>E(r(this.take(e)),(i)=>oi(r(t),this.release(i))));withPermitsIfAvailable=(e)=>(t)=>Gt((r)=>we(()=>{if(this.free<e)return lu;return this.taken+=e,oi(r(Tp(t)),this.release(e))}))}var iv=(e)=>new xK(e),SK=(e)=>q(()=>iv(e));class vK extends Ea{isOpen;waiters=[];scheduled=!1;constructor(e){super();this.isOpen=e}commit(){return this.await}unsafeSchedule(e){if(this.scheduled||this.waiters.length===0)return $e;return this.scheduled=!0,e.currentScheduler.scheduleTask(this.flushWaiters,e.getFiberRef(ns),e),$e}flushWaiters=()=>{this.scheduled=!1;let e=this.waiters;this.waiters=[];for(let t=0;t<e.length;t++)e[t](vn)};open=Qe((e)=>{if(this.isOpen)return $e;return this.isOpen=!0,this.unsafeSchedule(e)});unsafeOpen(){if(this.isOpen)return;this.isOpen=!0,this.flushWaiters()}release=Qe((e)=>{if(this.isOpen)return $e;return this.unsafeSchedule(e)});await=uf((e)=>{if(this.isOpen)return e($e);return this.waiters.push(e),q(()=>{let t=this.waiters.indexOf(e);if(t!==-1)this.waiters.splice(t,1)})});unsafeClose(){this.isOpen=!1}close=q(()=>{this.isOpen=!1});whenOpen=(e)=>st(this.await,e)}var K0=(e)=>new vK(e??!1),wK=(e)=>q(()=>K0(e)),kK=(e)=>ov(e,tv),IK=h(2,(e,t)=>W(Q0(e,t),(r)=>r[0])),Q0=h(2,(e,t)=>{let r=vr(t);return E(Bn(),(i)=>W(av(H()),(n)=>[Wi(dhe(e,r,n),i),mhe(n)]))}),bK=(e,t,r)=>{let i=ho(vr(t));return v(ri(),Hi((n)=>wo(e,n)),W((n)=>re([r+i,n])))},dhe=(e,t,r)=>Gt((i)=>v(Eo((n)=>n.currentTimeMillis),E((n)=>yhe(r,(o)=>{switch(o._tag){case"None":return re(bK(e,t,n));case"Some":{let[s]=o.value;return s-n<=0?re(bK(e,t,n)):H()}}})),E((n)=>Ft(n)?ga("BUG: Effect.cachedInvalidate - please report an issue at https://github.com/Effect-TS/effect/issues"):i(kr(n.value[1]))))),mhe=(e)=>To(e,H()),TK=h(2,(e,t)=>ov(e,(r)=>t(Np(r)))),ov=h(2,(e,t)=>E(V6,(r)=>v(X0(e,r),oi(E(r.value,t))))),EK=h((e)=>bi(e[0]),(e,t)=>t?.discard?Yn(e,bs):W(Rr(e,bs),Np)),Y0=h(2,(e,t)=>Qe((r,i)=>{let n=t,o=Qf(e,r,i.runtimeFlags,Gi);if(n.state._tag==="Open"){let s=()=>Nn((u)=>le(u,o.id())?$e:$t(ka(o))),c={};n.state.finalizers.set(c,s),o.addObserver(()=>{if(n.state._tag==="Closed")return;n.state.finalizers.delete(c)})}else o.unsafeInterruptAsFork(r.id());return O(o)})),sv=(e)=>bu((t)=>Y0(e,t)),CK=(e)=>Ar(e),PK=(e)=>we(()=>E(e,Ar)),V0=Symbol.for("effect/Effect/memoizeFunction.key");class G0{a;eq;[V0]=V0;constructor(e,t){this.a=e,this.eq=t}[he](e){if(pe(e,V0))if(this.eq)return this.eq(this.a,e.a);else return le(this.a,e.a);return!1}[be](){return this.eq?0:Ue(this,ue(this.a))}}var RK=(e,t)=>v(q(()=>fu()),E(av),W((r)=>(i)=>v(r.modifyEffect((n)=>{let o=v(n,sr(new G0(i,t)));if(Ft(o))return v(ri(),Hi((s)=>v(Ep(e(i)),wo(s),bs)),W((s)=>[s,v(n,Un(new G0(i,t),s))]));return O([o.value,n])}),E(kr),E(([n,o])=>v(cu(n),kt(o)))))),AK=h(2,(e,t)=>v(Pt(e),rv(Pt(t)),(r)=>tn(r))),X0=h(2,(e,t)=>wr(j0,(i)=>i.zip(t))(e)),_K=h(2,(e,t)=>eM(e,{onTimeout:()=>VJ(t),duration:t})),eM=h(2,(e,{duration:t,onTimeout:r})=>tn(tg(e,{onTimeout:()=>Pi(r),onSuccess:O,duration:t}))),OK=h(2,(e,{duration:t,onTimeout:r})=>tn(tg(e,{onTimeout:()=>ya(r),onSuccess:O,duration:t}))),DK=h(2,(e,t)=>tg(e,{duration:t,onSuccess:re,onTimeout:H})),tg=h(2,(e,{duration:t,onSuccess:r,onTimeout:i})=>Nn((n)=>Gt((o)=>z0(o(e),ts(uu(t)),{onSelfWin:(s,c)=>E(s.await,(u)=>{if(u._tag==="Success")return E(s.inheritAll,()=>kt(rn(c,n),r(u.value)));else return E(rn(c,n),()=>pt(u.cause))}),onOtherWin:(s,c)=>E(s.await,(u)=>{if(u._tag==="Success")return E(s.inheritAll,()=>kt(rn(c,n),i()));else return E(rn(c,n),()=>pt(u.cause))}),otherScope:Gi})))),fhe="effect/Ref/SynchronizedRef",ghe=Symbol.for(fhe),hhe={_A:(e)=>e};class MK extends Ea{ref;withLock;[ghe]=hhe;[yS]=yD;[Aa]=Aa;constructor(e,t){super();this.ref=e,this.withLock=t,this.get=Ur(this.ref)}get;commit(){return this.get}modify(e){return this.modifyEffect((t)=>O(e(t)))}modifyEffect(e){return this.withLock(v(E(Ur(this.ref),e),E(([t,r])=>kt(To(this.ref,r),t))))}}var av=(e)=>q(()=>tM(e)),tM=(e)=>{let t=Ip(e),r=iv(1);return new MK(t,r.withPermits(1))},yhe=h(2,(e,t)=>e.modifyEffect((r)=>{let i=t(r);switch(i._tag){case"None":return O([r,r]);case"Some":return W(i.value,(n)=>[n,n])}})),FK=h(2,(e,t)=>rg(e,t,(r,i)=>[r,i])),$K=h(2,(e,t)=>rg(e,t,(r,i)=>r)),jK=h(2,(e,t)=>rg(e,t,(r,i)=>i)),rg=h(3,(e,t,r)=>({...Zx,commit(){return Ar(this)},[ds]:Ap,id:()=>v(e.id(),rx(t.id())),await:v(e.await,tn,Co(tn(t.await),r,{concurrent:!0}),Pt),children:e.children,inheritAll:st(t.inheritAll,e.inheritAll),poll:Xn(e.poll,t.poll,(i,n)=>v(i,xc((o)=>v(n,Gn((s)=>oG(o,s,{onSuccess:r,onFailure:Xr})))))),interruptAsFork:(i)=>st(e.interruptAsFork(i),t.interruptAsFork(i)),pipe(){return ae(this,arguments)}})),NK=h((e)=>mt(e[0]),(e,t,r)=>E(e,(i)=>Ma(t(i),r).pipe(W((n)=>Object.assign({},i,n)))));var zK=Symbol.for("effect/ManagedRuntime");var LK="Fresh",BK="FromEffect",UK="Scoped",qK="Suspend",JK="Provide",HK="ProvideMerge",WK="MergeAll";var Ss={};pi(Ss,{FiberTypeId:()=>She,Order:()=>whe,RuntimeFiberTypeId:()=>vhe,all:()=>Rhe,await:()=>Ehe,awaitAll:()=>Che,children:()=>Phe,done:()=>Ahe,dump:()=>_he,dumpAll:()=>Ohe,fail:()=>Dhe,failCause:()=>Mhe,fromEffect:()=>Fhe,getCurrentFiber:()=>$he,id:()=>The,inheritAll:()=>jhe,interrupt:()=>Nhe,interruptAll:()=>Bhe,interruptAllAs:()=>Uhe,interruptAs:()=>nM,interruptAsFork:()=>Lhe,interruptFork:()=>qhe,interrupted:()=>zhe,isFiber:()=>khe,isRuntimeFiber:()=>Ihe,join:()=>Jhe,joinAll:()=>Hhe,map:()=>Whe,mapEffect:()=>Zhe,mapFiber:()=>Vhe,match:()=>Ghe,never:()=>Khe,orElse:()=>Qhe,orElseEither:()=>Yhe,poll:()=>Xhe,pretty:()=>eye,roots:()=>tye,scoped:()=>nye,status:()=>iye,succeed:()=>oye,unsafeRoots:()=>rye,void:()=>sye,zip:()=>aye,zipLeft:()=>cye,zipRight:()=>uye,zipWith:()=>lye});var She=ds,vhe=$f,whe=pG,khe=dG,Ihe=Ff,The=yG,Ehe=jS;var Che=tv,Phe=mG,Rhe=Np,Ahe=du,_he=NS,Ohe=fG,Dhe=gG,Mhe=QD,Fhe=hG,$he=RG,jhe=zS,Nhe=ka,zhe=bG,nM=rn,Lhe=LS,Bhe=xG,Uhe=jf,qhe=$4,Jhe=Ar,Hhe=j4,Whe=FS,Zhe=YD,Vhe=SG,Ghe=vG,Khe=wG,Qhe=XD,Yhe=kG,Xhe=IG,eye=TG,tye=EG,rye=e0,nye=N4,iye=CG,oye=t0,sye=PG;var aye=FK,cye=$K,uye=jK,lye=rg;var Bp=(e)=>function(){if(arguments.length===1){let t=arguments[0];return(r,...i)=>e(t,r,...i)}return e.apply(this,arguments)},uv=Bp((e,t,r)=>{let i=nx(),n=[[zn,[[i,e.context]]]];if(r?.scheduler)n.push([su,[[i,r.scheduler]]]);let o=aW(e.fiberRefs,{entries:n,forkAs:i});if(r?.updateRefs)o=r.updateRefs(o,i);let s=new YS(i,o,e.runtimeFlags),c=t;if(r?.scope)c=E(yK(r.scope,_i),(l)=>st(jx(l,Nn((p)=>le(p,s.id())?$e:rn(s,p))),Sn(t,(p)=>hK(l,p))));let u=s.currentSupervisor;if(u!==hu)u.onStart(e.context,c,H(),s),s.addObserver((l)=>u.onEnd(l,s));if(Gi.add(e.runtimeFlags,s),r?.immediate===!1)s.resume(c);else s.start(c);return s}),oM=Bp((e,t,r={})=>{let i=uv(e,t,r);if(r.onExit)i.addObserver((n)=>{r.onExit(n)});return(n,o)=>oM(e)(v(i,nM(n??bn)),{...o,onExit:o?.onExit?(s)=>o.onExit(rG(s)):void 0})}),pye=Bp((e,t)=>{let r=QK(e)(t);if(r._tag==="Failure")throw GK(r.effect_instruction_i0);return r.effect_instruction_i0});class ZK extends Error{fiber;_tag="AsyncFiberException";constructor(e){super(`Fiber #${e.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);this.fiber=e,this.name=this._tag,this.stack=this.message}}var dye=(e)=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let r=new ZK(e);return Error.stackTraceLimit=t,r};var iM=Symbol.for("effect/Runtime/FiberFailure"),cv=Symbol.for("effect/Runtime/FiberFailure/Cause");class VK extends Error{[iM];[cv];constructor(e){let t=Wb(e)[0];super(t?.message||"An error has occurred");if(this[iM]=iM,this[cv]=e,this.name=t?`(FiberFailure) ${t.name}`:"FiberFailure",t?.stack)this.stack=t.stack}toJSON(){return{_id:"FiberFailure",cause:this[cv].toJSON()}}toString(){return"(FiberFailure) "+Zo(this[cv],{renderErrorCause:!0})}[qe](){return this.toString()}}var GK=(e)=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let r=new VK(e);return Error.stackTraceLimit=t,r};var KK=(e)=>{let t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return lp(t.left);case"Right":return Rt(t.right);case"Some":return Rt(t.value);case"None":return lp(new Ln)}},QK=Bp((e,t)=>{let r=KK(t);if(r)return r;let i=new SD,n=uv(e)(t,{scheduler:i});i.flush();let o=n.unsafePoll();if(o)return o;return CO(vx(dye(n),zx(n)))}),mye=Bp((e,t,r)=>YK(e,t,r).then((i)=>{switch(i._tag){case Wt:return i.effect_instruction_i0;case Ht:throw GK(i.effect_instruction_i0)}})),YK=Bp((e,t,r)=>new Promise((i)=>{let n=KK(t);if(n)i(n);let o=uv(e)(t);if(o.addObserver((s)=>{i(s)}),r?.signal!==void 0)if(r.signal.aborted)o.unsafeInterruptAsFork(o.id());else r.signal.addEventListener("abort",()=>{o.unsafeInterruptAsFork(o.id())},{once:!0})}));class sM{context;runtimeFlags;fiberRefs;constructor(e,t,r){this.context=e,this.runtimeFlags=t,this.fiberRefs=r}pipe(){return ae(this,arguments)}}var fye=(e)=>new sM(e.context,e.runtimeFlags,e.fiberRefs),lv=()=>Qe((e,t)=>O(new sM(e.getFiberRef(zn),t.runtimeFlags,e.getFiberRefs()))),gye=eO(Ui,Q_,K_),vs=fye({context:Qn(),runtimeFlags:gye,fiberRefs:cW()});var XK=oM(vs),e3=uv(vs),t3=mye(vs),r3=YK(vs),n3=pye(vs),i3=QK(vs),o3=(e)=>we(()=>{let t=void 0;return E(ri(),(r)=>E(lv(),(i)=>Gt((n)=>st(bs(n(Dt(e((o)=>oM(i)(wo(o,r))),{onFailure:(o)=>vf(r,o),onSuccess:(o)=>(t=o,$e)}))),n(ko(kr(r),()=>t??$e))))))});var a3=h(2,(e,t)=>e.modifyEffect(t));var yye="effect/Layer",l3=Symbol.for(yye),bye={_RIn:(e)=>e,_E:(e)=>e,_ROut:(e)=>e},Up={[l3]:bye,pipe(){return ae(this,arguments)}},xye="effect/Layer/MemoMap",aM=Symbol.for(xye),Sye=go()("effect/Layer/CurrentMemoMap",{defaultValue:()=>Iye()}),vye=(e)=>pe(e,l3),wye=(e)=>e._op_layer===LK;class cM{ref;[aM];constructor(e){this.ref=e,this[aM]=aM}getOrElseMemoize(e,t){return v(a3(this.ref,(r)=>{let i=r.get(e);if(i!==void 0){let[n,o]=i,s=v(n,E(([c,u])=>v(cu(c),kt(u))),Sn(Yc({onFailure:()=>$e,onSuccess:()=>Vc(t,o)})));return O([s,r])}return v(iu(0),E((n)=>v(ri(),E((o)=>v(iu(()=>$e),W((s)=>{let c=Gt((l)=>v(XS(),E((p)=>v(l(E(d3(e,p,!0),(m)=>Ep(m(this)))),Pt,E((m)=>{switch(m._tag){case Ht:return v(vf(o,m.effect_instruction_i0),st(Gc(p,m)),st(tt(m.effect_instruction_i0)));case Wt:return v(To(s,(f)=>v(Gc(p,f),sp(bD(n,(g)=>[g===1,g-1])),$t)),st(ou(n,(f)=>f+1)),st(Vc(t,(f)=>v(q(()=>r.delete(e)),st(Ur(s)),E((g)=>g(f))))),st(AO(o,m.effect_instruction_i0)),kt(m.effect_instruction_i0[1]))}}))))),u=[v(kr(o),Sn(pp({onFailure:()=>$e,onSuccess:()=>ou(n,(l)=>l+1)}))),(l)=>v(Ur(s),E((p)=>p(l)))];return[c,wye(e)?r:r.set(e,u)]}))))))}),tn)}}var kye=we(()=>W(av(new Map),(e)=>new cM(e))),Iye=()=>new cM(tM(new Map));var p3=h(2,(e,t)=>E(kye,(r)=>Tye(e,r,t))),Tye=h(3,(e,t,r)=>E(d3(e,r),(i)=>_a(i(t),Sye,t))),d3=(e,t,r=!1)=>{let i=e;switch(i._op_layer){case"Locally":return q(()=>(n)=>i.f(n.getOrElseMemoize(i.self,t)));case"ExtendScope":return q(()=>(n)=>bu((o)=>n.getOrElseMemoize(i.layer,o)));case"Fold":return q(()=>(n)=>v(n.getOrElseMemoize(i.layer,t),Dt({onFailure:(o)=>n.getOrElseMemoize(i.failureK(o),t),onSuccess:(o)=>n.getOrElseMemoize(i.successK(o),t)})));case"Fresh":return q(()=>(n)=>v(i.layer,p3(t)));case"FromEffect":return r?q(()=>(n)=>i.effect):q(()=>(n)=>n.getOrElseMemoize(e,t));case"Provide":return q(()=>(n)=>v(n.getOrElseMemoize(i.first,t),E((o)=>v(n.getOrElseMemoize(i.second,t),Wi(o)))));case"Scoped":return r?q(()=>(n)=>$a(i.effect,t)):q(()=>(n)=>n.getOrElseMemoize(e,t));case"Suspend":return q(()=>(n)=>n.getOrElseMemoize(i.evaluate(),t));case"ProvideMerge":return q(()=>(n)=>v(n.getOrElseMemoize(i.first,t),Xn(n.getOrElseMemoize(i.second,t),i.zipK)));case"ZipWith":return Px(function*(){let n=yield*ti(t,Tf),o=yield*ti(n,_i),s=yield*ti(n,_i);return(c)=>v(c.getOrElseMemoize(i.first,o),Co(c.getOrElseMemoize(i.second,s),i.zipK,{concurrent:!0}))});case"MergeAll":{let n=i.layers;return W(ti(t,Tf),(o)=>(s)=>{let c=Array(n.length);return W(ys(n,ap(function*(u,l){let p=yield*ti(o,_i),m=yield*s.getOrElseMemoize(u,p);c[l]=m}),!1,!1),()=>l2(...c))})}}};var Eye=()=>pv(Bn());var uM=h(2,(e,t)=>{let r=Wm(e),i=r?e:t;return pv(W(r?t:e,(o)=>$c(i,o)))});function pv(e){let t=Object.create(Up);return t._op_layer=BK,t.effect=e,t}var m3=(...e)=>{let t=Object.create(Up);return t._op_layer=WK,t.layers=e,t};var lM=h(2,(e,t)=>{let r=Wm(e),i=r?e:t;return Cye(W(r?t:e,(o)=>$c(i,o)))});var Cye=(e)=>{let t=Object.create(Up);return t._op_layer=UK,t.effect=e,t};var f3=h(2,(e,t)=>{let r=Wm(e);return pv(O($c(r?e:t,r?t:e)))});var Pye=(e)=>{let t=Object.create(Up);return t._op_layer=qK,t.evaluate=e,t},g3=h(2,(e,t)=>{let r=Wm(e),i=r?e:t,n=r?t:e;return pv(q(()=>$c(i,n())))});var pM=h(2,(e,t)=>Pye(()=>{let r=Object.create(Up);return r._op_layer=JK,r.first=Object.create(Up,{_op_layer:{value:HK,enumerable:!0},first:{value:Eye(),enumerable:!0},second:{value:Array.isArray(t)?m3(...t):t},zipK:{value:(i,n)=>v(i,Go(n))}}),r.second=e,r}));var c3=h(2,(e,t)=>Yf((r)=>E(p3(t,r),(i)=>Nx(e,i)))),u3=h(2,(e,t)=>{let r=tu(vs.fiberRefs,t.fiberRefs),i=Ei(vs.runtimeFlags,t.runtimeFlags);return Gt((n)=>Qe((o)=>{let s=o.getFiberRef(zn),c=o.getFiberRefs(),u=ru(o.id(),c)(r),l=o.currentRuntimeFlags,p=Qo(i)(l),m=tu(u,c),f=Ei(p,l);return o.setFiberRefs(u),o.currentRuntimeFlags=p,oi(Nx(n(e),Go(s,t.context)),Qe((g)=>(g.setFiberRefs(ru(g.id(),g.getFiberRefs())(m)),g.currentRuntimeFlags=Qo(f)(g.currentRuntimeFlags),$e)))}))}),dv=h(2,(e,t)=>{if(Array.isArray(t))return c3(e,m3(...t));else if(vye(t))return c3(e,t);else if(u2(t))return Nx(e,t);else if(zK in t)return E(t.runtimeEffect,(r)=>u3(e,r));else return u3(e,t)});var y3=W(ei(er),$n(ss)),b3=(e)=>Br(er,(t)=>e($n(t,ss))),x3=h(2,(e,t)=>wr(e,er,Ot(ss,t))),S3=(e)=>Oi(er,Ot(ss,e));var v3=AH;var _ye="effect/Schedule",I3=Symbol.for(_ye),T3=(e)=>pe(e,I3),Oye="effect/ScheduleDriver",Dye=Symbol.for(Oye),dM={start:0,now:0,input:void 0,output:void 0,elapsed:la,elapsedSincePrevious:la,recurrence:0},ng=go()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>dM}),Mye={_Out:(e)=>e,_In:(e)=>e,_R:(e)=>e},Fye={_Out:(e)=>e,_In:(e)=>e,_R:(e)=>e};class E3{initial;step;[I3]=Mye;constructor(e,t){this.initial=e,this.step=t}pipe(){return ae(this,arguments)}}var w3=(e,t,r,i)=>ou(e,(n)=>n.recurrence===0?{now:t,input:r,output:i,recurrence:n.recurrence+1,elapsed:la,elapsedSincePrevious:la,start:t}:{now:t,input:r,output:i,recurrence:n.recurrence+1,elapsed:ua(t-n.start),elapsedSincePrevious:ua(t-n.now),start:n.start});class C3{schedule;ref;[Dye]=Fye;constructor(e,t){this.schedule=e,this.ref=t}get state(){return W(Ur(this.ref),(e)=>e[1])}get last(){return E(Ur(this.ref),([e,t])=>{switch(e._tag){case"None":return Pi(()=>new Ln);case"Some":return O(e.value)}})}iterationMeta=Ip(dM);get reset(){return To(this.ref,[H(),this.schedule.initial]).pipe(Jc(To(this.iterationMeta,dM)))}next(e){return v(W(Ur(this.ref),(t)=>t[1]),E((t)=>v(yp,E((r)=>v(we(()=>this.schedule.step(r,e,t)),E(([i,n,o])=>{let s=To(this.ref,[re(n),i]);if(eg(o))return s.pipe(st(Ge(H())));let c=iK(o.intervals)-r;if(c<=0)return s.pipe(st(w3(this.iterationMeta,r,e,n)),kt(n));let u=ua(c);return v(s,st(w3(this.iterationMeta,r,e,n)),st(uu(u)),kt(n))}))))))}}var og=(e,t)=>new E3(e,t);var $ye=(e)=>R3(e,ao);var jye=h(2,(e,t)=>fM(e,(r,i)=>q(()=>t(r,i)))),fM=h(2,(e,t)=>og(e.initial,(r,i,n)=>E(e.step(r,i,n),([o,s,c])=>{if(eg(c))return O([o,s,Lp]);return W(t(i,s),(u)=>u?[o,s,c]:[o,s,Lp])})));var gM=(e)=>v(iu([H(),e.initial]),W((t)=>new C3(e,t)));var P3=h(2,(e,t)=>Nye(e,t,nK)),Nye=h(3,(e,t,r)=>og([e.initial,t.initial],(i,n,o)=>v(Xn(e.step(i,n,o[0]),t.step(i,n,o[1]),(s,c)=>[s,c]),E(([[s,c,u],[l,p,m]])=>{if(Z0(u)&&Z0(m))return mM(e,t,n,s,c,u.intervals,l,p,m.intervals,r);return O([[s,l],[c,p],Lp])})))),mM=(e,t,r,i,n,o,s,c,u,l)=>{let p=l(o,u);if(sK(p))return O([[i,s],[n,c],fK(p)]);if(v(o,oK(u)))return E(e.step(H0(o),r,i),([m,f,g])=>{if(eg(g))return O([[m,s],[f,c],Lp]);return mM(e,t,r,m,f,g.intervals,s,c,u,l)});return E(t.step(H0(u),r,s),([m,f,g])=>{if(eg(g))return O([[i,m],[n,f],Lp]);return mM(e,t,r,i,n,o,m,f,g.intervals,l)})};var R3=h(2,(e,t)=>zye(e,(r)=>q(()=>t(r)))),zye=h(2,(e,t)=>og(e.initial,(r,i,n)=>E(e.step(r,i,n),([o,s,c])=>W(t(s),(u)=>[o,u,c]))));var Lye=(e)=>og(e.initial,(t,r,i)=>v(e.step(t,r,i),W(([n,o,s])=>[n,r,s])));var hM=(e)=>Uye(vM,(t)=>t<e);var Bye=(e,t)=>og(e,(r,i,n)=>q(()=>[t(n),n,gK(K4(r))]));var A3=h(2,(e,t)=>fM(e,(r,i)=>PS(t(r))));var _3=h(2,(e,t)=>fM(e,(r,i)=>t(r))),Uye=h(2,(e,t)=>jye(e,(r,i)=>t(i)));var mv=Symbol.for("effect/Schedule/ScheduleDefect");class O3{error;[mv];constructor(e){this.error=e,this[mv]=mv}}var qye=(e)=>pe(e,mv),fv=(e)=>Ji(e,(t)=>xn(new O3(t))),Jye=(e)=>yr(Fc(e,(t)=>Lm(t)&&qye(t.defect)?re(t.defect):H()),{onNone:()=>e,onSome:(t)=>Mc(t.error)}),sg=(e)=>vo(e,(t)=>tt(Jye(t))),k3=h(2,(e,t)=>yM(e,t,(r,i)=>Ge(r))),D3=h(2,(e,t)=>{if(T3(t))return k3(e,t);let r=t.schedule??Lye(vM),i=t.while?_3(r,(s)=>{let c=t.while(s);if(typeof c==="boolean")return O(c);return fv(c)}):r,n=t.until?A3(i,(s)=>{let c=t.until(s);if(typeof c==="boolean")return O(c);return fv(c)}):i,o=t.times?P3(n,hM(t.times)).pipe(R3((s)=>s[0])):n;return sg(k3(e,o))}),yM=h(3,(e,t,r)=>E(gM(t),(i)=>dr(e,{onFailure:(n)=>r(n,H()),onSuccess:(n)=>M3(Oa(e,ng,Ur(i.iterationMeta)),i,(o,s)=>Oa(r(o,s),ng,Ur(i.iterationMeta)),n)}))),M3=(e,t,r,i)=>dr(t.next(i),{onFailure:()=>Uc(t.last),onSuccess:(n)=>dr(e,{onFailure:(o)=>r(o,re(n)),onSuccess:(o)=>M3(e,t,r,o)})}),ig=h(2,(e,t)=>bM(e,t,(r,i)=>Ge(r))),F3=h(2,(e,t)=>{if(T3(t))return ig(e,t);return sg(ig(e,gv(t)))}),gv=(e)=>{let t=e.schedule??vM,r=e.while?_3(t,(n)=>{let o=e.while(n);if(typeof o==="boolean")return O(o);return fv(o)}):t,i=e.until?A3(r,(n)=>{let o=e.until(n);if(typeof o==="boolean")return O(o);return fv(o)}):r;return e.times!==void 0?P3(i,hM(e.times)):i},bM=h(3,(e,t,r)=>E(gM(t),(i)=>$3(Oa(e,ng,Ur(i.iterationMeta)),i,(n,o)=>Oa(r(n,o),ng,Ur(i.iterationMeta))))),$3=(e,t,r)=>Ji(e,(i)=>dr(t.next(i),{onFailure:()=>v(t.last,Uc,E((n)=>r(i,n))),onSuccess:()=>$3(e,t,r)})),xM=h(2,(e,t)=>SM(e,void 0,t)),SM=h(3,(e,t,r)=>E(gM(r),(i)=>j3(Oa(e,ng,Ur(i.iterationMeta)),t,i))),j3=(e,t,r)=>dr(r.next(t),{onFailure:()=>Uc(r.last),onSuccess:()=>E(e,(i)=>j3(e,i,r))});var vM=Bye(0,(e)=>e+1),N3=$ye(hM(1));var z3=h(2,(e,t)=>sv(xM(e,t)));var U3=h(2,(e,t)=>we(()=>{let r=0,i;return E(wa({while:()=>r<t.steps.length&&(i===void 0||co(i)),body:()=>{let n=t.steps[r],o=dv(e,n.provide);if(i){let s=!1,c=o;o=we(()=>{if(s)return c;return s=!0,i}),o=sg(ig(o,B3(n,!1)))}else{let s=B3(n,!0);o=s?sg(ig(o,s)):o}return Ci(o)},step:(n)=>{i=n,r++}}),()=>i)})),B3=(e,t)=>{if(!t)return gv({schedule:e.schedule?e.schedule:e.attempts?void 0:N3,times:e.attempts,while:e.while});else if(e.attempts===1||!(e.schedule||e.attempts))return;return gv({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})};var ag=kr;var q3=RO;var J3=eH;var wM=xf;var H3=Symbol.for("effect/MutableList"),Zye={[H3]:H3,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();let r=t.value;return t=t.next,{done:e,value:r}},return(r){if(!e)e=!0;return{done:!0,value:r}}}},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Vye=(e)=>({value:e,removed:!1,prev:void 0,next:void 0}),W3=()=>{let e=Object.create(Zye);return e.head=void 0,e.tail=void 0,e._length=0,e};var Z3=(e)=>kM(e)===0,kM=(e)=>e._length;var V3=h(2,(e,t)=>{let r=Vye(t);if(e.head===void 0)e.head=r;if(e.tail===void 0)e.tail=r;else e.tail.next=r,r.prev=e.tail,e.tail=r;return e._length+=1,e}),G3=(e)=>{let t=e.head;if(t!==void 0)return Gye(e,t),t.value;return};var Gye=(e,t)=>{if(t.removed)return;if(t.removed=!0,t.prev!==void 0&&t.next!==void 0)t.prev.next=t.next,t.next.prev=t.prev;else if(t.prev!==void 0)e.tail=t.prev,t.prev.next=void 0;else if(t.next!==void 0)e.head=t.next,t.next.prev=void 0;else e.tail=void 0,e.head=void 0;if(e._length>0)e._length-=1};var K3=Symbol.for("effect/MutableQueue"),IM=Symbol.for("effect/mutable/MutableQueue/Empty"),Qye={[K3]:K3,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return it(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(et)}},[qe](){return this.toJSON()},pipe(){return ae(this,arguments)}},Yye=(e)=>{let t=Object.create(Qye);return t.queue=W3(),t.capacity=e,t};var Q3=()=>Yye(void 0);var Y3=h(2,(e,t)=>{let r=kM(e.queue);if(e.capacity!==void 0&&r===e.capacity)return!1;return V3(t)(e.queue),!0});var X3=h(2,(e,t)=>{if(Z3(e.queue))return t;return G3(e.queue)});var eQ=(e,t,r,i)=>ax({_tag:"Complete",key:e,exit:t,entryStats:r,timeToLiveMillis:i}),tQ=(e,t)=>ax({_tag:"Pending",key:e,deferred:t}),ebe=(e,t)=>ax({_tag:"Refreshing",deferred:e,complete:t}),TM=Symbol.for("effect/Cache/MapKey");class rQ{current;[TM]=TM;previous=void 0;next=void 0;constructor(e){this.current=e}[be](){return v(ue(this.current),Re(ue(this.previous)),Re(ue(this.next)),Ue(this))}[he](e){if(this===e)return!0;return tbe(e)&&le(this.current,e.current)&&le(this.previous,e.previous)&&le(this.next,e.next)}}var qp=(e)=>new rQ(e),tbe=(e)=>pe(e,TM);class nQ{head=void 0;tail=void 0;add(e){if(e!==this.tail)if(this.tail===void 0)this.head=e,this.tail=e;else{let{previous:t,next:r}=e;if(r!==void 0)if(e.next=void 0,t!==void 0)t.next=r,r.previous=t;else this.head=r,this.head.previous=void 0;this.tail.next=e,e.previous=this.tail,this.tail=e}}remove(){let e=this.head;if(e!==void 0){let t=e.next;if(t!==void 0)e.next=void 0,this.head=t,this.head.previous=void 0;else this.head=void 0,this.tail=void 0}return e}}var rbe=()=>new nQ,nbe=(e,t,r,i,n,o)=>({map:e,keys:t,accesses:r,updating:i,hits:n,misses:o}),ibe=()=>nbe(fu(),rbe(),Q3(),bo(!1),0,0),obe="effect/Cache",sbe=Symbol.for(obe),abe={_Key:(e)=>e,_Error:(e)=>e,_Value:(e)=>e},cbe="effect/ConsumerCache",ube=Symbol.for(cbe),lbe={_Key:(e)=>e,_Error:(e)=>e,_Value:(e)=>e},pbe=(e)=>e,hv=(e)=>({loadedMillis:e});class iQ{capacity;context;fiberId;lookup;timeToLive;[sbe]=abe;[ube]=lbe;cacheState;constructor(e,t,r,i,n){this.capacity=e,this.context=t,this.fiberId=r,this.lookup=i,this.timeToLive=n,this.cacheState=ibe()}get(e){return W(this.getEither(e),vb)}get cacheStats(){return q(()=>pbe({hits:this.cacheState.hits,misses:this.cacheState.misses,size:qS(this.cacheState.map)}))}getOption(e){return we(()=>yr(sr(this.cacheState.map,e),{onNone:()=>{let t=qp(e);return this.trackAccess(t),this.trackMiss(),O(H())},onSome:(t)=>this.resolveMapValue(t)}))}getOptionComplete(e){return we(()=>yr(sr(this.cacheState.map,e),{onNone:()=>{let t=qp(e);return this.trackAccess(t),this.trackMiss(),O(H())},onSome:(t)=>this.resolveMapValue(t,!0)}))}contains(e){return q(()=>Ki(this.cacheState.map,e))}entryStats(e){return q(()=>{let t=sr(this.cacheState.map,e);if(Bt(t))switch(t.value._tag){case"Complete":{let r=t.value.entryStats.loadedMillis;return re(hv(r))}case"Pending":return H();case"Refreshing":{let r=t.value.complete.entryStats.loadedMillis;return re(hv(r))}}return H()})}getEither(e){return we(()=>{let t=e,r=void 0,i=void 0,n=Kr(sr(this.cacheState.map,t));if(n===void 0)if(i=wM(this.fiberId),r=qp(t),Ki(this.cacheState.map,t))n=Kr(sr(this.cacheState.map,t));else Un(this.cacheState.map,t,tQ(r,i));if(n===void 0)return this.trackAccess(r),this.trackMiss(),W(this.lookupValueOf(e,i),Nr);else return E(this.resolveMapValue(n),yr({onNone:()=>this.getEither(e),onSome:(o)=>O(Mn(o))}))})}invalidate(e){return q(()=>{gu(this.cacheState.map,e)})}invalidateWhen(e,t){return q(()=>{let r=sr(this.cacheState.map,e);if(Bt(r)&&r.value._tag==="Complete"){if(r.value.exit._tag==="Success"){if(t(r.value.exit.value))gu(this.cacheState.map,e)}}})}get invalidateAll(){return q(()=>{this.cacheState.map=fu()})}refresh(e){return Eo((t)=>we(()=>{let r=e,i=wM(this.fiberId),n=Kr(sr(this.cacheState.map,r));if(n===void 0)if(Ki(this.cacheState.map,r))n=Kr(sr(this.cacheState.map,r));else Un(this.cacheState.map,r,tQ(qp(r),i));if(n===void 0)return $t(this.lookupValueOf(e,i));else switch(n._tag){case"Complete":{if(this.hasExpired(t,n.timeToLiveMillis)){let o=Kr(sr(this.cacheState.map,r));if(le(o,n))gu(this.cacheState.map,r);return $t(this.get(e))}return v(this.lookupValueOf(e,i),AS(()=>{let o=Kr(sr(this.cacheState.map,r));if(le(o,n)){let s=ebe(i,n);return Un(this.cacheState.map,r,s),!0}return!1}),$t)}case"Pending":return ag(n.deferred);case"Refreshing":return ag(n.deferred)}}))}set(e,t){return Eo((r)=>q(()=>{let i=r.unsafeCurrentTimeMillis(),n=e,o=OS(t),s=eQ(qp(n),o,hv(i),i+ho(vr(this.timeToLive(o))));Un(this.cacheState.map,n,s)}))}get size(){return q(()=>qS(this.cacheState.map))}get values(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push(t[1].exit.value);return e})}get entries(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push([t[0],t[1].exit.value]);return e})}get keys(){return q(()=>{let e=[];for(let t of this.cacheState.map)if(t[1]._tag==="Complete"&&t[1].exit._tag==="Success")e.push(t[0]);return e})}resolveMapValue(e,t=!1){return Eo((r)=>{switch(e._tag){case"Complete":{if(this.trackAccess(e.key),this.hasExpired(r,e.timeToLiveMillis))return gu(this.cacheState.map,e.key.current),O(H());return this.trackHit(),W(e.exit,re)}case"Pending":{if(this.trackAccess(e.key),this.trackHit(),t)return O(H());return W(ag(e.deferred),re)}case"Refreshing":{if(this.trackAccess(e.complete.key),this.trackHit(),this.hasExpired(r,e.complete.timeToLiveMillis)){if(t)return O(H());return W(ag(e.deferred),re)}return W(e.complete.exit,re)}}})}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(e){if(Y3(this.cacheState.accesses,e),Vb(this.cacheState.updating,!1,!0)){let t=!0;while(t){let i=X3(this.cacheState.accesses,IM);if(i===IM)t=!1;else this.cacheState.keys.add(i)}let r=qS(this.cacheState.map);t=r>this.capacity;while(t){let i=this.cacheState.keys.remove();if(i!==void 0){if(Ki(this.cacheState.map,i.current))gu(this.cacheState.map,i.current),r=r-1,t=r>this.capacity}else t=!1}Ti(this.cacheState.updating,!1)}}hasExpired(e,t){return e.unsafeCurrentTimeMillis()>t}lookupValueOf(e,t){return Eo((r)=>we(()=>{let i=e;return v(this.lookup(e),Wi(this.context),Pt,E((n)=>{let o=r.unsafeCurrentTimeMillis(),s=hv(o),c=eQ(qp(i),n,s,o+ho(vr(this.timeToLive(n))));return Un(this.cacheState.map,i,c),st(q3(t,n),n)}),ko(()=>st(J3(t),q(()=>{gu(this.cacheState.map,i)}))))}))}}var oQ=(e,t,r)=>new iQ(e,Qn(),Xb,t,(i)=>vr(r(i)));var EM=Fe(Symbol.for("effect/FiberRef/currentCache"),()=>Ut(oQ(65536,()=>W(ri(),(e)=>({listeners:new Jf,handle:e})),()=>R_(60)))),CM=Fe(Symbol.for("effect/FiberRef/currentCacheEnabled"),()=>Ut(!1)),sQ=(e,t)=>E(mt(t)?t:O(t),(r)=>Nn((i)=>{let n=new Proxy(e,{});return Br(CM,(o)=>{if(o){let c=Br(EM,(u)=>E(u.getEither(n),(l)=>{switch(l._tag){case"Left":{if(l.left.listeners.interrupted)return E(u.invalidateWhen(n,(p)=>p.handle===l.left.handle),()=>c);return l.left.listeners.increment(),Gt((p)=>E(Pt(Yo(aJ,p(kr(l.left.handle)))),(m)=>(l.left.listeners.decrement(),m)))}case"Right":return l.right.listeners.increment(),Gt((p)=>E(Pt(Yo(cO(r,uO({request:n,result:l.right.handle,listeners:l.right.listeners,ownerId:i,state:{completed:!1}})),p(kr(l.right.handle)))),()=>(l.right.listeners.decrement(),kr(l.right.handle))))}}));return c}let s=new Jf;return s.increment(),E(ri(),(c)=>oi(Yo(cO(r,uO({request:n,result:c,listeners:s,ownerId:i,state:{completed:!1}})),kr(c)),q(()=>s.decrement())))})})),aQ=(e,t)=>Br(CM,(r)=>{if(r)return Br(EM,(i)=>E(i.getEither(e),(n)=>{switch(n._tag){case"Left":return $e;case"Right":return PO(n.right.handle,t)}}));return $e}),cQ=h(2,(e,t)=>Xt(e,CM,t)),uQ=h(2,(e,t)=>Xt(e,EM,t));var lQ=_6;var fbe=Xo,gbe=mt,hbe=IK,ybe=Q0,bbe=_D,xbe=RK,Sbe=OD,vbe=Ma,wbe=g4,kbe=h4,Ibe=EZ,Tbe=CZ,Ebe=vV,Cbe=wV,Pbe=NZ,Rbe=d4,Abe=f4,_be=RZ,Obe=MZ,Dbe=ii,Mbe=LZ,Fbe=_0,$be=O0,jbe=pV,Nbe=mV,zbe=dV,Lbe=v4,Bbe=A0,Ube=y4,qbe=x4,Jbe=E4,Hbe=en,Wbe=o3,Zbe=cf,Vbe=Qe,Gbe=Ge,Kbe=Pi,mQ=tt,Qbe=ya,PM=xn,Ybe=ga,Xbe=ha,exe=Px,txe=Hc,rxe=iV,nxe=uV,ixe=O,RM=lu,oxe=xV,sxe=we,axe=q,cxe=$e;var uxe=Io,lxe=pZ;var pxe=Ji,dxe=vo,mxe=dZ,fxe=lf,gxe=IJ,hxe=mZ,yxe=fZ,bxe=gZ,xxe=hZ,Sxe=yZ,vxe=CD,wxe=CS,kxe=BZ,Ixe=cV,Txe=yV,Exe=F3,Cxe=U3,Pxe=bM,Rxe=ED;var Axe=RV,_xe=AV,Oxe=$D,Dxe=DV,Mxe=SZ,Fxe=TJ,$xe=z4,jxe=Ix,Nxe=Tx,zxe=ts,Lxe=EJ,Bxe=ko,Uxe=rs,qxe=Gt,Jxe=OZ,Hxe=kt,Wxe=Tp,Zxe=lZ,Vxe=$t,Gxe=xa,Kxe=jZ,xu=W,Qxe=rV,Yxe=df,Xxe=Sa,eSe=Cp,tSe=nV,rSe=PS,nSe=Fp,iSe=l4,oSe=Sx,sSe=$p,aSe=oi,cSe=Ex,uSe=Sn,lSe=KS,pSe=QS,dSe=w4,mSe=$0,fSe=bu,gSe=Yf,hSe=D0,ySe=I4,bSe=A4,xSe=kK,SSe=p4,vSe=vZ,wSe=TS,kSe=Ep,ISe=TK,TSe=ov,ESe=es,CSe=Nn,PSe=bs,RSe=jp,ASe=EK,_Se=Y0,OSe=sv,DSe=b4,MSe=CK,FSe=PK,$Se=X0,jSe=Cx,NSe=PJ,zSe=tZ,LSe=wO,BSe=BJ,USe=bZ,qSe=Eo,JSe=C4,HSe=zH,WSe=y3,ZSe=b3,VSe=S3,GSe=x3,KSe=xZ,QSe=uu,YSe=CV,XSe=FD,eve=_K,tve=DK,rve=eM,nve=OK,ive=tg,ove=BH,sve=LH,ave=R4,cve=Bn,uve=PZ,lve=Ri,pve=Xc,dve=dv,mve=_a,fve=Oa,gve=zV,hve=NV,yve=jD,bve=ND,xve=LV,Sve=BV,vve=zD,wve=MV,kve=wZ,Ive=kZ,Tve=NK,Eve=IZ,Cve=TZ;var Pve=oV,Rve=Ci,Ave=Pt,_ve=wo,Ove=kx;var Dve=AZ,Mve=_Z,Fve=_f,$ve=DZ,jve=_O,Nve=tH,zve=_V,Lve=OV,Bve=AS,Uve=sp,qve=FV,Jve=$V,Hve=E,Wve=ba,Zve=tn,Vve=rv,Gve=S4,Kve=AK,Qve=N0,Yve=Df,Xve=Hi,ewe=kV,twe=IV,rwe=MD,nwe=TV,iwe=EV,owe=PD,swe=RD,awe=XZ,cwe=D3,uwe=gV,lwe=yM,pwe=xM,dwe=z3,mwe=SM,fwe=wa,gwe=ES,hwe=UZ,ywe=Xt,bwe=wr,xwe=ev,Swe=Oi,vwe=cu,wwe=bV,kwe=RS,Iwe=qZ,Twe=JZ,Ewe=Of,Cwe=pf,Pwe=Dt,Rwe=dr,Awe=HZ,_we=(e,...t)=>ps(e)(...t),Owe=WZ,Dwe=AD,Mwe=ZZ,Fwe=VZ,$we=GZ,jwe=KZ,Nwe=QZ,zwe=uZ,Lwe=c4,Bwe=YZ,Uwe=qJ,qwe=u4,Jwe=Uc,Hwe=yO,Wwe=Bc,Zwe=sV,Vwe=aV,Gwe=$Z,Kwe=lV,Qwe=Hx,fQ=UH,Ywe=h(2,(e,t)=>fQ(e,v3(t))),Xwe=P4,eke=lv,tke=op,rke=va,nke=Rx,ike=M4,oke=SV,ske=DD,ake=k4,cke=M0,uke=JJ,lke=jV,pke=iv,dke=SK,mke=K0,fke=wK,gke=e3,hke=XK,yke=t3,bke=r3,xke=n3,Ske=i3,vke=T4,wke=F0,kke=_4,Ike=O4,Tke=D4,gQ=Co,Eke=h(2,(e,t)=>gQ(e,t,(r,i)=>r(i))),Cke=Yo,Pke=xx,Rke=wx,Ake=h((e)=>lQ(e[0]),sQ),_ke=aQ,Oke=RJ,Dke=cQ,Mke=uQ,Fke=PV,$ke=Wx,jke=qH,Nke=L4,zke=AJ,Lke=_J,Bke=JV,Uke=UV,qke=LD,Jke=BD,Hke=HV,Wke=GV,Zke=KV,Vke=WV,Gke=qV,Kke=VV,Qke=Kf,Yke=kS,hQ=qD,Xke=QV,eIe=B4,tIe=IS,rIe=YV,nIe=XV,iIe=(e)=>Ul(e)?RM:xu(e.value,Xs),oIe=h(2,(e,t)=>Ul(e)?RM:xu(t(e.value),Xs)),yQ=(e)=>{let t=new Map;return new Proxy(e,{get(r,i,n){if(i in r)return Reflect.get(r,i,n);if(t.has(i))return t.get(i);let o=(...m)=>ba(r,(f)=>{if(typeof f[i]==="function")return t.set(i,(...g)=>ba(r,(S)=>S[i](...g))),f[i](...m);return t.set(i,ba(r,(g)=>g[i])),f[i]}),s=ba(r,(m)=>m[i]);Object.assign(o,s);let{apply:c,bind:u,call:l}=o,p=Object.setPrototypeOf({},Object.getPrototypeOf(s));return p.apply=c,p.bind=u,p.call=l,Object.setPrototypeOf(o,p),t.set(i,o),o}})},sIe=(e)=>()=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let r=Error();Error.stackTraceLimit=t;function i(){}return Object.setPrototypeOf(i,Hm),i.key=e,Object.defineProperty(i,"use",{get(){return(n)=>ba(this,n)}}),Object.defineProperty(i,"stack",{get(){return r.stack}}),yQ(i)},aIe=function(){return function(){let[e,t]=arguments,r="accessors"in t?t.accessors:!1,i=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=i;let o="unchecked",s=function(m){if(o==="unchecked"){let f=Object.getPrototypeOf(m);if(f===Object.prototype||f===null)o="plain";else{let g=Object.getPrototypeOf(this);Object.setPrototypeOf(g,f),o="patched"}}if(o==="plain")Object.assign(this,m);else if(o==="patched")return Object.setPrototypeOf(m,Object.getPrototypeOf(this)),m};s.prototype._tag=e,Object.defineProperty(s,"make",{get(){return(m)=>new this(m)}}),Object.defineProperty(s,"use",{get(){return(m)=>ba(this,m)}}),s.key=e,Object.assign(s,Hm),Object.defineProperty(s,"stack",{get(){return n.stack}});let c="dependencies"in t&&t.dependencies.length>0,u=c?"DefaultWithoutDependencies":"Default",l,p=!1;if("effect"in t)p=typeof t.effect==="function",Object.defineProperty(s,u,{get(){if(p)return function(){return uM(s,xu(t.effect.apply(null,arguments),(m)=>new this(m)))}.bind(this);return l??=uM(s,xu(t.effect,(m)=>new this(m)))}});else if("scoped"in t)p=typeof t.scoped==="function",Object.defineProperty(s,u,{get(){if(p)return function(){return lM(s,xu(t.scoped.apply(null,arguments),(m)=>new this(m)))}.bind(this);return l??=lM(s,xu(t.scoped,(m)=>new this(m)))}});else if("sync"in t)Object.defineProperty(s,u,{get(){return l??=g3(s,()=>new this(t.sync()))}});else Object.defineProperty(s,u,{get(){return l??=f3(s,new this(t.succeed))}});if(c){let m;Object.defineProperty(s,"Default",{get(){if(p)return function(){return pM(this.DefaultWithoutDependencies.apply(null,arguments),t.dependencies)};return m??=pM(this.DefaultWithoutDependencies,t.dependencies)}})}return r===!0?yQ(s):s}},cIe=function(e,...t){let r=Error.stackTraceLimit;Error.stackTraceLimit=2;let i=Error();if(Error.stackTraceLimit=r,typeof e!=="string")return pQ(e.length,function(...s){let c=Error.stackTraceLimit;Error.stackTraceLimit=2;let u=Error();return Error.stackTraceLimit=c,dQ({self:this,body:e,args:s,pipeables:t,spanName:"<anonymous>",spanOptions:{context:gp.context(!0)},errorDef:i,errorCall:u})});let n=e,o=t[0];return(s,...c)=>pQ(s.length,{[n](...u){let l=Error.stackTraceLimit;Error.stackTraceLimit=2;let p=Error();return Error.stackTraceLimit=l,dQ({self:this,body:s,args:u,pipeables:c,spanName:n,spanOptions:o,errorDef:i,errorCall:p})}}[n])};function pQ(e,t){return Object.defineProperty(t,"length",{value:e,configurable:!0})}function dQ(e){let t,r=void 0;if(CU(e.body))t=sf(()=>e.body.apply(e.self,e.args));else try{t=e.body.apply(e.self,e.args)}catch(s){r=s,t=PM(s)}if(e.pipeables.length>0)try{for(let s of e.pipeables)t=s(t,...e.args)}catch(s){t=r?mQ(Vt(Sr(r),Sr(s))):PM(s)}let i=!1,n=()=>{if(i!==!1)return i;if(e.errorCall.stack){let s=e.errorDef.stack.trim().split(`
|
|
182
182
|
`),c=e.errorCall.stack.trim().split(`
|
|
183
183
|
`),u=s.slice(2).join(`
|
|
184
184
|
`).trim();if(!u.includes("("))u=u.replace(/at (.*)/,"at ($1)");let l=c.slice(2).join(`
|
|
185
185
|
`).trim();if(!l.includes("("))l=l.replace(/at (.*)/,"at ($1)");return i=`${u}
|
|
186
186
|
${l}`,i}},o=e.spanOptions&&"captureStackTrace"in e.spanOptions?e.spanOptions:{captureStackTrace:n,...e.spanOptions};return hQ(t,e.spanName,o)}var uIe=ap,lIe=()=>(e)=>e,pIe=()=>(e)=>e,dIe=()=>(e)=>e;var _M=262144;class Jp extends Error{constructor(e){super(`Git operation stalled: no output for ${e}ms`);this.name="GitStallError"}}async function ja(e,t,r){r?.throwIfAborted();let{baseDir:i,timeoutMs:n}=e,o=null,s=()=>{},c=()=>{},u=!1,l=!1,p=Bun.spawn(["git","-c","maintenance.auto=false",...t],{cwd:i,stdout:"pipe",stderr:"pipe",...e.credentialEnv?{env:{...process.env,...e.credentialEnv}}:{}}),m=()=>{if(!o)return;tr.runSync(Ss.interruptFork(o)),o=null},f=()=>{if(u||l)return;m();let me=tr.sleep(n).pipe(tr.andThen(tr.sync(()=>s()))),F=e.clock?tr.withClock(me,e.clock):me;o=tr.runFork(F)},g=async()=>{let me=o;if(o=null,me)await tr.runPromise(Ss.interrupt(me))},S=()=>{if(p.exitCode!==null)return;let me=p.pid;try{process.kill(me,"SIGKILL")}catch{}yIe(me)},P=(me)=>{let F=me.getReader(),Be=new TextDecoder,Te="",Pe=!1,Je=async()=>{let He=await F.read();if(He.done)return Te+Be.decode();if(f(),e.onProgress?.(),Te+=Be.decode(He.value,{stream:!0}),Te.length>_M)return Te=`${Te.slice(0,_M)}
|
|
187
187
|
[output truncated at ${_M} characters]`,S(),Te;return Je()},Xe=Je().finally(()=>{Pe=!0,F.releaseLock()});return Xe.catch(()=>{return}),{done:Xe,async closeAfterExit(){if(!Pe)await Promise.race([Xe.then(()=>{return}),Bun.sleep(25)]);if(!Pe)await F.cancel();return Xe}}},D=P(p.stdout),L=P(p.stderr),Se=p.exited.then(async(me)=>{l=!0,m(),e.onProgress?.();let[F,Be]=await Promise.all([D.closeAfterExit(),L.closeAfterExit()]);if(me!==0){let Te=(Je)=>Je.replace(/\/\/[^@/\s]+@/g,"//<redacted>@"),Pe=Te(Be.trim()||F.trim());throw Error(`git ${t.map(Te).join(" ")} exited with ${me}${Pe?`: ${Pe}`:""}`)}return F}),Q=new Promise((me,F)=>{s=()=>{if(l)return;let Be=new Jp(n);F(Be),S()}}),se=new Promise((me,F)=>{c=()=>{F(r?.reason),S()}});if(r?.addEventListener("abort",c,{once:!0}),r?.aborted)c();f();try{return await Promise.race([Se,Q,se])}finally{u=!0,r?.removeEventListener("abort",c),await g(),await Se.catch(()=>{return})}}async function hIe(e){let t=new Map,r=await fIe("/proc").catch(()=>[]);for(let o of r){if(!/^\d+$/.test(o))continue;let s=await gIe(`/proc/${o}/stat`,"utf-8").catch(()=>{return});if(!s)continue;let c=Number(s.slice(s.lastIndexOf(")")+2).split(" ")[1]);if(Number.isFinite(c))t.set(Number(o),c)}let i=[],n=(o)=>{for(let[s,c]of t){if(c!==o||i.includes(s))continue;i.push(s),n(s)}};return n(e),i}async function yIe(e){let t=await hIe(e);for(let r of t)try{process.kill(r,"SIGKILL")}catch{}}async function Hp(e,t,r){let i=r??`Auto-sync: ${new Date().toISOString()}`;await bIe(e,t),await e.add(["-A"]),await xIe(e);try{let n=await e.commit(i);if(n.commit)t.info("Committed changes",{message:i,commit:n.commit});else t.debug("Nothing to commit",{message:i})}catch(n){if(!_e(n).includes("nothing to commit"))throw n}}async function lg(e,t,r,i){i?.throwIfAborted(),e.debug("Pushing to origin",{branch:t});try{await ja(r,["push","origin",t,"--set-upstream"],i)}catch(n){if(i?.aborted)throw i.reason;if(n instanceof Jp)throw n;await ja(r,["push","origin",t],i)}i?.throwIfAborted(),e.info("Pushed changes to remote")}async function bIe(e,t){let r=await e.status();if(r.conflicted.length===0)return;t.warn("Resolving conflicts with local version",{files:r.conflicted});for(let i of r.conflicted)await e.raw(["checkout","--ours",i])}async function xIe(e){let t=await e.diff(["--cached","--name-only"]);for(let r of t.split(`
|
|
188
|
-
`).filter((i)=>i.trim()))try{let i=await e.show([`:${r}`]);if(
|
|
189
|
-
`),s=[];for(let c=0;c+2<o.length;c+=3){let u=o[c],l=o[c+1],p=o[c+2];if(u&&l&&p!==void 0)s.push({sha:u,date:l,message:p})}return s}catch{return[]}}function xQ(e,t,r){return e.show([`${t}:${r}`])}import{writeFile as
|
|
190
|
-
`)}async function
|
|
191
|
-
`)){if(!s.trim())continue;let[c,u]=s.split("\t");if(!c||!u)continue;if(n.push(u),c.startsWith("D"))o.push(u)}return{files:n,deletedFiles:o}}async function xv(e,t){try{return await e.revparse([`refs/remotes/origin/${t}`])}catch{return}}async function
|
|
192
|
-
`;if(this.#n+=Buffer.byteLength(t),await
|
|
193
|
-
`).join("");await DQ(this.#t,e,{mode:384}),this.#n=Buffer.byteLength(e)}}function
|
|
194
|
-
`)){if(i.length===0)continue;let n=
|
|
195
|
-
`)}catch{}}}formatJsonEntry(e,t,r){let i={ts:new Date().toISOString(),level:e,msg:t};if(this.context)i.ctx=this.context;if(r.length>0)i.data=r;return JSON.stringify(i)}silly(e,...t){if(this.level<=vu.SILLY)this.write(console.debug.bind(console),"silly",e,t)}verbose(e,...t){if(this.level<=vu.VERBOSE)this.write(console.debug.bind(console),"verbose",e,t)}debug(e,...t){if(this.level<=vu.DEBUG)this.write(console.debug.bind(console),"debug",e,t)}info(e,...t){if(this.level<=vu.INFO){let r=this.useStderr?console.error.bind(console):console.info.bind(console);this.write(r,"info",e,t)}}warn(e,...t){if(this.level<=vu.WARN)this.write(console.warn.bind(console),"warn",e,t)}error(e,...t){if(this.level<=vu.ERROR)this.write(console.error.bind(console),"error",e,t)}child(e){return new _r({level:this.level,context:e,useStderr:this.useStderr,format:this.format},this.fileHandle)}setUseStderr(e){this.useStderr=e}}var gKe=_r.getInstance();var cTe=/\$\{[^}]+\}/g;function NQ(e,t=process.env){let r=e.match(cTe);if(!r)return e;let i=e;for(let n of r){let o=n.slice(2,-1),s=t[o];if(s===void 0)return;i=i.replace(n,s)}return i}function kv(e,t=process.env){if(typeof e==="string")return NQ(e,t);if(Array.isArray(e))return e.map((r)=>kv(r,t)).filter((r)=>r!==void 0);if(typeof e==="object"&&e!==null){let r={};for(let[i,n]of Object.entries(e)){let o=NQ(i,t);if(o===void 0)continue;let s=kv(n,t);if(s===void 0)continue;r[o]=s}return r}return e}var zQ=a.object({type:a.literal("event"),event:a.string().min(1),fromState:a.string().min(1).optional()}),uTe=a.object({conversationId:a.string().min(1),interfaceType:a.string().min(1),channelId:a.string().min(1).optional(),channelName:a.string().min(1),userPermissionLevel:a.enum(["admin","trusted","public"]),isAnchor:a.boolean(),action:zQ});var Iv=a.object({id:a.string(),toolCallId:a.string().optional(),toolName:a.string(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),args:a.unknown()}),Tv=a.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),LQ=a.object({kind:a.literal("tool-approval"),id:a.string(),toolCallId:a.string().optional(),toolName:a.string(),input:a.record(a.string(),a.unknown()).optional(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),state:Tv,output:a.unknown().optional(),error:a.string().optional()}),fg=LQ,Ev=a.object({entityType:a.string().optional(),entityId:a.string().optional(),attachmentType:a.string().optional()}),Cv=a.object({mediaType:a.string().min(1),url:a.string().min(1),downloadUrl:a.string().min(1).optional(),previewUrl:a.string().min(1).optional(),filename:a.string().min(1).optional(),sizeBytes:a.number().nonnegative().optional(),source:Ev.optional()}),BQ=a.object({kind:a.literal("attachment"),id:a.string(),jobId:a.string().optional(),title:a.string(),description:a.string().optional(),attachment:Cv}),gg=BQ,Pv=a.object({id:a.string().min(1),title:a.string().min(1).optional(),source:a.string().min(1),url:a.string().min(1).optional(),entityType:a.string().min(1).optional(),entityId:a.string().min(1).optional(),excerpt:a.string().min(1).optional(),provenance:a.record(a.string(),a.unknown()).optional()}),lTe=a.object({kind:a.literal("sources"),id:a.string().min(1),title:a.string().min(1).optional(),sources:a.array(Pv).min(1)});var pTe=a.object({type:a.literal("prompt"),id:a.string().min(1),label:a.string().min(1),prompt:a.string().min(1),description:a.string().min(1).optional()});var dTe=a.object({type:a.literal("event"),id:a.string().min(1),label:a.string().min(1),event:a.string().min(1),fromState:a.string().min(1).optional(),description:a.string().min(1).optional()});var Rv=a.discriminatedUnion("type",[pTe,dTe]),mTe=a.object({kind:a.literal("actions"),id:a.string().min(1),title:a.string().min(1).optional(),defaultOpen:a.boolean().optional(),actions:a.array(Rv).min(1)});var hg=a.discriminatedUnion("kind",[LQ,BQ,lTe,mTe]),Av=a.object({toolName:a.string(),args:a.record(a.string(),a.unknown()).optional(),jobId:a.string().optional(),data:a.unknown().optional(),error:a.object({message:a.string(),code:a.string().optional()}).optional()}),NM=a.object({text:a.string(),toolResults:a.array(Av).optional(),cards:a.array(hg).optional(),pendingConfirmations:a.array(Iv).optional(),usage:a.object({promptTokens:a.number(),completionTokens:a.number(),totalTokens:a.number()})});var UQ=a.enum(["admin","trusted","public"]),fTe=a.object({conversationId:a.string().min(1),message:a.string(),interfaceType:a.string().min(1),channelId:a.string().optional(),channelName:a.string().optional(),userPermissionLevel:UQ}),qQ=a.object({id:a.string().min(1),source:a.string().min(1),title:a.string().optional(),content:a.string().min(1),provenance:a.record(a.string(),a.unknown()).optional()}),gTe=a.object({items:a.array(qQ).default([])});import{createHash as hTe}from"crypto";var si=a.discriminatedUnion("kind",[a.object({kind:a.literal("user"),userId:a.string().min(1),canonicalId:a.string().min(1).optional()}),a.object({kind:a.literal("external"),externalActorId:a.string().min(1)}),a.object({kind:a.literal("agent"),agentId:a.string().min(1)}),a.object({kind:a.literal("service"),serviceId:a.string().min(1)})]);function zM(e){let t=e.userId??(e.canonicalId?.startsWith("user:")?`usr_${e.canonicalId.slice(5)}`:void 0);if(t)return{kind:"user",userId:t,...e.canonicalId?{canonicalId:e.canonicalId}:{}};if(e.role==="assistant")return{kind:"agent",agentId:e.actorId};return{kind:"external",externalActorId:e.canonicalId?yg("canonical",e.canonicalId):yg(e.interfaceType,e.actorId)}}function yg(e,t){let r=t.startsWith(`${e}:`)?t:`${e}:${t}`;return`ext_${hTe("sha256").update(r).digest("hex")}`}var yTe=a.object({actor:si}),JQ=a.object({userId:a.string().min(1),personId:a.string().min(1),canonicalId:a.string().min(1).optional(),displayName:a.string().min(1),permissionLevel:a.enum(["admin","trusted","public"])}),bTe=a.object({principal:JQ.nullable()});var LM=a.strictObject({name:a.string().min(1).optional(),address:a.email()}),xTe=a.strictObject({personId:a.string().min(1).max(200),displayName:a.string().trim().min(1).max(200),permissionLevel:a.enum(["admin","trusted","public"])}),STe=a.strictObject({messageId:a.string().min(1),sourceRef:a.string().min(1),threadId:a.string().min(1).optional(),from:LM,replyTo:LM.optional(),to:a.array(LM),subject:a.string(),receivedAt:a.iso.datetime(),text:a.string(),html:a.string().min(1).optional(),headers:a.strictObject({listUnsubscribe:a.string().min(1).optional(),autoSubmitted:a.string().min(1).optional(),precedence:a.string().min(1).optional(),inReplyTo:a.string().min(1).optional(),references:a.array(a.string().min(1)).optional()}),sender:xTe.optional()});var vTe=a.strictObject({permissionLevel:a.enum(["admin","trusted","public"])}),wTe=a.custom((e)=>typeof AbortSignal<"u"&&e instanceof AbortSignal),kTe=a.strictObject({sourceRef:a.string().regex(/^imap:[a-f0-9]{64}$/),actor:vTe,signal:wTe.optional()}),BM=a.strictObject({name:a.string().trim().min(1).max(300).optional(),address:a.email().max(320)}),ITe=a.strictObject({messageId:a.string().trim().min(1).max(2000),from:BM,replyTo:BM.optional(),to:a.array(BM).max(100),subject:a.string().max(1000),receivedAt:a.iso.datetime(),text:a.string().max(1e5),inReplyTo:a.string().trim().min(1).max(2000).optional(),references:a.array(a.string().trim().min(1).max(2000)).max(100),truncated:a.boolean()}),TTe=a.discriminatedUnion("kind",[a.strictObject({kind:a.literal("available"),message:ITe}),a.strictObject({kind:a.literal("unavailable")})]);function UM(e,t){let r=e.trim().toLowerCase(),i=t.trim();if(!r||!i)throw Error("Interface principal requires an interface and subject");return`${r}:${i}`}function qM(e){let t=e.indexOf(":");if(t<=0||t===e.length-1)throw Error(`Invalid interface principal: ${e}`);let r=e.slice(0,t).trim().toLowerCase(),i=e.slice(t+1).trim();return UM(r,i),{interfaceType:r,subject:i}}function bg(e,t){return lm(UM(e,t))}var ETe=a.object({url:a.string(),authToken:a.string().optional()});var CTe=a.object({success:a.boolean(),entityId:a.string().optional(),error:a.string().optional()});var Wp=a.enum(["user","assistant"]);var HQ=a.object({entityType:a.string().min(1),entityId:a.string().min(1),contentHash:a.string().min(1).optional()}),Zp=a.object({rootJobId:a.string().min(1),causationId:a.string().min(1),projectionId:a.string().min(1).optional(),projectionLineage:a.array(a.string().min(1)),sourceEntity:HQ.optional(),derivationDepth:a.number().int().nonnegative()}).superRefine((e,t)=>{if(e.derivationDepth!==e.projectionLineage.length)t.addIssue({code:"custom",path:["derivationDepth"],message:"Derivation depth must equal projection lineage length"});let r=e.projectionLineage.at(-1);if(e.projectionId!==r)t.addIssue({code:"custom",path:["projectionId"],message:"Current projection must equal the final projection lineage entry"})});var PTe=a.strictObject({waveId:a.string().trim().min(1),sourceTypes:a.array(a.string().trim().min(1)),changedTargetTypes:a.array(a.string().trim().min(1))});var j_e=Rs(pF(),1);class uY extends Error{name="Assertion";code="ERR_ASSERTION";constructor(e,t,r,i,n){super(e);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);this.actual=t,this.expected=r,this.generated=n,this.operator=i}}function k(e,t){ARe(Boolean(e),!1,!0,"ok","Expected value to be truthy",t)}function ARe(e,t,r,i,n,o){if(!e)throw o instanceof Error?o:new uY(o||n,t,r,i,!o)}var _Re={};function Pu(e,t){let r=t||_Re,i=typeof r.includeImageAlt==="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml==="boolean"?r.includeHtml:!0;return pY(e,i,n)}function pY(e,t,r){if(ORe(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lY(e.children,t,r)}if(Array.isArray(e))return lY(e,t,r);return""}function lY(e,t,r){let i=[],n=-1;while(++n<e.length)i[n]=pY(e[n],t,r);return i.join("")}function ORe(e){return Boolean(e&&typeof e==="object")}var dF={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\uD835\uDD04",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\uD835\uDD38",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\uD835\uDC9C",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\uD835\uDC9E",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\uD835\uDD3B",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\uD835\uDC9F",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\uD835\uDD08",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\uD835\uDD3C",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\uD835\uDD09",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\uD835\uDD3D",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\uD835\uDD0A",Gg:"\u22D9",Gopf:"\uD835\uDD3E",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\uD835\uDD40",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\uD835\uDD0F",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\uD835\uDD43",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",MinusPlus:"\u2213",Mopf:"\uD835\uDD44",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
196
|
-
`,Nfr:"\uD835\uDD11",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\uD835\uDCA9",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\uD835\uDD12",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\uD835\uDCAA",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\uD835\uDD13",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\uD835\uDCAB",Psi:"\u03A8",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"\u211A",Qscr:"\uD835\uDCAC",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\uD835\uDD16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\uD835\uDD4A",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\uD835\uDCAE",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:"\t",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\uD835\uDD17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\uD835\uDD4B",TripleDot:"\u20DB",Tscr:"\uD835\uDCAF",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\uD835\uDD18",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\uD835\uDD4C",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\uD835\uDCB0",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"\u039E",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\uD835\uDCB5",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\uD835\uDD1E",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\uD835\uDD52",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\uD835\uDCB6",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\uD835\uDD20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\uD835\uDD54",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\uD835\uDD21",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\uD835\uDD55",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\uD835\uDCB9",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\uD835\uDD22",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\uD835\uDD23",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\uD835\uDD57",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\uD835\uDCBB",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\uD835\uDD24",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\uD835\uDD58",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\uD835\uDD25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\uD835\uDD59",horbar:"\u2015",hscr:"\uD835\uDCBD",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\uD835\uDD26",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\uD835\uDD5A",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\uD835\uDCBE",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\uD835\uDD27",jmath:"\u0237",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\uD835\uDD28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\uD835\uDCC1",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\uD835\uDD5E",mp:"\u2213",mscr:"\uD835\uDCC2",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\uD835\uDD2B",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\uD835\uDD5F",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\uD835\uDCC3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\uD835\uDD2C",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\uD835\uDD60",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\uD835\uDD2D",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\uD835\uDD61",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\uD835\uDCC5",psi:"\u03C8",puncsp:"\u2008",qfr:"\uD835\uDD2E",qint:"\u2A0C",qopf:"\uD835\uDD62",qprime:"\u2057",qscr:"\uD835\uDCC6",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\uD835\uDD2F",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\uD835\uDD63",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\uD835\uDCC7",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\uD835\uDD30",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\uD835\uDD64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\uD835\uDCC8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\uD835\uDD31",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\uD835\uDD65",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\uD835\uDCC9",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\uD835\uDD32",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\uD835\uDD66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\uD835\uDCCA",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\uD835\uDD67",vprop:"\u221D",vrtri:"\u22B3",vscr:"\uD835\uDCCB",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\uD835\uDCCC",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\uD835\uDD35",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\uD835\uDD69",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\uD835\uDCCD",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\uD835\uDD36",yicy:"\u0457",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\uD835\uDD37",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"\u200D",zwnj:"\u200C"};var DRe={}.hasOwnProperty;function nd(e){return DRe.call(dF,e)?dF[e]:!1}var b={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var ne={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var y={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var ai={ht:"\t",lf:`
|
|
197
|
-
`,cr:"\r",space:" ",exclamationMark:"!",quotationMark:'"',numberSign:"#",dollarSign:"$",percentSign:"%",ampersand:"&",apostrophe:"'",leftParenthesis:"(",rightParenthesis:")",asterisk:"*",plusSign:"+",comma:",",dash:"-",dot:".",slash:"/",digit0:"0",digit1:"1",digit2:"2",digit3:"3",digit4:"4",digit5:"5",digit6:"6",digit7:"7",digit8:"8",digit9:"9",colon:":",semicolon:";",lessThan:"<",equalsTo:"=",greaterThan:">",questionMark:"?",atSign:"@",uppercaseA:"A",uppercaseB:"B",uppercaseC:"C",uppercaseD:"D",uppercaseE:"E",uppercaseF:"F",uppercaseG:"G",uppercaseH:"H",uppercaseI:"I",uppercaseJ:"J",uppercaseK:"K",uppercaseL:"L",uppercaseM:"M",uppercaseN:"N",uppercaseO:"O",uppercaseP:"P",uppercaseQ:"Q",uppercaseR:"R",uppercaseS:"S",uppercaseT:"T",uppercaseU:"U",uppercaseV:"V",uppercaseW:"W",uppercaseX:"X",uppercaseY:"Y",uppercaseZ:"Z",leftSquareBracket:"[",backslash:"\\",rightSquareBracket:"]",caret:"^",underscore:"_",graveAccent:"`",lowercaseA:"a",lowercaseB:"b",lowercaseC:"c",lowercaseD:"d",lowercaseE:"e",lowercaseF:"f",lowercaseG:"g",lowercaseH:"h",lowercaseI:"i",lowercaseJ:"j",lowercaseK:"k",lowercaseL:"l",lowercaseM:"m",lowercaseN:"n",lowercaseO:"o",lowercaseP:"p",lowercaseQ:"q",lowercaseR:"r",lowercaseS:"s",lowercaseT:"t",lowercaseU:"u",lowercaseV:"v",lowercaseW:"w",lowercaseX:"x",lowercaseY:"y",lowercaseZ:"z",leftCurlyBrace:"{",verticalBar:"|",rightCurlyBrace:"}",tilde:"~",replacementCharacter:"\uFFFD"};function qr(e,t,r,i){let n=e.length,o=0,s;if(t<0)t=-t>n?0:n+t;else t=t>n?n:t;if(r=r>0?r:0,i.length<ne.v8MaxSafeChunkSize)s=Array.from(i),s.unshift(t,r),e.splice(...s);else{if(r)e.splice(t,r);while(o<i.length)s=i.slice(o,o+ne.v8MaxSafeChunkSize),s.unshift(t,0),e.splice(...s),o+=ne.v8MaxSafeChunkSize,t+=ne.v8MaxSafeChunkSize}}function kn(e,t){if(e.length>0)return qr(e,e.length,0,t),e;return t}var dY={}.hasOwnProperty;function mY(e){let t={},r=-1;while(++r<e.length)MRe(t,e[r]);return t}function MRe(e,t){let r;for(r in t){let n=(dY.call(e,r)?e[r]:void 0)||(e[r]={}),o=t[r],s;if(o)for(s in o){if(!dY.call(n,s))n[s]=[];let c=o[s];FRe(n[s],Array.isArray(c)?c:c?[c]:[])}}}function FRe(e,t){let r=-1,i=[];while(++r<t.length)(t[r].add==="after"?e:i).push(t[r]);qr(e,0,0,i)}function qv(e,t){let r=Number.parseInt(e,t);if(r<b.ht||r===b.vt||r>b.cr&&r<b.space||r>b.tilde&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111)return ai.replacementCharacter;return String.fromCodePoint(r)}function Ts(e){return e.replace(/[\t\n\r ]+/g,ai.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ci=Ba(/[A-Za-z]/),In=Ba(/[\dA-Za-z]/),fY=Ba(/[#-'*+\--9=?A-Z^-~]/);function Cg(e){return e!==null&&(e<b.space||e===b.del)}var Pg=Ba(/\d/),gY=Ba(/[\dA-Fa-f]/),hY=Ba(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<b.horizontalTab}function ar(e){return e!==null&&(e<b.nul||e===b.space)}function Ke(e){return e===b.horizontalTab||e===b.virtualSpace||e===b.space}var yY=Ba(/\p{P}|\p{S}/u),bY=Ba(/\s/);function Ba(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function rt(e,t,r,i){let n=i?i-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){if(Ke(u))return e.enter(r),c(u);return t(u)}function c(u){if(Ke(u)&&o++<n)return e.consume(u),c;return e.exit(r),t(u)}}var xY={tokenize:$Re};function $Re(e){let t=e.attempt(this.parser.constructs.contentInitial,i,n),r;return t;function i(c){if(k(c===b.eof||de(c),"expected eol or eof"),c===b.eof){e.consume(c);return}return e.enter(y.lineEnding),e.consume(c),e.exit(y.lineEnding),rt(e,t,y.linePrefix)}function n(c){return k(c!==b.eof&&!de(c),"expected anything other than a line ending or EOF"),e.enter(y.paragraph),o(c)}function o(c){let u=e.enter(y.chunkText,{contentType:ne.contentTypeText,previous:r});if(r)r.next=u;return r=u,s(c)}function s(c){if(c===b.eof){e.exit(y.chunkText),e.exit(y.paragraph),e.consume(c);return}if(de(c))return e.consume(c),e.exit(y.chunkText),o;return e.consume(c),s}}var vY={tokenize:jRe},SY={tokenize:NRe};function jRe(e){let t=this,r=[],i=0,n,o,s;return c;function c(Q){if(i<r.length){let se=r[i];return t.containerState=se[1],k(se[0].continuation,"expected `continuation` to be defined on container construct"),e.attempt(se[0].continuation,u,l)(Q)}return l(Q)}function u(Q){if(k(t.containerState,"expected `containerState` to be defined after continuation"),i++,t.containerState._closeFlow){if(t.containerState._closeFlow=void 0,n)Se();let se=t.events.length,me=se,F;while(me--)if(t.events[me][0]==="exit"&&t.events[me][1].type===y.chunkFlow){F=t.events[me][1].end;break}k(F,"could not find previous flow chunk"),L(i);let Be=se;while(Be<t.events.length)t.events[Be][1].end={...F},Be++;return qr(t.events,me+1,0,t.events.slice(se)),t.events.length=Be,l(Q)}return c(Q)}function l(Q){if(i===r.length){if(!n)return f(Q);if(n.currentConstruct&&n.currentConstruct.concrete)return S(Q);t.interrupt=Boolean(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SY,p,m)(Q)}function p(Q){if(n)Se();return L(i),f(Q)}function m(Q){return t.parser.lazy[t.now().line]=i!==r.length,s=t.now().offset,S(Q)}function f(Q){return t.containerState={},e.attempt(SY,g,S)(Q)}function g(Q){return k(t.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),k(t.containerState,"expected `containerState` to be defined on tokenizer"),i++,r.push([t.currentConstruct,t.containerState]),f(Q)}function S(Q){if(Q===b.eof){if(n)Se();L(0),e.consume(Q);return}return n=n||t.parser.flow(t.now()),e.enter(y.chunkFlow,{_tokenizer:n,contentType:ne.contentTypeFlow,previous:o}),P(Q)}function P(Q){if(Q===b.eof){D(e.exit(y.chunkFlow),!0),L(0),e.consume(Q);return}if(de(Q))return e.consume(Q),D(e.exit(y.chunkFlow)),i=0,t.interrupt=void 0,c;return e.consume(Q),P}function D(Q,se){k(n,"expected `childFlow` to be defined when continuing");let me=t.sliceStream(Q);if(se)me.push(null);if(Q.previous=o,o)o.next=Q;if(o=Q,n.defineSkip(Q.start),n.write(me),t.parser.lazy[Q.start.line]){let F=n.events.length;while(F--)if(n.events[F][1].start.offset<s&&(!n.events[F][1].end||n.events[F][1].end.offset>s))return;let Be=t.events.length,Te=Be,Pe,Je;while(Te--)if(t.events[Te][0]==="exit"&&t.events[Te][1].type===y.chunkFlow){if(Pe){Je=t.events[Te][1].end;break}Pe=!0}k(Je,"could not find previous flow chunk"),L(i),F=Be;while(F<t.events.length)t.events[F][1].end={...Je},F++;qr(t.events,Te+1,0,t.events.slice(Be)),t.events.length=F}}function L(Q){let se=r.length;while(se-- >Q){let me=r[se];t.containerState=me[1],k(me[0].exit,"expected `exit` to be defined on container construct"),me[0].exit.call(t,e)}r.length=Q}function Se(){k(t.containerState,"expected `containerState` to be defined when closing flow"),k(n,"expected `childFlow` to be defined when closing it"),n.write([b.eof]),o=void 0,n=void 0,t.containerState._closeFlow=void 0}}function NRe(e,t,r){return k(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,e.attempt(this.parser.constructs.document,t,r),y.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)}function id(e){if(e===b.eof||ar(e)||bY(e))return ne.characterGroupWhitespace;if(yY(e))return ne.characterGroupPunctuation}function od(e,t,r){let i=[],n=-1;while(++n<e.length){let o=e[n].resolveAll;if(o&&!i.includes(o))t=o(t,r),i.push(o)}return t}var Rg={name:"attention",resolveAll:zRe,tokenize:LRe};function zRe(e,t){let r=-1,i,n,o,s,c,u,l,p;while(++r<e.length)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){i=r;while(i--)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let m={...e[i][1].end},f={...e[r][1].start};if(wY(m,-u),wY(f,u),s={type:u>1?y.strongSequence:y.emphasisSequence,start:m,end:{...e[i][1].end}},c={type:u>1?y.strongSequence:y.emphasisSequence,start:{...e[r][1].start},end:f},o={type:u>1?y.strongText:y.emphasisText,start:{...e[i][1].end},end:{...e[r][1].start}},n={type:u>1?y.strong:y.emphasis,start:{...s.start},end:{...c.end}},e[i][1].end={...s.start},e[r][1].start={...c.end},l=[],e[i][1].end.offset-e[i][1].start.offset)l=kn(l,[["enter",e[i][1],t],["exit",e[i][1],t]]);if(l=kn(l,[["enter",n,t],["enter",s,t],["exit",s,t],["enter",o,t]]),k(t.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),l=kn(l,od(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),l=kn(l,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",n,t]]),e[r][1].end.offset-e[r][1].start.offset)p=2,l=kn(l,[["enter",e[r][1],t],["exit",e[r][1],t]]);else p=0;qr(e,i-1,r-i+3,l),r=i+l.length-p-2;break}}r=-1;while(++r<e.length)if(e[r][1].type==="attentionSequence")e[r][1].type="data";return e}function LRe(e,t){let r=this.parser.constructs.attentionMarkers.null,i=this.previous,n=id(i),o;return s;function s(u){return k(u===b.asterisk||u===b.underscore,"expected asterisk or underscore"),o=u,e.enter("attentionSequence"),c(u)}function c(u){if(u===o)return e.consume(u),c;let l=e.exit("attentionSequence"),p=id(u);k(r,"expected `attentionMarkers` to be populated");let m=!p||p===ne.characterGroupPunctuation&&n||r.includes(u),f=!n||n===ne.characterGroupPunctuation&&p||r.includes(i);return l._open=Boolean(o===b.asterisk?m:m&&(n||!f)),l._close=Boolean(o===b.asterisk?f:f&&(p||!m)),t(u)}}function wY(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var mF={name:"autolink",tokenize:BRe};function BRe(e,t,r){let i=0;return n;function n(g){return k(g===b.lessThan,"expected `<`"),e.enter(y.autolink),e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.enter(y.autolinkProtocol),o}function o(g){if(ci(g))return e.consume(g),s;if(g===b.atSign)return r(g);return l(g)}function s(g){if(g===b.plusSign||g===b.dash||g===b.dot||In(g))return i=1,c(g);return l(g)}function c(g){if(g===b.colon)return e.consume(g),i=0,u;if((g===b.plusSign||g===b.dash||g===b.dot||In(g))&&i++<ne.autolinkSchemeSizeMax)return e.consume(g),c;return i=0,l(g)}function u(g){if(g===b.greaterThan)return e.exit(y.autolinkProtocol),e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.exit(y.autolink),t;if(g===b.eof||g===b.space||g===b.lessThan||Cg(g))return r(g);return e.consume(g),u}function l(g){if(g===b.atSign)return e.consume(g),p;if(fY(g))return e.consume(g),l;return r(g)}function p(g){return In(g)?m(g):r(g)}function m(g){if(g===b.dot)return e.consume(g),i=0,p;if(g===b.greaterThan)return e.exit(y.autolinkProtocol).type=y.autolinkEmail,e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.exit(y.autolink),t;return f(g)}function f(g){if((g===b.dash||In(g))&&i++<ne.autolinkDomainSizeMax){let S=g===b.dash?f:m;return e.consume(g),S}return r(g)}}var Ua={partial:!0,tokenize:URe};function URe(e,t,r){return i;function i(o){return Ke(o)?rt(e,n,y.linePrefix)(o):n(o)}function n(o){return o===b.eof||de(o)?t(o):r(o)}}var Jv={continuation:{tokenize:JRe},exit:HRe,name:"blockQuote",tokenize:qRe};function qRe(e,t,r){let i=this;return n;function n(s){if(s===b.greaterThan){let c=i.containerState;if(k(c,"expected `containerState` to be defined in container"),!c.open)e.enter(y.blockQuote,{_container:!0}),c.open=!0;return e.enter(y.blockQuotePrefix),e.enter(y.blockQuoteMarker),e.consume(s),e.exit(y.blockQuoteMarker),o}return r(s)}function o(s){if(Ke(s))return e.enter(y.blockQuotePrefixWhitespace),e.consume(s),e.exit(y.blockQuotePrefixWhitespace),e.exit(y.blockQuotePrefix),t;return e.exit(y.blockQuotePrefix),t(s)}}function JRe(e,t,r){let i=this;return n;function n(s){if(Ke(s))return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,o,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(s);return o(s)}function o(s){return e.attempt(Jv,t,r)(s)}}function HRe(e){e.exit(y.blockQuote)}var Hv={name:"characterEscape",tokenize:WRe};function WRe(e,t,r){return i;function i(o){return k(o===b.backslash,"expected `\\`"),e.enter(y.characterEscape),e.enter(y.escapeMarker),e.consume(o),e.exit(y.escapeMarker),n}function n(o){if(hY(o))return e.enter(y.characterEscapeValue),e.consume(o),e.exit(y.characterEscapeValue),e.exit(y.characterEscape),t;return r(o)}}var Wv={name:"characterReference",tokenize:ZRe};function ZRe(e,t,r){let i=this,n=0,o,s;return c;function c(m){return k(m===b.ampersand,"expected `&`"),e.enter(y.characterReference),e.enter(y.characterReferenceMarker),e.consume(m),e.exit(y.characterReferenceMarker),u}function u(m){if(m===b.numberSign)return e.enter(y.characterReferenceMarkerNumeric),e.consume(m),e.exit(y.characterReferenceMarkerNumeric),l;return e.enter(y.characterReferenceValue),o=ne.characterReferenceNamedSizeMax,s=In,p(m)}function l(m){if(m===b.uppercaseX||m===b.lowercaseX)return e.enter(y.characterReferenceMarkerHexadecimal),e.consume(m),e.exit(y.characterReferenceMarkerHexadecimal),e.enter(y.characterReferenceValue),o=ne.characterReferenceHexadecimalSizeMax,s=gY,p;return e.enter(y.characterReferenceValue),o=ne.characterReferenceDecimalSizeMax,s=Pg,p(m)}function p(m){if(m===b.semicolon&&n){let f=e.exit(y.characterReferenceValue);if(s===In&&!nd(i.sliceSerialize(f)))return r(m);return e.enter(y.characterReferenceMarker),e.consume(m),e.exit(y.characterReferenceMarker),e.exit(y.characterReference),t}if(s(m)&&n++<o)return e.consume(m),p;return r(m)}}var kY={partial:!0,tokenize:GRe},Zv={concrete:!0,name:"codeFenced",tokenize:VRe};function VRe(e,t,r){let i=this,n={partial:!0,tokenize:me},o=0,s=0,c;return u;function u(F){return l(F)}function l(F){k(F===b.graveAccent||F===b.tilde,"expected `` ` `` or `~`");let Be=i.events[i.events.length-1];return o=Be&&Be[1].type===y.linePrefix?Be[2].sliceSerialize(Be[1],!0).length:0,c=F,e.enter(y.codeFenced),e.enter(y.codeFencedFence),e.enter(y.codeFencedFenceSequence),p(F)}function p(F){if(F===c)return s++,e.consume(F),p;if(s<ne.codeFencedSequenceSizeMin)return r(F);return e.exit(y.codeFencedFenceSequence),Ke(F)?rt(e,m,y.whitespace)(F):m(F)}function m(F){if(F===b.eof||de(F))return e.exit(y.codeFencedFence),i.interrupt?t(F):e.check(kY,P,se)(F);return e.enter(y.codeFencedFenceInfo),e.enter(y.chunkString,{contentType:ne.contentTypeString}),f(F)}function f(F){if(F===b.eof||de(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceInfo),m(F);if(Ke(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceInfo),rt(e,g,y.whitespace)(F);if(F===b.graveAccent&&F===c)return r(F);return e.consume(F),f}function g(F){if(F===b.eof||de(F))return m(F);return e.enter(y.codeFencedFenceMeta),e.enter(y.chunkString,{contentType:ne.contentTypeString}),S(F)}function S(F){if(F===b.eof||de(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceMeta),m(F);if(F===b.graveAccent&&F===c)return r(F);return e.consume(F),S}function P(F){return k(de(F),"expected eol"),e.attempt(n,se,D)(F)}function D(F){return k(de(F),"expected eol"),e.enter(y.lineEnding),e.consume(F),e.exit(y.lineEnding),L}function L(F){return o>0&&Ke(F)?rt(e,Se,y.linePrefix,o+1)(F):Se(F)}function Se(F){if(F===b.eof||de(F))return e.check(kY,P,se)(F);return e.enter(y.codeFlowValue),Q(F)}function Q(F){if(F===b.eof||de(F))return e.exit(y.codeFlowValue),Se(F);return e.consume(F),Q}function se(F){return e.exit(y.codeFenced),t(F)}function me(F,Be,Te){let Pe=0;return Je;function Je(Me){return k(de(Me),"expected eol"),F.enter(y.lineEnding),F.consume(Me),F.exit(y.lineEnding),Xe}function Xe(Me){return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),F.enter(y.codeFencedFence),Ke(Me)?rt(F,He,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(Me):He(Me)}function He(Me){if(Me===c)return F.enter(y.codeFencedFenceSequence),ge(Me);return Te(Me)}function ge(Me){if(Me===c)return Pe++,F.consume(Me),ge;if(Pe>=s)return F.exit(y.codeFencedFenceSequence),Ke(Me)?rt(F,xe,y.whitespace)(Me):xe(Me);return Te(Me)}function xe(Me){if(Me===b.eof||de(Me))return F.exit(y.codeFencedFence),Be(Me);return Te(Me)}}}function GRe(e,t,r){let i=this;return n;function n(s){if(s===b.eof)return r(s);return k(de(s),"expected eol"),e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),o}function o(s){return i.parser.lazy[i.now().line]?r(s):t(s)}}var Ag={name:"codeIndented",tokenize:QRe},KRe={partial:!0,tokenize:YRe};function QRe(e,t,r){let i=this;return n;function n(l){return k(Ke(l)),e.enter(y.codeIndented),rt(e,o,y.linePrefix,ne.tabSize+1)(l)}function o(l){let p=i.events[i.events.length-1];return p&&p[1].type===y.linePrefix&&p[2].sliceSerialize(p[1],!0).length>=ne.tabSize?s(l):r(l)}function s(l){if(l===b.eof)return u(l);if(de(l))return e.attempt(KRe,s,u)(l);return e.enter(y.codeFlowValue),c(l)}function c(l){if(l===b.eof||de(l))return e.exit(y.codeFlowValue),s(l);return e.consume(l),c}function u(l){return e.exit(y.codeIndented),t(l)}}function YRe(e,t,r){let i=this;return n;function n(s){if(i.parser.lazy[i.now().line])return r(s);if(de(s))return e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),n;return rt(e,o,y.linePrefix,ne.tabSize+1)(s)}function o(s){let c=i.events[i.events.length-1];return c&&c[1].type===y.linePrefix&&c[2].sliceSerialize(c[1],!0).length>=ne.tabSize?t(s):de(s)?n(s):r(s)}}var fF={name:"codeText",previous:IY,resolve:XRe,tokenize:eAe};function XRe(e){let t=e.length-4,r=3,i,n;if((e[r][1].type===y.lineEnding||e[r][1].type==="space")&&(e[t][1].type===y.lineEnding||e[t][1].type==="space")){i=r;while(++i<t)if(e[i][1].type===y.codeTextData){e[r][1].type=y.codeTextPadding,e[t][1].type=y.codeTextPadding,r+=2,t-=2;break}}i=r-1,t++;while(++i<=t)if(n===void 0){if(i!==t&&e[i][1].type!==y.lineEnding)n=i}else if(i===t||e[i][1].type===y.lineEnding){if(e[n][1].type=y.codeTextData,i!==n+2)e[n][1].end=e[i-1][1].end,e.splice(n+2,i-n-2),t-=i-n-2,i=n+2;n=void 0}return e}function IY(e){return e!==b.graveAccent||this.events[this.events.length-1][1].type===y.characterEscape}function eAe(e,t,r){let i=this,n=0,o,s;return c;function c(f){return k(f===b.graveAccent,"expected `` ` ``"),k(IY.call(i,i.previous),"expected correct previous"),e.enter(y.codeText),e.enter(y.codeTextSequence),u(f)}function u(f){if(f===b.graveAccent)return e.consume(f),n++,u;return e.exit(y.codeTextSequence),l(f)}function l(f){if(f===b.eof)return r(f);if(f===b.space)return e.enter("space"),e.consume(f),e.exit("space"),l;if(f===b.graveAccent)return s=e.enter(y.codeTextSequence),o=0,m(f);if(de(f))return e.enter(y.lineEnding),e.consume(f),e.exit(y.lineEnding),l;return e.enter(y.codeTextData),p(f)}function p(f){if(f===b.eof||f===b.space||f===b.graveAccent||de(f))return e.exit(y.codeTextData),l(f);return e.consume(f),p}function m(f){if(f===b.graveAccent)return e.consume(f),o++,m;if(o===n)return e.exit(y.codeTextSequence),e.exit(y.codeText),t(f);return s.type=y.codeTextData,p(f)}}class gF{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(e<this.left.length)return this.left[e];return this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let r=t===null||t===void 0?Number.POSITIVE_INFINITY:t;if(r<this.left.length)return this.left.slice(e,r);if(e>this.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();return this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){let i=t||0;this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);if(r)_g(this.left,r);return n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),_g(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_g(this.right,e.reverse())}setCursor(e){if(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)return;if(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);_g(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);_g(this.left,t.reverse())}}}function _g(e,t){let r=0;if(t.length<ne.v8MaxSafeChunkSize)e.push(...t);else while(r<t.length)e.push(...t.slice(r,r+ne.v8MaxSafeChunkSize)),r+=ne.v8MaxSafeChunkSize}function Vv(e){let t={},r=-1,i,n,o,s,c,u,l,p=new gF(e);while(++r<p.length){while(r in t)r=t[r];if(i=p.get(r),r&&i[1].type===y.chunkFlow&&p.get(r-1)[1].type===y.listItemPrefix){if(k(i[1]._tokenizer,"expected `_tokenizer` on subtokens"),u=i[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type===y.lineEndingBlank)o+=2;if(o<u.length&&u[o][1].type===y.content)while(++o<u.length){if(u[o][1].type===y.content)break;if(u[o][1].type===y.chunkText)u[o][1]._isInFirstContentOfListItem=!0,o++}}if(i[0]==="enter"){if(i[1].contentType)Object.assign(t,tAe(p,r)),r=t[r],l=!0}else if(i[1]._container){o=r,n=void 0;while(o--)if(s=p.get(o),s[1].type===y.lineEnding||s[1].type===y.lineEndingBlank){if(s[0]==="enter"){if(n)p.get(n)[1].type=y.lineEndingBlank;s[1].type=y.lineEnding,n=o}}else if(s[1].type===y.linePrefix||s[1].type===y.listItemIndent);else break;if(n)i[1].end={...p.get(n)[1].start},c=p.slice(n,r),c.unshift(i),p.splice(n,r-n+1,c)}}return qr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!l}function tAe(e,t){let r=e.get(t)[1],i=e.get(t)[2],n=t-1,o=[];k(r.contentType,"expected `contentType` on subtokens");let s=r._tokenizer;if(!s){if(s=i.parser[r.contentType](r.start),r._contentTypeTextTrailing)s._contentTypeTextTrailing=!0}let c=s.events,u=[],l={},p,m,f=-1,g=r,S=0,P=0,D=[P];while(g){while(e.get(++n)[1]!==g);if(k(!m||g.previous===m,"expected previous to match"),k(!m||m.next===g,"expected next to match"),o.push(n),!g._tokenizer){if(p=i.sliceStream(g),!g.next)p.push(b.eof);if(m)s.defineSkip(g.start);if(g._isInFirstContentOfListItem)s._gfmTasklistFirstContentOfListItem=!0;if(s.write(p),g._isInFirstContentOfListItem)s._gfmTasklistFirstContentOfListItem=void 0}m=g,g=g.next}g=r;while(++f<c.length)if(c[f][0]==="exit"&&c[f-1][0]==="enter"&&c[f][1].type===c[f-1][1].type&&c[f][1].start.line!==c[f][1].end.line)k(g,"expected a current token"),P=f+1,D.push(P),g._tokenizer=void 0,g.previous=void 0,g=g.next;if(s.events=[],g)g._tokenizer=void 0,g.previous=void 0,k(!g.next,"expected no next token");else D.pop();f=D.length;while(f--){let L=c.slice(D[f],D[f+1]),Se=o.pop();k(Se!==void 0,"expected a start position when splicing"),u.push([Se,Se+L.length-1]),e.splice(Se,2,L)}u.reverse(),f=-1;while(++f<u.length)l[S+u[f][0]]=S+u[f][1],S+=u[f][1]-u[f][0]-1;return l}var hF={resolve:nAe,tokenize:iAe},rAe={partial:!0,tokenize:oAe};function nAe(e){return Vv(e),e}function iAe(e,t){let r;return i;function i(c){return k(c!==b.eof&&!de(c),"expected no eof or eol"),e.enter(y.content),r=e.enter(y.chunkContent,{contentType:ne.contentTypeContent}),n(c)}function n(c){if(c===b.eof)return o(c);if(de(c))return e.check(rAe,s,o)(c);return e.consume(c),n}function o(c){return e.exit(y.chunkContent),e.exit(y.content),t(c)}function s(c){return k(de(c),"expected eol"),e.consume(c),e.exit(y.chunkContent),k(r,"expected previous token"),r.next=e.enter(y.chunkContent,{contentType:ne.contentTypeContent,previous:r}),r=r.next,n}}function oAe(e,t,r){let i=this;return n;function n(s){return k(de(s),"expected a line ending"),e.exit(y.chunkContent),e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),rt(e,o,y.linePrefix)}function o(s){if(s===b.eof||de(s))return r(s);k(i.parser.constructs.disable.null,"expected `disable.null` to be populated");let c=i.events[i.events.length-1];if(!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type===y.linePrefix&&c[2].sliceSerialize(c[1],!0).length>=ne.tabSize)return t(s);return e.interrupt(i.parser.constructs.flow,r,t)(s)}}function Gv(e,t,r,i,n,o,s,c,u){let l=u||Number.POSITIVE_INFINITY,p=0;return m;function m(L){if(L===b.lessThan)return e.enter(i),e.enter(n),e.enter(o),e.consume(L),e.exit(o),f;if(L===b.eof||L===b.space||L===b.rightParenthesis||Cg(L))return r(L);return e.enter(i),e.enter(s),e.enter(c),e.enter(y.chunkString,{contentType:ne.contentTypeString}),P(L)}function f(L){if(L===b.greaterThan)return e.enter(o),e.consume(L),e.exit(o),e.exit(n),e.exit(i),t;return e.enter(c),e.enter(y.chunkString,{contentType:ne.contentTypeString}),g(L)}function g(L){if(L===b.greaterThan)return e.exit(y.chunkString),e.exit(c),f(L);if(L===b.eof||L===b.lessThan||de(L))return r(L);return e.consume(L),L===b.backslash?S:g}function S(L){if(L===b.lessThan||L===b.greaterThan||L===b.backslash)return e.consume(L),g;return g(L)}function P(L){if(!p&&(L===b.eof||L===b.rightParenthesis||ar(L)))return e.exit(y.chunkString),e.exit(c),e.exit(s),e.exit(i),t(L);if(p<l&&L===b.leftParenthesis)return e.consume(L),p++,P;if(L===b.rightParenthesis)return e.consume(L),p--,P;if(L===b.eof||L===b.space||L===b.leftParenthesis||Cg(L))return r(L);return e.consume(L),L===b.backslash?D:P}function D(L){if(L===b.leftParenthesis||L===b.rightParenthesis||L===b.backslash)return e.consume(L),P;return P(L)}}function Kv(e,t,r,i,n,o){let s=this,c=0,u;return l;function l(g){return k(g===b.leftSquareBracket,"expected `[`"),e.enter(i),e.enter(n),e.consume(g),e.exit(n),e.enter(o),p}function p(g){if(c>ne.linkReferenceSizeMax||g===b.eof||g===b.leftSquareBracket||g===b.rightSquareBracket&&!u||g===b.caret&&!c&&"_hiddenFootnoteSupport"in s.parser.constructs)return r(g);if(g===b.rightSquareBracket)return e.exit(o),e.enter(n),e.consume(g),e.exit(n),e.exit(i),t;if(de(g))return e.enter(y.lineEnding),e.consume(g),e.exit(y.lineEnding),p;return e.enter(y.chunkString,{contentType:ne.contentTypeString}),m(g)}function m(g){if(g===b.eof||g===b.leftSquareBracket||g===b.rightSquareBracket||de(g)||c++>ne.linkReferenceSizeMax)return e.exit(y.chunkString),p(g);if(e.consume(g),!u)u=!Ke(g);return g===b.backslash?f:m}function f(g){if(g===b.leftSquareBracket||g===b.backslash||g===b.rightSquareBracket)return e.consume(g),c++,m;return m(g)}}function Qv(e,t,r,i,n,o){let s;return c;function c(f){if(f===b.quotationMark||f===b.apostrophe||f===b.leftParenthesis)return e.enter(i),e.enter(n),e.consume(f),e.exit(n),s=f===b.leftParenthesis?b.rightParenthesis:f,u;return r(f)}function u(f){if(f===s)return e.enter(n),e.consume(f),e.exit(n),e.exit(i),t;return e.enter(o),l(f)}function l(f){if(f===s)return e.exit(o),u(s);if(f===b.eof)return r(f);if(de(f))return e.enter(y.lineEnding),e.consume(f),e.exit(y.lineEnding),rt(e,l,y.linePrefix);return e.enter(y.chunkString,{contentType:ne.contentTypeString}),p(f)}function p(f){if(f===s||f===b.eof||de(f))return e.exit(y.chunkString),l(f);return e.consume(f),f===b.backslash?m:p}function m(f){if(f===s||f===b.backslash)return e.consume(f),p;return p(f)}}function Ru(e,t){let r;return i;function i(n){if(de(n))return e.enter(y.lineEnding),e.consume(n),e.exit(y.lineEnding),r=!0,i;if(Ke(n))return rt(e,i,r?y.linePrefix:y.lineSuffix)(n);return t(n)}}var yF={name:"definition",tokenize:aAe},sAe={partial:!0,tokenize:cAe};function aAe(e,t,r){let i=this,n;return o;function o(g){return e.enter(y.definition),s(g)}function s(g){return k(g===b.leftSquareBracket,"expected `[`"),Kv.call(i,e,c,r,y.definitionLabel,y.definitionLabelMarker,y.definitionLabelString)(g)}function c(g){if(n=Ts(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===b.colon)return e.enter(y.definitionMarker),e.consume(g),e.exit(y.definitionMarker),u;return r(g)}function u(g){return ar(g)?Ru(e,l)(g):l(g)}function l(g){return Gv(e,p,r,y.definitionDestination,y.definitionDestinationLiteral,y.definitionDestinationLiteralMarker,y.definitionDestinationRaw,y.definitionDestinationString)(g)}function p(g){return e.attempt(sAe,m,m)(g)}function m(g){return Ke(g)?rt(e,f,y.whitespace)(g):f(g)}function f(g){if(g===b.eof||de(g))return e.exit(y.definition),i.parser.defined.push(n),t(g);return r(g)}}function cAe(e,t,r){return i;function i(c){return ar(c)?Ru(e,n)(c):r(c)}function n(c){return Qv(e,o,r,y.definitionTitle,y.definitionTitleMarker,y.definitionTitleString)(c)}function o(c){return Ke(c)?rt(e,s,y.whitespace)(c):s(c)}function s(c){return c===b.eof||de(c)?t(c):r(c)}}var bF={name:"hardBreakEscape",tokenize:uAe};function uAe(e,t,r){return i;function i(o){return k(o===b.backslash,"expected `\\`"),e.enter(y.hardBreakEscape),e.consume(o),n}function n(o){if(de(o))return e.exit(y.hardBreakEscape),t(o);return r(o)}}var xF={name:"headingAtx",resolve:lAe,tokenize:pAe};function lAe(e,t){let r=e.length-2,i=3,n,o;if(e[i][1].type===y.whitespace)i+=2;if(r-2>i&&e[r][1].type===y.whitespace)r-=2;if(e[r][1].type===y.atxHeadingSequence&&(i===r-1||r-4>i&&e[r-2][1].type===y.whitespace))r-=i+1===r?2:4;if(r>i)n={type:y.atxHeadingText,start:e[i][1].start,end:e[r][1].end},o={type:y.chunkText,start:e[i][1].start,end:e[r][1].end,contentType:ne.contentTypeText},qr(e,i,r-i+1,[["enter",n,t],["enter",o,t],["exit",o,t],["exit",n,t]]);return e}function pAe(e,t,r){let i=0;return n;function n(p){return e.enter(y.atxHeading),o(p)}function o(p){return k(p===b.numberSign,"expected `#`"),e.enter(y.atxHeadingSequence),s(p)}function s(p){if(p===b.numberSign&&i++<ne.atxHeadingOpeningFenceSizeMax)return e.consume(p),s;if(p===b.eof||ar(p))return e.exit(y.atxHeadingSequence),c(p);return r(p)}function c(p){if(p===b.numberSign)return e.enter(y.atxHeadingSequence),u(p);if(p===b.eof||de(p))return e.exit(y.atxHeading),t(p);if(Ke(p))return rt(e,c,y.whitespace)(p);return e.enter(y.atxHeadingText),l(p)}function u(p){if(p===b.numberSign)return e.consume(p),u;return e.exit(y.atxHeadingSequence),c(p)}function l(p){if(p===b.eof||p===b.numberSign||ar(p))return e.exit(y.atxHeadingText),c(p);return e.consume(p),l}}var TY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],SF=["pre","script","style","textarea"];var vF={concrete:!0,name:"htmlFlow",resolveTo:fAe,tokenize:gAe},dAe={partial:!0,tokenize:yAe},mAe={partial:!0,tokenize:hAe};function fAe(e){let t=e.length;while(t--)if(e[t][0]==="enter"&&e[t][1].type===y.htmlFlow)break;if(t>1&&e[t-2][1].type===y.linePrefix)e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2);return e}function gAe(e,t,r){let i=this,n,o,s,c,u;return l;function l(I){return p(I)}function p(I){return k(I===b.lessThan,"expected `<`"),e.enter(y.htmlFlow),e.enter(y.htmlFlowData),e.consume(I),m}function m(I){if(I===b.exclamationMark)return e.consume(I),f;if(I===b.slash)return e.consume(I),o=!0,P;if(I===b.questionMark)return e.consume(I),n=ne.htmlInstruction,i.interrupt?t:w;if(ci(I))return k(I!==null),e.consume(I),s=String.fromCharCode(I),D;return r(I)}function f(I){if(I===b.dash)return e.consume(I),n=ne.htmlComment,g;if(I===b.leftSquareBracket)return e.consume(I),n=ne.htmlCdata,c=0,S;if(ci(I))return e.consume(I),n=ne.htmlDeclaration,i.interrupt?t:w;return r(I)}function g(I){if(I===b.dash)return e.consume(I),i.interrupt?t:w;return r(I)}function S(I){let ur=ne.cdataOpeningString;if(I===ur.charCodeAt(c++)){if(e.consume(I),c===ur.length)return i.interrupt?t:He;return S}return r(I)}function P(I){if(ci(I))return k(I!==null),e.consume(I),s=String.fromCharCode(I),D;return r(I)}function D(I){if(I===b.eof||I===b.slash||I===b.greaterThan||ar(I)){let ur=I===b.slash,qt=s.toLowerCase();if(!ur&&!o&&SF.includes(qt))return n=ne.htmlRaw,i.interrupt?t(I):He(I);if(TY.includes(s.toLowerCase())){if(n=ne.htmlBasic,ur)return e.consume(I),L;return i.interrupt?t(I):He(I)}return n=ne.htmlComplete,i.interrupt&&!i.parser.lazy[i.now().line]?r(I):o?Se(I):Q(I)}if(I===b.dash||In(I))return e.consume(I),s+=String.fromCharCode(I),D;return r(I)}function L(I){if(I===b.greaterThan)return e.consume(I),i.interrupt?t:He;return r(I)}function Se(I){if(Ke(I))return e.consume(I),Se;return Je(I)}function Q(I){if(I===b.slash)return e.consume(I),Je;if(I===b.colon||I===b.underscore||ci(I))return e.consume(I),se;if(Ke(I))return e.consume(I),Q;return Je(I)}function se(I){if(I===b.dash||I===b.dot||I===b.colon||I===b.underscore||In(I))return e.consume(I),se;return me(I)}function me(I){if(I===b.equalsTo)return e.consume(I),F;if(Ke(I))return e.consume(I),me;return Q(I)}function F(I){if(I===b.eof||I===b.lessThan||I===b.equalsTo||I===b.greaterThan||I===b.graveAccent)return r(I);if(I===b.quotationMark||I===b.apostrophe)return e.consume(I),u=I,Be;if(Ke(I))return e.consume(I),F;return Te(I)}function Be(I){if(I===u)return e.consume(I),u=null,Pe;if(I===b.eof||de(I))return r(I);return e.consume(I),Be}function Te(I){if(I===b.eof||I===b.quotationMark||I===b.apostrophe||I===b.slash||I===b.lessThan||I===b.equalsTo||I===b.greaterThan||I===b.graveAccent||ar(I))return me(I);return e.consume(I),Te}function Pe(I){if(I===b.slash||I===b.greaterThan||Ke(I))return Q(I);return r(I)}function Je(I){if(I===b.greaterThan)return e.consume(I),Xe;return r(I)}function Xe(I){if(I===b.eof||de(I))return He(I);if(Ke(I))return e.consume(I),Xe;return r(I)}function He(I){if(I===b.dash&&n===ne.htmlComment)return e.consume(I),ee;if(I===b.lessThan&&n===ne.htmlRaw)return e.consume(I),at;if(I===b.greaterThan&&n===ne.htmlDeclaration)return e.consume(I),zt;if(I===b.questionMark&&n===ne.htmlInstruction)return e.consume(I),w;if(I===b.rightSquareBracket&&n===ne.htmlCdata)return e.consume(I),cr;if(de(I)&&(n===ne.htmlBasic||n===ne.htmlComplete))return e.exit(y.htmlFlowData),e.check(dAe,Fr,ge)(I);if(I===b.eof||de(I))return e.exit(y.htmlFlowData),ge(I);return e.consume(I),He}function ge(I){return e.check(mAe,xe,Fr)(I)}function xe(I){return k(de(I)),e.enter(y.lineEnding),e.consume(I),e.exit(y.lineEnding),Me}function Me(I){if(I===b.eof||de(I))return ge(I);return e.enter(y.htmlFlowData),He(I)}function ee(I){if(I===b.dash)return e.consume(I),w;return He(I)}function at(I){if(I===b.slash)return e.consume(I),s="",ft;return He(I)}function ft(I){if(I===b.greaterThan){let ur=s.toLowerCase();if(SF.includes(ur))return e.consume(I),zt;return He(I)}if(ci(I)&&s.length<ne.htmlRawSizeMax)return k(I!==null),e.consume(I),s+=String.fromCharCode(I),ft;return He(I)}function cr(I){if(I===b.rightSquareBracket)return e.consume(I),w;return He(I)}function w(I){if(I===b.greaterThan)return e.consume(I),zt;if(I===b.dash&&n===ne.htmlComment)return e.consume(I),w;return He(I)}function zt(I){if(I===b.eof||de(I))return e.exit(y.htmlFlowData),Fr(I);return e.consume(I),zt}function Fr(I){return e.exit(y.htmlFlow),t(I)}}function hAe(e,t,r){let i=this;return n;function n(s){if(de(s))return e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),o;return r(s)}function o(s){return i.parser.lazy[i.now().line]?r(s):t(s)}}function yAe(e,t,r){return i;function i(n){return k(de(n),"expected a line ending"),e.enter(y.lineEnding),e.consume(n),e.exit(y.lineEnding),e.attempt(Ua,t,r)}}var wF={name:"htmlText",tokenize:bAe};function bAe(e,t,r){let i=this,n,o,s;return c;function c(w){return k(w===b.lessThan,"expected `<`"),e.enter(y.htmlText),e.enter(y.htmlTextData),e.consume(w),u}function u(w){if(w===b.exclamationMark)return e.consume(w),l;if(w===b.slash)return e.consume(w),me;if(w===b.questionMark)return e.consume(w),Q;if(ci(w))return e.consume(w),Te;return r(w)}function l(w){if(w===b.dash)return e.consume(w),p;if(w===b.leftSquareBracket)return e.consume(w),o=0,S;if(ci(w))return e.consume(w),Se;return r(w)}function p(w){if(w===b.dash)return e.consume(w),g;return r(w)}function m(w){if(w===b.eof)return r(w);if(w===b.dash)return e.consume(w),f;if(de(w))return s=m,at(w);return e.consume(w),m}function f(w){if(w===b.dash)return e.consume(w),g;return m(w)}function g(w){return w===b.greaterThan?ee(w):w===b.dash?f(w):m(w)}function S(w){let zt=ne.cdataOpeningString;if(w===zt.charCodeAt(o++))return e.consume(w),o===zt.length?P:S;return r(w)}function P(w){if(w===b.eof)return r(w);if(w===b.rightSquareBracket)return e.consume(w),D;if(de(w))return s=P,at(w);return e.consume(w),P}function D(w){if(w===b.rightSquareBracket)return e.consume(w),L;return P(w)}function L(w){if(w===b.greaterThan)return ee(w);if(w===b.rightSquareBracket)return e.consume(w),L;return P(w)}function Se(w){if(w===b.eof||w===b.greaterThan)return ee(w);if(de(w))return s=Se,at(w);return e.consume(w),Se}function Q(w){if(w===b.eof)return r(w);if(w===b.questionMark)return e.consume(w),se;if(de(w))return s=Q,at(w);return e.consume(w),Q}function se(w){return w===b.greaterThan?ee(w):Q(w)}function me(w){if(ci(w))return e.consume(w),F;return r(w)}function F(w){if(w===b.dash||In(w))return e.consume(w),F;return Be(w)}function Be(w){if(de(w))return s=Be,at(w);if(Ke(w))return e.consume(w),Be;return ee(w)}function Te(w){if(w===b.dash||In(w))return e.consume(w),Te;if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return r(w)}function Pe(w){if(w===b.slash)return e.consume(w),ee;if(w===b.colon||w===b.underscore||ci(w))return e.consume(w),Je;if(de(w))return s=Pe,at(w);if(Ke(w))return e.consume(w),Pe;return ee(w)}function Je(w){if(w===b.dash||w===b.dot||w===b.colon||w===b.underscore||In(w))return e.consume(w),Je;return Xe(w)}function Xe(w){if(w===b.equalsTo)return e.consume(w),He;if(de(w))return s=Xe,at(w);if(Ke(w))return e.consume(w),Xe;return Pe(w)}function He(w){if(w===b.eof||w===b.lessThan||w===b.equalsTo||w===b.greaterThan||w===b.graveAccent)return r(w);if(w===b.quotationMark||w===b.apostrophe)return e.consume(w),n=w,ge;if(de(w))return s=He,at(w);if(Ke(w))return e.consume(w),He;return e.consume(w),xe}function ge(w){if(w===n)return e.consume(w),n=void 0,Me;if(w===b.eof)return r(w);if(de(w))return s=ge,at(w);return e.consume(w),ge}function xe(w){if(w===b.eof||w===b.quotationMark||w===b.apostrophe||w===b.lessThan||w===b.equalsTo||w===b.graveAccent)return r(w);if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return e.consume(w),xe}function Me(w){if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return r(w)}function ee(w){if(w===b.greaterThan)return e.consume(w),e.exit(y.htmlTextData),e.exit(y.htmlText),t;return r(w)}function at(w){return k(s,"expected return state"),k(de(w),"expected eol"),e.exit(y.htmlTextData),e.enter(y.lineEnding),e.consume(w),e.exit(y.lineEnding),ft}function ft(w){return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),Ke(w)?rt(e,cr,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(w):cr(w)}function cr(w){return e.enter(y.htmlTextData),s(w)}}var Au={name:"labelEnd",resolveAll:wAe,resolveTo:kAe,tokenize:IAe},xAe={tokenize:TAe},SAe={tokenize:EAe},vAe={tokenize:CAe};function wAe(e){let t=-1,r=[];while(++t<e.length){let i=e[t][1];if(r.push(e[t]),i.type===y.labelImage||i.type===y.labelLink||i.type===y.labelEnd){let n=i.type===y.labelImage?4:2;i.type=y.data,t+=n}}if(e.length!==r.length)qr(e,0,e.length,r);return e}function kAe(e,t){let r=e.length,i=0,n,o,s,c;while(r--)if(n=e[r][1],o){if(n.type===y.link||n.type===y.labelLink&&n._inactive)break;if(e[r][0]==="enter"&&n.type===y.labelLink)n._inactive=!0}else if(s){if(e[r][0]==="enter"&&(n.type===y.labelImage||n.type===y.labelLink)&&!n._balanced){if(o=r,n.type!==y.labelLink){i=2;break}}}else if(n.type===y.labelEnd)s=r;k(o!==void 0,"`open` is supposed to be found"),k(s!==void 0,"`close` is supposed to be found");let u={type:e[o][1].type===y.labelLink?y.link:y.image,start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:y.label,start:{...e[o][1].start},end:{...e[s][1].end}},p={type:y.labelText,start:{...e[o+i+2][1].end},end:{...e[s-2][1].start}};return c=[["enter",u,t],["enter",l,t]],c=kn(c,e.slice(o+1,o+i+3)),c=kn(c,[["enter",p,t]]),k(t.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),c=kn(c,od(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t)),c=kn(c,[["exit",p,t],e[s-2],e[s-1],["exit",l,t]]),c=kn(c,e.slice(s+1)),c=kn(c,[["exit",u,t]]),qr(e,o,e.length,c),e}function IAe(e,t,r){let i=this,n=i.events.length,o,s;while(n--)if((i.events[n][1].type===y.labelImage||i.events[n][1].type===y.labelLink)&&!i.events[n][1]._balanced){o=i.events[n][1];break}return c;function c(f){if(k(f===b.rightSquareBracket,"expected `]`"),!o)return r(f);if(o._inactive)return m(f);return s=i.parser.defined.includes(Ts(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter(y.labelEnd),e.enter(y.labelMarker),e.consume(f),e.exit(y.labelMarker),e.exit(y.labelEnd),u}function u(f){if(f===b.leftParenthesis)return e.attempt(xAe,p,s?p:m)(f);if(f===b.leftSquareBracket)return e.attempt(SAe,p,s?l:m)(f);return s?p(f):m(f)}function l(f){return e.attempt(vAe,p,m)(f)}function p(f){return t(f)}function m(f){return o._balanced=!0,r(f)}}function TAe(e,t,r){return i;function i(m){return k(m===b.leftParenthesis,"expected left paren"),e.enter(y.resource),e.enter(y.resourceMarker),e.consume(m),e.exit(y.resourceMarker),n}function n(m){return ar(m)?Ru(e,o)(m):o(m)}function o(m){if(m===b.rightParenthesis)return p(m);return Gv(e,s,c,y.resourceDestination,y.resourceDestinationLiteral,y.resourceDestinationLiteralMarker,y.resourceDestinationRaw,y.resourceDestinationString,ne.linkResourceDestinationBalanceMax)(m)}function s(m){return ar(m)?Ru(e,u)(m):p(m)}function c(m){return r(m)}function u(m){if(m===b.quotationMark||m===b.apostrophe||m===b.leftParenthesis)return Qv(e,l,r,y.resourceTitle,y.resourceTitleMarker,y.resourceTitleString)(m);return p(m)}function l(m){return ar(m)?Ru(e,p)(m):p(m)}function p(m){if(m===b.rightParenthesis)return e.enter(y.resourceMarker),e.consume(m),e.exit(y.resourceMarker),e.exit(y.resource),t;return r(m)}}function EAe(e,t,r){let i=this;return n;function n(c){return k(c===b.leftSquareBracket,"expected left bracket"),Kv.call(i,e,o,s,y.reference,y.referenceMarker,y.referenceString)(c)}function o(c){return i.parser.defined.includes(Ts(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):r(c)}function s(c){return r(c)}}function CAe(e,t,r){return i;function i(o){return k(o===b.leftSquareBracket,"expected left bracket"),e.enter(y.reference),e.enter(y.referenceMarker),e.consume(o),e.exit(y.referenceMarker),n}function n(o){if(o===b.rightSquareBracket)return e.enter(y.referenceMarker),e.consume(o),e.exit(y.referenceMarker),e.exit(y.reference),t;return r(o)}}var kF={name:"labelStartImage",resolveAll:Au.resolveAll,tokenize:PAe};function PAe(e,t,r){let i=this;return n;function n(c){return k(c===b.exclamationMark,"expected `!`"),e.enter(y.labelImage),e.enter(y.labelImageMarker),e.consume(c),e.exit(y.labelImageMarker),o}function o(c){if(c===b.leftSquareBracket)return e.enter(y.labelMarker),e.consume(c),e.exit(y.labelMarker),e.exit(y.labelImage),s;return r(c)}function s(c){return c===b.caret&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):t(c)}}var IF={name:"labelStartLink",resolveAll:Au.resolveAll,tokenize:RAe};function RAe(e,t,r){let i=this;return n;function n(s){return k(s===b.leftSquareBracket,"expected `[`"),e.enter(y.labelLink),e.enter(y.labelMarker),e.consume(s),e.exit(y.labelMarker),e.exit(y.labelLink),o}function o(s){return s===b.caret&&"_hiddenFootnoteSupport"in i.parser.constructs?r(s):t(s)}}var Og={name:"lineEnding",tokenize:AAe};function AAe(e,t){return r;function r(i){return k(de(i),"expected eol"),e.enter(y.lineEnding),e.consume(i),e.exit(y.lineEnding),rt(e,t,y.linePrefix)}}var _u={name:"thematicBreak",tokenize:_Ae};function _Ae(e,t,r){let i=0,n;return o;function o(l){return e.enter(y.thematicBreak),s(l)}function s(l){return k(l===b.asterisk||l===b.dash||l===b.underscore,"expected `*`, `-`, or `_`"),n=l,c(l)}function c(l){if(l===n)return e.enter(y.thematicBreakSequence),u(l);if(i>=ne.thematicBreakMarkerCountMin&&(l===b.eof||de(l)))return e.exit(y.thematicBreak),t(l);return r(l)}function u(l){if(l===n)return e.consume(l),i++,u;return e.exit(y.thematicBreakSequence),Ke(l)?rt(e,c,y.whitespace)(l):c(l)}}var sn={continuation:{tokenize:FAe},exit:jAe,name:"list",tokenize:MAe},OAe={partial:!0,tokenize:NAe},DAe={partial:!0,tokenize:$Ae};function MAe(e,t,r){let i=this,n=i.events[i.events.length-1],o=n&&n[1].type===y.linePrefix?n[2].sliceSerialize(n[1],!0).length:0,s=0;return c;function c(g){k(i.containerState,"expected state");let S=i.containerState.type||(g===b.asterisk||g===b.plusSign||g===b.dash?y.listUnordered:y.listOrdered);if(S===y.listUnordered?!i.containerState.marker||g===i.containerState.marker:Pg(g)){if(!i.containerState.type)i.containerState.type=S,e.enter(S,{_container:!0});if(S===y.listUnordered)return e.enter(y.listItemPrefix),g===b.asterisk||g===b.dash?e.check(_u,r,l)(g):l(g);if(!i.interrupt||g===b.digit1)return e.enter(y.listItemPrefix),e.enter(y.listItemValue),u(g)}return r(g)}function u(g){if(k(i.containerState,"expected state"),Pg(g)&&++s<ne.listItemValueSizeMax)return e.consume(g),u;if((!i.interrupt||s<2)&&(i.containerState.marker?g===i.containerState.marker:g===b.rightParenthesis||g===b.dot))return e.exit(y.listItemValue),l(g);return r(g)}function l(g){return k(i.containerState,"expected state"),k(g!==b.eof,"eof (`null`) is not a marker"),e.enter(y.listItemMarker),e.consume(g),e.exit(y.listItemMarker),i.containerState.marker=i.containerState.marker||g,e.check(Ua,i.interrupt?r:p,e.attempt(OAe,f,m))}function p(g){return k(i.containerState,"expected state"),i.containerState.initialBlankLine=!0,o++,f(g)}function m(g){if(Ke(g))return e.enter(y.listItemPrefixWhitespace),e.consume(g),e.exit(y.listItemPrefixWhitespace),f;return r(g)}function f(g){return k(i.containerState,"expected state"),i.containerState.size=o+i.sliceSerialize(e.exit(y.listItemPrefix),!0).length,t(g)}}function FAe(e,t,r){let i=this;return k(i.containerState,"expected state"),i.containerState._closeFlow=void 0,e.check(Ua,n,o);function n(c){return k(i.containerState,"expected state"),k(typeof i.containerState.size==="number","expected size"),i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,rt(e,t,y.listItemIndent,i.containerState.size+1)(c)}function o(c){if(k(i.containerState,"expected state"),i.containerState.furtherBlankLines||!Ke(c))return i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(c);return i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(DAe,t,s)(c)}function s(c){return k(i.containerState,"expected state"),i.containerState._closeFlow=!0,i.interrupt=void 0,k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,e.attempt(sn,t,r),y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(c)}}function $Ae(e,t,r){let i=this;return k(i.containerState,"expected state"),k(typeof i.containerState.size==="number","expected size"),rt(e,n,y.listItemIndent,i.containerState.size+1);function n(o){k(i.containerState,"expected state");let s=i.events[i.events.length-1];return s&&s[1].type===y.listItemIndent&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?t(o):r(o)}}function jAe(e){k(this.containerState,"expected state"),k(typeof this.containerState.type==="string","expected type"),e.exit(this.containerState.type)}function NAe(e,t,r){let i=this;return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,n,y.listItemPrefixWhitespace,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize+1);function n(o){let s=i.events[i.events.length-1];return!Ke(o)&&s&&s[1].type===y.listItemPrefixWhitespace?t(o):r(o)}}var Yv={name:"setextUnderline",resolveTo:zAe,tokenize:LAe};function zAe(e,t){let r=e.length,i,n,o;while(r--)if(e[r][0]==="enter"){if(e[r][1].type===y.content){i=r;break}if(e[r][1].type===y.paragraph)n=r}else{if(e[r][1].type===y.content)e.splice(r,1);if(!o&&e[r][1].type===y.definition)o=r}k(n!==void 0,"expected a `text` index to be found"),k(i!==void 0,"expected a `text` index to be found"),k(e[i][2]===t,"enter context should be same"),k(e[e.length-1][2]===t,"enter context should be same");let s={type:y.setextHeading,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};if(e[n][1].type=y.setextHeadingText,o)e.splice(n,0,["enter",s,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end};else e[i][1]=s;return e.push(["exit",s,t]),e}function LAe(e,t,r){let i=this,n;return o;function o(l){let p=i.events.length,m;k(l===b.dash||l===b.equalsTo,"expected `=` or `-`");while(p--)if(i.events[p][1].type!==y.lineEnding&&i.events[p][1].type!==y.linePrefix&&i.events[p][1].type!==y.content){m=i.events[p][1].type===y.paragraph;break}if(!i.parser.lazy[i.now().line]&&(i.interrupt||m))return e.enter(y.setextHeadingLine),n=l,s(l);return r(l)}function s(l){return e.enter(y.setextHeadingLineSequence),c(l)}function c(l){if(l===n)return e.consume(l),c;return e.exit(y.setextHeadingLineSequence),Ke(l)?rt(e,u,y.lineSuffix)(l):u(l)}function u(l){if(l===b.eof||de(l))return e.exit(y.setextHeadingLine),t(l);return r(l)}}var EY={tokenize:BAe};function BAe(e){let t=this,r=e.attempt(Ua,i,e.attempt(this.parser.constructs.flowInitial,n,rt(e,e.attempt(this.parser.constructs.flow,n,e.attempt(hF,n)),y.linePrefix)));return r;function i(o){if(k(o===b.eof||de(o),"expected eol or eof"),o===b.eof){e.consume(o);return}return e.enter(y.lineEndingBlank),e.consume(o),e.exit(y.lineEndingBlank),t.currentConstruct=void 0,r}function n(o){if(k(o===b.eof||de(o),"expected eol or eof"),o===b.eof){e.consume(o);return}return e.enter(y.lineEnding),e.consume(o),e.exit(y.lineEnding),t.currentConstruct=void 0,r}}var CY={resolveAll:_Y()},PY=AY("string"),RY=AY("text");function AY(e){return{resolveAll:_Y(e==="text"?UAe:void 0),tokenize:t};function t(r){let i=this,n=this.parser.constructs[e],o=r.attempt(n,s,c);return s;function s(p){return l(p)?o(p):c(p)}function c(p){if(p===b.eof){r.consume(p);return}return r.enter(y.data),r.consume(p),u}function u(p){if(l(p))return r.exit(y.data),o(p);return r.consume(p),u}function l(p){if(p===b.eof)return!0;let m=n[p],f=-1;if(m){k(Array.isArray(m),"expected `disable.null` to be populated");while(++f<m.length){let g=m[f];if(!g.previous||g.previous.call(i,i.previous))return!0}}return!1}}}function _Y(e){return t;function t(r,i){let n=-1,o;while(++n<=r.length)if(o===void 0){if(r[n]&&r[n][1].type===y.data)o=n,n++}else if(!r[n]||r[n][1].type!==y.data){if(n!==o+2)r[o][1].end=r[n-1][1].end,r.splice(o+2,n-o-2),n=o+2;o=void 0}return e?e(r,i):r}}function UAe(e,t){let r=0;while(++r<=e.length)if((r===e.length||e[r][1].type===y.lineEnding)&&e[r-1][1].type===y.data){let i=e[r-1][1],n=t.sliceStream(i),o=n.length,s=-1,c=0,u;while(o--){let l=n[o];if(typeof l==="string"){s=l.length;while(l.charCodeAt(s-1)===b.space)c++,s--;if(s)break;s=-1}else if(l===b.horizontalTab)u=!0,c++;else if(l===b.virtualSpace);else{o++;break}}if(t._contentTypeTextTrailing&&r===e.length)c=0;if(c){let l={type:r===e.length||u||c<ne.hardBreakPrefixSizeMin?y.lineSuffix:y.hardBreakTrailing,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};if(i.end={...l.start},i.start.offset===i.end.offset)Object.assign(i,l);else e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2}r++}return e}var TF={};pi(TF,{attentionMarkers:()=>KAe,contentInitial:()=>JAe,disable:()=>QAe,document:()=>qAe,flow:()=>WAe,flowInitial:()=>HAe,insideSpan:()=>GAe,string:()=>ZAe,text:()=>VAe});var qAe={[b.asterisk]:sn,[b.plusSign]:sn,[b.dash]:sn,[b.digit0]:sn,[b.digit1]:sn,[b.digit2]:sn,[b.digit3]:sn,[b.digit4]:sn,[b.digit5]:sn,[b.digit6]:sn,[b.digit7]:sn,[b.digit8]:sn,[b.digit9]:sn,[b.greaterThan]:Jv},JAe={[b.leftSquareBracket]:yF},HAe={[b.horizontalTab]:Ag,[b.virtualSpace]:Ag,[b.space]:Ag},WAe={[b.numberSign]:xF,[b.asterisk]:_u,[b.dash]:[Yv,_u],[b.lessThan]:vF,[b.equalsTo]:Yv,[b.underscore]:_u,[b.graveAccent]:Zv,[b.tilde]:Zv},ZAe={[b.ampersand]:Wv,[b.backslash]:Hv},VAe={[b.carriageReturn]:Og,[b.lineFeed]:Og,[b.carriageReturnLineFeed]:Og,[b.exclamationMark]:kF,[b.ampersand]:Wv,[b.asterisk]:Rg,[b.lessThan]:[mF,wF],[b.leftSquareBracket]:IF,[b.backslash]:[bF,Hv],[b.rightSquareBracket]:Au,[b.underscore]:Rg,[b.graveAccent]:fF},GAe={null:[Rg,CY]},KAe={null:[b.asterisk,b.underscore]},QAe={null:[]};var OY=Rs(Uy(),1);var Ou=OY.default("micromark");function DY(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},n={},o=[],s=[],c=[],u=!0,l={attempt:Pe(Be),check:Pe(Te),consume:se,enter:me,exit:F,interrupt:Pe(Te,{interrupt:!0})},p={code:b.eof,containerState:{},defineSkip:L,events:[],now:D,parser:e,previous:b.eof,sliceSerialize:S,sliceStream:P,write:g},m=t.tokenize.call(p,l),f;if(t.resolveAll)o.push(t);return p;function g(ge){if(s=kn(s,ge),Se(),s[s.length-1]!==b.eof)return[];return Je(t,0),p.events=od(o,p.events,p),p.events}function S(ge,xe){return XAe(P(ge),xe)}function P(ge){return YAe(s,ge)}function D(){let{_bufferIndex:ge,_index:xe,line:Me,column:ee,offset:at}=i;return{_bufferIndex:ge,_index:xe,line:Me,column:ee,offset:at}}function L(ge){n[ge.line]=ge.column,He(),Ou("position: define skip: `%j`",i)}function Se(){let ge;while(i._index<s.length){let xe=s[i._index];if(typeof xe==="string"){if(ge=i._index,i._bufferIndex<0)i._bufferIndex=0;while(i._index===ge&&i._bufferIndex<xe.length)Q(xe.charCodeAt(i._bufferIndex))}else Q(xe)}}function Q(ge){k(u===!0,"expected character to be consumed"),u=void 0,Ou("main: passing `%s` to %s",ge,m&&m.name),f=ge,k(typeof m==="function","expected state"),m=m(ge)}function se(ge){if(k(ge===f,"expected given code to equal expected code"),Ou("consume: `%s`",ge),k(u===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),k(ge===null?p.events.length===0||p.events[p.events.length-1][0]==="exit":p.events[p.events.length-1][0]==="enter","expected last token to be open"),de(ge))i.line++,i.column=1,i.offset+=ge===b.carriageReturnLineFeed?2:1,He(),Ou("position: after eol: `%j`",i);else if(ge!==b.virtualSpace)i.column++,i.offset++;if(i._bufferIndex<0)i._index++;else if(i._bufferIndex++,i._bufferIndex===s[i._index].length)i._bufferIndex=-1,i._index++;p.previous=ge,u=!0}function me(ge,xe){let Me=xe||{};return Me.type=ge,Me.start=D(),k(typeof ge==="string","expected string type"),k(ge.length>0,"expected non-empty string"),Ou("enter: `%s`",ge),p.events.push(["enter",Me,p]),c.push(Me),Me}function F(ge){k(typeof ge==="string","expected string type"),k(ge.length>0,"expected non-empty string");let xe=c.pop();return k(xe,"cannot close w/o open tokens"),xe.end=D(),k(ge===xe.type,"expected exit token to match current token"),k(!(xe.start._index===xe.end._index&&xe.start._bufferIndex===xe.end._bufferIndex),"expected non-empty token (`"+ge+"`)"),Ou("exit: `%s`",xe.type),p.events.push(["exit",xe,p]),xe}function Be(ge,xe){Je(ge,xe.from)}function Te(ge,xe){xe.restore()}function Pe(ge,xe){return Me;function Me(ee,at,ft){let cr,w,zt,Fr;return Array.isArray(ee)?ur(ee):("tokenize"in ee)?ur([ee]):I(ee);function I(St){return ht;function ht(Tt){let Ie=Tt!==null&&St[Tt],oe=Tt!==null&&St.null,Ee=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ur(Ee)(Tt)}}function ur(St){if(cr=St,w=0,St.length===0)return k(ft,"expected `bogusState` to be given"),ft;return qt(St[w])}function qt(St){return ht;function ht(Tt){if(Fr=Xe(),zt=St,!St.partial)p.currentConstruct=St;if(k(p.parser.constructs.disable.null,"expected `disable.null` to be populated"),St.name&&p.parser.constructs.disable.null.includes(St.name))return Hr(Tt);return St.tokenize.call(xe?Object.assign(Object.create(p),xe):p,l,En,Hr)(Tt)}}function En(St){return k(St===f,"expected code"),u=!0,ge(zt,Fr),at}function Hr(St){if(k(St===f,"expected code"),u=!0,Fr.restore(),++w<cr.length)return qt(cr[w]);return ft}}}function Je(ge,xe){if(ge.resolveAll&&!o.includes(ge))o.push(ge);if(ge.resolve)qr(p.events,xe,p.events.length-xe,ge.resolve(p.events.slice(xe),p));if(ge.resolveTo)p.events=ge.resolveTo(p.events,p);k(ge.partial||p.events.length===0||p.events[p.events.length-1][0]==="exit","expected last token to end")}function Xe(){let ge=D(),xe=p.previous,Me=p.currentConstruct,ee=p.events.length,at=Array.from(c);return{from:ee,restore:ft};function ft(){i=ge,p.previous=xe,p.currentConstruct=Me,p.events.length=ee,c=at,He(),Ou("position: restore: `%j`",i)}}function He(){if(i.line in n&&i.column<2)i.column=n[i.line],i.offset+=n[i.line]-1}}function YAe(e,t){let r=t.start._index,i=t.start._bufferIndex,n=t.end._index,o=t.end._bufferIndex,s;if(r===n)k(o>-1,"expected non-negative end buffer index"),k(i>-1,"expected non-negative start buffer index"),s=[e[r].slice(i,o)];else{if(s=e.slice(r,n),i>-1){let c=s[0];if(typeof c==="string")s[0]=c.slice(i);else k(i===0,"expected `startBufferIndex` to be `0`"),s.shift()}if(o>0)s.push(e[n].slice(0,o))}return s}function XAe(e,t){let r=-1,i=[],n;while(++r<e.length){let o=e[r],s;if(typeof o==="string")s=o;else switch(o){case b.carriageReturn:{s=ai.cr;break}case b.lineFeed:{s=ai.lf;break}case b.carriageReturnLineFeed:{s=ai.cr+ai.lf;break}case b.horizontalTab:{s=t?ai.space:ai.ht;break}case b.virtualSpace:{if(!t&&n)continue;s=ai.space;break}default:k(typeof o==="number","expected number"),s=String.fromCharCode(o)}n=o===b.horizontalTab,i.push(s)}return i.join("")}function EF(e){let i={constructs:mY([TF,...(e||{}).extensions||[]]),content:n(xY),defined:[],document:n(vY),flow:n(EY),lazy:{},string:n(PY),text:n(RY)};return i;function n(o){return s;function s(c){return DY(i,o,c)}}}function CF(e){while(!Vv(e));return e}var MY=/[\0\t\n\r]/g;function PF(){let e=1,t="",r=!0,i;return n;function n(o,s,c){let u=[],l,p,m,f,g;if(o=t+(typeof o==="string"?o.toString():new TextDecoder(s||void 0).decode(o)),m=0,t="",r){if(o.charCodeAt(0)===b.byteOrderMarker)m++;r=void 0}while(m<o.length){if(MY.lastIndex=m,l=MY.exec(o),f=l&&l.index!==void 0?l.index:o.length,g=o.charCodeAt(f),!l){t=o.slice(m);break}if(g===b.lf&&m===f&&i)u.push(b.carriageReturnLineFeed),i=void 0;else{if(i)u.push(b.carriageReturn),i=void 0;if(m<f)u.push(o.slice(m,f)),e+=f-m;switch(g){case b.nul:{u.push(b.replacementCharacter),e++;break}case b.ht:{p=Math.ceil(e/ne.tabSize)*ne.tabSize,u.push(b.horizontalTab);while(e++<p)u.push(b.virtualSpace);break}case b.lf:{u.push(b.lineFeed),e=1;break}default:i=!0,e=1}}m=f+1}if(c){if(i)u.push(b.carriageReturn);if(t)u.push(t);u.push(b.eof)}return u}}var e_e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xv(e){return e.replace(e_e,t_e)}function t_e(e,t,r){if(t)return t;if(r.charCodeAt(0)===b.numberSign){let n=r.charCodeAt(1),o=n===b.lowercaseX||n===b.uppercaseX;return qv(r.slice(o?2:1),o?ne.numericBaseHexadecimal:ne.numericBaseDecimal)}return nd(r)||e}function qa(e){if(!e||typeof e!=="object")return"";if("position"in e||"type"in e)return FY(e.position);if("start"in e||"end"in e)return FY(e);if("line"in e||"column"in e)return RF(e);return""}function RF(e){return $Y(e&&e.line)+":"+$Y(e&&e.column)}function FY(e){return RF(e&&e.start)+"-"+RF(e&&e.end)}function $Y(e){return e&&typeof e==="number"?e:1}var NY={}.hasOwnProperty;function AF(e,t,r){if(t&&typeof t==="object")r=t,t=void 0;return r_e(r)(CF(EF(r).document().write(PF()(e,t,!0))))}function r_e(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Nu),autolinkProtocol:Pe,autolinkEmail:Pe,atxHeading:o(nr),blockQuote:o(Tt),characterEscape:Pe,characterReference:Pe,codeFenced:o(Ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ie,s),codeText:o(oe,s),codeTextData:Pe,data:Pe,codeFlowValue:Pe,definition:o(Ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(gt),hardBreakEscape:o(hr),hardBreakTrailing:o(hr),htmlFlow:o(Wr,s),htmlFlowData:Pe,htmlText:o(Wr,s),htmlTextData:Pe,image:o(ju),label:s,link:o(Nu),listItem:o(zu),listItemValue:f,listOrdered:o(Ka,m),listUnordered:o(Ka),paragraph:o(wd),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(nr),strong:o(Mi),thematicBreak:o(Lu)},exit:{atxHeading:u(),atxHeadingSequence:me,autolink:u(),autolinkEmail:ht,autolinkProtocol:St,blockQuote:u(),characterEscapeValue:Je,characterReferenceMarkerHexadecimal:qt,characterReferenceMarkerNumeric:qt,characterReferenceValue:En,characterReference:Hr,codeFenced:u(D),codeFencedFence:P,codeFencedFenceInfo:g,codeFencedFenceMeta:S,codeFlowValue:Je,codeIndented:u(L),codeText:u(Me),codeTextData:Je,data:Je,definition:u(),definitionDestinationString:se,definitionLabelString:Se,definitionTitleString:Q,emphasis:u(),hardBreakEscape:u(He),hardBreakTrailing:u(He),htmlFlow:u(ge),htmlFlowData:Je,htmlText:u(xe),htmlTextData:Je,image:u(at),label:cr,labelText:ft,lineEnding:Xe,link:u(ee),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ur,resourceDestinationString:w,resourceTitleString:zt,resource:Fr,setextHeading:u(Te),setextHeadingLineSequence:Be,setextHeadingText:F,strong:u(),thematicBreak:u()}};zY(t,(e||{}).mdastExtensions||[]);let r={};return i;function i(j){let N={type:"root",children:[]},d={stack:[N],tokenStack:[],config:t,enter:c,exit:l,buffer:s,resume:p,data:r},T=[],A=-1;while(++A<j.length)if(j[A][1].type===y.listOrdered||j[A][1].type===y.listUnordered)if(j[A][0]==="enter")T.push(A);else{let z=T.pop();k(typeof z==="number","expected list to be open"),A=n(j,z,A)}A=-1;while(++A<j.length){let z=t[j[A][0]];if(NY.call(z,j[A][1].type))z[j[A][1].type].call(Object.assign({sliceSerialize:j[A][2].sliceSerialize},d),j[A][1])}if(d.tokenStack.length>0){let z=d.tokenStack[d.tokenStack.length-1];(z[1]||jY).call(d,void 0,z[0])}N.position={start:Ja(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:Ja(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},A=-1;while(++A<t.transforms.length)N=t.transforms[A](N)||N;return N}function n(j,N,d){let T=N-1,A=-1,z=!1,M,Z,x,R;while(++T<=d){let J=j[T];switch(J[1].type){case y.listUnordered:case y.listOrdered:case y.blockQuote:{if(J[0]==="enter")A++;else A--;R=void 0;break}case y.lineEndingBlank:{if(J[0]==="enter"){if(M&&!R&&!A&&!x)x=T;R=void 0}break}case y.linePrefix:case y.listItemValue:case y.listItemMarker:case y.listItemPrefix:case y.listItemPrefixWhitespace:break;default:R=void 0}if(!A&&J[0]==="enter"&&J[1].type===y.listItemPrefix||A===-1&&J[0]==="exit"&&(J[1].type===y.listUnordered||J[1].type===y.listOrdered)){if(M){let B=T;Z=void 0;while(B--){let U=j[B];if(U[1].type===y.lineEnding||U[1].type===y.lineEndingBlank){if(U[0]==="exit")continue;if(Z)j[Z][1].type=y.lineEndingBlank,z=!0;U[1].type=y.lineEnding,Z=B}else if(U[1].type===y.linePrefix||U[1].type===y.blockQuotePrefix||U[1].type===y.blockQuotePrefixWhitespace||U[1].type===y.blockQuoteMarker||U[1].type===y.listItemIndent);else break}if(x&&(!Z||x<Z))M._spread=!0;M.end=Object.assign({},Z?j[Z][1].start:J[1].end),j.splice(Z||T,0,["exit",M,J[2]]),T++,d++}if(J[1].type===y.listItemPrefix){let B={type:"listItem",_spread:!1,start:Object.assign({},J[1].start),end:void 0};M=B,j.splice(T,0,["enter",B,J[2]]),T++,d++,x=void 0,R=!0}}}return j[N][1]._spread=z,d}function o(j,N){return d;function d(T){if(c.call(this,j(T),T),N)N.call(this,T)}}function s(){this.stack.push({type:"fragment",children:[]})}function c(j,N,d){let T=this.stack[this.stack.length-1];k(T,"expected `parent`"),k("children"in T,"expected `parent`"),T.children.push(j),this.stack.push(j),this.tokenStack.push([N,d||void 0]),j.position={start:Ja(N.start),end:void 0}}function u(j){return N;function N(d){if(j)j.call(this,d);l.call(this,d)}}function l(j,N){let d=this.stack.pop();k(d,"expected `node`");let T=this.tokenStack.pop();if(!T)throw Error("Cannot close `"+j.type+"` ("+qa({start:j.start,end:j.end})+"): it\u2019s not open");else if(T[0].type!==j.type)if(N)N.call(this,j,T[0]);else(T[1]||jY).call(this,j,T[0]);k(d.type!=="fragment","unexpected fragment `exit`ed"),k(d.position,"expected `position` to be defined"),d.position.end=Ja(j.end)}function p(){return Pu(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function f(j){if(this.data.expectingFirstListItemValue){let N=this.stack[this.stack.length-2];k(N,"expected nodes on stack"),k(N.type==="list","expected list on stack"),N.start=Number.parseInt(this.sliceSerialize(j),ne.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function g(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.lang=j}function S(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.meta=j}function P(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function D(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.value=j.replace(/(\r?\n|\r)$/g,"")}function Se(j){let N=this.resume(),d=this.stack[this.stack.length-1];k(d,"expected node on stack"),k(d.type==="definition","expected definition on stack"),d.label=N,d.identifier=Ts(this.sliceSerialize(j)).toLowerCase()}function Q(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="definition","expected definition on stack"),N.title=j}function se(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="definition","expected definition on stack"),N.url=j}function me(j){let N=this.stack[this.stack.length-1];if(k(N,"expected node on stack"),k(N.type==="heading","expected heading on stack"),!N.depth){let d=this.sliceSerialize(j).length;k(d===1||d===2||d===3||d===4||d===5||d===6,"expected `depth` between `1` and `6`"),N.depth=d}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function Be(j){let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="heading","expected heading on stack"),N.depth=this.sliceSerialize(j).codePointAt(0)===b.equalsTo?1:2}function Te(){this.data.setextHeadingSlurpLineEnding=void 0}function Pe(j){let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k("children"in N,"expected parent on stack");let d=N.children,T=d[d.length-1];if(!T||T.type!=="text")T=kd(),T.position={start:Ja(j.start),end:void 0},d.push(T);this.stack.push(T)}function Je(j){let N=this.stack.pop();k(N,"expected a `node` to be on the stack"),k("value"in N,"expected a `literal` to be on the stack"),k(N.position,"expected `node` to have an open position"),N.value+=this.sliceSerialize(j),N.position.end=Ja(j.end)}function Xe(j){let N=this.stack[this.stack.length-1];if(k(N,"expected `node`"),this.data.atHardBreak){k("children"in N,"expected `parent`");let d=N.children[N.children.length-1];k(d.position,"expected tail to have a starting position"),d.position.end=Ja(j.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(N.type))Pe.call(this,j),Je.call(this,j)}function He(){this.data.atHardBreak=!0}function ge(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="html","expected html on stack"),N.value=j}function xe(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="html","expected html on stack"),N.value=j}function Me(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="inlineCode","expected inline code on stack"),N.value=j}function ee(){let j=this.stack[this.stack.length-1];if(k(j,"expected node on stack"),k(j.type==="link","expected link on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=N,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function at(){let j=this.stack[this.stack.length-1];if(k(j,"expected node on stack"),k(j.type==="image","expected image on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=N,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function ft(j){let N=this.sliceSerialize(j),d=this.stack[this.stack.length-2];k(d,"expected ancestor on stack"),k(d.type==="image"||d.type==="link","expected image or link on stack"),d.label=Xv(N),d.identifier=Ts(N).toLowerCase()}function cr(){let j=this.stack[this.stack.length-1];k(j,"expected node on stack"),k(j.type==="fragment","expected fragment on stack");let N=this.resume(),d=this.stack[this.stack.length-1];if(k(d,"expected node on stack"),k(d.type==="image"||d.type==="link","expected image or link on stack"),this.data.inReference=!0,d.type==="link"){let T=j.children;d.children=T}else d.alt=N}function w(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="image"||N.type==="link","expected image or link on stack"),N.url=j}function zt(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="image"||N.type==="link","expected image or link on stack"),N.title=j}function Fr(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ur(j){let N=this.resume(),d=this.stack[this.stack.length-1];k(d,"expected node on stack"),k(d.type==="image"||d.type==="link","expected image reference or link reference on stack"),d.label=N,d.identifier=Ts(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function qt(j){k(j.type==="characterReferenceMarkerNumeric"||j.type==="characterReferenceMarkerHexadecimal"),this.data.characterReferenceType=j.type}function En(j){let N=this.sliceSerialize(j),d=this.data.characterReferenceType,T;if(d)T=qv(N,d===y.characterReferenceMarkerNumeric?ne.numericBaseDecimal:ne.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let z=nd(N);k(z!==!1,"expected reference to decode"),T=z}let A=this.stack[this.stack.length-1];k(A,"expected `node`"),k("value"in A,"expected `node.value`"),A.value+=T}function Hr(j){let N=this.stack.pop();k(N,"expected `node`"),k(N.position,"expected `node.position`"),N.position.end=Ja(j.end)}function St(j){Je.call(this,j);let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="link","expected link on stack"),N.url=this.sliceSerialize(j)}function ht(j){Je.call(this,j);let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="link","expected link on stack"),N.url="mailto:"+this.sliceSerialize(j)}function Tt(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gt(){return{type:"emphasis",children:[]}}function nr(){return{type:"heading",depth:0,children:[]}}function hr(){return{type:"break"}}function Wr(){return{type:"html",value:""}}function ju(){return{type:"image",title:null,url:"",alt:null}}function Nu(){return{type:"link",title:null,url:"",children:[]}}function Ka(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function zu(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function wd(){return{type:"paragraph",children:[]}}function Mi(){return{type:"strong",children:[]}}function kd(){return{type:"text",value:""}}function Lu(){return{type:"thematicBreak"}}}function Ja(e){return{line:e.line,column:e.column,offset:e.offset}}function zY(e,t){let r=-1;while(++r<t.length){let i=t[r];if(Array.isArray(i))zY(e,i);else n_e(e,i)}}function n_e(e,t){let r;for(r in t)if(NY.call(t,r))switch(r){case"canContainEols":{let i=t[r];if(i)e[r].push(...i);break}case"transforms":{let i=t[r];if(i)e[r].push(...i);break}case"enter":case"exit":{let i=t[r];if(i)Object.assign(e[r],i);break}}}function jY(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+qa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qa({start:t.start,end:t.end})+") is open");else throw Error("Cannot close document, a token (`"+t.type+"`, "+qa({start:t.start,end:t.end})+") is still open")}function ew(e){let t=this;t.parser=r;function r(i){return AF(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var LY={}.hasOwnProperty;function BY(e,t){let r=t||{};function i(n,...o){let{invalid:s,handlers:c}=i;if(n&&LY.call(n,e)){let u=String(n[e]);s=LY.call(c,u)?c[u]:i.unknown}if(s)return s.call(this,n,...o)}return i.handlers=r.handlers||{},i.invalid=r.invalid,i.unknown=r.unknown,i}var i_e={}.hasOwnProperty;function _F(e,t){let r=-1,i;if(t.extensions)while(++r<t.extensions.length)_F(e,t.extensions[r]);for(i in t)if(i_e.call(t,i))switch(i){case"extensions":break;case"unsafe":{UY(e[i],t[i]);break}case"join":{UY(e[i],t[i]);break}case"handlers":{o_e(e[i],t[i]);break}default:e.options[i]=t[i]}return e}function UY(e,t){if(t)e.push(...t)}function o_e(e,t){if(t)Object.assign(e,t)}function qY(e,t,r,i){let n=r.enter("blockquote"),o=r.createTracker(i);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(e,o.current()),s_e);return n(),s}function s_e(e,t,r){return">"+(r?"":" ")+e}function tw(e,t){return JY(e,t.inConstruct,!0)&&!JY(e,t.notInConstruct,!1)}function JY(e,t,r){if(typeof t==="string")t=[t];if(!t||t.length===0)return r;let i=-1;while(++i<t.length)if(e.includes(t[i]))return!0;return!1}function OF(e,t,r,i){let n=-1;while(++n<r.unsafe.length)if(r.unsafe[n].character===`
|
|
198
|
-
`&&tw(r.stack,r.unsafe[n]))return/[ \t]/.test(i.before)?"":" ";return"\\\n"}function HY(e,t){let r=String(e),i=r.indexOf(t),n=i,o=0,s=0;if(typeof t!=="string")throw TypeError("Expected substring");while(i!==-1){if(i===n){if(++o>s)s=o}else o=1;n=i+t.length,i=r.indexOf(t,n)}return s}function Dg(e,t){return Boolean(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function WY(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ZY(e,t,r,i){let n=WY(r),o=e.value||"",s=n==="`"?"GraveAccent":"Tilde";if(Dg(e,r)){let m=r.enter("codeIndented"),f=r.indentLines(o,
|
|
188
|
+
`).filter((i)=>i.trim()))try{let i=await e.show([`:${r}`]);if(SIe(i))throw Error(`Conflict markers found in ${r}. Manual intervention required.`)}catch(i){if(i?.toString().includes("Conflict markers found"))throw i}}function SIe(e){let t="outside";for(let r of e.split(/\r?\n/)){if(/^<{7,}(?: .*)?$/.test(r)){t="local";continue}if(t==="local"&&/^={7,}$/.test(r)){t="remote";continue}if(t==="remote"&&/^>{7,}(?: .*)?$/.test(r))return!0}return!1}async function bQ(e,t,r){try{let i=["log","--format=%H%n%aI%n%s"];if(r)i.push(`-${r}`);i.push("--",t);let n=await e.raw(i);if(!n.trim())return[];let o=n.trim().split(`
|
|
189
|
+
`),s=[];for(let c=0;c+2<o.length;c+=3){let u=o[c],l=o[c+1],p=o[c+2];if(u&&l&&p!==void 0)s.push({sha:u,date:l,message:p})}return s}catch{return[]}}function xQ(e,t,r){return e.show([`${t}:${r}`])}import{writeFile as wIe}from"fs/promises";import{join as kIe}from"path";import{access as vIe}from"fs/promises";async function ws(e){try{return await vIe(e),!0}catch{return!1}}async function SQ(e,t,r){try{await e.checkout(r)}catch(i){let n=_e(i);if(!(n.includes(`pathspec '${r}' did not match`)||n.includes(`invalid reference: ${r}`)||n.includes("did not match any file(s) known to git")))throw i;await e.checkoutLocalBranch(r),await IIe(e,t)}}async function IIe(e,t){if((await e.log().catch(()=>({all:[]}))).all.length>0)return;await e.add("-A");let i=await e.status();if(i.staged.length===0&&i.created.length===0){let n=kIe(t,".gitkeep");if(!await ws(n))await wIe(n,"");await e.add(".gitkeep")}await e.commit("Initial commit")}import{mkdir as EIe,mkdtemp as CIe,readFile as PIe,rename as RIe,rm as OM,writeFile as AIe}from"fs/promises";import{basename as _Ie,join as bv}from"path";var TIe={GIT_TERMINAL_PROMPT:"0"},vQ=[["core.hooksPath","/dev/null"],["maintenance.auto","false"]],yv=vQ.map(([e,t])=>`${e}=${t}`);function wQ(e,t){let r=[["credential.helper",""],...vQ.map(([i,n])=>[i,n])];if(t&&e.startsWith("https://")){let i=Buffer.from(`x-access-token:${t}`).toString("base64");r.push([`http.${e}.extraheader`,`Authorization: Basic ${i}`])}return{...TIe,GIT_CONFIG_COUNT:String(r.length),...Object.fromEntries(r.flatMap(([i,n],o)=>[[`GIT_CONFIG_KEY_${o}`,i],[`GIT_CONFIG_VALUE_${o}`,n]]))}}function kQ(e){return cb(e,{config:yv,unsafe:{allowUnsafeHooksPath:!0}})}async function IQ(e){let{logger:t,dataDir:r,remoteUrl:i,credentialEnv:n,branch:o,timeoutMs:s,onProgress:c,signal:u}=e,l=bv(r,".git");if(await EIe(r,{recursive:!0}),!await ws(l))if(i)await OIe({logger:t,dataDir:r,remoteUrl:i,credentialEnv:n,branch:o,timeoutMs:s,...c?{onProgress:c}:{},...u?{signal:u}:{}});else await TQ(r,o);let p=kQ(r);if(await DIe({logger:t,dataDir:r,branch:o}),i)await MIe(p,i);return p}async function OIe(e){let{logger:t,dataDir:r,remoteUrl:i,credentialEnv:n,branch:o,timeoutMs:s,onProgress:c,signal:u}=e,l=async(g,S)=>{if(t.info(g,{gitUrl:i}),S)await OM(S,{recursive:!0,force:!0});await TQ(r,o)},p;try{p=(await ja({baseDir:r,timeoutMs:s,credentialEnv:n,...c?{onProgress:c}:{}},["ls-remote","--heads",i],u)).trim().length>0}catch{if(u?.aborted)throw u.reason;return l("ls-remote failed, initializing locally")}if(!p)return l("Remote is empty, initializing locally");t.info("Cloning repository",{gitUrl:i});let m=bv(r,".."),f=await CIe(bv(m,`${_Ie(r)}-clone-`));try{await ja({baseDir:m,timeoutMs:s,credentialEnv:n,...c?{onProgress:c}:{}},["clone",i,f],u),await OM(r,{recursive:!0,force:!0}),await RIe(f,r)}catch{if(u?.aborted)throw await OM(f,{recursive:!0,force:!0}),u.reason;await l("Clone failed, initializing locally",f)}}async function TQ(e,t){await kQ(e).raw(["init",`--initial-branch=${t}`])}async function DIe(e){let{logger:t,dataDir:r,branch:i}=e,n=bv(r,".git","HEAD"),o=(await PIe(n,"utf8")).trim();if(o!=="ref: refs/heads/.invalid")return;t.warn("Repairing invalid git HEAD",{dataDir:r,branch:i,head:o}),await AIe(n,`ref: refs/heads/${i}
|
|
190
|
+
`)}async function MIe(e,t){if((await e.getRemotes(!0)).find((n)=>n.name==="origin"))await e.remote(["set-url","origin",t]);else await e.addRemote("origin",t)}async function EQ(e){let{logger:t,dataDir:r,remoteUrl:i,credentialEnv:n,branch:o,timeoutMs:s,onProgress:c,signal:u,authorName:l,authorEmail:p}=e;t.debug("Initializing git repository",{gitUrl:i});let m=await IQ({logger:t,dataDir:r,remoteUrl:i,credentialEnv:n,branch:o,timeoutMs:s,...c?{onProgress:c}:{},...u?{signal:u}:{}});return await FIe(m,l,p),await m.addConfig("pull.rebase","false"),await SQ(m,r,o),m}async function FIe(e,t,r){if(t)await e.addConfig("user.name",t);if(r)await e.addConfig("user.email",r)}import{unlink as NIe}from"fs/promises";import{isAbsolute as $Ie,relative as y4e,sep as b4e,join as jIe}from"path";function ks(e,t){return $Ie(t)?t:jIe(e,t)}async function DM(e){let t=[];for(let r of e.deletedFiles){let i=ks(e.syncPath,r);if(!await ws(i))continue;await NIe(i),t.push(r),e.logger.warn("Removed locally resurrected remote deletion",{path:r})}if(t.length>0){if(await e.git.add(["-A","--",...t]),(await e.git.diff(["--cached","--name-only","--",...t])).trim())await e.git.commit("Reconcile remote deletions (remote wins)")}return t}async function CQ(e,t,r,i,n){if(n?.throwIfAborted(),t.debug("Pulling from origin",{branch:r}),!(await e.status()).isClean())t.warn("Committing local changes before pull"),await Hp(e,t,"Pre-pull commit: preserving local changes");let s=await e.revparse(["HEAD"]),c=await xv(e,r);try{await ja(i,["pull","origin",r,"--no-rebase","--allow-unrelated-histories","--strategy=recursive","-Xtheirs"],n),n?.throwIfAborted();let u=await PQ(e,s,c,r);return await DM({git:e,logger:t,syncPath:i.baseDir,deletedFiles:u.deletedFiles??[]}),n?.throwIfAborted(),u}catch(u){return zIe(e,t,r,i,s,c,u,n)}}async function zIe(e,t,r,i,n,o,s,c){if(c?.aborted)throw c.reason;if(s instanceof Jp)throw s;let u=_e(s),l=await e.status();if(u.includes("CONFLICT")||l.conflicted.length>0){await LIe(e,t,u,l.conflicted);let p=await PQ(e,n,o,r);return await DM({git:e,logger:t,syncPath:i.baseDir,deletedFiles:p.deletedFiles??[]}),p}if(u.includes("couldn't find remote ref"))return BIe(e,t,r,i,c);throw Error(`Failed to pull: ${u}`)}async function PQ(e,t,r,i){let n=await e.revparse(["HEAD"]),o=t===n?{files:[],deletedFiles:[]}:await pg(e,t,n),s=await xv(e,i),c=r&&s&&r!==s?await pg(e,r,s):void 0;return{files:[...new Set([...o.files,...c?.files??[]])],deletedFiles:c?.deletedFiles??o.deletedFiles}}async function pg(e,t,r){let i=await e.diff([t,r,"--name-status","--no-renames"]),n=[],o=[];for(let s of i.split(`
|
|
191
|
+
`)){if(!s.trim())continue;let[c,u]=s.split("\t");if(!c||!u)continue;if(n.push(u),c.startsWith("D"))o.push(u)}return{files:n,deletedFiles:o}}async function xv(e,t){try{return await e.revparse([`refs/remotes/origin/${t}`])}catch{return}}async function LIe(e,t,r,i){t.warn("Resolving merge conflict",{error:r});for(let n of i)try{await e.raw(["checkout","--theirs",n])}catch{await e.raw(["rm","--force",n])}await e.add(["-A"]),await e.commit("Auto-resolve merge conflict (remote wins)")}async function BIe(e,t,r,i,n){t.info("Remote branch doesn't exist yet, bootstrapping via push");try{await Hp(e,t,"Bootstrap remote branch")}catch(o){if(!_e(o).includes("nothing to commit"))throw o}return n?.throwIfAborted(),await lg(t,r,i,n),{files:[],deletedFiles:[]}}async function RQ(e,t){try{return await e.raw(["cat-file","-e",`${t}^{commit}`]),!0}catch{return!1}}async function AQ(e,t,r){try{return(await e.raw(["merge-base",t,r])).trim()===t}catch{return!1}}async function dg(e,t){let r=await xv(e,t.branch);return{remoteFingerprint:t.remoteFingerprint,branch:t.branch,lastReconciledGitHead:await e.revparse(["HEAD"]),...r?{lastObservedRemoteHead:r}:{}}}async function UIe(e,t,r){let i=t.lastObservedRemoteHead,n=r.lastObservedRemoteHead;if(!i&&!n)return{deletedFiles:[]};if(!i||!n)return;if(!await RQ(e,i))return;if(!await AQ(e,i,n))return;if(i===n)return{deletedFiles:[]};return{deletedFiles:(await pg(e,i,n)).deletedFiles}}async function _Q(e,t,r){let i=await dg(e,t);if(!r)return{mode:"full",checkpoint:i,reason:"missing-checkpoint"};if(r.remoteFingerprint!==t.remoteFingerprint)return{mode:"full",checkpoint:i,reason:"repository-identity-mismatch"};if(r.branch!==t.branch)return{mode:"full",checkpoint:i,reason:"branch-mismatch"};if(!await RQ(e,r.lastReconciledGitHead))return{mode:"full",checkpoint:i,reason:"missing-local-checkpoint"};if(!await AQ(e,r.lastReconciledGitHead,i.lastReconciledGitHead))return{mode:"full",checkpoint:i,reason:"non-ancestor-local-checkpoint"};let n=r.lastReconciledGitHead===i.lastReconciledGitHead?{files:[],deletedFiles:[]}:await pg(e,r.lastReconciledGitHead,i.lastReconciledGitHead),o=await UIe(e,r,i);if(!o)return{mode:"full",checkpoint:i,reason:"remote-checkpoint-mismatch"};return{mode:"incremental",checkpoint:i,files:n.files,deletedFiles:o.deletedFiles}}async function MM(e,t,r,i){try{let n=await e.status(),o;try{o=(await e.log({maxCount:1})).latest?.hash}catch{}return{isRepo:!0,hasChanges:!n.isClean(),ahead:n.ahead,behind:n.behind,branch:n.current??r,lastCommit:o,remote:i||void 0,files:n.files.map((s)=>({path:s.path,status:s.working_dir+s.index}))}}catch(n){return t.error("Failed to get git status",{error:n}),{isRepo:!1,hasChanges:!1,ahead:0,behind:0,branch:r,files:[]}}}async function OQ(e){let t=await e.status();return t.modified.length>0||t.not_added.length>0||t.deleted.length>0||t.created.length>0||t.conflicted.length>0}class FM{#t=new ub;#e;#i=null;constructor(e){this.#e=e}get identity(){return{branch:this.#e.branch,remoteFingerprint:this.#e.remoteFingerprint}}execute(e,t={}){return this.#t.run(async()=>{t.onStart?.();let r=await this.#s(e,t);return await this.#e.afterOperation?.(e),yR(e.name,r)},t.signal)}get#r(){return this.#i??=cb(this.#e.dataDir,{config:yv,unsafe:{allowUnsafeHooksPath:!0}}),this.#i}get#n(){return wQ(this.#e.remoteUrl,this.#e.authToken)}#o(e){return{baseDir:this.#e.dataDir,timeoutMs:this.#e.timeoutMs,credentialEnv:this.#n,...e.onProgress?{onProgress:e.onProgress}:{}}}async#s(e,t){let{logger:r,branch:i,remoteUrl:n}=this.#e;switch(e.name){case"initialize":this.#i=await EQ({logger:r,dataDir:this.#e.dataDir,remoteUrl:n,credentialEnv:this.#n,branch:i,timeoutMs:this.#e.timeoutMs,...t.onProgress?{onProgress:t.onProgress}:{},...t.signal?{signal:t.signal}:{},...this.#e.authorName?{authorName:this.#e.authorName}:{},...this.#e.authorEmail?{authorEmail:this.#e.authorEmail}:{}});return;case"get-status":return MM(this.#r,r,i,n);case"has-local-changes":return OQ(this.#r);case"commit":return Hp(this.#r,r,e.message);case"push":return lg(r,i,this.#o(t),t.signal);case"commit-and-push":{let o=await MM(this.#r,r,i,n);if(!o.isRepo)throw Error("Git repository is unavailable");if(!o.hasChanges&&o.ahead===0)return{pushed:!1,checkpoint:await dg(this.#r,this.identity)};if(o.hasChanges)await Hp(this.#r,r);return await lg(r,i,this.#o(t),t.signal),{pushed:!0,checkpoint:await dg(this.#r,this.identity)}}case"pull":return CQ(this.#r,r,i,this.#o(t),t.signal);case"get-reconciliation-delta":return _Q(this.#r,this.identity,e.checkpoint);case"get-checkpoint":return dg(this.#r,this.identity);case"log-file":return bQ(this.#r,e.filePath,e.limit);case"show-file":return xQ(this.#r,e.sha,e.filePath)}}}import{appendFile as qIe,mkdir as JIe,readFile as HIe,rename as WIe,writeFile as DQ}from"fs/promises";import{join as MQ}from"path";var ZIe="broker-journal.jsonl",VIe="broker-journal.prev.jsonl",GIe=1048576,KIe=a.object({requestId:a.string().min(1),checkoutPath:a.string().min(1),operation:a.enum(fL),mutating:a.boolean(),startedAt:a.number().int().nonnegative()}),QIe=a.object({requestId:a.string().min(1),settledAt:a.number().int().nonnegative(),outcome:a.enum(["ok","error"])});class Sv{ambiguous;inheritedGeneration;evidenceComplete;#t;#e;#i;#r=new Map;#n=0;constructor(e,t,r,i){this.#t=e,this.ambiguous=t.ambiguous,this.inheritedGeneration=r,this.evidenceComplete=t.complete,this.#e=i.now??Date.now,this.#i=i.maxBytes??GIe}static async open(e,t={}){await JIe(e,{recursive:!0,mode:448});let r=MQ(e,ZIe),i=!0,n=await HIe(r,"utf-8").catch((s)=>{if(eTe(s))return i=!1,"";throw s}),o=YIe(n);if(n.length>0)await WIe(r,MQ(e,VIe)).catch(()=>{return});return await DQ(r,"",{mode:384}),new Sv(r,o,i,t)}async recordStart(e){let t={...e,mutating:xl({name:e.operation}),startedAt:this.#e()};this.#r.set(e.requestId,t),await this.#o(JSON.stringify(t))}async recordSettled(e,t){await this.#o(JSON.stringify({requestId:e,settledAt:this.#e(),outcome:t})),this.#r.delete(e)}async#o(e){let t=`${e}
|
|
192
|
+
`;if(this.#n+=Buffer.byteLength(t),await qIe(this.#t,t),this.#n>this.#i)await this.#s()}async#s(){let e=[...this.#r.values()].map((t)=>`${JSON.stringify(t)}
|
|
193
|
+
`).join("");await DQ(this.#t,e,{mode:384}),this.#n=Buffer.byteLength(e)}}function YIe(e){let t=new Map,r=!0;for(let i of e.split(`
|
|
194
|
+
`)){if(i.length===0)continue;let n=XIe(i);if(n===void 0){r=!1;continue}let o=KIe.safeParse(n);if(o.success){t.set(o.data.requestId,o.data);continue}let s=QIe.safeParse(n);if(s.success){t.delete(s.data.requestId);continue}r=!1}return{ambiguous:[...t.values()],complete:r}}function XIe(e){try{return JSON.parse(e)}catch{return}}function eTe(e){return typeof e==="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function $M(e){return rTe(e,"git-broker.sock")}var nTe=256;function jQ(e){return JSON.stringify(e.operation)}class vv extends Error{constructor(e){super(e);this.name="BrokerStartupError"}}async function iTe(e){try{return(await Bun.connect({unix:e,socket:{data:()=>{}}})).end(),!0}catch{return!1}}class mg{socketPath;brokerId;#t=new Map;#e=new vR;#i;#r;#n=new Map;#o;#s;#c;#u;#p=null;constructor(e,t,r,i,n,o){this.socketPath=e,this.brokerId=t,this.#i=r,this.#r=i,this.#u=n,this.#o=o,this.#c=n?.inheritedGeneration??!1,this.#s=!this.#c}openAdmission(){this.#c=!1,this.#s=!0}closeAdmission(){this.#c=!0,this.#s=!1}get ambiguousRequests(){return this.#u?.ambiguous??[]}get activity(){return this.#e.snapshot()}static async start(e){await tTe(e.runtimeDir,{recursive:!0,mode:448}),await FQ(e.runtimeDir,448);let t=$M(e.runtimeDir);if(await iTe(t))throw new vv(`A live Git broker already owns ${t}`);await $Q(t).catch(()=>{return});let r=new mg(t,e.brokerId??jr(10),e.resolveCheckout,e.now??Date.now,e.journal??await Sv.open(e.runtimeDir,{...e.now?{now:e.now}:{}}),e.answeredWindow??nTe);return await r.#f(),r}async stop(){this.#p?.stop(!0),this.#p=null,await $Q(this.socketPath).catch(()=>{return})}get registeredCheckouts(){return[...this.#t.keys()].sort()}async#f(){let e=new WeakMap,t=new WeakMap,r=(i)=>{let n=t.get(i);if(n)return n;let o=new jy(i);return t.set(i,o),o};this.#p=Bun.listen({unix:this.socketPath,socket:{open:(i)=>{e.set(i,new dm),r(i)},drain:(i)=>{r(i).flush()},data:(i,n)=>{let o=e.get(i)??new dm;e.set(i,o);let s=r(i);(()=>{try{return o.push(n)}catch(u){return this.#a(s,"req_undecodable0",u),[]}})().forEach((u)=>{this.#h(s,u)})}}}),await FQ(this.socketPath,384)}#l(e,t){e.send(xR(t))}#a(e,t,r){this.#l(e,{type:"result",version:Js,requestId:t,outcome:"error",value:null,error:_e(r)})}#d(e,t){this.#l(e,{type:"status",version:Js,requestId:t,brokerId:this.brokerId,checkouts:this.registeredCheckouts,...this.activity,ambiguousRequestIds:this.ambiguousRequests.map((r)=>r.requestId),evidenceComplete:this.#u?.evidenceComplete??!0,recoveryPending:this.#c,admitsMutations:this.#s})}async#g(e){let t=await fm(e.checkoutPath),r=this.#t.get(t),i=this.#i(t);if(!i)throw Error(`This broker owns no checkout at ${t}`);if(i.branch!==e.branch||i.remoteFingerprint!==e.remoteFingerprint)throw Error(`Checkout ${t} is registered with a different branch or remote identity`);if(r)return;this.#t.set(t,new FM(i))}async#h(e,t){if(t.type==="register-checkout"){try{await this.#g(t)}catch(r){this.#a(e,t.requestId,r);return}this.#d(e,t.requestId);return}if(t.type==="query"){this.#d(e,t.requestId);return}if(t.type==="open-admission"){this.openAdmission(),this.#d(e,t.requestId);return}if(t.type==="execute-operation")await this.#y(e,t)}async#y(e,t){let r=this.#n.get(t.requestId);if(r){if(r.checkoutPath!==t.checkoutPath||r.operationIdentity!==jQ(t)){this.#a(e,t.requestId,Error(`Request ${t.requestId} is already used for ${r.operation} on ${r.checkoutPath}`));return}this.#m(e,t.requestId,await r.settled);return}if(!this.#s&&xl(t.operation)){this.#a(e,t.requestId,Error("Git admission is closed while the previous owner's work is reconciled"));return}let i=this.#t.get(await fm(t.checkoutPath));if(!i){this.#a(e,t.requestId,Error(`Checkout ${t.checkoutPath} is not registered`));return}let n=this.#b(e,t,i);this.#n.set(t.requestId,{checkoutPath:t.checkoutPath,operation:t.operation.name,operationIdentity:jQ(t),mutating:xl(t.operation),settled:n}),this.#x(),this.#m(e,t.requestId,await n)}async#b(e,t,r){this.#e.accept(t.requestId,t.checkoutPath,this.#r());try{try{await this.#u?.recordStart({requestId:t.requestId,checkoutPath:t.checkoutPath,operation:t.operation.name})}catch(n){return this.closeAdmission(),{ok:!1,error:Error(`Git broker journal start failed; mutation admission is closed: ${_e(n)}`)}}let i;try{let n=await r.execute(t.operation,{onStart:()=>{this.#e.start(t.requestId,this.#r())},onProgress:()=>{this.#e.progress(t.requestId,this.#r()),this.#l(e,{type:"progress",version:Js,requestId:t.requestId,phase:"running",observedAt:new Date().toISOString()})}}),o=Buffer.byteLength(JSON.stringify(n??null));if(o>bR)throw Error(`Operation ${t.operation.name} produced ${o} bytes; the limit is ${bR}`);i={ok:!0,value:n??null}}catch(n){i={ok:!1,error:n}}try{await this.#u?.recordSettled(t.requestId,i.ok?"ok":"error")}catch(n){return this.closeAdmission(),{ok:!1,error:Error(`Git broker journal settled write failed; mutation admission is closed: ${_e(n)}`)}}return i}finally{this.#e.finish(t.requestId)}}#m(e,t,r){if(!r.ok){this.#a(e,t,r.error);return}this.#l(e,{type:"result",version:Js,requestId:t,outcome:"ok",value:r.value,error:null})}#x(){let e=[...this.#n.entries()].filter(([,t])=>!t.mutating);for(let[t]of e.slice(0,Math.max(0,e.length-this.#o)))this.#n.delete(t)}}function jM(e){return sTe(e.cwd,e.syncPath??e.dataDir)}async function wv(e){let t=vl.parse(e.pluginConfig??{}),r=t.git,i={logger:e.logger,dataDir:e.dataDir,...r?.repo===void 0?{}:{repo:r.repo},...r?.gitUrl===void 0?{}:{gitUrl:r.gitUrl},...r?.authToken===void 0?{}:{authToken:r.authToken}},n=r?gR(i):"",o=r?lL(i):void 0;if(!r||n.length===0)throw new vv("This Brain configures no Git remote, so there is no checkout to own");let s=await fm(jM({cwd:e.cwd,dataDir:e.dataDir,syncPath:t.syncPath})),c={logger:e.logger.child("GitBroker"),dataDir:s,branch:r.branch,remoteUrl:n,...o===void 0?{}:{authToken:o},remoteFingerprint:$y(n),timeoutMs:fR,authorName:r.authorName,authorEmail:r.authorEmail,...e.testWithholdCompletionAfter===void 0?{}:{afterOperation:async(u)=>{if(u.name!==e.testWithholdCompletionAfter)return;await new Promise(()=>{})}}};return mg.start({runtimeDir:oTe(e.socketPath),resolveCheckout:(u)=>u===s?c:void 0})}import{openSync as aTe,writeSync as cTe}from"fs";var vu={SILLY:0,VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class _r{static instance=null;level;context;useStderr;format;logFile;fileHandle;constructor(e={},t){if(this.level=e.level??vu.INFO,this.context=e.context??void 0,this.useStderr=e.useStderr??!1,this.format=e.format??"text",this.logFile=e.logFile,t!==void 0)this.fileHandle=t;else if(this.logFile)try{this.fileHandle=aTe(this.logFile,"a")}catch{}}static getInstance(e){if(!_r.instance)_r.instance=new _r(e);else if(e?.useStderr!==void 0)_r.instance.useStderr=e.useStderr;return _r.instance}static resetInstance(){_r.instance=null}static createFresh(e){return new _r(e)}formatEntry(e,t,r){let i=new Date().toISOString();if(this.format==="json"){let n={ts:i,level:e,msg:t};if(this.context)n.ctx=this.context;if(r.length>0)n.data=r;return JSON.stringify(n)}return this.context?`[${i}] [${this.context}] ${t}`:`[${i}] ${t}`}write(e,t,r,i){if(this.format==="json")e(this.formatEntry(t,r,i));else if(i.length>0)e(this.formatEntry(t,r,[]),...i);else e(this.formatEntry(t,r,[]));if(this.fileHandle!==void 0){let n=this.formatJsonEntry(t,r,i);try{cTe(this.fileHandle,n+`
|
|
195
|
+
`)}catch{}}}formatJsonEntry(e,t,r){let i={ts:new Date().toISOString(),level:e,msg:t};if(this.context)i.ctx=this.context;if(r.length>0)i.data=r;return JSON.stringify(i)}silly(e,...t){if(this.level<=vu.SILLY)this.write(console.debug.bind(console),"silly",e,t)}verbose(e,...t){if(this.level<=vu.VERBOSE)this.write(console.debug.bind(console),"verbose",e,t)}debug(e,...t){if(this.level<=vu.DEBUG)this.write(console.debug.bind(console),"debug",e,t)}info(e,...t){if(this.level<=vu.INFO){let r=this.useStderr?console.error.bind(console):console.info.bind(console);this.write(r,"info",e,t)}}warn(e,...t){if(this.level<=vu.WARN)this.write(console.warn.bind(console),"warn",e,t)}error(e,...t){if(this.level<=vu.ERROR)this.write(console.error.bind(console),"error",e,t)}child(e){return new _r({level:this.level,context:e,useStderr:this.useStderr,format:this.format},this.fileHandle)}setUseStderr(e){this.useStderr=e}}var hKe=_r.getInstance();var uTe=/\$\{[^}]+\}/g;function NQ(e,t=process.env){let r=e.match(uTe);if(!r)return e;let i=e;for(let n of r){let o=n.slice(2,-1),s=t[o];if(s===void 0)return;i=i.replace(n,s)}return i}function kv(e,t=process.env){if(typeof e==="string")return NQ(e,t);if(Array.isArray(e))return e.map((r)=>kv(r,t)).filter((r)=>r!==void 0);if(typeof e==="object"&&e!==null){let r={};for(let[i,n]of Object.entries(e)){let o=NQ(i,t);if(o===void 0)continue;let s=kv(n,t);if(s===void 0)continue;r[o]=s}return r}return e}var zQ=a.object({type:a.literal("event"),event:a.string().min(1),fromState:a.string().min(1).optional()}),lTe=a.object({conversationId:a.string().min(1),interfaceType:a.string().min(1),channelId:a.string().min(1).optional(),channelName:a.string().min(1),userPermissionLevel:a.enum(["admin","trusted","public"]),isAnchor:a.boolean(),action:zQ});var Iv=a.object({id:a.string(),toolCallId:a.string().optional(),toolName:a.string(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),args:a.unknown()}),Tv=a.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),LQ=a.object({kind:a.literal("tool-approval"),id:a.string(),toolCallId:a.string().optional(),toolName:a.string(),input:a.record(a.string(),a.unknown()).optional(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),state:Tv,output:a.unknown().optional(),error:a.string().optional()}),fg=LQ,Ev=a.object({entityType:a.string().optional(),entityId:a.string().optional(),attachmentType:a.string().optional()}),Cv=a.object({mediaType:a.string().min(1),url:a.string().min(1),downloadUrl:a.string().min(1).optional(),previewUrl:a.string().min(1).optional(),filename:a.string().min(1).optional(),sizeBytes:a.number().nonnegative().optional(),source:Ev.optional()}),BQ=a.object({kind:a.literal("attachment"),id:a.string(),jobId:a.string().optional(),title:a.string(),description:a.string().optional(),attachment:Cv}),gg=BQ,Pv=a.object({id:a.string().min(1),title:a.string().min(1).optional(),source:a.string().min(1),url:a.string().min(1).optional(),entityType:a.string().min(1).optional(),entityId:a.string().min(1).optional(),excerpt:a.string().min(1).optional(),provenance:a.record(a.string(),a.unknown()).optional()}),pTe=a.object({kind:a.literal("sources"),id:a.string().min(1),title:a.string().min(1).optional(),sources:a.array(Pv).min(1)});var dTe=a.object({type:a.literal("prompt"),id:a.string().min(1),label:a.string().min(1),prompt:a.string().min(1),description:a.string().min(1).optional()});var mTe=a.object({type:a.literal("event"),id:a.string().min(1),label:a.string().min(1),event:a.string().min(1),fromState:a.string().min(1).optional(),description:a.string().min(1).optional()});var Rv=a.discriminatedUnion("type",[dTe,mTe]),fTe=a.object({kind:a.literal("actions"),id:a.string().min(1),title:a.string().min(1).optional(),defaultOpen:a.boolean().optional(),actions:a.array(Rv).min(1)});var hg=a.discriminatedUnion("kind",[LQ,BQ,pTe,fTe]),Av=a.object({toolName:a.string(),args:a.record(a.string(),a.unknown()).optional(),jobId:a.string().optional(),data:a.unknown().optional(),error:a.object({message:a.string(),code:a.string().optional()}).optional()}),NM=a.object({text:a.string(),toolResults:a.array(Av).optional(),cards:a.array(hg).optional(),pendingConfirmations:a.array(Iv).optional(),usage:a.object({promptTokens:a.number(),completionTokens:a.number(),totalTokens:a.number()})});var UQ=a.enum(["admin","trusted","public"]),gTe=a.object({conversationId:a.string().min(1),message:a.string(),interfaceType:a.string().min(1),channelId:a.string().optional(),channelName:a.string().optional(),userPermissionLevel:UQ}),qQ=a.object({id:a.string().min(1),source:a.string().min(1),title:a.string().optional(),content:a.string().min(1),provenance:a.record(a.string(),a.unknown()).optional()}),hTe=a.object({items:a.array(qQ).default([])});import{createHash as yTe}from"crypto";var si=a.discriminatedUnion("kind",[a.object({kind:a.literal("user"),userId:a.string().min(1),canonicalId:a.string().min(1).optional()}),a.object({kind:a.literal("external"),externalActorId:a.string().min(1)}),a.object({kind:a.literal("agent"),agentId:a.string().min(1)}),a.object({kind:a.literal("service"),serviceId:a.string().min(1)})]);function zM(e){let t=e.userId??(e.canonicalId?.startsWith("user:")?`usr_${e.canonicalId.slice(5)}`:void 0);if(t)return{kind:"user",userId:t,...e.canonicalId?{canonicalId:e.canonicalId}:{}};if(e.role==="assistant")return{kind:"agent",agentId:e.actorId};return{kind:"external",externalActorId:e.canonicalId?yg("canonical",e.canonicalId):yg(e.interfaceType,e.actorId)}}function yg(e,t){let r=t.startsWith(`${e}:`)?t:`${e}:${t}`;return`ext_${yTe("sha256").update(r).digest("hex")}`}var bTe=a.object({actor:si}),JQ=a.object({userId:a.string().min(1),personId:a.string().min(1),canonicalId:a.string().min(1).optional(),displayName:a.string().min(1),permissionLevel:a.enum(["admin","trusted","public"])}),xTe=a.object({principal:JQ.nullable()});var LM=a.strictObject({name:a.string().min(1).optional(),address:a.email()}),STe=a.strictObject({personId:a.string().min(1).max(200),displayName:a.string().trim().min(1).max(200),permissionLevel:a.enum(["admin","trusted","public"])}),vTe=a.strictObject({messageId:a.string().min(1),sourceRef:a.string().min(1),threadId:a.string().min(1).optional(),from:LM,replyTo:LM.optional(),to:a.array(LM),subject:a.string(),receivedAt:a.iso.datetime(),text:a.string(),html:a.string().min(1).optional(),headers:a.strictObject({listUnsubscribe:a.string().min(1).optional(),autoSubmitted:a.string().min(1).optional(),precedence:a.string().min(1).optional(),inReplyTo:a.string().min(1).optional(),references:a.array(a.string().min(1)).optional()}),sender:STe.optional()});var wTe=a.strictObject({permissionLevel:a.enum(["admin","trusted","public"])}),kTe=a.custom((e)=>typeof AbortSignal<"u"&&e instanceof AbortSignal),ITe=a.strictObject({sourceRef:a.string().regex(/^imap:[a-f0-9]{64}$/),actor:wTe,signal:kTe.optional()}),BM=a.strictObject({name:a.string().trim().min(1).max(300).optional(),address:a.email().max(320)}),TTe=a.strictObject({messageId:a.string().trim().min(1).max(2000),from:BM,replyTo:BM.optional(),to:a.array(BM).max(100),subject:a.string().max(1000),receivedAt:a.iso.datetime(),text:a.string().max(1e5),inReplyTo:a.string().trim().min(1).max(2000).optional(),references:a.array(a.string().trim().min(1).max(2000)).max(100),truncated:a.boolean()}),ETe=a.discriminatedUnion("kind",[a.strictObject({kind:a.literal("available"),message:TTe}),a.strictObject({kind:a.literal("unavailable")})]);function UM(e,t){let r=e.trim().toLowerCase(),i=t.trim();if(!r||!i)throw Error("Interface principal requires an interface and subject");return`${r}:${i}`}function qM(e){let t=e.indexOf(":");if(t<=0||t===e.length-1)throw Error(`Invalid interface principal: ${e}`);let r=e.slice(0,t).trim().toLowerCase(),i=e.slice(t+1).trim();return UM(r,i),{interfaceType:r,subject:i}}function bg(e,t){return lm(UM(e,t))}var CTe=a.object({url:a.string(),authToken:a.string().optional()});var PTe=a.object({success:a.boolean(),entityId:a.string().optional(),error:a.string().optional()});var Wp=a.enum(["user","assistant"]);var HQ=a.object({entityType:a.string().min(1),entityId:a.string().min(1),contentHash:a.string().min(1).optional()}),Zp=a.object({rootJobId:a.string().min(1),causationId:a.string().min(1),projectionId:a.string().min(1).optional(),projectionLineage:a.array(a.string().min(1)),sourceEntity:HQ.optional(),derivationDepth:a.number().int().nonnegative()}).superRefine((e,t)=>{if(e.derivationDepth!==e.projectionLineage.length)t.addIssue({code:"custom",path:["derivationDepth"],message:"Derivation depth must equal projection lineage length"});let r=e.projectionLineage.at(-1);if(e.projectionId!==r)t.addIssue({code:"custom",path:["projectionId"],message:"Current projection must equal the final projection lineage entry"})});var RTe=a.strictObject({waveId:a.string().trim().min(1),sourceTypes:a.array(a.string().trim().min(1)),changedTargetTypes:a.array(a.string().trim().min(1))});var N_e=Rs(pF(),1);class uY extends Error{name="Assertion";code="ERR_ASSERTION";constructor(e,t,r,i,n){super(e);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);this.actual=t,this.expected=r,this.generated=n,this.operator=i}}function k(e,t){_Re(Boolean(e),!1,!0,"ok","Expected value to be truthy",t)}function _Re(e,t,r,i,n,o){if(!e)throw o instanceof Error?o:new uY(o||n,t,r,i,!o)}var ORe={};function Pu(e,t){let r=t||ORe,i=typeof r.includeImageAlt==="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml==="boolean"?r.includeHtml:!0;return pY(e,i,n)}function pY(e,t,r){if(DRe(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lY(e.children,t,r)}if(Array.isArray(e))return lY(e,t,r);return""}function lY(e,t,r){let i=[],n=-1;while(++n<e.length)i[n]=pY(e[n],t,r);return i.join("")}function DRe(e){return Boolean(e&&typeof e==="object")}var dF={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\uD835\uDD04",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\uD835\uDD38",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\uD835\uDC9C",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\uD835\uDC9E",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\uD835\uDD3B",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\uD835\uDC9F",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\uD835\uDD08",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\uD835\uDD3C",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\uD835\uDD09",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\uD835\uDD3D",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\uD835\uDD0A",Gg:"\u22D9",Gopf:"\uD835\uDD3E",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\uD835\uDCA2",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\uD835\uDD40",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\uD835\uDD0F",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\uD835\uDD43",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\uD835\uDD10",MinusPlus:"\u2213",Mopf:"\uD835\uDD44",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
196
|
+
`,Nfr:"\uD835\uDD11",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\uD835\uDCA9",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\uD835\uDD12",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\uD835\uDCAA",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\uD835\uDD13",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\uD835\uDCAB",Psi:"\u03A8",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"\u211A",Qscr:"\uD835\uDCAC",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\uD835\uDD16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\uD835\uDD4A",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\uD835\uDCAE",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:"\t",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\uD835\uDD17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\uD835\uDD4B",TripleDot:"\u20DB",Tscr:"\uD835\uDCAF",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\uD835\uDD18",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\uD835\uDD4C",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\uD835\uDCB0",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"\u039E",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\uD835\uDCB5",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\uD835\uDD1E",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\uD835\uDD52",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\uD835\uDCB6",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\uD835\uDD20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\uD835\uDD54",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\uD835\uDD21",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\uD835\uDD55",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\uD835\uDCB9",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\uD835\uDD22",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\uD835\uDD23",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\uD835\uDD57",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\uD835\uDCBB",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\uD835\uDD24",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\uD835\uDD58",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\uD835\uDD25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\uD835\uDD59",horbar:"\u2015",hscr:"\uD835\uDCBD",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\uD835\uDD26",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\uD835\uDD5A",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\uD835\uDCBE",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\uD835\uDD27",jmath:"\u0237",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\uD835\uDD28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\uD835\uDCC1",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\uD835\uDD5E",mp:"\u2213",mscr:"\uD835\uDCC2",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\uD835\uDD2B",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\uD835\uDD5F",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\uD835\uDCC3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\uD835\uDD2C",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\uD835\uDD60",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\uD835\uDD2D",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\uD835\uDD61",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\uD835\uDCC5",psi:"\u03C8",puncsp:"\u2008",qfr:"\uD835\uDD2E",qint:"\u2A0C",qopf:"\uD835\uDD62",qprime:"\u2057",qscr:"\uD835\uDCC6",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\uD835\uDD2F",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\uD835\uDD63",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\uD835\uDCC7",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\uD835\uDD30",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\uD835\uDD64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\uD835\uDCC8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\uD835\uDD31",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\uD835\uDD65",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\uD835\uDCC9",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\uD835\uDD32",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\uD835\uDD66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\uD835\uDCCA",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\uD835\uDD67",vprop:"\u221D",vrtri:"\u22B3",vscr:"\uD835\uDCCB",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\uD835\uDCCC",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\uD835\uDD35",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\uD835\uDD69",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\uD835\uDCCD",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\uD835\uDD36",yicy:"\u0457",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\uD835\uDD37",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"\u200D",zwnj:"\u200C"};var MRe={}.hasOwnProperty;function nd(e){return MRe.call(dF,e)?dF[e]:!1}var b={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var ne={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var y={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var ai={ht:"\t",lf:`
|
|
197
|
+
`,cr:"\r",space:" ",exclamationMark:"!",quotationMark:'"',numberSign:"#",dollarSign:"$",percentSign:"%",ampersand:"&",apostrophe:"'",leftParenthesis:"(",rightParenthesis:")",asterisk:"*",plusSign:"+",comma:",",dash:"-",dot:".",slash:"/",digit0:"0",digit1:"1",digit2:"2",digit3:"3",digit4:"4",digit5:"5",digit6:"6",digit7:"7",digit8:"8",digit9:"9",colon:":",semicolon:";",lessThan:"<",equalsTo:"=",greaterThan:">",questionMark:"?",atSign:"@",uppercaseA:"A",uppercaseB:"B",uppercaseC:"C",uppercaseD:"D",uppercaseE:"E",uppercaseF:"F",uppercaseG:"G",uppercaseH:"H",uppercaseI:"I",uppercaseJ:"J",uppercaseK:"K",uppercaseL:"L",uppercaseM:"M",uppercaseN:"N",uppercaseO:"O",uppercaseP:"P",uppercaseQ:"Q",uppercaseR:"R",uppercaseS:"S",uppercaseT:"T",uppercaseU:"U",uppercaseV:"V",uppercaseW:"W",uppercaseX:"X",uppercaseY:"Y",uppercaseZ:"Z",leftSquareBracket:"[",backslash:"\\",rightSquareBracket:"]",caret:"^",underscore:"_",graveAccent:"`",lowercaseA:"a",lowercaseB:"b",lowercaseC:"c",lowercaseD:"d",lowercaseE:"e",lowercaseF:"f",lowercaseG:"g",lowercaseH:"h",lowercaseI:"i",lowercaseJ:"j",lowercaseK:"k",lowercaseL:"l",lowercaseM:"m",lowercaseN:"n",lowercaseO:"o",lowercaseP:"p",lowercaseQ:"q",lowercaseR:"r",lowercaseS:"s",lowercaseT:"t",lowercaseU:"u",lowercaseV:"v",lowercaseW:"w",lowercaseX:"x",lowercaseY:"y",lowercaseZ:"z",leftCurlyBrace:"{",verticalBar:"|",rightCurlyBrace:"}",tilde:"~",replacementCharacter:"\uFFFD"};function qr(e,t,r,i){let n=e.length,o=0,s;if(t<0)t=-t>n?0:n+t;else t=t>n?n:t;if(r=r>0?r:0,i.length<ne.v8MaxSafeChunkSize)s=Array.from(i),s.unshift(t,r),e.splice(...s);else{if(r)e.splice(t,r);while(o<i.length)s=i.slice(o,o+ne.v8MaxSafeChunkSize),s.unshift(t,0),e.splice(...s),o+=ne.v8MaxSafeChunkSize,t+=ne.v8MaxSafeChunkSize}}function kn(e,t){if(e.length>0)return qr(e,e.length,0,t),e;return t}var dY={}.hasOwnProperty;function mY(e){let t={},r=-1;while(++r<e.length)FRe(t,e[r]);return t}function FRe(e,t){let r;for(r in t){let n=(dY.call(e,r)?e[r]:void 0)||(e[r]={}),o=t[r],s;if(o)for(s in o){if(!dY.call(n,s))n[s]=[];let c=o[s];$Re(n[s],Array.isArray(c)?c:c?[c]:[])}}}function $Re(e,t){let r=-1,i=[];while(++r<t.length)(t[r].add==="after"?e:i).push(t[r]);qr(e,0,0,i)}function qv(e,t){let r=Number.parseInt(e,t);if(r<b.ht||r===b.vt||r>b.cr&&r<b.space||r>b.tilde&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111)return ai.replacementCharacter;return String.fromCodePoint(r)}function Ts(e){return e.replace(/[\t\n\r ]+/g,ai.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ci=Ba(/[A-Za-z]/),In=Ba(/[\dA-Za-z]/),fY=Ba(/[#-'*+\--9=?A-Z^-~]/);function Cg(e){return e!==null&&(e<b.space||e===b.del)}var Pg=Ba(/\d/),gY=Ba(/[\dA-Fa-f]/),hY=Ba(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<b.horizontalTab}function ar(e){return e!==null&&(e<b.nul||e===b.space)}function Ke(e){return e===b.horizontalTab||e===b.virtualSpace||e===b.space}var yY=Ba(/\p{P}|\p{S}/u),bY=Ba(/\s/);function Ba(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function rt(e,t,r,i){let n=i?i-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){if(Ke(u))return e.enter(r),c(u);return t(u)}function c(u){if(Ke(u)&&o++<n)return e.consume(u),c;return e.exit(r),t(u)}}var xY={tokenize:jRe};function jRe(e){let t=e.attempt(this.parser.constructs.contentInitial,i,n),r;return t;function i(c){if(k(c===b.eof||de(c),"expected eol or eof"),c===b.eof){e.consume(c);return}return e.enter(y.lineEnding),e.consume(c),e.exit(y.lineEnding),rt(e,t,y.linePrefix)}function n(c){return k(c!==b.eof&&!de(c),"expected anything other than a line ending or EOF"),e.enter(y.paragraph),o(c)}function o(c){let u=e.enter(y.chunkText,{contentType:ne.contentTypeText,previous:r});if(r)r.next=u;return r=u,s(c)}function s(c){if(c===b.eof){e.exit(y.chunkText),e.exit(y.paragraph),e.consume(c);return}if(de(c))return e.consume(c),e.exit(y.chunkText),o;return e.consume(c),s}}var vY={tokenize:NRe},SY={tokenize:zRe};function NRe(e){let t=this,r=[],i=0,n,o,s;return c;function c(Q){if(i<r.length){let se=r[i];return t.containerState=se[1],k(se[0].continuation,"expected `continuation` to be defined on container construct"),e.attempt(se[0].continuation,u,l)(Q)}return l(Q)}function u(Q){if(k(t.containerState,"expected `containerState` to be defined after continuation"),i++,t.containerState._closeFlow){if(t.containerState._closeFlow=void 0,n)Se();let se=t.events.length,me=se,F;while(me--)if(t.events[me][0]==="exit"&&t.events[me][1].type===y.chunkFlow){F=t.events[me][1].end;break}k(F,"could not find previous flow chunk"),L(i);let Be=se;while(Be<t.events.length)t.events[Be][1].end={...F},Be++;return qr(t.events,me+1,0,t.events.slice(se)),t.events.length=Be,l(Q)}return c(Q)}function l(Q){if(i===r.length){if(!n)return f(Q);if(n.currentConstruct&&n.currentConstruct.concrete)return S(Q);t.interrupt=Boolean(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SY,p,m)(Q)}function p(Q){if(n)Se();return L(i),f(Q)}function m(Q){return t.parser.lazy[t.now().line]=i!==r.length,s=t.now().offset,S(Q)}function f(Q){return t.containerState={},e.attempt(SY,g,S)(Q)}function g(Q){return k(t.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),k(t.containerState,"expected `containerState` to be defined on tokenizer"),i++,r.push([t.currentConstruct,t.containerState]),f(Q)}function S(Q){if(Q===b.eof){if(n)Se();L(0),e.consume(Q);return}return n=n||t.parser.flow(t.now()),e.enter(y.chunkFlow,{_tokenizer:n,contentType:ne.contentTypeFlow,previous:o}),P(Q)}function P(Q){if(Q===b.eof){D(e.exit(y.chunkFlow),!0),L(0),e.consume(Q);return}if(de(Q))return e.consume(Q),D(e.exit(y.chunkFlow)),i=0,t.interrupt=void 0,c;return e.consume(Q),P}function D(Q,se){k(n,"expected `childFlow` to be defined when continuing");let me=t.sliceStream(Q);if(se)me.push(null);if(Q.previous=o,o)o.next=Q;if(o=Q,n.defineSkip(Q.start),n.write(me),t.parser.lazy[Q.start.line]){let F=n.events.length;while(F--)if(n.events[F][1].start.offset<s&&(!n.events[F][1].end||n.events[F][1].end.offset>s))return;let Be=t.events.length,Te=Be,Pe,Je;while(Te--)if(t.events[Te][0]==="exit"&&t.events[Te][1].type===y.chunkFlow){if(Pe){Je=t.events[Te][1].end;break}Pe=!0}k(Je,"could not find previous flow chunk"),L(i),F=Be;while(F<t.events.length)t.events[F][1].end={...Je},F++;qr(t.events,Te+1,0,t.events.slice(Be)),t.events.length=F}}function L(Q){let se=r.length;while(se-- >Q){let me=r[se];t.containerState=me[1],k(me[0].exit,"expected `exit` to be defined on container construct"),me[0].exit.call(t,e)}r.length=Q}function Se(){k(t.containerState,"expected `containerState` to be defined when closing flow"),k(n,"expected `childFlow` to be defined when closing it"),n.write([b.eof]),o=void 0,n=void 0,t.containerState._closeFlow=void 0}}function zRe(e,t,r){return k(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,e.attempt(this.parser.constructs.document,t,r),y.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)}function id(e){if(e===b.eof||ar(e)||bY(e))return ne.characterGroupWhitespace;if(yY(e))return ne.characterGroupPunctuation}function od(e,t,r){let i=[],n=-1;while(++n<e.length){let o=e[n].resolveAll;if(o&&!i.includes(o))t=o(t,r),i.push(o)}return t}var Rg={name:"attention",resolveAll:LRe,tokenize:BRe};function LRe(e,t){let r=-1,i,n,o,s,c,u,l,p;while(++r<e.length)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){i=r;while(i--)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let m={...e[i][1].end},f={...e[r][1].start};if(wY(m,-u),wY(f,u),s={type:u>1?y.strongSequence:y.emphasisSequence,start:m,end:{...e[i][1].end}},c={type:u>1?y.strongSequence:y.emphasisSequence,start:{...e[r][1].start},end:f},o={type:u>1?y.strongText:y.emphasisText,start:{...e[i][1].end},end:{...e[r][1].start}},n={type:u>1?y.strong:y.emphasis,start:{...s.start},end:{...c.end}},e[i][1].end={...s.start},e[r][1].start={...c.end},l=[],e[i][1].end.offset-e[i][1].start.offset)l=kn(l,[["enter",e[i][1],t],["exit",e[i][1],t]]);if(l=kn(l,[["enter",n,t],["enter",s,t],["exit",s,t],["enter",o,t]]),k(t.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),l=kn(l,od(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),l=kn(l,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",n,t]]),e[r][1].end.offset-e[r][1].start.offset)p=2,l=kn(l,[["enter",e[r][1],t],["exit",e[r][1],t]]);else p=0;qr(e,i-1,r-i+3,l),r=i+l.length-p-2;break}}r=-1;while(++r<e.length)if(e[r][1].type==="attentionSequence")e[r][1].type="data";return e}function BRe(e,t){let r=this.parser.constructs.attentionMarkers.null,i=this.previous,n=id(i),o;return s;function s(u){return k(u===b.asterisk||u===b.underscore,"expected asterisk or underscore"),o=u,e.enter("attentionSequence"),c(u)}function c(u){if(u===o)return e.consume(u),c;let l=e.exit("attentionSequence"),p=id(u);k(r,"expected `attentionMarkers` to be populated");let m=!p||p===ne.characterGroupPunctuation&&n||r.includes(u),f=!n||n===ne.characterGroupPunctuation&&p||r.includes(i);return l._open=Boolean(o===b.asterisk?m:m&&(n||!f)),l._close=Boolean(o===b.asterisk?f:f&&(p||!m)),t(u)}}function wY(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var mF={name:"autolink",tokenize:URe};function URe(e,t,r){let i=0;return n;function n(g){return k(g===b.lessThan,"expected `<`"),e.enter(y.autolink),e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.enter(y.autolinkProtocol),o}function o(g){if(ci(g))return e.consume(g),s;if(g===b.atSign)return r(g);return l(g)}function s(g){if(g===b.plusSign||g===b.dash||g===b.dot||In(g))return i=1,c(g);return l(g)}function c(g){if(g===b.colon)return e.consume(g),i=0,u;if((g===b.plusSign||g===b.dash||g===b.dot||In(g))&&i++<ne.autolinkSchemeSizeMax)return e.consume(g),c;return i=0,l(g)}function u(g){if(g===b.greaterThan)return e.exit(y.autolinkProtocol),e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.exit(y.autolink),t;if(g===b.eof||g===b.space||g===b.lessThan||Cg(g))return r(g);return e.consume(g),u}function l(g){if(g===b.atSign)return e.consume(g),p;if(fY(g))return e.consume(g),l;return r(g)}function p(g){return In(g)?m(g):r(g)}function m(g){if(g===b.dot)return e.consume(g),i=0,p;if(g===b.greaterThan)return e.exit(y.autolinkProtocol).type=y.autolinkEmail,e.enter(y.autolinkMarker),e.consume(g),e.exit(y.autolinkMarker),e.exit(y.autolink),t;return f(g)}function f(g){if((g===b.dash||In(g))&&i++<ne.autolinkDomainSizeMax){let S=g===b.dash?f:m;return e.consume(g),S}return r(g)}}var Ua={partial:!0,tokenize:qRe};function qRe(e,t,r){return i;function i(o){return Ke(o)?rt(e,n,y.linePrefix)(o):n(o)}function n(o){return o===b.eof||de(o)?t(o):r(o)}}var Jv={continuation:{tokenize:HRe},exit:WRe,name:"blockQuote",tokenize:JRe};function JRe(e,t,r){let i=this;return n;function n(s){if(s===b.greaterThan){let c=i.containerState;if(k(c,"expected `containerState` to be defined in container"),!c.open)e.enter(y.blockQuote,{_container:!0}),c.open=!0;return e.enter(y.blockQuotePrefix),e.enter(y.blockQuoteMarker),e.consume(s),e.exit(y.blockQuoteMarker),o}return r(s)}function o(s){if(Ke(s))return e.enter(y.blockQuotePrefixWhitespace),e.consume(s),e.exit(y.blockQuotePrefixWhitespace),e.exit(y.blockQuotePrefix),t;return e.exit(y.blockQuotePrefix),t(s)}}function HRe(e,t,r){let i=this;return n;function n(s){if(Ke(s))return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,o,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(s);return o(s)}function o(s){return e.attempt(Jv,t,r)(s)}}function WRe(e){e.exit(y.blockQuote)}var Hv={name:"characterEscape",tokenize:ZRe};function ZRe(e,t,r){return i;function i(o){return k(o===b.backslash,"expected `\\`"),e.enter(y.characterEscape),e.enter(y.escapeMarker),e.consume(o),e.exit(y.escapeMarker),n}function n(o){if(hY(o))return e.enter(y.characterEscapeValue),e.consume(o),e.exit(y.characterEscapeValue),e.exit(y.characterEscape),t;return r(o)}}var Wv={name:"characterReference",tokenize:VRe};function VRe(e,t,r){let i=this,n=0,o,s;return c;function c(m){return k(m===b.ampersand,"expected `&`"),e.enter(y.characterReference),e.enter(y.characterReferenceMarker),e.consume(m),e.exit(y.characterReferenceMarker),u}function u(m){if(m===b.numberSign)return e.enter(y.characterReferenceMarkerNumeric),e.consume(m),e.exit(y.characterReferenceMarkerNumeric),l;return e.enter(y.characterReferenceValue),o=ne.characterReferenceNamedSizeMax,s=In,p(m)}function l(m){if(m===b.uppercaseX||m===b.lowercaseX)return e.enter(y.characterReferenceMarkerHexadecimal),e.consume(m),e.exit(y.characterReferenceMarkerHexadecimal),e.enter(y.characterReferenceValue),o=ne.characterReferenceHexadecimalSizeMax,s=gY,p;return e.enter(y.characterReferenceValue),o=ne.characterReferenceDecimalSizeMax,s=Pg,p(m)}function p(m){if(m===b.semicolon&&n){let f=e.exit(y.characterReferenceValue);if(s===In&&!nd(i.sliceSerialize(f)))return r(m);return e.enter(y.characterReferenceMarker),e.consume(m),e.exit(y.characterReferenceMarker),e.exit(y.characterReference),t}if(s(m)&&n++<o)return e.consume(m),p;return r(m)}}var kY={partial:!0,tokenize:KRe},Zv={concrete:!0,name:"codeFenced",tokenize:GRe};function GRe(e,t,r){let i=this,n={partial:!0,tokenize:me},o=0,s=0,c;return u;function u(F){return l(F)}function l(F){k(F===b.graveAccent||F===b.tilde,"expected `` ` `` or `~`");let Be=i.events[i.events.length-1];return o=Be&&Be[1].type===y.linePrefix?Be[2].sliceSerialize(Be[1],!0).length:0,c=F,e.enter(y.codeFenced),e.enter(y.codeFencedFence),e.enter(y.codeFencedFenceSequence),p(F)}function p(F){if(F===c)return s++,e.consume(F),p;if(s<ne.codeFencedSequenceSizeMin)return r(F);return e.exit(y.codeFencedFenceSequence),Ke(F)?rt(e,m,y.whitespace)(F):m(F)}function m(F){if(F===b.eof||de(F))return e.exit(y.codeFencedFence),i.interrupt?t(F):e.check(kY,P,se)(F);return e.enter(y.codeFencedFenceInfo),e.enter(y.chunkString,{contentType:ne.contentTypeString}),f(F)}function f(F){if(F===b.eof||de(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceInfo),m(F);if(Ke(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceInfo),rt(e,g,y.whitespace)(F);if(F===b.graveAccent&&F===c)return r(F);return e.consume(F),f}function g(F){if(F===b.eof||de(F))return m(F);return e.enter(y.codeFencedFenceMeta),e.enter(y.chunkString,{contentType:ne.contentTypeString}),S(F)}function S(F){if(F===b.eof||de(F))return e.exit(y.chunkString),e.exit(y.codeFencedFenceMeta),m(F);if(F===b.graveAccent&&F===c)return r(F);return e.consume(F),S}function P(F){return k(de(F),"expected eol"),e.attempt(n,se,D)(F)}function D(F){return k(de(F),"expected eol"),e.enter(y.lineEnding),e.consume(F),e.exit(y.lineEnding),L}function L(F){return o>0&&Ke(F)?rt(e,Se,y.linePrefix,o+1)(F):Se(F)}function Se(F){if(F===b.eof||de(F))return e.check(kY,P,se)(F);return e.enter(y.codeFlowValue),Q(F)}function Q(F){if(F===b.eof||de(F))return e.exit(y.codeFlowValue),Se(F);return e.consume(F),Q}function se(F){return e.exit(y.codeFenced),t(F)}function me(F,Be,Te){let Pe=0;return Je;function Je(Me){return k(de(Me),"expected eol"),F.enter(y.lineEnding),F.consume(Me),F.exit(y.lineEnding),Xe}function Xe(Me){return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),F.enter(y.codeFencedFence),Ke(Me)?rt(F,He,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(Me):He(Me)}function He(Me){if(Me===c)return F.enter(y.codeFencedFenceSequence),ge(Me);return Te(Me)}function ge(Me){if(Me===c)return Pe++,F.consume(Me),ge;if(Pe>=s)return F.exit(y.codeFencedFenceSequence),Ke(Me)?rt(F,xe,y.whitespace)(Me):xe(Me);return Te(Me)}function xe(Me){if(Me===b.eof||de(Me))return F.exit(y.codeFencedFence),Be(Me);return Te(Me)}}}function KRe(e,t,r){let i=this;return n;function n(s){if(s===b.eof)return r(s);return k(de(s),"expected eol"),e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),o}function o(s){return i.parser.lazy[i.now().line]?r(s):t(s)}}var Ag={name:"codeIndented",tokenize:YRe},QRe={partial:!0,tokenize:XRe};function YRe(e,t,r){let i=this;return n;function n(l){return k(Ke(l)),e.enter(y.codeIndented),rt(e,o,y.linePrefix,ne.tabSize+1)(l)}function o(l){let p=i.events[i.events.length-1];return p&&p[1].type===y.linePrefix&&p[2].sliceSerialize(p[1],!0).length>=ne.tabSize?s(l):r(l)}function s(l){if(l===b.eof)return u(l);if(de(l))return e.attempt(QRe,s,u)(l);return e.enter(y.codeFlowValue),c(l)}function c(l){if(l===b.eof||de(l))return e.exit(y.codeFlowValue),s(l);return e.consume(l),c}function u(l){return e.exit(y.codeIndented),t(l)}}function XRe(e,t,r){let i=this;return n;function n(s){if(i.parser.lazy[i.now().line])return r(s);if(de(s))return e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),n;return rt(e,o,y.linePrefix,ne.tabSize+1)(s)}function o(s){let c=i.events[i.events.length-1];return c&&c[1].type===y.linePrefix&&c[2].sliceSerialize(c[1],!0).length>=ne.tabSize?t(s):de(s)?n(s):r(s)}}var fF={name:"codeText",previous:IY,resolve:eAe,tokenize:tAe};function eAe(e){let t=e.length-4,r=3,i,n;if((e[r][1].type===y.lineEnding||e[r][1].type==="space")&&(e[t][1].type===y.lineEnding||e[t][1].type==="space")){i=r;while(++i<t)if(e[i][1].type===y.codeTextData){e[r][1].type=y.codeTextPadding,e[t][1].type=y.codeTextPadding,r+=2,t-=2;break}}i=r-1,t++;while(++i<=t)if(n===void 0){if(i!==t&&e[i][1].type!==y.lineEnding)n=i}else if(i===t||e[i][1].type===y.lineEnding){if(e[n][1].type=y.codeTextData,i!==n+2)e[n][1].end=e[i-1][1].end,e.splice(n+2,i-n-2),t-=i-n-2,i=n+2;n=void 0}return e}function IY(e){return e!==b.graveAccent||this.events[this.events.length-1][1].type===y.characterEscape}function tAe(e,t,r){let i=this,n=0,o,s;return c;function c(f){return k(f===b.graveAccent,"expected `` ` ``"),k(IY.call(i,i.previous),"expected correct previous"),e.enter(y.codeText),e.enter(y.codeTextSequence),u(f)}function u(f){if(f===b.graveAccent)return e.consume(f),n++,u;return e.exit(y.codeTextSequence),l(f)}function l(f){if(f===b.eof)return r(f);if(f===b.space)return e.enter("space"),e.consume(f),e.exit("space"),l;if(f===b.graveAccent)return s=e.enter(y.codeTextSequence),o=0,m(f);if(de(f))return e.enter(y.lineEnding),e.consume(f),e.exit(y.lineEnding),l;return e.enter(y.codeTextData),p(f)}function p(f){if(f===b.eof||f===b.space||f===b.graveAccent||de(f))return e.exit(y.codeTextData),l(f);return e.consume(f),p}function m(f){if(f===b.graveAccent)return e.consume(f),o++,m;if(o===n)return e.exit(y.codeTextSequence),e.exit(y.codeText),t(f);return s.type=y.codeTextData,p(f)}}class gF{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(e<this.left.length)return this.left[e];return this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let r=t===null||t===void 0?Number.POSITIVE_INFINITY:t;if(r<this.left.length)return this.left.slice(e,r);if(e>this.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();return this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){let i=t||0;this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);if(r)_g(this.left,r);return n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),_g(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_g(this.right,e.reverse())}setCursor(e){if(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)return;if(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);_g(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);_g(this.left,t.reverse())}}}function _g(e,t){let r=0;if(t.length<ne.v8MaxSafeChunkSize)e.push(...t);else while(r<t.length)e.push(...t.slice(r,r+ne.v8MaxSafeChunkSize)),r+=ne.v8MaxSafeChunkSize}function Vv(e){let t={},r=-1,i,n,o,s,c,u,l,p=new gF(e);while(++r<p.length){while(r in t)r=t[r];if(i=p.get(r),r&&i[1].type===y.chunkFlow&&p.get(r-1)[1].type===y.listItemPrefix){if(k(i[1]._tokenizer,"expected `_tokenizer` on subtokens"),u=i[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type===y.lineEndingBlank)o+=2;if(o<u.length&&u[o][1].type===y.content)while(++o<u.length){if(u[o][1].type===y.content)break;if(u[o][1].type===y.chunkText)u[o][1]._isInFirstContentOfListItem=!0,o++}}if(i[0]==="enter"){if(i[1].contentType)Object.assign(t,rAe(p,r)),r=t[r],l=!0}else if(i[1]._container){o=r,n=void 0;while(o--)if(s=p.get(o),s[1].type===y.lineEnding||s[1].type===y.lineEndingBlank){if(s[0]==="enter"){if(n)p.get(n)[1].type=y.lineEndingBlank;s[1].type=y.lineEnding,n=o}}else if(s[1].type===y.linePrefix||s[1].type===y.listItemIndent);else break;if(n)i[1].end={...p.get(n)[1].start},c=p.slice(n,r),c.unshift(i),p.splice(n,r-n+1,c)}}return qr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!l}function rAe(e,t){let r=e.get(t)[1],i=e.get(t)[2],n=t-1,o=[];k(r.contentType,"expected `contentType` on subtokens");let s=r._tokenizer;if(!s){if(s=i.parser[r.contentType](r.start),r._contentTypeTextTrailing)s._contentTypeTextTrailing=!0}let c=s.events,u=[],l={},p,m,f=-1,g=r,S=0,P=0,D=[P];while(g){while(e.get(++n)[1]!==g);if(k(!m||g.previous===m,"expected previous to match"),k(!m||m.next===g,"expected next to match"),o.push(n),!g._tokenizer){if(p=i.sliceStream(g),!g.next)p.push(b.eof);if(m)s.defineSkip(g.start);if(g._isInFirstContentOfListItem)s._gfmTasklistFirstContentOfListItem=!0;if(s.write(p),g._isInFirstContentOfListItem)s._gfmTasklistFirstContentOfListItem=void 0}m=g,g=g.next}g=r;while(++f<c.length)if(c[f][0]==="exit"&&c[f-1][0]==="enter"&&c[f][1].type===c[f-1][1].type&&c[f][1].start.line!==c[f][1].end.line)k(g,"expected a current token"),P=f+1,D.push(P),g._tokenizer=void 0,g.previous=void 0,g=g.next;if(s.events=[],g)g._tokenizer=void 0,g.previous=void 0,k(!g.next,"expected no next token");else D.pop();f=D.length;while(f--){let L=c.slice(D[f],D[f+1]),Se=o.pop();k(Se!==void 0,"expected a start position when splicing"),u.push([Se,Se+L.length-1]),e.splice(Se,2,L)}u.reverse(),f=-1;while(++f<u.length)l[S+u[f][0]]=S+u[f][1],S+=u[f][1]-u[f][0]-1;return l}var hF={resolve:iAe,tokenize:oAe},nAe={partial:!0,tokenize:sAe};function iAe(e){return Vv(e),e}function oAe(e,t){let r;return i;function i(c){return k(c!==b.eof&&!de(c),"expected no eof or eol"),e.enter(y.content),r=e.enter(y.chunkContent,{contentType:ne.contentTypeContent}),n(c)}function n(c){if(c===b.eof)return o(c);if(de(c))return e.check(nAe,s,o)(c);return e.consume(c),n}function o(c){return e.exit(y.chunkContent),e.exit(y.content),t(c)}function s(c){return k(de(c),"expected eol"),e.consume(c),e.exit(y.chunkContent),k(r,"expected previous token"),r.next=e.enter(y.chunkContent,{contentType:ne.contentTypeContent,previous:r}),r=r.next,n}}function sAe(e,t,r){let i=this;return n;function n(s){return k(de(s),"expected a line ending"),e.exit(y.chunkContent),e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),rt(e,o,y.linePrefix)}function o(s){if(s===b.eof||de(s))return r(s);k(i.parser.constructs.disable.null,"expected `disable.null` to be populated");let c=i.events[i.events.length-1];if(!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type===y.linePrefix&&c[2].sliceSerialize(c[1],!0).length>=ne.tabSize)return t(s);return e.interrupt(i.parser.constructs.flow,r,t)(s)}}function Gv(e,t,r,i,n,o,s,c,u){let l=u||Number.POSITIVE_INFINITY,p=0;return m;function m(L){if(L===b.lessThan)return e.enter(i),e.enter(n),e.enter(o),e.consume(L),e.exit(o),f;if(L===b.eof||L===b.space||L===b.rightParenthesis||Cg(L))return r(L);return e.enter(i),e.enter(s),e.enter(c),e.enter(y.chunkString,{contentType:ne.contentTypeString}),P(L)}function f(L){if(L===b.greaterThan)return e.enter(o),e.consume(L),e.exit(o),e.exit(n),e.exit(i),t;return e.enter(c),e.enter(y.chunkString,{contentType:ne.contentTypeString}),g(L)}function g(L){if(L===b.greaterThan)return e.exit(y.chunkString),e.exit(c),f(L);if(L===b.eof||L===b.lessThan||de(L))return r(L);return e.consume(L),L===b.backslash?S:g}function S(L){if(L===b.lessThan||L===b.greaterThan||L===b.backslash)return e.consume(L),g;return g(L)}function P(L){if(!p&&(L===b.eof||L===b.rightParenthesis||ar(L)))return e.exit(y.chunkString),e.exit(c),e.exit(s),e.exit(i),t(L);if(p<l&&L===b.leftParenthesis)return e.consume(L),p++,P;if(L===b.rightParenthesis)return e.consume(L),p--,P;if(L===b.eof||L===b.space||L===b.leftParenthesis||Cg(L))return r(L);return e.consume(L),L===b.backslash?D:P}function D(L){if(L===b.leftParenthesis||L===b.rightParenthesis||L===b.backslash)return e.consume(L),P;return P(L)}}function Kv(e,t,r,i,n,o){let s=this,c=0,u;return l;function l(g){return k(g===b.leftSquareBracket,"expected `[`"),e.enter(i),e.enter(n),e.consume(g),e.exit(n),e.enter(o),p}function p(g){if(c>ne.linkReferenceSizeMax||g===b.eof||g===b.leftSquareBracket||g===b.rightSquareBracket&&!u||g===b.caret&&!c&&"_hiddenFootnoteSupport"in s.parser.constructs)return r(g);if(g===b.rightSquareBracket)return e.exit(o),e.enter(n),e.consume(g),e.exit(n),e.exit(i),t;if(de(g))return e.enter(y.lineEnding),e.consume(g),e.exit(y.lineEnding),p;return e.enter(y.chunkString,{contentType:ne.contentTypeString}),m(g)}function m(g){if(g===b.eof||g===b.leftSquareBracket||g===b.rightSquareBracket||de(g)||c++>ne.linkReferenceSizeMax)return e.exit(y.chunkString),p(g);if(e.consume(g),!u)u=!Ke(g);return g===b.backslash?f:m}function f(g){if(g===b.leftSquareBracket||g===b.backslash||g===b.rightSquareBracket)return e.consume(g),c++,m;return m(g)}}function Qv(e,t,r,i,n,o){let s;return c;function c(f){if(f===b.quotationMark||f===b.apostrophe||f===b.leftParenthesis)return e.enter(i),e.enter(n),e.consume(f),e.exit(n),s=f===b.leftParenthesis?b.rightParenthesis:f,u;return r(f)}function u(f){if(f===s)return e.enter(n),e.consume(f),e.exit(n),e.exit(i),t;return e.enter(o),l(f)}function l(f){if(f===s)return e.exit(o),u(s);if(f===b.eof)return r(f);if(de(f))return e.enter(y.lineEnding),e.consume(f),e.exit(y.lineEnding),rt(e,l,y.linePrefix);return e.enter(y.chunkString,{contentType:ne.contentTypeString}),p(f)}function p(f){if(f===s||f===b.eof||de(f))return e.exit(y.chunkString),l(f);return e.consume(f),f===b.backslash?m:p}function m(f){if(f===s||f===b.backslash)return e.consume(f),p;return p(f)}}function Ru(e,t){let r;return i;function i(n){if(de(n))return e.enter(y.lineEnding),e.consume(n),e.exit(y.lineEnding),r=!0,i;if(Ke(n))return rt(e,i,r?y.linePrefix:y.lineSuffix)(n);return t(n)}}var yF={name:"definition",tokenize:cAe},aAe={partial:!0,tokenize:uAe};function cAe(e,t,r){let i=this,n;return o;function o(g){return e.enter(y.definition),s(g)}function s(g){return k(g===b.leftSquareBracket,"expected `[`"),Kv.call(i,e,c,r,y.definitionLabel,y.definitionLabelMarker,y.definitionLabelString)(g)}function c(g){if(n=Ts(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===b.colon)return e.enter(y.definitionMarker),e.consume(g),e.exit(y.definitionMarker),u;return r(g)}function u(g){return ar(g)?Ru(e,l)(g):l(g)}function l(g){return Gv(e,p,r,y.definitionDestination,y.definitionDestinationLiteral,y.definitionDestinationLiteralMarker,y.definitionDestinationRaw,y.definitionDestinationString)(g)}function p(g){return e.attempt(aAe,m,m)(g)}function m(g){return Ke(g)?rt(e,f,y.whitespace)(g):f(g)}function f(g){if(g===b.eof||de(g))return e.exit(y.definition),i.parser.defined.push(n),t(g);return r(g)}}function uAe(e,t,r){return i;function i(c){return ar(c)?Ru(e,n)(c):r(c)}function n(c){return Qv(e,o,r,y.definitionTitle,y.definitionTitleMarker,y.definitionTitleString)(c)}function o(c){return Ke(c)?rt(e,s,y.whitespace)(c):s(c)}function s(c){return c===b.eof||de(c)?t(c):r(c)}}var bF={name:"hardBreakEscape",tokenize:lAe};function lAe(e,t,r){return i;function i(o){return k(o===b.backslash,"expected `\\`"),e.enter(y.hardBreakEscape),e.consume(o),n}function n(o){if(de(o))return e.exit(y.hardBreakEscape),t(o);return r(o)}}var xF={name:"headingAtx",resolve:pAe,tokenize:dAe};function pAe(e,t){let r=e.length-2,i=3,n,o;if(e[i][1].type===y.whitespace)i+=2;if(r-2>i&&e[r][1].type===y.whitespace)r-=2;if(e[r][1].type===y.atxHeadingSequence&&(i===r-1||r-4>i&&e[r-2][1].type===y.whitespace))r-=i+1===r?2:4;if(r>i)n={type:y.atxHeadingText,start:e[i][1].start,end:e[r][1].end},o={type:y.chunkText,start:e[i][1].start,end:e[r][1].end,contentType:ne.contentTypeText},qr(e,i,r-i+1,[["enter",n,t],["enter",o,t],["exit",o,t],["exit",n,t]]);return e}function dAe(e,t,r){let i=0;return n;function n(p){return e.enter(y.atxHeading),o(p)}function o(p){return k(p===b.numberSign,"expected `#`"),e.enter(y.atxHeadingSequence),s(p)}function s(p){if(p===b.numberSign&&i++<ne.atxHeadingOpeningFenceSizeMax)return e.consume(p),s;if(p===b.eof||ar(p))return e.exit(y.atxHeadingSequence),c(p);return r(p)}function c(p){if(p===b.numberSign)return e.enter(y.atxHeadingSequence),u(p);if(p===b.eof||de(p))return e.exit(y.atxHeading),t(p);if(Ke(p))return rt(e,c,y.whitespace)(p);return e.enter(y.atxHeadingText),l(p)}function u(p){if(p===b.numberSign)return e.consume(p),u;return e.exit(y.atxHeadingSequence),c(p)}function l(p){if(p===b.eof||p===b.numberSign||ar(p))return e.exit(y.atxHeadingText),c(p);return e.consume(p),l}}var TY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],SF=["pre","script","style","textarea"];var vF={concrete:!0,name:"htmlFlow",resolveTo:gAe,tokenize:hAe},mAe={partial:!0,tokenize:bAe},fAe={partial:!0,tokenize:yAe};function gAe(e){let t=e.length;while(t--)if(e[t][0]==="enter"&&e[t][1].type===y.htmlFlow)break;if(t>1&&e[t-2][1].type===y.linePrefix)e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2);return e}function hAe(e,t,r){let i=this,n,o,s,c,u;return l;function l(I){return p(I)}function p(I){return k(I===b.lessThan,"expected `<`"),e.enter(y.htmlFlow),e.enter(y.htmlFlowData),e.consume(I),m}function m(I){if(I===b.exclamationMark)return e.consume(I),f;if(I===b.slash)return e.consume(I),o=!0,P;if(I===b.questionMark)return e.consume(I),n=ne.htmlInstruction,i.interrupt?t:w;if(ci(I))return k(I!==null),e.consume(I),s=String.fromCharCode(I),D;return r(I)}function f(I){if(I===b.dash)return e.consume(I),n=ne.htmlComment,g;if(I===b.leftSquareBracket)return e.consume(I),n=ne.htmlCdata,c=0,S;if(ci(I))return e.consume(I),n=ne.htmlDeclaration,i.interrupt?t:w;return r(I)}function g(I){if(I===b.dash)return e.consume(I),i.interrupt?t:w;return r(I)}function S(I){let ur=ne.cdataOpeningString;if(I===ur.charCodeAt(c++)){if(e.consume(I),c===ur.length)return i.interrupt?t:He;return S}return r(I)}function P(I){if(ci(I))return k(I!==null),e.consume(I),s=String.fromCharCode(I),D;return r(I)}function D(I){if(I===b.eof||I===b.slash||I===b.greaterThan||ar(I)){let ur=I===b.slash,qt=s.toLowerCase();if(!ur&&!o&&SF.includes(qt))return n=ne.htmlRaw,i.interrupt?t(I):He(I);if(TY.includes(s.toLowerCase())){if(n=ne.htmlBasic,ur)return e.consume(I),L;return i.interrupt?t(I):He(I)}return n=ne.htmlComplete,i.interrupt&&!i.parser.lazy[i.now().line]?r(I):o?Se(I):Q(I)}if(I===b.dash||In(I))return e.consume(I),s+=String.fromCharCode(I),D;return r(I)}function L(I){if(I===b.greaterThan)return e.consume(I),i.interrupt?t:He;return r(I)}function Se(I){if(Ke(I))return e.consume(I),Se;return Je(I)}function Q(I){if(I===b.slash)return e.consume(I),Je;if(I===b.colon||I===b.underscore||ci(I))return e.consume(I),se;if(Ke(I))return e.consume(I),Q;return Je(I)}function se(I){if(I===b.dash||I===b.dot||I===b.colon||I===b.underscore||In(I))return e.consume(I),se;return me(I)}function me(I){if(I===b.equalsTo)return e.consume(I),F;if(Ke(I))return e.consume(I),me;return Q(I)}function F(I){if(I===b.eof||I===b.lessThan||I===b.equalsTo||I===b.greaterThan||I===b.graveAccent)return r(I);if(I===b.quotationMark||I===b.apostrophe)return e.consume(I),u=I,Be;if(Ke(I))return e.consume(I),F;return Te(I)}function Be(I){if(I===u)return e.consume(I),u=null,Pe;if(I===b.eof||de(I))return r(I);return e.consume(I),Be}function Te(I){if(I===b.eof||I===b.quotationMark||I===b.apostrophe||I===b.slash||I===b.lessThan||I===b.equalsTo||I===b.greaterThan||I===b.graveAccent||ar(I))return me(I);return e.consume(I),Te}function Pe(I){if(I===b.slash||I===b.greaterThan||Ke(I))return Q(I);return r(I)}function Je(I){if(I===b.greaterThan)return e.consume(I),Xe;return r(I)}function Xe(I){if(I===b.eof||de(I))return He(I);if(Ke(I))return e.consume(I),Xe;return r(I)}function He(I){if(I===b.dash&&n===ne.htmlComment)return e.consume(I),ee;if(I===b.lessThan&&n===ne.htmlRaw)return e.consume(I),at;if(I===b.greaterThan&&n===ne.htmlDeclaration)return e.consume(I),zt;if(I===b.questionMark&&n===ne.htmlInstruction)return e.consume(I),w;if(I===b.rightSquareBracket&&n===ne.htmlCdata)return e.consume(I),cr;if(de(I)&&(n===ne.htmlBasic||n===ne.htmlComplete))return e.exit(y.htmlFlowData),e.check(mAe,Fr,ge)(I);if(I===b.eof||de(I))return e.exit(y.htmlFlowData),ge(I);return e.consume(I),He}function ge(I){return e.check(fAe,xe,Fr)(I)}function xe(I){return k(de(I)),e.enter(y.lineEnding),e.consume(I),e.exit(y.lineEnding),Me}function Me(I){if(I===b.eof||de(I))return ge(I);return e.enter(y.htmlFlowData),He(I)}function ee(I){if(I===b.dash)return e.consume(I),w;return He(I)}function at(I){if(I===b.slash)return e.consume(I),s="",ft;return He(I)}function ft(I){if(I===b.greaterThan){let ur=s.toLowerCase();if(SF.includes(ur))return e.consume(I),zt;return He(I)}if(ci(I)&&s.length<ne.htmlRawSizeMax)return k(I!==null),e.consume(I),s+=String.fromCharCode(I),ft;return He(I)}function cr(I){if(I===b.rightSquareBracket)return e.consume(I),w;return He(I)}function w(I){if(I===b.greaterThan)return e.consume(I),zt;if(I===b.dash&&n===ne.htmlComment)return e.consume(I),w;return He(I)}function zt(I){if(I===b.eof||de(I))return e.exit(y.htmlFlowData),Fr(I);return e.consume(I),zt}function Fr(I){return e.exit(y.htmlFlow),t(I)}}function yAe(e,t,r){let i=this;return n;function n(s){if(de(s))return e.enter(y.lineEnding),e.consume(s),e.exit(y.lineEnding),o;return r(s)}function o(s){return i.parser.lazy[i.now().line]?r(s):t(s)}}function bAe(e,t,r){return i;function i(n){return k(de(n),"expected a line ending"),e.enter(y.lineEnding),e.consume(n),e.exit(y.lineEnding),e.attempt(Ua,t,r)}}var wF={name:"htmlText",tokenize:xAe};function xAe(e,t,r){let i=this,n,o,s;return c;function c(w){return k(w===b.lessThan,"expected `<`"),e.enter(y.htmlText),e.enter(y.htmlTextData),e.consume(w),u}function u(w){if(w===b.exclamationMark)return e.consume(w),l;if(w===b.slash)return e.consume(w),me;if(w===b.questionMark)return e.consume(w),Q;if(ci(w))return e.consume(w),Te;return r(w)}function l(w){if(w===b.dash)return e.consume(w),p;if(w===b.leftSquareBracket)return e.consume(w),o=0,S;if(ci(w))return e.consume(w),Se;return r(w)}function p(w){if(w===b.dash)return e.consume(w),g;return r(w)}function m(w){if(w===b.eof)return r(w);if(w===b.dash)return e.consume(w),f;if(de(w))return s=m,at(w);return e.consume(w),m}function f(w){if(w===b.dash)return e.consume(w),g;return m(w)}function g(w){return w===b.greaterThan?ee(w):w===b.dash?f(w):m(w)}function S(w){let zt=ne.cdataOpeningString;if(w===zt.charCodeAt(o++))return e.consume(w),o===zt.length?P:S;return r(w)}function P(w){if(w===b.eof)return r(w);if(w===b.rightSquareBracket)return e.consume(w),D;if(de(w))return s=P,at(w);return e.consume(w),P}function D(w){if(w===b.rightSquareBracket)return e.consume(w),L;return P(w)}function L(w){if(w===b.greaterThan)return ee(w);if(w===b.rightSquareBracket)return e.consume(w),L;return P(w)}function Se(w){if(w===b.eof||w===b.greaterThan)return ee(w);if(de(w))return s=Se,at(w);return e.consume(w),Se}function Q(w){if(w===b.eof)return r(w);if(w===b.questionMark)return e.consume(w),se;if(de(w))return s=Q,at(w);return e.consume(w),Q}function se(w){return w===b.greaterThan?ee(w):Q(w)}function me(w){if(ci(w))return e.consume(w),F;return r(w)}function F(w){if(w===b.dash||In(w))return e.consume(w),F;return Be(w)}function Be(w){if(de(w))return s=Be,at(w);if(Ke(w))return e.consume(w),Be;return ee(w)}function Te(w){if(w===b.dash||In(w))return e.consume(w),Te;if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return r(w)}function Pe(w){if(w===b.slash)return e.consume(w),ee;if(w===b.colon||w===b.underscore||ci(w))return e.consume(w),Je;if(de(w))return s=Pe,at(w);if(Ke(w))return e.consume(w),Pe;return ee(w)}function Je(w){if(w===b.dash||w===b.dot||w===b.colon||w===b.underscore||In(w))return e.consume(w),Je;return Xe(w)}function Xe(w){if(w===b.equalsTo)return e.consume(w),He;if(de(w))return s=Xe,at(w);if(Ke(w))return e.consume(w),Xe;return Pe(w)}function He(w){if(w===b.eof||w===b.lessThan||w===b.equalsTo||w===b.greaterThan||w===b.graveAccent)return r(w);if(w===b.quotationMark||w===b.apostrophe)return e.consume(w),n=w,ge;if(de(w))return s=He,at(w);if(Ke(w))return e.consume(w),He;return e.consume(w),xe}function ge(w){if(w===n)return e.consume(w),n=void 0,Me;if(w===b.eof)return r(w);if(de(w))return s=ge,at(w);return e.consume(w),ge}function xe(w){if(w===b.eof||w===b.quotationMark||w===b.apostrophe||w===b.lessThan||w===b.equalsTo||w===b.graveAccent)return r(w);if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return e.consume(w),xe}function Me(w){if(w===b.slash||w===b.greaterThan||ar(w))return Pe(w);return r(w)}function ee(w){if(w===b.greaterThan)return e.consume(w),e.exit(y.htmlTextData),e.exit(y.htmlText),t;return r(w)}function at(w){return k(s,"expected return state"),k(de(w),"expected eol"),e.exit(y.htmlTextData),e.enter(y.lineEnding),e.consume(w),e.exit(y.lineEnding),ft}function ft(w){return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),Ke(w)?rt(e,cr,y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(w):cr(w)}function cr(w){return e.enter(y.htmlTextData),s(w)}}var Au={name:"labelEnd",resolveAll:kAe,resolveTo:IAe,tokenize:TAe},SAe={tokenize:EAe},vAe={tokenize:CAe},wAe={tokenize:PAe};function kAe(e){let t=-1,r=[];while(++t<e.length){let i=e[t][1];if(r.push(e[t]),i.type===y.labelImage||i.type===y.labelLink||i.type===y.labelEnd){let n=i.type===y.labelImage?4:2;i.type=y.data,t+=n}}if(e.length!==r.length)qr(e,0,e.length,r);return e}function IAe(e,t){let r=e.length,i=0,n,o,s,c;while(r--)if(n=e[r][1],o){if(n.type===y.link||n.type===y.labelLink&&n._inactive)break;if(e[r][0]==="enter"&&n.type===y.labelLink)n._inactive=!0}else if(s){if(e[r][0]==="enter"&&(n.type===y.labelImage||n.type===y.labelLink)&&!n._balanced){if(o=r,n.type!==y.labelLink){i=2;break}}}else if(n.type===y.labelEnd)s=r;k(o!==void 0,"`open` is supposed to be found"),k(s!==void 0,"`close` is supposed to be found");let u={type:e[o][1].type===y.labelLink?y.link:y.image,start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:y.label,start:{...e[o][1].start},end:{...e[s][1].end}},p={type:y.labelText,start:{...e[o+i+2][1].end},end:{...e[s-2][1].start}};return c=[["enter",u,t],["enter",l,t]],c=kn(c,e.slice(o+1,o+i+3)),c=kn(c,[["enter",p,t]]),k(t.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),c=kn(c,od(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t)),c=kn(c,[["exit",p,t],e[s-2],e[s-1],["exit",l,t]]),c=kn(c,e.slice(s+1)),c=kn(c,[["exit",u,t]]),qr(e,o,e.length,c),e}function TAe(e,t,r){let i=this,n=i.events.length,o,s;while(n--)if((i.events[n][1].type===y.labelImage||i.events[n][1].type===y.labelLink)&&!i.events[n][1]._balanced){o=i.events[n][1];break}return c;function c(f){if(k(f===b.rightSquareBracket,"expected `]`"),!o)return r(f);if(o._inactive)return m(f);return s=i.parser.defined.includes(Ts(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter(y.labelEnd),e.enter(y.labelMarker),e.consume(f),e.exit(y.labelMarker),e.exit(y.labelEnd),u}function u(f){if(f===b.leftParenthesis)return e.attempt(SAe,p,s?p:m)(f);if(f===b.leftSquareBracket)return e.attempt(vAe,p,s?l:m)(f);return s?p(f):m(f)}function l(f){return e.attempt(wAe,p,m)(f)}function p(f){return t(f)}function m(f){return o._balanced=!0,r(f)}}function EAe(e,t,r){return i;function i(m){return k(m===b.leftParenthesis,"expected left paren"),e.enter(y.resource),e.enter(y.resourceMarker),e.consume(m),e.exit(y.resourceMarker),n}function n(m){return ar(m)?Ru(e,o)(m):o(m)}function o(m){if(m===b.rightParenthesis)return p(m);return Gv(e,s,c,y.resourceDestination,y.resourceDestinationLiteral,y.resourceDestinationLiteralMarker,y.resourceDestinationRaw,y.resourceDestinationString,ne.linkResourceDestinationBalanceMax)(m)}function s(m){return ar(m)?Ru(e,u)(m):p(m)}function c(m){return r(m)}function u(m){if(m===b.quotationMark||m===b.apostrophe||m===b.leftParenthesis)return Qv(e,l,r,y.resourceTitle,y.resourceTitleMarker,y.resourceTitleString)(m);return p(m)}function l(m){return ar(m)?Ru(e,p)(m):p(m)}function p(m){if(m===b.rightParenthesis)return e.enter(y.resourceMarker),e.consume(m),e.exit(y.resourceMarker),e.exit(y.resource),t;return r(m)}}function CAe(e,t,r){let i=this;return n;function n(c){return k(c===b.leftSquareBracket,"expected left bracket"),Kv.call(i,e,o,s,y.reference,y.referenceMarker,y.referenceString)(c)}function o(c){return i.parser.defined.includes(Ts(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):r(c)}function s(c){return r(c)}}function PAe(e,t,r){return i;function i(o){return k(o===b.leftSquareBracket,"expected left bracket"),e.enter(y.reference),e.enter(y.referenceMarker),e.consume(o),e.exit(y.referenceMarker),n}function n(o){if(o===b.rightSquareBracket)return e.enter(y.referenceMarker),e.consume(o),e.exit(y.referenceMarker),e.exit(y.reference),t;return r(o)}}var kF={name:"labelStartImage",resolveAll:Au.resolveAll,tokenize:RAe};function RAe(e,t,r){let i=this;return n;function n(c){return k(c===b.exclamationMark,"expected `!`"),e.enter(y.labelImage),e.enter(y.labelImageMarker),e.consume(c),e.exit(y.labelImageMarker),o}function o(c){if(c===b.leftSquareBracket)return e.enter(y.labelMarker),e.consume(c),e.exit(y.labelMarker),e.exit(y.labelImage),s;return r(c)}function s(c){return c===b.caret&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):t(c)}}var IF={name:"labelStartLink",resolveAll:Au.resolveAll,tokenize:AAe};function AAe(e,t,r){let i=this;return n;function n(s){return k(s===b.leftSquareBracket,"expected `[`"),e.enter(y.labelLink),e.enter(y.labelMarker),e.consume(s),e.exit(y.labelMarker),e.exit(y.labelLink),o}function o(s){return s===b.caret&&"_hiddenFootnoteSupport"in i.parser.constructs?r(s):t(s)}}var Og={name:"lineEnding",tokenize:_Ae};function _Ae(e,t){return r;function r(i){return k(de(i),"expected eol"),e.enter(y.lineEnding),e.consume(i),e.exit(y.lineEnding),rt(e,t,y.linePrefix)}}var _u={name:"thematicBreak",tokenize:OAe};function OAe(e,t,r){let i=0,n;return o;function o(l){return e.enter(y.thematicBreak),s(l)}function s(l){return k(l===b.asterisk||l===b.dash||l===b.underscore,"expected `*`, `-`, or `_`"),n=l,c(l)}function c(l){if(l===n)return e.enter(y.thematicBreakSequence),u(l);if(i>=ne.thematicBreakMarkerCountMin&&(l===b.eof||de(l)))return e.exit(y.thematicBreak),t(l);return r(l)}function u(l){if(l===n)return e.consume(l),i++,u;return e.exit(y.thematicBreakSequence),Ke(l)?rt(e,c,y.whitespace)(l):c(l)}}var sn={continuation:{tokenize:$Ae},exit:NAe,name:"list",tokenize:FAe},DAe={partial:!0,tokenize:zAe},MAe={partial:!0,tokenize:jAe};function FAe(e,t,r){let i=this,n=i.events[i.events.length-1],o=n&&n[1].type===y.linePrefix?n[2].sliceSerialize(n[1],!0).length:0,s=0;return c;function c(g){k(i.containerState,"expected state");let S=i.containerState.type||(g===b.asterisk||g===b.plusSign||g===b.dash?y.listUnordered:y.listOrdered);if(S===y.listUnordered?!i.containerState.marker||g===i.containerState.marker:Pg(g)){if(!i.containerState.type)i.containerState.type=S,e.enter(S,{_container:!0});if(S===y.listUnordered)return e.enter(y.listItemPrefix),g===b.asterisk||g===b.dash?e.check(_u,r,l)(g):l(g);if(!i.interrupt||g===b.digit1)return e.enter(y.listItemPrefix),e.enter(y.listItemValue),u(g)}return r(g)}function u(g){if(k(i.containerState,"expected state"),Pg(g)&&++s<ne.listItemValueSizeMax)return e.consume(g),u;if((!i.interrupt||s<2)&&(i.containerState.marker?g===i.containerState.marker:g===b.rightParenthesis||g===b.dot))return e.exit(y.listItemValue),l(g);return r(g)}function l(g){return k(i.containerState,"expected state"),k(g!==b.eof,"eof (`null`) is not a marker"),e.enter(y.listItemMarker),e.consume(g),e.exit(y.listItemMarker),i.containerState.marker=i.containerState.marker||g,e.check(Ua,i.interrupt?r:p,e.attempt(DAe,f,m))}function p(g){return k(i.containerState,"expected state"),i.containerState.initialBlankLine=!0,o++,f(g)}function m(g){if(Ke(g))return e.enter(y.listItemPrefixWhitespace),e.consume(g),e.exit(y.listItemPrefixWhitespace),f;return r(g)}function f(g){return k(i.containerState,"expected state"),i.containerState.size=o+i.sliceSerialize(e.exit(y.listItemPrefix),!0).length,t(g)}}function $Ae(e,t,r){let i=this;return k(i.containerState,"expected state"),i.containerState._closeFlow=void 0,e.check(Ua,n,o);function n(c){return k(i.containerState,"expected state"),k(typeof i.containerState.size==="number","expected size"),i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,rt(e,t,y.listItemIndent,i.containerState.size+1)(c)}function o(c){if(k(i.containerState,"expected state"),i.containerState.furtherBlankLines||!Ke(c))return i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(c);return i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(MAe,t,s)(c)}function s(c){return k(i.containerState,"expected state"),i.containerState._closeFlow=!0,i.interrupt=void 0,k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,e.attempt(sn,t,r),y.linePrefix,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize)(c)}}function jAe(e,t,r){let i=this;return k(i.containerState,"expected state"),k(typeof i.containerState.size==="number","expected size"),rt(e,n,y.listItemIndent,i.containerState.size+1);function n(o){k(i.containerState,"expected state");let s=i.events[i.events.length-1];return s&&s[1].type===y.listItemIndent&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?t(o):r(o)}}function NAe(e){k(this.containerState,"expected state"),k(typeof this.containerState.type==="string","expected type"),e.exit(this.containerState.type)}function zAe(e,t,r){let i=this;return k(i.parser.constructs.disable.null,"expected `disable.null` to be populated"),rt(e,n,y.listItemPrefixWhitespace,i.parser.constructs.disable.null.includes("codeIndented")?void 0:ne.tabSize+1);function n(o){let s=i.events[i.events.length-1];return!Ke(o)&&s&&s[1].type===y.listItemPrefixWhitespace?t(o):r(o)}}var Yv={name:"setextUnderline",resolveTo:LAe,tokenize:BAe};function LAe(e,t){let r=e.length,i,n,o;while(r--)if(e[r][0]==="enter"){if(e[r][1].type===y.content){i=r;break}if(e[r][1].type===y.paragraph)n=r}else{if(e[r][1].type===y.content)e.splice(r,1);if(!o&&e[r][1].type===y.definition)o=r}k(n!==void 0,"expected a `text` index to be found"),k(i!==void 0,"expected a `text` index to be found"),k(e[i][2]===t,"enter context should be same"),k(e[e.length-1][2]===t,"enter context should be same");let s={type:y.setextHeading,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};if(e[n][1].type=y.setextHeadingText,o)e.splice(n,0,["enter",s,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end};else e[i][1]=s;return e.push(["exit",s,t]),e}function BAe(e,t,r){let i=this,n;return o;function o(l){let p=i.events.length,m;k(l===b.dash||l===b.equalsTo,"expected `=` or `-`");while(p--)if(i.events[p][1].type!==y.lineEnding&&i.events[p][1].type!==y.linePrefix&&i.events[p][1].type!==y.content){m=i.events[p][1].type===y.paragraph;break}if(!i.parser.lazy[i.now().line]&&(i.interrupt||m))return e.enter(y.setextHeadingLine),n=l,s(l);return r(l)}function s(l){return e.enter(y.setextHeadingLineSequence),c(l)}function c(l){if(l===n)return e.consume(l),c;return e.exit(y.setextHeadingLineSequence),Ke(l)?rt(e,u,y.lineSuffix)(l):u(l)}function u(l){if(l===b.eof||de(l))return e.exit(y.setextHeadingLine),t(l);return r(l)}}var EY={tokenize:UAe};function UAe(e){let t=this,r=e.attempt(Ua,i,e.attempt(this.parser.constructs.flowInitial,n,rt(e,e.attempt(this.parser.constructs.flow,n,e.attempt(hF,n)),y.linePrefix)));return r;function i(o){if(k(o===b.eof||de(o),"expected eol or eof"),o===b.eof){e.consume(o);return}return e.enter(y.lineEndingBlank),e.consume(o),e.exit(y.lineEndingBlank),t.currentConstruct=void 0,r}function n(o){if(k(o===b.eof||de(o),"expected eol or eof"),o===b.eof){e.consume(o);return}return e.enter(y.lineEnding),e.consume(o),e.exit(y.lineEnding),t.currentConstruct=void 0,r}}var CY={resolveAll:_Y()},PY=AY("string"),RY=AY("text");function AY(e){return{resolveAll:_Y(e==="text"?qAe:void 0),tokenize:t};function t(r){let i=this,n=this.parser.constructs[e],o=r.attempt(n,s,c);return s;function s(p){return l(p)?o(p):c(p)}function c(p){if(p===b.eof){r.consume(p);return}return r.enter(y.data),r.consume(p),u}function u(p){if(l(p))return r.exit(y.data),o(p);return r.consume(p),u}function l(p){if(p===b.eof)return!0;let m=n[p],f=-1;if(m){k(Array.isArray(m),"expected `disable.null` to be populated");while(++f<m.length){let g=m[f];if(!g.previous||g.previous.call(i,i.previous))return!0}}return!1}}}function _Y(e){return t;function t(r,i){let n=-1,o;while(++n<=r.length)if(o===void 0){if(r[n]&&r[n][1].type===y.data)o=n,n++}else if(!r[n]||r[n][1].type!==y.data){if(n!==o+2)r[o][1].end=r[n-1][1].end,r.splice(o+2,n-o-2),n=o+2;o=void 0}return e?e(r,i):r}}function qAe(e,t){let r=0;while(++r<=e.length)if((r===e.length||e[r][1].type===y.lineEnding)&&e[r-1][1].type===y.data){let i=e[r-1][1],n=t.sliceStream(i),o=n.length,s=-1,c=0,u;while(o--){let l=n[o];if(typeof l==="string"){s=l.length;while(l.charCodeAt(s-1)===b.space)c++,s--;if(s)break;s=-1}else if(l===b.horizontalTab)u=!0,c++;else if(l===b.virtualSpace);else{o++;break}}if(t._contentTypeTextTrailing&&r===e.length)c=0;if(c){let l={type:r===e.length||u||c<ne.hardBreakPrefixSizeMin?y.lineSuffix:y.hardBreakTrailing,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};if(i.end={...l.start},i.start.offset===i.end.offset)Object.assign(i,l);else e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2}r++}return e}var TF={};pi(TF,{attentionMarkers:()=>QAe,contentInitial:()=>HAe,disable:()=>YAe,document:()=>JAe,flow:()=>ZAe,flowInitial:()=>WAe,insideSpan:()=>KAe,string:()=>VAe,text:()=>GAe});var JAe={[b.asterisk]:sn,[b.plusSign]:sn,[b.dash]:sn,[b.digit0]:sn,[b.digit1]:sn,[b.digit2]:sn,[b.digit3]:sn,[b.digit4]:sn,[b.digit5]:sn,[b.digit6]:sn,[b.digit7]:sn,[b.digit8]:sn,[b.digit9]:sn,[b.greaterThan]:Jv},HAe={[b.leftSquareBracket]:yF},WAe={[b.horizontalTab]:Ag,[b.virtualSpace]:Ag,[b.space]:Ag},ZAe={[b.numberSign]:xF,[b.asterisk]:_u,[b.dash]:[Yv,_u],[b.lessThan]:vF,[b.equalsTo]:Yv,[b.underscore]:_u,[b.graveAccent]:Zv,[b.tilde]:Zv},VAe={[b.ampersand]:Wv,[b.backslash]:Hv},GAe={[b.carriageReturn]:Og,[b.lineFeed]:Og,[b.carriageReturnLineFeed]:Og,[b.exclamationMark]:kF,[b.ampersand]:Wv,[b.asterisk]:Rg,[b.lessThan]:[mF,wF],[b.leftSquareBracket]:IF,[b.backslash]:[bF,Hv],[b.rightSquareBracket]:Au,[b.underscore]:Rg,[b.graveAccent]:fF},KAe={null:[Rg,CY]},QAe={null:[b.asterisk,b.underscore]},YAe={null:[]};var OY=Rs(Uy(),1);var Ou=OY.default("micromark");function DY(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},n={},o=[],s=[],c=[],u=!0,l={attempt:Pe(Be),check:Pe(Te),consume:se,enter:me,exit:F,interrupt:Pe(Te,{interrupt:!0})},p={code:b.eof,containerState:{},defineSkip:L,events:[],now:D,parser:e,previous:b.eof,sliceSerialize:S,sliceStream:P,write:g},m=t.tokenize.call(p,l),f;if(t.resolveAll)o.push(t);return p;function g(ge){if(s=kn(s,ge),Se(),s[s.length-1]!==b.eof)return[];return Je(t,0),p.events=od(o,p.events,p),p.events}function S(ge,xe){return e_e(P(ge),xe)}function P(ge){return XAe(s,ge)}function D(){let{_bufferIndex:ge,_index:xe,line:Me,column:ee,offset:at}=i;return{_bufferIndex:ge,_index:xe,line:Me,column:ee,offset:at}}function L(ge){n[ge.line]=ge.column,He(),Ou("position: define skip: `%j`",i)}function Se(){let ge;while(i._index<s.length){let xe=s[i._index];if(typeof xe==="string"){if(ge=i._index,i._bufferIndex<0)i._bufferIndex=0;while(i._index===ge&&i._bufferIndex<xe.length)Q(xe.charCodeAt(i._bufferIndex))}else Q(xe)}}function Q(ge){k(u===!0,"expected character to be consumed"),u=void 0,Ou("main: passing `%s` to %s",ge,m&&m.name),f=ge,k(typeof m==="function","expected state"),m=m(ge)}function se(ge){if(k(ge===f,"expected given code to equal expected code"),Ou("consume: `%s`",ge),k(u===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),k(ge===null?p.events.length===0||p.events[p.events.length-1][0]==="exit":p.events[p.events.length-1][0]==="enter","expected last token to be open"),de(ge))i.line++,i.column=1,i.offset+=ge===b.carriageReturnLineFeed?2:1,He(),Ou("position: after eol: `%j`",i);else if(ge!==b.virtualSpace)i.column++,i.offset++;if(i._bufferIndex<0)i._index++;else if(i._bufferIndex++,i._bufferIndex===s[i._index].length)i._bufferIndex=-1,i._index++;p.previous=ge,u=!0}function me(ge,xe){let Me=xe||{};return Me.type=ge,Me.start=D(),k(typeof ge==="string","expected string type"),k(ge.length>0,"expected non-empty string"),Ou("enter: `%s`",ge),p.events.push(["enter",Me,p]),c.push(Me),Me}function F(ge){k(typeof ge==="string","expected string type"),k(ge.length>0,"expected non-empty string");let xe=c.pop();return k(xe,"cannot close w/o open tokens"),xe.end=D(),k(ge===xe.type,"expected exit token to match current token"),k(!(xe.start._index===xe.end._index&&xe.start._bufferIndex===xe.end._bufferIndex),"expected non-empty token (`"+ge+"`)"),Ou("exit: `%s`",xe.type),p.events.push(["exit",xe,p]),xe}function Be(ge,xe){Je(ge,xe.from)}function Te(ge,xe){xe.restore()}function Pe(ge,xe){return Me;function Me(ee,at,ft){let cr,w,zt,Fr;return Array.isArray(ee)?ur(ee):("tokenize"in ee)?ur([ee]):I(ee);function I(St){return ht;function ht(Tt){let Ie=Tt!==null&&St[Tt],oe=Tt!==null&&St.null,Ee=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ur(Ee)(Tt)}}function ur(St){if(cr=St,w=0,St.length===0)return k(ft,"expected `bogusState` to be given"),ft;return qt(St[w])}function qt(St){return ht;function ht(Tt){if(Fr=Xe(),zt=St,!St.partial)p.currentConstruct=St;if(k(p.parser.constructs.disable.null,"expected `disable.null` to be populated"),St.name&&p.parser.constructs.disable.null.includes(St.name))return Hr(Tt);return St.tokenize.call(xe?Object.assign(Object.create(p),xe):p,l,En,Hr)(Tt)}}function En(St){return k(St===f,"expected code"),u=!0,ge(zt,Fr),at}function Hr(St){if(k(St===f,"expected code"),u=!0,Fr.restore(),++w<cr.length)return qt(cr[w]);return ft}}}function Je(ge,xe){if(ge.resolveAll&&!o.includes(ge))o.push(ge);if(ge.resolve)qr(p.events,xe,p.events.length-xe,ge.resolve(p.events.slice(xe),p));if(ge.resolveTo)p.events=ge.resolveTo(p.events,p);k(ge.partial||p.events.length===0||p.events[p.events.length-1][0]==="exit","expected last token to end")}function Xe(){let ge=D(),xe=p.previous,Me=p.currentConstruct,ee=p.events.length,at=Array.from(c);return{from:ee,restore:ft};function ft(){i=ge,p.previous=xe,p.currentConstruct=Me,p.events.length=ee,c=at,He(),Ou("position: restore: `%j`",i)}}function He(){if(i.line in n&&i.column<2)i.column=n[i.line],i.offset+=n[i.line]-1}}function XAe(e,t){let r=t.start._index,i=t.start._bufferIndex,n=t.end._index,o=t.end._bufferIndex,s;if(r===n)k(o>-1,"expected non-negative end buffer index"),k(i>-1,"expected non-negative start buffer index"),s=[e[r].slice(i,o)];else{if(s=e.slice(r,n),i>-1){let c=s[0];if(typeof c==="string")s[0]=c.slice(i);else k(i===0,"expected `startBufferIndex` to be `0`"),s.shift()}if(o>0)s.push(e[n].slice(0,o))}return s}function e_e(e,t){let r=-1,i=[],n;while(++r<e.length){let o=e[r],s;if(typeof o==="string")s=o;else switch(o){case b.carriageReturn:{s=ai.cr;break}case b.lineFeed:{s=ai.lf;break}case b.carriageReturnLineFeed:{s=ai.cr+ai.lf;break}case b.horizontalTab:{s=t?ai.space:ai.ht;break}case b.virtualSpace:{if(!t&&n)continue;s=ai.space;break}default:k(typeof o==="number","expected number"),s=String.fromCharCode(o)}n=o===b.horizontalTab,i.push(s)}return i.join("")}function EF(e){let i={constructs:mY([TF,...(e||{}).extensions||[]]),content:n(xY),defined:[],document:n(vY),flow:n(EY),lazy:{},string:n(PY),text:n(RY)};return i;function n(o){return s;function s(c){return DY(i,o,c)}}}function CF(e){while(!Vv(e));return e}var MY=/[\0\t\n\r]/g;function PF(){let e=1,t="",r=!0,i;return n;function n(o,s,c){let u=[],l,p,m,f,g;if(o=t+(typeof o==="string"?o.toString():new TextDecoder(s||void 0).decode(o)),m=0,t="",r){if(o.charCodeAt(0)===b.byteOrderMarker)m++;r=void 0}while(m<o.length){if(MY.lastIndex=m,l=MY.exec(o),f=l&&l.index!==void 0?l.index:o.length,g=o.charCodeAt(f),!l){t=o.slice(m);break}if(g===b.lf&&m===f&&i)u.push(b.carriageReturnLineFeed),i=void 0;else{if(i)u.push(b.carriageReturn),i=void 0;if(m<f)u.push(o.slice(m,f)),e+=f-m;switch(g){case b.nul:{u.push(b.replacementCharacter),e++;break}case b.ht:{p=Math.ceil(e/ne.tabSize)*ne.tabSize,u.push(b.horizontalTab);while(e++<p)u.push(b.virtualSpace);break}case b.lf:{u.push(b.lineFeed),e=1;break}default:i=!0,e=1}}m=f+1}if(c){if(i)u.push(b.carriageReturn);if(t)u.push(t);u.push(b.eof)}return u}}var t_e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xv(e){return e.replace(t_e,r_e)}function r_e(e,t,r){if(t)return t;if(r.charCodeAt(0)===b.numberSign){let n=r.charCodeAt(1),o=n===b.lowercaseX||n===b.uppercaseX;return qv(r.slice(o?2:1),o?ne.numericBaseHexadecimal:ne.numericBaseDecimal)}return nd(r)||e}function qa(e){if(!e||typeof e!=="object")return"";if("position"in e||"type"in e)return FY(e.position);if("start"in e||"end"in e)return FY(e);if("line"in e||"column"in e)return RF(e);return""}function RF(e){return $Y(e&&e.line)+":"+$Y(e&&e.column)}function FY(e){return RF(e&&e.start)+"-"+RF(e&&e.end)}function $Y(e){return e&&typeof e==="number"?e:1}var NY={}.hasOwnProperty;function AF(e,t,r){if(t&&typeof t==="object")r=t,t=void 0;return n_e(r)(CF(EF(r).document().write(PF()(e,t,!0))))}function n_e(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Nu),autolinkProtocol:Pe,autolinkEmail:Pe,atxHeading:o(nr),blockQuote:o(Tt),characterEscape:Pe,characterReference:Pe,codeFenced:o(Ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ie,s),codeText:o(oe,s),codeTextData:Pe,data:Pe,codeFlowValue:Pe,definition:o(Ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(gt),hardBreakEscape:o(hr),hardBreakTrailing:o(hr),htmlFlow:o(Wr,s),htmlFlowData:Pe,htmlText:o(Wr,s),htmlTextData:Pe,image:o(ju),label:s,link:o(Nu),listItem:o(zu),listItemValue:f,listOrdered:o(Ka,m),listUnordered:o(Ka),paragraph:o(wd),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(nr),strong:o(Mi),thematicBreak:o(Lu)},exit:{atxHeading:u(),atxHeadingSequence:me,autolink:u(),autolinkEmail:ht,autolinkProtocol:St,blockQuote:u(),characterEscapeValue:Je,characterReferenceMarkerHexadecimal:qt,characterReferenceMarkerNumeric:qt,characterReferenceValue:En,characterReference:Hr,codeFenced:u(D),codeFencedFence:P,codeFencedFenceInfo:g,codeFencedFenceMeta:S,codeFlowValue:Je,codeIndented:u(L),codeText:u(Me),codeTextData:Je,data:Je,definition:u(),definitionDestinationString:se,definitionLabelString:Se,definitionTitleString:Q,emphasis:u(),hardBreakEscape:u(He),hardBreakTrailing:u(He),htmlFlow:u(ge),htmlFlowData:Je,htmlText:u(xe),htmlTextData:Je,image:u(at),label:cr,labelText:ft,lineEnding:Xe,link:u(ee),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ur,resourceDestinationString:w,resourceTitleString:zt,resource:Fr,setextHeading:u(Te),setextHeadingLineSequence:Be,setextHeadingText:F,strong:u(),thematicBreak:u()}};zY(t,(e||{}).mdastExtensions||[]);let r={};return i;function i(j){let N={type:"root",children:[]},d={stack:[N],tokenStack:[],config:t,enter:c,exit:l,buffer:s,resume:p,data:r},T=[],A=-1;while(++A<j.length)if(j[A][1].type===y.listOrdered||j[A][1].type===y.listUnordered)if(j[A][0]==="enter")T.push(A);else{let z=T.pop();k(typeof z==="number","expected list to be open"),A=n(j,z,A)}A=-1;while(++A<j.length){let z=t[j[A][0]];if(NY.call(z,j[A][1].type))z[j[A][1].type].call(Object.assign({sliceSerialize:j[A][2].sliceSerialize},d),j[A][1])}if(d.tokenStack.length>0){let z=d.tokenStack[d.tokenStack.length-1];(z[1]||jY).call(d,void 0,z[0])}N.position={start:Ja(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:Ja(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},A=-1;while(++A<t.transforms.length)N=t.transforms[A](N)||N;return N}function n(j,N,d){let T=N-1,A=-1,z=!1,M,Z,x,R;while(++T<=d){let J=j[T];switch(J[1].type){case y.listUnordered:case y.listOrdered:case y.blockQuote:{if(J[0]==="enter")A++;else A--;R=void 0;break}case y.lineEndingBlank:{if(J[0]==="enter"){if(M&&!R&&!A&&!x)x=T;R=void 0}break}case y.linePrefix:case y.listItemValue:case y.listItemMarker:case y.listItemPrefix:case y.listItemPrefixWhitespace:break;default:R=void 0}if(!A&&J[0]==="enter"&&J[1].type===y.listItemPrefix||A===-1&&J[0]==="exit"&&(J[1].type===y.listUnordered||J[1].type===y.listOrdered)){if(M){let B=T;Z=void 0;while(B--){let U=j[B];if(U[1].type===y.lineEnding||U[1].type===y.lineEndingBlank){if(U[0]==="exit")continue;if(Z)j[Z][1].type=y.lineEndingBlank,z=!0;U[1].type=y.lineEnding,Z=B}else if(U[1].type===y.linePrefix||U[1].type===y.blockQuotePrefix||U[1].type===y.blockQuotePrefixWhitespace||U[1].type===y.blockQuoteMarker||U[1].type===y.listItemIndent);else break}if(x&&(!Z||x<Z))M._spread=!0;M.end=Object.assign({},Z?j[Z][1].start:J[1].end),j.splice(Z||T,0,["exit",M,J[2]]),T++,d++}if(J[1].type===y.listItemPrefix){let B={type:"listItem",_spread:!1,start:Object.assign({},J[1].start),end:void 0};M=B,j.splice(T,0,["enter",B,J[2]]),T++,d++,x=void 0,R=!0}}}return j[N][1]._spread=z,d}function o(j,N){return d;function d(T){if(c.call(this,j(T),T),N)N.call(this,T)}}function s(){this.stack.push({type:"fragment",children:[]})}function c(j,N,d){let T=this.stack[this.stack.length-1];k(T,"expected `parent`"),k("children"in T,"expected `parent`"),T.children.push(j),this.stack.push(j),this.tokenStack.push([N,d||void 0]),j.position={start:Ja(N.start),end:void 0}}function u(j){return N;function N(d){if(j)j.call(this,d);l.call(this,d)}}function l(j,N){let d=this.stack.pop();k(d,"expected `node`");let T=this.tokenStack.pop();if(!T)throw Error("Cannot close `"+j.type+"` ("+qa({start:j.start,end:j.end})+"): it\u2019s not open");else if(T[0].type!==j.type)if(N)N.call(this,j,T[0]);else(T[1]||jY).call(this,j,T[0]);k(d.type!=="fragment","unexpected fragment `exit`ed"),k(d.position,"expected `position` to be defined"),d.position.end=Ja(j.end)}function p(){return Pu(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function f(j){if(this.data.expectingFirstListItemValue){let N=this.stack[this.stack.length-2];k(N,"expected nodes on stack"),k(N.type==="list","expected list on stack"),N.start=Number.parseInt(this.sliceSerialize(j),ne.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function g(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.lang=j}function S(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.meta=j}function P(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function D(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="code","expected code on stack"),N.value=j.replace(/(\r?\n|\r)$/g,"")}function Se(j){let N=this.resume(),d=this.stack[this.stack.length-1];k(d,"expected node on stack"),k(d.type==="definition","expected definition on stack"),d.label=N,d.identifier=Ts(this.sliceSerialize(j)).toLowerCase()}function Q(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="definition","expected definition on stack"),N.title=j}function se(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="definition","expected definition on stack"),N.url=j}function me(j){let N=this.stack[this.stack.length-1];if(k(N,"expected node on stack"),k(N.type==="heading","expected heading on stack"),!N.depth){let d=this.sliceSerialize(j).length;k(d===1||d===2||d===3||d===4||d===5||d===6,"expected `depth` between `1` and `6`"),N.depth=d}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function Be(j){let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="heading","expected heading on stack"),N.depth=this.sliceSerialize(j).codePointAt(0)===b.equalsTo?1:2}function Te(){this.data.setextHeadingSlurpLineEnding=void 0}function Pe(j){let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k("children"in N,"expected parent on stack");let d=N.children,T=d[d.length-1];if(!T||T.type!=="text")T=kd(),T.position={start:Ja(j.start),end:void 0},d.push(T);this.stack.push(T)}function Je(j){let N=this.stack.pop();k(N,"expected a `node` to be on the stack"),k("value"in N,"expected a `literal` to be on the stack"),k(N.position,"expected `node` to have an open position"),N.value+=this.sliceSerialize(j),N.position.end=Ja(j.end)}function Xe(j){let N=this.stack[this.stack.length-1];if(k(N,"expected `node`"),this.data.atHardBreak){k("children"in N,"expected `parent`");let d=N.children[N.children.length-1];k(d.position,"expected tail to have a starting position"),d.position.end=Ja(j.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(N.type))Pe.call(this,j),Je.call(this,j)}function He(){this.data.atHardBreak=!0}function ge(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="html","expected html on stack"),N.value=j}function xe(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="html","expected html on stack"),N.value=j}function Me(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="inlineCode","expected inline code on stack"),N.value=j}function ee(){let j=this.stack[this.stack.length-1];if(k(j,"expected node on stack"),k(j.type==="link","expected link on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=N,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function at(){let j=this.stack[this.stack.length-1];if(k(j,"expected node on stack"),k(j.type==="image","expected image on stack"),this.data.inReference){let N=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=N,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function ft(j){let N=this.sliceSerialize(j),d=this.stack[this.stack.length-2];k(d,"expected ancestor on stack"),k(d.type==="image"||d.type==="link","expected image or link on stack"),d.label=Xv(N),d.identifier=Ts(N).toLowerCase()}function cr(){let j=this.stack[this.stack.length-1];k(j,"expected node on stack"),k(j.type==="fragment","expected fragment on stack");let N=this.resume(),d=this.stack[this.stack.length-1];if(k(d,"expected node on stack"),k(d.type==="image"||d.type==="link","expected image or link on stack"),this.data.inReference=!0,d.type==="link"){let T=j.children;d.children=T}else d.alt=N}function w(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="image"||N.type==="link","expected image or link on stack"),N.url=j}function zt(){let j=this.resume(),N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="image"||N.type==="link","expected image or link on stack"),N.title=j}function Fr(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ur(j){let N=this.resume(),d=this.stack[this.stack.length-1];k(d,"expected node on stack"),k(d.type==="image"||d.type==="link","expected image reference or link reference on stack"),d.label=N,d.identifier=Ts(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function qt(j){k(j.type==="characterReferenceMarkerNumeric"||j.type==="characterReferenceMarkerHexadecimal"),this.data.characterReferenceType=j.type}function En(j){let N=this.sliceSerialize(j),d=this.data.characterReferenceType,T;if(d)T=qv(N,d===y.characterReferenceMarkerNumeric?ne.numericBaseDecimal:ne.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let z=nd(N);k(z!==!1,"expected reference to decode"),T=z}let A=this.stack[this.stack.length-1];k(A,"expected `node`"),k("value"in A,"expected `node.value`"),A.value+=T}function Hr(j){let N=this.stack.pop();k(N,"expected `node`"),k(N.position,"expected `node.position`"),N.position.end=Ja(j.end)}function St(j){Je.call(this,j);let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="link","expected link on stack"),N.url=this.sliceSerialize(j)}function ht(j){Je.call(this,j);let N=this.stack[this.stack.length-1];k(N,"expected node on stack"),k(N.type==="link","expected link on stack"),N.url="mailto:"+this.sliceSerialize(j)}function Tt(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gt(){return{type:"emphasis",children:[]}}function nr(){return{type:"heading",depth:0,children:[]}}function hr(){return{type:"break"}}function Wr(){return{type:"html",value:""}}function ju(){return{type:"image",title:null,url:"",alt:null}}function Nu(){return{type:"link",title:null,url:"",children:[]}}function Ka(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function zu(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function wd(){return{type:"paragraph",children:[]}}function Mi(){return{type:"strong",children:[]}}function kd(){return{type:"text",value:""}}function Lu(){return{type:"thematicBreak"}}}function Ja(e){return{line:e.line,column:e.column,offset:e.offset}}function zY(e,t){let r=-1;while(++r<t.length){let i=t[r];if(Array.isArray(i))zY(e,i);else i_e(e,i)}}function i_e(e,t){let r;for(r in t)if(NY.call(t,r))switch(r){case"canContainEols":{let i=t[r];if(i)e[r].push(...i);break}case"transforms":{let i=t[r];if(i)e[r].push(...i);break}case"enter":case"exit":{let i=t[r];if(i)Object.assign(e[r],i);break}}}function jY(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+qa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qa({start:t.start,end:t.end})+") is open");else throw Error("Cannot close document, a token (`"+t.type+"`, "+qa({start:t.start,end:t.end})+") is still open")}function ew(e){let t=this;t.parser=r;function r(i){return AF(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var LY={}.hasOwnProperty;function BY(e,t){let r=t||{};function i(n,...o){let{invalid:s,handlers:c}=i;if(n&&LY.call(n,e)){let u=String(n[e]);s=LY.call(c,u)?c[u]:i.unknown}if(s)return s.call(this,n,...o)}return i.handlers=r.handlers||{},i.invalid=r.invalid,i.unknown=r.unknown,i}var o_e={}.hasOwnProperty;function _F(e,t){let r=-1,i;if(t.extensions)while(++r<t.extensions.length)_F(e,t.extensions[r]);for(i in t)if(o_e.call(t,i))switch(i){case"extensions":break;case"unsafe":{UY(e[i],t[i]);break}case"join":{UY(e[i],t[i]);break}case"handlers":{s_e(e[i],t[i]);break}default:e.options[i]=t[i]}return e}function UY(e,t){if(t)e.push(...t)}function s_e(e,t){if(t)Object.assign(e,t)}function qY(e,t,r,i){let n=r.enter("blockquote"),o=r.createTracker(i);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(e,o.current()),a_e);return n(),s}function a_e(e,t,r){return">"+(r?"":" ")+e}function tw(e,t){return JY(e,t.inConstruct,!0)&&!JY(e,t.notInConstruct,!1)}function JY(e,t,r){if(typeof t==="string")t=[t];if(!t||t.length===0)return r;let i=-1;while(++i<t.length)if(e.includes(t[i]))return!0;return!1}function OF(e,t,r,i){let n=-1;while(++n<r.unsafe.length)if(r.unsafe[n].character===`
|
|
198
|
+
`&&tw(r.stack,r.unsafe[n]))return/[ \t]/.test(i.before)?"":" ";return"\\\n"}function HY(e,t){let r=String(e),i=r.indexOf(t),n=i,o=0,s=0;if(typeof t!=="string")throw TypeError("Expected substring");while(i!==-1){if(i===n){if(++o>s)s=o}else o=1;n=i+t.length,i=r.indexOf(t,n)}return s}function Dg(e,t){return Boolean(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function WY(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ZY(e,t,r,i){let n=WY(r),o=e.value||"",s=n==="`"?"GraveAccent":"Tilde";if(Dg(e,r)){let m=r.enter("codeIndented"),f=r.indentLines(o,c_e);return m(),f}let c=r.createTracker(i),u=n.repeat(Math.max(HY(o,n)+1,3)),l=r.enter("codeFenced"),p=c.move(u);if(e.lang){let m=r.enter(`codeFencedLang${s}`);p+=c.move(r.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){let m=r.enter(`codeFencedMeta${s}`);p+=c.move(" "),p+=c.move(r.safe(e.meta,{before:p,after:`
|
|
199
199
|
`,encode:["`"],...c.current()})),m()}if(p+=c.move(`
|
|
200
200
|
`),o)p+=c.move(o+`
|
|
201
|
-
`);return p+=c.move(u),l(),p}function
|
|
202
|
-
`,...u.current()}));if(c(),e.title)c=r.enter(`title${o}`),l+=u.move(" "+n),l+=u.move(r.safe(e.title,{before:l,after:n,...u.current()})),l+=u.move(n),c();return s(),l}function GY(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ui(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ad(e,t,r){let i=id(e),n=id(t);if(i===void 0)return n===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(i===1)return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}DF.peek=
|
|
201
|
+
`);return p+=c.move(u),l(),p}function c_e(e,t,r){return(r?"":" ")+e}function sd(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function VY(e,t,r,i){let n=sd(r),o=n==='"'?"Quote":"Apostrophe",s=r.enter("definition"),c=r.enter("label"),u=r.createTracker(i),l=u.move("[");if(l+=u.move(r.safe(r.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url))c=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">");else c=r.enter("destinationRaw"),l+=u.move(r.safe(e.url,{before:l,after:e.title?" ":`
|
|
202
|
+
`,...u.current()}));if(c(),e.title)c=r.enter(`title${o}`),l+=u.move(" "+n),l+=u.move(r.safe(e.title,{before:l,after:n,...u.current()})),l+=u.move(n),c();return s(),l}function GY(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ui(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ad(e,t,r){let i=id(e),n=id(t);if(i===void 0)return n===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(i===1)return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return n===void 0?{inside:!1,outside:!1}:n===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}DF.peek=u_e;function DF(e,t,r,i){let n=GY(r),o=r.enter("emphasis"),s=r.createTracker(i),c=s.move(n),u=s.move(r.containerPhrasing(e,{after:n,before:c,...s.current()})),l=u.charCodeAt(0),p=ad(i.before.charCodeAt(i.before.length-1),l,n);if(p.inside)u=ui(l)+u.slice(1);let m=u.charCodeAt(u.length-1),f=ad(i.after.charCodeAt(0),m,n);if(f.inside)u=u.slice(0,-1)+ui(m);let g=s.move(n);return o(),r.attentionEncodeSurroundingInfo={after:f.outside,before:p.outside},c+u+g}function u_e(e,t,r){return r.options.emphasis||"*"}var cd=function(e){if(e===null||e===void 0)return m_e;if(typeof e==="function")return rw(e);if(typeof e==="object")return Array.isArray(e)?l_e(e):p_e(e);if(typeof e==="string")return d_e(e);throw Error("Expected function, string, or object as test")};function l_e(e){let t=[],r=-1;while(++r<e.length)t[r]=cd(e[r]);return rw(i);function i(...n){let o=-1;while(++o<t.length)if(t[o].apply(this,n))return!0;return!1}}function p_e(e){let t=e;return rw(r);function r(i){let n=i,o;for(o in e)if(n[o]!==t[o])return!1;return!0}}function d_e(e){return rw(t);function t(r){return r&&r.type===e}}function rw(e){return t;function t(r,i,n){return Boolean(f_e(r)&&e.call(this,r,typeof i==="number"?i:void 0,n||void 0))}}function m_e(){return!0}function f_e(e){return e!==null&&typeof e==="object"&&"type"in e}function KY(e){return"\x1B[33m"+e+"\x1B[39m"}var QY=[],nw=!0,Du=!1,iw="skip";function MF(e,t,r,i){let n;if(typeof t==="function"&&typeof r!=="function")i=r,r=t;else n=t;let o=cd(n),s=i?-1:1;c(e,void 0,[])();function c(u,l,p){let m=u&&typeof u==="object"?u:{};if(typeof m.type==="string"){let g=typeof m.tagName==="string"?m.tagName:typeof m.name==="string"?m.name:void 0;Object.defineProperty(f,"name",{value:"node ("+KY(u.type+(g?"<"+g+">":""))+")"})}return f;function f(){let g=QY,S,P,D;if(!t||o(u,l,p[p.length-1]||void 0)){if(g=g_e(r(u,p)),g[0]===Du)return g}if("children"in u&&u.children){let L=u;if(L.children&&g[0]!==iw){P=(i?L.children.length:-1)+s,D=p.concat(L);while(P>-1&&P<L.children.length){let Se=L.children[P];if(S=c(Se,P,D)(),S[0]===Du)return S;P=typeof S[1]==="number"?S[1]:P+s}}}return g}}}function g_e(e){if(Array.isArray(e))return e;if(typeof e==="number")return[nw,e];return e===null||e===void 0?QY:[e]}function FF(e,t,r,i){let n,o,s;if(typeof t==="function"&&typeof r!=="function")o=void 0,s=t,n=r;else o=t,s=r,n=i;MF(e,o,c,n);function c(u,l){let p=l[l.length-1],m=p?p.children.indexOf(u):void 0;return s(u,m,p)}}function ow(e,t){let r=!1;return FF(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,Du}),Boolean((!e.depth||e.depth<3)&&Pu(e)&&(t.options.setext||r))}function YY(e,t,r,i){let n=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(i);if(ow(e,r)){let p=r.enter("headingSetext"),m=r.enter("phrasing"),f=r.containerPhrasing(e,{...o.current(),before:`
|
|
203
203
|
`,after:`
|
|
204
204
|
`});return m(),p(),f+`
|
|
205
205
|
`+(n===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
206
206
|
`))+1))}let s="#".repeat(n),c=r.enter("headingAtx"),u=r.enter("phrasing");o.move(s+" ");let l=r.containerPhrasing(e,{before:"# ",after:`
|
|
207
|
-
`,...o.current()});if(/^[\t ]/.test(l))l=ui(l.charCodeAt(0))+l.slice(1);if(l=l?s+" "+l:s,r.options.closeAtx)l+=" "+s;return u(),c(),l}$F.peek=
|
|
207
|
+
`,...o.current()});if(/^[\t ]/.test(l))l=ui(l.charCodeAt(0))+l.slice(1);if(l=l?s+" "+l:s,r.options.closeAtx)l+=" "+s;return u(),c(),l}$F.peek=h_e;function $F(e){return e.value||""}function h_e(){return"<"}jF.peek=y_e;function jF(e,t,r,i){let n=sd(r),o=n==='"'?"Quote":"Apostrophe",s=r.enter("image"),c=r.enter("label"),u=r.createTracker(i),l=u.move("![");if(l+=u.move(r.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))c=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">");else c=r.enter("destinationRaw"),l+=u.move(r.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}));if(c(),e.title)c=r.enter(`title${o}`),l+=u.move(" "+n),l+=u.move(r.safe(e.title,{before:l,after:n,...u.current()})),l+=u.move(n),c();return l+=u.move(")"),s(),l}function y_e(){return"!"}NF.peek=b_e;function NF(e,t,r,i){let n=e.referenceType,o=r.enter("imageReference"),s=r.enter("label"),c=r.createTracker(i),u=c.move("!["),l=r.safe(e.alt,{before:u,after:"]",...c.current()});u+=c.move(l+"]["),s();let p=r.stack;r.stack=[],s=r.enter("reference");let m=r.safe(r.associationId(e),{before:u,after:"]",...c.current()});if(s(),r.stack=p,o(),n==="full"||!l||l!==m)u+=c.move(m+"]");else if(n==="shortcut")u=u.slice(0,-1);else u+=c.move("]");return u}function b_e(){return"!"}zF.peek=x_e;function zF(e,t,r){let i=e.value||"",n="`",o=-1;while(new RegExp("(^|[^`])"+n+"([^`]|$)").test(i))n+="`";if(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i)))i=" "+i+" ";while(++o<r.unsafe.length){let s=r.unsafe[o],c=r.compilePattern(s),u;if(!s.atBreak)continue;while(u=c.exec(i)){let l=u.index;if(i.charCodeAt(l)===10&&i.charCodeAt(l-1)===13)l--;i=i.slice(0,l)+" "+i.slice(u.index+1)}}return n+i+n}function x_e(){return"`"}function LF(e,t){let r=Pu(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}BF.peek=S_e;function BF(e,t,r,i){let n=sd(r),o=n==='"'?"Quote":"Apostrophe",s=r.createTracker(i),c,u;if(LF(e,r)){let p=r.stack;r.stack=[],c=r.enter("autolink");let m=s.move("<");return m+=s.move(r.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),c(),r.stack=p,m}c=r.enter("link"),u=r.enter("label");let l=s.move("[");if(l+=s.move(r.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url))u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">");else u=r.enter("destinationRaw"),l+=s.move(r.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}));if(u(),e.title)u=r.enter(`title${o}`),l+=s.move(" "+n),l+=s.move(r.safe(e.title,{before:l,after:n,...s.current()})),l+=s.move(n),u();return l+=s.move(")"),c(),l}function S_e(e,t,r){return LF(e,r)?"<":"["}UF.peek=v_e;function UF(e,t,r,i){let n=e.referenceType,o=r.enter("linkReference"),s=r.enter("label"),c=r.createTracker(i),u=c.move("["),l=r.containerPhrasing(e,{before:u,after:"]",...c.current()});u+=c.move(l+"]["),s();let p=r.stack;r.stack=[],s=r.enter("reference");let m=r.safe(r.associationId(e),{before:u,after:"]",...c.current()});if(s(),r.stack=p,o(),n==="full"||!l||l!==m)u+=c.move(m+"]");else if(n==="shortcut")u=u.slice(0,-1);else u+=c.move("]");return u}function v_e(){return"["}function ud(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function XY(e){let t=ud(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function e8(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function sw(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t8(e,t,r,i){let n=r.enter("list"),o=r.bulletCurrent,s=e.ordered?e8(r):ud(r),c=e.ordered?s==="."?")":".":XY(r),u=t&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!e.ordered){let p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0)u=!0;if(sw(r)===s&&p){let m=-1;while(++m<e.children.length){let f=e.children[m];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}if(u)s=c;r.bulletCurrent=s;let l=r.containerFlow(e,i);return r.bulletLastUsed=s,r.bulletCurrent=o,n(),l}function r8(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function n8(e,t,r,i){let n=r8(r),o=r.bulletCurrent||ud(r);if(t&&t.type==="list"&&t.ordered)o=(typeof t.start==="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+o;let s=o.length+1;if(n==="tab"||n==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))s=Math.ceil(s/4)*4;let c=r.createTracker(i);c.move(o+" ".repeat(s-o.length)),c.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(e,c.current()),p);return u(),l;function p(m,f,g){if(f)return(g?"":" ".repeat(s))+m;return(g?o:o+" ".repeat(s-o.length))+m}}function i8(e,t,r,i){let n=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(e,i);return o(),n(),s}var qF=cd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function o8(e,t,r,i){return(e.children.some(function(s){return qF(s)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function s8(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}JF.peek=w_e;function JF(e,t,r,i){let n=s8(r),o=r.enter("strong"),s=r.createTracker(i),c=s.move(n+n),u=s.move(r.containerPhrasing(e,{after:n,before:c,...s.current()})),l=u.charCodeAt(0),p=ad(i.before.charCodeAt(i.before.length-1),l,n);if(p.inside)u=ui(l)+u.slice(1);let m=u.charCodeAt(u.length-1),f=ad(i.after.charCodeAt(0),m,n);if(f.inside)u=u.slice(0,-1)+ui(m);let g=s.move(n+n);return o(),r.attentionEncodeSurroundingInfo={after:f.outside,before:p.outside},c+u+g}function w_e(e,t,r){return r.options.strong||"*"}function a8(e,t,r,i){return r.safe(e.value,i)}function c8(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function u8(e,t,r){let i=(sw(r)+(r.options.ruleSpaces?" ":"")).repeat(c8(r));return r.options.ruleSpaces?i.slice(0,-1):i}var l8={blockquote:qY,break:OF,code:ZY,definition:VY,emphasis:DF,hardBreak:OF,heading:YY,html:$F,image:jF,imageReference:NF,inlineCode:zF,link:BF,linkReference:UF,list:t8,listItem:n8,paragraph:i8,root:o8,strong:JF,text:a8,thematicBreak:u8};var p8=[k_e];function k_e(e,t,r,i){if(t.type==="code"&&Dg(t,i)&&(e.type==="list"||e.type===t.type&&Dg(e,i)))return!1;if("spread"in r&&typeof r.spread==="boolean"){if(e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&ow(t,i)))return;return r.spread?1:0}}var Mu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],d8=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
208
208
|
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Mu},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
209
209
|
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Mu},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
210
210
|
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Mu},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
@@ -213,14 +213,14 @@ ${l}`,i}},o=e.spanOptions&&"captureStackTrace"in e.spanOptions?e.spanOptions:{ca
|
|
|
213
213
|
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Mu},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Mu},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Mu},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Mu},{atBreak:!0,character:"~"}];function m8(e){if(e.label||!e.identifier)return e.label||"";return Xv(e.identifier)}function f8(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function g8(e,t,r){let i=t.indexStack,n=e.children||[],o=[],s=-1,c=r.before,u;i.push(-1);let l=t.createTracker(r);while(++s<n.length){let p=n[s],m;if(i[i.length-1]=s,s+1<n.length){let S=t.handle.handlers[n[s+1].type];if(S&&S.peek)S=S.peek;m=S?S(n[s+1],e,t,{before:"",after:"",...l.current()}).charAt(0):""}else m=r.after;if(o.length>0&&(c==="\r"||c===`
|
|
214
214
|
`)&&p.type==="html")o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),c=" ",l=t.createTracker(r),l.move(o.join(""));let f=t.handle(p,e,t,{...l.current(),after:m,before:c});if(u&&u===f.slice(0,1))f=ui(u.charCodeAt(0))+f.slice(1);let g=t.attentionEncodeSurroundingInfo;if(t.attentionEncodeSurroundingInfo=void 0,u=void 0,g){if(o.length>0&&g.before&&c===o[o.length-1].slice(-1))o[o.length-1]=o[o.length-1].slice(0,-1)+ui(c.charCodeAt(0));if(g.after)u=m}l.move(f),o.push(f),c=f.slice(-1)}return i.pop(),o.join("")}function h8(e,t,r){let i=t.indexStack,n=e.children||[],o=t.createTracker(r),s=[],c=-1;i.push(-1);while(++c<n.length){let u=n[c];if(i[i.length-1]=c,s.push(o.move(t.handle(u,e,t,{before:`
|
|
215
215
|
`,after:`
|
|
216
|
-
`,...o.current()}))),u.type!=="list")t.bulletLastUsed=void 0;if(c<n.length-1)s.push(o.move(
|
|
216
|
+
`,...o.current()}))),u.type!=="list")t.bulletLastUsed=void 0;if(c<n.length-1)s.push(o.move(I_e(u,n[c+1],e,t)))}return i.pop(),s.join("")}function I_e(e,t,r,i){let n=i.join.length;while(n--){let o=i.join[n](e,t,r,i);if(o===!0||o===1)break;if(typeof o==="number")return`
|
|
217
217
|
`.repeat(1+o);if(o===!1)return`
|
|
218
218
|
|
|
219
219
|
<!---->
|
|
220
220
|
|
|
221
221
|
`}return`
|
|
222
222
|
|
|
223
|
-
`}var
|
|
223
|
+
`}var T_e=/\r?\n|\r/g;function y8(e,t){let r=[],i=0,n=0,o;while(o=T_e.exec(e))s(e.slice(i,o.index)),r.push(o[0]),i=o.index+o[0].length,n++;return s(e.slice(i)),r.join("");function s(c){r.push(t(c,n,!c))}}function x8(e,t,r){let i=(r.before||"")+(t||"")+(r.after||""),n=[],o=[],s={},c=-1;while(++c<e.unsafe.length){let p=e.unsafe[c];if(!tw(e.stack,p))continue;let m=e.compilePattern(p),f;while(f=m.exec(i)){let g="before"in p||Boolean(p.atBreak),S="after"in p,P=f.index+(g?f[1].length:0);if(n.includes(P)){if(s[P].before&&!g)s[P].before=!1;if(s[P].after&&!S)s[P].after=!1}else n.push(P),s[P]={before:g,after:S}}}n.sort(E_e);let u=r.before?r.before.length:0,l=i.length-(r.after?r.after.length:0);c=-1;while(++c<n.length){let p=n[c];if(p<u||p>=l)continue;if(p+1<l&&n[c+1]===p+1&&s[p].after&&!s[p+1].before&&!s[p+1].after||n[c-1]===p-1&&s[p].before&&!s[p-1].before&&!s[p-1].after)continue;if(u!==p)o.push(b8(i.slice(u,p),"\\"));if(u=p,/[!-/:-@[-`{-~]/.test(i.charAt(p))&&(!r.encode||!r.encode.includes(i.charAt(p))))o.push("\\");else o.push(ui(i.charCodeAt(p))),u++}return o.push(b8(i.slice(u,l),r.after)),o.join("")}function E_e(e,t){return e-t}function b8(e,t){let r=/\\(?=[!-/:-@[-`{-~])/g,i=[],n=[],o=e+t,s=-1,c=0,u;while(u=r.exec(o))i.push(u.index);while(++s<i.length){if(c!==i[s])n.push(e.slice(c,i[s]));n.push("\\"),c=i[s]}return n.push(e.slice(c)),n.join("")}function S8(e){let t=e||{},r=t.now||{},i=t.lineShift||0,n=r.line||1,o=r.column||1;return{move:u,current:s,shift:c};function s(){return{now:{line:n,column:o},lineShift:i}}function c(l){i+=l}function u(l){let p=l||"",m=p.split(/\r?\n|\r/g),f=m[m.length-1];return n+=m.length-1,o=m.length===1?o+f.length:1+f.length+i,p}}function HF(e,t){let r=t||{},i={associationId:m8,containerPhrasing:A_e,containerFlow:__e,createTracker:S8,compilePattern:f8,enter:o,handlers:{...l8},handle:void 0,indentLines:y8,indexStack:[],join:[...p8],options:{},safe:O_e,stack:[],unsafe:[...d8]};if(_F(i,r),i.options.tightDefinitions)i.join.push(R_e);i.handle=BY("type",{invalid:C_e,unknown:P_e,handlers:i.handlers});let n=i.handle(e,void 0,i,{before:`
|
|
224
224
|
`,after:`
|
|
225
225
|
`,now:{line:1,column:1},lineShift:0});if(n&&n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13)n+=`
|
|
226
|
-
`;return n;function o(s){return i.stack.push(s),c;function c(){i.stack.pop()}}}function E_e(e){throw Error("Cannot handle value `"+e+"`, expected node")}function C_e(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function P_e(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function R_e(e,t){return g8(e,this,t)}function A_e(e,t){return h8(e,this,t)}function __e(e,t){return x8(this,e,t)}function aw(e){let t=this;t.compiler=r;function r(i){return HF(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function WF(e){if(e)throw e}var dw=Rs(R8(),1);function Mg(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZF(){let e=[],t={run:r,use:i};return t;function r(...n){let o=-1,s=n.pop();if(typeof s!=="function")throw TypeError("Expected function as last argument, not "+s);c(null,...n);function c(u,...l){let p=e[++o],m=-1;if(u){s(u);return}while(++m<n.length)if(l[m]===null||l[m]===void 0)l[m]=n[m];if(n=l,p)A8(p,c)(...l);else s(null,...l)}}function i(n){if(typeof n!=="function")throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function A8(e,t){let r;return i;function i(...s){let c=e.length>s.length,u;if(c)s.push(n);try{u=e.apply(this,s)}catch(l){let p=l;if(c&&r)throw p;return n(p)}if(!c)if(u&&u.then&&typeof u.then==="function")u.then(o,n);else if(u instanceof Error)n(u);else o(u)}function n(s,...c){if(!r)r=!0,t(s,...c)}function o(s){n(null,s)}}class Jr extends Error{constructor(e,t,r){super();if(typeof t==="string")r=t,t=void 0;let i="",n={},o=!1;if(t)if("line"in t&&"column"in t)n={place:t};else if("start"in t&&"end"in t)n={place:t};else if("type"in t)n={ancestors:[t],place:t.position};else n={...t};if(typeof e==="string")i=e;else if(!n.cause&&e)o=!0,i=e.message,n.cause=e;if(!n.ruleId&&!n.source&&typeof r==="string"){let c=r.indexOf(":");if(c===-1)n.ruleId=r;else n.source=r.slice(0,c),n.ruleId=r.slice(c+1)}if(!n.place&&n.ancestors&&n.ancestors){let c=n.ancestors[n.ancestors.length-1];if(c)n.place=c.position}let s=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=qa(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=o&&n.cause&&typeof n.cause.stack==="string"?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jr.prototype.file="";Jr.prototype.name="";Jr.prototype.reason="";Jr.prototype.message="";Jr.prototype.stack="";Jr.prototype.column=void 0;Jr.prototype.line=void 0;Jr.prototype.ancestors=void 0;Jr.prototype.cause=void 0;Jr.prototype.fatal=void 0;Jr.prototype.place=void 0;Jr.prototype.ruleId=void 0;Jr.prototype.source=void 0;import{default as Yi}from"path";import{default as _8}from"process";import{fileURLToPath as O8}from"url";function uw(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var VF=["history","path","basename","stem","extname","dirname"];class lw{constructor(e){let t;if(!e)t={};else if(uw(e))t={path:e};else if(typeof e==="string"||O_e(e))t={value:e};else t=e;this.cwd="cwd"in t?"":_8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;while(++r<VF.length){let n=VF[r];if(n in t&&t[n]!==void 0&&t[n]!==null)this[n]=n==="history"?[...t[n]]:t[n]}let i;for(i in t)if(!VF.includes(i))this[i]=t[i]}get basename(){return typeof this.path==="string"?Yi.basename(this.path):void 0}set basename(e){KF(e,"basename"),GF(e,"basename"),this.path=Yi.join(this.dirname||"",e)}get dirname(){return typeof this.path==="string"?Yi.dirname(this.path):void 0}set dirname(e){D8(this.basename,"dirname"),this.path=Yi.join(e||"",this.basename)}get extname(){return typeof this.path==="string"?Yi.extname(this.path):void 0}set extname(e){if(GF(e,"extname"),D8(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=Yi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){if(uw(e))e=O8(e);if(KF(e,"path"),this.path!==e)this.history.push(e)}get stem(){return typeof this.path==="string"?Yi.basename(this.path,this.extname):void 0}set stem(e){KF(e,"stem"),GF(e,"stem"),this.path=Yi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){let i=this.message(e,t,r);throw i.fatal=!0,i}info(e,t,r){let i=this.message(e,t,r);return i.fatal=void 0,i}message(e,t,r){let i=new Jr(e,t,r);if(this.path)i.name=this.path+":"+i.name,i.file=this.path;return i.fatal=!1,this.messages.push(i),i}toString(e){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function GF(e,t){if(e&&e.includes(Yi.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Yi.sep+"`")}function KF(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function D8(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function O_e(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var M8=function(e){let i=this.constructor.prototype,n=i[e],o=function(){return n.apply(o,arguments)};return Object.setPrototypeOf(o,i),o};var D_e={}.hasOwnProperty;class e$ extends M8{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZF()}copy(){let e=new e$,t=-1;while(++t<this.attachers.length){let r=this.attachers[t];e.use(...r)}return e.data(dw.default(!0,{},this.namespace)),e}data(e,t){if(typeof e==="string"){if(arguments.length===2)return XF("data",this.frozen),this.namespace[e]=t,this;return D_e.call(this.namespace,e)&&this.namespace[e]||void 0}if(e)return XF("data",this.frozen),this.namespace=e,this;return this.namespace}freeze(){if(this.frozen)return this;let e=this;while(++this.freezeIndex<this.attachers.length){let[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;if(r[0]===!0)r[0]=void 0;let i=t.call(e,...r);if(typeof i==="function")this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=pw(e),r=this.parser||this.Parser;return QF("parse",r),r(String(t),t)}process(e,t){let r=this;return this.freeze(),QF("process",this.parser||this.Parser),YF("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(n,o){let s=pw(e),c=r.parse(s);r.run(c,s,function(l,p,m){if(l||!p||!m)return u(l);let f=p,g=r.stringify(f,m);if(F_e(g))m.value=g;else m.result=g;u(l,m)});function u(l,p){if(l||!p)o(l);else if(n)n(p);else k(t,"`done` is defined if `resolve` is not"),t(void 0,p)}}}processSync(e){let t=!1,r;return this.freeze(),QF("processSync",this.parser||this.Parser),YF("processSync",this.compiler||this.Compiler),this.process(e,i),$8("processSync","process",t),k(r,"we either bailed on an error or have a tree"),r;function i(n,o){t=!0,WF(n),r=o}}run(e,t,r){F8(e),this.freeze();let i=this.transformers;if(!r&&typeof t==="function")r=t,t=void 0;return r?n(void 0,r):new Promise(n);function n(o,s){k(typeof t!=="function","`file` can\u2019t be a `done` anymore, we checked");let c=pw(t);i.run(e,c,u);function u(l,p,m){let f=p||e;if(l)s(l);else if(o)o(f);else k(r,"`done` is defined if `resolve` is not"),r(void 0,f,m)}}}runSync(e,t){let r=!1,i;return this.run(e,t,n),$8("runSync","run",r),k(i,"we either bailed on an error or have a tree"),i;function n(o,s){WF(o),i=s,r=!0}}stringify(e,t){this.freeze();let r=pw(t),i=this.compiler||this.Compiler;return YF("stringify",i),F8(e),i(e,r)}use(e,...t){let r=this.attachers,i=this.namespace;if(XF("use",this.frozen),e===null||e===void 0);else if(typeof e==="function")c(e,t);else if(typeof e==="object")if(Array.isArray(e))s(e);else o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function n(u){if(typeof u==="function")c(u,[]);else if(typeof u==="object")if(Array.isArray(u)){let[l,...p]=u;c(l,p)}else o(u);else throw TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(s(u.plugins),u.settings)i.settings=dw.default(!0,i.settings,u.settings)}function s(u){let l=-1;if(u===null||u===void 0);else if(Array.isArray(u))while(++l<u.length){let p=u[l];n(p)}else throw TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,l){let p=-1,m=-1;while(++p<r.length)if(r[p][0]===u){m=p;break}if(m===-1)r.push([u,...l]);else if(l.length>0){let[f,...g]=l,S=r[m][1];if(Mg(S)&&Mg(f))f=dw.default(!0,S,f);r[m]=[u,f,...g]}}}}var t$=new e$().freeze();function QF(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `parser`")}function YF(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `compiler`")}function XF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function F8(e){if(!Mg(e)||typeof e.type!=="string")throw TypeError("Expected node, got `"+e+"`")}function $8(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function pw(e){return M_e(e)?e:new lw(e)}function M_e(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function F_e(e){return typeof e==="string"||$_e(e)}function $_e(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var mw=t$().use(ew).use(aw).freeze();var att=mw();var j8=a.object({audiences:a.array(a.string()).optional(),positioning:a.string().optional()}),N8=a.object({summary:a.string().optional(),traits:a.array(a.string()).optional(),principles:a.array(a.string()).optional(),preferredTerms:a.array(a.string()).optional(),avoid:a.array(a.string()).optional()}),z8=a.object({artDirection:a.string().optional(),palette:a.array(a.string()).optional(),composition:a.string().optional(),mood:a.string().optional(),preferred:a.array(a.string()).optional(),avoid:a.array(a.string()).optional()}),N_e=a.object({name:a.string().describe("Style guide name"),messaging:j8.optional(),voice:N8.optional(),visual:z8.optional()});var z_e=a.object({id:a.string().min(1),trigger:a.string().min(1),playbookId:a.string().min(1),once:a.boolean().default(!0),starterText:a.string().min(1),description:a.string().min(1).optional(),starterPrompt:a.string().min(1)}).strict();var r$=a.object({message:a.string().describe("Natural language response to the query"),summary:a.string().optional().describe("Brief summary if applicable"),topics:a.array(a.string()).optional().describe("Related topics mentioned"),sources:a.array(a.object({id:a.string(),type:a.string(),excerpt:a.string().optional(),relevance:a.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:a.record(a.string(),a.unknown()).optional()}).describe("defaultQueryResponse"),L8=a.object({message:a.string()}).describe("simpleTextResponse"),n$=a.object({success:a.boolean(),entityId:a.string().optional(),message:a.string()}).describe("createEntityResponse"),i$=a.object({success:a.boolean(),entityId:a.string(),changes:a.array(a.string()).optional(),message:a.string()}).describe("updateEntityResponse");var B8=a.discriminatedUnion("type",[a.strictObject({type:a.literal("email"),address:a.email()})]),L_e=a.strictObject({recipient:B8.optional(),title:a.string().min(1),body:a.string().min(1),html:a.string().min(1).optional(),sensitivity:a.enum(["normal","secret"]).default("normal"),idempotencyKey:a.string().trim().min(1).max(200).optional()}),B_e=a.discriminatedUnion("status",[a.strictObject({status:a.literal("sent"),deliveryId:a.string().optional()}),a.strictObject({status:a.literal("failed")})]);var V_e=a.object({enabled:a.boolean().describe("Whether the plugin is enabled"),debug:a.boolean().describe("Enable debug logging for this plugin")});var Ert=a.object({toolName:a.string(),args:a.unknown(),progressToken:a.union([a.string(),a.number()]).optional(),hasProgress:a.boolean().optional(),interfaceType:a.string(),actor:si,displayName:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),runId:a.string().optional(),toolCallId:a.string().optional(),userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional(),signal:a.custom((e)=>e instanceof AbortSignal).optional()}),Crt=a.object({resourceUri:a.string()});var Q8=a.object({id:a.string(),template:a.string(),content:a.unknown().optional(),dataQuery:a.looseObject({entityType:a.string().optional(),template:a.string().optional(),query:a.looseObject({id:a.string().optional(),limit:a.number().optional(),offset:a.number().optional()}).optional()}).optional(),order:a.number().optional()}),a$=["primary","secondary"],Y8=a.object({show:a.boolean().default(!1),label:a.string().optional(),slot:a.enum(a$).default("primary"),priority:a.number().min(0).max(100).default(50)}).optional(),c$=a.object({id:a.string(),path:a.string(),title:a.string().default(""),pageLabel:a.string().optional(),description:a.string().default(""),sections:a.array(Q8).default([]),layout:a.string().default("default"),fullscreen:a.boolean().optional(),pluginId:a.string().optional(),sourceEntityType:a.string().optional(),external:a.boolean().optional(),navigation:Y8}),X8=a.object({routes:a.array(c$),pluginId:a.string()}),e7=a.object({paths:a.array(a.string()).optional(),pluginId:a.string().optional()}),t7=a.object({pluginId:a.string().optional()}),r7=a.object({path:a.string()}),gw=a.object({label:a.string(),href:a.string(),priority:a.number()});var u$=a.object({heading:a.string().describe("Main CTA heading text"),buttonText:a.string().describe("Call-to-action button text"),buttonLink:a.string().describe("URL or anchor for the CTA button")}),n7=a.object({blurb:a.string().optional().describe("Short italic subtitle under the section title")}),hw=a.object({represents:a.enum(["brain","anchor"]).default("anchor").describe("Identity represented by the site"),title:a.string().describe("The site's title"),description:a.string().describe("The site's description"),url:a.string().optional().describe("Canonical site URL"),copyright:a.string().optional().describe("Copyright notice text"),logo:a.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:a.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:a.string().optional().describe("Analytics script HTML"),cta:u$.optional().describe("Call-to-action configuration"),sections:a.record(a.string(),n7).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")});var K_e=a.object({platform:a.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:a.string().describe("Profile or contact URL"),label:a.string().optional().describe("Optional display label")}),Q_e=hw.extend({copyright:a.string(),navigation:a.object({primary:a.array(gw),secondary:a.array(gw)}),socialLinks:a.array(K_e).optional().describe("Social media links from profile metadata")});var Frt=a.record(a.string(),a.unknown());var Urt=a.object({message:a.string()});var Yrt=a.record(a.string(),a.unknown());var tnt=a.record(a.string(),a.unknown());var aOe=a.object({slug:a.string(),title:a.string(),type:a.string(),entityId:a.string(),contentHash:a.string()});var cOe=hw.omit({url:!0,analyticsScript:!0}),uOe=cOe.extend({title:a.string().optional().describe("Optional site title override"),description:a.string().optional().describe("Optional site description override")});var o7=["primary","secondary"];var lOe=a.custom((e)=>typeof e==="function","Expected a Preact component"),pOe=a.strictObject({show:a.boolean().optional(),label:a.string().min(1).optional(),slot:a.enum(o7).optional(),priority:a.number().optional()}),dOe=a.strictObject({id:a.string().min(1),template:a.string().min(1),content:a.unknown().optional(),dataQuery:a.looseObject({entityType:a.string().optional(),template:a.string().optional(),query:a.record(a.string(),a.unknown()).optional()}).optional(),order:a.number().optional()}),mOe=a.strictObject({id:a.string().min(1),path:a.string().startsWith("/"),title:a.string().optional(),pageLabel:a.string().optional(),description:a.string().optional(),sections:a.array(dOe).optional(),layout:a.string().min(1).optional(),fullscreen:a.boolean().optional(),pluginId:a.string().optional(),sourceEntityType:a.string().optional(),external:a.boolean().optional(),navigation:pOe.optional()}),fOe=a.strictObject({label:a.string().min(1),pluralName:a.string().min(1).optional(),layout:a.string().min(1).optional(),paginate:a.boolean().optional(),pageSize:a.number().int().positive().optional(),navigation:a.strictObject({show:a.boolean().optional(),slot:a.enum(o7).optional(),priority:a.number().optional()}).optional()}),gOe=a.strictObject({schema:a.custom((e)=>e instanceof a.ZodType,"Expected a Zod schema"),component:a.custom((e)=>typeof e==="function","Expected a Preact component"),title:a.string().min(1),description:a.string(),requiredPermission:a.enum(["admin","trusted","public"]).optional(),fullscreen:a.boolean().optional()}),i7=a.strictObject({namespace:a.string().min(1),sections:a.record(a.string(),gOe)}),hOe=a.record(a.string(),a.json()),yOe=a.record(a.string(),a.record(a.string(),hOe)),s7=a.strictObject({layouts:a.record(a.string(),lOe).refine((e)=>typeof e.default==="function",{message:'Site layouts must include a "default" component'}),routes:a.array(mOe),content:yOe.optional(),sections:a.union([i7,a.array(i7)]).optional(),themeOverride:a.string().optional(),headScripts:a.array(a.string()).optional(),entityDisplay:a.record(a.string(),fOe),staticAssets:a.record(a.string(),a.string()).optional()}).superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.routes.entries()){if(r.has(s.id))t.addIssue({code:"custom",path:["routes",o,"id"],message:`Duplicate route id "${s.id}"`});r.add(s.id);let c=s.layout??"default";if(!e.layouts[c])t.addIssue({code:"custom",path:["routes",o,"layout"],message:`Unknown layout "${c}"`})}let i=Array.isArray(e.sections)?e.sections:e.sections?[e.sections]:[],n=new Map(i.map((o)=>[o.namespace,o]));if(n.size!==i.length)t.addIssue({code:"custom",path:["sections"],message:"Section group namespaces must be unique"});for(let[o,s]of Object.entries(e.content??{})){let c=n.get(o);if(!c){t.addIssue({code:"custom",path:["content",o],message:`Content namespace "${o}" has no section group`});continue}for(let[u,l]of Object.entries(s)){let p=c.sections[u];if(!p){t.addIssue({code:"custom",path:["content",o,u],message:`Content section "${o}.${u}" is not defined`});continue}let m=p.schema.safeParse(l);if(!m.success)t.addIssue({code:"custom",path:["content",o,u],message:`Content does not satisfy the "${o}.${u}" schema: ${a.prettifyError(m.error)}`})}}});var bOe=a.string();function xOe(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var SOe=a.custom((e)=>{if(!xOe(e))return!1;let{plugin:t,...r}=e;if(t!==void 0&&typeof t!=="function")return!1;return s7.safeParse(r).success});var p$=a.enum(["file_operations","content_operations","data_processing","batch_processing"]),wOe=a.object({pluginId:a.string().optional(),progressToken:a.union([a.string(),a.number()]).optional(),operationType:p$,operationTarget:a.string().optional(),interfaceType:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),requestedByActor:si.optional(),requestedByUserId:a.string().optional(),requestedByInterface:a.string().optional(),silent:a.boolean().optional(),provenance:Zp.optional()}),ld=a.object({pluginId:a.string().optional(),progressToken:a.union([a.string(),a.number()]).optional(),operationType:p$,operationTarget:a.string().optional(),interfaceType:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),requestedByActor:si.optional(),requestedByUserId:a.string().optional(),requestedByInterface:a.string().optional(),silent:a.boolean().optional(),provenance:Zp.optional(),rootJobId:a.string()}),Sit=a.enum(["none","skip","replace","coalesce"]);var kOe=a.object({id:a.string(),type:a.string(),data:a.string(),status:a.enum(["pending","processing","completed","failed"]),source:a.string().nullable(),priority:a.number(),retryCount:a.number(),maxRetries:a.number(),lastError:a.string().nullable(),createdAt:a.number(),scheduledFor:a.number(),startedAt:a.number().nullable(),completedAt:a.number().nullable(),attemptId:a.string().nullable(),workerSlotId:a.string().nullable(),workerSessionId:a.string().nullable(),leaseExpiresAt:a.number().nullable(),attemptHeartbeatAt:a.number().nullable(),runtimeUpdatedAt:a.number().nullable(),metadata:ld,progress:a.custom((e)=>typeof e==="object"&&e!==null&&("progress"in e)&&typeof e.progress==="number").nullable(),result:a.unknown().nullable().optional()});var d$=a.enum(["pending","processing","completed","failed"]),a7=a.enum(["completed","failed"]);var IOe=a.object({id:a.string(),type:a.string(),status:d$,data:a.unknown(),result:a.unknown().optional(),lastError:a.string().optional().nullable(),attempts:a.number(),maxRetries:a.number(),priority:a.number(),createdAt:a.date(),updatedAt:a.date(),processedAt:a.date().optional().nullable(),completedAt:a.date().optional().nullable(),failedAt:a.date().optional().nullable()}),TOe=a.object({jobId:a.string(),type:a.string(),status:a7,result:a.unknown().optional(),error:a.string().optional()}),c7=a.object({success:a.literal(!1),error:a.string().optional()}),m$=a.object({id:a.string(),type:a.enum(["job","batch"]),status:d$,message:a.string().optional(),progress:a.object({current:a.number(),total:a.number(),percentage:a.number()}).optional(),aggregationKey:a.string().optional(),batchDetails:a.object({totalOperations:a.number(),completedOperations:a.number(),failedOperations:a.number(),currentOperation:a.string().optional(),errors:a.array(a.string()).optional()}).optional(),jobDetails:a.object({jobType:a.string(),priority:a.number(),retryCount:a.number()}).optional(),metadata:ld});import{createClient as Sst}from"@libsql/client";var ie=Symbol.for("drizzle:entityKind");function an(e,t){if(!e||typeof e!=="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,ie))throw 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 r=Object.getPrototypeOf(e).constructor;if(r)while(r){if(ie in r&&r[ie]===t[ie])return!0;r=Object.getPrototypeOf(r)}return!1}class Ha{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[ie]="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(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class $g{static[ie]="ColumnBuilder";config;constructor(e,t,r){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){if(this.config.name!=="")return;this.config.name=e}}var Jn=Symbol.for("drizzle:Name");class f${static[ie]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){if(this.reference=()=>{let{name:r,columns:i,foreignColumns:n}=e();return{name:r,columns:i,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e===void 0?"no action":e,this}onDelete(e){return this._onDelete=e===void 0?"no action":e,this}build(e){return new u7(e,this)}}class u7{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[ie]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map((s)=>s.name),n=r.map((s)=>s.name),o=[this.table[Jn],...i,r[0].table[Jn],...n];return e??`${o.join("_")}_fk`}}function yw(e,...t){return e(...t)}function g$(e,t){return`${e[Jn]}_${t.join("_")}_unique`}class l7{constructor(e,t){this.name=t,this.columns=e}static[ie]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new p7(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class EOe{static[ie]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new l7(e,this.name)}}class p7{constructor(e,t,r,i){this.table=e,this.columns=t,this.name=i??g$(this.table,this.columns.map((n)=>n.name)),this.nullsNotDistinct=r}static[ie]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}}function d7(e,t,r){for(let i=t;i<e.length;i++){let n=e[i];if(n==="\\"){i++;continue}if(n==='"')return[e.slice(t,i).replace(/\\/g,""),i+1];if(r)continue;if(n===","||n==="}")return[e.slice(t,i).replace(/\\/g,""),i]}return[e.slice(t).replace(/\\/g,""),e.length]}function m7(e,t=0){let r=[],i=t,n=!1;while(i<e.length){let o=e[i];if(o===","){if(n||i===t)r.push("");n=!0,i++;continue}if(n=!1,o==="\\"){i+=2;continue}if(o==='"'){let[u,l]=d7(e,i+1,!0);r.push(u),i=l;continue}if(o==="}")return[r,i+1];if(o==="{"){let[u,l]=m7(e,i+1);r.push(u),i=l;continue}let[s,c]=d7(e,i,!1);r.push(s),i=c}return[r,i]}function f7(e){let[t]=m7(e,1);return t}function h$(e){return`{${e.map((t)=>{if(Array.isArray(t))return h$(t);if(typeof t==="string")return`"${t.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${t}`}).join(",")}}`}class jg extends $g{foreignKeyConfigs=[];static[ie]="PgColumnBuilder";array(e){return new h7(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>yw((n,o)=>{let s=new f$(()=>{let c=n();return{columns:[e],foreignColumns:[c]}});if(o.onUpdate)s.onUpdate(o.onUpdate);if(o.onDelete)s.onDelete(o.onDelete);return s.build(t)},r,i))}buildExtraConfigColumn(e){return new g7(e,this.config)}}class pd extends Ha{constructor(e,t){if(!t.uniqueName)t.uniqueName=g$(e,[t.name]);super(e,t);this.table=e}static[ie]="PgColumn"}class g7 extends pd{static[ie]="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(e){return this.indexConfig.opClass=e,this}}class COe{static[ie]="IndexedColumn";constructor(e,t,r,i){this.name=e,this.keyAsName=t,this.type=r,this.indexConfig=i}name;keyAsName;type;indexConfig}class h7 extends jg{static[ie]="PgArrayBuilder";constructor(e,t,r){super(e,"array","PgArray");this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new y$(e,this.config,t)}}class y$ extends pd{constructor(e,t,r,i){super(e,t);this.baseColumn=r,this.range=i,this.size=t.size}size;static[ie]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(e){if(typeof e==="string")e=f7(e);return e.map((t)=>this.baseColumn.mapFromDriverValue(t))}mapToDriverValue(e,t=!1){let r=e.map((i)=>i===null?null:an(this.baseColumn,y$)?this.baseColumn.mapToDriverValue(i,!0):this.baseColumn.mapToDriverValue(i));if(t)return r;return h$(r)}}class POe extends jg{static[ie]="PgEnumObjectColumnBuilder";constructor(e,t){super(e,"string","PgEnumObjectColumn");this.config.enum=t}build(e){return new b7(e,this.config)}}class b7 extends pd{static[ie]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}}var y7=Symbol.for("drizzle:isPgEnum");function x7(e){return!!e&&typeof e==="function"&&y7 in e&&e[y7]===!0}class ROe extends jg{static[ie]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn");this.config.enum=t}build(e){return new S7(e,this.config)}}class S7 extends pd{static[ie]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}}class Ng{static[ie]="Subquery";constructor(e,t,r,i=!1,n=[]){this._={brand:"Subquery",sql:e,selectedFields:t,alias:r,isWith:i,usedTables:n}}}class AOe extends Ng{static[ie]="WithSubquery"}var v7="0.45.2";var b$,x$,w7={startActiveSpan(e,t){if(!b$)return t();if(!x$)x$=b$.trace.getTracer("drizzle-orm",v7);return yw((r,i)=>i.startActiveSpan(e,(n)=>{try{return t(n)}catch(o){throw n.setStatus({code:r.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{n.end()}}),b$,x$)}};var dd=Symbol.for("drizzle:ViewBaseConfig");var S$=Symbol.for("drizzle:Schema"),k7=Symbol.for("drizzle:Columns"),I7=Symbol.for("drizzle:ExtraConfigColumns"),v$=Symbol.for("drizzle:OriginalName"),w$=Symbol.for("drizzle:BaseName"),zg=Symbol.for("drizzle:IsAlias"),T7=Symbol.for("drizzle:ExtraConfigBuilder"),_Oe=Symbol.for("drizzle:IsDrizzleTable");class fr{static[ie]="Table";static Symbol={Name:Jn,Schema:S$,OriginalName:v$,Columns:k7,ExtraConfigColumns:I7,BaseName:w$,IsAlias:zg,ExtraConfigBuilder:T7};[Jn];[v$];[S$];[k7];[I7];[w$];[zg]=!1;[_Oe]=!0;[T7]=void 0;constructor(e,t,r){this[Jn]=this[v$]=e,this[S$]=t,this[w$]=r}}class OOe{static[ie]="FakePrimitiveParam"}function DOe(e){return e!==null&&e!==void 0&&typeof e.getSQL==="function"}function MOe(e){let t={sql:"",params:[]};for(let r of e)if(t.sql+=r.sql,t.params.push(...r.params),r.typings?.length){if(!t.typings)t.typings=[];t.typings.push(...r.typings)}return t}class Di{static[ie]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new gr([this])}}class gr{constructor(e){this.queryChunks=e;for(let t of e)if(an(t,fr)){let r=t[fr.Symbol.Schema];this.usedTables.push(r===void 0?t[fr.Symbol.Name]:r+"."+t[fr.Symbol.Name])}}static[ie]="SQL";decoder=E7;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return w7.startActiveSpan("drizzle.buildSQL",(t)=>{let r=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,t){let r=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{casing:i,escapeName:n,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:u}=r;return MOe(e.map((l)=>{if(an(l,Di))return{sql:l.value.join(""),params:[]};if(an(l,bw))return{sql:n(l.value),params:[]};if(l===void 0)return{sql:"",params:[]};if(Array.isArray(l)){let p=[new Di("(")];for(let[m,f]of l.entries())if(p.push(f),m<l.length-1)p.push(new Di(", "));return p.push(new Di(")")),this.buildQueryFromSourceParams(p,r)}if(an(l,gr))return this.buildQueryFromSourceParams(l.queryChunks,{...r,inlineParams:c||l.shouldInlineParams});if(an(l,fr)){let p=l[fr.Symbol.Schema],m=l[fr.Symbol.Name];return{sql:p===void 0||l[zg]?n(m):n(p)+"."+n(m),params:[]}}if(an(l,Ha)){let p=i.getColumnCasing(l);if(t.invokeSource==="indexes")return{sql:n(p),params:[]};let m=l.table[fr.Symbol.Schema];return{sql:l.table[zg]||m===void 0?n(l.table[fr.Symbol.Name])+"."+n(p):n(m)+"."+n(l.table[fr.Symbol.Name])+"."+n(p),params:[]}}if(an(l,P7)){let p=l[dd].schema,m=l[dd].name;return{sql:p===void 0||l[dd].isAlias?n(m):n(p)+"."+n(m),params:[]}}if(an(l,k$)){if(an(l.value,xw))return{sql:o(u.value++,l),params:[l],typings:["none"]};let p=l.value===null?null:l.encoder.mapToDriverValue(l.value);if(an(p,gr))return this.buildQueryFromSourceParams([p],r);if(c)return{sql:this.mapInlineParam(p,r),params:[]};let m=["none"];if(s)m=[s(l.encoder)];return{sql:o(u.value++,p),params:[p],typings:m}}if(an(l,xw))return{sql:o(u.value++,l),params:[l],typings:["none"]};if(an(l,gr.Aliased)&&l.fieldAlias!==void 0)return{sql:n(l.fieldAlias),params:[]};if(an(l,Ng)){if(l._.isWith)return{sql:n(l._.alias),params:[]};return this.buildQueryFromSourceParams([new Di("("),l._.sql,new Di(") "),new bw(l._.alias)],r)}if(x7(l)){if(l.schema)return{sql:n(l.schema)+"."+n(l.enumName),params:[]};return{sql:n(l.enumName),params:[]}}if(DOe(l)){if(l.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([l.getSQL()],r);return this.buildQueryFromSourceParams([new Di("("),l.getSQL(),new Di(")")],r)}if(c)return{sql:this.mapInlineParam(l,r),params:[]};return{sql:o(u.value++,l),params:[l],typings:["none"]}}))}mapInlineParam(e,{escapeString:t}){if(e===null)return"null";if(typeof e==="number"||typeof e==="boolean")return e.toString();if(typeof e==="string")return t(e);if(typeof e==="object"){let r=e.toString();if(r==="[object Object]")return t(JSON.stringify(e));return t(r)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){if(e===void 0)return this;return new gr.Aliased(this,e)}mapWith(e){return this.decoder=typeof e==="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class bw{constructor(e){this.value=e}static[ie]="Name";brand;getSQL(){return new gr([this])}}var E7={mapFromDriverValue:(e)=>e},C7={mapToDriverValue:(e)=>e},hot={...E7,...C7};class k${constructor(e,t=C7){this.value=e,this.encoder=t}static[ie]="Param";brand;getSQL(){return new gr([this])}}function Fu(e,...t){let r=[];if(t.length>0||e.length>0&&e[0]!=="")r.push(new Di(e[0]));for(let[i,n]of t.entries())r.push(n,new Di(e[i+1]));return new gr(r)}((e)=>{function t(){return new gr([])}e.empty=t;function r(u){return new gr(u)}e.fromList=r;function i(u){return new gr([new Di(u)])}e.raw=i;function n(u,l){let p=[];for(let[m,f]of u.entries()){if(m>0&&l!==void 0)p.push(l);p.push(f)}return new gr(p)}e.join=n;function o(u){return new bw(u)}e.identifier=o;function s(u){return new xw(u)}e.placeholder=s;function c(u,l){return new k$(u,l)}e.param=c})(Fu||(Fu={}));((e)=>{class t{constructor(r,i){this.sql=r,this.fieldAlias=i}static[ie]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(gr||(gr={}));class xw{constructor(e){this.name=e}static[ie]="Placeholder";getSQL(){return new gr([this])}}var FOe=Symbol.for("drizzle:IsDrizzleView");class P7{static[ie]="View";[dd];[FOe]=!0;constructor({name:e,schema:t,selectedFields:r,query:i}){this[dd]={name:e,originalName:e,schema:t,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new gr([this])}}Ha.prototype.getSQL=function(){return new gr([this])};fr.prototype.getSQL=function(){return new gr([this])};Ng.prototype.getSQL=function(){return new gr([this])};function Ro(e,t){return{name:typeof e==="string"&&e.length>0?e:"",config:typeof e==="object"?e:t}}var I$=typeof TextDecoder>"u"?null:new TextDecoder;class T${static[ie]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){if(this.reference=()=>{let{name:r,columns:i,foreignColumns:n}=e();return{name:r,columns:i,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new R7(e,this)}}class R7{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[ie]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map((s)=>s.name),n=r.map((s)=>s.name),o=[this.table[Jn],...i,r[0].table[Jn],...n];return e??`${o.join("_")}_fk`}}function E$(e,t){return`${e[Jn]}_${t.join("_")}_unique`}class A7{constructor(e,t){this.name=t,this.columns=e}static[ie]="SQLiteUniqueConstraintBuilder";columns;build(e){return new _7(e,this.columns,this.name)}}class $Oe{static[ie]="SQLiteUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new A7(e,this.name)}}class _7{constructor(e,t,r){this.table=e,this.columns=t,this.name=r??E$(this.table,this.columns.map((i)=>i.name))}static[ie]="SQLiteUniqueConstraint";columns;name;getName(){return this.name}}class Or extends $g{static[ie]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>((n,o)=>{let s=new T$(()=>{let c=n();return{columns:[e],foreignColumns:[c]}});if(o.onUpdate)s.onUpdate(o.onUpdate);if(o.onDelete)s.onDelete(o.onDelete);return s.build(t)})(r,i))}}class Dr extends Ha{constructor(e,t){if(!t.uniqueName)t.uniqueName=E$(e,[t.name]);super(e,t);this.table=e}static[ie]="SQLiteColumn"}class O7 extends Or{static[ie]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new D7(e,this.config)}}class D7 extends Dr{static[ie]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString("utf8"))}return BigInt(I$.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class M7 extends Or{static[ie]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new F7(e,this.config)}}class F7 extends Dr{static[ie]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString("utf8"))}return JSON.parse(I$.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class $7 extends Or{static[ie]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new j7(e,this.config)}}class j7 extends Dr{static[ie]="SQLiteBlobBuffer";mapFromDriverValue(e){if(Buffer.isBuffer(e))return e;return Buffer.from(e)}getSQLType(){return"blob"}}function N7(e,t){let{name:r,config:i}=Ro(e,t);if(i?.mode==="json")return new M7(r);if(i?.mode==="bigint")return new O7(r);return new $7(r)}class z7 extends Or{static[ie]="SQLiteCustomColumnBuilder";constructor(e,t,r){super(e,"custom","SQLiteCustomColumn");this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new L7(e,this.config)}}class L7 extends Dr{static[ie]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t);this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom==="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo==="function"?this.mapTo(e):e}}function Sw(e){return(t,r)=>{let{name:i,config:n}=Ro(t,r);return new z7(i,n,e)}}class vw extends Or{static[ie]="SQLiteBaseIntegerBuilder";constructor(e,t,r){super(e,t,r);this.config.autoIncrement=!1}primaryKey(e){if(e?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}}class ww extends Dr{static[ie]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class B7 extends vw{static[ie]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new U7(e,this.config)}}class U7 extends ww{static[ie]="SQLiteInteger"}class q7 extends vw{static[ie]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp");this.config.mode=t}defaultNow(){return this.default(Fu`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new J7(e,this.config)}}class J7 extends ww{static[ie]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){if(this.config.mode==="timestamp")return new Date(e*1000);return new Date(e)}mapToDriverValue(e){let t=e.getTime();if(this.config.mode==="timestamp")return Math.floor(t/1000);return t}}class H7 extends vw{static[ie]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean");this.config.mode=t}build(e){return new W7(e,this.config)}}class W7 extends ww{static[ie]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}}function je(e,t){let{name:r,config:i}=Ro(e,t);if(i?.mode==="timestamp"||i?.mode==="timestamp_ms")return new q7(r,i.mode);if(i?.mode==="boolean")return new H7(r,i.mode);return new B7(r)}class Z7 extends Or{static[ie]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new V7(e,this.config)}}class V7 extends Dr{static[ie]="SQLiteNumeric";mapFromDriverValue(e){if(typeof e==="string")return e;return String(e)}getSQLType(){return"numeric"}}class G7 extends Or{static[ie]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new K7(e,this.config)}}class K7 extends Dr{static[ie]="SQLiteNumericNumber";mapFromDriverValue(e){if(typeof e==="number")return e;return Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class Q7 extends Or{static[ie]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new Y7(e,this.config)}}class Y7 extends Dr{static[ie]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function X7(e,t){let{name:r,config:i}=Ro(e,t),n=i?.mode;return n==="number"?new G7(r):n==="bigint"?new Q7(r):new Z7(r)}class eX extends Or{static[ie]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new tX(e,this.config)}}class tX extends Dr{static[ie]="SQLiteReal";getSQLType(){return"real"}}function rX(e){return new eX(e??"")}class nX extends Or{static[ie]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText");this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new iX(e,this.config)}}class iX extends Dr{static[ie]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class oX extends Or{static[ie]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new sX(e,this.config)}}class sX extends Dr{static[ie]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function X(e,t={}){let{name:r,config:i}=Ro(e,t);if(i.mode==="json")return new oX(r);return new nX(r,i)}function aX(){return{blob:N7,customType:Sw,integer:je,numeric:X7,real:rX,text:X}}var C$=Symbol.for("drizzle:SQLiteInlineForeignKeys");class Lg extends fr{static[ie]="SQLiteTable";static Symbol=Object.assign({},fr.Symbol,{InlineForeignKeys:C$});[fr.Symbol.Columns];[C$]=[];[fr.Symbol.ExtraConfigBuilder]=void 0}function jOe(e,t,r,i,n=e){let o=new Lg(e,i,n),s=typeof t==="function"?t(aX()):t,c=Object.fromEntries(Object.entries(s).map(([l,p])=>{let m=p;m.setName(l);let f=m.build(o);return o[C$].push(...m.buildForeignKeys(f,o)),[l,f]})),u=Object.assign(o,c);if(u[fr.Symbol.Columns]=c,u[fr.Symbol.ExtraConfigColumns]=c,r)u[Lg.Symbol.ExtraConfigBuilder]=r;return u}var Nt=(e,t,r)=>jOe(e,t,r);class cX{constructor(e,t){this.name=e,this.value=t}static[ie]="SQLiteCheckBuilder";brand;build(e){return new uX(e,this)}}class uX{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static[ie]="SQLiteCheck";name;value}function lX(e,t){return new cX(e,t)}class P${constructor(e,t){this.name=e,this.unique=t}static[ie]="SQLiteIndexBuilderOn";on(...e){return new pX(this.name,e,this.unique)}}class pX{static[ie]="SQLiteIndexBuilder";config;constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new dX(this.config,e)}}class dX{static[ie]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function It(e){return new P$(e,!1)}function R$(e){return new P$(e,!0)}function li(...e){if(e[0].columns)return new A$(e[0].columns,e[0].name);return new A$(e)}class A${static[ie]="SQLitePrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new mX(e,this.columns,this.name)}}class mX{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static[ie]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[Lg.Symbol.Name]}_${this.columns.map((e)=>e.name).join("_")}_pk`}}var fX=Nt("job_queue",{id:X("id").primaryKey().$defaultFn(()=>jr()),type:X("type").notNull(),data:X("data").notNull(),result:X("result",{mode:"json"}),progress:X("progress",{mode:"json"}).$type(),source:X("source"),metadata:X("metadata",{mode:"json"}).$type().notNull(),status:X("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:je("priority").notNull().default(0),retryCount:je("retryCount").notNull().default(0),maxRetries:je("maxRetries").notNull().default(3),lastError:X("lastError"),createdAt:je("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:je("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:je("startedAt"),completedAt:je("completedAt"),attemptId:X("attemptId"),workerSlotId:X("workerSlotId"),workerSessionId:X("workerSessionId"),leaseExpiresAt:je("leaseExpiresAt"),attemptHeartbeatAt:je("attemptHeartbeatAt"),runtimeUpdatedAt:je("runtimeUpdatedAt")},(e)=>({queueReadyIdx:It("idx_job_queue_ready").on(e.status,e.priority,e.scheduledFor),jobTypeIdx:It("idx_job_queue_type").on(e.type,e.status),runtimeUpdatesIdx:It("idx_job_queue_runtime_updates").on(e.runtimeUpdatedAt,e.id),jobSourceIdx:It("idx_job_queue_source").on(e.source)})),gX=Nt("job_worker_sessions",{slotId:X("slotId").primaryKey(),sessionId:X("sessionId").notNull().unique(),startedAt:je("startedAt").notNull(),heartbeatAt:je("heartbeatAt").notNull(),expiresAt:je("expiresAt").notNull().default(0)},(e)=>({heartbeatIdx:It("idx_job_worker_sessions_heartbeat").on(e.heartbeatAt),expiresIdx:It("idx_job_worker_sessions_expires").on(e.expiresAt)}));var Bst=a.looseObject({deduplicationKey:a.string().optional()});var Kst=new xA;var Aat=a.preprocess((e)=>{if(typeof e!=="string")return e;return JSON.parse(e)},a.record(a.string(),a.unknown()));var Dat=a.record(a.string(),a.unknown());var qOe=a.custom((e)=>typeof e==="object"&&e!==null&&("safeParse"in e)),Xat=a.object({name:a.string(),schema:qOe});var Iw=Nt("conversations",{id:X("id").primaryKey(),sessionId:X("session_id").notNull(),interfaceType:X("interface_type").notNull(),channelId:X("channel_id").notNull(),personId:X("person_id"),started:X("started").notNull(),lastActive:X("last_active").notNull(),metadata:X("metadata"),created:X("created").notNull(),updated:X("updated").notNull()},(e)=>({sessionIdx:It("idx_conversations_session").on(e.sessionId),channelIdx:It("idx_conversations_channel").on(e.channelId),personIdx:It("idx_conversations_person").on(e.personId),interfaceSessionIdx:It("idx_conversations_interface_session").on(e.interfaceType,e.sessionId),interfaceChannelIdx:It("idx_conversations_interface_channel").on(e.interfaceType,e.channelId)})),hX=Nt("messages",{id:X("id").primaryKey(),conversationId:X("conversation_id").notNull().references(()=>Iw.id,{onDelete:"cascade"}),role:X("role").notNull(),content:X("content").notNull(),timestamp:X("timestamp").notNull(),metadata:X("metadata")},(e)=>({conversationIdx:It("idx_messages_conversation").on(e.conversationId),timestampIdx:It("idx_messages_timestamp").on(e.timestamp)})),yX=Nt("summary_tracking",{conversationId:X("conversation_id").primaryKey().references(()=>Iw.id,{onDelete:"cascade"}),lastSummarizedAt:X("last_summarized_at"),lastMessageId:X("last_message_id"),messagesSinceSummary:je("messages_since_summary").default(0),updated:X("updated").notNull()});var uct=a.preprocess((e)=>{if(typeof e!=="string")return e;try{return JSON.parse(e)}catch{return}},a.record(a.string(),a.unknown())).catch({});var qg=a.object({identity:si,interfaceType:a.string(),role:Wp,displayName:a.string().optional(),username:a.string().optional(),isBot:a.boolean().optional()}),JOe=a.preprocess(HOe,qg);function HOe(e){if(!WOe(e)||"identity"in e)return e;let{actorId:t,interfaceType:r,role:i}=e;if(typeof t!=="string"||typeof r!=="string"||i!=="user"&&i!=="assistant")return e;let{userId:n,canonicalId:o}=e;return{identity:zM({actorId:t,interfaceType:r,role:i,...typeof n==="string"?{userId:n}:{},...typeof o==="string"?{canonicalId:o}:{}}),interfaceType:r,role:i,...typeof e.displayName==="string"?{displayName:e.displayName}:{},...typeof e.username==="string"?{username:e.username}:{},...typeof e.isBot==="boolean"?{isBot:e.isBot}:{}}}var Jg=a.object({messageId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),threadId:a.string().optional(),metadata:a.record(a.string(),a.unknown()).optional()}),bX=a.looseObject({actor:JOe.optional(),source:Jg.optional()});function WOe(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ZOe=a.object({id:a.string(),conversationId:a.string(),role:a.string(),content:a.string(),timestamp:a.string(),metadata:a.string().nullable()}),xX=a.object({conversationId:a.string(),messageCount:a.number(),messages:a.array(ZOe),windowStart:a.number(),windowEnd:a.number(),windowSize:a.number(),timestamp:a.string()});var Hg=a.record(a.string(),a.unknown());var KOe=a.object({id:a.string(),sessionId:a.string(),interfaceType:a.string(),channelId:a.string(),personId:a.string().optional(),channelName:a.string().optional(),startedAt:a.string(),lastActiveAt:a.string(),createdAt:a.string(),updatedAt:a.string(),metadata:Hg}),QOe=a.object({id:a.string(),conversationId:a.string(),role:Wp,content:a.string(),timestamp:a.string(),metadata:Hg});var vX=a.object({name:a.string(),role:a.string(),purpose:a.string(),values:a.array(a.string())}),wX=a.object({name:a.string(),organization:a.string().optional(),description:a.string().optional(),avatar:a.string().optional(),website:a.string().optional(),email:a.string().optional(),socialLinks:a.array(a.object({platform:a.enum(["github","instagram","linkedin","email","website"]),url:a.string(),label:a.string().optional()})).optional()});var kX=a.object({name:a.string(),description:a.string(),tags:a.array(a.string()),examples:a.array(a.string())});var Wg=Nt("entities",{id:X("id").notNull(),entityType:X("entityType").notNull(),content:X("content").notNull(),contentHash:X("contentHash").notNull(),visibility:X("visibility",{enum:["public","shared","restricted"]}).notNull().default("public"),metadata:X("metadata",{mode:"json"}).$type().notNull().default(Fu`'{}'`),created:je("created").notNull().$defaultFn(()=>Date.now()),updated:je("updated").notNull().$defaultFn(()=>Date.now())},(e)=>({pk:li({columns:[e.id,e.entityType]}),visibilityCheck:lX("entities_visibility_check",Fu`${e.visibility} IN ('public', 'shared', 'restricted')`)}));var IX=Nt("entity_export_intents",{entityType:X("entity_type").notNull(),entityId:X("entity_id").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),revision:X("revision").notNull(),markedAt:je("marked_at").notNull()},(e)=>({pk:li({columns:[e.entityType,e.entityId]}),markedAtIdx:It("entity_export_intents_marked_at_idx").on(e.markedAt)}));var TX=Nt("projection_entity_owners",{entityType:X("entity_type").notNull(),entityId:X("entity_id").notNull(),ruleId:X("rule_id").notNull(),ruleVersion:X("rule_version").notNull(),inputFingerprint:X("input_fingerprint").notNull(),claimedAt:je("claimed_at").notNull()},(e)=>({pk:li({columns:[e.entityType,e.entityId]}),ruleIdx:It("projection_entity_owners_rule_idx").on(e.ruleId)})),EX=Nt("projection_dirty_inputs",{generation:je("generation").primaryKey({autoIncrement:!0}),sourceType:X("source_type").notNull(),sourceId:X("source_id").notNull(),revision:X("revision").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),markedAt:je("marked_at").notNull()},(e)=>({generationIdx:It("projection_dirty_inputs_generation_idx").on(e.generation)})),Zg=Nt("projection_waves",{id:X("id").primaryKey(),cutoffGeneration:je("cutoff_generation").notNull(),graphFingerprint:X("graph_fingerprint").notNull(),admissionEpoch:je("admission_epoch").notNull().default(0),status:X("status",{enum:["running","completed","failed","superseded"]}).notNull(),startedAt:je("started_at").notNull(),completedAt:je("completed_at")}),CX=Nt("projection_incidents",{waveId:X("wave_id").primaryKey().references(()=>Zg.id,{onDelete:"cascade"}),ruleId:X("rule_id").notNull(),jobId:X("job_id"),failureReason:X("failure_reason").notNull(),recoveryGeneration:je("recovery_generation").notNull(),createdAt:je("created_at").notNull(),resolvedAt:je("resolved_at")},(e)=>({unresolvedIdx:It("projection_incidents_unresolved_idx").on(e.resolvedAt,e.createdAt)})),PX=Nt("projection_wave_inputs",{waveId:X("wave_id").notNull().references(()=>Zg.id,{onDelete:"cascade"}),sourceType:X("source_type").notNull(),sourceId:X("source_id").notNull(),revision:X("revision").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),generation:je("generation").notNull()},(e)=>({pk:li({columns:[e.waveId,e.sourceType,e.sourceId]}),generationIdx:It("projection_wave_inputs_generation_idx").on(e.waveId,e.generation)})),RX=Nt("projection_wave_rules",{waveId:X("wave_id").notNull().references(()=>Zg.id,{onDelete:"cascade"}),ruleId:X("rule_id").notNull(),targetType:X("target_type").notNull(),level:je("level").notNull(),jobId:X("job_id"),status:X("status",{enum:["pending","queued","completed","failed"]}).notNull(),inputFingerprint:X("input_fingerprint"),changedTargets:X("changed_targets",{mode:"json"}).$type().notNull().default([])},(e)=>({pk:li({columns:[e.waveId,e.ruleId]}),statusIdx:It("projection_wave_rules_status_idx").on(e.waveId,e.status,e.level)})),AX=Nt("projection_rule_memos",{ruleId:X("rule_id").notNull(),ruleVersion:X("rule_version").notNull(),inputFingerprint:X("input_fingerprint").notNull(),writeIntents:X("write_intents",{mode:"json"}).$type().notNull(),createdAt:je("created_at").notNull()},(e)=>({pk:li({columns:[e.ruleId,e.ruleVersion,e.inputFingerprint]})}));var _X=Sw({dataType(){return"F32_BLOB(1536)"},toDriver(e){return Buffer.from(e.buffer)},fromDriver(e){return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4)}});var Tw=Nt("embeddings",{entityId:X("entity_id").notNull(),entityType:X("entity_type").notNull(),embedding:_X("embedding").notNull(),contentHash:X("content_hash").notNull()},(e)=>({pk:li({columns:[e.entityId,e.entityType]})}));var alt=a.object({id:a.string().min(1,"Entity ID is required"),entityType:a.string().min(1,"Entity type is required"),contentHash:a.string().min(1,"Content hash is required"),operation:a.enum(["create","update"])});var D$=a.enum(["public","shared","restricted"]),Wa=a.union([D$,a.literal("private")]).optional().transform((e)=>{if(e===void 0)return"public";if(e==="private")return"restricted";return e});var Cs=a.object({id:a.string(),entityType:a.string(),content:a.string(),created:a.string().datetime(),updated:a.string().datetime(),visibility:Wa,metadata:a.record(a.string(),a.unknown()),contentHash:a.string()}),eDe=a.enum(["public","shared","restricted"]),Cw=a.object({id:a.string(),entityType:a.string(),content:a.string(),created:a.string().datetime(),updated:a.string().datetime(),visibility:a.union([eDe,a.literal("private")]).optional().transform((e)=>{if(e===void 0)return"public";if(e==="private")return"restricted";return e}),metadata:a.record(a.string(),a.unknown()),contentHash:a.string()}),F$=a.object({}),tDe=a.object({mediaType:a.string(),url:a.string(),downloadUrl:a.string().optional(),previewUrl:a.string().optional(),filename:a.string().optional(),sizeBytes:a.number().optional(),source:a.object({entityType:a.string().optional(),entityId:a.string().optional(),attachmentType:a.string().optional()}).optional()});var vlt=a.object({limit:a.number().int().positive().optional().default(20),offset:a.number().int().min(0).optional().default(0),types:a.array(a.string()).optional().default([]),excludeTypes:a.array(a.string()).optional().default([]),weight:a.record(a.string(),a.number()).optional(),visibilityScope:a.enum(["public","shared","restricted"]).optional(),includeUngenerated:a.boolean().optional().default(!1),minScore:a.number().min(0).optional()}),wlt=a.preprocess((e)=>{if(typeof e!=="string")return e;return JSON.parse(e)},a.record(a.string(),a.unknown()));var rDe=Rs(pF(),1);var Tlt=a.object({visibility:a.enum(["public","shared","restricted","private"]).optional().transform((e)=>{if(e===void 0)return;return e==="private"?"restricted":e})});var Rlt=a.looseObject({issues:a.array(a.looseObject({message:a.string()}))});var jlt=a.record(a.string(),a.unknown());var nDe=a.object({field:a.string(),direction:a.enum(["asc","desc"]),nullsFirst:a.boolean().optional()}),Hlt=a.object({limit:a.number().int().positive().optional(),offset:a.number().int().min(0).optional().default(0),sortFields:a.array(nDe).optional(),filter:a.object({metadata:a.record(a.string(),a.unknown()).optional(),visibilityScope:a.enum(["public","shared","restricted"]).optional()}).optional(),publishedOnly:a.boolean().optional()});var Xlt=a.custom((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e));var ept=a.object({id:a.string().min(1),entityType:a.string().min(1),contentHash:a.string().min(1)});var md=a.lazy(()=>a.union([a.null(),a.boolean(),a.number().finite().refine((e)=>!Number.isInteger(e)||Number.isSafeInteger(e),{message:"integer exceeds the JSON-safe range"}),a.string(),a.array(md),a.record(a.string(),md)])),$u=a.record(a.string(),md),iDe=a.strictObject({id:a.string().trim().min(1),entityType:a.string().trim().min(1),content:a.string(),metadata:$u,visibility:Wa}),Vg=a.discriminatedUnion("operation",[a.strictObject({operation:a.literal("upsert"),entity:iDe}),a.strictObject({operation:a.literal("delete"),entityType:a.string().trim().min(1),id:a.string().trim().min(1)})]);var oDe=Nt("projection_admission_state",{id:je("id").primaryKey(),epoch:je("epoch").notNull().default(0)}),jX=Nt("projection_batches",{id:X("id").primaryKey(),source:X("source").notNull(),operationId:X("operation_id").notNull(),status:X("status",{enum:["preparing","open","closed","abandoned"]}).notNull(),ownerKind:X("owner_kind",{enum:["callback","job-root"]}).notNull(),ownerToken:X("owner_token").notNull(),rootJobId:X("root_job_id"),expectedChildren:je("expected_children").notNull().default(0),enqueueComplete:je("enqueue_complete").notNull().default(0),enqueueFailed:je("enqueue_failed").notNull().default(0),openedAt:je("opened_at").notNull(),lastProgressAt:je("last_progress_at").notNull(),leaseExpiresAt:je("lease_expires_at"),terminalAt:je("terminal_at"),recoveredAt:je("recovered_at"),firstGeneration:je("first_generation"),highestGeneration:je("highest_generation"),mutationCount:je("mutation_count").notNull().default(0),recoveryGeneration:je("recovery_generation")},(e)=>({operationIdx:R$("projection_batches_operation_idx").on(e.source,e.operationId),admissionIdx:It("projection_batches_admission_idx").on(e.status,e.openedAt),rootJobIdx:It("projection_batches_root_job_idx").on(e.rootJobId),recoveryIdx:It("projection_batches_recovery_idx").on(e.recoveredAt,e.recoveryGeneration)})),sDe=Nt("projection_batch_children",{batchId:X("batch_id").notNull().references(()=>jX.id,{onDelete:"cascade"}),childKey:X("child_key").notNull(),jobId:X("job_id"),status:X("status",{enum:["expected","active","completed","failed","missing"]}).notNull().default("expected"),terminalAt:je("terminal_at")},(e)=>({pk:li({columns:[e.batchId,e.childKey]}),jobIdx:R$("projection_batch_children_job_idx").on(e.jobId),statusIdx:It("projection_batch_children_status_idx").on(e.batchId,e.status)}));var Spt=a.strictObject({sourceType:a.string().trim().min(1),sourceId:a.string().trim().min(1),revision:a.string().trim().min(1),operation:a.enum(["upsert","delete"]),markedAt:a.number().int().nonnegative()}),vpt=a.strictObject({waveId:a.string().trim().min(1),ruleId:a.string().trim().min(1),jobId:a.string().trim().min(1).nullable(),failureReason:a.string().trim().min(1).max(500),failedAt:a.number().int().nonnegative()}),wpt=a.strictObject({ruleId:a.string().trim().min(1),ruleVersion:a.string().trim().min(1),inputFingerprint:a.string().trim().min(1)}),kpt=a.strictObject({entityType:a.string().trim().min(1),id:a.string().trim().min(1)}),Ipt=a.strictObject({ruleId:a.string().trim().min(1),targetType:a.string().trim().min(1),level:a.number().int().nonnegative()}),cDe=a.strictObject({source:a.string().trim().min(1).max(100),operationId:a.string().trim().min(1).max(200)});var uDe=cDe.extend({rootJobId:a.string().trim().min(1).max(200),expectedChildren:a.number().int().positive().max(1e4)}),Tpt=uDe.extend({rootJobId:a.string().trim().min(1).max(200),childKey:a.string().trim().min(1).max(200),expectedChildren:a.number().int().positive().max(1e4),jobId:a.string().trim().min(1).max(200)}),Ept=a.strictObject({operationId:a.string().trim().min(1).max(200),childKey:a.string().trim().min(1).max(200),jobId:a.string().trim().min(1).max(200),outcome:a.enum(["completed","failed"])}),Cpt=a.strictObject({entityType:a.string().trim().min(1),entityId:a.string().trim().min(1),operation:a.enum(["upsert","delete"]),contentHash:a.string().min(1).optional()});var hdt=a.record(a.string(),a.unknown());var LX=a.object({currentPage:a.number(),totalPages:a.number(),totalItems:a.number(),pageSize:a.number(),hasNextPage:a.boolean(),hasPrevPage:a.boolean()});var RDe=a.object({name:a.string(),description:a.string(),schema:a.any(),basePrompt:a.string().optional(),useKnowledgeContext:a.boolean().optional(),requiredPermission:a.enum(["admin","trusted","public"]),formatter:a.any().optional(),overlayFormatter:a.any().optional(),layout:a.object({component:a.any().optional(),fullscreen:a.boolean().optional()}).optional(),dataSourceId:a.string().optional()});var qX=new Map;function Gg(e,t){if(e===t)return!0;let r=qX.get(e);if(!r){let i=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&");r=new RegExp(`^${i.replace(/\*/g,".*")}$`),qX.set(e,r)}return r.test(t)}var HX=a.enum(["admin","trusted","public"]),ADe=a.enum(["create","update","delete","extract","publish"]),gd=a.enum(["never","admin","trusted","public"]),WX=a.strictObject({create:gd.optional(),update:gd.optional(),delete:gd.optional(),extract:gd.optional(),publish:gd.optional()}),ZX=a.record(a.string(),WX),VX={create:"Creating",update:"Updating",delete:"Deleting",extract:"Extracting",publish:"Publishing"},JX={public:"Public",trusted:"Trusted",admin:"Admin"};class L$ extends Error{entityType;action;callerLevel;requiredLevel;constructor(e){super(`${VX[e.action]} \`${e.entityType}\` requires ${JX[e.requiredLevel]} permission; your current permission is ${JX[e.callerLevel]}.`);this.name="EntityActionPermissionError",this.entityType=e.entityType,this.action=e.action,this.callerLevel=e.callerLevel,this.requiredLevel=e.requiredLevel}}class Za{admins;anchors;trusted;configuredPrincipalSeeds;rules;spaces;entityActions;constructor(e,t={}){if(this.configuredPrincipalSeeds={admins:[...e.admins??[]],anchors:[...e.anchors??[]],trusted:[...e.trusted??[]]},this.admins=z$(this.configuredPrincipalSeeds.admins),this.anchors=z$(this.configuredPrincipalSeeds.anchors),this.trusted=z$(this.configuredPrincipalSeeds.trusted),this.rules=e.rules??[],this.spaces=t.spaces??[],e.entityActions)this.entityActions=ZX.parse(e.entityActions)}determineUserLevel(e,t,r={}){let i=`${e}:${t}`,n=hd(e,bg(e,t));if(this.admins.has(n))return"admin";if(this.trusted.has(n))return"trusted";let o=this.getPatternLevel(i);if(o==="admin"||o==="trusted")return o;if(this.spaces.length>0&&this.matchesConfiguredSpace({interfaceType:e,...r}))return"trusted";return o??"public"}isAnchor(e,t){return this.anchors.has(hd(e,bg(e,t)))}getConfiguredPrincipalSeeds(){return{admins:[...this.configuredPrincipalSeeds.admins],anchors:[...this.configuredPrincipalSeeds.anchors],trusted:[...this.configuredPrincipalSeeds.trusted]}}replaceRuntimePrincipalState(e){this.admins=new Set(e.grants.filter((t)=>t.permissionLevel==="admin").map((t)=>hd(t.interfaceType,t.principalKeyHash))),this.trusted=new Set(e.grants.filter((t)=>t.permissionLevel==="trusted").map((t)=>hd(t.interfaceType,t.principalKeyHash))),this.anchors=new Set(e.anchors.map((t)=>hd(t.interfaceType,t.principalKeyHash)))}getResolvedEntityActionPolicy(e){if(!this.entityActions)return;let t={...this.entityActions["*"]??{},...this.entityActions[e]??{}};return Object.keys(t).length>0?t:void 0}getEntityActionRequiredLevel(e,t){return this.getResolvedEntityActionPolicy(e)?.[t]}getRequiredEntityActionLevel(e,t){return this.getEntityActionRequiredLevel(e,t)}canPerformEntityAction(e,t,r){let i=this.getEntityActionRequiredLevel(t,r);if(!i)return!0;if(i==="never")return!1;return this.hasPermission(e??"public",i)}assertEntityActionAllowed(e,t,r){let i=this.getEntityActionRequiredLevel(e,t);if(!i)return;if(i==="never")throw Error(`${VX[t]} \`${e}\` is not allowed through system tools.`);let n=r??"public";if(this.hasPermission(n,i))return;throw new L$({entityType:e,action:t,callerLevel:n,requiredLevel:i})}hasPermission(e,t){return Za.hasPermission(e,t)}filterByPermission(e,t){return e.filter((r)=>{let i=r.visibility??"public";return this.hasPermission(t,i)})}static hasPermission(e,t){if(t==="public")return!0;if(t==="trusted")return e==="trusted"||e==="admin";return e==="admin"}getPatternLevel(e){for(let t of this.rules)if(Gg(t.pattern,e))return t.level;return}matchesConfiguredSpace(e){if(e.isBot||e.isGuest)return!1;if(!e.channelId)return!1;let t=`${e.interfaceType}:${e.channelId}`;return this.spaces.some((r)=>Gg(r,t))}}function z$(e){return new Set(e.map((t)=>{let r=qM(t);return hd(r.interfaceType,bg(r.interfaceType,r.subject))}))}function hd(e,t){return`${e.trim().toLowerCase()}:${t}`}var _De=a.enum(["site-content-preview","site-content-production"]),GX=a.enum(["web","image","pdf"]),B$=a.custom((e)=>typeof e==="function"),ODe=a.object({name:a.string(),schema:a.any(),description:a.string().optional(),pluginId:a.string(),renderers:a.object({web:a.union([B$,a.string()]).optional(),image:a.union([B$,a.string()]).optional(),pdf:a.union([B$,a.string()]).optional()})}),DDe=a.object({enableContentGeneration:a.boolean().default(!1),outputDir:a.string(),workingDir:a.string().optional(),environment:a.enum(["preview","production"]).default("preview"),siteConfig:a.object({title:a.string(),description:a.string(),url:a.string().optional()}).optional()}),MDe=a.object({success:a.boolean(),routesBuilt:a.number(),errors:a.array(a.string()).optional(),warnings:a.array(a.string()).optional()});var YX=a.object({});var sft=a.strictObject({id:a.string().trim().min(1),version:a.string().trim().min(1),sources:a.array(a.strictObject({kind:a.literal("entity"),types:a.array(a.string().trim().min(1)).min(1),excludeTypes:a.array(a.string().trim().min(1)).optional()})),targetType:a.string().trim().min(1),sourceChangeBatchDelayMs:a.number().int().nonnegative().default(0)});var Eft=a.union([a.string(),a.number().finite(),a.boolean(),a.null()]);var LDe=/^[a-z][a-z0-9-]*$/,BDe=a.strictObject({source:a.string().min(1).max(500),flags:a.string().regex(/^[imu]*$/).optional()}),Rft=a.strictObject({type:a.string().trim().regex(LDe),displayName:a.string().trim().min(1).max(100),subjectLabel:a.string().trim().min(1).max(100),subjectPattern:BDe.optional(),manualDelivery:a.boolean().optional()});var XX=/[\s\\\p{Cc}\p{Cf}]/u;function eee(e){if(typeof e!=="string"||e!==e.trim()||e.length===0||e.length>2048||!e.startsWith("/")||e.startsWith("//")||XX.test(e))return;try{let t=new URL(e,"https://brains.invalid");if(t.origin!=="https://brains.invalid")return;let r=`${t.pathname}${t.search}${t.hash}`;return r.length>0&&r.length<=2048&&r.startsWith("/")&&!r.startsWith("//")&&!XX.test(r)?r:void 0}catch{return}}var UDe=/^[a-z][a-z0-9-]*$/,_o=a.string().trim().regex(UDe),tee=a.string().trim().min(1).max(300),ree=a.enum(["high","normal"]),U$=_o.max(40),q$=_o.max(40),nee=a.strictObject({value:q$,label:a.string().trim().min(1).max(100)}),iee=a.strictObject({key:U$,label:a.string().trim().min(1).max(100),values:a.array(nee).min(1).max(20)}).superRefine((e,t)=>{let r=new Set;for(let i of e.values){if(r.has(i.value))t.addIssue({code:"custom",path:["values"],message:`Duplicate inbox facet value: ${i.value}`});r.add(i.value)}}),oee=a.array(iee).max(8).superRefine((e,t)=>{let r=new Set;for(let i of e){if(r.has(i.key))t.addIssue({code:"custom",path:[],message:`Duplicate inbox facet key: ${i.key}`});r.add(i.key)}}),see=a.record(U$,q$).refine((e)=>Object.keys(e).length<=8,{message:"Inbox items may declare at most eight facets"}),qDe=a.string().regex(/^[a-z][A-Za-z0-9]{0,39}$/),JDe=a.string().min(1).max(300).refine((e)=>!/[\p{Cc}\p{Cf}]/u.test(e),{message:"Inbox follow-up context values cannot contain controls"}),HDe=a.strictObject({kind:_o,context:a.record(qDe,JDe).refine((e)=>Object.keys(e).length<=8,{message:"Inbox follow-up context may contain at most eight entries"})}),WDe=a.array(HDe).max(8).superRefine((e,t)=>{let r=new Set;for(let i of e){if(r.has(i.kind))t.addIssue({code:"custom",path:[],message:`Duplicate inbox follow-up kind: ${i.kind}`});r.add(i.kind)}}),aee=a.strictObject({id:_o,label:a.string().trim().min(1).max(100),confirm:a.boolean().optional()}),cee=a.strictObject({entityType:a.string().trim().min(1).max(100),entityId:a.string().trim().min(1).max(300)}),uee=a.strictObject({label:a.string().trim().min(1).max(300),personId:a.string().trim().min(1).max(200).optional()}),J$=a.strictObject({id:tee,title:a.string().trim().min(1).max(160),summary:a.string().trim().min(1).max(1000).optional(),contact:uee.optional(),threadOrdinal:a.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),receivedAt:a.iso.datetime(),urgency:ree,entityRef:cee.optional(),facets:see.optional(),followUps:WDe.optional(),actions:a.array(aee).max(10)}).superRefine((e,t)=>{let r=new Set;for(let i of e.actions){if(r.has(i.id))t.addIssue({code:"custom",path:["actions"],message:`Duplicate inbox action id: ${i.id}`});r.add(i.id)}}),ZDe=a.array(J$).max(1000),lee=a.strictObject({permissionLevel:a.enum(["admin","trusted","public"])}),VDe=a.strictObject({kind:a.literal("plain"),text:a.string().max(1e5),truncated:a.boolean()}),GDe=a.strictObject({sourceId:_o,displayName:a.string().trim().min(1).max(100)}),KDe=a.strictObject({sourceId:_o,displayName:a.string().trim().min(1).max(100),facets:oee.optional()});var QDe=2048,YDe=8192,Nft=a.strictObject({kind:_o,label:a.string().trim().min(1).max(100),priority:a.number().int().min(0).max(1000),mode:a.enum(["universal","declared"]),permissionLevel:a.enum(["admin","trusted","public"]),contextSchema:a.custom((e)=>typeof e==="object"&&e!==null&&("safeParse"in e)&&typeof e.safeParse==="function").optional(),applies:a.custom((e)=>typeof e==="function"),resolve:a.custom((e)=>typeof e==="function")}).superRefine((e,t)=>{if(e.mode==="declared"&&e.contextSchema===void 0)t.addIssue({code:"custom",path:["contextSchema"],message:"Declared inbox follow-up kinds require a context schema"});if(e.mode==="universal"&&e.contextSchema!==void 0)t.addIssue({code:"custom",path:["contextSchema"],message:"Universal inbox follow-up kinds cannot accept context"})}),zft=a.strictObject({href:a.string(),state:a.unknown().optional()}),XDe=a.record(a.string(),a.json()).refine((e)=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=YDe,{message:"Inbox follow-up state is too large"}),e0e=a.strictObject({kind:_o,label:a.string().trim().min(1).max(100),href:a.string().min(1).max(QDe).refine((e)=>eee(e)===e),state:XDe.optional()});var H$=/^upload-[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;var Wft=a.object({id:a.string().regex(H$),ref:a.object({kind:a.string().min(1),id:a.string().regex(H$)}),filename:a.string().min(1),mediaType:a.string().min(1),sizeBytes:a.number().nonnegative(),createdAt:a.string().datetime(),metadata:a.record(a.string(),a.unknown()).optional()});function Ps(e,t){if(!/^[a-z][a-z0-9-]*$/u.test(e))throw Error(`${t} must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`)}var tgt=a.record(a.string(),a.unknown()),rgt=a.object({items:a.array(a.object({operation:a.enum(["upsert","delete"]),id:a.string(),source:$u.optional()}))});var cgt=a.object({});import{McpServer as wgt,ResourceTemplate as kgt}from"@modelcontextprotocol/server";var pee=a.object({interfaceType:a.string(),actor:si,displayName:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),runId:a.string().optional(),toolCallId:a.string().optional(),userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional()}),dee=a.strictObject({success:a.literal(!0),data:a.unknown().optional(),message:a.string().optional(),cached:a.literal(!0).optional()}),mee=a.strictObject({success:a.literal(!1),error:a.string(),code:a.string().optional()}),fee=a.strictObject({needsConfirmation:a.literal(!0),toolName:a.string(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),args:a.unknown()}),Aw=a.union([dee,mee,fee]);var ggt=a.union([a.looseObject({success:a.literal(!0)}),a.object({success:a.literal(!1),error:a.string()})]);var gee=a.union([a.object({success:a.literal(!0),data:a.unknown(),message:a.string().optional()}),a.object({success:a.literal(!1),error:a.string(),code:a.string().optional()})]);var s0e=["public","trusted","admin"];function Va(e,t){if(!e.trim())throw Error(`${t} must not be empty`)}function G$(e,t){if(e!==void 0)Va(e,t)}function yee(e,t){if(e!==void 0&&!Number.isFinite(e))throw Error(`${t} priority must be finite`)}function _w(e,t){if(!s0e.includes(e))throw Error(`${t} permission "${String(e)}" is unsupported`)}function Kg(e,t){return Za.hasPermission(e,t)}var u0e=Symbol("rizom.cms-workspace-executor");function Ow(e){Ps(e.id,"CMS workspace id"),Va(e.label,`CMS workspace "${e.id}" label`),G$(e.description,`CMS workspace "${e.id}" description`),yee(e.priority,`CMS workspace "${e.id}"`),_w(e.permission,`CMS workspace "${e.id}"`);let t=new Set;for(let i of e.actions){if(t.has(i.name))throw Error(`CMS workspace "${e.id}" declares action "${i.name}" more than once`);if(t.add(i.name),i.permission!==void 0&&!Kg(i.permission,e.permission))throw Error(`CMS workspace "${e.id}" action "${i.name}" permission cannot be lower than the workspace permission`)}let r={kind:"rizom-cms-workspace",...e,...e.entities?{entities:Object.freeze([...e.entities])}:{},actions:Object.freeze([...e.actions]),bind(i,n){if(r.entityCatalog!==void 0!==(n.listEntityTypes!==void 0))throw Error(`CMS workspace "${r.id}" must bind one entity-type catalog callback exactly when it declares entityCatalog`);let o=new Set;for(let s of n.actions){if(!r.actions.includes(s.definition))throw Error(`CMS workspace "${r.id}" cannot bind undeclared action "${s.definition.name}"`);if(o.has(s.definition))throw Error(`CMS workspace "${r.id}" binds action "${s.definition.name}" more than once`);o.add(s.definition)}for(let s of r.actions)if(!o.has(s))throw Error(`CMS workspace "${r.id}" has no executor for action "${s.name}"`);return Object.freeze({kind:"rizom-cms-workspace-binding",definition:r,actions:Object.freeze([...n.actions]),[u0e]:Object.freeze({...n.authorize?{authorize:n.authorize}:{},load:n.load,...n.listEntityTypes?{listEntityTypes:n.listEntityTypes}:{}})})}};return Object.freeze(r)}var Ce=a.string().trim().min(1).max(120),Qg=a.string().trim().min(1).max(400),Ne=a.string().trim().min(1).max(160),Mr=a.string().max(500),Ga=a.string().max(4000),l0e=a.string().max(1e5),Tn=a.enum(["good","warn","neutral","error"]),Fw=a.union([a.string().max(2000),a.number().finite(),a.boolean(),a.null()]),bee=a.string().max(2048).refine((e)=>{try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"}catch{return!1}},{message:"External operator links must use http or https"});function p0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-entity"&&"type"in e&&typeof e.type==="string"&&e.type.length>0}var d0e=a.custom(p0e,{message:"Expected an imported entity definition"});function m0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-entity-catalog"&&"id"in e&&typeof e.id==="string"&&"label"in e&&typeof e.label==="string"}var f0e=a.custom(m0e,{message:"Expected an imported entity catalog definition"});function g0e(e){return{kind:"external",href:e.external}}function h0e(e){return{kind:"entity",entityType:e.entity.type,id:e.id}}var xee=a.union([a.object({target:a.literal("account-settings")}).strict(),a.object({target:a.literal("admin-peer-invite"),peerId:Ce,displayName:Ne}).strict(),a.object({target:a.literal("inbox")}).strict(),a.object({target:a.literal("inbox"),source:a.literal("mail"),filter:a.enum(["high-priority","needs-reply","unclassified"]).optional()}).strict(),a.object({target:a.literal("publishing")}).strict(),a.object({target:a.literal("site")}).strict(),a.object({target:a.literal("inbox-open-entity"),entityType:Ce,entityId:Ce}).strict(),a.object({target:a.literal("inbox-capture-note"),title:Mr,summary:a.string().trim().min(1).max(1000).optional(),entityType:Ce,entityId:Ce}).strict(),a.object({target:a.literal("inbox-discuss-in-chat"),sourceId:Ce,itemId:a.string().trim().min(1).max(300),label:a.string().trim().min(1).max(160)}).strict()]);function y0e(e){return{kind:"entity",entityType:e.entityType,id:e.id}}function b0e(e){return{kind:"launch",launch:e.launch}}function x0e(e){return{kind:"detail",itemId:e.detail.itemId}}var Dw=a.union([a.object({external:bee}).strict().transform(g0e),a.object({entity:d0e,id:Ce}).strict().transform(h0e),a.object({catalog:f0e,entityType:Ce,id:Ce}).strict().transform(y0e),a.object({launch:xee}).strict().transform(b0e),a.object({detail:a.object({itemId:Qg}).strict()}).strict().transform(x0e),a.object({kind:a.literal("external"),href:bee}).strict(),a.object({kind:a.literal("entity"),entityType:Ce,id:Ce}).strict(),a.object({kind:a.literal("launch"),launch:xee}).strict(),a.object({kind:a.literal("detail"),itemId:Qg}).strict()]),S0e=a.object({label:Ne,value:a.union([a.string().max(500),a.number().finite()]),caption:Mr.optional(),tone:Tn.optional()}).strict(),v0e=a.object({label:Ne,value:Fw}).strict(),See=a.object({type:a.literal("stats"),id:Ce.optional(),items:a.array(S0e).max(20)}).strict(),vee=a.object({type:a.literal("key-values"),id:Ce.optional(),items:a.array(v0e).max(40)}).strict(),wee=a.object({type:a.literal("notice"),id:Ce.optional(),title:Ne.optional(),text:Ga,tone:Tn.optional()}).strict(),w0e=a.object({type:a.literal("text"),id:Ce.optional(),label:Ne.optional(),text:l0e,truncated:a.boolean().optional()}).strict(),k0e=a.object({id:Ce,label:Ne,value:Fw.optional(),description:Ga.optional(),tone:Tn.optional()}).strict(),kee=a.object({type:a.literal("group"),id:Ce,label:Ne,items:a.array(k0e).max(50)}).strict(),I0e=a.object({id:Ce,label:Ne,status:a.enum(["idle","active","complete","failed"]),detail:Mr.optional()}).strict(),Iee=a.object({type:a.literal("flow"),id:Ce,label:Ne,direction:a.enum(["forward","bidirectional"]).optional(),steps:a.array(I0e).min(2).max(20)}).strict(),T0e=a.object({id:Ce,label:Ne,value:a.number().finite().nonnegative(),max:a.number().finite().positive().optional(),unit:Ne.optional(),tone:Tn.optional()}).strict().superRefine((e,t)=>{if(e.max!==void 0&&e.value>e.max)t.addIssue({code:"custom",message:"Meter value cannot exceed its maximum",path:["value"]})}),Tee=a.object({type:a.literal("meters"),id:Ce,items:a.array(T0e).max(30)}).strict(),Eee=a.object({type:a.literal("progress"),id:Ce,label:Ne,state:Ne,detail:Ga.optional(),startedAt:a.string().datetime().optional(),updatedAt:a.string().datetime().optional(),progress:a.number().finite().min(0).max(1).optional(),tone:Tn.optional()}).strict(),E0e=a.string().trim().min(1).max(120).regex(/^[a-z][a-zA-Z0-9_.-]*$/),C0e=a.object({value:Ne,label:Ne,count:a.number().int().nonnegative().optional()}).strict(),P0e=a.object({key:E0e,label:Ne,value:Ne.optional(),allLabel:Ne.optional(),options:a.array(C0e).max(100)}).strict(),R0e=a.object({type:a.literal("query"),id:Ce,controls:a.array(P0e).max(20),pagination:a.object({offset:a.number().int().nonnegative(),limit:a.number().int().min(1).max(100),total:a.number().int().nonnegative(),label:Ne.optional()}).strict().optional()}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.controls.entries()){if(r.has(n.key))t.addIssue({code:"custom",message:`Query key "${n.key}" is duplicated`,path:["controls",i,"key"]});r.add(n.key)}}),Cee=a.object({type:a.literal("links"),id:Ce.optional(),items:a.array(a.object({label:Ne,target:Dw}).strict()).max(30)}).strict(),A0e=a.object({label:Ne,tone:Tn.optional()}).strict(),_0e=a.object({value:Ce,label:Ne,count:a.number().int().nonnegative().optional(),emphasis:a.literal("gap").optional()}).strict(),Pee=a.object({label:Ne,defaultValue:Ce,allValue:Ce.optional(),options:a.array(_0e).min(1).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.options.entries()){if(r.has(n.value))t.addIssue({code:"custom",message:`List filter value "${n.value}" is duplicated`,path:["options",i,"value"]});r.add(n.value)}if(!r.has(e.defaultValue))t.addIssue({code:"custom",message:`List filter default "${e.defaultValue}" has no matching option`,path:["defaultValue"]})}),K$=a.object({id:Qg,title:Mr,description:Ga.optional(),meta:Mr.optional(),metadata:a.array(Mr).max(20).optional(),tags:a.array(Ne).max(30).optional(),count:a.number().finite().optional(),badges:a.array(A0e).max(10).optional(),filterValues:a.array(Ce).max(50).optional(),links:a.array(a.object({label:Ne,target:Dw}).strict()).max(10).optional(),tone:Tn.optional(),link:Dw.optional()}).strict(),O0e=a.object({type:a.literal("list"),id:Ce,empty:Mr,filter:Pee.optional(),items:a.array(K$).max(200)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`List item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}if(e.filter){let i=new Set(e.filter.options.map((o)=>o.value)),n=e.filter.allValue??"all";for(let[o,s]of e.items.entries())for(let c of s.filterValues??[])if(c!==n&&!i.has(c))t.addIssue({code:"custom",message:`List item filter value "${c}" has no matching option`,path:["items",o,"filterValues"]})}}),Ree=a.object({key:Ce,label:Ne,align:a.enum(["start","center","end"]).optional()}).strict(),Aee=a.object({key:Ce,label:Ne,values:a.array(Fw).max(50)}).strict(),D0e=a.union([Fw,a.array(a.string().max(500)).max(50)]),_ee=a.object({id:Qg,cells:a.record(a.string(),D0e),link:Dw.optional()}).strict(),M0e=a.object({type:a.literal("table"),id:Ce,empty:Mr,filters:a.array(Aee).max(20).optional(),columns:a.array(Ree).min(1).max(30),rows:a.array(_ee).max(500)}).strict().superRefine((e,t)=>{let r=new Set;for(let[n,o]of e.columns.entries()){if(r.has(o.key))t.addIssue({code:"custom",message:`Table column key "${o.key}" is duplicated`,path:["columns",n,"key"]});r.add(o.key)}for(let[n,o]of(e.filters??[]).entries())if(!r.has(o.key))t.addIssue({code:"custom",message:`Table filter key "${o.key}" has no matching column`,path:["filters",n,"key"]});let i=new Set;for(let[n,o]of e.rows.entries()){if(i.has(o.id))t.addIssue({code:"custom",message:`Table row id "${o.id}" is duplicated`,path:["rows",n,"id"]});i.add(o.id);for(let s of Object.keys(o.cells))if(!r.has(s))t.addIssue({code:"custom",message:`Table cell key "${s}" has no matching column`,path:["rows",n,"cells",s]})}}),F0e=a.object({id:Ce,label:Ne,tone:Tn.optional(),empty:Mr,items:a.array(K$).max(100)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}}),$0e=a.object({type:a.literal("matrix"),id:Ce,columns:a.union([a.literal(1),a.literal(2),a.literal(3),a.literal(4)]).optional(),cells:a.array(F0e).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.cells.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix cell id "${n.id}" is duplicated`,path:["cells",i,"id"]});r.add(n.id)}}),Oee=a.object({label:Ne,tone:Tn.optional()}).strict(),Dee=a.object({sourceId:Ce,targetId:Ce,label:Ne.optional(),tone:Tn.optional()}).strict(),yd=a.number().finite().min(0).max(1),j0e=a.object({id:Ce,label:Ne,category:Ne,x:yd,y:yd,zoneId:Ce.optional(),tone:Tn.optional(),details:a.array(Mr).max(20).optional()}).strict(),N0e=a.object({id:Ce,label:Ne,x:yd,y:yd,memberIds:a.array(Ce).max(500)}).strict(),z0e=a.object({type:a.literal("spatial"),layout:a.literal("cartesian"),id:Ce,label:Ne,description:Ga,points:a.array(j0e).max(500),zones:a.array(N0e).max(100),relationships:a.array(Dee).max(2000).optional(),legend:a.array(Oee).max(20)}).strict().superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.points.entries()){if(r.has(s.id))t.addIssue({code:"custom",message:`Spatial point id "${s.id}" is duplicated`,path:["points",o,"id"]});r.add(s.id)}let i=new Set;for(let[o,s]of e.zones.entries()){if(i.has(s.id)||r.has(s.id))t.addIssue({code:"custom",message:`Spatial zone id "${s.id}" is duplicated`,path:["zones",o,"id"]});i.add(s.id);for(let c of s.memberIds)if(!r.has(c))t.addIssue({code:"custom",message:`Spatial zone member "${c}" has no matching point`,path:["zones",o,"memberIds"]})}for(let[o,s]of e.points.entries())if(s.zoneId&&!i.has(s.zoneId))t.addIssue({code:"custom",message:`Spatial point zone "${s.zoneId}" has no matching zone`,path:["points",o,"zoneId"]});let n=new Set([...r,...i]);for(let[o,s]of(e.relationships??[]).entries())if(!n.has(s.sourceId)||!n.has(s.targetId))t.addIssue({code:"custom",message:"Spatial relationship endpoints must reference declared points or zones",path:["relationships",o]})}),L0e=a.object({id:Ce,label:Ne,kind:Ne,status:Ne,tags:a.array(Ne).max(30).optional(),distance:yd,bearing:a.number().finite().min(0).lt(360),relatedIds:a.array(Ce).max(100).optional(),tone:Tn.optional(),details:a.array(Mr).max(20).optional()}).strict(),B0e=a.object({id:Ce,label:Ne,memberIds:a.array(Ce).min(2).max(500)}).strict(),U0e=a.object({id:Ce,label:Ne,maxDistance:yd}).strict(),q0e=a.object({type:a.literal("spatial"),layout:a.literal("radial"),id:Ce,label:Ne,description:Ga,centerLabel:Ne,centerKind:a.enum(["identity","centroid"]),points:a.array(L0e).max(500),clusters:a.array(B0e).max(100).optional(),relationships:a.array(Dee).max(2000).optional(),strata:a.array(U0e).min(1).max(10),legend:a.array(Oee).max(20)}).strict().superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.points.entries()){if(r.has(s.id))t.addIssue({code:"custom",message:`Spatial point id "${s.id}" is duplicated`,path:["points",o,"id"]});r.add(s.id)}for(let[o,s]of e.points.entries())for(let c of s.relatedIds??[])if(!r.has(c))t.addIssue({code:"custom",message:`Related point "${c}" is not declared`,path:["points",o,"relatedIds"]});let i=new Set;for(let[o,s]of(e.clusters??[]).entries()){if(i.has(s.id))t.addIssue({code:"custom",message:`Spatial cluster id "${s.id}" is duplicated`,path:["clusters",o,"id"]});i.add(s.id);for(let c of s.memberIds)if(!r.has(c))t.addIssue({code:"custom",message:`Spatial cluster member "${c}" has no matching point`,path:["clusters",o,"memberIds"]})}for(let[o,s]of(e.relationships??[]).entries())if(!r.has(s.sourceId)||!r.has(s.targetId))t.addIssue({code:"custom",message:"Spatial relationship endpoints must reference declared points",path:["relationships",o]});let n=-1;for(let[o,s]of e.strata.entries()){if(s.maxDistance<=n)t.addIssue({code:"custom",message:"Radial strata must increase by maximum distance",path:["strata",o,"maxDistance"]});n=s.maxDistance}}),Mee=a.discriminatedUnion("layout",[z0e,q0e]),Fee=a.union([See,vee,wee,kee,Iee,Tee,Eee,Cee,O0e,M0e,$0e,Mee]),J0e=a.object({type:a.literal("tabs"),id:Ce,label:Ne,defaultTab:Ce,tabs:a.array(a.object({id:Ce,label:Ne,count:a.number().int().nonnegative().optional(),blocks:a.array(Fee).max(30)}).strict()).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.tabs.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Tab id "${n.id}" is duplicated`,path:["tabs",i,"id"]});r.add(n.id)}if(!r.has(e.defaultTab))t.addIssue({code:"custom",message:`Default tab "${e.defaultTab}" has no matching tab`,path:["defaultTab"]})});function H0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-workspace-action"&&"name"in e&&typeof e.name==="string"&&"input"in e&&typeof e.input==="object"&&e.input!==null&&"safeParse"in e.input&&typeof e.input.safeParse==="function"}var W0e=a.custom(H0e,{message:"Expected a workspace action definition"}),Z0e=a.object({id:Ce,label:Ne,description:Ga.optional(),confirmation:a.literal("prepared").optional()}).strict(),$w=a.object({action:W0e,input:a.unknown(),capability:Z0e.optional(),disabled:a.boolean().optional()}).strict(),$ee=K$.extend({actions:a.array($w).max(20).optional()}),jee=a.object({type:a.literal("list"),id:Ce,empty:Mr,filter:Pee.optional(),items:a.array($ee).max(200)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`List item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}if(e.filter){let i=new Set(e.filter.options.map((o)=>o.value)),n=e.filter.allValue??"all";for(let[o,s]of e.items.entries())for(let c of s.filterValues??[])if(c!==n&&!i.has(c))t.addIssue({code:"custom",message:`List item filter value "${c}" has no matching option`,path:["items",o,"filterValues"]})}}),V0e=_ee.extend({actions:a.array($w).max(20).optional()}),Nee=a.object({type:a.literal("table"),id:Ce,empty:Mr,filters:a.array(Aee).max(20).optional(),columns:a.array(Ree).min(1).max(30),rows:a.array(V0e).max(500)}).strict().superRefine((e,t)=>{let r=new Set;for(let[n,o]of e.columns.entries()){if(r.has(o.key))t.addIssue({code:"custom",message:`Table column key "${o.key}" is duplicated`,path:["columns",n,"key"]});r.add(o.key)}for(let[n,o]of(e.filters??[]).entries())if(!r.has(o.key))t.addIssue({code:"custom",message:`Table filter key "${o.key}" has no matching column`,path:["filters",n,"key"]});let i=new Set;for(let[n,o]of e.rows.entries()){if(i.has(o.id))t.addIssue({code:"custom",message:`Table row id "${o.id}" is duplicated`,path:["rows",n,"id"]});i.add(o.id);for(let s of Object.keys(o.cells))if(!r.has(s))t.addIssue({code:"custom",message:`Table cell key "${s}" has no matching column`,path:["rows",n,"cells",s]})}}),G0e=a.object({id:Ce,label:Ne,tone:Tn.optional(),empty:Mr,items:a.array($ee).max(100)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}}),K0e=a.object({type:a.literal("matrix"),id:Ce,columns:a.union([a.literal(1),a.literal(2),a.literal(3),a.literal(4)]).optional(),cells:a.array(G0e).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.cells.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix cell id "${n.id}" is duplicated`,path:["cells",i,"id"]});r.add(n.id)}}),Q0e=$w.extend({type:a.literal("action"),id:Ce.optional()}),Y0e=a.object({type:a.literal("actions"),id:Ce.optional(),items:a.array($w).max(30)}).strict(),bd=a.union([See,vee,wee,w0e,kee,Iee,Tee,Eee,R0e,Cee,jee,Nee,K0e,Mee,Q0e,Y0e]),X0e=a.object({type:a.literal("tabs"),id:Ce,label:Ne,defaultTab:Ce,tabs:a.array(a.object({id:Ce,label:Ne,count:a.number().int().nonnegative().optional(),blocks:a.array(bd).max(30)}).strict()).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.tabs.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Tab id "${n.id}" is duplicated`,path:["tabs",i,"id"]});r.add(n.id)}if(!r.has(e.defaultTab))t.addIssue({code:"custom",message:`Default tab "${e.defaultTab}" has no matching tab`,path:["defaultTab"]})}),Mw=a.object({type:a.literal("card"),id:Ce,label:Ne,tone:Tn.optional(),blocks:a.array(bd).max(12)}).strict(),eMe=a.object({type:a.literal("detail"),id:Ce,queryKey:Ce,empty:Mr,master:a.union([jee,Nee]),open:a.object({forId:Qg,title:Ne,blocks:a.array(a.union([bd,Mw])).max(30)}).strict().optional()}).strict(),tMe=a.object({type:a.literal("columns"),id:Ce,primary:a.array(a.union([bd,Mw])).max(20),aside:a.array(a.union([bd,Mw])).max(12)}).strict(),yht=a.object({kicker:Ne.optional(),title:Mr.optional(),description:Ga.optional(),status:a.object({label:Ne,detail:Mr.optional(),tone:Tn.optional()}).strict().optional(),blocks:a.array(a.union([bd,X0e,eMe,tMe,Mw])).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.blocks.entries()){if(n.id===void 0)continue;if(r.has(n.id))t.addIssue({code:"custom",message:`Operator view block id "${n.id}" is duplicated`,path:["blocks",i,"id"]});r.add(n.id)}});var bht=a.json();var rMe=a.object({title:Mr.optional(),blocks:a.array(a.union([Fee,J0e])).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.blocks.entries()){if(n.id===void 0)continue;if(r.has(n.id))t.addIssue({code:"custom",message:`Operator view block id "${n.id}" is duplicated`,path:["blocks",i,"id"]});r.add(n.id)}}),nMe=a.object({items:a.array(a.object({label:Ne,value:a.string().max(500),tone:a.enum(["good","warn"]).optional()}).strict()).max(4),attention:a.number().int().nonnegative().optional()}).strict(),xht=a.object({view:rMe,digest:nMe.optional()}).strict();var iMe=Symbol("rizom.workspace-action-executor");function jw(e){if(Ps(e.name,"Workspace action name"),Va(e.label,`Workspace action "${e.name}" label`),e.confirmation?.kind==="static")Va(e.confirmation.message,`Workspace action "${e.name}" confirmation`);if(e.permission!==void 0)_w(e.permission,`Workspace action "${e.name}"`);let t={kind:"rizom-workspace-action",...e,bind(r,i,n){if(t.confirmation?.kind==="prepared"&&!n)throw Error(`Workspace action "${t.name}" requires a prepared confirmation callback`);return Object.freeze({kind:"rizom-workspace-action-binding",definition:t,[iMe]:Object.freeze({execute:i,...n?{prepare:n}:{}})})}};return Object.freeze(t)}var Dht=a.object({actionId:a.string().trim().min(1).max(120),input:a.unknown(),mode:a.enum(["prepare","execute"]).default("execute"),confirmationToken:a.string().uuid().optional()}).strict(),Mht=a.object({capability:a.object({confirmation:a.literal("prepared").optional()})}).passthrough(),Fht=a.array(a.string().trim().min(1).max(120)).max(200).transform((e)=>[...new Set(e)]),$ht=a.object({summary:a.string().trim().min(1).max(500),revision:a.string().trim().min(1).max(500)});var jht=a.json();var Nht=Object.freeze({config:Object.freeze({}),state:Object.freeze({}),accountSettings:void 0});var Vht=Object.freeze({config:Object.freeze({}),state:Object.freeze({}),accountSettings:void 0});var Wyt=a.enum(["tool:invoking","tool:completed","tool:failed"]),Zyt=a.object({toolName:a.string().min(1),conversationId:a.string().min(1),interfaceType:a.string().min(1),channelId:a.string().min(1).optional(),channelName:a.string().min(1).optional(),toolCallId:a.string().min(1).optional(),error:a.string().optional()});var bMe=["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"],Q$=a.object({captureUrls:a.boolean().default(!1),blockedUrlDomains:a.array(a.string()).default(bMe)});var IMe=a.object({status:a.enum(["healthy","warning","error","unknown"]),message:a.string().optional(),lastCheck:a.date().optional(),details:a.record(a.string(),a.unknown()).optional()}),Vee=a.object({name:a.string(),pluginId:a.string(),status:a.string(),health:IMe.optional()});var Gee=a.enum(["admin","trusted","public"]),Yg=a.object({label:a.string(),url:a.string(),pluginId:a.string(),priority:a.number().default(100),visibility:Gee.default("public")}),X$=a.enum(["human","agent","admin","protocol"]),ej=a.enum(["available","coming-soon","disabled"]),Xg=a.object({id:a.string(),label:a.string(),description:a.string().optional(),href:a.string(),kind:X$,pluginId:a.string(),priority:a.number().default(100),visibility:Gee.default("public"),status:ej.default("available")}),Nw=a.object({entityType:a.string(),count:a.number()}),tj=a.object({status:a.enum(["operational","degraded"]),reasons:a.array(a.string()),worker:a.object({state:a.enum(["active","missing","stale"]),activeSessions:a.number().int().nonnegative(),staleSessions:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()}),queue:a.object({duePending:a.number().int().nonnegative(),processing:a.number().int().nonnegative(),oldestDuePendingAgeMs:a.number().nonnegative().nullable(),latestClaimAgeMs:a.number().nonnegative().nullable(),stalled:a.boolean()})}),Kee=a.object({model:a.string(),version:a.string(),uptime:a.number(),entities:a.number(),entityCounts:a.array(Nw),embeddings:a.number(),backgroundWork:tj,ai:a.object({model:a.string(),embeddingModel:a.string()}),daemons:a.array(Vee),endpoints:a.array(Yg),interactions:a.array(Xg)});var Gbt=a.object({id:a.string(),type:a.string(),version:a.string(),status:a.string()}),Kbt=a.object({name:a.string(),description:a.string()});var TMe=a.object({id:a.string(),version:a.string(),type:a.enum(["core","entity","service","interface"]),description:a.string().optional(),dependencies:a.array(a.string()).optional(),packageName:a.string()});var Qee=a.looseObject({id:a.string().optional(),limit:a.number().optional(),page:a.number().optional(),pageSize:a.number().optional(),baseUrl:a.string().optional()}),EMe=a.looseObject({entityType:a.string().optional(),query:Qee.optional()});var rj=a.object({kind:a.string().min(1),id:a.string().min(1)}),Xee=a.object({kind:a.literal("text"),filename:a.string().min(1),mediaType:a.string().min(1),content:a.string(),sizeBytes:a.number().nonnegative().optional(),source:rj.optional()}),PMe=a.custom((e)=>e instanceof Uint8Array),RMe=a.object({kind:a.literal("file"),filename:a.string().min(1),mediaType:a.string().min(1),data:PMe,sizeBytes:a.number().nonnegative().optional(),source:rj.optional()}),ete=a.discriminatedUnion("kind",[Xee,RMe]),AMe=a.object({userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional(),interfaceType:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),actor:qg.optional(),source:Jg.optional(),attachments:a.array(ete).optional()});var _Me=a.object({status:a.enum(["healthy","warning","error","unknown"]),message:a.string().optional(),lastCheck:a.string().optional(),details:a.record(a.string(),a.unknown()).optional()}),OMe=a.object({name:a.string(),pluginId:a.string(),status:a.string(),health:_Me.optional()}),DMe=a.object({model:a.string(),version:a.string(),uptime:a.number(),entities:a.number(),entityCounts:a.array(Nw),embeddings:a.number(),ai:a.object({model:a.string(),embeddingModel:a.string()}),daemons:a.array(OMe),endpoints:a.array(Yg),interactions:a.array(Xg)});var nj=a.object({name:a.string().min(1),status:a.enum(["healthy","degraded","unhealthy"]),message:a.string().optional(),details:a.record(a.string(),a.unknown()).optional()}),tte=a.object({totals:a.object({pending:a.number().int().nonnegative(),processing:a.number().int().nonnegative(),completed:a.number().int().nonnegative(),failed:a.number().int().nonnegative()}),byType:a.array(a.object({type:a.string().min(1),status:a.enum(["pending","processing","completed","failed"]),count:a.number().int().nonnegative()})),oldestPendingAgeMs:a.number().nonnegative().nullable(),duePending:a.number().int().nonnegative(),oldestDuePendingAgeMs:a.number().nonnegative().nullable(),latestClaimAgeMs:a.number().nonnegative().nullable(),oldestProcessingAgeMs:a.number().nonnegative().nullable(),staleLeaseCount:a.number().int().nonnegative(),workerSessions:a.object({total:a.number().int().nonnegative(),active:a.number().int().nonnegative(),stale:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()})}),rte=a.object({memory:a.object({rssBytes:a.number().int().nonnegative(),heapUsedBytes:a.number().int().nonnegative(),heapTotalBytes:a.number().int().nonnegative()}),fileDescriptors:a.number().int().nonnegative().nullable(),processes:a.object({total:a.number().int().nonnegative().nullable(),zombies:a.number().int().nonnegative().nullable()}),queue:tte.nullable(),projection:a.object({initialized:a.boolean(),trackedRoots:a.number().int().nonnegative(),openCircuits:a.array(a.object({projectionId:a.string().min(1),reason:a.string().min(1),openedAt:a.number().int().nonnegative(),expiresAt:a.number().int().nonnegative()}))}),worker:a.object({total:a.number().int().nonnegative(),active:a.number().int().nonnegative(),stale:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()})}),MMe=a.object({status:a.enum(["ready","not_ready"]),operationalStatus:a.enum(["operational","degraded"]),checkedAt:a.iso.datetime(),checks:a.array(nj),resources:rte});var xxt=a.string().trim().min(1).max(200),Sxt=a.string().trim().min(1).max(100).regex(/^[a-z0-9][a-z0-9.-]*$/);var FMe=a.union([a.object({success:a.boolean(),data:a.unknown().optional(),error:a.string().optional()}),a.object({noop:a.literal(!0)})]),$Me=a.object({id:a.string(),timestamp:a.string(),type:a.string(),source:a.string(),target:a.string().optional(),metadata:Hg.optional()});var jMe=a.object({kind:a.string().min(1),id:a.string().min(1)}),NMe=a.object({kind:a.string().min(1),filename:a.string().min(1),mediaType:a.string().min(1),sizeBytes:a.number().nonnegative().optional(),source:jMe.optional()}),Mxt=a.array(NMe),Fxt=a.array(gg),$xt=a.array(fg),jxt=a.record(a.string(),a.unknown());var Uxt=a.record(a.string(),a.unknown());var Vxt=a.record(a.string(),a.unknown());var zMe=new Map([[".png","image/png"],[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".webp","image/webp"],[".gif","image/gif"],[".pdf","application/pdf"]]),Kxt=new Set(zMe.values());var ute=Cs.extend({id:a.literal("brain-character"),entityType:a.literal("brain-character")}),oj=a.object({name:a.string().describe("The brain's friendly display name"),role:a.string().describe("The brain's primary role"),purpose:a.string().describe("The brain's purpose and goals"),values:a.array(a.string()).describe("Core values that guide behavior")});var ZSt=a.record(a.string(),a.unknown());var lte=Cs.extend({id:a.literal("anchor-profile"),entityType:a.literal("anchor-profile")}),pte=a.enum(["person","team","organization"]),eh=a.object({name:a.string().describe("Name of the anchor"),organization:a.string().optional().describe("Organization the anchor belongs to"),description:a.string().optional().describe("Short description or biography"),avatar:a.string().optional().describe("URL or asset path to avatar/logo"),website:a.string().optional().describe("Primary website URL"),email:a.string().optional().describe("Contact email"),socialLinks:a.array(a.object({platform:a.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:a.string().describe("Profile or contact URL"),label:a.string().optional().describe("Optional display label")})).optional().describe("Social media and contact links")});var zw=a.enum(["person","team","organization"]),fvt=a.object({kind:a.string().trim().min(1),category:zw,labels:a.object({singular:a.string().trim().min(1),plural:a.string().trim().min(1)})});var dte=a.looseObject({id:a.string(),description:a.string(),name:a.string().optional(),tags:a.array(a.string()).optional().default([])}),JFe=eh.extend({kind:a.string().trim().min(1).optional(),category:zw.optional()}).superRefine((e,t)=>{if(e.kind===void 0!==(e.category===void 0))t.addIssue({code:"custom",message:"Anchor kind and category must be provided together"})}),HFe=a.looseObject({uri:a.string(),params:a.record(a.string(),a.unknown()).optional()}),WFe=a.looseObject({name:a.string(),url:a.string(),description:a.string().optional(),skills:a.array(dte).optional().default([]),capabilities:a.looseObject({extensions:a.array(HFe).optional().default([])}).optional()});var lTt=a.record(a.string(),a.unknown());var hte=a.enum(["png","jpg","jpeg","webp","gif","svg"]),yte=a.enum(["pending","draft","failed"]),bte=a.object({title:a.string().optional(),alt:a.string().optional(),format:hte,width:a.number(),height:a.number(),status:yte.optional(),processingJobId:a.string().optional(),processingError:a.string().optional(),sourceUrl:a.url().optional(),sourceEntityType:a.string().optional(),sourceEntityId:a.string().optional(),sourceUploadId:a.string().optional(),sourceFilename:a.string().optional(),sourceMediaType:a.string().optional(),attachmentType:a.string().optional(),dedupKey:a.string().optional()}),lj=Cw.extend({entityType:a.literal("image"),metadata:bte}),e$e=a.object({url:a.string(),alt:a.string(),title:a.string(),width:a.number(),height:a.number()});function xte(e){let t=e.trim().match(/^data:image\/([a-z+]+);base64,(.+)$/i);if(!t?.[1]||!t[2])return null;return{format:t[1].toLowerCase(),base64:t[2]}}function xd(e){let t=xte(e);if(!t)throw Error("Invalid image data URL");return t}var t$e={png:"iVBORw",jpg:"/9j/",gif:"R0lGOD",webp:"UklGR"};function th(e){for(let[t,r]of Object.entries(t$e))if(e.startsWith(r))return t;return null}function Sd(e){let t=Buffer.from(e,"base64");if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let r=t.readUInt32BE(16),i=t.readUInt32BE(20);return{width:r,height:i}}if(t[0]===255&&t[1]===216){let r=2;while(r<t.length-8){if(t[r]!==255){r++;continue}let i=t[r+1];if(i===192||i===194){let o=t.readUInt16BE(r+5);return{width:t.readUInt16BE(r+7),height:o}}let n=t.readUInt16BE(r+2);r+=2+n}}if(t[0]===71&&t[1]===73&&t[2]===70){let r=t.readUInt16LE(6),i=t.readUInt16LE(8);return{width:r,height:i}}if(t.length>=30&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70){if(t[12]===86&&t[13]===80&&t[14]===56){if(t[15]===32){let r=t[26]??0,i=t[27]??0,n=t[28]??0,o=t[29]??0,s=(r|i<<8)&16383,c=(n|o<<8)&16383;return{width:s,height:c}}if(t[15]===76&&t.length>=25){let r=t.readUInt32LE(21),i=(r&16383)+1,n=(r>>14&16383)+1;return{width:i,height:n}}}}return null}class dj{entityType="image";purpose="Image assets such as generated covers, social previews, and uploaded images.";schema=lj;toMarkdown(e){return e.content}fromMarkdown(e){let{format:t,base64:r}=xd(e),i=Sd(r);return{entityType:"image",content:e,metadata:{format:t,width:i?.width??0,height:i?.height??0}}}extractMetadata(e){return e.metadata}parseFrontMatter(e,t){return t.parse({})}generateFrontMatter(e){return""}getBodyTemplate(){return""}createImageEntity(e){let{dataUrl:t,title:r,alt:i}=e,{format:n,base64:o}=xd(t),s=Sd(o),u=th(o)??n;return{entityType:"image",content:t,metadata:{title:r,alt:i??r,format:u,width:s?.width??0,height:s?.height??0,...e.status&&{status:e.status},...e.sourceUrl&&{sourceUrl:e.sourceUrl},...e.sourceEntityType&&{sourceEntityType:e.sourceEntityType},...e.sourceEntityId&&{sourceEntityId:e.sourceEntityId},...e.sourceUploadId&&{sourceUploadId:e.sourceUploadId},...e.sourceFilename&&{sourceFilename:e.sourceFilename},...e.sourceMediaType&&{sourceMediaType:e.sourceMediaType},...e.attachmentType&&{attachmentType:e.attachmentType},...e.dedupKey&&{dedupKey:e.dedupKey}}}}}var r$e=new dj;var CTt=a.record(a.string(),a.unknown());var ATt=mw();var eEt=a.object({title:a.string(),slug:a.string().optional(),coverImageUrl:a.url(),coverImageId:a.string().optional(),coverImageAlt:a.string().optional()});var s$e=a.object({syncPath:a.string(),autoSync:a.boolean().optional(),watchInterval:a.number().optional(),includeMetadata:a.boolean().optional(),entityTypes:a.array(a.string()).optional(),deleteOnFileRemoval:a.boolean().optional(),maxImportFileBytes:a.number().int().positive().optional()});var vte=a.object({operation:a.enum(["initial","scheduled","manual"]),paths:a.array(a.string()).optional(),entityTypes:a.array(a.string()).optional(),syncDirection:a.enum(["import","export","both"]).optional()}),wte=a.object({source:a.string().min(1),runId:a.string().min(1).optional(),interfaceType:a.string().optional(),channelId:a.string().optional()}),vd=a.object({operationId:a.string().min(1),rootJobId:a.string().min(1),childKey:a.string().min(1),expectedChildren:a.number().int().positive()}),kte=a.object({paths:a.array(a.string()).optional(),batchSize:a.number().min(1).optional(),batchIndex:a.number().optional(),projectionBatch:vd.optional()}),Ite=a.object({entityTypes:a.array(a.string()).optional(),batchSize:a.number().min(1).optional()}),Ste=a.object({entityId:a.string(),entityType:a.string(),filePath:a.string()}),Tte=a.union([Ste.extend({projectionBatch:vd.optional()}),a.object({deletions:a.array(Ste).min(1).max(50),projectionBatch:vd.optional()})]),Ete=a.object({filePath:a.string(),sourceUrl:a.url(),postTitle:a.string(),postSlug:a.string(),customAlt:a.string().optional()}),Cte=a.object({filePath:a.string(),postSlug:a.string()});var mj=a.object({syncPath:a.string(),exists:a.boolean(),watching:a.boolean(),lastSync:a.date().optional(),files:a.array(a.object({path:a.string(),entityType:a.string(),modified:a.date()})),stats:a.object({totalFiles:a.number(),byEntityType:a.record(a.string(),a.number())})}).describe("Directory synchronization status - use with directorySyncStatus formatter"),Pte=a.object({exported:a.number(),failed:a.number(),errors:a.array(a.object({entityId:a.string(),entityType:a.string(),error:a.string()}))}),Rte=a.object({imported:a.number(),skipped:a.number(),failed:a.number(),quarantined:a.number(),quarantinedFiles:a.array(a.string()),errors:a.array(a.object({path:a.string(),error:a.string()})),issues:a.array(a.object({path:a.string(),message:a.string()})).optional(),jobIds:a.array(a.string())}),c$e=a.object({export:Pte,import:Rte,duration:a.number()});var gRt=a.object({projectionBatch:vd.optional()});var TRt=a.record(a.string(),a.unknown());var GRt=a.record(a.string(),a.unknown());var kAt=a.object({entityType:a.string(),id:a.string(),sha:a.string().optional(),limit:a.number().int().positive().optional().default(10)});var _At=a.object({action:a.enum(["sync","status"]).default("sync").describe("Use sync for a refresh request and status for a status check")}),OAt=a.object({action:a.enum(["sync","status","history"]).default("sync").describe("Use sync for git/filesystem sync, status for a status check, and history only for entity history"),entityType:a.string().optional().describe("History only; omit for sync and status"),id:a.string().optional().describe("History only; omit for sync and status"),sha:a.string().optional().describe("Optional history revision; omit for sync and status"),limit:a.number().int().positive().optional().default(10).describe("History only; omit for sync and status")}),DAt=a.discriminatedUnion("action",[a.object({action:a.literal("sync")}),a.object({action:a.literal("status")})]),MAt=a.discriminatedUnion("action",[a.object({action:a.literal("sync")}),a.object({action:a.literal("status")}),a.object({action:a.literal("history"),entityType:a.string().min(1),id:a.string().min(1),sha:a.string().optional(),limit:a.number().int().positive().optional().default(10)})]);var Ote=a.enum(["manual","periodic","watcher","save"]),x$e=a.enum(["pulling","scanning","importing","settling"]),Dte={imported:a.number().int().nonnegative(),skipped:a.number().int().nonnegative(),failed:a.number().int().nonnegative(),quarantined:a.number().int().nonnegative(),exported:a.number().int().nonnegative()},S$e=a.preprocess((e)=>{if(typeof e!=="object"||e===null||"lastProgressAt"in e||!("startedAt"in e)||typeof e.startedAt!=="string")return e;return{...e,lastProgressAt:e.startedAt}},a.object({id:a.string().min(1),source:Ote,state:x$e,startedAt:a.string().datetime(),lastProgressAt:a.string().datetime(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional(),...Dte})),v$e=a.object({id:a.string().min(1),source:Ote,outcome:a.enum(["succeeded","attention","failed"]),startedAt:a.string().datetime(),completedAt:a.string().datetime(),summary:a.string().min(1).max(240),...Dte}),w$e=a.object({id:a.string().min(1),kind:a.enum(["quarantined","import","export","git","source"]),path:a.string().min(1).max(300).optional(),message:a.string().min(1).max(400),occurredAt:a.string().datetime()}),zAt=a.object({activeRun:S$e.optional(),recentRuns:a.array(v$e).max(5),issues:a.array(w$e).max(8)}),LAt=a.object({gitPulled:a.literal(!0),batchQueued:a.boolean(),batchId:a.string().optional(),importOperations:a.number().int().nonnegative().optional(),totalFiles:a.number().int().nonnegative().optional()});var BAt=a.object({lastProgressAt:a.string().datetime()});var Mte=a.string().regex(/^[a-f0-9]{40,64}$/),k$e=a.object({remoteFingerprint:a.string().regex(/^[a-f0-9]{64}$/),branch:a.string().min(1).max(200),lastReconciledGitHead:Mte,lastObservedRemoteHead:Mte.optional()}),HAt=a.object({checkpoint:k$e.optional()});var Fte={imported:a.number().int().nonnegative(),skipped:a.number().int().nonnegative(),failed:a.number().int().nonnegative(),quarantined:a.number().int().nonnegative(),exported:a.number().int().nonnegative()},I$e=a.object({health:a.enum(["healthy","active","attention"]),directory:a.object({displayPath:a.string().min(1),exists:a.boolean(),watching:a.boolean(),totalFiles:a.number().int().nonnegative(),byEntityType:a.record(a.string(),a.number().int().nonnegative()),lastSettledAt:a.string().datetime().optional()}),git:a.object({branch:a.string().min(1),remoteLabel:a.string().min(1).optional(),hasChanges:a.boolean(),ahead:a.number().int().nonnegative(),behind:a.number().int().nonnegative(),lastCommit:a.string().min(1).optional(),changedFiles:a.array(a.object({path:a.string().min(1),status:a.string().min(1)})),changedFilesTruncated:a.boolean()}).nullable(),automation:a.object({autoSync:a.boolean(),watchIntervalMs:a.number().int().nonnegative(),remoteIntervalMinutes:a.number().nonnegative().optional(),commitDebounceMs:a.number().int().nonnegative().optional(),deleteOnFileRemoval:a.boolean()}),activeRun:a.object({id:a.string().min(1),source:a.enum(["manual","periodic","watcher","save"]),state:a.enum(["pulling","scanning","importing","settling"]),startedAt:a.string().datetime(),lastProgressAt:a.string().datetime(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional(),...Fte}).optional(),recentRuns:a.array(a.object({id:a.string().min(1),source:a.enum(["manual","periodic","watcher","save"]),outcome:a.enum(["succeeded","attention","failed"]),startedAt:a.string().datetime(),completedAt:a.string().datetime(),summary:a.string().min(1),...Fte})),issues:a.array(a.object({id:a.string().min(1),kind:a.enum(["quarantined","import","export","git","source"]),path:a.string().min(1).optional(),message:a.string().min(1),occurredAt:a.string().datetime()}))}),$te=jw({name:"sync-now",label:"Sync now",permission:"admin",input:a.object({}),output:a.object({accepted:a.boolean(),status:a.string().min(1),runId:a.string().min(1).optional(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional()})});function T$e(e){let t=e.imported+e.skipped+e.failed+e.quarantined;return{type:"progress",id:"active-sync",label:"Directory sync",state:e.state,detail:`${t} files handled \xB7 ${e.exported} exported`,startedAt:e.startedAt,updatedAt:e.lastProgressAt,tone:e.failed>0||e.quarantined>0?"warn":"neutral"}}var QAt=Ow({id:"sync",label:"Sync",permission:"admin",data:I$e,actions:[$te],refresh:({data:e})=>e.activeRun?1000:void 0,view:({data:e})=>{let t=[];if(e.git)t.push({id:"git",label:e.git.remoteLabel??e.git.branch,status:e.issues.some((m)=>m.kind==="git")?"failed":e.git.hasChanges||e.git.ahead>0||e.git.behind>0?"active":"complete",detail:`${e.git.ahead} ahead \xB7 ${e.git.behind} behind`});let r=e.activeRun?[T$e(e.activeRun)]:[],i=e.git?.changedFiles.length?[{type:"list",id:"changed-files",empty:"No changed files.",items:e.git.changedFiles.map((m,f)=>({id:`changed-${f+1}`,title:m.path,badges:[{label:m.status}]}))}]:[],n={type:"stats",id:"sync-summary",items:[{label:"Files",value:e.directory.totalFiles,caption:"markdown + images"},{label:"Entity types",value:Object.keys(e.directory.byEntityType).length,caption:"within sync scope"},{label:"Issues",value:e.issues.length,caption:e.issues.length>0?"needs attention":"all clear",tone:e.issues.length>0?"warn":"good"}]},o=[{type:"flow",id:"sync-flow",label:"Content flow",direction:e.git?"bidirectional":"forward",steps:[{id:"directory",label:e.directory.displayPath,status:e.directory.exists?"complete":"failed",detail:e.directory.watching?"Watching for changes":"Watcher stopped"},{id:"scanner",label:"Scanner",status:e.activeRun?"active":"idle",detail:e.activeRun?.state},{id:"entities",label:"Entity store",status:e.issues.some((m)=>m.kind==="import")?"failed":e.directory.totalFiles>0?"complete":"idle"},...t]}],s={type:"group",id:"sync-automation",label:"Automation",items:[{id:"automatic",label:"Automatic sync",value:e.automation.autoSync},{id:"watch",label:"Watch interval",value:`${e.automation.watchIntervalMs} ms`},{id:"delete",label:"Delete removed files",value:e.automation.deleteOnFileRemoval},...e.automation.remoteIntervalMinutes===void 0?[]:[{id:"remote",label:"Remote interval",value:`${e.automation.remoteIntervalMinutes} min`}]]},c={type:"meters",id:"sync-meters",items:[{id:"files",label:"Content files",value:e.directory.totalFiles},{id:"issues",label:"Issues",value:e.issues.length,tone:e.issues.length>0?"warn":"good"},...e.git?[{id:"ahead",label:"Commits ahead",value:e.git.ahead},{id:"behind",label:"Commits behind",value:e.git.behind}]:[]]},u=[...r,{type:"list",id:"recent-runs",empty:"No directory sync runs have completed yet.",items:e.recentRuns.map((m)=>({id:m.id,title:`${m.source} \xB7 ${m.outcome}`,description:m.summary,badges:[{label:m.outcome}],tone:m.outcome==="succeeded"?"good":m.outcome==="failed"?"error":"warn",metadata:[`Imported: ${m.imported}`,`Exported: ${m.exported}`,`Completed: ${m.completedAt}`]}))},...i],l=e.issues.length===0?{type:"card",id:"sync-blockers-card",label:"No blockers",tone:"good",blocks:[{type:"notice",id:"sync-clear",text:"Directory exists, configured automation is available, and no unresolved operation failures are recorded.",tone:"good"}]}:{type:"card",id:"sync-blockers-card",label:"Needs attention",tone:"warn",blocks:[{type:"list",id:"sync-issues",empty:"No sync issues need attention.",items:e.issues.map((m)=>({id:m.id,title:m.kind,description:m.message,tone:"warn",metadata:[...m.path?[`Path: ${m.path}`]:[],`Occurred: ${m.occurredAt}`]}))}]},p=[n,{type:"columns",id:"sync-body",primary:[...o,...u],aside:[l,{type:"card",id:"sync-automation-card",label:"Automation",blocks:[s]},{type:"card",id:"sync-source-card",label:"Source",blocks:[{type:"key-values",id:"sync-source",items:[{label:"Directory",value:e.directory.displayPath},...e.git?[{label:"Branch",value:e.git.branch},{label:"Remote",value:e.git.remoteLabel??e.git.branch}]:[{label:"Remote",value:"files only"}]]}]},{type:"card",id:"sync-repository-card",label:"Repository",blocks:[c]},{type:"action",id:"sync-now",action:$te,input:{}}]}];return{kicker:"Durability operations",title:"Content sync",description:"Keep the entity database, its files, and the configured Git remote converged.",status:{label:e.health,...e.directory.lastSettledAt?{detail:`last settled ${e.directory.lastSettledAt}`}:{},tone:e.health==="healthy"?"good":"warn"},blocks:p}}});var jte="./brain-data";var bOt=a.object({syncPath:a.string().optional(),git:a.object({repo:a.string().optional(),gitUrl:a.string().optional()}).optional()});var Nte=5000;var zte="BRAIN_TEST_GIT_BROKER_WITHHOLD_COMPLETION",_$e={setInterval:(e,t)=>{let r=setInterval(e,t);return()=>{clearInterval(r)}}};async function Lte(e,t,r={}){let i=r.processImpl??process,n=r.startHost??wv,o=i.env[mm];if(!o)return{success:!1,message:`${mm} is unset; the Git broker is started by the Brain supervisor, not directly`,exitCode:1};let s=await n({socketPath:o,cwd:e,dataDir:jte,pluginConfig:kv(t.plugins?.["directory-sync"]??{},i.env),logger:_r.getInstance(),...i.env[zte]===void 0?{}:{testWithholdCompletionAfter:i.env[zte]}}).then((l)=>({broker:l,error:void 0}),(l)=>({broker:void 0,error:l}));if(!s.broker)return{success:!1,message:`Git broker failed to start: ${_e(s.error)}`,exitCode:1};i.on("message",(l)=>{if(typeof l==="object"&&l!==null&&"type"in l&&l.type==="broker-close-admission")s.broker.closeAdmission()}),i.send?.({type:"broker-ready"});let u=(r.heartbeatClock??_$e).setInterval(()=>{i.send?.({type:"broker-heartbeat",...s.broker.activity})},Nte);return await new Promise((l)=>{i.on("SIGTERM",l),i.on("SIGINT",l)}),u(),await s.broker.stop(),{success:!0}}var M$e=a.object({plugins:a.object({"directory-sync":a.unknown().optional()}).optional()}),Bte=process.cwd(),F$e=M$e.parse(gk(O$e(D$e(Bte,"brain.yaml"),"utf8"))),rh=await Lte(Bte,F$e).catch((e)=>({success:!1,message:`Git broker failed: ${_e(e)}`,exitCode:1}));if(!rh.success&&rh.message)console.error(rh.message);process.exit(rh.success?0:rh.exitCode??1);
|
|
226
|
+
`;return n;function o(s){return i.stack.push(s),c;function c(){i.stack.pop()}}}function C_e(e){throw Error("Cannot handle value `"+e+"`, expected node")}function P_e(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function R_e(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function A_e(e,t){return g8(e,this,t)}function __e(e,t){return h8(e,this,t)}function O_e(e,t){return x8(this,e,t)}function aw(e){let t=this;t.compiler=r;function r(i){return HF(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function WF(e){if(e)throw e}var dw=Rs(R8(),1);function Mg(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZF(){let e=[],t={run:r,use:i};return t;function r(...n){let o=-1,s=n.pop();if(typeof s!=="function")throw TypeError("Expected function as last argument, not "+s);c(null,...n);function c(u,...l){let p=e[++o],m=-1;if(u){s(u);return}while(++m<n.length)if(l[m]===null||l[m]===void 0)l[m]=n[m];if(n=l,p)A8(p,c)(...l);else s(null,...l)}}function i(n){if(typeof n!=="function")throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function A8(e,t){let r;return i;function i(...s){let c=e.length>s.length,u;if(c)s.push(n);try{u=e.apply(this,s)}catch(l){let p=l;if(c&&r)throw p;return n(p)}if(!c)if(u&&u.then&&typeof u.then==="function")u.then(o,n);else if(u instanceof Error)n(u);else o(u)}function n(s,...c){if(!r)r=!0,t(s,...c)}function o(s){n(null,s)}}class Jr extends Error{constructor(e,t,r){super();if(typeof t==="string")r=t,t=void 0;let i="",n={},o=!1;if(t)if("line"in t&&"column"in t)n={place:t};else if("start"in t&&"end"in t)n={place:t};else if("type"in t)n={ancestors:[t],place:t.position};else n={...t};if(typeof e==="string")i=e;else if(!n.cause&&e)o=!0,i=e.message,n.cause=e;if(!n.ruleId&&!n.source&&typeof r==="string"){let c=r.indexOf(":");if(c===-1)n.ruleId=r;else n.source=r.slice(0,c),n.ruleId=r.slice(c+1)}if(!n.place&&n.ancestors&&n.ancestors){let c=n.ancestors[n.ancestors.length-1];if(c)n.place=c.position}let s=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=qa(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=o&&n.cause&&typeof n.cause.stack==="string"?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jr.prototype.file="";Jr.prototype.name="";Jr.prototype.reason="";Jr.prototype.message="";Jr.prototype.stack="";Jr.prototype.column=void 0;Jr.prototype.line=void 0;Jr.prototype.ancestors=void 0;Jr.prototype.cause=void 0;Jr.prototype.fatal=void 0;Jr.prototype.place=void 0;Jr.prototype.ruleId=void 0;Jr.prototype.source=void 0;import{default as Yi}from"path";import{default as _8}from"process";import{fileURLToPath as O8}from"url";function uw(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var VF=["history","path","basename","stem","extname","dirname"];class lw{constructor(e){let t;if(!e)t={};else if(uw(e))t={path:e};else if(typeof e==="string"||D_e(e))t={value:e};else t=e;this.cwd="cwd"in t?"":_8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;while(++r<VF.length){let n=VF[r];if(n in t&&t[n]!==void 0&&t[n]!==null)this[n]=n==="history"?[...t[n]]:t[n]}let i;for(i in t)if(!VF.includes(i))this[i]=t[i]}get basename(){return typeof this.path==="string"?Yi.basename(this.path):void 0}set basename(e){KF(e,"basename"),GF(e,"basename"),this.path=Yi.join(this.dirname||"",e)}get dirname(){return typeof this.path==="string"?Yi.dirname(this.path):void 0}set dirname(e){D8(this.basename,"dirname"),this.path=Yi.join(e||"",this.basename)}get extname(){return typeof this.path==="string"?Yi.extname(this.path):void 0}set extname(e){if(GF(e,"extname"),D8(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=Yi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){if(uw(e))e=O8(e);if(KF(e,"path"),this.path!==e)this.history.push(e)}get stem(){return typeof this.path==="string"?Yi.basename(this.path,this.extname):void 0}set stem(e){KF(e,"stem"),GF(e,"stem"),this.path=Yi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){let i=this.message(e,t,r);throw i.fatal=!0,i}info(e,t,r){let i=this.message(e,t,r);return i.fatal=void 0,i}message(e,t,r){let i=new Jr(e,t,r);if(this.path)i.name=this.path+":"+i.name,i.file=this.path;return i.fatal=!1,this.messages.push(i),i}toString(e){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function GF(e,t){if(e&&e.includes(Yi.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Yi.sep+"`")}function KF(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function D8(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function D_e(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var M8=function(e){let i=this.constructor.prototype,n=i[e],o=function(){return n.apply(o,arguments)};return Object.setPrototypeOf(o,i),o};var M_e={}.hasOwnProperty;class e$ extends M8{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZF()}copy(){let e=new e$,t=-1;while(++t<this.attachers.length){let r=this.attachers[t];e.use(...r)}return e.data(dw.default(!0,{},this.namespace)),e}data(e,t){if(typeof e==="string"){if(arguments.length===2)return XF("data",this.frozen),this.namespace[e]=t,this;return M_e.call(this.namespace,e)&&this.namespace[e]||void 0}if(e)return XF("data",this.frozen),this.namespace=e,this;return this.namespace}freeze(){if(this.frozen)return this;let e=this;while(++this.freezeIndex<this.attachers.length){let[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;if(r[0]===!0)r[0]=void 0;let i=t.call(e,...r);if(typeof i==="function")this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=pw(e),r=this.parser||this.Parser;return QF("parse",r),r(String(t),t)}process(e,t){let r=this;return this.freeze(),QF("process",this.parser||this.Parser),YF("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(n,o){let s=pw(e),c=r.parse(s);r.run(c,s,function(l,p,m){if(l||!p||!m)return u(l);let f=p,g=r.stringify(f,m);if($_e(g))m.value=g;else m.result=g;u(l,m)});function u(l,p){if(l||!p)o(l);else if(n)n(p);else k(t,"`done` is defined if `resolve` is not"),t(void 0,p)}}}processSync(e){let t=!1,r;return this.freeze(),QF("processSync",this.parser||this.Parser),YF("processSync",this.compiler||this.Compiler),this.process(e,i),$8("processSync","process",t),k(r,"we either bailed on an error or have a tree"),r;function i(n,o){t=!0,WF(n),r=o}}run(e,t,r){F8(e),this.freeze();let i=this.transformers;if(!r&&typeof t==="function")r=t,t=void 0;return r?n(void 0,r):new Promise(n);function n(o,s){k(typeof t!=="function","`file` can\u2019t be a `done` anymore, we checked");let c=pw(t);i.run(e,c,u);function u(l,p,m){let f=p||e;if(l)s(l);else if(o)o(f);else k(r,"`done` is defined if `resolve` is not"),r(void 0,f,m)}}}runSync(e,t){let r=!1,i;return this.run(e,t,n),$8("runSync","run",r),k(i,"we either bailed on an error or have a tree"),i;function n(o,s){WF(o),i=s,r=!0}}stringify(e,t){this.freeze();let r=pw(t),i=this.compiler||this.Compiler;return YF("stringify",i),F8(e),i(e,r)}use(e,...t){let r=this.attachers,i=this.namespace;if(XF("use",this.frozen),e===null||e===void 0);else if(typeof e==="function")c(e,t);else if(typeof e==="object")if(Array.isArray(e))s(e);else o(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function n(u){if(typeof u==="function")c(u,[]);else if(typeof u==="object")if(Array.isArray(u)){let[l,...p]=u;c(l,p)}else o(u);else throw TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(s(u.plugins),u.settings)i.settings=dw.default(!0,i.settings,u.settings)}function s(u){let l=-1;if(u===null||u===void 0);else if(Array.isArray(u))while(++l<u.length){let p=u[l];n(p)}else throw TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,l){let p=-1,m=-1;while(++p<r.length)if(r[p][0]===u){m=p;break}if(m===-1)r.push([u,...l]);else if(l.length>0){let[f,...g]=l,S=r[m][1];if(Mg(S)&&Mg(f))f=dw.default(!0,S,f);r[m]=[u,f,...g]}}}}var t$=new e$().freeze();function QF(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `parser`")}function YF(e,t){if(typeof t!=="function")throw TypeError("Cannot `"+e+"` without `compiler`")}function XF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function F8(e){if(!Mg(e)||typeof e.type!=="string")throw TypeError("Expected node, got `"+e+"`")}function $8(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function pw(e){return F_e(e)?e:new lw(e)}function F_e(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function $_e(e){return typeof e==="string"||j_e(e)}function j_e(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var mw=t$().use(ew).use(aw).freeze();var ctt=mw();var j8=a.object({audiences:a.array(a.string()).optional(),positioning:a.string().optional()}),N8=a.object({summary:a.string().optional(),traits:a.array(a.string()).optional(),principles:a.array(a.string()).optional(),preferredTerms:a.array(a.string()).optional(),avoid:a.array(a.string()).optional()}),z8=a.object({artDirection:a.string().optional(),palette:a.array(a.string()).optional(),composition:a.string().optional(),mood:a.string().optional(),preferred:a.array(a.string()).optional(),avoid:a.array(a.string()).optional()}),z_e=a.object({name:a.string().describe("Style guide name"),messaging:j8.optional(),voice:N8.optional(),visual:z8.optional()});var L_e=a.object({id:a.string().min(1),trigger:a.string().min(1),playbookId:a.string().min(1),once:a.boolean().default(!0),starterText:a.string().min(1),description:a.string().min(1).optional(),starterPrompt:a.string().min(1)}).strict();var r$=a.object({message:a.string().describe("Natural language response to the query"),summary:a.string().optional().describe("Brief summary if applicable"),topics:a.array(a.string()).optional().describe("Related topics mentioned"),sources:a.array(a.object({id:a.string(),type:a.string(),excerpt:a.string().optional(),relevance:a.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:a.record(a.string(),a.unknown()).optional()}).describe("defaultQueryResponse"),L8=a.object({message:a.string()}).describe("simpleTextResponse"),n$=a.object({success:a.boolean(),entityId:a.string().optional(),message:a.string()}).describe("createEntityResponse"),i$=a.object({success:a.boolean(),entityId:a.string(),changes:a.array(a.string()).optional(),message:a.string()}).describe("updateEntityResponse");var B8=a.discriminatedUnion("type",[a.strictObject({type:a.literal("email"),address:a.email()})]),B_e=a.strictObject({recipient:B8.optional(),title:a.string().min(1),body:a.string().min(1),html:a.string().min(1).optional(),sensitivity:a.enum(["normal","secret"]).default("normal"),idempotencyKey:a.string().trim().min(1).max(200).optional()}),U_e=a.discriminatedUnion("status",[a.strictObject({status:a.literal("sent"),deliveryId:a.string().optional()}),a.strictObject({status:a.literal("failed")})]);var G_e=a.object({enabled:a.boolean().describe("Whether the plugin is enabled"),debug:a.boolean().describe("Enable debug logging for this plugin")});var Crt=a.object({toolName:a.string(),args:a.unknown(),progressToken:a.union([a.string(),a.number()]).optional(),hasProgress:a.boolean().optional(),interfaceType:a.string(),actor:si,displayName:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),runId:a.string().optional(),toolCallId:a.string().optional(),userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional(),signal:a.custom((e)=>e instanceof AbortSignal).optional()}),Prt=a.object({resourceUri:a.string()});var Q8=a.object({id:a.string(),template:a.string(),content:a.unknown().optional(),dataQuery:a.looseObject({entityType:a.string().optional(),template:a.string().optional(),query:a.looseObject({id:a.string().optional(),limit:a.number().optional(),offset:a.number().optional()}).optional()}).optional(),order:a.number().optional()}),a$=["primary","secondary"],Y8=a.object({show:a.boolean().default(!1),label:a.string().optional(),slot:a.enum(a$).default("primary"),priority:a.number().min(0).max(100).default(50)}).optional(),c$=a.object({id:a.string(),path:a.string(),title:a.string().default(""),pageLabel:a.string().optional(),description:a.string().default(""),sections:a.array(Q8).default([]),layout:a.string().default("default"),fullscreen:a.boolean().optional(),pluginId:a.string().optional(),sourceEntityType:a.string().optional(),external:a.boolean().optional(),navigation:Y8}),X8=a.object({routes:a.array(c$),pluginId:a.string()}),e7=a.object({paths:a.array(a.string()).optional(),pluginId:a.string().optional()}),t7=a.object({pluginId:a.string().optional()}),r7=a.object({path:a.string()}),gw=a.object({label:a.string(),href:a.string(),priority:a.number()});var u$=a.object({heading:a.string().describe("Main CTA heading text"),buttonText:a.string().describe("Call-to-action button text"),buttonLink:a.string().describe("URL or anchor for the CTA button")}),n7=a.object({blurb:a.string().optional().describe("Short italic subtitle under the section title")}),hw=a.object({represents:a.enum(["brain","anchor"]).default("anchor").describe("Identity represented by the site"),title:a.string().describe("The site's title"),description:a.string().describe("The site's description"),url:a.string().optional().describe("Canonical site URL"),copyright:a.string().optional().describe("Copyright notice text"),logo:a.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:a.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:a.string().optional().describe("Analytics script HTML"),cta:u$.optional().describe("Call-to-action configuration"),sections:a.record(a.string(),n7).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")});var Q_e=a.object({platform:a.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:a.string().describe("Profile or contact URL"),label:a.string().optional().describe("Optional display label")}),Y_e=hw.extend({copyright:a.string(),navigation:a.object({primary:a.array(gw),secondary:a.array(gw)}),socialLinks:a.array(Q_e).optional().describe("Social media links from profile metadata")});var $rt=a.record(a.string(),a.unknown());var qrt=a.object({message:a.string()});var Xrt=a.record(a.string(),a.unknown());var rnt=a.record(a.string(),a.unknown());var cOe=a.object({slug:a.string(),title:a.string(),type:a.string(),entityId:a.string(),contentHash:a.string()});var uOe=hw.omit({url:!0,analyticsScript:!0}),lOe=uOe.extend({title:a.string().optional().describe("Optional site title override"),description:a.string().optional().describe("Optional site description override")});var o7=["primary","secondary"];var pOe=a.custom((e)=>typeof e==="function","Expected a Preact component"),dOe=a.strictObject({show:a.boolean().optional(),label:a.string().min(1).optional(),slot:a.enum(o7).optional(),priority:a.number().optional()}),mOe=a.strictObject({id:a.string().min(1),template:a.string().min(1),content:a.unknown().optional(),dataQuery:a.looseObject({entityType:a.string().optional(),template:a.string().optional(),query:a.record(a.string(),a.unknown()).optional()}).optional(),order:a.number().optional()}),fOe=a.strictObject({id:a.string().min(1),path:a.string().startsWith("/"),title:a.string().optional(),pageLabel:a.string().optional(),description:a.string().optional(),sections:a.array(mOe).optional(),layout:a.string().min(1).optional(),fullscreen:a.boolean().optional(),pluginId:a.string().optional(),sourceEntityType:a.string().optional(),external:a.boolean().optional(),navigation:dOe.optional()}),gOe=a.strictObject({label:a.string().min(1),pluralName:a.string().min(1).optional(),layout:a.string().min(1).optional(),paginate:a.boolean().optional(),pageSize:a.number().int().positive().optional(),navigation:a.strictObject({show:a.boolean().optional(),slot:a.enum(o7).optional(),priority:a.number().optional()}).optional()}),hOe=a.strictObject({schema:a.custom((e)=>e instanceof a.ZodType,"Expected a Zod schema"),component:a.custom((e)=>typeof e==="function","Expected a Preact component"),title:a.string().min(1),description:a.string(),requiredPermission:a.enum(["admin","trusted","public"]).optional(),fullscreen:a.boolean().optional()}),i7=a.strictObject({namespace:a.string().min(1),sections:a.record(a.string(),hOe)}),yOe=a.record(a.string(),a.json()),bOe=a.record(a.string(),a.record(a.string(),yOe)),s7=a.strictObject({layouts:a.record(a.string(),pOe).refine((e)=>typeof e.default==="function",{message:'Site layouts must include a "default" component'}),routes:a.array(fOe),content:bOe.optional(),sections:a.union([i7,a.array(i7)]).optional(),themeOverride:a.string().optional(),headScripts:a.array(a.string()).optional(),entityDisplay:a.record(a.string(),gOe),staticAssets:a.record(a.string(),a.string()).optional()}).superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.routes.entries()){if(r.has(s.id))t.addIssue({code:"custom",path:["routes",o,"id"],message:`Duplicate route id "${s.id}"`});r.add(s.id);let c=s.layout??"default";if(!e.layouts[c])t.addIssue({code:"custom",path:["routes",o,"layout"],message:`Unknown layout "${c}"`})}let i=Array.isArray(e.sections)?e.sections:e.sections?[e.sections]:[],n=new Map(i.map((o)=>[o.namespace,o]));if(n.size!==i.length)t.addIssue({code:"custom",path:["sections"],message:"Section group namespaces must be unique"});for(let[o,s]of Object.entries(e.content??{})){let c=n.get(o);if(!c){t.addIssue({code:"custom",path:["content",o],message:`Content namespace "${o}" has no section group`});continue}for(let[u,l]of Object.entries(s)){let p=c.sections[u];if(!p){t.addIssue({code:"custom",path:["content",o,u],message:`Content section "${o}.${u}" is not defined`});continue}let m=p.schema.safeParse(l);if(!m.success)t.addIssue({code:"custom",path:["content",o,u],message:`Content does not satisfy the "${o}.${u}" schema: ${a.prettifyError(m.error)}`})}}});var xOe=a.string();function SOe(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var vOe=a.custom((e)=>{if(!SOe(e))return!1;let{plugin:t,...r}=e;if(t!==void 0&&typeof t!=="function")return!1;return s7.safeParse(r).success});var p$=a.enum(["file_operations","content_operations","data_processing","batch_processing"]),kOe=a.object({pluginId:a.string().optional(),progressToken:a.union([a.string(),a.number()]).optional(),operationType:p$,operationTarget:a.string().optional(),interfaceType:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),requestedByActor:si.optional(),requestedByUserId:a.string().optional(),requestedByInterface:a.string().optional(),silent:a.boolean().optional(),provenance:Zp.optional()}),ld=a.object({pluginId:a.string().optional(),progressToken:a.union([a.string(),a.number()]).optional(),operationType:p$,operationTarget:a.string().optional(),interfaceType:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),requestedByActor:si.optional(),requestedByUserId:a.string().optional(),requestedByInterface:a.string().optional(),silent:a.boolean().optional(),provenance:Zp.optional(),rootJobId:a.string()}),vit=a.enum(["none","skip","replace","coalesce"]);var IOe=a.object({id:a.string(),type:a.string(),data:a.string(),status:a.enum(["pending","processing","completed","failed"]),source:a.string().nullable(),priority:a.number(),retryCount:a.number(),maxRetries:a.number(),lastError:a.string().nullable(),createdAt:a.number(),scheduledFor:a.number(),startedAt:a.number().nullable(),completedAt:a.number().nullable(),attemptId:a.string().nullable(),workerSlotId:a.string().nullable(),workerSessionId:a.string().nullable(),leaseExpiresAt:a.number().nullable(),attemptHeartbeatAt:a.number().nullable(),runtimeUpdatedAt:a.number().nullable(),metadata:ld,progress:a.custom((e)=>typeof e==="object"&&e!==null&&("progress"in e)&&typeof e.progress==="number").nullable(),result:a.unknown().nullable().optional()});var d$=a.enum(["pending","processing","completed","failed"]),a7=a.enum(["completed","failed"]);var TOe=a.object({id:a.string(),type:a.string(),status:d$,data:a.unknown(),result:a.unknown().optional(),lastError:a.string().optional().nullable(),attempts:a.number(),maxRetries:a.number(),priority:a.number(),createdAt:a.date(),updatedAt:a.date(),processedAt:a.date().optional().nullable(),completedAt:a.date().optional().nullable(),failedAt:a.date().optional().nullable()}),EOe=a.object({jobId:a.string(),type:a.string(),status:a7,result:a.unknown().optional(),error:a.string().optional()}),c7=a.object({success:a.literal(!1),error:a.string().optional()}),m$=a.object({id:a.string(),type:a.enum(["job","batch"]),status:d$,message:a.string().optional(),progress:a.object({current:a.number(),total:a.number(),percentage:a.number()}).optional(),aggregationKey:a.string().optional(),batchDetails:a.object({totalOperations:a.number(),completedOperations:a.number(),failedOperations:a.number(),currentOperation:a.string().optional(),errors:a.array(a.string()).optional()}).optional(),jobDetails:a.object({jobType:a.string(),priority:a.number(),retryCount:a.number()}).optional(),metadata:ld});import{createClient as vst}from"@libsql/client";var ie=Symbol.for("drizzle:entityKind");function an(e,t){if(!e||typeof e!=="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,ie))throw 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 r=Object.getPrototypeOf(e).constructor;if(r)while(r){if(ie in r&&r[ie]===t[ie])return!0;r=Object.getPrototypeOf(r)}return!1}class Ha{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[ie]="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(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class $g{static[ie]="ColumnBuilder";config;constructor(e,t,r){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){if(this.config.name!=="")return;this.config.name=e}}var Jn=Symbol.for("drizzle:Name");class f${static[ie]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){if(this.reference=()=>{let{name:r,columns:i,foreignColumns:n}=e();return{name:r,columns:i,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e===void 0?"no action":e,this}onDelete(e){return this._onDelete=e===void 0?"no action":e,this}build(e){return new u7(e,this)}}class u7{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[ie]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map((s)=>s.name),n=r.map((s)=>s.name),o=[this.table[Jn],...i,r[0].table[Jn],...n];return e??`${o.join("_")}_fk`}}function yw(e,...t){return e(...t)}function g$(e,t){return`${e[Jn]}_${t.join("_")}_unique`}class l7{constructor(e,t){this.name=t,this.columns=e}static[ie]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new p7(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class COe{static[ie]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new l7(e,this.name)}}class p7{constructor(e,t,r,i){this.table=e,this.columns=t,this.name=i??g$(this.table,this.columns.map((n)=>n.name)),this.nullsNotDistinct=r}static[ie]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}}function d7(e,t,r){for(let i=t;i<e.length;i++){let n=e[i];if(n==="\\"){i++;continue}if(n==='"')return[e.slice(t,i).replace(/\\/g,""),i+1];if(r)continue;if(n===","||n==="}")return[e.slice(t,i).replace(/\\/g,""),i]}return[e.slice(t).replace(/\\/g,""),e.length]}function m7(e,t=0){let r=[],i=t,n=!1;while(i<e.length){let o=e[i];if(o===","){if(n||i===t)r.push("");n=!0,i++;continue}if(n=!1,o==="\\"){i+=2;continue}if(o==='"'){let[u,l]=d7(e,i+1,!0);r.push(u),i=l;continue}if(o==="}")return[r,i+1];if(o==="{"){let[u,l]=m7(e,i+1);r.push(u),i=l;continue}let[s,c]=d7(e,i,!1);r.push(s),i=c}return[r,i]}function f7(e){let[t]=m7(e,1);return t}function h$(e){return`{${e.map((t)=>{if(Array.isArray(t))return h$(t);if(typeof t==="string")return`"${t.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${t}`}).join(",")}}`}class jg extends $g{foreignKeyConfigs=[];static[ie]="PgColumnBuilder";array(e){return new h7(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>yw((n,o)=>{let s=new f$(()=>{let c=n();return{columns:[e],foreignColumns:[c]}});if(o.onUpdate)s.onUpdate(o.onUpdate);if(o.onDelete)s.onDelete(o.onDelete);return s.build(t)},r,i))}buildExtraConfigColumn(e){return new g7(e,this.config)}}class pd extends Ha{constructor(e,t){if(!t.uniqueName)t.uniqueName=g$(e,[t.name]);super(e,t);this.table=e}static[ie]="PgColumn"}class g7 extends pd{static[ie]="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(e){return this.indexConfig.opClass=e,this}}class POe{static[ie]="IndexedColumn";constructor(e,t,r,i){this.name=e,this.keyAsName=t,this.type=r,this.indexConfig=i}name;keyAsName;type;indexConfig}class h7 extends jg{static[ie]="PgArrayBuilder";constructor(e,t,r){super(e,"array","PgArray");this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new y$(e,this.config,t)}}class y$ extends pd{constructor(e,t,r,i){super(e,t);this.baseColumn=r,this.range=i,this.size=t.size}size;static[ie]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(e){if(typeof e==="string")e=f7(e);return e.map((t)=>this.baseColumn.mapFromDriverValue(t))}mapToDriverValue(e,t=!1){let r=e.map((i)=>i===null?null:an(this.baseColumn,y$)?this.baseColumn.mapToDriverValue(i,!0):this.baseColumn.mapToDriverValue(i));if(t)return r;return h$(r)}}class ROe extends jg{static[ie]="PgEnumObjectColumnBuilder";constructor(e,t){super(e,"string","PgEnumObjectColumn");this.config.enum=t}build(e){return new b7(e,this.config)}}class b7 extends pd{static[ie]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}}var y7=Symbol.for("drizzle:isPgEnum");function x7(e){return!!e&&typeof e==="function"&&y7 in e&&e[y7]===!0}class AOe extends jg{static[ie]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn");this.config.enum=t}build(e){return new S7(e,this.config)}}class S7 extends pd{static[ie]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}}class Ng{static[ie]="Subquery";constructor(e,t,r,i=!1,n=[]){this._={brand:"Subquery",sql:e,selectedFields:t,alias:r,isWith:i,usedTables:n}}}class _Oe extends Ng{static[ie]="WithSubquery"}var v7="0.45.2";var b$,x$,w7={startActiveSpan(e,t){if(!b$)return t();if(!x$)x$=b$.trace.getTracer("drizzle-orm",v7);return yw((r,i)=>i.startActiveSpan(e,(n)=>{try{return t(n)}catch(o){throw n.setStatus({code:r.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{n.end()}}),b$,x$)}};var dd=Symbol.for("drizzle:ViewBaseConfig");var S$=Symbol.for("drizzle:Schema"),k7=Symbol.for("drizzle:Columns"),I7=Symbol.for("drizzle:ExtraConfigColumns"),v$=Symbol.for("drizzle:OriginalName"),w$=Symbol.for("drizzle:BaseName"),zg=Symbol.for("drizzle:IsAlias"),T7=Symbol.for("drizzle:ExtraConfigBuilder"),OOe=Symbol.for("drizzle:IsDrizzleTable");class fr{static[ie]="Table";static Symbol={Name:Jn,Schema:S$,OriginalName:v$,Columns:k7,ExtraConfigColumns:I7,BaseName:w$,IsAlias:zg,ExtraConfigBuilder:T7};[Jn];[v$];[S$];[k7];[I7];[w$];[zg]=!1;[OOe]=!0;[T7]=void 0;constructor(e,t,r){this[Jn]=this[v$]=e,this[S$]=t,this[w$]=r}}class DOe{static[ie]="FakePrimitiveParam"}function MOe(e){return e!==null&&e!==void 0&&typeof e.getSQL==="function"}function FOe(e){let t={sql:"",params:[]};for(let r of e)if(t.sql+=r.sql,t.params.push(...r.params),r.typings?.length){if(!t.typings)t.typings=[];t.typings.push(...r.typings)}return t}class Di{static[ie]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new gr([this])}}class gr{constructor(e){this.queryChunks=e;for(let t of e)if(an(t,fr)){let r=t[fr.Symbol.Schema];this.usedTables.push(r===void 0?t[fr.Symbol.Name]:r+"."+t[fr.Symbol.Name])}}static[ie]="SQL";decoder=E7;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return w7.startActiveSpan("drizzle.buildSQL",(t)=>{let r=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,t){let r=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{casing:i,escapeName:n,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:u}=r;return FOe(e.map((l)=>{if(an(l,Di))return{sql:l.value.join(""),params:[]};if(an(l,bw))return{sql:n(l.value),params:[]};if(l===void 0)return{sql:"",params:[]};if(Array.isArray(l)){let p=[new Di("(")];for(let[m,f]of l.entries())if(p.push(f),m<l.length-1)p.push(new Di(", "));return p.push(new Di(")")),this.buildQueryFromSourceParams(p,r)}if(an(l,gr))return this.buildQueryFromSourceParams(l.queryChunks,{...r,inlineParams:c||l.shouldInlineParams});if(an(l,fr)){let p=l[fr.Symbol.Schema],m=l[fr.Symbol.Name];return{sql:p===void 0||l[zg]?n(m):n(p)+"."+n(m),params:[]}}if(an(l,Ha)){let p=i.getColumnCasing(l);if(t.invokeSource==="indexes")return{sql:n(p),params:[]};let m=l.table[fr.Symbol.Schema];return{sql:l.table[zg]||m===void 0?n(l.table[fr.Symbol.Name])+"."+n(p):n(m)+"."+n(l.table[fr.Symbol.Name])+"."+n(p),params:[]}}if(an(l,P7)){let p=l[dd].schema,m=l[dd].name;return{sql:p===void 0||l[dd].isAlias?n(m):n(p)+"."+n(m),params:[]}}if(an(l,k$)){if(an(l.value,xw))return{sql:o(u.value++,l),params:[l],typings:["none"]};let p=l.value===null?null:l.encoder.mapToDriverValue(l.value);if(an(p,gr))return this.buildQueryFromSourceParams([p],r);if(c)return{sql:this.mapInlineParam(p,r),params:[]};let m=["none"];if(s)m=[s(l.encoder)];return{sql:o(u.value++,p),params:[p],typings:m}}if(an(l,xw))return{sql:o(u.value++,l),params:[l],typings:["none"]};if(an(l,gr.Aliased)&&l.fieldAlias!==void 0)return{sql:n(l.fieldAlias),params:[]};if(an(l,Ng)){if(l._.isWith)return{sql:n(l._.alias),params:[]};return this.buildQueryFromSourceParams([new Di("("),l._.sql,new Di(") "),new bw(l._.alias)],r)}if(x7(l)){if(l.schema)return{sql:n(l.schema)+"."+n(l.enumName),params:[]};return{sql:n(l.enumName),params:[]}}if(MOe(l)){if(l.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([l.getSQL()],r);return this.buildQueryFromSourceParams([new Di("("),l.getSQL(),new Di(")")],r)}if(c)return{sql:this.mapInlineParam(l,r),params:[]};return{sql:o(u.value++,l),params:[l],typings:["none"]}}))}mapInlineParam(e,{escapeString:t}){if(e===null)return"null";if(typeof e==="number"||typeof e==="boolean")return e.toString();if(typeof e==="string")return t(e);if(typeof e==="object"){let r=e.toString();if(r==="[object Object]")return t(JSON.stringify(e));return t(r)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){if(e===void 0)return this;return new gr.Aliased(this,e)}mapWith(e){return this.decoder=typeof e==="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class bw{constructor(e){this.value=e}static[ie]="Name";brand;getSQL(){return new gr([this])}}var E7={mapFromDriverValue:(e)=>e},C7={mapToDriverValue:(e)=>e},yot={...E7,...C7};class k${constructor(e,t=C7){this.value=e,this.encoder=t}static[ie]="Param";brand;getSQL(){return new gr([this])}}function Fu(e,...t){let r=[];if(t.length>0||e.length>0&&e[0]!=="")r.push(new Di(e[0]));for(let[i,n]of t.entries())r.push(n,new Di(e[i+1]));return new gr(r)}((e)=>{function t(){return new gr([])}e.empty=t;function r(u){return new gr(u)}e.fromList=r;function i(u){return new gr([new Di(u)])}e.raw=i;function n(u,l){let p=[];for(let[m,f]of u.entries()){if(m>0&&l!==void 0)p.push(l);p.push(f)}return new gr(p)}e.join=n;function o(u){return new bw(u)}e.identifier=o;function s(u){return new xw(u)}e.placeholder=s;function c(u,l){return new k$(u,l)}e.param=c})(Fu||(Fu={}));((e)=>{class t{constructor(r,i){this.sql=r,this.fieldAlias=i}static[ie]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(gr||(gr={}));class xw{constructor(e){this.name=e}static[ie]="Placeholder";getSQL(){return new gr([this])}}var $Oe=Symbol.for("drizzle:IsDrizzleView");class P7{static[ie]="View";[dd];[$Oe]=!0;constructor({name:e,schema:t,selectedFields:r,query:i}){this[dd]={name:e,originalName:e,schema:t,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new gr([this])}}Ha.prototype.getSQL=function(){return new gr([this])};fr.prototype.getSQL=function(){return new gr([this])};Ng.prototype.getSQL=function(){return new gr([this])};function Ro(e,t){return{name:typeof e==="string"&&e.length>0?e:"",config:typeof e==="object"?e:t}}var I$=typeof TextDecoder>"u"?null:new TextDecoder;class T${static[ie]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){if(this.reference=()=>{let{name:r,columns:i,foreignColumns:n}=e();return{name:r,columns:i,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new R7(e,this)}}class R7{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[ie]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map((s)=>s.name),n=r.map((s)=>s.name),o=[this.table[Jn],...i,r[0].table[Jn],...n];return e??`${o.join("_")}_fk`}}function E$(e,t){return`${e[Jn]}_${t.join("_")}_unique`}class A7{constructor(e,t){this.name=t,this.columns=e}static[ie]="SQLiteUniqueConstraintBuilder";columns;build(e){return new _7(e,this.columns,this.name)}}class jOe{static[ie]="SQLiteUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new A7(e,this.name)}}class _7{constructor(e,t,r){this.table=e,this.columns=t,this.name=r??E$(this.table,this.columns.map((i)=>i.name))}static[ie]="SQLiteUniqueConstraint";columns;name;getName(){return this.name}}class Or extends $g{static[ie]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>((n,o)=>{let s=new T$(()=>{let c=n();return{columns:[e],foreignColumns:[c]}});if(o.onUpdate)s.onUpdate(o.onUpdate);if(o.onDelete)s.onDelete(o.onDelete);return s.build(t)})(r,i))}}class Dr extends Ha{constructor(e,t){if(!t.uniqueName)t.uniqueName=E$(e,[t.name]);super(e,t);this.table=e}static[ie]="SQLiteColumn"}class O7 extends Or{static[ie]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new D7(e,this.config)}}class D7 extends Dr{static[ie]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString("utf8"))}return BigInt(I$.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class M7 extends Or{static[ie]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new F7(e,this.config)}}class F7 extends Dr{static[ie]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString("utf8"))}return JSON.parse(I$.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class $7 extends Or{static[ie]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new j7(e,this.config)}}class j7 extends Dr{static[ie]="SQLiteBlobBuffer";mapFromDriverValue(e){if(Buffer.isBuffer(e))return e;return Buffer.from(e)}getSQLType(){return"blob"}}function N7(e,t){let{name:r,config:i}=Ro(e,t);if(i?.mode==="json")return new M7(r);if(i?.mode==="bigint")return new O7(r);return new $7(r)}class z7 extends Or{static[ie]="SQLiteCustomColumnBuilder";constructor(e,t,r){super(e,"custom","SQLiteCustomColumn");this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new L7(e,this.config)}}class L7 extends Dr{static[ie]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t);this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom==="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo==="function"?this.mapTo(e):e}}function Sw(e){return(t,r)=>{let{name:i,config:n}=Ro(t,r);return new z7(i,n,e)}}class vw extends Or{static[ie]="SQLiteBaseIntegerBuilder";constructor(e,t,r){super(e,t,r);this.config.autoIncrement=!1}primaryKey(e){if(e?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}}class ww extends Dr{static[ie]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class B7 extends vw{static[ie]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new U7(e,this.config)}}class U7 extends ww{static[ie]="SQLiteInteger"}class q7 extends vw{static[ie]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp");this.config.mode=t}defaultNow(){return this.default(Fu`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new J7(e,this.config)}}class J7 extends ww{static[ie]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){if(this.config.mode==="timestamp")return new Date(e*1000);return new Date(e)}mapToDriverValue(e){let t=e.getTime();if(this.config.mode==="timestamp")return Math.floor(t/1000);return t}}class H7 extends vw{static[ie]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean");this.config.mode=t}build(e){return new W7(e,this.config)}}class W7 extends ww{static[ie]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}}function je(e,t){let{name:r,config:i}=Ro(e,t);if(i?.mode==="timestamp"||i?.mode==="timestamp_ms")return new q7(r,i.mode);if(i?.mode==="boolean")return new H7(r,i.mode);return new B7(r)}class Z7 extends Or{static[ie]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new V7(e,this.config)}}class V7 extends Dr{static[ie]="SQLiteNumeric";mapFromDriverValue(e){if(typeof e==="string")return e;return String(e)}getSQLType(){return"numeric"}}class G7 extends Or{static[ie]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new K7(e,this.config)}}class K7 extends Dr{static[ie]="SQLiteNumericNumber";mapFromDriverValue(e){if(typeof e==="number")return e;return Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class Q7 extends Or{static[ie]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new Y7(e,this.config)}}class Y7 extends Dr{static[ie]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function X7(e,t){let{name:r,config:i}=Ro(e,t),n=i?.mode;return n==="number"?new G7(r):n==="bigint"?new Q7(r):new Z7(r)}class eX extends Or{static[ie]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new tX(e,this.config)}}class tX extends Dr{static[ie]="SQLiteReal";getSQLType(){return"real"}}function rX(e){return new eX(e??"")}class nX extends Or{static[ie]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText");this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new iX(e,this.config)}}class iX extends Dr{static[ie]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class oX extends Or{static[ie]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new sX(e,this.config)}}class sX extends Dr{static[ie]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function X(e,t={}){let{name:r,config:i}=Ro(e,t);if(i.mode==="json")return new oX(r);return new nX(r,i)}function aX(){return{blob:N7,customType:Sw,integer:je,numeric:X7,real:rX,text:X}}var C$=Symbol.for("drizzle:SQLiteInlineForeignKeys");class Lg extends fr{static[ie]="SQLiteTable";static Symbol=Object.assign({},fr.Symbol,{InlineForeignKeys:C$});[fr.Symbol.Columns];[C$]=[];[fr.Symbol.ExtraConfigBuilder]=void 0}function NOe(e,t,r,i,n=e){let o=new Lg(e,i,n),s=typeof t==="function"?t(aX()):t,c=Object.fromEntries(Object.entries(s).map(([l,p])=>{let m=p;m.setName(l);let f=m.build(o);return o[C$].push(...m.buildForeignKeys(f,o)),[l,f]})),u=Object.assign(o,c);if(u[fr.Symbol.Columns]=c,u[fr.Symbol.ExtraConfigColumns]=c,r)u[Lg.Symbol.ExtraConfigBuilder]=r;return u}var Nt=(e,t,r)=>NOe(e,t,r);class cX{constructor(e,t){this.name=e,this.value=t}static[ie]="SQLiteCheckBuilder";brand;build(e){return new uX(e,this)}}class uX{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static[ie]="SQLiteCheck";name;value}function lX(e,t){return new cX(e,t)}class P${constructor(e,t){this.name=e,this.unique=t}static[ie]="SQLiteIndexBuilderOn";on(...e){return new pX(this.name,e,this.unique)}}class pX{static[ie]="SQLiteIndexBuilder";config;constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new dX(this.config,e)}}class dX{static[ie]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function It(e){return new P$(e,!1)}function R$(e){return new P$(e,!0)}function li(...e){if(e[0].columns)return new A$(e[0].columns,e[0].name);return new A$(e)}class A${static[ie]="SQLitePrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new mX(e,this.columns,this.name)}}class mX{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static[ie]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[Lg.Symbol.Name]}_${this.columns.map((e)=>e.name).join("_")}_pk`}}var fX=Nt("job_queue",{id:X("id").primaryKey().$defaultFn(()=>jr()),type:X("type").notNull(),data:X("data").notNull(),result:X("result",{mode:"json"}),progress:X("progress",{mode:"json"}).$type(),source:X("source"),metadata:X("metadata",{mode:"json"}).$type().notNull(),status:X("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:je("priority").notNull().default(0),retryCount:je("retryCount").notNull().default(0),maxRetries:je("maxRetries").notNull().default(3),lastError:X("lastError"),createdAt:je("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:je("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:je("startedAt"),completedAt:je("completedAt"),attemptId:X("attemptId"),workerSlotId:X("workerSlotId"),workerSessionId:X("workerSessionId"),leaseExpiresAt:je("leaseExpiresAt"),attemptHeartbeatAt:je("attemptHeartbeatAt"),runtimeUpdatedAt:je("runtimeUpdatedAt")},(e)=>({queueReadyIdx:It("idx_job_queue_ready").on(e.status,e.priority,e.scheduledFor),jobTypeIdx:It("idx_job_queue_type").on(e.type,e.status),runtimeUpdatesIdx:It("idx_job_queue_runtime_updates").on(e.runtimeUpdatedAt,e.id),jobSourceIdx:It("idx_job_queue_source").on(e.source)})),gX=Nt("job_worker_sessions",{slotId:X("slotId").primaryKey(),sessionId:X("sessionId").notNull().unique(),startedAt:je("startedAt").notNull(),heartbeatAt:je("heartbeatAt").notNull(),expiresAt:je("expiresAt").notNull().default(0)},(e)=>({heartbeatIdx:It("idx_job_worker_sessions_heartbeat").on(e.heartbeatAt),expiresIdx:It("idx_job_worker_sessions_expires").on(e.expiresAt)}));var Ust=a.looseObject({deduplicationKey:a.string().optional()});var Qst=new xA;var _at=a.preprocess((e)=>{if(typeof e!=="string")return e;return JSON.parse(e)},a.record(a.string(),a.unknown()));var Mat=a.record(a.string(),a.unknown());var JOe=a.custom((e)=>typeof e==="object"&&e!==null&&("safeParse"in e)),ect=a.object({name:a.string(),schema:JOe});var Iw=Nt("conversations",{id:X("id").primaryKey(),sessionId:X("session_id").notNull(),interfaceType:X("interface_type").notNull(),channelId:X("channel_id").notNull(),personId:X("person_id"),started:X("started").notNull(),lastActive:X("last_active").notNull(),metadata:X("metadata"),created:X("created").notNull(),updated:X("updated").notNull()},(e)=>({sessionIdx:It("idx_conversations_session").on(e.sessionId),channelIdx:It("idx_conversations_channel").on(e.channelId),personIdx:It("idx_conversations_person").on(e.personId),interfaceSessionIdx:It("idx_conversations_interface_session").on(e.interfaceType,e.sessionId),interfaceChannelIdx:It("idx_conversations_interface_channel").on(e.interfaceType,e.channelId)})),hX=Nt("messages",{id:X("id").primaryKey(),conversationId:X("conversation_id").notNull().references(()=>Iw.id,{onDelete:"cascade"}),role:X("role").notNull(),content:X("content").notNull(),timestamp:X("timestamp").notNull(),metadata:X("metadata")},(e)=>({conversationIdx:It("idx_messages_conversation").on(e.conversationId),timestampIdx:It("idx_messages_timestamp").on(e.timestamp)})),yX=Nt("summary_tracking",{conversationId:X("conversation_id").primaryKey().references(()=>Iw.id,{onDelete:"cascade"}),lastSummarizedAt:X("last_summarized_at"),lastMessageId:X("last_message_id"),messagesSinceSummary:je("messages_since_summary").default(0),updated:X("updated").notNull()});var lct=a.preprocess((e)=>{if(typeof e!=="string")return e;try{return JSON.parse(e)}catch{return}},a.record(a.string(),a.unknown())).catch({});var qg=a.object({identity:si,interfaceType:a.string(),role:Wp,displayName:a.string().optional(),username:a.string().optional(),isBot:a.boolean().optional()}),HOe=a.preprocess(WOe,qg);function WOe(e){if(!ZOe(e)||"identity"in e)return e;let{actorId:t,interfaceType:r,role:i}=e;if(typeof t!=="string"||typeof r!=="string"||i!=="user"&&i!=="assistant")return e;let{userId:n,canonicalId:o}=e;return{identity:zM({actorId:t,interfaceType:r,role:i,...typeof n==="string"?{userId:n}:{},...typeof o==="string"?{canonicalId:o}:{}}),interfaceType:r,role:i,...typeof e.displayName==="string"?{displayName:e.displayName}:{},...typeof e.username==="string"?{username:e.username}:{},...typeof e.isBot==="boolean"?{isBot:e.isBot}:{}}}var Jg=a.object({messageId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),threadId:a.string().optional(),metadata:a.record(a.string(),a.unknown()).optional()}),bX=a.looseObject({actor:HOe.optional(),source:Jg.optional()});function ZOe(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var VOe=a.object({id:a.string(),conversationId:a.string(),role:a.string(),content:a.string(),timestamp:a.string(),metadata:a.string().nullable()}),xX=a.object({conversationId:a.string(),messageCount:a.number(),messages:a.array(VOe),windowStart:a.number(),windowEnd:a.number(),windowSize:a.number(),timestamp:a.string()});var Hg=a.record(a.string(),a.unknown());var QOe=a.object({id:a.string(),sessionId:a.string(),interfaceType:a.string(),channelId:a.string(),personId:a.string().optional(),channelName:a.string().optional(),startedAt:a.string(),lastActiveAt:a.string(),createdAt:a.string(),updatedAt:a.string(),metadata:Hg}),YOe=a.object({id:a.string(),conversationId:a.string(),role:Wp,content:a.string(),timestamp:a.string(),metadata:Hg});var vX=a.object({name:a.string(),role:a.string(),purpose:a.string(),values:a.array(a.string())}),wX=a.object({name:a.string(),organization:a.string().optional(),description:a.string().optional(),avatar:a.string().optional(),website:a.string().optional(),email:a.string().optional(),socialLinks:a.array(a.object({platform:a.enum(["github","instagram","linkedin","email","website"]),url:a.string(),label:a.string().optional()})).optional()});var kX=a.object({name:a.string(),description:a.string(),tags:a.array(a.string()),examples:a.array(a.string())});var Wg=Nt("entities",{id:X("id").notNull(),entityType:X("entityType").notNull(),content:X("content").notNull(),contentHash:X("contentHash").notNull(),visibility:X("visibility",{enum:["public","shared","restricted"]}).notNull().default("public"),metadata:X("metadata",{mode:"json"}).$type().notNull().default(Fu`'{}'`),created:je("created").notNull().$defaultFn(()=>Date.now()),updated:je("updated").notNull().$defaultFn(()=>Date.now())},(e)=>({pk:li({columns:[e.id,e.entityType]}),visibilityCheck:lX("entities_visibility_check",Fu`${e.visibility} IN ('public', 'shared', 'restricted')`)}));var IX=Nt("entity_export_intents",{entityType:X("entity_type").notNull(),entityId:X("entity_id").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),revision:X("revision").notNull(),markedAt:je("marked_at").notNull()},(e)=>({pk:li({columns:[e.entityType,e.entityId]}),markedAtIdx:It("entity_export_intents_marked_at_idx").on(e.markedAt)}));var TX=Nt("projection_entity_owners",{entityType:X("entity_type").notNull(),entityId:X("entity_id").notNull(),ruleId:X("rule_id").notNull(),ruleVersion:X("rule_version").notNull(),inputFingerprint:X("input_fingerprint").notNull(),claimedAt:je("claimed_at").notNull()},(e)=>({pk:li({columns:[e.entityType,e.entityId]}),ruleIdx:It("projection_entity_owners_rule_idx").on(e.ruleId)})),EX=Nt("projection_dirty_inputs",{generation:je("generation").primaryKey({autoIncrement:!0}),sourceType:X("source_type").notNull(),sourceId:X("source_id").notNull(),revision:X("revision").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),markedAt:je("marked_at").notNull()},(e)=>({generationIdx:It("projection_dirty_inputs_generation_idx").on(e.generation)})),Zg=Nt("projection_waves",{id:X("id").primaryKey(),cutoffGeneration:je("cutoff_generation").notNull(),graphFingerprint:X("graph_fingerprint").notNull(),admissionEpoch:je("admission_epoch").notNull().default(0),status:X("status",{enum:["running","completed","failed","superseded"]}).notNull(),startedAt:je("started_at").notNull(),completedAt:je("completed_at")}),CX=Nt("projection_incidents",{waveId:X("wave_id").primaryKey().references(()=>Zg.id,{onDelete:"cascade"}),ruleId:X("rule_id").notNull(),jobId:X("job_id"),failureReason:X("failure_reason").notNull(),recoveryGeneration:je("recovery_generation").notNull(),createdAt:je("created_at").notNull(),resolvedAt:je("resolved_at")},(e)=>({unresolvedIdx:It("projection_incidents_unresolved_idx").on(e.resolvedAt,e.createdAt)})),PX=Nt("projection_wave_inputs",{waveId:X("wave_id").notNull().references(()=>Zg.id,{onDelete:"cascade"}),sourceType:X("source_type").notNull(),sourceId:X("source_id").notNull(),revision:X("revision").notNull(),operation:X("operation",{enum:["upsert","delete"]}).notNull(),generation:je("generation").notNull()},(e)=>({pk:li({columns:[e.waveId,e.sourceType,e.sourceId]}),generationIdx:It("projection_wave_inputs_generation_idx").on(e.waveId,e.generation)})),RX=Nt("projection_wave_rules",{waveId:X("wave_id").notNull().references(()=>Zg.id,{onDelete:"cascade"}),ruleId:X("rule_id").notNull(),targetType:X("target_type").notNull(),level:je("level").notNull(),jobId:X("job_id"),status:X("status",{enum:["pending","queued","completed","failed"]}).notNull(),inputFingerprint:X("input_fingerprint"),changedTargets:X("changed_targets",{mode:"json"}).$type().notNull().default([])},(e)=>({pk:li({columns:[e.waveId,e.ruleId]}),statusIdx:It("projection_wave_rules_status_idx").on(e.waveId,e.status,e.level)})),AX=Nt("projection_rule_memos",{ruleId:X("rule_id").notNull(),ruleVersion:X("rule_version").notNull(),inputFingerprint:X("input_fingerprint").notNull(),writeIntents:X("write_intents",{mode:"json"}).$type().notNull(),createdAt:je("created_at").notNull()},(e)=>({pk:li({columns:[e.ruleId,e.ruleVersion,e.inputFingerprint]})}));var _X=Sw({dataType(){return"F32_BLOB(1536)"},toDriver(e){return Buffer.from(e.buffer)},fromDriver(e){return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4)}});var Tw=Nt("embeddings",{entityId:X("entity_id").notNull(),entityType:X("entity_type").notNull(),embedding:_X("embedding").notNull(),contentHash:X("content_hash").notNull()},(e)=>({pk:li({columns:[e.entityId,e.entityType]})}));var clt=a.object({id:a.string().min(1,"Entity ID is required"),entityType:a.string().min(1,"Entity type is required"),contentHash:a.string().min(1,"Content hash is required"),operation:a.enum(["create","update"])});var D$=a.enum(["public","shared","restricted"]),Wa=a.union([D$,a.literal("private")]).optional().transform((e)=>{if(e===void 0)return"public";if(e==="private")return"restricted";return e});var Cs=a.object({id:a.string(),entityType:a.string(),content:a.string(),created:a.string().datetime(),updated:a.string().datetime(),visibility:Wa,metadata:a.record(a.string(),a.unknown()),contentHash:a.string()}),tDe=a.enum(["public","shared","restricted"]),Cw=a.object({id:a.string(),entityType:a.string(),content:a.string(),created:a.string().datetime(),updated:a.string().datetime(),visibility:a.union([tDe,a.literal("private")]).optional().transform((e)=>{if(e===void 0)return"public";if(e==="private")return"restricted";return e}),metadata:a.record(a.string(),a.unknown()),contentHash:a.string()}),F$=a.object({}),rDe=a.object({mediaType:a.string(),url:a.string(),downloadUrl:a.string().optional(),previewUrl:a.string().optional(),filename:a.string().optional(),sizeBytes:a.number().optional(),source:a.object({entityType:a.string().optional(),entityId:a.string().optional(),attachmentType:a.string().optional()}).optional()});var wlt=a.object({limit:a.number().int().positive().optional().default(20),offset:a.number().int().min(0).optional().default(0),types:a.array(a.string()).optional().default([]),excludeTypes:a.array(a.string()).optional().default([]),weight:a.record(a.string(),a.number()).optional(),visibilityScope:a.enum(["public","shared","restricted"]).optional(),includeUngenerated:a.boolean().optional().default(!1),minScore:a.number().min(0).optional()}),klt=a.preprocess((e)=>{if(typeof e!=="string")return e;return JSON.parse(e)},a.record(a.string(),a.unknown()));var nDe=Rs(pF(),1);var Elt=a.object({visibility:a.enum(["public","shared","restricted","private"]).optional().transform((e)=>{if(e===void 0)return;return e==="private"?"restricted":e})});var Alt=a.looseObject({issues:a.array(a.looseObject({message:a.string()}))});var Nlt=a.record(a.string(),a.unknown());var iDe=a.object({field:a.string(),direction:a.enum(["asc","desc"]),nullsFirst:a.boolean().optional()}),Wlt=a.object({limit:a.number().int().positive().optional(),offset:a.number().int().min(0).optional().default(0),sortFields:a.array(iDe).optional(),filter:a.object({metadata:a.record(a.string(),a.unknown()).optional(),visibilityScope:a.enum(["public","shared","restricted"]).optional()}).optional(),publishedOnly:a.boolean().optional()});var ept=a.custom((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e));var tpt=a.object({id:a.string().min(1),entityType:a.string().min(1),contentHash:a.string().min(1)});var md=a.lazy(()=>a.union([a.null(),a.boolean(),a.number().finite().refine((e)=>!Number.isInteger(e)||Number.isSafeInteger(e),{message:"integer exceeds the JSON-safe range"}),a.string(),a.array(md),a.record(a.string(),md)])),$u=a.record(a.string(),md),oDe=a.strictObject({id:a.string().trim().min(1),entityType:a.string().trim().min(1),content:a.string(),metadata:$u,visibility:Wa}),Vg=a.discriminatedUnion("operation",[a.strictObject({operation:a.literal("upsert"),entity:oDe}),a.strictObject({operation:a.literal("delete"),entityType:a.string().trim().min(1),id:a.string().trim().min(1)})]);var sDe=Nt("projection_admission_state",{id:je("id").primaryKey(),epoch:je("epoch").notNull().default(0)}),jX=Nt("projection_batches",{id:X("id").primaryKey(),source:X("source").notNull(),operationId:X("operation_id").notNull(),status:X("status",{enum:["preparing","open","closed","abandoned"]}).notNull(),ownerKind:X("owner_kind",{enum:["callback","job-root"]}).notNull(),ownerToken:X("owner_token").notNull(),rootJobId:X("root_job_id"),expectedChildren:je("expected_children").notNull().default(0),enqueueComplete:je("enqueue_complete").notNull().default(0),enqueueFailed:je("enqueue_failed").notNull().default(0),openedAt:je("opened_at").notNull(),lastProgressAt:je("last_progress_at").notNull(),leaseExpiresAt:je("lease_expires_at"),terminalAt:je("terminal_at"),recoveredAt:je("recovered_at"),firstGeneration:je("first_generation"),highestGeneration:je("highest_generation"),mutationCount:je("mutation_count").notNull().default(0),recoveryGeneration:je("recovery_generation")},(e)=>({operationIdx:R$("projection_batches_operation_idx").on(e.source,e.operationId),admissionIdx:It("projection_batches_admission_idx").on(e.status,e.openedAt),rootJobIdx:It("projection_batches_root_job_idx").on(e.rootJobId),recoveryIdx:It("projection_batches_recovery_idx").on(e.recoveredAt,e.recoveryGeneration)})),aDe=Nt("projection_batch_children",{batchId:X("batch_id").notNull().references(()=>jX.id,{onDelete:"cascade"}),childKey:X("child_key").notNull(),jobId:X("job_id"),status:X("status",{enum:["expected","active","completed","failed","missing"]}).notNull().default("expected"),terminalAt:je("terminal_at")},(e)=>({pk:li({columns:[e.batchId,e.childKey]}),jobIdx:R$("projection_batch_children_job_idx").on(e.jobId),statusIdx:It("projection_batch_children_status_idx").on(e.batchId,e.status)}));var vpt=a.strictObject({sourceType:a.string().trim().min(1),sourceId:a.string().trim().min(1),revision:a.string().trim().min(1),operation:a.enum(["upsert","delete"]),markedAt:a.number().int().nonnegative()}),wpt=a.strictObject({waveId:a.string().trim().min(1),ruleId:a.string().trim().min(1),jobId:a.string().trim().min(1).nullable(),failureReason:a.string().trim().min(1).max(500),failedAt:a.number().int().nonnegative()}),kpt=a.strictObject({ruleId:a.string().trim().min(1),ruleVersion:a.string().trim().min(1),inputFingerprint:a.string().trim().min(1)}),Ipt=a.strictObject({entityType:a.string().trim().min(1),id:a.string().trim().min(1)}),Tpt=a.strictObject({ruleId:a.string().trim().min(1),targetType:a.string().trim().min(1),level:a.number().int().nonnegative()}),uDe=a.strictObject({source:a.string().trim().min(1).max(100),operationId:a.string().trim().min(1).max(200)});var lDe=uDe.extend({rootJobId:a.string().trim().min(1).max(200),expectedChildren:a.number().int().positive().max(1e4)}),Ept=lDe.extend({rootJobId:a.string().trim().min(1).max(200),childKey:a.string().trim().min(1).max(200),expectedChildren:a.number().int().positive().max(1e4),jobId:a.string().trim().min(1).max(200)}),Cpt=a.strictObject({operationId:a.string().trim().min(1).max(200),childKey:a.string().trim().min(1).max(200),jobId:a.string().trim().min(1).max(200),outcome:a.enum(["completed","failed"])}),Ppt=a.strictObject({entityType:a.string().trim().min(1),entityId:a.string().trim().min(1),operation:a.enum(["upsert","delete"]),contentHash:a.string().min(1).optional()});var ydt=a.record(a.string(),a.unknown());var LX=a.object({currentPage:a.number(),totalPages:a.number(),totalItems:a.number(),pageSize:a.number(),hasNextPage:a.boolean(),hasPrevPage:a.boolean()});var ADe=a.object({name:a.string(),description:a.string(),schema:a.any(),basePrompt:a.string().optional(),useKnowledgeContext:a.boolean().optional(),requiredPermission:a.enum(["admin","trusted","public"]),formatter:a.any().optional(),overlayFormatter:a.any().optional(),layout:a.object({component:a.any().optional(),fullscreen:a.boolean().optional()}).optional(),dataSourceId:a.string().optional()});var qX=new Map;function Gg(e,t){if(e===t)return!0;let r=qX.get(e);if(!r){let i=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&");r=new RegExp(`^${i.replace(/\*/g,".*")}$`),qX.set(e,r)}return r.test(t)}var HX=a.enum(["admin","trusted","public"]),_De=a.enum(["create","update","delete","extract","publish"]),gd=a.enum(["never","admin","trusted","public"]),WX=a.strictObject({create:gd.optional(),update:gd.optional(),delete:gd.optional(),extract:gd.optional(),publish:gd.optional()}),ZX=a.record(a.string(),WX),VX={create:"Creating",update:"Updating",delete:"Deleting",extract:"Extracting",publish:"Publishing"},JX={public:"Public",trusted:"Trusted",admin:"Admin"};class L$ extends Error{entityType;action;callerLevel;requiredLevel;constructor(e){super(`${VX[e.action]} \`${e.entityType}\` requires ${JX[e.requiredLevel]} permission; your current permission is ${JX[e.callerLevel]}.`);this.name="EntityActionPermissionError",this.entityType=e.entityType,this.action=e.action,this.callerLevel=e.callerLevel,this.requiredLevel=e.requiredLevel}}class Za{admins;anchors;trusted;configuredPrincipalSeeds;rules;spaces;entityActions;constructor(e,t={}){if(this.configuredPrincipalSeeds={admins:[...e.admins??[]],anchors:[...e.anchors??[]],trusted:[...e.trusted??[]]},this.admins=z$(this.configuredPrincipalSeeds.admins),this.anchors=z$(this.configuredPrincipalSeeds.anchors),this.trusted=z$(this.configuredPrincipalSeeds.trusted),this.rules=e.rules??[],this.spaces=t.spaces??[],e.entityActions)this.entityActions=ZX.parse(e.entityActions)}determineUserLevel(e,t,r={}){let i=`${e}:${t}`,n=hd(e,bg(e,t));if(this.admins.has(n))return"admin";if(this.trusted.has(n))return"trusted";let o=this.getPatternLevel(i);if(o==="admin"||o==="trusted")return o;if(this.spaces.length>0&&this.matchesConfiguredSpace({interfaceType:e,...r}))return"trusted";return o??"public"}isAnchor(e,t){return this.anchors.has(hd(e,bg(e,t)))}getConfiguredPrincipalSeeds(){return{admins:[...this.configuredPrincipalSeeds.admins],anchors:[...this.configuredPrincipalSeeds.anchors],trusted:[...this.configuredPrincipalSeeds.trusted]}}replaceRuntimePrincipalState(e){this.admins=new Set(e.grants.filter((t)=>t.permissionLevel==="admin").map((t)=>hd(t.interfaceType,t.principalKeyHash))),this.trusted=new Set(e.grants.filter((t)=>t.permissionLevel==="trusted").map((t)=>hd(t.interfaceType,t.principalKeyHash))),this.anchors=new Set(e.anchors.map((t)=>hd(t.interfaceType,t.principalKeyHash)))}getResolvedEntityActionPolicy(e){if(!this.entityActions)return;let t={...this.entityActions["*"]??{},...this.entityActions[e]??{}};return Object.keys(t).length>0?t:void 0}getEntityActionRequiredLevel(e,t){return this.getResolvedEntityActionPolicy(e)?.[t]}getRequiredEntityActionLevel(e,t){return this.getEntityActionRequiredLevel(e,t)}canPerformEntityAction(e,t,r){let i=this.getEntityActionRequiredLevel(t,r);if(!i)return!0;if(i==="never")return!1;return this.hasPermission(e??"public",i)}assertEntityActionAllowed(e,t,r){let i=this.getEntityActionRequiredLevel(e,t);if(!i)return;if(i==="never")throw Error(`${VX[t]} \`${e}\` is not allowed through system tools.`);let n=r??"public";if(this.hasPermission(n,i))return;throw new L$({entityType:e,action:t,callerLevel:n,requiredLevel:i})}hasPermission(e,t){return Za.hasPermission(e,t)}filterByPermission(e,t){return e.filter((r)=>{let i=r.visibility??"public";return this.hasPermission(t,i)})}static hasPermission(e,t){if(t==="public")return!0;if(t==="trusted")return e==="trusted"||e==="admin";return e==="admin"}getPatternLevel(e){for(let t of this.rules)if(Gg(t.pattern,e))return t.level;return}matchesConfiguredSpace(e){if(e.isBot||e.isGuest)return!1;if(!e.channelId)return!1;let t=`${e.interfaceType}:${e.channelId}`;return this.spaces.some((r)=>Gg(r,t))}}function z$(e){return new Set(e.map((t)=>{let r=qM(t);return hd(r.interfaceType,bg(r.interfaceType,r.subject))}))}function hd(e,t){return`${e.trim().toLowerCase()}:${t}`}var ODe=a.enum(["site-content-preview","site-content-production"]),GX=a.enum(["web","image","pdf"]),B$=a.custom((e)=>typeof e==="function"),DDe=a.object({name:a.string(),schema:a.any(),description:a.string().optional(),pluginId:a.string(),renderers:a.object({web:a.union([B$,a.string()]).optional(),image:a.union([B$,a.string()]).optional(),pdf:a.union([B$,a.string()]).optional()})}),MDe=a.object({enableContentGeneration:a.boolean().default(!1),outputDir:a.string(),workingDir:a.string().optional(),environment:a.enum(["preview","production"]).default("preview"),siteConfig:a.object({title:a.string(),description:a.string(),url:a.string().optional()}).optional()}),FDe=a.object({success:a.boolean(),routesBuilt:a.number(),errors:a.array(a.string()).optional(),warnings:a.array(a.string()).optional()});var YX=a.object({});var aft=a.strictObject({id:a.string().trim().min(1),version:a.string().trim().min(1),sources:a.array(a.strictObject({kind:a.literal("entity"),types:a.array(a.string().trim().min(1)).min(1),excludeTypes:a.array(a.string().trim().min(1)).optional()})),targetType:a.string().trim().min(1),sourceChangeBatchDelayMs:a.number().int().nonnegative().default(0)});var Cft=a.union([a.string(),a.number().finite(),a.boolean(),a.null()]);var BDe=/^[a-z][a-z0-9-]*$/,UDe=a.strictObject({source:a.string().min(1).max(500),flags:a.string().regex(/^[imu]*$/).optional()}),Aft=a.strictObject({type:a.string().trim().regex(BDe),displayName:a.string().trim().min(1).max(100),subjectLabel:a.string().trim().min(1).max(100),subjectPattern:UDe.optional(),manualDelivery:a.boolean().optional()});var XX=/[\s\\\p{Cc}\p{Cf}]/u;function eee(e){if(typeof e!=="string"||e!==e.trim()||e.length===0||e.length>2048||!e.startsWith("/")||e.startsWith("//")||XX.test(e))return;try{let t=new URL(e,"https://brains.invalid");if(t.origin!=="https://brains.invalid")return;let r=`${t.pathname}${t.search}${t.hash}`;return r.length>0&&r.length<=2048&&r.startsWith("/")&&!r.startsWith("//")&&!XX.test(r)?r:void 0}catch{return}}var qDe=/^[a-z][a-z0-9-]*$/,_o=a.string().trim().regex(qDe),tee=a.string().trim().min(1).max(300),ree=a.enum(["high","normal"]),U$=_o.max(40),q$=_o.max(40),nee=a.strictObject({value:q$,label:a.string().trim().min(1).max(100)}),iee=a.strictObject({key:U$,label:a.string().trim().min(1).max(100),values:a.array(nee).min(1).max(20)}).superRefine((e,t)=>{let r=new Set;for(let i of e.values){if(r.has(i.value))t.addIssue({code:"custom",path:["values"],message:`Duplicate inbox facet value: ${i.value}`});r.add(i.value)}}),oee=a.array(iee).max(8).superRefine((e,t)=>{let r=new Set;for(let i of e){if(r.has(i.key))t.addIssue({code:"custom",path:[],message:`Duplicate inbox facet key: ${i.key}`});r.add(i.key)}}),see=a.record(U$,q$).refine((e)=>Object.keys(e).length<=8,{message:"Inbox items may declare at most eight facets"}),JDe=a.string().regex(/^[a-z][A-Za-z0-9]{0,39}$/),HDe=a.string().min(1).max(300).refine((e)=>!/[\p{Cc}\p{Cf}]/u.test(e),{message:"Inbox follow-up context values cannot contain controls"}),WDe=a.strictObject({kind:_o,context:a.record(JDe,HDe).refine((e)=>Object.keys(e).length<=8,{message:"Inbox follow-up context may contain at most eight entries"})}),ZDe=a.array(WDe).max(8).superRefine((e,t)=>{let r=new Set;for(let i of e){if(r.has(i.kind))t.addIssue({code:"custom",path:[],message:`Duplicate inbox follow-up kind: ${i.kind}`});r.add(i.kind)}}),aee=a.strictObject({id:_o,label:a.string().trim().min(1).max(100),confirm:a.boolean().optional()}),cee=a.strictObject({entityType:a.string().trim().min(1).max(100),entityId:a.string().trim().min(1).max(300)}),uee=a.strictObject({label:a.string().trim().min(1).max(300),personId:a.string().trim().min(1).max(200).optional()}),J$=a.strictObject({id:tee,title:a.string().trim().min(1).max(160),summary:a.string().trim().min(1).max(1000).optional(),contact:uee.optional(),threadOrdinal:a.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),receivedAt:a.iso.datetime(),urgency:ree,entityRef:cee.optional(),facets:see.optional(),followUps:ZDe.optional(),actions:a.array(aee).max(10)}).superRefine((e,t)=>{let r=new Set;for(let i of e.actions){if(r.has(i.id))t.addIssue({code:"custom",path:["actions"],message:`Duplicate inbox action id: ${i.id}`});r.add(i.id)}}),VDe=a.array(J$).max(1000),lee=a.strictObject({permissionLevel:a.enum(["admin","trusted","public"])}),GDe=a.strictObject({kind:a.literal("plain"),text:a.string().max(1e5),truncated:a.boolean()}),KDe=a.strictObject({sourceId:_o,displayName:a.string().trim().min(1).max(100)}),QDe=a.strictObject({sourceId:_o,displayName:a.string().trim().min(1).max(100),facets:oee.optional()});var YDe=2048,XDe=8192,zft=a.strictObject({kind:_o,label:a.string().trim().min(1).max(100),priority:a.number().int().min(0).max(1000),mode:a.enum(["universal","declared"]),permissionLevel:a.enum(["admin","trusted","public"]),contextSchema:a.custom((e)=>typeof e==="object"&&e!==null&&("safeParse"in e)&&typeof e.safeParse==="function").optional(),applies:a.custom((e)=>typeof e==="function"),resolve:a.custom((e)=>typeof e==="function")}).superRefine((e,t)=>{if(e.mode==="declared"&&e.contextSchema===void 0)t.addIssue({code:"custom",path:["contextSchema"],message:"Declared inbox follow-up kinds require a context schema"});if(e.mode==="universal"&&e.contextSchema!==void 0)t.addIssue({code:"custom",path:["contextSchema"],message:"Universal inbox follow-up kinds cannot accept context"})}),Lft=a.strictObject({href:a.string(),state:a.unknown().optional()}),e0e=a.record(a.string(),a.json()).refine((e)=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=XDe,{message:"Inbox follow-up state is too large"}),t0e=a.strictObject({kind:_o,label:a.string().trim().min(1).max(100),href:a.string().min(1).max(YDe).refine((e)=>eee(e)===e),state:e0e.optional()});var H$=/^upload-[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;var Zft=a.object({id:a.string().regex(H$),ref:a.object({kind:a.string().min(1),id:a.string().regex(H$)}),filename:a.string().min(1),mediaType:a.string().min(1),sizeBytes:a.number().nonnegative(),createdAt:a.string().datetime(),metadata:a.record(a.string(),a.unknown()).optional()});function Ps(e,t){if(!/^[a-z][a-z0-9-]*$/u.test(e))throw Error(`${t} must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`)}var rgt=a.record(a.string(),a.unknown()),ngt=a.object({items:a.array(a.object({operation:a.enum(["upsert","delete"]),id:a.string(),source:$u.optional()}))});var ugt=a.object({});import{McpServer as kgt,ResourceTemplate as Igt}from"@modelcontextprotocol/server";var pee=a.object({interfaceType:a.string(),actor:si,displayName:a.string().optional(),conversationId:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),runId:a.string().optional(),toolCallId:a.string().optional(),userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional()}),dee=a.strictObject({success:a.literal(!0),data:a.unknown().optional(),message:a.string().optional(),cached:a.literal(!0).optional()}),mee=a.strictObject({success:a.literal(!1),error:a.string(),code:a.string().optional()}),fee=a.strictObject({needsConfirmation:a.literal(!0),toolName:a.string(),summary:a.string(),completionSummary:a.string().optional(),preview:a.string().optional(),args:a.unknown()}),Aw=a.union([dee,mee,fee]);var hgt=a.union([a.looseObject({success:a.literal(!0)}),a.object({success:a.literal(!1),error:a.string()})]);var gee=a.union([a.object({success:a.literal(!0),data:a.unknown(),message:a.string().optional()}),a.object({success:a.literal(!1),error:a.string(),code:a.string().optional()})]);var a0e=["public","trusted","admin"];function Va(e,t){if(!e.trim())throw Error(`${t} must not be empty`)}function G$(e,t){if(e!==void 0)Va(e,t)}function yee(e,t){if(e!==void 0&&!Number.isFinite(e))throw Error(`${t} priority must be finite`)}function _w(e,t){if(!a0e.includes(e))throw Error(`${t} permission "${String(e)}" is unsupported`)}function Kg(e,t){return Za.hasPermission(e,t)}var l0e=Symbol("rizom.cms-workspace-executor");function Ow(e){Ps(e.id,"CMS workspace id"),Va(e.label,`CMS workspace "${e.id}" label`),G$(e.description,`CMS workspace "${e.id}" description`),yee(e.priority,`CMS workspace "${e.id}"`),_w(e.permission,`CMS workspace "${e.id}"`);let t=new Set;for(let i of e.actions){if(t.has(i.name))throw Error(`CMS workspace "${e.id}" declares action "${i.name}" more than once`);if(t.add(i.name),i.permission!==void 0&&!Kg(i.permission,e.permission))throw Error(`CMS workspace "${e.id}" action "${i.name}" permission cannot be lower than the workspace permission`)}let r={kind:"rizom-cms-workspace",...e,...e.entities?{entities:Object.freeze([...e.entities])}:{},actions:Object.freeze([...e.actions]),bind(i,n){if(r.entityCatalog!==void 0!==(n.listEntityTypes!==void 0))throw Error(`CMS workspace "${r.id}" must bind one entity-type catalog callback exactly when it declares entityCatalog`);let o=new Set;for(let s of n.actions){if(!r.actions.includes(s.definition))throw Error(`CMS workspace "${r.id}" cannot bind undeclared action "${s.definition.name}"`);if(o.has(s.definition))throw Error(`CMS workspace "${r.id}" binds action "${s.definition.name}" more than once`);o.add(s.definition)}for(let s of r.actions)if(!o.has(s))throw Error(`CMS workspace "${r.id}" has no executor for action "${s.name}"`);return Object.freeze({kind:"rizom-cms-workspace-binding",definition:r,actions:Object.freeze([...n.actions]),[l0e]:Object.freeze({...n.authorize?{authorize:n.authorize}:{},load:n.load,...n.listEntityTypes?{listEntityTypes:n.listEntityTypes}:{}})})}};return Object.freeze(r)}var Ce=a.string().trim().min(1).max(120),Qg=a.string().trim().min(1).max(400),Ne=a.string().trim().min(1).max(160),Mr=a.string().max(500),Ga=a.string().max(4000),p0e=a.string().max(1e5),Tn=a.enum(["good","warn","neutral","error"]),Fw=a.union([a.string().max(2000),a.number().finite(),a.boolean(),a.null()]),bee=a.string().max(2048).refine((e)=>{try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"}catch{return!1}},{message:"External operator links must use http or https"});function d0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-entity"&&"type"in e&&typeof e.type==="string"&&e.type.length>0}var m0e=a.custom(d0e,{message:"Expected an imported entity definition"});function f0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-entity-catalog"&&"id"in e&&typeof e.id==="string"&&"label"in e&&typeof e.label==="string"}var g0e=a.custom(f0e,{message:"Expected an imported entity catalog definition"});function h0e(e){return{kind:"external",href:e.external}}function y0e(e){return{kind:"entity",entityType:e.entity.type,id:e.id}}var xee=a.union([a.object({target:a.literal("account-settings")}).strict(),a.object({target:a.literal("admin-peer-invite"),peerId:Ce,displayName:Ne}).strict(),a.object({target:a.literal("inbox")}).strict(),a.object({target:a.literal("inbox"),source:a.literal("mail"),filter:a.enum(["high-priority","needs-reply","unclassified"]).optional()}).strict(),a.object({target:a.literal("publishing")}).strict(),a.object({target:a.literal("site")}).strict(),a.object({target:a.literal("inbox-open-entity"),entityType:Ce,entityId:Ce}).strict(),a.object({target:a.literal("inbox-capture-note"),title:Mr,summary:a.string().trim().min(1).max(1000).optional(),entityType:Ce,entityId:Ce}).strict(),a.object({target:a.literal("inbox-discuss-in-chat"),sourceId:Ce,itemId:a.string().trim().min(1).max(300),label:a.string().trim().min(1).max(160)}).strict()]);function b0e(e){return{kind:"entity",entityType:e.entityType,id:e.id}}function x0e(e){return{kind:"launch",launch:e.launch}}function S0e(e){return{kind:"detail",itemId:e.detail.itemId}}var Dw=a.union([a.object({external:bee}).strict().transform(h0e),a.object({entity:m0e,id:Ce}).strict().transform(y0e),a.object({catalog:g0e,entityType:Ce,id:Ce}).strict().transform(b0e),a.object({launch:xee}).strict().transform(x0e),a.object({detail:a.object({itemId:Qg}).strict()}).strict().transform(S0e),a.object({kind:a.literal("external"),href:bee}).strict(),a.object({kind:a.literal("entity"),entityType:Ce,id:Ce}).strict(),a.object({kind:a.literal("launch"),launch:xee}).strict(),a.object({kind:a.literal("detail"),itemId:Qg}).strict()]),v0e=a.object({label:Ne,value:a.union([a.string().max(500),a.number().finite()]),caption:Mr.optional(),tone:Tn.optional()}).strict(),w0e=a.object({label:Ne,value:Fw}).strict(),See=a.object({type:a.literal("stats"),id:Ce.optional(),items:a.array(v0e).max(20)}).strict(),vee=a.object({type:a.literal("key-values"),id:Ce.optional(),items:a.array(w0e).max(40)}).strict(),wee=a.object({type:a.literal("notice"),id:Ce.optional(),title:Ne.optional(),text:Ga,tone:Tn.optional()}).strict(),k0e=a.object({type:a.literal("text"),id:Ce.optional(),label:Ne.optional(),text:p0e,truncated:a.boolean().optional()}).strict(),I0e=a.object({id:Ce,label:Ne,value:Fw.optional(),description:Ga.optional(),tone:Tn.optional()}).strict(),kee=a.object({type:a.literal("group"),id:Ce,label:Ne,items:a.array(I0e).max(50)}).strict(),T0e=a.object({id:Ce,label:Ne,status:a.enum(["idle","active","complete","failed"]),detail:Mr.optional()}).strict(),Iee=a.object({type:a.literal("flow"),id:Ce,label:Ne,direction:a.enum(["forward","bidirectional"]).optional(),steps:a.array(T0e).min(2).max(20)}).strict(),E0e=a.object({id:Ce,label:Ne,value:a.number().finite().nonnegative(),max:a.number().finite().positive().optional(),unit:Ne.optional(),tone:Tn.optional()}).strict().superRefine((e,t)=>{if(e.max!==void 0&&e.value>e.max)t.addIssue({code:"custom",message:"Meter value cannot exceed its maximum",path:["value"]})}),Tee=a.object({type:a.literal("meters"),id:Ce,items:a.array(E0e).max(30)}).strict(),Eee=a.object({type:a.literal("progress"),id:Ce,label:Ne,state:Ne,detail:Ga.optional(),startedAt:a.string().datetime().optional(),updatedAt:a.string().datetime().optional(),progress:a.number().finite().min(0).max(1).optional(),tone:Tn.optional()}).strict(),C0e=a.string().trim().min(1).max(120).regex(/^[a-z][a-zA-Z0-9_.-]*$/),P0e=a.object({value:Ne,label:Ne,count:a.number().int().nonnegative().optional()}).strict(),R0e=a.object({key:C0e,label:Ne,value:Ne.optional(),allLabel:Ne.optional(),options:a.array(P0e).max(100)}).strict(),A0e=a.object({type:a.literal("query"),id:Ce,controls:a.array(R0e).max(20),pagination:a.object({offset:a.number().int().nonnegative(),limit:a.number().int().min(1).max(100),total:a.number().int().nonnegative(),label:Ne.optional()}).strict().optional()}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.controls.entries()){if(r.has(n.key))t.addIssue({code:"custom",message:`Query key "${n.key}" is duplicated`,path:["controls",i,"key"]});r.add(n.key)}}),Cee=a.object({type:a.literal("links"),id:Ce.optional(),items:a.array(a.object({label:Ne,target:Dw}).strict()).max(30)}).strict(),_0e=a.object({label:Ne,tone:Tn.optional()}).strict(),O0e=a.object({value:Ce,label:Ne,count:a.number().int().nonnegative().optional(),emphasis:a.literal("gap").optional()}).strict(),Pee=a.object({label:Ne,defaultValue:Ce,allValue:Ce.optional(),options:a.array(O0e).min(1).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.options.entries()){if(r.has(n.value))t.addIssue({code:"custom",message:`List filter value "${n.value}" is duplicated`,path:["options",i,"value"]});r.add(n.value)}if(!r.has(e.defaultValue))t.addIssue({code:"custom",message:`List filter default "${e.defaultValue}" has no matching option`,path:["defaultValue"]})}),K$=a.object({id:Qg,title:Mr,description:Ga.optional(),meta:Mr.optional(),metadata:a.array(Mr).max(20).optional(),tags:a.array(Ne).max(30).optional(),count:a.number().finite().optional(),badges:a.array(_0e).max(10).optional(),filterValues:a.array(Ce).max(50).optional(),links:a.array(a.object({label:Ne,target:Dw}).strict()).max(10).optional(),tone:Tn.optional(),link:Dw.optional()}).strict(),D0e=a.object({type:a.literal("list"),id:Ce,empty:Mr,filter:Pee.optional(),items:a.array(K$).max(200)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`List item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}if(e.filter){let i=new Set(e.filter.options.map((o)=>o.value)),n=e.filter.allValue??"all";for(let[o,s]of e.items.entries())for(let c of s.filterValues??[])if(c!==n&&!i.has(c))t.addIssue({code:"custom",message:`List item filter value "${c}" has no matching option`,path:["items",o,"filterValues"]})}}),Ree=a.object({key:Ce,label:Ne,align:a.enum(["start","center","end"]).optional()}).strict(),Aee=a.object({key:Ce,label:Ne,values:a.array(Fw).max(50)}).strict(),M0e=a.union([Fw,a.array(a.string().max(500)).max(50)]),_ee=a.object({id:Qg,cells:a.record(a.string(),M0e),link:Dw.optional()}).strict(),F0e=a.object({type:a.literal("table"),id:Ce,empty:Mr,filters:a.array(Aee).max(20).optional(),columns:a.array(Ree).min(1).max(30),rows:a.array(_ee).max(500)}).strict().superRefine((e,t)=>{let r=new Set;for(let[n,o]of e.columns.entries()){if(r.has(o.key))t.addIssue({code:"custom",message:`Table column key "${o.key}" is duplicated`,path:["columns",n,"key"]});r.add(o.key)}for(let[n,o]of(e.filters??[]).entries())if(!r.has(o.key))t.addIssue({code:"custom",message:`Table filter key "${o.key}" has no matching column`,path:["filters",n,"key"]});let i=new Set;for(let[n,o]of e.rows.entries()){if(i.has(o.id))t.addIssue({code:"custom",message:`Table row id "${o.id}" is duplicated`,path:["rows",n,"id"]});i.add(o.id);for(let s of Object.keys(o.cells))if(!r.has(s))t.addIssue({code:"custom",message:`Table cell key "${s}" has no matching column`,path:["rows",n,"cells",s]})}}),$0e=a.object({id:Ce,label:Ne,tone:Tn.optional(),empty:Mr,items:a.array(K$).max(100)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}}),j0e=a.object({type:a.literal("matrix"),id:Ce,columns:a.union([a.literal(1),a.literal(2),a.literal(3),a.literal(4)]).optional(),cells:a.array($0e).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.cells.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix cell id "${n.id}" is duplicated`,path:["cells",i,"id"]});r.add(n.id)}}),Oee=a.object({label:Ne,tone:Tn.optional()}).strict(),Dee=a.object({sourceId:Ce,targetId:Ce,label:Ne.optional(),tone:Tn.optional()}).strict(),yd=a.number().finite().min(0).max(1),N0e=a.object({id:Ce,label:Ne,category:Ne,x:yd,y:yd,zoneId:Ce.optional(),tone:Tn.optional(),details:a.array(Mr).max(20).optional()}).strict(),z0e=a.object({id:Ce,label:Ne,x:yd,y:yd,memberIds:a.array(Ce).max(500)}).strict(),L0e=a.object({type:a.literal("spatial"),layout:a.literal("cartesian"),id:Ce,label:Ne,description:Ga,points:a.array(N0e).max(500),zones:a.array(z0e).max(100),relationships:a.array(Dee).max(2000).optional(),legend:a.array(Oee).max(20)}).strict().superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.points.entries()){if(r.has(s.id))t.addIssue({code:"custom",message:`Spatial point id "${s.id}" is duplicated`,path:["points",o,"id"]});r.add(s.id)}let i=new Set;for(let[o,s]of e.zones.entries()){if(i.has(s.id)||r.has(s.id))t.addIssue({code:"custom",message:`Spatial zone id "${s.id}" is duplicated`,path:["zones",o,"id"]});i.add(s.id);for(let c of s.memberIds)if(!r.has(c))t.addIssue({code:"custom",message:`Spatial zone member "${c}" has no matching point`,path:["zones",o,"memberIds"]})}for(let[o,s]of e.points.entries())if(s.zoneId&&!i.has(s.zoneId))t.addIssue({code:"custom",message:`Spatial point zone "${s.zoneId}" has no matching zone`,path:["points",o,"zoneId"]});let n=new Set([...r,...i]);for(let[o,s]of(e.relationships??[]).entries())if(!n.has(s.sourceId)||!n.has(s.targetId))t.addIssue({code:"custom",message:"Spatial relationship endpoints must reference declared points or zones",path:["relationships",o]})}),B0e=a.object({id:Ce,label:Ne,kind:Ne,status:Ne,tags:a.array(Ne).max(30).optional(),distance:yd,bearing:a.number().finite().min(0).lt(360),relatedIds:a.array(Ce).max(100).optional(),tone:Tn.optional(),details:a.array(Mr).max(20).optional()}).strict(),U0e=a.object({id:Ce,label:Ne,memberIds:a.array(Ce).min(2).max(500)}).strict(),q0e=a.object({id:Ce,label:Ne,maxDistance:yd}).strict(),J0e=a.object({type:a.literal("spatial"),layout:a.literal("radial"),id:Ce,label:Ne,description:Ga,centerLabel:Ne,centerKind:a.enum(["identity","centroid"]),points:a.array(B0e).max(500),clusters:a.array(U0e).max(100).optional(),relationships:a.array(Dee).max(2000).optional(),strata:a.array(q0e).min(1).max(10),legend:a.array(Oee).max(20)}).strict().superRefine((e,t)=>{let r=new Set;for(let[o,s]of e.points.entries()){if(r.has(s.id))t.addIssue({code:"custom",message:`Spatial point id "${s.id}" is duplicated`,path:["points",o,"id"]});r.add(s.id)}for(let[o,s]of e.points.entries())for(let c of s.relatedIds??[])if(!r.has(c))t.addIssue({code:"custom",message:`Related point "${c}" is not declared`,path:["points",o,"relatedIds"]});let i=new Set;for(let[o,s]of(e.clusters??[]).entries()){if(i.has(s.id))t.addIssue({code:"custom",message:`Spatial cluster id "${s.id}" is duplicated`,path:["clusters",o,"id"]});i.add(s.id);for(let c of s.memberIds)if(!r.has(c))t.addIssue({code:"custom",message:`Spatial cluster member "${c}" has no matching point`,path:["clusters",o,"memberIds"]})}for(let[o,s]of(e.relationships??[]).entries())if(!r.has(s.sourceId)||!r.has(s.targetId))t.addIssue({code:"custom",message:"Spatial relationship endpoints must reference declared points",path:["relationships",o]});let n=-1;for(let[o,s]of e.strata.entries()){if(s.maxDistance<=n)t.addIssue({code:"custom",message:"Radial strata must increase by maximum distance",path:["strata",o,"maxDistance"]});n=s.maxDistance}}),Mee=a.discriminatedUnion("layout",[L0e,J0e]),Fee=a.union([See,vee,wee,kee,Iee,Tee,Eee,Cee,D0e,F0e,j0e,Mee]),H0e=a.object({type:a.literal("tabs"),id:Ce,label:Ne,defaultTab:Ce,tabs:a.array(a.object({id:Ce,label:Ne,count:a.number().int().nonnegative().optional(),blocks:a.array(Fee).max(30)}).strict()).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.tabs.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Tab id "${n.id}" is duplicated`,path:["tabs",i,"id"]});r.add(n.id)}if(!r.has(e.defaultTab))t.addIssue({code:"custom",message:`Default tab "${e.defaultTab}" has no matching tab`,path:["defaultTab"]})});function W0e(e){return e!==null&&typeof e==="object"&&"kind"in e&&e.kind==="rizom-workspace-action"&&"name"in e&&typeof e.name==="string"&&"input"in e&&typeof e.input==="object"&&e.input!==null&&"safeParse"in e.input&&typeof e.input.safeParse==="function"}var Z0e=a.custom(W0e,{message:"Expected a workspace action definition"}),V0e=a.object({id:Ce,label:Ne,description:Ga.optional(),confirmation:a.literal("prepared").optional()}).strict(),$w=a.object({action:Z0e,input:a.unknown(),capability:V0e.optional(),disabled:a.boolean().optional()}).strict(),$ee=K$.extend({actions:a.array($w).max(20).optional()}),jee=a.object({type:a.literal("list"),id:Ce,empty:Mr,filter:Pee.optional(),items:a.array($ee).max(200)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`List item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}if(e.filter){let i=new Set(e.filter.options.map((o)=>o.value)),n=e.filter.allValue??"all";for(let[o,s]of e.items.entries())for(let c of s.filterValues??[])if(c!==n&&!i.has(c))t.addIssue({code:"custom",message:`List item filter value "${c}" has no matching option`,path:["items",o,"filterValues"]})}}),G0e=_ee.extend({actions:a.array($w).max(20).optional()}),Nee=a.object({type:a.literal("table"),id:Ce,empty:Mr,filters:a.array(Aee).max(20).optional(),columns:a.array(Ree).min(1).max(30),rows:a.array(G0e).max(500)}).strict().superRefine((e,t)=>{let r=new Set;for(let[n,o]of e.columns.entries()){if(r.has(o.key))t.addIssue({code:"custom",message:`Table column key "${o.key}" is duplicated`,path:["columns",n,"key"]});r.add(o.key)}for(let[n,o]of(e.filters??[]).entries())if(!r.has(o.key))t.addIssue({code:"custom",message:`Table filter key "${o.key}" has no matching column`,path:["filters",n,"key"]});let i=new Set;for(let[n,o]of e.rows.entries()){if(i.has(o.id))t.addIssue({code:"custom",message:`Table row id "${o.id}" is duplicated`,path:["rows",n,"id"]});i.add(o.id);for(let s of Object.keys(o.cells))if(!r.has(s))t.addIssue({code:"custom",message:`Table cell key "${s}" has no matching column`,path:["rows",n,"cells",s]})}}),K0e=a.object({id:Ce,label:Ne,tone:Tn.optional(),empty:Mr,items:a.array($ee).max(100)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.items.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix item id "${n.id}" is duplicated`,path:["items",i,"id"]});r.add(n.id)}}),Q0e=a.object({type:a.literal("matrix"),id:Ce,columns:a.union([a.literal(1),a.literal(2),a.literal(3),a.literal(4)]).optional(),cells:a.array(K0e).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.cells.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Matrix cell id "${n.id}" is duplicated`,path:["cells",i,"id"]});r.add(n.id)}}),Y0e=$w.extend({type:a.literal("action"),id:Ce.optional()}),X0e=a.object({type:a.literal("actions"),id:Ce.optional(),items:a.array($w).max(30)}).strict(),bd=a.union([See,vee,wee,k0e,kee,Iee,Tee,Eee,A0e,Cee,jee,Nee,Q0e,Mee,Y0e,X0e]),eMe=a.object({type:a.literal("tabs"),id:Ce,label:Ne,defaultTab:Ce,tabs:a.array(a.object({id:Ce,label:Ne,count:a.number().int().nonnegative().optional(),blocks:a.array(bd).max(30)}).strict()).min(1).max(12)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.tabs.entries()){if(r.has(n.id))t.addIssue({code:"custom",message:`Tab id "${n.id}" is duplicated`,path:["tabs",i,"id"]});r.add(n.id)}if(!r.has(e.defaultTab))t.addIssue({code:"custom",message:`Default tab "${e.defaultTab}" has no matching tab`,path:["defaultTab"]})}),Mw=a.object({type:a.literal("card"),id:Ce,label:Ne,tone:Tn.optional(),blocks:a.array(bd).max(12)}).strict(),tMe=a.object({type:a.literal("detail"),id:Ce,queryKey:Ce,empty:Mr,master:a.union([jee,Nee]),open:a.object({forId:Qg,title:Ne,blocks:a.array(a.union([bd,Mw])).max(30)}).strict().optional()}).strict(),rMe=a.object({type:a.literal("columns"),id:Ce,primary:a.array(a.union([bd,Mw])).max(20),aside:a.array(a.union([bd,Mw])).max(12)}).strict(),bht=a.object({kicker:Ne.optional(),title:Mr.optional(),description:Ga.optional(),status:a.object({label:Ne,detail:Mr.optional(),tone:Tn.optional()}).strict().optional(),blocks:a.array(a.union([bd,eMe,tMe,rMe,Mw])).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.blocks.entries()){if(n.id===void 0)continue;if(r.has(n.id))t.addIssue({code:"custom",message:`Operator view block id "${n.id}" is duplicated`,path:["blocks",i,"id"]});r.add(n.id)}});var xht=a.json();var nMe=a.object({title:Mr.optional(),blocks:a.array(a.union([Fee,H0e])).max(50)}).strict().superRefine((e,t)=>{let r=new Set;for(let[i,n]of e.blocks.entries()){if(n.id===void 0)continue;if(r.has(n.id))t.addIssue({code:"custom",message:`Operator view block id "${n.id}" is duplicated`,path:["blocks",i,"id"]});r.add(n.id)}}),iMe=a.object({items:a.array(a.object({label:Ne,value:a.string().max(500),tone:a.enum(["good","warn"]).optional()}).strict()).max(4),attention:a.number().int().nonnegative().optional()}).strict(),Sht=a.object({view:nMe,digest:iMe.optional()}).strict();var oMe=Symbol("rizom.workspace-action-executor");function jw(e){if(Ps(e.name,"Workspace action name"),Va(e.label,`Workspace action "${e.name}" label`),e.confirmation?.kind==="static")Va(e.confirmation.message,`Workspace action "${e.name}" confirmation`);if(e.permission!==void 0)_w(e.permission,`Workspace action "${e.name}"`);let t={kind:"rizom-workspace-action",...e,bind(r,i,n){if(t.confirmation?.kind==="prepared"&&!n)throw Error(`Workspace action "${t.name}" requires a prepared confirmation callback`);return Object.freeze({kind:"rizom-workspace-action-binding",definition:t,[oMe]:Object.freeze({execute:i,...n?{prepare:n}:{}})})}};return Object.freeze(t)}var Mht=a.object({actionId:a.string().trim().min(1).max(120),input:a.unknown(),mode:a.enum(["prepare","execute"]).default("execute"),confirmationToken:a.string().uuid().optional()}).strict(),Fht=a.object({capability:a.object({confirmation:a.literal("prepared").optional()})}).passthrough(),$ht=a.array(a.string().trim().min(1).max(120)).max(200).transform((e)=>[...new Set(e)]),jht=a.object({summary:a.string().trim().min(1).max(500),revision:a.string().trim().min(1).max(500)});var Nht=a.json();var zht=Object.freeze({config:Object.freeze({}),state:Object.freeze({}),accountSettings:void 0});var Ght=Object.freeze({config:Object.freeze({}),state:Object.freeze({}),accountSettings:void 0});var Zyt=a.enum(["tool:invoking","tool:completed","tool:failed"]),Vyt=a.object({toolName:a.string().min(1),conversationId:a.string().min(1),interfaceType:a.string().min(1),channelId:a.string().min(1).optional(),channelName:a.string().min(1).optional(),toolCallId:a.string().min(1).optional(),error:a.string().optional()});var xMe=["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"],Q$=a.object({captureUrls:a.boolean().default(!1),blockedUrlDomains:a.array(a.string()).default(xMe)});var TMe=a.object({status:a.enum(["healthy","warning","error","unknown"]),message:a.string().optional(),lastCheck:a.date().optional(),details:a.record(a.string(),a.unknown()).optional()}),Vee=a.object({name:a.string(),pluginId:a.string(),status:a.string(),health:TMe.optional()});var Gee=a.enum(["admin","trusted","public"]),Yg=a.object({label:a.string(),url:a.string(),pluginId:a.string(),priority:a.number().default(100),visibility:Gee.default("public")}),X$=a.enum(["human","agent","admin","protocol"]),ej=a.enum(["available","coming-soon","disabled"]),Xg=a.object({id:a.string(),label:a.string(),description:a.string().optional(),href:a.string(),kind:X$,pluginId:a.string(),priority:a.number().default(100),visibility:Gee.default("public"),status:ej.default("available")}),Nw=a.object({entityType:a.string(),count:a.number()}),tj=a.object({status:a.enum(["operational","degraded"]),reasons:a.array(a.string()),worker:a.object({state:a.enum(["active","missing","stale"]),activeSessions:a.number().int().nonnegative(),staleSessions:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()}),queue:a.object({duePending:a.number().int().nonnegative(),processing:a.number().int().nonnegative(),oldestDuePendingAgeMs:a.number().nonnegative().nullable(),latestClaimAgeMs:a.number().nonnegative().nullable(),stalled:a.boolean()})}),Kee=a.object({model:a.string(),version:a.string(),uptime:a.number(),entities:a.number(),entityCounts:a.array(Nw),embeddings:a.number(),backgroundWork:tj,ai:a.object({model:a.string(),embeddingModel:a.string()}),daemons:a.array(Vee),endpoints:a.array(Yg),interactions:a.array(Xg)});var Kbt=a.object({id:a.string(),type:a.string(),version:a.string(),status:a.string()}),Qbt=a.object({name:a.string(),description:a.string()});var EMe=a.object({id:a.string(),version:a.string(),type:a.enum(["core","entity","service","interface"]),description:a.string().optional(),dependencies:a.array(a.string()).optional(),packageName:a.string()});var Qee=a.looseObject({id:a.string().optional(),limit:a.number().optional(),page:a.number().optional(),pageSize:a.number().optional(),baseUrl:a.string().optional()}),CMe=a.looseObject({entityType:a.string().optional(),query:Qee.optional()});var rj=a.object({kind:a.string().min(1),id:a.string().min(1)}),Xee=a.object({kind:a.literal("text"),filename:a.string().min(1),mediaType:a.string().min(1),content:a.string(),sizeBytes:a.number().nonnegative().optional(),source:rj.optional()}),RMe=a.custom((e)=>e instanceof Uint8Array),AMe=a.object({kind:a.literal("file"),filename:a.string().min(1),mediaType:a.string().min(1),data:RMe,sizeBytes:a.number().nonnegative().optional(),source:rj.optional()}),ete=a.discriminatedUnion("kind",[Xee,AMe]),_Me=a.object({userPermissionLevel:a.enum(["admin","trusted","public"]).optional(),isAnchor:a.boolean().optional(),interfaceType:a.string().optional(),channelId:a.string().optional(),channelName:a.string().optional(),actor:qg.optional(),source:Jg.optional(),attachments:a.array(ete).optional()});var OMe=a.object({status:a.enum(["healthy","warning","error","unknown"]),message:a.string().optional(),lastCheck:a.string().optional(),details:a.record(a.string(),a.unknown()).optional()}),DMe=a.object({name:a.string(),pluginId:a.string(),status:a.string(),health:OMe.optional()}),MMe=a.object({model:a.string(),version:a.string(),uptime:a.number(),entities:a.number(),entityCounts:a.array(Nw),embeddings:a.number(),ai:a.object({model:a.string(),embeddingModel:a.string()}),daemons:a.array(DMe),endpoints:a.array(Yg),interactions:a.array(Xg)});var nj=a.object({name:a.string().min(1),status:a.enum(["healthy","degraded","unhealthy"]),message:a.string().optional(),details:a.record(a.string(),a.unknown()).optional()}),tte=a.object({totals:a.object({pending:a.number().int().nonnegative(),processing:a.number().int().nonnegative(),completed:a.number().int().nonnegative(),failed:a.number().int().nonnegative()}),byType:a.array(a.object({type:a.string().min(1),status:a.enum(["pending","processing","completed","failed"]),count:a.number().int().nonnegative()})),oldestPendingAgeMs:a.number().nonnegative().nullable(),duePending:a.number().int().nonnegative(),oldestDuePendingAgeMs:a.number().nonnegative().nullable(),latestClaimAgeMs:a.number().nonnegative().nullable(),oldestProcessingAgeMs:a.number().nonnegative().nullable(),staleLeaseCount:a.number().int().nonnegative(),workerSessions:a.object({total:a.number().int().nonnegative(),active:a.number().int().nonnegative(),stale:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()})}),rte=a.object({memory:a.object({rssBytes:a.number().int().nonnegative(),heapUsedBytes:a.number().int().nonnegative(),heapTotalBytes:a.number().int().nonnegative()}),fileDescriptors:a.number().int().nonnegative().nullable(),processes:a.object({total:a.number().int().nonnegative().nullable(),zombies:a.number().int().nonnegative().nullable()}),queue:tte.nullable(),projection:a.object({initialized:a.boolean(),trackedRoots:a.number().int().nonnegative(),openCircuits:a.array(a.object({projectionId:a.string().min(1),reason:a.string().min(1),openedAt:a.number().int().nonnegative(),expiresAt:a.number().int().nonnegative()}))}),worker:a.object({total:a.number().int().nonnegative(),active:a.number().int().nonnegative(),stale:a.number().int().nonnegative(),latestHeartbeatAgeMs:a.number().nonnegative().nullable()})}),FMe=a.object({status:a.enum(["ready","not_ready"]),operationalStatus:a.enum(["operational","degraded"]),checkedAt:a.iso.datetime(),checks:a.array(nj),resources:rte});var Sxt=a.string().trim().min(1).max(200),vxt=a.string().trim().min(1).max(100).regex(/^[a-z0-9][a-z0-9.-]*$/);var $Me=a.union([a.object({success:a.boolean(),data:a.unknown().optional(),error:a.string().optional()}),a.object({noop:a.literal(!0)})]),jMe=a.object({id:a.string(),timestamp:a.string(),type:a.string(),source:a.string(),target:a.string().optional(),metadata:Hg.optional()});var NMe=a.object({kind:a.string().min(1),id:a.string().min(1)}),zMe=a.object({kind:a.string().min(1),filename:a.string().min(1),mediaType:a.string().min(1),sizeBytes:a.number().nonnegative().optional(),source:NMe.optional()}),Fxt=a.array(zMe),$xt=a.array(gg),jxt=a.array(fg),Nxt=a.record(a.string(),a.unknown());var qxt=a.record(a.string(),a.unknown());var Gxt=a.record(a.string(),a.unknown());var LMe=new Map([[".png","image/png"],[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".webp","image/webp"],[".gif","image/gif"],[".pdf","application/pdf"]]),Qxt=new Set(LMe.values());var ute=Cs.extend({id:a.literal("brain-character"),entityType:a.literal("brain-character")}),oj=a.object({name:a.string().describe("The brain's friendly display name"),role:a.string().describe("The brain's primary role"),purpose:a.string().describe("The brain's purpose and goals"),values:a.array(a.string()).describe("Core values that guide behavior")});var VSt=a.record(a.string(),a.unknown());var lte=Cs.extend({id:a.literal("anchor-profile"),entityType:a.literal("anchor-profile")}),pte=a.enum(["person","team","organization"]),eh=a.object({name:a.string().describe("Name of the anchor"),organization:a.string().optional().describe("Organization the anchor belongs to"),description:a.string().optional().describe("Short description or biography"),avatar:a.string().optional().describe("URL or asset path to avatar/logo"),website:a.string().optional().describe("Primary website URL"),email:a.string().optional().describe("Contact email"),socialLinks:a.array(a.object({platform:a.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:a.string().describe("Profile or contact URL"),label:a.string().optional().describe("Optional display label")})).optional().describe("Social media and contact links")});var zw=a.enum(["person","team","organization"]),gvt=a.object({kind:a.string().trim().min(1),category:zw,labels:a.object({singular:a.string().trim().min(1),plural:a.string().trim().min(1)})});var dte=a.looseObject({id:a.string(),description:a.string(),name:a.string().optional(),tags:a.array(a.string()).optional().default([])}),HFe=eh.extend({kind:a.string().trim().min(1).optional(),category:zw.optional()}).superRefine((e,t)=>{if(e.kind===void 0!==(e.category===void 0))t.addIssue({code:"custom",message:"Anchor kind and category must be provided together"})}),WFe=a.looseObject({uri:a.string(),params:a.record(a.string(),a.unknown()).optional()}),ZFe=a.looseObject({name:a.string(),url:a.string(),description:a.string().optional(),skills:a.array(dte).optional().default([]),capabilities:a.looseObject({extensions:a.array(WFe).optional().default([])}).optional()});var pTt=a.record(a.string(),a.unknown());var hte=a.enum(["png","jpg","jpeg","webp","gif","svg"]),yte=a.enum(["pending","draft","failed"]),bte=a.object({title:a.string().optional(),alt:a.string().optional(),format:hte,width:a.number(),height:a.number(),status:yte.optional(),processingJobId:a.string().optional(),processingError:a.string().optional(),sourceUrl:a.url().optional(),sourceEntityType:a.string().optional(),sourceEntityId:a.string().optional(),sourceUploadId:a.string().optional(),sourceFilename:a.string().optional(),sourceMediaType:a.string().optional(),attachmentType:a.string().optional(),dedupKey:a.string().optional()}),lj=Cw.extend({entityType:a.literal("image"),metadata:bte}),t$e=a.object({url:a.string(),alt:a.string(),title:a.string(),width:a.number(),height:a.number()});function xte(e){let t=e.trim().match(/^data:image\/([a-z+]+);base64,(.+)$/i);if(!t?.[1]||!t[2])return null;return{format:t[1].toLowerCase(),base64:t[2]}}function xd(e){let t=xte(e);if(!t)throw Error("Invalid image data URL");return t}var r$e={png:"iVBORw",jpg:"/9j/",gif:"R0lGOD",webp:"UklGR"};function th(e){for(let[t,r]of Object.entries(r$e))if(e.startsWith(r))return t;return null}function Sd(e){let t=Buffer.from(e,"base64");if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let r=t.readUInt32BE(16),i=t.readUInt32BE(20);return{width:r,height:i}}if(t[0]===255&&t[1]===216){let r=2;while(r<t.length-8){if(t[r]!==255){r++;continue}let i=t[r+1];if(i===192||i===194){let o=t.readUInt16BE(r+5);return{width:t.readUInt16BE(r+7),height:o}}let n=t.readUInt16BE(r+2);r+=2+n}}if(t[0]===71&&t[1]===73&&t[2]===70){let r=t.readUInt16LE(6),i=t.readUInt16LE(8);return{width:r,height:i}}if(t.length>=30&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70){if(t[12]===86&&t[13]===80&&t[14]===56){if(t[15]===32){let r=t[26]??0,i=t[27]??0,n=t[28]??0,o=t[29]??0,s=(r|i<<8)&16383,c=(n|o<<8)&16383;return{width:s,height:c}}if(t[15]===76&&t.length>=25){let r=t.readUInt32LE(21),i=(r&16383)+1,n=(r>>14&16383)+1;return{width:i,height:n}}}}return null}class dj{entityType="image";purpose="Image assets such as generated covers, social previews, and uploaded images.";schema=lj;toMarkdown(e){return e.content}fromMarkdown(e){let{format:t,base64:r}=xd(e),i=Sd(r);return{entityType:"image",content:e,metadata:{format:t,width:i?.width??0,height:i?.height??0}}}extractMetadata(e){return e.metadata}parseFrontMatter(e,t){return t.parse({})}generateFrontMatter(e){return""}getBodyTemplate(){return""}createImageEntity(e){let{dataUrl:t,title:r,alt:i}=e,{format:n,base64:o}=xd(t),s=Sd(o),u=th(o)??n;return{entityType:"image",content:t,metadata:{title:r,alt:i??r,format:u,width:s?.width??0,height:s?.height??0,...e.status&&{status:e.status},...e.sourceUrl&&{sourceUrl:e.sourceUrl},...e.sourceEntityType&&{sourceEntityType:e.sourceEntityType},...e.sourceEntityId&&{sourceEntityId:e.sourceEntityId},...e.sourceUploadId&&{sourceUploadId:e.sourceUploadId},...e.sourceFilename&&{sourceFilename:e.sourceFilename},...e.sourceMediaType&&{sourceMediaType:e.sourceMediaType},...e.attachmentType&&{attachmentType:e.attachmentType},...e.dedupKey&&{dedupKey:e.dedupKey}}}}}var n$e=new dj;var PTt=a.record(a.string(),a.unknown());var _Tt=mw();var tEt=a.object({title:a.string(),slug:a.string().optional(),coverImageUrl:a.url(),coverImageId:a.string().optional(),coverImageAlt:a.string().optional()});var a$e=a.object({syncPath:a.string(),autoSync:a.boolean().optional(),watchInterval:a.number().optional(),includeMetadata:a.boolean().optional(),entityTypes:a.array(a.string()).optional(),deleteOnFileRemoval:a.boolean().optional(),maxImportFileBytes:a.number().int().positive().optional()});var vte=a.object({operation:a.enum(["initial","scheduled","manual"]),paths:a.array(a.string()).optional(),entityTypes:a.array(a.string()).optional(),syncDirection:a.enum(["import","export","both"]).optional()}),wte=a.object({source:a.string().min(1),runId:a.string().min(1).optional(),interfaceType:a.string().optional(),channelId:a.string().optional()}),vd=a.object({operationId:a.string().min(1),rootJobId:a.string().min(1),childKey:a.string().min(1),expectedChildren:a.number().int().positive()}),kte=a.object({paths:a.array(a.string()).optional(),batchSize:a.number().min(1).optional(),batchIndex:a.number().optional(),projectionBatch:vd.optional()}),Ite=a.object({entityTypes:a.array(a.string()).optional(),batchSize:a.number().min(1).optional()}),Ste=a.object({entityId:a.string(),entityType:a.string(),filePath:a.string()}),Tte=a.union([Ste.extend({projectionBatch:vd.optional()}),a.object({deletions:a.array(Ste).min(1).max(50),projectionBatch:vd.optional()})]),Ete=a.object({filePath:a.string(),sourceUrl:a.url(),postTitle:a.string(),postSlug:a.string(),customAlt:a.string().optional()}),Cte=a.object({filePath:a.string(),postSlug:a.string()});var mj=a.object({syncPath:a.string(),exists:a.boolean(),watching:a.boolean(),lastSync:a.date().optional(),files:a.array(a.object({path:a.string(),entityType:a.string(),modified:a.date()})),stats:a.object({totalFiles:a.number(),byEntityType:a.record(a.string(),a.number())})}).describe("Directory synchronization status - use with directorySyncStatus formatter"),Pte=a.object({exported:a.number(),failed:a.number(),errors:a.array(a.object({entityId:a.string(),entityType:a.string(),error:a.string()}))}),Rte=a.object({imported:a.number(),skipped:a.number(),failed:a.number(),quarantined:a.number(),quarantinedFiles:a.array(a.string()),errors:a.array(a.object({path:a.string(),error:a.string()})),issues:a.array(a.object({path:a.string(),message:a.string()})).optional(),jobIds:a.array(a.string())}),u$e=a.object({export:Pte,import:Rte,duration:a.number()});var hRt=a.object({projectionBatch:vd.optional()});var ERt=a.record(a.string(),a.unknown());var KRt=a.record(a.string(),a.unknown());var IAt=a.object({entityType:a.string(),id:a.string(),sha:a.string().optional(),limit:a.number().int().positive().optional().default(10)});var OAt=a.object({action:a.enum(["sync","status"]).default("sync").describe("Use sync for a refresh request and status for a status check")}),DAt=a.object({action:a.enum(["sync","status","history"]).default("sync").describe("Use sync for git/filesystem sync, status for a status check, and history only for entity history"),entityType:a.string().optional().describe("History only; omit for sync and status"),id:a.string().optional().describe("History only; omit for sync and status"),sha:a.string().optional().describe("Optional history revision; omit for sync and status"),limit:a.number().int().positive().optional().default(10).describe("History only; omit for sync and status")}),MAt=a.discriminatedUnion("action",[a.object({action:a.literal("sync")}),a.object({action:a.literal("status")})]),FAt=a.discriminatedUnion("action",[a.object({action:a.literal("sync")}),a.object({action:a.literal("status")}),a.object({action:a.literal("history"),entityType:a.string().min(1),id:a.string().min(1),sha:a.string().optional(),limit:a.number().int().positive().optional().default(10)})]);var Ote=a.enum(["manual","periodic","watcher","save"]),S$e=a.enum(["pulling","scanning","importing","settling"]),Dte={imported:a.number().int().nonnegative(),skipped:a.number().int().nonnegative(),failed:a.number().int().nonnegative(),quarantined:a.number().int().nonnegative(),exported:a.number().int().nonnegative()},v$e=a.preprocess((e)=>{if(typeof e!=="object"||e===null||"lastProgressAt"in e||!("startedAt"in e)||typeof e.startedAt!=="string")return e;return{...e,lastProgressAt:e.startedAt}},a.object({id:a.string().min(1),source:Ote,state:S$e,startedAt:a.string().datetime(),lastProgressAt:a.string().datetime(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional(),...Dte})),w$e=a.object({id:a.string().min(1),source:Ote,outcome:a.enum(["succeeded","attention","failed"]),startedAt:a.string().datetime(),completedAt:a.string().datetime(),summary:a.string().min(1).max(240),...Dte}),k$e=a.object({id:a.string().min(1),kind:a.enum(["quarantined","import","export","git","source"]),path:a.string().min(1).max(300).optional(),message:a.string().min(1).max(400),occurredAt:a.string().datetime()}),LAt=a.object({activeRun:v$e.optional(),recentRuns:a.array(w$e).max(5),issues:a.array(k$e).max(8)}),BAt=a.object({gitPulled:a.literal(!0),batchQueued:a.boolean(),batchId:a.string().optional(),importOperations:a.number().int().nonnegative().optional(),totalFiles:a.number().int().nonnegative().optional()});var UAt=a.object({lastProgressAt:a.string().datetime()});var Mte=a.string().regex(/^[a-f0-9]{40,64}$/),I$e=a.object({remoteFingerprint:a.string().regex(/^[a-f0-9]{64}$/),branch:a.string().min(1).max(200),lastReconciledGitHead:Mte,lastObservedRemoteHead:Mte.optional()}),WAt=a.object({checkpoint:I$e.optional()});var Fte={imported:a.number().int().nonnegative(),skipped:a.number().int().nonnegative(),failed:a.number().int().nonnegative(),quarantined:a.number().int().nonnegative(),exported:a.number().int().nonnegative()},T$e=a.object({health:a.enum(["healthy","active","attention"]),directory:a.object({displayPath:a.string().min(1),exists:a.boolean(),watching:a.boolean(),totalFiles:a.number().int().nonnegative(),byEntityType:a.record(a.string(),a.number().int().nonnegative()),lastSettledAt:a.string().datetime().optional()}),git:a.object({branch:a.string().min(1),remoteLabel:a.string().min(1).optional(),hasChanges:a.boolean(),ahead:a.number().int().nonnegative(),behind:a.number().int().nonnegative(),lastCommit:a.string().min(1).optional(),changedFiles:a.array(a.object({path:a.string().min(1),status:a.string().min(1)})),changedFilesTruncated:a.boolean()}).nullable(),automation:a.object({autoSync:a.boolean(),watchIntervalMs:a.number().int().nonnegative(),remoteIntervalMinutes:a.number().nonnegative().optional(),commitDebounceMs:a.number().int().nonnegative().optional(),deleteOnFileRemoval:a.boolean()}),activeRun:a.object({id:a.string().min(1),source:a.enum(["manual","periodic","watcher","save"]),state:a.enum(["pulling","scanning","importing","settling"]),startedAt:a.string().datetime(),lastProgressAt:a.string().datetime(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional(),...Fte}).optional(),recentRuns:a.array(a.object({id:a.string().min(1),source:a.enum(["manual","periodic","watcher","save"]),outcome:a.enum(["succeeded","attention","failed"]),startedAt:a.string().datetime(),completedAt:a.string().datetime(),summary:a.string().min(1),...Fte})),issues:a.array(a.object({id:a.string().min(1),kind:a.enum(["quarantined","import","export","git","source"]),path:a.string().min(1).optional(),message:a.string().min(1),occurredAt:a.string().datetime()}))}),$te=jw({name:"sync-now",label:"Sync now",permission:"admin",input:a.object({}),output:a.object({accepted:a.boolean(),status:a.string().min(1),runId:a.string().min(1).optional(),jobId:a.string().min(1).optional(),batchId:a.string().min(1).optional()})});function E$e(e){let t=e.imported+e.skipped+e.failed+e.quarantined;return{type:"progress",id:"active-sync",label:"Directory sync",state:e.state,detail:`${t} files handled \xB7 ${e.exported} exported`,startedAt:e.startedAt,updatedAt:e.lastProgressAt,tone:e.failed>0||e.quarantined>0?"warn":"neutral"}}var YAt=Ow({id:"sync",label:"Sync",permission:"admin",data:T$e,actions:[$te],refresh:({data:e})=>e.activeRun?1000:void 0,view:({data:e})=>{let t=[];if(e.git)t.push({id:"git",label:e.git.remoteLabel??e.git.branch,status:e.issues.some((m)=>m.kind==="git")?"failed":e.git.hasChanges||e.git.ahead>0||e.git.behind>0?"active":"complete",detail:`${e.git.ahead} ahead \xB7 ${e.git.behind} behind`});let r=e.activeRun?[E$e(e.activeRun)]:[],i=e.git?.changedFiles.length?[{type:"list",id:"changed-files",empty:"No changed files.",items:e.git.changedFiles.map((m,f)=>({id:`changed-${f+1}`,title:m.path,badges:[{label:m.status}]}))}]:[],n={type:"stats",id:"sync-summary",items:[{label:"Files",value:e.directory.totalFiles,caption:"markdown + images"},{label:"Entity types",value:Object.keys(e.directory.byEntityType).length,caption:"within sync scope"},{label:"Issues",value:e.issues.length,caption:e.issues.length>0?"needs attention":"all clear",tone:e.issues.length>0?"warn":"good"}]},o=[{type:"flow",id:"sync-flow",label:"Content flow",direction:e.git?"bidirectional":"forward",steps:[{id:"directory",label:e.directory.displayPath,status:e.directory.exists?"complete":"failed",detail:e.directory.watching?"Watching for changes":"Watcher stopped"},{id:"scanner",label:"Scanner",status:e.activeRun?"active":"idle",detail:e.activeRun?.state},{id:"entities",label:"Entity store",status:e.issues.some((m)=>m.kind==="import")?"failed":e.directory.totalFiles>0?"complete":"idle"},...t]}],s={type:"group",id:"sync-automation",label:"Automation",items:[{id:"automatic",label:"Automatic sync",value:e.automation.autoSync},{id:"watch",label:"Watch interval",value:`${e.automation.watchIntervalMs} ms`},{id:"delete",label:"Delete removed files",value:e.automation.deleteOnFileRemoval},...e.automation.remoteIntervalMinutes===void 0?[]:[{id:"remote",label:"Remote interval",value:`${e.automation.remoteIntervalMinutes} min`}]]},c={type:"meters",id:"sync-meters",items:[{id:"files",label:"Content files",value:e.directory.totalFiles},{id:"issues",label:"Issues",value:e.issues.length,tone:e.issues.length>0?"warn":"good"},...e.git?[{id:"ahead",label:"Commits ahead",value:e.git.ahead},{id:"behind",label:"Commits behind",value:e.git.behind}]:[]]},u=[...r,{type:"list",id:"recent-runs",empty:"No directory sync runs have completed yet.",items:e.recentRuns.map((m)=>({id:m.id,title:`${m.source} \xB7 ${m.outcome}`,description:m.summary,badges:[{label:m.outcome}],tone:m.outcome==="succeeded"?"good":m.outcome==="failed"?"error":"warn",metadata:[`Imported: ${m.imported}`,`Exported: ${m.exported}`,`Completed: ${m.completedAt}`]}))},...i],l=e.issues.length===0?{type:"card",id:"sync-blockers-card",label:"No blockers",tone:"good",blocks:[{type:"notice",id:"sync-clear",text:"Directory exists, configured automation is available, and no unresolved operation failures are recorded.",tone:"good"}]}:{type:"card",id:"sync-blockers-card",label:"Needs attention",tone:"warn",blocks:[{type:"list",id:"sync-issues",empty:"No sync issues need attention.",items:e.issues.map((m)=>({id:m.id,title:m.kind,description:m.message,tone:"warn",metadata:[...m.path?[`Path: ${m.path}`]:[],`Occurred: ${m.occurredAt}`]}))}]},p=[n,{type:"columns",id:"sync-body",primary:[...o,...u],aside:[l,{type:"card",id:"sync-automation-card",label:"Automation",blocks:[s]},{type:"card",id:"sync-source-card",label:"Source",blocks:[{type:"key-values",id:"sync-source",items:[{label:"Directory",value:e.directory.displayPath},...e.git?[{label:"Branch",value:e.git.branch},{label:"Remote",value:e.git.remoteLabel??e.git.branch}]:[{label:"Remote",value:"files only"}]]}]},{type:"card",id:"sync-repository-card",label:"Repository",blocks:[c]},{type:"action",id:"sync-now",action:$te,input:{}}]}];return{kicker:"Durability operations",title:"Content sync",description:"Keep the entity database, its files, and the configured Git remote converged.",status:{label:e.health,...e.directory.lastSettledAt?{detail:`last settled ${e.directory.lastSettledAt}`}:{},tone:e.health==="healthy"?"good":"warn"},blocks:p}}});var jte="./brain-data";var xOt=a.object({syncPath:a.string().optional(),git:a.object({repo:a.string().optional(),gitUrl:a.string().optional()}).optional()});var Nte=5000;var zte="BRAIN_TEST_GIT_BROKER_WITHHOLD_COMPLETION",O$e={setInterval:(e,t)=>{let r=setInterval(e,t);return()=>{clearInterval(r)}}};async function Lte(e,t,r={}){let i=r.processImpl??process,n=r.startHost??wv,o=i.env[mm];if(!o)return{success:!1,message:`${mm} is unset; the Git broker is started by the Brain supervisor, not directly`,exitCode:1};let s=await n({socketPath:o,cwd:e,dataDir:jte,pluginConfig:kv(t.plugins?.["directory-sync"]??{},i.env),logger:_r.getInstance(),...i.env[zte]===void 0?{}:{testWithholdCompletionAfter:i.env[zte]}}).then((l)=>({broker:l,error:void 0}),(l)=>({broker:void 0,error:l}));if(!s.broker)return{success:!1,message:`Git broker failed to start: ${_e(s.error)}`,exitCode:1};i.on("message",(l)=>{if(typeof l==="object"&&l!==null&&"type"in l&&l.type==="broker-close-admission")s.broker.closeAdmission()}),i.send?.({type:"broker-ready"});let u=(r.heartbeatClock??O$e).setInterval(()=>{i.send?.({type:"broker-heartbeat",...s.broker.activity})},Nte);return await new Promise((l)=>{i.on("SIGTERM",l),i.on("SIGINT",l)}),u(),await s.broker.stop(),{success:!0}}var F$e=a.object({plugins:a.object({"directory-sync":a.unknown().optional()}).optional()}),Bte=process.cwd(),$$e=F$e.parse(gk(D$e(M$e(Bte,"brain.yaml"),"utf8"))),rh=await Lte(Bte,$$e).catch((e)=>({success:!1,message:`Git broker failed: ${_e(e)}`,exitCode:1}));if(!rh.success&&rh.message)console.error(rh.message);process.exit(rh.success?0:rh.exitCode??1);
|