@seanmozeik/tripwire 0.7.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/index.js +22 -27
- package/dist/tripwire-cli.js +1 -1
- package/dist/tripwire-hook.js +1 -1
- package/dist/tripwire-pi.js +16 -6
- package/dist/tripwire.js +109 -121
- package/dist/types/dispatch.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/bash/analyze.d.ts +3 -0
- package/dist/types/lib/bash/carriers.d.ts +11 -0
- package/dist/types/lib/bash/config.d.ts +17 -0
- package/dist/types/lib/bash/execution-types.d.ts +13 -0
- package/dist/types/lib/bash/execution.d.ts +13 -0
- package/dist/types/lib/bash/index.d.ts +8 -0
- package/dist/types/lib/bash/pipeline-inputs.d.ts +10 -0
- package/dist/types/lib/bash/static-command.d.ts +9 -0
- package/dist/types/lib/bash/types.d.ts +64 -0
- package/dist/types/lib/bash/values.d.ts +25 -0
- package/dist/types/lib/bash/wrappers.d.ts +21 -0
- package/dist/types/lib/code/analyze.d.ts +3 -0
- package/dist/types/lib/code/calls.d.ts +8 -0
- package/dist/types/lib/code/carriers.d.ts +18 -0
- package/dist/types/lib/code/containers.d.ts +4 -0
- package/dist/types/lib/code/control.d.ts +13 -0
- package/dist/types/lib/code/data.d.ts +9 -0
- package/dist/types/lib/code/imports.d.ts +5 -0
- package/dist/types/lib/code/members.d.ts +4 -0
- package/dist/types/lib/code/syntax.d.ts +10 -0
- package/dist/types/lib/code/types.d.ts +51 -0
- package/dist/types/lib/code/uv.d.ts +13 -0
- package/dist/types/lib/code/values.d.ts +9 -0
- package/dist/types/lib/config.d.ts +32 -0
- package/dist/types/lib/event.d.ts +7 -1
- package/dist/types/lib/rule-actions.d.ts +27 -0
- package/dist/types/rules/bash-bypass.d.ts +5 -0
- package/dist/types/rules/bash-deny.d.ts +4 -4
- package/dist/types/rules/bash-git.d.ts +2 -2
- package/dist/types/rules/bash-network-install.d.ts +2 -2
- package/dist/types/rules/bash-redirect.d.ts +2 -2
- package/dist/types/rules/bash-scoped-rm.d.ts +2 -2
- package/dist/types/rules/bash-tar-explosion.d.ts +2 -2
- package/dist/types/rules/config-custom.d.ts +3 -3
- package/dist/types/rules/embedded-code.d.ts +15 -0
- package/dist/types/rules/tool-policy.d.ts +2 -2
- package/package.json +11 -8
- package/dist/types/lib/bash.d.ts +0 -27
package/dist/tripwire.js
CHANGED
|
@@ -1,141 +1,129 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var Pq=Object.defineProperty;var U0=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fq=(e)=>e;function Mq(e,t){this[e]=Fq.bind(null,t)}var Un=(e,t)=>{for(var n in t)Pq(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Mq.bind(t,n)})};var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var Cp;var ky=w(()=>{Cp={name:"@seanmozeik/tripwire",version:"0.7.2",description:"Configurable safety hooks for Claude Code, Codex, Cursor, Pi, and Oh My Pi",keywords:["ai-agents","bun","claude-code","codex","cursor","hooks","safety"],homepage:"https://github.com/seanmozeik/tripwire#readme",bugs:{url:"https://github.com/seanmozeik/tripwire/issues"},license:"MIT",author:"Sean Mozeik",repository:{type:"git",url:"git+https://github.com/seanmozeik/tripwire.git"},bin:{tripwire:"./dist/tripwire-cli.js","tripwire-hook":"./dist/tripwire-hook.js"},workspaces:["packages/*"],files:["dist","LICENSE","package.json","README.md"],type:"module",types:"./dist/types/index.d.ts",exports:{".":{types:"./dist/types/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"}},publishConfig:{access:"public"},scripts:{build:"bun scripts/build.ts",prepublishOnly:"bun run verify",check:"bun run format && bun run lint:fix && bun run typecheck",format:"oxfmt --write .","format:check":"oxfmt --check .",lint:"oxlint .","lint:fix":"oxlint --format agent --fix .",prepare:"bunx effect-tsgo patch",test:"bun test",typecheck:"tsc --noEmit",verify:"bun run format:check && bun run lint && bun run typecheck && bun test && bun run build"},dependencies:{"shell-quote":"1.10.0"},devDependencies:{"@effect/platform-bun":"4.0.0-rc.112","@effect/tsgo":"0.38.0","@seanmozeik/de-clank":"0.1.7","bun-types":"1.4.0",effect:"4.0.0-rc.112",oxfmt:"0.65.0",oxlint:"1.80.0","oxlint-tsgolint":"7.0.2001",typescript:"7.0.2"},peerDependencies:{"@effect/platform-bun":"4.0.0-rc.112",effect:"4.0.0-rc.112"},optionalDependencies:{"@seanmozeik/tripwire-darwin-arm64":"0.7.2"},engines:{bun:">=1.4"}}});var le=(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 n=e;for(let r=0,o=t.length;r<o;r++)n=t[r](n);return n}}},Dq,Gi;var Qe=w(()=>{Dq={pipe(){return le(this,arguments)}},Gi=function(){function e(){}return e.prototype=Dq,e}()});function zr(e,...t){return le(e,t)}function L0(e,t,n,r,o,s,i,a,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return o(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return i(s(o(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return a(i(s(o(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(a(i(s(o(r(n(t(e.apply(this,arguments)))))))))}}return}function Qt(e){let t=new WeakMap;return(n)=>{let r=t.get(n);if(r!==void 0)return r;let o=e(n);return t.set(n,o),o}}function Ji(e){let t=new WeakMap;return(n)=>{let r=t.get(n);if(r!==void 0)return r;let o=e(n);return t.set(n,o),t.set(o,o),o}}var p=function(e,t){if(typeof e==="function")return function(){return e(arguments)?t.apply(this,arguments):(n)=>t(n,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(n,r){if(arguments.length>=2)return t(n,r);return function(o){return t(o,n)}};case 3:return function(n,r,o){if(arguments.length>=3)return t(n,r,o);return function(s){return t(s,n,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(r){return t(r,...n)}}}},D=(e)=>e,gt=(e)=>()=>e,nr,Sl,Tp,qr,Vo;var X=w(()=>{Qe();nr=gt(!0),Sl=gt(!1),Tp=gt(null),qr=gt(void 0),Vo=qr});var El=(e)=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;if(e instanceof Error)t.delete("stack");let n=Object.getPrototypeOf(e),r=n;while(r!==null&&r!==Object.prototype){let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++)t.add(o[s]);r=Object.getPrototypeOf(r)}if(t.has("constructor")&&typeof e.constructor==="function"&&n===e.constructor.prototype)t.delete("constructor");return t},wc;var Iy=w(()=>{wc=new WeakSet});function Wr(e){return typeof e==="string"}function bl(e){return typeof e==="number"}function Op(e){return typeof e==="boolean"}function j0(e){return typeof e==="bigint"}function Cy(e){return typeof e==="symbol"}function Ap(e){return Wr(e)||bl(e)||Cy(e)}function ln(e){return typeof e==="function"}function Gs(e){return e===void 0}function Le(e){return e!==void 0}function wl(e){return e!==null}function B0(e){return e===null||e===void 0}function _p(e){return e!=null}function H0(e){return!1}function Ty(e){return!0}function fn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function vl(e){return typeof e==="object"&&e!==null||ln(e)}function q0(e){return e instanceof Error}function go(e){return M(e,Symbol.iterator)||Wr(e)}var M,br;var he=w(()=>{X();M=p(2,(e,t)=>vl(e)&&(t in e)),br=p(2,(e,t)=>M(e,"_tag")&&e._tag===t)});function jq(e,t){if(_y.has(e))return qe("[Circular]");_y.add(e);let n=t();return _y.delete(e),n}var Ie="~effect/interfaces/Hash",re=(e)=>{switch(typeof e){case"number":return Ln(e);case"bigint":return qe(e.toString(10));case"boolean":return qe(String(e));case"symbol":return qe(String(e));case"string":return qe(e);case"undefined":return qe("undefined");case"function":case"object":if(e===null)return qe("null");else if(e instanceof Date){if(Number.isNaN(e.getTime()))return qe("Invalid Date");return qe(e.toISOString())}else if(e instanceof RegExp)return qe(e.toString());else{if(wc.has(e))return Rp(e);if(Ay.has(e))return Ay.get(e);let t=jq(e,()=>{if($q(e))return e[Ie]();else if(typeof e==="function")return Rp(e);else if(e instanceof DataView)return vc(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)||ArrayBuffer.isView(e))return vc(e);else if(e instanceof Map)return Uq(e);else if(e instanceof Set)return Lq(e);return Py(e)});return Ay.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Rp=(e)=>{if(!Oy.has(e))Oy.set(e,Ln(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return Oy.get(e)},xt,Js=(e)=>e&3221225471|e>>>1&1073741824,$q=(e)=>M(e,Ie),Ln=(e)=>{if(e!==e)return qe("NaN");if(e===1/0)return qe("Infinity");if(e===-1/0)return qe("-Infinity");let t=e|0;if(t!==e)t^=e*4294967295;while(e>4294967295)t^=e/=4294967295;return Js(t)},qe=(e)=>{let t=5381,n=e.length;while(n)t=t*33^e.charCodeAt(--n);return Js(t)},Ry=(e,t)=>{let n=12289;for(let r of t)n^=xt(re(r),re(e[r]));return Js(n)},Py=(e)=>Ry(e,El(e)),Fy=(e,t)=>(n)=>{let r=e;for(let o of n)r^=t(o);return Js(r)},vc,Uq,Lq,Oy,Ay,_y;var Xt=w(()=>{X();Iy();he();xt=p(2,(e,t)=>e*53^t),vc=Fy(6151,re),Uq=Fy(qe("Map"),([e,t])=>xt(re(e),re(t))),Lq=Fy(qe("Set"),re),Oy=new WeakMap,Ay=new WeakMap,_y=new WeakSet});function Y(){if(arguments.length===1)return(e)=>Zi(e,arguments[0]);return Zi(arguments[0],arguments[1])}function Zi(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;if(n!==typeof t)return!1;if(n==="number"&&e!==e&&t!==t)return!0;if(n!=="object"&&n!=="function")return!1;if(wc.has(e)||wc.has(t))return!1;return qq(e,t,Hq)}function Bq(e,t,n){let r=My.has(e),o=Ny.has(t);if(r&&o)return!0;if(r||o)return!1;My.add(e),Ny.add(t);let s=n();return My.delete(e),Ny.delete(t),s}function Hq(e,t){if(re(e)!==re(t))return!1;else if(e instanceof Date){if(!(t instanceof Date))return!1;let s=e.getTime(),i=t.getTime();return s===i||Number.isNaN(s)&&Number.isNaN(i)}else if(e instanceof RegExp){if(!(t instanceof RegExp))return!1;return e.toString()===t.toString()}let n=W0(e),r=W0(t);if(n!==r)return!1;let o=n&&r;if(typeof e==="function"&&!o)return!1;return Bq(e,t,()=>{if(o)return e[Ce](t);else if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;return zq(e,t)}else if(ArrayBuffer.isView(e)){let s=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||s!==t instanceof DataView)return!1;if(s){let i=t;return z0(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(i.buffer,i.byteOffset,i.byteLength))}return z0(e,t)}else if(e instanceof Map){if(!(t instanceof Map)||e.size!==t.size)return!1;return Kq(e,t)}else if(e instanceof Set){if(!(t instanceof Set)||e.size!==t.size)return!1;return Vq(e,t)}return Wq(e,t)})}function qq(e,t,n){let r=Pp.get(e);if(!r)r=new WeakMap,Pp.set(e,r);else if(r.has(t))return r.get(t);let o=n(e,t);r.set(t,o);let s=Pp.get(t);if(!s)s=new WeakMap,Pp.set(t,s);return s.set(e,o),o}function zq(e,t){for(let n=0;n<e.length;n++)if(!Zi(e[n],t[n]))return!1;return!0}function z0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wq(e,t){let n=El(e),r=El(t);if(n.size!==r.size)return!1;for(let o of n)if(!r.has(o)||!Zi(e[o],t[o]))return!1;return!0}function Fp(e,t){return function(r,o){let s=Array.from(o);for(let[i,a]of r){let c=!1;for(let u=0;u<s.length;u++){let[l,f]=s[u];if(e(i,l)&&t(a,f)){s[u]=s[s.length-1],s.pop(),c=!0;break}}if(!c)return!1}return!0}}function Mp(e){return function(n,r){let o=Array.from(r);for(let s of n){let i=!1;for(let a=0;a<o.length;a++){let c=o[a];if(e(s,c)){o[a]=o[o.length-1],o.pop(),i=!0;break}}if(!i)return!1}return!0}}var Ce="~effect/interfaces/Equal",My,Ny,Pp,Kq,Vq,W0=(e)=>M(e,Ce),Dy=()=>Y,$y=(e)=>(wc.add(e),e);var yt=w(()=>{Xt();Iy();he();My=new WeakSet,Ny=new WeakSet;Pp=new WeakMap;Kq=Fp(Zi,Zi);Vq=Mp(Zi)});function kc(e){if(Gq(e))return Uy(e);return e}function Uy(e){return e[kl](globalThis[Ic]?.context??Jq)}var kl,Gq=(e)=>M(e,kl),Ic="~effect/Fiber/currentFiber",K0,Jq;var Np=w(()=>{Qe();he();kl=Symbol.for("~effect/Redactable");K0=new Map,Jq={"~effect/Context":{},base:K0,depth:0,mapUnsafe:K0,pipe(){return le(this,arguments)}}});function B(e,t){let n=t?.space??0,r=new WeakSet,o=!n?"":typeof n==="number"?" ".repeat(n):n,s=(u)=>o.repeat(u),i=(u,l)=>{let f=u?.constructor;return f&&f!==Object.prototype.constructor&&f.name?`${f.name}(${l})`:l},a=(u)=>{try{return Reflect.ownKeys(u)}catch{return["[ownKeys threw]"]}};function c(u,l=0){if(typeof u==="string")return JSON.stringify(u);if(typeof u==="number"||u==null||typeof u==="boolean"||typeof u==="symbol")return String(u);if(typeof u==="bigint")return String(u)+"n";if(typeof u==="object"||typeof u==="function"){if(r.has(u))return Zq;r.add(u);let f;if(kl in u)f=c(Uy(u),l);else if(Array.isArray(u))f=!o||u.length<=1?`[${u.map((d)=>c(d,l)).join(",")}]`:`[
|
|
4
|
-
${s(
|
|
5
|
-
`+s(
|
|
6
|
-
${s(
|
|
7
|
-
${d.map((
|
|
3
|
+
var E=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Wu;var hh=E(()=>{Wu={name:"@seanmozeik/tripwire",version:"0.9.0",description:"Configurable safety hooks for Claude Code, Codex, Cursor, Pi, and Oh My Pi",keywords:["ai-agents","bun","claude-code","codex","cursor","hooks","safety"],homepage:"https://github.com/seanmozeik/tripwire#readme",bugs:{url:"https://github.com/seanmozeik/tripwire/issues"},license:"MIT",author:"Sean Mozeik",repository:{type:"git",url:"git+https://github.com/seanmozeik/tripwire.git"},bin:{tripwire:"./dist/tripwire-cli.js","tripwire-hook":"./dist/tripwire-hook.js"},workspaces:["packages/*"],files:["dist","LICENSE","package.json","README.md"],type:"module",types:"./dist/types/index.d.ts",exports:{".":{types:"./dist/types/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"}},publishConfig:{access:"public"},scripts:{build:"bun scripts/build.ts",prepublishOnly:"bun run verify",check:"bun run format && bun run lint:fix && bun run typecheck",format:"oxfmt --write .","format:check":"oxfmt --check .",lint:"oxlint .","lint:fix":"oxlint --format agent --fix .",prepare:"bunx effect-tsgo patch",test:"bun test",typecheck:"tsc --noEmit",verify:"bun run format:check && bun run lint && bun run typecheck && bun test && bun run build"},dependencies:{"@lezer/common":"1.5.2","@lezer/javascript":"1.5.4","@lezer/python":"1.1.19",unbash:"4.0.11"},devDependencies:{"@effect/platform-bun":"4.0.0-rc.112","@effect/tsgo":"0.45.0","@seanmozeik/de-clank":"0.1.8","bun-types":"1.4.2",effect:"4.0.0-rc.112",oxfmt:"0.67.0",oxlint:"1.82.0","oxlint-tsgolint":"7.0.2001",typescript:"7.0.2"},peerDependencies:{"@effect/platform-bun":"4.0.0-rc.112",effect:"4.0.0-rc.112"},optionalDependencies:{"@seanmozeik/tripwire-darwin-arm64":"0.9.0"},engines:{bun:">=1.4"}}});var pe=(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 n=0,o=t.length;n<o;n++)r=t[n](r);return r}}},F1,Tc;var It=E(()=>{F1={pipe(){return pe(this,arguments)}},Tc=function(){function e(){}return e.prototype=F1,e}()});function Ho(e,...t){return pe(e,t)}function gS(e,t,r,n,o,s,i,a,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return o(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return s(o(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return i(s(o(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return a(i(s(o(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return c(a(i(s(o(n(r(t(e.apply(this,arguments)))))))))}}return}function so(e){let t=new WeakMap;return(r)=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),o}}function ea(e){let t=new WeakMap;return(r)=>{let n=t.get(r);if(n!==void 0)return n;let o=e(r);return t.set(r,o),t.set(o,o),o}}var v=function(e,t){if(typeof e==="function")return function(){return e(arguments)?t.apply(this,arguments):(r)=>t(r,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(r,n){if(arguments.length>=2)return t(r,n);return function(o){return t(o,r)}};case 3:return function(r,n,o){if(arguments.length>=3)return t(r,n,o);return function(s){return t(s,r,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(n){return t(n,...r)}}}},B=(e)=>e,$r=(e)=>()=>e,no,mh,Yo,oo;var oe=E(()=>{It();no=$r(!0),mh=$r(!1),Yo=$r(void 0),oo=Yo});var vc=(e)=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;if(e instanceof Error)t.delete("stack");let r=Object.getPrototypeOf(e),n=r;while(n!==null&&n!==Object.prototype){let o=Reflect.ownKeys(n);for(let s=0;s<o.length;s++)t.add(o[s]);n=Object.getPrototypeOf(n)}if(t.has("constructor")&&typeof e.constructor==="function"&&r===e.constructor.prototype)t.delete("constructor");return t},Cc;var Oh=E(()=>{Cc=new WeakSet});function Jo(e){return typeof e==="string"}function Qc(e){return typeof e==="number"}function zu(e){return typeof e==="boolean"}function xS(e){return typeof e==="symbol"}function gh(e){return Jo(e)||Qc(e)||xS(e)}function io(e){return typeof e==="function"}function ta(e){return e===void 0}function wt(e){return e!==void 0}function _c(e){return e!==null}function yS(e){return e===null||e===void 0}function xh(e){return e!=null}function SS(e){return!0}function yh(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Xu(e){return typeof e==="object"&&e!==null||io(e)}function ES(e){return e instanceof Error}var G,Bs;var ye=E(()=>{oe();G=v(2,(e,t)=>Xu(e)&&(t in e)),Bs=v(2,(e,t)=>G(e,"_tag")&&e._tag===t)});function N1(e,t){if(bh.has(e))return it("[Circular]");bh.add(e);let r=t();return bh.delete(e),r}var Je="~effect/interfaces/Hash",Oe=(e)=>{switch(typeof e){case"number":return ra(e);case"bigint":return it(e.toString(10));case"boolean":return it(String(e));case"symbol":return it(String(e));case"string":return it(e);case"undefined":return it("undefined");case"function":case"object":if(e===null)return it("null");else if(e instanceof Date){if(Number.isNaN(e.getTime()))return it("Invalid Date");return it(e.toISOString())}else if(e instanceof RegExp)return it(e.toString());else{if(Cc.has(e))return ju(e);if(Eh.has(e))return Eh.get(e);let t=N1(e,()=>{if(U1(e))return e[Je]();else if(typeof e==="function")return ju(e);else if(e instanceof DataView)return Vu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)||ArrayBuffer.isView(e))return Vu(e);else if(e instanceof Map)return D1(e);else if(e instanceof Set)return M1(e);return Ph(e)});return Eh.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},ju=(e)=>{if(!Sh.has(e))Sh.set(e,ra(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return Sh.get(e)},Yt,Bu=(e)=>e&3221225471|e>>>1&1073741824,U1=(e)=>G(e,Je),ra=(e)=>{if(e!==e)return it("NaN");if(e===1/0)return it("Infinity");if(e===-1/0)return it("-Infinity");let t=e|0;if(t!==e)t^=e*4294967295;while(e>4294967295)t^=e/=4294967295;return Bu(t)},it=(e)=>{let t=5381,r=e.length;while(r)t=t*33^e.charCodeAt(--r);return Bu(t)},kh=(e,t)=>{let r=12289;for(let n of t)r^=Yt(Oe(n),Oe(e[n]));return Bu(r)},Ph=(e)=>kh(e,vc(e)),wh=(e,t)=>(r)=>{let n=e;for(let o of r)n^=t(o);return Bu(n)},Vu,D1,M1,Sh,Eh,bh;var En=E(()=>{oe();Oh();ye();Yt=v(2,(e,t)=>e*53^t),Vu=wh(6151,Oe),D1=wh(it("Map"),([e,t])=>Yt(Oe(e),Oe(t))),M1=wh(it("Set"),Oe),Sh=new WeakMap,Eh=new WeakMap,bh=new WeakSet});function at(){if(arguments.length===1)return(e)=>Gs(e,arguments[0]);return Gs(arguments[0],arguments[1])}function Gs(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let r=typeof e;if(r!==typeof t)return!1;if(r==="number"&&e!==e&&t!==t)return!0;if(r!=="object"&&r!=="function")return!1;if(Cc.has(e)||Cc.has(t))return!1;return W1(e,t,q1)}function Z1(e,t,r){let n=Th.has(e),o=vh.has(t);if(n&&o)return!0;if(n||o)return!1;Th.add(e),vh.add(t);let s=r();return Th.delete(e),vh.delete(t),s}function q1(e,t){if(Oe(e)!==Oe(t))return!1;else if(e instanceof Date){if(!(t instanceof Date))return!1;let s=e.getTime(),i=t.getTime();return s===i||Number.isNaN(s)&&Number.isNaN(i)}else if(e instanceof RegExp){if(!(t instanceof RegExp))return!1;return e.toString()===t.toString()}let r=kS(e),n=kS(t);if(r!==n)return!1;let o=r&&n;if(typeof e==="function"&&!o)return!1;return Z1(e,t,()=>{if(o)return e[Ke](t);else if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;return L1(e,t)}else if(ArrayBuffer.isView(e)){let s=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||s!==t instanceof DataView)return!1;if(s){let i=t;return bS(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(i.buffer,i.byteOffset,i.byteLength))}return bS(e,t)}else if(e instanceof Map){if(!(t instanceof Map)||e.size!==t.size)return!1;return j1(e,t)}else if(e instanceof Set){if(!(t instanceof Set)||e.size!==t.size)return!1;return B1(e,t)}return z1(e,t)})}function W1(e,t,r){let n=Gu.get(e);if(!n)n=new WeakMap,Gu.set(e,n);else if(n.has(t))return n.get(t);let o=r(e,t);n.set(t,o);let s=Gu.get(t);if(!s)s=new WeakMap,Gu.set(t,s);return s.set(e,o),o}function L1(e,t){for(let r=0;r<e.length;r++)if(!Gs(e[r],t[r]))return!1;return!0}function bS(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function z1(e,t){let r=vc(e),n=vc(t);if(r.size!==n.size)return!1;for(let o of r)if(!n.has(o)||!Gs(e[o],t[o]))return!1;return!0}function X1(e,t){return function(n,o){let s=Array.from(o);for(let[i,a]of n){let c=!1;for(let l=0;l<s.length;l++){let[u,f]=s[l];if(e(i,u)&&t(a,f)){s[l]=s[s.length-1],s.pop(),c=!0;break}}if(!c)return!1}return!0}}function V1(e){return function(r,n){let o=Array.from(n);for(let s of r){let i=!1;for(let a=0;a<o.length;a++){let c=o[a];if(e(s,c)){o[a]=o[o.length-1],o.pop(),i=!0;break}}if(!i)return!1}return!0}}var Ke="~effect/interfaces/Equal",Th,vh,Gu,j1,B1,kS=(e)=>G(e,Ke);var co=E(()=>{En();Oh();ye();Th=new WeakSet,vh=new WeakSet;Gu=new WeakMap;j1=X1(Gs,Gs);B1=V1(Gs)});function na(e){if(G1(e))return Ch(e);return e}function Ch(e){return e[$c](globalThis[oa]?.context??Y1)}var $c,G1=(e)=>G(e,$c),oa="~effect/Fiber/currentFiber",PS,Y1;var Yu=E(()=>{It();ye();$c=Symbol.for("~effect/Redactable");PS=new Map,Y1={"~effect/Context":{},base:PS,depth:0,mapUnsafe:PS,pipe(){return pe(this,arguments)}}});function he(e,t){let r=t?.space??0,n=new WeakSet,o=!r?"":typeof r==="number"?" ".repeat(r):r,s=(l)=>o.repeat(l),i=(l,u)=>{let f=l?.constructor;return f&&f!==Object.prototype.constructor&&f.name?`${f.name}(${u})`:u},a=(l)=>{try{return Reflect.ownKeys(l)}catch{return["[ownKeys threw]"]}};function c(l,u=0){if(typeof l==="string")return JSON.stringify(l);if(typeof l==="number"||l==null||typeof l==="boolean"||typeof l==="symbol")return String(l);if(typeof l==="bigint")return String(l)+"n";if(typeof l==="object"||typeof l==="function"){if(n.has(l))return H1;n.add(l);let f;if($c in l)f=c(Ch(l),u);else if(Array.isArray(l))f=!o||l.length<=1?`[${l.map((d)=>c(d,u)).join(",")}]`:`[
|
|
4
|
+
${s(u+1)}${l.map((d)=>c(d,u+1)).join(`,
|
|
5
|
+
`+s(u+1))}
|
|
6
|
+
${s(u)}]`;else if(l instanceof Date)f=TS(l);else if(!t?.ignoreToString&&G(l,"toString")&&typeof l.toString==="function"&&l.toString!==Object.prototype.toString&&l.toString!==Array.prototype.toString){let d=J1(l);f=l instanceof Error&&l.cause?`${d} (cause: ${c(l.cause,u)})`:d}else if(Symbol.iterator in l)f=`${l.constructor.name}(${c(Array.from(l),u)})`;else{let d=a(l);if(!o||d.length<=1){let h=`{${d.map((m)=>`${sa(m)}:${c(l[m],u)}`).join(",")}}`;f=i(l,h)}else{let h=`{
|
|
7
|
+
${d.map((m)=>`${s(u+1)}${sa(m)}: ${c(l[m],u+1)}`).join(`,
|
|
8
8
|
`)}
|
|
9
|
-
${s(l)}}`;f=i(u,m)}}return r.delete(u),f}return String(u)}return c(e,0)}function Go(e){return typeof e==="string"?JSON.stringify(e):String(e)}function Dp(e){return e.map((t)=>`[${Go(t)}]`).join("")}function Ly(e){try{return e.toISOString()}catch{return"Invalid Date"}}function Yq(e){try{let t=e.toString();return typeof t==="string"?t:String(t)}catch{return"[toString threw]"}}function Yi(e,t){let n=[];return JSON.stringify(e,function(r,o){let s=Object.getOwnPropertyDescriptor(this,r)?.value,i=M(s,kl)?kc(s):kc(o);if(typeof i==="bigint")return B(i);if(typeof i!=="object"||i===null)return i;while(n.length>0&&n[n.length-1]!==this)n.pop();if(n.includes(i))return;return n.push(i),i},t?.space)??"null"}var Zq="[Circular]";var kn=w(()=>{he();Np()});var At,Wt=(e)=>{try{if(e=kc(e),M(e,"toJSON")&&ln(e.toJSON)&&e.toJSON.length===0)return e.toJSON();else if(Array.isArray(e))return e.map(Wt);return e}catch{return"[toJSON threw]"}},V0=(e,t=2)=>{if(typeof e==="string")return e;try{return typeof e==="object"?Yi(e,{space:t}):B(e,{space:t})}catch{return String(e)}},G0,Qq;var jn=w(()=>{kn();he();Np();At=Symbol.for("nodejs.util.inspect.custom"),G0={toJSON(){return Wt(this)},[At](){return this.toJSON()},toString(){return B(this.toJSON())}};Qq=class Qq{[At](){return this.toJSON()}toString(){return B(this.toJSON())}}});var Zs,Xq=()=>{let t={["~effect/Utils/internal"]:(o)=>o()},n={["~effect/Utils/internal"]:(o)=>{try{return o()}finally{}}};return t["~effect/Utils/internal"](()=>Error().stack)?.includes("~effect/Utils/internal")===!0?t["~effect/Utils/internal"]:n["~effect/Utils/internal"]},Ae;var Qi=w(()=>{Zs=class Zs{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new Zs(this.self)}};Ae=Xq()});function U(e,t,n){if(t==="__proto__")Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});else e[t]=n}function $p(e,t){for(let n of Reflect.ownKeys(t))if(Object.prototype.propertyIsEnumerable.call(t,n))U(e,n,t[n])}function nz(e){return Kr("Effect.evaluate: Not implemented")}var xo="~effect/Effect",Xi="~effect/Exit",ez,Y0,ie,St,In,wr,Ys,ta,Cn,Q0,tz,fe=(e)=>M(e,xo),jy=(e)=>M(e,Xi),Cc="~effect/Cause",Tc="~effect/Cause/Reason",Oc=(e)=>M(e,Cc),X0=(e)=>M(e,Tc),Jo,Z0,Cl,Tl,Ac,Zo=(e)=>new Jo(e),Up,Ol=(e)=>new Jo([new Ac(e)]),Lp,By=(e)=>new Jo([new Lp(e)]),_c,Qs=(e)=>e._tag==="Fail",na=(e)=>e._tag==="Die",ra=(e)=>e._tag==="Interrupt",Yo=(e)=>({...tz,[Y0]:e.op,[St]:e[St]??nz,[In]:e[In],[wr]:e[wr],[Ys]:e[Ys]}),vr=(e)=>{let t=Yo(e);return function(){let n=Object.create(t);return n[ie]=e.single===!1?arguments:arguments[0],n}},eC=(e)=>{let t={[Xi]:Xi,_tag:e.op,get[e.prop](){return this[ie]},...Yo(e),toString(){return`${e.op}(${B(this[ie])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[ie]}},[Ce](n){return jy(n)&&n._tag===this._tag&&Y(this[ie],n[ie])},[Ie](){return xt(qe(e.op),re(this[ie]))}};return function(n){let r=Object.create(t);return r[ie]=n,r}},je,jp,Hy,pn,kr=(e)=>pn(Ol(e)),Kr=(e)=>pn(By(e)),ce,rz,Al,Qo=(e)=>{class t extends Al{_tag=e}return t.prototype.name=e,t},Il="~effect/Cause/NoSuchElementError",Bp=(e)=>M(e,Il),yo,ea="~effect/Cause/Done",_l=(e)=>M(e,ea),tC,Rc=(e)=>{if(e===void 0)return tC;return{[ea]:ea,_tag:"Done",value:e}},oz,nC=(e)=>{if(e===void 0)return oz;return kr(Rc(e))};var rt=w(()=>{yt();kn();X();Xt();jn();Qe();he();Qi();ez={_A:D,_E:D,_R:D},Y0=`${xo}/identifier`,ie=`${xo}/args`,St=`${xo}/evaluate`,In=`${xo}/successCont`,wr=`${xo}/failureCont`,Ys=`${xo}/ensureCont`,ta=Symbol.for("effect/Effect/Yield"),Cn={pipe(){return le(this,arguments)},toJSON(){return{...this}},toString(){return B(this.toJSON(),{ignoreToString:!0,space:2})},[At](){return this.toJSON()}},Q0={[Ie](){return Ry(this,Object.keys(this))},[Ce](e){let t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r]||!Y(this[t[r]],e[t[r]]))return!1;return!0}},tz={[xo]:ez,...Cn,[Symbol.iterator](){return new Zs(this)},toJSON(){return{_id:"Effect",op:this[Y0],...ie in this?{args:this[ie]}:void 0}}};Jo=class Jo{[Cc];reasons;constructor(e){this[Cc]=Cc,this.reasons=e}pipe(){return le(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((e)=>e.toJSON())}}toString(){return`Cause(${B(this.reasons)})`}[At](){return this.toJSON()}[Ce](e){return Oc(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Y(t,e.reasons[n]))}[Ie](){return vc(this.reasons)}};Z0=new WeakMap;Cl=class Cl{[Tc];annotations;_tag;constructor(e,t,n){if(this[Tc]=Tc,this._tag=e,t!==Tl&&typeof n==="object"&&n!==null&&t.size>0){let r=Z0.get(n);if(r)t=new Map([...r,...t]);Z0.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((o,s)=>{if(t?.overwrite!==!0&&n.has(s))return;n.set(s,o)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return le(this,arguments)}toString(){return B(this)}[At](){return this.toString()}};Tl=new Map;Ac=class Ac extends Cl{error;constructor(e,t=Tl){super("Fail",t,e);this.error=e}toString(){return`Fail(${B(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[Ce](e){return Qs(e)&&Y(this.error,e.error)&&Y(this.annotations,e.annotations)}[Ie](){return xt(qe(this._tag))(xt(re(this.error))(re(this.annotations)))}};Up=new Jo([]);Lp=class Lp extends Cl{defect;constructor(e,t=Tl){super("Die",t,e);this.defect=e}toString(){return`Die(${B(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[Ce](e){return na(e)&&Y(this.defect,e.defect)&&Y(this.annotations,e.annotations)}[Ie](){return xt(qe(this._tag))(xt(re(this.defect))(re(this.annotations)))}};_c=p((e)=>Oc(e[0]),(e,t,n)=>{if(t.mapUnsafe.size===0)return e;return new Jo(e.reasons.map((r)=>r.annotate(t,n)))});je=eC({op:"Success",prop:"value",[St](e){let t=e.getCont(In);return t?t[In](this[ie],e,this):e.yieldWith(this)}}),jp={key:"effect/Cause/StackTrace"},Hy={key:"effect/Cause/InterruptorStackTrace"},pn=eC({op:"Failure",prop:"cause",[St](e){let t=this[ie],n=!1;if(e.currentStackFrame)t=_c(t,{mapUnsafe:new Map([[jp.key,e.currentStackFrame]])}),n=!0;let r=e.getCont(wr);while(e.interruptible&&e._interruptedCause&&r)r=e.getCont(wr);return r?r[wr](t,e,n?void 0:this):e.yieldWith(n?pn(t):this)}}),ce=vr({op:"WithFiber",[St](e){return this[ie](e)}}),rz=function(){class e extends globalThis.Error{}let t=Yo({op:"YieldableError",[St](){return kr(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Al=function(){let e=Symbol.for("effect/Data/Error/plainArgs");return class extends rz{constructor(n){super(n?.message,n?.cause?{cause:n.cause}:void 0);if(n)$p(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1})}toJSON(){return{...this[e],...this}}}}();yo=class yo extends Qo("NoSuchElementError"){[Il]=Il;constructor(e){super({message:e})}};tC={[ea]:ea,_tag:"Done",value:void 0},oz=kr(tC)});var So=(e)=>Yo({op:e.label,[St]:e.evaluate});var Pc=w(()=>{rt()});function Hp(e){return{combine:e}}function Ir(e,t,n){return{combine:e,initialValue:t,combineAll:n??((r)=>{let o=t;for(let s of r)o=e(o,s);return o})}}function sC(e){return Kt((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0})}var Kt=(e)=>(t,n)=>t===n||e(t,n),sz=(e,t)=>e===t,oC=()=>sz;var Xo=()=>{};var Fc=(e)=>p(3,(t,n,r)=>e(t,(o)=>({...o,[n]:r(o)}))),Mc=(e)=>p(2,(t,n)=>e(t,(r)=>({[n]:r}))),Nc=(e,t)=>p(3,(n,r,o)=>t(n,(s)=>e(o(s),(i)=>({...s,[r]:i}))));var qp=w(()=>{X()});var iC="~effect/data/Option",aC,iz,az,cz,zp=(e)=>M(e,iC),ei=(e)=>e._tag==="None",zy=(e)=>e._tag==="Some",oa,es=(e)=>{let t=Object.create(iz);return t.value=e,t};var Wp=w(()=>{yt();kn();Xt();jn();he();Qi();rt();aC={[iC]:{_A:(e)=>e},...Cn,[Symbol.iterator](){return new Zs(this)}},iz=Object.defineProperty(Object.assign(Object.create(aC),{_tag:"Some",_op:"Some",[Ce](e){return zp(e)&&zy(e)&&Y(this.value,e.value)},[Ie](){return xt(re(this._tag))(re(this.value))},toString(){return`some(${B(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Wt(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),az=re("None"),cz=Object.assign(Object.create(aC),{_tag:"None",_op:"None",valueOrUndefined:void 0,[Ce](e){return zp(e)&&ei(e)},[Ie](){return az},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),oa=Object.create(cz)});var cC="~effect/data/Result",uC,uz,lz,Kp=(e)=>M(e,cC),Dc=(e)=>e._tag==="Failure",$c=(e)=>e._tag==="Success",Fl=(e)=>{let t=Object.create(lz);return t.failure=e,t},Ml=(e)=>{let t=Object.create(uz);return t.success=e,t},Vp=(e)=>$c(e)?oa:es(e.failure),Gp=(e)=>Dc(e)?oa:es(e.success),lC;var Ky=w(()=>{yt();kn();X();Xt();jn();he();Qi();rt();Wp();uC={[cC]:{_A:(e)=>e,_E:(e)=>e},...Cn,[Symbol.iterator](){return new Zs(this)}},uz=Object.assign(Object.create(uC),{_tag:"Success",_op:"Success",[Ce](e){return Kp(e)&&$c(e)&&Y(this.success,e.success)},[Ie](){return xt(re(this._tag))(re(this.success))},toString(){return`success(${B(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Wt(this.success)}}}),lz=Object.assign(Object.create(uC),{_tag:"Failure",_op:"Failure",[Ce](e){return Kp(e)&&Dc(e)&&Y(this.failure,e.failure)},[Ie](){return xt(re(this._tag))(re(this.failure))},toString(){return`failure(${B(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Wt(this.failure)}}}),lC=p(2,(e,t)=>ei(e)?Fl(t()):Ml(e.value))});function ts(e){return(t,n)=>t===n?0:e(t,n)}var rr,Cr,Vy,sa,Uc=(e)=>p(2,(t,n)=>e(t,n)===-1),ti=(e)=>p(2,(t,n)=>e(t,n)===1),Nl=(e)=>p(2,(t,n)=>e(t,n)!==1),Dl=(e)=>p(2,(t,n)=>e(t,n)!==-1);var ia=w(()=>{X();rr=ts((e,t)=>{if(globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t))return 0;if(globalThis.Number.isNaN(e))return-1;if(globalThis.Number.isNaN(t))return 1;return e<t?-1:1}),Cr=ts((e,t)=>e<t?-1:1),Vy=p(2,(e,t)=>ts((n,r)=>e(t(n),t(r)))),sa=Vy(rr,(e)=>e.getTime())});var be={};Un(be,{Do:()=>Uz,all:()=>Oz,andThen:()=>wz,as:()=>pC,asVoid:()=>Ez,bind:()=>$z,bindTo:()=>Nz,composeK:()=>Cz,contains:()=>Mz,containsWith:()=>yC,exists:()=>Qy,filter:()=>ca,filterMap:()=>Rz,firstSomeOf:()=>xz,flatMap:()=>rs,flatMapNullishOr:()=>vz,flatten:()=>aa,fromIterable:()=>dz,fromNullOr:()=>Gy,fromNullishOr:()=>Tn,fromUndefinedOr:()=>ns,gen:()=>Lz,getFailure:()=>pz,getOrElse:()=>mt,getOrNull:()=>Jp,getOrThrow:()=>Sz,getOrThrowWith:()=>Jy,getOrUndefined:()=>mn,getSuccess:()=>dC,isNone:()=>me,isOption:()=>jc,isSome:()=>Ee,let:()=>Dz,lift2:()=>Fz,liftNullishOr:()=>yz,liftPredicate:()=>Yy,liftThrowable:()=>ni,makeCombinerFailFast:()=>SC,makeEquivalence:()=>Zy,makeOrder:()=>Pz,makeReducer:()=>jz,makeReducerFailFast:()=>Bz,map:()=>en,match:()=>et,none:()=>O,orElse:()=>mz,orElseResult:()=>gz,orElseSome:()=>hz,partitionMap:()=>_z,product:()=>hC,productMany:()=>Tz,reduceCompact:()=>Az,some:()=>_,tap:()=>mC,toArray:()=>xC,toRefinement:()=>fz,void:()=>bz,zipLeft:()=>Iz,zipRight:()=>kz,zipWith:()=>gC});function jz(e){return Ir((t,n)=>{if(me(t))return n;if(me(n))return t;return _(e.combine(t.value,n.value))},O())}function SC(e){return Hp((t,n)=>{if(me(t)||me(n))return O();return _(e.combine(t.value,n.value))})}function Bz(e){let t=SC(e).combine,n=_(e.initialValue);return Ir(t,n,(r)=>{let o=n;for(let s of r)if(o=t(o,s),me(o))return o;return o})}var O=()=>oa,_,jc,me,Ee,et,fz=(e)=>(t)=>Ee(e(t)),dz=(e)=>{for(let t of e)return _(t);return O()},dC,pz,mt,mz,hz,gz,xz=(e)=>{let t=O();for(t of e)if(Ee(t))return t;return t},Tn=(e)=>e==null?O():_(e),ns=(e)=>e===void 0?O():_(e),Gy=(e)=>e===null?O():_(e),yz=(e)=>(...t)=>Tn(e(...t)),Jp,mn,ni=(e)=>(...t)=>{try{return _(e(...t))}catch{return O()}},Jy,Sz,en,pC,Ez,bz,rs,wz,vz,aa,kz,Iz,Cz,mC,hC=(e,t)=>Ee(e)&&Ee(t)?_([e.value,t.value]):O(),Tz=(e,t)=>{if(me(e))return O();let n=[e.value];for(let r of t){if(me(r))return O();n.push(r.value)}return _(n)},Oz=(e)=>{if(Symbol.iterator in e){let n=[];for(let r of e){if(me(r))return O();n.push(r.value)}return _(n)}let t={};for(let n of Object.keys(e)){let r=e[n];if(me(r))return O();U(t,n,r.value)}return _(t)},gC,Az,xC=(e)=>me(e)?[]:[e.value],_z,Rz,ca,Zy=(e)=>Kt((t,n)=>me(t)?me(n):me(n)?!1:e(t.value,n.value)),Pz=(e)=>ts((t,n)=>Ee(t)?Ee(n)?e(t.value,n.value):1:-1),Fz=(e)=>p(2,(t,n)=>gC(t,n,e)),Yy,yC=(e)=>p(2,(t,n)=>me(t)?!1:e(t.value,n)),Mz,Qy,Nz,Dz,$z,Uz,Lz=(...e)=>{let n=(e.length===1?e[0]:e[1].bind(e[0]))(),r=n.next();while(!r.done){let o=r.value;if(me(o))return o;r=n.next(o.value)}return _(r.value)};var _e=w(()=>{yt();Xo();X();qp();Wp();Ky();ia();he();_=es,jc=zp,me=ei,Ee=zy,et=p(2,(e,{onNone:t,onSome:n})=>me(e)?t():n(e.value)),dC=Gp,pz=Vp,mt=p(2,(e,t)=>me(e)?t():e.value),mz=p(2,(e,t)=>me(e)?t():e),hz=p(2,(e,t)=>me(e)?_(t()):e),gz=p(2,(e,t)=>me(e)?en(t(),Ml):en(e,Fl)),Jp=mt(Tp),mn=mt(qr),Jy=p(2,(e,t)=>{if(Ee(e))return e.value;throw t()}),Sz=Jy(()=>Error("getOrThrow called on a None")),en=p(2,(e,t)=>me(e)?O():_(t(e.value))),pC=p(2,(e,t)=>en(e,()=>t)),Ez=pC(void 0),bz=_(void 0),rs=p(2,(e,t)=>me(e)?O():t(e.value)),wz=p(2,(e,t)=>rs(e,(n)=>{let r=ln(t)?t(n):t;return jc(r)?r:_(r)})),vz=p(2,(e,t)=>me(e)?O():Tn(t(e.value))),aa=rs(D),kz=p(2,(e,t)=>rs(e,()=>t)),Iz=p(2,(e,t)=>mC(e,()=>t)),Cz=p(2,(e,t)=>(n)=>rs(e(n),t)),mC=p(2,(e,t)=>rs(e,(n)=>en(t(n),()=>n))),gC=p(3,(e,t,n)=>en(hC(e,t),([r,o])=>n(r,o))),Az=p(3,(e,t,n)=>{let r=t;for(let o of e)if(Ee(o))r=n(r,o.value);return r}),_z=p(2,(e,t)=>{if(me(e))return[O(),O()];let n=t(e.value);return Dc(n)?[_(n.failure),O()]:[O(),_(n.success)]}),Rz=p(2,(e,t)=>{if(me(e))return O();let n=t(e.value);return $c(n)?_(n.success):O()}),ca=p(2,(e,t)=>me(e)?O():t(e.value)?_(e.value):O()),Yy=p(2,(e,t)=>t(e)?_(e):O()),Mz=yC(Dy()),Qy=p(2,(e,t)=>me(e)?!1:t(e.value)),Nz=Mc(en),Dz=Fc(en),$z=Nc(en,rs),Uz=_({})});var EC="~effect/Context/Service",ze=function(){function e(){}let t=e;Object.setPrototypeOf(t,Hz);let n=(r,o)=>{if(t.key=r,o?.defaultValue)t[eS]=eS,t.defaultValue=o.defaultValue;if(o?.make)t.make=o.make;if(o?.fiberCached)bC.add(r);return t};return arguments.length>0?n(arguments[0],arguments[1]):n},Hz,bC,eS="~effect/Context/Reference",wC="~effect/Context",qz=8,zz=8,tS=(e,t,n,r)=>{let o=Object.create(Kz);return o.cacheRoot=e??o,o.base=t,o.overlay=n,o.depth=r,o._flat=void 0,o.baseHits=0,o},vC=(e,t)=>{if(!t)return;vC(e,t.parent),e.set(t.key,t.value)},kC=(e)=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return vC(t,e.overlay),e._flat=t},Wz=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),ri(n)},Zp,nS=(e,t)=>{let n=e;for(let o=n.overlay;o;o=o.parent)if(o.key===t)return o.value;let r=n.base.get(t);if(r===void 0&&!n.base.has(t))return Zp;if(n.overlay&&++n.baseHits>=zz)n.base=kC(n),n.overlay=void 0,n.depth=0;return r},ri=(e)=>tS(void 0,e,void 0,0),Kz,IC=(e,t)=>e.cacheRoot===t.cacheRoot,rS=(e)=>M(e,wC),CC=(e)=>!!e[eS],hn=()=>Vz,Vz,os=(e,t)=>ri(new Map([[e.key,t]])),tn,Gz=(e,t,n)=>{let r=e,o=bC.has(t)?void 0:r.cacheRoot;if(r.depth>=qz){let s=new Map(r.mapUnsafe);return s.set(t,n),tS(o,s,void 0,0)}return tS(o,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Yp,$l=(e,t)=>{let n=nS(e,t);return n===Zp?void 0:n},Gr,On,Xy="~effect/Context/defaultValue",TC=(e)=>{if(Xy in e)return e[Xy];return e[Xy]=e.defaultValue()},Jz=(e)=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(t.stack){let n=t.stack.split(`
|
|
10
|
-
`);
|
|
11
|
-
`)}return t},oS,ua,OC=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((r,o)=>{t.set(o,r)});return ri(t)},ke;var Ve=w(()=>{Pc();yt();X();Xt();rt();_e();he();Hz={[EC]:EC,...So({label:"Service",evaluate(e){return je(On(e.context,this))}}),toJSON(){return{_id:"Service",key:this.key}},of(e){return e},context(e){return os(this,e)},use(e){return ce((t)=>e(On(t.context,this)))},useSync(e){return ce((t)=>je(e(On(t.context,this))))}},bC=new Set,Zp=Symbol(),Kz={get mapUnsafe(){return kC(this)},...Cn,[wC]:{_Services:(e)=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Ce](e){if(!rS(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[r,o]of t)if(!n.has(r)||!Y(o,n.get(r)))return!1;return!0},[Ie](){return Ln(this.mapUnsafe.size)}},Vz=ri(new Map),tn=p(3,(e,t,n)=>Gz(e,t.key,n)),Yp=p(2,(e,t)=>$l(e,t.key)),Gr=p(2,(e,t)=>{let n=nS(e,t.key);if(n===Zp){if(CC(t))return TC(t);throw Jz(t)}return n}),On=Gr,oS=p(2,(e,t)=>{let n=nS(e,t.key);if(n!==Zp)return _(n);return CC(t)?_(TC(t)):O()}),ua=p(2,(e,t)=>{if(e.mapUnsafe.size===0)return t;if(t.mapUnsafe.size===0)return e;return Wz(e,(n)=>t.mapUnsafe.forEach((r,o)=>n.set(o,r)))}),ke=ze});var sS=(e)=>e.length>0;var Vt={};Un(Vt,{Do:()=>mW,all:()=>fW,andThen:()=>lW,bind:()=>hW,bindTo:()=>gW,fail:()=>te,failVoid:()=>Qz,filterOrFail:()=>sW,flatMap:()=>si,flip:()=>dW,fromNullishOr:()=>Xz,fromOption:()=>eW,gen:()=>pW,getFailure:()=>nW,getOrElse:()=>oi,getOrNull:()=>aW,getOrThrow:()=>_C,getOrThrowWith:()=>AC,getOrUndefined:()=>cW,getSuccess:()=>tW,isFailure:()=>xe,isResult:()=>Qp,isSuccess:()=>Ut,let:()=>xW,liftPredicate:()=>oW,makeEquivalence:()=>aS,map:()=>or,mapBoth:()=>rW,mapError:()=>Bc,match:()=>Bn,merge:()=>iW,orElse:()=>uW,succeed:()=>G,succeedNone:()=>cS,succeedSome:()=>EW,tap:()=>bW,transposeMapOption:()=>SW,transposeOption:()=>yW,try:()=>iS,void:()=>Yz});var G,te,Yz,Qz,Xz,eW,iS=(e)=>{if(ln(e))try{return G(e())}catch(t){return te(t)}else try{return G(e.try())}catch(t){return te(e.catch(t))}},Qp,xe,Ut,tW,nW,aS=(e,t)=>Kt((n,r)=>xe(n)?xe(r)&&t(n.failure,r.failure):Ut(r)&&e(n.success,r.success)),rW,Bc,or,Bn,oW,sW,iW,oi,aW,cW,AC,_C,uW,si,lW,fW=(e)=>{if(Symbol.iterator in e){let n=[];for(let r of e){if(xe(r))return r;n.push(r.success)}return G(n)}let t={};for(let n of Object.keys(e)){let r=e[n];if(xe(r))return r;U(t,n,r.success)}return G(t)},dW=(e)=>xe(e)?G(e.failure):te(e.success),pW=(...e)=>{let n=(e.length===1?e[0]:e[1].bind(e[0]))(),r=n.next();while(!r.done){let o=r.value;if(xe(o))return o;r=n.next(o.success)}return G(r.value)},mW,hW,gW,xW,yW=(e)=>ei(e)?cS:or(e.value,es),SW,cS,EW=(e)=>G(es(e)),bW;var gn=w(()=>{Xo();X();qp();Wp();Ky();he();G=Ml,te=Fl,Yz=G(void 0),Qz=te(void 0),Xz=p(2,(e,t)=>e==null?te(t(e)):G(e)),eW=lC,Qp=Kp,xe=Dc,Ut=$c,tW=Gp,nW=Vp,rW=p(2,(e,{onFailure:t,onSuccess:n})=>xe(e)?te(t(e.failure)):G(n(e.success))),Bc=p(2,(e,t)=>xe(e)?te(t(e.failure)):e),or=p(2,(e,t)=>Ut(e)?G(t(e.success)):e),Bn=p(2,(e,{onFailure:t,onSuccess:n})=>xe(e)?t(e.failure):n(e.success)),oW=p(3,(e,t,n)=>t(e)?G(e):te(n(e))),sW=p(3,(e,t,n)=>si(e,(r)=>t(r)?G(r):te(n(r)))),iW=Bn({onFailure:D,onSuccess:D}),oi=p(2,(e,t)=>xe(e)?t(e.failure):e.success),aW=oi(Tp),cW=oi(qr),AC=p(2,(e,t)=>{if(Ut(e))return e.success;throw t(e.failure)}),_C=AC(D),uW=p(2,(e,t)=>xe(e)?t(e.failure):G(e.success)),si=p(2,(e,t)=>xe(e)?te(e.failure):t(e.success)),lW=p(2,(e,t)=>si(e,(n)=>{let r=ln(t)?t(n):t;return Qp(r)?r:G(r)})),mW=G({}),hW=Nc(or,si),gW=Mc(or),xW=Fc(or),SW=p(2,(e,t)=>ei(e)?cS:or(t(e.value),es)),cS=G(oa),bW=p(2,(e,t)=>{if(Ut(e))t(e.success);return e})});var RC,nce,wW,PC;var uS=w(()=>{X();_e();he();RC=p(2,(e,t)=>{let n=0;for(let r of e){let o=t(r,n);if(Op(o)){if(o)return _(r)}else if(Ee(o))return o;n++}return O()}),nce={[Symbol.iterator](){return wW}},wW={next(){return{done:!0,value:void 0}}},PC=p(2,(e,t)=>({[Symbol.iterator](){let n=e[Symbol.iterator](),r=0;return{next(){let o=n.next();while(!o.done){if(t(o.value,r++))return{done:!1,value:o.value};o=n.next()}return{done:!0,value:void 0}}}}}))});var MC,vW=(e)=>Object.keys(e);var NC=w(()=>{X();MC=p(2,(e,t)=>{let n={...e};for(let r of vW(e))U(n,r,t(e[r],r));return n})});function LC(){return TW}var Xp,Lt=(e)=>Xp.isArray(e)?e:Xp.from(e),DC=(e)=>Xp.isArray(e)?e:[e],Ul,lS,$C,IW,la,Hn,UC,em,fS,dS,CW=(e,t)=>{let n=re(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let o of r)if(Y(o,t))return!1;return r.push(t),!0},pS,fa=()=>[],da=(e)=>[e],jt,mS=(e)=>{let t=[];for(let n of e)if(Ee(n))t.push(n.value);return t},hS,Ll,tm=(e)=>{let t=Lt(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let o of t)if(CW(n,o))r.push(o);return r},TW;var An=w(()=>{yt();X();Xt();uS();_e();gn();Xp=globalThis.Array,Ul=p(2,(e,{onEmpty:t,onNonEmpty:n})=>Hn(e)?n(e):t()),lS=p(2,(e,t)=>[...e,t]),$C=p(2,(e,t)=>Lt(e).concat(Lt(t))),IW=Xp.isArray,la=sS,Hn=sS,UC=p(2,(e,t)=>{let n=0,r=[];for(let o of e){if(!t(o,n))break;r.push(o),n++}return r}),em=p(2,(e,t)=>{let n=0;for(let r of e){if(t(r,n))return _(n);n++}return O()}),fS=RC,dS=p(2,(e,t)=>{let n=Lt(e);for(let r=n.length-1;r>=0;r--){let o=n[r],s=t(o,r);if(typeof s==="boolean"){if(s)return _(o)}else if(Ee(s))return s}return O()}),pS=p(2,(e,t)=>{let n=Lt(e),r=Lt(t);if(Hn(n))return Hn(r)?tm($C(n,r)):n;return r}),jt=p(2,(e,t)=>e.map(t)),hS=p(2,(e,t)=>{let n=[],r=[],o=0;for(let s of e){let i=t(s,o++);if(Ut(i))r.push(i.success);else n.push(i.failure)}return[n,r]}),Ll=p(3,(e,t,n)=>Lt(e).reduce((r,o,s)=>n(r,o,s),t)),TW=Ir((e,t)=>e.concat(t),[])});var nm="~effect/time/Duration",qC,zC,OW,AW,_W,rm=(e)=>BigInt(e<0?Math.ceil(e-0.5):Math.floor(e+0.5)),WC=(e)=>rm(e*1e6),jC=(e,t)=>{let n=e.indexOf(".");if(n===-1)return BigInt(e)*t;let r=e[0]==="-",o=e.slice(n+1),s=AW**BigInt(o.length),i=(BigInt(e.slice(r?1:0,n))*s+BigInt(o))*t,a=i/s+(i%s*OW>=s?zC:qC);return r?-a:a},RW,sr=(e)=>{switch(typeof e){case"number":return ii(e);case"bigint":return Tr(e);case"string":{if(e==="Infinity")return ss;if(e==="-Infinity")return pa;let t=RW.exec(e);if(!t)break;let[n,r,o]=t;if(o==="nano"||o==="nanos")return Tr(jC(r,zC));if(o==="micro"||o==="micros")return Tr(jC(r,_W));let s=Number(r);switch(o){case"milli":case"millis":return ii(s);case"second":case"seconds":return NW(s);case"minute":case"minutes":return DW(s);case"hour":case"hours":return $W(s);case"day":case"days":return UW(s);case"week":case"weeks":return LW(s)}break}case"object":{if(e===null)break;if(nm in e)return e;if(Array.isArray(e)){if(e.length!==2||!e.every(bl))return BC(e);if(Number.isNaN(e[0])||Number.isNaN(e[1]))return Hc;if(e[0]===-1/0||e[1]===-1/0)return pa;if(e[0]===1/0||e[1]===1/0)return ss;return _n(rm(e[0]*1e9+e[1]))}let t=e,n=0;if(t.weeks)n+=t.weeks*604800000;if(t.days)n+=t.days*86400000;if(t.hours)n+=t.hours*3600000;if(t.minutes)n+=t.minutes*60000;if(t.seconds)n+=t.seconds*1000;if(t.milliseconds)n+=t.milliseconds;if(!t.microseconds&&!t.nanoseconds)return _n(n);return _n(rm(n*1e6+(t.microseconds??0)*1000+(t.nanoseconds??0)))}}return BC(e)},BC=(e)=>{throw Error(`Invalid Input: ${e}`)},KC,HC,PW,FW,MW,_n=(e)=>{let t=Object.create(MW);if(typeof e==="number")if(isNaN(e)||e===0||Object.is(e,-0))t.value=HC;else if(!Number.isFinite(e))t.value=e>0?PW:FW;else if(!Number.isInteger(e))t.value={_tag:"Nanos",nanos:WC(e)};else t.value={_tag:"Millis",millis:e};else if(e===qC)t.value=HC;else t.value={_tag:"Nanos",nanos:e};return t},xS=(e)=>M(e,nm),VC=(e)=>e.value._tag!=="Infinity"&&e.value._tag!=="NegativeInfinity",Hc,ss,pa,Tr=(e)=>_n(e),ii=(e)=>_n(e),NW=(e)=>_n(e*1000),DW=(e)=>_n(e*60000),$W=(e)=>_n(e*3600000),UW=(e)=>_n(e*86400000),LW=(e)=>_n(e*604800000),qc=(e)=>jW(sr(e),{onMillis:D,onNanos:(t)=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),gS=(e)=>{let t=sr(e);switch(t.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return WC(t.value.millis)}},GC,jW,JC,yS=(e,t)=>JC(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r,onInfinity:(n,r)=>n.value._tag===r.value._tag}),ZC,BW;var ai=w(()=>{yt();X();Xt();jn();_e();Qe();he();qC=BigInt(0),zC=BigInt(1),OW=BigInt(2),AW=BigInt(10),_W=BigInt(1000),RW=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,KC=ni(sr),HC={_tag:"Millis",millis:0},PW={_tag:"Infinity"},FW={_tag:"NegativeInfinity"},MW={[nm]:nm,[Ie](){switch(this.value._tag){case"Millis":{let e=this.value.millis*1e6;return Number.isFinite(e)?re(rm(e)):Ln(this.value.millis)}case"Nanos":return re(this.value.nanos);default:return Py(this.value)}},[Ce](e){return xS(e)&&BW(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[At](){return this.toJSON()},pipe(){return le(this,arguments)}},Hc=_n(0),ss=_n(1/0),pa=_n(-1/0),GC=ni(gS),jW=p(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),JC=p(3,(e,t,n)=>{if(e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity")return n.onInfinity(e,t);if(e.value._tag==="Millis")return t.value._tag==="Millis"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(gS(e),t.value.nanos);else return n.onNanos(e.value.nanos,gS(t))}),ZC=p(2,(e,t)=>JC(e,t,{onMillis:(n,r)=>_n(n-r),onNanos:(n,r)=>_n(n-r),onInfinity:(n,r)=>{let o=n.value._tag,s=r.value._tag;if(o==="Infinity")return s==="Infinity"?Hc:ss;if(o==="NegativeInfinity")return s==="NegativeInfinity"?Hc:pa;return s==="Infinity"?pa:ss}})),BW=p(2,(e,t)=>yS(e,t))});var SS,YC=(e)=>(t)=>{let n=e(t);return xe(n)?O():_(n.success)};var QC=w(()=>{X();_e();gn();SS=p(2,(e,t)=>(n)=>{let r=e(n);if(xe(r))return te(n);let o=t(r.success);if(xe(o))return te(n);return o})});class eT{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,o,s=0;for(;s<r;s++){if(n[s][0]>t)break;o=n[s]}if(o&&o[0]===t)o[1].push(e);else if(s===r)n.push([t,[e]]);else n.splice(s,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}}class zc{executionMode;setImmediate;constructor(e="async",t){this.executionMode=e,this.setImmediate=t??(e==="sync"?qW:XC)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new tT(this.setImmediate)}}class tT{tasks=new eT;running=void 0;setImmediate;constructor(e=XC){this.setImmediate=e}scheduleTask(e,t){if(this.tasks.scheduleTask(e,t),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let r=0;r<n.length;r++)n[r]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var jl,XC,qW=(e)=>{let t=!1;return Promise.resolve().then(()=>{if(!t)e()}),()=>{t=!0}},nT,rT;var om=w(()=>{Ve();jl=ke("effect/Scheduler",{fiberCached:!0,defaultValue:()=>new zc}),XC="setImmediate"in globalThis?(e)=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:(e)=>{let t=setTimeout(e,0);return()=>clearTimeout(t)};nT=ke("effect/Scheduler/MaxOpsBeforeYield",{fiberCached:!0,defaultValue:()=>2048}),rT=ke("effect/Scheduler/PreventSchedulerYield",{fiberCached:!0,defaultValue:()=>!1})});var Or={};Un(Or,{Class:()=>sm,Error:()=>bS,TaggedClass:()=>zW,TaggedError:()=>ci,taggedEnum:()=>ES});function WW(){if(arguments.length===1){let n=arguments[0];return function(r){return n[r._tag](r)}}let e=arguments[0];return arguments[1][e._tag](e)}var sm,zW=(e)=>class extends sm{_tag=e},ES=()=>new Proxy({},{get(e,t,n){if(t==="$is")return br;else if(t==="$match")return WW;return(r)=>({...r,_tag:t})}}),bS,ci;var Wc=w(()=>{rt();Qe();he();sm=class extends Gi{constructor(e){super();if(e)$p(this,e)}};bS=Al,ci=Qo});function im(e){if(e>=iT.length)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);let t=iT[e];if(t===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return t}var sT="~effect/encoding/EncodingError",ui,am=(e)=>typeof e==="string"?wS(CS.encode(e)):wS(e),Vc=(e)=>{let t=hT(e),n=t.length;if(n%4!==0)return te(new ui({kind:"Decode",module:"Base64",input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf("=");if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!=="="))return te(new ui({kind:"Decode",module:"Base64",input:t,message:"Found a '=' character, but it is not at the end"}));try{let o=t.endsWith("==")?2:t.endsWith("=")?1:0,s=new Uint8Array(3*(n/4)-o);for(let i=0,a=0;i<n;i+=4,a+=3){let c=im(t.charCodeAt(i))<<18|im(t.charCodeAt(i+1))<<12|im(t.charCodeAt(i+2))<<6|im(t.charCodeAt(i+3));s[a]=c>>16,s[a+1]=c>>8&255,s[a+2]=c&255}return G(s)}catch(o){return te(new ui({kind:"Decode",module:"Base64",input:t,message:o instanceof Error?o.message:"Invalid input"}))}},lT=(e)=>or(Vc(e),(t)=>TS.decode(t)),fT=(e)=>typeof e==="string"?aT(CS.encode(e)):aT(e),vS=(e)=>{let t=hT(e),n=t.length;if(n%4===1)return te(new ui({module:"Base64Url",kind:"Decode",input:t,message:`Length should be a multiple of 4, but is ${n}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return te(new ui({module:"Base64Url",kind:"Decode",input:t,message:"Invalid input"}));let r=n%4===2?`${t}==`:n%4===3?`${t}=`:t;return r=r.replace(/-/g,"+").replace(/_/g,"/"),Vc(r)},dT=(e)=>or(vS(e),(t)=>TS.decode(t)),pT=(e)=>typeof e==="string"?cT(CS.encode(e)):cT(e),kS=(e)=>{let t="";for(let n=e>>>3;n>0;n--){let r=Math.random()*4294967296>>>0;t+=Kc[r>>>24]+Kc[r>>>16&255]+Kc[r>>>8&255]+Kc[r&255]}return t},IS=(e)=>{let t=new TextEncoder().encode(e);if(t.length%2!==0)return te(new ui({module:"Hex",kind:"Decode",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let n=t.length/2,r=new Uint8Array(n);for(let o=0;o<n;o++){let s=uT(t[o*2]),i=uT(t[o*2+1]);r[o]=s<<4|i}return G(r)}catch(n){return te(new ui({module:"Hex",kind:"Decode",input:e,message:n instanceof Error?n.message:"Invalid input"}))}},mT=(e)=>or(IS(e),(t)=>TS.decode(t)),CS,TS,hT=(e)=>e.replace(/[\n\r]/g,""),wS=(e)=>{let t=e.length,n="",r;for(r=2;r<t;r+=3)n+=is[e[r-2]>>2],n+=is[(e[r-2]&3)<<4|e[r-1]>>4],n+=is[(e[r-1]&15)<<2|e[r]>>6],n+=is[e[r]&63];if(r===t+1)n+=is[e[r-2]>>2],n+=is[(e[r-2]&3)<<4],n+="==";if(r===t)n+=is[e[r-2]>>2],n+=is[(e[r-2]&3)<<4|e[r-1]>>4],n+=is[(e[r-1]&15)<<2],n+="=";return n},is,iT,aT=(e)=>wS(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Kc,cT=(e)=>{let t="";for(let n=0;n<e.length;n++)t+=Kc[e[n]];return t},uT=(e)=>{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw TypeError("Invalid input")};var cm=w(()=>{Wc();gn();ui=class ui extends ci("EncodingError"){[sT]=sT};CS=new TextEncoder,TS=new TextDecoder;is=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],iT=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Kc=[];for(let e=0;e<256;e++)Kc.push(e.toString(16).padStart(2,"0"))});class yT{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:"Started",startTime:e.startTime},this.attributes=new Map,this.traceId=mn(e.parent)?.traceId??kS(32),this.spanId=kS(16)}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,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}}var AS="effect/Tracer/ParentSpan",um,KW=(e)=>e,lm,gT,xT,_S="effect/Tracer",fm;var ST=w(()=>{Ve();cm();X();_e();um=class um extends ze()(AS,{fiberCached:!0}){};lm=ke("effect/Tracer/DisablePropagation",{defaultValue:Sl}),gT=ke("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),xT=ke("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),fm=ke(_S,{fiberCached:!0,defaultValue:()=>KW({span:(e)=>new yT(e)})})});var ET="effect/observability/Metric/FiberRuntimeMetricsKey";var bT,Bl,dm,Gc,Hl,ql,as,RS,pm,mm;var PS=w(()=>{Ve();X();bT=ke("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),Bl=ke("effect/References/CurrentStackFrame",{fiberCached:!0,defaultValue:qr}),dm=ke("effect/References/TracerEnabled",{defaultValue:nr}),Gc=ke("effect/References/TracerTimingEnabled",{defaultValue:nr}),Hl=ke("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),ql=ke("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),as=ke("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),RS=ke("effect/References/CurrentLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),pm=ke("effect/References/MinimumLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),mm=ke("effect/References/CurrentLogSpans",{defaultValue:()=>[]})});var ZW=()=>{let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(e===void 0)return Object.isExtensible(Error);return Object.hasOwn(e,"writable")?e.writable===!0:e.set!==void 0},YW,li=()=>Error.stackTraceLimit,ir=(e)=>{if(YW)Error.stackTraceLimit=e};var hm=w(()=>{YW=ZW()});var gm=(e)=>{if(e?.captureStackTrace===!1)return e;else if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=="boolean")return e;let t=li();ir(3);let n=Error();return ir(t),{...e,captureStackTrace:QW(()=>n.stack)}},FS=(e)=>(t)=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let o=r.split(`
|
|
12
|
-
`)
|
|
13
|
-
`),
|
|
14
|
-
`),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`)},
|
|
18
|
-
`)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
${
|
|
24
|
-
${BT(e.cause,`${t} `)}
|
|
25
|
-
${t}}`;return r},xm="~effect/Fiber",sK,iK,pi=()=>globalThis[Ic],WS,aK,DS,km=(e)=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(Hy.key,e.currentStackFrame),ri(t)},cK=(e)=>{if(e._children===void 0||e._children.size===0)return;return di(e._children)},HT=(e)=>{let t=e;if(t._exit)return L(t._exit);return Bt((n)=>{if(t._exit)return n(L(t._exit));return pe(e.addObserver((r)=>n(L(r))))})},Im=(e)=>Bt((t)=>{let n=e[Symbol.iterator](),r=[],o=void 0;function s(){let i=n.next();while(!i.done){if(i.value._exit){r.push(i.value._exit),i=n.next();continue}o=i.value.addObserver((a)=>{r.push(a),s()});return}t(L(r))}return s(),pe(()=>o?.())}),Cm=(e)=>ce((t)=>qT(e,t.id)),qT,di=(e)=>ce((t)=>{let n=km(t),r=fa();for(let o of e)o.interruptUnsafe(t.id,n),r.push(o);return Xl(Im(r))}),L,Be,nt,pe,ae,KS,Yc,zT=(e)=>e==null?nt(new yo):L(e),VS,Qc,GS=(e)=>L(_(e)),xa,WT=(e)=>me(e)?xa:De(e.value,_),KT=(e)=>ae(()=>Be(Ae(e))),mi=(e)=>Kr(e),Tm=(e)=>ae(()=>nt(Ae(e))),ye,VT=(e)=>{let t=typeof e==="function"?e:e.try,n=typeof e==="function"?(r)=>new lf(r,"An error occurred in Effect.try"):e.catch;return ae(()=>{try{return L(Ae(t))}catch(r){return nt(Ae(()=>n(r)))}})},JS=(e)=>ZS(function(t,n){Ae(()=>e(n)).then((r)=>t(L(r)),(r)=>t(mi(r)))},e.length!==0),GT=(e)=>{let t=typeof e==="function"?e:e.try,n=typeof e==="function"?(r)=>new lf(r,"An error occurred in Effect.tryPromise"):e.catch;return ZS(function(r,o){let s=(i)=>{try{r(nt(Ae(()=>n(i))))}catch(a){r(mi(a))}};try{Ae(()=>t(o)).then((i)=>r(L(i)),s)}catch(i){s(i)}},t.length!==0)},JT=(e)=>ce((t)=>e(t.id)),ZT,YT,ZS,uK,Bt=(e)=>ZS(e,e.length>=2),Om,QT=(...e)=>ae(()=>Jc(e.length===1?e[0]():e[1].call(e[0].self))),YS=(e,...t)=>{let n=t.length===0?function(){return ae(()=>Jc(e.apply(this,arguments)))}:function(){let r=ae(()=>Jc(e.apply(this,arguments)));for(let o=0;o<t.length;o++)r=t[o](r,...arguments);return r};return QS(e.length,n)},QS=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),vT,XT=function(){let e=typeof arguments[0]==="string",t=e?arguments[0]:"Effect.fn",n=e?arguments[1]:void 0,r=li();ir(2);let o=new globalThis.Error;if(ir(r),e)return(s,...i)=>kT(t,s,o,i,e,n);return kT(t,arguments[0],o,Array.prototype.slice.call(arguments,1),e,n)},kT=(e,t,n,r,o,s)=>{let i=typeof t==="function"?t:r.shift().bind(t.self);return QS(i.length,function(...a){let c=ae(()=>{let f=i.apply(this,arguments);return fe(f)?f:Jc(f)});for(let f=0;f<r.length;f++)c=r[f](c,...a);if(!fe(c))return c;let u=li();ir(2);let l=new globalThis.Error;return ir(u),cs(o?Kl(e,s,(f)=>jS(c,f)):c,Bl,(f)=>({name:e,stack:vT(()=>l.stack),parent:{name:`${e} (definition)`,stack:vT(()=>n.stack),parent:f}}))})},eO=(e,...t)=>QS(e.length,t.length===0?function(){return IT(()=>e.apply(this,arguments))}:function(){let n=IT(()=>e.apply(this,arguments));for(let r of t)n=r(n);return n}),IT=(e)=>{try{let t=e(),n=void 0;while(!0){let r=t.next(n);if(r.done)return L(r.value);let o=r.value;if(o&&o._tag==="Success"){n=o.value;continue}else if(o&&o._tag==="Failure")return r.value;else{let s=!0;return ae(()=>{if(s)return s=!1,K(r.value,(i)=>Jc(t,i));else return ae(()=>Jc(e()))})}}}catch(t){return mi(t)}},Jc,xn,Xc=(e)=>De(e,_),tO=(e)=>Sa(e,{onFailure:L,onSuccess:nt}),Zr,ya,Xl=(e)=>K(e,(t)=>Rn),nO=(e)=>cr(e,nt),XS=(e,t)=>ce((n)=>Bt((r)=>{let o=Lt(e),s=o.length,i=0,a=!1,c=new Set,u=[],l=(f,d,m)=>{if(i++,f._tag==="Failure"){if(u.push(...f.cause.reasons),i>=s)r(Be(Zo(u)));return}let g=!a;if(a=!0,r(c.size===0?f:K(fs(di(c)),()=>f)),g&&t?.onWinner)t.onWinner({fiber:d,index:m,parentFiber:n})};for(let f=0;f<s;f++){let d=Ea(n,o[f],!0,!0,!1);if(c.add(d),d.addObserver((m)=>{c.delete(d),l(m,d,f)}),a)break}return di(c)})),eE=(e,t)=>ce((n)=>Bt((r)=>{let o=!1,s=new Set,i=(c)=>{o=!0,r(s.size===0?c:K(fs(di(s)),()=>c))},a=0;for(let c of e){if(o)break;let u=a++,l=Ea(n,c,!0,!0,!1);s.add(l),l.addObserver((f)=>{s.delete(l);let d=!o;if(i(f),d&&t?.onWinner)t.onWinner({fiber:l,index:u,parentFiber:n})})}return di(s)})),rO,Am,K,lK,oO,We=(e)=>(Xi in e),sO,iO=(e)=>K(e,D),De,aO,cO,uO,lO,_m=(e)=>pn(ga(e)),hi=(e)=>e._tag==="Success",fO=(e)=>e._tag==="Success"?G(e):te(e),dO=(e)=>e._tag==="Success"?G(e.value):te(e),tE=(e)=>e._tag==="Failure",pO=(e)=>e._tag==="Failure"?G(e):te(e),ef=(e)=>e._tag==="Failure"?G(e.cause):te(e),nE,mO,hO=(e)=>e._tag==="Failure"&&Sm(e.cause),gO=(e)=>e._tag==="Failure"&&ym(e.cause),xO=(e)=>e._tag==="Failure"&&HS(e.cause),Rn,rE,oE,sE,fK,yO,SO,EO,iE=(e)=>{let t=[];for(let n of e)if(n._tag==="Failure")t.push(...n.cause.reasons);return t.length===0?Rn:pn(Zo(t))},bO=(e)=>hi(e)?_(e.value):O(),wO=(e)=>tE(e)?_(e.cause):O(),vO=(e)=>{let t=nE(e);return xe(t)?O():_(t.success)},kO=(e)=>e,IO=(e)=>ce((t)=>L(oS(t.context,e))),dK=(e)=>ce((t)=>KS(oS(t.context,e))),eu,cs,CO=(e,t,n)=>fs(ce((r)=>{let o=Gr(r.context,e),s=t(o);return r.setContext(tn(r.context,e,s)),Yr(Gr(r.context,xi),(i)=>{let a=Gr(r.context,e),c;if(n?.reset===void 0){if(a!==s)return ye;c=o}else c=n.reset(o,s,a);return r.setContext(tn(r.context,e,c)),ye})})),aE=()=>pK,pK,gi=(e)=>ce((t)=>e(t.context)),TO,us,Pn=function(){if(arguments.length===1)return p(2,(e,t)=>CT(e,arguments[0],t));return p(3,(e,t,n)=>CT(e,t,n)).apply(this,arguments)},CT=(e,t,n)=>eu(e,tn(t,n)),Rm,OO,cE,AO,_O,uE,RO,Pm,cr,mK,lE,tu,ur,PO=(e)=>Sa(e,{onFailure:(t)=>Bp(t)?xa:nt(t),onSuccess:GS}),FO,MO,NO,Fm,fE,DO,$O,tf,Mm,dE,UO,LO,jO,BO,pE,mE,hE=(e)=>ur(e,mi),HO,qO=(e)=>ae(()=>{let t=e[Symbol.iterator](),n=t.next();if(n.done)return mi(Error("Received an empty collection of effects"));function r(o){let s=t.next();if(s.done)return o.value;return ur(o.value,(i)=>r(s))}return r(n)}),gE=(e)=>ur(e,(t)=>K(Qc,()=>gE(e))),zO,Nm,WO=(e)=>Dm(e,{onFailure:O,onSuccess:_}),fi=(e)=>nf(e,{onFailure:te,onSuccess:G}),Jr,hK,xE,Sa,Dm,nf,KO,rf=(e)=>We(e)?je(e):gK(e),gK,VO,GO,JO,yE,ZO,YO,QO=(e)=>bo((t)=>{let n=t.monotonicTimeNanosUnsafe();return De(e,(r)=>[Tr(t.monotonicTimeNanosUnsafe()-n),r])}),$S="~effect/Scope",US="~effect/Scope/Closeable",xi,SE=(e,t)=>ae(()=>$m(e,t)??ye),$m=(e,t)=>{if(e.state._tag==="Closed")return;let n={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=n;return}let r=e.state;if(e.state=n,r.finalizer!==void 0)return r.finalizer(t);let o=r.finalizers;if(o===void 0||o.size===0)return;else if(o.size===1)return o.values().next().value(t);return yK(e,o,t)},xK=(e,t)=>hi(e)?t:cr(t,(n)=>Be(bm(e.cause,n))),yK,XO=(e,t)=>{let n=of(t);if(e.state._tag==="Closed")return n.state=e.state,n;let r={};return zl(e,r,(o)=>SE(n,o)),zl(n,r,(o)=>pe(()=>EE(e,r))),n},Yr=(e,t)=>ae(()=>{if(e.state._tag==="Closed")return t(e.state.exit);return zl(e,{},t),ye}),eA=(e,t)=>Yr(e,gt(t)),zl=(e,t,n)=>{if(e.state._tag==="Empty")e.state={_tag:"Open",finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag==="Open"){let r=e.state;if(r.finalizer!==void 0)r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n);else if(r.finalizers===void 0)r.finalizerKey=t,r.finalizer=n;else r.finalizers.set(t,n)}},EE=(e,t)=>{if(e.state._tag==="Open"){let n=e.state;if(n.finalizerKey===t)n.finalizerKey=void 0,n.finalizer=void 0;else if(n.finalizers!==void 0)n.finalizers.delete(t)}},of=(e="sequential")=>({[US]:US,[$S]:$S,strategy:e,state:SK}),SK,sf,tA,bE=(e)=>ce((t)=>{let n=t.context,r=of();return t.setContext(tn(t.context,xi,r)),ls(e,(o)=>(t.setContext(n),$m(r,o)))}),Um=(e)=>ae(()=>{let t=of();return nn(e(t),(n)=>ae(()=>$m(t,n)??ye))}),af=(e,t,n)=>gi((r)=>Qr((o)=>K(sf,(s)=>ya(n?.interruptible?o(e):e,(i)=>Yr(s,(a)=>us(t(i,a),r)))))),wE=(e)=>K(sf,(t)=>gi((n)=>Yr(t,(r)=>us(e(r),n)))),ls,nn,nA,vE,kE,IE,rA,CE,oA,TE=(e,t,n)=>Qr((r)=>K(e,(o)=>ls(r(t(o)),(s)=>n(o,s),!0))),sA=(e)=>af(e,(t)=>M(t,Symbol.asyncDispose)?JS(()=>t[Symbol.asyncDispose]()):pe(()=>t[Symbol.dispose]())),OE,AE,iA=(e)=>AE(e,ss),aA,fs=(e)=>ce((t)=>{if(!t.interruptible)return e;return t.interruptible=!1,t._stack.push(Lm),e}),cA,Lm,EK,uA=(e)=>{if(e.interruptible=!0,e._stack.push(EK),e._interruptedCause)return Be(e._interruptedCause)},_E=(e)=>ce((t)=>{if(t.interruptible)return e;return uA(t)??e}),Qr=(e)=>ce((t)=>{if(!t.interruptible)return e(D);return t.interruptible=!1,t._stack.push(Lm),e(_E)}),lA=(e)=>ce((t)=>{if(t.interruptible)return e(D);let n=uA(t),r=e(fs);return n??r}),fA,cf=(e,t)=>{if(go(e))return t?.mode==="result"?ar(e,fi,t):ar(e,D,t);else if(t?.discard)return t.mode==="result"?ar(Object.values(e),fi,t):ar(Object.values(e),D,t);return ae(()=>{let n={};return xn(ar(Object.entries(e),([r,o])=>De(t?.mode==="result"?fi(o):o,(s)=>{U(n,r,s)}),{discard:!0,concurrency:t?.concurrency}),n)})},RE,dA,pA,mA,hA=(e,t,n,r)=>K(n(r,t),(o)=>{if(o)return L(_(r));let s=e.next();if(!s.done)return hA(e,t+1,n,s.value);return L(O())}),gA,xA=(e,t,n,r)=>K(n(r,t),(o)=>{if(Ut(o))return L(_(o.success));let s=e.next();if(!s.done)return xA(e,t+1,n,s.value);return L(O())}),Eo,ar,yA=(e)=>K(e,(t)=>{let n=t[Symbol.iterator]().next();return n.done?nt(new yo):L(n.value)}),bK=(e,t,n)=>ae(()=>{let r=n?.discard?void 0:[],o=e[Symbol.iterator](),s=o.next(),i=0;return xn(Eo({while:()=>!s.done,body:()=>t(s.value,i++),step:(a)=>{if(r)r.push(a);s=o.next()}}),r)}),SA=(e)=>{let{onItem:t,step:n}=e,r=(o,s,i,a)=>{for(;i<a;i++){let c=s[i],u=t(o,c,i);if(!We(u))return K(rf(u),(f)=>n(o,c,f,i)??r(o,s,i+1,a)??ye);let l=n(o,c,u,i);if(l)return l._tag==="Failure"?l:void 0}};return(o,s,i)=>{let a=0,c=i?.end??s.length,u=i?.concurrency??1;if(u===1)return r(o,s,0,c);let l=i?.orderedStep===!0,f=!1,d,m,g,b=!1,x,I,C=a,S=l?Array(c):void 0,y=(k)=>{let T=Kr(k);return x=T,f=!0,b=!0,m&&m.size>0?K(fs(di(Array.from(m))),()=>T):T},h=(k,T,F)=>{if(!l)return n(o,k,T,F);if(x)return x;S[F]=T;while(C<c){let N=S[C];if(N===void 0)return;S[C]=void 0;let R=C++,z=n(o,s[R],N,R);if(z)return z}},E=()=>{let k=!1;for(;!x&&a<c;a++){let T=s[a],F=I??t(o,T,a);if(We(F)){if(x=h(T,F,a),x)break}else if(!d)return Bt((N)=>{d=pi(),m=new Set,I=F,g=N;let R;try{R=E()}catch(z){return N(y(z))}if(R)return N(R);return ae(()=>(x=Rn,b=!0,m?di(m):ye))});else{I=void 0;let N=Ea(d,F,!0,!0,"inherit");if(N._exit){if(x=h(T,N._exit,a),x)break;continue}m.add(N);let R=a;if(N.addObserver((z)=>{m.delete(N);try{if(x){if(!b&&z._tag==="Failure")for(let q of z.cause.reasons)if(q._tag==="Interrupt")continue;else if(x._tag==="Failure")x.cause.reasons.push(q);else x=pn(Zo([q]))}else{let q=h(T,z,R);if(q)x=q._tag==="Failure"?pn(Zo(q.cause.reasons.slice())):q,E()}if(k){let q=E();if(q)g(q)}else if(f&&m.size===0)g(x??ye)}catch(q){g(y(q))}}),m.size<u)continue;k=!0,a++;return}}if(f=!0,x){if(m&&m.size>0){let T=km(d);m.forEach((F)=>F.interruptUnsafe(d.id,T));return}if(g||x._tag==="Failure")return x}else if(g){if(!m)return Rn;else if(m.size===0)g(ye)}};return E()}},uf=()=>SA,wK,PE,FE,EA,bA,wA,vA,kA,IA,CA,TA,OA,Ea=(e,t,n=!1,r=!1,o=!1)=>{let s=e,i=o==="inherit"?s.interruptible:!o,a=new WS(s.context,i);if(n)a.evaluate(t);else s.currentDispatcher.scheduleTask(()=>a.evaluate(t),0);if(!r&&!a._exit)s.children().add(a),a.addObserver(()=>s._children.delete(a));return a},AA,_A=(e)=>ce((t)=>{let n=t._children&&new Set(t._children);return nn(e,(r)=>{let o=t._children;if(o===void 0||o.size===0)return ye;else if(n)o=PC(o,(s)=>!n.has(s));return Xl(Im(o))})}),ME,RA,ds=(e)=>(t,n)=>{let r=new WS(n?.scheduler?tn(e,jl,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal)if(n.signal.aborted)r.interruptUnsafe();else{let o=()=>r.interruptUnsafe();n.signal.addEventListener("abort",o,{once:!0}),r.addObserver(()=>n.signal.removeEventListener("abort",o))}if(n?.onFiberStart)n.onFiberStart(r);return r},PA,FA,NE=(e)=>{let t=ds(e);return(n,r)=>{let o=t(n,r);if(r?.onExit)o.addObserver(r.onExit);return(s)=>o.interruptUnsafe(s)}},MA,jm=(e)=>{let t=ds(e);return(n,r)=>{let o=t(n,r);return new Promise((s)=>{o.addObserver((i)=>s(i))})}},NA,DE=(e)=>{let t=jm(e);return(n,r)=>t(n,r).then((o)=>{if(o._tag==="Failure")throw wm(o.cause);return o.value})},DA,Bm=(e)=>{let t=ds(e);return(n)=>{if(We(n))return n;let r=new zc("sync"),o=t(n,{scheduler:r});return o._dispatcher?.flush(),o._exit??Kr(new qm(o))}},$A,$E=(e)=>{let t=Bm(e);return(n)=>{let r=t(n);if(r._tag==="Failure")throw wm(r.cause);return r.value}},UA,TT,OT,UE=(e)=>new LA(e??!1),jA,BA,HA,qA,LS,vK,kK=(e)=>Object.assign(Object.create(vK),e),zA=(e)=>{if(!e)return O();return On(e.annotations,lm)?e._tag==="Span"?zA(mn(e.parent)):O():_(e)},LE=(e,t,n)=>{let r=!e.getRef(dm)||n?.annotations&&On(n.annotations,lm),o=n?.parent!==void 0?_(n.parent):n?.root?O():zA(e.currentSpan),s;if(r)s=kK({name:t,parent:o,annotations:tn(n?.annotations??hn(),lm,!0)});else{let i=e.getRef(fm),a=e.getRef(ps),c=e.getRef(Gc),u=e.getRef(Hl),l=e.getRef(ql),f=n?.level??e.getRef(gT),d=n?.links!==void 0?[...l,...n.links]:l.length===0?[]:l.slice();s=i.span({name:t,parent:o,annotations:n?.annotations??hn(),links:d,startTime:c?a.currentTimeNanosUnsafe():BigInt(0),kind:n?.kind??"internal",root:n?.root??me(o),sampled:n?.sampled??(Ee(o)&&o.value.sampled===!1?!1:!f_(e.getRef(xT),f))});for(let m in u)s.attribute(m,u[m]);if(n?.attributes!==void 0)for(let m in n.attributes)s.attribute(m,n.attributes[m])}return s},WA=(e,t)=>ce((n)=>L(LE(n,e,t))),Wl=(e,t)=>fs(ce((n)=>{let r=Gr(n.context,xi),o=LE(n,e,t??{}),s=n.getRef(ps),i=n.getRef(Gc);return xn(Yr(r,(a)=>ZA(o,a,s,i)),o)})),KA=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],n=gm(e?arguments[2]:arguments[1]);if(e){let r=arguments[0];return K(Wl(t,n),(o)=>Zc(r,o,n))}return(r)=>K(Wl(t,n),(o)=>Zc(r,o,n))},IK=(e,t)=>(t=typeof t==="function"?t:qr,cs(Bl,(n)=>({name:e,stack:t,parent:n}))),VA,GA,JA,ZA=(e,t,n,r)=>pe(()=>{if(e.status._tag==="Ended")return;e.end(r?n.currentTimeNanosUnsafe():LS,t)}),Kl=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return ce((o)=>{let s=LE(o,e,n),i=o.getRef(ps),a=o.getRef(Gc);return nn(Ae(()=>r(s)),(c)=>ZA(s,c,i,a))})},jS,Zc=function(){let e=fe(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=D;if(t._tag==="Span")n=gm(n),r=IK(t.name,n?.captureStackTrace);if(e)return jS(r(arguments[0]),t);return(o)=>jS(r(o),t)},YA=function(){let e=typeof arguments[0]!=="string",t=e?arguments[1]:arguments[0],n=gm(arguments[2]);if(e){let s=arguments[0];return Kl(t,arguments[2],(i)=>Zc(s,i,n))}let r=typeof arguments[1]==="function"?arguments[1]:void 0,o=r?void 0:arguments[1];return(s,...i)=>Kl(t,r?r(...i):o,(a)=>Zc(s,a,n))},QA,XA=(...e)=>ce((t)=>{let n=t.currentSpanLocal;if(n)if(e.length===1)for(let[r,o]of Object.entries(e[0]))n.attribute(r,o);else n.attribute(e[0],e[1]);return ye}),e_,t_,ps,MS=2147483647,r_,o_,CK,bo=(e)=>ce((t)=>e(t.getRef(ps))),ba=(e)=>bo((t)=>t.sleep(sr(e))),s_,Vl="~effect/Cause/TimeoutError",i_=(e)=>M(e,Vl),Hm,Gl="~effect/Cause/IllegalArgumentError",a_=(e)=>M(e,Gl),jE,Jl="~effect/Cause/ExceededCapacityError",c_=(e)=>M(e,Jl),BE,Zl="~effect/Cause/AsyncFiberError",u_=(e)=>M(e,Zl),qm,Yl="~effect/Cause/UnknownError",l_=(e)=>M(e,Yl),lf,HE,TK=(e)=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},OK,f_,qE,AK,d_=function(){let e=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return fs(ce((t)=>{let n=t.getRef(as),r={...n};for(let o=0;o<e.length;o++){let[s,i]=e[o];U(r,s,i)}return t.setContext(tn(t.context,as,r)),Yr(Gr(t.context,xi),(o)=>{let s=t.getRef(as),i={...s};for(let a=0;a<e.length;a++){let[c,u]=e[a];if(s[c]!==u)continue;if(Object.hasOwn(n,c))U(i,c,n[c]);else delete i[c]}return t.setContext(tn(t.context,as,i)),ye})}))},_K="~effect/Logger",RK,p_=(e)=>{let t=Object.create(RK);return t.log=e,t},PK=(e)=>e.replace(/[\s="]/g,"_"),FK=(e,t)=>`${PK(e[0])}=${t-e[1]}ms`,Xr=(e)=>(...t)=>{let n=void 0;for(let r=0,o=t.length;r<o;r++){let s=t[r];if(Oc(s)){if(n)t.splice(r,1);else t=t.slice(0,r).concat(t.slice(r+1));n=n?Zo(n.reasons.concat(s.reasons)):s,r--}}if(n===void 0)n=Up;return ce((r)=>{let o=e??r.currentLogLevel;if(f_(r.minimumLogLevel,o))return ye;let s=r.getRef(ps),i=r.getRef(qE);if(i.size>0){let a=new Date(s.currentTimeMillisUnsafe());for(let c of i)c.log({cause:n,fiber:r,date:a,logLevel:o,message:t})}return ye})},ha,Oce,MK=(e)=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,NK,DK,zE,m_,UK=(e,t,n)=>{let r=e.getRef(bT);if(r.size===0)return;if(n&&!ym(t))return;let o={cause:t,fiber:e,timestamp:e.getRef(ps).currentTimeNanosUnsafe()};r.forEach((s)=>s.report(o))};var ht=w(()=>{An();Ve();ai();yt();QC();kn();X();Xt();jn();uS();_e();ia();Qe();he();Np();gn();om();ST();Qi();rt();qp();PS();hm();wT();BS=class BS extends Cl{fiberId;constructor(e,t=Tl){super("Interrupt",t,"Interrupted");this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[Ce](e){return ra(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Ie](){return xt(qe(`${this._tag}:${this.fiberId}`))(Rp(this.annotations))}};_T=YC(Ar),XW=new Set,bm=p(2,(e,t)=>{if(e.reasons.length===0)return t;else if(t.reasons.length===0)return e;let n=new Jo(pS(e.reasons,t.reasons));return Y(e,n)?e:n}),$T=p(2,(e,t)=>{let n=!1,r=e.reasons.map((o)=>{if(Qs(o))return n=!0,new Ac(t(o.error),o.annotations);return o});return n?Zo(r):e}),nK=/\((.*)\)/g,sK={_A:D,_E:D},iK={id:0};WS=class WS{constructor(e,t=!0){this[xm]=sK,this.setContext(e),this.id=++iK.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[xm];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return On(this.context,e)}addObserver(e){if(this._exit)return e(this._exit),Vo;return this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);if(t>=0)this._observers.splice(t,1)}}interruptUnsafe(e,t){if(this._exit)return;let n=ga(e);if(this.currentStackFrame)n=_c(n,os(jp,this.currentStackFrame));if(t)n=_c(n,t);if(this._interruptedCause=this._interruptedCause?bm(this._interruptedCause,n):n,this.interruptible)if(this._running)this._deferredInterrupt=!0;else this.evaluate(Be(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;else if(this._yielded!==void 0){let r=this._yielded;this._yielded=void 0,r()}let t=this.runLoop(e);if(t===ta)return;let n=DS.interruptChildren&&DS.interruptChildren(this);if(n!==void 0)return this.evaluate(K(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let r=0;r<this._observers.length;r++)this._observers[r](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=hn()}runLoop(e){let t=globalThis[Ic];globalThis[Ic]=this;let n=this._running;this._running=!0;let r=!1,o=e;this.currentOpCount=0;try{while(!0){if(this._deferredInterrupt)this._deferredInterrupt=!1,o=Be(this._interruptedCause);if(this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let s=o;o=K(Qc,()=>s)}if(o=this.currentTracerContext?this.currentTracerContext(o,this):o[St](this),o===ta){let s=this._yielded;if(Xi in s)return this._deferredInterrupt=!1,this._yielded=void 0,s;else if(this._deferredInterrupt){this._yielded=void 0,s();continue}return ta}}}catch(s){if(!M(o,St))return Kr(`Fiber.runLoop: Not a valid effect: ${String(o)}`);return this.runLoop(Kr(s))}finally{this._running=n,globalThis[Ic]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,aK;while(!0){let t=this._stack.pop();if(!t)return;let n=t[Ys]&&t[Ys](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,ta}children(){return this._children??=new Set}pipe(){return le(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&IC(t,e))return;let n=this.getRef(jl);if(n!==this.currentScheduler)this.currentScheduler=n,this._dispatcher=void 0;this.currentSpan=$l(e,AS),this.currentLogLevel=this.getRef(RS),this.minimumLogLevel=this.getRef(pm),this.currentStackFrame=this.getRef(Bl),this.maxOpsBeforeYield=this.getRef(nT),this.currentPreventYield=this.getRef(rT),this.runtimeMetrics=$l(e,ET);let r=$l(e,_S);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}};aK={[In](e,t){return Be(t._interruptedCause)},[wr](e,t){return Be(t._interruptedCause)}},DS={interruptChildren:void 0},qT=p((e)=>M(e[0],xm),(e,t,n)=>ce((r)=>{let o=km(r);return o=o&&n?ua(o,n):o??n,e.interruptUnsafe(t,o),Xl(HT(e))})),L=je,Be=pn,nt=kr,pe=vr({op:"Sync",[St](e){let t=this[ie](),n=e.getCont(In);return n?n[In](t,e):e.yieldWith(je(t))}}),ae=vr({op:"Suspend",[St](e){return this[ie]()}}),KS=p((e)=>e.length>=2||jc(e[0]),(e,t)=>me(e)?nt(t?t():new yo("Effect.fromOption: Option.none")):L(e.value)),Yc=Bn({onFailure:nt,onSuccess:L}),VS=vr({op:"Yield",[St](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{if(t)return;e.evaluate(Rn)},this[ie]??0),e.yieldWith(()=>{t=!0})}}),Qc=VS(0),xa=L(O()),ye=L(void 0),ZT=ce(L),YT=JT(L),ZS=vr({op:"Async",single:!1,[St](e){let t=Ae(()=>this[ie][0].bind(e.currentScheduler)),n=!1,r=!1,o=this[ie][1]?new AbortController:void 0,s=t((i)=>{if(n)return;if(n=!0,r)e.evaluate(i);else r=i},o?.signal);if(r!==!1)return r;if(r=!0,e._yielded=()=>{n=!0},o===void 0&&s===void 0)return ta;return e._stack.push(uK(()=>(n=!0,o?.abort(),s??Rn))),ta}}),uK=vr({op:"AsyncFinalizer",[Ys](e){if(e.interruptible)e.interruptible=!1,e._stack.push(Lm)},[wr](e,t){return Sm(e)?K(this[ie](),()=>Be(e)):Be(e)}}),Om=Bt(Vo),vT=FS(2),Jc=vr({op:"Iterator",single:!1,[In](e,t){let n=this[ie][0];while(!0){let r=n.next(e);if(r.done)return L(r.value);if(!We(r.value))return t._stack.push(this),r.value;else if(r.value._tag==="Failure")return r.value;e=r.value.value}},[St](e){return this[In](this[ie][1],e)}}),xn=p(2,(e,t)=>{let n=L(t);return K(e,(r)=>n)}),Zr=p(2,(e,t)=>K(e,(n)=>fe(t)?t:Ae(()=>t(n)))),ya=p(2,(e,t)=>K(e,(n)=>xn(fe(t)?t:Ae(()=>t(n)),n))),rO=p((e)=>fe(e[1]),(e,t,n)=>XS([e,t],n)),Am=p((e)=>fe(e[1]),(e,t,n)=>eE([e,t],n)),K=p(2,(e,t)=>{let n=Object.create(lK);return n[ie]=e,n[In]=t.length!==1?(r)=>t(r):t,n}),lK=Yo({op:"OnSuccess",[St](e){return e._stack.push(this),this[ie]}}),oO=p(2,(e,t)=>{if(We(e))return e._tag==="Success"?t.onSuccess(e.value):t.onFailure(e.cause);return Jr(e,t)}),sO=p(2,(e,t)=>{if(We(e))return e._tag==="Success"?t(e.value):e;return K(e,t)}),De=p(2,(e,t)=>K(e,(n)=>L(Ae(()=>t(n))))),aO=p(2,(e,t)=>We(e)?rE(e,t):De(e,t)),cO=p(2,(e,t)=>We(e)?oE(e,t):pE(e,t)),uO=p(2,(e,t)=>We(e)?sE(e,t):mE(e,t)),lO=p(2,(e,t)=>{if(We(e)){if(e._tag==="Success")return e;let n=Ar(e.cause);if(xe(n))return e;return t(n.success)}return ur(e,t)}),nE=SS(ef,Ar),mO=SS(ef,Ql),Rn=je(void 0),rE=p(2,(e,t)=>e._tag==="Success"?je(t(e.value)):e),oE=p(2,(e,t)=>{if(e._tag==="Success")return e;let n=Ar(e.cause);if(xe(n))return e;return kr(t(n.success))}),sE=p(2,(e,t)=>{if(e._tag==="Success")return je(t.onSuccess(e.value));let n=Ar(e.cause);if(xe(n))return e;return kr(t.onFailure(n.success))}),fK=p(2,(e,t)=>hi(e)?je(t):e),yO=p(2,(e,t)=>hi(e)?t:e),SO=p(2,(e,t)=>hi(e)?t.onSuccess(e.value):t.onFailure(e.cause)),EO=fK(void 0),eu=p(2,(e,t)=>ce((n)=>{let r=n.context,o=t(r);if(r===o)return e;return n.setContext(o),ls(e,()=>{n.setContext(r);return})})),cs=p(3,(e,t,n)=>eu(e,(r)=>{let o=Gr(r,t),s=n(o);if(o===s)return r;return tn(r,t,s)})),pK=ce((e)=>L(e.context)),TO=p(2,(e,t)=>eu(e,gt(t))),us=p(2,(e,t)=>{if(We(e))return e;return eu(e,ua(t))}),Rm=p(3,(e,t,n)=>K(n,(r)=>Pn(e,t,r))),OO=p((e)=>fe(e[1]),(e,t,n)=>cE(e,t,(r,o)=>[r,o],n)),cE=p((e)=>fe(e[1]),(e,t,n,r)=>r?.concurrent?De(cf([e,t],{concurrency:2}),([o,s])=>Ae(()=>n(o,s))):K(e,(o)=>De(t,(s)=>Ae(()=>n(o,s))))),AO=p((e)=>fe(e[0]),(e,t,n)=>PE(e,t,n?(r)=>nt(n(r)):()=>nt(new yo))),_O=p(2,(e,t)=>K(t,(n)=>n?Xc(e):xa)),uE=p(2,(e,t)=>Array.from({length:t},()=>e)),RO=p((e)=>fe(e[0]),(e,t,n)=>cf(uE(e,t),n)),Pm=p((e)=>fe(e[0]),(e,t)=>Eo({while:nr,body:gt(t?.disableYield?e:K(e,(n)=>Qc)),step:Vo})),cr=p(2,(e,t)=>{let n=Object.create(mK);return n[ie]=e,n[wr]=t.length!==1?(r)=>t(r):t,n}),mK=Yo({op:"OnFailure",[St](e){return e._stack.push(this),this[ie]}}),lE=p(3,(e,t,n)=>cr(e,(r)=>{if(!t(r))return Be(r);return Ae(()=>n(r))})),tu=p(3,(e,t,n)=>cr(e,(r)=>{let o=t(r);return xe(o)?Be(o.failure):Ae(()=>n(o.success,r))})),ur=p(2,(e,t)=>tu(e,Ar,(n)=>t(n))),FO=p(2,(e,t)=>tu(e,Ql,t)),MO=p(2,(e,t)=>cr(e,(n)=>Zr(Ae(()=>t(n)),Be(n)))),NO=p(3,(e,t,n)=>lE(e,t,(r)=>Zr(Ae(()=>n(r)),Be(r)))),Fm=p(3,(e,t,n)=>cr(e,(r)=>{let o=t(r);if(xe(o))return Be(r);return Zr(Ae(()=>n(o.success,r)),Be(r))})),fE=p(2,(e,t)=>Fm(e,Ar,(n)=>t(n))),DO=p(3,(e,t,n)=>{let r=Array.isArray(t)?(o)=>M(o,"_tag")&&t.includes(o._tag):br(t);return fE(e,(o)=>r(o)?n(o):ye)}),$O=p(2,(e,t)=>Fm(e,Ql,(n)=>t(n))),tf=p((e)=>fe(e[0]),(e,t,n,r)=>cr(e,(o)=>{let s=Ar(o);if(xe(s))return Be(s.failure);if(!t(s.success))return r?Ae(()=>r(s.success)):Be(o);return Ae(()=>n(s.success))})),Mm=p((e)=>fe(e[0]),(e,t,n,r)=>cr(e,(o)=>{let s=Ar(o);if(xe(s))return Be(s.failure);let i=t(s.success);if(xe(i))return r?Ae(()=>r(i.failure)):Be(o);return Ae(()=>n(i.success))})),dE=p((e)=>fe(e[0]),(e,t,n,r)=>{let o=Array.isArray(t)?(s)=>M(s,"_tag")&&t.includes(s._tag):br(t);return tf(e,o,n,r)}),UO=p((e)=>fe(e[0]),(e,t,n)=>{let r;return Mm(e,(o)=>(r??=Object.keys(t),M(o,"_tag")&&Wr(o._tag)&&r.includes(o._tag)?G(o):te(o)),(o)=>Ae(()=>t[o._tag](o)),n)}),LO=p((e)=>fe(e[0]),(e,t,n,r,o)=>tf(e,(s)=>br(s,t)&&M(s,"reason"),(s)=>{let i=s.reason;if(br(i,n))return r(i,s);return o?Ae(()=>o(i,s)):nt(s)})),jO=p((e)=>fe(e[0]),(e,t,n,r)=>{let o;return tf(e,(s)=>br(s,t)&&M(s,"reason")&&M(s.reason,"_tag")&&Wr(s.reason._tag),(s)=>{let i=s.reason;if(o??=Object.keys(n),o.includes(i._tag))return Ae(()=>n[i._tag](i,s));return r?Ae(()=>r(i,s)):nt(s)})}),BO=p(2,(e,t)=>Mm(e,(n)=>{if(br(n,t)&&M(n,"reason"))return G(n.reason);return te(n)},nt)),pE=p(2,(e,t)=>ur(e,(n)=>Tm(()=>t(n)))),mE=p(2,(e,t)=>Sa(e,{onFailure:(n)=>Tm(()=>t.onFailure(n)),onSuccess:(n)=>pe(()=>t.onSuccess(n))})),HO=p(2,(e,t)=>ur(e,(n)=>pe(t))),zO=p((e)=>fe(e[0]),(e,t)=>{if(!t?.log)return Sa(e,{onFailure:(r)=>ye,onSuccess:(r)=>ye});let n=Xr(t.log===!0?void 0:t.log);return Jr(e,{onFailure(r){let o=qS(r);return xe(o)?Be(o.failure):t.message===void 0?n(r):n(t.message,r)},onSuccess:(r)=>ye})}),Nm=p((e)=>fe(e[0]),(e,t)=>{if(!t?.log)return Jr(e,{onFailure:(r)=>ye,onSuccess:(r)=>ye});let n=Xr(t.log===!0?void 0:t.log);return Jr(e,{onFailure:(r)=>t.message===void 0?n(r):n(t.message,r),onSuccess:(r)=>ye})}),Jr=p(2,(e,t)=>{let n=Object.create(hK);return n[ie]=e,n[In]=t.onSuccess.length!==1?(r)=>t.onSuccess(r):t.onSuccess,n[wr]=t.onFailure.length!==1?(r)=>t.onFailure(r):t.onFailure,n}),hK=Yo({op:"OnSuccessAndFailure",[St](e){return e._stack.push(this),this[ie]}}),xE=p(2,(e,t)=>Jr(e,{onFailure:(n)=>pe(()=>t.onFailure(n)),onSuccess:(n)=>pe(()=>t.onSuccess(n))})),Sa=p(2,(e,t)=>Jr(e,{onFailure:(n)=>{let r=n.reasons.find(Qs);return r?Ae(()=>t.onFailure(r.error)):Be(n)},onSuccess:t.onSuccess})),Dm=p(2,(e,t)=>Sa(e,{onFailure:(n)=>pe(()=>t.onFailure(n)),onSuccess:(n)=>pe(()=>t.onSuccess(n))})),nf=p(2,(e,t)=>{if(We(e)){if(e._tag==="Success")return je(t.onSuccess(e.value));let n=Ar(e.cause);if(xe(n))return e;return je(t.onFailure(n.success))}return Dm(e,t)}),KO=p(2,(e,t)=>{if(We(e)){if(e._tag==="Success")return je(t.onSuccess(e.value));return je(t.onFailure(e.cause))}return xE(e,t)}),gK=vr({op:"Exit",[St](e){return e._stack.push(this),this[ie]},[In](e,t,n){return L(n??je(e))},[wr](e,t,n){return L(n??pn(e))}}),VO=nf({onFailure:()=>!0,onSuccess:()=>!1}),GO=nf({onFailure:()=>!1,onSuccess:()=>!0}),JO=p(2,(e,t)=>Zr(ba(t),e)),yE=p(2,(e,t)=>Am(e,K(ba(t.duration),t.orElse))),ZO=p(2,(e,t)=>yE(e,{duration:t,orElse:()=>nt(new Hm)})),YO=p(2,(e,t)=>Am(Xc(e),xn(ba(t),O()))),xi=ze("effect/Scope"),yK=YS(function*(e,t,n){let r=[],o=[],s=Array.from(t.values()),i=pi();for(let a=s.length-1;a>=0;a--){let c=s[a];if(e.strategy==="sequential")r.push(yield*rf(c(n)));else o.push(Ea(i,c(n),!0,!0,"inherit"))}if(o.length>0)r=yield*Im(o);return yield*iE(r)}),SK={_tag:"Empty"},sf=xi,tA=Pn(xi),ls=vr({op:"OnExit",single:!1,[St](e){return e._stack.push(this),this[ie][0]},[Ys](e){if(e.interruptible&&this[ie][2]!==!0)e._stack.push(Lm),e.interruptible=!1},[In](e,t,n){n??=je(e);let r=this[ie][1](n);return r?K(r,(o)=>n):n},[wr](e,t,n){n??=pn(e);let r=this[ie][1](n);return r?K(xK(n,r),(o)=>n):n}}),nn=p(2,ls),nA=p(2,(e,t)=>nn(e,(n)=>t)),vE=p(3,(e,t,n)=>nn(e,(r)=>{if(!t(r))return ye;return n(r)})),kE=p(3,(e,t,n)=>nn(e,(r)=>{let o=t(r);return xe(o)?ye:n(o.success,r)})),IE=p(2,(e,t)=>kE(e,ef,t)),rA=p(3,(e,t,n)=>vE(e,(r)=>{if(r._tag!=="Failure")return!1;return t(r.cause)},(r)=>n(r.cause))),CE=p(3,(e,t,n)=>nn(e,(r)=>{if(r._tag!=="Failure")return ye;let o=t(r.cause);return xe(o)?ye:n(o.success,r.cause)})),oA=p(2,(e,t)=>CE(Em,t)(e)),OE=p(2,(e,t)=>pe(()=>{let n=qc(sr(t)),r=Number.isFinite(n),o=UE(!1),s=0,i=!1,a,c=K(o.await,()=>a);return[ce((u)=>{let l=u.getRef(ps),f=r?l.currentTimeMillisUnsafe():0;if(i||f<s)return a??c;return i=!0,o.closeUnsafe(),a=void 0,nn(e,(d)=>pe(()=>{i=!1,s=l.currentTimeMillisUnsafe()+n,a=d,o.openUnsafe()}))}),pe(()=>{s=0,o.closeUnsafe(),a=void 0})]})),AE=p(2,(e,t)=>De(OE(e,t),(n)=>n[0])),aA=ce((e)=>Be(ga(e.id))),cA=vr({op:"SetInterruptible",[Ys](e){if(e.interruptible=this[ie],e._interruptedCause&&e.interruptible)return()=>Be(e._interruptedCause)}}),Lm=cA(!0),EK=cA(!1),fA=De(af(pe(()=>new AbortController),(e)=>pe(()=>e.abort())),(e)=>e.signal),RE=p((e)=>go(e[0])&&!fe(e[0]),(e,t,n)=>De(ar(e,(r,o)=>fi(t(r,o)),n),(r)=>hS(r,D))),dA=p(3,(e,t,n)=>{let r=Lt(e);if(r.length===0)return pe(t);return ae(()=>{let o=0,s=t();return De(Eo({while:()=>o<r.length,body:()=>n(s,r[o],o),step(i){s=i,o++}}),()=>s)})}),pA=p((e)=>go(e[0])&&!fe(e[0]),(e,t,n)=>K(RE(e,t,{concurrency:n?.concurrency}),([r,o])=>{if(la(r))return nt(r);return n?.discard?ye:L(o)})),mA=p((e)=>go(e[0])&&!fe(e[0]),(e,t)=>ae(()=>{let n=e[Symbol.iterator](),r=n.next();if(!r.done)return hA(n,0,t,r.value);return L(O())})),gA=p((e)=>go(e[0])&&!fe(e[0]),(e,t)=>ae(()=>{let n=e[Symbol.iterator](),r=n.next();if(!r.done)return xA(n,0,t,r.value);return L(O())})),Eo=vr({op:"While",[In](e,t){if(this[ie].step(e),this[ie].while())return t._stack.push(this),this[ie].body();return Rn},[St](e){if(this[ie].while())return e._stack.push(this),this[ie].body();return Rn}}),ar=p((e)=>typeof e[1]==="function",(e,t,n)=>ae(()=>{let r=n?.concurrency??1,o=r==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,r);if(o===1)return bK(e,t,n);let s=Lt(e),i=s.length;if(i===0)return n?.discard?ye:L([]);let a=n?.discard?void 0:Array(i),c=wK({f:t,out:a},s,{concurrency:o});return c?xn(c,a):L(a)})),wK=SA({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag==="Failure")return n;else if(e.out)e.out[r]=n.value}}),PE=p(3,(e,t,n)=>K(e,(r)=>t(r)?L(r):n(r))),FE=p(3,(e,t,n)=>K(e,(r)=>{let o=t(r);return xe(o)?n(o.failure):L(o.success)})),EA=p((e)=>fe(e[0]),(e,t,n)=>FE(e,t,n?(r)=>nt(n(r)):()=>nt(new yo))),bA=p((e)=>go(e[0])&&!fe(e[0]),(e,t,n)=>ae(()=>{let r=[];return xn(ar(e,(o,s)=>{let i=t(o,s);if(typeof i==="boolean"){if(i)r.push(o);return ye}return De(i,(a)=>{if(a)r.push(o)})},{discard:!0,concurrency:n?.concurrency}),r)})),wA=p((e)=>go(e[0])&&!fe(e[0]),(e,t)=>ae(()=>{let n=[];for(let r of e){let o=t(r);if(Ut(o))n.push(o.success)}return L(n)})),vA=p((e)=>go(e[0])&&!fe(e[0]),(e,t,n)=>ae(()=>{let r=[];return xn(ar(e,(o)=>De(t(o),(s)=>{if(Ut(s))r.push(s.success)}),{discard:!0,concurrency:n?.concurrency}),r)})),kA=L({}),IA=Mc(De),CA=Nc(De,K),TA=Fc(De),OA=p((e)=>fe(e[0]),(e,t)=>ce((n)=>($K(),L(Ea(n,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),AA=p((e)=>fe(e[0]),(e,t)=>ce((n)=>L(Ea(n,e,t?.startImmediately,!0,t?.uninterruptible)))),ME=p((e)=>fe(e[0]),(e,t,n)=>ce((r)=>{let o=Ea(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!o._exit)if(t.state._tag!=="Closed"){let s={};zl(t,s,()=>JT((a)=>a===o.id?ye:Cm(o))),o.addObserver(()=>EE(t,s))}else o.interruptUnsafe(r.id,km(r));return L(o)})),RA=p((e)=>fe(e[0]),(e,t)=>K(sf,(n)=>ME(e,n,t))),PA=p(2,(e,t)=>{if(e._exit)return e;else if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;let n={};return zl(t,n,()=>Cm(e)),e.addObserver(()=>EE(t,n)),e}),FA=ds(hn()),MA=NE(hn()),NA=jm(hn()),DA=DE(hn()),$A=Bm(hn()),UA=$E(hn()),TT=L(!0),OT=L(!1);jA=ce((e)=>L(e.getRef(fm))),BA=p(2,(e,t)=>Pn(e,fm,t)),HA=Pn(dm),qA=Pn(Gc),LS=BigInt(0),vK={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:LS,endTime:LS,exit:Rn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},VA=Hl,GA=ql,JA=p((e)=>fe(e[0]),(e,t,n={})=>{let o=(Array.isArray(t)?t:[t]).map((s)=>({span:s,attributes:n}));return cs(e,ql,(s)=>[...s,...o])}),jS=Pn(um),QA=p((e)=>fe(e[0]),(e,...t)=>cs(e,Hl,(n)=>{let r=t.length===1?{...n,...t[0]}:{...n};if(t.length===1)return r;else U(r,t[0],t[1]);return r})),e_=ce((e)=>{let t=e.currentSpanLocal;return t?L(t):nt(new yo)}),t_=dK(um),ps=ke("effect/Clock",{defaultValue:()=>new n_});r_=BigInt(1e6),o_=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==="function")return()=>e.bigint();if(typeof performance<"u"&&typeof performance.now==="function")return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let n=BigInt(Date.now())*r_;if(n>t)t=n;return t}}(),CK=function(){let e=BigInt(1e9),t;return()=>{let n=o_(),r=BigInt(Date.now())*r_;if(t===void 0)t=r-n;else{let o=t+n;if((r>o?r-o:o-r)>e)t=r-n}return t+n}}(),s_=bo((e)=>e.currentTimeMillis);Hm=class Hm extends Qo("TimeoutError"){[Vl]=Vl;constructor(e){super({message:e})}};jE=class jE extends Qo("IllegalArgumentError"){[Gl]=Gl;constructor(e){super({message:e})}};BE=class BE extends Qo("ExceededCapacityError"){[Jl]=Jl;constructor(e){super({message:e})}};qm=class qm extends Qo("AsyncFiberError"){[Zl]=Zl;constructor(e){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:e})}};lf=class lf extends Qo("UnknownError"){[Yl]=Yl;constructor(e,t){super({message:t,cause:e})}};HE=ke("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),OK=Vy(rr,TK),f_=ti(OK),qE=ke("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([NK,DK])}),AK=ke("effect/Logger/LogToStderr",{defaultValue:Sl}),RK={[_K]:{_Message:D,_Output:D},pipe(){return le(this,arguments)}},ha={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},Oce={None:[],All:[],Trace:[ha.gray],Debug:[ha.blue],Info:[ha.green],Warn:[ha.yellow],Error:[ha.red],Fatal:[ha.bgBrightRed,ha.black]},NK=p_(({cause:e,date:t,fiber:n,logLevel:r,message:o})=>{let s=Array.isArray(o)?o.slice():[o];if(e.reasons.length>0)s.push(vm(e));let i=t.getTime(),a=n.getRef(mm),c="";for(let d of a)c+=` ${FK(d,i)}`;let u=n.getRef(as);if(Object.keys(u).length>0)s.push(u);let l=n.getRef(HE);(n.getRef(AK)?l.error:l.log)(`[${MK(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...s)}),DK=p_(({cause:e,fiber:t,logLevel:n,message:r})=>{let o=t.getRef(ps),s=t.getRef(as),i=t.currentSpan;if(i===void 0||i._tag==="ExternalSpan")return;let a={};for(let[c,u]of Object.entries(s))U(a,c,u);if(a["effect.fiberId"]=t.id,a["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0)a["effect.cause"]=vm(e);i.event(V0(Array.isArray(r)&&r.length===1?r[0]:r),o.currentTimeNanosUnsafe(),a)});zE=L(void 0),m_=p((e)=>fe(e[0]),(e,t)=>IE(e,(n)=>ce((r)=>(UK(r,n,t?.defectsOnly),ye))))});var lt={};Un(lt,{AsyncFiberError:()=>hV,AsyncFiberErrorTypeId:()=>pV,Done:()=>gf,DoneTypeId:()=>oV,ExceededCapacityError:()=>dV,ExceededCapacityErrorTypeId:()=>fV,IllegalArgumentError:()=>xf,IllegalArgumentErrorTypeId:()=>cV,InterruptorStackTrace:()=>S_,NoSuchElementError:()=>rV,NoSuchElementErrorTypeId:()=>nV,ReasonTypeId:()=>jK,StackTrace:()=>y_,TimeoutError:()=>aV,TimeoutErrorTypeId:()=>sV,TypeId:()=>LK,UnknownError:()=>ZE,UnknownErrorTypeId:()=>gV,annotate:()=>yV,annotations:()=>EV,combine:()=>zK,die:()=>h_,done:()=>_t,empty:()=>VE,fail:()=>GE,filterInterruptors:()=>XK,findDefect:()=>JK,findDie:()=>GK,findError:()=>x_,findErrorOption:()=>KK,findFail:()=>WK,findInterrupt:()=>YK,fromReasons:()=>wa,hasDies:()=>VK,hasFails:()=>g_,hasInterrupts:()=>ZK,hasInterruptsOnly:()=>hf,interrupt:()=>qK,interruptors:()=>QK,isAsyncFiberError:()=>mV,isCause:()=>WE,isDieReason:()=>BK,isDone:()=>zm,isExceededCapacityError:()=>lV,isFailReason:()=>ff,isIllegalArgumentError:()=>uV,isInterruptReason:()=>HK,isNoSuchElementError:()=>tV,isReason:()=>KE,isTimeoutError:()=>iV,isUnknownError:()=>xV,makeDieReason:()=>pf,makeFailReason:()=>df,makeInterruptReason:()=>mf,map:()=>ms,pretty:()=>JE,prettyErrors:()=>eV,reasonAnnotations:()=>SV,squash:()=>nu});var LK,jK,WE,KE,ff,BK,HK,wa,VE,GE,h_,qK,df=(e)=>new Ac(e),pf=(e)=>new Lp(e),mf,hf,ms,zK,nu,g_,WK,x_,KK,VK,GK,JK,ZK,YK,QK,XK,eV,JE,tV,nV,rV,zm,oV,gf,_t,sV,iV,aV,cV,uV,xf,lV,fV,dV,pV,mV,hV,gV,xV,ZE,yV,SV,EV,y_,S_;var rn=w(()=>{Ve();rt();ht();LK=Cc,jK=Tc,WE=Oc,KE=X0,ff=Qs,BK=na,HK=ra,wa=Zo,VE=Up,GE=Ol,h_=By,qK=ga,mf=AT,hf=MT,ms=$T,zK=bm,nu=wm,g_=HS,WK=qS,x_=Ar,KK=_T,VK=ym,GK=RT,JK=Ql,ZK=Sm,YK=PT,QK=FT,XK=Em,eV=zS,JE=vm,tV=Bp,nV=Il,rV=yo,zm=_l,oV=ea,gf=Rc,_t=nC,sV=Vl,iV=i_,aV=Hm,cV=Gl,uV=a_,xf=jE,lV=c_,fV=Jl,dV=BE,pV=Zl,mV=u_,hV=qm,gV=Yl,xV=l_,ZE=lf,yV=_c,SV=NT,EV=DT;y_=class y_ extends ze()("effect/Cause/StackTrace"){};S_=class S_ extends ze()("effect/Cause/InterruptorStackTrace"){}});var Gt={};Un(Gt,{asVoid:()=>NV,asVoidAll:()=>DV,die:()=>E_,fail:()=>Rr,failCause:()=>lr,filterCause:()=>OV,filterFailure:()=>TV,filterSuccess:()=>IV,filterValue:()=>CV,findDefect:()=>_V,findError:()=>AV,findErrorOption:()=>LV,getCause:()=>UV,getSuccess:()=>$V,hasDies:()=>vV,hasFails:()=>wV,hasInterrupts:()=>kV,interrupt:()=>bV,isExit:()=>YE,isFailure:()=>ru,isSuccess:()=>Rt,map:()=>PV,mapBoth:()=>MV,mapError:()=>FV,match:()=>RV,succeed:()=>_r,void:()=>fr});var YE,_r,lr,Rr,E_,bV,fr,Rt,ru,wV,vV,kV,IV,CV,TV,OV,AV,_V,RV,PV,FV,MV,NV,DV,$V,UV,LV;var dr=w(()=>{rt();ht();YE=jy,_r=je,lr=pn,Rr=kr,E_=Kr,bV=_m,fr=Rn,Rt=hi,ru=tE,wV=xO,vV=gO,kV=hO,IV=fO,CV=dO,TV=pO,OV=ef,AV=nE,_V=mO,RV=SO,PV=rE,FV=oE,MV=sE,NV=EO,DV=iE,$V=bO,UV=wO,LV=vO});var jV="~effect/Deferred",BV,Wm=()=>{let e=Object.create(BV);return e.resumes=void 0,e.effect=void 0,e},va=(e)=>Bt((t)=>{if(e.effect)return t(e.effect);return e.resumes??=[],e.resumes.push(t),pe(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);if(r>=0)n.splice(r,1)})}),HV,b_,QE=(e)=>pe(()=>qV(e)),qV=(e)=>e.effect!==void 0,XE=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let n=e.resumes;e.resumes=void 0;for(let r=0;r<n.length;r++)n[r](t)}return!0};var eb=w(()=>{X();ht();Qe();BV={[jV]:{_A:D,_E:D},pipe(){return le(this,arguments)}},HV=p(2,(e,t)=>pe(()=>XE(e,t))),b_=HV});var v_,k_,I_;var tb=w(()=>{PS();v_=as,k_=mm,I_=pm});var yf,ou,Sf,Km,Ef,yi,pr;var bf=w(()=>{ht();yf=xi,ou=of,Sf=tA,Km=Yr,Ef=eA,yi=XO,pr=SE});var O_="~effect/Layer",C_="~effect/Layer/MemoMap",WV=(e,t)=>(e.observers++,Zr(Yr(t,(n)=>e.finalizer(n)),e.effect)),A_=(e)=>M(e,O_),KV,__=(e)=>{let t=Object.create(KV);return t.build=e,t},nb=(e)=>__((t,n)=>{let r=yi(n);return nn(e(t,r),(o)=>o._tag==="Failure"?pr(r,o):ye)}),VV=(e)=>{let t=nb((n,r)=>n.getOrElseMemoize(t,r,e));return t},GV=(e,t,n,r)=>{let o=ou(),s=Wm(),i={observers:1,effect:va(s),finalizer:(a)=>ae(()=>{if(i.observers--,i.observers===0)return e.map.delete(t),pr(o,a);return ye})};return e.map.set(t,i),Yr(n,i.finalizer).pipe(K(()=>r(e,o)),nn((a)=>(i.effect=a,b_(s,a))))},rb,ob=()=>new rb,JV=(e)=>new rb(e),wf,sb,R_,Si=function(){if(arguments.length===1)return(e)=>Gm(os(arguments[0],e));return Gm(os(arguments[0],arguments[1]))},Gm=(e)=>__(gt(L(e))),su=function(){if(arguments.length===1)return(e)=>T_(arguments[0],e);return T_(arguments[0],arguments[1])},T_=(e,t)=>ZV(De(t,(n)=>os(e,n))),ZV=(e)=>VV((t,n)=>Sf(e,n)),P_=(e,t,n)=>{let r=yi(n,"parallel");return ar(e,(o)=>o.build(t,yi(r,"sequential")),{concurrency:e.length}).pipe(De((o)=>OC(...o)))},Jm=(...e)=>nb((t,n)=>P_(e,t,n)),F_=(e,t,n)=>nb((r,o)=>K(Array.isArray(t)?P_(t,r,o):t.build(r,o),(s)=>e.build(r,o).pipe(us(s),De((i)=>n(i,s))))),M_,N_;var wo=w(()=>{Ve();eb();X();rt();ht();Qe();he();bf();KV={[O_]:{_ROut:D,_E:D,_RIn:D},pipe(){return le(this,arguments)}};rb=class rb{get[C_](){return C_}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);if(n)return WV(n,t);return this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return ae(()=>{let r=this.get(e,t);if(r)return r;return GV(this,e,t,n)})}};wf=class wf extends ze()("effect/Layer/CurrentMemoMap"){static forkOrCreate(e){let t=Yp(e,wf);return t?JV(t):ob()}};sb=p(3,(e,t,n)=>Pn(De(e.build(t,n),tn(wf,t)),wf,t)),R_=p(2,(e,t)=>ce((n)=>sb(e,wf.forkOrCreate(n.context),t))),M_=p(2,(e,t)=>F_(e,t,D)),N_=p(2,(e,t)=>F_(e,t,(n,r)=>ua(r,n)))});var D_="~effect/ExecutionPlan",YV,QV=(e)=>{let t=Object.create(YV);return t.steps=e,t},$_;var U_=w(()=>{Ve();X();ht();wo();Qe();YV={[D_]:D_,get captureRequirements(){let e=this;return gi((t)=>L(QV(e.steps.map((n)=>({...n,provide:A_(n.provide)?M_(n.provide,Gm(t)):n.provide})))))},pipe(){return le(this,arguments)}},$_=ke("effect/ExecutionPlan/CurrentMetadata",{defaultValue:gt({attempt:0,stepIndex:0})})});var Zm="~effect/time/DateTime",Ym="~effect/time/DateTime/TimeZone",j_,o3,s3,B_,i3,a3,vo=(e,t,n)=>{let r=Object.create(s3);return r.epochMilliseconds=e,r.zone=t,Object.defineProperty(r,"partsUtc",{value:n,enumerable:!1,writable:!0}),Object.defineProperty(r,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(r,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),r},iu=(e)=>M(e,Zm),Ia=(e)=>M(e,Ym),H_=(e)=>Ia(e)&&e._tag==="Offset",q_=(e)=>Ia(e)&&e._tag==="Named",z_=(e)=>e._tag==="Utc",cb=(e)=>e._tag==="Zoned",W_,K_,V_=(e)=>{let t=Object.create(o3);return t.epochMilliseconds=e,Object.defineProperty(t,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),t},ka=(e)=>{let t=e.getTime();if(Number.isNaN(t))throw new xf("Invalid date");return V_(t)},ub=(e)=>{if(iu(e))return e;else if(e instanceof Date)return ka(e);else if(typeof e==="object"){if("epochMilliseconds"in e)return ka(new Date(e.epochMilliseconds));let t=new Date(0);return h3(t,e),ka(t)}else if(typeof e==="string"&&!c3(e))return ka(new Date(e+"Z"));return ka(new Date(e))},c3=(e)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e),u3=-8639999956800000,l3=8639999949600000,lb=(e,t)=>{let n=t?.timeZone;if(n===void 0&&iu(e)&&cb(e))return e;let r=ub(e);if(r.epochMilliseconds<u3||r.epochMilliseconds>l3)throw RangeError(`Epoch millis out of range: ${r.epochMilliseconds}`);if(n===void 0&&typeof e==="object"&&"timeZoneId"in e)n=e.timeZoneId;let o;if(n===void 0){let s=new Date(r.epochMilliseconds).getTimezoneOffset()*-60*1000;o=If(s)}else if(Ia(n))o=n;else if(typeof n==="number")o=If(n);else{let s=pb(n);if(me(s))throw new xf(`Invalid time zone: ${n}`);o=s.value}if(t?.adjustForTimeZone!==!0)return vo(r.epochMilliseconds,o,r.partsUtc);return g3(r.epochMilliseconds,o,t?.disambiguation??"compatible")},ib,G_,f3,J_=(e)=>{let t=f3.exec(e);if(t===null){let o=xb(e);return o!==null?ib(e,{timeZone:o}):O()}let[,n,r]=t;return ib(n,{timeZone:r})},Z_=(e)=>V_(e.epochMilliseconds),kf,d3,p3=(e)=>{let t=e.resolvedOptions().timeZone;if(kf.has(t))return kf.get(t);let n=Object.create(i3);return n.id=t,n.format=e,kf.set(t,n),n},fb=(e)=>{if(kf.has(e))return kf.get(e);try{return p3(new Intl.DateTimeFormat("en-US",{...d3,timeZone:e}))}catch{throw new xf(`Invalid time zone: ${e}`)}},If=(e)=>{let t=Object.create(a3);return t.offset=e,t},db,m3,pb=(e)=>{if(m3.test(e)){let t=xb(e);return t===null?O():_(If(t))}return db(e)},Y_=(e)=>{if(e._tag==="Offset")return hb(e.offset);return e.id},Cf=(e)=>new Date(e.epochMilliseconds),Qm=(e)=>{if(e._tag==="Utc")return new Date(e.epochMilliseconds);else if(e.zone._tag==="Offset")return new Date(e.epochMilliseconds+e.zone.offset);else if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=e.zone.format.formatToParts(e.epochMilliseconds).filter((r)=>r.type!=="literal"),n=new Date(0);return n.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),n.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),Number(t[6].value)),e.adjustedEpochMilliseconds=n.getTime(),n},mb=(e)=>Qm(e).getTime()-gb(e),hb=(e)=>{let t=Math.abs(e),n=Math.floor(t/3600000),r=Math.round(t%3600000/60000);if(r===60)n+=1,r=0;return`${e<0?"-":"+"}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`},Q_=(e)=>hb(mb(e)),gb=(e)=>e.epochMilliseconds,h3=(e,t)=>{if(t.year!==void 0)e.setUTCFullYear(t.year);if(t.month!==void 0)e.setUTCMonth(t.month-1);if(t.day!==void 0)e.setUTCDate(t.day);if(t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}if(t.hour!==void 0)e.setUTCHours(t.hour);if(t.minute!==void 0)e.setUTCMinutes(t.minute);if(t.second!==void 0)e.setUTCSeconds(t.second);if(t.millisecond!==void 0)e.setUTCMilliseconds(t.millisecond)},L_=86400000,g3=(e,t,n)=>{if(t._tag==="Offset")return vo(e-t.offset,t);let r=vf(e-L_,e,t),o=vf(e+L_,e,t);if(r===o)return vo(e-r,t);let s=r<o,i=r-o;if(s){if(vf(e-o,e,t)===o)return vo(e-o,t);let u=vo(e-r,t),l=Qm(u).getTime();if(e!==l)switch(n){case"reject":{let f=new Date(e).toISOString();throw RangeError(`Gap time: ${f} does not exist in time zone ${t.id}`)}case"earlier":return vo(e-o,t);case"compatible":case"later":return u}return u}if(vf(e-r,e,t)===r){if(n==="earlier"||n==="compatible")return vo(e-r,t);if(vf(e-r+i,e+i,t)===r)return vo(e-r,t);if(n==="reject"){let u=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${u} occurs twice in time zone ${t.id}`)}}return vo(e-o,t)},x3,xb=(e)=>{let t=x3.exec(e);if(t===null)return null;let[,n,r,o]=t;return(n==="+"?1:-1)*(Number(r)*60+Number(o))*60*1000},vf=(e,t,n)=>{let r=n.format.formatToParts(e).find((s)=>s.type==="timeZoneName")?.value??"";if(r==="GMT")return 0;let o=xb(r);if(o===null)return mb(vo(t,n));return o},X_=(e)=>Cf(e).toISOString(),ab=(e)=>{let t=Qm(e);return e._tag==="Utc"?t.toISOString():`${t.toISOString().slice(0,-1)}${Q_(e)}`},yb=(e)=>e.zone._tag==="Offset"?ab(e):`${ab(e)}[${e.zone.id}]`;var eR=w(()=>{rn();yt();Xo();Xt();jn();_e();ia();Qe();he();j_={[Zm]:Zm,pipe(){return le(this,arguments)},[At](){return this.toString()},toJSON(){return Cf(this).toJSON()}},o3={...j_,_tag:"Utc",[Ie](){return Ln(this.epochMilliseconds)},[Ce](e){return iu(e)&&e._tag==="Utc"&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${Cf(this).toJSON()})`}},s3={...j_,_tag:"Zoned",[Ie](){return xt(Ln(this.epochMilliseconds))(re(this.zone))},[Ce](e){return iu(e)&&e._tag==="Zoned"&&this.epochMilliseconds===e.epochMilliseconds&&Y(this.zone,e.zone)},toString(){return`DateTime.Zoned(${yb(this)})`}},B_={[Ym]:Ym,[At](){return this.toString()}},i3={...B_,_tag:"Named",[Ie](){return qe(`Named:${this.id}`)},[Ce](e){return Ia(e)&&e._tag==="Named"&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},a3={...B_,_tag:"Offset",[Ie](){return qe(`Offset:${this.offset}`)},[Ce](e){return Ia(e)&&e._tag==="Offset"&&this.offset===e.offset},toString(){return`TimeZone.Offset(${hb(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},W_=Kt((e,t)=>e.epochMilliseconds===t.epochMilliseconds),K_=ts((e,t)=>e.epochMilliseconds<t.epochMilliseconds?-1:e.epochMilliseconds>t.epochMilliseconds?1:0),ib=ni(lb),G_=ni(ub),f3=/^(.{17,35})\[(.+)\]$/,kf=new Map,d3={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},db=ni(fb),m3=/^(?:GMT|[+-])/,x3=/([+-])(\d{2}):(\d{2})$/});function S3(e,t){let[n,r]=tR(e),[o,s]=tR(t),i=Math.min(r,s),a=n*BigInt(10)**BigInt(r-i),c=o*BigInt(10)**BigInt(s-i),u=a%c;if(u===BigInt(0))return e<0||Object.is(e,-0)?-0:0;let l=globalThis.Number(`${u}e${i}`);return l===0?Math.sign(e)*globalThis.Number.MIN_VALUE:l}function tR(e){let t=Math.abs(e).toExponential(),n=t.indexOf("e"),r=t.slice(0,n).replace(".","");return[BigInt(r)*(e<0?-BigInt(1):BigInt(1)),globalThis.Number(t.slice(n+1))-r.length+1]}var qce,nR,rR,oR,sR;var Xm=w(()=>{X();qce=globalThis.Number,nR=p(2,(e,t)=>{let n=e.toString(),r=t.toString();if(n.includes("e")||r.includes("e")){if(!globalThis.Number.isFinite(e)||!globalThis.Number.isFinite(t)||t===0)return NaN;return S3(e,t)}let o=(n.split(".")[1]||"").length,s=(r.split(".")[1]||"").length,i=o>s?o:s,a=parseInt(e.toFixed(i).replace(".","")),c=parseInt(t.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)});rR=p(2,(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n}),oR=Ir((e,t)=>Math.max(e,t),-1/0),sR=Ir((e,t)=>Math.min(e,t),1/0)});var zce,aR=(e)=>e.trim(),cR=13,uR=10,lR,E3=(e)=>{let t=e.charCodeAt(0);return t===cR||t===uR},b3=(e,t)=>e.charCodeAt(0)===cR&&t.charCodeAt(0)===uR;var fR=w(()=>{zce=globalThis.String;lR=class lR{index;length;s;stripped;constructor(e,t=!1){this.s=e,this.stripped=t,this.index=0,this.length=e.length}next(){if(this.done)return{done:!0,value:void 0};let e=this.index;while(!this.done&&!E3(this.s[this.index]))this.index=this.index+1;let t=this.index;if(!this.done){let n=this.s[this.index];if(this.index=this.index+1,!this.done&&b3(n,this.s[this.index]))this.index=this.index+1;if(!this.stripped)t=this.index}return{done:!1,value:this.s.substring(e,t)}}[Symbol.iterator](){return new lR(this.s,this.stripped)}get done(){return this.index>=this.length}}});var mr,Tf=(e)=>e.reasons.some(Sb),Sb=(e)=>e._tag==="Fail"&&zm(e.error),eh=(e)=>{let t,n=!1;for(let r of e.reasons)if(Sb(r))t??=r.error;else if(r._tag!=="Interrupt")n=!0;if(t===void 0)return te(e);return n?te(wa(e.reasons.filter((r)=>!Sb(r)))):G(t)},v3=(e)=>{let t=eh(e);return xe(t)?t:G(t.success.value)},Eb=(e)=>{let t=eh(e);return!xe(t)?_r(t.success.value):lr(t.failure)},th;var Ca=w(()=>{rn();dr();X();ht();gn();mr=p(2,(e,t)=>tu(e,v3,(n)=>t(n))),th=p(2,(e,t)=>Jr(e,{onSuccess:t.onSuccess,onFailure:(n)=>{let r=eh(n);return!xe(r)?t.onDone(r.success.value):t.onFailure(r.failure)}}))});var dR="~effect/Schedule",Ta,k3,bb=(e)=>M(e,dR),wb=(e)=>{let t=Object.create(k3);return t.step=e,t},vb=()=>{let e=0,t,n;return(r,o)=>{if(n===void 0)n=r;let s=r-n,i=t===void 0?0:r-t;return t=r,{input:o,attempt:++e,start:n,now:r,elapsed:s,elapsedSincePrevious:i}}},I3=(e)=>wb(De(e,(t)=>{let n=vb();return(r,o)=>t(n(r,o))})),kb=(e)=>cr(e.step,(t)=>L(()=>Be(t))),nh=(e)=>bo((t)=>De(kb(e),(n)=>{let r=vb();return(o)=>ae(()=>{let s=t.currentTimeMillisUnsafe();return K(n(s,o),([i,a])=>{let c=r(s,o);return c.output=i,c.duration=a,xn(ba(a),c)})})})),Ib=(e)=>wb(De(kb(e),(t)=>(n,r)=>th(t(n,r),{onSuccess:(o)=>L([r,o[1]]),onFailure:Be,onDone:()=>_t(r)}))),pR=(e)=>Of(Cb,({attempt:t})=>L(t<=e)),C3=(e)=>{let t=sr(e);return I3(L((n)=>L([n.attempt-1,t])))},Of,Cb;var Tb=w(()=>{rn();Ve();ai();X();rt();ht();Qe();he();Ca();Ta=ke("effect/Schedule/CurrentMetadata",{defaultValue:gt({input:void 0,output:void 0,duration:Hc,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),k3={[dR]:{_Out:D,_In:D,_Env:D},pipe(){return le(this,arguments)}},Of=p(2,(e,t)=>wb(De(kb(e),(n)=>{let r=vb();return(o,s)=>K(n(o,s),(i)=>{let[a,c]=i,u=t({...r(o,s),output:a,duration:c});return K(fe(u)?u:L(u),(l)=>l?L(i):_t(a))})}))),Cb=C3(Hc)});var T3=(e,t,n)=>Um((r)=>K(n?.local?sb(t,ob(),r):R_(t,r),(o)=>us(e,o))),rh;var Ob=w(()=>{Ve();X();wo();rt();ht();rh=p((e)=>fe(e[0]),(e,t,n)=>rS(t)?us(e,t):T3(e,Array.isArray(t)?Jm(...t):t,n))});var Ab,_b,gR,Af,xR,O3,_f=(e)=>{let t=e.schedule?Ib(e.schedule):O3;if(e.while)t=Of(t,({input:n})=>{let r=e.while(n);return fe(r)?r:L(r)});if(e.until)t=Of(t,({input:n})=>{let r=e.until(n);return fe(r)?De(r,(o)=>!o):L(!r)});if(e.times!==void 0)t=Of(t,({attempt:n})=>L(n<=e.times));return t};var Rb=w(()=>{X();_e();Ca();Tb();Qi();rt();ht();Ab=p(3,(e,t,n)=>K(nh(t),(r)=>{let o=Ta.defaultValue();return ur(Pm(ya(K(ae(()=>Pn(e,Ta,o)),r),(s)=>pe(()=>{o=s})),{disableYield:!0}),(s)=>_l(s)?L(s.value):n(s,o.attempt===0?O():_(o)))})),_b=p(3,(e,t,n)=>K(nh(t),(r)=>{let o=Ta.defaultValue(),s,i=ur(ae(()=>Pn(e,Ta,o)),(a)=>(s=a,K(r(a),(c)=>(o=c,i))));return mr(i,(a)=>Ae(()=>n(s,a)))})),gR=p(2,(e,t)=>{let n=typeof t==="function"?t(D):bb(t)?t:_f(t);return Ab(e,n,nt)}),Af=p(2,(e,t)=>{let n=typeof t==="function"?t(D):bb(t)?t:_f(t);return _b(e,n,nt)}),xR=p(3,(e,t,n)=>K(nh(n),(r)=>{let o=Ta.defaultValue(),s=ae(()=>Pn(e,Ta,o));return ur(K(r(t),(i)=>{o=i;let a=gt(K(s,r));return Eo({while:nr,body:a,step(c){o=c}})}),(i)=>_l(i)?L(i.value):nt(i))})),O3=Ib(Cb)});var A3=(e,t)=>{let n=-1,r=0,o=(s)=>Nm(e(s));return{begin:bo((s)=>ae(()=>{let i=t();if(i.stepIndex!==n)n=i.stepIndex,r=0;r++;let a={attempt:i.attempt,stepAttempt:r,stepIndex:i.stepIndex,startNanos:s.monotonicTimeNanosUnsafe()};return xn(o({_tag:"AttemptStart",attempt:a.attempt,stepAttempt:a.stepAttempt,stepIndex:a.stepIndex}),a)})),end:(s,i)=>bo((a)=>{let c=Tr(a.monotonicTimeNanosUnsafe()-s.startNanos);return o(i._tag==="Success"?{_tag:"AttemptSuccess",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c}:{_tag:"AttemptFailure",attempt:s.attempt,stepAttempt:s.stepAttempt,stepIndex:s.stepIndex,duration:c,cause:i.cause})})}},ER,SR=(e,t)=>{if(!t)return _f({schedule:e.schedule?e.schedule:e.attempts?void 0:_3,times:e.attempts,while:e.while});else if(e.attempts===1||!(e.schedule||e.attempts))return;return _f({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0})},_3;var bR=w(()=>{ai();U_();X();gn();Tb();rt();ht();Ob();Rb();ER=p((e)=>fe(e[0]),(e,t,n)=>ae(()=>{let r=0,o={attempt:0,stepIndex:0},s=Rm($_,pe(()=>(o={attempt:o.attempt+1,stepIndex:r},o))),i=n?.onEvent===void 0?void 0:A3(n.onEvent,()=>o),a=i===void 0?D:(u)=>Qr((l)=>K(i.begin,(f)=>nn(l(u),(d)=>i.end(f,d)))),c;return K(Eo({while:()=>r<t.steps.length&&(c===void 0||xe(c)),body(){let u=t.steps[r],l=s(a(rh(e,u.provide)));if(c){let f=!1,d=l;l=ae(()=>{if(f)return d;return f=!0,Yc(c)}),l=Af(l,SR(u,!1))}else{let f=SR(u,!0);l=f?Af(l,f):l}return fi(l)},step(u){c=u,r++}}),()=>Yc(c))})),_3=pR(1)});var P3="~effect/Request",F3,iue,wR=(e)=>e;var vR=w(()=>{yt();rt();F3=$y({_E:(e)=>e,_A:(e)=>e,_R:(e)=>e}),iue={...Q0,[P3]:F3}});function kR(e){if(!e.map.has(e.key))return ye;return e.map.delete(e.key),e.run}var IR,CR=(e,t)=>{let n=TR(t.resolver,e,t.onExit,{context:t.context,currentScheduler:On(t.context,jl)});return()=>OR(t.resolver,n)},oh,Pb,TR=(e,t,n,r)=>{let o=Pb.get(e);if(!o)o=new Map,Pb.set(e,o);let s,i=!1,a=wR({request:t,context:r.context,uninterruptible:!1,completeUnsafe(u){if(i)return;i=!0,n(u),s?.entrySet.delete(a)}});if(e.preCheck!==void 0&&!e.preCheck(a))return a;let c=e.batchKey(a);if(s=o.get(c),!s){if(oh.length>0)s=oh.pop(),s.key=c,s.resolver=e,s.map=o;else{let u={key:c,resolver:e,map:o,entrySet:new Set,entries:new Set,delayEffect:K(ae(()=>u.resolver.delay),(l)=>kR(u)),run:nn(ae(()=>u.resolver.runAll(Array.from(u.entries),u.key)),(l)=>{for(let f of u.entrySet)f.completeUnsafe(l._tag==="Success"?Kr(Error("Effect.request: RequestResolver did not complete request",{cause:f.request})):l);if(u.entries.clear(),oh.length<128)u.entrySet.clear(),u.key=void 0,u.fiber=void 0,u.resolver=void 0,u.map=void 0,oh.push(u);return ye})};s=u}o.set(c,s),s.fiber=ds(r.context)(s.delayEffect,{scheduler:r.currentScheduler})}if(s.entrySet.add(a),s.entries.add(a),s.resolver.collectWhile(s.entries))return a;return s.fiber.interruptUnsafe(r.id),s.fiber=ds(r.context)(kR(s),{scheduler:r.currentScheduler}),a},OR=(e,t)=>{if(t.uninterruptible)return;let n=Pb.get(e);if(!n)return;let r=e.batchKey(t),o=n.get(r);if(!o)return;if(o.entries.delete(t),o.entrySet.delete(t),o.entries.size===0)n.delete(r),o.fiber?.interruptUnsafe()},M3=(e,t)=>pe(()=>OR(e,t));var AR=w(()=>{Ve();X();vR();om();rt();ht();IR=p(2,(e,t)=>{let n=(r)=>Bt((o)=>{let s=TR(r,e,o,pi());return M3(r,s)});return fe(t)?K(t,n):n(t)}),oh=[],Pb=new WeakMap});function B3(e,t){let n=`${e.type}:${e.id}`;if(Le(e.description))n+=`:${e.description}`;if(Le(t))n+=`:${H3(t)}`;return n}function H3(e){return JSON.stringify(Array.isArray(e)?e:Object.entries(e))}function q3(e,t){return{...Fb(e),...Fb(t)}}function Fb(e){if(Le(e)&&Array.isArray(e))return e.reduce((t,[n,r])=>(U(t,n,r),t),{});return e}var D3="effect/Metric/CurrentMetricAttributes",$3,U3="~effect/observability/Metric/MetricRegistryKey",L3,_R="~effect/observability/Metric",j3,cu;var RR=w(()=>{Ve();X();ht();Qe();he();$3=ke(D3,{defaultValue:()=>({})}),L3=ke(U3,{defaultValue:()=>new Map});j3=class j3{[_R]=_R;#t=new WeakMap;#e;id;description;attributes;constructor(e,t,n){this.id=e,this.description=t,this.attributes=n}valueUnsafe(e){return this.hook(e).get(e)}modifyUnsafe(e,t){return this.hook(t).modify(e,t)}updateUnsafe(e,t){return this.hook(t).update(e,t)}hook(e){let t=On(e,$3);if(Object.keys(t).length===0){if(Le(this.#e))return this.#e.hooks;return this.#e=this.getOrCreate(e,this.attributes),this.#e.hooks}let n=q3(this.attributes,t),r=this.#t.get(n);if(Le(r))return r.hooks;return r=this.getOrCreate(e,n),this.#t.set(n,r),r.hooks}getOrCreate(e,t){let n=B3(this,t),r=On(e,L3);if(r.has(n))return r.get(n);let o=this.createHooks(),s={id:this.id,type:this.type,description:this.description,attributes:Fb(t),hooks:o};return r.set(n,s),s}pipe(){return le(this,arguments)}};cu=p(2,(e,t)=>gi((n)=>pe(()=>e.updateUnsafe(t,n))))});var j={};Un(j,{Do:()=>X3,Transaction:()=>Rf,TypeId:()=>W3,abortSignal:()=>iJ,acquireDisposable:()=>ZG,acquireRelease:()=>Mr,acquireUseRelease:()=>WR,addFinalizer:()=>dh,all:()=>FR,andThen:()=>hr,annotateCurrentSpan:()=>xJ,annotateLogs:()=>GJ,annotateLogsScoped:()=>JJ,annotateSpans:()=>gJ,as:()=>gr,asSome:()=>DR,asVoid:()=>Ff,awaitAllChildren:()=>RJ,bind:()=>nG,bindTo:()=>eG,cached:()=>tJ,cachedInvalidateWithTTL:()=>rJ,cachedWithTTL:()=>nJ,callback:()=>yn,catch:()=>Pr,catchCause:()=>xr,catchCauseFilter:()=>hG,catchCauseIf:()=>mG,catchDefect:()=>Lb,catchEager:()=>Bf,catchFilter:()=>Mf,catchIf:()=>dG,catchNoSuchElement:()=>pG,catchReason:()=>uG,catchReasons:()=>lG,catchTag:()=>gs,catchTags:()=>Ub,clockWith:()=>jf,context:()=>lh,contextWith:()=>qR,currentParentSpan:()=>SJ,currentSpan:()=>yJ,delay:()=>jR,die:()=>ko,effectify:()=>ot,ensuring:()=>pu,eventually:()=>EG,exit:()=>bi,fail:()=>A,failCause:()=>fu,failCauseSync:()=>Ei,failSync:()=>Nb,fiber:()=>PJ,fiberId:()=>FJ,filter:()=>Hb,filterMap:()=>MG,filterMapEffect:()=>HR,filterMapOrElse:()=>DG,filterMapOrFail:()=>UG,filterOrElse:()=>NG,filterOrFail:()=>$G,findFirst:()=>J3,findFirstFilter:()=>Z3,firstSuccessOf:()=>OG,flatMap:()=>ne,flatMapEager:()=>on,flatten:()=>NR,flip:()=>cG,fn:()=>jJ,fnUntraced:()=>H,fnUntracedEager:()=>hh,forEach:()=>Oa,forever:()=>Co,forkChild:()=>Vb,forkDetach:()=>_J,forkIn:()=>gu,forkScoped:()=>xu,fromNullishOr:()=>iG,fromOption:()=>oG,fromResult:()=>$b,gen:()=>qt,head:()=>Y3,ignore:()=>Nf,ignoreCause:()=>kG,interrupt:()=>hu,interruptible:()=>oJ,interruptibleMask:()=>sJ,isEffect:()=>zn,isFailure:()=>zG,isSuccess:()=>WG,let:()=>tG,linkSpans:()=>wJ,log:()=>BJ,logDebug:()=>WJ,logError:()=>mh,logFatal:()=>HJ,logInfo:()=>zJ,logTrace:()=>KJ,logWarning:()=>qJ,logWithLevel:()=>QR,makeSpan:()=>JR,makeSpanScoped:()=>vJ,map:()=>oe,mapBoth:()=>gG,mapBothEager:()=>Jt,mapEager:()=>Ss,mapError:()=>Pt,mapErrorEager:()=>Ra,match:()=>wi,matchCause:()=>BG,matchCauseEager:()=>HG,matchCauseEffect:()=>qb,matchCauseEffectEager:()=>qG,matchEager:()=>jG,matchEffect:()=>uh,never:()=>sh,onError:()=>mu,onErrorFilter:()=>QG,onErrorIf:()=>YG,onExit:()=>ys,onExitFilter:()=>eJ,onExitIf:()=>XG,onExitPrimitive:()=>KR,onInterrupt:()=>VR,option:()=>aG,orDie:()=>Fr,orElseSucceed:()=>TG,partition:()=>K3,promise:()=>MR,provide:()=>zb,provideContext:()=>xs,provideService:()=>Io,provideServiceEffect:()=>Wb,race:()=>FG,raceAll:()=>BR,raceAllFirst:()=>PG,raceFirst:()=>_a,reduce:()=>V3,repeat:()=>aJ,repeatOrElse:()=>cJ,replicate:()=>uJ,replicateEffect:()=>lJ,request:()=>OJ,requestUnsafe:()=>AJ,result:()=>ih,retry:()=>bG,retryOrElse:()=>wG,runCallback:()=>NJ,runCallbackWith:()=>MJ,runFork:()=>To,runForkWith:()=>Lf,runPromise:()=>ZR,runPromiseExit:()=>ph,runPromiseExitWith:()=>DJ,runPromiseWith:()=>YR,runSync:()=>$J,runSyncExit:()=>ki,runSyncExitWith:()=>LJ,runSyncWith:()=>UJ,sandbox:()=>vG,satisfiesErrorType:()=>c4,satisfiesServicesType:()=>u4,satisfiesSuccessType:()=>a4,schedule:()=>fJ,scheduleFrom:()=>GR,scope:()=>Df,scoped:()=>vi,scopedWith:()=>Kb,service:()=>zR,serviceOption:()=>fh,setContext:()=>KG,sleep:()=>ch,spanAnnotations:()=>EJ,spanLinks:()=>bJ,succeed:()=>v,succeedNone:()=>Aa,succeedSome:()=>Mb,suspend:()=>Ne,sync:()=>Se,tap:()=>du,tapCause:()=>ah,tapCauseFilter:()=>SG,tapCauseIf:()=>yG,tapDefect:()=>LR,tapError:()=>jb,tapErrorTag:()=>xG,timed:()=>RG,timeout:()=>AG,timeoutOption:()=>_G,timeoutOrElse:()=>Bb,tracer:()=>dJ,track:()=>YJ,trackDefects:()=>e4,trackDuration:()=>t4,trackErrors:()=>XJ,trackSuccesses:()=>QJ,transposeOption:()=>sG,try:()=>Nt,tryPromise:()=>lu,tx:()=>n4,txRetry:()=>i4,undefined:()=>Q3,uninterruptible:()=>$f,uninterruptibleMask:()=>Uf,unwrapReason:()=>fG,updateContext:()=>VG,updateService:()=>GG,updateServiceScoped:()=>JG,useSpan:()=>kJ,validate:()=>G3,void:()=>Te,when:()=>LG,whileLoop:()=>uu,withErrorReporting:()=>CG,withExecutionPlan:()=>IG,withFiber:()=>Pf,withLogSpan:()=>ZJ,withLogger:()=>VJ,withParentSpan:()=>TJ,withSpan:()=>IJ,withSpanScoped:()=>CJ,withTracer:()=>pJ,withTracerEnabled:()=>mJ,withTracerTiming:()=>hJ,yieldNow:()=>Db,yieldNowWith:()=>rG,zip:()=>$R,zipWith:()=>UR});function s4(e,t){for(let[n,{value:r}]of t.journal){if(r!==n.value)n.version=n.version+1,n.value=r;for(let o of n.pending.values())e.currentDispatcher.scheduleTask(o,0);n.pending.clear()}}function PR(e){e.retry=!1,e.journal.clear()}var W3,zn,FR,K3,V3,G3,J3,Z3,Oa,Y3,uu,MR,lu,v,Aa,Mb,Ne,Se,Te,Q3,yn,sh,X3,eG,tG,nG,qt,A,Nb,fu,Ei,ko,Nt,Db,rG,Pf,$b,oG,sG,iG,ne,NR,hr,du,ih,aG,bi,oe,gr,DR,Ff,cG,$R,UR,Pr,gs,Ub,uG,lG,fG,xr,Lb,dG,Mf,pG,mG,hG,Pt,gG,Fr,jb,xG,ah,yG,SG,LR,EG,bG,wG,vG,Nf,kG,IG,CG,TG,OG,AG,_G,Bb,jR,ch,RG,BR,PG,FG,_a,Hb,MG,HR,NG,DG,$G,UG,LG,wi,jG,BG,HG,qG,qb,uh,zG,WG,lh,qR,zb,xs,KG,zR,fh,VG,GG,JG,Io,Wb,Df,vi,Kb,Mr,ZG,WR,dh,pu,mu,YG,QG,KR,ys,XG,eJ,tJ,nJ,rJ,hu,oJ,VR,$f,Uf,sJ,iJ,Co,aJ,cJ,uJ,lJ,fJ,GR,dJ,pJ,mJ,hJ,gJ,xJ,yJ,SJ,EJ,bJ,wJ,JR,vJ,kJ,IJ,CJ,TJ,OJ,AJ,Vb,gu,xu,_J,RJ,PJ,FJ,To,Lf,MJ,NJ,ZR,YR,ph,DJ,$J,UJ,ki,LJ,H,jJ,jf,QR,BJ,HJ,qJ,mh,zJ,WJ,KJ,VJ,GJ,JJ,ZJ,YJ,QJ,XJ,e4,t4,Rf,n4=(e)=>Pf((t)=>{let n=Yp(t.context,Rf);if(n)return e;n={journal:new Map,retry:!1};let r;return Uf((o)=>ne(uu({while:()=>!r,body:gt(o(e).pipe(Io(Rf,n),ah(()=>{if(!n.retry)return Te;return o(o4(n))}),bi)),step(s){if(n.retry||!r4(n))return PR(n);if(Rt(s))s4(t,n);else PR(n);r=s}}),()=>r))}),r4=(e)=>{for(let[t,{version:n}]of e.journal)if(t.version!==n)return!1;return!0},o4=(e)=>Ne(()=>{let t={},n=Array.from(e.journal.keys()),r=()=>{for(let o of n)o.pending.delete(t)};return yn((o)=>{let s=()=>{r(),o(Te)};for(let i of n)i.pending.set(t,s);return Se(r)})}),i4,ot=(e,t,n)=>(...r)=>yn((o)=>{try{e(...r,(s,i)=>{if(s)o(A(t?t(s,r):s));else o(v(i))})}catch(s){o(n?A(n(s,r)):ko(s))}}),a4=()=>(e)=>e,c4=()=>(e)=>e,u4=()=>(e)=>e,Ss,Ra,Jt,on,Bf,hh;var Oe=w(()=>{Ve();ai();dr();X();rt();ht();bR();Ob();AR();Rb();RR();tb();Qi();W3=xo,zn=fe,FR=cf,K3=RE,V3=dA,G3=pA,J3=mA,Z3=gA,Oa=ar,Y3=yA,uu=Eo,MR=JS,lu=GT,v=L,Aa=xa,Mb=GS,Ne=ae,Se=pe,Te=ye,Q3=zE,yn=Bt,sh=Om,X3=kA,eG=IA,tG=TA,nG=CA,qt=QT,A=nt,Nb=Tm,fu=Be,Ei=KT,ko=mi,Nt=VT,Db=Qc,rG=VS,Pf=ce,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UJ=$E,ki=$A,LJ=Bm,H=YS,jJ=XT,jf=bo,QR=Xr,BJ=Xr(),HJ=Xr("Fatal"),qJ=Xr("Warn"),mh=Xr("Error"),zJ=Xr("Info"),WJ=Xr("Debug"),KJ=Xr("Trace"),VJ=p(2,(e,t)=>cs(e,qE,(n)=>new Set([...n,t]))),GJ=p((e)=>zn(e[0]),(e,...t)=>cs(e,v_,(n)=>{let r=t.length===1?{...n,...t[0]}:{...n};if(t.length===1)return r;else U(r,t[0],t[1]);return r})),JJ=d_,ZJ=p(2,(e,t)=>K(s_,(n)=>cs(e,k_,(r)=>[[t,n],...r]))),YJ=p((e)=>zn(e[0]),(e,t,n)=>ys(e,(r)=>{let o=n===void 0?r:Ae(()=>n(r));return cu(t,o)})),QJ=p((e)=>zn(e[0]),(e,t,n)=>du(e,(r)=>{let o=n===void 0?r:n(r);return cu(t,o)})),XJ=p((e)=>zn(e[0]),(e,t,n)=>jb(e,(r)=>{let o=n===void 0?r:Ae(()=>n(r));return cu(t,o)})),e4=p((e)=>zn(e[0]),(e,t,n)=>LR(e,(r)=>{let o=n===void 0?r:Ae(()=>n(r));return cu(t,o)})),t4=p((e)=>zn(e[0]),(e,t,n)=>jf((r)=>{let o=r.monotonicTimeNanosUnsafe();return ys(e,()=>{let s=r.monotonicTimeNanosUnsafe(),i=ZC(sr(s),sr(o)),a=n===void 0?i:Ae(()=>n(i));return cu(t,a)})}));Rf=class Rf extends ze()("effect/Effect/Transaction"){};i4=ne(Rf,(e)=>(e.retry=!0,hu)),Ss=aO,Ra=cO,Jt=uO,on=sO,Bf=lO,hh=eO});var l4=(e,t)=>{if(Rt(e))return t(0);if(hf(e.cause))return t(130);return t(f4(nu(e.cause)))},XR=(e)=>p((t)=>zn(t[0]),(t,n)=>{let r=n?.disableErrorReporting===!0?To(t):To(ah(t,(s)=>{if(hf(s))return Te;return d4(nu(s))?mh(s):Te}));try{let s=globalThis.setInterval(Vo,2147483647);r.addObserver(()=>{clearInterval(s)})}catch{}let o=n?.teardown??l4;return e({fiber:r,teardown:o})}),gh="~effect/Runtime/errorExitCode",f4=(e)=>{if(typeof e==="object"&&e!==null&&gh in e){let t=e[gh];if(typeof t==="number")return t}return 1},Pa="~effect/Runtime/errorReported",d4=(e)=>{if(typeof e==="object"&&e!==null&&Pa in e){let t=e[Pa];if(typeof t==="boolean")return t}return!0};var xh=w(()=>{rn();Oe();dr();X()});var eP;var tP=w(()=>{xh();eP=XR(({fiber:e,teardown:t})=>{let n=!1;e.addObserver((o)=>{process.removeListener("SIGINT",r),process.removeListener("SIGTERM",r),t(o,(s)=>{if(n||s!==0)process.exit(s)})});function r(){n=!0,e.interruptUnsafe(e.id)}process.on("SIGINT",r),process.on("SIGTERM",r)})});var yh={};Un(yh,{runMain:()=>m4});var m4;var nP=w(()=>{tP();m4=eP});var rP="~effect/platform/PlatformError",Es,oP,Jb,Nr=(e)=>new Jb(new oP(e)),bs=(e)=>new Jb(new Es(e));var Oo=w(()=>{Wc();Es=class Es extends ci("BadArgument"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:""}`}};oP=class oP extends bS{get message(){return`${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor!==void 0?` (${this.pathOrDescriptor})`:""}${this.description?`: ${this.description}`:""}`}};Jb=class Jb extends ci("PlatformError"){constructor(e){if("cause"in e)super({reason:e,cause:e.cause});else super({reason:e})}[rP]=rP;get message(){return this.reason.message}}});function g4(e,t,n,r,o){for(let s=t;s<Math.min(e.length,t+o);s++)n[r+s-t]=e[s];return n}var sP="~effect/collections/Chunk",iP,Yb=(e)=>Kt((t,n)=>t.length===n.length&&Hf(t).every((r,o)=>e(r,qf(n,o)))),x4,y4,Qb=(e)=>{let t=Object.create(y4);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=ws,t.right=ws;break}case"ISingleton":{t.length=1,t.depth=0,t.left=ws,t.right=ws;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=ws,t.right=ws;break}}return t},Eh=(e)=>M(e,sP),ws,S4=()=>ws,E4=(e)=>Qb({_tag:"ISingleton",a:e}),bh=(e)=>Eh(e)?e:w4(Lt(e)),Zb=(e,t,n)=>{switch(e.backing._tag){case"IArray":{g4(e.backing.array,0,t,n,e.length);break}case"IConcat":{Zb(e.left,t,n),Zb(e.right,t,n+e.left.length);break}case"ISingleton":{t[n]=e.backing.a;break}case"ISlice":{let r=0,o=n;while(r<e.length)t[o]=qf(e,r),r+=1,o+=1;break}}},b4=(e)=>{switch(e.backing._tag){case"IEmpty":return iP;case"IArray":return e.backing.array;default:{let t=Array(e.length);return Zb(e,t,0),e.backing={_tag:"IArray",array:t},e.left=ws,e.right=ws,e.depth=0,t}}},Hf,w4=(e)=>e.length===0?S4():e.length===1?E4(e[0]):Qb({_tag:"IArray",array:e}),qf,aP=(e)=>e.length;var cP=w(()=>{An();yt();Xo();kn();X();Xt();jn();Qe();he();iP=[],x4=Yb(Y),y4={[sP]:{_A:(e)=>e},toString(){return`Chunk(${B(Hf(this))})`},toJSON(){return{_id:"Chunk",values:Wt(Hf(this))}},[At](){return this.toJSON()},[Ce](e){return Eh(e)&&x4(this,e)},[Ie](){return vc(Hf(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return iP[Symbol.iterator]();default:return Hf(this)[Symbol.iterator]()}},pipe(){return le(this,arguments)}},ws=Qb({_tag:"IEmpty"}),Hf=b4,qf=p(2,(e,t)=>{let n=Math.floor(t);switch(e.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${n}`);case"ISingleton":{if(t!==0)throw Error(`Index out of bounds: ${n}`);return e.backing.a}case"IArray":{if(n>=e.length||n<0)throw Error(`Index out of bounds: ${n}`);return e.backing.array[n]}case"IConcat":return n<e.left.length?qf(e.left,n):qf(e.right,n-e.left.length);case"ISlice":return qf(e.backing.chunk,n+e.backing.offset)}})});var uP,lP;var fP=w(()=>{ht();uP=Cm,lP=PA});var dP;var pP=w(()=>{ht();dP=UE});var mP="~effect/MutableRef",C4,hP=(e)=>{let t=Object.create(C4);return t.current=e,t};var gP=w(()=>{jn();rt();C4={[mP]:mP,...Cn,toJSON(){return{_id:"MutableRef",current:Wt(this.current)}}}});var O4,yP=()=>({head:void 0,tail:void 0,length:0}),xP=()=>({array:[],mutable:!0,offset:0,next:void 0}),vs=(e,t)=>{if(!e.tail)e.head=e.tail=xP();else if(!e.tail.mutable)e.tail.next=xP(),e.tail=e.tail.next;e.tail.array.push(t),e.length++},yu=(e)=>{e.head=e.tail=void 0,e.length=0},SP=(e,t)=>{if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let s=e.head.array;return yu(e),s}let n=Array(t),r=0,o=e.head;while(o){while(o.offset<o.array.length){if(n[r++]=o.array[o.offset],o.mutable)o.array[o.offset]=void 0;if(o.offset++,r===t){if(e.head=o,e.length-=t,e.length===0)yu(e);return n}}o=o.next}return yu(e),n},Su=(e)=>{if(!e.head)return O4;let t=e.head.array[e.head.offset];if(e.head.mutable)e.head.array[e.head.offset]=void 0;if(e.head.offset++,e.length--,e.head.offset===e.head.array.length)if(e.head.next)e.head=e.head.next;else yu(e);return t};var EP=w(()=>{O4=Symbol.for("effect/MutableList/Empty")});var _4="~effect/Queue",R4="~effect/Queue/Enqueue",P4="~effect/Queue/Dequeue",Xb,F4,bu=(e)=>ce((t)=>{let n=Object.create(F4);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??Number.POSITIVE_INFINITY,n.strategy=e?.strategy??"suspend",n.messages=yP(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},L(n)}),bP=(e)=>bu({capacity:e}),zf=(e,t)=>ae(()=>{if(e.state._tag!=="Open")return vh;else if(e.messages.length>=e.capacity)switch(e.strategy){case"dropping":return vh;case"suspend":if(e.capacity<=0&&e.state.takers.size>0)return vs(e.messages,t),tw(e),wh;return U4(e,t);case"sliding":return Su(e.messages),vs(e.messages,t),wh}return vs(e.messages,t),CP(e),wh}),Wf=(e,t)=>{if(e.state._tag!=="Open")return!1;else if(e.messages.length>=e.capacity){if(e.strategy==="sliding")return Su(e.messages),vs(e.messages,t),!0;else if(e.capacity<=0&&e.state.takers.size>0)return vs(e.messages,t),tw(e),!0;return!1}return vs(e.messages,t),CP(e),!0},Kf,Vf=(e,t)=>{if(e.state._tag!=="Open")return!1;let n=pn(t),r=yO(n,N4);if(e.state.offers.size===0&&e.messages.length===0)return nw(e,r),!0;return e.state={...e.state,_tag:"Closing",exit:r},!0},ks=(e)=>Vf(e,Ol(Rc())),ew=(e)=>pe(()=>{if(e.state._tag==="Done")return!0;yu(e.messages);let t=e.state.offers;if(nw(e,e.state._tag==="Open"?D4:e.state.exit),t.size>0){for(let n of t)if(n._tag==="Single")n.resume(vh);else n.resume(je(n.remaining.slice(n.offset)));t.clear()}return!0}),wP=(e)=>vP(e,1,Number.POSITIVE_INFINITY),vP=(e,t,n)=>ae(()=>$4(e,t,n)??Zr(TP(e),vP(e,1,n))),Is=(e)=>ae(()=>IP(e)??Zr(TP(e),Is(e))),kP=(e)=>ae(()=>{let t=IP(e);if(t===void 0)return L(O());if(t._tag==="Success")return L(_(t.value));return L(O())}),IP=(e)=>{if(e.state._tag==="Done")return e.state.exit;if(e.messages.length>0){let t=Su(e.messages);return Eu(e),je(t)}else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Eu(e),e.capacity=0;let t=Su(e.messages);return Eu(e),je(t)}return},M4=(e)=>e.state._tag==="Done"?0:e.messages.length,vh,wh,N4,D4,tw=(e)=>{if(e.scheduleRunning=!1,e.state._tag==="Done"||e.state.takers.size===0)return;for(let t of e.state.takers)if(e.state.takers.delete(t),t(Rn),e.messages.length===0)break},CP=(e)=>{if(e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0)return;e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>tw(e),0)},$4=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;else if(n<=0||t<=0)return je([]);else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Eu(e),e.capacity=0;let r=[Su(e.messages)];return Eu(e),je(r)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let r=SP(e.messages,n);return Eu(e),je(r)}},U4=(e,t)=>Bt((n)=>{if(e.state._tag!=="Open")return n(vh);let r={_tag:"Single",message:t,resume:n};return e.state.offers.add(r),pe(()=>{if(e.state._tag==="Open")e.state.offers.delete(r)})}),Eu=(e)=>{if(e.state._tag==="Done")return Tf(e.state.exit.cause);else if(e.state.offers.size===0){if(e.state._tag==="Closing"&&e.messages.length===0)return nw(e,e.state.exit),Tf(e.state.exit.cause);return!1}let t=e.capacity-e.messages.length;for(let n of e.state.offers)if(t===0)break;else if(n._tag==="Single")vs(e.messages,n.message),t--,n.resume(wh),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;vs(e.messages,n.remaining[n.offset]),t--}n.resume(je([])),e.state.offers.delete(n)}return!1},TP=(e)=>Bt((t)=>{if(e.state._tag==="Done")return t(e.state.exit);return e.state.takers.add(t),pe(()=>{if(e.state._tag!=="Done")e.state.takers.delete(t)})}),nw=(e,t)=>{if(e.state._tag==="Done")return;let n=e.state;e.state={_tag:"Done",exit:t};for(let r of n.takers)r(t);n.takers.clear();for(let r of n.awaiters)r(t);n.awaiters.clear()};var Gf=w(()=>{X();rt();rt();ht();EP();_e();Ca();Xb={_A:D,_E:D},F4={[_4]:Xb,[R4]:Xb,[P4]:Xb,...Cn,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:M4(this)}}},Kf=p(2,(e,t)=>pe(()=>Vf(e,t))),vh=je(!1),wh=je(!0),N4=kr(Rc()),D4=_m()});class _P{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=ae(()=>{if(this.free<e)return OP(this,e,t);return this.taken+=e,L(e)});return t}takeIfAvailable(e){return ae(()=>{if(this.free<e)return L(!1);return this.taken+=e,L(!0)})}releaseUnsafe(e,t){if(this.taken-=t,this.waiters.size>0)e.currentDispatcher.scheduleTask(()=>{for(let n of this.waiters){if(this.free<=0)break;n()}},0);return this.free}resize(e){return ce((t)=>{if(this.permits=e,this.free<0)return ye;return this.releaseUnsafe(t,0),ye})}release(e){return ce((t)=>L(this.releaseUnsafe(t,e)))}get releaseAll(){return ce((e)=>L(this.releaseUnsafe(e,this.taken)))}withPermits(e){return(t)=>Qr((n)=>{let r=ae(()=>{if(this.free<e){let o=OP(this,e,ye);return K(n(o),()=>r)}return this.taken+=e,ls(n(t),()=>{this.releaseUnsafe(pi(),e);return},!0)});return r})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return(t)=>Qr((n)=>{if(this.free<e)return xa;return this.taken+=e,ls(n(Xc(t)),()=>{this.releaseUnsafe(pi(),e);return},!0)})}}var AP=(e)=>new _P(e),OP=(e,t,n)=>Bt((r)=>{if(e.free>=t)return r(n);let o=()=>{if(e.free<t)return;e.waiters.delete(o),r(n)};return e.waiters.add(o),pe(()=>{e.waiters.delete(o)})});var RP=w(()=>{rt();ht()});var FP="~effect/Channel",PP=(e)=>M(e,FP),j4,Sn=(e)=>{let t=Object.create(j4);return t.transform=(n,r)=>xr(e(n,r),(o)=>v(fu(o))),t},MP=(e,t)=>Sn((n,r)=>ne(eo(e)(n,r),(o)=>t(o,r))),Ih=(e)=>Sn((t,n)=>e),NP=(e)=>Sn(H(function*(t,n){let r=yi(n),o=(i)=>pr(r,Eb(i)),s=yield*mu(e(t,n,r),o);return mu(s,o)})),eo=(e)=>e.transform,B4=(e,t,n)=>bu({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(du((r)=>Ef(e,ew(r))),du((r)=>gu(Sf(t(r),e),e))),DP=(e,t)=>Sn((n,r)=>oe(B4(r,e,t),wP)),$P=(e)=>Sn((t,n)=>Ne(()=>eo(e())(t,n))),UP,LP,rw,H4,jP,BP=()=>Sn((e,t)=>Se(()=>{let n="",r=!1,o=O();function s(c){let u=[];function l(f){if(n.length===0)u.push(f);else u.push(n+f),n=""}for(let f=0;f<c.length;f++){let d=c[f];if(d.length!==0){let m=0,g=d.indexOf("\r"),b=d.indexOf(`
|
|
26
|
-
|
|
27
|
-
`,
|
|
28
|
-
`,
|
|
29
|
-
|
|
30
|
-
`)
|
|
31
|
-
`);n=Cu(e)??Oi(nd(e.ast),e);break}default:n=SF(e);break}return t?`${n}
|
|
32
|
-
at ${t}`:n}function Cu(e){if(e._tag==="Pointer")return;if(e._tag==="Encoding")return Cu(e.issue);let n=(e._tag==="Filter"?e.filter.annotations:("annotations"in e)?e.annotations:e.ast.annotations)?.[e._tag==="MissingKey"?"messageMissingKey":e._tag==="UnexpectedKey"?"messageUnexpectedKey":"message"];if(typeof n==="string")return n}var od="~effect/SchemaIssue/Issue",$r,ww,vw,Ft,Da,$h,Et,ft,we,Tu,sd,kw,SF=(e)=>{let t=Cu(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return Oi(nd(e.ast),e);case"InvalidValue":{let n=Iw(e);if(n!==void 0)return Oi(n,e);let r=Dh(e);return r===void 0?"Expected a valid value":`Invalid data ${r}`}case"MissingKey":return"Missing key";case"UnexpectedKey":{let n=Dh(e);return n===void 0?"Expected no excess property":`Unexpected key with value ${n}`}case"Forbidden":return"Forbidden operation";case"OneOf":{let n=Dh(e);return n===void 0?"Expected exactly one member to match":`Expected exactly one member to match the input ${n}`}}},EF=(e)=>Cu(e.issue)??Cu(e),wF;var Ai=w(()=>{An();kn();Ti();Nh();he();$r=class $r{[od]=od;constructor(e,t){if(t?.reportInput===!0&&e!==Re)this.input=e}};ww=class ww extends $r{_tag="Filter";filter;issue;constructor(e,t,n,r){super(n,r);this.filter=e,this.issue=t}};vw=class vw extends $r{_tag="Encoding";ast;issue;constructor(e,t,n,r){super(n,r);this.ast=e,this.issue=t}};Ft=class Ft extends $r{_tag="Pointer";path;issue;constructor(e,t){super();this.path=e,this.issue=t}};Da=class Da extends $r{_tag="MissingKey";annotations;constructor(e){super();this.annotations=e}};$h=class $h extends $r{_tag="UnexpectedKey";ast;constructor(e,t,n){super(t,n);this.ast=e}};Et=class Et extends $r{_tag="Composite";ast;issues;constructor(e,t,n,r){super(n,r);this.ast=e,this.issues=t}};ft=class ft extends $r{_tag="InvalidType";ast;constructor(e,t,n){super(t,n);this.ast=e}};we=class we extends $r{_tag="InvalidValue";annotations;constructor(e,t,n){super(t,n);this.annotations=e}};Tu=class Tu extends $r{_tag="Forbidden";annotations;constructor(e,t,n){super(t,n);this.annotations=e}};sd=class sd extends $r{_tag="AnyOf";ast;issues;constructor(e,t,n,r){super(n,r);this.ast=e,this.issues=t}};kw=class kw extends $r{_tag="OneOf";ast;successes;constructor(e,t,n,r){super(n,r);this.ast=e,this.successes=t}};wF=y6()});function id(e){let t;for(let n of e.reasons){if(!ff(n)||!bw(n.error))return;t??=n.error}return t}function Os(e,t){let n=id(e);if(n===void 0)throw Error(t,{cause:e});return n}var Tw=w(()=>{rn();Ai()});var Ow,kF,IF,CF,TF,OF,Aw,_w,AF,_F,Uh,RF,Lh,Rw,ad,PF,FF,_i,jh,MF,NF,Bh;var Hh=w(()=>{eR();Ow=iu,kF=Ia,IF=H_,CF=q_,TF=z_,OF=cb,Aw=W_,_w=K_,AF=ka,_F=lb,Uh=G_,RF=J_,Lh=Z_,Rw=fb,ad=If,PF=db,FF=pb,_i=Y_,jh=Cf,MF=gb,NF=X_,Bh=yb});function S6(e){return new As((t,n)=>A(e(t,n)))}function Fw(e){return S6((t,n)=>{let r={message:e(t)};return Ee(t)?new Tu(r,t.value,n):new Tu(r)})}function DF(e){return e.run===$F.run}function ro(){return $F}function Mw(e){return new As((t,n)=>me(t)?Aa:e(t.value,n))}function ve(e){return qh(en(e))}function Vn(e){return Mw((t,n)=>e(t,n).pipe(Ss(_)))}function qh(e){return new As((t)=>v(e(t)))}function Nw(){return new As(()=>Aa)}function cd(e){return new As((t)=>{let n=ca(t,Le);return Ee(n)?v(n):Ss(e,_)})}function Ua(){return ve(globalThis.String)}function zh(){return ve(globalThis.Number)}function UF(){return ve(globalThis.BigInt)}function Dw(){return ve((e)=>new globalThis.Date(e))}function LF(){return ve(aR)}function jF(e){return Mw((t,n)=>Nt({try:()=>_(JSON.parse(t,e?.reviver)),catch:()=>new we({expected:"a valid JSON string"},t,n)}))}function BF(e){return Mw((t,n)=>Nt({try:()=>{let r=JSON.stringify(t,e?.replacer,e?.space);if(r===void 0)throw TypeError("Value cannot be represented as JSON");return _(r)},catch:()=>new we({expected:"a JSON-serializable value"},t,n)}))}function $w(){return ve(am)}function Wh(){return ve(fT)}function Kh(){return ve(pT)}function HF(){return Vn((e,t)=>Ra($b(Vc(e)),()=>new we({expected:"a valid Base64 string"},e,t)))}function qF(){return Vn((e,t)=>Bn(lT(e),{onFailure:()=>A(new we({expected:"a valid Base64 string"},e,t)),onSuccess:v}))}function zF(){return Vn((e,t)=>Bn(vS(e),{onFailure:()=>A(new we({expected:"a valid Base64Url string"},e,t)),onSuccess:v}))}function WF(){return Vn((e,t)=>Bn(dT(e),{onFailure:()=>A(new we({expected:"a valid Base64Url string"},e,t)),onSuccess:v}))}function KF(){return Vn((e,t)=>Bn(IS(e),{onFailure:()=>A(new we({expected:"a valid hexadecimal string"},e,t)),onSuccess:v}))}function VF(){return Vn((e,t)=>Bn(mT(e),{onFailure:()=>A(new we({expected:"a valid hexadecimal string"},e,t)),onSuccess:v}))}function GF(){return ve(encodeURIComponent)}function JF(){return Vn((e,t)=>{try{return v(globalThis.decodeURIComponent(e))}catch{return A(new we({expected:"a valid URI component"},e,t))}})}function Uw(){return Vn((e,t)=>et(Uh(e),{onNone:()=>A(new we({message:"Invalid DateTime input"},e,t)),onSome:(n)=>v(Lh(n))}))}function ZF(){return ve((e)=>eM(Array.from(e.entries())))}function YF(){return ve((e)=>{let t=new FormData;if(typeof e==="object"&&e!==null)E6(e).forEach(([r,o])=>{t.append(r,o)});return t})}function QF(){return ve((e)=>eM(Array.from(e.entries())))}function XF(){return ve((e)=>{if(typeof e==="object"&&e!==null)return new URLSearchParams(b6(e));return new URLSearchParams})}function v6(e){if(e==="")return[""];let t=e.replace(/\[(.*?)\]/g,".$1"),n=t.split("."),r=t.startsWith(".")?1:0;return n.slice(r).map((o)=>w6.test(o)?globalThis.Number(o):o)}function eM(e){let t={},n=new WeakSet;function r(o,s,i){let a=Object.hasOwn(o,s)?o[s]:void 0;if(n.has(a)&&Array.isArray(a)===i)return a;let c=i?[]:{};return n.add(c),U(o,s,c),c}return e.forEach(([o,s])=>{let i=v6(o),a=t;i.forEach((c,u)=>{let l=u===i.length-1;if(Array.isArray(a)&&c==="")if(l)a.push(s);else{let f=i[u+1],d=typeof f==="number"||f==="",m=a.length;a=r(a,m,d)}else if(l){let f=Object.hasOwn(a,c);if(f&&Array.isArray(a[c]))a[c].push(s);else if(f)U(a,c,[a[c],s]);else U(a,c,s)}else{let f=i[u+1];a=r(a,c,typeof f==="number"||f==="")}})}),t}function tM(e){return(t)=>{let n=[];function r(o,s){if(e(s))n.push([o,s]);else if(Array.isArray(s))if(s.every(e))s.forEach((a)=>{n.push([o,a])});else s.forEach((a,c)=>{r(`${o}[${c}]`,a)});else if(typeof s==="object"&&s!==null)for(let[i,a]of Object.entries(s))r(`${o}[${i}]`,a)}for(let[o,s]of Object.entries(t))r(o,s);return n}}var As,$F,E6,b6,w6;var Vh=w(()=>{Hh();Oe();cm();_e();Qe();he();gn();Ai();fR();As=class As extends Gi{run;constructor(e){super();this.run=e}map(e){return new As((t,n)=>this.run(t,n).pipe(Ss(en(e))))}compose(e){if(DF(this))return e;if(DF(e))return this;return new As((t,n)=>this.run(t,n).pipe(on((r)=>e.run(r,n))))}};$F=new As(v);E6=tM((e)=>typeof e==="string"||typeof Blob<"u"&&e instanceof Blob);b6=tM(Wr);w6=/^\d+$/});var nM,jw="~effect/BigDecimal",k6,Jh=(e)=>M(e,jw),Gn=(e,t)=>{let n=Object.create(k6);return n.value=e,n.scale=t,n},oM=(e,t)=>{if(e!==yr&&e%Gh===yr)throw RangeError("Value must be normalized");let n=Gn(e,t);return n.normalized=n,n},yr,I6,C6,Gh,sM,Bw=(e)=>{if(e.normalized===void 0)if(e.value===yr)e.normalized=sM;else{let t=`${e.value}`,n=0;for(let s=t.length-1;s>=0;s--)if(t[s]==="0")n++;else break;if(n===0)e.normalized=e;let r=BigInt(t.substring(0,t.length-n)),o=e.scale-n;e.normalized=oM(r,o)}return e.normalized},Ri,iM,_s,T6,O6,rM=(e)=>e.value===yr?0:e.value<yr?-1:1,A6=(e)=>e.value<yr?Gn(-e.value,e.scale):e,Hw,_6,aM=(e)=>{if(e==="")return _(sM);let t,n,r=e.search(/[eE]/);if(r!==-1){let c=e.slice(r+1);if(t=e.slice(0,r),n=Number(c),t===""||!Number.isSafeInteger(n)||!nM.test(c))return O()}else t=e,n=0;let o,s,i=t.search(/\./);if(i!==-1){let c=t.slice(0,i),u=t.slice(i+1);o=`${c}${u}`,s=u.length}else o=t,s=0;if(!nM.test(o))return O();let a=s-n;if(!Number.isSafeInteger(a))return O();return _(Gn(BigInt(o),a))},Ro=(e)=>{let t=Bw(e);if(Math.abs(t.scale)>=16)return R6(t);let n=t.value<yr,r=n?`${t.value}`.substring(1):`${t.value}`,o,s;if(t.scale>=r.length)o="0",s="0".repeat(t.scale-r.length)+r;else{let a=r.length-t.scale;if(a>r.length){let c=a-r.length;o=`${r}${"0".repeat(c)}`,s=""}else s=r.slice(a),o=r.slice(0,a)}let i=s===""?o:`${o}.${s}`;return n?`-${i}`:i},R6=(e)=>{if(P6(e))return"0e+0";let t=Bw(e),n=`${A6(t).value}`,r=n.slice(0,1),o=n.slice(1),s=`${cM(t)?"-":""}${r}`;if(o!=="")s+=`.${o}`;let i=o.length-t.scale;return`${s}e${i>=0?"+":""}${i}`},P6=(e)=>e.value===yr,cM=(e)=>e.value<yr,F6=(e)=>e.value>yr,qw=(e)=>Jh(e[0]),uM,zw,Ww;var Kw=w(()=>{yt();Xo();X();Xt();jn();_e();ia();Qe();he();nM=/^[+-]?\d+$/,k6={[jw]:jw,[Ie](){let e=Bw(this);return xt(re(e.value),Ln(e.scale))},[Ce](e){return Jh(e)&&_6(this,e)},toString(){return`BigDecimal(${Ro(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[At](){return this.toJSON()},pipe(){return le(this,arguments)}},yr=BigInt(0),I6=BigInt(1),C6=BigInt(-1),Gh=BigInt(10),sM=oM(yr,0),Ri=p(2,(e,t)=>{if(t>e.scale)return Gn(e.value*Gh**BigInt(t-e.scale),t);if(t<e.scale)return Gn(e.value/Gh**BigInt(e.scale-t),t);return e}),iM=p(2,(e,t)=>{if(t.value===yr)return e;if(e.value===yr)return t;if(e.scale>t.scale)return Gn(Ri(t,e.scale).value+e.value,e.scale);if(e.scale<t.scale)return Gn(Ri(e,t.scale).value+t.value,t.scale);return Gn(e.value+t.value,e.scale)}),_s=ts((e,t)=>{let n=rr(rM(e),rM(t));if(n!==0)return n;if(e.scale>t.scale)return Cr(e.value,Ri(t,e.scale).value);if(e.scale<t.scale)return Cr(Ri(e,t.scale).value,t.value);return Cr(e.value,t.value)}),T6=Uc(_s),O6=ti(_s),Hw=Kt((e,t)=>{if(e.scale>t.scale)return Ri(t,e.scale).value===e.value;if(e.scale<t.scale)return Ri(e,t.scale).value===t.value;return e.value===t.value}),_6=p(2,(e,t)=>Hw(e,t)),uM=p(qw,(e,t=0)=>{if(e.scale<=t)return e;return Gn(e.value/Gh**BigInt(e.scale-t),t)}),zw=p(qw,(e,t=0)=>{let n=uM(e,t);if(F6(e)&&T6(n,e))return iM(n,Gn(I6,t));return n}),Ww=p(qw,(e,t=0)=>{let n=uM(e,t);if(cM(e)&&O6(n,e))return iM(n,Gn(C6,t));return n})});class ld{_tag="Middleware";decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new ld(this.encode,this.decode)}}function M6(e){return M(e,ud)&&e[ud]===ud}function Sr(e){return new Pe(Vn(e.decode),Vn(e.encode))}function st(e){return new Pe(ve(e.decode),ve(e.encode))}function Yh(e){return new Pe(qh(e.decode),qh(e.encode))}function fM(){return new Pe(LF(),ro())}function Ou(){return N6}function bM(){return st({decode:Gy,encode:Jp})}function wM(){return st({decode:ns,encode:mn})}function vM(e){return st({decode:Tn,encode:e?.onNoneEncoding===null?Jp:mn})}function kM(){return Yh({decode:_,encode:aa})}function IM(){return Yh({decode:(e)=>e.pipe(ca(Le),_),encode:aa})}function _M(e){return new Pe(jF(e??{}),BF(e))}var ud="~effect/SchemaTransformation/Transformation",Pe,Zh=(e)=>{if(M6(e))return e;return new Pe(e.decode,e.encode)},N6,Au,Qh,Vw,dM,pM,mM,hM,D6=(e)=>fn(e)&&typeof e.message==="string",gM=(e)=>{let n=Object.hasOwn(e,"cause")?Error(e.message,{cause:yM(e.cause)}):Error(e.message);if(typeof e.name==="string"&&e.name!=="Error")n.name=e.name;if(typeof e.stack==="string")n.stack=e.stack;return n},$6=(e)=>{try{let t=Yi(e);return t===void 0?B(e):JSON.parse(t)}catch{return B(e)}},U6=(e,t,n)=>{let r={name:e.name,message:typeof e.message==="string"?e.message:""};if(t?.includeStack&&typeof e.stack==="string")r.stack=e.stack;if(!t?.excludeCause&&e.cause!==void 0)r.cause=n(e.cause);return r},xM=(e)=>{let t=new WeakSet,n=(r)=>{if(q0(r)){if(t.has(r))return"[Circular]";t.add(r);let o=U6(r,e,n);return t.delete(r),o}return $6(r)};return n},yM=(e)=>D6(e)?gM(e):e,SM=(e)=>st({decode:gM,encode:(t)=>xM(e)(t)}),EM=(e)=>st({decode:yM,encode:xM(e)}),Gw,Jw,Zw,CM,TM,OM,AM,RM,PM,FM,Yw,Qw,Xw,ev;var Xh=w(()=>{Kw();Hh();ai();Oe();kn();_e();he();Vh();Ai();Pe=class Pe{[ud]=ud;_tag="Transformation";decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new Pe(this.encode,this.decode)}compose(e){return new Pe(this.decode.compose(e.decode),e.encode.compose(this.encode))}};N6=new Pe(ro(),ro());Au=new Pe(zh(),Ua()),Qh=new Pe(UF(),Ua()),Vw=new Pe(Dw(),ve(Ly)),dM=new Pe(Dw(),ve((e)=>e.getTime())),pM=Sr({decode:(e,t)=>et(KC(e),{onNone:()=>A(new we({expected:"a valid Duration string"},e,t)),onSome:v}),encode:(e)=>v(globalThis.String(e))}),mM=Sr({decode:(e)=>v(Tr(e)),encode:(e,t)=>et(GC(e),{onNone:()=>A(new we({expected:"a Duration representable as a bigint"},e,t)),onSome:(n)=>v(n)})}),hM=st({decode:(e)=>ii(e),encode:(e)=>qc(e)});Gw=Sr({decode:(e,t)=>URL.canParse(e)?v(new URL(e)):A(new we({expected:"a valid URL string"},e,t)),encode:(e)=>v(e.href)}),Jw=Sr({decode:(e,t)=>{let n=aM(e);return me(n)?A(new we({expected:"a valid BigDecimal string"},e,t)):v(n.value)},encode:(e)=>v(Ro(e))}),Zw=new Pe(HF(),$w()),CM=new Pe(qF(),$w()),TM=new Pe(WF(),Wh()),OM=new Pe(VF(),Kh()),AM=new Pe(JF(),GF());RM=new Pe(ZF(),YF()),PM=new Pe(QF(),XF()),FM=st({decode:(e)=>ad(e),encode:(e)=>e.offset}),Yw=Sr({decode:(e,t)=>et(PF(e),{onNone:()=>A(new we({expected:"a valid IANA time zone"},e,t)),onSome:v}),encode:(e)=>v(e.id)}),Qw=Sr({decode:(e,t)=>et(FF(e),{onNone:()=>A(new we({expected:"a valid time zone"},e,t)),onSome:v}),encode:(e)=>v(_i(e))}),Xw=Sr({decode:(e,t)=>et(Uh(e),{onNone:()=>A(new we({expected:"a valid UTC DateTime string"},e,t)),onSome:(n)=>v(Lh(n))}),encode:(e)=>v(NF(e))}),ev=Sr({decode:(e,t)=>et(RF(e),{onNone:()=>A(new we({expected:"a valid Zoned DateTime string"},e,t)),onSome:v}),encode:(e)=>v(Bh(e))})});function Fi(e){return(t)=>t._tag===e}class dt{to;transformation;constructor(e,t){this.to=e,this.transformation=t}}class so{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}}function t1(e){switch(e._tag){case"String":case"Number":case"BigInt":return!0;case"Literal":case"TemplateLiteral":return!e.checks;case"Union":return!e.checks&&e.types.every(t1);default:return!1}}function NM(e){let t=globalThis.String(e.literal);return Ge(e,[new dt(new Er(t),new Pe(ve(()=>e.literal),ve(()=>t)))])}function rv(e,t){return e.some((n)=>n.annotations?.representation?.id===t||n._tag==="FilterGroup"&&rv(n.checks,t))}function La(e,t,n=ja){let r,o;function s(i){switch(i._tag){case"String":case"TemplateLiteral":return(r??=Object.keys(e)).filter((a)=>i.matchPart(a,n)!==void 0);case"Number":return(r??=Object.keys(e)).filter((a)=>i.matchKey(a,n)!==void 0);case"Symbol":return(o??=Object.getOwnPropertySymbols(e)).filter((a)=>i.matchKey(a,n)!==void 0);case"Union":return[...new Set(i.types.flatMap(s))];default:return[]}}return s(Iv(Jn(t)))}class ng{name;type;constructor(e,t){this.name=e,this.type=t}}function ov(e){switch(e._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return e.types.every(ov);default:return!1}}function q6(e){return ov(e)&&ov(Jn(e))}class rg{parameter;type;constructor(e,t){if(!q6(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,bt(t)&&!k1(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}function sv(e,t,n){if(n._tag==="Failure")return eg(e,e.ast,t.name,n);if(n===Dt)return;let r=n[ie];if(r!==Re){U(e.out,t.name,r);return}if(delete e.out[t.name],!bt(t.type)){let o=new Ft([t.name],new Da(t.type.context?.annotations));if(e.options.errors==="all"){if(e.issues)e.issues.push(o);else e.issues=[o];return}else return Rr(new Et(e.ast,[o],e.input,e.options))}}function xv(e,t){if(!e)return t;if(!t)return e;return[...e,...t]}function og(e,t,n){return new Mu(Reflect.ownKeys(e).map((r)=>new ng(r,e[r].ast)),[],n,t)}function pd(e){return e.ast}function yv(e,t=void 0){return new io(!1,e.map((n)=>n.ast),[],void 0,t)}function sg(e,t,n){return new Fn(e.map(pd),t,void 0,n)}function l1(e,t){if(e.encoding||t.some((s)=>s.encoding))throw Error("StructWithRest does not support encodings");let{propertySignatures:n,indexSignatures:r,checks:o}=e;for(let s of t)n=n.concat(s.propertySignatures),r=r.concat(s.indexSignatures),o=xv(o,s.checks);return new Mu(n,r,void 0,o)}function f1(e,t){if(e.encoding)throw Error("TupleWithRest does not support encodings");return new io(e.isMutable,e.elements,t,void 0,e.checks)}function d1(e){switch(e._tag){case"Null":return["null"];case"Undefined":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["string","number","boolean","symbol","bigint","object","array","function"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(d1)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Ru(e){switch(e._tag){default:return[];case"Declaration":{let t=e.annotations?.[td];return Array.isArray(t)?t:[]}case"Objects":return e.propertySignatures.flatMap((t)=>{let n=t.type;if(!bt(n)){if(_u(n))return[{key:t.name,literal:n.literal}];if(nv(n))return[{key:t.name,literal:n.symbol}]}return[]});case"Arrays":return e.elements.flatMap((t,n)=>{if(!bt(t)){if(_u(t))return[{key:n,literal:t.literal}];if(nv(t))return[{key:n,literal:t.symbol}]}return[]});case"Union":{if(e.types.length===0)return[];let t=e.types.map((n)=>Ru(ig(n)));return t[0].filter((n)=>t.every((r)=>r.some((o)=>o.key===n.key&&o.literal===n.literal)))}case"Suspend":return Ru(e.thunk())}}function z6(e){let t=$M.get(e);if(t)return t;let n,r=0,o,s,i=!0;for(let a=0;a<e.length;a++){let c=e[a],u=ig(c);if(L6(u))continue;if(i)if(_u(u)||nv(u)){s??=new Map;let f=_u(u)?u.literal:u.symbol,d=s.get(f);if(!d)s.set(f,d=[]);d.push(c)}else i=!1;let l=Ru(u);if(l.length){n??=new Map,r++;for(let{key:f,literal:d}of l){let m=n.get(f);if(!m)n.set(f,m=[new Map,new Set]);m[1].add(a);let g=m[0].get(d);if(!g)m[0].set(d,g=new Set);g.add(a)}}else{o??={};let f=d1(u);for(let d of f)(o[d]??=[]).push(a)}}if(i&&s)s.forEach(Object.freeze),t=(a)=>s.get(a)??fd;else if(n?.size===1&&!o){let[a,[c]]=n.entries().next().value,u=c;for(let[l,f]of c)u.set(l,Object.freeze(Array.from(f,(d)=>e[d])));t=(l,f)=>{if(vl(l)){let d=Object.hasOwn(l,a)?l[a]:void 0;if(d!==void 0)return u.get(d)??fd;if(f)return e}return fd}}else if(n){let a;for(let c of n)if((!a||c[1][0].size>a[1][0].size)&&c[1][1].size===r)a=c;t=(c,u)=>{let l=c===null?"null":Array.isArray(c)?"array":typeof c,f=o?.[l]??fd;if(!vl(c))return f.map((g)=>e[g]);let d=new Set(f),m;if(a){let[g,[b]]=a,x=Object.hasOwn(c,g),I=x?c[g]:void 0;if(x&&(!u||I!==void 0)){let C=b.get(I);if(!C)return f.map((S)=>e[S]);for(let S of C)d.add(S);m=g}}if(m===void 0)for(let[g,[b,x]]of n){let I=Object.hasOwn(c,g),C=I?c[g]:void 0;if(I&&(!u||C!==void 0)){let S=b.get(C);if(S)for(let y of S)d.add(y)}else if(u)for(let S of x)d.add(S)}for(let[g,[b,x]]of n){if(g===m)continue;let I=Object.hasOwn(c,g),C=I?c[g]:void 0;if(I&&(!u||C!==void 0)){let S=b.get(C);for(let y of d)if(x.has(y)&&!S?.has(y))d.delete(y)}}return Array.from(d).sort((g,b)=>g-b).map((g)=>e[g])}}else t=(a)=>{let c=a===null?"null":Array.isArray(a)?"array":typeof a;return(o?.[c]??fd).map((u)=>e[u]).filter(W6(a))};return $M.set(e,t),t}function W6(e){return(t)=>{let n=ig(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function md(e,t,n=!1){return z6(t)(e,n)}function UM(e,t,n,r){let o=id(t);if(!o)return lr(t);return Rr(new sd(e,[o],n,r))}function LM(e){return e?"":"readonly "}function jM(e){return e?"?":""}function Ha(e){let t=!1,n;return()=>{if(t)return n;return n=e(),t=!0,n}}function cg(e,t,n=!1){return new dd((r,o,s)=>yF(o,e(r,o,s),r,s),t,n)}function ug(e,t){return new dd((n,r,o)=>e(n)?void 0:new we(void 0,n,o),t,!0)}function Sv(e){return cg((t)=>globalThis.Number.isFinite(t),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}function hd(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return cg((o)=>(r.lastIndex=0,r.test(o)),{expected:`a string matching the RegExp ${n}`,representation:{id:"effect/schema/isPattern",payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function gd(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function bv(e){return m1.get(e)??e}function Ge(e,t){if(e.encoding===t)return e;return gd(e,(n)=>{n.encoding.value=t})}function xd(e,t){if(e.context===t)return e;let n=bv(e);if(n.context===t)return n;let r=gd(e,(o)=>{o.context.value=t});return m1.set(r,n),r}function yd(e){return e.encoding?yd(e.encoding[e.encoding.length-1].to):e}function Ur(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return lg(e,lS(e.checks.slice(0,-1),n.annotate(t)))}return gd(e,(n)=>{n.annotations.value={...n.annotations.value,...t}})}function lg(e,t){if(e._tag==="Suspend"&&t)throw Error("Cannot add checks to Suspend");if(e.checks===t)return e;return gd(e,(n)=>{n.checks.value=t})}function Fo(e,t){return lg(e,xv(e.checks,t))}function Nu(e,t){let n=t(e.to);return n===e.to?e:new dt(n,e.transformation)}function h1(e,t){let n=e,r=n[n.length-1],o=Nu(r,t);return o===r?e:lS(e.slice(0,e.length-1),o)}function wv(e){return(t)=>t.encoding?Ge(t,h1(t.encoding,e)):t}function fg(e,t){return wv((n)=>xd(n,t))(e)}function qa(e,t){function n(r){if(r.encoding){let o=r.encoding[r.encoding.length-1];return t?.stopAt?.(o)?r:Ge(r,h1(r.encoding,n))}return e(r)}return Ji(n)}function g1(e,t){return vv(e,t,sn(e))}function x1(e,t){return vv(Jn(e),t,e)}function vv(e,t,n){let r=new dt(e,t);return Ge(n,n.encoding?[...n.encoding,r]:[r])}function y1(e,t){let n=hF(e),r=n?[...n,t]:[t];return Ur(e,{brands:r})}function Pu(e,t){let n=!1,r=Array(e.length);for(let o=0;o<e.length;o++){let s=e[o],i=t(s);if(i!==s)n=!0;r[o]=i}return n?r:e}function Sd(e,t){let n=e.context?new so(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new so(!1,!1,void 0,t);return xd(e,n)}function E1(e,t){let n=new Pe(cd(t),ro()),r=new dt(Rs,n),o=e.context?new so(e.context.isOptional,e.context.isMutable,r,e.context.annotations):new so(!1,!1,r);return xd(e,o)}function dg(e,t,n){return vv(e,n,t)}function Z6(e){let t=[],n=[];function r(o){switch(o._tag){case"Literal":if(Ap(o.literal))t.push(o.literal);return;case"UniqueSymbol":t.push(o.symbol);return;case"Never":return;case"Union":for(let s=0;s<o.types.length;s++)r(o.types[s]);return;default:n.push(o)}}return r(e),{literals:t,parameters:n}}function b1(e,t){let{literals:n,parameters:r}=Z6(e);return new Mu(n.map((o)=>new ng(o,t)),r.map((o)=>new rg(o,t)))}function bt(e){return e.context?.isOptional??!1}function w1(e){return e.context?.isMutable??!1}function v1(e){return e.annotations?.[Wn]===!0||e._tag==="FilterGroup"&&e.checks.every(v1)}function Y6(e){function t(r){if(v1(r))return[r];return r._tag==="FilterGroup"?r.checks.flatMap(t):[]}let n=e.flatMap(t);return la(n)?n:void 0}function Q6(e,t){let n=t,r=n.length,o=n[r-1],s=[new dt(oo(Ge(e,void 0)),n[0].transformation.flip())];for(let a=1;a<r;a++)s.unshift(new dt(oo(n[a-1].to),n[a].transformation.flip()));let i=oo(o.to);if(i.encoding)return Ge(i,[...i.encoding,...s]);else return Ge(i,s)}function k1(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(k1);default:return!1}}function pg(e,t){let n=Dr(t);return(r,o)=>{if(r===Re)return no;if(r===t)return n;return A(new ft(e,r,o))}}function ao(e,t){return(n,r)=>{if(n===Re)return no;if(t(n))return Dt;return A(new ft(e,n,r))}}function BM(e,t,n){let{encodedParts:r,literals:o}=e,s=t.length;for(let u=0;u<o.length;u++){let l=o[u];if(l&&!t.includes(l))return}if(e.suffixLengths[0]>s)return;let i=Array(r.length),a;function c(u,l){if(u===r.length)return l===s;if(a?.has(u*(s+1)+l))return!1;let f=r[u];if(u===r.length-1){let d=t.slice(l);if(f.matchPart(d,n)!==void 0)return i[u]=d,!0}else if(f._tag==="Literal"){let d=o[u];if(t.startsWith(d,l)&&c(u+1,l+d.length))return i[u]=d,!0}else{let d=s-e.suffixLengths[u+1],m=o[u+1],g=m===void 0?d:t.lastIndexOf(m,d);while(g>=l){let b=t.slice(l,g);if(f.matchPart(b,n)!==void 0&&c(u+1,g))return i[u]=b,!0;if(g===0)break;g=m===void 0?g-1:t.lastIndexOf(m,g-1)}}return a??=new Set,a.add(u*(s+1)+l),!1}return c(0,0)?i:void 0}function Cv(e){return hd(iv,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:iv.source}),...e})}function Tv(e){return hd(av,{expected:"a string representing a bigint",representation:{id:"effect/schema/isStringBigInt",payload:null},toJsonSchema:()=>({pattern:av.source}),...e})}function Av(e){return hd(cv,{expected:"a string representing a symbol",representation:{id:"effect/schema/isStringSymbol",payload:null},toJsonSchema:()=>({pattern:cv.source}),...e})}function co(e,t,n,r,o){for(let s=0;s<e.length;s++){let i=e[s];if(i._tag==="FilterGroup"){if(n=co(i.checks,t,n,r,o),n&&(o.errors!=="all"||n[n.length-1].filter.aborted))return n}else{let a=i.run(t,r,o);if(a){let c=new ww(i,a,t,o);if(n)n.push(c);else n=[c];if(o.errors!=="all"||i.aborted)return n}}}return n}function _1(e,t){let n=co(e,t,void 0,Rs,{errors:"all"});if(n){let r=new Et(Rs,n);return te(r)}return G(t)}function R1(e){if(!Mi(e))return;let t=e.annotations?.[Fh];return ln(t)?t(e.typeParameters):void 0}function i5(e){return e===null||typeof e==="string"||typeof e==="boolean"||typeof e==="number"&&globalThis.Number.isFinite(e)}function a5(e){return e===void 0||typeof e==="string"}function P1(e,t){let n=new WeakMap,r=[];e:while(!0){if(typeof e!=="object"||e===null){if(!t(e))return!1}else{let o=e,s=n.get(o);if(s===!1)return!1;if(s===void 0){let i=Array.isArray(o);if(!i){let a=Object.getPrototypeOf(o);if(a!==null&&a!==Object.prototype&&Object.getPrototypeOf(a)!==null)return!1}n.set(o,!1),r.push({value:o,keys:i?o.length:Object.keys(o),index:0})}}while(r.length>0){let o=r[r.length-1],s=o.keys;if(typeof s==="number"){if(o.index<s){e=o.value[o.index++];continue e}}else if(o.index<s.length){e=o.value[s[o.index++]];continue e}n.set(o.value,!0),r.pop()}return!0}}function $u(e){return P1(e,i5)}function c5(e){return P1(e,a5)}var Mi,L6,_u,nv,uv,j6,HM,B6,ja,MM="~effect/Schema",wt,Ba,qM,lv,zM,WM,fv,KM,VM,GM,JM,ZM,YM,QM,Rs,XM,e1,dv,pv,mv,Er,n1,Po,r1,hv,o1,s1,i1,a1,c1,u1,io,H6,gv=(e)=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),eg=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let o=id(r.cause);if(o===void 0)return lr(ms(r.cause,(i)=>new Et(t,[new Ft([n],i)],e.input,e.options)));let s=new Ft([n],o);if(e.options.errors==="all")if(e.issues)e.issues.push(s);else e.issues=[s];else return Rr(new Et(t,[s],e.input,e.options))},tg="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",Mu,DM,ig,$M,fd,Fn,K6,p1,ag,dd,Pi,Ev,V6,m1,Du,G6,S1,kv,J6,sn,Jn,oo,I1,Iv,mg,C1,T1="[\\s\\S]*?",iv,X6,O1,e5,t5,n5="-?\\d+",av,Ov,r5,o5="Symbol\\((.*)\\)",cv,s5,A1,Fu,F1,_v,M1,u5,Rv;var Ps=w(()=>{An();rn();Oe();dr();kn();X();ht();Ti();Tw();Nh();Qe();he();gn();Vh();Ai();Xh();Mi=Fi("Declaration"),L6=Fi("Never"),_u=Fi("Literal"),nv=Fi("UniqueSymbol"),uv=Fi("Arrays"),j6=Fi("Objects"),HM=Fi("Union"),B6=Fi("Suspend");ja={};wt=class wt{[MM]=MM;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}};Ba=class Ba extends wt{_tag="Declaration";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,o,s,i,a){super(n,r,o,s);this.typeParameters=e,this.run=t,this.encodingChecks=i,this.encodingRun=a}getParser(){let e;return(t,n)=>{if(t===Re)return no;return(e??=this.run(this.typeParameters))(t,this,n)}}_rebuild(e,t,n,r,o){let s=Pu(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&o===this.encodingRun?this:new Ba(s,r,this.annotations,t,void 0,this.context,n,o)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;if(typeof e==="string")return e;return"<Declaration>"}};qM=class qM extends wt{_tag="Null";getParser(){return pg(this,null)}getExpected(){return"null"}};lv=new qM;zM=class zM extends wt{_tag="Undefined";getParser(){return pg(this,void 0)}toCodecJson(){return Ge(this,[WM])}getExpected(){return"undefined"}};WM=new dt(lv,new Pe(ve(()=>{return}),ve(()=>null))),fv=new zM;KM=class KM extends wt{_tag="Void";getParser(){let e=Dr(void 0);return(t)=>t===Re?no:e}toCodecJson(){return Ge(this,[WM])}getExpected(){return"void"}};VM=new KM;GM=class GM extends wt{_tag="Never";getParser(){return ao(this,H0)}getExpected(){return"never"}};JM=new GM;ZM=class ZM extends wt{_tag="Any";getParser(){return ao(this,Ty)}getExpected(){return"any"}};YM=new ZM;QM=class QM extends wt{_tag="Unknown";getParser(){return ao(this,Ty)}getExpected(){return"unknown"}};Rs=new QM;XM=class XM extends wt{_tag="ObjectKeyword";getParser(){return ao(this,vl)}getExpected(){return"object | array | function"}};e1=new XM;dv=class dv extends wt{_tag="Enum";enums;constructor(e,t,n,r,o){super(t,n,r,o);this.enums=e}getParser(){let e=new Set(this.enums.map(([,t])=>t));return ao(this,(t)=>e.has(t))}toCodecStringTree(){if(this.enums.some(([e,t])=>typeof t==="number")){let e=Object.fromEntries(this.enums.map(([t,n])=>[globalThis.String(n),n]));return Ge(this,[new dt(new Fn(Object.keys(e).map((t)=>new Er(t)),"anyOf"),new Pe(ve((t)=>e[t]),Ua()))])}return this}getExpected(){return this.enums.map(([e,t])=>JSON.stringify(t)).join(" | ")}};pv=class pv extends wt{_tag="TemplateLiteral";parts;encodedParts;literals;suffixLengths;constructor(e,t,n,r,o){super(t,n,r,o);let s=[],i=[];for(let c of e){let u=Jn(c);if(t1(u))s.push(u),i.push(u._tag==="Literal"?globalThis.String(u.literal):void 0);else throw Error(`Invalid TemplateLiteral part ${u._tag}`)}let a=Array(s.length+1);a[s.length]=0;for(let c=s.length-1;c>=0;c--)a[c]=a[c+1]+(i[c]?.length??0);this.parts=e,this.encodedParts=s,this.literals=i,this.suffixLengths=a}getParser(e){let t=e(this.asTemplateLiteralParser());return(n,r)=>{if(n===Re)return no;let o=t(n,r);if(o._tag==="Success")return Dt;return Jt(o,{onSuccess:()=>n,onFailure:(s)=>new Et(this,[s],n,r)})}}getExpected(){return"string"}matchPart(e,t){return BM(this,e,t)===void 0?void 0:e}asTemplateLiteralParser(){let e=new io(!1,this.parts.map(C1),[]);return dg(Po,e,new Pe(Vn((t,n)=>{let r=BM(this,t,n);if(r)return v(r);return A(new we({expected:"a string matching template literal parts"},t,n))}),ve((t)=>t.join(""))))}};mv=class mv extends wt{_tag="UniqueSymbol";symbol;constructor(e,t,n,r,o){super(t,n,r,o);this.symbol=e}getParser(){return pg(this,this.symbol)}toCodecStringTree(){return Ge(this,[A1])}getExpected(){return globalThis.String(this.symbol)}};Er=class Er extends wt{_tag="Literal";literal;constructor(e,t,n,r,o){super(t,n,r,o);if(typeof e==="number"&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${B(e)}`);this.literal=e}getParser(){return pg(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==="bigint"?NM(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:NM(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};n1=class n1 extends wt{_tag="String";getParser(){return ao(this,Wr)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&co(n,e,void 0,this,t)?void 0:e}getExpected(){return"string"}};Po=new n1;r1=class r1 extends wt{_tag="Number";getParser(){return ao(this,bl)}matchKey(e,t){return this._match(X6,e,t)}matchPart(e,t){return this._match(iv,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);if(n.disableChecks||!this.checks)return r;return co(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){if(this.checks&&(rv(this.checks,"effect/schema/isFinite")||rv(this.checks,"effect/schema/isInt")))return this;return Ge(this,[V6])}toCodecStringTree(){if(this.toCodecJson()===this)return Ge(this,[e5]);return Ge(this,[t5])}getExpected(){return"number"}};hv=new r1;o1=class o1 extends wt{_tag="Boolean";getParser(){return ao(this,Op)}getExpected(){return"boolean"}};s1=new o1;i1=class i1 extends wt{_tag="Symbol";getParser(){return ao(this,Cy)}matchKey(e,t){if(t.disableChecks||!this.checks)return e;return co(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return Ge(this,[A1])}getExpected(){return"symbol"}};a1=new i1;c1=class c1 extends wt{_tag="BigInt";getParser(){return ao(this,j0)}matchPart(e,t){if(!av.test(e))return;let n=globalThis.BigInt(e);if(t.disableChecks||!this.checks)return n;return co(this.checks,n,void 0,this,t)?void 0:n}toCodecStringTree(){return Ge(this,[r5])}getExpected(){return"bigint"}};u1=new c1;io=class io extends wt{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,o,s,i,a){super(r,o,s,i);this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=a;let c=!1;for(let u=0;u<t.length;u++)if(bt(t[u]))c=!0;else if(c)throw Error("A required element cannot follow an optional element. ts(1257)");if(c&&n.length>1)throw Error("A required element cannot follow an optional element. ts(1257)");for(let u=1;u<n.length;u++)if(bt(n[u]))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(e,t=e){let n=this,r,o,s=n.elements.length,i=Math.max(0,n.rest.length-1);function a(c,u){if(u<s)return r[u];else if(u>=c)return o[u-c+1];return o[0]}return hh(function*(c,u){if(c===Re)return Re;if(!Array.isArray(c))return yield*A(new ft(n,c,u));if(!r)r=n.elements.map((g)=>({ast:g,parser:t(g)})),o=n.rest.map((g)=>({ast:g,parser:t(g)}));let l=c.length,f={ast:n,getParser:a,input:c,len:l,tailThreshold:Math.max(s,l-i),output:new globalThis.Array(l),issues:void 0,options:u},d=gv(u?.concurrency),m=H6(f,c,{concurrency:d?.concurrency,end:n.rest.length===0?s:Math.max(l,s+i)});if(m)yield*m;if(n.rest.length===0&&l>s)for(let g=s;g<=l-1;g++){let b=new $h(n,c[g],u),x=new Ft([g],b);if(u.errors==="all")if(f.issues)f.issues.push(x);else f.issues=[x];else return yield*A(new Et(n,[x],c,u))}if(f.issues)return yield*A(new Et(n,f.issues,c,u));return f.output})}_rebuild(e,t,n){let r=Pu(this.elements,e),o=Pu(this.rest,e);return r===this.elements&&o===this.rest&&t===this.checks&&n===this.encodingChecks?this:new io(this.isMutable,r,o,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return"array"}};H6=uf()({onItem(e,t,n){let r=n<e.len?t:Re;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag==="Failure")return eg(e,e.ast,r,n);let o=n===Dt?t:n[ie];if(o!==Re)e.output[r]=o;else{let s=e.getParser(e.tailThreshold,r);if(bt(s.ast))return;let i=new Ft([r],new Da(s.ast.context?.annotations));if(e.options.errors==="all")if(e.issues)e.issues.push(i);else e.issues=[i];else return Rr(new Et(e.ast,[i],e.input,e.options))}}});Mu=class Mu extends wt{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,o,s,i){super(n,r,o,s);this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=i;let a=e.map((c)=>c.name).filter((c,u,l)=>l.indexOf(c)!==u);if(a.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(a)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let x of n.propertySignatures)r.push(x.name);let o=r.length,s=n.indexSignatures.length,i=o&&s?new Set(r):void 0;if(!o&&!s)return ao(n,_p);let a,c,u=(x,I,C,S,y)=>{if(y._tag==="Failure")return eg(x,n,I,y)??fr;let h=y===Dt?S:y[ie];if(C!==Re&&h!==Re){if(o&&(i.has(I)||i.has(C)))return fr;U(x.out,C,h)}return fr},l=(x,I,C,S)=>{if(!S){let k=C.parserKey(I,x.options);if(!We(k))return ne(bi(k),(T)=>l(x,I,C,T));S=k}if(S._tag==="Failure")return eg(x,n,I,S)??fr;let y=S===Dt?I:S[ie],h=x.input[I],E=C.parserValue(h,x.options);return We(E)?u(x,I,y,h,E):ne(bi(E),(k)=>u(x,I,y,h,k))},f=(x,I,C)=>{let S=x.input[I],y=C.parserValue(S,x.options);return We(y)?u(x,I,I,S,y):ne(bi(y),(h)=>u(x,I,I,S,h))},d=s?uf()({onItem:(x,[I,C])=>l(x,I,C),step:(x,I,C)=>C._tag==="Failure"?C:void 0}):void 0,m=()=>{if(!a)a=n.propertySignatures.map((x)=>({parser:t(x.type),name:x.name,type:x.type})),c=s?n.indexSignatures.map((x)=>({is:x,parserKey:e(Iv(x.parameter)),parserValue:t(x.type)})):void 0;return a},g=hh(function*(x,I){if(x===Re)return Re;if(!(typeof x==="object"&&x!==null&&!Array.isArray(x)))return yield*A(new ft(n,x,I));m();let C=x,S={},y={ast:n,input:C,out:S,issues:void 0,options:I},h=I.errors==="all",E=I.onExcessProperty==="error",k=I.onExcessProperty==="preserve",T;if(!s&&(E||k)){i??=new Set(r),T=Reflect.ownKeys(C);for(let N=0;N<T.length;N++){let R=T[N];if(!i.has(R))if(E){let z=new $h(n,C[R],I),q=new Ft([R],z);if(h){if(y.issues)y.issues.push(q);else y.issues=[q];continue}else return yield*A(new Et(n,[q],x,I))}else U(S,R,C[R])}}let F=gv(I?.concurrency);if(o){let N=DM(y,a,F);if(N)yield*N}if(s&&!F)for(let N=0;N<s;N++){let R=c[N],z=R.is.parameter===Po?f:l,q=R.is.parameter===Po?Object.keys(C):La(C,R.is.parameter,I);for(let ue=0;ue<q.length;ue++){let ut=z(y,q[ue],R);if(!We(ut))yield*ut;else if(ut._tag==="Failure")return yield*ut}}else if(d){let N=fa();for(let z=0;z<s;z++){let q=c[z],ue=La(C,q.is.parameter,I);for(let ut=0;ut<ue.length;ut++)N.push([ue[ut],q])}let R=d(y,N,F);if(R)yield*R}if(y.issues)return yield*A(new Et(n,y.issues,x,I));if(I.propertyOrder==="original"){let N=(T??Reflect.ownKeys(C)).concat(r),R={};for(let z of N)if(Object.hasOwn(S,z))U(R,z,S[z]);return R}return S});if(s)return g;let b=(x,I,C)=>{let S=a[I];return ne(bi(C),(y)=>{let h=sv(x,S,y);if(h)return h;let E=()=>Dr(x.out),k=DM(x,a.slice(I+1));return k?on(k,E):E()})};return(x,I)=>{if(x===Re)return no;if(I.errors==="all"||I.onExcessProperty!==void 0||I.propertyOrder==="original"||I.concurrency!==void 0)return g(x,I);if(!(typeof x==="object"&&x!==null&&!Array.isArray(x)))return A(new ft(n,x,I));let C=m(),S=x,y={},h={ast:n,input:S,out:y,issues:void 0,options:I};try{for(let E=0;E<C.length;E++){let k=C[E],T=k.name,F=Object.hasOwn(S,T),N=F?S[T]:Re,R=k.parser(N,I);if(!We(R))return b(h,E,R);if(R===Dt){if(F)U(y,T,N);continue}let z=sv(h,k,R);if(z)return z}}catch(E){return ko(E)}return Dr(y)}}_rebuild(e,t,n,r){let o=Pu(this.propertySignatures,(i)=>{let a=e(i.type);return a===i.type?i:new ng(i.name,a)}),s=Pu(this.indexSignatures,(i)=>{let a=t(i.parameter),c=e(i.type);return a===i.parameter&&c===i.type?i:new rg(a,c)});return o===this.propertySignatures&&s===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Mu(o,s,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}};DM=uf()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(Re,e.options);let n=e.input[t.name];return U(e.out,t.name,n),t.parser(n,e.options)},step:sv});ig=Ji((e)=>{while(!0){if(B6(e))return Rs;let t=e.encoding;if(!t)return e.recur?.(ig,D)??e;if(t.some((n)=>n.transformation._tag==="Middleware"&&n.transformation.decode!==D))return Rs;e=t[t.length-1].to}});$M=new WeakMap,fd=Object.freeze([]);Fn=class Fn extends wt{_tag="Union";types;mode;encodingChecks;constructor(e,t,n,r,o,s,i){super(n,r,o,s);this.types=e,this.mode=t,this.encodingChecks=i}getParser(e,t){let n=this;return(r,o)=>{if(r===Re)return no;let s=md(r,n.types,t!==void 0);if(s.length===1){let u=e(s[0])(r,o);if(u._tag==="Success")return u;return We(u)?UM(n,u.cause,r,o):xr(u,(l)=>UM(n,l,r,o))}let i={ast:n,compile:e,input:r,out:void 0,successes:n.mode==="oneOf"?[]:void 0,issues:void 0,options:o},a=gv(o?.concurrency),c=K6(i,s,a?{...a,orderedStep:!0}:void 0);if(!c){if(i.out)return i.out;return A(new sd(n,i.issues??[],r,o))}return on(c,(u)=>{if(i.out===Dt)return v(r);if(i.out)return i.out;return A(new sd(n,i.issues??[],r,o))})}}_rebuild(e,t,n){let r=Pu(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new Fn(r,this.mode,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}return}getExpected(e){let t=this.annotations?.expected;if(typeof t==="string")return t;if(this.types.length===0)return"never";let n=this.types.map((r)=>{let o=Jn(r);switch(o._tag){case"Arrays":{let s=o.elements.filter(_u);if(s.length>0)return`${LM(o.isMutable)}[ ${s.map((i)=>e(i)+jM(i.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let s=o.propertySignatures.filter((i)=>_u(i.type));if(s.length>0)return`{ ${s.map((i)=>`${LM(i.type.context?.isMutable)}${Go(i.name)}${jM(i.type.context?.isOptional)}: ${e(i.type)}`).join(", ")}, ... }`;break}}return e(o)});return Array.from(new Set(n)).join(" | ")}};K6=uf()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag==="Failure"){let r=id(n.cause);if(r===void 0)return n;if(e.issues)e.issues.push(r);else e.issues=[r]}else{if(e.out&&e.successes)return e.successes.push(t),Rr(new kw(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return fr}}}),p1=new Fn([new Er("Infinity"),new Er("-Infinity"),new Er("NaN")],"anyOf");ag=class ag extends wt{_tag="Suspend";thunk;constructor(e,t,n,r,o){if(n)throw Error("Cannot add checks to Suspend");super(t,void 0,r,o);this.thunk=Ha(e)}getParser(e){let t;return(n,r)=>(t??=e(this.thunk()))(n,r)}recur(e){return new ag(()=>e(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}};dd=class dd extends Gi{_tag="Filter";run;annotations;aborted;constructor(e,t=void 0,n=!1){super();this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new dd(this.run,{...this.annotations,...e},this.aborted)}abort(){return new dd(this.run,this.annotations,!0)}and(e,t){return new Pi([this,e],t)}};Pi=class Pi extends Gi{_tag="FilterGroup";checks;annotations;constructor(e,t=void 0){super();this.checks=e,this.annotations=t}annotate(e){return new Pi(this.checks,{...this.annotations,...e})}and(e,t){return new Pi([this,e],t)}};Ev=Fo(hv,[Sv()]),V6=new dt(new Fn([Ev,p1],"anyOf"),new Pe(zh(),ve((e)=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));m1=new WeakMap;Du=Ji((e)=>{let t=e.context?e.context.isOptional===!1?new so(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new so(!0,!1);return G6(xd(e,t))}),G6=wv(Du),S1=Qt((e)=>Du(new Fn([e,fv],"anyOf"))),kv=Ji((e)=>{let t=e.context?e.context.isMutable===!1?new so(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new so(!1,!0);return J6(xd(e,t))}),J6=wv(kv);sn=Ji((e)=>{if(e.encoding)return sn(Ge(e,void 0));let t=e,n=t.recur?.(sn)??t,r=n.encodingChecks;if(r){let o=n===e?r:uv(n)||j6(n)||Mi(n)&&n.typeParameters.length>0?Y6(r):void 0;return gd(n,(s)=>{s.encodingChecks.value=void 0,s.checks.value=xv(n.checks,o)})}return n}),Jn=Ji((e)=>sn(oo(e)));oo=Qt((e)=>{if(e.encoding)return Q6(e,e.encoding);let t=e;return t.flip?.(oo)??t.recur?.(oo)??t});I1=Qt((e)=>new Fn(e.enums.map((t)=>new Er(t[1],{title:t[0]})),"anyOf")),Iv=qa((e)=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(Iv)}}),mg=qa((e)=>{switch(e._tag){default:return e;case"Symbol":case"UniqueSymbol":return e.toCodecStringTree();case"Union":return e.recur(mg)}}),C1=qa((e)=>{switch(e._tag){default:return e;case"Number":case"Literal":case"BigInt":return e.toCodecStringTree();case"Union":return e.recur(C1)}}),iv=new globalThis.RegExp(`^${tg}$`),X6=new globalThis.RegExp(`^(?:${tg}|Infinity|-Infinity|NaN)$`);O1=Fo(Po,[Cv()]),e5=new dt(O1,Au),t5=new dt(new Fn([O1,p1],"anyOf"),Au),av=new globalThis.RegExp(`^${n5}$`);Ov=Fo(Po,[Tv({expected:"a string representing a bigint"})]),r5=new dt(Ov,Qh),cv=new globalThis.RegExp(`^${o5}$`),s5=Fo(Po,[Av()]),A1=new dt(s5,new Pe(ve((e)=>globalThis.Symbol.for(cv.exec(e)[1])),Vn((e,t)=>{if(globalThis.Symbol.keyFor(e)!==void 0)return v(globalThis.String(e));return A(new Tu({message:"cannot serialize to string, Symbol is not registered"},e,t))})));Fu=new Ba([],()=>(e,t,n)=>$u(e)?Dt:A(new ft(t,e,n)),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>{return},toCodecStringTree:()=>Rv,toArbitrary:()=>(e)=>e.jsonValue()}),F1=Ur(Fu,{representation:{id:"effect/schema/MutableJson",payload:null}}),_v=new dt(Fu,Ou()),M1=new dt(new Fn([new io(!1,[],[Fu]),new Mu([],[new rg(Po,Fu)])],"anyOf"),Ou());u5=new Ba([],()=>(e,t,n)=>c5(e)?Dt:A(new ft(t,e,n)),{expected:"StringTree",toCodecStringTree:()=>{return}}),Rv=new dt(u5,Ou())});function Pv(){return Object.assign((e)=>e,{option:(e)=>_(e),result:(e)=>G(e),is:(e)=>!0})}var N1=w(()=>{_e();gn()});var $1,U1,D1="~effect/ChildProcessSpawner/ChildProcessHandle",f5,Fv=(e)=>Object.setPrototypeOf({...e},f5),L1=(e)=>{let t=(r,o)=>e(r).pipe(oe((s)=>sF(o?.includeStderr===!0?s.all:s.stdout)),Ii),n=(r,o)=>iF(t(r,o));return Uu.of({spawn:e,exitCode:(r)=>vi(ne(e(r),(o)=>o.exitCode)),streamString:t,streamLines:n,lines:(r,o)=>aF(n(r,o)),string:(r,o)=>cF(t(r,o))})},Uu;var Mv=w(()=>{N1();Ve();Oe();jn();vu();$1=Pv(),U1=Pv(),f5={[D1]:D1,...G0,toJSON(){return{_id:"ChildProcessHandle",pid:this.pid}}};Uu=class Uu extends ze()("effect/process/ChildProcessSpawner"){}});var j1="~effect/unstable/process/ChildProcess",d5,hg=(e,t,n)=>Object.assign(Object.create(d5),{_tag:"StandardCommand",command:e,args:t,options:n}),gg=function(...t){if(B1(t[0])){let[s,...i]=t,a=H1(s,i);return hg(a[0]??"",a.slice(1),{})}if(typeof t[0]==="object"&&!Array.isArray(t[0])&&!B1(t[0])){let s=t[0];return function(i,...a){let c=H1(i,a);return hg(c[0]??"",c.slice(1),s)}}if(typeof t[0]==="string"&&!Array.isArray(t[1])){let[s,i={}]=t;return hg(s,[],i)}let[n,r=[],o={}]=t;return hg(n,r,o)},B1=(e)=>Array.isArray(e)&&("raw"in e)&&Array.isArray(e.raw),xg=(e)=>{let t=/^fd(\d+)$/.exec(e);if(t===null)return;let n=parseInt(t[1],10);return n>=3?n:void 0},K1=(e)=>`fd${e}`,H1=(e,t)=>{let n=[];for(let[r,o]of e.entries())n=p5(e,t,n,o,r);return n},p5=(e,t,n,r,o)=>{let s=e.raw[o];if(s===void 0)throw Error(`Invalid backslash sequence: ${e.raw[o]}`);let{hasLeadingWhitespace:i,hasTrailingWhitespace:a,tokens:c}=h5(r,s),u=W1(n,c,i);if(o===t.length)return u;let l=t[o],f=Array.isArray(l)?l.map((d)=>q1(d)):[q1(l)];return W1(u,f,a)},q1=(e)=>{if(typeof e==="string")return e;return String(e)},z1,m5,h5=(e,t)=>{if(t.length===0)return{tokens:[],hasLeadingWhitespace:!1,hasTrailingWhitespace:!1};let n=z1.has(t[0]),r=[],o=0;for(let i=0,a=0;i<e.length;i+=1,a+=1){let c=t[a];if(z1.has(c)){if(o!==i)r.push(e.slice(o,i));o=i+1}else if(c==="\\"){let u=t[a+1];if(u===`
|
|
33
|
-
`)i-=1,a+=1;else if(u==="u"&&t[a+2]==="{")a=t.indexOf("}",a+3);else a+=m5[u]??1}}let s=o===e.length;if(!s)r.push(e.slice(o));return{tokens:r,hasLeadingWhitespace:n,hasTrailingWhitespace:s}},W1=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t.at(0)}`,...t.slice(1)];var V1=w(()=>{Ve();Pc();Mv();d5={...So({label:"Command",evaluate(e){return Gr(e.context,Uu).spawn(this)}}),[j1]:j1},z1=new Set([" ","\t","\r",`
|
|
34
|
-
`]),m5={x:3,u:5}});var G1=(e,t,n)=>{let r=e.detached??n!=="win32";return{...t,detached:r,shell:e.shell,windowsHide:e.windowsHide??!r}};var He=(e,t)=>(n,[r])=>{let o="Unknown";switch(n.code){case"ENOENT":o="NotFound";break;case"EACCES":o="PermissionDenied";break;case"EEXIST":o="AlreadyExists";break;case"EISDIR":o="BadResource";break;case"ENOTDIR":o="BadResource";break;case"EBUSY":o="Busy";break;case"ELOOP":o="BadResource";break}return Nr({_tag:o,module:e,method:t,pathOrDescriptor:r,syscall:n.syscall,cause:n})};var Nv=w(()=>{Oo()});var Lu=(e)=>iw(rw(x5(e),(t)=>[t])),x5=(e)=>Sn((t)=>{let n=e.evaluate();return v(y5({...e,writable:n,pull:t}))}),y5=(e)=>e.pull.pipe(ne((t)=>{let n=0;return yn(function r(o){for(;n<t.length;)if(!e.writable.write(t[n++],e.encoding)){e.writable.once("drain",()=>r(o));return}o(Te)})}),Co({disableYield:!0}),_a(yn((t)=>{let n=(r)=>t(A(e.onError(r)));return e.writable.once("error",n),Se(()=>{e.writable.off("error",n)})})),e.endOnDone!==!1?mr((t)=>{if("closed"in e.writable&&e.writable.closed)return _t(t);return yn((n)=>{e.writable.once("finish",()=>n(_t(t))),e.writable.end()})}):D);var Dv=w(()=>{rn();Jf();Oe();X();Ca();Oh()});var ju=(e)=>to(E5(e)),E5=(e)=>Sn((t,n)=>b5({scope:n,readable:e.evaluate(),onError:e.onError??w5,chunkSize:e.chunkSize,closeOnDone:e.closeOnDone})),b5=(e)=>{let t=e.readable,n=e.closeOnDone??!0,r=e.exit??hP(void 0),o=dP(!1);function s(){o.openUnsafe()}function i(u){r.current=Rr(e.onError(u)),o.openUnsafe()}function a(){r.current=Rr(gf()),o.openUnsafe()}t.on("readable",s),t.once("error",i),t.once("end",a);let c=Ne(function u(){let l=e.readable.read(e.chunkSize);if(l===null){if(r.current)return r.current;if(t.readableEnded)return A(gf());return o.closeUnsafe(),ne(o.await,u)}let f=da(l);while(!0){if(l=e.readable.read(e.chunkSize),l===null)break;f.push(l)}return v(f)});return gr(Ef(e.scope,Se(()=>{if(t.off("readable",s),t.off("error",i),t.off("end",a),n&&"closed"in e.readable&&!e.readable.closed)e.readable.destroy()})),c)},w5=(e)=>new ZE(e);var $v=w(()=>{An();rn();Jf();Oe();dr();pP();gP();bf();vu()});import*as yg from"child_process";import{PassThrough as Uv}from"stream";var za=(e)=>e instanceof globalThis.Error?e:new globalThis.Error(String(e)),Mo=(e,t,n)=>{let{commands:r}=Y1(n),o=r.reduce((s,i)=>{let a=`${i.command} ${i.args.join(" ")}`;return s.length===0?a:`${s} | ${a}`},"");return He("ChildProcess",e)(t,[o])},J1=(e,t=()=>{})=>yg.execFile("taskkill",["/pid",String(e.pid),"/T","/F"],{windowsHide:!0},t),k5,Z1,Y1=(e)=>{let t=[],n=[],r=(a)=>{switch(a._tag){case"StandardCommand":{t.push(a);break}case"PipedCommand":{r(a.left),n.push(a.options),r(a.right);break}}};if(r(e),t.length===0)throw Error("flattenCommand produced empty commands array");let[o,...s]=t;return{commands:[o,...s],pipeOptions:n}};var Q1=w(()=>{eb();Oe();dr();Rh();wo();Ph();he();Oh();vu();V1();Mv();Nv();Dv();$v();k5=qt(function*(){let e=yield*Ci,t=yield*Ao,n=H(function*(y){if(Gs(y.cwd))return;return yield*e.access(y.cwd),t.resolve(y.cwd)}),r=(y)=>y.extendEnv?{...globalThis.process.env,...y.env}:y.env,o=(y)=>Fa(y)?"pipe":y,s=(y)=>Zf(y)?"pipe":y,i=(y)=>{let h={stream:"pipe",encoding:"utf-8",endOnDone:!0};if(Gs(y.stdin))return h;if(typeof y.stdin==="string")return{...h,stream:y.stdin};if(Fa(y.stdin))return{...h,stream:y.stdin};return{stream:y.stdin.stream,encoding:y.stdin.encoding??h.encoding,endOnDone:y.stdin.endOnDone??h.endOnDone}},a=(y,h)=>{let E=y[h];if(Gs(E))return{stream:"pipe"};if(typeof E==="string")return{stream:E};if(Zf(E))return{stream:E};return{stream:E.stream}},c=(y)=>{if(Gs(y.additionalFds))return[];let h=[];for(let[E,k]of Object.entries(y.additionalFds)){let T=xg(E);if(Le(T))h.push({fd:T,config:k})}return h.sort((E,k)=>E.fd-k.fd)},u=(y,h,E,k)=>{let T=[o(y.stream),s(h.stream),s(E.stream)];if(k.length===0)return T;let F=k.reduce((N,{fd:R})=>Math.max(N,R),2);for(let N=3;N<=F;N++)T[N]="ignore";for(let{fd:N}of k)T[N]="pipe";return T},l=H(function*(y,h,E){if(E.length===0)return{getInputFd:()=>Yf,getOutputFd:()=>wu};let k=new Map,T=new Map;for(let{config:F,fd:N}of E){let R=h.stdio[N];switch(F.type){case"input":{let z=Yf;if(R&&"write"in R)z=Lu({evaluate:()=>R,onError:(q)=>Mo(`fromWritable(fd${N})`,za(q),y)});if(F.stream)yield*xu(dw(F.stream,z));k.set(N,z);break}case"output":{let z=wu;if(R&&"read"in R){let q=new Uv;R.on("error",(ue)=>q.destroy(ue)),R.pipe(q),z=ju({evaluate:()=>q,onError:(ue)=>Mo(`fromReadable(fd${N})`,za(ue),y)})}if(F.sink)z=Ah(z,F.sink);T.set(N,z);break}}}return{getInputFd:(F)=>k.get(F)??Yf,getOutputFd:(F)=>T.get(F)??wu}}),f=(y,h,E)=>Ne(()=>{let k=Yf;if(wl(h.stdin))k=Lu({evaluate:()=>h.stdin,onError:(T)=>Mo("fromWritable(stdin)",za(T),y),endOnDone:E.endOnDone,encoding:E.encoding});if(Fa(E.stream))return gr(xu(dw(E.stream,k)),k);return v(k)}),d=(y,h,E,k)=>{let T=h.stdout?(()=>{let R=new Uv;return h.stdout.on("error",(z)=>R.destroy(z)),h.stdout.pipe(R),ju({evaluate:()=>R,onError:(z)=>Mo("fromReadable(stdout)",za(z),y)})})():wu,F=h.stderr?(()=>{let R=new Uv;return h.stderr.on("error",(z)=>R.destroy(z)),h.stderr.pipe(R),ju({evaluate:()=>R,onError:(z)=>Mo("fromReadable(stderr)",za(z),y)})})():wu;if(Zf(E.stream))T=Ah(T,E.stream);if(Zf(k.stream))F=Ah(F,k.stream);let N=oF(T,F);return{stdout:T,stderr:F,all:N}},m=(y,h)=>yn((E)=>{let k=Wm(),T=yg.spawn(y.command,y.args,h);return T.on("error",(F)=>{E(A(Mo("spawn",F,y)))}),T.on("exit",(...F)=>{XE(k,_r(F))}),T.on("spawn",()=>{E(v([T,k]))}),Se(()=>{T.kill("SIGTERM")})}),g=(y,h,E)=>{if(globalThis.process.platform==="win32")return yn((k)=>{J1(h,(T)=>{if(T)k(A(Mo("kill",za(T),y)));else k(Te)})});return Nt({try:()=>{globalThis.process.kill(-h.pid,E)},catch:(k)=>Mo("kill",za(k),y)})},b=(y,h)=>{if(globalThis.process.platform==="win32"){J1(y);return}try{globalThis.process.kill(-y.pid,h)}catch{}},x=(y,h,E)=>Ne(()=>{if(!h.kill(E)){let T=new globalThis.Error("Failed to kill child process");return A(Mo("kill",T,y))}return Te}),I=(y,h,E)=>(k)=>{let T=E?.killSignal??"SIGTERM";return Gs(E?.forceKillAfter)?k(h,y,T):Bb(k(h,y,T),{duration:E.forceKillAfter,orElse:()=>k(h,y,"SIGKILL")})},C=(y,h)=>{let E=h??"stdout";switch(E){case"stdout":return y.stdout;case"stderr":return y.stderr;case"all":return y.all;default:{let k=xg(E);if(Le(k))return y.getOutputFd(k);return y.stdout}}},S=H(function*(y){switch(y._tag){case"StandardCommand":{let h=i(y.options),E=a(y.options,"stdout"),k=a(y.options,"stderr"),T=c(y.options),F=!0,N=yield*n(y.options),R=r(y.options),z=u(h,E,k,T),[q,ue]=yield*Mr(m(y,G1(y.options,{cwd:N,env:R,stdio:z},process.platform)),H(function*([Hr,Ec]){let bc=yield*QE(Ec),xl=I(Hr,y,y.options);if(bc){let[Vs]=yield*va(Ec);if(Vs!==0&&wl(Vs))return yield*Nf(xl(g));return yield*Te}if(!F)return yield*Te;return yield*xl((Vs,D0,$0)=>g(Vs,D0,$0).pipe(Pr(()=>x(Vs,D0,$0)),hr(va(Ec)))).pipe(Nf)})),ut=U1(q.pid);q.on("exit",(Hr)=>{if(Hr!==0&&wl(Hr))b(q,y.options.killSignal??"SIGTERM")});let Ks=Se(()=>{if(!F)q.ref(),F=!0}),gl=Se(()=>{if(F)q.unref(),F=!1;return Ks}),kp=yield*f(y,q,h),{all:Ip,stderr:wy,stdout:vy}=d(y,q,E,k),{getInputFd:Oq,getOutputFd:Aq}=yield*l(y,q,T),_q=oe(QE(ue),(Hr)=>!Hr),Rq=ne(va(ue),([Hr,Ec])=>{if(wl(Hr))return v($1(Hr));let bc=new globalThis.Error(`Process interrupted due to receipt of signal: '${Ec}'`);return A(Mo("exitCode",bc,y))});return Fv({pid:ut,exitCode:Rq,isRunning:_q,kill:(Hr)=>I(q,y,Hr)((bc,xl,Vs)=>g(bc,xl,Vs).pipe(Pr(()=>x(bc,xl,Vs)),hr(va(ue)))).pipe(Ff),stdin:kp,stdout:vy,stderr:wy,all:Ip,getInputFd:Oq,getOutputFd:Aq,unref:gl})}case"PipedCommand":{let{commands:h,pipeOptions:E}=Y1(y),[k,...T]=h,F=[yield*S(k)];for(let q=0;q<T.length;q++){let ue=T[q],ut=E[q]??{},Ks=i(ue.options),gl=Ii(v(C(F[F.length-1],ut.from))),kp=ut.to??"stdin";if(kp==="stdin")F.push(yield*S(gg(ue.command,ue.args,{...ue.options,stdin:{...Ks,stream:gl}})));else{let Ip=xg(kp);if(Le(Ip)){let wy=K1(Ip),vy=ue.options.additionalFds??{};F.push(yield*S(gg(ue.command,ue.args,{...ue.options,additionalFds:{...vy,[wy]:{type:"input",stream:gl}}})))}else F.push(yield*S(gg(ue.command,ue.args,{...ue.options,stdin:{...Ks,stream:gl}})))}}let N=F[F.length-1],R=(q)=>Oa([...F].reverse(),(ue)=>Nf(ue.kill(q)),{discard:!0}),z=qt(function*(){let q=[];for(let ue of F)q.push(yield*ue.unref);return Oa([...q].reverse(),(ue)=>ue,{discard:!0})});return Fv({pid:N.pid,exitCode:N.exitCode,isRunning:N.isRunning,kill:R,stdin:N.stdin,stdout:N.stdout,stderr:N.stderr,all:N.all,getInputFd:N.getInputFd,getOutputFd:N.getOutputFd,unref:z})}}});return L1(S)}),Z1=su(Uu,k5)});var X1=w(()=>{Q1()});function eN(e=rN()){return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}function tN(e,t=rN()){let n=Math.min(Math.max(0,Math.trunc(e)),T5);return t[0]=Math.floor(n/1099511627776),t[1]=Math.floor(n/4294967296)&255,t[2]=Math.floor(n/16777216)&255,t[3]=Math.floor(n/65536)&255,t[4]=Math.floor(n/256)&255,t[5]=n&255,t[6]=t[6]&15|112,t[8]=t[8]&63|128,t}var C5=(e)=>e.toString(16).padStart(2,"0"),nN=(e)=>[e.subarray(0,4),e.subarray(4,6),e.subarray(6,8),e.subarray(8,10),e.subarray(10,16)].map((n)=>Array.from(n,C5).join("")).join("-"),rN=()=>globalThis.crypto.getRandomValues(new Uint8Array(16)),oN=(e)=>nN(e===void 0?eN():eN(e)),T5=281474976710655,sN=(e,t)=>nN(t===void 0?tN(e):tN(e,t));var iN="~effect/platform/Crypto",Lv,aN=(e)=>{let t=e.randomBytes,n=(i)=>oe(A5("randomBytes",i),t),r=(i)=>(i[0]&31)*281474976710656+i[1]*1099511627776+i[2]*4294967296+i[3]*16777216+i[4]*65536+i[5]*256+i[6],o=()=>r(t(7))/9007199254740992,s=()=>{while(!0){let i=t(7),a=r(i);if((i[0]&32)===0)return a+Number.MIN_SAFE_INTEGER;if(a<Number.MAX_SAFE_INTEGER)return a+1}};return Lv.of({[iN]:iN,randomBytes:n,nextDoubleUnsafe:o,nextIntUnsafe:s,digest:e.digest,random:Se(()=>o()),randomBoolean:Se(()=>o()>0.5),randomInt:Se(()=>s()),randomBetween:(i,a)=>Se(()=>o()*(a-i)+i),randomIntBetween(i,a,c){let u=c?.halfOpen===!0?0:1;return Se(()=>{let l=Math.ceil(i),f=Math.floor(a);return Math.floor(o()*(f-l+u))+l})},randomShuffle:(i)=>Se(()=>{let a=Array.from(i);for(let c=a.length-1;c>=1;c=c-1){let u=Math.min(c,Math.floor(o()*(c+1))),l=a[c];a[c]=a[u],a[u]=l}return a}),randomUUIDv4:Se(()=>oN(t(16))),randomUUIDv7:jf((i)=>v(sN(i.currentTimeMillisUnsafe(),t(16))))})},A5=(e,t)=>Number.isSafeInteger(t)&&t>=0?v(t):A(bs({module:"Crypto",method:e,description:"size must be a non-negative safe integer"}));var cN=w(()=>{Ve();Oe();Oo();Lv=ze("effect/Crypto")});import*as Sg from"crypto";var R5=(e)=>{switch(e){case"SHA-1":return"sha1";case"SHA-256":return"sha256";case"SHA-384":return"sha384";case"SHA-512":return"sha512"}},P5=(e,t)=>Nt({try:()=>Uint8Array.from(Sg.createHash(R5(e)).update(t).digest()),catch:(n)=>Nr({module:"Crypto",method:"digest",_tag:"Unknown",description:"Could not compute digest",cause:n})}),F5,uN;var lN=w(()=>{cN();Oe();wo();Oo();F5=aN({randomBytes:Sg.randomBytes,digest:P5}),uN=Si(Lv,F5)});var fN;var dN=w(()=>{lN();fN=uN});import*as pN from"crypto";import*as ee from"fs";import*as mN from"os";import*as Bu from"path";var it=(e)=>(t)=>bs({module:"FileSystem",method:e,description:t.message??String(t)}),D5,$5,U5,L5,j5,B5,H5,q5,jv=(e)=>{let t=ot(ee.mkdtemp,He("FileSystem",e),it(e));return(n)=>Ne(()=>{let r=n?.prefix??"",o=typeof n?.directory==="string"?Bu.join(n.directory,"."):mN.tmpdir();return t(r?Bu.join(o,r):o+"/")})},z5,Bv=(e)=>{let t=ot(ee.rm,He("FileSystem",e),it(e));return(n,r)=>t(n,{recursive:r?.recursive??!1,force:r?.force??!1})},W5,K5,V5=(e)=>{let t=ot(ee.open,He("FileSystem",e),it(e)),n=ot(ee.close,He("FileSystem",e),it(e));return(r,o)=>zr(Mr(t(r,o?.flag??"r",o?.mode),(s)=>Fr(n(s))),oe((s)=>J5(s,o?.flag?.startsWith("a")??!1)))},G5,J5,hN=(e)=>{let t=jv(e);return H(function*(n){let r=yield*t(n),o=pN.randomBytes(6).toString("hex"),s=Bu.join(r,n?.suffix?`${o}${n.suffix}`:o);return yield*xN(s,new Uint8Array(0)),s})},Z5,Y5,Q5=(e,t)=>lu({try:()=>ee.promises.readdir(e,t),catch:(n)=>He("FileSystem","readDirectory")(n,[e])}),X5=(e)=>yn((t,n)=>{try{ee.readFile(e,{signal:n},(r,o)=>{if(r)t(A(He("FileSystem","readFile")(r,[e])));else t(v(o))})}catch(r){t(A(it("readFile")(r)))}}),eZ,tZ,nZ,gN=(e)=>({type:e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":e.isBlockDevice()?"BlockDevice":e.isCharacterDevice()?"CharacterDevice":e.isFIFO()?"FIFO":e.isSocket()?"Socket":"Unknown",mtime:Tn(e.mtime),atime:Tn(e.atime),birthtime:Tn(e.birthtime),dev:e.dev,rdev:Tn(e.rdev),ino:Tn(e.ino),mode:e.mode,nlink:Tn(e.nlink),uid:Tn(e.uid),gid:Tn(e.gid),size:Cs(e.size),blksize:e.blksize!==void 0?_(Cs(e.blksize)):O(),blocks:Tn(e.blocks)}),Hv,rZ,oZ,sZ,iZ=(e,t)=>nF((n)=>Mr(Se(()=>{let r=ee.watch(e,{recursive:t?.recursive??!1},(o,s)=>{if(!s)return;switch(o){case"rename":{To(uh(Hv(s),{onSuccess:(i)=>zf(n,{_tag:"Create",path:s}),onFailure:(i)=>zf(n,{_tag:"Remove",path:s})}));return}case"change":{Wf(n,{_tag:"Update",path:s});return}}});return r.on("error",(o)=>{Vf(n,GE(Nr({module:"FileSystem",_tag:"Unknown",method:"watch",pathOrDescriptor:e,cause:o})))}),r.on("close",()=>{ks(n)}),r}),(r)=>Se(()=>r.close()))),aZ=(e,t,n)=>Hv(t).pipe(oe((r)=>e.pipe(rs((o)=>o.register(t,r,n)),mt(()=>iZ(t,n)))),Ii),xN=(e,t,n)=>yn((r,o)=>{try{ee.writeFile(e,t,{signal:o,flag:n?.flag,mode:n?.mode},(s)=>{if(s)r(A(He("FileSystem","writeFile")(s,[e])));else r(Te)})}catch(s){r(A(it("writeFile")(s)))}}),cZ,yN;var SN=w(()=>{rn();Oe();Oe();Rh();X();wo();_e();Oo();Gf();vu();Nv();D5=(()=>{let e=ot(ee.access,He("FileSystem","access"),it("access"));return(t,n)=>{let r=ee.constants.F_OK;if(n?.readable)r|=ee.constants.R_OK;if(n?.writable)r|=ee.constants.W_OK;return e(t,r)}})(),$5=(()=>{let e=ot(ee.cp,He("FileSystem","copy"),it("copy"));return(t,n,r)=>e(t,n,{force:r?.overwrite??!1,preserveTimestamps:r?.preserveTimestamps??!1,recursive:!0})})(),U5=(()=>{let e=ot(ee.copyFile,He("FileSystem","copyFile"),it("copyFile"));return(t,n)=>e(t,n)})(),L5=(()=>{let e=ot(ee.chmod,He("FileSystem","chmod"),it("chmod"));return(t,n)=>e(t,n)})(),j5=(()=>{let e=ot(ee.chown,He("FileSystem","chown"),it("chown"));return(t,n,r)=>e(t,n,r)})(),B5=(()=>{let e=ot(ee.glob,He("FileSystem","glob"),it("glob"));return(t,n)=>e(t,{cwd:n?.root,exclude:n?.exclude})})(),H5=(()=>{let e=ot(ee.link,He("FileSystem","link"),it("link"));return(t,n)=>e(t,n)})(),q5=(()=>{let e=ot(ee.mkdir,He("FileSystem","makeDirectory"),it("makeDirectory"));return(t,n)=>e(t,{recursive:n?.recursive??!1,mode:n?.mode})})(),z5=jv("makeTempDirectory"),W5=Bv("remove"),K5=(()=>{let e=jv("makeTempDirectoryScoped"),t=Bv("makeTempDirectoryScoped");return(n)=>Mr(e(n),(r)=>Fr(t(r,{recursive:!0})))})(),G5=V5("open"),J5=(()=>{let e=(l)=>ot(ee.read,He("FileSystem",l),it(l)),t=e("read"),n=e("readAlloc"),r=ot(ee.fstat,He("FileSystem","stat"),it("stat")),o=ot(ee.ftruncate,He("FileSystem","truncate"),it("truncate")),s=ot(ee.fsync,He("FileSystem","sync"),it("sync")),i=(l)=>ot(ee.write,He("FileSystem",l),it(l)),a=i("write"),c=i("writeAll");class u{[_h];fd;append;position=BigInt(0);constructor(l,f){this[_h]=_h,this.fd=l,this.append=f}get stat(){return oe(r(this.fd),gN)}get sync(){return s(this.fd)}seek(l,f){let d=Cs(l);return Se(()=>{if(f==="start")this.position=d;else if(f==="current")this.position=this.position+d;return Cs(this.position)})}read(l){return Ne(()=>{let f=this.position;return oe(t(this.fd,{buffer:l,position:f}),(d)=>{let m=Cs(d);return this.position=f+m,m})})}readAlloc(l){let f=Number(l);return Ne(()=>{let d=Buffer.allocUnsafeSlow(f),m=this.position;return oe(n(this.fd,{buffer:d,position:m}),(g)=>{if(g===0)return O();if(this.position=m+BigInt(g),g===f)return _(d);let b=Buffer.allocUnsafeSlow(g);return d.copy(b,0,0,g),_(b)})})}truncate(l){return oe(o(this.fd,l?Number(l):void 0),()=>{if(!this.append){let f=BigInt(l??0);if(this.position>f)this.position=f}})}write(l){return Ne(()=>{let f=this.position;return oe(a(this.fd,l,void 0,void 0,this.append?void 0:Number(f)),(d)=>{let m=Cs(d);if(!this.append)this.position=f+m;return m})})}writeAllChunk(l){return Ne(()=>{let f=this.position;return ne(c(this.fd,l,void 0,void 0,this.append?void 0:Number(f)),(d)=>{if(d===0)return A(Nr({module:"FileSystem",method:"writeAll",_tag:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"}));if(!this.append)this.position=f+BigInt(d);return d<l.length?this.writeAllChunk(l.subarray(d)):Te})})}writeAll(l){return this.writeAllChunk(l)}}return(l,f)=>new u(l,f)})(),Z5=hN("makeTempFile"),Y5=(()=>{let e=hN("makeTempFileScoped"),t=Bv("makeTempFileScoped");return(n)=>Mr(e(n),(r)=>Fr(t(Bu.dirname(r),{recursive:!0})))})(),eZ=(()=>{let e=ot(ee.readlink,He("FileSystem","readLink"),it("readLink"));return(t)=>e(t)})(),tZ=(()=>{let e=ot(ee.realpath,He("FileSystem","realPath"),it("realPath"));return(t)=>e(t)})(),nZ=(()=>{let e=ot(ee.rename,He("FileSystem","rename"),it("rename"));return(t,n)=>e(t,n)})(),Hv=(()=>{let e=ot(ee.stat,He("FileSystem","stat"),it("stat"));return(t)=>oe(e(t),gN)})(),rZ=(()=>{let e=ot(ee.symlink,He("FileSystem","symlink"),it("symlink"));return(t,n)=>e(t,n)})(),oZ=(()=>{let e=ot(ee.truncate,He("FileSystem","truncate"),it("truncate"));return(t,n)=>e(t,n!==void 0?Number(n):void 0)})(),sZ=(()=>{let e=ot(ee.utimes,He("FileSystem","utime"),it("utime"));return(t,n,r)=>e(t,n,r)})(),cZ=oe(fh(pw),(e)=>lF({access:D5,chmod:L5,chown:j5,copy:$5,copyFile:U5,glob:B5,link:H5,makeDirectory:q5,makeTempDirectory:z5,makeTempDirectoryScoped:K5,makeTempFile:Z5,makeTempFileScoped:Y5,open:G5,readDirectory:Q5,readFile:X5,readLink:eZ,realPath:tZ,remove:W5,rename:nZ,stat:Hv,symlink:rZ,truncate:oZ,utimes:sZ,watch(t,n){return aZ(e,t,n)},writeFile:xN})),yN=su(Ci)(cZ)});var EN;var bN=w(()=>{SN();EN=yN});import*as Ed from"path";import*as Eg from"url";var qv=(e)=>({fromFileUrl:(t)=>Nt({try:()=>Eg.fileURLToPath(t,{windows:e}),catch:(n)=>new Es({module:"Path",method:"fromFileUrl",cause:n})}),toFileUrl:(t)=>Nt({try:()=>Eg.pathToFileURL(t,{windows:e}),catch:(n)=>new Es({module:"Path",method:"toFileUrl",cause:n})})}),fZ,dZ,wN;var vN=w(()=>{Oe();wo();Ph();Oo();fZ=Si(Ao)({[Ts]:Ts,...Ed.posix,...qv(!1)}),dZ=Si(Ao)({[Ts]:Ts,...Ed.win32,...qv(!0)}),wN=Si(Ao)({[Ts]:Ts,...Ed,...qv(void 0)})});var kN;var IN=w(()=>{vN();kN=wN});var zv="~effect/Stdio",bg,CN=(e)=>({[zv]:zv,stdinIsTerminal:v(!1),stdoutIsTerminal:v(!1),...e});var Wv=w(()=>{Ve();Oe();bg=ze(zv)});var ON;var AN=w(()=>{Oe();wo();Oo();Wv();Dv();$v();ON=Si(bg,CN({args:Se(()=>process.argv.slice(2)),stdinIsTerminal:Se(()=>process.stdin.isTTY===!0),stdoutIsTerminal:Se(()=>process.stdout.isTTY===!0),stdout:(e)=>Lu({evaluate:()=>process.stdout,onError:(t)=>Nr({module:"Stdio",method:"stdout",_tag:"Unknown",cause:t}),endOnDone:e?.endOnDone??!1}),stderr:(e)=>Lu({evaluate:()=>process.stderr,onError:(t)=>Nr({module:"Stdio",method:"stderr",_tag:"Unknown",cause:t}),endOnDone:e?.endOnDone??!1}),stdin:ju({evaluate:()=>process.stdin,onError:(e)=>Nr({module:"Stdio",method:"stdin",_tag:"Unknown",cause:e}),closeOnDone:!1})}))});var _N;var RN=w(()=>{AN();_N=ON});var wg="~effect/collections/Graph",Kv=(e)=>e,xZ=(e,t,n)=>(e==="directed"?t.source===n.source&&t.target===n.target:t.source===n.source&&t.target===n.target||t.source===n.target&&t.target===n.source)&&Y(t.data,n.data),yZ=(e,t)=>e==="directed"?re(t):Js(re(t.data)^re(t.source)+re(t.target)),SZ,PN=(e,t)=>{let n=Object.create(SZ);return n.type=e,n.mutable=t,n.transforming=!1,n.nodes=new Map,n.edges=new Map,n.adjacency=new Map,n.reverseAdjacency=new Map,n.nextNodeIndex=0,n.nextEdgeIndex=0,n.acyclic=_(!0),n},bd=(e)=>{let t=Kv(e);return{type:e.type,nodes:Array.from(t.nodes,([n,r])=>({index:n,data:r})).sort((n,r)=>n.index-r.index),edges:Array.from(t.edges,([n,r])=>({index:n,source:r.source,target:r.target,data:r.data})).sort((n,r)=>n.index-r.index)}},wd=(e)=>{let t=PN(e.type,!1);for(let n of e.nodes)t.nodes.set(n.index,n.data),t.adjacency.set(n.index,[]),t.reverseAdjacency.set(n.index,[]);for(let n of e.edges)if(t.edges.set(n.index,{source:n.source,target:n.target,data:n.data}),t.adjacency.get(n.source).push(n.index),t.reverseAdjacency.get(n.target).push(n.index),e.type==="undirected")t.adjacency.get(n.target).push(n.index),t.reverseAdjacency.get(n.source).push(n.index);return t.nextNodeIndex=e.nodes.length===0?0:e.nodes[e.nodes.length-1].index+1,t.nextEdgeIndex=e.edges.length===0?0:e.edges[e.edges.length-1].index+1,t.acyclic=O(),t};var Vv=w(()=>{yt();Xt();jn();_e();Qe();he();SZ={[wg]:{_N:(e)=>e,_E:(e)=>e},[Symbol.iterator](){return this.nodes[Symbol.iterator]()},[At](){return this.toJSON()},[Ce](e){if(M(e,wg)){let t=Kv(e);if(this.nodes.size!==t.nodes.size||this.edges.size!==t.edges.size||this.type!==t.type)return!1;for(let[n,r]of this.nodes)if(!t.nodes.has(n)||!Y(r,t.nodes.get(n)))return!1;for(let[n,r]of this.edges){let o=t.edges.get(n);if(o===void 0||!xZ(this.type,r,o))return!1}return!0}return!1},[Ie](){let e=qe("Graph");e=e^qe(this.type),e=e^Ln(this.nodes.size),e=e^Ln(this.edges.size);for(let[t,n]of this.nodes)e=e^re(t)+re(n);for(let[t,n]of this.edges)e=e^re(t)+yZ(this.type,n);return e},toJSON(){return{_id:"Graph",nodeCount:this.nodes.size,edgeCount:this.edges.size,type:this.type}},toString(){return`Graph(${this.type}, ${this.nodes.size}, ${this.edges.size})`},pipe(){return le(this,arguments)}}});var EZ,Gv=(e)=>M(e,EZ),MN,bZ;var NN=w(()=>{yt();Xt();Vv();he();EZ=wg;MN=class MN{type;source;target;identity;constructor(e,t,n,r){this.type=e,this.source=t,this.target=n,this.identity=r}[Ce](e){if(!(e instanceof MN)||this.type!==e.type||!Y(this.identity,e.identity))return!1;if(this.type==="directed")return Y(this.source,e.source)&&Y(this.target,e.target);return Y(this.source,e.source)&&Y(this.target,e.target)||Y(this.source,e.target)&&Y(this.target,e.source)}[Ie](){let e=re(this.identity);return this.type==="directed"?xt(re(this.target))(xt(re(this.source))(e)):Js(e^re(this.source)+re(this.target))}};bZ=class bZ{[Symbol.iterator];visit;constructor(e){this.visit=e,this[Symbol.iterator]=()=>e((t,n)=>[t,n])[Symbol.iterator]()}}});function $N(e,t,n,r,o,s){if(t>32)throw Error("HashMap: max depth exceeded");let i=Di(n,t),a=Di(o,t);if(i===a){let l=$N(e,t+uo,n,r,o,s);return new No(e,i,[l])}let c=i|a,u=i>>>0<a>>>0?[r,s]:[s,r];return new No(e,c,u)}class Hu{canEdit(e){return this.edit===e}}var kg="~effect/collections/HashMap",uo=5,Cd,vZ,DN,kZ,IZ=(e)=>(e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24),vd=(e,t)=>e>>>t&kZ,Di=(e,t)=>1<<vd(e,t),vg=(e,t)=>IZ(e&t-1),UN,Fs,kd,No,Id,Ig,LN,Jv=(e)=>M(e,kg),Zv=()=>new Ig(!1,0,LN,0),jN=(e)=>{let t=LN,n=0,r={value:!1};for(let[o,s]of e){let i=re(o);if(r.value=!1,t=t.set(NaN,0,i,o,s,r),r.value)n++}return new Ig(!1,0,t,n)},BN,Yv,CZ=(e,t,n,r)=>{let o=e,s={value:!1},i=o._editable?o._edit:NaN,a=o._root.set(i,0,n,t,r,s);if(o._editable){if(o._root=a,s.value)o._size++;return e}if(o._root===a)return e;return new Ig(!1,o._edit,a,o._size+(s.value?1:0))},Qv,Xv=(e)=>{let t=e[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let n=t.next();if(n.done)return{done:!0,value:void 0};return{done:!1,value:n.value[0]}}}},HN=(e)=>{let t=e[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return t.next()}}},Cg=(e)=>e.size;var ek=w(()=>{yt();kn();X();Xt();jn();_e();Qe();he();Cd=1<<uo,vZ=Cd/4,DN=Cd/2,kZ=Cd-1;UN=class UN extends Hu{_tag="EmptyNode";edit=0;get size(){return 0}get(e,t,n){return O()}has(e,t,n){return!1}set(e,t,n,r,o,s){return s.value=!0,new Fs(e,n,r,o)}remove(e,t,n,r,o){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit(e){return!1}};Fs=class Fs extends Hu{_tag="LeafNode";edit;hash;key;value;constructor(e,t,n,r){super();this.edit=e,this.hash=t,this.key=n,this.value=r}get size(){return 1}get(e,t,n){if(this.hash===t&&Y(this.key,n))return _(this.value);return O()}has(e,t,n){return this.hash===t&&Y(this.key,n)}set(e,t,n,r,o,s){if(this.hash===n&&Y(this.key,r)){if(Y(this.value,o))return this;if(this.canEdit(e))return this.value=o,this;return new Fs(e,n,r,o)}if(s.value=!0,this.hash===n)return new kd(e,n,[[this.key,this.value],[r,o]]);let i=Di(n,t),a=Di(this.hash,t);if(i===a)return new No(e,i,[this.set(e,t+uo,n,r,o,s)]);let c=i|a,u=i>>>0<a>>>0?[new Fs(e,n,r,o),this]:[this,new Fs(e,n,r,o)];return new No(e,c,u)}remove(e,t,n,r,o){if(this.hash===n&&Y(this.key,r)){o.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}};kd=class kd extends Hu{_tag="CollisionNode";edit;hash;entries;constructor(e,t,n){super();this.edit=e,this.hash=t,this.entries=n}get size(){return this.entries.length}get(e,t,n){if(this.hash!==t)return O();for(let[r,o]of this.entries)if(Y(r,n))return _(o);return O()}has(e,t,n){if(this.hash!==t)return!1;for(let[r]of this.entries)if(Y(r,n))return!0;return!1}set(e,t,n,r,o,s){if(this.hash!==n)return s.value=!0,$N(e,t,this.hash,this,n,new Fs(e,n,r,o));for(let i=0;i<this.entries.length;i++)if(Y(this.entries[i][0],r)){if(Y(this.entries[i][1],o))return this;if(this.canEdit(e))return this.entries[i]=[r,o],this;let a=[...this.entries];return a[i]=[r,o],new kd(e,this.hash,a)}if(s.value=!0,this.canEdit(e))return this.entries.push([r,o]),this;return new kd(e,this.hash,[...this.entries,[r,o]])}remove(e,t,n,r,o){if(this.hash!==n)return this;let s=this.entries.findIndex(([a])=>Y(a,r));if(s===-1)return this;if(o.value=!0,this.entries.length===1)return;if(this.entries.length===2){let a=this.entries[s===0?1:0];return new Fs(e,this.hash,a[0],a[1])}if(this.canEdit(e))return this.entries.splice(s,1),this;let i=[...this.entries];return i.splice(s,1),new kd(e,this.hash,i)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}};No=class No extends Hu{_tag="IndexedNode";edit;_size;bitmap;children;constructor(e,t,n){super();this.edit=e,this.bitmap=t,this.children=n}get size(){if(this._size===void 0)this._size=this.children.reduce((e,t)=>e+t.size,0);return this._size}get(e,t,n){let r=Di(t,e);if((this.bitmap&r)===0)return O();let o=vg(this.bitmap,r);return this.children[o].get(e+uo,t,n)}has(e,t,n){let r=Di(t,e);if((this.bitmap&r)===0)return!1;let o=vg(this.bitmap,r);return this.children[o].has(e+uo,t,n)}set(e,t,n,r,o,s){let i=Di(n,t),a=vg(this.bitmap,i);if((this.bitmap&i)!==0){let c=this.children[a],u=c.set(e,t+uo,n,r,o,s);if(c===u)return this;if(this.canEdit(e))return this.children[a]=u,this;let l=[...this.children];return l[a]=u,new No(e,this.bitmap,l)}else{s.value=!0;let c=new Fs(e,n,r,o),u=this.bitmap|i;if(this.canEdit(e)){if(this.children.splice(a,0,c),this.bitmap=u,this._size=void 0,this.children.length>DN)return this.expand(e,u,this.children);return this}let l=[...this.children];if(l.splice(a,0,c),l.length>DN)return this.expand(e,u,l);return new No(e,u,l)}}remove(e,t,n,r,o){let s=Di(n,t);if((this.bitmap&s)===0)return this;let i=vg(this.bitmap,s),a=this.children[i],c=a.remove(e,t+uo,n,r,o);if(!o.value)return this;if(c===void 0){let l=this.bitmap^s;if(l===0)return;if(this.children.length===2){let d=this.children[i===0?1:0];if(d._tag==="LeafNode")return d}if(this.canEdit(e))return this.children.splice(i,1),this.bitmap=l,this._size=void 0,this;let f=[...this.children];return f.splice(i,1),new No(e,l,f)}if(a===c)return this;if(this.canEdit(e))return this.children[i]=c,this;let u=[...this.children];return u[i]=c,new No(e,this.bitmap,u)}expand(e,t,n){let r=new globalThis.Array(Cd),o=0;for(let s=0;s<Cd;s++)if((t&1<<s)!==0)r[s]=n[o++];return new Id(e,n.length,r)}iterator(){let e=0,t;return{next:()=>{while(e<this.children.length){if(!t)t=this.children[e].iterator();let n=t.next();if(!n.done)return n;t=void 0,e++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}};Id=class Id extends Hu{_tag="ArrayNode";edit;_size;count;children;constructor(e,t,n){super();this.edit=e,this.count=t,this.children=n}get size(){if(this._size===void 0)this._size=this.children.reduce((e,t)=>e+(t?.size??0),0);return this._size}get(e,t,n){let r=vd(t,e),o=this.children[r];return o?o.get(e+uo,t,n):O()}has(e,t,n){let r=vd(t,e),o=this.children[r];return o?o.has(e+uo,t,n):!1}set(e,t,n,r,o,s){let i=vd(n,t),a=this.children[i];if(a){let c=a.set(e,t+uo,n,r,o,s);if(a===c)return this;if(this.canEdit(e))return this.children[i]=c,this;let u=[...this.children];return u[i]=c,new Id(e,this.count,u)}else{s.value=!0;let c=new Fs(e,n,r,o);if(this.canEdit(e))return this.children[i]=c,this.count++,this._size=void 0,this;let u=[...this.children];return u[i]=c,new Id(e,this.count+1,u)}}remove(e,t,n,r,o){let s=vd(n,t),i=this.children[s];if(!i)return this;let a=i.remove(e,t+uo,n,r,o);if(!o.value)return this;let c=this.count-(a?0:1);if(c<vZ)return this.pack(e,s,a);if(i===a)return this;if(this.canEdit(e)){if(this.children[s]=a,!a)this.count=c;return this._size=void 0,this}let u=[...this.children];return u[s]=a,new Id(e,c,u)}pack(e,t,n){let r=[],o=0,s=1;for(let i=0;i<this.children.length;i++){let a=i===t?n:this.children[i];if(a)r.push(a),o|=s;s<<=1}return new No(e,o,r)}iterator(){let e=0,t;return{next:()=>{while(e<this.children.length){let n=this.children[e];if(!n){e++;continue}if(!t)t=n.iterator();let r=t.next();if(!r.done)return r;t=void 0,e++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}};Ig=class Ig{[kg]=kg;_editable;_edit;_root;_size;constructor(e,t,n,r){this._editable=e,this._edit=t,this._root=n,this._size=r}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[Ce](e){if(Jv(e)){let t=e;if(this.size!==t.size)return!1;for(let[n,r]of this){let o=zr(e,BN(n));if(me(o)||!Y(r,o.value))return!1}return!0}return!1}[Ie](){let e=qe("HashMap");for(let[t,n]of this)e=e^re(t)+re(n);return e}[At](){return Wt(this)}toString(){return`HashMap(${B(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([e,t])=>[Wt(e),Wt(t)])}}pipe(){return le(this,arguments)}};LN=new UN,BN=p(2,(e,t)=>e._root.get(0,re(t),t)),Yv=p(2,(e,t)=>e._root.has(0,re(t),t)),Qv=p(3,(e,t,n)=>CZ(e,t,re(t),n))});var zN,Tg,AZ,Og=(e)=>Array.from(AZ(e)),WN;var KN=w(()=>{ek();zN=Jv,Tg=jN,AZ=HN,WN=Cg});var Td="~effect/collections/HashSet",RZ,PZ=(e)=>{let t=Object.create(RZ);return t[Td]=Td,t.keyMap=e,t},tk=(e)=>M(e,Td),nk=(e)=>e.keyMap,VN=(e)=>{let t=Zv();for(let n of e)t=Qv(t,n,!0);return PZ(t)},GN=(e,t)=>Yv(nk(e),t),Ag=(e)=>Cg(nk(e)),JN=(e,t)=>{for(let n of e)if(!t(n))return!1;return!0};var ZN=w(()=>{yt();kn();Xt();jn();Qe();he();ek();RZ={[Ie](){return re(Td)},[Ce](e){return tk(e)&&Ag(this)===Ag(e)&&JN(this,(t)=>GN(e,t))},[Symbol.iterator](){return Xv(nk(this))},toString(){return`HashSet(${B(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:Wt(Array.from(this))}},[At](){return this.toJSON()},pipe(){return le(this,arguments)}}});var _g,YN,QN;var XN=w(()=>{ZN();_g=VN,YN=tk,QN=Ag});function Rg(e){let t=fD(Fg,sn(e.ast));return(n,r)=>t(n,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Pg(e){let t=Rg(e);return(n,r)=>{let o=ki(t(n,r));if(Rt(o))return _(o.value);return Os(o.cause,"Option adapter can only return none for schema issues"),O()}}function tD(e){let t=Rg(e);return(n,r)=>{let o=ki(t(n,r));if(Rt(o))return o.value;let s=Os(o.cause,"Constructor adapter can only throw schema issues");throw Error("Schema validation failed",{cause:s})}}function nD(e){return Ad(e.ast)}function Ad(e){let t=Wa(_d(sn(e)));return(n)=>{let r=t(n,ja);if(Rt(r))return!0;return Os(r.cause,"Type guard adapter can only return false for schema issues"),!1}}function rD(e){let t=_d(e);return(n,r)=>{let o=ki(t(n,r));if(Rt(o))return;return Os(o.cause,"Issue adapter can only return schema issues")}}function oD(e,t){let r=Wa(_d(sn(e.ast)))(t,ja);if(ru(r)){let o=Os(r.cause,"Assertion adapter can only throw schema issues");throw Error("Schema validation failed",{cause:o})}}function vt(e,t){let n=_d(e.ast);return t===void 0?n:(r,o)=>n(r,Od(t,o))}function sD(e,t){return Wa(vt(e,t))}function ok(e,t){return dD(vt(e,t))}function aD(e,t){return pD(vt(e,t))}function NZ(e,t){return mD(vt(e,t))}function qu(e,t){let n=_d(oo(e.ast));return t===void 0?n:(r,o)=>n(r,Od(t,o))}function cD(e,t){return Wa(qu(e,t))}function ik(e,t){return dD(qu(e,t))}function lD(e,t){return pD(qu(e,t))}function DZ(e,t){return mD(qu(e,t))}function _d(e){return fD(hD,e)}function fD(e,t){let n;return(r,o)=>{let s=(n??=e(t))(r,o??ja);if(s===Dt)return v(r);if(!We(s))return on(s,eD);return s[ie]===Re?eD(Re):s}}function Wa(e){return(t,n)=>ki(e(t,n))}function dD(e){let t=Wa(e);return(n,r)=>{let o=t(n,r);if(Rt(o))return _(o.value);return Os(o.cause,"Option adapter can only return none for schema issues"),O()}}function pD(e){let t=Wa(e);return(n,r)=>{let o=t(n,r);if(Rt(o))return G(o.value);return te(Os(o.cause,"Result adapter can only return schema issues"))}}function mD(e){let t=Wa(e);return(n,r)=>{let o=t(n,r);if(Rt(o))return o.value;let s=Os(o.cause,"Sync adapter can only throw schema issues");throw Error("Schema validation failed",{cause:s})}}function gD(e){return e.context?.constructorDefault?$Z(e):Fg(e)}function xD(e,t,n,r){let o;if(We(e)&&e._tag==="Success"){let s=Mh(e===Dt?t:e[ie]);o=n._tag==="Transformation"?n.decode.run(s,r):n.decode(Dr(s),r)}else if(n._tag==="Transformation")o=on(e,(s)=>n.decode.run(Mh(s),r));else o=n.decode(Ss(e,Mh),r);return We(o)&&o._tag==="Success"?yw(o[ie]):on(o,yw)}function UZ(e,t){let n;return(r,o)=>{if(r===Re)return no;if(e.isConstructed(r))return Dt;let s=(n??=t(e.link.to))(r,o);return xD(s,r,e.link.transformation,o)}}function ck(e,t,n,r){let o=n?R1(e):void 0,s=o?UZ(o,t):e.getParser(t,n),i=e.checks,a=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,u=(i?i[i.length-1].annotations:e.annotations)?.parseOptions;if(!a&&!i&&!c){if(!u)return s;return(d,m)=>s(d,Od(m,u))}let l,f=(d,m)=>{let g=s(d,m);if(c&&!m.disableChecks)if(We(g)){if(g._tag==="Success"){let b=g===Dt?d:g[ie];if(d!==Re&&b!==Re){let x=co(c,d,void 0,e,m);if(x)g=A(new Et(e,x,d,m))}}}else g=ne(g,(b)=>{if(d!==Re&&b!==Re){let x=co(c,d,void 0,e,m);if(x)return A(new Et(e,x,d,m))}return v(b)});if(i&&!m.disableChecks)if(We(g)){if(g._tag==="Success"){let b=g===Dt?d:g[ie];if(b===Re)return g;let x=co(i,b,void 0,e,m);if(x)g=A(new Et(e,x,b,m))}}else g=ne(g,(b)=>{if(b!==Re){let x=co(i,b,void 0,e,m);if(x)return A(new Et(e,x,b,m))}return v(b)});return g};if(!a)return u?(d,m)=>f(d,Od(m,u)):f;return(d,m)=>{if(u)m=Od(m,u);let g=l??=a.map((I)=>t(I.to)),b=d,x=g[g.length-1](d,m);for(let I=a.length-1;I>=0;I--)if(x=xD(x,b,a[I].transformation,m),I!==0){let C=g[I-1];if(x._tag==="Success")b=x[ie],x=C(b,m);else x=on(x,(S)=>{let y=C(S,m);return y===Dt?Dr(S):y})}if(x._tag==="Success"){let I=x[ie],C=f(I,m);return C===Dt?x:C}return x=xr(x,(I)=>Ei(()=>ms(I,(C)=>new vw(e,C,d,m)))),on(x,(I)=>{let C=f(I,m);return C===Dt?Dr(I):C})}}var rk,iD,sk,uD,ak,Od=(e,t)=>t?{...e,...t}:e,eD=(e)=>{if(e===Re)return A(new we);return v(e)},hD,Fg,$Z;var Mg=w(()=>{rn();Oe();dr();X();ht();Tw();Nh();_e();gn();Ps();Ai();rk=vt;iD=ok;sk=NZ;uD=ik;ak=DZ;hD=Qt((e)=>ck(e,hD)),Fg=Qt((e)=>ck(e,Fg,gD)),$Z=Qt((e)=>ck(e,Fg,gD,e.context?.constructorDefault))});function Mn(e,t,n){return{id:e,payloadSchema:t,revive:n}}function ge(e,t,n){return{id:e,payloadSchema:t,revive:n}}function Rd(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,LZ),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=(o)=>Rd(o,t),r.makeEffect=Rg(r),r.make=tD(r),r.makeOption=Pg(r),r}var Ng="~effect/Schema/Schema",LZ;var yD=w(()=>{Qe();Ps();Mg();LZ={[Ng]:Ng,pipe(){return le(this,arguments)},annotate(e){return this.rebuild(Ur(this.ast,e))},annotateKey(e){return this.rebuild(Sd(this.ast,e))},check(...e){return this.rebuild(Fo(this.ast,e))}}});var Gme,SD;var ED=w(()=>{Gme=globalThis.Boolean,SD=Ir((e,t)=>e||t,!1)});function fk(e,t){let n={};for(let r of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;let o=t(r,e[r]);if(o){let[s,i]=o;U(n,s,i)}}return n}function kD(e,t){let n=t?.omitKeyWhen??(()=>!1);return Hp((r,o)=>{let s=Reflect.ownKeys(e),i={};for(let a of s){let c=e[a].combine(r[a],o[a]);if(n(c))continue;U(i,a,c)}return i})}var bD,wD,vD,lk,En=(e)=>e;var Dg=w(()=>{X();bD=p(2,(e,t)=>fk(e,(n,r)=>t.includes(n)?[n,r]:void 0)),wD=p(2,(e,t)=>fk(e,(n,r)=>!t.includes(n)?[n,r]:void 0)),vD=p(2,(e,t)=>({...e,...t})),lk=p(2,(e,t)=>fk(e,(n,r)=>[Object.hasOwn(t,n)?t[n]:n,r]))});function Pd(e){return Ir((t,n)=>{if(t===void 0)return n;if(n===void 0)return t;return e.combine(t,n)},void 0)}var ID=()=>{};function Do(e,t){if(t.length>0)e+=`
|
|
35
|
-
at ${Dp(t)}`;return Error(e)}var pk=w(()=>{kn()});function Ms(e){return Error(`Unable to derive an arbitrary for ${e}`)}function qZ(e,t,n){return t.reduce((r,o)=>r.filter((s)=>o.run(s,e,ja)===void 0),n)}function LD(e,t){if(e?.minLength!==void 0&&e.maxLength!==void 0&&e.minLength>e.maxLength)throw Ms(`${t} constraints`)}function jD(e){return e===void 0||e.minLength===void 0&&e.maxLength===void 0?void 0:{...e.minLength!==void 0?{minLength:e.minLength}:{},...e.maxLength!==void 0?{maxLength:e.maxLength}:{}}}function mk(e,t,n,r){return r?e.uniqueArray(t,{...n,comparator:r}):e.array(t,n)}function _D(e,t,n,r=!1){let o=t.constraint,s=jD(o);return LD(s,"array"),mk(e,n,r?{...s,maxLength:s?.minLength??0}:s,o?.unique?Y:void 0)}function $g(e,t,n,r){return t.chain((o)=>o.length<n?e.constant(o):r.map((s)=>[...o,...s]))}function RD(e,t){return e.chain((n)=>t.map((r)=>({...Object.fromEntries(r),...n})))}function PD(e,t,n,r,o,s){if(r===void 0||t===void 0)return r===void 0?[t,n]:[r,o];let i=e(t,r);return i===s?[r,o]:i===0?[t,n||o]:[t,n]}function GZ(e,t){if(e===void 0)return t;if(e.order!==t.order)throw Error("Cannot merge ordered arbitrary constraints with different Order instances");let[n,r]=PD(e.order,e.minimum,e.exclusiveMinimum,t.minimum,t.exclusiveMinimum,-1),[o,s]=PD(e.order,e.maximum,e.exclusiveMaximum,t.maximum,t.exclusiveMaximum,1);return{order:e.order,...n!==void 0?{minimum:n}:{},...r!==void 0?{exclusiveMinimum:r}:{},...o!==void 0?{maximum:o}:{},...s!==void 0?{exclusiveMaximum:s}:{}}}function JZ(e,t){let{ordered:n,...r}=e??{},{ordered:o,...s}=t,i=o===void 0?n:GZ(n,o);return{...VZ.combine(r,s),...i===void 0?{}:{ordered:i}}}function FD(e){let t=[],n=[];function r(o){if(o.annotations?.arbitrary)n.push(o.annotations.arbitrary);if(o._tag!=="Filter")for(let s of o.checks)r(s);else t.push(o)}return e?.forEach(r),{filters:t,arbitraries:n}}function ZZ(e){let t=e.map(({constraint:n})=>n).filter(Le);return(n)=>{let r=t.reduce((o,s)=>JZ(o,s),n.constraint);return{...n,constraint:r}}}function Fd(e){return{...e,constraint:void 0}}function MD(e,t,n){if(t===void 0||t.minLength===void 0&&t.maxLength===void 0)return;if(t.minLength!==void 0&&e.indexSignatures.length===0&&t.minLength>e.propertySignatures.length)throw Ms("object property constraints");let r={};if(t.minLength!==void 0)r.minLength=Math.max(0,t.minLength-n);if(t.maxLength!==void 0){if(r.maxLength=t.maxLength-n,r.maxLength<0)throw Ms("object property constraints")}return LD(r,"object property"),r}function YZ(e,t,n,r,o,s){let i=r.length;if(s.maxLength!==void 0&&s.maxLength<i)throw Ms("object property constraints");let a=s.minLength===void 0?0:Math.max(0,s.minLength-i),c=s.maxLength===void 0?o.length:Math.min(o.length,s.maxLength-i);if(a>c)throw Ms("object property constraints");let u=e.record(t,{requiredKeys:[...r,...o]}),l=e.shuffledSubarray([...o],{minLength:a,maxLength:c});return e.tuple(u,l).map(([f,d])=>{let m=new Set([...r,...d]),g={};for(let b of n)if(m.has(b))U(g,b,f[b]);return g})}function BD(e,t,n,r){let o={};if(e?.minimum!==void 0)o.min=t(e.minimum,e.exclusiveMinimum===!0);if(e?.maximum!==void 0)o.max=n(e.maximum,e.exclusiveMaximum===!0);if(o.min!==void 0&&o.max!==void 0&&o.min>o.max)throw Ms(r);return o}function QZ(e){return BD(e,(t,n)=>n?Math.floor(t)+1:Math.ceil(t),(t,n)=>n?Math.ceil(t)-1:Math.floor(t),"integer constraints")}function XZ(e,t){let n={...e?.noInfinity?{noDefaultInfinity:!0}:{},...e?.noNaN?{noNaN:!0}:{},...t?.minimum!==void 0?{min:t.minimum}:{},...t?.exclusiveMinimum!==void 0?{minExcluded:t.exclusiveMinimum}:{},...t?.maximum!==void 0?{max:t.maximum}:{},...t?.exclusiveMaximum!==void 0?{maxExcluded:t.exclusiveMaximum}:{}};if(n.min!==void 0&&n.max!==void 0&&(n.min>n.max||n.min===n.max&&(n.minExcluded||n.maxExcluded)))throw Ms("number constraints");return n}function eY(e){return BD(e,(t,n)=>n?t+BigInt(1):t,(t,n)=>n?t-BigInt(1):t,"the ordered bigint constraints")}function zu(e,t){let n=(r,o,s=OD)=>e(r,o,s);return n.terminal=(r,o,s=OD)=>t(r,o,s),n}function Lr(e){return zu(e,e)}function ND(e,t){let n=TD.get(t)??e.createDepthIdentifier();return TD.set(t,n),{maxDepth:2,depthIdentifier:n}}function DD(e,t){return t.length===0?void 0:t.length===1?t[0]:e.oneof(...t)}function nY(e){return{...e,constraint:tY}}function rY(e,t,n,r){let o=r===void 0?[]:[{arbitrary:r,weight:1}];for(let{candidate:s}of n){if(!s)continue;let i=s.make(e,t);if(i===void 0)continue;let a=s.weight??1;if(!globalThis.Number.isInteger(a)||a<=0)throw Ms("a candidate with an invalid weight");o.push({arbitrary:i,weight:a})}return o.length===0?void 0:o.length===1?o[0].arbitrary:e.oneof(...o)}function $D(e,t,n,r,o){let s=rY(n,r,t.arbitraries,o);return s===void 0?void 0:qZ(e,t.filters,s)}function oY(e,t){if(!(typeof e==="object"&&e!==null&&("arbitrary"in e)))return{arbitrary:e,terminal:t?void 0:e};let n="terminal"in e?e.terminal:t?void 0:e.arbitrary;return{arbitrary:e.arbitrary,terminal:n}}function sY(e,t,n,r,o){return e.map((s)=>({arbitrary:o?t.constant(null).chain(()=>s(t,n,r)):s(t,n,r),terminal:s.terminal(t,n,r)}))}function UD(e,t,n,r){let o=ZZ(t.arbitraries);return zu((s,i,a)=>{let c=o(i);return $D(e,t,s,c,n(s,i,c,a))},(s,i,a)=>{let c=o(i);return $D(e,t,s,c,r(s,i,c,a))})}function jr(e,t){let n=_o(e)?.toArbitrary;if(n){let r=Mi(e)?e.typeParameters.map((i)=>jr(i,t)):[],o=FD(e.checks),s=(i)=>(a,c,u,l)=>oY(n(sY(r,a,Fd(c),l,i))(a,u),r.length>0)[i?"terminal":"arbitrary"];return UD(e,o,s(!1),s(!0))}if(e.checks){let r=FD(e.checks),o=jr(lg(e,void 0),t);return UD(e,r,(s,i,a,c)=>o(s,a,c),(s,i,a,c)=>o.terminal(s,a,c))}return iY(e,t)}function iY(e,t){switch(e._tag){case"Never":case"Declaration":throw Do(`Unsupported AST ${e._tag}`,t);case"Null":return Lr((n)=>n.constant(null));case"Void":case"Undefined":return Lr((n)=>n.constant(void 0));case"Unknown":case"Any":return Lr((n)=>n.anything());case"String":return Lr((n,r)=>{let o=r.constraint,s=o?.patterns;return s?n.oneof(...s.map((i)=>n.stringMatching(new RegExp(i)))):n.string(jD(o))});case"Number":return Lr((n,r)=>{let o=r.constraint,s=o?.ordered?.order===rr?o.ordered:void 0;return o?.integer?n.integer(QZ(s)):n.float(XZ(o,s))});case"Boolean":return Lr((n)=>n.boolean());case"BigInt":return Lr((n,r)=>{let o=r.constraint?.ordered?.order===Cr?r.constraint.ordered:void 0;return n.bigInt(eY(o))});case"Symbol":return Lr((n)=>n.string().map(Symbol.for));case"Literal":return Lr((n)=>n.constant(e.literal));case"UniqueSymbol":return Lr((n)=>n.constant(e.symbol));case"ObjectKeyword":return Lr((n)=>n.oneof(n.object(),n.array(n.anything())));case"Enum":return jr(I1(e),t);case"TemplateLiteral":{let n=e.parts.map((r,o)=>jr(Jn(r),[...t,o]));return Lr((r,o,s)=>r.tuple(...n.map((i)=>i(r,nY(o),s))).map((i)=>i.map((a)=>globalThis.String(a)).join("")))}case"Arrays":{let n=e.elements.map((i,a)=>({ast:i,arbitrary:jr(i,[...t,a])})),r=e.elements.length,o=e.rest.map((i,a)=>({ast:i,arbitrary:jr(i,[...t,r+a])})),s=(i,a,c)=>{let u=Fd(a),l=[],f=[],d=0;for(let C of n){let S=C.arbitrary.terminal(i,u,c);if(bt(C.ast)){f.push(S);continue}if(S===void 0)return;d++,l.push(S.map(_))}let m=a.constraint?.minLength??0,b=Hn(o)&&m>d+f.length?f.length:Math.max(0,m-d),x=0;for(let C of f){if(x>=b||C===void 0){l.push(i.constant(O()));continue}x++,d++,l.push(C.map(_))}if(x<b)return;let I=i.tuple(...l).map(mS);if(Hn(o)){let[C,...S]=o,y=e.elements.length===0?a:u,h=Math.max(0,m-d-S.length),E=h===0?void 0:C.arbitrary.terminal(i,u,c);if(h>0&&E===void 0)return;let k=h===0?i.constant([]):_D(i,{...y,constraint:{...y.constraint,minLength:h}},E,!0);if(I=$g(i,I,r,k),S.length>0){let T=[];for(let N of S){let R=N.arbitrary.terminal(i,u,c);if(R===void 0)return;T.push(R)}let F=i.tuple(...T);I=$g(i,I,r,F)}}return I};return zu((i,a,c)=>{let u=Fd(a),l=n.map(({ast:d,arbitrary:m})=>{let g=m(i,u,c);return bt(d)?g.chain((b)=>i.boolean().map((x)=>x?_(b):O())):g.map(_)}),f=i.tuple(...l).map((d)=>mS(UC(d,Ee)));if(Hn(o)){let[d,...m]=o.map(({arbitrary:b})=>b(i,u,c)),g=_D(i,e.elements.length===0?a:u,d);if(f=$g(i,f,r,g),m.length>0){let b=i.tuple(...m);f=$g(i,f,r,b)}}if(a.recursion){let d=s(i,a,c);if(d!==void 0)return i.oneof(a.recursion,d,f)}return f},s)}case"Objects":{let n=e.propertySignatures.map((s)=>({ps:s,arbitrary:jr(s.type,[...t,s.name])})),r=e.indexSignatures.map((s)=>({is:s,parameter:jr(s.parameter,t),type:jr(s.type,t)}));return zu((s,i,a)=>{let c=Fd(i),u={},l=[],f=[],d=[];for(let{ps:x,arbitrary:I}of n){let C=x.name;if(l.push(C),bt(x.type))d.push(C);else f.push(C);U(u,C,I(s,c,a))}let m=i.constraint;if(d.length>0&&r.length===0&&m!==void 0&&(m.minLength!==void 0||m.maxLength!==void 0))return YZ(s,u,l,f,d,m);let g=s.record(u,{requiredKeys:f}),b=MD(e,i.constraint,f.length);for(let{parameter:x,type:I}of r){let C=s.tuple(x(s,c,a),I(s,c,a)),S=mk(s,C,b,AD);g=RD(g,S)}return g},(s,i,a)=>{let c=Fd(i),u={},l=[],f=[];for(let{ps:x,arbitrary:I}of n){let C=x.name,S=I.terminal(s,c,a);if(bt(x.type)){if(S!==void 0)f.push([C,S]);continue}if(S===void 0)return;l.push(C),U(u,C,S)}let d=Math.max(0,(i.constraint?.minLength??0)-l.length);for(let[x,I]of f){if(d===0)break;d--,l.push(x),U(u,x,I)}if(d>0&&e.indexSignatures.length===0)return;let m=s.record(u,{requiredKeys:l}),g=MD(e,i.constraint,l.length),b=g?.minLength??0;for(let{parameter:x,type:I}of r){let C;if(b===0)C=s.constant([]);else{let S=x.terminal(s,c,a),y=I.terminal(s,c,a);if(S===void 0||y===void 0)return;C=mk(s,s.tuple(S,y),{...g,maxLength:b},AD)}m=RD(m,C)}return m})}case"Union":{let n=e.types.map((o)=>jr(o,t)),r=(o,s,i)=>DD(o,n.map((a)=>a.terminal(o,s,i)).filter(Le));return zu((o,s,i)=>{let a=n.map((u)=>u(o,s,i));if(s.recursion){let u=r(o,s,i);if(u!==void 0)return o.oneof(s.recursion,u,...a)}let c=DD(o,a);if(c===void 0)throw Ms("a union with no members");return c},r)}case"Suspend":{let n=CD.get(e);if(n)return n;let r=Ha(()=>jr(e.thunk(),t)),o=zu((s,i,a)=>{let c=ND(s,e),u={...i,recursion:c},l=a.includes(e)?a:[...a,e],f=r().terminal(s,u,l);if(f===void 0)throw Do("Unable to derive an arbitrary for a recursive schema without a finite generation path",t);return s.oneof(c,f,s.constant(null).chain(()=>r()(s,u,l)))},(s,i,a)=>{if(a.includes(e))return;let c=ND(s,e);return r().terminal(s,{...i,recursion:c},[...a,e])});return CD.set(e,o),o}}}var CD,TD,OD,AD=([e],[t])=>Y(e,t),zZ,WZ,Ug,KZ,VZ,tY,HD;var qD=w(()=>{An();ED();yt();X();Xm();_e();ia();he();Ps();Dg();ID();pk();Ti();CD=new WeakMap,TD=new WeakMap,OD=[];zZ=Pd(oR),WZ=Pd(sR),Ug=Pd(SD),KZ=Pd(LC()),VZ=kD({integer:Ug,maxLength:WZ,minLength:zZ,noInfinity:Ug,noNaN:Ug,patterns:KZ,unique:Ug},{omitKeyWhen:Gs});tY={noInfinity:!0,noNaN:!0};HD=Qt((e)=>jr(e,[]))});function $i(e,t){let n=_o(e)?.toEquivalence;if(n)return n(Mi(e)?e.typeParameters.map((r)=>$i(r,t)):[]);switch(e._tag){case"Never":return oC();case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return Y;case"Arrays":{let r=e.elements.map((i,a)=>$i(i,[...t,a])),o=e.elements.length,s=e.rest.map((i,a)=>$i(i,[...t,o+a]));return Kt((i,a)=>{if(!Array.isArray(i)||!Array.isArray(a))return!1;let c=i.length;if(c!==a.length)return!1;let u=0;for(;u<Math.min(c,e.elements.length);u++)if(!r[u](i[u],a[u]))return!1;if(s.length>0){let[l,...f]=s;for(;u<c-f.length;u++)if(!l(i[u],a[u]))return!1;for(let d=0;d<f.length;d++)if(!f[d](i[u+d],a[u+d]))return!1}return!0})}case"Objects":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return Y;let r=e.propertySignatures.map((s)=>$i(s.type,[...t,s.name])),o=e.indexSignatures.map((s)=>$i(s.type,t));return Kt((s,i)=>{if(!fn(s)||!fn(i))return!1;for(let a=0;a<r.length;a++){let c=e.propertySignatures[a],u=c.name,l=Object.hasOwn(s,u),f=Object.hasOwn(i,u);if(bt(c.type)){if(l!==f)return!1}if(l&&f&&!r[a](s[u],i[u]))return!1}for(let a=0;a<o.length;a++){let c=e.indexSignatures[a],u=La(s,c.parameter),l=La(i,c.parameter);if(u.length!==l.length)return!1;for(let f=0;f<u.length;f++){let d=u[f];if(!Object.hasOwn(i,d)||!o[a](s[d],i[d]))return!1}}return!0})}case"Union":{let r=sn(e).types,o=new Map(r.map((s,i)=>[s,[Ad(s),$i(e.types[i],t)]]));return Kt((s,i)=>{let a=md(s,r);for(let c=0;c<a.length;c++){let[u,l]=o.get(a[c]);if(u(s)&&u(i))return l(s,i)}return!1})}case"Suspend":{let r=Ha(()=>$i(e.thunk(),t));return Kt((o,s)=>r()(o,s))}}}var zD;var WD=w(()=>{yt();Xo();X();he();Ps();Mg();Ti();zD=Qt((e)=>$i(e,[]))});function Ka(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Wu(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function VD(e,t){return e===t||e===(t.endsWith("#")?t.slice(0,-1):`${t}#`)}function ZD(e){return{dialect:"draft-07",...gY(e,CY)}}function lY(e,t){return n(e,!1,!0);function n(r,o,s=!1){if(!fn(r))return r;let i=o||!s&&XD(r.$id),a={};for(let c of Object.keys(r)){let u=r[c],l=u;switch(c){case"$defs":case"properties":case"patternProperties":case"dependentSchemas":l=gk(u,(f)=>n(f,i))??u;break;case"allOf":case"anyOf":case"oneOf":case"prefixItems":l=Array.isArray(u)?u.map((f)=>n(f,i)):u;break;case"not":case"additionalProperties":case"propertyNames":case"unevaluatedProperties":case"items":case"contains":case"unevaluatedItems":case"if":case"then":case"else":case"contentSchema":l=n(u,i)}U(a,c,l)}return t(a,i),a}}function YD(e,t){return lY(e,(n)=>{fY(n,t)})}function fY(e,t){if(typeof e.$ref==="string")U(e,"$ref",t(e.$ref,"$ref"));if(typeof e.$dynamicRef==="string")U(e,"$dynamicRef",t(e.$dynamicRef,"$dynamicRef"))}function gk(e,t){if(!fn(e))return;let n={};for(let r of Object.keys(e))U(n,r,t(e[r],r));return n}function dY(e,t,n){let r=new Map,o=[],s=hk;function i(d,m=[],g=[]){if(m.length===0&&t?.trackIds){let b=fn(d)?l(d):void 0;s=GD(b,hk)??hk}return u(d,m,g,{sourceRoot:[],targetRoot:[],uri:s})}function a(){for(let[d,m,g]of o){let b=m,x=QD(m,g);if(x!==void 0){let I=pY(x.hash);if(x.hash="",I!==void 0){let C=r.get(JD(x.href,I));if(C!==void 0)b=mY(m,C)}}U(d,"$ref",b)}}let c=n(i);return a(),c;function u(d,m,g,b){if(typeof d==="boolean")return f(m,g,b),t?.booleanAdapter?.(d)??d;if(!fn(d))return d;let x=b,I=l(d);if(m.length>0&&t?.trackIds&&XD(I)){let y=GD(I,b.uri);if(y!==void 0)x={parent:b,sourceRoot:m,targetRoot:g,uri:y}}f(m,g,x);let C=x.uri,S={isDocumentRoot:m.length===0,schema(y,h,E=h){return u(y,[...m,h],[...g,E],x)},schemaAt(y,h,E){return u(y,[...m,...h],[...g,...E],x)},schemaArray(y,h,E=h){return Array.isArray(y)?y.map((k,T)=>u(k,[...m,h,String(T)],[...g,E,String(T)],x)):y},schemaMap(y,h,E=h){if(!fn(y))return y;return gk(y,(k,T)=>u(k,[...m,h,T],[...g,E,T],x))},reference(y,h){if(typeof h==="string")o.push([y,h,C]);else U(y,"$ref",h)}};return e(d,S)}function l(d){return t?.ignoreRefSiblings===!0&&typeof d.$ref==="string"?void 0:d.$id}function f(d,m,g){if(g.parent!==void 0)f(d,m,g.parent);r.set(JD(g.uri,d.slice(g.sourceRoot.length)),m.slice(g.targetRoot.length))}}function QD(e,t){return URL.canParse(e,t)?new URL(e,t):void 0}function GD(e,t){if(typeof e!=="string")return;let n=QD(e,t);if(n===void 0)return;return n.hash="",n.href}function pY(e){if(e.length===0)return[];let t;try{t=decodeURIComponent(e.slice(1))}catch{return}if(!t.startsWith("/"))return;return/~(?:[^01]|$)/.test(t)?void 0:t.slice(1).split("/").map(Wu)}function mY(e,t){let n=e.indexOf("#");if(n===-1&&t.length===0)return e;return`${n===-1?e:e.slice(0,n)}${hY(t)}`}function hY(e){return e.length===0?"#":`#/${e.map((t)=>encodeURI(Ka(t)).replace(/#/g,"%23")).join("/")}`}function JD(e,t){return`${e}\x00${JSON.stringify(t)}`}function XD(e){return typeof e==="string"&&e.length>0&&e[0]!=="#"}function gY(e,t,n){return dY(t,{...n,trackIds:!0},(r)=>({schema:r(e.schema),definitions:gk(e.definitions,(o,s)=>r(o,["$defs",s],["definitions",s]))}))}function EY(e,t,n,r,o,s=xY){let i;if(s.has(t))i=r.schemaMap(n,t);else if(yY.has(t))i=r.schemaArray(n,t);else if(o.has(t))i=r.schema(n,t);else return!1;return U(e,t,i),!0}function Va(e,t,n){throw Error(`Cannot convert JSON Schema keyword "${e}" to ${t}: ${n}`)}function vY(e,t,n,r){for(let o of t)if(Object.hasOwn(e,o))Va(o,n,`it is not active in ${r} but would become active in the target`)}function IY(e,t,n,r,o){if(n.isDocumentRoot)U(e,"$schema",VD(t,KD)?r:t);else if(!VD(t,KD))Va("$schema",o,"an embedded resource cannot declare a different dialect")}function CY(e,t){vY(e,kY,"Draft-07","Draft 2020-12");let n={},r=void 0,o=void 0,s=void 0;for(let i of Object.keys(e)){let a=e[i];if(EY(n,i,a,t,SY))continue;switch(i){case"$ref":r=a;break;case"$schema":IY(n,a,t,uY,"Draft-07");break;case"$id":case"$anchor":break;case"$defs":U(n,"definitions",t.schemaMap(a,i,"definitions"));break;case"prefixItems":o=a;break;case"items":s=a;break;case"dependentRequired":case"dependentSchemas":case"minContains":case"maxContains":break;case"$dynamicRef":case"$dynamicAnchor":case"$vocabulary":case"unevaluatedProperties":case"unevaluatedItems":Va(i,"Draft-07","the target dialect has no equivalent");case"required":if(Array.isArray(a)&&a.length===0)break;U(n,i,a);break;default:U(n,i,a)}}if(TY(n,o,s,t),Object.hasOwn(e,"contains")){let{minContains:i,maxContains:a}=e;if(i!==void 0&&i!==1||a!==void 0)Va("minContains/maxContains","Draft-07","contains cardinality cannot be represented");if(Object.hasOwn(e,"minContains"))U(n,"minContains",i)}else{if(Object.hasOwn(e,"minContains"))U(n,"minContains",e.minContains);if(Object.hasOwn(e,"maxContains"))U(n,"maxContains",e.maxContains)}return AY(e,n,t,"draft-07"),RY(e,n,"$id","Draft-07"),OY(n,r,t),n}function TY(e,t,n,r){if(t===void 0){if(n!==void 0)U(e,"items",r.schema(n,"items"));return}if(U(e,"items",r.schemaArray(t,"prefixItems","items")),n!==void 0)U(e,"additionalItems",r.schema(n,"items","additionalItems"))}function OY(e,t,n){if(t===void 0)return;if(typeof t==="string"&&Object.keys(e).length>0){let r={};n.reference(r,t),_Y(e,r)}else n.reference(e,t)}function AY(e,t,n,r){let o=fn(e.dependentRequired)?e.dependentRequired:void 0,s=fn(e.dependentSchemas)?e.dependentSchemas:void 0;if(o===void 0&&s===void 0)return;let i={},a=new Set([...Object.keys(o??{}),...Object.keys(s??{})]);for(let c of a){let u=o?.[c],l=s?.[c],f=r==="draft-04"&&Array.isArray(u)&&u.length===0;if(l===void 0){if(!f)U(i,c,u)}else if(u===void 0||f)U(i,c,n.schemaAt(l,["dependentSchemas",c],["dependencies",c]));else U(i,c,{allOf:[n.schemaAt(l,["dependentSchemas",c],["dependencies",c,"allOf","0"]),{required:u}]})}if(Object.keys(i).length>0)U(t,"dependencies",i)}function _Y(e,t){if(Array.isArray(e.allOf))e.allOf.push(t);else U(e,"allOf",[t])}function RY(e,t,n,r){let{$id:o,$anchor:s}=e;if(s===void 0){if(o!==void 0)U(t,n,o);return}if(typeof s!=="string"||!bY.test(s))Va("$anchor",r,"the anchor is not valid");if(!wY.test(s))Va("$anchor",r,"the anchor cannot be represented as a plain-name fragment identifier");if(o===void 0)U(t,n,`#${s}`);else Va("$anchor",r,"it cannot be combined with the schema $id")}var uY="http://json-schema.org/draft-07/schema#",KD="https://json-schema.org/draft/2020-12/schema",hk="https://effect.invalid/.json-schema/",xY,yY,SY,e$,rhe,ohe,bY,wY,kY;var xk=w(()=>{he();xY=new Set(["properties","patternProperties"]),yY=new Set(["allOf","anyOf","oneOf"]),SY=new Set(["not","additionalProperties","propertyNames","contains","if","then","else","contentSchema"]);e$=["$anchor","$defs","$dynamicAnchor","$dynamicRef","$vocabulary","contentSchema","dependentRequired","dependentSchemas","maxContains","minContains","prefixItems","unevaluatedItems","unevaluatedProperties"],rhe=[...e$,"deprecated"],ohe=[...e$,"$comment","$id","$schema","const","contains","contentEncoding","contentMediaType","else","examples","if","patternProperties","propertyNames","then"],bY=/^[A-Za-z_][-A-Za-z0-9._]*$/,wY=/^[A-Za-z][-A-Za-z0-9._:]*$/;kY=["additionalItems","definitions","dependencies"]});var she,Ku=(e)=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var yk=w(()=>{she=globalThis.RegExp});function Md(e,t){if(e===void 0)return;let n={},r=e.title;if(typeof r==="string")n.title=r;let{description:o,expected:s}=e;if(typeof o==="string")n.description=o;else if(t?.generateDescriptions===!0&&typeof s==="string")n.description=s;let i=e.default;if($u(i))n.default=i;let a=e.examples;if(Array.isArray(a)&&$u(a))n.examples=a;let c=e.readOnly;if(typeof c==="boolean")n.readOnly=c;let u=e.writeOnly;if(typeof u==="boolean")n.writeOnly=u;let l=e.format;if(typeof l==="string")n.format=l;let f=e.contentEncoding;if(typeof f==="string")n.contentEncoding=f;let d=e.contentMediaType;if(typeof d==="string")n.contentMediaType=d;let m=e.contentSchema;if($u(m))n.contentSchema=m;if(t?.includeAnnotationKey!==void 0)for(let[g,b]of Object.entries(e)){if(FY.has(g)||!t.includeAnnotationKey(g))continue;if($u(b))U(n,g,b)}return Object.keys(n).length===0?void 0:n}function r$(e){let t=e.type==="number"||e.type==="integer"?e.type:void 0,n=e;if(t!==void 0)n={...e},delete n.type;if(Array.isArray(n.allOf)){let r=[],o=!1;for(let s of n.allOf){let i=r$(s);if(i.type!==void 0){if(o=!0,t===void 0||i.type==="integer")t=i.type}if(Object.keys(i.schema).length>0)r.push(i.schema)}if(o){let{allOf:s,...i}=n;n=r.length===0?i:{...i,allOf:r}}}return{type:t,schema:n}}function MY(e){return Array.isArray(e.anyOf)&&e.anyOf.length===4&&e.anyOf[0]?.type==="number"&&e.anyOf.slice(1).every((t)=>t.type==="string")}function Sk(e,t){return Object.keys(e).every((n)=>t.includes(`|${n}|`))}function n$(e,t){return typeof e.$ref!=="string"&&t.every((n)=>!Object.hasOwn(e,n))}function Nd(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let o=e.type==="number"||e.type==="integer"?e.type:void 0,s=MY(e);if(o!==void 0||s){let a=r$(t);if(a.type!==void 0){let c=o==="integer"||a.type==="integer"?"integer":"number",u={...e,type:c};if(s)delete u.anyOf;let l=Object.keys(a.schema);if(l.length===0)return u;return Sk(a.schema,Ek)&&n$(u,l)?{...u,...a.schema}:Nd(u,a.schema,n)}}if(n&&n$(e,r))return{...e,...t};let i=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];if(Array.isArray(e.allOf))return{...e,allOf:[...e.allOf,...i]};if(typeof e.$ref==="string")return{allOf:[e,...i]};return{...e,allOf:i}}function DY(e,t,n,r){let o=new Map,s=new WeakMap,i=new Map,a=!1,c=Object.keys(n);for(let S of c)f(S,["references",S]);let u=jt(e,(S,y)=>d(x(S,t[y]))),l={};for(let S of c){let y=o.get(S);if(typeof y!=="string")U(l,S,d(y))}return{dialect:"draft-2020-12",schemas:u,definitions:l};function f(S,y){let h=o.get(S);if(h!==void 0)return typeof h==="string"?h:S;if(!Object.hasOwn(n,S))throw Do(`Invalid reference ${S}`,[...y,"$ref"]);o.set(S,null);let E=n[S],k=x(E,["references",S]),T=m(E);if(T!==void 0){let F=i.get(T),N=F?.find((R)=>Y(o.get(R),k));if(N===void 0)if(F===void 0)i.set(T,[S]);else F.push(S);else return a=!0,o.set(S,N),N}return o.set(S,k),S}function d(S){if(!a)return S;return YD(S,(y)=>y.replace(/^#\/\$defs\/([^/]*)/,(h,E)=>{let k=o.get(Wu(E));return typeof k==="string"?`#/$defs/${Ka(k)}`:h}))}function m(S){if(S._tag==="Reference")return;let y=S.checks.length===0?S.annotations:S.checks[S.checks.length-1].annotations;return typeof y?.identifier!=="string"&&typeof y?.[Ma]==="string"?y[Ma]:void 0}function g(S,y){return S?.schemas?.map((h,E)=>x(h,[...y,"schemas",E]))??[]}function b(S,y,h){let E=S.annotations,k=E?.toJsonSchema;if(k!==void 0){let R=g(S.representation,[...h,"representation"]),z=k({type:y,schemas:R}),q=Md(E,r),ue=q===void 0?z:{...z,...q},ut=q===void 0?o$:NY;return S._tag==="Filter"&&Sk(ue,ut)&&(q===void 0||Sk(q,Ek))?[ue,!0]:[ue]}if(S._tag==="Filter")return;let T=S.checks.map((R,z)=>b(R,y,[...h,"checks",z])).filter((R)=>R!==void 0);if(T.length===0)return;let F=Md(E,r),N=T.map(([R])=>R);return[F===void 0?{allOf:N}:{allOf:N,...F}]}function x(S,y){if(S._tag==="Reference"){let T=f(S.$ref,y);return{$ref:`#/$defs/${Ka(T)}`}}let h=s.get(S);if(h!==void 0)return h;let E=I(S,y),k=Md(S.annotations,r);if(k!==void 0)E={...E,...k};for(let T=0;T<S.checks.length;T++){let F=typeof E.type==="string"&&$Y(E.type)?E.type:void 0,N=b(S.checks[T],F,[...y,"checks",T]);if(N!==void 0)E=Nd(E,...N)}return s.set(S,E),E}function I(S,y){switch(S._tag){case"Any":case"Unknown":return{};case"ObjectKeyword":return{anyOf:[{type:"object"},{type:"array"}]};case"Void":case"Undefined":case"Null":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return{};case"Suspend":return x(S.thunk,[...y,"thunk"]);case"Never":return{not:{}};case"String":return{type:"string"};case"Number":return{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let h=S.literal;return typeof h==="bigint"?{type:"string",enum:[globalThis.String(h)]}:{type:typeof h,enum:[h]}}case"Enum":{let h=S.enums.map(([E,k])=>typeof k==="number"&&!globalThis.Number.isFinite(k)?{type:"string",enum:[globalThis.String(k)],title:E}:{type:typeof k,enum:[k],title:E});return h.length===0?{not:{}}:{anyOf:h}}case"TemplateLiteral":return{type:"string",pattern:`^${S.parts.map(Lg).join("")}$`};case"Arrays":{if(S.rest.length>1)throw Do("Invalid schema representation document",[...y,"rest"]);let h={type:"array"},E=S.elements.length,k=S.elements.map((T,F)=>{if(T.isOptional)E--;let N=x(T.type,[...y,"elements",F,"type"]),R=Md(T.annotations,r);return R===void 0?N:Nd(N,R)});if(k.length>0){if(h.prefixItems=k,h.maxItems=S.elements.length,E>0)h.minItems=E}else h.items=!1;if(S.rest.length===1){delete h.maxItems;let T=x(S.rest[0],[...y,"rest",0]);if(Object.keys(T).length>0)h.items=T;else delete h.items}return h}case"Objects":{if(S.propertySignatures.length===0&&S.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let h={type:"object"},E={},k=[];for(let R=0;R<S.propertySignatures.length;R++){let z=S.propertySignatures[R];if(typeof z.name!=="string")throw Do("Invalid schema representation document",[...y,"propertySignatures",R,"name"]);let q=z.name,ue=x(z.type,[...y,"propertySignatures",R,"type"]),ut=Md(z.annotations,r);if(U(E,q,ut===void 0?ue:Nd(ue,ut)),!z.isOptional)k.push(q)}if(S.propertySignatures.length>0)h.properties=E;if(k.length>0)h.required=k;let T={},F=[];for(let R=0;R<S.indexSignatures.length;R++){let z=S.indexSignatures[R],q=x(z.type,[...y,"indexSignatures",R,"type"]);if(Object.keys(q).length===1&&"not"in q)q=!1;let ue=C(z.parameter,[...y,"indexSignatures",R,"parameter"],new Set);if(ue.length===0)F.push(q);else for(let ut of ue){let Ks=T[ut];U(T,ut,Ks===void 0?q:Ks===!1||q===!1?!1:Nd(Ks,q))}}let N=Object.keys(T).length>0;if(N)h.patternProperties=T;if(S.indexSignatures.length===0)h.additionalProperties=r?.additionalProperties??!1;else if(F.length===1&&S.propertySignatures.length===0&&!N)h.additionalProperties=F[0];else if(F.length>0)h.allOf=F.map((R)=>({type:"object",additionalProperties:R}));if(typeof h.additionalProperties==="object"&&h.additionalProperties!==null&&Object.keys(h.additionalProperties).length===0)delete h.additionalProperties;return h}case"Union":{let h=S.types.map((E,k)=>x(E,[...y,"types",k]));if(h.length===0)return{not:{}};if(S.mode==="anyOf"&&h.length>1){let E=UY(h);if(E!==void 0)return E}return S.mode==="anyOf"?{anyOf:h}:{oneOf:h}}}}function C(S,y,h){switch(S._tag){case"Reference":{if(!Object.hasOwn(n,S.$ref))throw Do(`Invalid reference ${S.$ref}`,[...y,"$ref"]);if(f(S.$ref,y),h.has(S.$ref))return[];let E=new Set(h).add(S.$ref);return C(n[S.$ref],["references",S.$ref],E)}case"String":return s$(x(S,y));case"TemplateLiteral":return[`^${S.parts.map(Lg).join("")}$`];case"Union":return S.types.flatMap((E,k)=>C(E,[...y,"types",k],h));default:throw Do("Invalid schema representation document",y)}}}function $Y(e){return e==="string"||e==="number"||e==="boolean"||e==="array"||e==="object"||e==="null"||e==="integer"}function UY(e){let t=void 0,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;n.push(...r.enum)}return{type:t,enum:n}}function s$(e){let t=[];if(typeof e.pattern==="string")t.push(e.pattern);for(let n of["allOf","anyOf","oneOf"]){let r=e[n];if(Array.isArray(r)){for(let o of r)if(typeof o==="object"&&o!==null&&!Array.isArray(o))t.push(...s$(o))}}return t}function Lg(e){switch(e._tag){case"Literal":return Ku(globalThis.String(e.literal));case"String":return T1;case"Number":return tg;case"TemplateLiteral":return e.parts.map(Lg).join("");case"Union":return e.types.map(Lg).join("|");default:throw Do("Invalid schema representation document",[])}}function i$(e,t){let n=DY([e.representation],[["representation"]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var FY,o$="|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|",Ek="|title|description|default|examples|readOnly|writeOnly|",NY;var a$=w(()=>{An();yt();xk();yk();Ps();pk();Ti();FY=new Set([...gF,Ma,...mF]);NY=o$+Ek});function lo(e){return e===void 0?void 0:{annotations:e}}function bk(e,t){let{references:n,representations:r}=BY([e],t);return{representation:r[0],references:n}}function BY(e,t){let n={},r=new Map,o=new Set,s=new Map,i=new Set;for(let h of e)m(h);let a=t?.referencePolicy??jY;for(let h of s.values())for(let E of h.values()){let k=a({ast:E.ast,occurrences:E.occurrences,identifier:E.identifier});if(k!==void 0){let T=k===E.identifier||!k.endsWith("_")?"_":"";E.reference=u(k,E,T)}else if(E.isRecursive)E.reference=u(`${E.ast._tag}_`,E,"")}return{representations:jt(e,(h)=>b(h)),references:n};function u(h,E,k="_"){let T=h,F=0;while(r.has(T)){if(r.get(T)===E)return T;T=`${h}${k}${++F}`}return r.set(T,E),T}function l(h,E,k){let T=E.fallback;if(T!==void 0)return gw(h)===T?h:Ur(h,{[Ma]:T});return k===E.identifier?h:Ur(h,{identifier:k})}function f(h,E){if(!Object.hasOwn(n,h)&&!o.has(h)){o.add(h);let k=x(E);o.delete(h),U(n,h,k)}return{_tag:"Reference",$ref:h}}function d(h){let E=yd(h),k=bv(E),T=ku(E),F=T===void 0?(E!==h?ku(h):void 0)??gw(E):void 0;if(F!==void 0)T=`${F}Encoded`;let N=s.get(k);if(N===void 0)N=new Map,s.set(k,N);let R=N.get(T);if(R===void 0)R={ast:k,identifier:T,fallback:F,occurrences:0,isRecursive:!1,reference:void 0},N.set(T,R);return R}function m(h){let E=d(h),k=E.ast;if(E.occurrences++,i.has(E)){E.isRecursive=!0;return}if(E.occurrences>1)return;switch(i.add(E),g(k.checks),k._tag){case"Declaration":case"Arrays":case"Objects":case"Union":k.recur((T)=>(m(T),T));break;case"TemplateLiteral":k.parts.forEach(m);break;case"Suspend":m(k.thunk());break}i.delete(E)}function g(h){h?.forEach((E)=>{if(E.annotations?.representation?.schemas?.forEach((k)=>m(sn(k))),E._tag==="FilterGroup")g(E.checks)})}function b(h){let E=d(h),k=E.ast,T=E.reference;if(T!==void 0){let F=E.identifier===void 0?k:l(k,E,T);return f(T,F)}return x(k)}function x(h){let E=I(h.checks);switch(h._tag){case"Declaration":return{_tag:"Declaration",typeParameters:h.typeParameters.map((k)=>b(k)),checks:E,...S(h.annotations)};case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"String":case"Boolean":case"Number":case"BigInt":case"Symbol":case"ObjectKeyword":return{_tag:h._tag,checks:E,...lo(h.annotations)};case"Literal":return{_tag:"Literal",literal:h.literal,checks:E,...lo(h.annotations)};case"UniqueSymbol":return{_tag:"UniqueSymbol",symbol:h.symbol,checks:E,...lo(h.annotations)};case"Enum":return{_tag:"Enum",enums:h.enums,checks:E,...lo(h.annotations)};case"TemplateLiteral":return{_tag:"TemplateLiteral",parts:h.parts.map((k)=>b(k)),checks:E,...lo(h.annotations)};case"Arrays":return{_tag:"Arrays",elements:h.elements.map((k)=>{let T=yd(k),F=T.context?.annotations;return{isOptional:bt(T),type:b(k),...lo(F)}}),rest:h.rest.map((k)=>b(k)),checks:E,...lo(h.annotations)};case"Objects":return{_tag:"Objects",propertySignatures:h.propertySignatures.map((k)=>{let T=yd(k.type),F=T.context?.annotations;return{name:k.name,type:b(k.type),isOptional:bt(T),isMutable:w1(T),...lo(F)}}),indexSignatures:h.indexSignatures.map((k)=>({parameter:b(k.parameter),type:b(k.type)})),checks:E,...lo(h.annotations)};case"Union":return{_tag:"Union",types:h.types.map((k)=>b(k)),mode:h.mode,checks:E,...lo(h.annotations)};case"Suspend":return{_tag:"Suspend",checks:[],thunk:b(h.thunk()),...lo(h.annotations)}}}function I(h){return h?.map(C)??[]}function C(h){switch(h._tag){case"Filter":return{_tag:"Filter",aborted:h.aborted,...y(h.annotations)};case"FilterGroup":return{_tag:"FilterGroup",checks:jt(h.checks,C),...y(h.annotations)}}}function S(h){if(h===void 0)return;let{representation:E,...k}=h;return{...E===void 0?void 0:{representation:E},...Object.keys(k).length===0?void 0:{annotations:k}}}function y(h){if(h===void 0)return;let{representation:E,...k}=h,T=E===void 0?void 0:E.schemas===void 0?E:{...E,schemas:E.schemas.map((F)=>b(sn(F)))};return{...T===void 0?void 0:{representation:T},...Object.keys(k).length===0?void 0:{annotations:k}}}}var jY=({identifier:e})=>e;var c$=w(()=>{An();Ps();Ti()});function l$(e,t){let n=[];return wk(e,t,"",n),n}function wk(e,t,n,r){if(Object.is(e,t))return;if(Array.isArray(e)&&Array.isArray(t)){let o=e.length,s=t.length,i=Math.min(o,s);for(let a=0;a<i;a++)wk(e[a],t[a],`${n}/${a}`,r);for(let a=o-1;a>=s;a--)r.push({op:"remove",path:`${n}/${a}`});for(let a=o;a<s;a++)r.push({op:"add",path:`${n}/${a}`,value:t[a]});return}if(jg(e)&&jg(t)){let o=Object.keys(e),s=Object.keys(t),i=Array.from(new Set([...o,...s])).sort();for(let a of i){let c=`${n}/${Ka(a)}`,u=Object.hasOwn(e,a),l=Object.hasOwn(t,a);if(u&&l)wk(e[a],t[a],c,r);else if(!u&&l)r.push({op:"add",path:c,value:t[a]});else r.push({op:"remove",path:c})}return}r.push({op:"replace",path:n,value:t})}function f$(e,t){let n=t;for(let r of e)n=zY(n,r);return n}function jg(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function qY(e){if(e==="")return[];if(e.charCodeAt(0)!==47)throw Error(`Invalid JSON Pointer, it must start with "/": ${JSON.stringify(e)}`);return e.split("/").slice(1).map(Wu)}function d$(e){if(!/^(0|[1-9]\d*)$/.test(e))throw Error(`Invalid array index: "${e}"`);return Number(e)}function zY(e,t){if(t.path===""){if(t.op==="remove")throw Error("Unsupported operation at the root");return t.value}let n=WY(e,t.path);if(n===null)throw Error(`Cannot ${t.op} at "${t.path}" (parent not found or not a container).`);let{lastToken:r,parent:o,stack:s}=n;if(Array.isArray(o)){if(r==="-"&&t.op!=="add")throw Error(`"-" is not valid for ${t.op} at "${t.path}".`);let i=r==="-"?o.length:d$(r),a=t.op==="add"?o.length:o.length-1;if(i>a)throw Error(`Array index out of bounds at "${t.path}".`);let c=o.slice();if(t.op==="add")c.splice(i,0,t.value);else if(t.op==="remove")c.splice(i,1);else c[i]=t.value;return u$(s,c)}if(jg(o)){if(t.op!=="add"&&!Object.hasOwn(o,r))throw Error(`Property "${r}" does not exist at "${t.path}".`);let i={...o};if(t.op==="remove")delete i[r];else U(i,r,t.value);return u$(s,i)}throw Error(`Cannot ${t.op} at "${t.path}" (parent not found or not a container).`)}function WY(e,t){let n=qY(t);if(n.length===0)return null;let r=n[n.length-1],o=[],s=e;for(let i=0;i<n.length-1;i++){let a=n[i];if(Array.isArray(s)){let c=d$(a);if(c>=s.length)return null;o.push({container:s,token:c}),s=s[c];continue}if(jg(s)){if(!Object.hasOwn(s,a))return null;o.push({container:s,token:a}),s=s[a];continue}return null}return{stack:o,parent:s,lastToken:r}}function u$(e,t){let n=t;for(let r=e.length-1;r>=0;r--){let{container:o,token:s}=e[r];if(Array.isArray(o)){let i=o.slice();i[s]=n,n=i}else{let i={...o};U(i,s,n),n=i}}return n}var p$=()=>{};function g$(e,t){return fo(Vu("Iso",e,t))}function m$(e,t){return fo(Vu("Lens",e,t))}function Vu(e,t,n){return[{_tag:"PrimitiveNode",kind:e,get:t,set:n}]}class kk{_tag="PathNode";kind="Lens";path;get;set;constructor(e){this.path=e,this.get=(t)=>{let n=t;for(let r=0;r<e.length;r++)n=n[e[r]];return n},this.set=(t,n)=>{let r=Hg(n),o=r,s=0;for(;s<e.length-1;s++){let i=e[s];U(o,i,Hg(o[i])),o=o[i]}return U(o,e[s],t),r}}}class Bg{_tag="CheckNode";kind="Prism";checks;get;set=D;constructor(e){this.checks=e,this.get=(t)=>_1(e,t)}}function Ga(e,t){if(e.length===0)return t;if(t.length===0)return e;let n=e.slice();for(let r=0;r<t.length;r++){let o=t[r],s=n[n.length-1];if(s._tag==="PathNode"&&o._tag==="PathNode")n[n.length-1]=new kk([...s.path,...o.path]);else if(s._tag==="CheckNode"&&o._tag==="CheckNode")n[n.length-1]=new Bg([...s.checks,...o.checks]);else n.push(o)}return n}function GY(e,t){return fo(Vu("Optional",e,t))}class Dd{node;getResult;replaceResult;constructor(e,t,n){this.node=e,this.getResult=t,this.replaceResult=n}replace(e,t){return oi(this.replaceResult(e,t),()=>t)}modify(e){return(t)=>oi(si(this.getResult(t),(n)=>this.replaceResult(e(n),t)),()=>t)}compose(e){return fo(Ga(this.node,e.node))}key(e){return fo(Ga(this.node,[new kk([e])]))}optionalKey(e){return fo(Ga(this.node,Vu("Lens",(t)=>t[e],(t,n)=>{let r=Hg(n);if(t===void 0)if(Array.isArray(r)&&typeof e==="number")r.splice(e,1);else delete r[e];else U(r,e,t);return r})))}check(...e){return fo(Ga(this.node,[new Bg(e)]))}refine(e,t){return fo(Ga(this.node,[new Bg([ug(e,t)])]))}tag(e){let t=te(new we({expected:`${JSON.stringify(e)} tag`}));return fo(Ga(this.node,Vu("Prism",(n)=>n._tag===e?G(n):t,D)))}at(e,...t){let n=te(new Ft([e],new Da(void 0)));return fo(Ga(this.node,Vu("Optional",(r)=>Object.hasOwn(r,e)?G(r[e]):n,(r,o)=>{if(Object.hasOwn(o,e)){let s=Hg(o);return U(s,e,r),G(s)}else return n})))}pick(e){return this.compose(m$(bD(e),(t,n)=>({...n,...t})))}omit(e){return this.compose(m$(wD(e),(t,n)=>({...n,...t})))}notUndefined(){return this.refine(Le,{expected:"a value other than `undefined`"})}forEach(e){let t=e(qg());return GY((n)=>or(this.getResult(n),(r)=>{let o=[];for(let s=0;s<r.length;s++){let i=t.getResult(r[s]);if(Ut(i))o.push(i.success)}return o}),(n,r)=>si(this.getResult(r),(o)=>{let s=[];for(let a=0;a<o.length;a++)if(Ut(t.getResult(o[a])))s.push(a);if(n.length!==s.length)return te(new we({message:`each: replacement length mismatch: ${n.length} !== ${s.length}`}));let i=o.slice();for(let a=0;a<s.length;a++){let c=s[a],u=t.replaceResult(n[a],o[c]);if(xe(u))return te(new Ft([c],u.failure));i[c]=u.success}return this.replaceResult(i,r)}))}modifyAll(e){return(t)=>oi(si(this.getResult(t),(n)=>this.replaceResult(n.map(e),t)),()=>t)}}function fo(e){let t=e[0]??VY;if(e.length>1){let n=e.reduce((r,o)=>YY(r,o.kind),"Iso");t={kind:n,get:JY(e,n),set:ZY(e,n)}}switch(t.kind){case"Iso":return new x$(e,t.get,t.set);case"Lens":return new y$(e,t.get,t.set);case"Prism":return new S$(e,t.get,t.set);case"Optional":return new Dd(e,t.get,t.set)}}function Hg(e){if(Array.isArray(e))return e.slice();if(typeof e==="object"&&e!==null){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw Error("Cannot clone object with non-Object constructor or null prototype");return{...e}}return e}function JY(e,t){return(n)=>{for(let r=0;r<e.length;r++){let o=e[r],s=o.get(n);if(vk(o.kind)){if(xe(s))return s;n=s.success}else n=s}return vk(t)?G(n):n}}function ZY(e,t){if(h$(t))return(n)=>{for(let r=e.length-1;r>=0;r--)n=e[r].set(n);return n};return(n,r)=>{let o=e.length,s=Array(o);for(let i=0;i<o;i++){s[i]=r;let a=e[i];if(vk(a.kind)){let c=a.get(r);if(xe(c))return c;r=c.success}else r=a.get(r)}for(let i=o-1;i>=0;i--){let a=e[i];if(h$(a.kind))n=a.set(n);else if(a.kind==="Lens")n=a.set(n,s[i]);else{let c=a.set(n,s[i]);if(xe(c))return c;n=c.success}}return t==="Optional"?G(n):n}}function vk(e){return e==="Prism"||e==="Optional"}function h$(e){return e==="Iso"||e==="Prism"}function YY(e,t){if(e==="Iso")return t;if(t==="Iso"||e===t)return e;return"Optional"}function qg(){return QY}var VY,x$,y$,S$,QY;var E$=w(()=>{X();he();gn();Ps();Ai();Dg();VY={kind:"Iso",get:D,set:D};x$=class x$ extends Dd{get;set;constructor(e,t,n){super(e,(r)=>G(t(r)),(r)=>G(n(r)));this.get=t,this.set=n}replace(e,t){return this.set(e)}modify(e){return(t)=>this.set(e(this.get(t)))}};y$=class y$ extends Dd{get;constructor(e,t,n){super(e,(r)=>G(t(r)),(r,o)=>G(n(r,o)));this.get=t,this.replace=n}modify(e){return(t)=>this.replace(e(this.get(t)),t)}};S$=class S$ extends Dd{set;constructor(e,t,n){super(e,t,(r,o)=>G(n(r)));this.set=n}replace(e,t){return this.set(e)}modify(e){return(t)=>oi(or(this.getResult(t),(n)=>this.set(e(n))),()=>t)}};QY=fo([])});var Ja,b$=(e)=>{if(Ja.has(e))return Ja.get(e);else throw Error("Unable to get redacted value"+(e.label?` with label: "${e.label}"`:""))};var w$=w(()=>{Ja=new WeakMap});var v$="~effect/data/Redacted",Ik=(e)=>M(e,v$),Ns=(e,t)=>{let n=Object.create(tQ);if(t?.label)n.label=t.label;return Ja.set(n,e),n},tQ,Ui,k$=(e)=>Kt((t,n)=>e(Ui(t),Ui(n)));var $d=w(()=>{yt();Xo();Xt();rt();w$();he();tQ={[v$]:{_A:(e)=>e},label:void 0,...Cn,toJSON(){return this.toString()},toString(){return`<redacted${Wr(this.label)?":"+this.label:""}>`},[Ie](){return re(Ja.get(this))},[Ce](e){return Ik(e)&&Y(Ja.get(this),Ja.get(e))}},Ui=b$});var P={};Un(P,{Any:()=>PQ,Array:()=>$e,ArrayEnsure:()=>qQ,BigDecimal:()=>Wk,BigDecimalFromString:()=>L9,BigDecimalReviver:()=>U9,BigInt:()=>$o,BigIntFromString:()=>J9,Boolean:()=>Zg,BooleanFromBit:()=>n7,Cause:()=>Kg,CauseReason:()=>Wg,CauseReasonReviver:()=>u9,CauseReviver:()=>l9,Char:()=>Z8,Chunk:()=>y2,ChunkReviver:()=>v9,Class:()=>M2,Date:()=>Yn,DateFromMillis:()=>A9,DateFromString:()=>O9,DateReviver:()=>T9,DateTimeUtc:()=>Qd,DateTimeUtcFromDate:()=>c7,DateTimeUtcFromMillis:()=>l7,DateTimeUtcFromString:()=>u7,DateTimeUtcReviver:()=>a7,DateTimeZoned:()=>Yk,DateTimeZonedFromString:()=>x7,DateTimeZonedReviver:()=>g7,Defect:()=>qk,Duration:()=>Zd,DurationFromMillis:()=>F9,DurationFromNanos:()=>P9,DurationFromString:()=>w2,DurationReviver:()=>_9,Enum:()=>_Q,Error:()=>rx,ErrorInstance:()=>u2,ErrorInstanceReviver:()=>p9,Exit:()=>l2,ExitReviver:()=>m9,File:()=>Kk,FileReviver:()=>H9,Finite:()=>Zn,FiniteFromString:()=>G9,FormData:()=>Vk,FormDataReviver:()=>q9,Graph:()=>m2,GraphReviver:()=>S9,HashMap:()=>h2,HashMapReviver:()=>E9,HashSet:()=>x2,HashSetReviver:()=>w9,Int:()=>Uo,Json:()=>tp,JsonObject:()=>tX,JsonReviver:()=>nX,Literal:()=>Ke,Literals:()=>Ls,MutableJson:()=>W2,MutableJsonReviver:()=>oX,Natural:()=>an,Never:()=>RQ,NonEmptyArray:()=>HQ,NonEmptyString:()=>XU,Null:()=>Fe,NullOr:()=>Mk,NullishOr:()=>rU,Number:()=>Hd,NumberFromString:()=>V9,ObjectKeyword:()=>MQ,Opaque:()=>r8,Option:()=>ji,OptionFromNullOr:()=>Q8,OptionFromNullishOr:()=>e9,OptionFromOptional:()=>n9,OptionFromOptionalKey:()=>t9,OptionFromOptionalNullOr:()=>r9,OptionFromUndefinedOr:()=>X8,OptionReviver:()=>Y8,PropertyKey:()=>Ok,ReadonlyMap:()=>p2,ReadonlyMapReviver:()=>h9,ReadonlySet:()=>g2,ReadonlySetReviver:()=>b9,Record:()=>Yg,Redacted:()=>ex,RedactedFromValue:()=>c9,RedactedReviver:()=>a9,RegExp:()=>S2,RegExpReviver:()=>k9,Result:()=>e2,ResultReviver:()=>o9,SchemaError:()=>Za,StandardSchemaV1FailureResult:()=>t7,String:()=>J,StringFromBase64:()=>Y9,StringFromBase64Url:()=>Q9,StringFromHex:()=>X9,StringFromUriComponent:()=>e7,Struct:()=>Q,StructWithRest:()=>jQ,Symbol:()=>eU,TaggedClass:()=>b7,TaggedError:()=>po,TaggedStruct:()=>Xg,TaggedUnion:()=>n8,TemplateLiteral:()=>OQ,TemplateLiteralParser:()=>AQ,TimeZone:()=>Zk,TimeZoneFromString:()=>h7,TimeZoneNamed:()=>Jk,TimeZoneNamedFromString:()=>p7,TimeZoneNamedReviver:()=>d7,TimeZoneOffset:()=>A2,TimeZoneOffsetReviver:()=>f7,TimeZoneReviver:()=>m7,Tree:()=>eX,Trim:()=>Z9,Trimmed:()=>T2,Tuple:()=>Ju,TupleWithRest:()=>BQ,URL:()=>nx,URLFromString:()=>C9,URLReviver:()=>I9,URLSearchParams:()=>Gk,URLSearchParamsReviver:()=>W9,Uint8Array:()=>Yd,Uint8ArrayFromBase64:()=>o7,Uint8ArrayFromBase64Url:()=>s7,Uint8ArrayFromHex:()=>i7,Uint8ArrayReviver:()=>r7,Undefined:()=>Pk,UndefinedOr:()=>Qg,Union:()=>pt,UniqueArray:()=>zQ,UniqueSymbol:()=>NQ,Unknown:()=>Rk,UnknownFromJsonString:()=>B9,Void:()=>FQ,annotate:()=>rQ,annotateEncoded:()=>oQ,annotateKey:()=>sQ,asserts:()=>uQ,brand:()=>sU,catchDecoding:()=>JQ,catchDecodingWithContext:()=>cU,catchEncoding:()=>ZQ,catchEncodingWithContext:()=>uU,check:()=>KQ,declare:()=>Br,declareConstructor:()=>Qn,decode:()=>YQ,decodeEffect:()=>lQ,decodeExit:()=>fQ,decodeOption:()=>pQ,decodePromise:()=>hQ,decodeResult:()=>mQ,decodeSync:()=>gQ,decodeTo:()=>de,decodeUnknownEffect:()=>Us,decodeUnknownExit:()=>z$,decodeUnknownOption:()=>dQ,decodeUnknownPromise:()=>K$,decodeUnknownResult:()=>W$,decodeUnknownSync:()=>V$,encode:()=>QQ,encodeEffect:()=>G$,encodeExit:()=>xQ,encodeKeys:()=>UQ,encodeOption:()=>SQ,encodePromise:()=>bQ,encodeResult:()=>EQ,encodeSync:()=>wQ,encodeTo:()=>Nk,encodeUnknownEffect:()=>Gg,encodeUnknownExit:()=>J$,encodeUnknownOption:()=>yQ,encodeUnknownPromise:()=>Y$,encodeUnknownResult:()=>Z$,encodeUnknownSync:()=>Q$,extendTo:()=>LQ,fieldsAssign:()=>DQ,flip:()=>Ck,fromBrand:()=>GQ,fromFormData:()=>z9,fromJsonString:()=>C2,fromURLSearchParams:()=>K9,instanceOf:()=>Li,is:()=>Bd,isBase64:()=>Uk,isBase64Reviver:()=>h8,isBase64Url:()=>EU,isBase64UrlReviver:()=>g8,isBetween:()=>Gd,isBetweenBigDecimal:()=>U8,isBetweenBigInt:()=>qU,isBetweenBigIntReviver:()=>G7,isBetweenDate:()=>UU,isBetweenDateReviver:()=>q7,isBetweenReviver:()=>A8,isCapitalized:()=>CU,isCapitalizedReviver:()=>w8,isEndsWith:()=>wU,isEndsWithReviver:()=>y8,isFinite:()=>OU,isFiniteReviver:()=>k8,isGUID:()=>yU,isGUIDReviver:()=>p8,isGreaterThan:()=>_U,isGreaterThanBigDecimal:()=>M8,isGreaterThanBigInt:()=>LU,isGreaterThanBigIntReviver:()=>z7,isGreaterThanDate:()=>MU,isGreaterThanDateReviver:()=>L7,isGreaterThanOrEqualTo:()=>Lk,isGreaterThanOrEqualToBigDecimal:()=>N8,isGreaterThanOrEqualToBigInt:()=>jU,isGreaterThanOrEqualToBigIntReviver:()=>W7,isGreaterThanOrEqualToDate:()=>NU,isGreaterThanOrEqualToDateReviver:()=>j7,isGreaterThanOrEqualToReviver:()=>C8,isGreaterThanReviver:()=>I8,isIncludes:()=>vU,isIncludesReviver:()=>S8,isInt:()=>Jd,isInt32:()=>P8,isIntReviver:()=>R8,isLengthBetween:()=>Bk,isLengthBetweenReviver:()=>B8,isLessThan:()=>RU,isLessThanBigDecimal:()=>D8,isLessThanBigInt:()=>BU,isLessThanBigIntReviver:()=>K7,isLessThanDate:()=>DU,isLessThanDateReviver:()=>B7,isLessThanOrEqualTo:()=>PU,isLessThanOrEqualToBigDecimal:()=>$8,isLessThanOrEqualToBigInt:()=>HU,isLessThanOrEqualToBigIntReviver:()=>V7,isLessThanOrEqualToDate:()=>$U,isLessThanOrEqualToDateReviver:()=>H7,isLessThanOrEqualToReviver:()=>O8,isLessThanReviver:()=>T8,isLowercased:()=>IU,isLowercasedReviver:()=>b8,isMaxLength:()=>WU,isMaxLengthReviver:()=>j8,isMaxProperties:()=>ZU,isMaxPropertiesReviver:()=>K8,isMaxSize:()=>VU,isMaxSizeReviver:()=>q8,isMinLength:()=>jk,isMinLengthReviver:()=>L8,isMinProperties:()=>JU,isMinPropertiesReviver:()=>W8,isMinSize:()=>KU,isMinSizeReviver:()=>H8,isMultipleOf:()=>FU,isMultipleOfReviver:()=>_8,isNonEmpty:()=>zU,isPattern:()=>Ya,isPatternReviver:()=>a8,isPropertiesLengthBetween:()=>YU,isPropertiesLengthBetweenReviver:()=>V8,isPropertyNames:()=>QU,isPropertyNamesReviver:()=>G8,isSchema:()=>Jg,isSchemaError:()=>L$,isSizeBetween:()=>GU,isSizeBetweenReviver:()=>z8,isStartsWith:()=>bU,isStartsWithReviver:()=>x8,isStringBigInt:()=>hU,isStringBigIntReviver:()=>u8,isStringFinite:()=>mU,isStringFiniteReviver:()=>c8,isStringSymbol:()=>gU,isStringSymbolReviver:()=>l8,isTrimmed:()=>$k,isTrimmedReviver:()=>s8,isULID:()=>SU,isULIDReviver:()=>m8,isUUID:()=>xU,isUUIDReviver:()=>d8,isUint32:()=>F8,isUncapitalized:()=>TU,isUncapitalizedReviver:()=>v8,isUnique:()=>Hk,isUniqueReviver:()=>J8,isUppercased:()=>kU,isUppercasedReviver:()=>E8,link:()=>Je,make:()=>V,makeFilter:()=>Ze,makeFilterGroup:()=>o8,makeIsBetween:()=>Vd,makeIsGreaterThan:()=>qd,makeIsGreaterThanOrEqualTo:()=>zd,makeIsLessThan:()=>Wd,makeIsLessThanOrEqualTo:()=>Kd,makeIsMultipleOf:()=>AU,middlewareDecoding:()=>iU,middlewareEncoding:()=>aU,mutable:()=>WQ,mutableKey:()=>IQ,optional:()=>Nn,optionalKey:()=>Ds,overrideToCodecIso:()=>Q7,overrideToEquivalence:()=>I7,overrideToFormatter:()=>v7,readonlyKey:()=>CQ,refine:()=>VQ,required:()=>kQ,requiredKey:()=>vQ,resolveAnnotations:()=>sX,resolveAnnotationsKey:()=>iX,revealBottom:()=>nQ,revealCodec:()=>iQ,suspend:()=>oU,tag:()=>$s,tagDefaultOmit:()=>t8,toArbitrary:()=>w7,toCodecArrayFromSingle:()=>R7,toCodecIso:()=>L2,toCodecJson:()=>D2,toCodecJsonAST:()=>ox,toCodecStringTree:()=>ep,toDifferJsonPatch:()=>X7,toEncoded:()=>Xu,toEncoderXml:()=>P7,toEquivalence:()=>C7,toFormatter:()=>k7,toIso:()=>J7,toIsoFocus:()=>Y7,toIsoSource:()=>Z7,toJsonSchemaDocument:()=>N2,toRepresentation:()=>T7,toStandardJSONSchemaV1:()=>cQ,toStandardSchemaV1:()=>aQ,toTaggedUnion:()=>pU,toType:()=>Dn,withConstructorDefault:()=>lU,withDecodingDefault:()=>dU,withDecodingDefaultKey:()=>Dk,withDecodingDefaultType:()=>e8,withDecodingDefaultTypeKey:()=>XQ});function Qn(){return(e,t,n)=>V(new Ba(e.map(pd),(r)=>t(r.map((o)=>V(o))),n))}function Br(e,t){return Qn()([],()=>(n,r,o)=>e(n)?v(n):A(new ft(r,n,o)),t)}function nQ(e){return e}function rQ(e){return(t)=>t.annotate(e)}function oQ(e){return(t)=>Ck(Ck(t).annotate(e))}function sQ(e){return(t)=>t.rebuild(Sd(t.ast,e))}function iQ(e){return e}function L$(e){return M(e,Ld)&&e[Ld]===Ld}function I$(e){return Rt(e)?e.value:{issues:[{message:JE(e.cause)}]}}function aQ(e,t){let n=vt(e),r={errors:"all",...t?.parseOptions},o=bF(t),s=(i)=>{let a=new zc("sync"),c=To(wi(n(i,r),{onFailure:o,onSuccess:(l)=>({value:l})}),{scheduler:a});c.currentDispatcher?.flush();let u=c.pollUnsafe();if(u)return I$(u);return new Promise((l)=>{c.addObserver((f)=>{l(I$(f))})})};if("~standard"in e){let i=e;if("validate"in i["~standard"])return i;return Object.assign(i["~standard"],{validate:s}),i}else return Object.assign(e,{"~standard":{version:1,vendor:"effect",validate:s}})}function C$(e,t){let n=N2(e);if(t==="draft-2020-12"){let r=n.schema;if(Object.keys(n.definitions).length>0)r.$defs=n.definitions;return r}else if(t==="draft-07"){let r=ZD(n),o=r.schema;if(Object.keys(r.definitions).length>0)o.definitions=r.definitions;return o}throw new globalThis.Error(`Unsupported target: ${t}`)}function cQ(e){let t={input(n){return C$(e,n.target)},output(n){return C$(Dn(e),n.target)}};if("~standard"in e){let n=e;if("jsonSchema"in n["~standard"])return n;return Object.assign(n["~standard"],{jsonSchema:t}),n}else return Object.assign(e,{"~standard":{version:1,vendor:"effect",jsonSchema:t}})}function Us(e,t){let n=vt(e,t);return(r,o)=>j$(n(r,o))}function j$(e){if(We(e))return _k(e);return xr(e,(t)=>Ei(()=>ms(t,(n)=>new Za(n))))}function B$(e,t){let n;for(let r of e.reasons){if(!ff(r)||!L$(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function H$(e){return ph(e).then((t)=>{if(Rt(t))return t.value;throw B$(t.cause,"Promise adapter can only reject schema errors")})}function q$(e){let t=ki(e);if(Rt(t))return t.value;throw B$(t.cause,"Sync adapter can only throw schema errors")}function z$(e,t){let n=sD(e,t);return(r,o)=>_k(n(r,o))}function _k(e){return Rt(e)?e:lr(ms(e.cause,(t)=>new Za(t)))}function W$(e,t){let n=aD(e,t);return(r,o)=>Bc(n(r,o),(s)=>new Za(s))}function K$(e,t){let n=Us(e,t);return(r,o)=>H$(n(r,o))}function V$(e,t){let n=Us(e,t);return(r,o)=>q$(n(r,o))}function Gg(e,t){let n=qu(e,t);return(r,o)=>j$(n(r,o))}function J$(e,t){let n=cD(e,t);return(r,o)=>_k(n(r,o))}function Z$(e,t){let n=lD(e,t);return(r,o)=>Bc(n(r,o),(s)=>new Za(s))}function Y$(e,t){let n=Gg(e,t);return(r,o)=>H$(n(r,o))}function Q$(e,t){let n=Gg(e,t);return(r,o)=>q$(n(r,o))}function Jg(e){return M(e,Ud)&&e[Ud]===Ud}function TQ(e){return M(e,jd)&&e[jd]===jd}function Ck(e){if(TQ(e))return e.schema.rebuild(oo(e.ast));return V(oo(e.ast),{[jd]:jd,schema:e})}function Ke(e){let t=V(new Er(e),{literal:e,transform(n){return t.pipe(de(Ke(n),{decode:ve(()=>n),encode:ve(()=>e)}))}});return t}function X$(e){return new pv(e.map((t)=>Jg(t)?t.ast:new Er(t)))}function OQ(e){return V(X$(e),{parts:e})}function AQ(e){return V(X$(e).asTemplateLiteralParser(),{parts:e})}function _Q(e){return V(new dv(Object.keys(e).filter((t)=>typeof e[e[t]]!=="number").map((t)=>[t,e[t]])),{enums:e})}function NQ(e){return V(new mv(e))}function Fk(e,t){return V(e,{fields:t,mapFields(n,r){let o=n(this.fields);return Fk(og(o,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Q(e){return Fk(og(e,void 0),e)}function DQ(e){return En((t)=>t.mapFields(vD(e)))}function UQ(e){return function(t){let n={},r=Object.create(null),o=Object.create(null),s=new Set;for(let i of Reflect.ownKeys(t.fields)){let a=Xu(t.fields[i]),c=Object.hasOwn(e,i),u=c?e[i]:i,l=$Q(u);if(s.has(l))throw new globalThis.Error(`Duplicate encoded keys: ${Go(u)}`);if(s.add(l),U(n,u,a),c)r[i]=u,o[u]=i}return Q(n).pipe(de(t,st({decode:lk(o),encode:lk(r)})))}}function LQ(e,t){return(n)=>{let r=MC(n.fields,Dn),o=Q({...r,...e});return n.pipe(de(o,st({decode:(s)=>{let i={...s};for(let a in e){let c=t[a],u=c(s);if(Ee(u))U(i,a,u.value)}return i},encode:(s)=>{let i={...s};for(let a in e)delete i[a];return i}})))}}function Yg(e,t){return V(b1(e.ast,t.ast),{key:e,value:t})}function jQ(e,t){return V(l1(e.ast,t.map(pd)),{schema:e,records:t})}function tU(e,t){return V(e,{elements:t,mapElements(n,r){let o=n(this.elements);return tU(yv(o,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Ju(e){return tU(yv(e),e)}function BQ(e,t){return V(f1(e.ast,t.map(pd)),{schema:e,rest:t})}function qQ(e){return pt([e,$e(e)]).pipe(de($e(Dn(e)),st({decode:DC,encode:(t)=>t.length===1?t[0]:t})))}function zQ(e){return $e(e).check(Hk())}function nU(e,t){return V(e,{members:t,mapMembers(n,r){let o=n(this.members);return nU(sg(o,this.ast.mode,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function pt(e,t){return nU(sg(e,t?.mode??"anyOf",void 0),e)}function Ls(e){let t=e.map(Ke);return V(sg(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return pt(n(this.members))},pick(n){return Ls(n)},transform(n){return pt(t.map((r,o)=>r.transform(n[o])))}})}function oU(e){return V(new ag(()=>e().ast))}function KQ(...e){return(t)=>t.check(...e)}function VQ(e,t){return(n)=>V(Fo(n.ast,[ug(e,t)]),{schema:n})}function sU(e){return(t)=>V(y1(t.ast,e),{schema:t,identifier:e})}function GQ(e,t){return(n)=>(t.checks?n.check(...t.checks):n).pipe(sU(e))}function iU(e){return(t)=>V(g1(t.ast,new ld(e,D)),{schema:t})}function aU(e){return(t)=>V(x1(t.ast,new ld(D,e)),{schema:t})}function JQ(e){return cU(e)}function cU(e){return(t)=>iU(Bf(e))(t)}function ZQ(e){return uU(e)}function uU(e){return(t)=>aU(Bf(e))(t)}function de(e,t){return(n)=>V(dg(n.ast,e.ast,t?Zh(t):Ou()),{from:n,to:e})}function YQ(e){return(t)=>de(Dn(t),e)(t)}function Nk(e,t){return(n)=>t?de(n,t)(e):de(n)(e)}function QQ(e){return(t)=>de(t,e)(Xu(t))}function lU(e){return(t)=>V(E1(t.ast,e),{schema:t})}function fU(e){return xr(e,(t)=>Ei(()=>ms(t,(n)=>n.issue)))}function Dk(e,t){let n=t?.encodingStrategy==="omit"?Nw():ro();return(r)=>Ds(Xu(r)).pipe(de(r,{decode:cd(fU(e)),encode:n}))}function XQ(e,t){return(n)=>Dn(n).pipe(Dk(e,t),Nk(Ds(n)))}function dU(e,t){let n=t?.encodingStrategy==="omit"?Nw():ro();return(r)=>Nn(Xu(r)).pipe(de(r,{decode:cd(fU(e)),encode:n}))}function e8(e,t){return(n)=>Dn(n).pipe(dU(e,t),Nk(Nn(n)))}function $s(e){return Ke(e).pipe(lU(v(e)))}function t8(e){return $s(e).pipe(Dk(v(e),{encodingStrategy:"omit"}))}function Xg(e,t){return Q({_tag:$s(e),...t})}function pU(e){return(t)=>{let n={},r=[],o=new Set,s={},i=(l)=>(f)=>l.includes(f[e]);return a(t),Object.assign(t,{cases:n,discriminants:r,isAnyOf:i,guards:s,match:c,matchOrElse:u});function a(l){let f=l.ast;if(HM(f)&&"members"in l&&globalThis.Array.isArray(l.members)&&l.members.every(Jg))return l.members.forEach(a);let d=Ru(f);if(d.length>0){let m=d.find((g)=>g.key===e)?.literal;if(Ap(m)){let g=typeof m==="number"?globalThis.String(m):m;if(o.has(g))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(m)}`);o.add(g),r.push(m),U(n,m,l),U(s,m,Bd(Dn(l)));return}}throw new globalThis.Error("No literal or unique symbol found")}function c(){if(arguments.length===1){let g=arguments[0];return function(b){let x=b[e];return(Object.hasOwn(g,x)?g[x]:void 0)(b)}}let l=arguments[0],f=arguments[1],d=l[e];return(Object.hasOwn(f,d)?f[d]:void 0)(l)}function u(){if(arguments.length===2){let b=arguments[0],x=arguments[1];return function(I){let C=I[e];return(Object.hasOwn(b,C)?b[C]??x:x)(I)}}let l=arguments[0],f=arguments[1],d=arguments[2],m=l[e];return(Object.hasOwn(f,m)?f[m]??d:d)(l)}}}function n8(e){let t={},n=[];for(let c of Object.keys(e)){let u=Xg(c,e[c]);U(t,c,u),n.push(u)}let r=pt(n),{guards:o,isAnyOf:s,match:i,matchOrElse:a}=pU("_tag")(r);return V(r.ast,{cases:t,isAnyOf:s,guards:o,match:i,matchOrElse:a})}function r8(){return(e)=>e}function Li(e,t){return Br((n)=>n instanceof e,t)}function Je(){return(e,t)=>new dt(e.ast,Zh(t))}function o8(e,t=void 0){return new Pi(e,t)}function bn(e,t){return Mn(e,Fe,({annotations:n})=>n===void 0?t:t.annotate(n))}function $k(e){let t=new globalThis.RegExp(T$);return Ze((n)=>n.trim()===n,{expected:"a string with no leading or trailing whitespace",representation:{id:"effect/schema/isTrimmed",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isTrimmed()"}),arbitrary:{constraint:{patterns:[T$]}},...e})}function Ya(e,t){let{source:n,flags:r}=e,o=r===""?`new RegExp(${B(n)})`:`new RegExp(${B(n)}, ${B(r)})`;return hd(e,{toCode:()=>({runtime:`Schema.isPattern(${o})`}),...t})}function mU(e){return Cv({toCode:()=>({runtime:"Schema.isStringFinite()"}),...e})}function hU(e){return Tv({toCode:()=>({runtime:"Schema.isStringBigInt()"}),...e})}function gU(e){return Av({toCode:()=>({runtime:"Schema.isStringSymbol()"}),...e})}function xU(e,t){let n=f8(e);return Ya(n,{expected:e?`a UUID v${e}`:"a UUID",representation:{id:"effect/schema/isUUID",payload:{version:e??null}},toJsonSchema:()=>({pattern:n.source,format:"uuid"}),toCode:()=>({runtime:e===void 0?"Schema.isUUID()":`Schema.isUUID(${e})`}),...t})}function yU(e){return Ya(O$,{expected:"a GUID",representation:{id:"effect/schema/isGUID",payload:null},toJsonSchema:()=>({pattern:O$.source}),toCode:()=>({runtime:"Schema.isGUID()"}),...e})}function SU(e){let t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return Ya(t,{representation:{id:"effect/schema/isULID",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isULID()"}),...e})}function Uk(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return Ya(t,{expected:"a base64 encoded string",representation:{id:"effect/schema/isBase64",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isBase64()"}),...e})}function EU(e){let t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return Ya(t,{expected:"a base64url encoded string",representation:{id:"effect/schema/isBase64Url",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isBase64Url()"}),...e})}function bU(e,t){let n=JSON.stringify(e),r=new globalThis.RegExp(`^${Ku(e)}`);return Ze((o)=>o.startsWith(e),{expected:`a string starting with ${n}`,representation:{id:"effect/schema/isStartsWith",payload:{startsWith:e}},toJsonSchema:()=>({pattern:r.source}),toCode:()=>({runtime:`Schema.isStartsWith(${B(e)})`}),arbitrary:{constraint:{patterns:[r.source]}},...t})}function wU(e,t){let n=JSON.stringify(e),r=new globalThis.RegExp(`${Ku(e)}$`);return Ze((o)=>o.endsWith(e),{expected:`a string ending with ${n}`,representation:{id:"effect/schema/isEndsWith",payload:{endsWith:e}},toJsonSchema:()=>({pattern:r.source}),toCode:()=>({runtime:`Schema.isEndsWith(${B(e)})`}),arbitrary:{constraint:{patterns:[r.source]}},...t})}function vU(e,t){let n=JSON.stringify(e),r=new globalThis.RegExp(Ku(e));return Ze((o)=>o.includes(e),{expected:`a string including ${n}`,representation:{id:"effect/schema/isIncludes",payload:{includes:e}},toJsonSchema:()=>({pattern:r.source}),toCode:()=>({runtime:`Schema.isIncludes(${B(e)})`}),arbitrary:{constraint:{patterns:[r.source]}},...t})}function kU(e){let t=new globalThis.RegExp(A$);return Ze((n)=>n.toUpperCase()===n,{expected:"a string with all characters in uppercase",representation:{id:"effect/schema/isUppercased",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isUppercased()"}),arbitrary:{constraint:{patterns:[A$]}},...e})}function IU(e){let t=new globalThis.RegExp(_$);return Ze((n)=>n.toLowerCase()===n,{expected:"a string with all characters in lowercase",representation:{id:"effect/schema/isLowercased",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isLowercased()"}),arbitrary:{constraint:{patterns:[_$]}},...e})}function CU(e){let t=new globalThis.RegExp(R$);return Ze((n)=>n.charAt(0).toUpperCase()===n.charAt(0),{expected:"a string with the first character in uppercase",representation:{id:"effect/schema/isCapitalized",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isCapitalized()"}),arbitrary:{constraint:{patterns:[R$]}},...e})}function TU(e){let t=new globalThis.RegExp(P$);return Ze((n)=>n.charAt(0).toLowerCase()===n.charAt(0),{expected:"a string with the first character in lowercase",representation:{id:"effect/schema/isUncapitalized",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isUncapitalized()"}),arbitrary:{constraint:{patterns:[P$]}},...e})}function qd(e){let t=ti(e.order),n=e.formatter??B;return(r,o)=>Ze((s)=>t(s,r),{expected:`a value greater than ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:r,exclusiveMinimum:!0}}},...e.annotate?.(r),...o})}function zd(e){let t=Dl(e.order),n=e.formatter??B;return(r,o)=>Ze((s)=>t(s,r),{expected:`a value greater than or equal to ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:r}}},...e.annotate?.(r),...o})}function Wd(e){let t=Uc(e.order),n=e.formatter??B;return(r,o)=>Ze((s)=>t(s,r),{expected:`a value less than ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,maximum:r,exclusiveMaximum:!0}}},...e.annotate?.(r),...o})}function Kd(e){let t=Nl(e.order),n=e.formatter??B;return(r,o)=>Ze((s)=>t(s,r),{expected:`a value less than or equal to ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,maximum:r}}},...e.annotate?.(r),...o})}function Vd(e){let t=Dl(e.order),n=ti(e.order),r=Nl(e.order),o=Uc(e.order),s=e.formatter??B;return(i,a)=>{let c=i.exclusiveMinimum?n:t,u=i.exclusiveMaximum?o:r;return Ze((l)=>c(l,i.minimum)&&u(l,i.maximum),{expected:`a value between ${s(i.minimum)}${i.exclusiveMinimum?" (excluded)":""} and ${s(i.maximum)}${i.exclusiveMaximum?" (excluded)":""}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:i.minimum,maximum:i.maximum,...i.exclusiveMinimum&&{exclusiveMinimum:!0},...i.exclusiveMaximum&&{exclusiveMaximum:!0}}}},...e.annotate?.(i),...a})}}function AU(e){return(t,n)=>{let r=e.formatter??B;return Ze((o)=>e.remainder(o,t)===e.zero,{expected:`a value that is a multiple of ${r(t)}`,...e.annotate?.(t),...n})}}function Zu(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${B(e)}`);return e}function Jd(e){return Ze((t)=>globalThis.Number.isSafeInteger(t),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>({type:"integer"}),toCode:()=>({runtime:"Schema.isInt()"}),arbitrary:{constraint:{integer:!0}},...e})}function P8(e){return new Pi([Jd(),Gd({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...e})}function F8(e){return new Pi([Jd(),Gd({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...e})}function Yu(e){if(globalThis.Number.isNaN(e.getTime()))throw new globalThis.RangeError(`Expected a valid Date, got ${B(e)}`);return e.toISOString()}function Qu(e){return`new Date(${B(e.getTime())})`}function jk(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>n.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:"effect/schema/isMinLength",payload:{minLength:e}},toJsonSchema:({type:n})=>n==="array"?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e}},...t})}function zU(e){return jk(1,e)}function WU(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>n.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:"effect/schema/isMaxLength",payload:{maxLength:e}},toJsonSchema:({type:n})=>n==="array"?{maxItems:e}:{maxLength:e},toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[Wn]:!0,arbitrary:{constraint:{maxLength:e}},...t})}function Bk(e,t,n){return e=Math.max(0,Math.floor(e)),t=Math.max(0,Math.floor(t)),Ze((r)=>r.length>=e&&r.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:"effect/schema/isLengthBetween",payload:{minimum:e,maximum:t}},toJsonSchema:({type:r})=>r==="array"?{allOf:[{minItems:e},{maxItems:t}]}:{allOf:[{minLength:e},{maxLength:t}]},toCode:()=>({runtime:`Schema.isLengthBetween(${e}, ${t})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e,maxLength:t}},...n})}function KU(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>n.size>=e,{expected:`a value with a size of at least ${e}`,representation:{id:"effect/schema/isMinSize",payload:{minSize:e}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isMinSize(${e})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e}},...t})}function VU(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>n.size<=e,{expected:`a value with a size of at most ${e}`,representation:{id:"effect/schema/isMaxSize",payload:{maxSize:e}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isMaxSize(${e})`}),[Wn]:!0,arbitrary:{constraint:{maxLength:e}},...t})}function GU(e,t,n){return e=Math.max(0,Math.floor(e)),t=Math.max(0,Math.floor(t)),Ze((r)=>r.size>=e&&r.size<=t,{expected:e===t?`a value with a size of ${e}`:`a value with a size between ${e} and ${t}`,representation:{id:"effect/schema/isSizeBetween",payload:{minimum:e,maximum:t}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isSizeBetween(${e}, ${t})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e,maxLength:t}},...n})}function JU(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>Reflect.ownKeys(n).length>=e,{expected:`a value with at least ${e===1?"1 entry":`${e} entries`}`,representation:{id:"effect/schema/isMinProperties",payload:{minProperties:e}},toJsonSchema:()=>({minProperties:e}),toCode:()=>({runtime:`Schema.isMinProperties(${e})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e}},...t})}function ZU(e,t){return e=Math.max(0,Math.floor(e)),Ze((n)=>Reflect.ownKeys(n).length<=e,{expected:`a value with at most ${e===1?"1 entry":`${e} entries`}`,representation:{id:"effect/schema/isMaxProperties",payload:{maxProperties:e}},toJsonSchema:()=>({maxProperties:e}),toCode:()=>({runtime:`Schema.isMaxProperties(${e})`}),[Wn]:!0,arbitrary:{constraint:{maxLength:e}},...t})}function YU(e,t,n){return e=Math.max(0,Math.floor(e)),t=Math.max(0,Math.floor(t)),Ze((r)=>Reflect.ownKeys(r).length>=e&&Reflect.ownKeys(r).length<=t,{expected:e===t?`a value with exactly ${e===1?"1 entry":`${e} entries`}`:`a value with between ${e} and ${t} entries`,representation:{id:"effect/schema/isPropertiesLengthBetween",payload:{minimum:e,maximum:t}},toJsonSchema:()=>({minProperties:e,maxProperties:t}),toCode:()=>({runtime:`Schema.isPropertiesLengthBetween(${e}, ${t})`}),[Wn]:!0,arbitrary:{constraint:{minLength:e,maxLength:t}},...n})}function QU(e,t){let n=Xu(e),r=rD(n.ast);return Ze((o,s,i)=>{let a=Reflect.ownKeys(o),c=[];for(let u of a){let l=r(u,i);if(l!==void 0){if(c.push(new Ft([u],l)),i.errors==="first")break}}if(la(c))return new Et(s,c,o,i);return!0},{expected:"an object with property names matching the schema",representation:{id:"effect/schema/isPropertyNames",payload:null,schemas:[n.ast]},toJsonSchema:({schemas:o})=>({propertyNames:o[0]}),toCode:({schemas:o})=>({runtime:`Schema.isPropertyNames(${o[0].runtime})`}),[Wn]:!0,...t})}function Hk(e){return Ze((t)=>tm(t).length===t.length,{expected:"an array with unique items",representation:{id:"effect/schema/isUnique",payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:"Schema.isUnique()"}),arbitrary:{constraint:{unique:!0}},...e})}function ji(e){let t=Qn()([e],([n])=>(r,o,s)=>{if(jc(r)){if(me(r))return Aa;return Jt(vt(n)(r.value,s),{onSuccess:_,onFailure:(i)=>Kn(o,"value",i,r,s)})}return A(new ft(o,r,s))},{representation:{id:"effect/schema/Option",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Option(${n[0].runtime})`,Type:`Option.Option<${n[0].Type}>`,importDeclarations:['import * as Option from "effect/Option"']}),expected:"Option",toCodec:([n])=>Je()(pt([Q({_tag:Ke("Some"),value:n}),Q({_tag:Ke("None")})]),st({decode:(r)=>r._tag==="None"?O():_(r.value),encode:(r)=>Ee(r)?{_tag:"Some",value:r.value}:{_tag:"None"}})),toArbitrary:([n])=>(r,o)=>{let s=r.constant(O()),i=r.oneof(s,n.arbitrary.map(_));return Qa(r,o,s,i)},toEquivalence:([n])=>Zy(n),toFormatter:([n])=>et({onNone:()=>"none()",onSome:(r)=>`some(${n(r)})`})});return V(t.ast,{value:e})}function Q8(e){return Mk(e).pipe(de(ji(Dn(e)),bM()))}function X8(e){return Qg(e).pipe(de(ji(Dn(e)),wM()))}function e9(e,t){return rU(e).pipe(de(ji(Dn(e)),vM(t)))}function t9(e){return Ds(e).pipe(de(ji(Dn(e)),kM()))}function n9(e){return Nn(e).pipe(de(ji(Dn(e)),IM()))}function r9(e,t){let n=t===void 0?"omit":t.onNoneEncoding,r=n===null?null:void 0;return Nn(Mk(e)).pipe(de(ji(Dn(e)),Yh({decode:(o)=>o.pipe(ca(_p),_),encode:n==="omit"?aa:(o)=>_(mt(aa(o),()=>r))})))}function e2(e,t){let n=Qn()([e,t],([r,o])=>(s,i,a)=>{if(!Qp(s))return A(new ft(i,s,a));switch(s._tag){case"Success":return Jt(rk(r)(s.success,a),{onSuccess:G,onFailure:(c)=>Kn(i,"success",c,s,a)});case"Failure":return Jt(rk(o)(s.failure,a),{onSuccess:te,onFailure:(c)=>Kn(i,"failure",c,s,a)})}},{representation:{id:"effect/schema/Result",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Result(${r[0].runtime}, ${r[1].runtime})`,Type:`Result.Result<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Result from "effect/Result"']}),expected:"Result",toCodec:([r,o])=>Je()(pt([Q({_tag:Ke("Success"),success:r}),Q({_tag:Ke("Failure"),failure:o})]),st({decode:(s)=>s._tag==="Success"?G(s.success):te(s.failure),encode:(s)=>Ut(s)?{_tag:"Success",success:s.success}:{_tag:"Failure",failure:s.failure}})),toArbitrary:([r,o])=>(s,i)=>{let a=f2(s,r.terminal?.map((u)=>G(u)),o.terminal?.map((u)=>te(u))),c=s.oneof(r.arbitrary.map((u)=>G(u)),o.arbitrary.map((u)=>te(u)));return Qa(s,i,a,c)},toEquivalence:([r,o])=>aS(r,o),toFormatter:([r,o])=>Bn({onSuccess:(s)=>`success(${r(s)})`,onFailure:(s)=>`failure(${o(s)})`})});return V(n.ast,{success:e,failure:t})}function ex(e,t){let n=typeof t?.label==="string"?t.label:void 0,r=t?.disallowJsonEncode===!0,o=n!==void 0?r?{label:n,disallowJsonEncode:!0}:{label:n}:r?{disallowJsonEncode:!0}:void 0,s=n!==void 0?vt(Ke(n)):void 0,i=Qn()([e],([a])=>(c,u,l)=>{if(Ik(c)){let f=s!==void 0?Ra(s(c.label,l),(d)=>new Ft(["label"],d)):Te;return on(f,()=>Jt(vt(a)(Ui(c),l),{onSuccess:()=>c,onFailure:()=>new Et(u,[new Ft(["value"],new we(void 0,c,l))],c,l)}))}return A(new ft(u,c,l))},{representation:{id:"effect/schema/Redacted",payload:o??null},toCode:({typeParameters:a})=>({runtime:o!==void 0?`Schema.Redacted(${a[0].runtime}, ${B(o)})`:`Schema.Redacted(${a[0].runtime})`,Type:`Redacted.Redacted<${a[0].Type}>`,importDeclarations:['import * as Redacted from "effect/Redacted"']}),expected:"Redacted",toCodecJson:([a])=>Je()(a,{decode:ve((c)=>Ns(c,{label:n})),encode:r?Fw((c)=>"Cannot serialize Redacted"+(Ee(c)&&typeof c.value.label==="string"?` with label: "${c.value.label}"`:"")):ve(Ui)}),toArbitrary:([a])=>()=>({arbitrary:a.arbitrary.map((c)=>Ns(c,{label:n})),terminal:a.terminal?.map((c)=>Ns(c,{label:n}))}),toFormatter:()=>globalThis.String,toEquivalence:([a])=>k$(a)});return V(i.ast,{value:e})}function c9(e,t){return de(ex(Dn(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:ve((n)=>Ns(n,{label:t?.label})),encode:t?.disallowEncode?Fw((n)=>"Cannot encode Redacted"+(Ee(n)&&typeof n.value.label==="string"?` with label: "${n.value.label}"`:"")):ve(Ui)})(e)}function Wg(e,t){let n=Qn()([e,t],([r,o])=>(s,i,a)=>{if(!KE(s))return A(new ft(i,s,a));switch(s._tag){case"Fail":return Jt(vt(r)(s.error,a),{onSuccess:df,onFailure:(c)=>Kn(i,"error",c,s,a)});case"Die":return Jt(vt(o)(s.defect,a),{onSuccess:pf,onFailure:(c)=>Kn(i,"defect",c,s,a)});case"Interrupt":return v(s)}},{representation:{id:"effect/schema/CauseReason",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.CauseReason(${r[0].runtime}, ${r[1].runtime})`,Type:`Cause.Failure<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause.Failure",toCodec:([r,o])=>Je()(pt([Q({_tag:Ke("Fail"),error:r}),Q({_tag:Ke("Die"),defect:o}),Q({_tag:Ke("Interrupt"),fiberId:Qg(Zn)})]),st({decode:(s)=>{switch(s._tag){case"Fail":return df(s.error);case"Die":return pf(s.defect);case"Interrupt":return mf(s.fiberId)}},encode:D})),toArbitrary:([r,o])=>t2(r,o),toEquivalence:([r,o])=>n2(r,o),toFormatter:([r,o])=>r2(r,o)});return V(n.ast,{error:e,defect:t})}function t2(e,t){return(n,r)=>{let o=n.constant(mf()),s=n.oneof(o,n.integer({min:1}).map(mf),e.arbitrary.map((i)=>df(i)),t.arbitrary.map((i)=>pf(i)));return Qa(n,r,o,s)}}function n2(e,t){return(n,r)=>{if(n._tag!==r._tag)return!1;switch(n._tag){case"Fail":return e(n.error,r.error);case"Die":return t(n.defect,r.defect);case"Interrupt":return n.fiberId===r.fiberId}}}function r2(e,t){return(n)=>{switch(n._tag){case"Fail":return`Fail(${e(n.error)})`;case"Die":return`Die(${t(n.defect)})`;case"Interrupt":return"Interrupt"}}}function Kg(e,t){let n=Qn()([e,t],([r,o])=>{let s=$e(Wg(r,o));return(i,a,c)=>{if(!WE(i))return A(new ft(a,i,c));return Jt(vt(s)(i.reasons,c),{onSuccess:wa,onFailure:(u)=>Kn(a,"failures",u,i,c)})}},{representation:{id:"effect/schema/Cause",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.Cause(${r[0].runtime}, ${r[1].runtime})`,Type:`Cause.Cause<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause",toCodec:([r,o])=>Je()($e(Wg(r,o)),st({decode:wa,encode:({reasons:s})=>s})),toArbitrary:([r,o])=>o2(r,o),toEquivalence:([r,o])=>s2(r,o),toFormatter:([r,o])=>i2(r,o)});return V(n.ast,{error:e,defect:t})}function o2(e,t){return(n,r)=>{let o=t2(e,t)(n,r),s=n.constant(VE),i=n.array(o.arbitrary).map(wa);return Qa(n,r,s,i)}}function s2(e,t){let n=sC(n2(e,t));return(r,o)=>n(r.reasons,o.reasons)}function i2(e,t){let n=r2(e,t);return(r)=>`Cause([${r.reasons.map(n).join(", ")}])`}function u2(e){let t=a2(e),n=F$[t];if(n!==void 0)return n;let r=c2(t),o=Li(globalThis.Error,{representation:{id:"effect/schema/Error",payload:r??null},toCode:()=>({runtime:r!==void 0?`Schema.ErrorInstance(${B(r)})`:"Schema.ErrorInstance()",Type:"globalThis.Error"}),expected:"Error",toCodecJson:()=>Je()(rX,SM(r)),toArbitrary:()=>(s)=>s.string().map((i)=>new globalThis.Error(i))});return F$[t]=o,o}function qk(e){let t=a2(e),n=M$[t];if(n!==void 0)return n;let r=tp.pipe(de(Rk,EM(c2(t))));return M$[t]=r,r}function l2(e,t,n){let r=Qn()([e,t,n],([o,s,i])=>{let a=Kg(s,i);return(c,u,l)=>{if(!YE(c))return A(new ft(u,c,l));switch(c._tag){case"Success":return Jt(vt(o)(c.value,l),{onSuccess:_r,onFailure:(f)=>Kn(u,"value",f,c,l)});case"Failure":return Jt(vt(a)(c.cause,l),{onSuccess:lr,onFailure:(f)=>Kn(u,"cause",f,c,l)})}}},{representation:{id:"effect/schema/Exit",payload:null},toCode:({typeParameters:o})=>({runtime:`Schema.Exit(${o[0].runtime}, ${o[1].runtime}, ${o[2].runtime})`,Type:`Exit.Exit<${o[0].Type}, ${o[1].Type}, ${o[2].Type}>`,importDeclarations:['import * as Exit from "effect/Exit"']}),expected:"Exit",toCodec:([o,s,i])=>Je()(pt([Q({_tag:Ke("Success"),value:o}),Q({_tag:Ke("Failure"),cause:Kg(s,i)})]),st({decode:(a)=>a._tag==="Success"?_r(a.value):lr(a.cause),encode:(a)=>Rt(a)?{_tag:"Success",value:a.value}:{_tag:"Failure",cause:a.cause}})),toArbitrary:([o,s,i])=>(a,c)=>{let u=o2(s,i)(a,c),l=f2(a,o.terminal?.map((d)=>_r(d)),u.terminal?.map((d)=>lr(d))),f=a.oneof(o.arbitrary.map((d)=>_r(d)),u.arbitrary.map((d)=>lr(d)));return Qa(a,c,l,f)},toEquivalence:([o,s,i])=>{let a=s2(s,i);return(c,u)=>{if(c._tag!==u._tag)return!1;switch(c._tag){case"Success":return o(c.value,u.value);case"Failure":return a(c.cause,u.cause)}}},toFormatter:([o,s,i])=>{let a=i2(s,i);return(c)=>{switch(c._tag){case"Success":return`Exit.Success(${o(c.value)})`;case"Failure":return`Exit.Failure(${a(c.cause)})`}}}});return V(r.ast,{value:e,error:t,defect:n})}function f2(e,t,n){return t===void 0?n:n===void 0?t:e.oneof(t,n)}function Qa(e,t,n,r){return{arbitrary:n===void 0||t.recursion===void 0?r:e.oneof(t.recursion,n,r),terminal:n}}function N$(e,t,n,r){return r===void 0?e.array(t,n):e.uniqueArray(t,{...n,comparator:r})}function tx(e,t,n,r,o,s){let i=t.constraint,a=i===void 0||i.minLength===void 0&&i.maxLength===void 0?void 0:{...i.minLength!==void 0?{minLength:i.minLength}:{},...i.maxLength!==void 0?{maxLength:i.maxLength}:{}};if(a?.minLength!==void 0&&a.maxLength!==void 0&&a.minLength>a.maxLength)throw new globalThis.Error("Unable to derive an arbitrary for size constraints");let c=a?.minLength??0,u=c===0?e.constant([]):r===void 0?void 0:N$(e,r,{...a,maxLength:c},s),l=Qa(e,t,u,N$(e,n,a,s));return{arbitrary:l.arbitrary.map(o),terminal:l.terminal?.map(o)}}function d2(e,t,n,r,o){return tx(e,t,e.tuple(n.arbitrary,r.arbitrary),n.terminal===void 0||r.terminal===void 0?void 0:e.tuple(n.terminal,r.terminal),o,([s],[i])=>Y(s,i))}function p2(e,t){let n=Qn()([e,t],([r,o])=>{let s=$e(Ju([r,o]));return(i,a,c)=>{if(i instanceof globalThis.Map)return Jt(vt(s)([...i],c),{onSuccess:(u)=>new globalThis.Map(u),onFailure:(u)=>Kn(a,"entries",u,i,c)});return A(new ft(a,i,c))}},{representation:{id:"effect/schema/ReadonlyMap",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.ReadonlyMap(${r[0].runtime}, ${r[1].runtime})`,Type:`globalThis.ReadonlyMap<${r[0].Type}, ${r[1].Type}>`}),expected:"ReadonlyMap",toCodec:([r,o])=>Je()($e(Ju([r,o])),st({decode:(s)=>new globalThis.Map(s),encode:(s)=>[...s.entries()]})),toArbitrary:([r,o])=>(s,i)=>d2(s,i,r,o,(a)=>new globalThis.Map(a)),toEquivalence:([r,o])=>Fp(r,o),toFormatter:([r,o])=>(s)=>{let i=s.size;if(i===0)return"ReadonlyMap(0) {}";let a=globalThis.Array.from(s.entries()).sort().map(([c,u])=>`${r(c)} => ${o(u)}`);return`ReadonlyMap(${i}) { ${a.join(", ")} }`}});return V(n.ast,{key:e,value:t})}function D$(e,t,n){return Q({type:Ke(e),nodes:$e(Q({index:an,data:t})),edges:$e(Q({index:an,source:an,target:an,data:n}))})}function $$(e,t){let n=-1,r=new Set;for(let o=0;o<e.nodes.length;o++){let s=e.nodes[o].index;if(s<=n)return A(new Ft(["nodes",o,"index"],new we({expected:"a strictly increasing node index"},s,t)));n=s,r.add(s)}n=-1;for(let o=0;o<e.edges.length;o++){let s=e.edges[o];if(s.index<=n)return A(new Ft(["edges",o,"index"],new we({expected:"a strictly increasing edge index"},s.index,t)));if(n=s.index,!r.has(s.source))return A(new Ft(["edges",o,"source"],new we({expected:"an encoded node index"},s.source,t)));if(!r.has(s.target))return A(new Ft(["edges",o,"target"],new we({expected:"an encoded node index"},s.target,t)))}return v(wd(e))}function g9(e,t,n){if(!Gv(e)||e.mutable||e.type!==t)return A(new we({expected:`an immutable ${t} Graph`},e,n));return v(bd(e))}function x9(e,t){return(n,r)=>{let o=bd(n),s=bd(r);if(o.type!==s.type||o.nodes.length!==s.nodes.length||o.edges.length!==s.edges.length)return!1;for(let i=0;i<o.nodes.length;i++)if(o.nodes[i].index!==s.nodes[i].index||!e(o.nodes[i].data,s.nodes[i].data))return!1;for(let i=0;i<o.edges.length;i++){let a=o.edges[i],c=s.edges[i],u=o.type==="directed"?a.source===c.source&&a.target===c.target:a.source===c.source&&a.target===c.target||a.source===c.target&&a.target===c.source;if(a.index!==c.index||!u||!t(a.data,c.data))return!1}return!0}}function y9(e,t,n){return(r,o)=>{let s=wd({type:e,nodes:[],edges:[]}),i=r.constant(s),a=r.array(t.arbitrary).chain((c)=>{let u=c.map((f,d)=>({index:d,data:f}));if(u.length===0)return i;let l=r.integer({min:0,max:u.length-1});return r.array(r.tuple(l,l,n.arbitrary)).map((f)=>wd({type:e,nodes:u,edges:f.map(([d,m,g],b)=>({index:b,source:d,target:m,data:g}))}))});return Qa(r,o,i,a)}}function m2(e,t,n){let r=Qn()([t,n],([o,s])=>{let i=D$(e,o,s);return(a,c,u)=>{if(!Gv(a)||a.mutable||a.type!==e)return A(new ft(c,a,u));return ne(vt(i)(bd(a),u),(l)=>$$(l,u))}},{representation:{id:"effect/schema/Graph",payload:e},toCode:({typeParameters:o})=>({runtime:`Schema.Graph(${B(e)}, ${o[0].runtime}, ${o[1].runtime})`,Type:`Graph.Graph<${o[0].Type}, ${o[1].Type}, ${B(e)}>`,importDeclarations:['import * as Graph from "effect/Graph"']}),expected:`an immutable ${e} Graph`,toCodec:([o,s])=>Je()(D$(e,o,s),Sr({decode:$$,encode:(i,a)=>g9(i,e,a)})),toArbitrary:([o,s])=>y9(e,o,s),toEquivalence:([o,s])=>x9(o,s),toFormatter:()=>globalThis.String});return V(r.ast,{type:e,node:t,edge:n})}function h2(e,t){let n=Qn()([e,t],([r,o])=>{let s=$e(Ju([r,o]));return(i,a,c)=>{if(zN(i))return Jt(vt(s)(Og(i),c),{onSuccess:Tg,onFailure:(u)=>Kn(a,"entries",u,i,c)});return A(new ft(a,i,c))}},{representation:{id:"effect/schema/HashMap",payload:null},toCode:({typeParameters:r})=>({runtime:`Schema.HashMap(${r[0].runtime}, ${r[1].runtime})`,Type:`HashMap.HashMap<${r[0].Type}, ${r[1].Type}>`,importDeclarations:['import * as HashMap from "effect/HashMap"']}),expected:"HashMap",toCodec:([r,o])=>Je()($e(Ju([r,o])),st({decode:Tg,encode:Og})),toArbitrary:([r,o])=>(s,i)=>d2(s,i,r,o,Tg),toEquivalence:([r,o])=>Fp(r,o),toFormatter:([r,o])=>(s)=>{let i=WN(s);if(i===0)return"HashMap(0) {}";let a=Og(s).sort().map(([c,u])=>`${r(c)} => ${o(u)}`);return`HashMap(${i}) { ${a.join(", ")} }`}});return V(n.ast,{key:e,value:t})}function g2(e){let t=Qn()([e],([n])=>{let r=$e(n);return(o,s,i)=>{if(o instanceof globalThis.Set)return Jt(vt(r)([...o],i),{onSuccess:(a)=>new globalThis.Set(a),onFailure:(a)=>Kn(s,"values",a,o,i)});return A(new ft(s,o,i))}},{representation:{id:"effect/schema/ReadonlySet",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.ReadonlySet(${n[0].runtime})`,Type:`globalThis.ReadonlySet<${n[0].Type}>`}),expected:"ReadonlySet",toCodec:([n])=>Je()($e(n),st({decode:(r)=>new globalThis.Set(r),encode:(r)=>[...r.values()]})),toArbitrary:([n])=>(r,o)=>tx(r,o,n.arbitrary,n.terminal,(s)=>new globalThis.Set(s),Y),toEquivalence:([n])=>Mp(n),toFormatter:([n])=>(r)=>{let o=r.size;if(o===0)return"ReadonlySet(0) {}";let s=globalThis.Array.from(r.values()).sort().map((i)=>`${n(i)}`);return`ReadonlySet(${o}) { ${s.join(", ")} }`}});return V(t.ast,{value:e})}function x2(e){let t=Qn()([e],([n])=>{let r=$e(n);return(o,s,i)=>{if(YN(o))return Jt(vt(r)(Lt(o),i),{onSuccess:_g,onFailure:(a)=>Kn(s,"values",a,o,i)});return A(new ft(s,o,i))}},{representation:{id:"effect/schema/HashSet",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.HashSet(${n[0].runtime})`,Type:`HashSet.HashSet<${n[0].Type}>`}),expected:"HashSet",toCodec:([n])=>Je()($e(n),st({decode:_g,encode:Lt})),toArbitrary:([n])=>(r,o)=>tx(r,o,n.arbitrary,n.terminal,_g,Y),toEquivalence:([n])=>Mp(n),toFormatter:([n])=>(r)=>{let o=QN(r);if(o===0)return"HashSet(0) {}";let s=globalThis.Array.from(r).sort().map((i)=>`${n(i)}`);return`HashSet(${o}) { ${s.join(", ")} }`}});return V(t.ast,{value:e})}function y2(e){let t=Qn()([e],([n])=>{let r=$e(n);return(o,s,i)=>{if(Eh(o))return Jt(vt(r)(Lt(o),i),{onSuccess:bh,onFailure:(a)=>Kn(s,"values",a,o,i)});return A(new ft(s,o,i))}},{representation:{id:"effect/schema/Chunk",payload:null},toCode:({typeParameters:n})=>({runtime:`Schema.Chunk(${n[0].runtime})`,Type:`Chunk.Chunk<${n[0].Type}>`}),expected:"Chunk",toCodec:([n])=>Je()($e(n),st({decode:bh,encode:Lt})),toArbitrary:([n])=>(r,o)=>tx(r,o,n.arbitrary,n.terminal,bh),toEquivalence:([n])=>Yb(n),toFormatter:([n])=>(r)=>{let o=aP(r);if(o===0)return"Chunk(0) {}";let s=globalThis.Array.from(r).sort().map((i)=>`${n(i)}`);return`Chunk(${o}) { ${s.join(", ")} }`}});return V(t.ast,{value:e})}function zk(e,t,n){let r={...t};if(e?.minimum!==void 0){let o=n===void 0?e.minimum:n(e.minimum),s=e.exclusiveMinimum?new globalThis.Date(o.getTime()+1):o;if(r.min===void 0||s.getTime()>r.min.getTime())r.min=s}if(e?.maximum!==void 0){let o=n===void 0?e.maximum:n(e.maximum),s=e.exclusiveMaximum?new globalThis.Date(o.getTime()-1):o;if(r.max===void 0||s.getTime()<r.max.getTime())r.max=s}return r}function Vg(e,t){return Ri(e,t).value}function M9(e,t,n){return n?Vg(Ww(e,t),t)+globalThis.BigInt(1):Vg(zw(e,t),t)}function N9(e,t,n){return n?Vg(zw(e,t),t)-globalThis.BigInt(1):Vg(Ww(e,t),t)}function D9(e){return Math.max(k2,e.minimum?.scale??0,e.maximum?.scale??0,e.exclusiveMinimum&&e.minimum!==void 0?e.minimum.scale+1:0,e.exclusiveMaximum&&e.maximum!==void 0?e.maximum.scale+1:0)}function Tk(e,t){let n={};if(e.minimum!==void 0)n.min=M9(e.minimum,t,e.exclusiveMinimum===!0);if(e.maximum!==void 0)n.max=N9(e.maximum,t,e.exclusiveMaximum===!0);if(n.min!==void 0&&n.max!==void 0&&n.min>n.max)return;return n}function $9(e){let t=D9(e);if(Tk(e,t)===void 0)throw new globalThis.Error(I2);let n=0,r=t;while(n<r){let o=n+Math.floor((r-n)/2);if(Tk(e,o)===void 0)n=o+1;else r=o}return{min:n,max:t}}function C2(e,t){return j9.pipe(de(e,_M(t)))}function z9(e){return Vk.pipe(de(e,RM))}function K9(e){return Gk.pipe(de(e,PM))}function Qk(e,t,n,r,o){let s=E7(n,t,r),i=F2(t),a=class extends e{constructor(...[c,u]){let f=u?.["~payload"],d=f?.token===Ak?f.value:n.make(c??{},u);super(d,{...u,disableChecks:!0,"~payload":{token:Ak,value:d}})}static[Ud]=Ud;get[i](){return i}static[y7]=!0;static identifier=t;static fields=n.fields;static get ast(){return s(this).ast}static pipe(){return le(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,u){return new this(c,u)}static makeOption(c,u){return Pg(s(this))(c??{},u)}static makeEffect(c,u){return s(this).makeEffect(c??{},u)}static annotate(c){return this.rebuild(Ur(this.ast,c))}static annotateKey(c){return this.rebuild(Sd(this.ast,c))}static check(...c){return this.rebuild(Fo(this.ast,c))}static extend(c){return(u,l)=>{let f=Xd(u)?u:Q(u),d={...n.fields,...f.fields},m=og(d,n.ast.checks,{identifier:c});return Qk(this,c,Fk(Fo(m,f.ast.checks),d),l,o)}}static mapFields(c,u){return n.mapFields(c,u)}};if(o!==void 0)Object.assign(a.prototype,o(t));return a}function S7(e){return new Pe(ve((t)=>new e(t,{"~payload":{token:Ak,value:t}})),ro())}function F2(e){return`~effect/Schema/Class/${e}`}function E7(e,t,n){let r;return(o)=>{if(r!==void 0)return r;let s=F2(t),i=(u)=>u instanceof o||M(u,s),a=S7(o),c=V(new Ba([e.ast],()=>(u,l,f)=>i(u)?v(u):A(new ft(l,u,f)),{identifier:t,[Fh]:([u])=>({isConstructed:i,link:new dt(u,a)}),toCodec:([u])=>new dt(u.ast,a),toArbitrary:([u])=>()=>({arbitrary:u.arbitrary.map((l)=>new o(l)),terminal:u.terminal?.map((l)=>new o(l))}),toFormatter:([u])=>(l)=>`${o.identifier}(${u(l)})`,[td]:Ru(e.ast),...n}));return r=de(c,a)(e)}}function Xd(e){return Jg(e)}function w7(e){let t=HD(e.ast);return(n)=>t(n,{})}function v7(e){return(t)=>t.annotate({toFormatter:e})}function k7(e,t){return n(e.ast);function n(o){let s=_o(o)?.toFormatter;if(typeof s==="function")return s(Mi(o)?o.typeParameters.map(n):[]);if(t?.onBefore){let i=t.onBefore(o,n);if(i!==void 0)return i}return r(o)}function r(o){switch(o._tag){default:return B;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let s=o.elements.map(n),i=o.rest.map(n);return(a)=>{let c=[],u=0;for(;u<s.length;u++)if(a.length<u+1){if(bt(o.elements[u]))continue}else c.push(s[u](a[u]));if(i.length>0){let[l,...f]=i;for(;u<a.length-f.length;u++)c.push(l(a[u]));for(let d=0;d<f.length;d++)c.push(f[d](a[u+d]))}return"["+c.join(", ")+"]"}}case"Objects":{let s=o.propertySignatures.map((a)=>n(a.type)),i=o.indexSignatures.map((a)=>n(a.type));if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return B;return(a)=>{let c=[],u=new Set;for(let l=0;l<s.length;l++){let f=o.propertySignatures[l],d=f.name;if(u.add(d),bt(f.type)&&!Object.hasOwn(a,d))continue;c.push(`${Go(d)}: ${s[l](a[d])}`)}for(let l=0;l<i.length;l++){let f=La(a,o.indexSignatures[l].parameter);for(let d of f){if(u.has(d))continue;u.add(d),c.push(`${Go(d)}: ${i[l](a[d])}`)}}return c.length>0?"{ "+c.join(", ")+" }":"{}"}}case"Union":{let s=sn(o).types,i=(c)=>md(c,s),a=new Map(s.map((c,u)=>[c,[Ad(c),n(o.types[u])]]));return(c)=>{let u=i(c);for(let l=0;l<u.length;l++){let[f,d]=a.get(u[l]);if(f(c))return d(c)}return B(c)}}case"Suspend":{let s=Ha(()=>n(o.thunk()));return(i)=>s()(i)}}}}function I7(e){return(t)=>t.annotate({toEquivalence:e})}function C7(e){return zD(e.ast)}function T7(e,t){return bk(e.ast,t)}function N2(e,t){let n=bk(ox(e.ast),t);return i$(n,t)}function D2(e){return V(ox(e.ast),{schema:e})}function Xk(e){return e.constructorDefault===void 0?e:new so(e.isOptional,e.isMutable,void 0,e.annotations)}function $2(e){if(e.propertySignatures.some((t)=>typeof t.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e})}function U2(e){return(t)=>{let n=new Map;for(let s=0;s<t.length;s++)n.set(Jn(t[s]),s);let r=[...t].sort((s,i)=>{s=Jn(s),i=Jn(i);let a=e(s),c=e(i);if(a!==c)return a-c;return n.get(s)-n.get(i)});if(!r.some((s,i)=>s!==t[i]))return t;return r}}function A7(e,t){switch(e._tag){case"Declaration":{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!ln(n))return Ge(e,[_v]);let r=e.typeParameters.map((s)=>Rd(Jn(s))),o=n(r);return o===void 0?e:Ge(e,[Nu(o,t)])}case"Unknown":return Ge(e,[_v]);case"ObjectKeyword":return Ge(e,[M1]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return $2(e),e.recur(t,mg);case"Union":{let n=O7(e.types);if(n!==e.types)return new Fn(n,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}function L2(e){return V(j2(sn(e.ast)))}function _7(e,t){switch(e._tag){case"Declaration":{let n=e.annotations?.toCodecIso??e.annotations?.toCodec;if(ln(n)){let r=n(e.typeParameters.map((o)=>Rd(o)));return Ge(e,[Nu(r,t)])}return e}case"Arrays":case"Objects":case"Union":case"Suspend":return e.recur(t)}return e}function ep(e){return V(q2(e.ast),{schema:e})}function R7(e){return V(z2(e.ast))}function P7(e,t){let n=ku(e.ast)??xw(e.ast),r=G$(ep(e));return(o)=>r(o).pipe(oe((s)=>F7(s,{rootName:n,...t})))}function F7(e,t){let n=t.rootName??"root",r=t.arrayItemName??"item",o=t.pretty??!0,s=t.indent??" ",i=t.sortKeys??!0,a=new Set,c=[];return l(n,e,0),c.join(o?`
|
|
36
|
-
`:"");function u(f,d){c.push(o?s.repeat(f)+d:d)}function l(f,d,m,g){let{attrs:b,safe:x}=Gu.tagInfo(f,g);if(d===void 0)u(m,`<${x}${b}/>`);else if(typeof d==="string")u(m,`<${x}${b}>${Gu.escapeText(d)}</${x}>`);else if(typeof d!=="object"||d===null)u(m,`<${x}${b}>${Gu.escapeText(B(d))}</${x}>`);else{if(a.has(d))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:d});a.add(d);try{if(globalThis.globalThis.Array.isArray(d)){if(d.length===0){u(m,`<${x}${b}/>`);return}u(m,`<${x}${b}>`);for(let S of d)l(r,S,m+1);u(m,`</${x}>`);return}let I=d,C=Object.keys(I);if(i)C.sort();if(C.length===0){u(m,`<${x}${b}/>`);return}u(m,`<${x}${b}>`);for(let S of C)l(Gu.parseTagName(S).safe,I[S],m+1,S);u(m,`</${x}>`)}finally{a.delete(d)}}}}function N7(e,t,n){switch(e._tag){case"Declaration":{let r=e.typeParameters.map((u)=>V(t(Jn(u)))),o=e.annotations?.toCodecStringTree;if(ln(o)){let u=o(r);if(u===void 0)return e;return Ge(e,[Nu(u,t)])}let s=e.annotations?.toCodecJson,i=ln(s)?s(r):void 0,a=i===void 0?e.annotations?.toCodec:void 0,c=i??(ln(a)?a(r):void 0);return c===void 0?n(e):Ge(e,[Nu(c,t)])}case"Null":return Ge(e,[D7]);case"Boolean":return Ge(e,[$7]);case"Unknown":case"ObjectKeyword":return Ge(e,[Rv]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return $2(e),e.recur(t,mg);case"Union":{let r=M7(e.types);if(r!==e.types)return new Fn(r,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}function U7(e){return e._tag==="Declaration"||e._tag==="Arrays"||e._tag==="Objects"||e._tag==="Union"||e._tag==="Suspend"?e.recur(z2):e}function J7(e){let t=L2(e);return g$(ak(t),sk(t))}function Z7(e){return qg()}function Y7(e){return qg()}function Q7(e,t){return(n)=>V(Ur(n.ast,{toCodecIso:()=>new dt(e.ast,Zh(t))}),{schema:n})}function X7(e){let t=D2(e),n=ak(t),r=sk(t);return{empty:[],diff:(o,s)=>l$(n(o),n(s)),combine:(o,s)=>[...o,...s],patch:(o,s)=>{let i=n(o),a=f$(s,i);return Object.is(a,i)?o:r(a)}}}function eX(e){let t=oU(()=>n),n=pt([e,$e(t),Yg(J,t)]);return n}function sX(e){return _o(e.ast)}function iX(e){return e.ast.context?.annotations}var Ud,Ld="~effect/SchemaError/SchemaError",Za,Bd,uQ,lQ,fQ,dQ,pQ,mQ,hQ,gQ,G$,xQ,yQ,SQ,EQ,bQ,wQ,V,Ds,vQ,Nn,kQ,IQ,CQ,Dn,Xu,jd="~effect/Schema/flip",RQ,PQ,Rk,Fe,Pk,J,Hd,Zg,eU,$o,FQ,MQ,$Q=(e)=>typeof e==="symbol"?e:globalThis.String(e),$e,HQ,WQ,Mk,Qg,rU,Ze,T$="^\\S[\\s\\S]*\\S$|^\\S$|^$",s8,i8,a8,c8,u8,l8,f8=(e)=>{if(e)return new globalThis.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})$`);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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/},d8,O$,p8,m8,h8,g8,x8,y8,S8,A$="^[^a-z]*$",E8,_$="^[^A-Z]*$",b8,R$="^[^a-z]?.*$",w8,P$="^[^A-Z]?.*$",v8,Zn,OU,k8,_U,I8,Lk,C8,RU,T8,PU,O8,Gd,A8,FU,_8,R8,Uo,an,MU,NU,DU,$U,UU,LU,jU,BU,HU,qU,M8,N8,D8,$8,U8,L8,j8,B8,H8,q8,z8,W8,K8,V8,G8,J8,XU,Z8,Y8,o9,s9,i9,a9,u9,l9,f9,d9,a2=(e)=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),c2=(e)=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},F$,p9,M$,m9,h9,S9,E9,b9,w9,v9,S2,k9,E2,nx,I9,C9,b2,Yn,T9,O9,A9,Zd,_9,R9,w2,P9,F9,v2,k2=20,I2="Unable to derive an arbitrary for the ordered BigDecimal constraints",Wk,U9,L9,j9,B9,Kk,H9,Vk,q9,Gk,W9,V9,G9,J9,T2,Z9,Y9,Q9,X9,e7,Ok,t7,n7,O2,Yd,r7,o7,s7,i7,Qd,a7,c7,u7,l7,A2,f7,_2,Jk,d7,p7,R2,Zk,m7,h7,P2,Yk,g7,x7,y7,Ak,M2=(e)=>(t,n)=>{let r=Xd(t)?t:Q(t);return Qk(sm,e,r,n,(o)=>({toString(){return`${o}(${B({...this})})`}}))},b7=(e)=>(t,n,r)=>{let o=Xd(n)?n.mapFields((s)=>({_tag:$s(t),...s}),{unsafePreserveChecks:!0}):Xg(t,n);return M2(e??t)(o,r)},rx=(e)=>(t,n)=>{let r=Xd(t)?t:Q(t);return Qk(Al,e,r,n,(s)=>({name:s}))},po=(e)=>(t,n,r)=>{let o=Xd(n)?n.mapFields((s)=>({_tag:$s(t),...s}),{unsafePreserveChecks:!0}):Xg(t,n);return rx(e??t)(o,r)},ox,O7,j2,Gu,M7,D7,$7,B2,H2=(e)=>e.transformation===B2,q2,U$=(e)=>bt(e)?Du(Rs):Rs,z2,L7,j7,B7,H7,q7,z7,W7,K7,V7,G7,tp,tX,nX,rX,W2,oX;var Xa=w(()=>{An();Kw();rn();cP();Wc();Hh();ai();Oe();cm();yt();Xo();dr();kn();X();NN();KN();XN();rt();ht();Vv();Ti();yD();qD();WD();a$();c$();hm();p$();xk();Xm();E$();_e();ia();Qe();he();NC();$d();yk();gn();om();Ps();Vh();Ai();Mg();Xh();Dg();Ud=Ng;Za=class Za extends ci("SchemaError"){[Ld]=Ld;constructor(e){let t=li();ir(0);try{super({issue:e})}finally{ir(t)}}get message(){return wF(this.issue)}toString(){return`SchemaError(${this.message})`}};Bd=nD,uQ=oD;lQ=Us;fQ=z$,dQ=ok,pQ=iD;mQ=W$;hQ=K$;gQ=V$;G$=Gg;xQ=J$,yQ=ik,SQ=uD;EQ=Z$;bQ=Y$;wQ=Q$,V=Rd;Ds=En((e)=>V(Du(e.ast),{schema:e})),vQ=En((e)=>e.schema),Nn=En((e)=>{let t=Qg(e);return V(S1(e.ast),{schema:t})}),kQ=En((e)=>e.schema.members[0]),IQ=En((e)=>V(kv(e.ast),{schema:e})),CQ=En((e)=>e.schema),Dn=En((e)=>V(sn(e.ast),{schema:e})),Xu=En((e)=>V(Jn(e.ast),{schema:e}));RQ=V(JM),PQ=V(YM),Rk=V(Rs),Fe=V(lv),Pk=V(fv),J=V(Po),Hd=V(hv),Zg=V(s1),eU=V(a1),$o=V(u1),FQ=V(VM),MQ=V(e1);$e=En((e)=>V(new io(!1,[],[e.ast]),{value:e})),HQ=En((e)=>V(new io(!1,[e.ast],[e.ast]),{value:e}));WQ=En((e)=>V(new io(!0,e.ast.elements,e.ast.rest),{schema:e}));Mk=En((e)=>pt([e,Fe])),Qg=En((e)=>pt([e,Pk])),rU=En((e)=>pt([e,Fe,Pk]));Ze=cg;s8=ge("effect/schema/isTrimmed",Fe,({annotations:e})=>$k(e));i8=Q({source:J,flags:J}).check(Ze((e)=>{let t=iS(()=>new globalThis.RegExp(e.source,e.flags));return Ut(t)&&t.success.source===e.source&&t.success.flags===e.flags})),a8={id:"effect/schema/isPattern",payloadSchema:i8,revive:({annotations:e,payload:t})=>Ya(new globalThis.RegExp(t.source,t.flags),e)};c8=ge("effect/schema/isStringFinite",Fe,({annotations:e})=>mU(e));u8=ge("effect/schema/isStringBigInt",Fe,({annotations:e})=>hU(e));l8=ge("effect/schema/isStringSymbol",Fe,({annotations:e})=>gU(e));d8=ge("effect/schema/isUUID",Q({version:pt([Ls([1,2,3,4,5,6,7,8]),Fe])}),({annotations:e,payload:t})=>xU(t.version??void 0,e)),O$=/^([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})$/;p8=ge("effect/schema/isGUID",Fe,({annotations:e})=>yU(e));m8=ge("effect/schema/isULID",Fe,({annotations:e})=>SU(e));h8=ge("effect/schema/isBase64",Fe,({annotations:e})=>Uk(e));g8=ge("effect/schema/isBase64Url",Fe,({annotations:e})=>EU(e));x8=ge("effect/schema/isStartsWith",Q({startsWith:J}),({annotations:e,payload:t})=>bU(t.startsWith,e));y8=ge("effect/schema/isEndsWith",Q({endsWith:J}),({annotations:e,payload:t})=>wU(t.endsWith,e));S8=ge("effect/schema/isIncludes",Q({includes:J}),({annotations:e,payload:t})=>vU(t.includes,e));E8=ge("effect/schema/isUppercased",Fe,({annotations:e})=>kU(e));b8=ge("effect/schema/isLowercased",Fe,({annotations:e})=>IU(e));w8=ge("effect/schema/isCapitalized",Fe,({annotations:e})=>CU(e));v8=ge("effect/schema/isUncapitalized",Fe,({annotations:e})=>TU(e)),Zn=V(Ev),OU=Sv,k8=ge("effect/schema/isFinite",Fe,({annotations:e})=>OU(e));_U=qd({order:rr,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThan",payload:{exclusiveMinimum:Zu(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${B(e)})`})})}),I8=ge("effect/schema/isGreaterThan",Q({exclusiveMinimum:Zn}),({annotations:e,payload:t})=>_U(t.exclusiveMinimum,e)),Lk=zd({order:rr,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThanOrEqualTo",payload:{minimum:Zu(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${B(e)})`})})}),C8=ge("effect/schema/isGreaterThanOrEqualTo",Q({minimum:Zn}),({annotations:e,payload:t})=>Lk(t.minimum,e)),RU=Wd({order:rr,annotate:(e)=>({representation:{id:"effect/schema/isLessThan",payload:{exclusiveMaximum:Zu(e)}},toJsonSchema:()=>({exclusiveMaximum:e}),toCode:()=>({runtime:`Schema.isLessThan(${B(e)})`})})}),T8=ge("effect/schema/isLessThan",Q({exclusiveMaximum:Zn}),({annotations:e,payload:t})=>RU(t.exclusiveMaximum,e)),PU=Kd({order:rr,annotate:(e)=>({representation:{id:"effect/schema/isLessThanOrEqualTo",payload:{maximum:Zu(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${B(e)})`})})}),O8=ge("effect/schema/isLessThanOrEqualTo",Q({maximum:Zn}),({annotations:e,payload:t})=>PU(t.maximum,e)),Gd=Vd({order:rr,annotate:(e)=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetween",payload:{minimum:Zu(e.minimum),maximum:Zu(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?"exclusiveMinimum":"minimum"]:e.minimum,[n?"exclusiveMaximum":"maximum"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${B(e.minimum)}, maximum: ${B(e.maximum)}, exclusiveMinimum: ${B(t)}, exclusiveMaximum: ${B(n)} })`})}}}),A8=ge("effect/schema/isBetween",Q({minimum:Zn,maximum:Zn,exclusiveMinimum:Nn(Ke(!0)),exclusiveMaximum:Nn(Ke(!0))}),({annotations:e,payload:t})=>Gd(t,e)),FU=AU({remainder:nR,zero:0,annotate:(e)=>({expected:`a value that is a multiple of ${e}`,representation:{id:"effect/schema/isMultipleOf",payload:{divisor:e}},toJsonSchema:()=>({multipleOf:e}),toCode:()=>({runtime:`Schema.isMultipleOf(${B(e)})`})})}),_8=ge("effect/schema/isMultipleOf",Q({divisor:Zn}),({annotations:e,payload:t})=>FU(t.divisor,e));R8=ge("effect/schema/isInt",Fe,({annotations:e})=>Jd(e)),Uo=Hd.check(Jd()),an=Uo.check(Lk(0));MU=qd({order:sa,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThanDate",payload:{exclusiveMinimum:Yu(e)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanDate(${Qu(e)})`})})}),NU=zd({order:sa,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThanOrEqualToDate",payload:{minimum:Yu(e)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToDate(${Qu(e)})`})})}),DU=Wd({order:sa,annotate:(e)=>({representation:{id:"effect/schema/isLessThanDate",payload:{exclusiveMaximum:Yu(e)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanDate(${Qu(e)})`})})}),$U=Kd({order:sa,annotate:(e)=>({representation:{id:"effect/schema/isLessThanOrEqualToDate",payload:{maximum:Yu(e)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanOrEqualToDate(${Qu(e)})`})})}),UU=Vd({order:sa,annotate:(e)=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetweenDate",payload:{minimum:Yu(e.minimum),maximum:Yu(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isBetweenDate({ minimum: ${Qu(e.minimum)}, maximum: ${Qu(e.maximum)}, exclusiveMinimum: ${B(t)}, exclusiveMaximum: ${B(n)} })`})}}}),LU=qd({order:Cr,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThanBigInt",payload:{exclusiveMinimum:e.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanBigInt(${B(e)})`})})}),jU=zd({order:Cr,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThanOrEqualToBigInt",payload:{minimum:e.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualToBigInt(${B(e)})`})})}),BU=Wd({order:Cr,annotate:(e)=>({representation:{id:"effect/schema/isLessThanBigInt",payload:{exclusiveMaximum:e.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanBigInt(${B(e)})`})})}),HU=Kd({order:Cr,annotate:(e)=>({representation:{id:"effect/schema/isLessThanOrEqualToBigInt",payload:{maximum:e.toString(10)}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isLessThanOrEqualToBigInt(${B(e)})`})})}),qU=Vd({order:Cr,annotate:(e)=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:"effect/schema/isBetweenBigInt",payload:{minimum:e.minimum.toString(10),maximum:e.maximum.toString(10),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({}),toCode:()=>({runtime:`Schema.isBetweenBigInt({ minimum: ${B(e.minimum)}, maximum: ${B(e.maximum)}, exclusiveMinimum: ${B(t)}, exclusiveMaximum: ${B(n)} })`})}}}),M8=qd({order:_s,formatter:(e)=>Ro(e)}),N8=zd({order:_s,formatter:(e)=>Ro(e)}),D8=Wd({order:_s,formatter:(e)=>Ro(e)}),$8=Kd({order:_s,formatter:(e)=>Ro(e)}),U8=Vd({order:_s,formatter:(e)=>Ro(e)});L8=ge("effect/schema/isMinLength",Q({minLength:an}),({annotations:e,payload:t})=>jk(t.minLength,e));j8=ge("effect/schema/isMaxLength",Q({maxLength:an}),({annotations:e,payload:t})=>WU(t.maxLength,e));B8=ge("effect/schema/isLengthBetween",Q({minimum:an,maximum:an}),({annotations:e,payload:t})=>Bk(t.minimum,t.maximum,e));H8=ge("effect/schema/isMinSize",Q({minSize:an}),({annotations:e,payload:t})=>KU(t.minSize,e));q8=ge("effect/schema/isMaxSize",Q({maxSize:an}),({annotations:e,payload:t})=>VU(t.maxSize,e));z8=ge("effect/schema/isSizeBetween",Q({minimum:an,maximum:an}),({annotations:e,payload:t})=>GU(t.minimum,t.maximum,e));W8=ge("effect/schema/isMinProperties",Q({minProperties:an}),({annotations:e,payload:t})=>JU(t.minProperties,e));K8=ge("effect/schema/isMaxProperties",Q({maxProperties:an}),({annotations:e,payload:t})=>ZU(t.maxProperties,e));V8=ge("effect/schema/isPropertiesLengthBetween",Q({minimum:an,maximum:an}),({annotations:e,payload:t})=>YU(t.minimum,t.maximum,e));G8=ge("effect/schema/isPropertyNames",Fe,({annotations:e,schemas:t})=>QU(t[0],e));J8=ge("effect/schema/isUnique",Fe,({annotations:e})=>Hk(e)),XU=J.check(zU()),Z8=J.check(Bk(1,1));Y8=Mn("effect/schema/Option",Fe,({annotations:e,typeParameters:t})=>{let n=ji(t[0]);return e===void 0?n:n.annotate(e)});o9=Mn("effect/schema/Result",Fe,({annotations:e,typeParameters:t})=>{let n=e2(t[0],t[1]);return e===void 0?n:n.annotate(e)}),s9=Br((e)=>{if(!fn(e))return!1;let t=globalThis.Object.keys(e);return t.length>0&&t.every((n)=>{switch(n){case"label":return typeof e[n]==="string";case"disallowJsonEncode":return e[n]===!0;default:return!1}})}),i9=pt([Fe,s9]);a9=Mn("effect/schema/Redacted",i9,({annotations:e,payload:t,typeParameters:n})=>{let r=ex(n[0],t??void 0);return e===void 0?r:r.annotate(e)});u9=Mn("effect/schema/CauseReason",Fe,({annotations:e,typeParameters:t})=>{let n=Wg(t[0],t[1]);return e===void 0?n:n.annotate(e)});l9=Mn("effect/schema/Cause",Fe,({annotations:e,typeParameters:t})=>{let n=Kg(t[0],t[1]);return e===void 0?n:n.annotate(e)});f9=Br((e)=>{if(!fn(e))return!1;let t=globalThis.Object.keys(e);return t.length>0&&t.every((n)=>(n==="includeStack"||n==="excludeCause")&&e[n]===!0)}),d9=pt([Fe,f9]),F$=[];p9=Mn("effect/schema/Error",d9,({annotations:e,payload:t})=>{let n=u2(t??void 0);return e===void 0?n:n.annotate(e)}),M$=[];m9=Mn("effect/schema/Exit",Fe,({annotations:e,typeParameters:t})=>{let n=l2(t[0],t[1],t[2]);return e===void 0?n:n.annotate(e)});h9=Mn("effect/schema/ReadonlyMap",Fe,({annotations:e,typeParameters:t})=>{let n=p2(t[0],t[1]);return e===void 0?n:n.annotate(e)});S9=Mn("effect/schema/Graph",Ls(["directed","undirected"]),({annotations:e,payload:t,typeParameters:n})=>{let r=m2(t,n[0],n[1]);return e===void 0?r:r.annotate(e)});E9=Mn("effect/schema/HashMap",Fe,({annotations:e,typeParameters:t})=>{let n=h2(t[0],t[1]);return e===void 0?n:n.annotate(e)});b9=Mn("effect/schema/ReadonlySet",Fe,({annotations:e,typeParameters:t})=>{let n=g2(t[0]);return e===void 0?n:n.annotate(e)});w9=Mn("effect/schema/HashSet",Fe,({annotations:e,typeParameters:t})=>{let n=x2(t[0]);return e===void 0?n:n.annotate(e)});v9=Mn("effect/schema/Chunk",Fe,({annotations:e,typeParameters:t})=>{let n=y2(t[0]);return e===void 0?n:n.annotate(e)}),S2=Li(globalThis.RegExp,{representation:{id:"effect/schema/RegExp",payload:null},toCode:()=>({runtime:"Schema.RegExp",Type:"globalThis.RegExp"}),expected:"RegExp",toCodecJson:()=>Je()(Q({source:J,flags:J}),Sr({decode:(e,t)=>Nt({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new we({expected:"valid RegExp source and flags"},e,t)}),encode:(e)=>v({source:e.source,flags:e.flags})})),toArbitrary:()=>(e)=>e.tuple(e.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),e.uniqueArray(e.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((t)=>t.join(""))).map(([t,n])=>new globalThis.RegExp(t,n)),toEquivalence:()=>(e,t)=>e.source===t.source&&e.flags===t.flags}),k9=bn("effect/schema/RegExp",S2),E2=J.annotate({expected:"a string that will be decoded as a URL"}),nx=Li(globalThis.URL,{representation:{id:"effect/schema/URL",payload:null},toCode:()=>({runtime:"Schema.URL",Type:"globalThis.URL"}),expected:"URL",toCodecJson:()=>Je()(E2,Gw),toArbitrary:()=>(e)=>e.webUrl().map((t)=>new globalThis.URL(t)),toEquivalence:()=>(e,t)=>e.toString()===t.toString()}),I9=bn("effect/schema/URL",nx),C9=E2.pipe(de(nx,Gw));b2=J.annotate({expected:"a string that will be decoded as a Date"}),Yn=Br((e)=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:"effect/schema/Date",payload:null},toCode:()=>({runtime:"Schema.Date",Type:"globalThis.Date"}),expected:"a valid Date",toCodecJson:()=>Je()(b2,Vw),toArbitrary:()=>(e,t)=>e.date(zk(t?.constraint?.ordered?.order===sa?t.constraint.ordered:void 0,{noInvalidDate:!0}))}),T9=bn("effect/schema/Date",Yn),O9=b2.pipe(de(Yn,Vw)),A9=Uo.pipe(de(Yn,dM)),Zd=Br(xS,{representation:{id:"effect/schema/Duration",payload:null},toCode:()=>({runtime:"Schema.Duration",Type:"Duration.Duration",importDeclarations:['import * as Duration from "effect/Duration"']}),expected:"Duration",toCodecJson:()=>Je()(pt([Q({_tag:Ke("Infinity")}),Q({_tag:Ke("NegativeInfinity")}),Q({_tag:Ke("Nanos"),value:$o}),Q({_tag:Ke("Millis"),value:Uo})]),st({decode:(e)=>{switch(e._tag){case"Infinity":return ss;case"NegativeInfinity":return pa;case"Nanos":return Tr(e.value);case"Millis":return ii(e.value)}},encode:(e)=>{switch(e.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:e.value.nanos};case"Millis":return{_tag:"Millis",value:e.value.millis}}}})),toArbitrary:()=>(e)=>e.oneof(e.constant(ss),e.constant(pa),e.bigInt().map(Tr),e.maxSafeInteger().map(ii)),toFormatter:()=>globalThis.String,toEquivalence:()=>yS}),_9=bn("effect/schema/Duration",Zd),R9=J.annotate({expected:"a string that will be decoded as a Duration"}),w2=R9.pipe(de(Zd,pM)),P9=$o.pipe(de(Zd,mM)),F9=Hd.pipe(de(Zd,hM)),v2=J.annotate({expected:"a string that will be decoded as a BigDecimal"});Wk=Br(Jh,{representation:{id:"effect/schema/BigDecimal",payload:null},toCode:()=>({runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclarations:['import * as BigDecimal from "effect/BigDecimal"']}),expected:"BigDecimal",toCodecJson:()=>Je()(v2,Jw),toArbitrary:()=>(e,t)=>{let n=t.constraint?.ordered?.order===_s?t.constraint.ordered:void 0;if(n===void 0)return e.tuple(e.bigInt(),e.integer({min:0,max:k2})).map(([r,o])=>Gn(r,o));return e.integer($9(n)).chain((r)=>{let o=Tk(n,r);if(o===void 0)throw new globalThis.Error(I2);return e.bigInt(o).map((s)=>Gn(s,r))})},toFormatter:()=>(e)=>Ro(e),toEquivalence:()=>Hw}),U9=bn("effect/schema/BigDecimal",Wk),L9=v2.pipe(de(Wk,Jw)),j9=J.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json"});B9=C2(Rk),Kk=Li(globalThis.File,{representation:{id:"effect/schema/File",payload:null},toCode:()=>({runtime:"Schema.File",Type:"globalThis.File"}),expected:"File",toCodecJson:()=>Je()(Q({data:J.check(Uk()),type:J,name:J,lastModified:Uo}),Sr({decode:(e,t)=>Bn(Vc(e.data),{onFailure:()=>A(new we({expected:"a valid Base64 string"},e.data,t)),onSuccess:(n)=>{let r=new globalThis.Uint8Array(n);return v(new globalThis.File([r],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>lu({try:async()=>{let n=new globalThis.Uint8Array(await e.arrayBuffer());return{data:am(n),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new we({expected:"a readable File"},e,t)})}))}),H9=bn("effect/schema/File",Kk),Vk=Li(globalThis.FormData,{representation:{id:"effect/schema/FormData",payload:null},toCode:()=>({runtime:"Schema.FormData",Type:"globalThis.FormData"}),expected:"FormData",toCodecJson:()=>Je()($e(Ju([J,pt([Q({_tag:$s("String"),value:J}),Q({_tag:$s("File"),value:Kk})])])),Sr({decode:(e)=>{let t=new globalThis.FormData;for(let[n,r]of e)t.append(n,r.value);return v(t)},encode:(e)=>v(globalThis.Array.from(e.entries()).map(([t,n])=>{if(typeof n==="string")return[t,{_tag:"String",value:n}];else return[t,{_tag:"File",value:n}]}))}))}),q9=bn("effect/schema/FormData",Vk);Gk=Li(globalThis.URLSearchParams,{representation:{id:"effect/schema/URLSearchParams",payload:null},toCode:()=>({runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"}),expected:"URLSearchParams",toCodecJson:()=>Je()(J.annotate({expected:"a query string that will be decoded as URLSearchParams"}),st({decode:(e)=>new globalThis.URLSearchParams(e),encode:(e)=>e.toString()}))}),W9=bn("effect/schema/URLSearchParams",Gk);V9=J.annotate({expected:"a string that will be decoded as a number"}).pipe(de(Hd,Au)),G9=J.annotate({expected:"a string that will be decoded as a finite number"}).pipe(de(Zn,Au)),J9=V(Ov).pipe(de($o,Qh)),T2=J.check($k()),Z9=J.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(de(T2,fM())),Y9=J.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(de(J,CM)),Q9=J.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(de(J,TM)),X9=J.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(de(J,OM)),e7=J.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(de(J,AM)),Ok=pt([Zn,eU,J]),t7=Q({issues:$e(Q({message:J,path:Nn($e(pt([Ok,Q({key:Ok})])))}))}),n7=Ls([0,1]).pipe(de(Zg,st({decode:(e)=>e===1,encode:(e)=>e?1:0}))),O2=J.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),Yd=Li(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>Je()(O2,Zw),toArbitrary:()=>(e)=>e.uint8Array()}),r7=bn("effect/schema/Uint8Array",Yd),o7=O2.pipe(de(Yd,Zw)),s7=J.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(de(Yd,{decode:zF(),encode:Wh()})),i7=J.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(de(Yd,{decode:KF(),encode:Kh()})),Qd=Br((e)=>Ow(e)&&TF(e),{representation:{id:"effect/schema/DateTimeUtc",payload:null},toCode:()=>({runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.Utc",toCodecJson:()=>Je()(J,Xw),toArbitrary:()=>(e,t)=>e.date(zk(t?.constraint?.ordered?.order===_w?t.constraint.ordered:void 0,{noInvalidDate:!0},jh)).map((n)=>AF(n)),toFormatter:()=>(e)=>e.toString(),toEquivalence:()=>Aw}),a7=bn("effect/schema/DateTimeUtc",Qd),c7=Yn.pipe(de(Qd,{decode:Uw(),encode:ve(jh)})),u7=J.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(de(Qd,Xw)),l7=Uo.pipe(de(Qd,{decode:Uw(),encode:ve(MF)})),A2=Br(IF,{representation:{id:"effect/schema/TimeZoneOffset",payload:null},toCode:()=>({runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone.Offset",toCodecJson:()=>Je()(Uo,FM),toArbitrary:()=>(e)=>e.integer({min:-43200000,max:50400000}).map((t)=>ad(t)),toFormatter:()=>(e)=>_i(e),toEquivalence:()=>(e,t)=>e.offset===t.offset}),f7=bn("effect/schema/TimeZoneOffset",A2),_2=J.annotate({expected:"an IANA time zone identifier"}),Jk=Br(CF,{representation:{id:"effect/schema/TimeZoneNamed",payload:null},toCode:()=>({runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone.Named",toCodecJson:()=>Je()(_2,Yw),toArbitrary:()=>(e)=>e.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(Rw)),toFormatter:()=>(e)=>_i(e),toEquivalence:()=>(e,t)=>e.id===t.id}),d7=bn("effect/schema/TimeZoneNamed",Jk),p7=_2.pipe(de(Jk,Yw)),R2=J.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),Zk=Br(kF,{representation:{id:"effect/schema/TimeZone",payload:null},toCode:()=>({runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.TimeZone",toCodecJson:()=>Je()(R2,Qw),toArbitrary:()=>(e)=>e.oneof(e.integer({min:-43200000,max:50400000}).map((t)=>ad(t)),e.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(Rw))),toFormatter:()=>(e)=>_i(e),toEquivalence:()=>(e,t)=>_i(e)===_i(t)}),m7=bn("effect/schema/TimeZone",Zk),h7=R2.pipe(de(Zk,Qw)),P2=J.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),Yk=Br((e)=>Ow(e)&&OF(e),{representation:{id:"effect/schema/DateTimeZoned",payload:null},toCode:()=>({runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclarations:['import * as DateTime from "effect/DateTime"']}),expected:"DateTime.Zoned",toCodecJson:()=>Je()(P2,ev),toArbitrary:()=>(e,t)=>e.tuple(e.date(zk(t?.constraint?.ordered?.order===_w?t.constraint.ordered:void 0,{max:new globalThis.Date(8639999949600000),min:new globalThis.Date(-8639999949600000),noInvalidDate:!0},jh)),e.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([n,r])=>_F(n,{timeZone:r})),toFormatter:()=>(e)=>Bh(e),toEquivalence:()=>Aw}),g7=bn("effect/schema/DateTimeZoned",Yk),x7=P2.pipe(de(Yk,ev)),y7=globalThis.Symbol.for("immer-draftable"),Ak={};ox=qa((e)=>{let t=A7(e,ox),n=e.context;if(t===e||n===void 0)return t;return fg(t,Xk(n))});O7=U2((e)=>{switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});j2=Qt((e)=>{let t=_7(e,j2);return t!==e&&e.context!==void 0?fg(t,Xk(e.context)):t});Gu={escapeText(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},escapeAttribute(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},parseTagName(e){let t=e,n=e;if(!/^[A-Za-z_]/.test(n))n="_"+n;if(n=n.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(n))n="_"+n;return{safe:n,changed:n!==t}},tagInfo(e,t){let{changed:n,safe:r}=Gu.parseTagName(e),s=n||t&&t!==e?` data-name="${Gu.escapeAttribute(t??e)}"`:"";return{safe:r,attrs:s}}},M7=U2((e)=>{switch(e._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});D7=new dt(new Er("null"),new Pe(ve(()=>null),ve(()=>"null"))),$7=new dt(new Fn([new Er("true"),new Er("false")],"anyOf"),new Pe(ve((e)=>e==="true"),Ua())),B2=new Pe(ve((e)=>typeof e==="string"?[e]:e),ro()),q2=qa((e)=>{let t=N7(e,q2,(n)=>{throw new globalThis.Error("Missing structural codec for StringTree",{cause:n})});if(t!==e&&e.context!==void 0)return fg(t,Xk(e.context));return t},{stopAt:H2}),z2=qa((e)=>{let t=U7(e);if(uv(t)){let n=dg(new Fn([new io(t.isMutable,t.elements.map(U$),t.rest.map(U$)),Po],"anyOf"),t,B2);return bt(e)?Du(n):n}return t},{stopAt:H2});L7=ge("effect/schema/isGreaterThanDate",Q({exclusiveMinimum:Yn}),({annotations:e,payload:t})=>MU(t.exclusiveMinimum,e)),j7=ge("effect/schema/isGreaterThanOrEqualToDate",Q({minimum:Yn}),({annotations:e,payload:t})=>NU(t.minimum,e)),B7=ge("effect/schema/isLessThanDate",Q({exclusiveMaximum:Yn}),({annotations:e,payload:t})=>DU(t.exclusiveMaximum,e)),H7=ge("effect/schema/isLessThanOrEqualToDate",Q({maximum:Yn}),({annotations:e,payload:t})=>$U(t.maximum,e)),q7=ge("effect/schema/isBetweenDate",Q({minimum:Yn,maximum:Yn,exclusiveMinimum:Nn(Ke(!0)),exclusiveMaximum:Nn(Ke(!0))}),({annotations:e,payload:t})=>UU(t,e)),z7=ge("effect/schema/isGreaterThanBigInt",Q({exclusiveMinimum:$o}),({annotations:e,payload:t})=>LU(t.exclusiveMinimum,e)),W7=ge("effect/schema/isGreaterThanOrEqualToBigInt",Q({minimum:$o}),({annotations:e,payload:t})=>jU(t.minimum,e)),K7=ge("effect/schema/isLessThanBigInt",Q({exclusiveMaximum:$o}),({annotations:e,payload:t})=>BU(t.exclusiveMaximum,e)),V7=ge("effect/schema/isLessThanOrEqualToBigInt",Q({maximum:$o}),({annotations:e,payload:t})=>HU(t.maximum,e)),G7=ge("effect/schema/isBetweenBigInt",Q({minimum:$o,maximum:$o,exclusiveMinimum:Nn(Ke(!0)),exclusiveMaximum:Nn(Ke(!0))}),({annotations:e,payload:t})=>qU(t,e));tp=V(Ur(Fu,{toCode:()=>({runtime:"Schema.Json",Type:"Schema.Json"})})),tX=Yg(J,tp),nX=bn("effect/schema/Json",tp),rX=Q({message:J,name:Ds(J),stack:Ds(J),cause:Ds(tp)}),W2=V(Ur(F1,{toCode:()=>({runtime:"Schema.MutableJson",Type:"Schema.MutableJson"})})),oX=bn("effect/schema/MutableJson",W2)});var K2="~effect/platform/Terminal",eI="effect/platform/Terminal/QuitError",np,V2=(e)=>M(e,eI),mo,G2=(e)=>mo.of({...e,[K2]:K2});var sx=w(()=>{Ve();he();Xa();np=class np extends rx("QuitError")({_tag:$s("QuitError")}){[eI]=eI};mo=ze("effect/platform/Terminal")});import*as ix from"readline";function Y2(e){return e.key.ctrl&&(e.key.name==="c"||e.key.name==="d")}var J2,Z2;var Q2=w(()=>{Oe();wo();_e();Oo();he();Gf();eF();sx();J2=H(function*(e=Y2){let{stdin:t,stdout:n}=process,r=yield*bu(),o=t.readableEnded,s=!1,i=()=>{if(o=!0,!s)ks(r)};t.once("end",i),yield*dh(()=>Se(()=>t.off("end",i)));let a=yield*XP({acquire:Mr(Se(()=>{let m=ix.createInterface({input:t,escapeCodeTimeout:50}),g=(x)=>Wf(r,x),b=()=>{s=!1,ks(r)};if(s=!0,ix.emitKeypressEvents(t,m),m.on("line",g),m.once("close",b),t.isTTY)t.setRawMode(!0);return{rl:m,onClose:b,onLine:g}}),({rl:m,onClose:g,onLine:b})=>Se(()=>{if(s=!1,m.off("line",b),m.off("close",g),t.isTTY)t.setRawMode(!1);if(m.close(),o)ks(r)})),idleTimeToLive:"10 millis"}),c=Se(()=>n.columns??0),u=Se(()=>n.rows??0),l=qt(function*(){let m=yield*bu(),g=(I,C)=>{let S={input:ns(I),key:{name:C.name??"",ctrl:!!C.ctrl,meta:!!C.meta,shift:!!C.shift}};if(Wf(m,S),e(S))ks(m)},b=setInterval(()=>{},2147483647),x=()=>{clearInterval(b),ks(m)};if(yield*dh(()=>Se(()=>{clearInterval(b),t.off("keypress",g),t.off("end",x)})),t.on("keypress",g),o)x();else yield*lw(a),t.once("end",x);return m}),f=Ne(()=>kP(r).pipe(ne(et({onNone:()=>vi(hr(lw(a),Is(r))),onSome:v})),Pt(()=>new np({}))));return G2({columns:c,rows:u,readInput:l,readLine:f,display:(m)=>$f(yn((g)=>{n.write(m,(b)=>B0(b)?g(Te):g(A(bs({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:b}))))}))})}),Z2=su(mo,J2(Y2))});var X2;var eL=w(()=>{Q2();X2=Z2});var ax={};Un(ax,{layer:()=>uX});var uX;var tL=w(()=>{wo();X1();dN();bN();IN();RN();eL();uX=Z1.pipe(N_(Jm(EN,fN,kN,_N,X2)))});var nI=w(()=>{nP();tL()});var el=w(()=>{rn();Wc();Oe();dr();_e();gn();Xa()});var oL=U0(function(xye,rL){var lX=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],nL=/[\n\r\u2028\u2029]/,fX=/[\s#!"$&'():;<=>@\\^`|]/g;rL.exports=function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n==="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(nL.test(n.pattern))throw TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(fX,"\\$&")}if("op"in n&&typeof n.op==="string"){if(lX.indexOf(n.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment==="string"){if(nL.test(n.comment))throw TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(n)&&!/'/.test(n))return"'"+n.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(n))return'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"';return String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var fL=U0(function(yye,lL){var uL="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",sL=new RegExp("^"+uL+"$"),iL="|&;()<> \\t",dX="'([^']*?)'",pX='"((\\\\"|[^"])*?)"',mX=/^#$/,aL="'",cL='"',cx="$",ec="",hX=4294967296;for(ux=0;ux<4;ux++)ec+=(hX*Math.random()).toString(16);var ux,gX=new RegExp("^"+ec);function xX(e,t){var n=t.lastIndex,r=[],o;while(o=t.exec(e))if(r[r.length]=o,t.lastIndex===o.index)t.lastIndex+=1;return t.lastIndex=n,r}function yX(e,t,n){var r=typeof e==="function"?e(n):e[n];if(typeof r>"u"&&n!="")r="";else if(typeof r>"u")r="$";if(typeof r==="object")return t+ec+JSON.stringify(r)+ec;return t+r}function SX(e,t,n){if(!n)n={};var r=n.escape||"\\",o=n.splitUnquoted===!0?`
|
|
37
|
-
`:typeof n.splitUnquoted==="string"?n.splitUnquoted:"",s="(\\"+r+`['"`+iL+`]|[^\\s'"`+iL+"])+",i=new RegExp(["("+uL+")","("+s+"|"+pX+"|"+dX+")+"].join("|"),"g"),a=xX(e,i);if(a.length===0)return[];if(!t)t={};var c=!1;return a.map(function(u){var l=u[0];if(!l||c)return;if(sL.test(l))return{op:l};var f=!1,d=!1,m="",g=[],b=!1,x=null,I=!1,C;function S(){C+=1;var R,z,q=l.charAt(C);if(q==="{"){if(C+=1,l.charAt(C)==="}")throw Error("Bad substitution: "+l.slice(C-2,C+1));var ue=1;R=C;while(ue>0&&R<l.length){if(l.charAt(R)==="{"&&l.charAt(R-1)==="$")ue+=1;else if(l.charAt(R)==="}")ue-=1;R+=1}if(ue!==0)throw Error("Bad substitution: "+l.slice(C));R-=1,z=l.slice(C,R),C=R}else if(/[*@#?$!_-]/.test(q))z=q,C+=1;else{var ut=l.slice(C);if(R=ut.match(/[^\w\d_]/),!R)z=ut,C=l.length;else z=ut.slice(0,R.index),C+=R.index-1}return yX(t,"",z)}function y(){if(x===null)return;if(x===0){if(m!=="")g[g.length]=m,m=""}else{g[g.length]=m,m="";for(var R=1;R<x;R+=1)g[g.length]=""}x=null}for(C=0;C<l.length;C++){var h=l.charAt(C);if(o&&h!==cx)y();if(I=I||!f&&(h==="*"||h==="?"),d)m+=h,d=!1;else if(f)if(h===f)f=!1;else if(f==aL)m+=h;else if(h===r)if(C+=1,h=l.charAt(C),h===cL||h===r||h===cx)m+=h;else m+=r+h;else if(h===cx)m+=S();else m+=h;else if(h===cL||h===aL)f=h,b=!0;else if(sL.test(h))return{op:l};else if(mX.test(h)){c=!0;var E={comment:e.slice(u.index+C+1)};if(m.length)return[m,E];return[E]}else if(h===r)d=!0;else if(h===cx){var k=S();if(!o)m+=k;else for(var T=0;T<k.length;T+=1){var F=k.charAt(T);if(o.indexOf(F)<0)y(),m+=F;else if(x===null)x=F===" "||F==="\t"||F===`
|
|
38
|
-
|
|
39
|
-
`)x+=1}}else m+=h}if(I)return{op:"glob",pattern:m};if(o){if(x!==null&&x>0){g[g.length]=m,m="";for(var N=1;N<x;N+=1)g[g.length]=""}if(m!==""||b&&g.length===0)g[g.length]=m;return g}return m}).reduce(function(u,l){if(typeof l>"u")return u;return[].concat(l).forEach(function(f){u[u.length]=f}),u},[])}lL.exports=function(t,n,r){var o=SX(t,n,r);if(typeof n!=="function")return o;return o.reduce(function(s,i){if(typeof i==="object")return s[s.length]=i,s;var a=i.split(RegExp("("+ec+".*?"+ec+")","g"));if(a.length===1)return s[s.length]=a[0],s;return a.filter(Boolean).forEach(function(c){s[s.length]=gX.test(c)?JSON.parse(c.split(ec)[1]):c}),s},[])}});var js,rI;var dL=w(()=>{js=oL(),rI=fL()});var EX,xL,yL,SL,EL=(e)=>typeof e==="string",Bs=(e)=>{if(typeof e==="object"&&"op"in e&&typeof e.op==="string")return e.op;return null},bX=(e)=>typeof e==="object"&&("comment"in e),wX=(e)=>{try{let t=[...new Bun.Glob(e).scanSync({onlyFiles:!1,dot:!0})];if(t.length>0)return t}catch{}return[e]},vX=(e)=>{if(EL(e))return[e];if(typeof e==="object"&&"op"in e&&e.op==="glob"&&"pattern"in e)return wX(String(e.pattern));let t=Bs(e);if(t!==null){if(yL.has(t)||SL.has(t))return[];return[`__op_${t}__`]}if(bX(e))return[];return["__tripwire_cmd_sub__"]},pL=(e,t)=>{let n=[],r=[],o=[],s=[],i=0;while(i<e.length){let l=e[i],f=Bs(l);if(f!==null&&yL.has(f)){let d=n.at(-1);if(d!==void 0&&/^[0-9]+$/.test(d)&&t.remaining>0)n.pop(),t.remaining-=1;let m=e[i+1];if(m!==void 0&&EL(m)){s.push({op:f,target:m}),i+=2;continue}i+=1;continue}for(let d of vX(l))n.push(d);i+=1}if(n.length===0)return null;for(let l=1;l<n.length;l+=1){let f=n[l];if(f.startsWith("-")&&f!=="-")o.push(f);else r.push(f)}let a=n[0],c=a.lastIndexOf("/");return{head:c===-1?a:a.slice(c+1),tokens:n,args:r,flags:o,redirects:s,raw:n.join(" ")}},kX=(e)=>`$${e}`,IX=(e)=>{let t=[];for(let n=0;n<e.length;n+=1){let r=e[n],o=e[n+1];if(Bs(r)==="&"&&o!==void 0&&(Bs(o)===">"||Bs(o)===">>")){let s={op:Bs(o)===">"?"&>":"&>>"};t.push(s),n+=1;continue}if(Bs(r)===">"&&o!==void 0&&Bs(o)==="|"){t.push({op:">"}),n+=1;continue}t.push(r)}return t},CX=(e)=>e.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0,oI=(e)=>{let t=/<<-?\s*(?:"(?<quoted>[^"]+)"|'(?<single>[^']+)'|(?<unquoted>[A-Za-z_][A-Za-z0-9_]*))/u.exec(e);return t?.groups?.quoted??t?.groups?.single??t?.groups?.unquoted??null},TX,sI=(e)=>TX.test(e),bL=(e)=>{let t=e.split(`
|
|
40
|
-
`),n=[];for(let r=0;r<t.length;r+=1){let o=t[r];n.push(o);let s=oI(o);if(s===null||sI(o))continue;r+=1;while(r<t.length&&t[r].trim()!==s)r+=1;if(r<t.length)n.push("__HEREDOC_BODY__",t[r])}return n.join(`
|
|
41
|
-
|
|
42
|
-
`);for(let r=0;r
|
|
43
|
-
`))}return t},
|
|
44
|
-
`),n=[];for(let r=0;r<t.length;r+=1){let o=t[r],s=oI(o);if(s===null||!sI(o))continue;let i=[];r+=1;while(r<t.length&&t[r].trim()!==s)i.push(t[r]),r+=1;if(i.length>0)n.push(i.join(`
|
|
45
|
-
`))}return n},AX=(e,t)=>{for(let n=t;n<e.length;n+=1){let r=e[n];if(r==="\\"){n+=1;continue}if(r==="`")return n}return null},_X=(e,t)=>{let n=1,r=null;for(let o=t;o<e.length;o+=1){let s=e[o];if(s==="\\"){o+=1;continue}if(r==="single"){if(s==="'")r=null;continue}if(s==="'"){r??="single";continue}if(s==='"'){r=r==="double"?null:"double";continue}if(s==="("){n+=1;continue}if(s===")"){if(n-=1,n===0)return o}}return null},RX=(e)=>{let t=[],n=null;for(let r=0;r<e.length;r+=1){let o=e[r];if(o==="\\"){r+=1;continue}if(n==="single"){if(o==="'")n=null;continue}if(o==="'"){n??="single";continue}if(o==='"'){n=n==="double"?null:"double";continue}if(o==="`"){let u=AX(e,r+1);if(u!==null)t.push(e.slice(r+1,u)),r=u;continue}let s=e[r+1];if(!(o==="$"&&s==="(")&&!(n===null&&(o==="<"||o===">")&&s==="("))continue;let c=_X(e,r+2);if(c!==null)t.push(e.slice(r+2,c)),r=c}return t},vL,kL=(e)=>{if(e===""||e==="-")return!1;if(e==="/"||e==="~"||e==="."||e==="..")return!0;if(e.startsWith("/")||e.startsWith("~")||e.startsWith("./")||e.startsWith("../")||vL.test(e))return!0;return!1},lx=(e)=>{if(e==="/")return 100;if(e==="~"||vL.test(e))return 90;if(/^\/(?<dir>etc|usr|bin|sbin|System|Library|var|boot|root|home)(?<suffix>\/|$)/.test(e))return 80;if(e.startsWith("/Users/"))return 70;if(e.startsWith("/")||e.startsWith("~"))return 60;if(e.startsWith("../"))return 40;if(e===".."||e==="."||e.startsWith("./"))return 10;return 50},PX,FX=(e,t)=>{let n=[],r=1;while(r<t){let o=e[r];if(PX.has(o)){r+=2;continue}if(o.startsWith("-")){r+=1;continue}if(kL(o))n.push(o);r+=1}if(n.length===0)return".";return n.sort((o,s)=>lx(s)-lx(o)),n[0]},MX=(e,t)=>{let n=[];for(let r=1;r<t;r+=1){let o=e[r];if(o.startsWith("-"))break;if(kL(o))n.push(o)}if(n.length===0)return".";return n.sort((r,o)=>lx(o)-lx(r)),n[0]},mL,hL,NX,DX=(e,t,n)=>e.map((r)=>t.placeholders.has(r)?n:r),$X=(e)=>{let t=NX[e.head];if(t===void 0)return[];let n=[],{tokens:r}=e;for(let o=1;o<r.length;o+=1){if(!t.execFlags.has(r[o]))continue;let s=[],i=o+1;while(i<r.length){let u=r[i];if(u===";"||u==="+")break;s.push(u),i+=1}if(s.length===0)continue;let a=s[0];if(t.placeholders.has(a))continue;let c=t.pickRoot(r,o);n.push(js(DX(s,t,c))),o=i}return n},UX,LX,dx=(e,t)=>{let n=UX.exec(e);if(n!==null){let o=n.groups?.body??e;if(t!==void 0&&o.trim()==="__HEREDOC_BODY__"){let s=n.groups?.delimiter,i=s===void 0?void 0:t.get(s);if(i!==void 0)return i}return o}let r=LX.exec(e);if(r!==null)return r.groups?.content??e;return e},jX,BX=(e)=>{if(!jX.has(e.head))return[];let{tokens:t}=e;for(let n=1;n<t.length;n+=1){let r=t[n];if(r==="-c"&&n+1<t.length)return[t[n+1]];if(r.startsWith("-")&&!r.startsWith("--")&&r.endsWith("c")&&r.length>2&&n+1<t.length)return[t[n+1]]}return[]},HX,qX,zX=(e)=>/^[A-Za-z_][A-Za-z0-9_]*=.*/u.test(e),WX=(e)=>{let t=e[0],n=qX[t]??new Set,r=1;while(r<e.length){let o=e[r];if(t==="env"&&zX(o)){r+=1;continue}if(n.has(o)){r+=2;continue}if(o.includes("=")&&n.has(o.slice(0,o.indexOf("=")))){r+=1;continue}if(o.startsWith("--")&&o!=="--"){r+=1;continue}if(o.startsWith("-")&&o!=="-"){r+=1;continue}break}return r},KX=(e)=>{if(!HX.has(e.head))return[];if(e.head==="script")for(let r=1;r<e.tokens.length-1;r+=1){let o=e.tokens[r];if(o==="-c"||o==="--command")return[e.tokens[r+1]];if(o.startsWith("--command="))return[o.slice(10)]}let t=WX(e.tokens),n=js(e.tokens.slice(t));return n===""?[]:[n]},VX,GX=(e)=>{if(!VX.has(e.head))return[];if(e.tokens.length===2)return[e.tokens[1]];let t=js(e.tokens.slice(1));return t===""?[]:[t]},JX,ZX=(e)=>e==="rtk",YX=(e)=>{let t=1;while(t<e.length){let n=e[t];if(n.startsWith("-")&&n!=="-"&&n!=="--"){t+=1;continue}break}return t},IL=(e,t)=>{for(let n=t;n<e.length;n+=1){let r=e[n];if((r==="-c"||r==="--command")&&n+1<e.length)return e[n+1];if(r.startsWith("--command="))return r.slice(10)}return null},QX=(e)=>{if(!ZX(e.head))return[];let t=YX(e.tokens),n=e.tokens[t];if(n===void 0)return[];if(JX.has(n)){let o=IL(e.tokens,t+1);if(o!==null)return o===""?[]:[o];let s=t+1;while(s<e.tokens.length){let a=e.tokens[s];if(a==="--"){s+=1;break}if(a.startsWith("-")&&a!=="-"){s+=1;continue}break}let i=js(e.tokens.slice(s));return i===""?[]:[i]}let r=js(e.tokens.slice(t));return r===""?[]:[r]},XX,eee=(e)=>{let t=XX[e.head];if(t===void 0)return[];if(t.dashCommand){let o=IL(e.tokens,1);if(o!==null)return o===""?[]:[o]}let n=1;while(n<e.tokens.length){let o=e.tokens[n];if(t.valueFlags.has(o)){n+=2;continue}if(o.includes("=")&&t.valueFlags.has(o.slice(0,o.indexOf("=")))){n+=1;continue}if(o==="--"){n+=1;break}if(o.startsWith("-")&&o!=="-"){n+=1;continue}break}n+=t.skipPositionals;let r=js(e.tokens.slice(n));return r===""?[]:[r]},CL,tee=(e)=>{if(!CL.has(e.head)||e.tokens.length<2)return[];return[js(e.tokens.slice(1))]},nee,fx="__tripwire_unsupported_shell__",gL=(e)=>({head:fx,tokens:[fx],args:[],flags:[],redirects:[],raw:e}),ree=(e)=>e.some((t)=>{if(t.head==="case"||t.head==="function"||t.head==="{")return!0;if(t.tokens.includes("__op_(__")||t.tokens.includes("__op_)__"))return!0;return CL.has(t.head)&&t.tokens[1]==="{"}),oee=(e)=>{let t="",n=!1,r=!1,o=!1;for(let s of e){if(o){t+=s,o=!1;continue}if(s==="\\"){t+=s,o=!0;continue}if(s==="'"&&!r){n=!n,t+=s;continue}if(s==='"'&&!n){r=!r,t+=s;continue}t+=s===`
|
|
46
|
-
|
|
47
|
-
`)},wn=(e)=>/(?<prefix>^|\s)#\s*tripwire-allow:[ \t]*\S[^\r\n]*/.test(bL(e));var Lo=w(()=>{dL();EX=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],xL=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],yL=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),SL=new Set([";","&&","||","|","|&","&"]),TX=/(?:^|[|;&]\s*)(?:\/(?:usr\/bin|bin|usr\/local\/bin|opt\/homebrew\/bin)\/)?(?:sh|bash|zsh|dash|ksh|ash)(?:\s|$)/u,vL=/^\$\{?HOME\}?(?:\/|$)/,PX=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),mL={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:FX},hL={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:MX},NX=Object.assign(Object.create(null),{fd:mL,fdfind:mL,find:hL,gfind:hL}),UX=/\$\(\s*cat\s+<<-?\s*['"]?(?<delimiter>\w+)['"]?\s*\n(?<body>[\s\S]*?)\n\s*\k<delimiter>\s*\)/u,LX=/\$\(\s*(?:printf|echo)\s+(?:-[a-zA-Z]+\s+)*'(?<content>[^']*)'/u,jX=new Set(["sh","bash","zsh","dash","ksh","ash"]),HX=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","script","taskset","sudo","doas","xargs","watch"]),qX={command:new Set,env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),script:new Set(["-c","--command"]),taskset:new Set,sudo:new Set(["-u","--user","-g","--group","-C","--close-from","-D","--chdir","-h","--host","-p","--prompt","-r","--role","-t","--type","-U","--other-user","-R","--chroot","-T","--command-timeout"]),doas:new Set(["-a","-C","-u"]),xargs:new Set(["-I","-i","-J","-n","--max-args","-P","--max-procs","-s","--max-chars","-L","--max-lines","-E","--eof","-d","--delimiter","-a","--arg-file","--replace"]),watch:new Set(["-n","--interval"])},VX=new Set(["eval"]),JX=new Set(["run","proxy","err","test","summary"]),XX={timeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},gtimeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},chroot:{valueFlags:new Set(["--userspec","--groups"]),skipPositionals:1,dashCommand:!1},flock:{valueFlags:new Set(["-w","--wait","--timeout","-E","--conflict-exit-code"]),skipPositionals:1,dashCommand:!0},su:{valueFlags:new Set,skipPositionals:0,dashCommand:!0}},CL=new Set(["!","if","elif","then","else","while","until","do"]),nee=[$X,BX,KX,GX,QX,eee,tee]});import{readFileSync as iee}from"fs";import{homedir as aee}from"os";var OL,cee,uee,lee,fee,dee,pee,aI,AL,_L,mee=(e)=>e instanceof Error&&("code"in e)&&e.code==="ENOENT",hee=(e)=>j.try({try:()=>iee(e,"utf8"),catch:(t)=>new AL({cause:t})}).pipe(j.catchTag("ConfigReadError",(t)=>mee(t.cause)?j.succeed(null):j.fail(t))),gee=(e)=>j.try({try:()=>JSON.parse(e),catch:(t)=>new _L({cause:t})}),xee=(e)=>P.decodeUnknownEffect(pee)(e,{onExcessProperty:"error"}),px=()=>({git:{protectedBranches:[],enforceConventionalCommits:!1},safePaths:{},toolPolicies:[],blockedCommands:[],allowedCommands:[],secretScanner:{executable:"betterleaks",timeoutMs:5000}}),cI=(e)=>{let t=px();return{git:{protectedBranches:e.git?.protectedBranches??t.git.protectedBranches,enforceConventionalCommits:e.git?.enforceConventionalCommits??t.git.enforceConventionalCommits},safePaths:{...t.safePaths,...e.safePaths},toolPolicies:e.toolPolicies??t.toolPolicies,blockedCommands:e.blockedCommands??t.blockedCommands,allowedCommands:e.allowedCommands??t.allowedCommands,secretScanner:e.secretScanner??t.secretScanner}},RL=(e=aI)=>j.gen(function*(){let n=yield*hee(e);if(n===null)return{ok:!0,config:px()};let r=yield*gee(n),o=yield*xee(r);return{ok:!0,config:cI(o)}}).pipe(j.timeout(1000),j.catchCause((t)=>{let n={ok:!1,error:lt.pretty(t)};return j.succeed(n)}));var PL=w(()=>{el();OL=P.Struct({pattern:P.String,message:P.String,action:P.optional(P.Union([P.Literal("deny"),P.Literal("ask")])),requiresFlags:P.optional(P.Array(P.String)),forbidsFlagValues:P.optional(P.Array(P.Struct({flag:P.String,values:P.Array(P.String)})))}),cee=P.Struct({protectedBranches:P.optional(P.Array(P.String)),enforceConventionalCommits:P.optional(P.Boolean)}),uee=P.Struct({relative:P.optional(P.Array(P.String)),absolute:P.optional(P.Array(P.String))}),lee=P.Struct({argumentsIncludeAll:P.optional(P.Array(P.String)),argumentsStartWith:P.optional(P.Array(P.String)),shortFlagsIncludeAll:P.optional(P.Array(P.String))}),fee=P.Struct({rule:P.String,executables:P.Array(P.String),action:P.Union([P.Literal("deny"),P.Literal("warn")]),message:P.String,match:P.optional(lee)}),dee=P.Struct({executable:P.String,timeoutMs:P.Finite.check(P.isGreaterThan(0))}),pee=P.Struct({git:P.optional(cee),safePaths:P.optional(uee),toolPolicies:P.optional(P.Array(fee)),blockedCommands:P.optional(P.Array(OL)),allowedCommands:P.optional(P.Array(OL)),secretScanner:P.optional(dee)}),aI=`${aee()}/.config/tripwire/config.json`;AL=class AL extends Or.TaggedError("ConfigReadError"){};_L=class _L extends Or.TaggedError("ConfigParseError"){}});var DL,fI,dI=(e)=>({kind:"cursor",eventName:e,post:fI.has(e)}),yee=(e)=>DL.has(e)||fI.has(e),tc=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),Mt=(e,...t)=>{for(let n of t){let r=e[n];if(typeof r==="string")return r}return},pI=(e,...t)=>{for(let n of t)if(n in e)return e[n];return},lI=(e,t,...n)=>{let r=Mt(e,...n);if(r!==void 0)return r;if(typeof t==="string"&&n.includes("command"))return t;return tc(t)?Mt(t,...n):void 0},FL=(e,t)=>{if(e===void 0)throw Error(`Cursor hook payload missing ${t}`);return e},See=(e)=>{let t=e.toLowerCase();if(t==="bash"||t==="exec"||t==="shell"||t==="run_command")return"Bash";if(t==="read"||t==="read_file")return"Read";if(t==="write"||t==="write_file")return"Write";if(t==="edit"||t==="edit_file"||t==="multiedit"||t==="apply_patch")return"Edit";return e},Eee=(e)=>e==="Read"||e==="Write"||e==="Edit",bee=(e,t)=>{let n;if(typeof e==="string")n=e;else if(tc(e))n=Mt(e,"command","cmd");if(t&&n===void 0)throw Error("Cursor hook payload missing command");if(typeof e==="string")return{command:e};if(!tc(e)||n===void 0)return e;return{...e,command:n}},wee=(e,t,n)=>{let r=Mt(t,"file_path","filePath","path");if(n&&r===void 0)throw Error(`Cursor ${e} hook payload missing file path`);if(e==="Read")return{...t,file_path:r??""};if(e==="Write"){let o=Mt(t,"content","fileText","text");if(n&&o===void 0)throw Error("Cursor Write hook payload missing content");return{...t,file_path:r??"",content:o??""}}if(e==="Edit"){let o=Mt(t,"old_string","oldString"),s=Mt(t,"new_string","newString");if(n&&(o===void 0||s===void 0))throw Error("Cursor Edit hook payload missing oldString or newString");return{...t,file_path:r??"",old_string:o??"",new_string:s??""}}return t},uI=(e,t,n=!0)=>{if(e==="Bash")return bee(t,n);if(!Eee(e))return t;if(!tc(t)){if(n)throw Error(`Cursor ${e} hook payload is missing tool input`);return t}return wee(e,t,n)},ML=(e,t)=>{if(typeof t!=="string")return t;if(e==="Bash")return{stdout:t,stderr:""};if(e==="Read")return{content:t};return{content:t}},vee=(e,t)=>{if(e==="beforeShellExecution"||e==="afterShellExecution")return"Bash";if(e==="beforeReadFile"||e==="beforeTabFileRead"||e==="afterFileEdit"||e==="afterTabFileEdit")return e.startsWith("before")?"Read":"Edit";let n=Mt(t,"tool_name","toolName");if(n!==void 0)return See(n);let r=pI(t,"tool_input","toolInput");if(Mt(t,"command","cmd")!==void 0||typeof r==="string"||tc(r)&&Mt(r,"command","cmd")!==void 0)return"Bash";if(Mt(t,"file_path","filePath","path")!==void 0||tc(r)&&Mt(r,"file_path","filePath","path")!==void 0)return"Read";return""},kee=(e,t)=>{if(e==="Bash")return{command:lI(t,void 0,"command","cmd")};let n={file_path:Mt(t,"file_path","filePath","path")};if(e==="Write")n.content=Mt(t,"content","fileText","text");if(e==="Edit")n.old_string=Mt(t,"old_string","oldString"),n.new_string=Mt(t,"new_string","newString");return n},Iee=(e,t,n,r)=>{let o=pI(n,"tool_input","toolInput"),s=!r;if(e==="beforeShellExecution"||e==="afterShellExecution"){let i=lI(n,o,"command","cmd");return{command:s?FL(i,"command"):i??""}}if(e==="beforeReadFile"||e==="beforeTabFileRead"||e==="afterFileEdit"||e==="afterTabFileEdit"){let i=lI(n,o,"file_path","filePath","path");return uI(t,{file_path:s?FL(i,"file path"):i??"",...Array.isArray(n.edits)&&{edits:n.edits}},s)}if(o===void 0&&["Bash","Read","Write","Edit"].includes(t))return uI(t,kee(t,n),s);return uI(t,o,s)},Cee=(e,t,n)=>{if(e==="afterShellExecution")return ML(t,Mt(n,"output")??"");let r=pI(n,"tool_response","toolResponse","tool_output","toolOutput","result","result_json");return ML(t,r)},NL=(e,t,n)=>{let r=vee(t,e),o=Iee(t,r,e,n),s=n?Cee(t,r,e):void 0,i=Mt(e,"cwd"),a=Mt(e,"conversation_id","session_id"),c=Mt(e,"tool_use_id");return{event:{hook_event_name:n?"PostToolUse":"PreToolUse",...r.length>0&&{tool_name:r},...o!==void 0&&{tool_input:o},...s!==void 0&&{tool_response:s},...i!==void 0&&{cwd:i},...a!==void 0&&{session_id:a},...c!==void 0&&{tool_use_id:c}},host:dI(t)}},$L=(e,t)=>{if(t!==void 0&&!yee(t))throw Error(`Unknown Cursor hook event "${t}"`);if(!tc(e)){if(t!==void 0)throw Error(`Cursor ${t} hook payload must be a JSON object`);return{event:e,host:{kind:"native"}}}let n=t??Mt(e,"hook_event_name");if(n!==void 0&&DL.has(n))return NL(e,n,!1);if(n!==void 0&&fI.has(n))return NL(e,n,!0);return{event:e,host:{kind:"native"}}};var UL=w(()=>{DL=new Set(["preToolUse","beforeShellExecution","beforeMCPExecution","beforeReadFile","beforeTabFileRead"]),fI=new Set(["postToolUse","postToolUseFailure","afterShellExecution","afterMCPExecution","afterFileEdit","afterTabFileEdit"])});var LL,Z=(e)=>({kind:"allow",rule:e,message:""}),Bi=(e,t)=>({kind:"warn",rule:e,message:t}),zt=(e,t)=>({kind:"ask",rule:e,message:t}),se=(e,t)=>({kind:"deny",rule:e,message:t}),nl=(e)=>{let t=Z("none");for(let n of e)if(LL[n.kind]>LL[t.kind])t=n;return t};var Xn=w(()=>{LL={allow:0,warn:1,ask:2,deny:3}});var mI,rl=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),jL=(e)=>rl(e)&&typeof e.command==="string",BL=(e)=>rl(e)&&typeof e.file_path==="string"&&typeof e.old_string==="string"&&typeof e.new_string==="string",HL=(e)=>rl(e)&&typeof e.file_path==="string"&&typeof e.content==="string",qL=(e)=>rl(e)&&typeof e.file_path==="string",zL=(e,t)=>{if(!rl(t))return"";if(e==="Bash"){let n=typeof t.stdout==="string"?t.stdout:"",r=typeof t.stderr==="string"?t.stderr:"";return[n,r].filter((o)=>o.length>0).join(`
|
|
48
|
-
`)}if(e==="Read"){if(typeof t.content==="string")return t.content;let{file:n}=t;return rl(n)&&typeof n.content==="string"?n.content:""}return typeof t.content==="string"?t.content:""};var hI=w(()=>{el();mI=P.Struct({hook_event_name:P.String,tool_name:P.optional(P.String),tool_input:P.optional(P.Unknown),tool_response:P.optional(P.Unknown),cwd:P.optional(P.String),session_id:P.optional(P.String),turn_id:P.optional(P.String),tool_use_id:P.optional(P.String)})});import{appendFileSync as Tee,mkdirSync as Oee}from"fs";import{homedir as Aee}from"os";import _ee from"path";var WL,jo=(e,t)=>{let n=new Date().toISOString(),r=t instanceof Error?t.stack??t.message:String(t);try{Tee(WL,`[${n}] [${e}] ${r}
|
|
49
|
-
`)}catch{}};var KL=w(()=>{WL=`${Aee()}/.claude/tripwire.log`;try{Oee(_ee.dirname(WL),{recursive:!0})}catch{}});var Ree=(e)=>e.tokens.slice(1).join(" "),VL=(e,...t)=>{let n=new Set(e.flags);return t.some((r)=>n.has(r))},Pee,Fee,GL=(e,t)=>{let n=wn(t),r=[];for(let o of e)for(let s of Pee){if(!s.match(o,t))continue;if(n&&!Fee.has(s.rule))continue;r.push(s.action==="deny"?se(s.rule,s.message):zt(s.rule,s.message));break}return r.length===0?Z("bash-deny"):nl(r)};var JL=w(()=>{Lo();Xn();Pee=[{rule:"unsupported-shell-structure",action:"deny",message:"Tripwire cannot inspect every executable branch in this shell structure. Rewrite it as simple commands joined with `;`, `&&`, or `||` so each command can be checked.",match:(e)=>e.head===fx},{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(e)=>e.head==="rm"&&VL(e,"-rf","-fr","-Rf","-fR")&&e.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(e)=>e.head==="rm"&&VL(e,"-rf","-fr","-Rf","-fR")&&e.tokens.some((t)=>/^(?<home>~|\$HOME|\$\{HOME\})$/.test(t))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(e,t)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/.test(t)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(e)=>(e.head==="source"||e.head===".")&&e.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(e)=>e.head==="dd"&&/\bof=\/dev\/(?<type>disk|sd|nvme|rdisk)/i.test(Ree(e))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(e)=>/^mkfs(?<ext>\.[a-z0-9]+)?$/i.test(e.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(e)=>e.head==="kill"&&e.tokens.includes("-9")&&e.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(e)=>e.head==="chmod"&&e.flags.some((t)=>t.includes("R"))&&e.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(e)=>e.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(e,t)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/.test(t)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(e)=>e.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(e)=>["shutdown","reboot","halt","poweroff"].includes(e.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(e)=>e.head==="launchctl"&&typeof e.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(e.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(e)=>e.head==="defaults"&&e.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(e)=>e.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(e)=>e.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(e)=>e.head==="diskutil"&&typeof e.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(e.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(e)=>e.head==="tmutil"&&typeof e.tokens[1]==="string"&&["delete","disablelocal"].includes(e.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with the user what you want done before running it.",match:(e)=>e.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(e)=>e.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(e)=>e.head==="rsync"&&e.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(e)=>e.head==="softwareupdate"&&e.flags.some((t)=>t==="--install"||t==="-i"||t==="-d"||t.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need the user.",match:(e)=>e.head==="pmset"&&e.tokens.length>1&&!e.tokens.includes("-g")&&!e.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(e)=>e.head==="dscl"&&e.tokens.some((t)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(t))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(e)=>e.head==="xattr"&&e.tokens.includes("-d")&&e.tokens.some((t)=>t.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(e)=>e.head==="spctl"&&e.flags.some((t)=>t==="--master-disable"||t==="--global-disable"||t==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 the user handles this manually.",match:(e)=>e.head==="kextload"||e.head==="kextunload"||e.head==="kmutil"&&(e.tokens[1]==="load"||e.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(e)=>e.head==="security"&&typeof e.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(e.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(e)=>e.head==="security"&&typeof e.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(e.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(e)=>e.head==="systemsetup"&&e.tokens.some((t)=>t.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(e)=>e.head==="scutil"&&e.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(e)=>e.head==="brew"&&typeof e.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(e.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(e)=>e.head==="mas"&&typeof e.tokens[1]==="string"&&["install","uninstall","purchase"].includes(e.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(e)=>e.head==="gh"&&typeof e.tokens[1]==="string"&&typeof e.tokens[2]==="string"&&["repo","release","issue","pr"].includes(e.tokens[1])&&["delete","destroy","remove"].includes(e.tokens[2])},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(e)=>e.head==="flyctl"&&e.tokens.some((t)=>t==="destroy"||t==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(e)=>e.head==="gcloud"&&e.tokens.includes("delete")}],Fee=new Set(["unsupported-shell-structure","rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign"])});var gI=(e)=>e.protectedBranches??[],Mee,Nee,Dee,$ee=(e)=>{if(e.head!=="git")return null;let t=e.tokens.slice(1),n=0;while(n<t.length){let r=t[n];if(r===void 0)break;if(Nee.has(r)){n+=2;continue}if(Dee.has(r)){n+=1;continue}if(r.startsWith("--git-dir=")||r.startsWith("--work-tree=")||r.startsWith("--namespace=")||r.startsWith("--super-prefix=")||r.startsWith("--exec-path=")){n+=1;continue}if(r.startsWith("-")){n+=1;continue}return{subcommand:r,subArgs:t.slice(n+1)}}return null},Uee=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e[n];if(r===void 0)break;if(r==="-m"||r==="--message"){let o=e[n+1];return o===void 0?null:dx(o,t)}if(r.startsWith("--message="))return dx(r.slice(10),t);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(r)){let o=e[n+1];return o===void 0?null:dx(o,t)}}return null},Lee=(e,t)=>{let n=gI(t);for(let r of e)for(let o of n)if(r===o||r.endsWith(`:${o}`)||r.endsWith(`/${o}`))return o;return null},jee=(e)=>e.filter((t)=>!t.startsWith("-")),Bee=(e)=>e.filter((t)=>t.startsWith("-")),kt=(e,...t)=>{let n=new Set(e);return t.some((r)=>n.has(r))},Hee=({subArgs:e,positional:t})=>{if(kt(e,"--global","--system"))return se("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!kt(e,"--get","-l","--list","--get-all","--get-regexp")&&t.length>=2)return se("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return Z("bash-git")},qee=({subArgs:e})=>{if(kt(e,"--cached"))return Z("bash-git");return zt("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},zee=({subArgs:e,positional:t})=>{if(kt(e,"--staged","-S")&&!kt(e,"--worktree","-W"))return Z("bash-git");if(t.length>0)return se("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return Z("bash-git")},Wee=({subArgs:e,positional:t})=>{if(kt(e,"-b","-B"))return Z("bash-git");if(kt(e,"-f","--force"))return se("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(e.includes("--"))return se("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");let[n]=t;if(n!==void 0&&t.length===1&&(n==="."||n.startsWith("./")))return se("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return Z("bash-git")},Kee=({subArgs:e})=>{if(kt(e,"-f","--force","--discard-changes"))return se("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return Z("bash-git")},Vee=({subArgs:e,flags:t,positional:n})=>{if(kt(e,"--hard"))return se("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(kt(e,"--keep"))return zt("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(n.length===0&&t.length===0)return Z("bash-git");return zt("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},Gee=({flags:e})=>{if(e.some((t)=>/^-[a-zA-Z]*[df]/.test(t)||t==="--force"))return se("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return Z("bash-git")},Jee=({subArgs:e,positional:t,config:n})=>{if(kt(e,"--abort","--quit","--continue","--skip","--edit-todo"))return Z("bash-git");if(kt(e,"-i","--interactive"))return se("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let[r]=t,o=gI(n);if(r!==void 0&&o.includes(r))return zt("git-rebase-onto-protected",`Rebasing onto \`${r}\` rewrites history of the current branch. \`git merge ${r}\` is usually safer. Confirm intent.`);return zt("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},Zee=({subArgs:e})=>{if(kt(e,"--abort","--quit","--continue","--skip"))return Z("bash-git");return zt("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},Yee=({subArgs:e})=>{if(kt(e,"--abort","--continue","--quit"))return Z("bash-git");return zt("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Qee=({subArgs:e,config:t,heredocBodies:n})=>{if(kt(e,"--amend"))return se("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let r=Uee(e,n),o=kt(e,"-F","--file","-c","-C","--reuse-message","--reedit-message"),s=kt(e,"--no-edit");if(r===null&&!o&&!s)return se("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(r!==null&&t.enforceConventionalCommits===!0&&!Mee.test(r))return se("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify(r)}`].join(`
|
|
50
|
-
`));if(kt(e,"-a","--all")||e.some((i)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(i)))return zt("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return Z("bash-git")},Xee=({subArgs:e,flags:t,positional:n,config:r})=>{if(t.some((s)=>s==="--force"||s==="-f"||s.startsWith("--force-with-lease")))return se("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(kt(e,"--delete","--mirror")||e.some((s)=>s.startsWith(":")))return se("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let o=Lee(n,r);if(o!==null)return se("git-push-protected",`Refusing to push directly to protected branch \`${o}\`. Open a PR instead: \`gh pr create\`.`);return Z("bash-git")},ete=({subArgs:e,flags:t,positional:n,config:r})=>{let o=t.find((s)=>s==="-D"||s==="-d"||s==="--delete"||/^-[a-zA-Z]*D/.test(s)||/^-[a-zA-Z]*d/.test(s));if(o!==void 0){let s=n,i=new Set(gI(r)),a=s.find((c)=>i.has(c));if(a!==void 0)return se("git-branch-delete-protected",`Refusing to delete protected branch \`${a}\`.`);if(o==="-D"||o.includes("D"))return se("git-branch-force-delete",`\`git branch -D ${s.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return zt("git-branch-delete",`\`git branch -d ${s.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(kt(e,"-m","-M","--move"))return zt("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return Z("bash-git")},tte=({subArgs:e})=>{if(kt(e,"-d","--delete"))return se("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return Z("bash-git")},nte=({subArgs:e})=>{let t=e[0]??"push";if(t==="drop"||t==="clear")return se("git-stash-drop",`\`git stash ${t}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return Z("bash-git")},rte=({flags:e})=>{if(e.some((t)=>t.startsWith("--prune=")||t==="--aggressive"))return se("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return Z("bash-git")},ote=({subArgs:e})=>{let[t]=e;if(t==="add"||t==="remove"||t==="rm"||t==="set-url"||t==="rename")return zt("git-remote-mutate",`\`git remote ${t}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return Z("bash-git")},ZL=({subcommand:e,subArgs:t})=>{let n=t[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(n))return zt("git-submodule-worktree-mutate",`\`git ${e} ${n}\` modifies repo structure. Confirm intent.`);return Z("bash-git")},ste,ite=(e,t,n)=>{let{subcommand:r,subArgs:o}=e,s=Bee(o),i=jee(o);if(new Set(["status","diff","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]).has(r)){if(r==="reflog"&&(o[0]==="expire"||kt(o,"--expire")))return se("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(r==="symbolic-ref"&&i.length>=2)return se("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return Z("bash-git")}let c=ste.get(r);if(c!==void 0)return c({subcommand:r,subArgs:o,flags:s,positional:i,config:t,heredocBodies:n});return Bi("git-unknown-subcommand",`\`git ${r}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},YL=(e,t,n)=>{if(wn(t))return Z("bash-git");let r=wL(t);for(let o of e){let s=$ee(o);if(s===null)continue;let i=ite(s,n,r);if(i!==null&&i.kind!=="allow")return i}return Z("bash-git")};var QL=w(()=>{Lo();Xn();Mee=/^(?<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?<scope>\([\w./\- ]+\))?!?:\s+\S/,Nee=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),Dee=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),ste=new Map([["config",Hee],["add",()=>Z("bash-git")],["mv",()=>Z("bash-git")],["rm",qee],["restore",zee],["checkout",Wee],["switch",Kee],["reset",Vee],["clean",Gee],["rebase",Jee],["cherry-pick",Zee],["merge",Yee],["commit",Qee],["push",Xee],["branch",ete],["tag",tte],["stash",nte],["filter-branch",({subcommand:e})=>se("git-filter",`\`git ${e}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:e})=>se("git-filter",`\`git ${e}\` rewrites entire repo history. Refuse.`)],["gc",rte],["update-ref",()=>se("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",ote],["submodule",ZL],["worktree",ZL],["init",({subcommand:e})=>Bi(`git-${e}`,`\`git ${e}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)],["clone",({subcommand:e})=>Bi(`git-${e}`,`\`git ${e}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)]])});var ate,cte,ute=(e)=>{for(let t=0;t<e.length-1;t+=1){let n=e[t],r=e[t+1];if(n===void 0||r===void 0)continue;if(ate.has(n.head)&&cte.has(r.head))return!0}return!1},lte,XL=(e,t)=>{if(wn(t))return Z("bash-network-install");if(ute(e))return se("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to the user what you're running).");for(let n of e)for(let r of lte)if(n.head===r.head&&n.tokens[1]===r.subcommand)return zt(r.rule,r.message);return Z("bash-network-install")};var ej=w(()=>{Lo();Xn();ate=new Set(["curl","wget","wget2","aria2c","xh"]),cte=new Set(["bash","sh","zsh","fish"]),lte=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}]});import{lstatSync as fte,readlinkSync as dte,realpathSync as pte}from"fs";import ol from"path";var mte,tj=(e)=>{try{return pte(e)}catch{return null}},xI=(e,t=new Set)=>{if(t.has(e))return e;t.add(e);let n=tj(e);if(n!==null)return n;try{if(fte(e).isSymbolicLink()){let o=dte(e);return xI(ol.resolve(ol.dirname(e),o),t)}}catch{}let r=ol.dirname(e);if(r===e)return e;return ol.join(xI(r,t),ol.basename(e))},rp=(e,t,n)=>{let r=ol.resolve(e),o=t==="write"?xI(r):tj(r),s=[e,r];if(o!==null&&!s.includes(o))s.push(o);for(let i of s)for(let a of n)if(a.pattern.test(i))return a;return null},yI=(e)=>{let t=rp(e.file_path,"write",mte);if(t!==null)return se(t.rule,t.message);return Z("path-protect")};var mx=w(()=>{Xn();mte=[{pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(?<prefix>^|\/)\.ssh\//,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)(?<pub>\.pub)?$/,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(?<ext>pem|key|p12|pfx)$/i,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let the user review."},{pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(?<prefix>^|\/)\.aws\/credentials$/,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(?<prefix>^|\/)\.netrc$/,rule:"netrc",message:".netrc holds host credentials. Refuse."}]});var hte,SI=(e)=>{let t=rp(e,"write",hte);if(t!==null)return se(t.rule,t.message);return null},nj=(e,t)=>{if(wn(t))return Z("bash-redirect");for(let n of e){for(let r of n.redirects)if(r.op===">"||r.op===">>"){let o=SI(r.target);if(o!==null)return o}if(n.head==="tee")for(let r of n.args){let o=SI(r);if(o!==null)return o}if(n.head==="cp"||n.head==="mv"){let r=n.args.at(-1);if(r!==void 0){let o=SI(r);if(o!==null)return o}}}return Z("bash-redirect")};var rj=w(()=>{Lo();Xn();mx();hte=[{rule:"redirect-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(?<type>sd|disk|nvme|rdisk)/i,message:"Redirecting into a raw block device wipes the disk. Refuse."}]});var gte=(e,t)=>{let n=!1,r=[];for(let i of e.tokens.slice(1)){if(!n&&i==="--"){n=!0;continue}if(!n&&i.startsWith("-")&&i!=="-")continue;r.push(i)}let o=t.relative??[],s=t.absolute??[];return r.filter((i)=>!iI(i,o,s))},xte=(e,t)=>{if(!e.tokens.includes("-delete"))return null;let n=[];for(let i of e.tokens.slice(1)){if(i.startsWith("-"))break;n.push(i)}let r=n.length===0?["."]:n,o=t.relative??[],s=t.absolute??[];return r.filter((i)=>!iI(i,o,s))},oj=(e,t,n)=>{if(wn(t))return Z("bash-scoped-rm");let r=[];for(let a of e){if(a.head==="rm"){let c=gte(a,n);if(c.length>0)r.push({kind:"rm",targets:c});continue}if(a.head==="find"){let c=xte(a,n);if(c!==null&&c.length>0)r.push({kind:"find -delete",targets:c})}}if(r.length===0)return Z("bash-scoped-rm");let o=n.relative??[],s=n.absolute??[],i=r.map((a)=>` \u2022 ${a.kind} on: ${a.targets.map((c)=>JSON.stringify(c)).join(", ")}`).join(`
|
|
51
|
-
`);return se("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use a recoverable deletion tool or limit the target to an ephemeral build, cache, state, or temporary directory:
|
|
52
|
-
${TL(o,s)}
|
|
9
|
+
${s(u)}}`;f=i(l,h)}}return n.delete(l),f}return String(l)}return c(e,0)}function sa(e){return typeof e==="string"?JSON.stringify(e):String(e)}function wS(e){return e.map((t)=>`[${sa(t)}]`).join("")}function TS(e){try{return e.toISOString()}catch{return"Invalid Date"}}function J1(e){try{let t=e.toString();return typeof t==="string"?t:String(t)}catch{return"[toString threw]"}}function Ys(e,t){let r=[];return JSON.stringify(e,function(n,o){let s=Object.getOwnPropertyDescriptor(this,n)?.value,i=G(s,$c)?na(s):na(o);if(typeof i==="bigint")return he(i);if(typeof i!=="object"||i===null)return i;while(r.length>0&&r[r.length-1]!==this)r.pop();if(r.includes(i))return;return r.push(i),i},t?.space)??"null"}var H1="[Circular]";var on=E(()=>{ye();Yu()});var Hs,bn=(e)=>{try{if(e=na(e),G(e,"toJSON")&&io(e.toJSON)&&e.toJSON.length===0)return e.toJSON();else if(Array.isArray(e))return e.map(bn);return e}catch{return"[toJSON threw]"}},vS=(e,t=2)=>{if(typeof e==="string")return e;try{return typeof e==="object"?Ys(e,{space:t}):he(e,{space:t})}catch{return String(e)}},CS;var es=E(()=>{on();ye();Yu();Hs=Symbol.for("nodejs.util.inspect.custom"),CS={toJSON(){return bn(this)},[Hs](){return this.toJSON()},toString(){return he(this.toJSON())}}});var ts,eA=()=>{let t={["~effect/Utils/internal"]:(o)=>o()},r={["~effect/Utils/internal"]:(o)=>{try{return o()}finally{}}};return t["~effect/Utils/internal"](()=>Error().stack)?.includes("~effect/Utils/internal")===!0?t["~effect/Utils/internal"]:r["~effect/Utils/internal"]},mt;var Ac=E(()=>{ts=class ts{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new ts(this.self)}};mt=eA()});function Ar(e,t,r){if(t==="__proto__")Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0});else e[t]=r}function QS(e,t){for(let r of Reflect.ownKeys(t))if(Object.prototype.propertyIsEnumerable.call(t,r))Ar(e,r,t[r])}function nA(e){return os("Effect.evaluate: Not implemented")}var lo="~effect/Effect",Js="~effect/Exit",tA,$S,Y,et,Ht,Rr,rs,Ks,Jt,hj,rA,Ft=(e)=>G(e,lo),AS=(e)=>G(e,Js),Rc="~effect/Cause",Ju="~effect/Cause/Reason",Ic=(e)=>G(e,Rc),uo,_S,Fc,Uc,Dc,ns=(e)=>new uo(e),Qh,Mc=(e)=>new uo([new Dc(e)]),_h,RS=(e)=>new uo([new _h(e)]),Nc,ei=(e)=>e._tag==="Fail",$h=(e)=>e._tag==="Die",Zc=(e)=>e._tag==="Interrupt",fo=(e)=>({...rA,[$S]:e.op,[et]:e[et]??nA,[Ht]:e[Ht],[Rr]:e[Rr],[rs]:e[rs]}),Ir=(e)=>{let t=fo(e);return function(){let r=Object.create(t);return r[Y]=e.single===!1?arguments:arguments[0],r}},IS=(e)=>{let t={[Js]:Js,_tag:e.op,get[e.prop](){return this[Y]},...fo(e),toString(){return`${e.op}(${he(this[Y])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Y]}},[Ke](r){return AS(r)&&r._tag===this._tag&&at(this[Y],r[Y])},[Je](){return Yt(it(e.op),Oe(this[Y]))}};return function(r){let n=Object.create(t);return n[Y]=r,n}},Ne,Ku,Ah,Kt,kn=(e)=>Kt(Mc(e)),os=(e)=>Kt(RS(e)),le,oA,qc,aa=(e)=>{class t extends qc{_tag=e}return t.prototype.name=e,t},ia="~effect/Cause/Done",FS=(e)=>G(e,ia),US,ca=(e)=>{if(e===void 0)return US;return{[ia]:ia,_tag:"Done",value:e}},sA,DS=(e)=>{if(e===void 0)return sA;return kn(ca(e))};var ct=E(()=>{co();on();oe();En();es();It();ye();Ac();tA={_A:B,_E:B,_R:B},$S=`${lo}/identifier`,Y=`${lo}/args`,et=`${lo}/evaluate`,Ht=`${lo}/successCont`,Rr=`${lo}/failureCont`,rs=`${lo}/ensureCont`,Ks=Symbol.for("effect/Effect/Yield"),Jt={pipe(){return pe(this,arguments)},toJSON(){return{...this}},toString(){return he(this.toJSON(),{ignoreToString:!0,space:2})},[Hs](){return this.toJSON()}},hj={[Je](){return kh(this,Object.keys(this))},[Ke](e){let t=Object.keys(this),r=Object.keys(e);if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n]||!at(this[t[n]],e[t[n]]))return!1;return!0}},rA={[lo]:tA,...Jt,[Symbol.iterator](){return new ts(this)},toJSON(){return{_id:"Effect",op:this[$S],...Y in this?{args:this[Y]}:void 0}}};uo=class uo{[Rc];reasons;constructor(e){this[Rc]=Rc,this.reasons=e}pipe(){return pe(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((e)=>e.toJSON())}}toString(){return`Cause(${he(this.reasons)})`}[Hs](){return this.toJSON()}[Ke](e){return Ic(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,r)=>at(t,e.reasons[r]))}[Je](){return Vu(this.reasons)}};_S=new WeakMap;Fc=class Fc{[Ju];annotations;_tag;constructor(e,t,r){if(this[Ju]=Ju,this._tag=e,t!==Uc&&typeof r==="object"&&r!==null&&t.size>0){let n=_S.get(r);if(n)t=new Map([...n,...t]);_S.set(r,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let r=new Map(this.annotations);e.mapUnsafe.forEach((o,s)=>{if(t?.overwrite!==!0&&r.has(s))return;r.set(s,o)});let n=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return n.annotations=r,n}pipe(){return pe(this,arguments)}toString(){return he(this)}[Hs](){return this.toString()}};Uc=new Map;Dc=class Dc extends Fc{error;constructor(e,t=Uc){super("Fail",t,e);this.error=e}toString(){return`Fail(${he(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[Ke](e){return ei(e)&&at(this.error,e.error)&&at(this.annotations,e.annotations)}[Je](){return Yt(it(this._tag))(Yt(Oe(this.error))(Oe(this.annotations)))}};Qh=new uo([]);_h=class _h extends Fc{defect;constructor(e,t=Uc){super("Die",t,e);this.defect=e}toString(){return`Die(${he(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[Ke](e){return $h(e)&&at(this.defect,e.defect)&&at(this.annotations,e.annotations)}[Je](){return Yt(it(this._tag))(Yt(Oe(this.defect))(Oe(this.annotations)))}};Nc=v((e)=>Ic(e[0]),(e,t,r)=>{if(t.mapUnsafe.size===0)return e;return new uo(e.reasons.map((n)=>n.annotate(t,r)))});Ne=IS({op:"Success",prop:"value",[et](e){let t=e.getCont(Ht);return t?t[Ht](this[Y],e,this):e.yieldWith(this)}}),Ku={key:"effect/Cause/StackTrace"},Ah={key:"effect/Cause/InterruptorStackTrace"},Kt=IS({op:"Failure",prop:"cause",[et](e){let t=this[Y],r=!1;if(e.currentStackFrame)t=Nc(t,{mapUnsafe:new Map([[Ku.key,e.currentStackFrame]])}),r=!0;let n=e.getCont(Rr);while(e.interruptible&&e._interruptedCause&&n)n=e.getCont(Rr);return n?n[Rr](t,e,r?void 0:this):e.yieldWith(r?Kt(t):this)}}),le=Ir({op:"WithFiber",[et](e){return this[Y](e)}}),oA=function(){class e extends globalThis.Error{}let t=fo({op:"YieldableError",[et](){return kn(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),qc=function(){let e=Symbol.for("effect/Data/Error/plainArgs");return class extends oA{constructor(r){super(r?.message,r?.cause?{cause:r.cause}:void 0);if(r)QS(this,r),Object.defineProperty(this,e,{value:r,enumerable:!1})}toJSON(){return{...this[e],...this}}}}(),US={[ia]:ia,_tag:"Done",value:void 0},sA=kn(US)});var Pn=(e)=>fo({op:e.label,[et]:e.evaluate});var la=E(()=>{ct()});var MS="~effect/data/Option",NS,iA,aA,cA,Rh=(e)=>G(e,MS),Ih=(e)=>e._tag==="None",Fh=(e)=>e._tag==="Some",ZS,qS=(e)=>{let t=Object.create(iA);return t.value=e,t};var WS=E(()=>{co();on();En();es();ye();Ac();ct();NS={[MS]:{_A:(e)=>e},...Jt,[Symbol.iterator](){return new ts(this)}},iA=Object.defineProperty(Object.assign(Object.create(NS),{_tag:"Some",_op:"Some",[Ke](e){return Rh(e)&&Fh(e)&&at(this.value,e.value)},[Je](){return Yt(Oe(this._tag))(Oe(this.value))},toString(){return`some(${he(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:bn(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),aA=Oe("None"),cA=Object.assign(Object.create(NS),{_tag:"None",_op:"None",valueOrUndefined:void 0,[Ke](e){return Rh(e)&&Ih(e)},[Je](){return aA},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),ZS=Object.create(cA)});var LS="~effect/data/Result",zS,uA,fA,Uh=(e)=>G(e,LS),Dh=(e)=>e._tag==="Failure",XS=(e)=>e._tag==="Success",jS=(e)=>{let t=Object.create(fA);return t.failure=e,t},VS=(e)=>{let t=Object.create(uA);return t.success=e,t};var BS=E(()=>{co();on();En();es();ye();Ac();ct();zS={[LS]:{_A:(e)=>e,_E:(e)=>e},...Jt,[Symbol.iterator](){return new ts(this)}},uA=Object.assign(Object.create(zS),{_tag:"Success",_op:"Success",[Ke](e){return Uh(e)&&XS(e)&&at(this.success,e.success)},[Je](){return Yt(Oe(this._tag))(Oe(this.success))},toString(){return`success(${he(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:bn(this.success)}}}),fA=Object.assign(Object.create(zS),{_tag:"Failure",_op:"Failure",[Ke](e){return Uh(e)&&Dh(e)&&at(this.failure,e.failure)},[Je](){return Yt(Oe(this._tag))(Oe(this.failure))},toString(){return`failure(${he(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:bn(this.failure)}}})});function GS(e){return(t,r)=>t===r?0:e(t,r)}var ef,YS,tf=(e)=>v(2,(t,r)=>e(t,r)===1);var Mh=E(()=>{oe();ef=GS((e,t)=>{if(globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t))return 0;if(globalThis.Number.isNaN(e))return-1;if(globalThis.Number.isNaN(t))return 1;return e<t?-1:1}),YS=v(2,(e,t)=>GS((r,n)=>e(t(r),t(n))))});var L=()=>ZS,ee,Lt,tt,er,bt,wn=(e)=>e==null?L():ee(e),ua=(e)=>e===void 0?L():ee(e),ur,fa,JS,KS,eE;var ze=E(()=>{oe();WS();ee=qS,Lt=Ih,tt=Fh,er=v(2,(e,{onNone:t,onSome:r})=>Lt(e)?t():r(e.value)),bt=v(2,(e,t)=>Lt(e)?t():e.value),ur=bt(Yo),fa=v(2,(e,t)=>Lt(e)?L():ee(t(e.value))),JS=v(2,(e,t)=>Lt(e)?L():t(e.value)),KS=v(2,(e,t)=>Lt(e)?L():t(e.value)?ee(e.value):L()),eE=v(2,(e,t)=>Lt(e)?!1:t(e.value))});var tE="~effect/Context/Service",rt=function(){function e(){}let t=e;Object.setPrototypeOf(t,hA);let r=(n,o)=>{if(t.key=n,o?.defaultValue)t[Zh]=Zh,t.defaultValue=o.defaultValue;if(o?.make)t.make=o.make;if(o?.fiberCached)rE.add(n);return t};return arguments.length>0?r(arguments[0],arguments[1]):r},hA,rE,Zh="~effect/Context/Reference",nE="~effect/Context",mA=8,OA=8,qh=(e,t,r,n)=>{let o=Object.create(xA);return o.cacheRoot=e??o,o.base=t,o.overlay=r,o.depth=n,o._flat=void 0,o.baseHits=0,o},oE=(e,t)=>{if(!t)return;oE(e,t.parent),e.set(t.key,t.value)},sE=(e)=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return oE(t,e.overlay),e._flat=t},gA=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),da(r)},rf,Wh=(e,t)=>{let r=e;for(let o=r.overlay;o;o=o.parent)if(o.key===t)return o.value;let n=r.base.get(t);if(n===void 0&&!r.base.has(t))return rf;if(r.overlay&&++r.baseHits>=OA)r.base=sE(r),r.overlay=void 0,r.depth=0;return n},da=(e)=>qh(void 0,e,void 0,0),xA,iE=(e,t)=>e.cacheRoot===t.cacheRoot,Lh=(e)=>G(e,nE),aE=(e)=>!!e[Zh],Tn=()=>yA,yA,ho=(e,t)=>da(new Map([[e.key,t]])),mo,SA=(e,t,r)=>{let n=e,o=rE.has(t)?void 0:n.cacheRoot;if(n.depth>=mA){let s=new Map(n.mapUnsafe);return s.set(t,r),qh(o,s,void 0,0)}return qh(o,n.base,{key:t,value:r,parent:n.overlay},n.depth+1)},cE,Lc=(e,t)=>{let r=Wh(e,t);return r===rf?void 0:r},zc,ss,Nh="~effect/Context/defaultValue",lE=(e)=>{if(Nh in e)return e[Nh];return e[Nh]=e.defaultValue()},EA=(e)=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(t.stack){let r=t.stack.split(`
|
|
10
|
+
`);r.splice(1,3),t.stack=r.join(`
|
|
11
|
+
`)}return t},uE,pa,fE=(...e)=>{let t=new Map;for(let r=0;r<e.length;r++)e[r].mapUnsafe.forEach((n,o)=>{t.set(o,n)});return da(t)},Be;var lt=E(()=>{la();co();oe();En();ct();ze();ye();hA={[tE]:tE,...Pn({label:"Service",evaluate(e){return Ne(ss(e.context,this))}}),toJSON(){return{_id:"Service",key:this.key}},of(e){return e},context(e){return ho(this,e)},use(e){return le((t)=>e(ss(t.context,this)))},useSync(e){return le((t)=>Ne(e(ss(t.context,this))))}},rE=new Set,rf=Symbol(),xA={get mapUnsafe(){return sE(this)},...Jt,[nE]:{_Services:(e)=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Ke](e){if(!Lh(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[n,o]of t)if(!r.has(n)||!at(o,r.get(n)))return!1;return!0},[Je](){return ra(this.mapUnsafe.size)}},yA=da(new Map),mo=v(3,(e,t,r)=>SA(e,t.key,r)),cE=v(2,(e,t)=>Lc(e,t.key)),zc=v(2,(e,t)=>{let r=Wh(e,t.key);if(r===rf){if(aE(t))return lE(t);throw EA(t)}return r}),ss=zc,uE=v(2,(e,t)=>{let r=Wh(e,t.key);if(r!==rf)return ee(r);return aE(t)?ee(lE(t)):L()}),pa=v(2,(e,t)=>{if(e.mapUnsafe.size===0)return t;if(t.mapUnsafe.size===0)return e;return gA(e,(r)=>t.mapUnsafe.forEach((n,o)=>r.set(o,n)))}),Be=rt});var zh=(e)=>e.length>0;var gt,ut,Ut,Xh,nf;var Oo=E(()=>{oe();BS();gt=VS,ut=jS,Ut=Dh,Xh=v(2,(e,t)=>Ut(e)?ut(t(e.failure)):e),nf=v(2,(e,{onFailure:t,onSuccess:r})=>Ut(e)?t(e.failure):r(e.success))});var dE,Dj,kA;var pE=E(()=>{oe();ze();ye();dE=v(2,(e,t)=>{let r=0;for(let n of e){let o=t(n,r);if(zu(o)){if(o)return ee(n)}else if(tt(o))return o;r++}return L()}),Dj={[Symbol.iterator](){return kA}},kA={next(){return{done:!0,value:void 0}}}});var jh,Cn=(e)=>jh.isArray(e)?e:jh.from(e),Xc,Vh,hE,wA,of,Qn,Bh,mE,OE,TA=(e,t)=>{let r=Oe(t),n=e.get(r);if(n===void 0)return e.set(r,[t]),!0;for(let o of n)if(at(o,t))return!1;return n.push(t),!0},gE,ti=()=>[],ri=(e)=>[e],Sr,sf,vA=(e)=>{let t=Cn(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let o of t)if(TA(r,o))n.push(o);return n};var _n=E(()=>{co();oe();En();pE();ze();jh=globalThis.Array,Xc=v(2,(e,{onEmpty:t,onNonEmpty:r})=>Qn(e)?r(e):t()),Vh=v(2,(e,t)=>[...e,t]),hE=v(2,(e,t)=>Cn(e).concat(Cn(t))),wA=jh.isArray,of=zh,Qn=zh,Bh=v(2,(e,t)=>{let r=0;for(let n of e){if(t(n,r))return ee(r);r++}return L()}),mE=dE,OE=v(2,(e,t)=>{let r=Cn(e);for(let n=r.length-1;n>=0;n--){let o=r[n],s=t(o,n);if(typeof s==="boolean"){if(s)return ee(o)}else if(tt(s))return s}return L()}),gE=v(2,(e,t)=>{let r=Cn(e),n=Cn(t);if(Qn(r))return Qn(n)?vA(hE(r,n)):r;return n}),Sr=v(2,(e,t)=>e.map(t)),sf=v(3,(e,t,r)=>Cn(e).reduce((n,o,s)=>r(n,o,s),t))});var cf="~effect/time/Duration",PE,wE,CA,QA,_A,lf=(e)=>BigInt(e<0?Math.ceil(e-0.5):Math.floor(e+0.5)),TE=(e)=>lf(e*1e6),xE=(e,t)=>{let r=e.indexOf(".");if(r===-1)return BigInt(e)*t;let n=e[0]==="-",o=e.slice(r+1),s=QA**BigInt(o.length),i=(BigInt(e.slice(n?1:0,r))*s+BigInt(o))*t,a=i/s+(i%s*CA>=s?wE:PE);return n?-a:a},$A,ha=(e)=>{switch(typeof e){case"number":return bE(e);case"bigint":return af(e);case"string":{if(e==="Infinity")return Gh;if(e==="-Infinity")return EE;let t=$A.exec(e);if(!t)break;let[r,n,o]=t;if(o==="nano"||o==="nanos")return af(xE(n,wE));if(o==="micro"||o==="micros")return af(xE(n,_A));let s=Number(n);switch(o){case"milli":case"millis":return bE(s);case"second":case"seconds":return DA(s);case"minute":case"minutes":return MA(s);case"hour":case"hours":return NA(s);case"day":case"days":return ZA(s);case"week":case"weeks":return qA(s)}break}case"object":{if(e===null)break;if(cf in e)return e;if(Array.isArray(e)){if(e.length!==2||!e.every(Qc))return yE(e);if(Number.isNaN(e[0])||Number.isNaN(e[1]))return UA;if(e[0]===-1/0||e[1]===-1/0)return EE;if(e[0]===1/0||e[1]===1/0)return Gh;return Er(lf(e[0]*1e9+e[1]))}let t=e,r=0;if(t.weeks)r+=t.weeks*604800000;if(t.days)r+=t.days*86400000;if(t.hours)r+=t.hours*3600000;if(t.minutes)r+=t.minutes*60000;if(t.seconds)r+=t.seconds*1000;if(t.milliseconds)r+=t.milliseconds;if(!t.microseconds&&!t.nanoseconds)return Er(r);return Er(lf(r*1e6+(t.microseconds??0)*1000+(t.nanoseconds??0)))}}return yE(e)},yE=(e)=>{throw Error(`Invalid Input: ${e}`)},SE,AA,RA,IA,Er=(e)=>{let t=Object.create(IA);if(typeof e==="number")if(isNaN(e)||e===0||Object.is(e,-0))t.value=SE;else if(!Number.isFinite(e))t.value=e>0?AA:RA;else if(!Number.isInteger(e))t.value={_tag:"Nanos",nanos:TE(e)};else t.value={_tag:"Millis",millis:e};else if(e===PE)t.value=SE;else t.value={_tag:"Nanos",nanos:e};return t},FA=(e)=>G(e,cf),vE=(e)=>e.value._tag!=="Infinity"&&e.value._tag!=="NegativeInfinity",UA,Gh,EE,af=(e)=>Er(e),bE=(e)=>Er(e),DA=(e)=>Er(e*1000),MA=(e)=>Er(e*60000),NA=(e)=>Er(e*3600000),ZA=(e)=>Er(e*86400000),qA=(e)=>Er(e*604800000),CE=(e)=>WA(ha(e),{onMillis:B,onNanos:(t)=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),kE=(e)=>{let t=ha(e);switch(t.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return TE(t.value.millis)}},WA,LA,zA=(e,t)=>LA(e,t,{onMillis:(r,n)=>r===n,onNanos:(r,n)=>r===n,onInfinity:(r,n)=>r.value._tag===n.value._tag}),XA;var Yh=E(()=>{co();oe();En();es();It();ye();PE=BigInt(0),wE=BigInt(1),CA=BigInt(2),QA=BigInt(10),_A=BigInt(1000),$A=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,SE={_tag:"Millis",millis:0},AA={_tag:"Infinity"},RA={_tag:"NegativeInfinity"},IA={[cf]:cf,[Je](){switch(this.value._tag){case"Millis":{let e=this.value.millis*1e6;return Number.isFinite(e)?Oe(lf(e)):ra(this.value.millis)}case"Nanos":return Oe(this.value.nanos);default:return Ph(this.value)}},[Ke](e){return FA(e)&&XA(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[Hs](){return this.toJSON()},pipe(){return pe(this,arguments)}},UA=Er(0),Gh=Er(1/0),EE=Er(-1/0),WA=v(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),LA=v(3,(e,t,r)=>{if(e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity")return r.onInfinity(e,t);if(e.value._tag==="Millis")return t.value._tag==="Millis"?r.onMillis(e.value.millis,t.value.millis):r.onNanos(kE(e),t.value.nanos);else return r.onNanos(e.value.nanos,kE(t))}),XA=v(2,(e,t)=>zA(e,t))});class $E{buckets=[];scheduleTask(e,t){let r=this.buckets,n=r.length,o,s=0;for(;s<n;s++){if(r[s][0]>t)break;o=r[s]}if(o&&o[0]===t)o[1].push(e);else if(s===n)r.push([t,[e]]);else r.splice(s,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}}class uf{executionMode;setImmediate;constructor(e="async",t){this.executionMode=e,this.setImmediate=t??(e==="sync"?jA:_E)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new AE(this.setImmediate)}}class AE{tasks=new $E;running=void 0;setImmediate;constructor(e=_E){this.setImmediate=e}scheduleTask(e,t){if(this.tasks.scheduleTask(e,t),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let r=e[t][1];for(let n=0;n<r.length;n++)r[n]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var Hh,_E,jA=(e)=>{let t=!1;return Promise.resolve().then(()=>{if(!t)e()}),()=>{t=!0}},RE,IE;var FE=E(()=>{lt();Hh=Be("effect/Scheduler",{fiberCached:!0,defaultValue:()=>new uf}),_E="setImmediate"in globalThis?(e)=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:(e)=>{let t=setTimeout(e,0);return()=>clearTimeout(t)};RE=Be("effect/Scheduler/MaxOpsBeforeYield",{fiberCached:!0,defaultValue:()=>2048}),IE=Be("effect/Scheduler/PreventSchedulerYield",{fiberCached:!0,defaultValue:()=>!1})});function BA(){if(arguments.length===1){let r=arguments[0];return function(n){return r[n._tag](n)}}let e=arguments[0];return arguments[1][e._tag](e)}var UE=()=>new Proxy({},{get(e,t,r){if(t==="$is")return Bs;else if(t==="$match")return BA;return(n)=>({...n,_tag:t})}}),DE,Fr;var ma=E(()=>{ct();ye();DE=qc,Fr=aa});function ff(e){if(e>=ZE.length)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);let t=ZE[e];if(t===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return t}var ME="~effect/encoding/EncodingError",df,pf=(e)=>typeof e==="string"?NE(GA.encode(e)):NE(e),hf=(e)=>{let t=YA(e),r=t.length;if(r%4!==0)return ut(new df({kind:"Decode",module:"Base64",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf("=");if(n!==-1&&(n<r-2||n===r-2&&t[r-1]!=="="))return ut(new df({kind:"Decode",module:"Base64",input:t,message:"Found a '=' character, but it is not at the end"}));try{let o=t.endsWith("==")?2:t.endsWith("=")?1:0,s=new Uint8Array(3*(r/4)-o);for(let i=0,a=0;i<r;i+=4,a+=3){let c=ff(t.charCodeAt(i))<<18|ff(t.charCodeAt(i+1))<<12|ff(t.charCodeAt(i+2))<<6|ff(t.charCodeAt(i+3));s[a]=c>>16,s[a+1]=c>>8&255,s[a+2]=c&255}return gt(s)}catch(o){return ut(new df({kind:"Decode",module:"Base64",input:t,message:o instanceof Error?o.message:"Invalid input"}))}},GA,YA=(e)=>e.replace(/[\n\r]/g,""),NE=(e)=>{let t=e.length,r="",n;for(n=2;n<t;n+=3)r+=xo[e[n-2]>>2],r+=xo[(e[n-2]&3)<<4|e[n-1]>>4],r+=xo[(e[n-1]&15)<<2|e[n]>>6],r+=xo[e[n]&63];if(n===t+1)r+=xo[e[n-2]>>2],r+=xo[(e[n-2]&3)<<4],r+="==";if(n===t)r+=xo[e[n-2]>>2],r+=xo[(e[n-2]&3)<<4|e[n-1]>>4],r+=xo[(e[n-1]&15)<<2],r+="=";return r},xo,ZE,HA;var Jh=E(()=>{ma();Oo();df=class df extends Fr("EncodingError"){[ME]=ME};GA=new TextEncoder;xo=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],ZE=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],HA=[];for(let e=0;e<256;e++)HA.push(e.toString(16).padStart(2,"0"))});var WE="effect/Tracer/ParentSpan",LE="effect/Tracer";var zE=()=>{};var XE="effect/observability/Metric/FiberRuntimeMetricsKey";var Kh,mf,em,Of,tm;var rm=E(()=>{lt();oe();Kh=Be("effect/References/CurrentStackFrame",{fiberCached:!0,defaultValue:Yo}),mf=Be("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),em=Be("effect/References/CurrentLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),Of=Be("effect/References/MinimumLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),tm=Be("effect/References/CurrentLogSpans",{defaultValue:()=>[]})});var tR=()=>{let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(e===void 0)return Object.isExtensible(Error);return Object.hasOwn(e,"writable")?e.writable===!0:e.set!==void 0},rR,gf=()=>Error.stackTraceLimit,Oa=(e)=>{if(rR)Error.stackTraceLimit=e};var nm=E(()=>{rR=tR()});class nk{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return GE;if(this.scheduled===void 0)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let t=0;t<this.waiters.length;t++)this.scheduled.push(this.waiters[t]);return this.waiters=[],GE}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](fr)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](fr)}open=le((e)=>{if(this._isOpen)return YE;return this._isOpen=!0,this.scheduleUnsafe(e)});release=le((e)=>this._isOpen?YE:this.scheduleUnsafe(e));openUnsafe(){if(this._isOpen)return!1;return this._isOpen=!0,this.flushWaiters(),!0}await=zt((e)=>{if(this._isOpen)return e($e);return this.waiters.push(e),ve(()=>{let t=this.waiters.indexOf(e);if(t!==-1)this.waiters.splice(t,1);else if(this.scheduled!==void 0){if(t=this.scheduled.indexOf(e),t!==-1)this.scheduled.splice(t,1)}})});closeUnsafe(){if(!this._isOpen)return!1;return this._isOpen=!1,!0}close=ve(()=>this.closeUnsafe());whenOpen=(e)=>ge(this.await,()=>e);isOpen(){return this._isOpen}}class sk{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=ve(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return _R()}currentTimeNanos=ve(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return ak()}monotonicTimeNanos=ve(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(CE(e))}sleepMillis(e){if(e<=0)return bf;else if(!Number.isFinite(e))return Om;return zt((t)=>{let r=e>om?this.sleepMillis(e-om):$e,n=setTimeout(()=>t(r),Math.min(e,om));return ve(()=>clearTimeout(n))})}}var JE,ga=(e)=>new uo([new JE(e)]),KE=(e)=>{let t=e.reasons.find(ei);return t?gt(t):ut(e)},xa=(e)=>{for(let t=0;t<e.reasons.length;t++){let r=e.reasons[t];if(r._tag==="Fail")return gt(r.error)}return ut(e)},eb=(e)=>e.reasons.some(Zc),tb=(e)=>e.reasons.length>0&&e.reasons.every(Zc),fm,rb,lR=(e)=>{let t={Fail:[],Die:[],Interrupt:[]};for(let r=0;r<e.reasons.length;r++)t[e.reasons[r]._tag].push(e.reasons[r]);return t},dm=(e)=>{let t=lR(e);if(t.Fail.length>0)return t.Fail[0].error;else if(t.Die.length>0)return t.Die[0].defect;else if(t.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},nb=(e,t)=>{let r=[],n=[];if(e.reasons.length===0)return r;let o=gf();Oa(1);for(let s of e.reasons){if(s._tag==="Interrupt"){n.push(s);continue}r.push(sm(s._tag==="Die"?s.defect:s.error,s.annotations,t))}if(r.length===0){let s=Error("The fiber was interrupted by:");s.name="InterruptCause",s.stack=pR(s,n);let i=new globalThis.Error("All fibers interrupted without error",{cause:s});i.name="InterruptError",i.stack=`${i.name}: ${i.message}`,r.push(sm(i,n[0].annotations,t))}return Oa(o),r},sm=(e,t,r)=>{let n=typeof e,o;if(e&&n==="object"){if(o=new globalThis.Error(uR(e),{cause:e.cause?sm(e.cause):void 0}),typeof e.name==="string")o.name=e.name;if(typeof e.stack==="string")o.stack=dR(e.stack,o,t);else{let s=`${o.name}: ${o.message}`;o.stack=t?ob(s,t):s}if(r?.includeCauseInStack)o.stack=ib(o);for(let s of Object.keys(e))if(!(s in o))o[s]=e[s]}else o=new globalThis.Error(!e?`Unknown error: ${e}`:n==="string"?e:Ys(e));return o},uR=(e)=>{if(typeof e.message==="string")return e.message;else if(typeof e.toString==="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Ys(e)},fR,dR=(e,t,r)=>{let n=`${t.name}: ${t.message}`,o=(e.startsWith(n)?e.slice(n.length):e).split(`
|
|
12
|
+
`),s=[n];for(let i=1;i<o.length;i++){if(/(?:Generator\.next|~effect\/Effect)/.test(o[i]))break;s.push(o[i])}return r?ob(s.join(`
|
|
13
|
+
`),r):s.join(`
|
|
14
|
+
`)},ob=(e,t)=>{let r=t?.get(Ku.key);if(r)e=`${e}
|
|
15
|
+
${sb(r)}`;return e},pR=(e,t)=>{let r=[`${e.name}: ${e.message}`];for(let n of t){let o=n.fiberId!==void 0?`#${n.fiberId}`:"unknown",s=n.annotations.get(Ah.key);if(r.push(` at fiber (${o})`),s)r.push(sb(s))}return r.join(`
|
|
16
|
+
`)},sb=(e)=>{let t=[],r=e,n=0;while(r&&n<10){let o=r.stack();if(o){let s=o.matchAll(fR),i=!1;for(let[,a]of s)i=!0,t.push(` at ${r.name} (${a})`);if(!i)t.push(` at ${r.name} (${o.replace(/^at /,"")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join(`
|
|
17
|
+
`)},yf=(e)=>nb(e).map(ib).join(`
|
|
18
|
+
`),ib=(e)=>e.cause?`${e.stack} {
|
|
19
|
+
${ab(e.cause," ")}
|
|
20
|
+
}`:e.stack,ab=(e,t)=>{let r=e.stack.split(`
|
|
21
|
+
`),n=`${t}[cause]: ${r[0]}`;for(let o=1,s=r.length;o<s;o++)n+=`
|
|
22
|
+
${t}${r[o]}`;if(e.cause)n+=` {
|
|
23
|
+
${ab(e.cause,`${t} `)}
|
|
24
|
+
${t}}`;return n},xf="~effect/Fiber",hR,mR,ya=()=>globalThis[oa],pm,OR,jE,Sf=(e)=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(Ah.key,e.currentStackFrame),da(t)},cb=(e)=>{let t=e;if(t._exit)return se(t._exit);return zt((r)=>{if(t._exit)return r(se(t._exit));return ve(e.addObserver((n)=>r(se(n))))})},hm=(e)=>zt((t)=>{let r=e[Symbol.iterator](),n=[],o=void 0;function s(){let i=r.next();while(!i.done){if(i.value._exit){n.push(i.value._exit),i=r.next();continue}o=i.value.addObserver((a)=>{n.push(a),s()});return}t(se(n))}return s(),ve(()=>o?.())}),Ef=(e)=>le((t)=>lb(e,t.id)),lb,jc=(e)=>le((t)=>{let r=Sf(t),n=ti();for(let o of e)o.interruptUnsafe(t.id,r),n.push(o);return wf(hm(n))}),se,nt,as,ve,Se,ub,fb,bf,kf,db=(e)=>Se(()=>nt(mt(e))),oi=(e)=>os(e),pb=(e)=>Se(()=>as(mt(e))),$e,hb=(e)=>{let t=typeof e==="function"?e:e.try,r=typeof e==="function"?(n)=>new ol(n,"An error occurred in Effect.try"):e.catch;return Se(()=>{try{return se(mt(t))}catch(n){return as(mt(()=>r(n)))}})},mb=(e)=>mm(function(t,r){mt(()=>e(r)).then((n)=>t(se(n)),(n)=>t(oi(n)))},e.length!==0),Ob=(e)=>{let t=typeof e==="function"?e:e.try,r=typeof e==="function"?(n)=>new ol(n,"An error occurred in Effect.tryPromise"):e.catch;return mm(function(n,o){let s=(i)=>{try{n(as(mt(()=>r(i))))}catch(a){n(oi(a))}};try{mt(()=>t(o)).then((i)=>n(se(i)),s)}catch(i){s(i)}},t.length!==0)},gR=(e)=>le((t)=>e(t.id)),mm,xR,zt=(e)=>mm(e,e.length>=2),Om,gb=(...e)=>Se(()=>Vc(e.length===1?e[0]():e[1].call(e[0].self))),gm=(e,...t)=>{let r=t.length===0?function(){return Se(()=>Vc(e.apply(this,arguments)))}:function(){let n=Se(()=>Vc(e.apply(this,arguments)));for(let o=0;o<t.length;o++)n=t[o](n,...arguments);return n};return xb(e.length,r)},xb=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),yb=(e,...t)=>xb(e.length,t.length===0?function(){return VE(()=>e.apply(this,arguments))}:function(){let r=VE(()=>e.apply(this,arguments));for(let n of t)r=n(r);return r}),VE=(e)=>{try{let t=e(),r=void 0;while(!0){let n=t.next(r);if(n.done)return se(n.value);let o=n.value;if(o&&o._tag==="Success"){r=o.value;continue}else if(o&&o._tag==="Failure")return n.value;else{let s=!0;return Se(()=>{if(s)return s=!1,ge(n.value,(i)=>Vc(t,i));else return Se(()=>Vc(e()))})}}}catch(t){return oi(t)}},Vc,si,xm=(e)=>yo(e,ee),cs,Pf,wf=(e)=>ge(e,(t)=>fr),Sb=(e,t)=>le((r)=>zt((n)=>{let o=!1,s=new Set,i=(c)=>{o=!0,n(s.size===0?c:ge($f(jc(s)),()=>c))},a=0;for(let c of e){if(o)break;let l=a++,u=If(r,c,!0,!0,!1);s.add(u),u.addObserver((f)=>{s.delete(u);let d=!o;if(i(f),d&&t?.onWinner)t.onWinner({fiber:u,index:l,parentFiber:r})})}return jc(s)})),ym,ge,yR,qe=(e)=>(Js in e),Eb,yo,bb,kb,Sm=(e)=>Kt(ga(e)),Tf=(e)=>e._tag==="Success",Pb=(e)=>e._tag==="Failure",wb=(e)=>e._tag==="Failure"?gt(e.cause):ut(e),fr,Tb,vb,Cb,Qb=(e)=>{let t=[];for(let r of e)if(r._tag==="Failure")t.push(...r.cause.reasons);return t.length===0?fr:Kt(ns(t))},_b=(e)=>le((t)=>se(uE(t.context,e))),Em,bm=(e)=>le((t)=>e(t.context)),So,Gc=function(){if(arguments.length===1)return v(2,(e,t)=>BE(e,arguments[0],t));return v(3,(e,t,r)=>BE(e,t,r)).apply(this,arguments)},BE=(e,t,r)=>Em(e,mo(t,r)),$b,ls,SR,vf,Yc,Ab,Rb,km,Pm,Ib,wm,Tm=(e)=>Yc(e,oi),Fb,Ub=(e)=>Db(e,{onFailure:ut,onSuccess:gt}),Sa,ER,Cf,vm,Db,Hc=(e)=>qe(e)?Ne(e):bR(e),bR,Cm,Mb,im="~effect/Scope",am="~effect/Scope/Closeable",Jc,Qm=(e,t)=>Se(()=>Qf(e,t)??$e),Qf=(e,t)=>{if(e.state._tag==="Closed")return;let r={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=r;return}let n=e.state;if(e.state=r,n.finalizer!==void 0)return n.finalizer(t);let o=n.finalizers;if(o===void 0||o.size===0)return;else if(o.size===1)return o.values().next().value(t);return PR(e,o,t)},kR=(e,t)=>Tf(e)?t:ls(t,(r)=>nt(fm(e.cause,r))),PR,Nb=(e,t)=>{let r=Kc(t);if(e.state._tag==="Closed")return r.state=e.state,r;let n={};return Bc(e,n,(o)=>Qm(r,o)),Bc(r,n,(o)=>ve(()=>_m(e,n))),r},us=(e,t)=>Se(()=>{if(e.state._tag==="Closed")return t(e.state.exit);return Bc(e,{},t),$e}),Zb=(e,t)=>us(e,$r(t)),Bc=(e,t,r)=>{if(e.state._tag==="Empty")e.state={_tag:"Open",finalizerKey:t,finalizer:r,finalizers:void 0};else if(e.state._tag==="Open"){let n=e.state;if(n.finalizer!==void 0)n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0,n.finalizers.set(t,r);else if(n.finalizers===void 0)n.finalizerKey=t,n.finalizer=r;else n.finalizers.set(t,r)}},_m=(e,t)=>{if(e.state._tag==="Open"){let r=e.state;if(r.finalizerKey===t)r.finalizerKey=void 0,r.finalizer=void 0;else if(r.finalizers!==void 0)r.finalizers.delete(t)}},Kc=(e="sequential")=>({[am]:am,[im]:im,strategy:e,state:wR}),wR,el,qb,$m=(e)=>le((t)=>{let r=t.context,n=Kc();return t.setContext(mo(t.context,Jc,n)),ii(e,(o)=>(t.setContext(r),Qf(n,o)))}),_f=(e)=>Se(()=>{let t=Kc();return fs(e(t),(r)=>Se(()=>Qf(t,r)??$e))}),Am=(e,t,r)=>bm((n)=>ds((o)=>ge(el,(s)=>Pf(r?.interruptible?o(e):e,(i)=>us(s,(a)=>So(t(i,a),n)))))),Rm=(e)=>ge(el,(t)=>bm((r)=>us(t,(n)=>So(e(n),r)))),ii,fs,Wb,Lb,zb,Xb,$f=(e)=>le((t)=>{if(!t.interruptible)return e;return t.interruptible=!1,t._stack.push(Af),e}),jb,Af,TR,vR=(e)=>{if(e.interruptible=!0,e._stack.push(TR),e._interruptedCause)return nt(e._interruptedCause)},Vb=(e)=>le((t)=>{if(t.interruptible)return e;return vR(t)??e}),ds=(e)=>le((t)=>{if(!t.interruptible)return e(B);return t.interruptible=!1,t._stack.push(Af),e(Vb)}),tl,Rf,CR=(e,t,r)=>Se(()=>{let n=r?.discard?void 0:[],o=e[Symbol.iterator](),s=o.next(),i=0;return si(tl({while:()=>!s.done,body:()=>t(s.value,i++),step:(a)=>{if(n)n.push(a);s=o.next()}}),n)}),Bb=(e)=>{let{onItem:t,step:r}=e,n=(o,s,i,a)=>{for(;i<a;i++){let c=s[i],l=t(o,c,i);if(!qe(l))return ge(Hc(l),(f)=>r(o,c,f,i)??n(o,s,i+1,a)??$e);let u=r(o,c,l,i);if(u)return u._tag==="Failure"?u:void 0}};return(o,s,i)=>{let a=0,c=i?.end??s.length,l=i?.concurrency??1;if(l===1)return n(o,s,0,c);let u=i?.orderedStep===!0,f=!1,d,h,m,b=!1,x,O,S=a,y=u?Array(c):void 0,g=(w)=>{let _=os(w);return x=_,f=!0,b=!0,h&&h.size>0?ge($f(jc(Array.from(h))),()=>_):_},C=(w,_,I)=>{if(!u)return r(o,w,_,I);if(x)return x;y[I]=_;while(S<c){let F=y[S];if(F===void 0)return;y[S]=void 0;let R=S++,A=r(o,s[R],F,R);if(A)return A}},Q=()=>{let w=!1;for(;!x&&a<c;a++){let _=s[a],I=O??t(o,_,a);if(qe(I)){if(x=C(_,I,a),x)break}else if(!d)return zt((F)=>{d=ya(),h=new Set,O=I,m=F;let R;try{R=Q()}catch(A){return F(g(A))}if(R)return F(R);return Se(()=>(x=fr,b=!0,h?jc(h):$e))});else{O=void 0;let F=If(d,I,!0,!0,"inherit");if(F._exit){if(x=C(_,F._exit,a),x)break;continue}h.add(F);let R=a;if(F.addObserver((A)=>{h.delete(F);try{if(x){if(!b&&A._tag==="Failure")for(let M of A.cause.reasons)if(M._tag==="Interrupt")continue;else if(x._tag==="Failure")x.cause.reasons.push(M);else x=Kt(ns([M]))}else{let M=C(_,A,R);if(M)x=M._tag==="Failure"?Kt(ns(M.cause.reasons.slice())):M,Q()}if(w){let M=Q();if(M)m(M)}else if(f&&h.size===0)m(x??$e)}catch(M){m(g(M))}}),h.size<l)continue;w=!0,a++;return}}if(f=!0,x){if(h&&h.size>0){let _=Sf(d);h.forEach((I)=>I.interruptUnsafe(d.id,_));return}if(m||x._tag==="Failure")return x}else if(m){if(!h)return fr;else if(h.size===0)m($e)}};return Q()}},rl=()=>Bb,QR,If=(e,t,r=!1,n=!1,o=!1)=>{let s=e,i=o==="inherit"?s.interruptible:!o,a=new pm(s.context,i);if(r)a.evaluate(t);else s.currentDispatcher.scheduleTask(()=>a.evaluate(t),0);if(!n&&!a._exit)s.children().add(a),a.addObserver(()=>s._children.delete(a));return a},Im,Gb,nl=(e)=>(t,r)=>{let n=new pm(r?.scheduler?mo(e,Hh,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let o=()=>n.interruptUnsafe();r.signal.addEventListener("abort",o,{once:!0}),n.addObserver(()=>r.signal.removeEventListener("abort",o))}if(r?.onFiberStart)r.onFiberStart(n);return n},Yb,Hb,Jb=(e)=>{let t=nl(e);return(r,n)=>{let o=t(r,n);return new Promise((s)=>{o.addObserver((i)=>s(i))})}},Kb=(e)=>{let t=Jb(e);return(r,n)=>t(r,n).then((o)=>{if(o._tag==="Failure")throw dm(o.cause);return o.value})},ek,tk=(e)=>{let t=nl(e);return(r)=>{if(qe(r))return r;let n=new uf("sync"),o=t(r,{scheduler:n});return o._dispatcher?.flush(),o._exit??os(new Nm(o))}},rk,GE,YE,ok=(e)=>new nk(e??!1),Fm,om=2147483647,ik,ak,_R,Um=(e)=>le((t)=>e(t.getRef(Fm))),Dm=(e)=>Um((t)=>t.sleep(ha(e))),cm="~effect/Cause/TimeoutError",Mm,lm="~effect/Cause/AsyncFiberError",Nm,um="~effect/Cause/UnknownError",ol,Zm,$R=(e)=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},AR,RR,ck,IR,FR="~effect/Logger",UR,lk=(e)=>{let t=Object.create(UR);return t.log=e,t},DR=(e)=>e.replace(/[\s="]/g,"_"),MR=(e,t)=>`${DR(e[0])}=${t-e[1]}ms`,qm=(e)=>(...t)=>{let r=void 0;for(let n=0,o=t.length;n<o;n++){let s=t[n];if(Ic(s)){if(r)t.splice(n,1);else t=t.slice(0,n).concat(t.slice(n+1));r=r?ns(r.reasons.concat(s.reasons)):s,n--}}if(r===void 0)r=Qh;return le((n)=>{let o=e??n.currentLogLevel;if(RR(n.minimumLogLevel,o))return $e;let s=n.getRef(Fm),i=n.getRef(ck);if(i.size>0){let a=new Date(s.currentTimeMillisUnsafe());for(let c of i)c.log({cause:r,fiber:n,date:a,logLevel:o,message:t})}return $e})},ni,pV,NR=(e)=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,ZR,qR;var Dt=E(()=>{_n();lt();Yh();co();on();oe();En();es();ze();Mh();It();ye();Yu();Oo();FE();zE();Ac();ct();rm();nm();JE=class JE extends Fc{fiberId;constructor(e,t=Uc){super("Interrupt",t,"Interrupted");this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[Ke](e){return Zc(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Je](){return Yt(it(`${this._tag}:${this.fiberId}`))(ju(this.annotations))}};fm=v(2,(e,t)=>{if(e.reasons.length===0)return t;else if(t.reasons.length===0)return e;let r=new uo(gE(e.reasons,t.reasons));return at(e,r)?e:r}),rb=v(2,(e,t)=>{let r=!1,n=e.reasons.map((o)=>{if(ei(o))return r=!0,new Dc(t(o.error),o.annotations);return o});return r?ns(n):e}),fR=/\((.*)\)/g,hR={_A:B,_E:B},mR={id:0};pm=class pm{constructor(e,t=!0){this[xf]=hR,this.setContext(e),this.id=++mR.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[xf];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return ss(this.context,e)}addObserver(e){if(this._exit)return e(this._exit),oo;return this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);if(t>=0)this._observers.splice(t,1)}}interruptUnsafe(e,t){if(this._exit)return;let r=ga(e);if(this.currentStackFrame)r=Nc(r,ho(Ku,this.currentStackFrame));if(t)r=Nc(r,t);if(this._interruptedCause=this._interruptedCause?fm(this._interruptedCause,r):r,this.interruptible)if(this._running)this._deferredInterrupt=!0;else this.evaluate(nt(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;else if(this._yielded!==void 0){let n=this._yielded;this._yielded=void 0,n()}let t=this.runLoop(e);if(t===Ks)return;let r=jE.interruptChildren&&jE.interruptChildren(this);if(r!==void 0)return this.evaluate(ge(r,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let n=0;n<this._observers.length;n++)this._observers[n](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Tn()}runLoop(e){let t=globalThis[oa];globalThis[oa]=this;let r=this._running;this._running=!0;let n=!1,o=e;this.currentOpCount=0;try{while(!0){if(this._deferredInterrupt)this._deferredInterrupt=!1,o=nt(this._interruptedCause);if(this.currentOpCount++,!n&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){n=!0;let s=o;o=ge(bf,()=>s)}if(o=this.currentTracerContext?this.currentTracerContext(o,this):o[et](this),o===Ks){let s=this._yielded;if(Js in s)return this._deferredInterrupt=!1,this._yielded=void 0,s;else if(this._deferredInterrupt){this._yielded=void 0,s();continue}return Ks}}}catch(s){if(!G(o,et))return os(`Fiber.runLoop: Not a valid effect: ${String(o)}`);return this.runLoop(os(s))}finally{this._running=r,globalThis[oa]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,OR;while(!0){let t=this._stack.pop();if(!t)return;let r=t[rs]&&t[rs](this);if(r)return r[e]=r,r;if(t[e])return t}}yieldWith(e){return this._yielded=e,Ks}children(){return this._children??=new Set}pipe(){return pe(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&iE(t,e))return;let r=this.getRef(Hh);if(r!==this.currentScheduler)this.currentScheduler=r,this._dispatcher=void 0;this.currentSpan=Lc(e,WE),this.currentLogLevel=this.getRef(em),this.minimumLogLevel=this.getRef(Of),this.currentStackFrame=this.getRef(Kh),this.maxOpsBeforeYield=this.getRef(RE),this.currentPreventYield=this.getRef(IE),this.runtimeMetrics=Lc(e,XE);let n=Lc(e,LE);this.currentTracerContext=n?n.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}};OR={[Ht](e,t){return nt(t._interruptedCause)},[Rr](e,t){return nt(t._interruptedCause)}},jE={interruptChildren:void 0},lb=v((e)=>G(e[0],xf),(e,t,r)=>le((n)=>{let o=Sf(n);return o=o&&r?pa(o,r):o??r,e.interruptUnsafe(t,o),wf(cb(e))})),se=Ne,nt=Kt,as=kn,ve=Ir({op:"Sync",[et](e){let t=this[Y](),r=e.getCont(Ht);return r?r[Ht](t,e):e.yieldWith(Ne(t))}}),Se=Ir({op:"Suspend",[et](e){return this[Y]()}}),ub=nf({onFailure:as,onSuccess:se}),fb=Ir({op:"Yield",[et](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{if(t)return;e.evaluate(fr)},this[Y]??0),e.yieldWith(()=>{t=!0})}}),bf=fb(0),kf=se(L()),$e=se(void 0),mm=Ir({op:"Async",single:!1,[et](e){let t=mt(()=>this[Y][0].bind(e.currentScheduler)),r=!1,n=!1,o=this[Y][1]?new AbortController:void 0,s=t((i)=>{if(r)return;if(r=!0,n)e.evaluate(i);else n=i},o?.signal);if(n!==!1)return n;if(n=!0,e._yielded=()=>{r=!0},o===void 0&&s===void 0)return Ks;return e._stack.push(xR(()=>(r=!0,o?.abort(),s??fr))),Ks}}),xR=Ir({op:"AsyncFinalizer",[rs](e){if(e.interruptible)e.interruptible=!1,e._stack.push(Af)},[Rr](e,t){return eb(e)?ge(this[Y](),()=>nt(e)):nt(e)}}),Om=zt(oo),Vc=Ir({op:"Iterator",single:!1,[Ht](e,t){let r=this[Y][0];while(!0){let n=r.next(e);if(n.done)return se(n.value);if(!qe(n.value))return t._stack.push(this),n.value;else if(n.value._tag==="Failure")return n.value;e=n.value.value}},[et](e){return this[Ht](this[Y][1],e)}}),si=v(2,(e,t)=>{let r=se(t);return ge(e,(n)=>r)}),cs=v(2,(e,t)=>ge(e,(r)=>Ft(t)?t:mt(()=>t(r)))),Pf=v(2,(e,t)=>ge(e,(r)=>si(Ft(t)?t:mt(()=>t(r)),r))),ym=v((e)=>Ft(e[1]),(e,t,r)=>Sb([e,t],r)),ge=v(2,(e,t)=>{let r=Object.create(yR);return r[Y]=e,r[Ht]=t.length!==1?(n)=>t(n):t,r}),yR=fo({op:"OnSuccess",[et](e){return e._stack.push(this),this[Y]}}),Eb=v(2,(e,t)=>{if(qe(e))return e._tag==="Success"?t(e.value):e;return ge(e,t)}),yo=v(2,(e,t)=>ge(e,(r)=>se(mt(()=>t(r))))),bb=v(2,(e,t)=>qe(e)?Tb(e,t):yo(e,t)),kb=v(2,(e,t)=>qe(e)?vb(e,t):wm(e,t)),fr=Ne(void 0),Tb=v(2,(e,t)=>e._tag==="Success"?Ne(t(e.value)):e),vb=v(2,(e,t)=>{if(e._tag==="Success")return e;let r=xa(e.cause);if(Ut(r))return e;return kn(t(r.success))}),Cb=v(2,(e,t)=>Tf(e)?t:e),Em=v(2,(e,t)=>le((r)=>{let n=r.context,o=t(n);if(n===o)return e;return r.setContext(o),ii(e,()=>{r.setContext(n);return})})),So=v(2,(e,t)=>{if(qe(e))return e;return Em(e,pa(t))}),$b=v((e)=>Ft(e[0]),(e,t)=>tl({while:no,body:$r(t?.disableYield?e:ge(e,(r)=>bf)),step:oo})),ls=v(2,(e,t)=>{let r=Object.create(SR);return r[Y]=e,r[Rr]=t.length!==1?(n)=>t(n):t,r}),SR=fo({op:"OnFailure",[et](e){return e._stack.push(this),this[Y]}}),vf=v(3,(e,t,r)=>ls(e,(n)=>{let o=t(n);return Ut(o)?nt(o.failure):mt(()=>r(o.success,n))})),Yc=v(2,(e,t)=>vf(e,xa,(r)=>t(r))),Ab=v(2,(e,t)=>ls(e,(r)=>cs(mt(()=>t(r)),nt(r)))),Rb=v((e)=>Ft(e[0]),(e,t,r,n)=>ls(e,(o)=>{let s=xa(o);if(Ut(s))return nt(s.failure);if(!t(s.success))return n?mt(()=>n(s.success)):nt(o);return mt(()=>r(s.success))})),km=v((e)=>Ft(e[0]),(e,t,r,n)=>ls(e,(o)=>{let s=xa(o);if(Ut(s))return nt(s.failure);let i=t(s.success);if(Ut(i))return n?mt(()=>n(i.failure)):nt(o);return mt(()=>r(i.success))})),Pm=v((e)=>Ft(e[0]),(e,t,r,n)=>{let o=Array.isArray(t)?(s)=>G(s,"_tag")&&t.includes(s._tag):Bs(t);return Rb(e,o,r,n)}),Ib=v((e)=>Ft(e[0]),(e,t,r)=>{let n;return km(e,(o)=>(n??=Object.keys(t),G(o,"_tag")&&Jo(o._tag)&&n.includes(o._tag)?gt(o):ut(o)),(o)=>mt(()=>t[o._tag](o)),r)}),wm=v(2,(e,t)=>Yc(e,(r)=>pb(()=>t(r)))),Fb=v((e)=>Ft(e[0]),(e,t)=>{if(!t?.log)return Cf(e,{onFailure:(n)=>$e,onSuccess:(n)=>$e});let r=qm(t.log===!0?void 0:t.log);return Sa(e,{onFailure(n){let o=KE(n);return Ut(o)?nt(o.failure):t.message===void 0?r(n):r(t.message,n)},onSuccess:(n)=>$e})}),Sa=v(2,(e,t)=>{let r=Object.create(ER);return r[Y]=e,r[Ht]=t.onSuccess.length!==1?(n)=>t.onSuccess(n):t.onSuccess,r[Rr]=t.onFailure.length!==1?(n)=>t.onFailure(n):t.onFailure,r}),ER=fo({op:"OnSuccessAndFailure",[et](e){return e._stack.push(this),this[Y]}}),Cf=v(2,(e,t)=>Sa(e,{onFailure:(r)=>{let n=r.reasons.find(ei);return n?mt(()=>t.onFailure(n.error)):nt(r)},onSuccess:t.onSuccess})),vm=v(2,(e,t)=>Cf(e,{onFailure:(r)=>ve(()=>t.onFailure(r)),onSuccess:(r)=>ve(()=>t.onSuccess(r))})),Db=v(2,(e,t)=>{if(qe(e)){if(e._tag==="Success")return Ne(t.onSuccess(e.value));let r=xa(e.cause);if(Ut(r))return e;return Ne(t.onFailure(r.success))}return vm(e,t)}),bR=Ir({op:"Exit",[et](e){return e._stack.push(this),this[Y]},[Ht](e,t,r){return se(r??Ne(e))},[Rr](e,t,r){return se(r??Kt(e))}}),Cm=v(2,(e,t)=>ym(e,ge(Dm(t.duration),t.orElse))),Mb=v(2,(e,t)=>Cm(e,{duration:t,orElse:()=>as(new Mm)})),Jc=rt("effect/Scope"),PR=gm(function*(e,t,r){let n=[],o=[],s=Array.from(t.values()),i=ya();for(let a=s.length-1;a>=0;a--){let c=s[a];if(e.strategy==="sequential")n.push(yield*Hc(c(r)));else o.push(If(i,c(r),!0,!0,"inherit"))}if(o.length>0)n=yield*hm(o);return yield*Qb(n)}),wR={_tag:"Empty"},el=Jc,qb=Gc(Jc),ii=Ir({op:"OnExit",single:!1,[et](e){return e._stack.push(this),this[Y][0]},[rs](e){if(e.interruptible&&this[Y][2]!==!0)e._stack.push(Af),e.interruptible=!1},[Ht](e,t,r){r??=Ne(e);let n=this[Y][1](r);return n?ge(n,(o)=>r):r},[Rr](e,t,r){r??=Kt(e);let n=this[Y][1](r);return n?ge(kR(r,n),(o)=>r):r}}),fs=v(2,ii),Wb=v(2,(e,t)=>fs(e,(r)=>t)),Lb=v(3,(e,t,r)=>fs(e,(n)=>{let o=t(n);return Ut(o)?$e:r(o.success,n)})),zb=v(2,(e,t)=>Lb(e,wb,t)),Xb=le((e)=>nt(ga(e.id))),jb=Ir({op:"SetInterruptible",[rs](e){if(e.interruptible=this[Y],e._interruptedCause&&e.interruptible)return()=>nt(e._interruptedCause)}}),Af=jb(!0),TR=jb(!1),tl=Ir({op:"While",[Ht](e,t){if(this[Y].step(e),this[Y].while())return t._stack.push(this),this[Y].body();return fr},[et](e){if(this[Y].while())return e._stack.push(this),this[Y].body();return fr}}),Rf=v((e)=>typeof e[1]==="function",(e,t,r)=>Se(()=>{let n=r?.concurrency??1,o=n==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,n);if(o===1)return CR(e,t,r);let s=Cn(e),i=s.length;if(i===0)return r?.discard?$e:se([]);let a=r?.discard?void 0:Array(i),c=QR({f:t,out:a},s,{concurrency:o});return c?si(c,a):se(a)})),QR=Bb({onItem(e,t,r){return e.f(t,r)},step(e,t,r,n){if(r._tag==="Failure")return r;else if(e.out)e.out[n]=r.value}}),Im=v((e)=>Ft(e[0]),(e,t,r)=>le((n)=>{let o=If(n,e,r?.startImmediately,!0,r?.uninterruptible);if(!o._exit)if(t.state._tag!=="Closed"){let s={};Bc(t,s,()=>gR((a)=>a===o.id?$e:Ef(o))),o.addObserver(()=>_m(t,s))}else o.interruptUnsafe(n.id,Sf(n));return se(o)})),Gb=v((e)=>Ft(e[0]),(e,t)=>ge(el,(r)=>Im(e,r,t))),Yb=v(2,(e,t)=>{if(e._exit)return e;else if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;let r={};return Bc(t,r,()=>Ef(e)),e.addObserver(()=>_m(t,r)),e}),Hb=nl(Tn()),ek=Kb(Tn()),rk=tk(Tn()),GE=se(!0),YE=se(!1);Fm=Be("effect/Clock",{defaultValue:()=>new sk});ik=BigInt(1e6),ak=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==="function")return()=>e.bigint();if(typeof performance<"u"&&typeof performance.now==="function")return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let r=BigInt(Date.now())*ik;if(r>t)t=r;return t}}(),_R=function(){let e=BigInt(1e9),t;return()=>{let r=ak(),n=BigInt(Date.now())*ik;if(t===void 0)t=n-r;else{let o=t+r;if((n>o?n-o:o-n)>e)t=n-r}return t+r}}();Mm=class Mm extends aa("TimeoutError"){[cm]=cm;constructor(e){super({message:e})}};Nm=class Nm extends aa("AsyncFiberError"){[lm]=lm;constructor(e){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:e})}};ol=class ol extends aa("UnknownError"){[um]=um;constructor(e,t){super({message:t,cause:e})}};Zm=Be("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),AR=YS(ef,$R),RR=tf(AR),ck=Be("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([ZR,qR])}),IR=Be("effect/Logger/LogToStderr",{defaultValue:mh}),UR={[FR]:{_Message:B,_Output:B},pipe(){return pe(this,arguments)}},ni={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},pV={None:[],All:[],Trace:[ni.gray],Debug:[ni.blue],Info:[ni.green],Warn:[ni.yellow],Error:[ni.red],Fatal:[ni.bgBrightRed,ni.black]},ZR=lk(({cause:e,date:t,fiber:r,logLevel:n,message:o})=>{let s=Array.isArray(o)?o.slice():[o];if(e.reasons.length>0)s.push(yf(e));let i=t.getTime(),a=r.getRef(tm),c="";for(let d of a)c+=` ${MR(d,i)}`;let l=r.getRef(mf);if(Object.keys(l).length>0)s.push(l);let u=r.getRef(Zm);(r.getRef(IR)?u.error:u.log)(`[${NR(t)}] ${n.toUpperCase()} (#${r.id})${c}:`,...s)}),qR=lk(({cause:e,fiber:t,logLevel:r,message:n})=>{let o=t.getRef(Fm),s=t.getRef(mf),i=t.currentSpan;if(i===void 0||i._tag==="ExternalSpan")return;let a={};for(let[c,l]of Object.entries(s))Ar(a,c,l);if(a["effect.fiberId"]=t.id,a["effect.logLevel"]=r.toUpperCase(),e.reasons.length>0)a["effect.cause"]=yf(e);i.event(vS(Array.isArray(n)&&n.length===1?n[0]:n),o.currentTimeNanosUnsafe(),a)})});var Wm,Lm,uk,Ff,ai,sl,ci,zm,Uf,Mt,fk;var tr=E(()=>{ct();Dt();Wm=ei,Lm=ns,uk=Mc,Ff=tb,ai=rb,sl=dm,ci=yf,zm=FS,Uf=ca,Mt=DS,fk=ol});var li,ps,sn,Ur,kr,ui;var Mr=E(()=>{ct();Dt();li=Ne,ps=Kt,sn=kn,Ur=fr,kr=Tf,ui=Pb});var WR="~effect/Deferred",LR,Df=()=>{let e=Object.create(LR);return e.resumes=void 0,e.effect=void 0,e},fi=(e)=>zt((t)=>{if(e.effect)return t(e.effect);return e.resumes??=[],e.resumes.push(t),ve(()=>{let r=e.resumes;if(r===void 0)return;let n=r.indexOf(t);if(n>=0)r.splice(n,1)})}),zR,dk,Xm=(e)=>ve(()=>XR(e)),XR=(e)=>e.effect!==void 0,jm=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let n=0;n<r.length;n++)r[n](t)}return!0};var Vm=E(()=>{oe();Dt();It();LR={[WR]:{_A:B,_E:B},pipe(){return pe(this,arguments)}},zR=v(2,(e,t)=>ve(()=>jm(e,t))),dk=zR});var hk;var mk=E(()=>{rm();hk=Of});var il,Ea,al,Mf,cl,hs,Pr;var ll=E(()=>{Dt();il=Jc,Ea=Kc,al=qb,Mf=us,cl=Zb,hs=Nb,Pr=Qm});var BR="~effect/Layer",Ok="~effect/Layer/MemoMap",GR=(e,t)=>(e.observers++,cs(us(t,(r)=>e.finalizer(r)),e.effect)),YR,yk=(e)=>{let t=Object.create(YR);return t.build=e,t},Bm=(e)=>yk((t,r)=>{let n=hs(r);return fs(e(t,n),(o)=>o._tag==="Failure"?Pr(n,o):$e)}),HR=(e)=>{let t=Bm((r,n)=>r.getOrElseMemoize(t,n,e));return t},JR=(e,t,r,n)=>{let o=Ea(),s=Df(),i={observers:1,effect:fi(s),finalizer:(a)=>Se(()=>{if(i.observers--,i.observers===0)return e.map.delete(t),Pr(o,a);return $e})};return e.map.set(t,i),us(r,i.finalizer).pipe(ge(()=>n(e,o)),fs((a)=>(i.effect=a,dk(s,a))))},Gm,Ym=()=>new Gm,KR=(e)=>new Gm(e),ul,Hm,Sk,ms=function(){if(arguments.length===1)return(e)=>gk(ho(arguments[0],e));return gk(ho(arguments[0],arguments[1]))},gk=(e)=>yk($r(se(e))),ba=function(){if(arguments.length===1)return(e)=>xk(arguments[0],e);return xk(arguments[0],arguments[1])},xk=(e,t)=>eI(yo(t,(r)=>ho(e,r))),eI=(e)=>HR((t,r)=>al(e,r)),Ek=(e,t,r)=>{let n=hs(r,"parallel");return Rf(e,(o)=>o.build(t,hs(n,"sequential")),{concurrency:e.length}).pipe(yo((o)=>fE(...o)))},Zf=(...e)=>Bm((t,r)=>Ek(e,t,r)),tI=(e,t,r)=>Bm((n,o)=>ge(Array.isArray(t)?Ek(t,n,o):t.build(n,o),(s)=>e.build(n,o).pipe(So(s),yo((i)=>r(i,s))))),bk;var Eo=E(()=>{lt();Vm();oe();ct();Dt();It();ll();YR={[BR]:{_ROut:B,_E:B,_RIn:B},pipe(){return pe(this,arguments)}};Gm=class Gm{get[Ok](){return Ok}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let r=this.map.get(e);if(r)return GR(r,t);return this.parent?.get(e,t)}getOrElseMemoize(e,t,r){return Se(()=>{let n=this.get(e,t);if(n)return n;return JR(this,e,t,r)})}};ul=class ul extends rt()("effect/Layer/CurrentMemoMap"){static forkOrCreate(e){let t=cE(e,ul);return t?KR(t):Ym()}};Hm=v(3,(e,t,r)=>Gc(yo(e.build(t,r),mo(ul,t)),ul,t)),Sk=v(2,(e,t)=>le((r)=>Hm(e,ul.forkOrCreate(r.context),t))),bk=v(2,(e,t)=>tI(e,t,(r,n)=>pa(n,r)))});var sB,kk;var Pk=E(()=>{oe();sB=globalThis.Number,kk=v(2,(e,t)=>{let r=Math.pow(10,t);return Math.round(e*r)/r})});var $n,fl=(e)=>e.reasons.some(Jm),Jm=(e)=>e._tag==="Fail"&&zm(e.error),qf=(e)=>{let t,r=!1;for(let n of e.reasons)if(Jm(n))t??=n.error;else if(n._tag!=="Interrupt")r=!0;if(t===void 0)return ut(e);return r?ut(Lm(e.reasons.filter((n)=>!Jm(n)))):gt(t)},nI=(e)=>{let t=qf(e);return Ut(t)?t:gt(t.success.value)},Km=(e)=>{let t=qf(e);return!Ut(t)?li(t.success.value):ps(t.failure)},wk;var dl=E(()=>{tr();Mr();oe();Dt();Oo();$n=v(2,(e,t)=>vf(e,nI,(r)=>t(r))),wk=v(2,(e,t)=>Sa(e,{onSuccess:t.onSuccess,onFailure:(r)=>{let n=qf(r);return!Ut(n)?t.onDone(n.success.value):t.onFailure(n.failure)}}))});var oI=(e,t,r)=>_f((n)=>ge(r?.local?Hm(t,Ym(),n):Sk(t,n),(o)=>So(e,o))),Tk;var vk=E(()=>{lt();oe();Eo();ct();Dt();Tk=v((e)=>Ft(e[0]),(e,t,r)=>Lh(t)?So(e,t):oI(e,Array.isArray(t)?Zf(...t):t,r))});var di,ka,Lf,gs,pi,T,zf,Ee,ne,ue,dr,We,N,pl,Pa,xs,xt,eO,Ck,H,an,Xf,Qk,An,K,Nr,jf,bo,wa,_k,wr,Vf,cn,Rn,$k,Bf,Ak,Rk,tO,Ta,va,Ik,Fk,ys,rO,hi,Gf,mi,Uk,ln,nO,hl,ml,Ca,Yf,Hf,oO,ko,Ol,gl,Ss,Jf,Dk,xl,z,sO,iO,Le=(e,t,r)=>(...n)=>dr((o)=>{try{e(...n,(s,i)=>{if(s)o(N(t?t(s,n):s));else o(T(i))})}catch(s){o(r?N(r(s,n)):xs(s))}}),Qa,aO,Tr,cO;var ae=E(()=>{ct();Dt();vk();di=Ft,ka=Rf,Lf=tl,gs=mb,pi=Ob,T=se,zf=kf,Ee=Se,ne=ve,ue=$e,dr=zt,We=gb,N=as,pl=nt,Pa=db,xs=oi,xt=hb,eO=le,Ck=ub,H=ge,an=cs,Xf=Pf,Qk=Ub,An=Hc,K=yo,Nr=si,jf=wf,bo=Yc,wa=Pm,_k=Ib,wr=ls,Vf=km,cn=wm,Rn=Tm,$k=Ab,Bf=Fb,Ak=Mb,Rk=Cm,tO=Dm,Ta=ym,va=vm,Ik=Cf,Fk=Tk,ys=So,rO=_b,hi=Gc,Gf=el,mi=$m,Uk=_f,ln=Am,nO=Rm,hl=Wb,ml=zb,Ca=fs,Yf=Xb,Hf=$f,oO=ds,ko=$b,Ol=Im,gl=Gb,Ss=Hb,Jf=nl,Dk=ek,xl=rk,z=gm,sO=Um,iO=qm("Error"),Qa=bb,aO=kb,Tr=Eb,cO=yb});var aI=(e,t)=>{if(kr(e))return t(0);if(Ff(e.cause))return t(130);return t(cI(sl(e.cause)))},Mk=(e)=>v((t)=>di(t[0]),(t,r)=>{let n=r?.disableErrorReporting===!0?Ss(t):Ss($k(t,(s)=>{if(Ff(s))return ue;return lI(sl(s))?iO(s):ue}));try{let s=globalThis.setInterval(oo,2147483647);n.addObserver(()=>{clearInterval(s)})}catch{}let o=r?.teardown??aI;return e({fiber:n,teardown:o})}),Kf="~effect/Runtime/errorExitCode",cI=(e)=>{if(typeof e==="object"&&e!==null&&Kf in e){let t=e[Kf];if(typeof t==="number")return t}return 1},Oi="~effect/Runtime/errorReported",lI=(e)=>{if(typeof e==="object"&&e!==null&&Oi in e){let t=e[Oi];if(typeof t==="boolean")return t}return!0};var ed=E(()=>{tr();ae();Mr();oe()});var Nk;var Zk=E(()=>{ed();Nk=Mk(({fiber:e,teardown:t})=>{let r=!1;e.addObserver((o)=>{process.removeListener("SIGINT",n),process.removeListener("SIGTERM",n),t(o,(s)=>{if(r||s!==0)process.exit(s)})});function n(){r=!0,e.interruptUnsafe(e.id)}process.on("SIGINT",n),process.on("SIGTERM",n)})});var fI;var Wk=E(()=>{Zk();fI=Nk});var Lk="~effect/platform/PlatformError",Po,zk,uO,Zr=(e)=>new uO(new zk(e)),wo=(e)=>new uO(new Po(e));var In=E(()=>{ma();Po=class Po extends Fr("BadArgument"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:""}`}};zk=class zk extends DE{get message(){return`${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor!==void 0?` (${this.pathOrDescriptor})`:""}${this.description?`: ${this.description}`:""}`}};uO=class uO extends Fr("PlatformError"){constructor(e){if("cause"in e)super({reason:e,cause:e.cause});else super({reason:e})}[Lk]=Lk;get message(){return this.reason.message}}});var Xk,jk;var Vk=E(()=>{Dt();Xk=Ef,jk=Yb});var Bk;var Gk=E(()=>{Dt();Bk=ok});var Yk="~effect/MutableRef",hI,Hk=(e)=>{let t=Object.create(hI);return t.current=e,t};var Jk=E(()=>{es();ct();hI={[Yk]:Yk,...Jt,toJSON(){return{_id:"MutableRef",current:bn(this.current)}}}});var OI,eP=()=>({head:void 0,tail:void 0,length:0}),Kk=()=>({array:[],mutable:!0,offset:0,next:void 0}),To=(e,t)=>{if(!e.tail)e.head=e.tail=Kk();else if(!e.tail.mutable)e.tail.next=Kk(),e.tail=e.tail.next;e.tail.array.push(t),e.length++},_a=(e)=>{e.head=e.tail=void 0,e.length=0},tP=(e,t)=>{if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let s=e.head.array;return _a(e),s}let r=Array(t),n=0,o=e.head;while(o){while(o.offset<o.array.length){if(r[n++]=o.array[o.offset],o.mutable)o.array[o.offset]=void 0;if(o.offset++,n===t){if(e.head=o,e.length-=t,e.length===0)_a(e);return r}}o=o.next}return _a(e),r},$a=(e)=>{if(!e.head)return OI;let t=e.head.array[e.head.offset];if(e.head.mutable)e.head.array[e.head.offset]=void 0;if(e.head.offset++,e.length--,e.head.offset===e.head.array.length)if(e.head.next)e.head=e.head.next;else _a(e);return t};var rP=E(()=>{OI=Symbol.for("effect/MutableList/Empty")});var xI="~effect/Queue",yI="~effect/Queue/Enqueue",SI="~effect/Queue/Dequeue",fO,EI,Ra=(e)=>le((t)=>{let r=Object.create(EI);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??Number.POSITIVE_INFINITY,r.strategy=e?.strategy??"suspend",r.messages=eP(),r.scheduleRunning=!1,r.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},se(r)}),nP=(e)=>Ra({capacity:e}),yl=(e,t)=>Se(()=>{if(e.state._tag!=="Open")return nd;else if(e.messages.length>=e.capacity)switch(e.strategy){case"dropping":return nd;case"suspend":if(e.capacity<=0&&e.state.takers.size>0)return To(e.messages,t),pO(e),rd;return TI(e,t);case"sliding":return $a(e.messages),To(e.messages,t),rd}return To(e.messages,t),cP(e),rd}),Sl=(e,t)=>{if(e.state._tag!=="Open")return!1;else if(e.messages.length>=e.capacity){if(e.strategy==="sliding")return $a(e.messages),To(e.messages,t),!0;else if(e.capacity<=0&&e.state.takers.size>0)return To(e.messages,t),pO(e),!0;return!1}return To(e.messages,t),cP(e),!0},El,bl=(e,t)=>{if(e.state._tag!=="Open")return!1;let r=Kt(t),n=Cb(r,kI);if(e.state.offers.size===0&&e.messages.length===0)return hO(e,n),!0;return e.state={...e.state,_tag:"Closing",exit:n},!0},vo=(e)=>bl(e,Mc(ca())),dO=(e)=>ve(()=>{if(e.state._tag==="Done")return!0;_a(e.messages);let t=e.state.offers;if(hO(e,e.state._tag==="Open"?PI:e.state.exit),t.size>0){for(let r of t)if(r._tag==="Single")r.resume(nd);else r.resume(Ne(r.remaining.slice(r.offset)));t.clear()}return!0}),oP=(e)=>sP(e,1,Number.POSITIVE_INFINITY),sP=(e,t,r)=>Se(()=>wI(e,t,r)??cs(lP(e),sP(e,1,r))),Co=(e)=>Se(()=>aP(e)??cs(lP(e),Co(e))),iP=(e)=>Se(()=>{let t=aP(e);if(t===void 0)return se(L());if(t._tag==="Success")return se(ee(t.value));return se(L())}),aP=(e)=>{if(e.state._tag==="Done")return e.state.exit;if(e.messages.length>0){let t=$a(e.messages);return Aa(e),Ne(t)}else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Aa(e),e.capacity=0;let t=$a(e.messages);return Aa(e),Ne(t)}return},bI=(e)=>e.state._tag==="Done"?0:e.messages.length,nd,rd,kI,PI,pO=(e)=>{if(e.scheduleRunning=!1,e.state._tag==="Done"||e.state.takers.size===0)return;for(let t of e.state.takers)if(e.state.takers.delete(t),t(fr),e.messages.length===0)break},cP=(e)=>{if(e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0)return;e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>pO(e),0)},wI=(e,t,r)=>{if(e.state._tag==="Done")return e.state.exit;else if(r<=0||t<=0)return Ne([]);else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Aa(e),e.capacity=0;let n=[$a(e.messages)];return Aa(e),Ne(n)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let n=tP(e.messages,r);return Aa(e),Ne(n)}},TI=(e,t)=>zt((r)=>{if(e.state._tag!=="Open")return r(nd);let n={_tag:"Single",message:t,resume:r};return e.state.offers.add(n),ve(()=>{if(e.state._tag==="Open")e.state.offers.delete(n)})}),Aa=(e)=>{if(e.state._tag==="Done")return fl(e.state.exit.cause);else if(e.state.offers.size===0){if(e.state._tag==="Closing"&&e.messages.length===0)return hO(e,e.state.exit),fl(e.state.exit.cause);return!1}let t=e.capacity-e.messages.length;for(let r of e.state.offers)if(t===0)break;else if(r._tag==="Single")To(e.messages,r.message),t--,r.resume(rd),e.state.offers.delete(r);else{for(;r.offset<r.remaining.length;r.offset++){if(t===0)return!1;To(e.messages,r.remaining[r.offset]),t--}r.resume(Ne([])),e.state.offers.delete(r)}return!1},lP=(e)=>zt((t)=>{if(e.state._tag==="Done")return t(e.state.exit);return e.state.takers.add(t),ve(()=>{if(e.state._tag!=="Done")e.state.takers.delete(t)})}),hO=(e,t)=>{if(e.state._tag==="Done")return;let r=e.state;e.state={_tag:"Done",exit:t};for(let n of r.takers)n(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()};var kl=E(()=>{oe();ct();ct();Dt();rP();ze();dl();fO={_A:B,_E:B},EI={[xI]:fO,[yI]:fO,[SI]:fO,...Jt,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:bI(this)}}},El=v(2,(e,t)=>ve(()=>bl(e,t))),nd=Ne(!1),rd=Ne(!0),kI=kn(ca()),PI=Sm()});class dP{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=Se(()=>{if(this.free<e)return uP(this,e,t);return this.taken+=e,se(e)});return t}takeIfAvailable(e){return Se(()=>{if(this.free<e)return se(!1);return this.taken+=e,se(!0)})}releaseUnsafe(e,t){if(this.taken-=t,this.waiters.size>0)e.currentDispatcher.scheduleTask(()=>{for(let r of this.waiters){if(this.free<=0)break;r()}},0);return this.free}resize(e){return le((t)=>{if(this.permits=e,this.free<0)return $e;return this.releaseUnsafe(t,0),$e})}release(e){return le((t)=>se(this.releaseUnsafe(t,e)))}get releaseAll(){return le((e)=>se(this.releaseUnsafe(e,this.taken)))}withPermits(e){return(t)=>ds((r)=>{let n=Se(()=>{if(this.free<e){let o=uP(this,e,$e);return ge(r(o),()=>n)}return this.taken+=e,ii(r(t),()=>{this.releaseUnsafe(ya(),e);return},!0)});return n})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return(t)=>ds((r)=>{if(this.free<e)return kf;return this.taken+=e,ii(r(xm(t)),()=>{this.releaseUnsafe(ya(),e);return},!0)})}}var fP=(e)=>new dP(e),uP=(e,t,r)=>zt((n)=>{if(e.free>=t)return n(r);let o=()=>{if(e.free<t)return;e.waiters.delete(o),n(r)};return e.waiters.add(o),ve(()=>{e.waiters.delete(o)})});var pP=E(()=>{ct();Dt()});var gP="~effect/Channel",hP=(e)=>G(e,gP),II,jt=(e)=>{let t=Object.create(II);return t.transform=(r,n)=>wr(e(r,n),(o)=>T(pl(o))),t},xP=(e,t)=>jt((r,n)=>H(un(e)(r,n),(o)=>t(o,n))),sd=(e)=>jt((t,r)=>e),yP=(e)=>jt(z(function*(t,r){let n=hs(r),o=(i)=>Pr(n,Km(i)),s=yield*ml(e(t,r,n),o);return ml(s,o)})),un=(e)=>e.transform,FI=(e,t,r)=>Ra({capacity:r?.bufferSize,strategy:r?.strategy}).pipe(Xf((n)=>cl(e,dO(n))),Xf((n)=>Ol(al(t(n),e),e))),SP=(e,t)=>jt((r,n)=>K(FI(n,e,t),oP)),EP=(e)=>jt((t,r)=>Ee(()=>un(e())(t,r))),bP,kP,mO,UI,PP,wP=()=>jt((e,t)=>ne(()=>{let r="",n=!1,o=L();function s(c){let l=[];function u(f){if(r.length===0)l.push(f);else l.push(r+f),r=""}for(let f=0;f<c.length;f++){let d=c[f];if(d.length!==0){let h=0,m=d.indexOf("\r"),b=d.indexOf(`
|
|
25
|
+
`);if(n){if(b===0)u(""),h=1,b=d.indexOf(`
|
|
26
|
+
`,h);else u("");n=!1}while(m!==-1||b!==-1)if(m===-1||b!==-1&&b<m)u(d.substring(h,b)),h=b+1,b=d.indexOf(`
|
|
27
|
+
`,h);else if(d.length===m+1)n=!0,m=-1;else u(d.substring(h,m)),h=m+(b===m+1?2:1),m=d.indexOf("\r",h),b=d.indexOf(`
|
|
28
|
+
`,h);r=r+d.substring(h,d.length-(n?1:0))}}return Qn(l)?l:null}let i=Ee(()=>{if(o._tag==="Some")return Mt(o.value);return wk(e,{onSuccess:a,onFailure:pl,onDone:(c)=>{if(o=ee(c),r.length>0||n){let l=r;return r="",n=!1,T([l])}return Mt(c)}})});function a(c){let l=s(c);return l!==null?T(l):i}return i})),TP,id=(e)=>jt((t,r)=>{let n;return T(Ee(()=>{if(n)return n;return e.pipe(al(r),H((o)=>un(o)(t,r)),H((o)=>n=o))}))}),DI=(e,t,r)=>Ee(()=>{let n=Ea(),o=un(e)(Mt(),n);return $n(H(o,t),r?r:T).pipe(Ca((s)=>Pr(n,s)))}),OO,gO=(e,t)=>un(e)(Mt(),t);var Pl=E(()=>{_n();tr();ae();oe();ze();It();ye();dl();kl();ll();II={[gP]:{_Env:B,_InErr:B,_InElem:B,_OutErr:B,_OutElem:B},pipe(){return pe(this,arguments)}},bP=sd(T(Mt())),kP=v(2,(e,t)=>xP(e,(r)=>ne(()=>{let n=0;return K(r,(o)=>t(o,n++))}))),mO=v(2,(e,t)=>UI(e,(r)=>T(t(r)))),UI=v(2,(e,t)=>xP(e,(r)=>T($n(r,(n)=>H(t(n),Mt))))),PP=v((e)=>hP(e[0])&&hP(e[1]),(e,t,r)=>yP(z(function*(n,o,s){let i=r?.haltStrategy??"both",a=yield*nP(0);yield*cl(s,dO(a));let c=0;function l(f,d){if(c++,!fl(d))return El(a,d);switch(i){case"both":return c===2?El(a,d):ue;case"left":case"right":return f===i?El(a,d):ue;case"either":return El(a,d)}}let u=(f,d,h)=>un(d)(n,h).pipe(H((m)=>m.pipe(H((b)=>yl(a,b)),ko)),ml((m)=>an(Pr(h,Km(m)),l(f,m))),Ol(s));return yield*u("left",e,hs(s)),yield*u("right",t,hs(s)),Co(a)}))),TP=v(2,(e,t)=>jt((r,n)=>H(un(e)(r,n),(o)=>un(t)(o,n)))),OO=v(3,(e,t,r)=>Ee(()=>{let n=t();return DI(e,(o)=>Lf({while:no,body:()=>o,step:(s)=>{n=r(n,s)}}),()=>T(n))}))});var MI="~effect/Stream",NI,ZI,vP=(e)=>{let t=Object.create(ZI);return t.channel=e,t};var CP=E(()=>{oe();It();NI={_R:B,_E:B,_A:B},ZI={[MI]:NI,pipe(){return pe(this,arguments)}}});var QP="~effect/Sink",_P,WI,LI,wl=(e)=>G(e,QP),xO=(e)=>yO((t,r)=>un(e)(t,r).pipe(H(ko({disableYield:!0})),$n(T))),yO=(e)=>{let t=Object.create(LI);return t.transform=e,t},zI=(e)=>jt((t,r)=>T(H(e.transform(t,r),Mt))),Tl,$P=(e)=>XI(ka((t)=>e(t),{discard:!0})),XI=(e)=>yO((t)=>t.pipe(H(e),ko({disableYield:!0}),$n(()=>_P))),AP=(e)=>xO(id(K(e,zI)));var cd=E(()=>{tr();Pl();ae();oe();It();ye();dl();_P=T([void 0]),WI={_A:B,_In:B,_L:B,_E:B,_R:B},LI={[QP]:WI,pipe(){return pe(this,arguments)}},Tl=yO((e)=>$n(ko(e,{disableYield:!0}),()=>_P))});var jI="~effect/RcRef",EO,VI,BI,RP,IP=(e)=>eO((t)=>{let r=t.context,n=ss(r,il),o=new RP(e.acquire,r,n,e.idleTimeToLive?ha(e.idleTimeToLive):void 0);return Nr(Mf(n,()=>{let s=o.state._tag==="Acquired"?Pr(o.state.scope,Ur):ue;return o.state=VI,s}),o)}),GI=(e)=>oO(function t(r){switch(e.state._tag){case"Closed":return Yf;case"Acquired":return e.state.refCount++,e.state.fiber?Nr(Xk(e.state.fiber),e.state):T(e.state);case"Empty":{let n=Ea();return e.semaphore.withPermit(Ee(()=>{if(e.state._tag!=="Empty")return t(r);return r(ys(e.acquire,mo(e.context,il,n))).pipe(K((o)=>{let s={_tag:"Acquired",value:o,scope:n,fiber:void 0,refCount:1,invalidated:!1};return e.state=s,s}),Ca((o)=>ui(o)?Pr(n,o):ue))}))}}}),FP;var UP=E(()=>{lt();Yh();ae();Mr();Vk();oe();It();ll();pP();EO={_tag:"Empty"},VI={_tag:"Closed"},BI={_A:B,_E:B};RP=class RP{[jI]=BI;pipe(){return pe(this,arguments)}state=EO;semaphore=fP(1);acquire;context;scope;idleTimeToLive;constructor(e,t,r,n){this.acquire=e,this.context=t,this.scope=r,this.idleTimeToLive=n}};FP=z(function*(e){let t=e,r=yield*GI(t),n=yield*Gf,o=t.idleTimeToLive!==void 0&&vE(t.idleTimeToLive);return yield*Mf(n,()=>{if(r.refCount--,r.refCount>0)return ue;if(t.idleTimeToLive===void 0)return t.state=EO,Pr(r.scope,Ur);else if(r.invalidated)return Pr(r.scope,Ur);else if(!o)return ue;return r.fiber=tO(t.idleTimeToLive).pipe(H(()=>{if(t.state._tag==="Acquired"&&t.state.refCount===0)return t.state=EO,Pr(r.scope,Ur);return ue}),hl(ne(()=>{r.fiber=void 0})),Jf(t.context),jk(t.scope)),ue}),r.value})});var DP,bO;var MP=E(()=>{UP();DP=IP,bO=FP});var JI="~effect/Stream",gi=(e)=>G(e,JI),fn,NP=(e)=>fn(sd(e)),KI=(e,t)=>fn(jt((r,n)=>H(gO(e.channel,n),(o)=>t(o,n)))),kO=(e)=>e.channel,ZP=(e,t)=>fn(SP(e,t)),Ia,qP=(e)=>fn(EP(()=>e().channel)),Es=(e)=>fn(id(K(e,kO))),eF,WP,ld,LP,zP=(e)=>e.channel.pipe(TP(wP()),fn),PO,XP=(e)=>OO(e.channel,()=>[],(t,r)=>{for(let n=0;n<r.length;n++)t.push(r[n]);return t}),jP=(e)=>OO(e.channel,()=>"",(t,r)=>t+r.join(""));var Fa=E(()=>{_n();tr();Pl();ae();Mr();oe();CP();ye();fn=vP,Ia=fn(bP),eF=v(2,(e,t)=>qP(()=>{let r=0;return fn(kP(e.channel,Sr((n)=>t(n,r++))))})),WP=v((e)=>gi(e[0])&&gi(e[1]),(e,t,r)=>fn(PP(kO(e),kO(t),r))),ld=v(2,(e,t)=>KI(e,(r,n)=>ne(()=>{let o,s,i=Ee(()=>{if(s!==void 0){let c=s;return s=void 0,T(c)}return r}).pipe(bo((c)=>(o=sn(c),Mt()))),a=K(Ee(()=>t.transform(i,n)),([c,l])=>(s=l,ri(c)));return Ee(()=>o?o:a)}))),LP=v((e)=>gi(e[0]),(e,t)=>qP(()=>{let r=new TextDecoder(t?.encoding);return eF(e,(n)=>r.decode(n,{stream:!0}))})),PO=v(2,(e,t)=>Uk((r)=>gO(e.channel,r).pipe(H((n)=>t.transform(n,r)),K(([n])=>n))))});var VP="~effect/platform/FileSystem",Qo=(e)=>typeof e==="bigint"?e:BigInt(e),Cl,Z3,Ql,BP=(e)=>Ql.of({...e,[VP]:VP,exists:(t)=>Ho(e.access(t),Nr(!0),wa("PlatformError",(r)=>r.reason._tag==="NotFound"?T(!1):N(r))),readFileString:(t,r)=>H(e.readFile(t),(n)=>xt({try:()=>new TextDecoder(r).decode(n),catch:(o)=>wo({module:"FileSystem",method:"readFileString",description:"invalid encoding",cause:o})})),stream:z(function*(t,r){let n=yield*e.open(t,{flag:"r"});if(r?.offset)yield*n.seek(r.offset,"start");let o=r?.bytesToRead!==void 0?Qo(r.bytesToRead):void 0,s=BigInt(0),i=Qo(r?.chunkSize??65536),a=n.readAlloc(i);return NP(T(H(Ee(()=>{if(o!==void 0&&o<=s)return Mt();return o!==void 0&&o-s<i?n.readAlloc(o-s):a}),er({onNone:()=>Mt(),onSome:(c)=>(s+=BigInt(c.length),T(ri(c)))}))))},Es),sink:(t,r)=>Ho(e.open(t,{flag:"w",...r}),K((n)=>$P((o)=>n.writeAll(o))),AP),writeFileString:(t,r,n)=>H(xt({try:()=>new TextEncoder().encode(r),catch:(o)=>wo({module:"FileSystem",method:"writeFileString",description:"could not encode string",cause:o})}),(o)=>e.writeFile(t,o,n))}),ud="~effect/platform/FileSystem/File",wO;var TO=E(()=>{_n();tr();lt();ae();oe();ze();In();cd();Fa();Cl=BigInt(1024),Z3=Cl*Cl*Cl*Cl*Cl,Ql=rt("effect/platform/FileSystem");wO=class wO extends rt()("effect/platform/FileSystem/WatchBackend"){}});function YP(e,t){let r="",n=0,o=-1,s=0,i;for(let a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else if(i===47)break;else i=47;if(i===47){if(o===a-1||s===1);else if(o!==a-1&&s===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){let c=r.lastIndexOf("/");if(c!==r.length-1){if(c===-1)r="",n=0;else r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/");o=a,s=0;continue}}else if(r.length===2||r.length===1){r="",n=0,o=a,s=0;continue}}if(t){if(r.length>0)r+="/..";else r="..";n=2}}else{if(r.length>0)r+="/"+e.slice(o+1,a);else r=e.slice(o+1,a);n=a-o-1}o=a,s=0}else if(i===46&&s!==-1)++s;else s=-1}return r}function tF(e,t){let r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");if(!r)return n;if(r===t.root)return r+n;return r+e+n}function rF(e){if(e.protocol!=="file:")return N(new Po({module:"Path",method:"fromFileUrl",description:"URL must be of scheme file"}));else if(e.hostname!=="")return N(new Po({module:"Path",method:"fromFileUrl",description:"Invalid file URL host"}));let t=e.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let n=t.codePointAt(r+2)|32;if(t[r+1]==="2"&&n===102)return N(new Po({module:"Path",method:"fromFileUrl",description:"must not include encoded / characters"}))}return T(decodeURIComponent(t))}function oF(e){let t=new URL("file://"),r=HP(e);if(e.charCodeAt(e.length-1)===nF&&r[r.length-1]!=="/")r+="/";return t.pathname=uF(r),T(t)}function uF(e){if(e.includes("%"))e=e.replace(sF,"%25");if(e.includes("\\"))e=e.replace(iF,"%5C");if(e.includes(`
|
|
29
|
+
`))e=e.replace(aF,"%0A");if(e.includes("\r"))e=e.replace(cF,"%0D");if(e.includes("\t"))e=e.replace(lF,"%09");return e}var _o="~effect/platform/Path",xi,HP=function(){let t="",r=!1,n=void 0;for(let o=arguments.length-1;o>=-1&&!r;o--){let s;if(o>=0)s=arguments[o];else{let i=globalThis.process;if(n===void 0&&"process"in globalThis&&typeof i==="object"&&i!==null&&typeof i.cwd==="function")n=i.cwd();s=n}if(s.length===0)continue;t=s+"/"+t,r=s.charCodeAt(0)===47}if(t=YP(t,!r),r)if(t.length>0)return"/"+t;else return"/";else if(t.length>0)return t;else return"."},nF=47,sF,iF,aF,cF,lF,vO;var CO=E(()=>{lt();ae();oe();In();xi=rt("effect/Path");sF=/%/g,iF=/\\/g,aF=/\n/g,cF=/\r/g,lF=/\t/g;vO=xi.of({[_o]:_o,resolve:HP,normalize(e){if(e.length===0)return".";let t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;if(e=YP(e,!t),e.length===0&&!t)e=".";if(e.length>0&&r)e+="/";if(t)return"/"+e;return e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return".";let e;for(let t=0;t<arguments.length;++t){let r=arguments[t];if(r.length>0)if(e===void 0)e=r;else e+="/"+r}if(e===void 0)return".";return vO.normalize(e)},relative(e,t){if(e===t)return"";if(e=vO.resolve(e),t=vO.resolve(t),e===t)return"";let r=1;for(;r<e.length;++r)if(e.charCodeAt(r)!==47)break;let n=e.length,o=n-r,s=1;for(;s<t.length;++s)if(t.charCodeAt(s)!==47)break;let a=t.length-s,c=o<a?o:a,l=-1,u=0;for(;u<=c;++u){if(u===c){if(a>c){if(t.charCodeAt(s+u)===47)return t.slice(s+u+1);else if(u===0)return t.slice(s+u)}else if(o>c){if(e.charCodeAt(r+u)===47)l=u;else if(u===0)l=0}break}let d=e.charCodeAt(r+u),h=t.charCodeAt(s+u);if(d!==h)break;else if(d===47)l=u}let f="";for(u=r+l+1;u<=n;++u)if(u===n||e.charCodeAt(u)===47)if(f.length===0)f+="..";else f+="/..";if(f.length>0)return f+t.slice(s+l);else{if(s+=l,t.charCodeAt(s)===47)++s;return t.slice(s)}},dirname(e){if(e.length===0)return".";let t=e.charCodeAt(0),r=t===47,n=-1,o=!0;for(let s=e.length-1;s>=1;--s)if(t=e.charCodeAt(s),t===47){if(!o){n=s;break}}else o=!1;if(n===-1)return r?"/":".";if(r&&n===1)return"//";return e.slice(0,n)},basename(e,t){let r=0,n=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let i=t.length-1,a=-1;for(s=e.length-1;s>=0;--s){let c=e.charCodeAt(s);if(c===47){if(!o){r=s+1;break}}else{if(a===-1)o=!1,a=s+1;if(i>=0)if(c===t.charCodeAt(i)){if(--i===-1)n=s}else i=-1,n=a}}if(r===n)n=a;else if(n===-1)n=e.length;return e.slice(r,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){r=s+1;break}}else if(n===-1)o=!1,n=s+1;if(n===-1)return"";return e.slice(r,n)}},extname(e){let t=-1,r=0,n=-1,o=!0,s=0;for(let i=e.length-1;i>=0;--i){let a=e.charCodeAt(i);if(a===47){if(!o){r=i+1;break}continue}if(n===-1)o=!1,n=i+1;if(a===46){if(t===-1)t=i;else if(s!==1)s=1}else if(t!==-1)s=-1}if(t===-1||n===-1||s===0||s===1&&t===n-1&&t===r+1)return"";return e.slice(t,n)},format:function(t){if(t===null||typeof t!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return tF("/",t)},parse(e){let t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;let r=e.charCodeAt(0),n=r===47,o;if(n)t.root="/",o=1;else o=0;let s=-1,i=0,a=-1,c=!0,l=e.length-1,u=0;for(;l>=o;--l){if(r=e.charCodeAt(l),r===47){if(!c){i=l+1;break}continue}if(a===-1)c=!1,a=l+1;if(r===46){if(s===-1)s=l;else if(u!==1)u=1}else if(s!==-1)u=-1}if(s===-1||a===-1||u===0||u===1&&s===a-1&&s===i+1){if(a!==-1)if(i===0&&n)t.base=t.name=e.slice(1,a);else t.base=t.name=e.slice(i,a)}else{if(i===0&&n)t.name=e.slice(1,s),t.base=e.slice(1,a);else t.name=e.slice(i,s),t.base=e.slice(i,a);t.ext=e.slice(s,a)}if(i>0)t.dir=e.slice(0,i-1);else if(n)t.dir="/";return t},sep:"/",fromFileUrl:rF,toFileUrl:oF,toNamespacedPath:B})});function QO(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var _l="~structural",fd="~sentinels",dd="~constructor",pd;var hd=E(()=>{oe();pd=so((e)=>{let t=QO(e)?.identifier;if(typeof t==="string")return t;return e.getExpected(pd)})});var fe,dn,$o,kt,md=(e)=>e===fe?L():ee(e),$O=(e)=>e._tag==="None"?$o:dn(e.value);var Od=E(()=>{Mr();ze();ct();fe=Symbol(),dn=li,$o=dn(fe),kt=dn(fe)});function IO(e){return G(e,Al)&&e[Al]===Al}function dF(e){return Object.hasOwn(e,"input")}function RO(e,t,r){if(IO(e))return e;if(typeof e==="string")return new rr({message:e},t,r);let n=typeof e.issue==="string"?new rr({message:e.issue},t,r):e.issue;return new Fn(e.path,n)}function JP(e,t,r){if(e===void 0)return;if(typeof e==="boolean")return e?void 0:new rr(void 0,t,r);return RO(e,t,r)}function KP(e,t,r,n){if(Array.isArray(t)){if(!Qn(t))return;return t.length===1?RO(t[0],r,n):new Nt(e,Sr(t,(o)=>RO(o,r,n)),r,n)}return JP(t,r,n)}function gd(e){return dF(e)?he(e.input):void 0}function ew(e){let t=e.annotations?.expected;return typeof t==="string"?t:void 0}function Rl(e,t){let r=gd(t);return r===void 0?`Expected ${e}`:`Expected ${e}, got ${r}`}function tw(e){let t=e.annotations?.expected;if(typeof t==="string")return t;switch(e._tag){case"Filter":return"<filter>";case"FilterGroup":return e.checks.map((r)=>tw(r)).join(" & ")}}function mF(){return(e)=>$l(e,"")}function $l(e,t){let r;switch(e._tag){case"Filter":{let n=hF(e);if(n!==void 0)r=n;else{if(e.issue._tag!=="InvalidValue")return $l(e.issue,t);let o=ew(e.issue);r=o===void 0?Rl(tw(e.filter),e):Rl(o,e.issue)}break}case"Encoding":return $l(e.issue,t);case"Pointer":return $l(e.issue,t+wS(e.path));case"Composite":case"AnyOf":{if(e._tag==="Composite"||e.issues.length>0)return e.issues.map((n)=>$l(n,t)).join(`
|
|
30
|
+
`);r=Il(e)??Rl(pd(e.ast),e);break}default:r=pF(e);break}return t?`${r}
|
|
31
|
+
at ${t}`:r}function Il(e){if(e._tag==="Pointer")return;if(e._tag==="Encoding")return Il(e.issue);let r=(e._tag==="Filter"?e.filter.annotations:("annotations"in e)?e.annotations:e.ast.annotations)?.[e._tag==="MissingKey"?"messageMissingKey":e._tag==="UnexpectedKey"?"messageUnexpectedKey":"message"];if(typeof r==="string")return r}var Al="~effect/SchemaIssue/Issue",pn,FO,UO,Fn,Fl,xd,Nt,qr,rr,Ul,DO,pF=(e)=>{let t=Il(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return Rl(pd(e.ast),e);case"InvalidValue":{let r=ew(e);if(r!==void 0)return Rl(r,e);let n=gd(e);return n===void 0?"Expected a valid value":`Invalid data ${n}`}case"MissingKey":return"Missing key";case"UnexpectedKey":{let r=gd(e);return r===void 0?"Expected no excess property":`Unexpected key with value ${r}`}case"Forbidden":return"Forbidden operation";case"OneOf":{let r=gd(e);return r===void 0?"Expected exactly one member to match":`Expected exactly one member to match the input ${r}`}}},hF=(e)=>Il(e.issue)??Il(e),rw;var yi=E(()=>{_n();on();hd();Od();ye();pn=class pn{[Al]=Al;constructor(e,t){if(t?.reportInput===!0&&e!==fe)this.input=e}};FO=class FO extends pn{_tag="Filter";filter;issue;constructor(e,t,r,n){super(r,n);this.filter=e,this.issue=t}};UO=class UO extends pn{_tag="Encoding";ast;issue;constructor(e,t,r,n){super(r,n);this.ast=e,this.issue=t}};Fn=class Fn extends pn{_tag="Pointer";path;issue;constructor(e,t){super();this.path=e,this.issue=t}};Fl=class Fl extends pn{_tag="MissingKey";annotations;constructor(e){super();this.annotations=e}};xd=class xd extends pn{_tag="UnexpectedKey";ast;constructor(e,t,r){super(t,r);this.ast=e}};Nt=class Nt extends pn{_tag="Composite";ast;issues;constructor(e,t,r,n){super(r,n);this.ast=e,this.issues=t}};qr=class qr extends pn{_tag="InvalidType";ast;constructor(e,t,r){super(t,r);this.ast=e}};rr=class rr extends pn{_tag="InvalidValue";annotations;constructor(e,t,r){super(t,r);this.annotations=e}};Ul=class Ul extends pn{_tag="AnyOf";ast;issues;constructor(e,t,r,n){super(r,n);this.ast=e,this.issues=t}};DO=class DO extends pn{_tag="OneOf";ast;successes;constructor(e,t,r,n){super(r,n);this.ast=e,this.successes=t}};rw=mF()});function Dl(e){let t;for(let r of e.reasons){if(!Wm(r)||!IO(r.error))return;t??=r.error}return t}function Da(e,t){let r=Dl(e);if(r===void 0)throw Error(t,{cause:e});return r}var MO=E(()=>{tr();yi()});function ow(e){return e.run===sw.run}function bs(){return sw}function gF(e){return new Si((t,r)=>Lt(t)?zf:e(t.value,r))}function yt(e){return iw(fa(e))}function Ml(e){return gF((t,r)=>e(t,r).pipe(Qa(ee)))}function iw(e){return new Si((t)=>T(e(t)))}function NO(e){return new Si((t)=>{let r=KS(t,wt);return tt(r)?T(r):Qa(e,ee)})}function Nl(){return yt(globalThis.String)}function yd(){return yt(globalThis.Number)}function aw(){return yt(pf)}function cw(){return Ml((e,t)=>aO(Ck(hf(e)),()=>new rr({expected:"a valid Base64 string"},e,t)))}var Si,sw;var Sd=E(()=>{ae();Jh();ze();It();ye();yi();Si=class Si extends Tc{run;constructor(e){super();this.run=e}map(e){return new Si((t,r)=>this.run(t,r).pipe(Qa(fa(e))))}compose(e){if(ow(this))return e;if(ow(e))return this;return new Si((t,r)=>this.run(t,r).pipe(Tr((n)=>e.run(n,r))))}};sw=new Si(T)});function SF(e){return G(e,Zl)&&e[Zl]===Zl}function ql(e){return new St(Ml(e.decode),Ml(e.encode))}function Wl(e){return new St(yt(e.decode),yt(e.encode))}function Ed(){return EF}var Zl="~effect/SchemaTransformation/Transformation",St,qO=(e)=>{if(SF(e))return e;return new St(e.decode,e.encode)},EF,bd,bF=(e)=>yh(e)&&typeof e.message==="string",kF=(e)=>{let r=Object.hasOwn(e,"cause")?Error(e.message,{cause:lw(e.cause)}):Error(e.message);if(typeof e.name==="string"&&e.name!=="Error")r.name=e.name;if(typeof e.stack==="string")r.stack=e.stack;return r},PF=(e)=>{try{let t=Ys(e);return t===void 0?he(e):JSON.parse(t)}catch{return he(e)}},wF=(e,t,r)=>{let n={name:e.name,message:typeof e.message==="string"?e.message:""};if(t?.includeStack&&typeof e.stack==="string")n.stack=e.stack;if(!t?.excludeCause&&e.cause!==void 0)n.cause=r(e.cause);return n},TF=(e)=>{let t=new WeakSet,r=(n)=>{if(ES(n)){if(t.has(n))return"[Circular]";t.add(n);let o=wF(n,e,r);return t.delete(n),o}return PF(n)};return r},lw=(e)=>bF(e)?kF(e):e,uw=(e)=>Wl({decode:lw,encode:TF(e)}),fw,dw;var kd=E(()=>{ae();on();ye();Sd();yi();St=class St{[Zl]=Zl;_tag="Transformation";decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new St(this.encode,this.decode)}compose(e){return new St(this.decode.compose(e.decode),e.encode.compose(this.encode))}};EF=new St(bs(),bs());bd=new St(yd(),Nl()),fw=ql({decode:(e,t)=>URL.canParse(e)?T(new URL(e)):N(new rr({expected:"a valid URL string"},e,t)),encode:(e)=>T(e.href)}),dw=new St(cw(),aw())});function bi(e){return(t)=>t._tag===e}class vt{to;transformation;constructor(e,t){this.to=e,this.transformation=t}}class Ao{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r=void 0,n=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}}function hw(e){let t=globalThis.String(e.literal);return Tt(e,[new vt(new Un(t),new St(yt(()=>e.literal),yt(()=>t)))])}function zO(e,t){return e.some((r)=>r.annotations?.representation?.id===t||r._tag==="FilterGroup"&&zO(r.checks,t))}function XO(e,t,r=Td){let n,o;function s(i){switch(i._tag){case"String":case"TemplateLiteral":return(n??=Object.keys(e)).filter((a)=>i.matchPart(a,r)!==void 0);case"Number":return(n??=Object.keys(e)).filter((a)=>i.matchKey(a,r)!==void 0);case"Symbol":return(o??=Object.getOwnPropertySymbols(e)).filter((a)=>i.matchKey(a,r)!==void 0);case"Union":return[...new Set(i.types.flatMap(s))];default:return[]}}return s(sg(ws(t)))}class vd{name;type;constructor(e,t){this.name=e,this.type=t}}function jO(e){switch(e._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return e.types.every(jO);default:return!1}}function UF(e){return jO(e)&&jO(ws(e))}class KO{parameter;type;constructor(e,t){if(!UF(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Ps(t)&&!Xw(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}function VO(e,t,r){if(r._tag==="Failure")return Pd(e,e.ast,t.name,r);if(r===kt)return;let n=r[Y];if(n!==fe){Ar(e.out,t.name,n);return}if(delete e.out[t.name],!Ps(t.type)){let o=new Fn([t.name],new Fl(t.type.context?.annotations));if(e.options.errors==="all"){if(e.issues)e.issues.push(o);else e.issues=[o];return}else return sn(new Nt(e.ast,[o],e.input,e.options))}}function _w(e,t){if(!e)return t;if(!t)return e;return[...e,...t]}function Qd(e,t,r){return new Cd(Reflect.ownKeys(e).map((n)=>new vd(n,e[n].ast)),[],r,t)}function eg(e){return e.ast}function tg(e,t=void 0){return new Bl(!1,e.map((r)=>r.ast),[],void 0,t)}function _d(e,t,r){return new Dn(e.map(eg),t,void 0,r)}function $w(e){switch(e._tag){case"Null":return["null"];case"Undefined":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["string","number","boolean","symbol","bigint","object","array","function"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap($w)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function jl(e){switch(e._tag){default:return[];case"Declaration":{let t=e.annotations?.[fd];return Array.isArray(t)?t:[]}case"Objects":return e.propertySignatures.flatMap((t)=>{let r=t.type;if(!Ps(r)){if(Ma(r))return[{key:t.name,literal:r.literal}];if(LO(r))return[{key:t.name,literal:r.symbol}]}return[]});case"Arrays":return e.elements.flatMap((t,r)=>{if(!Ps(t)){if(Ma(t))return[{key:r,literal:t.literal}];if(LO(t))return[{key:r,literal:t.symbol}]}return[]});case"Union":{if(e.types.length===0)return[];let t=e.types.map((r)=>jl($d(r)));return t[0].filter((r)=>t.every((n)=>n.some((o)=>o.key===r.key&&o.literal===r.literal)))}case"Suspend":return jl(e.thunk())}}function DF(e){let t=Ow.get(e);if(t)return t;let r,n=0,o,s,i=!0;for(let a=0;a<e.length;a++){let c=e[a],l=$d(c);if($F(l))continue;if(i)if(Ma(l)||LO(l)){s??=new Map;let f=Ma(l)?l.literal:l.symbol,d=s.get(f);if(!d)s.set(f,d=[]);d.push(c)}else i=!1;let u=jl(l);if(u.length){r??=new Map,n++;for(let{key:f,literal:d}of u){let h=r.get(f);if(!h)r.set(f,h=[new Map,new Set]);h[1].add(a);let m=h[0].get(d);if(!m)h[0].set(d,m=new Set);m.add(a)}}else{o??={};let f=$w(l);for(let d of f)(o[d]??=[]).push(a)}}if(i&&s)s.forEach(Object.freeze),t=(a)=>s.get(a)??Ll;else if(r?.size===1&&!o){let[a,[c]]=r.entries().next().value,l=c;for(let[u,f]of c)l.set(u,Object.freeze(Array.from(f,(d)=>e[d])));t=(u,f)=>{if(Xu(u)){let d=Object.hasOwn(u,a)?u[a]:void 0;if(d!==void 0)return l.get(d)??Ll;if(f)return e}return Ll}}else if(r){let a;for(let c of r)if((!a||c[1][0].size>a[1][0].size)&&c[1][1].size===n)a=c;t=(c,l)=>{let u=c===null?"null":Array.isArray(c)?"array":typeof c,f=o?.[u]??Ll;if(!Xu(c))return f.map((m)=>e[m]);let d=new Set(f),h;if(a){let[m,[b]]=a,x=Object.hasOwn(c,m),O=x?c[m]:void 0;if(x&&(!l||O!==void 0)){let S=b.get(O);if(!S)return f.map((y)=>e[y]);for(let y of S)d.add(y);h=m}}if(h===void 0)for(let[m,[b,x]]of r){let O=Object.hasOwn(c,m),S=O?c[m]:void 0;if(O&&(!l||S!==void 0)){let y=b.get(S);if(y)for(let g of y)d.add(g)}else if(l)for(let y of x)d.add(y)}for(let[m,[b,x]]of r){if(m===h)continue;let O=Object.hasOwn(c,m),S=O?c[m]:void 0;if(O&&(!l||S!==void 0)){let y=b.get(S);for(let g of d)if(x.has(g)&&!y?.has(g))d.delete(g)}}return Array.from(d).sort((m,b)=>m-b).map((m)=>e[m])}}else t=(a)=>{let c=a===null?"null":Array.isArray(a)?"array":typeof a;return(o?.[c]??Ll).map((l)=>e[l]).filter(MF(a))};return Ow.set(e,t),t}function MF(e){return(t)=>{let r=$d(t);return r._tag==="Literal"?r.literal===e:r._tag==="UniqueSymbol"?r.symbol===e:!0}}function Aw(e,t,r=!1){return DF(t)(e,r)}function gw(e,t,r,n){let o=Dl(t);if(!o)return ps(t);return sn(new Ul(e,[o],r,n))}function xw(e){return e?"":"readonly "}function yw(e){return e?"?":""}function Ad(e,t,r=!1){return new wd((n,o,s)=>KP(o,e(n,o,s),n,s),t,r)}function Iw(e){return Ad((t)=>globalThis.Number.isFinite(t),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}function ng(e,t){let r=e.source,n=new globalThis.RegExp(r,e.flags);return Ad((o)=>(n.lastIndex=0,n.test(o)),{expected:`a string matching the RegExp ${r}`,representation:{id:"effect/schema/isPattern",payload:{source:r,flags:e.flags}},toJsonSchema:()=>({pattern:r}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function Gl(e,t){let r=Object.getOwnPropertyDescriptors(e);return t(r),Object.create(Object.getPrototypeOf(e),r)}function qF(e){return Fw.get(e)??e}function Tt(e,t){if(e.encoding===t)return e;return Gl(e,(r)=>{r.encoding.value=t})}function Rd(e,t){if(e.context===t)return e;let r=qF(e);if(r.context===t)return r;let n=Gl(e,(o)=>{o.context.value=t});return Fw.set(n,r),n}function Yl(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return Uw(e,Vh(e.checks.slice(0,-1),r.annotate(t)))}return Gl(e,(r)=>{r.annotations.value={...r.annotations.value,...t}})}function Uw(e,t){if(e._tag==="Suspend"&&t)throw Error("Cannot add checks to Suspend");if(e.checks===t)return e;return Gl(e,(r)=>{r.checks.value=t})}function Pi(e,t){return Uw(e,_w(e.checks,t))}function Id(e,t){let r=t(e.to);return r===e.to?e:new vt(r,e.transformation)}function Dw(e,t){let r=e,n=r[r.length-1],o=Id(n,t);return o===n?e:Vh(e.slice(0,e.length-1),o)}function Mw(e){return(t)=>t.encoding?Tt(t,Dw(t.encoding,e)):t}function Nw(e,t){return Mw((r)=>Rd(r,t))(e)}function Fd(e,t){function r(n){if(n.encoding){let o=n.encoding[n.encoding.length-1];return t?.stopAt?.(o)?n:Tt(n,Dw(n.encoding,r))}return e(n)}return ea(r)}function WF(e,t,r){let n=new vt(e,t);return Tt(r,r.encoding?[...r.encoding,n]:[n])}function Na(e,t){let r=!1,n=Array(e.length);for(let o=0;o<e.length;o++){let s=e[o],i=t(s);if(i!==s)r=!0;n[o]=i}return r?n:e}function Ud(e,t){let r=e.context?new Ao(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Ao(!1,!1,void 0,t);return Rd(e,r)}function qw(e,t){let r=new St(NO(t),bs()),n=new vt(zl,r),o=e.context?new Ao(e.context.isOptional,e.context.isMutable,n,e.context.annotations):new Ao(!1,!1,n);return Rd(e,o)}function Ww(e,t,r){return WF(e,r,t)}function zF(e){let t=[],r=[];function n(o){switch(o._tag){case"Literal":if(gh(o.literal))t.push(o.literal);return;case"UniqueSymbol":t.push(o.symbol);return;case"Never":return;case"Union":for(let s=0;s<o.types.length;s++)n(o.types[s]);return;default:r.push(o)}}return n(e),{literals:t,parameters:r}}function Lw(e,t){let{literals:r,parameters:n}=zF(e);return new Cd(r.map((o)=>new vd(o,t)),n.map((o)=>new KO(o,t)))}function Ps(e){return e.context?.isOptional??!1}function zw(e){return e.annotations?.[_l]===!0||e._tag==="FilterGroup"&&e.checks.every(zw)}function XF(e){function t(n){if(zw(n))return[n];return n._tag==="FilterGroup"?n.checks.flatMap(t):[]}let r=e.flatMap(t);return of(r)?r:void 0}function jF(e,t){let r=t,n=r.length,o=r[n-1],s=[new vt(ks(Tt(e,void 0)),r[0].transformation.flip())];for(let a=1;a<n;a++)s.unshift(new vt(ks(r[a-1].to),r[a].transformation.flip()));let i=ks(o.to);if(i.encoding)return Tt(i,[...i.encoding,...s]);else return Tt(i,s)}function Xw(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(Xw);default:return!1}}function og(e,t){let r=dn(t);return(n,o)=>{if(n===fe)return $o;if(n===t)return r;return N(new qr(e,n,o))}}function Hl(e,t){return(r,n)=>{if(r===fe)return $o;if(t(r))return kt;return N(new qr(e,r,n))}}function jw(e){return ng(BO,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:BO.source}),...e})}function Ts(e,t,r,n,o){for(let s=0;s<e.length;s++){let i=e[s];if(i._tag==="FilterGroup"){if(r=Ts(i.checks,t,r,n,o),r&&(o.errors!=="all"||r[r.length-1].filter.aborted))return r}else{let a=i.run(t,n,o);if(a){let c=new FO(i,a,t,o);if(r)r.push(c);else r=[c];if(o.errors!=="all"||i.aborted)return r}}}return r}function Bw(e){if(!GO(e))return;let t=e.annotations?.[dd];return io(t)?t(e.typeParameters):void 0}function JF(e){return e===null||typeof e==="string"||typeof e==="boolean"||typeof e==="number"&&globalThis.Number.isFinite(e)}function KF(e){return e===void 0||typeof e==="string"}function Gw(e,t){let r=new WeakMap,n=[];e:while(!0){if(typeof e!=="object"||e===null){if(!t(e))return!1}else{let o=e,s=r.get(o);if(s===!1)return!1;if(s===void 0){let i=Array.isArray(o);if(!i){let a=Object.getPrototypeOf(o);if(a!==null&&a!==Object.prototype&&Object.getPrototypeOf(a)!==null)return!1}r.set(o,!1),n.push({value:o,keys:i?o.length:Object.keys(o),index:0})}}while(n.length>0){let o=n[n.length-1],s=o.keys;if(typeof s==="number"){if(o.index<s){e=o.value[o.index++];continue e}}else if(o.index<s.length){e=o.value[s[o.index++]];continue e}r.set(o.value,!0),n.pop()}return!0}}function e2(e){return Gw(e,JF)}function t2(e){return Gw(e,KF)}var GO,$F,Ma,LO,Sw,AF,RF,Td,pw="~effect/Schema",Wr,ki,Ew,bw,kw,IF,YO,Pw,zl,Un,ww,Xl,Tw,HO,vw,Cw,Bl,FF,JO=(e)=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),Pd=(e,t,r,n)=>{if(n.cause.reasons.length===0)return n;let o=Dl(n.cause);if(o===void 0)return ps(ai(n.cause,(i)=>new Nt(t,[new Fn([r],i)],e.input,e.options)));let s=new Fn([r],o);if(e.options.errors==="all")if(e.issues)e.issues.push(s);else e.issues=[s];else return sn(new Nt(t,[s],e.input,e.options))},Qw="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",Cd,mw,$d,Ow,Ll,Dn,NF,Rw,wd,Vl,rg,ZF,Fw,Dd,LF,Zw,Ei,ws,ks,sg,ig,BO,VF,Vw,BF,GF,YF="-?\\d+",$H,HF="Symbol\\((.*)\\)",AH,Yw,r2,ag;var Md=E(()=>{_n();tr();ae();Mr();on();oe();Dt();hd();MO();Od();It();ye();Sd();yi();kd();GO=bi("Declaration"),$F=bi("Never"),Ma=bi("Literal"),LO=bi("UniqueSymbol"),Sw=bi("Arrays"),AF=bi("Objects"),RF=bi("Suspend");Td={};Wr=class Wr{[pw]=pw;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,r=void 0,n=void 0){this.annotations=e,this.checks=t,this.encoding=r,this.context=n}toString(){return`<${this._tag}>`}};ki=class ki extends Wr{_tag="Declaration";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,o,s,i,a){super(r,n,o,s);this.typeParameters=e,this.run=t,this.encodingChecks=i,this.encodingRun=a}getParser(){let e;return(t,r)=>{if(t===fe)return $o;return(e??=this.run(this.typeParameters))(t,this,r)}}_rebuild(e,t,r,n,o){let s=Na(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&o===this.encodingRun?this:new ki(s,n,this.annotations,t,void 0,this.context,r,o)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;if(typeof e==="string")return e;return"<Declaration>"}};Ew=class Ew extends Wr{_tag="Null";getParser(){return og(this,null)}getExpected(){return"null"}};bw=new Ew;kw=class kw extends Wr{_tag="Undefined";getParser(){return og(this,void 0)}toCodecJson(){return Tt(this,[IF])}getExpected(){return"undefined"}};IF=new vt(bw,new St(yt(()=>{return}),yt(()=>null))),YO=new kw;Pw=class Pw extends Wr{_tag="Unknown";getParser(){return Hl(this,SS)}getExpected(){return"unknown"}};zl=new Pw;Un=class Un extends Wr{_tag="Literal";literal;constructor(e,t,r,n,o){super(t,r,n,o);if(typeof e==="number"&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${he(e)}`);this.literal=e}getParser(){return og(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==="bigint"?hw(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:hw(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};ww=class ww extends Wr{_tag="String";getParser(){return Hl(this,Jo)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&Ts(r,e,void 0,this,t)?void 0:e}getExpected(){return"string"}};Xl=new ww;Tw=class Tw extends Wr{_tag="Number";getParser(){return Hl(this,Qc)}matchKey(e,t){return this._match(VF,e,t)}matchPart(e,t){return this._match(BO,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);if(r.disableChecks||!this.checks)return n;return Ts(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){if(this.checks&&(zO(this.checks,"effect/schema/isFinite")||zO(this.checks,"effect/schema/isInt")))return this;return Tt(this,[ZF])}toCodecStringTree(){if(this.toCodecJson()===this)return Tt(this,[BF]);return Tt(this,[GF])}getExpected(){return"number"}};HO=new Tw;vw=class vw extends Wr{_tag="Boolean";getParser(){return Hl(this,zu)}getExpected(){return"boolean"}};Cw=new vw;Bl=class Bl extends Wr{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,o,s,i,a){super(n,o,s,i);this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=a;let c=!1;for(let l=0;l<t.length;l++)if(Ps(t[l]))c=!0;else if(c)throw Error("A required element cannot follow an optional element. ts(1257)");if(c&&r.length>1)throw Error("A required element cannot follow an optional element. ts(1257)");for(let l=1;l<r.length;l++)if(Ps(r[l]))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(e,t=e){let r=this,n,o,s=r.elements.length,i=Math.max(0,r.rest.length-1);function a(c,l){if(l<s)return n[l];else if(l>=c)return o[l-c+1];return o[0]}return cO(function*(c,l){if(c===fe)return fe;if(!Array.isArray(c))return yield*N(new qr(r,c,l));if(!n)n=r.elements.map((m)=>({ast:m,parser:t(m)})),o=r.rest.map((m)=>({ast:m,parser:t(m)}));let u=c.length,f={ast:r,getParser:a,input:c,len:u,tailThreshold:Math.max(s,u-i),output:new globalThis.Array(u),issues:void 0,options:l},d=JO(l?.concurrency),h=FF(f,c,{concurrency:d?.concurrency,end:r.rest.length===0?s:Math.max(u,s+i)});if(h)yield*h;if(r.rest.length===0&&u>s)for(let m=s;m<=u-1;m++){let b=new xd(r,c[m],l),x=new Fn([m],b);if(l.errors==="all")if(f.issues)f.issues.push(x);else f.issues=[x];else return yield*N(new Nt(r,[x],c,l))}if(f.issues)return yield*N(new Nt(r,f.issues,c,l));return f.output})}_rebuild(e,t,r){let n=Na(this.elements,e),o=Na(this.rest,e);return n===this.elements&&o===this.rest&&t===this.checks&&r===this.encodingChecks?this:new Bl(this.isMutable,n,o,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return"array"}};FF=rl()({onItem(e,t,r){let n=r<e.len?t:fe;return e.getParser(e.tailThreshold,r).parser(n,e.options)},step(e,t,r,n){if(r._tag==="Failure")return Pd(e,e.ast,n,r);let o=r===kt?t:r[Y];if(o!==fe)e.output[n]=o;else{let s=e.getParser(e.tailThreshold,n);if(Ps(s.ast))return;let i=new Fn([n],new Fl(s.ast.context?.annotations));if(e.options.errors==="all")if(e.issues)e.issues.push(i);else e.issues=[i];else return sn(new Nt(e.ast,[i],e.input,e.options))}}});Cd=class Cd extends Wr{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,o,s,i){super(r,n,o,s);this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=i;let a=e.map((c)=>c.name).filter((c,l,u)=>u.indexOf(c)!==l);if(a.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(a)}. ts(2300)`)}getParser(e,t=e){let r=this,n=[];for(let x of r.propertySignatures)n.push(x.name);let o=n.length,s=r.indexSignatures.length,i=o&&s?new Set(n):void 0;if(!o&&!s)return Hl(r,xh);let a,c,l=(x,O,S,y,g)=>{if(g._tag==="Failure")return Pd(x,r,O,g)??Ur;let C=g===kt?y:g[Y];if(S!==fe&&C!==fe){if(o&&(i.has(O)||i.has(S)))return Ur;Ar(x.out,S,C)}return Ur},u=(x,O,S,y)=>{if(!y){let w=S.parserKey(O,x.options);if(!qe(w))return H(An(w),(_)=>u(x,O,S,_));y=w}if(y._tag==="Failure")return Pd(x,r,O,y)??Ur;let g=y===kt?O:y[Y],C=x.input[O],Q=S.parserValue(C,x.options);return qe(Q)?l(x,O,g,C,Q):H(An(Q),(w)=>l(x,O,g,C,w))},f=(x,O,S)=>{let y=x.input[O],g=S.parserValue(y,x.options);return qe(g)?l(x,O,O,y,g):H(An(g),(C)=>l(x,O,O,y,C))},d=s?rl()({onItem:(x,[O,S])=>u(x,O,S),step:(x,O,S)=>S._tag==="Failure"?S:void 0}):void 0,h=()=>{if(!a)a=r.propertySignatures.map((x)=>({parser:t(x.type),name:x.name,type:x.type})),c=s?r.indexSignatures.map((x)=>({is:x,parserKey:e(sg(x.parameter)),parserValue:t(x.type)})):void 0;return a},m=cO(function*(x,O){if(x===fe)return fe;if(!(typeof x==="object"&&x!==null&&!Array.isArray(x)))return yield*N(new qr(r,x,O));h();let S=x,y={},g={ast:r,input:S,out:y,issues:void 0,options:O},C=O.errors==="all",Q=O.onExcessProperty==="error",w=O.onExcessProperty==="preserve",_;if(!s&&(Q||w)){i??=new Set(n),_=Reflect.ownKeys(S);for(let F=0;F<_.length;F++){let R=_[F];if(!i.has(R))if(Q){let A=new xd(r,S[R],O),M=new Fn([R],A);if(C){if(g.issues)g.issues.push(M);else g.issues=[M];continue}else return yield*N(new Nt(r,[M],x,O))}else Ar(y,R,S[R])}}let I=JO(O?.concurrency);if(o){let F=mw(g,a,I);if(F)yield*F}if(s&&!I)for(let F=0;F<s;F++){let R=c[F],A=R.is.parameter===Xl?f:u,M=R.is.parameter===Xl?Object.keys(S):XO(S,R.is.parameter,O);for(let j=0;j<M.length;j++){let me=A(g,M[j],R);if(!qe(me))yield*me;else if(me._tag==="Failure")return yield*me}}else if(d){let F=ti();for(let A=0;A<s;A++){let M=c[A],j=XO(S,M.is.parameter,O);for(let me=0;me<j.length;me++)F.push([j[me],M])}let R=d(g,F,I);if(R)yield*R}if(g.issues)return yield*N(new Nt(r,g.issues,x,O));if(O.propertyOrder==="original"){let F=(_??Reflect.ownKeys(S)).concat(n),R={};for(let A of F)if(Object.hasOwn(y,A))Ar(R,A,y[A]);return R}return y});if(s)return m;let b=(x,O,S)=>{let y=a[O];return H(An(S),(g)=>{let C=VO(x,y,g);if(C)return C;let Q=()=>dn(x.out),w=mw(x,a.slice(O+1));return w?Tr(w,Q):Q()})};return(x,O)=>{if(x===fe)return $o;if(O.errors==="all"||O.onExcessProperty!==void 0||O.propertyOrder==="original"||O.concurrency!==void 0)return m(x,O);if(!(typeof x==="object"&&x!==null&&!Array.isArray(x)))return N(new qr(r,x,O));let S=h(),y=x,g={},C={ast:r,input:y,out:g,issues:void 0,options:O};try{for(let Q=0;Q<S.length;Q++){let w=S[Q],_=w.name,I=Object.hasOwn(y,_),F=I?y[_]:fe,R=w.parser(F,O);if(!qe(R))return b(C,Q,R);if(R===kt){if(I)Ar(g,_,F);continue}let A=VO(C,w,R);if(A)return A}}catch(Q){return xs(Q)}return dn(g)}}_rebuild(e,t,r,n){let o=Na(this.propertySignatures,(i)=>{let a=e(i.type);return a===i.type?i:new vd(i.name,a)}),s=Na(this.indexSignatures,(i)=>{let a=t(i.parameter),c=e(i.type);return a===i.parameter&&c===i.type?i:new KO(a,c)});return o===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new Cd(o,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}};mw=rl()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(fe,e.options);let r=e.input[t.name];return Ar(e.out,t.name,r),t.parser(r,e.options)},step:VO});$d=ea((e)=>{while(!0){if(RF(e))return zl;let t=e.encoding;if(!t)return e.recur?.($d,B)??e;if(t.some((r)=>r.transformation._tag==="Middleware"&&r.transformation.decode!==B))return zl;e=t[t.length-1].to}});Ow=new WeakMap,Ll=Object.freeze([]);Dn=class Dn extends Wr{_tag="Union";types;mode;encodingChecks;constructor(e,t,r,n,o,s,i){super(r,n,o,s);this.types=e,this.mode=t,this.encodingChecks=i}getParser(e,t){let r=this;return(n,o)=>{if(n===fe)return $o;let s=Aw(n,r.types,t!==void 0);if(s.length===1){let l=e(s[0])(n,o);if(l._tag==="Success")return l;return qe(l)?gw(r,l.cause,n,o):wr(l,(u)=>gw(r,u,n,o))}let i={ast:r,compile:e,input:n,out:void 0,successes:r.mode==="oneOf"?[]:void 0,issues:void 0,options:o},a=JO(o?.concurrency),c=NF(i,s,a?{...a,orderedStep:!0}:void 0);if(!c){if(i.out)return i.out;return N(new Ul(r,i.issues??[],n,o))}return Tr(c,(l)=>{if(i.out===kt)return T(n);if(i.out)return i.out;return N(new Ul(r,i.issues??[],n,o))})}}_rebuild(e,t,r){let n=Na(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new Dn(n,this.mode,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(n!==void 0)return n}return}getExpected(e){let t=this.annotations?.expected;if(typeof t==="string")return t;if(this.types.length===0)return"never";let r=this.types.map((n)=>{let o=ws(n);switch(o._tag){case"Arrays":{let s=o.elements.filter(Ma);if(s.length>0)return`${xw(o.isMutable)}[ ${s.map((i)=>e(i)+yw(i.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let s=o.propertySignatures.filter((i)=>Ma(i.type));if(s.length>0)return`{ ${s.map((i)=>`${xw(i.type.context?.isMutable)}${sa(i.name)}${yw(i.type.context?.isOptional)}: ${e(i.type)}`).join(", ")}, ... }`;break}}return e(o)});return Array.from(new Set(r)).join(" | ")}};NF=rl()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,r){if(r._tag==="Failure"){let n=Dl(r.cause);if(n===void 0)return r;if(e.issues)e.issues.push(n);else e.issues=[n]}else{if(e.out&&e.successes)return e.successes.push(t),sn(new DO(e.ast,e.successes,e.input,e.options));if(e.out=r,e.successes)e.successes.push(t);else return Ur}}}),Rw=new Dn([new Un("Infinity"),new Un("-Infinity"),new Un("NaN")],"anyOf");wd=class wd extends Tc{_tag="Filter";run;annotations;aborted;constructor(e,t=void 0,r=!1){super();this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new wd(this.run,{...this.annotations,...e},this.aborted)}abort(){return new wd(this.run,this.annotations,!0)}and(e,t){return new Vl([this,e],t)}};Vl=class Vl extends Tc{_tag="FilterGroup";checks;annotations;constructor(e,t=void 0){super();this.checks=e,this.annotations=t}annotate(e){return new Vl(this.checks,{...this.annotations,...e})}and(e,t){return new Vl([this,e],t)}};rg=Pi(HO,[Iw()]),ZF=new vt(new Dn([rg,Rw],"anyOf"),new St(yd(),yt((e)=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));Fw=new WeakMap;Dd=ea((e)=>{let t=e.context?e.context.isOptional===!1?new Ao(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Ao(!0,!1);return LF(Rd(e,t))}),LF=Mw(Dd),Zw=so((e)=>Dd(new Dn([e,YO],"anyOf")));Ei=ea((e)=>{if(e.encoding)return Ei(Tt(e,void 0));let t=e,r=t.recur?.(Ei)??t,n=r.encodingChecks;if(n){let o=r===e?n:Sw(r)||AF(r)||GO(r)&&r.typeParameters.length>0?XF(n):void 0;return Gl(r,(s)=>{s.encodingChecks.value=void 0,s.checks.value=_w(r.checks,o)})}return r}),ws=ea((e)=>Ei(ks(e)));ks=so((e)=>{if(e.encoding)return jF(e,e.encoding);let t=e;return t.flip?.(ks)??t.recur?.(ks)??t});sg=Fd((e)=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(sg)}}),ig=Fd((e)=>{switch(e._tag){default:return e;case"Symbol":case"UniqueSymbol":return e.toCodecStringTree();case"Union":return e.recur(ig)}}),BO=new globalThis.RegExp(`^${Qw}$`),VF=new globalThis.RegExp(`^(?:${Qw}|Infinity|-Infinity|NaN)$`);Vw=Pi(Xl,[jw()]),BF=new vt(Vw,bd),GF=new vt(new Dn([Vw,Rw],"anyOf"),bd),$H=new globalThis.RegExp(`^${YF}$`),AH=new globalThis.RegExp(`^${HF}$`);Yw=new ki([],()=>(e,t,r)=>e2(e)?kt:N(new qr(t,e,r)),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>{return},toCodecStringTree:()=>ag,toArbitrary:()=>(e)=>e.jsonValue()});r2=new ki([],()=>(e,t,r)=>t2(e)?kt:N(new qr(t,e,r)),{expected:"StringTree",toCodecStringTree:()=>{return}}),ag=new vt(r2,Ed())});function lg(){return Object.assign((e)=>e,{option:(e)=>ee(e),result:(e)=>gt(e),is:(e)=>!0})}var Hw=E(()=>{ze();Oo()});var Kw,eT,Jw="~effect/ChildProcessSpawner/ChildProcessHandle",o2,ug=(e)=>Object.setPrototypeOf({...e},o2),tT=(e)=>{let t=(n,o)=>e(n).pipe(K((s)=>LP(o?.includeStderr===!0?s.all:s.stdout)),Es),r=(n,o)=>zP(t(n,o));return Za.of({spawn:e,exitCode:(n)=>mi(H(e(n),(o)=>o.exitCode)),streamString:t,streamLines:r,lines:(n,o)=>XP(r(n,o)),string:(n,o)=>jP(t(n,o))})},Za;var fg=E(()=>{Hw();lt();ae();es();Fa();Kw=lg(),eT=lg(),o2={[Jw]:Jw,...CS,toJSON(){return{_id:"ChildProcessHandle",pid:this.pid}}};Za=class Za extends rt()("effect/process/ChildProcessSpawner"){}});var rT="~effect/unstable/process/ChildProcess",s2,Nd=(e,t,r)=>Object.assign(Object.create(s2),{_tag:"StandardCommand",command:e,args:t,options:r}),Zd=function(...t){if(nT(t[0])){let[s,...i]=t,a=oT(s,i);return Nd(a[0]??"",a.slice(1),{})}if(typeof t[0]==="object"&&!Array.isArray(t[0])&&!nT(t[0])){let s=t[0];return function(i,...a){let c=oT(i,a);return Nd(c[0]??"",c.slice(1),s)}}if(typeof t[0]==="string"&&!Array.isArray(t[1])){let[s,i={}]=t;return Nd(s,[],i)}let[r,n=[],o={}]=t;return Nd(r,n,o)},nT=(e)=>Array.isArray(e)&&("raw"in e)&&Array.isArray(e.raw),qd=(e)=>{let t=/^fd(\d+)$/.exec(e);if(t===null)return;let r=parseInt(t[1],10);return r>=3?r:void 0},cT=(e)=>`fd${e}`,oT=(e,t)=>{let r=[];for(let[n,o]of e.entries())r=i2(e,t,r,o,n);return r},i2=(e,t,r,n,o)=>{let s=e.raw[o];if(s===void 0)throw Error(`Invalid backslash sequence: ${e.raw[o]}`);let{hasLeadingWhitespace:i,hasTrailingWhitespace:a,tokens:c}=c2(n,s),l=aT(r,c,i);if(o===t.length)return l;let u=t[o],f=Array.isArray(u)?u.map((d)=>sT(d)):[sT(u)];return aT(l,f,a)},sT=(e)=>{if(typeof e==="string")return e;return String(e)},iT,a2,c2=(e,t)=>{if(t.length===0)return{tokens:[],hasLeadingWhitespace:!1,hasTrailingWhitespace:!1};let r=iT.has(t[0]),n=[],o=0;for(let i=0,a=0;i<e.length;i+=1,a+=1){let c=t[a];if(iT.has(c)){if(o!==i)n.push(e.slice(o,i));o=i+1}else if(c==="\\"){let l=t[a+1];if(l===`
|
|
32
|
+
`)i-=1,a+=1;else if(l==="u"&&t[a+2]==="{")a=t.indexOf("}",a+3);else a+=a2[l]??1}}let s=o===e.length;if(!s)n.push(e.slice(o));return{tokens:n,hasLeadingWhitespace:r,hasTrailingWhitespace:s}},aT=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t.at(0)}`,...t.slice(1)];var lT=E(()=>{lt();la();fg();s2={...Pn({label:"Command",evaluate(e){return zc(e.context,Za).spawn(this)}}),[rT]:rT},iT=new Set([" ","\t","\r",`
|
|
33
|
+
`]),a2={x:3,u:5}});var uT=(e,t,r)=>{let n=e.detached??r!=="win32";return{...t,detached:n,shell:e.shell,windowsHide:e.windowsHide??!n}};var be=(e,t)=>(r,[n])=>{let o="Unknown";switch(r.code){case"ENOENT":o="NotFound";break;case"EACCES":o="PermissionDenied";break;case"EEXIST":o="AlreadyExists";break;case"EISDIR":o="BadResource";break;case"ENOTDIR":o="BadResource";break;case"EBUSY":o="Busy";break;case"ELOOP":o="BadResource";break}return Zr({_tag:o,module:e,method:t,pathOrDescriptor:n,syscall:r.syscall,cause:r})};var dg=E(()=>{In()});var qa=(e)=>xO(mO(u2(e),(t)=>[t])),u2=(e)=>jt((t)=>{let r=e.evaluate();return T(f2({...e,writable:r,pull:t}))}),f2=(e)=>e.pull.pipe(H((t)=>{let r=0;return dr(function n(o){for(;r<t.length;)if(!e.writable.write(t[r++],e.encoding)){e.writable.once("drain",()=>n(o));return}o(ue)})}),ko({disableYield:!0}),Ta(dr((t)=>{let r=(n)=>t(N(e.onError(n)));return e.writable.once("error",r),ne(()=>{e.writable.off("error",r)})})),e.endOnDone!==!1?$n((t)=>{if("closed"in e.writable&&e.writable.closed)return Mt(t);return dr((r)=>{e.writable.once("finish",()=>r(Mt(t))),e.writable.end()})}):B);var pg=E(()=>{tr();Pl();ae();oe();dl();cd()});var Wa=(e)=>fn(p2(e)),p2=(e)=>jt((t,r)=>h2({scope:r,readable:e.evaluate(),onError:e.onError??m2,chunkSize:e.chunkSize,closeOnDone:e.closeOnDone})),h2=(e)=>{let t=e.readable,r=e.closeOnDone??!0,n=e.exit??Hk(void 0),o=Bk(!1);function s(){o.openUnsafe()}function i(l){n.current=sn(e.onError(l)),o.openUnsafe()}function a(){n.current=sn(Uf()),o.openUnsafe()}t.on("readable",s),t.once("error",i),t.once("end",a);let c=Ee(function l(){let u=e.readable.read(e.chunkSize);if(u===null){if(n.current)return n.current;if(t.readableEnded)return N(Uf());return o.closeUnsafe(),H(o.await,l)}let f=ri(u);while(!0){if(u=e.readable.read(e.chunkSize),u===null)break;f.push(u)}return T(f)});return Nr(cl(e.scope,ne(()=>{if(t.off("readable",s),t.off("error",i),t.off("end",a),r&&"closed"in e.readable&&!e.readable.closed)e.readable.destroy()})),c)},m2=(e)=>new fk(e);var hg=E(()=>{_n();tr();Pl();ae();Mr();Gk();Jk();ll();Fa()});import*as Wd from"child_process";import{PassThrough as mg}from"stream";var wi=(e)=>e instanceof globalThis.Error?e:new globalThis.Error(String(e)),Mn=(e,t,r)=>{let{commands:n}=pT(r),o=n.reduce((s,i)=>{let a=`${i.command} ${i.args.join(" ")}`;return s.length===0?a:`${s} | ${a}`},"");return be("ChildProcess",e)(t,[o])},fT=(e,t=()=>{})=>Wd.execFile("taskkill",["/pid",String(e.pid),"/T","/F"],{windowsHide:!0},t),g2,dT,pT=(e)=>{let t=[],r=[],n=(a)=>{switch(a._tag){case"StandardCommand":{t.push(a);break}case"PipedCommand":{n(a.left),r.push(a.options),n(a.right);break}}};if(n(e),t.length===0)throw Error("flattenCommand produced empty commands array");let[o,...s]=t;return{commands:[o,...s],pipeOptions:r}};var hT=E(()=>{Vm();ae();Mr();TO();Eo();CO();ye();cd();Fa();lT();fg();dg();pg();hg();g2=We(function*(){let e=yield*Ql,t=yield*xi,r=z(function*(g){if(ta(g.cwd))return;return yield*e.access(g.cwd),t.resolve(g.cwd)}),n=(g)=>g.extendEnv?{...globalThis.process.env,...g.env}:g.env,o=(g)=>gi(g)?"pipe":g,s=(g)=>wl(g)?"pipe":g,i=(g)=>{let C={stream:"pipe",encoding:"utf-8",endOnDone:!0};if(ta(g.stdin))return C;if(typeof g.stdin==="string")return{...C,stream:g.stdin};if(gi(g.stdin))return{...C,stream:g.stdin};return{stream:g.stdin.stream,encoding:g.stdin.encoding??C.encoding,endOnDone:g.stdin.endOnDone??C.endOnDone}},a=(g,C)=>{let Q=g[C];if(ta(Q))return{stream:"pipe"};if(typeof Q==="string")return{stream:Q};if(wl(Q))return{stream:Q};return{stream:Q.stream}},c=(g)=>{if(ta(g.additionalFds))return[];let C=[];for(let[Q,w]of Object.entries(g.additionalFds)){let _=qd(Q);if(wt(_))C.push({fd:_,config:w})}return C.sort((Q,w)=>Q.fd-w.fd)},l=(g,C,Q,w)=>{let _=[o(g.stream),s(C.stream),s(Q.stream)];if(w.length===0)return _;let I=w.reduce((F,{fd:R})=>Math.max(F,R),2);for(let F=3;F<=I;F++)_[F]="ignore";for(let{fd:F}of w)_[F]="pipe";return _},u=z(function*(g,C,Q){if(Q.length===0)return{getInputFd:()=>Tl,getOutputFd:()=>Ia};let w=new Map,_=new Map;for(let{config:I,fd:F}of Q){let R=C.stdio[F];switch(I.type){case"input":{let A=Tl;if(R&&"write"in R)A=qa({evaluate:()=>R,onError:(M)=>Mn(`fromWritable(fd${F})`,wi(M),g)});if(I.stream)yield*gl(PO(I.stream,A));w.set(F,A);break}case"output":{let A=Ia;if(R&&"read"in R){let M=new mg;R.on("error",(j)=>M.destroy(j)),R.pipe(M),A=Wa({evaluate:()=>M,onError:(j)=>Mn(`fromReadable(fd${F})`,wi(j),g)})}if(I.sink)A=ld(A,I.sink);_.set(F,A);break}}}return{getInputFd:(I)=>w.get(I)??Tl,getOutputFd:(I)=>_.get(I)??Ia}}),f=(g,C,Q)=>Ee(()=>{let w=Tl;if(_c(C.stdin))w=qa({evaluate:()=>C.stdin,onError:(_)=>Mn("fromWritable(stdin)",wi(_),g),endOnDone:Q.endOnDone,encoding:Q.encoding});if(gi(Q.stream))return Nr(gl(PO(Q.stream,w)),w);return T(w)}),d=(g,C,Q,w)=>{let _=C.stdout?(()=>{let R=new mg;return C.stdout.on("error",(A)=>R.destroy(A)),C.stdout.pipe(R),Wa({evaluate:()=>R,onError:(A)=>Mn("fromReadable(stdout)",wi(A),g)})})():Ia,I=C.stderr?(()=>{let R=new mg;return C.stderr.on("error",(A)=>R.destroy(A)),C.stderr.pipe(R),Wa({evaluate:()=>R,onError:(A)=>Mn("fromReadable(stderr)",wi(A),g)})})():Ia;if(wl(Q.stream))_=ld(_,Q.stream);if(wl(w.stream))I=ld(I,w.stream);let F=WP(_,I);return{stdout:_,stderr:I,all:F}},h=(g,C)=>dr((Q)=>{let w=Df(),_=Wd.spawn(g.command,g.args,C);return _.on("error",(I)=>{Q(N(Mn("spawn",I,g)))}),_.on("exit",(...I)=>{jm(w,li(I))}),_.on("spawn",()=>{Q(T([_,w]))}),ne(()=>{_.kill("SIGTERM")})}),m=(g,C,Q)=>{if(globalThis.process.platform==="win32")return dr((w)=>{fT(C,(_)=>{if(_)w(N(Mn("kill",wi(_),g)));else w(ue)})});return xt({try:()=>{globalThis.process.kill(-C.pid,Q)},catch:(w)=>Mn("kill",wi(w),g)})},b=(g,C)=>{if(globalThis.process.platform==="win32"){fT(g);return}try{globalThis.process.kill(-g.pid,C)}catch{}},x=(g,C,Q)=>Ee(()=>{if(!C.kill(Q)){let _=new globalThis.Error("Failed to kill child process");return N(Mn("kill",_,g))}return ue}),O=(g,C,Q)=>(w)=>{let _=Q?.killSignal??"SIGTERM";return ta(Q?.forceKillAfter)?w(C,g,_):Rk(w(C,g,_),{duration:Q.forceKillAfter,orElse:()=>w(C,g,"SIGKILL")})},S=(g,C)=>{let Q=C??"stdout";switch(Q){case"stdout":return g.stdout;case"stderr":return g.stderr;case"all":return g.all;default:{let w=qd(Q);if(wt(w))return g.getOutputFd(w);return g.stdout}}},y=z(function*(g){switch(g._tag){case"StandardCommand":{let C=i(g.options),Q=a(g.options,"stdout"),w=a(g.options,"stderr"),_=c(g.options),I=!0,F=yield*r(g.options),R=n(g.options),A=l(C,Q,w,_),[M,j]=yield*ln(h(g,uT(g.options,{cwd:F,env:R,stdio:A},process.platform)),z(function*([cr,Ji]){let Ki=yield*Xm(Ji),wc=O(cr,g,g.options);if(Ki){let[Go]=yield*fi(Ji);if(Go!==0&&_c(Go))return yield*Bf(wc(m));return yield*ue}if(!I)return yield*ue;return yield*wc((Go,mS,OS)=>m(Go,mS,OS).pipe(bo(()=>x(Go,mS,OS)),an(fi(Ji)))).pipe(Bf)})),me=eT(M.pid);M.on("exit",(cr)=>{if(cr!==0&&_c(cr))b(M,g.options.killSignal??"SIGTERM")});let xr=ne(()=>{if(!I)M.ref(),I=!0}),nn=ne(()=>{if(I)M.unref(),I=!1;return xr}),to=yield*f(g,M,C),{all:Qr,stderr:Hi,stdout:yr}=d(g,M,Q,w),{getInputFd:ar,getOutputFd:_r}=yield*u(g,M,_),ro=K(Xm(j),(cr)=>!cr),Bo=H(fi(j),([cr,Ji])=>{if(_c(cr))return T(Kw(cr));let Ki=new globalThis.Error(`Process interrupted due to receipt of signal: '${Ji}'`);return N(Mn("exitCode",Ki,g))});return ug({pid:me,exitCode:Bo,isRunning:ro,kill:(cr)=>O(M,g,cr)((Ki,wc,Go)=>m(Ki,wc,Go).pipe(bo(()=>x(Ki,wc,Go)),an(fi(j)))).pipe(jf),stdin:to,stdout:yr,stderr:Hi,all:Qr,getInputFd:ar,getOutputFd:_r,unref:nn})}case"PipedCommand":{let{commands:C,pipeOptions:Q}=pT(g),[w,..._]=C,I=[yield*y(w)];for(let M=0;M<_.length;M++){let j=_[M],me=Q[M]??{},xr=i(j.options),nn=Es(T(S(I[I.length-1],me.from))),to=me.to??"stdin";if(to==="stdin")I.push(yield*y(Zd(j.command,j.args,{...j.options,stdin:{...xr,stream:nn}})));else{let Qr=qd(to);if(wt(Qr)){let Hi=cT(Qr),yr=j.options.additionalFds??{};I.push(yield*y(Zd(j.command,j.args,{...j.options,additionalFds:{...yr,[Hi]:{type:"input",stream:nn}}})))}else I.push(yield*y(Zd(j.command,j.args,{...j.options,stdin:{...xr,stream:nn}})))}}let F=I[I.length-1],R=(M)=>ka([...I].reverse(),(j)=>Bf(j.kill(M)),{discard:!0}),A=We(function*(){let M=[];for(let j of I)M.push(yield*j.unref);return ka([...M].reverse(),(j)=>j,{discard:!0})});return ug({pid:F.pid,exitCode:F.exitCode,isRunning:F.isRunning,kill:R,stdin:F.stdin,stdout:F.stdout,stderr:F.stderr,all:F.all,getInputFd:F.getInputFd,getOutputFd:F.getOutputFd,unref:A})}}});return tT(y)}),dT=ba(Za,g2)});var mT=E(()=>{hT()});function OT(e=yT()){return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}function gT(e,t=yT()){let r=Math.min(Math.max(0,Math.trunc(e)),S2);return t[0]=Math.floor(r/1099511627776),t[1]=Math.floor(r/4294967296)&255,t[2]=Math.floor(r/16777216)&255,t[3]=Math.floor(r/65536)&255,t[4]=Math.floor(r/256)&255,t[5]=r&255,t[6]=t[6]&15|112,t[8]=t[8]&63|128,t}var y2=(e)=>e.toString(16).padStart(2,"0"),xT=(e)=>[e.subarray(0,4),e.subarray(4,6),e.subarray(6,8),e.subarray(8,10),e.subarray(10,16)].map((r)=>Array.from(r,y2).join("")).join("-"),yT=()=>globalThis.crypto.getRandomValues(new Uint8Array(16)),ST=(e)=>xT(e===void 0?OT():OT(e)),S2=281474976710655,ET=(e,t)=>xT(t===void 0?gT(e):gT(e,t));var bT="~effect/platform/Crypto",Og,kT=(e)=>{let t=e.randomBytes,r=(i)=>K(b2("randomBytes",i),t),n=(i)=>(i[0]&31)*281474976710656+i[1]*1099511627776+i[2]*4294967296+i[3]*16777216+i[4]*65536+i[5]*256+i[6],o=()=>n(t(7))/9007199254740992,s=()=>{while(!0){let i=t(7),a=n(i);if((i[0]&32)===0)return a+Number.MIN_SAFE_INTEGER;if(a<Number.MAX_SAFE_INTEGER)return a+1}};return Og.of({[bT]:bT,randomBytes:r,nextDoubleUnsafe:o,nextIntUnsafe:s,digest:e.digest,random:ne(()=>o()),randomBoolean:ne(()=>o()>0.5),randomInt:ne(()=>s()),randomBetween:(i,a)=>ne(()=>o()*(a-i)+i),randomIntBetween(i,a,c){let l=c?.halfOpen===!0?0:1;return ne(()=>{let u=Math.ceil(i),f=Math.floor(a);return Math.floor(o()*(f-u+l))+u})},randomShuffle:(i)=>ne(()=>{let a=Array.from(i);for(let c=a.length-1;c>=1;c=c-1){let l=Math.min(c,Math.floor(o()*(c+1))),u=a[c];a[c]=a[l],a[l]=u}return a}),randomUUIDv4:ne(()=>ST(t(16))),randomUUIDv7:sO((i)=>T(ET(i.currentTimeMillisUnsafe(),t(16))))})},b2=(e,t)=>Number.isSafeInteger(t)&&t>=0?T(t):N(wo({module:"Crypto",method:e,description:"size must be a non-negative safe integer"}));var PT=E(()=>{lt();ae();In();Og=rt("effect/Crypto")});import*as Ld from"crypto";var P2=(e)=>{switch(e){case"SHA-1":return"sha1";case"SHA-256":return"sha256";case"SHA-384":return"sha384";case"SHA-512":return"sha512"}},w2=(e,t)=>xt({try:()=>Uint8Array.from(Ld.createHash(P2(e)).update(t).digest()),catch:(r)=>Zr({module:"Crypto",method:"digest",_tag:"Unknown",description:"Could not compute digest",cause:r})}),T2,wT;var TT=E(()=>{PT();ae();Eo();In();T2=kT({randomBytes:Ld.randomBytes,digest:w2}),wT=ms(Og,T2)});var vT;var CT=E(()=>{TT();vT=wT});import*as QT from"crypto";import*as X from"fs";import*as _T from"os";import*as La from"path";var Ie=(e)=>(t)=>wo({module:"FileSystem",method:e,description:t.message??String(t)}),Q2,_2,$2,A2,R2,I2,F2,U2,gg=(e)=>{let t=Le(X.mkdtemp,be("FileSystem",e),Ie(e));return(r)=>Ee(()=>{let n=r?.prefix??"",o=typeof r?.directory==="string"?La.join(r.directory,"."):_T.tmpdir();return t(n?La.join(o,n):o+"/")})},D2,xg=(e)=>{let t=Le(X.rm,be("FileSystem",e),Ie(e));return(r,n)=>t(r,{recursive:n?.recursive??!1,force:n?.force??!1})},M2,N2,Z2=(e)=>{let t=Le(X.open,be("FileSystem",e),Ie(e)),r=Le(X.close,be("FileSystem",e),Ie(e));return(n,o)=>Ho(ln(t(n,o?.flag??"r",o?.mode),(s)=>Rn(r(s))),K((s)=>W2(s,o?.flag?.startsWith("a")??!1)))},q2,W2,$T=(e)=>{let t=gg(e);return z(function*(r){let n=yield*t(r),o=QT.randomBytes(6).toString("hex"),s=La.join(n,r?.suffix?`${o}${r.suffix}`:o);return yield*RT(s,new Uint8Array(0)),s})},L2,z2,X2=(e,t)=>pi({try:()=>X.promises.readdir(e,t),catch:(r)=>be("FileSystem","readDirectory")(r,[e])}),j2=(e)=>dr((t,r)=>{try{X.readFile(e,{signal:r},(n,o)=>{if(n)t(N(be("FileSystem","readFile")(n,[e])));else t(T(o))})}catch(n){t(N(Ie("readFile")(n)))}}),V2,B2,G2,AT=(e)=>({type:e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":e.isBlockDevice()?"BlockDevice":e.isCharacterDevice()?"CharacterDevice":e.isFIFO()?"FIFO":e.isSocket()?"Socket":"Unknown",mtime:wn(e.mtime),atime:wn(e.atime),birthtime:wn(e.birthtime),dev:e.dev,rdev:wn(e.rdev),ino:wn(e.ino),mode:e.mode,nlink:wn(e.nlink),uid:wn(e.uid),gid:wn(e.gid),size:Qo(e.size),blksize:e.blksize!==void 0?ee(Qo(e.blksize)):L(),blocks:wn(e.blocks)}),yg,Y2,H2,J2,K2=(e,t)=>ZP((r)=>ln(ne(()=>{let n=X.watch(e,{recursive:t?.recursive??!1},(o,s)=>{if(!s)return;switch(o){case"rename":{Ss(Ik(yg(s),{onSuccess:(i)=>yl(r,{_tag:"Create",path:s}),onFailure:(i)=>yl(r,{_tag:"Remove",path:s})}));return}case"change":{Sl(r,{_tag:"Update",path:s});return}}});return n.on("error",(o)=>{bl(r,uk(Zr({module:"FileSystem",_tag:"Unknown",method:"watch",pathOrDescriptor:e,cause:o})))}),n.on("close",()=>{vo(r)}),n}),(n)=>ne(()=>n.close()))),eU=(e,t,r)=>yg(t).pipe(K((n)=>e.pipe(JS((o)=>o.register(t,n,r)),bt(()=>K2(t,r)))),Es),RT=(e,t,r)=>dr((n,o)=>{try{X.writeFile(e,t,{signal:o,flag:r?.flag,mode:r?.mode},(s)=>{if(s)n(N(be("FileSystem","writeFile")(s,[e])));else n(ue)})}catch(s){n(N(Ie("writeFile")(s)))}}),tU,IT;var FT=E(()=>{tr();ae();ae();TO();oe();Eo();ze();In();kl();Fa();dg();Q2=(()=>{let e=Le(X.access,be("FileSystem","access"),Ie("access"));return(t,r)=>{let n=X.constants.F_OK;if(r?.readable)n|=X.constants.R_OK;if(r?.writable)n|=X.constants.W_OK;return e(t,n)}})(),_2=(()=>{let e=Le(X.cp,be("FileSystem","copy"),Ie("copy"));return(t,r,n)=>e(t,r,{force:n?.overwrite??!1,preserveTimestamps:n?.preserveTimestamps??!1,recursive:!0})})(),$2=(()=>{let e=Le(X.copyFile,be("FileSystem","copyFile"),Ie("copyFile"));return(t,r)=>e(t,r)})(),A2=(()=>{let e=Le(X.chmod,be("FileSystem","chmod"),Ie("chmod"));return(t,r)=>e(t,r)})(),R2=(()=>{let e=Le(X.chown,be("FileSystem","chown"),Ie("chown"));return(t,r,n)=>e(t,r,n)})(),I2=(()=>{let e=Le(X.glob,be("FileSystem","glob"),Ie("glob"));return(t,r)=>e(t,{cwd:r?.root,exclude:r?.exclude})})(),F2=(()=>{let e=Le(X.link,be("FileSystem","link"),Ie("link"));return(t,r)=>e(t,r)})(),U2=(()=>{let e=Le(X.mkdir,be("FileSystem","makeDirectory"),Ie("makeDirectory"));return(t,r)=>e(t,{recursive:r?.recursive??!1,mode:r?.mode})})(),D2=gg("makeTempDirectory"),M2=xg("remove"),N2=(()=>{let e=gg("makeTempDirectoryScoped"),t=xg("makeTempDirectoryScoped");return(r)=>ln(e(r),(n)=>Rn(t(n,{recursive:!0})))})(),q2=Z2("open"),W2=(()=>{let e=(u)=>Le(X.read,be("FileSystem",u),Ie(u)),t=e("read"),r=e("readAlloc"),n=Le(X.fstat,be("FileSystem","stat"),Ie("stat")),o=Le(X.ftruncate,be("FileSystem","truncate"),Ie("truncate")),s=Le(X.fsync,be("FileSystem","sync"),Ie("sync")),i=(u)=>Le(X.write,be("FileSystem",u),Ie(u)),a=i("write"),c=i("writeAll");class l{[ud];fd;append;position=BigInt(0);constructor(u,f){this[ud]=ud,this.fd=u,this.append=f}get stat(){return K(n(this.fd),AT)}get sync(){return s(this.fd)}seek(u,f){let d=Qo(u);return ne(()=>{if(f==="start")this.position=d;else if(f==="current")this.position=this.position+d;return Qo(this.position)})}read(u){return Ee(()=>{let f=this.position;return K(t(this.fd,{buffer:u,position:f}),(d)=>{let h=Qo(d);return this.position=f+h,h})})}readAlloc(u){let f=Number(u);return Ee(()=>{let d=Buffer.allocUnsafeSlow(f),h=this.position;return K(r(this.fd,{buffer:d,position:h}),(m)=>{if(m===0)return L();if(this.position=h+BigInt(m),m===f)return ee(d);let b=Buffer.allocUnsafeSlow(m);return d.copy(b,0,0,m),ee(b)})})}truncate(u){return K(o(this.fd,u?Number(u):void 0),()=>{if(!this.append){let f=BigInt(u??0);if(this.position>f)this.position=f}})}write(u){return Ee(()=>{let f=this.position;return K(a(this.fd,u,void 0,void 0,this.append?void 0:Number(f)),(d)=>{let h=Qo(d);if(!this.append)this.position=f+h;return h})})}writeAllChunk(u){return Ee(()=>{let f=this.position;return H(c(this.fd,u,void 0,void 0,this.append?void 0:Number(f)),(d)=>{if(d===0)return N(Zr({module:"FileSystem",method:"writeAll",_tag:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"}));if(!this.append)this.position=f+BigInt(d);return d<u.length?this.writeAllChunk(u.subarray(d)):ue})})}writeAll(u){return this.writeAllChunk(u)}}return(u,f)=>new l(u,f)})(),L2=$T("makeTempFile"),z2=(()=>{let e=$T("makeTempFileScoped"),t=xg("makeTempFileScoped");return(r)=>ln(e(r),(n)=>Rn(t(La.dirname(n),{recursive:!0})))})(),V2=(()=>{let e=Le(X.readlink,be("FileSystem","readLink"),Ie("readLink"));return(t)=>e(t)})(),B2=(()=>{let e=Le(X.realpath,be("FileSystem","realPath"),Ie("realPath"));return(t)=>e(t)})(),G2=(()=>{let e=Le(X.rename,be("FileSystem","rename"),Ie("rename"));return(t,r)=>e(t,r)})(),yg=(()=>{let e=Le(X.stat,be("FileSystem","stat"),Ie("stat"));return(t)=>K(e(t),AT)})(),Y2=(()=>{let e=Le(X.symlink,be("FileSystem","symlink"),Ie("symlink"));return(t,r)=>e(t,r)})(),H2=(()=>{let e=Le(X.truncate,be("FileSystem","truncate"),Ie("truncate"));return(t,r)=>e(t,r!==void 0?Number(r):void 0)})(),J2=(()=>{let e=Le(X.utimes,be("FileSystem","utime"),Ie("utime"));return(t,r,n)=>e(t,r,n)})(),tU=K(rO(wO),(e)=>BP({access:Q2,chmod:A2,chown:R2,copy:_2,copyFile:$2,glob:I2,link:F2,makeDirectory:U2,makeTempDirectory:D2,makeTempDirectoryScoped:N2,makeTempFile:L2,makeTempFileScoped:z2,open:q2,readDirectory:X2,readFile:j2,readLink:V2,realPath:B2,remove:M2,rename:G2,stat:yg,symlink:Y2,truncate:H2,utimes:J2,watch(t,r){return eU(e,t,r)},writeFile:RT})),IT=ba(Ql)(tU)});var UT;var DT=E(()=>{FT();UT=IT});import*as Jl from"path";import*as zd from"url";var Sg=(e)=>({fromFileUrl:(t)=>xt({try:()=>zd.fileURLToPath(t,{windows:e}),catch:(r)=>new Po({module:"Path",method:"fromFileUrl",cause:r})}),toFileUrl:(t)=>xt({try:()=>zd.pathToFileURL(t,{windows:e}),catch:(r)=>new Po({module:"Path",method:"toFileUrl",cause:r})})}),oU,sU,MT;var NT=E(()=>{ae();Eo();CO();In();oU=ms(xi)({[_o]:_o,...Jl.posix,...Sg(!1)}),sU=ms(xi)({[_o]:_o,...Jl.win32,...Sg(!0)}),MT=ms(xi)({[_o]:_o,...Jl,...Sg(void 0)})});var ZT;var qT=E(()=>{NT();ZT=MT});var Eg="~effect/Stdio",Xd,WT=(e)=>({[Eg]:Eg,stdinIsTerminal:T(!1),stdoutIsTerminal:T(!1),...e});var bg=E(()=>{lt();ae();Xd=rt(Eg)});var zT;var XT=E(()=>{ae();Eo();In();bg();pg();hg();zT=ms(Xd,WT({args:ne(()=>process.argv.slice(2)),stdinIsTerminal:ne(()=>process.stdin.isTTY===!0),stdoutIsTerminal:ne(()=>process.stdout.isTTY===!0),stdout:(e)=>qa({evaluate:()=>process.stdout,onError:(t)=>Zr({module:"Stdio",method:"stdout",_tag:"Unknown",cause:t}),endOnDone:e?.endOnDone??!1}),stderr:(e)=>qa({evaluate:()=>process.stderr,onError:(t)=>Zr({module:"Stdio",method:"stderr",_tag:"Unknown",cause:t}),endOnDone:e?.endOnDone??!1}),stdin:Wa({evaluate:()=>process.stdin,onError:(e)=>Zr({module:"Stdio",method:"stdin",_tag:"Unknown",cause:e}),closeOnDone:!1})}))});var jT;var VT=E(()=>{XT();jT=zT});function Vd(e){let t=tv(Yd,Ei(e.ast));return(r,n)=>t(r,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function Bd(e){let t=Vd(e);return(r,n)=>{let o=xl(t(r,n));if(kr(o))return ee(o.value);return Da(o.cause,"Option adapter can only return none for schema issues"),L()}}function GT(e){let t=Vd(e);return(r,n)=>{let o=xl(t(r,n));if(kr(o))return o.value;let s=Da(o.cause,"Constructor adapter can only throw schema issues");throw Error("Schema validation failed",{cause:s})}}function YT(e){return HT(e.ast)}function HT(e){let t=kg(ev(Ei(e)));return(r)=>{let n=t(r,Td);if(kr(n))return!0;return Da(n.cause,"Type guard adapter can only return false for schema issues"),!1}}function Gd(e,t){let r=ev(e.ast);return t===void 0?r:(n,o)=>r(n,jd(t,o))}function JT(e,t){return fU(Gd(e,t))}function KT(e,t){return dU(Gd(e,t))}function ev(e){return tv(rv,e)}function tv(e,t){let r;return(n,o)=>{let s=(r??=e(t))(n,o??Td);if(s===kt)return T(n);if(!qe(s))return Tr(s,BT);return s[Y]===fe?BT(fe):s}}function kg(e){return(t,r)=>xl(e(t,r))}function fU(e){let t=kg(e);return(r,n)=>{let o=t(r,n);if(kr(o))return ee(o.value);return Da(o.cause,"Option adapter can only return none for schema issues"),L()}}function dU(e){let t=kg(e);return(r,n)=>{let o=t(r,n);if(kr(o))return gt(o.value);return ut(Da(o.cause,"Result adapter can only return schema issues"))}}function nv(e){return e.context?.constructorDefault?pU(e):Yd(e)}function ov(e,t,r,n){let o;if(qe(e)&&e._tag==="Success"){let s=md(e===kt?t:e[Y]);o=r._tag==="Transformation"?r.decode.run(s,n):r.decode(dn(s),n)}else if(r._tag==="Transformation")o=Tr(e,(s)=>r.decode.run(md(s),n));else o=r.decode(Qa(e,md),n);return qe(o)&&o._tag==="Success"?$O(o[Y]):Tr(o,$O)}function hU(e,t){let r;return(n,o)=>{if(n===fe)return $o;if(e.isConstructed(n))return kt;let s=(r??=t(e.link.to))(n,o);return ov(s,n,e.link.transformation,o)}}function Pg(e,t,r,n){let o=r?Bw(e):void 0,s=o?hU(o,t):e.getParser(t,r),i=e.checks,a=n?e.encoding?[...e.encoding,n]:[n]:e.encoding,c=e.encodingChecks,l=(i?i[i.length-1].annotations:e.annotations)?.parseOptions;if(!a&&!i&&!c){if(!l)return s;return(d,h)=>s(d,jd(h,l))}let u,f=(d,h)=>{let m=s(d,h);if(c&&!h.disableChecks)if(qe(m)){if(m._tag==="Success"){let b=m===kt?d:m[Y];if(d!==fe&&b!==fe){let x=Ts(c,d,void 0,e,h);if(x)m=N(new Nt(e,x,d,h))}}}else m=H(m,(b)=>{if(d!==fe&&b!==fe){let x=Ts(c,d,void 0,e,h);if(x)return N(new Nt(e,x,d,h))}return T(b)});if(i&&!h.disableChecks)if(qe(m)){if(m._tag==="Success"){let b=m===kt?d:m[Y];if(b===fe)return m;let x=Ts(i,b,void 0,e,h);if(x)m=N(new Nt(e,x,b,h))}}else m=H(m,(b)=>{if(b!==fe){let x=Ts(i,b,void 0,e,h);if(x)return N(new Nt(e,x,b,h))}return T(b)});return m};if(!a)return l?(d,h)=>f(d,jd(h,l)):f;return(d,h)=>{if(l)h=jd(h,l);let m=u??=a.map((O)=>t(O.to)),b=d,x=m[m.length-1](d,h);for(let O=a.length-1;O>=0;O--)if(x=ov(x,b,a[O].transformation,h),O!==0){let S=m[O-1];if(x._tag==="Success")b=x[Y],x=S(b,h);else x=Tr(x,(y)=>{let g=S(y,h);return g===kt?dn(y):g})}if(x._tag==="Success"){let O=x[Y],S=f(O,h);return S===kt?x:S}return x=wr(x,(O)=>Pa(()=>ai(O,(S)=>new UO(e,S,d,h)))),Tr(x,(O)=>{let S=f(O,h);return S===kt?dn(O):S})}}var jd=(e,t)=>t?{...e,...t}:e,BT=(e)=>{if(e===fe)return N(new rr);return T(e)},rv,Yd,pU;var wg=E(()=>{tr();ae();Mr();oe();Dt();MO();Od();ze();Oo();Md();yi();rv=so((e)=>Pg(e,rv)),Yd=so((e)=>Pg(e,Yd,nv)),pU=so((e)=>Pg(e,Yd,nv,e.context?.constructorDefault))});function Tg(e,t){function r(){}let n=Object.defineProperties(Object.setPrototypeOf(r,mU),Object.getOwnPropertyDescriptors({...t}));return n.ast=e,n.rebuild=(o)=>Tg(o,t),n.makeEffect=Vd(n),n.make=GT(n),n.makeOption=Bd(n),n}var Hd="~effect/Schema/Schema",mU;var iv=E(()=>{It();Md();wg();mU={[Hd]:Hd,pipe(){return pe(this,arguments)},annotate(e){return this.rebuild(Yl(this.ast,e))},annotateKey(e){return this.rebuild(Ud(this.ast,e))},check(...e){return this.rebuild(Pi(this.ast,e))}}});var Kl=(e)=>e;var av=()=>{};var Ti,cv=(e)=>{if(Ti.has(e))return Ti.get(e);else throw Error("Unable to get redacted value"+(e.label?` with label: "${e.label}"`:""))};var lv=E(()=>{Ti=new WeakMap});var uv="~effect/data/Redacted",yU=(e)=>G(e,uv),fv=(e,t)=>{let r=Object.create(SU);if(t?.label)r.label=t.label;return Ti.set(r,e),r},SU,dv;var vg=E(()=>{co();En();ct();lv();ye();SU={[uv]:{_A:(e)=>e},label:void 0,...Jt,toJSON(){return this.toString()},toString(){return`<redacted${Jo(this.label)?":"+this.label:""}>`},[Je](){return Oe(Ti.get(this))},[Ke](e){return yU(e)&&at(Ti.get(this),Ti.get(e))}},dv=cv});function EU(){return(e,t,r)=>Xe(new ki(e.map(eg),(n)=>t(n.map((o)=>Xe(o))),r))}function bU(e,t){return EU()([],()=>(r,n,o)=>e(r)?T(r):N(new qr(n,r,o)),t)}function ru(e,t){let r=Gd(e,t);return(n,o)=>kU(r(n,o))}function kU(e){if(qe(e))return wU(e);return wr(e,(t)=>Pa(()=>ai(t,(r)=>new tu(r))))}function wU(e){return kr(e)?e:ps(ai(e.cause,(t)=>new tu(t)))}function gv(e,t){let r=KT(e,t);return(n,o)=>Xh(r(n,o),(s)=>new tu(s))}function vU(e){return G(e,eu)&&e[eu]===eu}function Lr(e){let t=Xe(new Un(e),{literal:e,transform(r){return t.pipe(nu(Lr(r),{decode:yt(()=>r),encode:yt(()=>e)}))}});return t}function $g(e,t){return Xe(e,{fields:t,mapFields(r,n){let o=r(this.fields);return $g(Qd(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function ot(e){return $g(Qd(e,void 0),e)}function Sv(e,t){return Xe(Lw(e.ast,t.ast),{key:e,value:t})}function Ev(e,t){return Xe(e,{elements:t,mapElements(r,n){let o=r(this.elements);return Ev(tg(o,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function QU(e){return Ev(tg(e),e)}function bv(e,t){return Xe(e,{members:t,mapMembers(r,n){let o=r(this.members);return bv(_d(o,this.ast.mode,n?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function hn(e,t){return bv(_d(e,t?.mode??"anyOf",void 0),e)}function Xa(e){let t=e.map(Lr);return Xe(_d(t,"anyOf",void 0),{literals:e,members:t,mapMembers(r){return hn(r(this.members))},pick(r){return Xa(r)},transform(r){return hn(t.map((n,o)=>n.transform(r[o])))}})}function nu(e,t){return(r)=>Xe(Ww(r.ast,e.ast,t?qO(t):Ed()),{from:r,to:e})}function $U(e){return(t)=>Xe(qw(t.ast,e),{schema:t})}function za(e){return Lr(e).pipe($U(T(e)))}function AU(e,t){return ot({_tag:za(e),...t})}function ja(e,t){return bU((r)=>r instanceof e,t)}function Va(){return(e,t)=>new vt(e.ast,qO(t))}function RU(e,t){let{source:r,flags:n}=e,o=n===""?`new RegExp(${he(r)})`:`new RegExp(${he(r)}, ${he(n)})`;return ng(e,{toCode:()=>({runtime:`Schema.isPattern(${o})`}),...t})}function IU(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return RU(t,{expected:"a base64 encoded string",representation:{id:"effect/schema/isBase64",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isBase64()"}),...e})}function FU(e){let t=tf(e.order),r=e.formatter??he;return(n,o)=>Kd((s)=>t(s,n),{expected:`a value greater than ${r(n)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:n,exclusiveMinimum:!0}}},...e.annotate?.(n),...o})}function UU(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${he(e)}`);return e}function MU(e){return Kd((t)=>globalThis.Number.isSafeInteger(t),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>({type:"integer"}),toCode:()=>({runtime:"Schema.isInt()"}),arbitrary:{constraint:{integer:!0}},...e})}function Rg(e,t){return e=Math.max(0,Math.floor(e)),Kd((r)=>r.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:"effect/schema/isMinLength",payload:{minLength:e}},toJsonSchema:({type:r})=>r==="array"?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[_l]:!0,arbitrary:{constraint:{minLength:e}},...t})}function NU(e){return Rg(1,e)}function kv(e,t){return e=Math.max(0,Math.floor(e)),Kd((r)=>r.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:"effect/schema/isMaxLength",payload:{maxLength:e}},toJsonSchema:({type:r})=>r==="array"?{maxItems:e}:{maxLength:e},toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[_l]:!0,arbitrary:{constraint:{maxLength:e}},...t})}function wv(e){let t=ZU(e),r=mv[t];if(r!==void 0)return r;let n=oD.pipe(nu(Jd,uw(qU(t))));return mv[t]=n,n}function Tv(e,t,r,n,o){let s=BU(r,t,n),i=vv(t),a=class extends e{constructor(...[c,l]){let f=l?.["~payload"],d=f?.token===Cg?f.value:r.make(c??{},l);super(d,{...l,disableChecks:!0,"~payload":{token:Cg,value:d}})}static[eu]=eu;get[i](){return i}static[jU]=!0;static identifier=t;static fields=r.fields;static get ast(){return s(this).ast}static pipe(){return pe(this,arguments)}static rebuild(c){return s(this).rebuild(c)}static make(c,l){return new this(c,l)}static makeOption(c,l){return Bd(s(this))(c??{},l)}static makeEffect(c,l){return s(this).makeEffect(c??{},l)}static annotate(c){return this.rebuild(Yl(this.ast,c))}static annotateKey(c){return this.rebuild(Ud(this.ast,c))}static check(...c){return this.rebuild(Pi(this.ast,c))}static extend(c){return(l,u)=>{let f=Ig(l)?l:ot(l),d={...r.fields,...f.fields},h=Qd(d,r.ast.checks,{identifier:c});return Tv(this,c,$g(Pi(h,f.ast.checks),d),u,o)}}static mapFields(c,l){return r.mapFields(c,l)}};if(o!==void 0)Object.assign(a.prototype,o(t));return a}function VU(e){return new St(yt((t)=>new e(t,{"~payload":{token:Cg,value:t}})),bs())}function vv(e){return`~effect/Schema/Class/${e}`}function BU(e,t,r){let n;return(o)=>{if(n!==void 0)return n;let s=vv(t),i=(l)=>l instanceof o||G(l,s),a=VU(o),c=Xe(new ki([e.ast],()=>(l,u,f)=>i(l)?T(l):N(new qr(u,l,f)),{identifier:t,[dd]:([l])=>({isConstructed:i,link:new vt(l,a)}),toCodec:([l])=>new vt(l.ast,a),toArbitrary:([l])=>()=>({arbitrary:l.arbitrary.map((u)=>new o(u)),terminal:l.terminal?.map((u)=>new o(u))}),toFormatter:([l])=>(u)=>`${o.identifier}(${l(u)})`,[fd]:jl(e.ast),...r}));return n=nu(c,a)(e)}}function Ig(e){return vU(e)}function GU(e){return e.constructorDefault===void 0?e:new Ao(e.isOptional,e.isMutable,void 0,e.annotations)}function YU(e){if(e.propertySignatures.some((t)=>typeof t.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e})}function HU(e){return(t)=>{let r=new Map;for(let s=0;s<t.length;s++)r.set(ws(t[s]),s);let n=[...t].sort((s,i)=>{s=ws(s),i=ws(i);let a=e(s),c=e(i);if(a!==c)return a-c;return r.get(s)-r.get(i)});if(!n.some((s,i)=>s!==t[i]))return t;return n}}function Ug(e){return Xe(Cv(e.ast),{schema:e})}function KU(e,t,r){switch(e._tag){case"Declaration":{let n=e.typeParameters.map((l)=>Xe(t(ws(l)))),o=e.annotations?.toCodecStringTree;if(io(o)){let l=o(n);if(l===void 0)return e;return Tt(e,[Id(l,t)])}let s=e.annotations?.toCodecJson,i=io(s)?s(n):void 0,a=i===void 0?e.annotations?.toCodec:void 0,c=i??(io(a)?a(n):void 0);return c===void 0?r(e):Tt(e,[Id(c,t)])}case"Null":return Tt(e,[eD]);case"Boolean":return Tt(e,[tD]);case"Unknown":case"ObjectKeyword":return Tt(e,[ag]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return YU(e),e.recur(t,ig);case"Union":{let n=JU(e.types);if(n!==e.types)return new Dn(n,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}var eu,hv="~effect/SchemaError/SchemaError",tu,Qg,PU,Ov,TU,Xe,xv,te,Jd,CU,V,yv,_g,Ae,_U,Kd,ou,DU,Ag,Pv,ZU=(e)=>(e?.includeStack===!0?1:0)|(e?.excludeCause===!0?2:0),qU=(e)=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},mv,V6,WU,LU,zU,B6,G6,XU,Y6,jU,Cg,Fg=(e)=>(t,r)=>{let n=Ig(t)?t:ot(t);return Tv(qc,e,n,r,(s)=>({name:s}))},Nn=(e)=>(t,r,n)=>{let o=Ig(r)?r.mapFields((s)=>({_tag:za(t),...s}),{unsafePreserveChecks:!0}):AU(t,r);return Fg(e??t)(o,n)},JU,eD,tD,rD,nD=(e)=>e.transformation===rD,Cv,oD;var Ba=E(()=>{tr();ma();ae();Jh();Mr();on();ct();Dt();hd();iv();nm();Mh();It();ye();Oo();Md();Sd();yi();wg();kd();av();eu=Hd;tu=class tu extends Fr("SchemaError"){[hv]=hv;constructor(e){let t=gf();Oa(0);try{super({issue:e})}finally{Oa(t)}}get message(){return rw(this.issue)}toString(){return`SchemaError(${this.message})`}};Qg=YT;PU=ru;Ov=JT;TU=gv,Xe=Tg;xv=Kl((e)=>Xe(Dd(e.ast),{schema:e})),te=Kl((e)=>{let t=_U(e);return Xe(Zw(e.ast),{schema:t})});Jd=Xe(zl),CU=Xe(YO),V=Xe(Xl),yv=Xe(HO),_g=Xe(Cw);Ae=Kl((e)=>Xe(new Bl(!1,[],[e.ast]),{value:e}));_U=Kl((e)=>hn([e,CU]));Kd=Ad;ou=Xe(rg);DU=FU({order:ef,annotate:(e)=>({representation:{id:"effect/schema/isGreaterThan",payload:{exclusiveMinimum:UU(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${he(e)})`})})});Ag=yv.check(MU());Pv=V.check(NU()),mv=[];V6=ja(globalThis.RegExp,{representation:{id:"effect/schema/RegExp",payload:null},toCode:()=>({runtime:"Schema.RegExp",Type:"globalThis.RegExp"}),expected:"RegExp",toCodecJson:()=>Va()(ot({source:V,flags:V}),ql({decode:(e,t)=>xt({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new rr({expected:"valid RegExp source and flags"},e,t)}),encode:(e)=>T({source:e.source,flags:e.flags})})),toArbitrary:()=>(e)=>e.tuple(e.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),e.uniqueArray(e.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((t)=>t.join(""))).map(([t,r])=>new globalThis.RegExp(t,r)),toEquivalence:()=>(e,t)=>e.source===t.source&&e.flags===t.flags}),WU=V.annotate({expected:"a string that will be decoded as a URL"}),LU=ja(globalThis.URL,{representation:{id:"effect/schema/URL",payload:null},toCode:()=>({runtime:"Schema.URL",Type:"globalThis.URL"}),expected:"URL",toCodecJson:()=>Va()(WU,fw),toArbitrary:()=>(e)=>e.webUrl().map((t)=>new globalThis.URL(t)),toEquivalence:()=>(e,t)=>e.toString()===t.toString()}),zU=ja(globalThis.File,{representation:{id:"effect/schema/File",payload:null},toCode:()=>({runtime:"Schema.File",Type:"globalThis.File"}),expected:"File",toCodecJson:()=>Va()(ot({data:V.check(IU()),type:V,name:V,lastModified:Ag}),ql({decode:(e,t)=>nf(hf(e.data),{onFailure:()=>N(new rr({expected:"a valid Base64 string"},e.data,t)),onSuccess:(r)=>{let n=new globalThis.Uint8Array(r);return T(new globalThis.File([n],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>pi({try:async()=>{let r=new globalThis.Uint8Array(await e.arrayBuffer());return{data:pf(r),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new rr({expected:"a readable File"},e,t)})}))}),B6=ja(globalThis.FormData,{representation:{id:"effect/schema/FormData",payload:null},toCode:()=>({runtime:"Schema.FormData",Type:"globalThis.FormData"}),expected:"FormData",toCodecJson:()=>Va()(Ae(QU([V,hn([ot({_tag:za("String"),value:V}),ot({_tag:za("File"),value:zU})])])),ql({decode:(e)=>{let t=new globalThis.FormData;for(let[r,n]of e)t.append(r,n.value);return T(t)},encode:(e)=>T(globalThis.Array.from(e.entries()).map(([t,r])=>{if(typeof r==="string")return[t,{_tag:"String",value:r}];else return[t,{_tag:"File",value:r}]}))}))}),G6=ja(globalThis.URLSearchParams,{representation:{id:"effect/schema/URLSearchParams",payload:null},toCode:()=>({runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"}),expected:"URLSearchParams",toCodecJson:()=>Va()(V.annotate({expected:"a query string that will be decoded as URLSearchParams"}),Wl({decode:(e)=>new globalThis.URLSearchParams(e),encode:(e)=>e.toString()}))}),XU=V.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),Y6=ja(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>Va()(XU,dw),toArbitrary:()=>(e)=>e.uint8Array()}),jU=globalThis.Symbol.for("immer-draftable"),Cg={};JU=HU((e)=>{switch(e._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});eD=new vt(new Un("null"),new St(yt(()=>null),yt(()=>"null"))),tD=new vt(new Dn([new Un("true"),new Un("false")],"anyOf"),new St(yt((e)=>e==="true"),Nl())),rD=new St(yt((e)=>typeof e==="string"?[e]:e),bs()),Cv=Fd((e)=>{let t=KU(e,Cv,(r)=>{throw new globalThis.Error("Missing structural codec for StringTree",{cause:r})});if(t!==e&&e.context!==void 0)return Nw(t,GU(e.context));return t},{stopAt:nD}),oD=Xe(Yl(Yw,{toCode:()=>({runtime:"Schema.Json",Type:"Schema.Json"})}))});var Qv="~effect/platform/Terminal",Dg="effect/platform/Terminal/QuitError",su,_v=(e)=>G(e,Dg),mn,$v=(e)=>mn.of({...e,[Qv]:Qv});var ep=E(()=>{lt();ye();Ba();su=class su extends Fg("QuitError")({_tag:za("QuitError")}){[Dg]=Dg};mn=rt("effect/platform/Terminal")});import*as tp from"readline";function Iv(e){return e.key.ctrl&&(e.key.name==="c"||e.key.name==="d")}var Av,Rv;var Fv=E(()=>{ae();Eo();ze();In();ye();kl();MP();ep();Av=z(function*(e=Iv){let t=process.stdin,r=process.stdout,n=yield*Ra(),o=t.readableEnded,s=!1,i=()=>{if(o=!0,!s)vo(n)};t.once("end",i),yield*nO(()=>ne(()=>t.off("end",i)));let a=yield*DP({acquire:ln(ne(()=>{let h=tp.createInterface({input:t,escapeCodeTimeout:50}),m=(x)=>Sl(n,x),b=()=>{s=!1,vo(n)};if(s=!0,tp.emitKeypressEvents(t,h),h.on("line",m),h.once("close",b),t.isTTY)t.setRawMode(!0);return{rl:h,onClose:b,onLine:m}}),({rl:h,onClose:m,onLine:b})=>ne(()=>{if(s=!1,h.off("line",b),h.off("close",m),t.isTTY)t.setRawMode(!1);if(h.close(),o)vo(n)})),idleTimeToLive:"10 millis"}),c=ne(()=>r.columns??0),l=ne(()=>r.rows??0),u=We(function*(){let h=yield*Ra(),m=(O,S)=>{let y={input:ua(O),key:{name:S.name??"",ctrl:!!S.ctrl,meta:!!S.meta,shift:!!S.shift}};if(Sl(h,y),e(y))vo(h)},b=setInterval(()=>{},2147483647),x=()=>{clearInterval(b),vo(h)};if(yield*nO(()=>ne(()=>{clearInterval(b),t.off("keypress",m),t.off("end",x)})),t.on("keypress",m),o)x();else yield*bO(a),t.once("end",x);return h}),f=Ee(()=>iP(n).pipe(H(er({onNone:()=>mi(an(bO(a),Co(n))),onSome:T})),cn(()=>new su({}))));return $v({columns:c,rows:l,readInput:u,readLine:f,display:(h)=>Hf(dr((m)=>{r.write(h,(b)=>yS(b)?m(ue):m(N(wo({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:b}))))}))})}),Rv=ba(mn,Av(Iv))});var Uv;var Dv=E(()=>{Fv();Uv=Rv});var aD;var Nv=E(()=>{Eo();mT();CT();DT();qT();VT();Dv();aD=dT.pipe(bk(Zf(UT,vT,ZT,jT,Uv)))});var Ng=E(()=>{Wk();Nv()});var Zn=E(()=>{tr();ma();ae();Mr();ze();Oo();Ba()});var vi="__tripwire_dynamic_shell_value__",Zg=(e)=>({start:e.pos,end:e.end}),cD=(e)=>{let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)},qg=()=>({aliases:new Map,backgroundPidAvailable:!1,bindings:new Map,functions:new Map,temps:new Map}),Pt=(e)=>({aliases:new Map(e.aliases),backgroundPidAvailable:e.backgroundPidAvailable,bindings:new Map(e.bindings),functions:new Map(e.functions),temps:new Map(e.temps)}),Wg=(e)=>e.type==="SingleQuoted"||e.type==="DoubleQuoted"||e.type==="AnsiCQuoted"||e.type==="LocaleString",qv=(e)=>e.every((t)=>{switch(t.type){case"Literal":case"SingleQuoted":case"AnsiCQuoted":return!0;case"DoubleQuoted":case"LocaleString":return qv(t.parts);case"SimpleExpansion":case"ParameterExpansion":case"CommandExpansion":case"ArithmeticExpansion":case"ProcessSubstitution":case"ExtendedGlob":case"BraceExpansion":return!1;default:return!1}}),Ro=(e)=>qv(e.parts??[]),Wv=(e)=>{if(e===void 0||(e.errors?.length??0)>0||e.commands.length!==1)return null;let[t]=e.commands;if(t===void 0||t.background===!0||t.redirects.length>0)return null;let{command:r}=t;if(r.type!=="Command"||r.name===void 0||!Ro(r.name))return null;if(r.prefix.length>0||r.suffix.some((n)=>!Ro(n)))return null;return{command:r,head:cD(r.name.value),args:r.suffix.map((n)=>n.value)}},Lv=(e)=>{let t=e.parts??[];if(t.length!==1)return;let[r]=t;if(r?.type==="CommandExpansion")return r.script;if(r?.type!=="DoubleQuoted"||r.parts.length!==1)return;let[n]=r.parts;return n?.type==="CommandExpansion"?n.script:void 0},zv=(e,t)=>e.command.name?.value.includes("/")===!1&&(t.aliases.has(e.head)||t.functions.has(e.head)),Lg=(e,t)=>{let r=Wv(Lv(e));if(r===null||zv(r,t))return null;if(r.head==="cat"&&r.args.length===0&&r.command.redirects.length===1){let[n]=r.command.redirects;if(n?.operator!=="<<"&&n?.operator!=="<<-")return null;if(n.heredocQuoted===!0||n.body===void 0||Ro(n.body))return(n.content??"").replace(/\n+$/u,"");return null}if(r.head==="printf"&&r.args.length===2){let[n,o]=r.args;if(n==="%s"||n===String.raw`%s\n`)return o??""}return null},Zv=(e)=>["/tmp","/private/tmp","/var/tmp","/private/var/tmp","/var/folders","/private/var/folders"].some((t)=>e===t||e.startsWith(`${t}/`)),lD=(e)=>{let t=!1,r=null,n=[];for(let o=0;o<e.length;o+=1){let s=e[o];if(s==="-t")t=!0,o+=1;else if(s==="-p"||s==="--tmpdir")r=e[o+1]??"",o+=1;else if(s?.startsWith("--tmpdir=")===!0)r=s.slice(9);else if(s!==void 0&&!s.startsWith("-"))n.push(s)}return{explicitDirectory:r,positionals:n,systemTempTemplate:t}},Xv=(e,t)=>{let r=Wv(Lv(e));if(r?.head!=="mktemp"||zv(r,t)||["TMPDIR","TMP","TEMP"].some((a)=>t.bindings.has(a)||t.temps.has(a))||!r.args.some((a)=>a==="-d"||a==="--directory"||/^-[^-]*d/u.test(a)))return!1;let{explicitDirectory:n,positionals:o,systemTempTemplate:s}=lD(r.args);if(n!==null&&!Zv(n))return!1;if(o.length===0||s||n!==null)return!0;let[i]=o;return o.length===1&&i!==void 0&&Zv(i)},jv=(e)=>{if(e.type==="SimpleExpansion")return/^\$(?<name>[A-Za-z_][A-Za-z0-9_]*|[0-9]+|!)$/u.exec(e.text)?.groups?.name??null;if(e.type==="ParameterExpansion"&&e.indirect!==!0&&e.length!==!0&&e.operator===void 0&&e.index===void 0&&e.slice===void 0&&e.replace===void 0&&/^(?:[A-Za-z_][A-Za-z0-9_]*|[0-9]+|!)$/u.test(e.parameter))return e.parameter;return null},Vv=(e)=>{let t=[],r=(i,a)=>{for(let c of i)switch(c.type){case"Literal":case"SingleQuoted":case"AnsiCQuoted":{t.push({kind:"literal",value:c.value});break}case"DoubleQuoted":case"LocaleString":{if(!r(c.parts,!0))return!1;break}case"SimpleExpansion":case"ParameterExpansion":{let l=jv(c);if(l===null)return!1;t.push({kind:"variable",quoted:a,variable:l});break}case"ArithmeticExpansion":case"BraceExpansion":case"CommandExpansion":case"ExtendedGlob":case"ProcessSubstitution":return!1;default:return!1}return!0};if(!r(e.parts??[],!1))return null;let n=t.filter((i)=>i.kind==="variable");if(n.length!==1)return null;let[o]=n;if(o===void 0)return null;let s=t.indexOf(o);return{prefix:t.slice(0,s).map((i)=>i.kind==="literal"?i.value:"").join(""),quoted:o.quoted,suffix:t.slice(s+1).map((i)=>i.kind==="literal"?i.value:"").join(""),variable:o.variable}},uD=(e)=>{let t=e.parts??[];if(t.length!==1||t[0]?.type!=="DoubleQuoted")return null;let r=t[0].parts;if(r.length<1||r.length>2)return null;let[n]=r,o=n===void 0?null:jv(n);if(o===null)return null;let[,s]=r;if(s!==void 0&&s.type!=="Literal")return null;return{variable:o,suffix:s?.value??""}},Bv=(e,t)=>{let r=uD(e);if(r===null||!t.temps.has(r.variable))return null;let{suffix:n,variable:o}=r;if(n!==""&&!n.startsWith("/")||n.split("/").includes("..")||n.includes("\x00"))return null;return{source:e.text,value:`/private/tmp/tripwire-provenance/${o}${n}`,kind:"trusted-temp-path",range:Zg(e),quoted:!0,variable:o}},zg=(e,t)=>{let r=Vv(e);if(r===null)return null;let{prefix:n,quoted:o,suffix:s,variable:i}=r,a=t.bindings.get(i);if(a===void 0||a.kind==="dynamic"||a.kind==="trusted-temp-path"||a.kind==="background-pid"&&(n!==""||s!=="")||s.split("/").includes("..")||n.split("/").includes(".."))return null;let c=`${n}${a.value}${s}`;if(!o&&(/\s/u.test(c)||c.includes("*")||c.includes("?")||c.includes("[")))return null;return{...a,source:e.text,value:c,range:Zg(e),quoted:o,variable:i}},Xg=(e,t)=>{let r=Vv(e);if(!t.backgroundPidAvailable||r?.variable!=="!"||r.prefix!==""||r.suffix!=="")return null;return{source:e.text,value:"__tripwire_background_pid__",kind:"background-pid",range:Zg(e),quoted:r.quoted,variable:"!"}};var Ga=()=>{};function Gv(e){return e>=48&&e<=55}function fD(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function dD(e,t){try{return String.fromCodePoint(e)}catch{return t}}function jg(e,t,r){let n=t,o="";while(n<r&&e.charCodeAt(n)!==39){if(e.charCodeAt(n)!==92||n+1>=r){let c=n;while(n<r){let l=e.charCodeAt(n);if(l===39||l===92&&n+1<r)break;n++}o+=e.slice(c,n);continue}let i=n++,a=e[n++];switch(a){case"a":o+="\x07";break;case"b":o+="\b";break;case"e":case"E":o+="\x1B";break;case"f":o+="\f";break;case"n":o+=`
|
|
34
|
+
`;break;case"r":o+="\r";break;case"t":o+="\t";break;case"v":o+="\v";break;case"\\":o+="\\";break;case"'":o+="'";break;case'"':o+='"';break;case"?":o+="?";break;case`
|
|
35
|
+
`:break;case"c":{let c=n<r?e.charCodeAt(n):39;if(c===39){o+=e.slice(i,n);break}if(n++,c===92){let l=n<r&&e.charCodeAt(n)===92;if(l)n++;if(o+="\x1C",!l&&n<r)o+=e[n],n++;break}o+=String.fromCharCode(c===63?127:c&31);break}case"x":case"u":case"U":{let c=n,l=a==="x"?2:a==="u"?4:8;while(n<r&&n-c<l&&fD(e.charCodeAt(n)))n++;if(n===c){o+=`\\${a}`;break}let u=e.slice(i,n);o+=dD(Number.parseInt(e.slice(c,n),16),u);break}default:{let c=a.charCodeAt(0);if(!Gv(c)){o+=`\\${a}`;break}while(n<r&&n-i-1<3&&Gv(e.charCodeAt(n)))n++;o+=String.fromCharCode(Number.parseInt(e.slice(i+1,n),8)&255);break}}}let s=n<r;if(s)n++;return{value:o,end:n,closed:s}}var On=9,Re=10,Xr=32,nr=33,ke=34,Ct=35,ce=36,Ci=37,pr=38,Fe=39,J=40,ft=41,gn=42,Qt=43,Ya=44,_t=45,Qi=47,hr=48,mr=57,_i=58,Ha=59,we=60,Pe=61,je=62,vr=63,vs=64,Cs=65,Qs=90,Vt=91,re=92,qn=93,Ja=94,_s=95,de=96,Io=97,Fo=122,Ge=123,jr=124,or=125,Yv=126;function pD(e){switch(e){case",":return 1;case"=":case"+=":case"-=":case"*=":case"/=":case"%=":case"<<=":case">>=":case"&=":case"|=":case"^=":return 2;case"||":return 4;case"&&":return 5;case"|":return 6;case"^":return 7;case"&":return 8;case"==":case"!=":return 9;case"<":case"<=":case">":case">=":return 10;case"<<":case">>":return 11;case"+":case"-":return 12;case"*":case"/":case"%":return 13;case"**":return 14;default:return-1}}function hD(e){switch(e){case"=":case"+=":case"-=":case"*=":case"/=":case"%=":case"<<=":case">>=":case"&=":case"|=":case"^=":case"**":return!0;default:return!1}}function Ka(e,t=0,r){let n=0,o=e.length,s=r?.commandExpansions.length??0,i=r?.embeddedWords.length??0;function a(O,S,y=!1){let g={type:"ArithmeticWord",pos:O+t,end:S+t,value:e.slice(O,S),parts:void 0};if(y)r?.embeddedWords.push(g);return g}function c(){while(n<o){let O=e.charCodeAt(n);if(O===Xr||O===On||O===Re)n++;else break}}function l(){if(n>=o)return null;let O=e.charCodeAt(n),S=n+1<o?e.charCodeAt(n+1):0,y=n+2<o?e.charCodeAt(n+2):0;switch(O){case Ya:return n++,",";case Pe:if(S===Pe)return n+=2,"==";return n++,"=";case nr:if(S===Pe)return n+=2,"!=";return null;case we:if(S===we){if(y===Pe)return n+=3,"<<=";return n+=2,"<<"}if(S===Pe)return n+=2,"<=";return n++,"<";case je:if(S===je){if(y===Pe)return n+=3,">>=";return n+=2,">>"}if(S===Pe)return n+=2,">=";return n++,">";case Qt:if(S===Pe)return n+=2,"+=";if(S===Qt)return null;return n++,"+";case _t:if(S===Pe)return n+=2,"-=";if(S===_t)return null;return n++,"-";case gn:if(S===gn)return n+=2,"**";if(S===Pe)return n+=2,"*=";return n++,"*";case Qi:if(S===Pe)return n+=2,"/=";return n++,"/";case Ci:if(S===Pe)return n+=2,"%=";return n++,"%";case jr:if(S===jr)return n+=2,"||";if(S===Pe)return n+=2,"|=";return n++,"|";case pr:if(S===pr)return n+=2,"&&";if(S===Pe)return n+=2,"&=";return n++,"&";case Ja:if(S===Pe)return n+=2,"^=";return n++,"^";case vr:return n++,"?";default:return null}}function u(O){let S=f();while(!0){if(c(),n>=o)break;let y=n,g=l();if(!g)break;if(g==="?"){if(3<O){n=y;break}let _=u(1);if(c(),n<o&&e.charCodeAt(n)===_i)n++;let I=u(3);S={type:"ArithmeticTernary",pos:S.pos,end:I.end,test:S,consequent:_,alternate:I};continue}let C=pD(g);if(C<O){n=y;break}let Q=hD(g)?C:C+1,w=u(Q);S={type:"ArithmeticBinary",pos:S.pos,end:w.end,operator:g,left:S,right:w}}return S}function f(){if(c(),n>=o)return a(n,n);let O=n,S=e.charCodeAt(n),y=n+1<o?e.charCodeAt(n+1):0;if(S===Qt&&y===Qt){n+=2;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"++",operand:g,prefix:!0}}if(S===_t&&y===_t){n+=2;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"--",operand:g,prefix:!0}}if(S===nr){n++;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"!",operand:g,prefix:!0}}if(S===Yv){n++;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"~",operand:g,prefix:!0}}if(S===Qt&&y!==Qt&&y!==Pe){n++;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"+",operand:g,prefix:!0}}if(S===_t&&y!==_t&&y!==Pe){n++;let g=f();return{type:"ArithmeticUnary",pos:O+t,end:g.end,operator:"-",operand:g,prefix:!0}}return d()}function d(){let O=h();if(c(),n+1<o){let S=e.charCodeAt(n),y=e.charCodeAt(n+1);if(S===Qt&&y===Qt)return n+=2,{type:"ArithmeticUnary",pos:O.pos,end:n+t,operator:"++",operand:O,prefix:!1};if(S===_t&&y===_t)return n+=2,{type:"ArithmeticUnary",pos:O.pos,end:n+t,operator:"--",operand:O,prefix:!1}}return O}function h(){if(c(),n>=o)return a(n,n);let O=e.charCodeAt(n);if(O===J){let Q=n;n++;let w=u(0);if(c(),n<o&&e.charCodeAt(n)===ft)n++;return{type:"ArithmeticGroup",pos:Q+t,end:n+t,expression:w}}if(O===ce){let Q=n,w=r?.commandExpansions.length??0,_=r?.embeddedWords.length??0,I=m(),F=r?.findArithmeticWordEnd?.(Q+t,t+o)??n+t;if(F>n+t){if(r)r.commandExpansions.length=w,r.embeddedWords.length=_;return n=F-t,a(Q,n,!0)}return I}if(O===96||O===34||O===39){let Q=n;return n=(r?.findArithmeticWordEnd?.(Q+t,t+o)??Q+t+1)-t,a(Q,n,!0)}let S=n,y=r?.embeddedWords.length??0,g=b(),C=r?.findArithmeticWordEnd?.(S+t,t+o)??n+t;if(C>n+t){if(r)r.embeddedWords.length=y;return n=C-t,a(S,n,!0)}return g}function m(){let O=n;if(n++,n>=o)return a(O,n);let S=e.charCodeAt(n);if(S===J)if(n+1<o&&e.charCodeAt(n+1)===J){let y=r?.findArithmeticExpansionEnd(O+t,t+o)??-1;if(y!==-1)n=y-t;else{n+=2;let g=1;while(n<o&&g>0)if(e.charCodeAt(n)===J&&e.charCodeAt(n+1)===J)g++,n+=2;else if(e.charCodeAt(n)===ft&&e.charCodeAt(n+1)===ft)g--,n+=2;else n++}}else{n++;let y=r?.findClosingParenthesis(n+t,t+o)??-1;if(y!==-1)n=y-t+1;else{let w=1;while(n<o&&w>0){let _=e.charCodeAt(n++);if(_===J)w++;else if(_===ft)w--}}let g=e.slice(O,n),C=g.slice(2,-1),Q={type:"ArithmeticCommandExpansion",pos:O+t,end:n+t,text:g,inner:C,script:void 0};return r?.commandExpansions.push(Q),Q}else if(S===Ge){let y=r?.findClosingBrace(n+t+1,t+o)??-1;if(y!==-1)n=y-t+1;else{n++;let g=1;while(n<o&&g>0){let C=e.charCodeAt(n++);if(C===Ge)g++;else if(C===or)g--}}}else while(n<o){let y=e.charCodeAt(n);if(y>=Io&&y<=Fo||y>=Cs&&y<=Qs||y>=hr&&y<=mr||y===_s)n++;else break}return a(O,n,S===J||S===Ge)}function b(){let O=n;while(n<o){let S=e.charCodeAt(n);if(S>=hr&&S<=mr||S>=Cs&&S<=Qs||S>=Io&&S<=Fo||S===_s||S===35)n++;else break}if(n>O&&n<o&&e.charCodeAt(n)===Vt){let S=r?.findClosingBracket?.(n+t+1,t+o)??-1;if(S!==-1)n=S-t+1;else{n++;let y=1;while(n<o&&y>0){let g=e.charCodeAt(n);if(g===Vt)y++;else if(g===qn)y--;n++}}return a(O,n,!0)}if(n===O)return n++,a(O,n);return a(O,n)}if(c(),n>=o)return null;let x=u(0);if(c(),n<o&&r)return r.commandExpansions.length=s,r.embeddedWords.length=i,a(0,o,!0);return x}var Vg=()=>{};function mD(e){let t="";for(let r of e)t+=r.type==="Literal"?r.value:r.text;return t}function OD(e){let t=e.indexOf("\\");if(t===-1)return e;let r="",n=0;for(let o=t;o<e.length;o++){if(e.charCodeAt(o)!==92)continue;if(r+=e.slice(n,o),o++,o>=e.length){r+="\\",n=o;break}if(e.charCodeAt(o)!==10)r+=e[o];n=o+1}return r+e.slice(n)}function gD(e){if(e[0]!=="$")return e;let t=1;while(e[t]==="\\"&&e[t+1]===`
|
|
36
|
+
`)t+=2;return t===1||e[t]!=="("?e:"$"+e.slice(t)}class Et{static _resolveWord;static _resolveHeredocBody;text;pos;end;#t;#e;#r;#s;#a=null;constructor(e,t,r,n,o,s=0){this.text=e,this.pos=t,this.end=r,this.#t=n,this.#e=o??Et._resolveWord,this.#r=s,this.#s=n!==void 0?null:void 0}get value(){if(this.#a===null){let e=this.parts;if(!e)this.#a=OD(this.text);else{let t="";for(let r of e)switch(r.type){case"Literal":case"SingleQuoted":case"AnsiCQuoted":t+=r.value;break;case"DoubleQuoted":case"LocaleString":t+=mD(r.parts);break;case"CommandExpansion":t+=gD(r.text);break;default:t+=r.text;break}this.#a=t}}return this.#a}get parts(){if(this.#s===null)this.#s=this.#e(this.#t??"",this,this.#r)??void 0;return this.#s}set parts(e){this.#s=e??void 0}sourceText(){return this.#t?.slice(this.pos,this.end)}toJSON(){return{text:this.text,pos:this.pos,end:this.end,parts:this.parts,value:this.value}}}class np{token=p.EOF;_value="";_owner;pos=0;end=0;fileDescriptor=void 0;variableName=void 0;content=void 0;targetPos=0;targetEnd=0;assignmentOperatorPos=-1;raw=!1;keywordEligible=!1;constructor(e=null){this._owner=e}get value(){return this._value??(this._value=this._owner===null?"":this._owner._tokenValue(this.pos,this.end,this.raw))}set value(e){this._value=e}reset(){this.token=p.EOF,this._value="",this.pos=0,this.end=0,this.fileDescriptor=void 0,this.variableName=void 0,this.content=void 0,this.targetPos=0,this.targetEnd=0,this.assignmentOperatorPos=-1,this.raw=!1,this.keywordEligible=!1}copyFrom(e){this.token=e.token,this._value=e._value,this.pos=e.pos,this.end=e.end,this.fileDescriptor=e.fileDescriptor,this.variableName=e.variableName,this.content=e.content,this.targetPos=e.targetPos,this.targetEnd=e.targetEnd,this.assignmentOperatorPos=e.assignmentOperatorPos,this.raw=e.raw,this.keywordEligible=e.keywordEligible}}function Bg(e,t,r){while(t+1<r&&e.charCodeAt(t)===re&&e.charCodeAt(t+1)===Re)t+=2;return t}function $s(e,t,r){for(let n=t;n<r;n++){let o=e.charCodeAt(n);if(o===re||o===Fe||o===ke||o===ce||o===de||(o===we||o===je)&&n+1<r&&e.charCodeAt(n+1)===J)return!0}return!1}function Hv(e,t,r=!1,n){let o=0,s=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===re){i++;continue}if(a===Ge){o++;continue}if(a===or){if(o>0)o--;continue}if(a===Fe){i++;while(i<e.length&&e.charCodeAt(i)!==Fe)i++;continue}if(a===ke){i++;while(i<e.length){let l=e.charCodeAt(i);if(l===ke)break;if(l===re){i+=2;continue}let u=n?.(i,!0)??i;if(u>i){i=u;continue}i++}continue}let c=n?.(i,!1)??i;if(c>i){i=c-1;continue}if(r&&o===0){if(a===vr){s++;continue}if(a===_i&&s>0){s--;continue}}if(a===t&&o===0)return i}return-1}function Jv(e){let t=e.type;return t==="Literal"||t==="SimpleExpansion"||t==="ParameterExpansion"||t==="CommandExpansion"||t==="ArithmeticExpansion"}function SD(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<hr||r>mr)return!1}return e.length>0}function ED(e,t,r){for(let n=t;n<r;n++){let o=e.charCodeAt(n);if(o<hr||o>mr)return!1}return r>t}function r0(e){return e<Br}function n0(e){return-e-2}function iu(e,t,r,n){let o=n;for(let s=t;s<r&&o>=0;s++){let i=e.charCodeAt(s);if(o>=Vr){if(i===Vt)o++;else if(i===qn&&--o===Vr)o=e0}else if(o===rp)o=i<128&&As[i]&1?Kv:Br;else if(o===Kv){if(i<128&&As[i]&2)continue;if(i===Vt)o=Vr+1;else if(i===Qt)o=t0;else o=i===Pe?-s-2:Br}else if(o===e0)if(i===Qt)o=t0;else o=i===Pe?-s-2:Br;else o=i===Pe?-s-2:Br}return o}function Ye(e,t,r,n=0,o=0){e.token=t,e._value=r,e.pos=n,e.end=o,e.fileDescriptor=void 0,e.variableName=void 0,e.content=void 0,e.assignmentOperatorPos=-1,e.raw=!1,e.keywordEligible=!1}function au(e,t,r,n,o){e.token=t,e._value=null,e.pos=r,e.end=n,e.fileDescriptor=void 0,e.variableName=void 0,e.content=void 0,e.assignmentOperatorPos=-1,e.raw=o,e.keywordEligible=!1}function kD(e,t,r){switch(e.charCodeAt(t)){case nr:return r===1?p.Bang:void 0;case Ge:return r===1?p.LBrace:void 0;case or:return r===1?p.RBrace:void 0;case 105:{if(r!==2)return;let n=e.charCodeAt(t+1);return n===102?p.If:n===110?p.In:void 0}case 102:if(r===2)return e.charCodeAt(t+1)===105?p.Fi:void 0;if(r===3)return e.startsWith("for",t)?p.For:void 0;if(r===8)return e.startsWith("function",t)?p.Function:void 0;return;case 116:return r===4&&e.startsWith("then",t)?p.Then:void 0;case 101:if(r!==4)return;if(e.startsWith("else",t))return p.Else;if(e.startsWith("elif",t))return p.Elif;if(e.startsWith("esac",t))return p.Esac;return;case 100:if(r===2)return e.charCodeAt(t+1)===111?p.Do:void 0;if(r===4)return e.startsWith("done",t)?p.Done:void 0;return;case 99:if(r===4)return e.startsWith("case",t)?p.Case:void 0;if(r===6)return e.startsWith("coproc",t)?p.Coproc:void 0;return;case 119:return r===5&&e.startsWith("while",t)?p.While:void 0;case 117:return r===5&&e.startsWith("until",t)?p.Until:void 0;case 115:return r===6&&e.startsWith("select",t)?p.Select:void 0;default:return}}function PD(e,t,r){let n=t+1<r?e.charCodeAt(t+1):0;if(n<=Xr||n===or)return-1;let o=1,s=!1,i=t+1;while(i<r&&o>0){let a=e.charCodeAt(i);if(a===Ge)o++;else if(a===or){if(--o===0)break}else if(a<=Xr||a===Ha||a===jr||a===pr)return-1;else if(o===1&&(a===44||a===46&&i+1<r&&e.charCodeAt(i+1)===46))s=!0;if(a===re)i++;i++}if(o===0&&s)return i+1;return-1}class xn{src;srcEnd;pos;current;nextState;hasPeek;pendingHereDocs;collectedExpansions;_errors=null;_buildParts=!1;_buildValue=!1;_nestingDepth=0;constructor(e,t=0,r=e.length){if(this.src=e,this.srcEnd=r,this.pos=t,this.current=new np(this),this.nextState=new np(this),this.hasPeek=!1,this.pendingHereDocs=null,this.collectedExpansions=null,t===0&&e.charCodeAt(0)===Ct&&e.charCodeAt(1)===nr){let n=e.indexOf(`
|
|
37
|
+
`);this.pos=n===-1?this.srcEnd:n+1}}getSource(){return this.src}get errors(){return this._errors??(this._errors=[])}getCollectedExpansions(){return this.collectedExpansions??bD}collect(e){(this.collectedExpansions??=[]).push([e,this._nestingDepth])}getPos(){return this.pos}_tokenValue(e,t,r){return r?this.src.slice(e,t):this.wordValueOf(e,t)}wordValueOf(e,t){let r=this.pos,n=this.srcEnd,o=this._buildValue,s=this._unbalanced,i=this._errors===null?0:this._errors.length;this.pos=e,this.srcEnd=t,this._buildValue=!0,this.readWordText();let a=this._wordText;if(this.pos=r,this.srcEnd=n,this._buildValue=o,this._unbalanced=s,this._errors!==null)this._errors.length=i;return a}findClosingBracket(e,t=this.srcEnd){return this.findClosingShellDelimiter(e,t,qn)}findClosingArithmeticBracket(e,t=this.srcEnd){return this.findClosingShellDelimiter(e,t,qn,!1,!1)}findClosingBrace(e,t=this.srcEnd){return this.findClosingShellDelimiter(e,t,or)}findClosingParenthesis(e,t=this.srcEnd){let r=this.pos,n=this.srcEnd,o=this._unbalanced;this.pos=e,this.srcEnd=Math.min(t,this.srcEnd),this.extractBalanced();let s=this._unbalanced?-1:this.pos-1;return this.pos=r,this.srcEnd=n,this._unbalanced=o,s}findArithmeticExpansionEnd(e,t=this.srcEnd){let r=new xn(this.src,e,t);return r.pos=e+1,r.scanArithmeticBody(),r.pos}findArithmeticWordEnd(e,t=this.srcEnd){let r=new xn(this.src,e,t);return r.pos=e,r.scanArithmeticWordEnd()}scanArithmeticWordEnd(){while(this.pos<this.srcEnd){let e=this.src.charCodeAt(this.pos);if(e===ce){this.readDollar();continue}if(e===de){this.readBacktickExpansion();continue}if(e===Fe){this.pos++,this.skipSQ();continue}if(e===ke){this.pos++,this.skipDQ();continue}if(e===re){this.pos+=2;continue}if(e===Vt){let t=this.findClosingBracket(this.pos+1);if(t!==-1){this.pos=t+1;continue}}if((e===we||e===je)&&this.src.charCodeAt(this.pos+1)===J){this.pos+=2,this.extractBalanced();continue}if(e<128&&o0[e])break;this.pos++}return this.pos}findClosingShellDelimiter(e,t,r,n=!1,o=!0){let s=this.pos,i=this.srcEnd,a=this._unbalanced;this.srcEnd=Math.min(t,this.srcEnd);let c=[r],l=e,u=!0;while(l<this.srcEnd){let f=this.src.charCodeAt(l);if(f===re){if(l+1<this.srcEnd&&this.src.charCodeAt(l+1)!==Re)u=!1;l+=2;continue}if(f===Ct&&n&&c.length===1&&u){while(l<this.srcEnd&&this.src.charCodeAt(l)!==Re)l++;continue}if(f===Fe){this.pos=l+1,this.skipSQ(),l=this.pos,u=!1;continue}if(f===ke){this.pos=l+1,this.skipDQ(),l=this.pos,u=!1;continue}if(f===de){l++;while(l<this.srcEnd&&this.src.charCodeAt(l)!==de){if(this.src.charCodeAt(l)===re)l++;l++}if(l<this.srcEnd)l++;u=!1;continue}if(f===ce&&l+1<this.srcEnd&&this.src.charCodeAt(l+1)===J||(f===we||f===je)&&l+1<this.srcEnd&&this.src.charCodeAt(l+1)===J){this.pos=l+2,this.extractBalanced(),l=this.pos,u=!1;continue}let d=c[c.length-1];if(f===ce&&l+1<this.srcEnd){let h=this.src.charCodeAt(l+1);if(h===ce){l+=2,u=!1;continue}if(h===Ge&&o){c.push(or),l+=2,u=!1;continue}}if(d===qn&&f===Vt)c.push(qn);else if(d===ft&&f===J)c.push(ft);else if(f===d){if(c.pop(),c.length===0)return this.pos=s,this.srcEnd=i,this._unbalanced=a,l;u=!1,l++;continue}u=f<128&&(Te[f]&1)!==0,l++}return this.pos=s,this.srcEnd=i,this._unbalanced=a,-1}skipSubshellBody(){return this.extractBalanced(),this._unbalanced?-1:this.pos}skipCompoundBody(e){let t=[{close:e,phase:e===p.Esac?"case-pattern":"commands"}],r=!0;for(;;){let n=this.next(r?k.CommandStart:k.Normal),o=n.token;if(o===p.EOF)return-1;let s=t.length-1,i=t[s];if(i.phase==="function-name"){if(o===p.Newline)continue;i.phase="function-body",r=!0;continue}else if(i.phase==="function-body"){if(o===p.Newline)continue;if(i.phase="commands",r=!0,o===p.LParen&&this.peek(k.Normal).token===p.RParen){this.next(k.Normal),i.phase="function-body";continue}}else if(i.phase==="coproc-command"){if(o===p.Newline)continue;if(o===p.Word){i.phase="coproc-body",r=!0;continue}i.phase="commands",r=!0}else if(i.phase==="coproc-body"){if(o===p.Newline)continue;if(i.phase=o===p.Word&&n.keywordEligible&&n.value==="time"?"time-command":"commands",r=!0,i.phase==="time-command")continue}else if(i.phase==="time-command"){if(o===p.Word&&n.keywordEligible&&n.value==="-p"){i.phase="time-command-after-p";continue}if(o===p.Word&&n.keywordEligible&&n.value==="--"){i.phase="commands";continue}i.phase="commands",r=!0}else if(i.phase==="time-command-after-p"){if(o===p.Word&&n.keywordEligible&&n.value==="--"){i.phase="commands";continue}i.phase="commands",r=!0}else if(i.phase==="for-header"){if(o===p.ArithCmd||o===p.Semi||o===p.Newline){r=!0;continue}if(o===p.Do||o===p.LBrace){i.close=o===p.Do?p.Done:p.RBrace,i.phase="commands",r=!0;continue}}else if(i.phase==="case-word"){if(o===p.Newline)continue;i.phase="case-in",r=!1;continue}else if(i.phase==="case-in"){if(o===p.Newline){r=!0;continue}i.phase="case-pattern",r=!0;continue}else if(i.phase==="case-pattern"){if(o===p.Esac&&r){if(t.pop(),t.length===0)return n.end;r=!1;continue}if(o===p.RParen)i.phase="commands",r=!0;else r=o===p.Newline;continue}if(o===i.close){if(t.pop(),t.length===0)return n.end;r=!1;continue}if(r)switch(o){case p.LParen:t.push({close:p.RParen,phase:"commands"});break;case p.LBrace:t.push({close:p.RBrace,phase:"commands"});break;case p.If:t.push({close:p.Fi,phase:"commands"});break;case p.For:t.push({close:p.Done,phase:"for-header"});break;case p.While:case p.Until:case p.Select:t.push({close:p.Done,phase:"commands"});break;case p.Case:t.push({close:p.Esac,phase:"case-word"});break;case p.DblLBracket:if(!this.skipTestCommandBody())return-1;r=!1;continue;case p.Assignment:case p.Redirect:case p.Bang:case p.Then:case p.Else:case p.Elif:case p.Do:case p.In:break;case p.Semi:case p.Newline:case p.Pipe:case p.And:case p.Or:case p.Amp:case p.DoubleSemi:case p.SemiAmp:case p.DoubleSemiAmp:break;case p.Function:i.phase="function-name";break;case p.Coproc:i.phase="coproc-command";break;default:if(o===p.Word&&n.keywordEligible&&n.value==="time")i.phase="time-command",r=!0;else r=!1;continue}switch(o){case p.Semi:case p.Newline:case p.Pipe:case p.And:case p.Or:case p.Amp:r=!0;break;case p.DoubleSemi:case p.SemiAmp:case p.DoubleSemiAmp:if(i.close===p.Esac)i.phase="case-pattern";r=!0;break;case p.RParen:r=!0;break}}}skipTestGroup(){let e=1;for(;;){let t=this.next(k.TestMode);if(t.token===p.EOF)return-1;if(t.token===p.DblRBracket)return this.unshift(t),-1;if(t.token===p.LParen)e++;else if(t.token===p.RParen&&--e===0)return t.end}}skipTestCommandBody(){for(;;){let e=this.next(k.TestMode).token;if(e===p.DblRBracket)return!0;if(e===p.EOF)return!1}}buildWordParts(e){this._buildParts=!0,this.pos=e;let t=this.src.charCodeAt(e);if((t===60||t===62)&&e+1<this.srcEnd&&this.src.charCodeAt(e+1)===40){this.pos=e+2;let r=this.extractBalanced();if(this._unbalanced)this.errors.push({message:"unterminated process substitution",pos:e});let o={type:"ProcessSubstitution",text:this.src.slice(e,this.pos),operator:t===60?"<":">",script:void 0,inner:r??void 0,innerStart:e+2};if(this.collect(o),this.pos<this.srcEnd)if(this.readWordText(),this._wordParts)this._wordParts.unshift(o);else this._wordParts=[o];else this._wordParts=[o]}else this.readWordText();return this._wordParts}buildEmbeddedWordParts(e){return this._buildParts=!0,this.pos=e,this.readInnerWordText(),this._wordParts}buildHereDocParts(e,t){this._buildParts=!0;let r=this.src,n=[],o="",s=e,i=e,a=()=>{if(o)n.push({type:"Literal",value:o,text:r.slice(s,i)}),o=""};while(i<t){let c=r.charCodeAt(i);if(c===92){if(i+1<t){let l=r.charCodeAt(i+1);if(l===36||l===96||l===92){o+=String.fromCharCode(l),i+=2;continue}}o+="\\",i++;continue}if(c===36){if(a(),s=i,this.pos=i,this.readDollar(),this._resultPart)n.push(this._resultPart),s=this.pos;else o+=r.slice(i,this.pos);i=this.pos;continue}if(c===96){if(a(),s=i,this.pos=i,this.readBacktickExpansion(),this._resultPart)n.push(this._resultPart),s=this.pos;else o+=r.slice(i,this.pos);i=this.pos;continue}o+=r[i],i++}return a(),n.length>1||n.length===1&&n[0].type!=="Literal"?n:null}registerHereDocTarget(e){if(this.pendingHereDocs===null)return;for(let t of this.pendingHereDocs)if(!t.target){t.target=e;return}}readTestRegexWord(){this.hasPeek=!1,this.skipSpacesAndTabs();let e=this.src,t=this.srcEnd,r=this.pos,n=0;while(this.pos<t){let o=e.charCodeAt(this.pos);if(o===J){n++,this.pos++;continue}if(o===re){this.pos+=this.pos+1<t?2:1;continue}if(o===Fe){let s=this.pos++,i=s>r&&e.charCodeAt(s-1)===ce;while(this.pos<t&&e.charCodeAt(this.pos)!==Fe){if(i&&e.charCodeAt(this.pos)===re&&this.pos+1<t)this.pos++;this.pos++}if(this.pos<t)this.pos++;else this.errors.push({message:i?"unterminated ANSI-C quote":"unterminated single quote",pos:s});continue}if(o===ke){this.pos++,this.readDoubleQuoted();continue}if(o===de){this.readBacktickExpansion();continue}if(n>0){if(o===ft)n--;this.pos++;continue}if(o===ce){this.readDollar();continue}if((o===we||o===je)&&this.pos+1<t&&e.charCodeAt(this.pos+1)===J){let s=this.pos;if(this.pos+=2,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated process substitution",pos:s});continue}if(o<128&&Te[o]&1&&o!==jr)break;this.pos++}return Ye(this.current,p.Word,e.slice(r,this.pos),r,this.pos),this.current}readCStyleForExprs(){this.hasPeek=!1;let e=this.src,t=this.srcEnd;while(this.pos<t&&(e.charCodeAt(this.pos)===Xr||e.charCodeAt(this.pos)===On))this.pos++;if(this.pos<t&&e.charCodeAt(this.pos)===J)this.pos++;let r=[this.pos,0,0],n=["","","",0,0,0],o=0,s=1,i=this.pos;while(this.pos<t&&s>0){let a=e.charCodeAt(this.pos);if(a===J)s++,this.pos++;else if(a===ft){if(s--,s===0){let c=e.slice(i,this.pos);n[o]=c.trim(),n[3+o]=r[o]+c.length-c.trimStart().length,this.pos++;while(this.pos<t&&(e.charCodeAt(this.pos)===Xr||e.charCodeAt(this.pos)===On))this.pos++;if(this.pos<t&&e.charCodeAt(this.pos)===ft)this.pos++;break}this.pos++}else if(a===Ha&&s===1){let c=e.slice(i,this.pos);if(n[o]=c.trim(),n[3+o]=r[o]+c.length-c.trimStart().length,o<2)o++;this.pos++,i=this.pos,r[o]=i}else if(a===Fe)this.pos++,this.skipSQ();else if(a===ke)this.pos++,this.skipDQ();else this.pos++}return n}peek(e=k.Normal){if(!this.hasPeek)this.readNext(this.nextState,e),this.hasPeek=!0;return this.nextState}peekFollow(e){if(!this.hasPeek){let t=e[this.current.token]?k.CommandStart:k.Normal;this.readNext(this.nextState,t),this.hasPeek=!0}return this.nextState}next(e=k.Normal){if(this.hasPeek){this.hasPeek=!1;let t=this.current;return this.current=this.nextState,this.nextState=t,this.current}return this.readNext(this.current,e),this.current}unshift(e){this.nextState.copyFrom(e),this.hasPeek=!0}readNext(e,t){let r=this.src,n=this.srcEnd,o=this.pos;while(o<n){let a=r.charCodeAt(o);if(a===Xr||a===On){o++;continue}if(a===re&&o+1<n&&r.charCodeAt(o+1)===Re){o+=2;continue}if(a===Re&&t===k.TestMode){o++;continue}break}if(this.pos=o,o>=n){this.consumePendingHereDocs(),Ye(e,p.EOF,"",o,o);return}let s=o,i=r.charCodeAt(o);if(i===Ct){while(this.pos<n&&r.charCodeAt(this.pos)!==Re)this.pos++;this.readNext(e,t);return}if(i===Re){this.pos++,this.consumePendingHereDocs(),Ye(e,p.Newline,`
|
|
38
|
+
`,s,this.pos);return}if(t===k.TestMode&&(i===we||i===je)&&!(this.pos+1<this.srcEnd&&r.charCodeAt(this.pos+1)===J)){this.pos++,Ye(e,p.Word,i===we?"<":">",s,this.pos),e.keywordEligible=!0;return}if(i<128&&Te[i]&1&&this.tryReadOperator(e,i,t,s))return;this.readWord(e,t,s)}tryReadOperator(e,t,r,n){let o=this.src,s=this.pos,i=s+1<this.srcEnd?o.charCodeAt(s+1):0;switch(t){case Ha:if(i===Ha){if(s+2<this.srcEnd&&o.charCodeAt(s+2)===pr)return this.pos+=3,Ye(e,p.DoubleSemiAmp,";;&",n,this.pos),!0;return this.pos+=2,Ye(e,p.DoubleSemi,";;",n,this.pos),!0}if(i===pr)return this.pos+=2,Ye(e,p.SemiAmp,";&",n,this.pos),!0;return this.pos++,Ye(e,p.Semi,";",n,this.pos),!0;case jr:if(i===jr)return this.pos+=2,Ye(e,p.Or,"||",n,this.pos),!0;if(i===pr)return this.pos+=2,Ye(e,p.Pipe,"|&",n,this.pos),!0;return this.pos++,Ye(e,p.Pipe,"|",n,this.pos),!0;case pr:if(i===pr)return this.pos+=2,Ye(e,p.And,"&&",n,this.pos),!0;if(i===je){this.pos+=2;let a=this.pos<this.srcEnd&&o.charCodeAt(this.pos)===je;if(a)this.pos++;this.skipSpacesAndTabs();let c=this.pos;if(this.pos<this.srcEnd&&o.charCodeAt(this.pos)!==Re&&o.charCodeAt(this.pos)!==Ct)this.readRedirectTargetText();return this.redirectToken(e,a?"&>>":"&>",n,c),!0}return this.pos++,Ye(e,p.Amp,"&",n,this.pos),!0;case J:if(r===k.CommandStart&&i===J){let a=this.errors.length;if(this.readArithmeticCommand(e,n),!this._notArithmetic)return!0;this.errors.length=a,this.pos=n}return this.pos++,Ye(e,p.LParen,"(",n,this.pos),!0;case ft:return this.pos++,Ye(e,p.RParen,")",n,this.pos),!0;case we:case je:return this.readRedirection(e,n);default:return!1}}readRedirection(e,t){let r=this.src,n=r.charCodeAt(this.pos),o="";if(n===we){this.pos++;let s=this.pos<this.srcEnd?r.charCodeAt(this.pos):0;if(s===we){this.pos++;let i=this.pos<this.srcEnd?r.charCodeAt(this.pos):0;if(i===we){this.pos++,this.skipSpacesAndTabs();let u=this.pos;if(this.pos<this.srcEnd&&r.charCodeAt(this.pos)!==Re&&r.charCodeAt(this.pos)!==Ct)this.readRedirectTargetText();return this.redirectToken(e,"<<<",t,u),!0}let a=i===_t;if(a)this.pos++;this.skipSpacesAndTabs();let c=this.pos;if(this.pos>=this.srcEnd||r.charCodeAt(this.pos)!==Ct)this.readHereDocDelimiter();let l=this.pos>c;if(l)(this.pendingHereDocs??=[]).push({delimiter:this._hereDelim,strip:a,quoted:this._hereQuoted});return Ye(e,p.Redirect,a?"<<-":"<<",t,this.pos),e.content=l?this._hereDelim:void 0,e.targetPos=c,e.targetEnd=l?this.pos:c,!0}if(s===J)return this.readProcessSubstitution(e,"<",t),!0;if(s===je)o="<>",this.pos++;else if(s===pr)o="<&",this.pos++;else o="<"}else if(n===je){this.pos++;let s=this.pos<this.srcEnd?r.charCodeAt(this.pos):0;if(s===J)return this.readProcessSubstitution(e,">",t),!0;if(s===je)o=">>",this.pos++;else if(s===pr)o=">&",this.pos++;else if(s===jr)o=">|",this.pos++;else o=">"}if(this.skipSpacesAndTabs(),this.pos<this.srcEnd){let s=r.charCodeAt(this.pos);if((s===we||s===je)&&this.pos+1<this.srcEnd&&r.charCodeAt(this.pos+1)===J){let a=this.pos;if(this.pos+=2,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated process substitution",pos:a});let c=r.slice(a,this.pos);return Ye(e,p.Redirect,o,t,this.pos),e.content=c,e.targetPos=a,e.targetEnd=this.pos,!0}let i=this.pos;if(s!==Re&&s!==Ct)this.readRedirectTargetText();return this.redirectToken(e,o,t,i),!0}return this.redirectToken(e,o,t,this.pos),!0}readRedirectTargetText(){let e=this._buildValue;this._buildValue=!0,this.readWordText(),this._buildValue=e}redirectToken(e,t,r,n){let o=this.pos>n&&(this._wordText.length>0||this._wordQuoted);Ye(e,p.Redirect,t,r,this.pos),e.content=o?this._wordText:void 0,e.targetPos=n,e.targetEnd=o?this.pos:n}readProcessSubstitution(e,t,r){if(this.pos++,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated process substitution",pos:r});let n=this.src.slice(r,this.pos);Ye(e,p.Word,n,r,this.pos)}readHereDocDelimiter(){let e=this.src,t=this.srcEnd,r=this._buildValue;this._buildValue=!0;let n="",o=!1;while(this.pos<t){let s=e.charCodeAt(this.pos);if(s===Fe){o=!0,this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==Fe)n+=e[this.pos],this.pos++;if(this.pos<t)this.pos++}else if(s===ke){o=!0,this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==ke){if(e.charCodeAt(this.pos)===re&&this.pos+1<t){let i=e.charCodeAt(this.pos+1);if(i===Re){this.pos+=2;continue}if(i===ce||i===de||i===ke||i===re)this.pos++}n+=e[this.pos],this.pos++}if(this.pos<t)this.pos++}else if(s===re){if(this.pos+1<t&&e.charCodeAt(this.pos+1)===Re){this.pos+=2;continue}if(o=!0,this.pos++,this.pos<t)n+=e[this.pos],this.pos++;else n+="\\"}else if(s===de){let i=this.pos;this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==de){if(e.charCodeAt(this.pos)===re)this.pos++;this.pos++}if(this.pos<t)this.pos++;n+=e.slice(i,this.pos)}else if(s===ce){let i=this.pos+1<t?e.charCodeAt(this.pos+1):0;if(i===Fe||i===ke)o=!0;this.readDollar(),n+=this._resultText}else if(s<128&&Te[s]&1)break;else n+=e[this.pos],this.pos++}this._buildValue=r,this._hereDelim=n,this._hereQuoted=o}consumePendingHereDocs(){let e=this.pendingHereDocs;if(e===null||e.length===0)return;for(let t of e){let r=this.pos,n=this.readHereDocBody(t.delimiter,t.strip);if(t.target){if(t.target.content=n,t.quoted)t.target.heredocQuoted=!0;else if(n){let o=this.parseHereDocBody(n,r);if(o)t.target.body=o}}}e.length=0}readHereDocBody(e,t){let r=this.pos,n=this.skipHereDocBody(e,t);return this.src.slice(r,n)}matchHereDocDelimiter(e,t,r,n){let o=this.src,s=t;for(let i=0;i<e.length;){if(n&&o.charCodeAt(s)===re&&s+1<r&&o.charCodeAt(s+1)===Re){s+=2;continue}if(s>=r||o.charCodeAt(s)!==e.charCodeAt(i))return-1;s++,i++}return s}logicalLineEnd(e,t,r){let n=this.src,o=e;while(o<t){let s=n.charCodeAt(o);if(s===Re)return o;o+=r&&s===re?2:1}return t}skipHereDocBody(e,t,r=!1,n=!1){let o=this.src,s=this.srcEnd,i=e.length;while(this.pos<s){let a=this.pos,c=o.indexOf(`
|
|
39
|
+
`,this.pos);if(c===-1||c>s)c=s;if(t)while(a<c&&o.charCodeAt(a)===On)a++;if(c-a===i&&o.startsWith(e,a)){let l=this.pos;return this.pos=c<s?c+1:c,l}if(r){let l=this.matchHereDocDelimiter(e,a,s,!n);if(l!==-1){let u=o.indexOf(")",l);if(u!==-1&&u<this.logicalLineEnd(a,s,!n)){let f=this.pos;return this.pos=l,f}}}this.pos=c<s?c+1:c}return this.pos}parseHereDocBody(e,t){let r=!1;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o===de){r=!0;break}if(o===ce){let s=n+1<e.length?e.charCodeAt(n+1):0;if(s===Ge||s===J||s===ce||s>=Io&&s<=Fo||s>=Cs&&s<=Qs||s===_s||s===nr||s===Ct||s===vs||s===gn||s===vr||s===_t||s>=hr&&s<=mr){r=!0;break}}if(o===re)n++}if(!r)return null;return new Et(e,t,t+e.length,this.src,Et._resolveHeredocBody,this._nestingDepth)}_wordText="";_wordRaw=!1;_wordQuoted=!1;_wordHasExpansions=!1;_wordKeywordEligible=!1;_wordIsAssignment;_wordAssignmentOperatorPos;_wordParts=null;_resultText="";_resultIsRaw=!0;_resultHasExpansion=!1;_resultPart;_unbalanced=!1;_notArithmetic=!1;_dqText="";_dqHasExpansions=!1;_dqParts=null;_dqEnd=0;_hereDelim="";_hereQuoted=!1;readWord(e,t,r=0){this.readWordText(),this.classifyWord(e,t,r)}classifyWord(e,t,r){let n=this.src,o=this._wordRaw,s=this._wordHasExpansions,i=this._wordQuoted,a=this._wordKeywordEligible,c=this._wordIsAssignment,l=this._wordAssignmentOperatorPos,u=this.pos,f=u-r,d=null;if(!o&&!s){let h=u<this.srcEnd?n.charCodeAt(u):0;if(!i&&f<=16||h===we||h===je)d=this.wordValueOf(r,u)}if(t===k.CommandStart&&a){if(o){if(f<=8){let h=kD(n,r,f);if(h!==void 0){au(e,h,r,u,!0);return}}if(f===2&&n.charCodeAt(r)===Vt&&n.charCodeAt(r+1)===Vt){au(e,p.DblLBracket,r,u,!0);return}}else if(d!==null&&d.length>0){let h=d.charCodeAt(0);if(h>=Io&&h<=Fo&&d.length<=8||h===nr||h===Ge||h===or){let m=xD.get(d);if(m!==void 0){Ye(e,m,d,r,u);return}}if(h===Vt&&d==="[["){Ye(e,p.DblLBracket,d,r,u);return}}}if(t===k.CommandStart||t===k.CommandPrefix){if(c===void 0){let h=-1,m=!1;for(let b=r+1;b<u;b++){let x=n.charCodeAt(b);if(x===Pe){h=b;break}if(x===Vt)m=!0}if(h!==-1){let b=iu(n,r,u,rp);if(r0(b))l=n0(b)}else if(m&&u<this.srcEnd&&iu(n,r,u,rp)>=Vr){this.pos=r,this.readWordText(!0),this.classifyWord(e,t,r);return}}if(l!==void 0){if(au(e,p.Assignment,r,u,o),d!==null)e._value=d;e.assignmentOperatorPos=l;return}}if((t===k.CommandStart||t===k.TestMode)&&a){if(o){if(f===2&&n.charCodeAt(r)===qn&&n.charCodeAt(r+1)===qn){au(e,p.DblRBracket,r,u,!0);return}}else if(d==="]]"){Ye(e,p.DblRBracket,d,r,u);return}}if(!s&&this.pos<this.srcEnd){let h=n.charCodeAt(this.pos);if(h===we||h===je){if(o){let m=n.charCodeAt(r);if(m>=hr&&m<=mr&&ED(n,r,u)){let b=Number.parseInt(n.slice(r,u),10);if(this.readRedirection(e,r)){e.fileDescriptor=b;return}}if(m===Ge&&f>2&&n.charCodeAt(u-1)===or){let b=n.slice(r+1,u-1);if(this.readRedirection(e,r)){e.variableName=b;return}}}else if(d!==null&&d.length>0){if(d.charCodeAt(0)>=hr&&d.charCodeAt(0)<=mr&&SD(d)){let m=Number.parseInt(d,10);if(this.readRedirection(e,r)){e.fileDescriptor=m;return}}if(d.charCodeAt(0)===Ge&&d.charCodeAt(d.length-1)===or&&d.length>2){let m=d.slice(1,-1);if(this.readRedirection(e,r)){e.variableName=m;return}}}}}if(au(e,p.Word,r,u,o),d!==null)e._value=d;e.keywordEligible=a}readWordText(e=!1){let t=this.src,r=this.srcEnd,n=this.pos,o=n,s=0;while(n<r){let S=t.charCodeAt(n);if(S<128&&Te[S]){s=S;break}n++}if(n>=r||Te[s]&1&&!(s===J&&n>o&&Rs[t.charCodeAt(n-1)])&&!e){if(this.pos=n,this._wordText=(this._buildParts||this._buildValue)&&n>o?t.slice(o,n):"",this._wordRaw=!0,this._wordQuoted=!1,this._wordHasExpansions=!1,this._wordKeywordEligible=!0,this._wordIsAssignment=void 0,this._wordAssignmentOperatorPos=void 0,this._buildParts)this._wordParts=null;return}let i=this._buildParts,a=i||this._buildValue,c=a&&n>o?t.slice(o,n):"",l=!1,u=!1,f=!0,d=!0,h=n>o?t.charCodeAt(n-1):0,m=iu(t,o,n,rp),b,x="",O=0;if(i)b=[],x=c,O=o;while(n<r){let S=t.charCodeAt(n);if(S>=128||!Te[S]){let y=n;n++;while(n<r){let g=t.charCodeAt(n);if(g<128&&Te[g])break;n++}if(h=t.charCodeAt(n-1),m=iu(t,y,n,m),a){let g=t.slice(y,n);if(c+=g,i)x+=g}continue}if(Te[S]&1){if(S===J&&h<128&&Rs[h]){f=!1;let y=h;n++;let g=n,C=this.findClosingShellDelimiter(g,r,ft,y===Pe),Q=C===-1?r:C;if(n=C===-1?r:C+1,C===-1)this.errors.push({message:"unterminated extended glob",pos:g-2});if(h=t.charCodeAt(n-1),a){let w="("+t.slice(g,n);if(c+=w,i&&y!==Pe){if(x.length>0){let I=x.slice(0,-1);if(I)b.push({type:"Literal",value:I,text:t.slice(O,g-2)});x=""}let _=yD[y];b.push({type:"ExtendedGlob",text:_+w,operator:_,pattern:t.slice(g,Q),parts:$s(t,g,Q)?this.parseSubFieldWord(g,Q).parts:void 0}),O=n}else if(i)x+=w}continue}if(e&&m>=Vr){let y=this.findClosingBracket(n);if(y!==-1){let g=y+1;if(m=iu(t,n,g,m),h=t.charCodeAt(y),a){let C=t.slice(n,g);if(c+=C,i)x+=C}n=g;continue}}break}if(S===re){if(n++,n<r)if(t.charCodeAt(n)===Re)n++,d=!1;else{if(m>=0&&m<Vr)m=Br;if(l=!0,f=!1,d=!1,h=t.charCodeAt(n),a){if(c+=t[n],i)x+=t[n]}n++}else{if(m>=0&&m<Vr)m=Br;if(l=!0,f=!1,h=re,a){if(c+="\\",i)x+="\\"}}continue}if(S===Fe){let y=n;if(m>=0&&m<Vr)m=Br;l=!0,f=!1,d=!1,n++;let g=n;while(n<r&&t.charCodeAt(n)!==Fe)n++;if(n>g)h=t.charCodeAt(n-1);let C=a?t.slice(g,n):"";if(a)c+=C;if(n<r)n++;else this.errors.push({message:"unterminated single quote",pos:g-1});if(i){if(x)b.push({type:"Literal",value:x,text:t.slice(O,y)}),x="";b.push({type:"SingleQuoted",value:C,text:t.slice(y,n)}),O=n}continue}if(S===ke){let y=n;if(m>=0&&m<Vr)m=Br;if(l=!0,f=!1,d=!1,n++,this.pos=n,this.readDoubleQuoted(),n=this.pos,this._dqEnd>y+1)h=t.charCodeAt(this._dqEnd-1);if(this._dqHasExpansions)u=!0;if(a)c+=this._dqText;if(i){if(x)b.push({type:"Literal",value:x,text:t.slice(O,y)}),x="";let g=t.slice(y,n);b.push({type:"DoubleQuoted",text:g,parts:this._dqParts??[{type:"Literal",value:this._dqText,text:t.slice(y+1,this._dqEnd)}]}),O=n}continue}if(S===ce){f=!1;let y=n;if(m>=0&&m<Vr)m=Br;if(this.pos=n,this.readDollar(),n=this.pos,!this._resultIsRaw)d=!1;if(n>y)h=t.charCodeAt(n-1);if(this._resultHasExpansion)u=!0;if(a)c+=this._resultText;if(i)if(this._resultPart){if(x)b.push({type:"Literal",value:x,text:t.slice(O,y)}),x="";b.push(this._resultPart),O=n}else x+=this._resultText;continue}if(S===de){f=!1;let y=n;if(m>=0&&m<Vr)m=Br;if(this.pos=n,this.readBacktickExpansion(),n=this.pos,d=!1,h=t.charCodeAt(n-1),u=!0,a)c+=this._resultText;if(i){if(x)b.push({type:"Literal",value:x,text:t.slice(O,y)}),x="";b.push(this._resultPart),O=n}continue}if(S===Ge){if(m>=0&&m<Vr)m=Br;let y=PD(t,n,r);if(y>0){if(f=!1,h=t.charCodeAt(y-1),a){let g=t.slice(n,y);if(c+=g,i){if(x)b.push({type:"Literal",value:x,text:t.slice(O,n)}),x="";b.push({type:"BraceExpansion",text:g,parts:$s(t,n+1,y-1)?this.parseSubFieldWord(n+1,y-1).parts:void 0}),O=y}}n=y;continue}if(h=Ge,a){if(c+="{",i)x+="{"}n++;continue}n++}if(i&&x)b.push({type:"Literal",value:x,text:t.slice(O,n)});if(this.pos=n,this._wordText=c,this._wordRaw=d,this._wordQuoted=l,this._wordHasExpansions=u,this._wordKeywordEligible=f,this._wordIsAssignment=r0(m),this._wordAssignmentOperatorPos=this._wordIsAssignment?n0(m):void 0,i)this._wordParts=b.length>1||b.length===1&&b[0].type!=="Literal"?b:null}readInnerWordText(){let e=this.src,t=this.srcEnd,r=this.pos,n="",o=this._buildParts,s,i="",a=0;if(o)s=[],a=r;while(r<t){let c=e.charCodeAt(r);if(c===re){if(r++,r<t)if(e.charCodeAt(r)===Re)r++;else{let l=e[r++];if(n+=l,o)i+=l}continue}if(c===Fe){let l=r;r++;let u=r;while(r<t&&e.charCodeAt(r)!==Fe)r++;let f=e.slice(u,r);if(n+=f,r<t)r++;if(o){if(i)s.push({type:"Literal",value:i,text:e.slice(a,l)}),i="";s.push({type:"SingleQuoted",value:f,text:e.slice(l,r)}),a=r}continue}if(c===ke){let l=r;if(r++,this.pos=r,this.readDoubleQuoted(),r=this.pos,n+=this._dqText,o){if(i)s.push({type:"Literal",value:i,text:e.slice(a,l)}),i="";let u=e.slice(l,r);s.push({type:"DoubleQuoted",text:u,parts:this._dqParts??[{type:"Literal",value:this._dqText,text:e.slice(l+1,this._dqEnd)}]}),a=r}continue}if(c===ce){let l=r;if(this.pos=r,this.readDollar(),r=this.pos,n+=this._resultText,o)if(this._resultPart){if(i)s.push({type:"Literal",value:i,text:e.slice(a,l)}),i="";s.push(this._resultPart),a=r}else i+=this._resultText;continue}if(c===de){let l=r;if(this.pos=r,this.readBacktickExpansion(),r=this.pos,n+=this._resultText,o){if(i)s.push({type:"Literal",value:i,text:e.slice(a,l)}),i="";s.push(this._resultPart),a=r}continue}if((c===we||c===je)&&r+1<t&&e.charCodeAt(r+1)===J){let l=r;this.pos=r+2;let u=this.extractBalanced();r=this.pos;let f=e.slice(l,r);if(n+=f,o){if(i)s.push({type:"Literal",value:i,text:e.slice(a,l)}),i="";let d={type:"ProcessSubstitution",text:f,operator:c===we?"<":">",script:void 0,inner:u,innerStart:l+2};s.push(d),this.collect(d),a=r}continue}if(n+=e[r],o)i+=e[r];r++}if(o&&i)s.push({type:"Literal",value:i,text:e.slice(a,r)});if(this.pos=r,this._wordText=n,this._wordRaw=!1,this._wordQuoted=!1,this._wordHasExpansions=!1,this._wordKeywordEligible=!1,o)this._wordParts=s.length>1||s.length===1&&s[0].type!=="Literal"?s:null}parseSubFieldWord(e,t){if(e>=t)return new Et("",e,e);if(this._nestingDepth>=$t)return new Et(this.src.slice(e,t),e,t);this._nestingDepth++;let r=this.srcEnd,n=this.pos,o=this._wordText,s=this._wordParts,i=this._wordQuoted,a=this._wordKeywordEligible;this.srcEnd=t,this.pos=e,this.readInnerWordText();let c=new Et(this.src.slice(e,t),e,t);if(this._buildParts&&this._wordParts)c.parts=this._wordParts;return this.srcEnd=r,this.pos=n,this._wordText=o,this._wordParts=s,this._wordQuoted=i,this._wordKeywordEligible=a,this._nestingDepth--,c}skipSQ(){while(this.pos<this.srcEnd&&this.src.charCodeAt(this.pos)!==Fe)this.pos++;if(this.pos<this.srcEnd)this.pos++}skipAnsiCQuoted(){let e=this.pos-1,t=jg(this.src,this.pos,this.srcEnd);if(this.pos=t.end,!t.closed)this.errors.push({message:"unterminated ANSI-C quote",pos:e})}skipDQ(){let e=this.src,t=this.srcEnd;while(this.pos<t){let r=e.charCodeAt(this.pos);if(r===ke){this.pos++;return}if(r===re){this.pos+=2;continue}if(r===ce&&this.pos+1<t){let n=e.charCodeAt(this.pos+1);if(n===J){let o=this.pos;if(this.pos+=2,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated command substitution",pos:o});continue}if(n===Ge){this.pos+=2;let o=1;while(this.pos<t&&o>0){let s=e.charCodeAt(this.pos);if(s===or){if(--o===0){this.pos++;break}}else if(s===Ge&&this.pos>0&&e.charCodeAt(this.pos-1)===ce)o++;else if(s===re)this.pos++;else if(s===Fe){this.pos++,this.skipSQ();continue}else if(s===ke){this.pos++,this.skipDQ();continue}this.pos++}continue}}if(r===de){this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==de){if(e.charCodeAt(this.pos)===re)this.pos++;this.pos++}if(this.pos<t)this.pos++;continue}this.pos++}}skipSpacesAndTabs(){let e=this.src,t=this.srcEnd;while(this.pos<t){let r=e.charCodeAt(this.pos);if(r===Xr||r===On)this.pos++;else if(r===re&&this.pos+1<t&&e.charCodeAt(this.pos+1)===Re)this.pos+=2;else break}}readDoubleQuoted(){let e=this.src,t=this.srcEnd,r=this.pos,n=!1,o=this._buildParts,s=o||this._buildValue;if(!o){let u=this.pos;while(u<t){let f=e.charCodeAt(u);if(f===ke){this._dqText=s?e.slice(r,u):"",this._dqEnd=u,this.pos=u+1,this._dqHasExpansions=!1,this._dqParts=null;return}if(f===ce||f===de||f===re)break;u++}}let i="",a=null,c="",l=o?this.pos:0;while(this.pos<t&&e.charCodeAt(this.pos)!==ke){let u=this.pos;while(this.pos<t){let d=e.charCodeAt(this.pos);if(d===ke||d===re||d===ce||d===de)break;this.pos++}if(s&&this.pos>u){let d=e.slice(u,this.pos);if(i+=d,o)c+=d}if(this.pos>=t||e.charCodeAt(this.pos)===ke)break;let f=e.charCodeAt(this.pos);if(f===re){if(this.pos++,this.pos<t){let d=e.charCodeAt(this.pos);if(d===Re){this.pos++;continue}if(s)if(d===ce||d===de||d===ke||d===re){let h=e[this.pos];if(i+=h,o)c+=h}else{let h="\\"+e[this.pos];if(i+=h,o)c+=h}this.pos++}continue}if(f===ce){let d=this.pos+1<t?e.charCodeAt(this.pos+1):0;if(d===ke||d===Fe){if(s){if(i+="$",o)c+="$"}this.pos++;continue}let h=this.pos;if(this.readDollar(),s)i+=this._resultText;if(this._resultHasExpansion)n=!0;if(o){let m=this._resultPart;if(m&&Jv(m)){if(!a)a=[];if(c)a.push({type:"Literal",value:c,text:e.slice(l,h)}),c="";a.push(m),l=this.pos}else c+=this._resultText}continue}if(f===de){let d=this.pos;if(this.readBacktickExpansion(!0),s)i+=this._resultText;if(n=!0,o&&this._resultPart&&Jv(this._resultPart)){if(!a)a=[];if(c)a.push({type:"Literal",value:c,text:e.slice(l,d)}),c="";a.push(this._resultPart),l=this.pos}continue}}if(o&&a&&c)a.push({type:"Literal",value:c,text:e.slice(l,this.pos)});if(this._dqEnd=this.pos,this.pos<t)this.pos++;else this.errors.push({message:"unterminated double quote",pos:r-1});this._dqText=i,this._dqHasExpansions=n,this._dqParts=a}readDollar(){let e=this.pos;this.pos++;let t=this.src,r=this.srcEnd,n=this._buildParts||this._buildValue;if(this.pos>=r){this._resultText="$",this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=void 0;return}let o=Bg(t,this.pos,r);if(o>this.pos&&t.charCodeAt(o)===J&&t.charCodeAt(o+1)!==J)this.pos=o;let s=t.charCodeAt(this.pos);if(s===J){if(this.pos+1<r&&t.charCodeAt(this.pos+1)===J){let i=this.pos,a=this.errors.length;if(this.readArithmeticExpansion(),!this._notArithmetic)return;this.errors.length=a,this.pos=i}this.readCommandSubstitution(e);return}if(s===Ge){let i=this.pos+1<r?t.charCodeAt(this.pos+1):0;if(i===Xr||i===On||i===Re){this.readBraceCommandSubstitution();return}if(i===jr){this.readValueSubstitution();return}this.readParameterExpansion();return}if(s===Fe){if(this.pos++,n){let i=this.readAnsiCQuoted();this._resultText=i,this._resultPart=this._buildParts?{type:"AnsiCQuoted",text:t.slice(e,this.pos),value:i}:void 0}else this.skipAnsiCQuoted(),this._resultText="",this._resultPart=void 0;this._resultIsRaw=!1,this._resultHasExpansion=!1;return}if(s===ke){if(this.pos++,this.readDoubleQuoted(),this._resultText=this._dqText,this._resultIsRaw=!1,this._resultHasExpansion=this._dqHasExpansions,this._buildParts){let i=t.slice(e,this.pos);this._resultPart={type:"LocaleString",text:i,parts:this._dqParts??[{type:"Literal",value:this._dqText,text:t.slice(e+2,this._dqEnd)}]}}else this._resultPart=void 0;return}if(s===vs||s===gn||s===Ct||s===vr||s===_t||s===ce||s===nr||s>=hr&&s<=mr){this.pos++;let i=n?t.slice(this.pos-2,this.pos):"";this._resultText=i,this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=this._buildParts?{type:"SimpleExpansion",text:i}:void 0;return}if(s<128&&As[s]&1){let i=this.pos-1;while(this.pos<r){let c=t.charCodeAt(this.pos);if(c<128&&As[c]&2)this.pos++;else break}let a=n?t.slice(i,this.pos):"";this._resultText=a,this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=this._buildParts?{type:"SimpleExpansion",text:a}:void 0;return}if(s===Vt){let i=this.findClosingArithmeticBracket(this.pos+1);if(i!==-1){let a=this.pos+1,c=t.slice(a,i);this.pos=i+1;let l=n?t.slice(e,this.pos):"";this._resultText=l,this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=this._buildParts?{type:"ArithmeticExpansion",text:l,expression:this.buildArithmeticExpression(c,a)}:void 0;return}}this._resultText="$",this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=void 0}scanArithmeticBody(){this._notArithmetic=!1,this.pos+=2;let e=1,t=0,r=0,n,o=0,s=!1,i=this.src,a=this.srcEnd,c=this.pos;while(this.pos<a&&e>0){let l=i.charCodeAt(this.pos);if(l===re)this.pos+=2;else if(l===Fe)this.pos++,this.skipSQ();else if(l===ke)this.pos++,this.skipDQ();else if(l===de){this.pos++;while(this.pos<a&&i.charCodeAt(this.pos)!==de){if(i.charCodeAt(this.pos)===re)this.pos++;this.pos++}if(this.pos<a)this.pos++}else if(l===ce&&this.pos+2<a&&i.charCodeAt(this.pos+1)===J&&i.charCodeAt(this.pos+2)!==J){let u=this.pos;if(this.pos+=2,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated command substitution",pos:u})}else if(l===ce&&this.pos+1<a&&i.charCodeAt(this.pos+1)===Ge){let u=this.findClosingBrace(this.pos+2,a);this.pos=u===-1?a:u+1}else if((l===we||l===je)&&this.pos+1<a&&i.charCodeAt(this.pos+1)===J)this.pos+=2,this.extractBalanced();else if(l===J)if(i.charCodeAt(this.pos-1)===ce&&i.charCodeAt(this.pos+1)===J){if(e===1)r=t;else(n??=[]).push(t);if(e++,t=0,++o+this._nestingDepth>=$t){if(!s)this.errors.push({message:"maximum arithmetic expansion nesting depth exceeded",pos:this.pos-1}),s=!0}this.pos+=2}else t++,this.pos++;else if(l===ft&&t>0)t--,this.pos++;else if(l===ft&&this.pos+1<a&&i.charCodeAt(this.pos+1)===ft){if(--e===0){this.pos+=2;break}t=e===1?r:n.pop(),this.pos+=2}else if(l===ft&&e===1)return this._notArithmetic=!0,"";else this.pos++}return this._buildParts||this._buildValue?i.slice(c,this.pos-2):""}readArithmeticExpansion(){let e=this.pos+2,t=this.scanArithmeticBody();if(this._notArithmetic)return;let r=this._buildParts||this._buildValue?"$(("+t+"))":"";this._resultText=r,this._resultIsRaw=!0,this._resultHasExpansion=!1,this._resultPart=this._buildParts?{type:"ArithmeticExpansion",text:r,expression:this.buildArithmeticExpression(t,e)}:void 0}buildArithmeticExpression(e,t){if(!$s(this.src,t,t+e.length))return Ka(e,t)??void 0;let r=[],n=[],o=Ka(e,t,{commandExpansions:r,embeddedWords:n,findClosingBracket:(s,i)=>this.findClosingBracket(s,i),findClosingBrace:(s,i)=>this.findClosingBrace(s,i),findClosingParenthesis:(s,i)=>this.findClosingParenthesis(s,i),findArithmeticExpansionEnd:(s,i)=>this.findArithmeticExpansionEnd(s,i),findArithmeticWordEnd:(s,i)=>this.findArithmeticWordEnd(s,i)})??void 0;for(let s of r)s.innerStart=s.pos+2,this.collect(s);for(let s of n)s.parts=this.parseSubFieldWord(s.pos,s.end).parts;return o}readArithmeticCommand(e,t){let r=this._buildValue;this._buildValue=!0;let n=this.scanArithmeticBody();this._buildValue=r,Ye(e,p.ArithCmd,n,t,this.pos)}readCommandSubstitution(e){let t=this.pos;this.pos++;let r=this.extractBalanced();if(this._unbalanced)this.errors.push({message:"unterminated command substitution",pos:e});let n=this._buildParts||this._buildValue,o=n?this.src.slice(e,this.pos):"",s=!n||t===e+1?o:"$"+this.src.slice(t,this.pos);if(this._resultText=s,this._resultIsRaw=t===e+1,this._resultHasExpansion=!0,this._buildParts)this._resultPart={type:"CommandExpansion",text:o,script:void 0,inner:r,innerStart:t+1},this.collect(this._resultPart);else this._resultPart=void 0}readBraceCommandSubstitution(){this.readBraceSubstitution(1)}readValueSubstitution(){this.readBraceSubstitution(2)}readBraceSubstitution(e){let t=this.pos-1;this.pos+=e;let r=this.src,n=this.srcEnd,o=1,s=this.pos;while(this.pos<n){let i=r.charCodeAt(this.pos);if(i===Ge)o++;else if(i===or){if(--o===0){this.pos++;break}}else if(i===Fe){this.pos++,this.skipSQ();continue}else if(i===ke){this.pos++,this.skipDQ();continue}else if(i===re)this.pos++;this.pos++}if(this._resultIsRaw=!0,this._resultHasExpansion=!0,this._buildParts||this._buildValue){let i=r.slice(s,this.pos-1),a=i.trim(),c=r.slice(t,this.pos);if(this._resultText=c,this._buildParts){let l=s+(i.length-i.trimStart().length);this._resultPart={type:"CommandExpansion",text:c,script:void 0,inner:a,innerStart:l},this.collect(this._resultPart)}else this._resultPart=void 0}else this._resultText="",this._resultPart=void 0}readBacktickExpansion(e=!1){this.pos++;let t=this.src,r=this.srcEnd,n=this.pos;if(!this._buildParts&&!this._buildValue){while(this.pos<r&&t.charCodeAt(this.pos)!==de){if(t.charCodeAt(this.pos)===re&&this.pos+1<r)this.pos++;this.pos++}if(this.pos<r)this.pos++;else this.errors.push({message:"unterminated backtick",pos:n-1});this._resultText="",this._resultIsRaw=!1,this._resultHasExpansion=!0,this._resultPart=void 0;return}let o="",s=!1;while(this.pos<r&&t.charCodeAt(this.pos)!==de){if(t.charCodeAt(this.pos)===re){s=!0;break}this.pos++}if(!s)o=t.slice(n,this.pos);else{o=t.slice(n,this.pos);while(this.pos<r&&t.charCodeAt(this.pos)!==de)if(t.charCodeAt(this.pos)===re){if(this.pos++,this.pos<r){let a=t.charCodeAt(this.pos);if(a===ce||a===de||a===re||e&&a===ke)o+=t[this.pos];else o+="\\"+t[this.pos];this.pos++}}else{let a=this.pos;while(this.pos<r){let c=t.charCodeAt(this.pos);if(c===de||c===re)break;this.pos++}o+=t.slice(a,this.pos)}}if(this.pos<r)this.pos++;else this.errors.push({message:"unterminated backtick",pos:n-1});let i=t.slice(n-1,this.pos);if(this._resultText=o,this._resultHasExpansion=!0,this._buildParts)this._resultPart={type:"CommandExpansion",text:i,script:void 0,inner:o,innerStart:s?void 0:n},this.collect(this._resultPart);else this._resultPart=void 0}readParameterExpansion(){let e=this.src,t=this.srcEnd,r=this.pos;this.pos++;let n=1,o=!1;while(this.pos<t&&n>0){let a=e.charCodeAt(this.pos);if(a===ce){let c=this.pos+1<t?e.charCodeAt(this.pos+1):0;if(c===Ge){if(n++,this._nestingDepth+n>$t&&!o)this.errors.push({message:"maximum parameter expansion nesting depth exceeded",pos:this.pos}),o=!0;this.pos+=2;continue}if(c===ce){this.pos+=2;continue}if(c===J){let l=this.pos;if(this.pos+=2,this.extractBalanced(),this._unbalanced)this.errors.push({message:"unterminated command substitution",pos:l});continue}}else if(a===de){this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==de){if(e.charCodeAt(this.pos)===re)this.pos++;this.pos++}if(this.pos<t)this.pos++;continue}else if(a===or){if(--n===0){this.pos++;break}}else if(a===re)this.pos++;else if(a===Fe){if(this.pos++,this.pos>r+1&&e.charCodeAt(this.pos-2)===ce)this.skipAnsiCQuoted();else this.skipSQ();continue}else if(a===ke){this.pos++,this.skipDQ();continue}this.pos++}let s=n===0;if(!s)this.errors.push({message:"unterminated parameter expansion",pos:r-1});let i=this._buildParts||this._buildValue?e.slice(r-1,this.pos):"";if(this._resultText=i,this._resultIsRaw=!0,this._resultHasExpansion=!1,this._buildParts){let a=e.slice(r+1,s?this.pos-1:this.pos);this._resultPart=this.parseParamInner(i,a,r+1)}else this._resultPart=void 0}parseParamInner(e,t,r){let n={type:"ParameterExpansion",text:e,parameter:"",index:void 0,indexParts:void 0,indirect:void 0,length:void 0,operator:void 0,operand:void 0,slice:void 0,replace:void 0},o=t.length;if(o===0)return n;let s=(l,u)=>this.parseSubFieldWord(r+l,r+u),i=(l)=>{let u=this.findClosingBracket(r+l,r+o);return u===-1?-1:u-r},a=0;if(t.charCodeAt(0)===nr)n.indirect=!0,a=1;if(!n.indirect&&t.charCodeAt(0)===Ct){if(o===1)return n.parameter="#",n;if(t.charCodeAt(1)===Ct)n.parameter="#",a=1;else{let l=this.scanParamName(t,1);if(l>1){let u=l;if(u<o&&t.charCodeAt(u)===Vt){let f=i(u+1);if(f!==-1)u=f+1}if(u>=o){if(n.length=!0,n.parameter=t.slice(1,l),l<o&&t.charCodeAt(l)===Vt){let f=i(l+1);if(f!==-1)n.index=t.slice(l+1,f),n.indexParts=s(l+1,f).parts}return n}}n.parameter="#",a=1}}if(!n.parameter){let l=a;a=this.scanParamName(t,a),n.parameter=t.slice(l,a)}if(a<o&&t.charCodeAt(a)===Vt){let l=i(a+1);if(l!==-1)n.index=t.slice(a+1,l),n.indexParts=s(a+1,l).parts,a=l+1}if(a>=o)return n;let c=t.charCodeAt(a);if(c===_i){if(a+1<o){let h=t.charCodeAt(a+1);if(h===_t||h===Pe||h===Qt||h===vr)return n.operator=t.slice(a,a+2),n.operand=s(a+2,o),n}a++;let l=t.slice(a),u=r+a,f=r+o,d=Hv(l,_i,!0,(h,m)=>this.findNestedShellEnd(u+h,f,m)-u);if(d===-1)n.slice={offset:s(a,o),length:void 0};else n.slice={offset:s(a,a+d),length:s(a+d+1,o)};return n}if(c===_t||c===Pe||c===Qt||c===vr)return n.operator=t[a],n.operand=s(a+1,o),n;if(c===Ct){if(a+1<o&&t.charCodeAt(a+1)===Ct)n.operator="##",n.operand=s(a+2,o);else n.operator="#",n.operand=s(a+1,o);return n}if(c===Ci){if(a+1<o&&t.charCodeAt(a+1)===Ci)n.operator="%%",n.operand=s(a+2,o);else n.operator="%",n.operand=s(a+1,o);return n}if(c===Qi){a++;let l="/";if(a<o){let d=t.charCodeAt(a);if(d===Qi)l="//",a++;else if(d===Ct)l="/#",a++;else if(d===Ci)l="/%",a++}n.operator=l;let u=t.slice(a),f=Hv(u,Qi);if(f===-1)n.replace={pattern:s(a,o),replacement:new Et("",r+o,r+o)};else n.replace={pattern:s(a,a+f),replacement:s(a+f+1,o)};return n}if(c===Ja){if(a+1<o&&t.charCodeAt(a+1)===Ja){if(n.operator="^^",a+2<o)n.operand=s(a+2,o)}else if(n.operator="^",a+1<o)n.operand=s(a+1,o);return n}if(c===Ya){if(a+1<o&&t.charCodeAt(a+1)===Ya){if(n.operator=",,",a+2<o)n.operand=s(a+2,o)}else if(n.operator=",",a+1<o)n.operand=s(a+1,o);return n}if(c===vs)return n.operator="@",n.operand=s(a+1,o),n;return n.operator=t.slice(a),n}findNestedShellEnd(e,t,r){let n=this.src.charCodeAt(e);if(n===de){let s=e+1;while(s<t){let i=this.src.charCodeAt(s);if(i===re){s+=2;continue}if(s++,i===de)return s}return t}let o;if(n===ce){let s=e+1;if(s<t&&this.src.charCodeAt(s)===Ge)o=this.findClosingBrace(s+1,t);else{let i=Bg(this.src,s,t);if(i>=t||this.src.charCodeAt(i)!==J)return e;o=this.findClosingParenthesis(i+1,t)}}else{let s=e+1;if(r||n!==we&&n!==je||s>=t||this.src.charCodeAt(s)!==J)return e;o=this.findClosingParenthesis(s+1,t)}return o===-1?t:o+1}scanParamName(e,t){let r=t;if(r>=e.length)return r;let n=e.charCodeAt(r);if(n===vs||n===gn||n===Ct||n===vr||n===_t||n===ce||n===nr)return r+1;if(n>=hr&&n<=mr){while(r<e.length&&e.charCodeAt(r)>=hr&&e.charCodeAt(r)<=mr)r++;return r}if(n>=Io&&n<=Fo||n>=Cs&&n<=Qs||n===_s){r++;while(r<e.length){let o=e.charCodeAt(r);if(o>=Io&&o<=Fo||o>=Cs&&o<=Qs||o>=hr&&o<=mr||o===_s)r++;else break}}return r}readAnsiCQuoted(){let e=this.pos-1,t=jg(this.src,this.pos,this.srcEnd);if(this.pos=t.end,!t.closed)this.errors.push({message:"unterminated ANSI-C quote",pos:e});return t.value}extractBalanced(){let e=this.src,t=this.srcEnd,r=this._buildParts||this._buildValue,n=1,o=this.pos;this._unbalanced=!1;let s=!0;while(this.pos<t){let x=e.charCodeAt(this.pos);if(x===ft){let O=r?e.slice(o,this.pos):"";return this.pos++,O}else if(x===J||x===re||x===Fe||x===ke||x===de)break;else if(x===we&&this.pos+1<t&&e.charCodeAt(this.pos+1)===we)break;else if(x===Ct&&s)break;else if(x===99&&s&&this.pos+3<t&&e.charCodeAt(this.pos+1)===97&&e.charCodeAt(this.pos+2)===115&&e.charCodeAt(this.pos+3)===101&&(this.pos+4>=t||e.charCodeAt(this.pos+4)<128&&Te[e.charCodeAt(this.pos+4)]&1))break;else s=x<128&&(Te[x]&1)!==0,this.pos++}let i=0,a=0,c=[],l=null,u=-1,f=o>=2&&e.charCodeAt(o)===J&&e.charCodeAt(o-1)===J&&e.charCodeAt(o-2)===ce,d=0,h=!1,m=-1,b=-1;while(this.pos<t&&n>0){let x=e.charCodeAt(this.pos);if(x===J){let O=this.pos>o?e.charCodeAt(this.pos-1):0,S=O===ce?this.pos-1:this.pos===b?m:-1,y=S!==-1||O===we||O===je||O===Pe||O===vs||O===vr||O===gn||O===Qt||O===nr||O===J&&c[c.length-1]===!1||f&&this.pos===o;if(c.push(!y),s=!0,u<0&&this.pos+1<t&&e.charCodeAt(this.pos+1)===J)u=n;if(S!==-1&&++d+this._nestingDepth>=$t){if(!h)this.errors.push({message:"maximum command substitution nesting depth exceeded",pos:S}),h=!0}if(m=-1,b=-1,n++,i>0)a++;this.pos++}else if(x===ft)if(i>0&&a===0)this.pos++,s=!0;else{if(i>0)a--;if(n--,n===0){let O=r?e.slice(o,this.pos):"";return this.pos++,O}if(n<=u)u=-1;s=c.pop()??!0,this.pos++}else if(x===re){if(this.pos>o&&e.charCodeAt(this.pos-1)===ce){let O=Bg(e,this.pos,t);if(O>this.pos&&e.charCodeAt(O)===J&&e.charCodeAt(O+1)!==J)m=this.pos-1,b=O}if(this.pos++,this.pos<t){if(e.charCodeAt(this.pos)!==Re)s=!1;this.pos++}}else if(x===Fe)this.pos++,this.skipSQ(),s=!1;else if(x===ke)this.pos++,this.skipDQ(),s=!1;else if(x===de){this.pos++;while(this.pos<t&&e.charCodeAt(this.pos)!==de){if(e.charCodeAt(this.pos)===re)this.pos++;if(this.pos<t)this.pos++}if(this.pos<t)this.pos++;s=!1}else if(x===we&&u<0&&this.pos+1<t&&e.charCodeAt(this.pos+1)===we){if(this.pos+2<t&&e.charCodeAt(this.pos+2)===we)this.pos+=3;else{this.pos+=2;let O=this.pos<t&&e.charCodeAt(this.pos)===_t;if(O)this.pos++;if(this.skipSpacesAndTabs(),this.readHereDocDelimiter(),this._hereDelim||this._hereQuoted)(l??=[]).push({delimiter:this._hereDelim,strip:O,quoted:this._hereQuoted})}s=!1}else if(x===Re&&l){this.pos++;for(let O of l)this.skipHereDocBody(O.delimiter,O.strip,!0,O.quoted);l=null,s=!0}else if(x===Ct&&u<0&&!f&&s)while(this.pos<t&&e.charCodeAt(this.pos)!==Re)this.pos++;else{let O=this.pos;while(this.pos<t){let S=e.charCodeAt(this.pos);if(S<128&&Te[S])break;this.pos++}if(this.pos>O){if(this.pos-O===4&&s){let y=e.charCodeAt(O);if(y===99&&e.charCodeAt(O+1)===97&&e.charCodeAt(O+2)===115&&e.charCodeAt(O+3)===101)i++;else if(y===101&&e.charCodeAt(O+1)===115&&e.charCodeAt(O+2)===97&&e.charCodeAt(O+3)===99&&i>0){if(i--,i===0)a=0}}s=!1}else{let S=e.charCodeAt(this.pos);s=S<128&&(Te[S]&1)!==0,this.pos++}}}return this._unbalanced=!0,r?e.slice(o,this.pos):""}}var $t=256,p,xD,Te,o0,As,Rs,yD,Br=-1,rp=0,Kv=1,e0=2,t0=3,Vr=4,bD,k;var Gg=E(()=>{Vg();p={Word:0,Assignment:1,Semi:2,Newline:3,Pipe:4,And:5,Or:6,Amp:7,LParen:8,RParen:9,LBrace:10,RBrace:11,Bang:12,If:13,Then:14,Else:15,Elif:16,Fi:17,Do:18,Done:19,For:20,While:21,Until:22,In:23,Case:24,Esac:25,Function:26,DoubleSemi:27,SemiAmp:28,DoubleSemiAmp:29,Select:30,DblLBracket:31,DblRBracket:32,EOF:33,ArithCmd:34,Coproc:35,Redirect:36};xD=new Map([["if",p.If],["then",p.Then],["else",p.Else],["elif",p.Elif],["fi",p.Fi],["do",p.Do],["done",p.Done],["for",p.For],["while",p.While],["until",p.Until],["in",p.In],["case",p.Case],["esac",p.Esac],["function",p.Function],["select",p.Select],["coproc",p.Coproc],["!",p.Bang],["{",p.LBrace],["}",p.RBrace]]),Te=new Uint8Array(128);Te[jr]=1;Te[pr]=1;Te[Ha]=1;Te[J]=1;Te[ft]=1;Te[we]=1;Te[je]=1;Te[Xr]=1;Te[On]=1;Te[Re]=1;Te[re]=2;Te[Fe]=2;Te[ke]=2;Te[ce]=2;Te[de]=2;Te[Ge]=2;o0=new Uint8Array(128);for(let e of[On,Re,Xr,nr,Ci,pr,J,ft,gn,Qt,Ya,_t,Qi,_i,we,Pe,je,vr,Ja,jr])o0[e]=1;As=new Uint8Array(128);for(let e=Io;e<=Fo;e++)As[e]=3;for(let e=Cs;e<=Qs;e++)As[e]=3;for(let e=hr;e<=mr;e++)As[e]=2;As[_s]=3;Rs=new Uint8Array(128);Rs[vr]=1;Rs[vs]=1;Rs[gn]=1;Rs[Qt]=1;Rs[nr]=1;Rs[Pe]=1;yD={[vr]:"?",[vs]:"@",[gn]:"*",[Qt]:"+",[nr]:"!"};bD=[];k={Normal:0,CommandStart:1,TestMode:2,CommandPrefix:3}});function s0(e,t,r=0){let n=new xn(e,t.pos,t.end);n._nestingDepth=r;let o=n.buildWordParts(t.pos);if(!o)return;return Yg(n),o}function op(e,t,r=0){if(!$s(e,t.pos,t.end))return;let n=new xn(e,t.pos,t.end);n._nestingDepth=r;let o=n.buildEmbeddedWordParts(t.pos);if(!o)return;return Yg(n),o}function i0(e,t,r=0){let n=new xn(e,t.pos,t.end);n._nestingDepth=r;let o=n.buildHereDocParts(t.pos,t.end);if(!o)return;return Yg(n),o}function Yg(e){let t=e.getSource();for(let[r,n]of e.getCollectedExpansions())if(r.inner!==void 0){let o=n+1;if(o>$t+1);else if(r.innerStart!==void 0)r.script=Hg(t,r.innerStart,r.innerStart+r.inner.length,o);else r.script=ec(r.inner),Object.defineProperty(r.script,"source",{value:r.inner,enumerable:!1});r.inner=void 0,r.innerStart=void 0}}var a0=E(()=>{Gg();Jg()});class c0{type="ArithmeticCommand";pos;end;body;#t;#e;#r=null;constructor(e,t,r,n,o){this.pos=e,this.end=t,this.body=r,this.#t=n,this.#e=o}get expression(){if(this.#r===null)this.#r=ip(this.body,this.pos+2,this.#t,this.#e);return this.#r}set expression(e){this.#r=e??void 0}toJSON(){return{type:this.type,pos:this.pos,end:this.end,expression:this.expression,body:this.body}}}class sp{type="ArithmeticFor";pos;end;body;#t;#e;#r;#s;#a;#o;#u;#d;#p=null;#f=null;#n=null;constructor(e,t,r,n,o,s,i,a,c,l,u){this.pos=e,this.end=t,this.body=r,this.#t=n,this.#e=o,this.#r=s,this.#s=i,this.#a=a,this.#o=c,this.#u=l,this.#d=u}get initialize(){if(this.#p===null)if(this.#t)this.#p=ip(this.#t,this.#s,this.#u,this.#d);else this.#p=void 0;return this.#p}set initialize(e){this.#p=e??void 0}get test(){if(this.#f===null)if(this.#e)this.#f=ip(this.#e,this.#a,this.#u,this.#d);else this.#f=void 0;return this.#f}set test(e){this.#f=e??void 0}get update(){if(this.#n===null)if(this.#r)this.#n=ip(this.#r,this.#o,this.#u,this.#d);else this.#n=void 0;return this.#n}set update(e){this.#n=e??void 0}toJSON(){return{type:this.type,pos:this.pos,end:this.end,initialize:this.initialize,test:this.test,update:this.update,body:this.body}}}function ip(e,t,r,n=0){if(!$s(r,t,t+e.length))return Ka(e,t)??void 0;let o=[],s=[],i=new xn(r),a=Ka(e,t,{commandExpansions:o,embeddedWords:s,findClosingBracket:(c,l)=>i.findClosingBracket(c,l),findClosingBrace:(c,l)=>i.findClosingBrace(c,l),findClosingParenthesis:(c,l)=>i.findClosingParenthesis(c,l),findArithmeticExpansionEnd:(c,l)=>i.findArithmeticExpansionEnd(c,l),findArithmeticWordEnd:(c,l)=>i.findArithmeticWordEnd(c,l)})??void 0;for(let c of o)if(c.inner!==void 0){if(n<=$t){let l=c.pos+2;c.script=Hg(r,l,l+c.inner.length,n+1)}c.inner=void 0}for(let c of s)c.parts=op(r,c,n);return a}function Kg(e){return e.token===p.Word&&e.keywordEligible&&e.value==="!"}function QD(e){return(t,r)=>{let n=t.slice(r.pos,r.end);return n===e?void 0:[{type:"Literal",value:e,text:n}]}}function cu(e){return e.length===0?[]:e}function ec(e){return new ex(e,0,e.length).run()}function Hg(e,t,r,n=0){return new ex(e,t,r,n).run()}class ex{tok;source;start;end;depth;errors=null;_redirects=Gr;syntaxDepth=0;constructor(e,t,r,n=0){this.tok=new xn(e,t,r),this.tok._nestingDepth=n,this.source=e,this.start=t,this.end=r,this.depth=n}run(){let e=this.start;if(this.depth>$t)this.error("maximum substitution nesting depth exceeded",e);let t;if(e===0&&this.source.charCodeAt(0)===35&&this.source.charCodeAt(1)===33){let s=this.source.indexOf(`
|
|
40
|
+
`);t=s===-1?this.source:this.source.slice(0,s)}let r=this.list();for(;;){let s=this.tok.peek(k.CommandStart);if(s.token===p.EOF)break;if(this.error(`unexpected token '${s.value}'`,s.pos),!Bt[s.token]&&s.token!==p.In)break;this.tok.next(k.CommandStart);let i=this.tok.peek(k.CommandStart).token;if(i!==p.Semi&&i!==p.Newline&&i!==p.Amp)break;while(i===p.Semi||i===p.Newline||i===p.Amp)this.tok.next(k.CommandStart),i=this.tok.peek(k.CommandStart).token;let a=this.list();for(let c=0;c<a.length;c++)r.push(a[c])}let n=this.tok._errors;if(n!==null&&n.length>0){let s=this.errors??=[];for(let i=0;i<n.length;i++)s.push(n[i])}if(this.errors!==null&&this.errors.length>1)this.errors.sort((s,i)=>s.pos-i.pos);return{type:"Script",pos:e,end:this.end,shebang:t,commands:r,errors:this.errors??void 0}}error(e,t){(this.errors??=[]).push({message:e,pos:t})}skipSemi(){if(this.tok.peek(k.Normal).token===p.Semi)this.tok.next(k.Normal)}accept(e,t=k.Normal){if(this.tok.peek(t).token===e)return this.tok.next(t);return null}acceptEnd(e,t=k.Normal){if(this.tok.peek(t).token===e)return this.tok.next(t).end;return-1}skipNewlines(e=k.Normal){while(this.tok.peek(e).token===p.Newline)this.tok.next(e)}makeStatement(e,t){let r=t.length>0?t[t.length-1].end:e.end;return{type:"Statement",pos:e.pos,end:r,command:e,background:void 0,redirects:cu(t)}}list(){let e=[];this.skipNewlines(k.CommandStart);let t=this.tok.peek(k.CommandStart).token;if(Bt[t]||!At[t])return e;let r=this.andOr();if(r){let n=this._redirects;this._redirects=Gr,e.push(this.makeStatement(r,n))}for(;;){if(t=this.tok.peekFollow(Uo).token,t!==p.Semi&&t!==p.Newline&&t!==p.Amp)break;let n=t===p.Amp,o=this.tok.next(k.Normal).end;if(n){let i=e[e.length-1];i.background=!0,i.end=o}if(this.skipNewlines(k.CommandStart),t=this.tok.peek(k.CommandStart).token,Bt[t]||!At[t])break;let s=this.andOr();if(s){let i=this._redirects;this._redirects=Gr,e.push(this.makeStatement(s,i))}}return e}andOr(){let e=this.pipeline();if(!e)return null;let t=this.tok.peek(k.Normal).token;if(t!==p.And&&t!==p.Or)return e;let r=e;if(this._redirects.length>0)r=this.makeStatement(e,this._redirects),this._redirects=Gr;let n=[r],o=[];do{let s=this.tok.next(k.Normal),i=s.token===p.And?"&&":"||";this.skipNewlines(k.CommandStart);let a=this.pipeline();if(!a){this.error(`expected command after '${i}'`,s.end);break}o.push(i),n.push(a),t=this.tok.peek(k.Normal).token}while(t===p.And||t===p.Or);return{type:"AndOr",pos:e.pos,end:n[n.length-1].end,commands:n,operators:o}}wrapCompoundRedirects(e){let t=this._redirects;if(this._redirects=Gr,t.length===0)return e;return this.makeStatement(e,t)}pipeline(){let e=!1,t=0,r=0,n=this.tok.peek(k.CommandStart);if(n.token===p.Word&&n.keywordEligible&&n.value==="time"){e=!0;let f=this.tok.next(k.CommandStart);t=f.pos,r=f.end;let d=this.tok.peek(k.CommandStart);if(d.token===p.Word&&d.keywordEligible&&d.value==="-p")r=this.tok.next(k.CommandStart).end}let o=!1,s=this.tok.peek(k.CommandStart);if(s.token===p.Bang){if(!e)t=s.pos;r=this.tok.next(k.CommandStart).end,o=!0;let f=this.tok.peek(k.CommandStart);if(f.token===p.Bang){this.error("unexpected token '!'",f.pos);do r=this.tok.next(k.CommandStart).end;while(this.tok.peek(k.CommandStart).token===p.Bang)}}let i=this.command();if(!i){if(e||o)return{type:"Pipeline",pos:t,end:r,commands:[],negated:o?!0:void 0,operators:[],time:e?!0:void 0};return null}if(!e&&!o)t=i.pos;let a=[i],c=[],l=this._redirects;this._redirects=Gr;while(this.tok.peek(k.Normal).token===p.Pipe){if(a.length===1&&l.length>0)a[0]=this.makeStatement(i,l),l=[];let f=this.tok.next(k.Normal),d=f.value==="|&"?"|&":"|";this.skipNewlines(k.CommandStart);let h=this.command();if(!h){this.error(`expected command after '${d}'`,f.end);break}c.push(d),a.push(this.wrapCompoundRedirects(h))}if(a.length===1&&!o&&!e)return this._redirects=l,a[0];if(l.length>0)a[0]=this.makeStatement(i,l);return{type:"Pipeline",pos:t,end:a[a.length-1].end,commands:a,negated:o?!0:void 0,operators:c,time:e?!0:void 0}}command(){switch(this.tok.peek(k.CommandStart).token){case p.LParen:return this.subshell();case p.LBrace:return this.braceGroup();case p.If:return this.ifClause();case p.For:return this.forClause();case p.While:return this.whileClause();case p.Until:return this.untilClause();case p.Case:return this.caseClause();case p.Function:return this.functionDef();case p.Select:return this.selectClause();case p.DblLBracket:return this.testCommand();case p.ArithCmd:return this.arithCommand();case p.Coproc:return this.coprocCommand();case p.Word:case p.Assignment:case p.Redirect:return this.simpleCommandOrFunction();default:return null}}collectTrailingRedirects(){let e=Gr;while(this.tok.peekFollow(Uo).token===p.Redirect)e=this.collectRedirect(e,k.Normal);return e}arithCommand(){let e=this.tok.next(k.CommandStart);return this._redirects=this.collectTrailingRedirects(),new c0(e.pos,e.end,e.value,this.source,this.depth)}coprocCommand(){let e=this.tok.next(k.CommandStart),{pos:t,end:r}=e,n=this.tok.peek(k.CommandStart);if(n.token!==p.Word&&n.token!==p.Assignment&&n.token!==p.Redirect){let u=this.pipeline()??{type:"Command",pos:t,end:r,name:void 0,prefix:[],suffix:[],redirects:[]},f=this._redirects;this._redirects=Gr;let d=this.collectTrailingRedirects(),h=[...f,...d],m=h.length>0?h[h.length-1].end:u.end;return{type:"Coproc",pos:t,end:m,name:void 0,body:u,redirects:h}}let o=this.toWord(this.tok.next(k.CommandStart)),s=this.pipeline();if(s===null){let u={type:"Command",pos:o.pos,end:o.end,name:o,prefix:[],suffix:[],redirects:[]},f=this.collectTrailingRedirects(),d=f.length>0?f[f.length-1].end:u.end;return{type:"Coproc",pos:t,end:d,name:void 0,body:u,redirects:cu(f)}}if(s.type==="Command"){let u=s;if(u.name)u.suffix=[u.name,...u.suffix];u.name=o,u.pos=o.pos;let f=this.collectTrailingRedirects(),d=f.length>0?f[f.length-1].end:u.end;return{type:"Coproc",pos:t,end:d,name:void 0,body:u,redirects:cu(f)}}let i=this._redirects;this._redirects=Gr;let a=this.collectTrailingRedirects(),c=[...i,...a],l=c.length>0?c[c.length-1].end:s.end;return{type:"Coproc",pos:t,end:l,name:o,body:s,redirects:c}}subshell(){return this.subshellBody(this.tok.next(k.CommandStart).pos)}subshellBody(e){if(this.syntaxDepth===$t){this.error("maximum subshell nesting depth exceeded",e);let o=this.tok.skipSubshellBody();if(o<0)this.error("expected ')' to close subshell",this.tok.getPos());let s=o>=0?o:e;return this._redirects=this.collectTrailingRedirects(),{type:"Subshell",pos:e,end:s,body:this.makeCompoundList([])}}this.syntaxDepth++;let t=this.list();this.syntaxDepth--;let r=this.acceptEnd(p.RParen,k.Normal);if(r<0)this.error("expected ')' to close subshell",this.tok.getPos());let n=r>=0?r:e;return this._redirects=this.collectTrailingRedirects(),{type:"Subshell",pos:e,end:n,body:this.makeCompoundList(t)}}braceGroup(){let e=this.tok.next(k.CommandStart).pos;if(this.syntaxDepth===$t){this.error("maximum brace group nesting depth exceeded",e);let o=this.tok.skipCompoundBody(p.RBrace);if(o<0)this.error("expected '}' to close brace group",this.tok.getPos());let s=o>=0?o:e;return this._redirects=this.collectTrailingRedirects(),{type:"BraceGroup",pos:e,end:s,body:this.makeCompoundList([])}}this.syntaxDepth++;let t=this.list();this.syntaxDepth--;let r=this.acceptEnd(p.RBrace,k.Normal);if(r<0)this.error("expected '}' to close brace group",this.tok.getPos());let n=r>=0?r:e;return this._redirects=this.collectTrailingRedirects(),{type:"BraceGroup",pos:e,end:n,body:this.makeCompoundList(t)}}ifClause(){let e=this.tok.next(k.CommandStart).pos;if(this.syntaxDepth===$t){this.error("maximum if nesting depth exceeded",e);let u=this.tok.skipCompoundBody(p.Fi);if(u<0)this.error("expected 'fi' to close 'if'",this.tok.getPos());let f=u>=0?u:e;return this._redirects=this.collectTrailingRedirects(),{type:"If",pos:e,end:f,clause:this.makeCompoundList([]),then:this.makeCompoundList([]),else:void 0}}this.syntaxDepth++;let t,r,n=e,o,s;for(;;){o=this.makeCompoundList(this.list()),this.skipSemi();let u=this.accept(p.Then,k.CommandStart);if(!u)this.error("expected 'then'",this.tok.getPos());let f=this.list();if(u&&f.length===0)this.error("expected command after 'then'",this.tok.peek(k.CommandStart).pos);s=this.makeCompoundList(f),this.skipSemi();let d=this.accept(p.Elif,k.CommandStart);if(!d)break;let h={type:"If",pos:n,end:n,clause:o,then:s,else:void 0};if(r)r.else=h;else t=h;r=h,n=d.pos}let i,a;if(this.accept(p.Else,k.CommandStart)){i=this.makeCompoundList(this.list()),this.skipSemi();let u=this.acceptEnd(p.Fi,k.CommandStart);if(u<0)this.error("expected 'fi' to close 'if'",this.tok.getPos());a=u>=0?u:n}else{let u=this.acceptEnd(p.Fi,k.CommandStart);if(u<0)this.error("expected 'fi' to close 'if'",this.tok.getPos());a=u>=0?u:n}this.syntaxDepth--,this._redirects=this.collectTrailingRedirects();let c={type:"If",pos:n,end:a,clause:o,then:s,else:i};if(!t)return c;r.else=c;let l=t;while(l!==c)l.end=a,l=l.else;return t}forClause(){let e=this.tok.next(k.CommandStart).pos;if(this.tok.peek(k.Normal).token===p.LParen)return this.cStyleFor(e);let t=this.readWord(k.Normal),r=[];if(this.skipNewlines(k.CommandStart),this.tok.peek(k.CommandStart).token===p.In){this.tok.next(k.CommandStart);while(this.tok.peek(k.Normal).token===p.Word)r.push(this.readWord(k.Normal))}if(this.skipSemi(),this.skipNewlines(k.CommandStart),this.tok.peek(k.CommandStart).token===p.LBrace){let i=this.braceGroup();return{type:"For",pos:e,end:i.end,name:t,wordlist:r,body:i.body}}if(!this.accept(p.Do,k.CommandStart))this.error("expected 'do'",this.tok.getPos());if(this.syntaxDepth===$t){this.error("maximum for nesting depth exceeded",e);let i=this.tok.skipCompoundBody(p.Done);if(i<0)this.error("expected 'done' to close 'for'",this.tok.getPos());let a=i>=0?i:e;return this._redirects=this.collectTrailingRedirects(),{type:"For",pos:e,end:a,name:t,wordlist:r,body:this.makeCompoundList([])}}this.syntaxDepth++;let n=this.list();this.syntaxDepth--,this.skipSemi();let o=this.acceptEnd(p.Done,k.CommandStart);if(o<0)this.error("expected 'done' to close 'for'",this.tok.getPos());let s=o>=0?o:e;return this._redirects=this.collectTrailingRedirects(),{type:"For",pos:e,end:s,name:t,wordlist:r,body:this.makeCompoundList(n)}}cStyleFor(e){let[t,r,n,o,s,i]=this.tok.readCStyleForExprs();if(this.tok.peek(k.CommandStart).token===p.Semi)this.tok.next(k.CommandStart);if(this.skipNewlines(k.CommandStart),this.tok.peek(k.CommandStart).token===p.LBrace){let u=this.braceGroup();return new sp(e,u.end,u.body,t,r,n,o,s,i,this.source,this.depth)}if(!this.accept(p.Do,k.CommandStart))this.error("expected 'do'",this.tok.getPos());if(this.syntaxDepth===$t){this.error("maximum for nesting depth exceeded",e);let u=this.tok.skipCompoundBody(p.Done);if(u<0)this.error("expected 'done' to close 'for'",this.tok.getPos());let f=u>=0?u:e;return this._redirects=this.collectTrailingRedirects(),new sp(e,f,this.makeCompoundList([]),t,r,n,o,s,i,this.source,this.depth)}this.syntaxDepth++;let a=this.list();this.syntaxDepth--;let c=this.acceptEnd(p.Done,k.CommandStart);if(c<0)this.error("expected 'done' to close 'for'",this.tok.getPos());let l=c>=0?c:e;return this._redirects=this.collectTrailingRedirects(),new sp(e,l,this.makeCompoundList(a),t,r,n,o,s,i,this.source,this.depth)}whileClause(){return this.whileOrUntil("while")}untilClause(){return this.whileOrUntil("until")}whileOrUntil(e){let t=this.tok.next(k.CommandStart).pos;if(this.syntaxDepth===$t){this.error(`maximum ${e} nesting depth exceeded`,t);let i=this.tok.skipCompoundBody(p.Done);if(i<0)this.error(`expected 'done' to close '${e}'`,this.tok.getPos());let a=i>=0?i:t;return this._redirects=this.collectTrailingRedirects(),{type:"While",pos:t,end:a,kind:e,clause:this.makeCompoundList([]),body:this.makeCompoundList([])}}this.syntaxDepth++;let r=this.makeCompoundList(this.list());if(this.skipSemi(),!this.accept(p.Do,k.CommandStart))this.error("expected 'do'",this.tok.getPos());let n=this.list();this.skipSemi();let o=this.acceptEnd(p.Done,k.CommandStart);if(o<0)this.error(`expected 'done' to close '${e}'`,this.tok.getPos());let s=o>=0?o:t;return this.syntaxDepth--,this._redirects=this.collectTrailingRedirects(),{type:"While",pos:t,end:s,kind:e,clause:r,body:this.makeCompoundList(n)}}caseClause(){let e=this.tok.next(k.CommandStart).pos,t=this.readWord(k.Normal);if(this.skipNewlines(k.CommandStart),!this.accept(p.In,k.CommandStart))this.error("expected 'in' after 'case' word",this.tok.getPos());if(this.skipNewlines(k.CommandStart),this.syntaxDepth===$t){this.error("maximum case nesting depth exceeded",e);let i=this.tok.skipCompoundBody(p.Esac);if(i<0)this.error("expected 'esac' to close 'case'",this.tok.getPos());let a=i>=0?i:e;return this._redirects=this.collectTrailingRedirects(),{type:"Case",pos:e,end:a,word:t,items:[]}}this.syntaxDepth++;let r=[],n=this.tok.peek(k.CommandStart).token;while(n!==p.Esac&&n!==p.EOF){let i=this.tok.peek(k.Normal).pos;this.accept(p.LParen,k.Normal);let a=[];n=this.tok.peek(k.Normal).token;while(n!==p.RParen&&n!==p.EOF){if(n!==p.Pipe)a.push(this.toWord(this.tok.next(k.Normal)));else this.tok.next(k.Normal);n=this.tok.peek(k.Normal).token}let c=this.acceptEnd(p.RParen,k.Normal),l=this.list(),u=c>=0?c:i;if(l.length>0)u=l[l.length-1].end;let f={type:"CaseItem",pos:i,end:u,pattern:a,body:this.makeCompoundList(l),terminator:void 0};if(n=this.tok.peek(k.CommandStart).token,n===p.DoubleSemi||n===p.SemiAmp||n===p.DoubleSemiAmp){let d=this.tok.next(k.CommandStart);f.terminator=wD[d.token],f.end=d.end}r.push(f),this.skipNewlines(k.CommandStart),n=this.tok.peek(k.CommandStart).token}let o=this.acceptEnd(p.Esac,k.CommandStart);if(o<0)this.error("expected 'esac' to close 'case'",this.tok.getPos());let s=o>=0?o:e;return this.syntaxDepth--,this._redirects=this.collectTrailingRedirects(),{type:"Case",pos:e,end:s,word:t,items:r}}selectClause(){let e=this.tok.next(k.CommandStart).pos,t=this.readWord(k.Normal),r=[];if(this.skipNewlines(k.CommandStart),this.tok.peek(k.CommandStart).token===p.In){this.tok.next(k.CommandStart);while(this.tok.peek(k.Normal).token===p.Word)r.push(this.readWord(k.Normal))}if(this.skipSemi(),this.skipNewlines(k.CommandStart),this.tok.peek(k.CommandStart).token===p.LBrace){let i=this.braceGroup();return{type:"Select",pos:e,end:i.end,name:t,wordlist:r,body:i.body}}if(!this.accept(p.Do,k.CommandStart))this.error("expected 'do'",this.tok.getPos());if(this.syntaxDepth===$t){this.error("maximum select nesting depth exceeded",e);let i=this.tok.skipCompoundBody(p.Done);if(i<0)this.error("expected 'done' to close 'select'",this.tok.getPos());let a=i>=0?i:e;return this._redirects=this.collectTrailingRedirects(),{type:"Select",pos:e,end:a,name:t,wordlist:r,body:this.makeCompoundList([])}}this.syntaxDepth++;let n=this.list();this.syntaxDepth--,this.skipSemi();let o=this.acceptEnd(p.Done,k.CommandStart);if(o<0)this.error("expected 'done' to close 'select'",this.tok.getPos());let s=o>=0?o:e;return this._redirects=this.collectTrailingRedirects(),{type:"Select",pos:e,end:s,name:t,wordlist:r,body:this.makeCompoundList(n)}}testCommand(){let e=this.tok.next(k.CommandStart).pos,t=this.parseTestOr(),r=this.acceptEnd(p.DblRBracket,k.TestMode);if(r<0)this.error("expected ']]' to close '[['",this.tok.getPos());let n=r>=0?r:e;return this._redirects=this.collectTrailingRedirects(),{type:"TestCommand",pos:e,end:n,expression:t}}parseTestOr(){let e=this.parseTestAnd();while(this.tok.peek(k.TestMode).token===p.Or){this.tok.next(k.TestMode);let t=this.parseTestAnd();e={type:"TestLogical",pos:e.pos,end:t.end,operator:"||",left:e,right:t}}return e}parseTestAnd(){let e=this.parseTestNot();while(this.tok.peek(k.TestMode).token===p.And){this.tok.next(k.TestMode);let t=this.parseTestNot();e={type:"TestLogical",pos:e.pos,end:t.end,operator:"&&",left:e,right:t}}return e}parseTestNot(){let e=this.tok.peek(k.TestMode);if(!Kg(e))return this.parseTestPrimary();let t=this.tok.next(k.TestMode).pos;if(e=this.tok.peek(k.TestMode),!Kg(e)){let o=this.parseTestPrimary();return{type:"TestNot",pos:t,end:o.end,operand:o}}let r=[t];while(Kg(e))r.push(this.tok.next(k.TestMode).pos),e=this.tok.peek(k.TestMode);let n=this.parseTestPrimary();for(let o=r.length-1;o>=0;o--)n={type:"TestNot",pos:r[o],end:n.end,operand:n};return n}parseTestPrimary(){if(this.tok.peek(k.TestMode).token===p.LParen){let i=this.tok.next(k.TestMode).pos;if(this.syntaxDepth===$t){this.error("maximum test group nesting depth exceeded",i);let u=this.tok.skipTestGroup();if(u<0)this.error("expected ')' to close test group",this.tok.getPos());let f=u>=0?u:i,d=new Et("",i,i,this.source,void 0,this.depth);return{type:"TestGroup",pos:i,end:f,expression:{type:"TestUnary",pos:i,end:i,operator:"-n",operand:d}}}this.syntaxDepth++;let a=this.parseTestOr();this.syntaxDepth--;let c=this.acceptEnd(p.RParen,k.TestMode);if(c<0)this.error("expected ')' to close test group",this.tok.getPos());let l=c>=0?c:i;return{type:"TestGroup",pos:i,end:l,expression:a}}let e=this.tok.next(k.TestMode),{value:t,pos:r,end:n}=e;if(e.keywordEligible&&vD[t]===1){if(this.tok.peek(k.TestMode).token===p.Word){let a=this.readWord(k.TestMode);return{type:"TestUnary",pos:r,end:a.end,operator:t,operand:a}}}let o=this.tok.peek(k.TestMode);if(o.token===p.Word&&o.keywordEligible&&CD[o.value]===1){let i=this.tok.next(k.TestMode).value,a;if(i==="=~"){let l=this.tok.readTestRegexWord();a=new Et(this.source.slice(l.pos,l.end),l.pos,l.end,this.source,op,this.depth)}else a=this.readWord(k.TestMode);let c=this.toWordFromPosEnd(e,r,n);return{type:"TestBinary",pos:r,end:a.end,operator:i,left:c,right:a}}let s=this.toWordFromPosEnd(e,r,n);return{type:"TestUnary",pos:r,end:s.end,operator:"-n",operand:s}}functionDef(){let e=this.tok.next(k.CommandStart).pos,t=this.readWord(k.Normal),r;if(this.tok.peek(k.CommandStart).token===p.LParen){let s=this.tok.next(k.CommandStart).pos;if(this.tok.peek(k.CommandStart).token===p.RParen)this.tok.next(k.CommandStart),this.skipNewlines(k.CommandStart),r=this.commandAsBody();else r=this.subshellBody(s)}else this.skipNewlines(k.CommandStart),r=this.commandAsBody();let n=this._redirects;this._redirects=Gr;let o=n.length>0?n[n.length-1].end:r.end;return{type:"Function",pos:e,end:o,name:t,body:r,redirects:cu(n)}}simpleCommandOrFunction(){let e=[],t=[],r=this.tok.peek(k.CommandStart).pos,n=r,o=k.CommandStart;for(;;){let a=this.tok.peek(o).token;if(a===p.Assignment){let c=this.tok.next(o);n=c.end,e.push(this.parseAssignment(c))}else if(a===p.Redirect)t=this.collectRedirect(t,o),n=t[t.length-1].end;else break;o=k.CommandPrefix}if(this.tok.peek(k.Normal).token!==p.Word)return{type:"Command",pos:r,end:n,name:void 0,prefix:e,suffix:[],redirects:t};let s=this.readWord(k.Normal);if(n=s.end,this.tok.peek(k.Normal).token===p.LParen){if(this.tok.next(k.Normal),this.tok.peek(k.Normal).token===p.RParen){this.tok.next(k.Normal),this.skipNewlines(k.CommandStart);let a=this.commandAsBody(),c=this._redirects;this._redirects=Gr;let l=c.length>0?c[c.length-1].end:a.end;return{type:"Function",pos:s.pos,end:l,name:s,body:a,redirects:cu(c)}}}let i=[];for(;;){let a=this.tok.peek(k.Normal).token;if(a===p.Word||a===p.Assignment){let c=this.readWord(k.Normal);i.push(c),n=c.end}else if(a===p.Redirect)t=this.collectRedirect(t,k.Normal),n=t[t.length-1].end;else break}return{type:"Command",pos:r,end:n,name:s,prefix:e,suffix:i,redirects:t}}collectRedirect(e,t){if(e===Gr)e=[];let r=this.tok.next(t),{pos:n,end:o}=r,s={pos:n,end:o,operator:TD[r.value]??">",target:void 0,fileDescriptor:r.fileDescriptor,variableName:r.variableName,content:r.content,heredocQuoted:void 0,body:void 0};if(r.targetEnd>r.targetPos){let a=r.value==="<<"||r.value==="<<-"?QD(r.content??""):void 0,c=this.source.slice(r.targetPos,r.targetEnd);s.target=new Et(c,r.targetPos,r.targetEnd,this.source,a,this.depth)}else this.error("expected redirect target",r.targetPos);if(s.target&&(r.value==="<<"||r.value==="<<-"))this.tok.registerHereDocTarget(s);return e.push(s),e}commandAsBody(){let e=this.tok.peek(k.CommandStart).token;if(e===p.LBrace)return this.braceGroup();if(e===p.LParen)return this.subshell();let t=this.command(),r=this.tok.getPos();return t??{type:"CompoundList",pos:r,end:r,commands:[]}}readWord(e){return this.toWord(this.tok.next(e))}toWord(e){let t=e.raw?e.value:this.source.slice(e.pos,e.end);return new Et(t,e.pos,e.end,this.source,void 0,this.depth)}toWordFromPosEnd(e,t,r){let n=e.raw&&e.pos===t&&e.end===r?e.value:this.source.slice(t,r);return new Et(n,t,r,this.source,void 0,this.depth)}parseAssignment(e){let t=e.raw?e.value:this.source.slice(e.pos,e.end),{pos:r,end:n}=e,o={type:"Assignment",pos:r,end:n,text:t,name:void 0,value:void 0,append:void 0,index:void 0,indexParts:void 0,array:void 0},s=e.assignmentOperatorPos-r;if(s<=0)return o;let i=s,a=!1,c,l=s;while(l>=2&&t.charCodeAt(l-2)===92&&t.charCodeAt(l-1)===10)l-=2;if(t.charCodeAt(l-1)===43)a=!0,i=l-1;let u=t.indexOf("[");if(u>0&&u<i){let b=t.lastIndexOf("]",s);if(b>u)c=t.slice(u+1,b),i=u}let f=t.slice(0,i),d=f.includes("\\\n")?f.split("\\\n").join(""):f;if(o.name=d,a)o.append=!0;if(c!==void 0){o.index=c;let b=r+u+1,x=b+c.length;if($s(this.source,b,x)){let O=new Et(c,b,x,this.source,op,this.depth);Object.defineProperty(o,"indexParts",{configurable:!0,enumerable:!0,get:()=>O.parts,set:(S)=>{O.parts=S}})}}let h=s+1,m=r+h;if(h<t.length&&t.charCodeAt(h)===40&&t.charCodeAt(t.length-1)===41){let b=this.parseArrayElements(m+1,n-1);o.array=b}else o.value=new Et(t.slice(h),m,n,this.source,void 0,this.depth);return o}parseArrayElements(e,t){let r=new xn(this.source,e,t),n=[];while(r.peek(k.Normal).token!==p.EOF){if(r.peek(k.Normal).token===p.Newline){r.next(k.Normal);continue}let o=r.next(k.Normal);if(o.token===p.Word||o.token===p.Assignment){let s=o.raw?o.value:this.source.slice(o.pos,o.end);n.push(new Et(s,o.pos,o.end,this.source,void 0,this.depth))}}return n}makeCompoundList(e){let t=this.tok.getPos(),r=e.length>0?e[0].pos:t,n=e.length>0?e[e.length-1].end:t;return{type:"CompoundList",pos:r,end:n,commands:e}}}var wD,TD,Bt,Uo,At,vD,CD,Gr;var Jg=E(()=>{Gg();Vg();a0();Et._resolveWord=s0;Et._resolveHeredocBody=i0;wD={[p.DoubleSemi]:";;",[p.SemiAmp]:";&",[p.DoubleSemiAmp]:";;&"},TD={">":">",">>":">>","<":"<","<<":"<<","<<-":"<<-","<<<":"<<<","<>":"<>","<&":"<&",">&":">&",">|":">|","&>":"&>","&>>":"&>>"};Bt=new Uint8Array(37);Bt[p.EOF]=1;Bt[p.RParen]=1;Bt[p.RBrace]=1;Bt[p.Then]=1;Bt[p.Else]=1;Bt[p.Elif]=1;Bt[p.Fi]=1;Bt[p.Do]=1;Bt[p.Done]=1;Bt[p.Esac]=1;Bt[p.DoubleSemi]=1;Bt[p.SemiAmp]=1;Bt[p.DoubleSemiAmp]=1;Uo=new Uint8Array(37);Uo[p.RParen]=1;Uo[p.RBrace]=1;Uo[p.DblRBracket]=1;Uo[p.Fi]=1;Uo[p.Done]=1;Uo[p.Esac]=1;Uo[p.ArithCmd]=1;At=new Uint8Array(37);At[p.Word]=1;At[p.Assignment]=1;At[p.Bang]=1;At[p.LParen]=1;At[p.LBrace]=1;At[p.DblLBracket]=1;At[p.If]=1;At[p.For]=1;At[p.While]=1;At[p.Until]=1;At[p.Case]=1;At[p.Function]=1;At[p.Select]=1;At[p.ArithCmd]=1;At[p.Coproc]=1;At[p.Redirect]=1;vD={"-a":1,"-b":1,"-c":1,"-d":1,"-e":1,"-f":1,"-g":1,"-h":1,"-k":1,"-p":1,"-r":1,"-s":1,"-t":1,"-u":1,"-v":1,"-w":1,"-x":1,"-z":1,"-n":1,"-o":1,"-N":1,"-S":1,"-L":1,"-G":1,"-O":1,"-R":1},CD={"==":1,"!=":1,"=~":1,"=":1,"-eq":1,"-ne":1,"-lt":1,"-le":1,"-gt":1,"-ge":1,"-nt":1,"-ot":1,"-ef":1,"<":1,">":1};Gr=[]});var $i=(e)=>({start:e.pos,end:e.end}),Is=(e)=>{let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)},tc=(e)=>{if(e.name===void 0||e.prefix.length>0||e.redirects.length>0||!Ro(e.name)||e.suffix.some((t)=>!Ro(t)))return null;return[e.name,...e.suffix].map((t)=>({source:t.text,value:t.value,kind:"literal",range:$i(t),quoted:(t.parts??[]).some((r)=>r.type==="SingleQuoted"||r.type==="DoubleQuoted"||r.type==="AnsiCQuoted"||r.type==="LocaleString")}))};var ap=E(()=>{Ga()});var Fs,f0,l0,tx=(e,t,r)=>{let n=t;while(n<e.length){let o=e[n]?.value;if(o===void 0)break;if(r.has(o))n+=2;else if(o.includes("=")&&r.has(o.slice(0,o.indexOf("="))))n+=1;else if(o==="--")return n+1;else if(o.startsWith("-")&&o!=="-")n+=1;else break}return n},cp=(e)=>{let t=Object.hasOwn(l0,e.head)?l0[e.head]??new Set:new Set,r=tx(e.words,1,t);if(e.head==="env")while(/^[A-Za-z_][A-Za-z0-9_]*=/u.test(e.words[r]?.value??""))r+=1;return r},rc=(e,t)=>{for(let r=1;r<e.length-1;r+=1){let n=e[r]?.value;if(n!==void 0&&(n===`-${t}`||n.startsWith("-")&&!n.startsWith("--")&&n.slice(1).includes(t)))return r+1}return null},lp=(e,t,r=1)=>{for(let n=r;n<e.length;n+=1){let o=e[n]?.value;if(o!==void 0){if(t.has(o))return n+1<e.length?n+1:null;for(let s of t)if(o.startsWith(`${s}=`))return n}}return null},_D,$D=(e)=>e==="/"||e==="~"||e==="."||e===".."||e.startsWith("/")||e.startsWith("~/")||e.startsWith("./")||e.startsWith("../")||/^\$\{?HOME\}?(?:\/|$)/u.test(e),u0=(e)=>{if(e==="/")return 100;if(e==="~"||/^\$\{?HOME\}?(?:\/|$)/u.test(e))return 90;if(/^\/(?:etc|usr|bin|sbin|System|Library|var|boot|root|home)(?:\/|$)/u.test(e))return 80;if(e.startsWith("/Users/"))return 70;if(e.startsWith("/"))return 60;if(e.startsWith("../"))return 40;return 10},d0=(e,t,r)=>{let n=[];for(let o=1;o<t;o+=1){let s=e[o];if(s!==void 0&&r==="fd"&&_D.has(s.value))o+=1;else if(s?.value.startsWith("-")===!0){if(r==="find")break}else if(s!==void 0&&$D(s.value))n.push(s)}return n.sort((o,s)=>u0(s.value)-u0(o.value)),n[0]??{source:".",value:".",kind:"literal",range:e[0]?.range??{start:0,end:0},quoted:!1}},rx,p0,h0,m0,O0,nx;var up=E(()=>{Fs=new Set(["sh","bash","zsh","dash","ksh","ash"]),f0=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","taskset","sudo","doas","xargs","watch"]),l0={env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),sudo:new Set(["-u","--user","-g","--group","-C","--close-from","-D","--chdir","-h","--host","-p","--prompt","-r","--role","-t","--type","-U","--other-user","-R","--chroot","-T","--command-timeout"]),doas:new Set(["-a","-C","-u"]),xargs:new Set(["-I","-i","-J","-n","--max-args","-P","--max-procs","-s","--max-chars","-L","--max-lines","-E","--eof","-d","--delimiter","-a","--arg-file","--replace"]),watch:new Set(["-n","--interval"])},_D=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),rx=new Set(["-x","-X","--exec","--exec-batch"]),p0=new Set(["{}","{/}","{//}","{.}","{/.}"]),h0=new Set(["-exec","-execdir","-ok","-okdir"]),m0=new Set(["{}"]),O0=new Set(["run","proxy","err","test","summary"]),nx={timeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,shellFlag:!1},gtimeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,shellFlag:!1},chroot:{valueFlags:new Set(["--userspec","--groups"]),skipPositionals:1,shellFlag:!1},flock:{valueFlags:new Set(["-w","--wait","--timeout","-E","--conflict-exit-code"]),skipPositionals:1,shellFlag:!0},su:{valueFlags:new Set,skipPositionals:0,shellFlag:!0}}});class ox{#t;#e;constructor(e,t){this.#e=e,this.#t=[...t].toSorted((r,n)=>n.command.length-r.command.length)}isCarrierCommand(e){let t=tc(e);return t!==null&&this.#r(t)!==null}inspect(e,t,r){let n=this.#r(e.words);if(n===null)return!1;this.#s(n.words,t,r);let o=ID(n.words);if(o===null){if(n.words.some((l)=>l.value==="-Q"||l.value==="-V"))return!0;return this.#e.addDiagnostic("dynamic-shell-source","Tripwire cannot identify the SSH destination and remote command safely.",e.range),!0}let s=n.words.slice(o);if(s.length===0){let l=n.words.some((u)=>u.value==="-N"||u.value==="-G"||u.value==="-Q"||u.value==="-V"||u.value==="-W"||u.value.startsWith("-W"));if(!r.inspectedPipelineInput&&!l)this.#e.addDiagnostic("dynamic-shell-source","An interactive remote shell has no command source that Tripwire can inspect.",e.range);return!0}let i=s.find((l)=>l.kind!=="literal");if(i!==void 0)return this.#e.addDiagnostic("dynamic-shell-source","The remote shell command is computed at runtime.",i.range),!0;if(r.inspectedPipelineInput&&Fs.has(Is(s[0]?.value??""))&&rc(s,"c")===null)return this.#e.emitSynthetic(s,e,t,{...r,inspectedPipelineInput:!0}),!0;let[a]=s,c=s.at(-1);if(a!==void 0&&c!==void 0){let l=s.map((u)=>u.value).join(" ");this.#e.inspectShellSource({source:l,value:l,kind:"literal",range:{start:a.range.start,end:c.range.end},quoted:!0},t,{...r,inspectedPipelineInput:!1})}return!0}#r(e){let[t]=e;if(t!==void 0&&Is(t.value)==="ssh")return{kind:"ssh",words:e};for(let r of this.#t)if(r.command.every((n,o)=>e[o]?.value===n)&&r.command.length<=e.length){let[n]=e;if(n===void 0)return null;return{kind:r.equivalentTo,words:[{...n,source:r.equivalentTo,value:r.equivalentTo},...e.slice(r.command.length)]}}return null}#s(e,t,r){for(let n=1;n<e.length;n+=1){let o=RD(e,n);if(n=o.nextIndex,o.opaqueConfig!==void 0)this.#e.addDiagnostic("dynamic-shell-source","An explicit SSH configuration file may contain executable commands that Tripwire has not inspected.",o.opaqueConfig.range);else if(o.source!==void 0)this.#e.inspectShellSource(o.source,t,{...r,inspectedPipelineInput:!1})}}}var AD,RD=(e,t)=>{let r=e[t];if(r===void 0)return{nextIndex:t,opaqueConfig:void 0,source:void 0};if(r.value==="-F"||r.value.startsWith("-F"))return{nextIndex:r.value==="-F"?t+1:t,opaqueConfig:r,source:void 0};let n=t,o;if(r.value==="-o")n+=1,o=e[n];else if(r.value.startsWith("-o"))o={...r,source:r.source.slice(2),value:r.value.slice(2)};let s=o===void 0?null:/^(?<key>[A-Za-z]+)(?:=|\s+)(?<source>[\s\S]+)$/u.exec(o.value),i=s?.groups?.key?.toLowerCase(),a=s?.groups?.source,c=o!==void 0&&a!==void 0&&a!=="none"&&i!==void 0&&["localcommand","proxycommand","remotecommand"].includes(i)?{...o,source:a,value:a}:void 0;return{nextIndex:n,opaqueConfig:void 0,source:c}},ID=(e)=>{let t=1;while(t<e.length){let n=e[t];if(n?.kind!=="literal")return null;if(n.value==="--"){t+=1;break}if(AD.has(n.value)){if(e[t+1]?.kind!=="literal")return null;t+=2}else if(n.value.startsWith("-")&&n.value!=="-")t+=1;else break}return e[t]?.kind==="literal"?t+1:null};var g0=E(()=>{ap();up();AD=new Set(["-B","-b","-c","-D","-E","-e","-F","-I","-i","-J","-L","-l","-m","-O","-o","-p","-Q","-R","-S","-W","-w"])});class sx{#t;#e;constructor(e,t){this.#e=e,this.#t=t}inspect(e,t,r){let n=new Set;return this.#r(e,t,r,n),this.#s(e,t,r,n),n}#r(e,t,r,n){for(let o=0;o<e.length-1;o+=1){let s=e[o],i=e[o+1];if(s?.type==="Command"&&i?.type==="Command"&&i.name!==void 0&&Fs.has(Is(i.name.value))){for(let a of s.redirects)if((a.operator==="<<"||a.operator==="<<-")&&a.content!==void 0)this.#e.inspectShellSource({source:a.content,value:a.content,kind:"literal",range:$i(a),quoted:a.heredocQuoted===!0},t,r),n.add(o+1)}}}#s(e,t,r,n){for(let o=0;o<e.length-2;o+=1){let s=e[o],i=e[o+1],a=e[o+2];if(s?.type==="Command"&&i?.type==="Command"&&a?.type==="Command"&&this.#a(a)){let c=FD(s,i),l=c===null?null:UD(c);if(l!==null)this.#e.inspectShellSource({source:l,value:l,kind:"literal",range:$i(s),quoted:!0},t,r),n.add(o+2)}}}#a(e){let t=tc(e);if(t===null)return!1;if(Fs.has(Is(t[0]?.value??"")))return rc(t,"c")===null;return this.#t.isCarrierCommand(e)}}var FD=(e,t)=>{let r=tc(e),n=tc(t);if(r===null||n===null||Is(n[0]?.value??"")!=="base64"||n.length!==2||!["-d","-D","--decode"].includes(n[1]?.value??""))return null;let o=Is(r[0]?.value??""),s=r.slice(1).map((i)=>i.value);if(o==="printf"&&s.length===2){let[i,a]=s;return i==="%s"||i===String.raw`%s\n`?a??null:null}if(o==="echo"){let i=s.filter((a)=>a!=="-n");return i.length===1?i[0]??null:null}return null},UD=(e)=>{if(e.length===0||e.length>1048576||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(e))return null;let t=Buffer.from(e,"base64");if(t.toString("base64")!==e||t.includes(0))return null;try{return new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{return null}};var x0=E(()=>{ap();up()});class ix{#t;#e;#r;constructor(e,t){this.#e=e,this.#t=new ox(e,t),this.#r=new sx(e,this.#t)}inspectShellInput(e,t,r,n){if(!Fs.has(e.head))return!1;let o=n.inspectedPipelineInput;for(let[s,i]of t.entries())if((i.operator==="<<"||i.operator==="<<-")&&i.content!==void 0){let a={source:i.content,value:i.content,kind:"literal",range:$i(i),quoted:i.heredocQuoted===!0};this.#e.inspectShellSource(a,r,n),o=!0}else if(i.operator==="<<<")this.#e.inspectShellSource(e.redirects[s]?.target,r,n),o=!0;else if(i.operator==="<")this.#e.addDiagnostic("dynamic-shell-source","A shell wrapper reads program source from a file that Tripwire has not inspected.",$i(i));return o}inspectWrapper(e,t,r,n=!1){if(e.head==="eval"||this.#t.inspect(e,t,r)||this.#s(e,t,r,n)||this.#a(e,t,r))return;this.#u(e,t,r)}inspectPipelineInputs(e,t,r){return this.#r.inspect(e,t,r)}#s(e,t,r,n){if(!Fs.has(e.head))return!1;let o=rc(e.words,"c");if(o!==null)return this.#e.inspectShellSource(e.words[o],t,r),!0;if(!(n||e.tokens.includes("-n")||e.tokens.includes("--noexec")||e.tokens.includes("--help")||e.tokens.includes("--version")))this.#e.addDiagnostic("dynamic-shell-source","A shell wrapper has no inline program source that Tripwire can inspect.",e.range);return!0}#a(e,t,r){switch(e.head){case"trap":return this.#d(e,t,r),!0;case"script":{let n=lp(e.words,new Set(["-c","--command"]));if(n!==null)this.#e.inspectShellSource(e.words[n],t,r);return!0}case"watch":return this.#o(e,t,r),!0;case"xargs":return this.#p(e,t,r),!0;default:return!1}}#o(e,t,r){let n=cp(e),o=e.words.slice(n);if(e.tokens.includes("-x")||e.tokens.includes("--exec")){this.#e.emitSynthetic(o,e,t,r);return}let[s]=o,i=o.at(-1),a=o.find((c)=>c.kind==="dynamic");if(a!==void 0){this.#e.addDiagnostic("dynamic-shell-source","watch receives command text that is computed at runtime.",a.range);return}if(s!==void 0&&i!==void 0){let c=o.map((l)=>l.value).join(" ");this.#e.inspectShellSource({source:c,value:c,kind:"literal",range:{start:s.range.start,end:i.range.end},quoted:!0},t,r)}}#u(e,t,r){if(f0.has(e.head)){let n=cp(e);this.#e.emitSynthetic(e.words.slice(n),e,t,r)}else if(e.head==="fd"||e.head==="fdfind")this.#f(e,rx,p0,t,r);else if(e.head==="find"||e.head==="gfind")this.#f(e,h0,m0,t,r);else if(e.head==="rtk")this.#n(e,t,r);else{let n=Object.hasOwn(nx,e.head)?nx[e.head]:void 0;if(n!==void 0)this.#m(e,n,t,r)}}#d(e,t,r){let[,n,o]=e.words,s=n?.value==="--"?o:n;if(s===void 0||s.value===""||s.value==="-"||s.value==="-p"||s.value==="-l")return;this.#e.inspectShellSource(s,t,r)}#p(e,t,r){let n=cp(e),o=e.words.slice(n),s=o[0]??{kind:"literal",quoted:!1,range:e.range,source:"echo",value:"echo"},i={kind:"dynamic",quoted:!1,range:e.range,source:"<xargs-input>",value:vi};this.#e.emitSynthetic([s,...o.slice(1),i],e,t,r)}#f(e,t,r,n,o){for(let s=1;s<e.words.length;s+=1){let i=e.words[s];if(i!==void 0&&t.has(i.value)){let a=[],c=d0(e.words,s,t===rx?"fd":"find");for(let l=s+1;l<e.words.length;l+=1){let u=e.words[l];if(u===void 0||u.value===";"||u.value==="+")break;a.push(r.has(u.value)?c:u)}this.#e.emitSynthetic(a,e,n,o)}}}#n(e,t,r){let n=1;while(e.words[n]?.value.startsWith("-")===!0)n+=1;let o=e.words[n]?.value;if(o===void 0)return;if(O0.has(o)){let s=lp(e.words,new Set(["-c","--command"]),n+1);if(s!==null){this.#e.inspectShellSource(e.words[s],t,r);return}this.#e.emitSynthetic(e.words.slice(n+1),e,t,r);return}this.#e.emitSynthetic(e.words.slice(n),e,t,r)}#m(e,t,r,n){if(t.shellFlag){let s=lp(e.words,new Set(["-c","--command"]));if(s!==null){this.#e.inspectShellSource(e.words[s],r,n);return}}let o=tx(e.words,1,t.valueFlags);o+=t.skipPositionals,this.#e.emitSynthetic(e.words.slice(o),e,r,n)}}var y0=E(()=>{g0();x0();ap();Ga();up()});class E0{#t;#e=[];#r=[];#s=[];#a=new Set;#o=[];#u=new WeakSet;#d=new Set;#p=new Set;#f=[];#n;#m;#O=1;#S=1;constructor(e,t){this.#t=e,this.#m=t,this.#n=new ix({addDiagnostic:(r,n,o)=>{this.#c(r,n,o)},emitSynthetic:(r,n,o,s)=>{this.#T(r,n,o,s)},inspectShellSource:(r,n,o)=>{this.#D(r,n,o)}},t.executionCarrierAliases??[])}analyze(e){let t=qg(),r=(n,o)=>{t.bindings.set(n,{source:o,value:o,kind:"literal",range:{start:0,end:0},quoted:!0,variable:n})};if(this.#m.cwd!==void 0)r("PWD",this.#m.cwd);for(let[n,o]of(this.#m.positionalArguments??[]).entries())r((n+1).toString(),o);return this.#g(e,t,{inspectedPipelineInput:!1,source:this.#t,pipeline:void 0}),{source:this.#t,invocations:this.#e,redirects:this.#r,diagnostics:this.#s,environmentAssignments:[...this.#a],hasBypass:this.#N()}}#c(e,t,r){this.#s.push({kind:e,message:t,range:r})}#g(e,t,r){if(this.#u.has(e))return;this.#u.add(e);let n=e.source??r.source;for(let o of e.errors??[])this.#c("parse-error",o.message,{start:o.pos,end:o.pos});this.#E(e.commands,t,{...r,source:n})}#E(e,t,r){for(let n of e)this.#k(n,t,r)}#k(e,t,r){if(this.#b(e.redirects,t,r),this.#l(e.command,t,r),e.background===!0)t.backgroundPidAvailable=!0}#l(e,t,r){if(this.#v(e,t,r)||this.#C(e,t,r)||this.#Q(e,t,r))return;this.#c("parse-error",`Unknown Bash AST node: ${e.type}`,yn(e))}#v(e,t,r){if(e.type==="Statement")return this.#k(e,t,r),!0;if(e.type==="Command")return this.#_(e,t,r),!0;if(e.type==="CompoundList")return this.#E(e.commands,t,r),!0;if(e.type==="Pipeline"){let n=this.#S;this.#S+=1;let o=this.#n.inspectPipelineInputs(e.commands,t,r);for(let[s,i]of e.commands.entries())this.#l(i,Pt(t),{...r,inspectedPipelineInput:o.has(s),pipeline:{id:n,index:s}});return!0}if(e.type==="AndOr"){let n=Pt(t);for(let o of e.commands)this.#l(o,n,r);return cx(t,ax([t,n])),!0}return!1}#C(e,t,r){if(e.type==="If"){let n=Pt(t);this.#l(e.clause,n,r);let o=Pt(n);this.#l(e.then,o,r);let s=Pt(n);if(e.else!==void 0)this.#l(e.else,s,r);return cx(t,ax([o,s])),!0}if(e.type==="For"||e.type==="Select"){let n=this.#i(e.name,t,r),o=e.wordlist.map((s)=>this.#i(s,t,r));if(n.kind==="literal"&&/^[A-Za-z_][A-Za-z0-9_]*$/u.test(n.value)&&o.length>0&&o.length<=32&&o.every((s)=>s.kind==="literal"))for(let s of o){let i=Pt(t);i.temps.delete(n.value),i.bindings.set(n.value,s),this.#l(e.body,i,r)}else{let s=Pt(t);s.temps.delete(n.value),s.bindings.delete(n.value),this.#l(e.body,s,r)}return!0}if(e.type==="ArithmeticFor")return this.#h(e.initialize,t,r),this.#h(e.test,t,r),this.#h(e.update,t,r),this.#l(e.body,Pt(t),r),!0;if(e.type==="While"){let n=Pt(t);return this.#l(e.clause,n,r),this.#l(e.body,n,r),!0}if(e.type==="Function"){let n=this.#i(e.name,t,r);if(n.kind!=="literal"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(n.value))this.#c("function","The function name is not static.",yn(e));else t.functions.set(n.value,e);return!0}return!1}#Q(e,t,r){if(e.type==="Subshell")return this.#l(e.body,Pt(t),r),!0;if(e.type==="BraceGroup")return this.#l(e.body,t,r),!0;if(e.type==="Case"){this.#i(e.word,t,r);let n=[Pt(t)];for(let o of e.items){for(let i of o.pattern)this.#i(i,t,r);let s=Pt(t);this.#l(o.body,s,r),n.push(s)}return cx(t,ax(n)),!0}if(e.type==="Coproc"){if(e.name!==void 0)this.#i(e.name,t,r);return this.#b(e.redirects,t,r),this.#l(e.body,Pt(t),r),!0}if(e.type==="TestCommand")return this.#y(e.expression,t,r),!0;if(e.type==="ArithmeticCommand")return this.#h(e.expression,t,r),!0;return!1}#_(e,t,r){let n=e.prefix.flatMap((l)=>{let u=this.#$(l,t,r);return u===null?[]:[u]});if(e.name===void 0)for(let l of n)S0(l,t);let o=this.#b(e.redirects,t,r);if(e.name===void 0)return;let s=this.#i(e.name,t,r),i=e.suffix.flatMap((l)=>this.#P(l,t,r));if(s.kind==="literal"&&t.functions.has(s.value)){this.#R(s.value,i,n,t,r);return}if(s.kind==="literal"&&t.aliases.has(s.value)){this.#I(s.value,i,t,r,yn(e));return}let a=this.#w([s,...i],o,yn(e),r,!1);if(a===null)return;if(a.head==="alias"){this.#F(a,t);return}if(a.head==="unalias"){this.#U(a,t);return}let c=this.#n.inspectShellInput(a,e.redirects,t,r);this.#n.inspectWrapper(a,t,r,c),this.#M(a,t)}#$(e,t,r){for(let i of e.indexParts??[])this.#x(i,t,r);for(let i of e.array??[])this.#i(i,t,r);let n=e.value===void 0?void 0:this.#i(e.value,t,r);if(e.name===void 0)return null;this.#a.add(e.name);let o=e.append!==!0&&e.index===void 0&&e.array===void 0&&e.value!==void 0&&Xv(e.value,t);return{binding:ND(e,n,t)?n:void 0,name:e.name,trustedTemp:o}}#P(e,t,r){let n=this.#i(e,t,r);if(n.kind!=="literal"||n.quoted||!/[*?[]/u.test(n.value))return[n];try{let o=[...new Bun.Glob(n.value).scanSync({onlyFiles:!1,dot:!0})];if(o.length===0)return[n];let s=[];for(let i of o)s.push({source:n.source,value:i,kind:n.kind,range:n.range,quoted:n.quoted});return s}catch{return[n]}}#i(e,t,r){for(let a of e.parts??[])this.#x(a,t,r);let n=Bv(e,t);if(n!==null)return n;let o=Xg(e,t);if(o!==null)return o;let s=zg(e,t);if(s!==null)return s;if(Ro(e))return{source:e.text,value:e.value,kind:"literal",range:yn(e),quoted:(e.parts??[]).some((a)=>Wg(a))};let i=Lg(e,t);if(i!==null)return{source:e.text,value:i,kind:"literal",range:yn(e),quoted:!0};return{source:e.text,value:e.value,kind:"dynamic",range:yn(e),quoted:(e.parts??[]).some((a)=>Wg(a))}}#x(e,t,r){switch(e.type){case"Literal":case"SingleQuoted":case"AnsiCQuoted":case"SimpleExpansion":return;case"DoubleQuoted":case"LocaleString":{for(let n of e.parts)this.#x(n,t,r);return}case"ParameterExpansion":{this.#A(e,t,r);return}case"CommandExpansion":case"ProcessSubstitution":{if(e.script!==void 0)this.#g(e.script,Pt(t),r);return}case"ArithmeticExpansion":{this.#h(e.expression,t,r);return}case"ExtendedGlob":case"BraceExpansion":{for(let n of e.parts??[])this.#x(n,t,r);break}default:break}}#A(e,t,r){for(let n of e.indexParts??[])this.#x(n,t,r);if(e.operand!==void 0)this.#i(e.operand,t,r);if(e.slice!==void 0){if(this.#i(e.slice.offset,t,r),e.slice.length!==void 0)this.#i(e.slice.length,t,r)}if(e.replace!==void 0)this.#i(e.replace.pattern,t,r),this.#i(e.replace.replacement,t,r)}#h(e,t,r){if(e===void 0)return;switch(e.type){case"ArithmeticBinary":{this.#h(e.left,t,r),this.#h(e.right,t,r);return}case"ArithmeticUnary":{this.#h(e.operand,t,r);return}case"ArithmeticTernary":{this.#h(e.test,t,r),this.#h(e.consequent,t,r),this.#h(e.alternate,t,r);return}case"ArithmeticGroup":{this.#h(e.expression,t,r);return}case"ArithmeticWord":{for(let n of e.parts??[])this.#x(n,t,r);return}case"ArithmeticCommandExpansion":{if(e.script!==void 0)this.#g(e.script,Pt(t),r);break}default:break}}#y(e,t,r){switch(e.type){case"TestUnary":{this.#i(e.operand,t,r);return}case"TestBinary":{this.#i(e.left,t,r),this.#i(e.right,t,r);return}case"TestLogical":{this.#y(e.left,t,r),this.#y(e.right,t,r);return}case"TestNot":{this.#y(e.operand,t,r);return}case"TestGroup":{this.#y(e.expression,t,r);break}default:break}}#b(e,t,r){let n=[];for(let o of e){if(o.body!==void 0)this.#o.push(yn(o.body)),this.#i(o.body,t,r);else if(o.content!==void 0){let c=r.source.indexOf(o.content,o.end);if(c!==-1)this.#o.push({start:c,end:c+o.content.length})}let s=o.target===void 0?{source:"",value:vi,kind:"dynamic",range:yn(o),quoted:!1}:this.#i(o.target,t,r),i;if(o.operator==="<<-")i="<<";else if(o.operator===">|")i=">";else i=o.operator;let a={op:i,target:s,range:yn(o),...o.content!==void 0&&{heredoc:{content:o.content,quoted:o.heredocQuoted===!0}}};n.push(a),this.#r.push(a)}return n}#w(e,t,r,n,o){let[s]=e;if(s===void 0)return null;if(s.kind!=="literal")return this.#c("dynamic-executable","The executable name is computed at runtime.",s.range),null;let i=e.map((u)=>u.value),a=i.slice(1).filter((u)=>u.startsWith("-")&&u!=="-"),c=i.slice(1).filter((u)=>!u.startsWith("-")||u==="-"),l={id:this.#O,head:DD(s.value),words:e,tokens:i,args:c,flags:a,redirects:t,raw:o?e.map((u)=>u.source).join(" "):n.source.slice(r.start,r.end),range:r,pipeline:n.pipeline,synthetic:o};if(this.#O+=1,this.#e.push(l),l.head==="eval")this.#c("eval","`eval` can turn computed data into shell syntax.",r);return l}#R(e,t,r,n,o){let s=n.functions.get(e);if(s===void 0)return;if(this.#p.has(e)){this.#c("function",`Recursive function call: ${e}`,yn(s));return}this.#p.add(e);let i=Pt(n),a=new Set(r.map((l)=>l.name));for(let l of r)S0(l,i);for(let l of i.bindings.keys())if(/^[0-9]+$/u.test(l))i.bindings.delete(l);for(let[l,u]of t.entries())i.bindings.set(String(l+1),u);let c={localNames:new Set};this.#f.push(c);try{this.#b(s.redirects,i,o),this.#l(s.body,i,o);let l=new Set([...a,...c.localNames]);for(let u of i.bindings.keys())if(/^[0-9]+$/u.test(u))l.add(u);MD(n,i,l)}finally{this.#f.pop(),this.#p.delete(e)}}#I(e,t,r,n,o){let s=r.aliases.get(e);if(s===void 0)return;if(this.#d.has(e)){this.#c("alias",`Recursive alias expansion: ${e}`,o);return}this.#d.add(e);try{let i=ec(s),[a]=i.commands,c=a?.command;if((i.errors?.length??0)>0||i.commands.length!==1||a?.background===!0||a?.redirects.length!==0||c?.type!=="Command"||c.name===void 0||c.prefix.length>0||c.redirects.length>0){this.#g(i,Pt(r),{...n,source:s,pipeline:void 0}),this.#c("alias",`Alias ${e} has compound expansion whose call arguments cannot be bound safely.`,o);return}let l={...n,source:s},u=[this.#i(c.name,r,l),...c.suffix.flatMap((d)=>this.#P(d,r,l)),...t],f={id:0,head:e,words:[],tokens:[],args:[],flags:[],redirects:[],raw:e,range:o,pipeline:n.pipeline,synthetic:!0};this.#T(u,f,r,n)}finally{this.#d.delete(e)}}#F(e,t){for(let r of e.words.slice(1))if(r.kind==="literal"){let n=r.value.indexOf("=");if(n!==-1){let o=r.value.slice(0,n);if(/^[A-Za-z_][A-Za-z0-9_]*$/u.test(o))t.aliases.set(o,r.value.slice(n+1));else this.#c("alias",`Invalid alias name: ${o}`,r.range)}}else this.#c("alias","An alias definition is computed at runtime.",r.range)}#U(e,t){if(e.tokens.includes("-a")){t.aliases.clear();return}for(let r of e.words.slice(1))if(r.kind==="literal")t.aliases.delete(r.value),this.#d.delete(r.value)}#T(e,t,r,n){let o=this.#w(e,[],t.range,{...n,pipeline:t.pipeline},!0);if(o!==null)this.#n.inspectWrapper(o,r,n,n.inspectedPipelineInput)}#D(e,t,r){if(e?.kind!=="literal"){this.#c("dynamic-shell-source","A shell wrapper receives source that is computed at runtime.",e?.range??{start:0,end:0});return}try{this.#g(ec(e.value),Pt(t),{...r,inspectedPipelineInput:!1,source:e.value,pipeline:void 0})}catch(n){this.#c("parse-error",n instanceof Error?n.message:"The nested shell source could not be parsed.",e.range)}}#M(e,t){if(e.head==="export"&&e.flags.some((n)=>n==="-f"||/^-[^-]*f/u.test(n)))this.#c("function","Exported functions can execute in a nested shell outside the local call binding.",e.range);if(e.head==="unset"){for(let n of e.words.slice(1))if(/^[A-Za-z_][A-Za-z0-9_]*$/u.test(n.value))t.temps.delete(n.value),t.bindings.delete(n.value);return}if(!["export","readonly","declare","typeset","local"].includes(e.head))return;let r=this.#f.at(-1);for(let n of e.words.slice(1)){let o=/^(?<name>[A-Za-z_][A-Za-z0-9_]*)/u.exec(n.source)?.groups?.name;if(o!==void 0){if(this.#a.add(o),e.head==="local")r?.localNames.add(o);t.temps.delete(o),t.bindings.delete(o)}}}#N(){let e=this.#t.split("");for(let t of this.#o)for(let r=t.start;r<t.end&&r<e.length;r+=1)if(e[r]!==`
|
|
41
|
+
`&&e[r]!=="\r")e[r]=" ";return/(?<prefix>^|\s)#\s*tripwire-allow:[ \t]*\S[^\r\n]*/u.test(e.join(""))}}var yn=(e)=>({start:e.pos,end:e.end}),DD=(e)=>{let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)},fp=(e)=>{let[t,...r]=e,n=new Map;if(t===void 0)return n;for(let[o,s]of t)if(r.every((i)=>i.get(o)===s))n.set(o,s);return n},ax=(e)=>{let[t,...r]=e;if(t===void 0)return qg();return{aliases:fp([t.aliases,...r.map((n)=>n.aliases)]),backgroundPidAvailable:[t,...r].every((n)=>n.backgroundPidAvailable),bindings:fp([t.bindings,...r.map((n)=>n.bindings)]),functions:fp([t.functions,...r.map((n)=>n.functions)]),temps:fp([t.temps,...r.map((n)=>n.temps)])}},cx=(e,t)=>{e.backgroundPidAvailable=t.backgroundPidAvailable,e.aliases.clear();for(let[r,n]of t.aliases)e.aliases.set(r,n);e.bindings.clear();for(let[r,n]of t.bindings)e.bindings.set(r,n);e.functions.clear();for(let[r,n]of t.functions)e.functions.set(r,n);e.temps.clear();for(let[r,n]of t.temps)e.temps.set(r,n)},dp=(e,t,r)=>{for(let n of e.keys())if(!r.has(n)&&!t.has(n))e.delete(n);for(let[n,o]of t)if(!r.has(n))e.set(n,o)},MD=(e,t,r)=>{dp(e.aliases,t.aliases,new Set),dp(e.functions,t.functions,new Set),dp(e.bindings,t.bindings,r),dp(e.temps,t.temps,r),e.backgroundPidAvailable=t.backgroundPidAvailable},S0=(e,t)=>{if(t.temps.delete(e.name),t.bindings.delete(e.name),e.trustedTemp)t.temps.set(e.name,{variable:e.name});else if(e.binding!==void 0)t.bindings.set(e.name,e.binding)},ND=(e,t,r)=>{if(e.append===!0||e.index!==void 0||e.array!==void 0||e.value===void 0)return!1;if(t?.kind==="literal")return Ro(e.value)||Lg(e.value,r)!==null||zg(e.value,r)!==null;return t?.kind==="background-pid"&&Xg(e.value,r)!==null},lu=(e,t={})=>{try{return new E0(e,t).analyze(ec(e))}catch(r){return{source:e,invocations:[],redirects:[],diagnostics:[{kind:"parse-error",message:r instanceof Error?r.message:"The Bash parser failed.",range:{start:0,end:e.length}}],hasBypass:!1}}};var b0=E(()=>{Jg();y0();Ga()});var ZD,k0,qD=(e)=>e.startsWith("./")?e.slice(2):e,nc=(e,t=[],r=[])=>{if(e===""||e===vi)return!1;let n=qD(e);if(n===".."||n.startsWith("../")||n.includes("/../"))return!1;for(let o of[...k0,...r])if(n===o||n.startsWith(`${o}/`))return!0;for(let o of[...ZD,...t])if(n===o||n.startsWith(`${o}/`))return!0;return!1},P0=(e=[],t=[])=>{let r={"build outputs":["dist","build","_build","out","target"],"js framework outputs":[".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless"],"tests / coverage":["coverage",".nyc_output"],caches:[".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox"],"language / package":["__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target"],"tmp / state":["tmp",".tmp",".state",...k0],iac:[".terraform"],"bundler dev":[".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"]};if(e.length>0)r["custom relative"]=e;if(t.length>0)r["custom absolute"]=t;return Object.entries(r).map(([n,o])=>` ${n}: ${o.join(", ")}`).join(`
|
|
42
|
+
`)};var uu=E(()=>{Ga();b0();Ga();ZD=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],k0=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"]});var WD,LD,w0;var T0=E(()=>{Zn();WD=Lr("ssh"),LD=ot({command:Ae(Pv).check(Rg(1),kv(16)),equivalentTo:WD}),w0=ot({executionCarrierAliases:te(Ae(LD).check(kv(64)))})});var v0,q=(e)=>({kind:"allow",rule:e,message:""}),Wn=(e,t)=>({kind:"warn",rule:e,message:t}),st=(e,t)=>({kind:"ask",rule:e,message:t}),W=(e,t)=>({kind:"deny",rule:e,message:t}),Do=(e)=>{let t=q("none");for(let r of e)if(v0[r.kind]>v0[t.kind])t=r;return t};var Zt=E(()=>{v0={allow:0,warn:1,ask:2,deny:3}});var qt,lx,zD=(e)=>Object.hasOwn(lx.fields,e),C0=(e,t)=>{let r=zD(e.rule)?t[e.rule]:void 0;if(r===void 0||r===e.kind)return e;if(r==="allow")return q(e.rule);if(r==="warn")return Wn(e.rule,e.message);if(r==="ask")return st(e.rule,e.message);return W(e.rule,e.message)};var ux=E(()=>{Zn();Zt();qt=Xa(["allow","warn","ask","deny"]),lx=ot({"brew-mutation":te(qt),"chmod-777-recursive":te(qt),"defaults-write":te(qt),"dscl-mutate":te(qt),"launchctl-mutation":te(qt),"mas-mutation":te(qt),"no-gpg-sign":te(qt),"no-verify":te(qt),osascript:te(qt),"pmset-write":te(qt),"rsync-delete":te(qt),"scutil-set":te(qt),"security-keychain-add-write":te(qt),"softwareupdate-install":te(qt),sudo:te(qt),systemsetup:te(qt),topgrade:te(qt)})});import{readFileSync as XD}from"fs";import{homedir as jD}from"os";var Q0,VD,BD,GD,YD,HD,JD,fx,_0,$0,KD=(e)=>e instanceof Error&&("code"in e)&&e.code==="ENOENT",eM=(e)=>xt({try:()=>XD(e,"utf8"),catch:(t)=>new _0({cause:t})}).pipe(wa("ConfigReadError",(t)=>KD(t.cause)?T(null):N(t))),tM=(e)=>xt({try:()=>JSON.parse(e),catch:(t)=>new $0({cause:t})}),rM=(e)=>ru(JD)(e,{onExcessProperty:"error"}),pp=()=>({git:{protectedBranches:[],enforceConventionalCommits:!1},safePaths:{},toolPolicies:[],blockedCommands:[],allowedCommands:[],ruleActions:{},secretScanner:{executable:"betterleaks",timeoutMs:5000},shell:{executionCarrierAliases:[]}}),dx=(e)=>{let t=pp();return{git:{protectedBranches:e.git?.protectedBranches??t.git.protectedBranches,enforceConventionalCommits:e.git?.enforceConventionalCommits??t.git.enforceConventionalCommits},safePaths:{...t.safePaths,...e.safePaths},toolPolicies:e.toolPolicies??t.toolPolicies,blockedCommands:e.blockedCommands??t.blockedCommands,allowedCommands:e.allowedCommands??t.allowedCommands,ruleActions:{...t.ruleActions,...e.ruleActions},secretScanner:e.secretScanner??t.secretScanner,shell:{executionCarrierAliases:e.shell?.executionCarrierAliases??t.shell.executionCarrierAliases}}},hp=(e=fx)=>We(function*(){let r=yield*eM(e);if(r===null)return{ok:!0,config:pp()};let n=yield*tM(r),o=yield*rM(n);return{ok:!0,config:dx(o)}}).pipe(Ak(1000),wr((t)=>{let r={ok:!1,error:ci(t)};return T(r)}));var px=E(()=>{Zn();T0();ux();Q0=ot({pattern:V,message:V,action:te(hn([Lr("deny"),Lr("ask")])),requiresFlags:te(Ae(V)),forbidsFlagValues:te(Ae(ot({flag:V,values:Ae(V)})))}),VD=ot({protectedBranches:te(Ae(V)),enforceConventionalCommits:te(_g)}),BD=ot({relative:te(Ae(V)),absolute:te(Ae(V))}),GD=ot({argumentsIncludeAll:te(Ae(V)),argumentsStartWith:te(Ae(V)),shortFlagsIncludeAll:te(Ae(V))}),YD=ot({rule:V,executables:Ae(V),action:hn([Lr("deny"),Lr("warn")]),message:V,match:te(GD)}),HD=ot({executable:V,timeoutMs:ou.check(DU(0))}),JD=ot({git:te(VD),safePaths:te(BD),toolPolicies:te(Ae(YD)),blockedCommands:te(Ae(Q0)),allowedCommands:te(Ae(Q0)),ruleActions:te(lx),secretScanner:te(HD),shell:te(w0)}),fx=`${jD()}/.config/tripwire/config.json`;_0=class _0 extends Fr("ConfigReadError"){};$0=class $0 extends Fr("ConfigParseError"){}});var nM,F0,Ox,gx=(e)=>({kind:"cursor",eventName:e,post:Ox.has(e)}),oM=(e)=>F0.has(e)||Ox.has(e),Ai=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),dt=(e,...t)=>{for(let r of t){let n=e[r];if(typeof n==="string")return n}return},xx=(e,...t)=>{for(let r of t)if(r in e)return e[r];return},mx=(e,t,...r)=>{let n=dt(e,...r);if(n!==void 0)return n;if(typeof t==="string"&&r.includes("command"))return t;return Ai(t)?dt(t,...r):void 0},A0=(e,t)=>{if(e===void 0)throw Error(`Cursor hook payload missing ${t}`);return e},sM=(e)=>{let t=e.toLowerCase();if(t==="bash"||t==="exec"||t==="shell"||t==="run_command")return"Bash";if(t==="read"||t==="read_file")return"Read";if(t==="write"||t==="write_file")return"Write";if(t==="edit"||t==="edit_file"||t==="multiedit"||t==="apply_patch")return"Edit";return e},iM=(e)=>e==="Read"||e==="Write"||e==="Edit",aM=(e,t)=>{let r;if(typeof e==="string")r=e;else if(Ai(e))r=dt(e,"command","cmd");if(t&&r===void 0)throw Error("Cursor hook payload missing command");if(typeof e==="string")return{command:e};if(!Ai(e)||r===void 0)return e;return{...e,command:r}},cM=(e,t,r)=>{let n=dt(t,"file_path","filePath","path");if(r&&n===void 0)throw Error(`Cursor ${e} hook payload missing file path`);if(e==="Read")return{...t,file_path:n??""};if(e==="Write"){let o=dt(t,"content","fileText","text");if(r&&o===void 0)throw Error("Cursor Write hook payload missing content");return{...t,file_path:n??"",content:o??""}}if(e==="Edit"){let o=dt(t,"old_string","oldString"),s=dt(t,"new_string","newString");if(r&&(o===void 0||s===void 0))throw Error("Cursor Edit hook payload missing oldString or newString");return{...t,file_path:n??"",old_string:o??"",new_string:s??""}}return t},hx=(e,t,r=!0)=>{if(e==="Bash")return aM(t,r);if(!iM(e))return t;if(!Ai(t)){if(r)throw Error(`Cursor ${e} hook payload is missing tool input`);return t}return cM(e,t,r)},R0=(e,t)=>{if(typeof t!=="string")return t;if(e==="Bash")return{stdout:t,stderr:""};if(e==="Read")return{content:t};return{content:t}},lM=(e,t)=>{if(e==="beforeShellExecution"||e==="afterShellExecution")return"Bash";if(e==="beforeReadFile"||e==="beforeTabFileRead"||e==="afterFileEdit"||e==="afterTabFileEdit")return e.startsWith("before")?"Read":"Edit";let r=dt(t,"tool_name","toolName");if(r!==void 0)return sM(r);let n=xx(t,"tool_input","toolInput");if(dt(t,"command","cmd")!==void 0||typeof n==="string"||Ai(n)&&dt(n,"command","cmd")!==void 0)return"Bash";if(dt(t,"file_path","filePath","path")!==void 0||Ai(n)&&dt(n,"file_path","filePath","path")!==void 0)return"Read";return""},uM=(e,t)=>{if(e==="Bash")return{command:mx(t,void 0,"command","cmd")};let r={file_path:dt(t,"file_path","filePath","path")};if(e==="Write")return{...r,content:dt(t,"content","fileText","text")};if(e==="Edit")return{...r,old_string:dt(t,"old_string","oldString"),new_string:dt(t,"new_string","newString")};return r},fM=(e,t,r,n)=>{let o=TU(nM)(r);if(Ut(o))throw Error("Cursor sent an invalid tool event");let s=o.success,i=xx(s,"tool_input","toolInput"),a=!n;if(e==="beforeShellExecution"||e==="afterShellExecution"){let c=mx(s,i,"command","cmd");return{command:a?A0(c,"command"):c??""}}if(e==="beforeReadFile"||e==="beforeTabFileRead"||e==="afterFileEdit"||e==="afterTabFileEdit"){let c=mx(s,i,"file_path","filePath","path");return hx(t,{file_path:a?A0(c,"file path"):c??"",...Array.isArray(s.edits)&&{edits:s.edits}},a)}if(i===void 0&&["Bash","Read","Write","Edit"].includes(t))return hx(t,uM(t,s),a);return hx(t,i,a)},dM=(e,t,r)=>{if(e==="afterShellExecution")return R0(t,dt(r,"output")??"");let n=xx(r,"tool_response","toolResponse","tool_output","toolOutput","result","result_json");return R0(t,n)},I0=(e,t,r)=>{let n=lM(t,e),o=fM(t,n,e,r),s=r?dM(t,n,e):void 0,i=dt(e,"cwd"),a=dt(e,"conversation_id","session_id"),c=dt(e,"tool_use_id");return{event:{hook_event_name:r?"PostToolUse":"PreToolUse",...n.length>0&&{tool_name:n},...o!==void 0&&{tool_input:o},...s!==void 0&&{tool_response:s},...i!==void 0&&{cwd:i},...a!==void 0&&{session_id:a},...c!==void 0&&{tool_use_id:c}},host:gx(t)}},U0=(e,t)=>{if(t!==void 0&&!oM(t))throw Error(`Unknown Cursor hook event "${t}"`);if(!Ai(e)){if(t!==void 0)throw Error(`Cursor ${t} hook payload must be a JSON object`);return{event:e,host:{kind:"native"}}}let r=t??dt(e,"hook_event_name");if(r!==void 0&&F0.has(r))return I0(e,r,!1);if(r!==void 0&&Ox.has(r))return I0(e,r,!0);return{event:e,host:{kind:"native"}}};var D0=E(()=>{Zn();nM=Sv(V,Jd),F0=new Set(["preToolUse","beforeShellExecution","beforeMCPExecution","beforeReadFile","beforeTabFileRead"]),Ox=new Set(["postToolUse","postToolUseFailure","afterShellExecution","afterMCPExecution","afterFileEdit","afterTabFileEdit"])});var yx,oc=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),Sx=(e)=>oc(e)&&typeof e.command==="string",pM,hM,M0,N0,Z0=(e)=>oc(e)&&typeof e.file_path==="string"&&typeof e.old_string==="string"&&typeof e.new_string==="string",q0=(e)=>oc(e)&&typeof e.file_path==="string"&&typeof e.content==="string",W0=(e)=>oc(e)&&typeof e.file_path==="string",L0=(e,t)=>{if(!oc(t))return"";if(e==="Bash"){let r=typeof t.stdout==="string"?t.stdout:"",n=typeof t.stderr==="string"?t.stderr:"";return[r,n].filter((o)=>o.length>0).join(`
|
|
43
|
+
`)}if(e==="Read"){if(typeof t.content==="string")return t.content;let{file:r}=t;return oc(r)&&typeof r.content==="string"?r.content:""}return typeof t.content==="string"?t.content:""};var Ex=E(()=>{Zn();yx=ot({hook_event_name:V,tool_name:te(V),tool_input:te(Jd),tool_response:te(Jd),cwd:te(V),session_id:te(V),turn_id:te(V),tool_use_id:te(V)}),pM=hn([V,ot({code:V})]),hM=ot({cmd:V}),M0=Ov(pM),N0=Ov(hM)});import{appendFileSync as mM,mkdirSync as OM}from"fs";import{homedir as gM}from"os";import xM from"path";var z0,Ln=(e,t)=>{let r=new Date().toISOString(),n=t instanceof Error?t.stack??t.message:String(t);try{mM(z0,`[${r}] [${e}] ${n}
|
|
44
|
+
`)}catch{}};var X0=E(()=>{z0=`${gM()}/.claude/tripwire.log`;try{OM(xM.dirname(z0),{recursive:!0})}catch{}});var yM,sc=(e,t)=>{if(!e.hasBypass||t.kind==="allow"||yM.has(t.rule))return t;return q(t.rule)};var bx=E(()=>{Zt();yM=new Set(["unsupported-shell-structure","source-script","rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign","curl-pipe-shell","gh-api-mutation","gh-destructive","flyctl-destroy","gcloud-delete","git-dynamic-subcommand","git-dynamic-mutation","git-restore-discard","git-checkout-force","git-checkout-discard","git-checkout-discard-all","git-switch-force","git-reset-hard","git-force-push","git-filter","git-update-ref","git-reflog-expire","git-symbolic-ref-write"])});var SM=(e)=>e.tokens.slice(1).join(" "),j0=(e,...t)=>{let r=new Set(e.flags);return t.some((n)=>r.has(n))},EM,bM,kM=(e)=>{if(e.head==="dd")return e.words.slice(1).some((r)=>r.kind==="dynamic"&&!r.source.startsWith("if="));if(e.head==="rsync"){let r=e.words.findIndex((o)=>o.value==="--"),n=r===-1?e.words.length:r;return e.words.slice(1,n).some((o)=>o.kind==="dynamic")}if(e.head==="gh"&&e.tokens[1]==="api"){for(let r=2;r<e.words.length;r+=1){let n=e.words[r-1]?.value,o=e.words[r];if(o?.kind==="dynamic"&&(n==="--method"||n==="-X"||o.source.startsWith("-X")||o.source.startsWith("--method=")))return!0}return!1}let t=EM.get(e.head);if(t!==void 0)return e.words.slice(1,t+1).some((r)=>r.kind==="dynamic");return bM.has(e.head)&&e.words.slice(1).some((r)=>r.kind==="dynamic")},PM=(e)=>{if(e.head!=="gh"||e.tokens[1]!=="api")return null;for(let t=2;t<e.tokens.length;t+=1){let r=e.tokens[t];if(r==="--method"||r==="-X")return e.tokens[t+1]?.toUpperCase()??"";if(r?.startsWith("--method=")===!0)return r.slice(9).toUpperCase();if(r?.startsWith("-X")===!0&&r.length>2)return r.slice(2).toUpperCase()}return null},wM=(e)=>{if(e.head!=="gh"||e.tokens[1]!=="api")return!1;let t=PM(e);if(t!==null&&["POST","PUT","PATCH","DELETE"].includes(t))return!0;return e.flags.some((r)=>r==="--input"||r.startsWith("--input=")||r==="-f"||r==="-F"||r==="--field"||r.startsWith("--field=")||r==="--raw-field"||r.startsWith("--raw-field="))},TM,V0=(e,t={})=>{let r=[];if(e.diagnostics.length>0){let n=[...new Set(e.diagnostics.map((s)=>s.message))],o=W("unsupported-shell-structure",`Tripwire cannot inspect this shell program safely: ${n.join(" ")}`);r.push(sc(e,o))}for(let n of e.invocations)if(kM(n)){let o=W("unsupported-shell-structure",`Tripwire cannot classify computed policy arguments to \`${n.head}\` safely.`);r.push(sc(e,o))}else{let o=TM.find((s)=>s.match(n,e.source));if(o!==void 0){let s=o.action==="deny"?W(o.rule,o.message):st(o.rule,o.message);r.push(sc(e,C0(s,t)))}}return r.length===0?q("bash-deny"):Do(r)};var B0=E(()=>{Zt();ux();bx();EM=new Map([["launchctl",1],["defaults",1],["diskutil",1],["tmutil",1],["security",1],["brew",1],["mas",1],["kmutil",1],["gh",2]]),bM=new Set(["dd","kill","chmod","softwareupdate","pmset","dscl","xattr","spctl","systemsetup","scutil","flyctl","gcloud"]),TM=[{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(e)=>e.head==="rm"&&j0(e,"-rf","-fr","-Rf","-fR")&&e.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(e)=>e.head==="rm"&&j0(e,"-rf","-fr","-Rf","-fR")&&e.tokens.some((t)=>/^(?<home>~|\$HOME|\$\{HOME\})$/u.test(t))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(e,t)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/u.test(t)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(e)=>(e.head==="source"||e.head===".")&&e.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(e)=>e.head==="dd"&&/\bof=\/dev\/(?<type>disk|sd|nvme|rdisk)/iu.test(SM(e))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(e)=>/^mkfs(?<ext>\.[a-z0-9]+)?$/iu.test(e.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(e)=>e.head==="kill"&&e.tokens.includes("-9")&&e.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(e)=>e.head==="chmod"&&e.flags.some((t)=>t.includes("R"))&&e.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(e)=>e.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(e,t)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/u.test(t)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(e)=>e.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(e)=>["shutdown","reboot","halt","poweroff"].includes(e.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(e)=>e.head==="launchctl"&&typeof e.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(e.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(e)=>e.head==="defaults"&&e.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(e)=>e.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(e)=>e.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(e)=>e.head==="diskutil"&&typeof e.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(e.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(e)=>e.head==="tmutil"&&typeof e.tokens[1]==="string"&&["delete","disablelocal"].includes(e.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with the user what you want done before running it.",match:(e)=>e.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(e)=>e.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(e)=>e.head==="rsync"&&e.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(e)=>e.head==="softwareupdate"&&e.flags.some((t)=>t==="--install"||t==="-i"||t==="-d"||t.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need the user.",match:(e)=>e.head==="pmset"&&e.tokens.length>1&&!e.tokens.includes("-g")&&!e.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(e)=>e.head==="dscl"&&e.tokens.some((t)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(t))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(e)=>e.head==="xattr"&&e.tokens.includes("-d")&&e.tokens.some((t)=>t.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(e)=>e.head==="spctl"&&e.flags.some((t)=>t==="--master-disable"||t==="--global-disable"||t==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 the user handles this manually.",match:(e)=>e.head==="kextload"||e.head==="kextunload"||e.head==="kmutil"&&(e.tokens[1]==="load"||e.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(e)=>e.head==="security"&&typeof e.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(e.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(e)=>e.head==="security"&&typeof e.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(e.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(e)=>e.head==="systemsetup"&&e.tokens.some((t)=>t.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(e)=>e.head==="scutil"&&e.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(e)=>e.head==="brew"&&typeof e.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(e.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(e)=>e.head==="mas"&&typeof e.tokens[1]==="string"&&["install","uninstall","purchase"].includes(e.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(e)=>e.head==="gh"&&typeof e.tokens[1]==="string"&&typeof e.tokens[2]==="string"&&["repo","release","issue","pr"].includes(e.tokens[1])&&["delete","destroy","remove"].includes(e.tokens[2])},{rule:"gh-api-mutation",action:"deny",message:"`gh api` with a mutating HTTP method can change shared GitHub state and bypass Git workflow protections. Refuse the inline mutation.",match:wM},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(e)=>e.head==="flyctl"&&e.tokens.some((t)=>t==="destroy"||t==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(e)=>e.head==="gcloud"&&e.tokens.includes("delete")}]});var kx=(e)=>e.protectedBranches??[],vM,CM,QM,Y0,_M=(e)=>{if(e.head!=="git")return null;let t=e.tokens.slice(1),r=0;while(r<t.length){let n=t[r];if(n===void 0)break;if(CM.has(n))r+=2;else if(QM.has(n))r+=1;else if(n.startsWith("--git-dir=")||n.startsWith("--work-tree=")||n.startsWith("--namespace=")||n.startsWith("--super-prefix=")||n.startsWith("--exec-path="))r+=1;else if(n.startsWith("-"))r+=1;else return{subcommand:n,subcommandIndex:r+1,subArgs:t.slice(r+1)}}return null},$M=(e)=>{for(let t=0;t<e.length;t+=1){let r=e[t];if(r===void 0)break;if(r==="-m"||r==="--message")return e[t+1]??null;if(r.startsWith("--message="))return r.slice(10);if(/^-[a-zA-Z]*m[a-zA-Z]*$/u.test(r))return e[t+1]??null}return null},AM=(e,t)=>{let r=kx(t);for(let n of e)for(let o of r)if(n===o||n.endsWith(`:${o}`)||n.endsWith(`/${o}`))return o;return null},RM=(e)=>e.filter((t)=>!t.startsWith("-")),IM=(e)=>e.filter((t)=>t.startsWith("-")),Ve=(e,...t)=>{let r=new Set(e);return t.some((n)=>r.has(n))},FM=({subArgs:e,positional:t})=>{if(Ve(e,"--global","--system"))return W("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!Ve(e,"--get","-l","--list","--get-all","--get-regexp")&&t.length>=2)return W("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return q("bash-git")},UM=({subArgs:e})=>{if(Ve(e,"--cached"))return q("bash-git");return st("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},DM=({subArgs:e,positional:t})=>{if(Ve(e,"--staged","-S")&&!Ve(e,"--worktree","-W"))return q("bash-git");if(t.length>0)return W("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return q("bash-git")},MM=({subArgs:e,positional:t})=>{if(Ve(e,"-b","-B"))return q("bash-git");if(Ve(e,"-f","--force"))return W("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(e.includes("--"))return W("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");let[r]=t;if(r!==void 0&&t.length===1&&(r==="."||r.startsWith("./")))return W("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return q("bash-git")},NM=({subArgs:e})=>{if(Ve(e,"-f","--force","--discard-changes"))return W("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return q("bash-git")},ZM=({subArgs:e,flags:t,positional:r})=>{if(Ve(e,"--hard"))return W("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(Ve(e,"--keep"))return st("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(r.length===0&&t.length===0)return q("bash-git");return st("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},qM=({subArgs:e,flags:t})=>{if(Ve(e,"-n","--dry-run")||t.some((r)=>/^-[a-zA-Z]*n/u.test(r)))return q("bash-git");if(t.some((r)=>/^-[a-zA-Z]*[df]/u.test(r)||r==="--force"))return W("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return q("bash-git")},WM=({subArgs:e,positional:t,config:r})=>{if(Ve(e,"--abort","--quit","--continue","--skip","--edit-todo"))return q("bash-git");if(Ve(e,"-i","--interactive"))return W("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let[n]=t,o=kx(r);if(n!==void 0&&o.includes(n))return st("git-rebase-onto-protected",`Rebasing onto \`${n}\` rewrites history of the current branch. \`git merge ${n}\` is usually safer. Confirm intent.`);return st("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},LM=({subArgs:e})=>{if(Ve(e,"--abort","--quit","--continue","--skip"))return q("bash-git");return st("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},zM=({subArgs:e})=>{if(Ve(e,"--abort","--continue","--quit"))return q("bash-git");return st("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},XM=({subArgs:e,config:t})=>{if(Ve(e,"--amend"))return W("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let r=$M(e),n=Ve(e,"-F","--file","-c","-C","--reuse-message","--reedit-message"),o=Ve(e,"--no-edit");if(r===null&&!n&&!o)return W("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(r!==null&&t.enforceConventionalCommits===!0&&!vM.test(r))return W("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify(r)}`].join(`
|
|
45
|
+
`));if(Ve(e,"-a","--all")||e.some((s)=>/^-[a-zA-Z]*a[a-zA-Z]*$/u.test(s)))return st("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return q("bash-git")},jM=({subArgs:e,flags:t,positional:r,config:n})=>{if(t.some((s)=>s==="--force"||s==="-f"||s.startsWith("--force-with-lease")))return W("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(Ve(e,"--delete","--mirror")||e.some((s)=>s.startsWith(":")))return W("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let o=AM(r,n);if(o!==null)return W("git-push-protected",`Refusing to push directly to protected branch \`${o}\`. Open a PR instead: \`gh pr create\`.`);return q("bash-git")},VM=({subArgs:e,flags:t,positional:r,config:n})=>{let o=t.find((s)=>s==="-D"||s==="-d"||s==="--delete"||/^-[a-zA-Z]*D/u.test(s)||/^-[a-zA-Z]*d/u.test(s));if(o!==void 0){let s=r,i=new Set(kx(n)),a=s.find((c)=>i.has(c));if(a!==void 0)return W("git-branch-delete-protected",`Refusing to delete protected branch \`${a}\`.`);if(o==="-D"||o.includes("D"))return W("git-branch-force-delete",`\`git branch -D ${s.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return st("git-branch-delete",`\`git branch -d ${s.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(Ve(e,"-m","-M","--move"))return st("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return q("bash-git")},BM=({subArgs:e})=>{if(Ve(e,"-d","--delete"))return W("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return q("bash-git")},GM=({subArgs:e})=>{let t=e[0]??"push";if(t==="drop"||t==="clear")return W("git-stash-drop",`\`git stash ${t}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return q("bash-git")},YM=({flags:e})=>{if(e.some((t)=>t.startsWith("--prune=")||t==="--aggressive"))return W("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return q("bash-git")},HM=({subArgs:e})=>{let[t]=e;if(t!==void 0&&["add","prune","remove","rename","rm","set-branches","set-head","set-url","update"].includes(t))return st("git-remote-mutate",`\`git remote ${t}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return q("bash-git")},JM=({subArgs:e})=>{if(Ve(e,"-f","--force"))return W("git-checkout-index-force","`git checkout-index --force` can overwrite working-tree files. Refuse.");return st("git-checkout-index","`git checkout-index` writes files from the index into the working tree. Confirm the target and intent.")},G0=({subcommand:e,subArgs:t})=>{let r=t[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(r))return st("git-submodule-worktree-mutate",`\`git ${e} ${r}\` modifies repo structure. Confirm intent.`);return q("bash-git")},KM,eN=(e,t)=>{let{subcommand:r,subArgs:n}=e,o=IM(n),s=RM(n);if(Y0.has(r)){if(r==="reflog"&&(n[0]==="expire"||Ve(n,"--expire")))return W("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(r==="symbolic-ref"&&s.length>=2)return W("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return q("bash-git")}let i=KM.get(r);if(i!==void 0)return i({subcommand:r,subArgs:n,flags:o,positional:s,config:t});return Wn("git-unknown-subcommand",`\`git ${r}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},tN=(e)=>{if(Y0.has(e.subcommand))return!0;if(e.subcommand!=="remote")return!1;let t=e.subArgs.find((r)=>!r.startsWith("-"));return t===void 0||t==="get-url"||t==="show"},H0=(e,t)=>{for(let r of e.invocations){let n=_M(r);if(n!==null){if(r.words[n.subcommandIndex]?.kind==="dynamic")return W("git-dynamic-subcommand","Tripwire cannot classify a Git subcommand that is computed at runtime.");if((!tN(n)||n.subcommand==="reflog"||n.subcommand==="symbolic-ref")&&r.words.slice(1).some((i)=>i.kind==="dynamic"))return W("git-dynamic-mutation",`Tripwire cannot prove that computed arguments to \`git ${n.subcommand}\` preserve Git safety policy.`);let s=eN(n,t);if(s!==null&&s.kind!=="allow")return s}}return q("bash-git")};var J0=E(()=>{Zt();vM=/^(?<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?<scope>\([\w./\- ]+\))?!?:\s+\S/u,CM=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),QM=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),Y0=new Set(["status","diff","diff-tree","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]),KM=new Map([["config",FM],["add",()=>q("bash-git")],["mv",()=>q("bash-git")],["rm",UM],["restore",DM],["checkout",MM],["switch",NM],["reset",ZM],["clean",qM],["rebase",WM],["cherry-pick",LM],["merge",zM],["commit",XM],["push",jM],["branch",VM],["tag",BM],["stash",GM],["filter-branch",({subcommand:e})=>W("git-filter",`\`git ${e}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:e})=>W("git-filter",`\`git ${e}\` rewrites entire repo history. Refuse.`)],["gc",YM],["update-ref",()=>W("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",HM],["submodule",G0],["worktree",G0],["checkout-index",JM],["write-tree",()=>q("bash-git")],["init",({subcommand:e})=>Wn(`git-${e}`,`\`git ${e}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)],["clone",({subcommand:e})=>Wn(`git-${e}`,`\`git ${e}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)]])});var rN,nN,oN=(e)=>{for(let t of e.invocations){let{pipeline:r}=t;if(rN.has(t.head)&&r!==void 0){if(e.invocations.find((o)=>o.pipeline?.id===r.id&&o.pipeline.index===r.index+1&&nN.has(o.head))!==void 0)return!0}}return!1},sN,K0=(e)=>{if(oN(e))return W("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to the user what you're running).");for(let t of e.invocations)for(let r of sN)if(t.head===r.head&&t.tokens[1]===r.subcommand)return st(r.rule,r.message);return q("bash-network-install")};var eC=E(()=>{Zt();rN=new Set(["curl","wget","wget2","aria2c","xh"]),nN=new Set(["bash","sh","zsh","fish"]),sN=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}]});import{lstatSync as iN,readlinkSync as aN,realpathSync as cN}from"fs";import ic from"path";var lN,tC=(e)=>{try{return cN(e)}catch{return null}},Px=(e,t=new Set)=>{if(t.has(e))return e;t.add(e);let r=tC(e);if(r!==null)return r;try{if(iN(e).isSymbolicLink()){let o=aN(e);return Px(ic.resolve(ic.dirname(e),o),t)}}catch{}let n=ic.dirname(e);if(n===e)return e;return ic.join(Px(n,t),ic.basename(e))},fu=(e,t,r)=>{let n=ic.resolve(e),o=t==="write"?Px(n):tC(n),s=[e,n];if(o!==null&&!s.includes(o))s.push(o);for(let i of s)for(let a of r)if(a.pattern.test(i))return a;return null},du=(e)=>{let t=fu(e.file_path,"write",lN);if(t!==null)return W(t.rule,t.message);return q("path-protect")};var pu=E(()=>{Zt();lN=[{pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/u,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/u,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(?<prefix>^|\/)\.ssh\//u,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)(?<pub>\.pub)?$/u,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(?<ext>pem|key|p12|pfx)$/iu,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let the user review."},{pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/iu,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(?<prefix>^|\/)\.aws\/credentials$/u,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(?<prefix>^|\/)\.netrc$/u,rule:"netrc",message:".netrc holds host credentials. Refuse."}]});var uN,fN=(e)=>{let t=fu(e,"write",uN);if(t!==null)return W(t.rule,t.message);return null},wx=(e)=>e.kind==="dynamic"||e.kind==="background-pid"?W("redirect-dynamic-target","Tripwire cannot prove that this computed write target avoids protected files."):fN(e.value),rC=(e)=>{for(let t of e.redirects)if(t.op===">"||t.op===">>"||t.op==="&>"||t.op==="&>>"){let r=wx(t.target);if(r!==null)return r}for(let t of e.invocations){let r=t.words.slice(1).filter((n)=>!n.value.startsWith("-"));if(t.head==="tee")for(let n of r){let o=wx(n);if(o!==null)return o}if(t.head==="cp"||t.head==="mv"){let n=r.at(-1);if(n!==void 0){let o=wx(n);if(o!==null)return o}}}return q("bash-redirect")};var nC=E(()=>{Zt();pu();uN=[{rule:"redirect-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/u,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/u,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(?<prefix>^|\/)\.ssh\//u,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/iu,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/u,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(?<prefix>^|\/)\.netrc$/u,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(?<type>sd|disk|nvme|rdisk)/iu,message:"Redirecting into a raw block device wipes the disk. Refuse."}]});var dN=(e,t)=>{let r=!1,n=[];for(let i of e.tokens.slice(1))if(!r&&i==="--")r=!0;else if(r||!i.startsWith("-")||i==="-")n.push(i);let o=t.relative??[],s=t.absolute??[];return n.filter((i)=>!nc(i,o,s))},pN=(e,t)=>{if(!e.tokens.includes("-delete"))return null;let r=[];for(let i of e.tokens.slice(1)){if(i.startsWith("-"))break;r.push(i)}let n=r.length===0?["."]:r,o=t.relative??[],s=t.absolute??[];return n.filter((i)=>!nc(i,o,s))},oC=(e,t)=>{let r=[];for(let i of e.invocations)if(i.head==="rm"){let a=dN(i,t);if(a.length>0)r.push({kind:"rm",targets:a})}else if(i.head==="find"){let a=pN(i,t);if(a!==null&&a.length>0)r.push({kind:"find -delete",targets:a})}if(r.length===0)return q("bash-scoped-rm");let n=t.relative??[],o=t.absolute??[],s=r.map((i)=>` \u2022 ${i.kind} on: ${i.targets.map((a)=>JSON.stringify(a)).join(", ")}`).join(`
|
|
46
|
+
`);return W("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use a recoverable deletion tool or limit the target to an ephemeral build, cache, state, or temporary directory:
|
|
47
|
+
${P0(n,o)}
|
|
53
48
|
|
|
54
49
|
Flagged targets:
|
|
55
|
-
${
|
|
50
|
+
${s}
|
|
56
51
|
|
|
57
|
-
If raw deletion is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var sj=w(()=>{Lo();Xn()});var yte=(e)=>e==="--extract"||e.startsWith("-")&&!e.startsWith("--")&&e.slice(1).includes("x"),Ste=(e)=>{for(let t=0;t<e.tokens.length;t+=1){let n=e.tokens[t];if(n===void 0)continue;if(n==="-C"||n==="--directory")return e.tokens[t+1]??null;if(n.startsWith("--directory="))return n.slice(12)}return null},ij=(e)=>e==="/"||/^(?<home>~|\$HOME|\$\{HOME\})$/.test(e),aj=(e,t)=>{if(wn(t))return Z("bash-tar-explosion");for(let n of e){if(n.head!=="tar")continue;let[,r]=n.tokens;if(!(n.flags.some(yte)||n.tokens.includes("--extract")||r!==void 0&&/^[a-zA-Z]+$/.test(r)&&r.includes("x")))continue;let s=Ste(n);if(s!==null&&ij(s))return se("tar-extract-to-root",`tar -x with -C ${s} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let n of e){if(n.head!=="unzip")continue;for(let r=0;r<n.tokens.length;r+=1)if(n.tokens[r]==="-d"){let o=n.tokens[r+1];if(o!==void 0&&ij(o))return se("unzip-to-root",`unzip -d ${o} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return Z("bash-tar-explosion")};var cj=w(()=>{Lo();Xn()});var Ete="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",bte,uj=(e)=>bte.get(e)??e,lj=(e)=>{let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)},wte=(e,t)=>e.some((n)=>n===t||n.startsWith(`${t}=`)),vte=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e[n];if(r===void 0)continue;if(r===t)return e[n+1]??"";if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null},kte=(e)=>{let t=[],n=e.tokens.slice(1);for(let r=0;r<n.length;r+=1){let o=n[r];if(o===void 0)continue;if(o.startsWith("-")){let s=n[r+1];if(!o.includes("=")&&s!==void 0&&!s.startsWith("-"))r+=1;continue}t.push(o)}return t},fj=(e,t)=>{let{pattern:n}=t,r=tl(n);if(r.length===0)return!1;let[o]=r;if(o===void 0)return!1;let[s,...i]=o.tokens;if(s===void 0)return!1;for(let a of e){if(lj(a.head)!==lj(s))continue;if(i.length>0){let l=kte(a);if(!i.every((d,m)=>l[m]!==void 0&&uj(l[m])===uj(d)))continue}if((t.requiresFlags??[]).some((l)=>!wte(a.tokens,l)))continue;if(!(t.forbidsFlagValues??[]).every((l)=>{let f=vte(a.tokens,l.flag);return f!==null&&l.values.includes(f)}))continue;if(i.length===0&&t.requiresFlags===void 0&&t.forbidsFlagValues===void 0)return!0;return!0}return!1},dj=(e,t,n,r)=>{if(wn(t))return Z("config-custom");for(let o of r)if(fj(e,o))return Z("config-custom");for(let o of n)if(fj(e,o)){let s=o.message.includes("tripwire-allow")?o.message:`${o.message} ${Ete}`;return o.action==="ask"?zt("config-custom",s):se("config-custom",s)}return Z("config-custom")};var pj=w(()=>{Lo();Xn();bte=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]])});import{readFileSync as Ite}from"fs";var mj=(e,t)=>{let n=new Set(e.split(`
|
|
58
|
-
`).map((r)=>r.trim()).filter((r)=>r.length>0));return t.split(`
|
|
59
|
-
`).
|
|
52
|
+
If raw deletion is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var sC=E(()=>{uu();Zt()});var hN=(e)=>e==="--extract"||e.startsWith("-")&&!e.startsWith("--")&&e.slice(1).includes("x"),mN=(e)=>{for(let t=0;t<e.tokens.length;t+=1){let r=e.tokens[t];if(r!==void 0){if(r==="-C"||r==="--directory")return e.tokens[t+1]??null;if(r.startsWith("--directory="))return r.slice(12)}}return null},iC=(e)=>e==="/"||/^(?<home>~|\$HOME|\$\{HOME\})$/u.test(e),ON=(e)=>{let t=e.tokens.indexOf("-d");return t===-1?void 0:e.tokens[t+1]},aC=(e)=>{for(let t of e.invocations)if(t.head==="tar"){let[,r]=t.tokens,o=t.flags.some(hN)||t.tokens.includes("--extract")||r!==void 0&&/^[a-zA-Z]+$/u.test(r)&&r.includes("x")?mN(t):null;if(o!==null&&iC(o))return W("tar-extract-to-root",`tar -x with -C ${o} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let t of e.invocations)if(t.head==="unzip"){let r=ON(t);if(r!==void 0&&iC(r))return W("unzip-to-root",`unzip -d ${r} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}return q("bash-tar-explosion")};var cC=E(()=>{Zt()});var gN="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",xN,lC=(e)=>xN.get(e)??e,uC=(e)=>{let t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)},yN=(e,t)=>e.some((r)=>r===t||r.startsWith(`${t}=`)),SN=(e,t)=>{for(let r=0;r<e.length;r+=1){let n=e[r];if(n!==void 0){if(n===t)return e[r+1]??"";if(n.startsWith(`${t}=`))return n.slice(t.length+1)}}return null},EN=(e)=>{let t=[],r=e.tokens.slice(1);for(let n=0;n<r.length;n+=1){let o=r[n];if(o?.startsWith("-")===!0){let s=r[n+1];if(!o.includes("=")&&s!==void 0&&!s.startsWith("-"))n+=1}else if(o!==void 0)t.push(o)}return t},fC=(e,t)=>{let{pattern:r}=t,n=lu(r);if(n.diagnostics.length>0||n.invocations.length===0)return!1;let[o]=n.invocations;if(o===void 0)return!1;let[s,...i]=o.tokens;if(s===void 0)return!1;return e.invocations.some((a)=>{if(uC(a.head)!==uC(s))return!1;let c=EN(a),l=i.every((d,h)=>c[h]!==void 0&&lC(c[h])===lC(d)),u=(t.requiresFlags??[]).every((d)=>yN(a.tokens,d)),f=(t.forbidsFlagValues??[]).every((d)=>{let h=SN(a.tokens,d.flag);return h!==null&&d.values.includes(h)});return l&&u&&f})},dC=(e,t,r)=>{for(let n of r)if(fC(e,n))return q("config-custom");for(let n of t)if(fC(e,n)){let o=n.message.includes("tripwire-allow")?n.message:`${n.message} ${gN}`;return n.action==="ask"?st("config-custom",o):W("config-custom",o)}return q("config-custom")};var pC=E(()=>{uu();Zt();xN=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]])});class Op{constructor(e,t){this.from=e,this.to=t}}class Ce{constructor(e={}){this.id=bN++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");if(typeof e!="function")e=Hr.match(e);return(t)=>{let r=e(t);return r===void 0?null:[this,r]}}}class ac{constructor(e,t,r,n=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=n}static get(e){return e&&e.props&&e.props[Ce.mounted.id]}}class Hr{constructor(e,t,r,n=0){this.name=e,this.props=t,this.id=r,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):kN,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new Hr(e.name||"",t,e.id,r);if(e.props)for(let o of e.props){if(!Array.isArray(o))o=o(n);if(o){if(o[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ce.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let n of r.split(" "))t[n]=e[r];return(r)=>{for(let n=r.prop(Ce.group),o=-1;o<(n?n.length:0);o++){let s=t[o<0?r.name:n[o]];if(s)return s}}}}class yp{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let n=null;for(let o of e){let s=o(r);if(s){if(!n)n=Object.assign({},r.props);let i=s[1],a=s[0];if(a.combine&&a.id in n)i=a.combine(n[a.id],i);n[a.id]=i}}t.push(n?new Hr(r.name,n,r.id,r.flags):r)}return new yp(t)}}class Gt{constructor(e,t,r,n,o){if(this.type=e,this.children=t,this.positions=r,this.length=n,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,i]of o)this.props[typeof s=="number"?s:s.id]=i}}toString(){let e=ac.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let n=r.toString();if(n){if(t)t+=",";t+=n}}return!this.type.name?t:(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":"")}cursor(e=0){return new xp(this.topNode,e)}cursorAt(e,t=0,r=0){let n=mp.get(this)||this.topNode,o=new xp(n);return o.moveTo(e,t),mp.set(this,o._tree),o}get topNode(){return new Yr(this,0,0,null)}resolve(e,t=0){let r=hu(mp.get(this)||this.topNode,e,t,!1);return mp.set(this,r),r}resolveInner(e,t=0){let r=hu(hC.get(this)||this.topNode,e,t,!0);return hC.set(this,r),r}resolveStack(e,t=0){return PN(this,e,t)}iterate(e){let{enter:t,leave:r,from:n=0,to:o=this.length}=e,s=e.mode||0,i=(s&pt.IncludeAnonymous)>0;for(let a=this.cursor(s|pt.IncludeAnonymous);;){let c=!1;if(a.from<=o&&a.to>=n&&(!i&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;;){if(c&&r&&(i||!a.type.isAnonymous))r(a);if(a.nextSibling())break;if(!a.parent())return;c=!0}}}prop(e){return!e.perNode?this.type.prop(e):this.props?this.props[e.id]:void 0}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:_x(Hr.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,n)=>new Gt(this.type,t,r,n,this.propValues),e.makeTree||((t,r,n)=>new Gt(Hr.none,t,r,n)))}static build(e){return wN(e)}}class vx{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new vx(this.buffer,this.index)}}class Ds{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Hr.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],n=this.set.types[t],o=n.name;if(/\W/.test(o)&&!n.isError)o=JSON.stringify(o);if(e+=4,r==e)return o;let s=[];while(e<r)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,t,r,n,o){let{buffer:s}=this,i=-1;for(let a=e;a!=t;a=s[a+3])if(xC(o,n,s[a+1],s[a+2])){if(i=a,r>0)break}return i}slice(e,t,r){let n=this.buffer,o=new Uint16Array(t-e),s=0;for(let i=e,a=0;i<t;){o[a++]=n[i++],o[a++]=n[i++]-r;let c=o[a++]=n[i++]-r;o[a++]=n[i++]-e,s=Math.max(s,c)}return new Ds(o,s,this.set)}}function xC(e,t,r,n){switch(e){case-2:return r<t;case-1:return n>=t&&r<t;case 0:return r<t&&n>t;case 1:return r<=t&&n>t;case 2:return n>t;case 4:return!0}}function hu(e,t,r,n){var o;while(e.from==e.to||(r<1?e.from>=t:e.from>t)||(r>-1?e.to<=t:e.to<t)){let i=!n&&e instanceof Yr&&e.index<0?null:e.parent;if(!i)return e;e=i}let s=n?0:pt.IgnoreOverlays;if(n){for(let i=e,a=i.parent;a;i=a,a=i.parent)if(i instanceof Yr&&i.index<0&&((o=a.enter(t,r,s))===null||o===void 0?void 0:o.from)!=i.from)e=a}for(;;){let i=e.enter(t,r,s);if(!i)return e;e=i}}class Cx{cursor(e=0){return new xp(this,e)}getChild(e,t=null,r=null){let n=mC(this,e,t,r);return n.length?n[0]:null}getChildren(e,t=null,r=null){return mC(this,e,t,r)}resolve(e,t=0){return hu(this,e,t,!1)}resolveInner(e,t=0){return hu(this,e,t,!0)}matchContext(e){return Tx(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;while(t){let n=t.lastChild;if(!n||n.to!=t.to)break;if(n.type.isError&&n.from==n.to)r=t,t=n.prevSibling;else t=n}return r}get node(){return this}get next(){return this.parent}}function mC(e,t,r,n){let o=e.cursor(),s=[];if(!o.firstChild())return s;if(r!=null){for(let i=!1;!i;)if(i=o.type.is(r),!o.nextSibling())return s}for(;;){if(n!=null&&o.type.is(n))return s;if(o.type.is(t))s.push(o.node);if(!o.nextSibling())return n==null?s:[]}}function Tx(e,t,r=t.length-1){for(let n=e;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[r]&&t[r]!=n.name)return!1;r--}}return!0}class yC{constructor(e,t,r,n){this.parent=e,this.buffer=t,this.index=r,this.start=n}}function SC(e){if(!e.length)return null;let t=0,r=e[0];for(let s=1;s<e.length;s++){let i=e[s];if(i.from>r.from||i.to<r.to)r=i,t=s}let n=r instanceof Yr&&r.index<0?null:r.parent,o=e.slice();if(n)o[t]=n;else o.splice(t,1);return new EC(o,r)}class EC{constructor(e,t){this.heads=e,this.node=t}get next(){return SC(this.heads)}}function PN(e,t,r){let n=e.resolveInner(t,r),o=null;for(let s=n instanceof Yr?n:n.context.parent;s;s=s.parent)if(s.index<0){let i=s.parent;(o||(o=[n])).push(i.resolve(t,r)),s=i}else{let i=ac.get(s.tree);if(i&&i.overlay&&i.overlay[0].from<=t&&i.overlay[i.overlay.length-1].to>=t){let a=new Yr(i.tree,i.overlay[0].from+s.from,-1,s);(o||(o=[n])).push(hu(a,t,r,!1))}}return o?SC(o):n}class xp{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~pt.EnterBracketed,e instanceof Yr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){if(!e)return!1;return this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0}yieldBuf(e,t){this.index=e;let{start:r,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=r+n.buffer[e+1],this.to=r+n.buffer[e+2],!0}yield(e){if(!e)return!1;if(e instanceof Yr)return this.buffer=null,this.yieldNode(e);return this.buffer=e.context,this.yieldBuf(e.index,e.type)}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:n}=this.buffer,o=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,r);if(o<0)return!1;return this.stack.push(this.index),this.yieldBuf(o)}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){if(!this.buffer)return this.yield(this._tree.enter(e,t,r));return r&pt.ExcludeBuffers?!1:this.enterChild(1,e,t)}parent(){if(!this.buffer)return this.yieldNode(this.mode&pt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&pt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!this._tree._parent?!1:this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let n=r<0?0:this.stack[r]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(n)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:n}=this;if(n){if(e>0){if(this.index<n.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(n.buffer.buffer[o+3]<this.index)return!1;({index:t,parent:r}=n)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let o=t+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let i=r._tree.children[o];if(this.mode&pt.IncludeAnonymous||i instanceof Ds||!i.type.isAnonymous||Qx(i))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){while(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))if(!this.parent())break;while(this.enterChild(1,e,t));return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let n=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==n){if(n==this.index)return s;t=s,r=o+1;break e}n=this.stack[--o]}for(let n=r;n<this.stack.length;n++)t=new Us(this.buffer,t,this.stack[n]);return this.bufferNode=new Us(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let n=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}if(!this.type.isAnonymous)n=!0}for(;;){if(n&&t)t(this);if(n=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,n=!0}}}matchContext(e){if(!this.buffer)return Tx(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let n=e.length-1,o=this.stack.length-1;n>=0;o--){if(o<0)return Tx(this._tree,e,n);let s=r[t.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[n]&&e[n]!=s.name)return!1;n--}}return!0}}function Qx(e){return e.children.some((t)=>t instanceof Ds||!t.type.isAnonymous||Qx(t))}function wN(e){var t;let{buffer:r,nodeSet:n,maxBufferLength:o=1024,reused:s=[],minRepeatType:i=n.types.length}=e,a=Array.isArray(r)?new vx(r,r.length):r,c=n.types,l=0,u=0;function f(C,Q,w,_,I,F){let{id:R,start:A,end:M,size:j}=a,me=u,xr=l;if(j<0)if(a.next(),j==-1){let yr=s[R];w.push(yr),_.push(A-C);return}else if(j==-3){l=R;return}else if(j==-4){u=R;return}else throw RangeError(`Unrecognized record size: ${j}`);let nn=c[R],to,Qr,Hi=A-C;if(M-A<=o&&(Qr=x(a.pos-Q,I))){let yr=new Uint16Array(Qr.size-Qr.skip),ar=a.pos-Qr.size,_r=yr.length;while(a.pos>ar)_r=O(Qr.start,yr,_r);to=new Ds(yr,M-Qr.start,n),Hi=Qr.start-C}else{let yr=a.pos-j;a.next();let ar=[],_r=[],ro=R>=i?R:-1,Bo=0,Pc=M;while(a.pos>yr)if(ro>=0&&a.id==ro&&a.size>=0){if(a.end<=Pc-o)m(ar,_r,A,Bo,a.end,Pc,ro,me,xr),Bo=ar.length,Pc=a.end;a.next()}else if(F>2500)d(A,yr,ar,_r);else f(A,yr,ar,_r,ro,F+1);if(ro>=0&&Bo>0&&Bo<ar.length)m(ar,_r,A,Bo,A,Pc,ro,me,xr);if(ar.reverse(),_r.reverse(),ro>-1&&Bo>0){let cr=h(nn,xr);to=_x(nn,ar,_r,0,ar.length,0,M-A,cr,cr)}else to=b(nn,ar,_r,M-A,me-M,xr)}w.push(to),_.push(Hi)}function d(C,Q,w,_){let I=[],F=0,R=-1;while(a.pos>Q){let{id:A,start:M,end:j,size:me}=a;if(me>4)a.next();else if(R>-1&&M<R)break;else{if(R<0)R=j-o;I.push(A,M,j),F++,a.next()}}if(F){let A=new Uint16Array(F*4),M=I[I.length-2];for(let j=I.length-3,me=0;j>=0;j-=3)A[me++]=I[j],A[me++]=I[j+1]-M,A[me++]=I[j+2]-M,A[me++]=me;w.push(new Ds(A,I[2]-M,n)),_.push(M-C)}}function h(C,Q){return(w,_,I)=>{let F=0,R=w.length-1,A,M;if(R>=0&&(A=w[R])instanceof Gt){if(!R&&A.type==C&&A.length==I)return A;if(M=A.prop(Ce.lookAhead))F=_[R]+A.length+M}return b(C,w,_,I,F,Q)}}function m(C,Q,w,_,I,F,R,A,M){let j=[],me=[];while(C.length>_)j.push(C.pop()),me.push(Q.pop()+w-I);C.push(b(n.types[R],j,me,F-I,A-F,M)),Q.push(I-w)}function b(C,Q,w,_,I,F,R){if(F){let A=[Ce.contextHash,F];R=R?[A].concat(R):[A]}if(I>25){let A=[Ce.lookAhead,I];R=R?[A].concat(R):[A]}return new Gt(C,Q,w,_,R)}function x(C,Q){let w=a.fork(),_=0,I=0,F=0,R=w.end-o,A={size:0,start:0,skip:0};e:for(let M=w.pos-C;w.pos>M;){let j=w.size;if(w.id==Q&&j>=0){A.size=_,A.start=I,A.skip=F,F+=4,_+=4,w.next();continue}let me=w.pos-j;if(j<0||me<M||w.start<R)break;let xr=w.id>=i?4:0,nn=w.start;w.next();while(w.pos>me){if(w.size<0)if(w.size==-3||w.size==-4)xr+=4;else break e;else if(w.id>=i)xr+=4;w.next()}I=nn,_+=j,F+=xr}if(Q<0||_==C)A.size=_,A.start=I,A.skip=F;return A.size>4?A:void 0}function O(C,Q,w){let{id:_,start:I,end:F,size:R}=a;if(a.next(),R>=0&&_<i){let A=w;if(R>4){let M=a.pos-(R-4);while(a.pos>M)w=O(C,Q,w)}Q[--w]=A,Q[--w]=F-C,Q[--w]=I-C,Q[--w]=_}else if(R==-3)l=_;else if(R==-4)u=_;return w}let S=[],y=[];while(a.pos>0)f(e.start||0,e.bufferStart||0,S,y,-1,0);let g=(t=e.length)!==null&&t!==void 0?t:S.length?y[0]+S[0].length:0;return new Gt(c[e.topID],S.reverse(),y.reverse(),g)}function gp(e,t){if(!e.isAnonymous||t instanceof Ds||t.type!=e)return 1;let r=OC.get(t);if(r==null){r=1;for(let n of t.children){if(n.type!=e||!(n instanceof Gt)){r=1;break}r+=gp(e,n)}OC.set(t,r)}return r}function _x(e,t,r,n,o,s,i,a,c){let l=0;for(let m=n;m<o;m++)l+=gp(e,t[m]);let u=Math.ceil(l*1.5/8),f=[],d=[];function h(m,b,x,O,S){for(let y=x;y<O;){let g=y,C=b[y],Q=gp(e,m[y]);y++;for(;y<O;y++){let w=gp(e,m[y]);if(Q+w>=u)break;Q+=w}if(y==g+1){if(Q>u){let w=m[g];h(w.children,w.positions,0,w.children.length,b[g]+S);continue}f.push(m[g])}else{let w=b[y-1]+m[y-1].length-C;f.push(_x(e,m,b,g,y,C,w,null,c))}d.push(C+S-s)}}return h(t,r,n,o,0),(a||c)(f,d,i)}class $x{startParse(e,t,r){if(typeof e=="string")e=new bC(e);return r=!r?[new Op(0,e.length)]:r.length?r.map((n)=>new Op(n.from,n.to)):[new Op(0,0)],this.createParse(e,t||[],r)}parse(e,t,r){let n=this.startParse(e,t,r);for(;;){let o=n.advance();if(o)return o}}}class bC{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}var gC=1024,bN=0,kN,mp,hC,pt,Yr,Us,OC,Qee;var Ax=E(()=>{Ce.closedBy=new Ce({deserialize:(e)=>e.split(" ")});Ce.openedBy=new Ce({deserialize:(e)=>e.split(" ")});Ce.group=new Ce({deserialize:(e)=>e.split(" ")});Ce.isolate=new Ce({deserialize:(e)=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ce.contextHash=new Ce({perNode:!0});Ce.lookAhead=new Ce({perNode:!0});Ce.mounted=new Ce({perNode:!0});kN=Object.create(null);Hr.none=new Hr("",Object.create(null),0,8);mp=new WeakMap,hC=new WeakMap;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(pt||(pt={}));Gt.empty=new Gt(Hr.none,[],[],0);Yr=class Yr extends Cx{constructor(e,t,r,n){super();this._tree=e,this.from=t,this.index=r,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,n,o=0){for(let s=this;;){for(let{children:i,positions:a}=s._tree,c=t>0?i.length:-1;e!=c;e+=t){let l=i[e],u=a[e]+s.from,f;if(!(o&pt.EnterBracketed&&l instanceof Gt&&(f=ac.get(l))&&!f.overlay&&f.bracketed&&r>=u&&r<=u+l.length)&&!xC(n,r,u,u+l.length))continue;if(l instanceof Ds){if(o&pt.ExcludeBuffers)continue;let d=l.findChild(0,l.buffer.length,t,r-u,n);if(d>-1)return new Us(new yC(s,l,e,u),null,d)}else if(o&pt.IncludeAnonymous||(!l.type.isAnonymous||Qx(l))){let d;if(!(o&pt.IgnoreMounts)&&(d=ac.get(l))&&!d.overlay)return new Yr(d.tree,u,e,s);let h=new Yr(l,u,e,s);return o&pt.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(t<0?l.children.length-1:0,t,r,n,o)}}if(o&pt.IncludeAnonymous||!s.type.isAnonymous)return null;if(s.index>=0)e=s.index+t;else e=t<0?-1:s._parent._tree.children.length;if(s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let n;if(!(r&pt.IgnoreOverlays)&&(n=ac.get(this._tree))&&n.overlay){let o=e-this.from,s=r&pt.EnterBracketed&&n.bracketed;for(let{from:i,to:a}of n.overlay)if((t>0||s?i<=o:i<o)&&(t<0||s?a>=o:a>o))return new Yr(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;while(e.type.isAnonymous&&e._parent)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};Us=class Us extends Cx{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super();this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,r);return o<0?null:new Us(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&pt.ExcludeBuffers)return null;let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Us(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];if(t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length))return new Us(this.context,this._parent,t);return this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;if(this.index==t)return this.externalSibling(-1);return new Us(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,n=this.index+4,o=r.buffer[this.index+3];if(o>n){let s=r.buffer[this.index+1];e.push(r.slice(n,o,s)),t.push(0)}return new Gt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};OC=new WeakMap;Qee=new Ce({perNode:!0})});class Sp{constructor(e,t,r,n,o,s,i,a,c,l=0,u){this.p=e,this.stack=t,this.state=r,this.reducePos=n,this.pos=o,this.score=s,this.buffer=i,this.bufferBase=a,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let n=e.parser.context;return new Sp(e,[],t,r,r,0,[],0,n?new Fx(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,n=e&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),i=o.dynamicPrecedence(n);if(i)this.score+=i;if(r==0){if(n<o.minRepeatTerm&&this.reducePos<this.pos)this.reducePos=this.pos;if(this.pushState(o.getGoto(this.state,n,!0),this.reducePos),n<o.minRepeatTerm)this.storeNode(n,this.reducePos,this.reducePos,s?8:4,!0);this.reduceContext(n,this.reducePos);return}let a=this.stack.length-(r-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;if(n<o.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos)this.reducePos=this.pos;let l=this.reducePos-c;if(l>=2000&&!((t=this.p.parser.nodeSet.types[n])===null||t===void 0?void 0:t.isAnonymous)){if(c==this.p.lastBigReductionStart)this.p.bigReductionCount++,this.p.lastBigReductionSize=l;else if(this.p.lastBigReductionSize<l)this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=l}let u=a?this.stack[a-1]:0,f=this.bufferBase+this.buffer.length-u;if(n<o.minRepeatTerm||e&131072){let d=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,c,d,f+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=o.getGoto(d,n,!0)}while(this.stack.length>a)this.stack.pop();this.reduceContext(n,c)}storeNode(e,t,r,n=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this.buffer.length;if(s>0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(t==r)return;if(this.buffer[s-2]>=t){this.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,t,r,n);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let i=!1;for(let a=s;a>0&&this.buffer[a-2]>r;a-=4)if(this.buffer[a-1]>=0){i=!0;break}if(i){while(s>0&&this.buffer[s-2]>r)if(this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,n>4)n-=4}}this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=r,this.buffer[s+3]=n}}shift(e,t,r,n){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;this.pos=n;let i=s.stateFlag(o,1);if(!i&&(n>r||t<=s.maxNode))this.reducePos=n;if(this.pushState(o,i?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=s.maxNode)this.buffer.push(t,r,n,4)}else if(this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode)this.buffer.push(t,r,n,4)}apply(e,t,r,n){if(e&65536)this.reduce(e);else this.shift(e,t,r,n)}useNode(e,t){let r=this.p.reused.length-1;if(r<0||this.p.reused[r]!=e)this.p.reused.push(e),r++;let n=this.pos;if(this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(r,n,this.reducePos,-1),this.curContext)this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;if(t&&e.buffer[t-4]==0)t-=4;while(t>0&&e.buffer[t-2]>e.reducePos)t-=4;let r=e.buffer.slice(t),n=e.bufferBase+t;while(e&&n==e.bufferBase)e=e.parent;return new Sp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;if(r)this.storeNode(e,this.pos,t,4);this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new CC(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let o=0,s;o<t.length;o+=2)if((s=t[o+1])!=this.state&&this.p.parser.hasAction(s,e))n.push(t[o],s);if(this.stack.length<120)for(let o=0;n.length<8&&o<t.length;o+=2){let s=t[o+1];if(!n.some((i,a)=>a&1&&i==s))n.push(t[o],s)}t=n}let r=[];for(let n=0;n<t.length&&r.length<4;n+=2){let o=t[n+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(t[n],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,n=t&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],n,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;t=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(n,o)=>{if(t.includes(n))return;return t.push(n),e.allActions(n,(s)=>{if(s&393216);else if(s&65536){let i=(s>>19)-o;if(i>1){let a=s&65535,c=this.stack.length-i*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return i<<19|65536|a}}else{let i=r(s,o+1);if(i!=null)return i}})};return r(this.state,0)}forceAll(){while(!this.p.parser.stateFlag(this.state,2))if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){if(this.curContext)this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){if(this.curContext)this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;if(e<0||this.buffer[e]!=-3)this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;if(e<0||this.buffer[e]!=-4)this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Fx(this.curContext.tracker,e);if(t.hash!=this.curContext.hash)this.emitContext();this.curContext=t}}setLookAhead(e){if(e<=this.lookAhead)return!1;return this.emitLookAhead(),this.lookAhead=e,!0}close(){if(this.curContext&&this.curContext.tracker.strict)this.emitContext();if(this.lookAhead>0)this.emitLookAhead()}}class Fx{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class CC{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;if(r==0){if(this.stack==this.start.stack)this.stack=this.stack.slice();this.stack.push(this.state,0,0),this.base+=3}else this.base-=(r-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class Ep{constructor(e,t,r){if(this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0)this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ep(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;if(e!=null)this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){if(this.index-=4,this.pos-=4,this.index==0)this.maybeNext()}fork(){return new Ep(this.stack,this.pos,this.index)}}function mu(e,t=Uint16Array){if(typeof e!="string")return e;let r=null;for(let n=0,o=0;n<e.length;){let s=0;for(;;){let i=e.charCodeAt(n++),a=!1;if(i==126){s=65535;break}if(i>=92)i--;if(i>=34)i--;let c=i-32;if(c>=46)c-=46,a=!0;if(s+=c,a)break;s*=46}if(r)r[o++]=s;else r=new t(s)}return r}class Ou{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}class QC{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kC,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,n=this.rangeIndex,o=this.pos+e;while(o<r.from){if(!n)return null;let s=this.ranges[--n];o-=r.from-s.to,r=s}while(t<0?o>r.to:o>=r.to){if(n==this.ranges.length-1)return null;let s=this.ranges[++n];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,n;if(t>=0&&t<this.chunk.length)r=this.pos+e,n=this.chunk.charCodeAt(t);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,i=this.range;while(i.to<=r)i=this.ranges[++s];if(this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>i.to)this.chunk2=this.chunk2.slice(0,i.to-r);n=this.chunk2.charCodeAt(0)}}if(r>=this.token.lookAhead)this.token.lookAhead=r+1;return n}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){if(this.chunkOff>=this.chunk.length){if(this.getChunk(),this.chunkOff==this.chunk.length)return this.next=-1}return this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){this.chunkOff+=e;while(this.pos+e>=this.range.to){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}if(this.pos+=e,this.pos>=this.token.lookAhead)this.token.lookAhead=this.pos+1;return this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t)this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1;else this.token=kC;if(this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;while(e<this.range.from)this.range=this.ranges[--this.rangeIndex];while(e>=this.range.to)this.range=this.ranges[++this.rangeIndex];if(e>=this.chunkPos&&e<this.chunkPos+this.chunk.length)this.chunkOff=e-this.chunkPos;else this.chunk="",this.chunkOff=0;this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let n of this.ranges){if(n.from>=t)break;if(n.to>e)r+=this.input.read(Math.max(n.from,e),Math.min(n.to,t))}return r}}class Ri{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;_C(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}class gu{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?mu(e):e}token(e,t){let r=e.pos,n=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(_C(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(!o)n++;if(s==null)break;e.reset(s,e.token)}if(n)e.reset(r,e.token),e.acceptToken(this.elseToken,n)}}class Jr{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function _C(e,t,r,n,o,s){let i=0,a=1<<n,{dialect:c}=r.p.parser;e:for(;;){if((a&e[i])==0)break;let l=e[i+1];for(let h=i+3;h<l;h+=2)if((e[h+1]&a)>0){let m=e[h];if(c.allows(m)&&(t.token.value==-1||t.token.value==m||TN(m,t.token.value,o,s))){t.acceptToken(m);break}}let u=t.next,f=0,d=e[i+2];if(t.next<0&&d>f&&e[l+d*3-3]==65535){i=e[l+d*3-1];continue e}for(;f<d;){let h=f+d>>1,m=l+h+(h<<1),b=e[m],x=e[m+1]||65536;if(u<b)d=h;else if(u>=x)f=h+1;else{i=e[m+2],t.advance();continue e}}break}}function PC(e,t,r){for(let n=t,o;(o=e[n])!=65535;n++)if(o==r)return n-t;return-1}function TN(e,t,r,n){let o=PC(r,n,t);return o<0||PC(r,n,e)<o}function wC(e,t,r){let n=e.cursor(pt.IncludeAnonymous);n.moveTo(t);for(;;)if(!(r<0?n.childBefore(t):n.childAfter(t)))for(;;){if((r<0?n.to<t:n.from>t)&&!n.type.isError)return r<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(r<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return r<0?0:e.length}}class $C{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){this.safeFrom=e.openStart?wC(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?wC(e.tree,e.to+e.offset,-1)-e.offset:e.to;while(this.trees.length)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;while(this.fragment&&this.safeTo<=e)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],n=this.index[t];if(n==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[n],s=this.start[t]+r.positions[n];if(s>e)return this.nextStart=s,null;if(o instanceof Gt){if(s==e){if(s<this.safeFrom)return null;let i=s+o.length;if(i<=this.safeTo){let a=o.prop(Ce.lookAhead);if(!a||i+a<this.fragment.to)return o}}if(this.index[t]++,s+o.length>=Math.max(this.safeFrom,e))this.trees.push(o),this.start.push(s),this.index.push(0)}else this.index[t]++,this.nextStart=s+o.length}}}class AC{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((r)=>new Ou)}getActions(e){let t=0,r=null,{parser:n}=e.p,{tokenizers:o}=n,s=n.stateSlot(e.state,3),i=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let l=o[c],u=this.tokens[c];if(r&&!l.fallback)continue;if(l.contextual||u.start!=e.pos||u.mask!=s||u.context!=i)this.updateCachedToken(u,l,e),u.mask=s,u.context=i;if(u.lookAhead>u.end+25)a=Math.max(u.lookAhead,a);if(u.value!=0){let f=t;if(u.extended>-1)t=this.addActions(e,u.extended,u.end,t);if(t=this.addActions(e,u.value,u.end,t),!l.extend){if(r=u,t>f)break}}}while(this.actions.length>t)this.actions.pop();if(a)e.setLookAhead(a);if(!r&&e.pos==this.stream.end)r=new Ou,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t);return this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ou,{pos:r,p:n}=e;return t.start=r,t.end=Math.min(r+1,n.stream.end),t.value=r==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,r){let n=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(n,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let i=o.specializers[s](this.stream.read(e.start,e.end),r);if(i>=0&&r.p.parser.dialect.allows(i>>1)){if((i&1)==0)e.value=i>>1;else e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,r,n){for(let o=0;o<n;o+=3)if(this.actions[o]==e)return n;return this.actions[n++]=e,this.actions[n++]=t,this.actions[n++]=r,n}addActions(e,t,r,n){let{state:o}=e,{parser:s}=e.p,{data:i}=s;for(let a=0;a<2;a++)for(let c=s.stateSlot(o,a?2:1);;c+=3){if(i[c]==65535)if(i[c+1]==1)c=Mo(i,c+2);else{if(n==0&&i[c+1]==2)n=this.putAction(Mo(i,c+2),t,r,n);break}if(i[c]==t)n=this.putAction(Mo(i,c+1),t,r,n)}return n}}class RC{constructor(e,t,r,n){this.parser=e,this.input=t,this.ranges=n,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new QC(t,n),this.tokens=new AC(e,this.stream),this.topTerm=e.top[1];let{from:o}=n[0];this.stacks=[Sp.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new $C(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],n,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;while(s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let i=e[s];for(;;){if(this.tokens.mainToken=null,i.pos>t)r.push(i);else if(this.advanceStack(i,r,e))continue;else{if(!n)n=[],o=[];n.push(i);let a=this.tokens.getMainToken(i);o.push(a.value,a.end)}break}}if(!r.length){let s=n&&vN(n);if(s){if(Cr)console.log("Finish with "+this.stackID(s));return this.stackToTree(s)}if(this.parser.strict){if(Cr&&n)console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none"));throw SyntaxError("No parse at "+t)}if(!this.recovering)this.recovering=5}if(this.recovering&&n){let s=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,o,r);if(s){if(Cr)console.log("Force-finish "+this.stackID(s));return this.stackToTree(s.forceAll())}}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s){r.sort((i,a)=>a.score-i.score);while(r.length>s)r.pop()}if(r.some((i)=>i.reducePos>t))this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let i=r[s];for(let a=s+1;a<r.length;a++){let c=r[a];if(i.sameState(c)||i.buffer.length>500&&c.buffer.length>500)if((i.score-c.score||i.buffer.length-c.buffer.length)>0)r.splice(a--,1);else{r.splice(s--,1);continue e}}}if(r.length>12)r.sort((s,i)=>i.score-s.score),r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)if(r[s].pos<this.minStackPos)this.minStackPos=r[s].pos;return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let n=e.pos,{parser:o}=this,s=Cr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,l=c?e.curContext.hash:0;for(let u=this.fragments.nodeAt(n);u;){let f=this.parser.nodeSet.types[u.type.id]==u.type?o.getGoto(e.state,u.type.id):-1;if(f>-1&&u.length&&(!c||(u.prop(Ce.contextHash)||0)==l)){if(e.useNode(u,f),Cr)console.log(s+this.stackID(e)+` (via reuse of ${o.getName(u.type.id)})`);return!0}if(!(u instanceof Gt)||u.children.length==0||u.positions[0]>0)break;let d=u.children[0];if(d instanceof Gt&&u.positions[0]==0)u=d;else break}}let i=o.stateSlot(e.state,4);if(i>0){if(e.reduce(i),Cr)console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(i&65535)})`);return!0}if(e.stack.length>=8400)while(e.stack.length>6000&&e.forceReduce());let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let l=a[c++],u=a[c++],f=a[c++],d=c==a.length||!r,h=d?e:e.split(),m=this.tokens.mainToken;if(h.apply(l,u,m?m.start:h.pos,f),Cr)console.log(s+this.stackID(h)+` (via ${(l&65536)==0?"shift":`reduce of ${o.getName(l&65535)}`} for ${o.getName(u)} @ ${n}${h==e?"":", split"})`);if(d)return!0;else if(h.pos>n)t.push(h);else r.push(h)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return TC(e,t),!0}}runRecovery(e,t,r){let n=null,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=t[s<<1],c=t[(s<<1)+1],l=Cr?this.stackID(i)+" -> ":"";if(i.deadEnd){if(o)continue;if(o=!0,i.restart(),Cr)console.log(l+this.stackID(i)+" (restarted)");if(this.advanceFully(i,r))continue}let u=i.split(),f=l;for(let d=0;d<10&&u.forceReduce();d++){if(Cr)console.log(f+this.stackID(u)+" (via force-reduce)");if(this.advanceFully(u,r))break;if(Cr)f=this.stackID(u)+" -> "}for(let d of i.recoverByInsert(a)){if(Cr)console.log(l+this.stackID(d)+" (via recover-insert)");this.advanceFully(d,r)}if(this.stream.end>i.pos){if(c==i.pos)c++,a=0;if(i.recoverByDelete(a,c),Cr)console.log(l+this.stackID(i)+` (via recover-delete ${this.parser.getName(a)})`);TC(i,r)}else if(!n||n.score<u.score)n=u}return n}stackToTree(e){return e.close(),Gt.build({buffer:Ep.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Rx||(Rx=new WeakMap)).get(e);if(!t)Rx.set(e,t=String.fromCodePoint(this.nextStackID++));return t+e}}function TC(e,t){for(let r=0;r<t.length;r++){let n=t[r];if(n.pos==e.pos&&n.sameState(e)){if(t[r].score<e.score)t[r]=e;return}}t.push(e)}class IC{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class xu{constructor(e){this.start=e.start,this.shift=e.shift||Ix,this.reduce=e.reduce||Ix,this.reuse=e.reuse||Ix,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}function Mo(e,t){return e[t]|e[t+1]<<16}function vN(e){let t=null;for(let r of e){let n=r.p.stoppedAt;if((r.pos==r.p.stream.end||n!=null&&r.pos>n)&&r.p.parser.stateFlag(r.state,2)&&(!t||t.score<r.score))t=r}return t}function vC(e){if(e.external){let t=e.extend?1:0;return(r,n)=>e.external(r,n)<<1|t}return e.get}var kC,Cr,Rx=null,Ix=(e)=>e,Ii;var Ux=E(()=>{Ax();kC=new Ou;Ri.prototype.contextual=Ri.prototype.fallback=Ri.prototype.extend=!1;gu.prototype.contextual=Ri.prototype.fallback=Ri.prototype.extend=!1;Cr=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);Ii=class Ii extends $x{constructor(e){super();if(this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;i<e.repeatNodeCount;i++)t.push("");let r=Object.keys(e.topRules).map((i)=>e.topRules[i][1]),n=[];for(let i=0;i<t.length;i++)n.push([]);function o(i,a,c){n[i].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let i of e.nodeProps){let a=i[0];if(typeof a=="string")a=Ce[a];for(let c=1;c<i.length;){let l=i[c++];if(l>=0)o(l,a,i[c++]);else{let u=i[c+-l];for(let f=-l;f>0;f--)o(i[c++],a,u);c++}}}if(this.nodeSet=new yp(t.map((i,a)=>Hr.define({name:a>=this.minRepeatTerm?void 0:i,id:a,props:n[a],top:r.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources)this.nodeSet=this.nodeSet.extend(...e.propSources);this.strict=!1,this.bufferLength=gC;let s=mu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let i=0;i<this.specializerSpecs.length;i++)this.specialized[i]=this.specializerSpecs[i].term;this.specializers=this.specializerSpecs.map(vC),this.states=mu(e.states,Uint32Array),this.data=mu(e.stateData),this.goto=mu(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map((i)=>typeof i=="number"?new Ri(s,i):i),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let n=new RC(this,e,t,r);for(let o of this.wrappers)n=o(n,e,t,r);return n}getGoto(e,t,r=!1){let n=this.goto;if(t>=n[0])return-1;for(let o=n[t+1];;){let s=n[o++],i=s&1,a=n[o++];if(i&&r)return a;for(let c=o+(s>>1);o<c;o++)if(n[o]==e)return a;if(i)return-1}}hasAction(e,t){let r=this.data;for(let n=0;n<2;n++)for(let o=this.stateSlot(e,n?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=Mo(r,o+2)];else if(r[o+1]==2)return Mo(r,o+2);else break;if(s==t||s==0)return Mo(r,o+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,(r)=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),n=r?t(r):void 0;for(let o=this.stateSlot(e,1);n==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Mo(this.data,o+2);else break;n=t(Mo(this.data,o+1))}return n}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Mo(this.data,r+2);else break;if((this.data[r+2]&1)==0){let n=this.data[r+1];if(!t.some((o,s)=>s&1&&o==n))t.push(this.data[r],n)}}return t}configure(e){let t=Object.assign(Object.create(Ii.prototype),this);if(e.props)t.nodeSet=this.nodeSet.extend(...e.props);if(e.top){let r=this.topRules[e.top];if(!r)throw RangeError(`Invalid top rule name ${e.top}`);t.top=r}if(e.tokenizers)t.tokenizers=this.tokenizers.map((r)=>{let n=e.tokenizers.find((o)=>o.from==r);return n?n.to:r});if(e.specializers)t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,n)=>{let o=e.specializers.find((i)=>i.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return t.specializers[n]=vC(s),s});if(e.contextTracker)t.context=e.contextTracker;if(e.dialect)t.dialect=this.parseDialect(e.dialect);if(e.strict!=null)t.strict=e.strict;if(e.wrap)t.wrappers=t.wrappers.concat(e.wrap);if(e.bufferLength!=null)t.bufferLength=e.bufferLength;return t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let o of e.split(" ")){let s=t.indexOf(o);if(s>=0)r[s]=!0}let n=null;for(let o=0;o<t.length;o++)if(!r[o])for(let s=this.dialects[t[o]],i;(i=this.data[s++])!=65535;)(n||(n=new Uint8Array(this.maxTerm+1)))[i]=1;return new IC(e,r,n)}static deserialize(e){return new Ii(e)}}});class Kr{constructor(e,t,r,n){this.name=e,this.set=t,this.base=r,this.modified=n,this.id=CN++}toString(){let{name:e}=this;for(let t of this.modified)if(t.name)e=`${t.name}(${e})`;return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Kr)t=e;if(t===null||t===void 0?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new Kr(r,[],null,[]);if(n.set.push(n),t)for(let o of t.set)n.set.push(o);return n}static defineModifier(e){let t=new wp(e);return(r)=>{if(r.modified.indexOf(t)>-1)return r;return wp.get(r.base||r,r.modified.concat(t).sort((n,o)=>n.id-o.id))}}}class wp{constructor(e){this.name=e,this.instances=[],this.id=QN++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find((i)=>i.base==e&&_N(t,i.modified));if(r)return r;let n=[],o=new Kr(e.name,n,e,t);for(let i of t)i.instances.push(o);let s=$N(t);for(let i of e.set)if(!i.modified.length)for(let a of s)n.push(wp.get(i,a));return o}}function _N(e,t){return e.length==t.length&&e.every((r,n)=>r==t[n])}function $N(e){let t=[[]];for(let r=0;r<e.length;r++)for(let n=0,o=t.length;n<o;n++)t.push(t[n].concat(e[r]));return t.sort((r,n)=>n.length-r.length)}function Tp(e){let t=Object.create(null);for(let r in e){let n=e[r];if(!Array.isArray(n))n=[n];for(let o of r.split(" "))if(o){let s=[],i=2,a=o;for(let f=0;;){if(a=="..."&&f>0&&f+3==o.length){i=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw RangeError("Invalid path: "+o);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==o.length)break;let h=o[f++];if(f==o.length&&h=="!"){i=0;break}if(h!="/")throw RangeError("Invalid path: "+o);a=o.slice(f)}let c=s.length-1,l=s[c];if(!l)throw RangeError("Invalid path: "+o);let u=new Su(n,i,c>0?s.slice(0,c):null);t[l]=u.sort(t[l])}}return AN.add(t)}class Su{constructor(e,t,r,n){this.tags=e,this.mode=t,this.context=r,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){if(!e||e.depth<this.depth)return this.next=e,this;return e.next=this.sort(e.next),e}get depth(){return this.context?this.context.length:0}}function RN(e,t){let r=Object.create(null);for(let s of e)if(!Array.isArray(s.tag))r[s.tag.id]=s.class;else for(let i of s.tag)r[i.id]=s.class;let{scope:n,all:o=null}=t||{};return{style:(s)=>{let i=o;for(let a of s)for(let c of a.set){let l=r[c.id];if(l){i=i?i+" "+l:l;break}}return i},scope:n}}var CN=0,QN=0,AN,D,bp,Ms,FC,UC,Ns,kp,Dx,jn,Fi,zn,Xn,Mx,yu,Pp,P,Iee;var Nx=E(()=>{Ax();AN=new Ce({combine(e,t){let r,n,o;while(e||t){if(!e||t&&e.depth>=t.depth)o=t,t=t.next;else o=e,e=e.next;if(r&&r.mode==o.mode&&!o.context&&!r.context)continue;let s=new Su(o.tags,o.mode,o.context);if(r)r.next=s;else n=s;r=s}return n}});Su.empty=new Su([],2,null);D=Kr.define,bp=D(),Ms=D(),FC=D(Ms),UC=D(Ms),Ns=D(),kp=D(Ns),Dx=D(Ns),jn=D(),Fi=D(jn),zn=D(),Xn=D(),Mx=D(),yu=D(Mx),Pp=D(),P={comment:bp,lineComment:D(bp),blockComment:D(bp),docComment:D(bp),name:Ms,variableName:D(Ms),typeName:FC,tagName:D(FC),propertyName:UC,attributeName:D(UC),className:D(Ms),labelName:D(Ms),namespace:D(Ms),macroName:D(Ms),literal:Ns,string:kp,docString:D(kp),character:D(kp),attributeValue:D(kp),number:Dx,integer:D(Dx),float:D(Dx),bool:D(Ns),regexp:D(Ns),escape:D(Ns),color:D(Ns),url:D(Ns),keyword:zn,self:D(zn),null:D(zn),atom:D(zn),unit:D(zn),modifier:D(zn),operatorKeyword:D(zn),controlKeyword:D(zn),definitionKeyword:D(zn),moduleKeyword:D(zn),operator:Xn,derefOperator:D(Xn),arithmeticOperator:D(Xn),logicOperator:D(Xn),bitwiseOperator:D(Xn),compareOperator:D(Xn),updateOperator:D(Xn),definitionOperator:D(Xn),typeOperator:D(Xn),controlOperator:D(Xn),punctuation:Mx,separator:D(Mx),bracket:yu,angleBracket:D(yu),squareBracket:D(yu),paren:D(yu),brace:D(yu),content:jn,heading:Fi,heading1:D(Fi),heading2:D(Fi),heading3:D(Fi),heading4:D(Fi),heading5:D(Fi),heading6:D(Fi),contentSeparator:D(jn),list:D(jn),quote:D(jn),emphasis:D(jn),strong:D(jn),link:D(jn),monospace:D(jn),strikethrough:D(jn),inserted:D(),deleted:D(),changed:D(),invalid:D(),meta:Pp,documentMeta:D(Pp),annotation:D(Pp),processingInstruction:D(Pp),definition:Kr.defineModifier("definition"),constant:Kr.defineModifier("constant"),function:Kr.defineModifier("function"),standard:Kr.defineModifier("standard"),local:Kr.defineModifier("local"),special:Kr.defineModifier("special")};for(let e in P){let t=P[e];if(t instanceof Kr)t.name=e}Iee=RN([{tag:P.link,class:"tok-link"},{tag:P.heading,class:"tok-heading"},{tag:P.emphasis,class:"tok-emphasis"},{tag:P.strong,class:"tok-strong"},{tag:P.keyword,class:"tok-keyword"},{tag:P.atom,class:"tok-atom"},{tag:P.bool,class:"tok-bool"},{tag:P.url,class:"tok-url"},{tag:P.labelName,class:"tok-labelName"},{tag:P.inserted,class:"tok-inserted"},{tag:P.deleted,class:"tok-deleted"},{tag:P.literal,class:"tok-literal"},{tag:P.string,class:"tok-string"},{tag:P.number,class:"tok-number"},{tag:[P.regexp,P.escape,P.special(P.string)],class:"tok-string2"},{tag:P.variableName,class:"tok-variableName"},{tag:P.local(P.variableName),class:"tok-variableName tok-local"},{tag:P.definition(P.variableName),class:"tok-variableName tok-definition"},{tag:P.special(P.variableName),class:"tok-variableName2"},{tag:P.definition(P.propertyName),class:"tok-propertyName tok-definition"},{tag:P.typeName,class:"tok-typeName"},{tag:P.namespace,class:"tok-namespace"},{tag:P.className,class:"tok-className"},{tag:P.macroName,class:"tok-macroName"},{tag:P.propertyName,class:"tok-propertyName"},{tag:P.operator,class:"tok-operator"},{tag:P.comment,class:"tok-comment"},{tag:P.meta,class:"tok-meta"},{tag:P.invalid,class:"tok-invalid"},{tag:P.punctuation,class:"tok-punctuation"}])});function Zx(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var IN=316,FN=317,DC=1,UN=2,DN=3,MN=4,NN=318,ZN=320,qN=321,WN=5,LN=6,zN=0,qx,MC=125,XN=59,Wx=47,jN=42,VN=43,BN=45,GN=60,YN=44,HN=63,JN=46,KN=91,eZ,tZ,rZ,nZ,oZ,sZ,iZ,aZ,cZ,lZ,Lx;var NC=E(()=>{Ux();Nx();qx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],eZ=new xu({start:!1,shift(e,t){return t==WN||t==LN||t==ZN?e:t==qN},strict:!1}),tZ=new Jr((e,t)=>{let{next:r}=e;if(r==MC||r==-1||t.context)e.acceptToken(NN)},{contextual:!0,fallback:!0}),rZ=new Jr((e,t)=>{let{next:r}=e,n;if(qx.indexOf(r)>-1)return;if(r==Wx&&((n=e.peek(1))==Wx||n==jN))return;if(r!=MC&&r!=XN&&r!=-1&&!t.context)e.acceptToken(IN)},{contextual:!0}),nZ=new Jr((e,t)=>{if(e.next==KN&&!t.context)e.acceptToken(FN)},{contextual:!0}),oZ=new Jr((e,t)=>{let{next:r}=e;if(r==VN||r==BN){if(e.advance(),r==e.next){e.advance();let n=!t.context&&t.canShift(DC);e.acceptToken(n?DC:UN)}}else if(r==HN&&e.peek(1)==JN){if(e.advance(),e.advance(),e.next<48||e.next>57)e.acceptToken(DN)}},{contextual:!0});sZ=new Jr((e,t)=>{if(e.next!=GN||!t.dialectEnabled(zN))return;if(e.advance(),e.next==Wx)return;let r=0;while(qx.indexOf(e.next)>-1)e.advance(),r++;if(Zx(e.next,!0)){e.advance(),r++;while(Zx(e.next,!1))e.advance(),r++;while(qx.indexOf(e.next)>-1)e.advance(),r++;if(e.next==YN)return;for(let n=0;;n++){if(n==7){if(!Zx(e.next,!0))return;break}if(e.next!="extends".charCodeAt(n))break;e.advance(),r++}}e.acceptToken(MN,-r)}),iZ=Tp({"get set async static":P.modifier,"for while do if else switch try catch finally return throw break continue default case defer":P.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":P.operatorKeyword,"let var const using function class extends":P.definitionKeyword,"import export from":P.moduleKeyword,"with debugger new":P.keyword,TemplateString:P.special(P.string),super:P.atom,BooleanLiteral:P.bool,this:P.self,null:P.null,Star:P.modifier,VariableName:P.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":P.function(P.variableName),VariableDefinition:P.definition(P.variableName),Label:P.labelName,PropertyName:P.propertyName,PrivatePropertyName:P.special(P.propertyName),"CallExpression/MemberExpression/PropertyName":P.function(P.propertyName),"FunctionDeclaration/VariableDefinition":P.function(P.definition(P.variableName)),"ClassDeclaration/VariableDefinition":P.definition(P.className),"NewExpression/VariableName":P.className,PropertyDefinition:P.definition(P.propertyName),PrivatePropertyDefinition:P.definition(P.special(P.propertyName)),UpdateOp:P.updateOperator,"LineComment Hashbang":P.lineComment,BlockComment:P.blockComment,Number:P.number,String:P.string,Escape:P.escape,ArithOp:P.arithmeticOperator,LogicOp:P.logicOperator,BitOp:P.bitwiseOperator,CompareOp:P.compareOperator,RegExp:P.regexp,Equals:P.definitionOperator,Arrow:P.function(P.punctuation),": Spread":P.punctuation,"( )":P.paren,"[ ]":P.squareBracket,"{ }":P.brace,"InterpolationStart InterpolationEnd":P.special(P.brace),".":P.derefOperator,", ;":P.separator,"@":P.meta,TypeName:P.typeName,TypeDefinition:P.definition(P.typeName),"type enum interface implements namespace module declare":P.definitionKeyword,"abstract global Privacy readonly override":P.modifier,"is keyof unique infer asserts":P.operatorKeyword,JSXAttributeValue:P.attributeValue,JSXText:P.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":P.angleBracket,"JSXIdentifier JSXNameSpacedName":P.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":P.attributeName,"JSXBuiltin/JSXIdentifier":P.standard(P.tagName)}),aZ={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},cZ={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},lZ={__proto__:null,"<":193},Lx=Ii.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgO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Xst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"\u26A0 ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:eZ,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[iZ],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8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}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[rZ,nZ,oZ,sZ,2,3,4,5,6,7,8,9,10,11,12,13,14,tZ,new gu("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new gu("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{"80":1,"82":1,"94":1,"169":1,"199":1},specialized:[{term:327,get:(e)=>aZ[e]||-1},{term:343,get:(e)=>cZ[e]||-1},{term:95,get:(e)=>lZ[e]||-1}],tokenPrec:15201})});function zx(e){return e==Ui||e==Eu}function Xx(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Cp(e,t,r){this.parent=e,this.indent=t,this.flags=r,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+r+(r<<6)}function dq(e){let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r)==Qp?8-t%8:1;return t}function Oq(e,t){if(t==nq)for(let r=0;r<2&&e.next>=48&&e.next<=55;r++)e.advance();else if(t==oq)for(let r=0;r<2&&Xx(e.next);r++)e.advance();else if(t==iq)for(let r=0;r<4&&Xx(e.next);r++)e.advance();else if(t==aq)for(let r=0;r<8&&Xx(e.next);r++)e.advance();else if(t==sq){if(e.next==jx){e.advance();while(e.next>=0&&e.next!=WC&&e.next!=GC&&e.next!=YC&&e.next!=Ui)e.advance();if(e.next==WC)e.advance()}}}var uZ=1,XC=194,jC=195,fZ=196,ZC=197,dZ=198,pZ=199,hZ=200,mZ=2,VC=3,qC=201,OZ=24,gZ=25,xZ=49,yZ=50,SZ=55,EZ=56,bZ=57,kZ=59,PZ=60,wZ=61,TZ=62,vZ=63,CZ=65,QZ=238,_Z=71,$Z=241,AZ=242,RZ=243,IZ=244,FZ=245,UZ=246,DZ=247,MZ=248,BC=72,NZ=249,ZZ=250,qZ=251,WZ=252,LZ=253,zZ=254,XZ=255,jZ=256,VZ=73,BZ=77,GZ=263,YZ=112,HZ=130,JZ=151,KZ=152,eq=155,Ui=10,Eu=13,Vx=32,Qp=9,Bx=35,tq=40,rq=46,jx=123,WC=125,GC=39,YC=34,LC=92,nq=111,oq=120,sq=78,iq=117,aq=85,cq,lq,uq,vp=1,HC=2,No=4,Zo=8,qo=16,Wo=32,fq,zC,pq,hq,mq,gq,xq,JC;var KC=E(()=>{Ux();Nx();cq=new Set([gZ,xZ,yZ,GZ,CZ,HZ,EZ,bZ,QZ,TZ,vZ,BC,VZ,BZ,PZ,wZ,JZ,KZ,eq,YZ]);lq=new Jr((e,t)=>{let r;if(e.next<0)e.acceptToken(pZ);else if(t.context.flags&vp){if(zx(e.next))e.acceptToken(dZ,1)}else if(((r=e.peek(-1))<0||zx(r))&&t.canShift(ZC)){let n=0;while(e.next==Vx||e.next==Qp)e.advance(),n++;if(e.next==Ui||e.next==Eu||e.next==Bx)e.acceptToken(ZC,-n)}else if(zx(e.next))e.acceptToken(fZ,1)},{contextual:!0}),uq=new Jr((e,t)=>{let r=t.context;if(r.flags)return;let n=e.peek(-1);if(n==Ui||n==Eu){let o=0,s=0;for(;;){if(e.next==Vx)o++;else if(e.next==Qp)o+=8-o%8;else break;e.advance(),s++}if(o!=r.indent&&e.next!=Ui&&e.next!=Eu&&e.next!=Bx)if(o<r.indent)e.acceptToken(jC,-s);else e.acceptToken(XC)}});fq=new Cp(null,0,0);zC=new Map([[$Z,0],[AZ,No],[RZ,Zo],[IZ,Zo|No],[FZ,qo],[UZ,qo|No],[DZ,qo|Zo],[MZ,qo|Zo|No],[NZ,Wo],[ZZ,Wo|No],[qZ,Wo|Zo],[WZ,Wo|Zo|No],[LZ,Wo|qo],[zZ,Wo|qo|No],[XZ,Wo|qo|Zo],[jZ,Wo|qo|Zo|No]].map(([e,t])=>[e,t|HC])),pq=new xu({start:fq,reduce(e,t,r,n){if(e.flags&vp&&cq.has(t)||(t==_Z||t==BC)&&e.flags&HC)return e.parent;return e},shift(e,t,r,n){if(t==XC)return new Cp(e,dq(n.read(n.pos,r.pos)),0);if(t==jC)return e.parent;if(t==OZ||t==SZ||t==kZ||t==VC)return new Cp(e,0,vp);if(zC.has(t))return new Cp(e,0,zC.get(t)|e.flags&vp);return e},hash(e){return e.hash}}),hq=new Jr((e)=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(/\w/.test(String.fromCharCode(e.next)))return;for(let t=0;;t++){let r=e.peek(t);if(r==Vx||r==Qp)continue;if(r!=tq&&r!=rq&&r!=Ui&&r!=Eu&&r!=Bx)e.acceptToken(uZ);return}}),mq=new Jr((e,t)=>{let{flags:r}=t.context,n=r&No?YC:GC,o=(r&Zo)>0,s=!(r&qo),i=(r&Wo)>0,a=e.pos;for(;;)if(e.next<0)break;else if(i&&e.next==jx)if(e.peek(1)==jx)e.advance(2);else{if(e.pos==a){e.acceptToken(VC,1);return}break}else if(s&&e.next==LC){if(e.pos==a){e.advance();let c=e.next;if(c>=0)e.advance(),Oq(e,c);e.acceptToken(mZ);return}break}else if(e.next==LC&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==n&&(!o||e.peek(1)==n&&e.peek(2)==n)){if(e.pos==a){e.acceptToken(qC,o?3:1);return}break}else if(e.next==Ui){if(o)e.advance();else if(e.pos==a){e.acceptToken(qC);return}break}else e.advance();if(e.pos>a)e.acceptToken(hZ)});gq=Tp({'async "*" "**" FormatConversion FormatSpec':P.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":P.controlKeyword,"in not and or is del":P.operatorKeyword,"from def class global nonlocal lambda":P.definitionKeyword,import:P.moduleKeyword,"with as print":P.keyword,Boolean:P.bool,None:P.null,VariableName:P.variableName,"CallExpression/VariableName":P.function(P.variableName),"FunctionDefinition/VariableName":P.function(P.definition(P.variableName)),"ClassDefinition/VariableName":P.definition(P.className),PropertyName:P.propertyName,"CallExpression/MemberExpression/PropertyName":P.function(P.propertyName),Comment:P.lineComment,Number:P.number,String:P.string,FormatString:P.special(P.string),Escape:P.escape,UpdateOp:P.updateOperator,"ArithOp!":P.arithmeticOperator,BitOp:P.bitwiseOperator,CompareOp:P.compareOperator,AssignOp:P.definitionOperator,Ellipsis:P.punctuation,At:P.meta,"( )":P.paren,"[ ]":P.squareBracket,"{ }":P.brace,".":P.derefOperator,", ;":P.separator}),xq={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},JC=Ii.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'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Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:pq,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[gq],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/t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ZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[hq,uq,lq,mq,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:(e)=>xq[e]||-1}],tokenPrec:7668})});var yq,Sq=65536,Eq=12000,bq=80,Lo,U=(e)=>{throw new Lo(e)},Ue=(e)=>{let t=[];for(let r=e.firstChild;r!==null;r=r.nextSibling)t.push(r);return t},eQ=(e,t)=>{if(t.length>Sq)throw new Lo("Code exceeds the source size limit.");let n=yq[e].startParse(t),o=performance.now()+40,s=n.advance();while(s===null){if(performance.now()>o)throw new Lo("Code exceeds the parsing time budget.");s=n.advance()}let i=0,a=[{node:s.topNode,depth:0}];while(a.length>0){let c=a.pop();if(c===void 0)break;if(i+=1,i>Eq||c.depth>bq||performance.now()>o)throw new Lo("Code exceeds the tree inspection budget.");if(c.node.type.isError)throw new Lo("Code contains invalid or incomplete syntax.");for(let l of Ue(c.node))a.push({node:l,depth:c.depth+1})}return s.topNode},_p=(e,t="javascript")=>{let r=t==="python"&&/^[rR]["']/u.test(e),n=r?e.slice(1):e,[o]=n;if(o!=='"'&&o!=="'")throw new Lo("Unsupported string literal.");let s=t==="python"&&n.startsWith(o.repeat(3))?o.repeat(3):o;if(!n.endsWith(s))return U("Incomplete string literal.");let i=n.slice(s.length,-s.length);return r?i:kq(i)},kq=(e)=>{let t={n:`
|
|
53
|
+
`,r:"\r",t:"\t",b:"\b",f:"\f",v:"\v","\\":"\\","'":"'",'"':'"'},r="";for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="\\"){n+=1;let s=e[n];if(s===void 0)return U("Incomplete escape.");if(t[s]!==void 0)r+=t[s];else if(s==="x"||s==="u"){let i=s==="x"?2:4,a=e.slice(n+1,n+1+i);if(a.length!==i||!/^[0-9a-f]+$/iu.test(a))return U("Unsupported Unicode escape.");r+=String.fromCodePoint(Number.parseInt(a,16)),n+=i}else return U("Unsupported string escape.")}else r+=o}return r};var zo=E(()=>{NC();KC();yq={python:JC.configure({strict:!0}),javascript:Lx.configure({strict:!0}),typescript:Lx.configure({dialect:"ts",strict:!0})};Lo=class Lo extends Error{name="CodeInspectionError"}});import Pq from"path";var Vn,en=(e)=>({kind:"symbol",name:e}),cc=(e)=>{if(e.length>65536)return U("A resolved string exceeds its size limit.");return{kind:"string",value:e}},sr=(e)=>{if(e?.kind==="string")return e.value;if(e?.kind==="path")return e.path;return U("An operation has an unresolved path or argument.")},wq,Tq,vq,Cq,tQ=(e)=>new Map((e==="python"?vq:Cq).map((t)=>[t,en(t)])),lc=(e,t)=>{let r=t!=="python"&&e.startsWith("node:")?e.slice(5):e;if(!(t==="python"?wq:Tq).has(r))return U(`Module ${JSON.stringify(e)} can execute code that was not inspected.`);return r==="fs/promises"?"fs":r},bu=(e)=>{let t="";for(let r of e)t=r.startsWith("/")?r:Pq.posix.join(t,r);return t};var Di=E(()=>{zo();Vn={kind:"unknown"},wq=new Set(["os","os.path","shutil","pathlib","subprocess","json","math","sys","re"]),Tq=new Set(["fs","fs/promises","path","child_process"]),vq=["print","len","str","int","float","abs","round","open","sum","sorted","list","bool","min","max","any","all"],Cq=["console","require","JSON","Deno"]});var ht,Gx=(e)=>({kind:"text",path:e,preservesNonempty:!0}),Zs=(e)=>{let t=[e],r=new Set;while(t.length>0){let n=t.pop();if(n!==void 0&&!r.has(n)){if(r.add(n),r.size>12000)return U("Data exceeds the value inspection budget.");switch(n.kind){case"string":case"number":case"text":case"data":break;case"list":{t.push(...n.items);break}case"object":{t.push(...n.entries.values());break}case"file":case"path":case"method":case"symbol":case"unknown":return!1;default:return!1}}}return!0},ir=(e)=>{if(!e.every((t)=>Zs(t)))U("Only inert data can be passed to a data operation.")},Yx=(e,t)=>{if(t?.kind==="string"&&t.value.length>0)return"write";if(t?.kind==="text"&&t.path===e&&t.preservesNonempty)return"write";return"truncate"},Qq=(e,t,r)=>{let[n,o]=t;if(t.length!==2||n?.kind!=="string"||o?.kind!=="string")return U("Text replacement needs two literal strings.");let s=o.value.length>0&&(r==="python"||!o.value.includes("$"));return e.kind==="text"?{...e,preservesNonempty:e.preservesNonempty&&s}:{kind:"text",path:null,preservesNonempty:!1}},rQ=(e,t,r,n)=>{if(ir(r),e.kind==="string"||e.kind==="text"){if(t==="replace"||t==="replaceAll")return Qq(e,r,n);if(["strip","trim","lower","upper","toLowerCase","toUpperCase","slice","substring"].includes(t))return{kind:"text",path:null,preservesNonempty:!1};if(["split","splitlines","startswith","endswith","startsWith","endsWith","includes","find","index","indexOf"].includes(t))return ht}if(n==="python"&&["get","keys","values","items","count","index"].includes(t)&&Zs(e))return ht;return U(`Unsupported data method: ${t}.`)},_q=(e)=>{let[t]=e,r=t?.kind==="file"||t?.kind==="symbol"&&t.name==="sys.stdin";if(e.length!==1||!r)return U("JSON load requires a known file or stdin without callbacks.");return ht},$q=(e)=>{let[t,r,n]=e;if(e.length!==3||t?.kind!=="string"||r?.kind!=="string"||n===void 0)return U("Regex substitution needs literal pattern/replacement and one input.");ir([n]);let o=r.value.length>0&&!r.value.includes("\\");return n.kind==="text"?{...n,preservesNonempty:n.preservesNonempty&&o}:{kind:"text",path:null,preservesNonempty:!1}},nQ=(e,t)=>{if(e==="re.sub")return $q(t);if(e==="json.load")return _q(t);if(["json.loads","JSON.parse","json.dumps","JSON.stringify","str"].includes(e)){if(ir(t),t.length!==1)return U("JSON callbacks and serialization options require review.");return["json.loads","JSON.parse"].includes(e)?ht:{kind:"text",path:null,preservesNonempty:!1}}if(["len","int","float","abs","round","sum","sorted","list","bool","min","max","any","all"].includes(e))return ir(t),ht;if(["print","console.log","console.info","console.warn","console.error"].includes(e))return ir(t),Vn;if(e==="sys.stdin.read")return ir(t),{kind:"text",path:null,preservesNonempty:!1};return null};var uc=E(()=>{zo();Di();ht={kind:"data"}});import Aq from"path";var Rq,Iq,Fq=(e,t)=>{if(!e.startsWith("fs."))return;if(t.length>2)return U("Read callbacks are not inspected.");let[,r]=t;if(r===void 0||r.kind==="string")return;if(r.kind!=="object")return U("Read options are unresolved.");for(let[n,o]of r.entries){if(n==="flag"&&sr(o)!=="r")return U("A file read flag can truncate or write the file.");if(n!=="flag"&&n!=="encoding")return U("Unsupported read option.");sr(o)}},Uq=(e,t)=>{if(!e.startsWith("fs."))return;let r=t.at(2);if(r===void 0&&t.length<=2)return;if(t.length===3&&r?.kind==="string"&&r.value.replace("-","")==="utf8")return;return U("Write encodings, flags, and callbacks require explicit review.")},Dq=(e,t)=>{let[r,n]=t;if(e.startsWith("subprocess.")){if(t.length!==1||r?.kind!=="list")return U("Subprocess options or shell execution require review.");if(r.items.length===0)return U("Empty subprocess argument list.");return r.items.map((o)=>sr(o))}if(t.length>2||n!==void 0&&n.kind!=="list")return U("Subprocess options require review.");return[sr(r),...n?.kind==="list"?n.items.map((o)=>sr(o)):[]]},Mq=(e,t,r,n)=>{let s=(e.kind==="path"?{unlink:"delete",rmdir:"delete",read_text:"read",read_bytes:"read",write_text:"write",write_bytes:"write"}:{read:"read",write:"write"})[t];if(s===void 0)return U(`Unsupported ${e.kind} method: ${t}.`);if(s==="read"&&r.length>0)return U("File read encoding and offset options require review.");if(s==="write"&&r.length!==1)return U("File write encoding and callback options require review.");let i=s==="write"?Yx(e.path,r[0]):s;return n.operations.push({kind:i,path:e.path,range:n.range}),s==="read"?Gx(e.path):Vn},Nq=(e,t)=>{if(e.length>2)return U("File opener options are not inspected.");let r=e[1]===void 0?"r":sr(e[1]),o={r:"read",rb:"read",rt:"read",w:"truncate",wb:"truncate",wt:"truncate",a:"write",ab:"write",at:"write"}[r];if(o===void 0)return U("Unsupported file open mode.");let s=sr(e[0]);return t.operations.push({kind:o,path:s,range:t.range}),{kind:"file",path:s}},oQ=(e,t,r)=>{if(e.kind==="method")return e.receiver.kind==="path"||e.receiver.kind==="file"?Mq(e.receiver,e.name,t,r):rQ(e.receiver,e.name,t,r.language);if(e.kind!=="symbol")return U("Dynamic call target.");let{name:n}=e,o=nQ(n,t);if(o!==null)return o;if(n==="require")return en(lc(sr(t[0]),r.language));if(n==="pathlib.Path"||n==="pathlib.PosixPath")return{kind:"path",path:bu(t.map((i)=>sr(i)))};if(n==="os.path.join")return cc(bu(t.map((i)=>sr(i))));if(n==="path.join")return cc(Aq.posix.join(...t.map((i)=>sr(i))));if(n==="open")return Nq(t,r);let s=Rq.get(n);if(s!==void 0)return Zq(n,s,t,r);else if(Iq.has(n))r.operations.push({kind:"process",argv:Dq(n,t),range:r.range});else return U(`Call ${JSON.stringify(n)} has uninspected effects.`);return Vn},Zq=(e,t,r,n)=>{if(t==="read")Fq(e,r);if(t==="write")Uq(e,r);let o=sr(r[0]),s=t==="write"?Yx(o,r[1]):t;if(n.operations.push({kind:s,path:o,range:n.range}),t==="read"){let[,i]=r;return e.startsWith("Deno.")||i?.kind==="string"&&i.value.toLowerCase().replace("-","")==="utf8"?Gx(o):ht}return Vn};var sQ=E(()=>{uc();zo();Di();Rq=new Map([...["os.remove","os.unlink","os.rmdir","shutil.rmtree","fs.rm","fs.rmSync","fs.unlink","fs.unlinkSync","fs.rmdir","fs.rmdirSync","Deno.remove","Deno.removeSync"].map((e)=>[e,"delete"]),...["fs.readFile","fs.readFileSync","Deno.readTextFile","Deno.readTextFileSync"].map((e)=>[e,"read"]),...["fs.writeFile","fs.writeFileSync","fs.appendFile","fs.appendFileSync","Deno.writeTextFile","Deno.writeTextFileSync"].map((e)=>[e,"write"]),...["os.truncate","fs.truncate","fs.truncateSync"].map((e)=>[e,"truncate"])]),Iq=new Set(["subprocess.run","subprocess.call","subprocess.check_call","subprocess.check_output","subprocess.Popen","child_process.execFile","child_process.execFileSync","child_process.spawn","child_process.spawnSync"])});var qq=(e,t,r)=>{let n=new Map;for(let o of Ue(e).filter((s)=>!["{","}",","].includes(s.name))){let s=Ue(o),[i,a,c]=s;if(o.name!=="Property"||i?.name!=="PropertyDefinition"||a?.name!==":"||c===void 0||s.length!==3)return U("Computed properties, accessors, and object spread are not inspected.");n.set(r(i),t(c))}return{kind:"object",entries:n}},Wq=(e,t)=>{let r=Ue(e).filter((o)=>!["{","}",","].includes(o.name)),n=new Map;for(let o=0;o<r.length;o+=3){let[s,i,a]=r.slice(o,o+3);if(s===void 0||i?.name!==":"||a===void 0)return U("Unsupported dictionary entry.");let c=t(s);if(c.kind!=="string")return U("Dictionary keys must be literal strings.");n.set(c.value,t(a))}return{kind:"object",entries:n}},Lq=(e,t)=>{for(let r of Ue(e)){if(r.name!=="FormatReplacement")return U("Unsupported formatted string component.");let n=Ue(r).filter((o)=>!["{","}"].includes(o.name));if(n.length!==1||n[0]===void 0)return U("Format conversions and specifications require review.");ir([t(n[0])])}return{kind:"text",path:null,preservesNonempty:!1}},iQ=(e,t,r)=>{switch(e.name){case"ObjectExpression":return qq(e,t,r);case"DictionaryExpression":return Wq(e,t);case"FormatString":return Lq(e,t);default:return null}};var aQ=E(()=>{uc();zo()});var cQ=(e,t)=>{e.clear();for(let[r,n]of t)e.set(r,n)},lQ=(e,t)=>{let r=new Set(t.flatMap((n)=>[...n.keys()]));e.clear();for(let n of r){let o=t[0]?.get(n);e.set(n,o!==void 0&&t.every((s)=>s.get(n)===o)?o:Vn)}},uQ=(e,t)=>{let r=new Map(t.bindings),n=[r];for(let o of Ue(e).filter((s)=>!["if","elif","else","(",")"].includes(s.name)))if(cQ(t.bindings,r),o.name==="Body"||o.name==="Block")t.statement(o),n.push(new Map(t.bindings));else ir([t.evaluate(o)]);lQ(t.bindings,n)},fQ=(e,t)=>{let r=Ue(e);if(["AssignStatement","ImportStatement","ForStatement","VariableDeclaration","WithStatement"].includes(e.name)){let n=r.findIndex((o)=>["AssignOp","Equals","in"].includes(o.name));for(let o of n===-1?r:r.slice(0,n))if(o.name==="VariableName"||o.name==="VariableDefinition")t.bindings.set(t.text(o),Vn)}for(let n of r)fQ(n,t)},Hx=(e,t,r,n,o)=>{if(e===void 0||!["VariableName","VariableDefinition"].includes(e.name)||t===void 0)return U("Only simple iteration bindings are inspected.");let s=r.evaluate(t),i;if(s.kind==="list")i=s.items;else if(s.kind==="data")i=[ht];else return U("Iteration needs bounded literals or inert JSON data.");if(i.length>128)return U("Iteration needs bounded literals or inert JSON data.");let c=[new Map(r.bindings)];if(s.kind==="data"&&o!==void 0)fQ(o,r);for(let l of i.length===0?[Vn]:i)r.bindings.set(r.text(e),l),n(),c.push(new Map(r.bindings));lQ(r.bindings,c)},dQ=(e,t)=>{let r=Ue(e),n=r.find((i)=>i.name==="ForOfSpec");if(n!==void 0){let i=Ue(n),[,a,c,l,u]=i,f=r.at(2);if(i.length!==6||!["const","let"].includes(a?.name??"")||l?.name!=="of"||f?.name!=="Block")return U("Unsupported JavaScript iteration form.");Hx(c,u,t,()=>{t.statement(f)},f);return}let o=r.findIndex((i)=>i.name==="in"),s=r[o+2];if(o!==2||s?.name!=="Body"||r.length!==5)return U("Unsupported loop shape.");Hx(r[o-1],r[o+1],t,()=>{t.statement(s)},s)},Jx=(e,t)=>{let r=e.findIndex((s)=>s.name==="for"),n=e[r-1];if(r!==1||n===void 0||e[r+2]?.name!=="in"||![5,7].includes(e.length))return U("Only single-generator comprehensions are inspected.");let o=new Map(t.bindings);return Hx(e[r+1],e[r+3],t,()=>{if(e.length===7){let[,s]=e.slice(5),i=s??U("Missing comprehension filter.");if(e[5]?.name!=="if")U("Unsupported comprehension filter.");ir([t.evaluate(i)])}ir([t.evaluate(n)])}),cQ(t.bindings,o),ht};var pQ=E(()=>{uc();zo();Di()});var zq=(e,t)=>{let r=t===null?lc(e,"python"):`${t}.${e}`;return{qualified:r,bound:t===null?r.split(".")[0]??r:r}},hQ=(e,t)=>{let[r,n]=e;if(n===void 0)return U("Missing Python import.");let o=r?.name==="from"?lc(t(n),"python"):null,s=new Map,i=o===null?1:e.findIndex((a)=>a.name==="import")+1;while(i<e.length){let a=e[i];if(a?.name!=="VariableName"&&a?.name!=="MemberExpression")return U("Unsupported Python import list.");let c=zq(t(a),o);i+=1;let l=t(a).split(".")[0]??"",{bound:u}=c;if(e[i]?.name==="as"){let f=e[i+1];if(f?.name!=="VariableName")return U("Invalid import alias.");l=t(f),u=c.qualified,i+=2}if(s.set(l,en(u)),i<e.length&&e[i]?.name!==",")return U("Unsupported import separator.");i+=1}return s},mQ=(e,t,r)=>{let n=e.find((c)=>c.name==="String");if(n===void 0)return U("Import source is unresolved.");let o=lc(_p(t(n)),r),s=e.find((c)=>c.name==="ImportGroup");if(s===void 0){let c=e.find((l)=>l.name==="VariableDefinition");if(c===void 0)return U("Unsupported JavaScript import.");return new Map([[t(c),en(o)]])}if(e.some((c)=>c.name==="VariableDefinition"))return U("Combined default and named import requires review.");let i=Ue(s).filter((c)=>!["{","}",","].includes(c.name)),a=new Map;for(let c=0;c<i.length;c+=1){let l=i[c];if(l===void 0)break;let u=i[c+1]?.name==="as"?i[c+2]:l;if(u===void 0)return U("Import alias is unresolved.");if(a.set(t(u),en(`${o}.${t(l)}`)),u!==l)c+=2}return a};var OQ=E(()=>{zo();Di()});var gQ=(e,t)=>{if(!Zs(t))return U("Index has uninspected effects.");if(e.kind==="data"||e.kind==="text"||e.kind==="string")return ht;if(e.kind==="list"&&t.kind==="number")return e.items[t.value]??ht;if(e.kind==="object"&&t.kind==="string")return e.entries.get(t.value)??ht;return U("Computed property access is not inspected.")},xQ=(e,t,r)=>{if(t.startsWith("_")||t==="constructor"||t==="prototype")return U("Runtime reflection is not inspected.");if(e.kind==="symbol")return en(`${e.name}.${t}`);if(e.kind==="path"||e.kind==="file")return{kind:"method",receiver:e,name:t};if(e.kind==="object"&&r!=="python")return e.entries.get(t)??ht;if(Zs(e)){if(e.kind==="data"&&r!=="python")return ht;return{kind:"method",receiver:e,name:t}}return U("Unknown receiver may execute a property getter.")};var yQ=E(()=>{uc();zo();Di()});class EQ{operations=[];#t;#e;#r;#s=0;#a=0;constructor(e,t){this.#e=e,this.#r=t,this.#t=tQ(t)}#o(e){return this.#e.slice(e.from,e.to)}inspect(e){for(let t of Ue(e))this.#u(t)}#u(e){if(this.#m(),SQ.has(e.name))return;let t=Ue(e).filter((r)=>!SQ.has(r.name));switch(e.name){case"Body":case"Block":case"StatementGroup":{for(let r of t)if(![":","{","}"].includes(r.name))this.#u(r);return}case"ExpressionStatement":{for(let r of t)this.#n(r);return}case"AssignStatement":case"VariableDeclaration":{this.#d(t);return}case"ImportStatement":case"ImportDeclaration":{let r=(o)=>this.#o(o),n=e.name==="ImportStatement"?hQ(t,r):mQ(t,r,this.#r);for(let[o,s]of n)this.#t.set(o,s);return}case"ForStatement":{dQ(e,this.#O());return}case"IfStatement":{uQ(e,this.#O());return}case"AssertStatement":{ir(t.filter((r)=>!["assert",","].includes(r.name)).map((r)=>this.#n(r)));return}case"WithStatement":{this.#p(t);return}default:U(`Unsupported executable syntax: ${e.name}.`)}}#d(e){let t=e.findIndex((i)=>i.name==="AssignOp"||i.name==="Equals"),r=e.find((i)=>["VariableName","VariableDefinition","ObjectPattern"].includes(i.name)),n=e[t],o=e[t+1];if(n===void 0||r===void 0||o===void 0||e.length!==t+2)return U("Unsupported binding or assignment.");if(this.#o(n)!=="=")return U("Compound assignment is not inspected.");if(e.slice(0,t).some((i)=>["MemberExpression","ArrayPattern"].includes(i.name)))return U("Destructuring or object mutation is not inspected.");let s=this.#n(o);if(r.name==="ObjectPattern")this.#f(r,s);else this.#t.set(this.#o(r),s)}#p(e){let[,t,r,n,o]=e;if(e.length!==5||t===void 0||r?.name!=="as"||n?.name!=="VariableName"||o?.name!=="Body")return U("Only a single known file context is inspected.");let s=this.#n(t);if(s.kind!=="file")return U("Context manager callbacks require review.");this.#t.set(this.#o(n),s),this.#u(o)}#f(e,t){if(t.kind!=="symbol")return U("Only named module members can be destructured.");for(let r of Ue(e).filter((n)=>!["{","}",","].includes(n.name))){let n=Ue(r),[o,s,i]=n;if(r.name!=="PatternProperty"||o?.name!=="PropertyName")return U("Computed or rest destructuring is not inspected.");if(n.length===1)this.#t.set(this.#o(o),en(`${t.name}.${this.#o(o)}`));else if(n.length===3&&s?.name===":"&&i?.name==="VariableDefinition")this.#t.set(this.#o(i),en(`${t.name}.${this.#o(o)}`));else return U("Destructuring defaults are not inspected.")}}#n(e){this.#m();let t=this.#S(e);if(t.kind==="string")this.#s+=t.value.length;if(t.kind==="path"||t.kind==="file")this.#s+=t.path.length;if(this.#s>1048576)return U("Code exceeds the resolved value budget.");return t}#m(){if(this.#a+=1,this.#a>12000)U("Code exceeds the evaluation step budget.")}#O(){return{bindings:this.#t,text:(e)=>this.#o(e),evaluate:(e)=>this.#n(e),statement:(e)=>{this.#u(e)}}}#S(e){let t=iQ(e,(r)=>this.#n(r),(r)=>this.#o(r));if(t!==null)return t;switch(e.name){case"String":return cc(_p(this.#o(e),this.#r));case"Number":return{kind:"number",value:Number(this.#o(e))};case"Boolean":case"BooleanLiteral":case"None":case"Null":return ht;case"VariableName":return this.#t.get(this.#o(e))??U("Unresolved variable or persistent runtime state.");case"ParenthesizedExpression":case"AwaitExpression":{let r=Ue(e).find((n)=>!["(",")","await"].includes(n.name));return r===void 0?U("Missing expression."):this.#n(r)}case"ArrayExpression":case"Array":case"TupleExpression":return{kind:"list",items:Ue(e).filter((r)=>!["[","]","(",")",","].includes(r.name)).map((r)=>this.#n(r))};case"ArrayComprehensionExpression":return Jx(Ue(e).filter((r)=>!["[","]"].includes(r.name)),this.#O());case"BinaryExpression":return this.#c(e);case"MemberExpression":return this.#g(e);case"CallExpression":return this.#E(e);default:return U(`Unsupported expression: ${e.name}.`)}}#c(e){let[t,r,n]=Ue(e);if(t===void 0||r===void 0||n===void 0)return U("Incomplete binary expression.");let o=this.#n(t),s=this.#n(n),i=this.#o(r);if(o.kind==="string"&&s.kind==="string"&&i==="+")return cc(o.value+s.value);if(o.kind==="path"&&i==="/")return{kind:"path",path:bu([o.path,sr(s)])};if(o.kind==="number"&&s.kind==="number"&&["+","-","*","/","%","**","==","===","<",">"].includes(i))return ht;if(Zs(o)&&Zs(s))return ht;return U("Dynamic operators are not inspected.")}#g(e){let t=Ue(e),[r,n,o]=t;if(r===void 0||o===void 0||n===void 0)return U("Computed property access is not inspected.");let s=this.#n(r);if(this.#r==="python"&&this.#o(n)==="["&&t.some((i)=>i.name===":")){let i=t.slice(2,-1).filter((a)=>a.name!==":");return ir([s,...i.map((a)=>this.#n(a))]),ht}if(this.#o(n)==="["&&t.length===4)return gQ(s,this.#n(o));if(this.#o(n)!=="."||o.name!=="PropertyName"||t.length!==3)return U("Unsupported property access.");return xQ(s,this.#o(o),this.#r)}#E(e){let[t,r]=Ue(e);if(t===void 0||r?.name!=="ArgList")return U("Unsupported call syntax.");let n=this.#n(t),o=Ue(r).filter((i)=>!["(",")",","].includes(i.name)),s=o.some((i)=>i.name==="for")?[Jx(o,this.#O())]:o.map((i)=>this.#n(i));if(s.length>128)return U("Call exceeds the argument count limit.");return oQ(n,s,{language:this.#r,range:{start:e.from,end:e.to},operations:this.operations})}}var SQ,bQ=(e,t)=>{let r=new EQ(t,e);try{return r.inspect(eQ(e,t)),{operations:r.operations,gap:null}}catch(n){return{operations:r.operations,gap:n instanceof Lo?n.message:"The code inspector failed."}}};var kQ=E(()=>{sQ();aQ();pQ();uc();OQ();yQ();zo();Di();SQ=new Set(["Comment","LineComment","BlockComment",";"])});var Xq,PQ=(e)=>{let t=e.words.slice(1);if(t.some((i)=>i.kind!=="literal"))return{kind:"blocked",reason:"The uv command contains unresolved arguments."};let r=0,n=!1,o=()=>{while(r<t.length){let i=t[r]?.value??"";if(Xq.has(i))n||=i==="--no-sync",r+=1;else if(i==="--python"||i==="-p"||i.startsWith("--python=")){let a=i.startsWith("--python="),c=a?i.slice(9):t[r+1]?.value??"";if(!/^[23](?:\.\d+){0,2}t?$/u.test(c))return!1;r+=a?1:2}else break}return!0};if(!o())return{kind:"blocked",reason:"The uv Python selector must be a literal version."};if(t[r]?.value!=="run")return e.tokens.includes("run")?{kind:"blocked",reason:"The uv run options require review."}:{kind:"irrelevant"};if(r+=1,!o())return{kind:"blocked",reason:"The uv Python selector must be a literal version."};if(t[r]?.value==="--")r+=1;let s=t[r]?.value;if(s===void 0||s.startsWith("-")&&s!=="-")return{kind:"blocked",reason:"The uv run command or options require review."};return{kind:"command",argv:t.slice(r).map((i)=>i.value),noSync:n}};var wQ=E(()=>{Xq=new Set(["--no-sync","--locked","--frozen","--offline","--no-project","--no-config","--no-python-downloads","--quiet","-q","--verbose","-v"])});import ku from"path";var $p,Bn=(e)=>({kind:"blocked",reason:e}),ey=(e)=>{let t=ku.posix.basename(e);if(/^(?:python|pypy)(?:[23](?:\.\d+)*t?)?$/u.test(t))return"python";if(["node","nodejs"].includes(t))return"javascript";if(["bun","deno","tsx","ts-node"].includes(t))return"typescript";return null},jq,Vq,Bq=(e)=>{let t=ku.posix.basename(e.head);if(!jq.has(t))return!1;return e.words.slice(1).some((r)=>ey(r.value)!==null||Vq.has(r.value.split("=")[0]??"")||/\.(?:py|pyw|mjs|cjs|js|jsx|ts|tsx)$/u.test(r.value))},Gq=(e)=>{let t=PQ(e);if(t.kind!=="command")return t;let r=t.argv[0]??"",n=r==="-"?"python":ey(r);if(n!==null){if(!t.noSync)return Bn("Inline code through uv requires --no-sync and an existing trusted environment.");if(r==="-")return t.argv.length===1?Kx(e,n):Bn("Trailing uv stdin arguments require review.");return TQ(t.argv.slice(1),n,ku.posix.basename(r))??Kx(e,n)}if(/\.(?:py|pyw|mjs|cjs|js|jsx|ts|tsx)$/u.test(r))return Bn("Script files require explicit review.");return{kind:"command",argv:t.argv}},Kx=(e,t)=>{let r=e.redirects.filter((o)=>["<<","<<<","<","<&"].includes(o.op));if(r.length!==1)return Bn("Interpreter input is absent, piped, or redirected more than once.");let[n]=r;if(n?.op==="<<"&&n.heredoc!==void 0){if(!n.heredoc.quoted&&/[$`\\]/u.test(n.heredoc.content))return Bn("Unquoted interpreter heredoc can change during shell expansion.");return{kind:"source",language:t,source:n.heredoc.content}}if(n?.op==="<<<"&&n.target.kind==="literal")return{kind:"source",language:t,source:n.target.value};return Bn("Interpreter input bytes are not available for inspection.")},TQ=(e,t,r)=>{let n=new Set(t==="python"?["-I","-S","-E","-s","-B","-u","-q"]:["--input-type=module","--input-type=commonjs","--no-warnings"]),o=0;while(o<e.length&&n.has(e[o]??""))o+=1;let s=e[o];if(s===void 0||s==="-"&&o===e.length-1)return null;let i=t==="python"?["-c"]:["-e","--eval","-p","--print"];if(r==="deno")i.push("eval");if(i.includes(s)){let l=e[o+1];if(l===void 0||e.length!==o+2)return Bn("Interpreter source or trailing arguments are not fully inspected.");return{kind:"source",language:t,source:l}}let c=(t==="python"?["-c"]:["-e","-p","--eval=","--print="]).find((l)=>s.startsWith(l));if(c!==void 0&&e.length===o+1)return{kind:"source",language:t,source:s.slice(c.length)};return Bn("Interpreter flags, script files, modules, and interactive sessions require explicit review.")},vQ=(e)=>{if(Bq(e))return Bn("A package launcher can change the interpreter or load project startup code. Use a directly inspected interpreter.");if(ku.posix.basename(e.head)==="uv")return Gq(e);let t=ey(e.head);if(t===null)return $p;let r=e.words.slice(1),n=ku.posix.basename(e.head);if(n==="bun"&&r[0]?.kind==="literal"&&["add","install","remove","update","outdated","pm","build","test"].includes(r[0].value))return $p;if(r.some((o)=>o.kind!=="literal"))return Bn("Interpreter arguments contain runtime substitutions.");if(n==="bun"&&r[0]?.value==="run"&&/^(?:check|test|typecheck|lint|format|build|verify)(?::[\w-]+)*$/u.test(r[1]?.value??""))return $p;if(r.length===1&&["--version","-V","--help","-h"].includes(r[0]?.value??""))return $p;return TQ(r.map((o)=>o.value),t,n)??Kx(e,t)};var CQ=E(()=>{wQ();$p={kind:"irrelevant"},jq=new Set(["poetry","pipenv","pipx","npx","bunx","npm","pnpm","yarn"]),Vq=new Set(["--script","--module","-m","-c","-e","--eval","--call"])});var Yq,Ap=(e)=>{let t=fu(e.file_path,"read",Yq);if(t!==null)return W(t.rule,t.message);return q("read-protect")};var ty=E(()=>{Zt();pu();Yq=[{rule:"read-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/u,message:".env files hold secrets that should never enter the model context. Refuse to read. If the goal is documenting required env vars, look at .env.example or describe the schema from memory."},{rule:"read-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/u,message:"Refuse to read .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"read-ssh",pattern:/(?<prefix>^|\/)\.ssh\//u,message:"Refuse to read files inside ~/.ssh/."},{rule:"read-ssh-key",pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)$/u,message:"Refuse to read SSH private key files."},{rule:"read-private-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/iu,message:"Refuse to read private-key-shaped files."},{rule:"read-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/u,message:"Refuse to read ~/.aws/credentials."},{rule:"read-netrc",pattern:/(?<prefix>^|\/)\.netrc$/u,message:"Refuse to read ~/.netrc (host credentials)."},{rule:"read-secrets-file",pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/iu,message:"Refuse to read a file named secrets.{json,yaml,toml,env}."}]});import{lstatSync as Hq,realpathSync as Jq}from"fs";import qs from"path";var QQ,_Q=(e,t)=>{if(e.environmentAssignments?.some((r)=>QQ.has(r))===!0)return!0;return e.invocations.some((r)=>{if(["cd","pushd","popd"].includes(r.head)||t.remoteHeads.has(r.head))return!0;return r.head==="env"&&r.tokens.some((n)=>QQ.has(n.split("=")[0]??""))})},tn=(e)=>W("embedded-code",`${e} Use a dedicated file tool, a recoverable deletion tool, or a command Tripwire can fully inspect.`),$Q=(e)=>{let t=e,r=[];for(let n=0;n<256;n+=1){try{return qs.join(Jq(t),...r.toReversed())}catch(s){if(!(s instanceof Error)||!("code"in s)||s.code!=="ENOENT")return null}try{if(Hq(t).isSymbolicLink())return null}catch(s){if(!(s instanceof Error)||!("code"in s)||s.code!=="ENOENT")return null}let o=qs.dirname(t);if(o===t)return null;r.push(qs.basename(t)),t=o}return null},Kq=(e,t)=>{if(e===""||e.includes("\x00"))return!1;if(!nc(e,t.safePaths.relative,t.safePaths.absolute))return!1;let r=$Q(qs.resolve(t.cwd,e)),n=$Q(t.cwd);if(r===null||n===null||r===qs.parse(r).root||r===n)return!1;let o=qs.isAbsolute(e)?r:qs.relative(n,r);return nc(o,t.safePaths.relative,t.safePaths.absolute)},AQ=(e)=>`'${e.replaceAll("'",String.raw`'\''`)}'`,eW=(e,t)=>{if(e.kind==="process")return t.inspectCommand(e.argv.map(AQ).join(" "));let r=qs.resolve(t.cwd,e.path);if((e.kind==="delete"||e.kind==="truncate")&&!Kq(e.path,t))return tn(`${e.kind} outside a verified safe scope: ${JSON.stringify(e.path)}.`);return e.kind==="read"?Ap({file_path:r}):du({file_path:r,content:""})},ry=(e,t,r)=>{let n=bQ(e,t);if(n.gap!==null)return tn(n.gap);return Do(n.operations.map((o)=>eW(o,r)))},RQ=(e,t)=>{let r=[];for(let n of e.invocations){let o=vQ(n);if(o.kind==="blocked")return tn(o.reason);if(o.kind==="command"){if(_Q(e,t))return tn("The forwarded command has an unverified execution context.");r.push(t.inspectCommand(o.argv.map(AQ).join(" ")))}if(o.kind==="source"){if(_Q(e,t))return tn("Interpreter startup, working directory, or remote filesystem state is not verified.");r.push(ry(o.language,o.source,t))}}return r.length===0?q("embedded-code"):Do(r)};var IQ=E(()=>{uu();kQ();CQ();Zt();pu();ty();QQ=new Set(["NODE_OPTIONS","NODE_PATH","PYTHONPATH","PYTHONHOME","PYTHONSTARTUP","LD_PRELOAD","DYLD_INSERT_LIBRARIES","BUN_OPTIONS"])});import{readFileSync as tW}from"fs";var FQ=(e,t)=>{let r=new Set(e.split(`
|
|
54
|
+
`).map((n)=>n.trim()).filter((n)=>n.length>0));return t.split(`
|
|
55
|
+
`).filter((n)=>n.trim().length>0).filter((n)=>!r.has(n.trim()))},UQ=(e)=>{try{return tW(e,"utf8")}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return"";throw t}};var DQ=()=>{};var rW,nW,oW,sW,iW=(e)=>{if(sW.test(e))return!1;for(let t of rW)if(t.test(e))return!0;return!1},ny=(e)=>{let t=e.file_path;if(!nW.test(t)||oW.test(t))return q("lazy-code");let r="content"in e?e.content:e.new_string,n="content"in e?UQ(t):e.old_string,o=[];for(let a of FQ(n,r))if(iW(a))o.push(a.slice(0,200));if(o.length===0)return q("lazy-code");let s=o.slice(0,3).map((a)=>` \u2022 ${a}`).join(`
|
|
60
56
|
`),i=o.length>3?`
|
|
61
|
-
\u2026and ${o.length-3} more`:"";return
|
|
62
|
-
`))};var
|
|
57
|
+
\u2026and ${o.length-3} more`:"";return Wn("lazy-code-marker",["Heads up: line(s) you just added contain words that often signal incomplete or deferred work. The write went through \u2014 this is a flag, not a block.","",'Why this exists: AI coding agents have a strong pull toward stubbing things, deferring "for now," and shipping half-built fallbacks instead of finishing the work in the same turn. The point of this warning is to push back on that pull on every iteration. If you stubbed something out for time, finish it this turn rather than leaving deferred work for later.',"",'If the marker is genuinely permanent \u2014 a real product term ("auth fallback flow", "retry fallback chain", an HTML input placeholder, a public API field literally named "placeholder"), a logging tag, or a comment intentionally left for a human reader \u2014 no action needed. To silence the flag on subsequent edits of that line, append `tripwire-allow: <one-line reason>` (any comment syntax: `//`, `#`, `--`, etc.).',"","Flagged additions:",s+i].join(`
|
|
58
|
+
`))};var MQ=E(()=>{Zt();DQ();rW=[/\bTODO\s*:/iu,/\bFIXME\s*:/iu,/\bXXX\s*:/iu,/\bHACK\s*:/iu,/\bfor now\b/iu,/\bnot implemented\b/iu,/\bNotImplementedError\b/u,/\btemp fix\b/iu,/\bfallback\b/iu,/\bplaceholder\b/iu,/\bbackwards?[ -]?compat(?<ibility>ibility)?\b/iu,/\bfor later\b/iu,/\blater on\b/iu,/\bget back to\b/iu,/\bI'?ll fix\b/iu,/\bto be implemented\b/iu,/\bnot yet (?<state>implemented|done)\b/iu,/\bstubbed\b/iu],nW=/\.(?<ext>ts|tsx|js|jsx|mjs|cjs|py|rs|go|rb|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|zsh|bash|lua|ex|exs|clj|scala|dart)$/iu,oW=/(?<prefix>^|\/)(?<dir>__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(?<suffix>\/|$)|\.(?<ext>test|spec|fixture|mock|stories)\.[^/]+$/iu,sW=/tripwire-allow:[ \t]*\S/u});import{spawnSync as aW}from"child_process";var cW,lW,uW,fW=({executable:e,args:t,input:r,timeoutMs:n})=>{let o=aW(e,t,{encoding:"utf8",input:r,maxBuffer:67108864,stdio:["pipe","pipe","ignore"],timeout:n}),s={status:o.status,stdout:typeof o.stdout==="string"?o.stdout:""};return o.error===void 0?s:{...s,error:o.error}},dW=(e)=>{if(typeof e!=="object"||e===null||!("code"in e))return;return typeof e.code==="string"?e.code:void 0},pW=(e)=>{let t=dW(e);if(t==="ENOENT")return"missing-executable";if(t==="ETIMEDOUT")return"timeout";return"non-zero-exit"},hW=(e)=>{let t=new Map;for(let r of e)t.set(r.RuleID,(t.get(r.RuleID)??0)+1);return[...t.entries()].map(([r,n])=>({rule:r,count:n}))},mW=(e,t)=>{let r=e,n=[...t].toSorted((o,s)=>s.Secret.length-o.Secret.length);for(let o of n)if(o.Secret!=="")r=r.replaceAll(o.Secret,`[REDACTED:${o.RuleID}]`);return r},NQ=(e,t,r=fW)=>{if(e.length===0)return{ok:!0,hits:[],redacted:e};let n;try{n=r({executable:t.executable,args:uW,input:e,timeoutMs:t.timeoutMs})}catch{return{ok:!1,category:"non-zero-exit"}}if(n.error!==void 0)return{ok:!1,category:pW(n.error)};if(n.status!==0)return{ok:!1,category:"non-zero-exit"};let o;try{o=JSON.parse(n.stdout)}catch{return{ok:!1,category:"malformed-json"}}let s=gv(lW)(o);if(Ut(s))return{ok:!1,category:"malformed-json"};let i=s.success;return{ok:!0,hits:hW(i),redacted:mW(e,i)}};var ZQ=E(()=>{Zn();cW=ot({RuleID:V,Description:V,StartLine:ou,EndLine:ou,Secret:V,Match:V}),lW=Ae(cW),uW=["stdin","--report-format","json","--report-path","-","--exit-code","0","--no-banner","--no-color","--log-level","error"]});var OW=(e)=>`Tripwire could not verify this tool output because the configured secret scanner failed (${e}). The original output was withheld. Install Betterleaks 1.5.0 or later, check secretScanner.executable and secretScanner.timeoutMs, then run the original tool again.`,qQ=(e)=>{let t=L0(e.toolName,e.response);if(t.length===0)return q("post-secret-scrub");let r=NQ(t,e.secretScanner,e.scannerRunner);if(!r.ok)return W("secret-scanner-failed",OW(r.category));if(r.hits.length===0)return q("post-secret-scrub");let n=r.hits.map((o)=>`${o.rule}\xD7${o.count}`).join(", ");return W("secrets-in-output",[`tripwire intercepted ${r.hits.length} secret pattern(s) in this tool's output (${n}). The original output was withheld so the secret never enters the model context. A redacted form is below \u2014 work from this, do not re-run the same command in a way that re-fetches the underlying secret.`,"","Redacted output:",r.redacted.slice(0,16000)+(r.redacted.length>16000?`
|
|
63
59
|
\u2026[truncated]`:"")].join(`
|
|
64
|
-
`))};var
|
|
60
|
+
`))};var WQ=E(()=>{Zt();Ex();ZQ()});var gW=(e,t)=>e.some((r)=>r.startsWith("-")&&!r.startsWith("--")&&r.slice(1).includes(t)),xW=(e,t)=>{if(!t.executables.includes(e.head))return!1;let r=e.tokens.slice(1),n=new Set(r);if(!(t.match?.argumentsIncludeAll??[]).every((o)=>n.has(o)))return!1;if(!(t.match?.argumentsStartWith??[]).every((o,s)=>r[s]===o))return!1;return(t.match?.shortFlagsIncludeAll??[]).every((o)=>gW(e.flags,o))},LQ=(e,t)=>{for(let r of e.invocations)for(let n of t)if(xW(r,n))return n.action==="deny"?W(n.rule,n.message):Wn(n.rule,n.message);return q("tool-policy")};var zQ=E(()=>{Zt()});var yW=async()=>{let e=[];for await(let t of process.stdin){let r=t;if(r instanceof Uint8Array)e.push(Buffer.from(r));else throw TypeError("Tripwire received a non-byte stdin chunk")}return Buffer.concat(e).toString("utf8")},ay,XQ=250,SW="--tripwire-hook",EW,fc=(e=ay)=>{if(e.kind==="cursor"&&!e.post){process.stdout.write(`{"continue":true,"permission":"allow"}
|
|
65
61
|
`);return}process.stdout.write(`{"continue": true}
|
|
66
|
-
`)},
|
|
67
|
-
`)},
|
|
68
|
-
`);return}let
|
|
69
|
-
`);return}let s={hookEventName:
|
|
70
|
-
`)},
|
|
71
|
-
`)},
|
|
72
|
-
`)},
|
|
62
|
+
`)},oy=(e)=>`[tripwire:${e.rule}] ${e.message}`,YQ=(e)=>{let t=e.kind==="ask"?`${oy(e)} This unattended Cursor run cannot ask a human, so the action is denied.`:oy(e);process.stdout.write(`${JSON.stringify({continue:!0,permission:"deny",user_message:t,agent_message:t})}
|
|
63
|
+
`)},HQ=(e)=>e.turn_id!==void 0,jQ=(e,t,r)=>{if(r.kind==="cursor"){process.stdout.write(`${JSON.stringify({continue:!0,permission:"allow",agent_message:oy(t)})}
|
|
64
|
+
`);return}let n=e.hook_event_name,o=`[tripwire:${t.rule}] ${t.message}`;if(HQ(e)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:o})}
|
|
65
|
+
`);return}let s={hookEventName:n,additionalContext:o};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:s})}
|
|
66
|
+
`)},sy=(e,t,r=ay)=>{if(r.kind==="cursor"){YQ(t);return}let n={hookSpecificOutput:{hookEventName:e,permissionDecision:t.kind==="deny"?"deny":"ask",permissionDecisionReason:`[tripwire:${t.rule}] ${t.message}`}};process.stdout.write(`${JSON.stringify(n)}
|
|
67
|
+
`)},bW=(e,t)=>{if(t.kind==="cursor"){fc(t);return}let r={continue:!0,decision:"block",reason:`[tripwire:${e.rule}] ${e.message}`};process.stdout.write(`${JSON.stringify(r)}
|
|
68
|
+
`)},kW,iy=(e)=>kW[e.toLowerCase()]??e,JQ,KQ,PW=(e,t,r)=>We(function*(){let o=yield*An(xt({try:t,catch:(s)=>new JQ({cause:s})}).pipe(Ak(r)));if(kr(o))return o.value;return Ln(e,ci(o.cause)),e==="embedded-code"?tn("The code inspection rule failed or timed out."):q(e)}),Rp=(e,t,r={},n=0)=>{if(n>8)return[{name:"embedded-code",fn:()=>tn("Nested process inspection exceeds its depth limit.")}];let o=[],s=lu(e,{...r,executionCarrierAliases:t.shell.executionCarrierAliases}),i=(a,c)=>({name:a,fn:()=>sc(s,c())});return o.push({name:"embedded-code",fn:()=>RQ(s,e_(t,r.cwd,n))},i("bash-deny",()=>V0(s,t.ruleActions)),i("bash-git",()=>H0(s,t.git)),i("bash-scoped-rm",()=>oC(s,t.safePaths)),i("bash-redirect",()=>rC(s)),i("bash-network-install",()=>K0(s)),i("bash-tar-explosion",()=>aC(s)),i("tool-policy",()=>LQ(s,t.toolPolicies)),i("config-custom",()=>dC(s,t.blockedCommands,t.allowedCommands))),o},e_=(e,t,r=0)=>({safePaths:e.safePaths,remoteHeads:new Set(["ssh",...e.shell.executionCarrierAliases.map((n)=>n.command[0]??"")]),cwd:t??process.cwd(),inspectCommand:(n)=>t_(Rp(n,e,t===void 0?{}:{cwd:t},r+1))}),wW=(e,t,r,n)=>{if(e==="StatefulCode")return[{name:"embedded-code",fn:()=>tn("Persistent REPL bindings cannot be verified by a stateless hook. Use a fresh interpreter process.")}];if(e==="ExecCommand"){let o=N0(t);return tt(o)?Rp(o.value.cmd,r,n===void 0?{}:{cwd:n}):[{name:"embedded-code",fn:()=>tn("Executable tool input is missing its command.")}]}if(e==="Python"||e==="CodeRepl"||e==="Bash"&&!Sx(t)){let o=M0(t);if(Lt(o))return[{name:"embedded-code",fn:()=>tn("Executable tool input is missing its source text.")}];let s=typeof o.value==="string"?o.value:o.value.code;return[{name:"embedded-code",fn:()=>ry(e==="Python"?"python":"typescript",s,e_(r,n))}]}return},TW=(e,t,r,n)=>{let o=wW(e,t,r,n);if(o!==void 0)return o;let s=[];if(e==="PowerShell")return s.push({name:"powershell-unsupported",fn:()=>W("powershell-unsupported","PowerShell commands are blocked because Tripwire cannot parse PowerShell grammar. Use the Bash tool, or add a PowerShell parser before you enable this tool.")}),s;if(e==="Bash"&&Sx(t))return Rp(t.command,r,n===void 0?{}:{cwd:n});if(e==="Read"&&W0(t)){let c=t;return s.push({name:"read-protect",fn:()=>Ap(c)}),s}let i=(e==="Edit"||e==="MultiEdit")&&Z0(t),a=e==="Write"&&q0(t);if(i){let c=t;s.push({name:"path-protect",fn:()=>du(c)},{name:"lazy-code",fn:()=>ny(c)})}else if(a){let c=t;s.push({name:"path-protect",fn:()=>du(c)},{name:"lazy-code",fn:()=>ny(c)})}return s},vW=(e,t,r)=>{if(e==="Bash"||e==="PowerShell"||e==="Read"||e==="WebFetch"){let n=e==="PowerShell"?"Bash":e;return[{name:"post-secret-scrub",fn:()=>qQ({toolName:n,response:t,secretScanner:r})}]}return[]},VQ=(e,t)=>We(function*(){if(e.length===0)return q("no-rules");let n=[];for(let o of e)n.push(yield*PW(o.name,o.fn,t));return Do(n)}),t_=(e)=>{if(e.length===0)return q("no-rules");let t=[];for(let r of e)try{t.push(r.fn())}catch(n){Ln(r.name,n),t.push(r.name==="embedded-code"?tn("The code inspection rule failed."):q(r.name))}return Do(t)},r_=(e,t={},r={})=>t_(Rp(e,dx(t),r)),CW=(e,t,r)=>{let n=e.hook_event_name,o=iy(e.tool_name??"");if(n==="PreToolUse"&&o==="Bash"){if(t.kind==="warn"){jQ(e,t,r);return}fc(r);return}if(t.kind==="warn"){jQ(e,t,r);return}fc(r)},QW=(e)=>`tripwire config at ${fx} failed to load, so ALL custom safety policy is inactive. Failing closed until it is fixed. Fix the JSON, then this clears on the next hook call. Restart any long-running consumer that caches the loaded config. Error: ${e}`,n_=()=>{let e=process.argv.indexOf("--cursor-event");if(e!==-1)return process.argv[e+1]??"";return process.argv.find((r)=>r.startsWith("--cursor-event="))?.slice(15)},_W=()=>process.argv.includes(SW),o_=()=>{let e=n_();return e===void 0?ay:gx(e)},Ws=(e,t=!1)=>{let r=o_();if(t){sy("PreToolUse",W("tripwire-batch-error",`Tripwire batch input could not be processed (${e}). Failing closed.`),r);return}if(r.kind==="cursor"&&!r.post){YQ(W("cursor-hook-error",`Cursor hook input could not be processed (${e}). Failing closed.`));return}fc(r)},BQ=(e,t)=>{if(t.kind==="cursor")return`cursor:${t.eventName}`;return HQ(e)?"codex":"native"},GQ=(e)=>e.length===1?e[0]??q("no-rules"):Do(e),$W=(e)=>We(function*(){let r=Array.isArray(e);if(r&&!_W())return Ln("decode","Batch hook input is only available through --tripwire-hook"),Ws("unsupported batch input"),{ok:!1};let n,o;if(r){let c=yield*An(PU(EW)(e));if(ui(c))return Ln("decode",ci(c.cause)),Ws("unsupported batch event shape",!0),{ok:!1};n=c.value,o=o_()}else{let c=U0(e,n_()),l=yield*An(ru(yx)(c.event));if(ui(l))return Ln("decode",ci(l.cause)),Ws("unsupported event shape"),{ok:!1};n=[l.value],{host:o}=c}let[s]=n;if(s===void 0)return Ws("empty batch",!0),{ok:!1};let i=s.hook_event_name,a=BQ(s,o);if(n.some((c)=>c.hook_event_name!==i))return Ln("decode","Batch hook input mixes event phases"),Ws("mixed event phases",!0),{ok:!1};if(n.some((c)=>BQ(c,o)!==a))return Ln("decode","Batch hook input mixes hosts"),Ws("mixed hosts",!0),{ok:!1};return{ok:!0,events:n,firstEvent:s,host:o,phase:i}}),AW,RW,s_=()=>{fI(RW)};var cy=E(()=>{Ng();Zn();uu();px();D0();Zt();Ex();X0();bx();B0();J0();eC();nC();sC();cC();pC();IQ();MQ();pu();WQ();ty();zQ();ay={kind:"native"},EW=Ae(yx).check(Rg(1)),kW={bash:"Bash",exec:"Bash",shell:"Bash",run_command:"Bash",read:"Read",read_file:"Read",write:"Write",write_file:"Write",edit:"Edit",edit_file:"Edit",multiedit:"Edit",apply_patch:"Edit",webfetch:"WebFetch",web_fetch:"WebFetch",fetch:"WebFetch",powershell:"PowerShell",exec_command:"ExecCommand","functions.exec_command":"ExecCommand","functions.exec":"Bash",python:"Python",javascript:"CodeRepl",typescript:"CodeRepl",js_repl:"StatefulCode",python_repl:"StatefulCode","functions.js_repl":"StatefulCode"};JQ=class JQ extends Fr("RuleExecutionError"){};KQ=class KQ extends Fr("HookInputParseError"){};AW=We(function*(){let t=yield*hp(),r=yield*gs(yW),n=yield*An(xt({try:()=>JSON.parse(r),catch:(l)=>new KQ({cause:l})}));if(ui(n)){Ln("parse",ci(n.cause)),Ws("invalid JSON");return}let o=yield*$W(n.value);if(!o.ok)return;let{events:s,firstEvent:i,host:a,phase:c}=o;if(c==="PreToolUse"){if(!t.ok){sy(c,W("config-error",QW(t.error)),a);return}let l=[];for(let f of s){let d=iy(f.tool_name??"");l.push(yield*VQ(TW(d,f.tool_input,t.config,f.cwd),XQ))}let u=GQ(l);if(u.kind==="deny"||u.kind==="ask"){sy(c,u,a);return}CW(i,u,a);return}if(c==="PostToolUse"){let l=t.ok?t.config.secretScanner:pp().secretScanner,u=[];for(let d of s){let h=iy(d.tool_name??"");u.push(yield*VQ(vW(h,d.tool_response,l),XQ))}let f=GQ(u);if(f.kind==="deny"){bW(f,a);return}fc(a);return}fc(a)}),RW=AW.pipe(wr((e)=>ne(()=>{Ln("dispatch-fatal",ci(e)),Ws("dispatcher failure")})))});function IW(e){return{_tag:"Value",value:e}}function FW(e,t){return{_tag:"Record",keys:e,value:t}}function UW(e,t){return{_tag:"Array",length:e,value:t}}function NW(e,t){let r=Object.create(DW);return r.load=e,r.mapInput=t,r}function a_(e,t){return NW((r)=>e(t(r)),(r)=>a_(e,gS(t,r)))}function ZW(e){return a_(e,MW)}function qW(e,t){return e===""&&!t?void 0:e}function WW(e,t){let r=t?.preserveEmptyStrings===!0,n=zW(e);return ZW((o)=>T(jW(n,e,o,r)))}function LW(e){let t=e?.env??{...globalThis.process?.env,...import.meta?.env};return WW(t,{preserveEmptyStrings:e?.preserveEmptyStrings})}function zW(e){let t={};for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=r.split("_"),s=t;for(let i of o){let a=s.children??=Object.create(null);s=a[i]??={}}}return t}function jW(e,t,r,n){let o=r.map(String).join("_"),s=qW(Object.hasOwn(t,o)?t[o]:void 0,n),i=VW(e,r),a=i?.children?Object.keys(i.children):[];if(a.length===0)return s===void 0?void 0:IW(s);if(a.every((l)=>XW.test(l))){let l=Math.max(...a.map((u)=>parseInt(u,10)))+1;return UW(l,s)}return FW(new Set(a),s)}function VW(e,t){if(t.length===0)return e;let r=e;for(let n of t)if(r=r?.children?.[String(n)],!r)return;return r}var i_,DW,MW=(e)=>e,XW;var c_=E(()=>{lt();ae();oe();ct();i_=Be("effect/ConfigProvider",{defaultValue:()=>LW()}),DW={...Jt,toJSON(){return{_id:"ConfigProvider"}}};XW=/^(0|[1-9][0-9]*)$/});var l_="~effect/Config",_re,ly,uy,u_;var f_=E(()=>{c_();la();Ba();kd();_re={...Pn({label:"Config",evaluate(e){return this.parse(e.getRef(i_))}}),[l_]:l_,toJSON(){return{_id:"Config"}}},ly=Xa(["true","yes","on","1","y"]),uy=Xa(["false","no","off","0","n"]),u_=Xa([...ly.literals,...uy.literals]).pipe(nu(_g,Wl({decode:(e)=>e==="true"||e==="yes"||e==="on"||e==="1"||e==="y",encode:(e)=>e?"true":"false"})))});var Qe="~effect/cli/CliError",fy=(e)=>G(e,Qe),Mi,Ip,Pu,Fp,Up,Sn,Dp,d_,HW,Ls;var wu=E(()=>{ye();ed();Ba();Mi=class Mi extends Nn(`${Qe}/UnrecognizedOption`)("UnrecognizedOption",{option:V,command:te(Ae(V)),suggestions:Ae(V)}){[Qe]=Qe;get message(){let e=this.suggestions.length>0?`
|
|
73
69
|
|
|
74
70
|
Did you mean this?
|
|
75
71
|
${this.suggestions.join(`
|
|
76
|
-
`)}`:"";return(this.command?`Unrecognized flag: ${this.option} in command ${this.command.join(" ")}`:`Unrecognized flag: ${this.option}`)+e}};
|
|
72
|
+
`)}`:"";return(this.command?`Unrecognized flag: ${this.option} in command ${this.command.join(" ")}`:`Unrecognized flag: ${this.option}`)+e}};Ip=class Ip extends Nn(`${Qe}/DuplicateOption`)("DuplicateOption",{option:V,parentCommand:V,childCommand:V}){[Qe]=Qe;get message(){return`Duplicate flag name "${this.option}" in parent command "${this.parentCommand}" and subcommand "${this.childCommand}". Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`}};Pu=class Pu extends Nn(`${Qe}/MissingOption`)("MissingOption",{option:V}){[Qe]=Qe;get message(){return`Missing required flag: --${this.option}`}};Fp=class Fp extends Nn(`${Qe}/MissingArgument`)("MissingArgument",{argument:V}){[Qe]=Qe;get message(){return`Missing required argument: ${this.argument}`}};Up=class Up extends Nn(`${Qe}/UnexpectedArgument`)("UnexpectedArgument",{arguments:Ae(V)}){[Qe]=Qe;get message(){return`Unexpected positional ${this.arguments.length===1?"argument":"arguments"}: ${this.arguments.map((t)=>JSON.stringify(t)).join(", ")}`}};Sn=class Sn extends Nn(`${Qe}/InvalidValue`)("InvalidValue",{option:V,value:V,expected:V,kind:hn([Lr("flag"),Lr("argument")])}){[Qe]=Qe;get message(){let e=this.expected.startsWith("Expected ")||this.expected.startsWith("Expected:")?this.expected:`Expected: ${this.expected}`;if(this.kind==="argument")return`Invalid value for argument <${this.option}>: "${this.value}". ${e}`;if(this.value.length===0)return`Missing value for flag --${this.option}. ${e}`;return`Invalid value for flag --${this.option}: "${this.value}". ${e}`}};Dp=class Dp extends Nn(`${Qe}/UnknownSubcommand`)("UnknownSubcommand",{subcommand:V,parent:te(Ae(V)),suggestions:Ae(V)}){[Qe]=Qe;get message(){let e=this.suggestions.length>0?`
|
|
77
73
|
|
|
78
74
|
Did you mean this?
|
|
79
75
|
${this.suggestions.join(`
|
|
80
|
-
`)}`:"";return this.parent?`Unknown subcommand "${this.subcommand}" for "${this.parent.join(" ")}"${e}`:`Unknown subcommand "${this.subcommand}"${e}`}};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
`)
|
|
89
|
-
`)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
`}
|
|
94
|
-
|
|
95
|
-
`).
|
|
96
|
-
`
|
|
97
|
-
|
|
98
|
-
`))})
|
|
99
|
-
|
|
100
|
-
`))
|
|
101
|
-
`))}})},fre=(e,t,n,r)=>{if(!e.disabled&&e.description&&t){let o=n.descriptionSeparator+e.description;return r?.plain===!0?o:at(o,n.mutedColor)}return""},XB=(e)=>H(function*(t,n){let o=yield*(yield*mo).columns,s=yield*Zt(e),i=zi+oc,a=eH(t,s.pointerSmall,s,{plain:!0}),c=GI(t,s.prefix,s.pointerSmall,e,s,{plain:!0});return zI(c,o,a)+i}),dre=(e,t,n,r)=>{let o=e.value===""?"":`${e.value}`;if(t||r?.plain===!0)return o;let s=Ee(e.error)?n.errorColor:Ho(rc,n.primaryColor);return at(o,s)},eH=(e,t,n,r)=>{if(Ee(e.error))return Ul(e.error.value.split(cc),{onEmpty:()=>"",onNonEmpty:(o)=>{if(r?.plain===!0)return Wi(t,o.join(`
|
|
102
|
-
`));let s=Ue(t,n.errorColor),i=jt(o,(a)=>LI(a,n.errorColor));return kx+`
|
|
103
|
-
`+Wi(s,i.join(`
|
|
104
|
-
`))+Ix}});return""},GI=(e,t,n,r,o,s,i=!1)=>{let a=dre(e,i,o,s);return uc(a,r.message,t,n,s)},tH,nH,rH=(e)=>{if(e.value.length<=0)return v(W.Beep());let t=e.value.slice(0,e.value.length-1);return v(W.NextFrame({state:{...e,value:t,error:O()}}))},oH=(e)=>v(W.NextFrame({state:{...e,cursor:0,value:"",error:O()}})),pre=(e,t)=>{if(t.value.length===0&&e==="-")return v(W.NextFrame({state:{...t,value:"-",error:O()}}));let n=Number.parseInt(t.value+e);if(Number.isNaN(n))return v(W.Beep());else return v(W.NextFrame({state:{...t,value:`${n}`,error:O()}}))},mre=(e,t)=>{if(e==="."&&t.value.includes("."))return v(W.Beep());if(t.value.length===0&&e==="-")return v(W.NextFrame({state:{...t,value:"-",error:O()}}));let n=Number.parseFloat(t.value+e);if(Number.isNaN(n))return v(W.Beep());else return v(W.NextFrame({state:{...t,value:e==="."?`${n}.`:t.value.includes(".")&&/^\d$/.test(e)?t.value+e:`${n}`,error:O()}}))},hre=(e)=>(t,n)=>W.$match(n,{Beep:()=>v(ac),NextFrame:({state:r})=>tH(r,e),Submit:()=>nH(t,e)}),gre=(e)=>(t,n)=>{if(t.key.ctrl&&t.key.name==="u")return oH(n);switch(t.key.name){case"backspace":return rH(n);case"k":case"up":return v(W.NextFrame({state:{...n,value:n.value===""||n.value==="-"?`${e.incrementBy}`:`${Number.parseInt(n.value)+e.incrementBy}`,error:O()}}));case"j":case"down":return v(W.NextFrame({state:{...n,value:n.value===""||n.value==="-"?`-${e.decrementBy}`:`${Number.parseInt(n.value)-e.decrementBy}`,error:O()}}));case"enter":case"return":{let r=Number.parseInt(n.value);if(Number.isNaN(r))return v(W.NextFrame({state:{...n,error:_("Must provide an integer value")}}));else return wi(e.validate(r),{onFailure:(o)=>W.NextFrame({state:{...n,error:_(o)}}),onSuccess:(o)=>W.Submit({value:o})})}default:return pre(mt(t.input,()=>""),n)}},xre=(e)=>(t,n)=>W.$match(n,{Beep:()=>v(ac),NextFrame:({state:r})=>tH(r,e),Submit:()=>nH(t,e)}),yre=(e)=>(t,n)=>{if(t.key.ctrl&&t.key.name==="u")return oH(n);switch(t.key.name){case"backspace":return rH(n);case"k":case"up":return v(W.NextFrame({state:{...n,value:n.value===""||n.value==="-"?`${e.incrementBy}`:`${Number.parseFloat(n.value)+e.incrementBy}`,error:O()}}));case"j":case"down":return v(W.NextFrame({state:{...n,value:n.value===""||n.value==="-"?`-${e.decrementBy}`:`${Number.parseFloat(n.value)-e.decrementBy}`,error:O()}}));case"enter":case"return":{let r=Number.parseFloat(n.value);if(Number.isNaN(r))return v(W.NextFrame({state:{...n,error:_("Must provide a floating point value")}}));else return ne(Se(()=>rR(r,e.precision)),(o)=>wi(e.validate(o),{onFailure:(s)=>W.NextFrame({state:{...n,error:_(s)}}),onSuccess:(s)=>W.Submit({value:s})}))}default:return mre(mt(t.input,()=>""),n)}},JI=(e,t,n,r)=>uc("",n.message,e,t,r),Sre=(e,t,n,r,o,s)=>{let i=Dne(o,r===n.startIndex&&n.startIndex>0,r===n.endIndex-1&&n.endIndex<t.length);if(s?.plain===!0)return e===r?o.pointer+i:i+" ".repeat(o.pointer.length);if(t[r].disabled){let a=Ho(qs,o.mutedColor);return e===r?Ue(o.pointer,a)+i:i+" ".repeat(o.pointer.length)}return e===r?Ue(o.pointer,o.primaryColor)+i:i+" ".repeat(o.pointer.length)},Ere=(e,t,n,r)=>{if(r?.plain===!0)return e.title;let o=e.title;if(t)return e.disabled?at(o,Ho(rc,n.mutedColor)):at(o,Ho(rc,n.primaryColor));return e.disabled?at(o,Ho(wB,n.mutedColor)):o},sH=(e,t,n,r)=>{let o=t.choices,s=Vre(e,o.length,t.maxPerPage),i=[];for(let a=s.startIndex;a<s.endIndex;a++){let c=o[a],u=e===a,l=Sre(e,o,s,a,n,r),f=Ere(c,u,n,r),d=fre(c,u,n,r);i.push(l+f+" "+d)}return i.join(`
|
|
105
|
-
`)},bre,wre,vre=(e,t)=>{if(e===0)return v(W.NextFrame({state:t.length-1}));return v(W.NextFrame({state:e-1}))},kre=(e,t)=>{if(e===t.length-1)return v(W.NextFrame({state:0}));return v(W.NextFrame({state:e+1}))},Ire=(e,t)=>v(W.NextFrame({state:(e+1)%t.length})),Cre=(e)=>(t,n)=>W.$match(n,{Beep:()=>v(ac),NextFrame:({state:r})=>bre(r,e),Submit:()=>wre(t,e)}),Tre=(e)=>H(function*(t,n){let o=yield*(yield*mo).columns,s=yield*Zt(e),i=zi+oc,a=JI(s.prefix,s.pointerSmall,e,{plain:!0}),c=sH(t,e,s,{plain:!0});return cl(`${a}
|
|
106
|
-
${c}`,o)+i}),Ore=(e)=>(t,n)=>{switch(t.key.name){case"k":case"up":return vre(n,e.choices);case"j":case"down":return kre(n,e.choices);case"tab":return Ire(n,e.choices);case"enter":case"return":{let r=e.choices[n];if(r.disabled)return v(W.Beep());return v(W.Submit({value:r.value}))}default:return v(W.Beep())}},Are,_re=(e,t,n,r,o)=>{let s=e.value;if(o?.plain===!0)switch(t.type){case"hidden":return"";case"password":return n.passwordMask.repeat(s.length);case"text":return s}if(s.length===0)return"";let i=Ee(e.error)?n.errorColor:r?n.submittedColor:Ho(rc,n.primaryColor);switch(t.type){case"hidden":return"";case"password":return Ue(n.passwordMask.repeat(s.length),i);case"text":return at(s,i)}},iH=(e,t,n,r)=>{if(Ee(e.error))return Ul(e.error.value.split(cc),{onEmpty:()=>"",onNonEmpty:(o)=>{if(r?.plain===!0)return Wi(t,o.join(`
|
|
107
|
-
`));let s=Ue(t,n.errorColor),i=jt(o,(a)=>LI(a,n.errorColor));return kx+`
|
|
108
|
-
`+Wi(s,i.join(`
|
|
109
|
-
`))+Ix}});return""},ZI=(e,t,n,r,o,s,i=!1)=>{let a=_re(e,r,o,i,s);return uc(a,r.message,t,n,s)},Rre,Pre,Fre=(e)=>{if(e.cursor<=0)return v(W.Beep());let t=e.value.slice(0,e.cursor-1),n=e.value.slice(e.cursor),r=e.cursor-1,o=`${t}${n}`;return v(W.NextFrame({state:{...e,cursor:r,value:o,error:O()}}))},Mre=(e)=>v(W.NextFrame({state:{...e,cursor:0,value:"",error:O()}})),Nre=(e)=>{if(e.cursor<=0)return v(W.Beep());let t=e.cursor-1;return v(W.NextFrame({state:{...e,cursor:t,error:O()}}))},Dre=(e)=>{if(e.cursor>=e.value.length)return v(W.Beep());let t=Math.min(e.cursor+1,e.value.length);return v(W.NextFrame({state:{...e,cursor:t,error:O()}}))},PB=(e)=>v(W.NextFrame({state:{...e,cursor:0,error:O()}})),FB=(e)=>v(W.NextFrame({state:{...e,cursor:e.value.length,error:O()}})),$re=(e,t)=>{if(e.value===t.default)return v(W.Beep());let n=e.value.length===0?t.default:e.value;return v(W.NextFrame({state:{...e,value:n,cursor:n.length,error:O()}}))},Ure=(e,t)=>{let n=t.value.slice(0,t.cursor),r=t.value.slice(t.cursor),o=`${n}${e}${r}`,s=t.cursor+e.length;return v(W.NextFrame({state:{...t,cursor:s,value:o,error:O()}}))},Lre=(e)=>(t,n)=>W.$match(n,{Beep:()=>v(ac),NextFrame:({state:r})=>Rre(r,e),Submit:()=>Pre(t,e)}),jre=(e)=>(t,n)=>{if(t.key.ctrl)switch(t.key.name){case"u":return Mre(n);case"a":return PB(n);case"e":return FB(n);default:return v(W.Beep())}switch(t.key.name){case"backspace":return Fre(n);case"left":return Nre(n);case"right":return Dre(n);case"home":return PB(n);case"end":return FB(n);case"enter":case"return":{let r=n.value;return wi(e.validate(r),{onFailure:(o)=>W.NextFrame({state:{...n,value:r,error:_(o)}}),onSuccess:(o)=>W.Submit({value:o})})}case"tab":return $re(n,e);default:return Ure(mt(t.input,()=>""),n)}},Bre=(e)=>(t,n)=>Are(t,e),aH=(e,t)=>{let n={default:"",type:t,validate:v,...e},r={cursor:n.default.length,value:n.default,error:O()};return ic(r,{render:Lre(n),process:jre(n),clear:Bre(n)})},Hre,cH=(e,t,n,r=!1)=>{let o=Ue(n.toggleSeparator,n.mutedColor),s=Ho(rc,r?n.submittedColor:n.primaryColor),i=e?t.inactive:at(t.inactive,s);return(e?at(t.active,s):t.active)+" "+Wi(o,i)},uH=(e,t,n,r)=>uc(e,r.message,t,n),qre,zre,MB,NB,Wre=(e)=>(t,n)=>{switch(n._tag){case"Beep":return v(ac);case"NextFrame":return qre(t,e);case"Submit":return zre(t,e)}},Kre=(e,t)=>{switch(e.key.name){case"0":case"j":case"delete":case"right":case"down":return NB;case"1":case"k":case"left":case"up":return MB;case" ":case"tab":return t?NB:MB;case"enter":case"return":return v(W.Submit({value:t}));default:return v(W.Beep())}},Vre=(e,t,n)=>{let r=n===void 0?t:n,o=Math.min(t-r,e-Math.floor(r/2));if(o<0)o=0;let s=Math.min(o+r,t);return{startIndex:o,endIndex:s}};var Ox=w(()=>{An();Ve();Wc();Oe();Pc();X();Xm();_e();he();Gf();$d();sx();UB={prefix:"?",arrowUp:"\u2191",arrowDown:"\u2193",checkboxOn:"\u2612",checkboxOff:"\u2610",tick:"\u2714",ellipsis:"\u2026",pointerSmall:"\u203A",pointer:"\u276F",descriptionSeparator:"- ",passwordMask:"*",toggleSeparator:"/",primaryColor:al,mutedColor:fp,successColor:Tx,errorColor:Cx,submittedColor:sc},Pne={...UB,checkboxOn:"[*]",checkboxOff:"[ ]",tick:"\u221A",ellipsis:"...",pointerSmall:"\xBB",pointer:">"},Mne=ke("effect/unstable/cli/Prompt/Theme",{defaultValue:Fne}),$ne=p(2,(e,t)=>{let n=Object.create(qI);return n._tag="OnSuccess",n.prompt=e,n.onSuccess=t,n}),Une=p(2,(e,t)=>$ne(e,(n)=>jne(t(n)))),vn=H(function*(e){let t=yield*mo,n=yield*t.readInput;return yield*UI(e,t,n)},Pt(()=>new np({})),vi),qI={...So({label:"Prompt",evaluate(){return vn(this)}}),[DB]:{_Output:(e)=>e}},Bne=H(function*(e,t,n){let r=zn(e.initialState)?yield*e.initialState:e.initialState,o=W.NextFrame({state:r});while(!0){let s=yield*e.render(r,o);if(yield*Fr(t.display(s)),e.events){let i=Is(n).pipe(oe((c)=>({_tag:"Input",input:c}))),a=yield*_a(i,Is(e.events).pipe(oe((c)=>({_tag:"Event",value:c}))));o=yield*e.process(a,r)}else{let i=yield*Is(n);o=yield*e.process(i,r)}switch(o._tag){case"Beep":continue;case"NextFrame":{yield*Fr(t.display(yield*e.clear(r,o))),r=o.state;continue}case"Submit":{yield*Fr(t.display(yield*e.clear(r,o)));let i=yield*e.render(r,o);return yield*Fr(t.display(i)),o.value}}}},(e,t,n)=>pu(e,Fr(n.display(vB)))),W=ES(),ac=kB,cc=/\r?\n/,zne=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.prefix,n.primaryColor),o=Ue(n.pointerSmall,n.mutedColor),s=e.value?t.placeholder.defaultConfirm:t.placeholder.defaultDeny,i=at(s,n.mutedColor),a=WI(i,r,o,t);return lp+a}),Wne=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.tick,n.successColor),o=Ue(n.ellipsis,n.mutedColor),s=e?t.label.confirm:t.label.deny;return WI(s,r,o,t)+`
|
|
110
|
-
`}),Vne=/^y|t$/,Gne=/^n|f$/,Qne=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.prefix,n.primaryColor),o=Ue(n.pointerSmall,n.mutedColor),s=zB(e,n),i=KI(r,o,s,t),a=Yne(e,n.pointerSmall,n);return lp+i+a}),Xne=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.tick,n.successColor),o=Ue(n.ellipsis,n.mutedColor),s=zB(e,n,!0);return KI(r,o,s,t)+`
|
|
111
|
-
`}),ire={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},ure=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,RB={1:({token:e,...t})=>new VI({token:e.replace(/\\(.)/g,"$1"),...t}),2:(e)=>new JB(e),3:(e)=>new ZB(e),4:(e)=>new YB(e),5:(e)=>new QB(e),6:(e)=>new GB(e),7:(e)=>new VB(e),8:(e)=>new KB(e),9:(e)=>new WB(e)};VI=class VI extends qo{increment(){}decrement(){}setValue(e){this.token=this.token+e}isToken(){return!0}toString(){return this.token}};WB=class WB extends qo{increment(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}decrement(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setValue(e){this.date.setMilliseconds(Number.parseInt(e.slice(-this.token.length)))}toString(){return`${this.date.getMilliseconds()}`.padStart(4,"0").substring(0,this.token.length)}};KB=class KB extends qo{increment(){this.date.setSeconds(this.date.getSeconds()+1)}decrement(){this.date.setSeconds(this.date.getSeconds()-1)}setValue(e){this.date.setSeconds(Number.parseInt(e.slice(-2)))}toString(){let e=`${this.date.getSeconds()}`;return this.token.length>1?e.padStart(2,"0"):e}};VB=class VB extends qo{increment(){this.date.setMinutes(this.date.getMinutes()+1)}decrement(){this.date.setMinutes(this.date.getMinutes()-1)}setValue(e){this.date.setMinutes(Number.parseInt(e.slice(-2)))}toString(){let e=`${this.date.getMinutes()}`;return this.token.length>1?e.padStart(2,"0"):e}};GB=class GB extends qo{increment(){this.date.setHours(this.date.getHours()+1)}decrement(){this.date.setHours(this.date.getHours()-1)}setValue(e){this.date.setHours(Number.parseInt(e.slice(-2)))}toString(){let e=/h/.test(this.token)?this.date.getHours()%12||12:this.date.getHours();return this.token.length>1?`${e}`.padStart(2,"0"):`${e}`}};JB=class JB extends qo{increment(){this.date.setDate(this.date.getDate()+1)}decrement(){this.date.setDate(this.date.getDate()-1)}setValue(e){this.date.setDate(Number.parseInt(e.slice(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();switch(this.token){case"DD":return`${e}`.padStart(2,"0");case"Do":return`${e}${this.ordinalIndicator(e)}`;case"d":return`${t+1}`;case"ddd":return this.locales.weekdaysShort[t];case"dddd":return this.locales.weekdays[t];default:return`${e}`}}ordinalIndicator(e){if(e>=11&&e<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}};ZB=class ZB extends qo{increment(){this.date.setMonth(this.date.getMonth()+1)}decrement(){this.date.setMonth(this.date.getMonth()-1)}setValue(e){let t=Number.parseInt(e.slice(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let e=this.date.getMonth();switch(this.token.length){case 2:return`${e+1}`.padStart(2,"0");case 3:return this.locales.monthsShort[e];case 4:return this.locales.months[e];default:return`${e+1}`}}};YB=class YB extends qo{increment(){this.date.setFullYear(this.date.getFullYear()+1)}decrement(){this.date.setFullYear(this.date.getFullYear()-1)}setValue(e){this.date.setFullYear(Number.parseInt(e.slice(-4)))}toString(){let e=`${this.date.getFullYear()}`.padStart(4,"0");return this.token.length===2?e.slice(-2):e}};QB=class QB extends qo{increment(){this.date.setHours((this.date.getHours()+12)%24)}decrement(){this.increment()}setValue(e){}toString(){let e=this.date.getHours()>=12?"pm":"am";return/A/.test(this.token)?e.toUpperCase():e}};tH=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.prefix,n.primaryColor),o=Ue(n.pointerSmall,n.mutedColor),s=eH(e,n.pointerSmall,n);return GI(e,r,o,t,n)+s}),nH=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.tick,n.successColor),o=Ue(n.ellipsis,n.mutedColor);return GI(e,r,o,t,n,void 0,!0)+`
|
|
112
|
-
`}),bre=H(function*(e,t){let n=yield*Zt(t),r=sH(e,t,n),o=Ue(n.prefix,n.primaryColor),s=Ue(n.pointerSmall,n.mutedColor),i=JI(o,s,t);return lp+i+`
|
|
113
|
-
`+r}),wre=H(function*(e,t){let n=yield*Zt(t),r=t.choices[e].title,o=Ue(n.tick,n.successColor),s=Ue(n.ellipsis,n.mutedColor);return JI(o,s,t)+" "+at(r,n.submittedColor)+`
|
|
114
|
-
`}),Are=H(function*(e,t){let r=yield*(yield*mo).columns,o=yield*Zt(t),s=zi+oc,i=iH(e,o.pointerSmall,o,{plain:!0});return zI(ZI(e,o.prefix,o.pointerSmall,t,o,{plain:!0}),r,i)+s}),Rre=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.prefix,n.primaryColor),o=Ue(n.pointerSmall,n.mutedColor),s=ZI(e,r,o,t,n),i=iH(e,n.pointerSmall,n),a=t.type==="password"?n.passwordMask.length:1,c=(e.cursor-e.value.length)*a;return s+i+OB(c)}),Pre=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.tick,n.successColor),o=Ue(n.ellipsis,n.mutedColor);return ZI(e,r,o,t,n,void 0,!0)+`
|
|
115
|
-
`}),Hre=H(function*(e){let n=yield*(yield*mo).columns,r=yield*Zt(e),o=zi+oc,s=e.active+" "+Wi(r.toggleSeparator,e.inactive),i=uc(s,e.message,r.prefix,r.pointerSmall,{plain:!0});return cl(i,n)+o}),qre=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.prefix,n.primaryColor),o=Ue(n.pointerSmall,n.mutedColor),s=cH(e,t,n),i=uH(s,r,o,t);return lp+i}),zre=H(function*(e,t){let n=yield*Zt(t),r=Ue(n.tick,n.successColor),o=Ue(n.ellipsis,n.mutedColor),s=cH(e,t,n,!0);return uH(s,r,o,t)+`
|
|
116
|
-
`}),MB=v(W.NextFrame({state:!0})),NB=v(W.NextFrame({state:!1}))});var lH="~effect/cli/Param",Yt="argument",It="flag",dp,Ax=(e)=>M(e,lH),fc=(e)=>e.kind==="flag",cn=(e)=>{let t=(n)=>e.kind===Yt?Jre(e.name,e.primitiveType,n):Zre(e.name,e.primitiveType,n);return Object.setPrototypeOf({_tag:"Single",...e,description:e.description??O(),aliases:e.aliases??[],hidden:e.hidden??!1,parse:t},dp)},_x=(e,t)=>cn({name:t,primitiveType:mB,kind:e}),fH=(e,t)=>cn({name:t,primitiveType:lB,kind:e}),Rx=(e,t)=>cn({name:t,primitiveType:dB,kind:e}),Px=(e,t)=>cn({name:t,primitiveType:fB,kind:e}),Fx=(e,t)=>cn({name:t,primitiveType:pB,kind:e}),pp=(e,t,n)=>cn({name:t,primitiveType:hB(n),kind:e}),Mx=(e,t,n)=>{let r=n.map((o)=>[o,o]);return pp(e,t,r)},ul=(e,t,n)=>cn({name:t,kind:e,primitiveType:gB(n?.pathType??"either",n?.mustExist),typeName:n?.typeName}),Nx=(e,t,n)=>ul(e,t,{pathType:"directory",typeName:"directory",mustExist:n?.mustExist}),Dx=(e,t,n)=>ul(e,t,{pathType:"file",typeName:"file",mustExist:n?.mustExist}),$x=(e,t)=>cn({name:t,primitiveType:xB,kind:e}),Ux=(e,t)=>cn({name:t,primitiveType:NI,kind:e}),Lx=(e,t,n)=>cn({name:t,primitiveType:DI(n),kind:e}),jx=(e,t,n,r)=>cn({name:t,primitiveType:yB(n,r),kind:e}),dH=(e,t)=>dc(hc(cn({name:t,primitiveType:SB,kind:e}),{min:1}),(n)=>Object.fromEntries(n.flatMap(Object.entries))),Bx=(e)=>cn({name:"__none__",primitiveType:EB,kind:e}),Gre,pH,Hx,mH=(e)=>zs(e,(t)=>cn({...t,hidden:!0})),dc,pc=(e,t,n=[])=>{let r=n.map((o)=>()=>o().parse);return Object.assign(Object.create(dp),{_tag:"Transform",kind:e.kind,param:e,alternatives:n,f:t,parse:t(e.parse,r)})},mc,qx,lc=(e)=>{let t=H(function*(n){return gc(e),yield*e.parse(n).pipe(oe(([r,o])=>[r,_(o)]),Ub({MissingOption:()=>v([n.arguments,O()]),MissingArgument:()=>v([n.arguments,O()])}))});return Object.assign(Object.create(dp),{_tag:"Optional",kind:e.kind,param:e,parse:t})},zx,Wx,Kx,hc=(e,t)=>{let n=gc(e),r=(o)=>{if(n.kind==="argument")return Yre(e,n,o,t);else return Qre(e,n,o,t)};return Object.assign(Object.create(dp),{_tag:"Variadic",kind:e.kind,param:e,min:ns(t?.min),max:ns(t?.max),parse:r})},Vx,Gx,Jx,mp,Zx,Yx,Qx,Xx,ey,Jre,Zre,Yre,Qre,QI=(e,t)=>{let n=e;switch(n._tag){case"Single":return t.Single(n);case"Map":return t.Map(n);case"Transform":return t.Transform(n);case"Optional":return t.Optional(n);case"Variadic":return t.Variadic(n)}},zs=(e,t)=>QI(e,{Single:(n)=>t(n),Map:(n)=>dc(zs(n.param,t),n.f),Transform:(n)=>pc(zs(n.param,t),n.f,n.alternatives.map((r)=>()=>zs(r(),t))),Optional:(n)=>lc(zs(n.param,t)),Variadic:(n)=>hc(zs(n.param,t),{min:mn(n.min),max:mn(n.max)})}),ct=(e)=>QI(e,{Single:(t)=>[t],Map:(t)=>ct(t.param),Transform:(t)=>[...ct(t.param),...t.alternatives.flatMap((n)=>ct(n()))],Optional:(t)=>ct(t.param),Variadic:(t)=>ct(t.param)}),gc=(e)=>{let t=ct(e);if(t.length===0)throw Error("No Single param found in param structure");if(t.length>1)throw Error(`Multiple Single params found: ${t.map((n)=>n.name).join(", ")}`);return t[0]},er=(e)=>QI(e,{Single:()=>({isOptional:!1,isVariadic:!1,variadicMin:O(),variadicMax:O()}),Map:(t)=>er(t.param),Transform:(t)=>er(t.param),Optional:(t)=>({...er(t.param),isOptional:!0}),Variadic:(t)=>({...er(t.param),isVariadic:!0,variadicMin:t.min,variadicMax:t.max})});var zo=w(()=>{_I();Oe();X();_e();Qe();he();gn();Xa();ip();il();Ox();dp={[lH]:{_A:D},pipe(){return le(this,arguments)}},Gre=/^-+/,pH=p(2,(e,t)=>zs(e,(n)=>cn({...n,aliases:[...n.aliases,t.replace(Gre,"")]}))),Hx=p(2,(e,t)=>zs(e,(n)=>cn({...n,description:_(t)}))),dc=p(2,(e,t)=>{let n=(r)=>oe(e.parse(r),([o,s])=>[o,t(s)]);return Object.assign(Object.create(dp),{_tag:"Map",kind:e.kind,param:e,f:t,parse:n})}),mc=p(2,(e,t)=>pc(e,(n)=>(r)=>ne(n(r),([o,s])=>t(s).pipe(oe((i)=>[o,i]))))),qx=p(3,(e,t,n)=>{let r=gc(e);return pc(e,(o)=>(s)=>ne(o(s),([i,a])=>Nt({try:()=>t(a),catch:(c)=>n(c)}).pipe(Pt((c)=>new $n({option:r.name,value:String(a),expected:c,kind:r.kind})),oe((c)=>[i,c]))))}),zx=p(2,(e,t)=>{if(!zn(t))return dc(lc(e),mt(()=>t));return mc(lc(e),et({onNone:()=>t,onSome:v}))}),Wx=p(2,(e,t)=>{let n=(o,s)=>new $n({option:o._tag==="MissingOption"?o.option:o.argument,value:"config",expected:s.message,kind:o._tag==="MissingOption"?"flag":"argument"}),r=(o,s)=>Wj(t).pipe(Pt((i)=>n(o,i)),ne(et({onNone:()=>A(o),onSome:(i)=>v([s.arguments,i])})));return pc(e,(o)=>(s)=>o(s).pipe(gs(["MissingOption","MissingArgument"],(i)=>r(i,s))))}),Kx=p(2,(e,t)=>{let n=(r,o)=>ne($B(t)?v(t):t,vn).pipe(oe((s)=>[o.arguments,s]),gs("QuitError",()=>A(r)));return pc(e,(r)=>(o)=>r(o).pipe(gs(["MissingOption","MissingArgument"],(s)=>n(s,o))))}),Vx=p(3,(e,t,n)=>{if(t<0)throw Error("between: min must be non-negative");if(n<t)throw Error("between: max must be greater than or equal to min");return hc(e,{min:t,max:n})}),Gx=p(2,(e,t)=>{if(t<0)throw Error("atMost: max must be non-negative");return hc(e,{max:t})}),Jx=p(2,(e,t)=>{if(t<0)throw Error("atLeast: min must be non-negative");return hc(e,{min:t})}),mp=p(3,(e,t,n)=>mc(e,H(function*(r){let o=t(r);if(Ee(o))return o.value;let s=gc(e);return yield*new $n({option:s.name,value:String(r),expected:n(r),kind:s.kind})}))),Zx=p(3,(e,t,n)=>mp(e,Yy(t),n)),Yx=p(2,(e,t)=>zs(e,(n)=>cn({...n,typeName:t}))),Qx=p(2,(e,t)=>{let n=Us(t);return mc(e,(r)=>Pt(n(r),(o)=>{let s=gc(e);return new $n({option:s.name,value:String(r),expected:`Schema validation failed: ${o.message}`,kind:s.kind})}))}),Xx=p(2,(e,t)=>pc(e,(n,r)=>(o)=>Pr(n(o),()=>r[0]()(o)),[t])),ey=p(2,(e,t)=>pc(e,(n,r)=>(o)=>Pr(oe(n(o),([s,i])=>[s,G(i)]),()=>oe(r[0]()(o),([s,i])=>[s,te(i)])),[t])),Jre=H(function*(e,t,n){if(n.arguments.length===0)return yield*new gx({argument:e});let r=n.arguments[0],o=yield*Pt(t.parse(r),(s)=>new $n({option:e,value:r,expected:s,kind:"argument"}));return[n.arguments.slice(1),o]}),Zre=H(function*(e,t,n){let r=n.flags[e];if(r===void 0||r.length===0)return yield*new sp({option:e});let o=r[0],s=yield*Pt(t.parse(o),(i)=>new $n({option:e,value:o,expected:i,kind:"flag"}));return[n.arguments,s]}),Yre=H(function*(e,t,n,r){let o=[],s=r?.min??0,i=r?.max??Number.POSITIVE_INFINITY,a=0,c=n.arguments;while(c.length>0&&a<i){let[u,l]=yield*e.parse({flags:n.flags,arguments:c});o.push(l),c=u,a++}if(a<s)return yield*new $n({option:t.name,value:`${a} values`,expected:`at least ${s} value${s===1?"":"s"}`,kind:t.kind});return[c,o]}),Qre=H(function*(e,t,n,r){let o=[],i=[t.name,...t.aliases].flatMap((c)=>n.flags[c]??[]),a=i.length;if(Le(r?.min)&&a<r.min)return yield*a===0?new sp({option:t.name}):new $n({option:t.name,value:`${a} occurrences`,expected:`at least ${r.min} value${r.min===1?"":"s"}`,kind:t.kind});if(Le(r?.max)&&a>r.max)return yield*new $n({option:t.name,value:`${a} occurrences`,expected:`at most ${r.max} value${r.max===1?"":"s"}`,kind:t.kind});for(let c of i){let[,u]=yield*e.parse({flags:{[t.name]:[c]},arguments:[]});o.push(u)}return[n.arguments,o]})});var Ki={};Un(Ki,{atLeast:()=>boe,atMost:()=>woe,between:()=>voe,choice:()=>soe,choiceWithValue:()=>Ioe,date:()=>ooe,directory:()=>noe,file:()=>toe,fileParse:()=>uoe,fileSchema:()=>loe,fileText:()=>coe,filter:()=>Toe,filterMap:()=>Ooe,float:()=>roe,integer:()=>eoe,map:()=>yoe,mapEffect:()=>Soe,mapTryCatch:()=>Eoe,none:()=>foe,optional:()=>doe,orElse:()=>Aoe,orElseResult:()=>_oe,path:()=>ioe,redacted:()=>aoe,string:()=>Xre,variadic:()=>xoe,withDefault:()=>moe,withDescription:()=>poe,withFallbackConfig:()=>hoe,withFallbackPrompt:()=>goe,withMetavar:()=>Coe,withSchema:()=>koe});var Xre=(e)=>_x(Yt,e),eoe=(e)=>Rx(Yt,e),toe=(e,t)=>Dx(Yt,e,t),noe=(e,t)=>Nx(Yt,e,t),roe=(e)=>Px(Yt,e),ooe=(e)=>Fx(Yt,e),soe=(e,t)=>Mx(Yt,e,t),ioe=(e,t)=>ul(Yt,e,t),aoe=(e)=>$x(Yt,e),coe=(e)=>Ux(Yt,e),uoe=(e,t)=>Lx(Yt,e,t),loe=(e,t,n)=>jx(Yt,e,t,n),foe,doe=(e)=>lc(e),poe,moe,hoe,goe,xoe,yoe,Soe,Eoe,boe,woe,voe,koe,Ioe=(e,t)=>pp(Yt,e,t),Coe,Toe,Ooe,Aoe,_oe;var hH=w(()=>{X();zo();foe=Bx(Yt),poe=p(2,(e,t)=>Hx(e,t)),moe=zx,hoe=p(2,(e,t)=>Wx(e,t)),goe=p(2,(e,t)=>Kx(e,t)),xoe=p((e)=>Ax(e[0]),(e,t)=>hc(e,t)),yoe=p(2,(e,t)=>dc(e,t)),Soe=p(2,(e,t)=>mc(e,t)),Eoe=p(3,(e,t,n)=>qx(e,t,n)),boe=p(2,(e,t)=>Jx(e,t)),woe=p(2,(e,t)=>Gx(e,t)),voe=p(3,(e,t,n)=>Vx(e,t,n)),koe=p(2,(e,t)=>Qx(e,t)),Coe=p(2,(e,t)=>Yx(e,t)),Toe=p(3,(e,t,n)=>Zx(e,t,n)),Ooe=p(3,(e,t,n)=>mp(e,t,n)),Aoe=p(2,(e,t)=>Xx(e,t)),_oe=p(2,(e,t)=>ey(e,t))});var Roe,gH=(e)=>ce((t)=>e(t.getRef(Roe))),XI=(...e)=>gH((t)=>pe(()=>{t.error(...e)})),un=(...e)=>gH((t)=>pe(()=>{t.log(...e)}));var ty=w(()=>{rt();ht();Roe=HE});var ll,ny=(e)=>e.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,(t)=>`\\x${t.charCodeAt(0).toString(16).padStart(2,"0")}`),Poe=(e)=>{let t=globalThis.process,n=typeof t==="object"&&t!==null,r=e?.colors!==void 0?e.colors:n&&typeof t.stdout==="object"&&t.stdout!==null&&t.stdout.isTTY===!0&&t.env?.NO_COLOR!=="1",o=r?{bold:(c)=>`\x1B[1m${c}\x1B[0m`,dim:(c)=>`\x1B[2m${c}\x1B[0m`,cyan:(c)=>`\x1B[36m${c}\x1B[0m`,green:(c)=>`\x1B[32m${c}\x1B[0m`,blue:(c)=>`\x1B[34m${c}\x1B[0m`,yellow:(c)=>`\x1B[33m${c}\x1B[0m`,magenta:(c)=>`\x1B[35m${c}\x1B[0m`}:{bold:(c)=>c,dim:(c)=>c,cyan:(c)=>c,green:(c)=>c,blue:(c)=>c,yellow:(c)=>c,magenta:(c)=>c},s=r?"\x1B[0m":"",i=r?"\x1B[31m":"",a=r?"\x1B[1m":"";return{formatHelpDoc:(c)=>Noe(c,o),formatCliError:(c)=>ny(c.message),formatError:(c)=>`
|
|
76
|
+
`)}`:"";return this.parent?`Unknown subcommand "${this.subcommand}" for "${this.parent.join(" ")}"${e}`:`Unknown subcommand "${this.subcommand}"${e}`}};d_=class d_ extends Nn(`${Qe}/UserError`)("UserError",{cause:wv(),userMessage:xv(V)}){[Qe]=Qe;[Oi]=!0;get message(){if(this.userMessage)return this.userMessage;if(typeof this.cause==="string"&&this.cause)return this.cause;if(this.cause instanceof Error&&this.cause.message)return this.cause.message;return"An error occurred"}};HW=hn([Mi,Ip,Pu,Fp,Up,Sn,Dp,d_]);Ls=class Ls extends Nn(`${Qe}/ShowHelp`)("ShowHelp",{commandPath:Ae(V),errors:Ae(HW)}){[Qe]=Qe;[Kf]=this.errors.length?1:0;[Oi]=!1;get message(){return"Help requested"}}});var JW="~effect/cli/Primitive",KW,p_,h_,Np=(e)=>e._tag==="Boolean",dy=(e,t)=>Object.assign(Object.create(KW),{_tag:e,parse:t}),eL=(e,t)=>{let r=Ug(t),n=ru(r);return dy(e,(o)=>cn(n(o),(s)=>s.message))},m_,O_,g_=(e)=>{let t=new Map(e),r=e.map(([o])=>he(o)).join(" | "),n=dy("Choice",(o)=>{if(t.has(o))return T(t.get(o));return N(r)});return Object.assign(n,{choiceKeys:e.map(([o])=>o)})},Tu=(e)=>{switch(e._tag){case"Boolean":return"boolean";case"String":return"string";case"Integer":return"integer";case"Float":return"number";case"Date":return"date";case"Path":return"path";case"Choice":return"choice";case"Redacted":return"string";case"FileText":return"file";case"FileParse":return"file";case"FileSchema":return"file";case"KeyValuePair":return"key=value";case"None":return"none";default:return"value"}},Xo=(e)=>e._tag==="Choice"?e.choiceKeys:void 0,py=(e)=>e._tag==="Path"?e.pathType:void 0;var dc=E(()=>{f_();ae();on();oe();Ba();KW={[JW]:{_A:B}},p_=Qg(ly),h_=Qg(uy),m_=eL("Boolean",u_),O_=dy("String",(e)=>T(e))});var jo="\x1B[1m",x_="\x1B[3m",Ni="\x1B[4m",y_="\x1B[9m",S_="\x1B[?25h",Cu="\x1B[?25l",Zi="\x1B[G",Zp="\x1B[s",qp="\x1B[u",zs="\x1B[2K",E_="\x07",Wp="\x1B[31m",Lp="\x1B[32m",b_="\x1B[35m",qi="\x1B[37m",Qu="\x1B[90m",pc="\x1B[96m",De=(e,...t)=>`${t.flat().join("")}${e}\x1B[0m`,Gn=(...e)=>e,k_=(e,t)=>{if(t===void 0)return`\x1B[${Math.max(e+1,0)}G`;return`\x1B[${t+1};${Math.max(e+1,0)}H`},P_=(e=1)=>`\x1B[${e}B`,w_=(e,t=0)=>{let r="";if(t<0)r+=`\x1B[${-t}A`;if(t>0)r+=`\x1B[${t}B`;if(e>0)r+=`\x1B[${e}C`;if(e<0)r+=`\x1B[${-e}D`;return r},T_=(e)=>{let t="";for(let r=0;r<e;r++)t+="\x1B[2K"+(r<e-1?"\x1B[1A":"");if(e>0)t+="\x1B[G";return t};class Yn{token;date;parts;locales;constructor(e){this.token=e.token,this.locales=e.locales,this.date=e.date||new Date,this.parts=e.parts||[this]}isToken(){return!1}nextPart(){let e=bt(Bh(this.parts,(t)=>t===this),()=>0);return mE(this.parts.slice(e+1),(t)=>!t.isToken())}previousPart(){let e=Bh(this.parts,(t)=>t===this);if(tt(e))return OE(this.parts.slice(0,e.value),(t)=>!t.isToken());return L()}toString(){return String(this.date)}}var tL="~effect/cli/Prompt",R_,rL,nL=(e)=>({...process.platform==="win32"?rL:R_,...e}),oL,Rt=(e)=>K(oL,(t)=>({...t,...e.theme})),sL=(e)=>De(e,jo),my=(e,t)=>De(e,Gn(x_,t)),xe=(e,...t)=>e.length===0?"":De(e,...t),Xs=(e,t)=>e.length===0?t:e+" "+t,iL=(e,t,r)=>{let n=Math.max(e.arrowUp.length,e.arrowDown.length);if(t)return e.arrowUp.padEnd(n);if(r)return e.arrowDown.padEnd(n);return" ".repeat(n)},Oy=(e)=>{let t={initial:!1,...e,label:{confirm:"yes",deny:"no",...e.label},placeholder:{defaultConfirm:"(Y/n)",defaultDeny:"(y/N)",...e.placeholder}},r={value:t.initial};return Wi(r,{render:OL(t),process:(n)=>yL(n,t.initial),clear:pL(t)})},Wi=(e,...t)=>{let[r,n]=t.length===1?[void 0,t[0]]:[t[0],t[1]],o=Object.create(yy);return o._tag="Loop",o.initialState=e,o.render=n.render,o.process=n.process,o.clear=n.clear,o.events=r,o},I_=(e)=>{let t={initial:new Date,dateMask:"YYYY-MM-DD HH:mm:ss",validate:T,...e,locales:{..._L,...e.locales}},r=IL(t.dateMask,t.initial,t.locales),n=r.findIndex((s)=>!s.isToken()),o={dateParts:r,typed:"",cursor:n,value:t.initial,error:L()};return Wi(o,{render:$L(t),process:AL(t),clear:SL(t)})},aL,F_=(e)=>{let t={default:0,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY,incrementBy:1,decrementBy:1,precision:2,validate:(o)=>{if(o<t.min)return N(`${o} must be greater than or equal to ${t.min}`);if(o>t.max)return N(`${o} must be less than or equal to ${t.max}`);return T(o)},...e},r=e.default===void 0?"":`${t.default}`,n={cursor:r.length,value:r,error:L()};return Wi(n,{render:qL(t),process:WL(t),clear:B_(t)})},gy=(e)=>{let t={default:0,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY,incrementBy:1,decrementBy:1,validate:(o)=>{if(o<t.min)return N(`${o} must be greater than or equal to ${t.min}`);if(o>t.max)return N(`${o} must be less than or equal to ${t.max}`);return T(o)},...e},r=e.default===void 0?"":`${t.default}`,n={cursor:r.length,value:r,error:L()};return Wi(n,{render:NL(t),process:ZL(t),clear:B_(t)})},cL,U_=(e)=>r$(e,"password").pipe(cL(fv)),Or,lL=(e)=>{let t=0,r=-1;for(let n=0;n<e.length;n++)if(e[n].selected===!0){if(r!==-1)throw Error("InvalidArgumentException: only a single choice can be selected by default for Prompt.select");r=n}if(r!==-1)t=r;return t},xy=(e)=>{let t={maxPerPage:10,...e},r=lL(t.choices);return Wi(r,{render:YL(t),process:JL(t),clear:HL(t)})},uL=(e)=>{let t=Object.create(yy);return t._tag="Succeed",t.value=e,t},D_=(e)=>r$(e,"text"),M_=(e)=>{let t={initial:!1,active:"on",inactive:"off",...e};return Wi(t.initial,{render:mz(t),process:Oz,clear:()=>dz(t)})},yy,hy=(e,t,r)=>Ee(()=>{let n=e;switch(n._tag){case"Loop":return fL(n,t,r);case"OnSuccess":return H(hy(n.prompt,t,r),(o)=>hy(n.onSuccess(o),t,r));case"Succeed":return T(n.value)}}),fL,Z,hc=(e,t)=>{if(t===0)return zs+k_(0);let r=0,n=e.split(zi);for(let o of n)r+=1+Math.floor(Math.max(o.length-1,0)/t);return T_(r)},dL=(e,t)=>{let r=e.split(zi);return t===0?r.length:Ho(Sr(r,(n)=>Math.ceil(n.length/t)),sf(0,(n,o)=>n+o))},Sy=(e,t,r)=>{if(r!==void 0&&r.length>0)return P_(dL(r,t))+hc(`
|
|
77
|
+
${r}`,t)+hc(e,t);return hc(e,t)},Li,zi,pL=(e)=>z(function*(t,r){let o=yield*(yield*mn).columns,s=yield*Rt(e),i=t.value?e.placeholder.defaultConfirm:e.placeholder.defaultDeny,a=Ey(i,s.prefix,s.pointerSmall,e,{plain:!0}),c=hc(a,o),l=zs+Zi;return c+l}),Ey=(e,t,r,n,o)=>Xi(e,n.message,t,r,o),hL,mL,OL=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>hL(n,e),Submit:({value:n})=>mL(n,e)}),gL,xL,yL=(e,t)=>{let r=bt(e.input,()=>"");if(e.key.name==="enter"||e.key.name==="return")return T(Z.Submit({value:t}));if(gL.test(r.toLowerCase()))return T(Z.Submit({value:!0}));if(xL.test(r.toLowerCase()))return T(Z.Submit({value:!1}));return T(Z.Beep())},SL=(e)=>z(function*(t,r){let o=yield*(yield*mn).columns,s=yield*Rt(e),i=zs+Zi,a=sf(t.dateParts,"",(f,d)=>f+d.toString()),c=by(s.prefix,s.pointerSmall,a,e,{plain:!0}),l=tt(t.error)?Xc(t.error.value.split(zi),{onEmpty:()=>"",onNonEmpty:(f)=>Xs(s.pointerSmall,f.join(`
|
|
78
|
+
`))}):"";return Sy(c,o,l)+i}),EL=(e,t,r)=>{if(tt(e.error)){let n=e.error.value.split(zi);if(Qn(n)){let o=xe(t,r.errorColor),s=Sr(n,(i)=>my(i,r.errorColor));return Zp+`
|
|
79
|
+
`+Xs(o,s.join(`
|
|
80
|
+
`))+qp}}return""},N_=(e,t,r=!1)=>sf(e.dateParts,"",(n,o,s)=>{let i=o.toString();if(s===e.cursor&&!r){let a=Gn(Ni,t.primaryColor);return n+De(i,a)}return n+i}),by=(e,t,r,n,o)=>Xi(r,n.message,e,t,o),bL,kL,PL=(e)=>(e.dateParts[e.cursor].increment(),Z.NextFrame({state:{...e,typed:""}})),wL=(e)=>(e.dateParts[e.cursor].decrement(),Z.NextFrame({state:{...e,typed:""}})),TL=(e)=>{let t=e.dateParts[e.cursor].previousPart();if(tt(t))return Z.NextFrame({state:{...e,typed:"",cursor:e.dateParts.indexOf(t.value)}});return Z.Beep()},vL=(e)=>{let t=e.dateParts[e.cursor].nextPart();if(tt(t))return Z.NextFrame({state:{...e,typed:"",cursor:e.dateParts.indexOf(t.value)}});return Z.Beep()},CL=(e)=>{let t=e.dateParts[e.cursor].nextPart(),r=er(t,{onNone:()=>e.dateParts.findIndex((n)=>!n.isToken()),onSome:(n)=>e.dateParts.indexOf(n)});return Z.NextFrame({state:{...e,cursor:r}})},QL=(e,t)=>{if(/\d/.test(e)){let r=t.typed+e;return t.dateParts[t.cursor].setValue(r),Z.NextFrame({state:{...t,typed:r}})}return Z.Beep()},_L,$L=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>bL(n,e),Submit:()=>kL(t,e)}),AL=(e)=>(t,r)=>{switch(t.key.name){case"left":return T(TL(r));case"right":return T(vL(r));case"k":case"up":return T(PL(r));case"j":case"down":return T(wL(r));case"tab":return T(CL(r));case"enter":case"return":return va(e.validate(r.value),{onFailure:(n)=>Z.NextFrame({state:{...r,error:ee(n)}}),onSuccess:(n)=>Z.Submit({value:n})});default:return T(QL(bt(t.input,()=>""),r))}},RL,C_,IL=(e,t,r)=>{let n=[],o=null;while(o=RL.exec(e)){let i=o.shift(),a=o.findIndex((c)=>c!==void 0);if(a in C_){let c=o[a]||i;n.push(C_[a]({token:c,date:t,parts:n,locales:r}))}else n.push(new ky({token:o[a]||i,date:t,parts:n,locales:r}))}let s=n.reduce((i,a)=>{let c=i[i.length-1];if(a.isToken()&&c!==void 0&&c.isToken())c.setValue(a.token);else i.push(a);return i},ti());return n.splice(0,n.length,...s),n},ky,Z_,q_,W_,L_,z_,X_,j_,V_,Xi=(e,t,r,n,o)=>{let s=r.length===0?"":r+" ",i=(c)=>{let l=s+c;if(n.length>0)l+=" "+n;if(e.length>0)l+=" "+e;else if(n.length>0)l+=" ";return l},a=o?.plain===!0?(c)=>c:sL;return Xc(t.split(zi),{onEmpty:()=>i(""),onNonEmpty:(c)=>{let l=Sr(c,(u)=>a(u));return i(l.join(`
|
|
81
|
+
`))}})},FL=(e,t,r,n)=>{if(!e.disabled&&e.description&&t){let o=r.descriptionSeparator+e.description;return n?.plain===!0?o:De(o,r.mutedColor)}return""},B_=(e)=>z(function*(t,r){let o=yield*(yield*mn).columns,s=yield*Rt(e),i=zs+Zi,a=G_(t,s.pointerSmall,s,{plain:!0}),c=Py(t,s.prefix,s.pointerSmall,e,s,{plain:!0});return Sy(c,o,a)+i}),UL=(e,t,r,n)=>{let o=e.value===""?"":`${e.value}`;if(t||n?.plain===!0)return o;let s=tt(e.error)?r.errorColor:Gn(Ni,r.primaryColor);return De(o,s)},G_=(e,t,r,n)=>{if(tt(e.error))return Xc(e.error.value.split(zi),{onEmpty:()=>"",onNonEmpty:(o)=>{if(n?.plain===!0)return Xs(t,o.join(`
|
|
82
|
+
`));let s=xe(t,r.errorColor),i=Sr(o,(a)=>my(a,r.errorColor));return Zp+`
|
|
83
|
+
`+Xs(s,i.join(`
|
|
84
|
+
`))+qp}});return""},Py=(e,t,r,n,o,s,i=!1)=>{let a=UL(e,i,o,s);return Xi(a,n.message,t,r,s)},Y_,H_,J_=(e)=>{if(e.value.length<=0)return T(Z.Beep());let t=e.value.slice(0,e.value.length-1);return T(Z.NextFrame({state:{...e,value:t,error:L()}}))},K_=(e)=>T(Z.NextFrame({state:{...e,cursor:0,value:"",error:L()}})),DL=(e,t)=>{if(t.value.length===0&&e==="-")return T(Z.NextFrame({state:{...t,value:"-",error:L()}}));let r=Number.parseInt(t.value+e);if(Number.isNaN(r))return T(Z.Beep());else return T(Z.NextFrame({state:{...t,value:`${r}`,error:L()}}))},ML=(e,t)=>{if(e==="."&&t.value.includes("."))return T(Z.Beep());if(t.value.length===0&&e==="-")return T(Z.NextFrame({state:{...t,value:"-",error:L()}}));let r=Number.parseFloat(t.value+e);if(Number.isNaN(r))return T(Z.Beep());else return T(Z.NextFrame({state:{...t,value:e==="."?`${r}.`:t.value.includes(".")&&/^\d$/.test(e)?t.value+e:`${r}`,error:L()}}))},NL=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>Y_(n,e),Submit:()=>H_(t,e)}),ZL=(e)=>(t,r)=>{if(t.key.ctrl&&t.key.name==="u")return K_(r);switch(t.key.name){case"backspace":return J_(r);case"k":case"up":return T(Z.NextFrame({state:{...r,value:r.value===""||r.value==="-"?`${e.incrementBy}`:`${Number.parseInt(r.value)+e.incrementBy}`,error:L()}}));case"j":case"down":return T(Z.NextFrame({state:{...r,value:r.value===""||r.value==="-"?`-${e.decrementBy}`:`${Number.parseInt(r.value)-e.decrementBy}`,error:L()}}));case"enter":case"return":{let n=Number.parseInt(r.value);if(Number.isNaN(n))return T(Z.NextFrame({state:{...r,error:ee("Must provide an integer value")}}));else return va(e.validate(n),{onFailure:(o)=>Z.NextFrame({state:{...r,error:ee(o)}}),onSuccess:(o)=>Z.Submit({value:o})})}default:return DL(bt(t.input,()=>""),r)}},qL=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>Y_(n,e),Submit:()=>H_(t,e)}),WL=(e)=>(t,r)=>{if(t.key.ctrl&&t.key.name==="u")return K_(r);switch(t.key.name){case"backspace":return J_(r);case"k":case"up":return T(Z.NextFrame({state:{...r,value:r.value===""||r.value==="-"?`${e.incrementBy}`:`${Number.parseFloat(r.value)+e.incrementBy}`,error:L()}}));case"j":case"down":return T(Z.NextFrame({state:{...r,value:r.value===""||r.value==="-"?`-${e.decrementBy}`:`${Number.parseFloat(r.value)-e.decrementBy}`,error:L()}}));case"enter":case"return":{let n=Number.parseFloat(r.value);if(Number.isNaN(n))return T(Z.NextFrame({state:{...r,error:ee("Must provide a floating point value")}}));else return H(ne(()=>kk(n,e.precision)),(o)=>va(e.validate(o),{onFailure:(s)=>Z.NextFrame({state:{...r,error:ee(s)}}),onSuccess:(s)=>Z.Submit({value:s})}))}default:return ML(bt(t.input,()=>""),r)}},wy=(e,t,r,n)=>Xi("",r.message,e,t,n),LL=(e,t,r,n,o,s)=>{let i=iL(o,n===r.startIndex&&r.startIndex>0,n===r.endIndex-1&&r.endIndex<t.length);if(s?.plain===!0)return e===n?o.pointer+i:i+" ".repeat(o.pointer.length);if(t[n].disabled){let a=Gn(jo,o.mutedColor);return e===n?xe(o.pointer,a)+i:i+" ".repeat(o.pointer.length)}return e===n?xe(o.pointer,o.primaryColor)+i:i+" ".repeat(o.pointer.length)},zL=(e,t,r,n)=>{if(n?.plain===!0)return e.title;let o=e.title;if(t)return e.disabled?De(o,Gn(Ni,r.mutedColor)):De(o,Gn(Ni,r.primaryColor));return e.disabled?De(o,Gn(y_,r.mutedColor)):o},e$=(e,t,r,n)=>{let o=t.choices,s=gz(e,o.length,t.maxPerPage),i=[];for(let a=s.startIndex;a<s.endIndex;a++){let c=o[a],l=e===a,u=LL(e,o,s,a,r,n),f=zL(c,l,r,n),d=FL(c,l,r,n);i.push(u+f+" "+d)}return i.join(`
|
|
85
|
+
`)},XL,jL,VL=(e,t)=>{if(e===0)return T(Z.NextFrame({state:t.length-1}));return T(Z.NextFrame({state:e-1}))},BL=(e,t)=>{if(e===t.length-1)return T(Z.NextFrame({state:0}));return T(Z.NextFrame({state:e+1}))},GL=(e,t)=>T(Z.NextFrame({state:(e+1)%t.length})),YL=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>XL(n,e),Submit:()=>jL(t,e)}),HL=(e)=>z(function*(t,r){let o=yield*(yield*mn).columns,s=yield*Rt(e),i=zs+Zi,a=wy(s.prefix,s.pointerSmall,e,{plain:!0}),c=e$(t,e,s,{plain:!0});return hc(`${a}
|
|
86
|
+
${c}`,o)+i}),JL=(e)=>(t,r)=>{switch(t.key.name){case"k":case"up":return VL(r,e.choices);case"j":case"down":return BL(r,e.choices);case"tab":return GL(r,e.choices);case"enter":case"return":{let n=e.choices[r];if(n.disabled)return T(Z.Beep());return T(Z.Submit({value:n.value}))}default:return T(Z.Beep())}},KL,ez=(e,t,r,n,o)=>{let s=e.value;if(o?.plain===!0)switch(t.type){case"hidden":return"";case"password":return r.passwordMask.repeat(s.length);case"text":return s}if(s.length===0)return"";let i=tt(e.error)?r.errorColor:n?r.submittedColor:Gn(Ni,r.primaryColor);switch(t.type){case"hidden":return"";case"password":return xe(r.passwordMask.repeat(s.length),i);case"text":return De(s,i)}},t$=(e,t,r,n)=>{if(tt(e.error))return Xc(e.error.value.split(zi),{onEmpty:()=>"",onNonEmpty:(o)=>{if(n?.plain===!0)return Xs(t,o.join(`
|
|
87
|
+
`));let s=xe(t,r.errorColor),i=Sr(o,(a)=>my(a,r.errorColor));return Zp+`
|
|
88
|
+
`+Xs(s,i.join(`
|
|
89
|
+
`))+qp}});return""},Ty=(e,t,r,n,o,s,i=!1)=>{let a=ez(e,n,o,i,s);return Xi(a,n.message,t,r,s)},tz,rz,nz=(e)=>{if(e.cursor<=0)return T(Z.Beep());let t=e.value.slice(0,e.cursor-1),r=e.value.slice(e.cursor),n=e.cursor-1,o=`${t}${r}`;return T(Z.NextFrame({state:{...e,cursor:n,value:o,error:L()}}))},oz=(e)=>T(Z.NextFrame({state:{...e,cursor:0,value:"",error:L()}})),sz=(e)=>{if(e.cursor<=0)return T(Z.Beep());let t=e.cursor-1;return T(Z.NextFrame({state:{...e,cursor:t,error:L()}}))},iz=(e)=>{if(e.cursor>=e.value.length)return T(Z.Beep());let t=Math.min(e.cursor+1,e.value.length);return T(Z.NextFrame({state:{...e,cursor:t,error:L()}}))},Q_=(e)=>T(Z.NextFrame({state:{...e,cursor:0,error:L()}})),__=(e)=>T(Z.NextFrame({state:{...e,cursor:e.value.length,error:L()}})),az=(e,t)=>{if(e.value===t.default)return T(Z.Beep());let r=e.value.length===0?t.default:e.value;return T(Z.NextFrame({state:{...e,value:r,cursor:r.length,error:L()}}))},cz=(e,t)=>{let r=t.value.slice(0,t.cursor),n=t.value.slice(t.cursor),o=`${r}${e}${n}`,s=t.cursor+e.length;return T(Z.NextFrame({state:{...t,cursor:s,value:o,error:L()}}))},lz=(e)=>(t,r)=>Z.$match(r,{Beep:()=>T(Li),NextFrame:({state:n})=>tz(n,e),Submit:()=>rz(t,e)}),uz=(e)=>(t,r)=>{if(t.key.ctrl)switch(t.key.name){case"u":return oz(r);case"a":return Q_(r);case"e":return __(r);default:return T(Z.Beep())}switch(t.key.name){case"backspace":return nz(r);case"left":return sz(r);case"right":return iz(r);case"home":return Q_(r);case"end":return __(r);case"enter":case"return":{let n=r.value;return va(e.validate(n),{onFailure:(o)=>Z.NextFrame({state:{...r,value:n,error:ee(o)}}),onSuccess:(o)=>Z.Submit({value:o})})}case"tab":return az(r,e);default:return cz(bt(t.input,()=>""),r)}},fz=(e)=>(t,r)=>KL(t,e),r$=(e,t)=>{let r={default:"",type:t,validate:T,...e},n={cursor:r.default.length,value:r.default,error:L()};return Wi(n,{render:lz(r),process:uz(r),clear:fz(r)})},dz,n$=(e,t,r,n=!1)=>{let o=xe(r.toggleSeparator,r.mutedColor),s=Gn(Ni,n?r.submittedColor:r.primaryColor),i=e?t.inactive:De(t.inactive,s);return(e?De(t.active,s):t.active)+" "+Xs(o,i)},o$=(e,t,r,n)=>Xi(e,n.message,t,r),pz,hz,$_,A_,mz=(e)=>(t,r)=>{switch(r._tag){case"Beep":return T(Li);case"NextFrame":return pz(t,e);case"Submit":return hz(t,e)}},Oz=(e,t)=>{switch(e.key.name){case"0":case"j":case"delete":case"right":case"down":return A_;case"1":case"k":case"left":case"up":return $_;case" ":case"tab":return t?A_:$_;case"enter":case"return":return T(Z.Submit({value:t}));default:return T(Z.Beep())}},gz=(e,t,r)=>{let n=r===void 0?t:r,o=Math.min(t-n,e-Math.floor(n/2));if(o<0)o=0;let s=Math.min(o+n,t);return{startIndex:o,endIndex:s}};var vy=E(()=>{_n();lt();ma();ae();la();oe();Pk();ze();kl();vg();ep();R_={prefix:"?",arrowUp:"\u2191",arrowDown:"\u2193",checkboxOn:"\u2612",checkboxOff:"\u2610",tick:"\u2714",ellipsis:"\u2026",pointerSmall:"\u203A",pointer:"\u276F",descriptionSeparator:"- ",passwordMask:"*",toggleSeparator:"/",primaryColor:pc,mutedColor:Qu,successColor:Lp,errorColor:Wp,submittedColor:qi},rL={...R_,checkboxOn:"[*]",checkboxOff:"[ ]",tick:"\u221A",ellipsis:"...",pointerSmall:"\xBB",pointer:">"},oL=Be("effect/unstable/cli/Prompt/Theme",{defaultValue:nL}),aL=v(2,(e,t)=>{let r=Object.create(yy);return r._tag="OnSuccess",r.prompt=e,r.onSuccess=t,r}),cL=v(2,(e,t)=>aL(e,(r)=>uL(t(r)))),Or=z(function*(e){let t=yield*mn,r=yield*t.readInput;return yield*hy(e,t,r)},cn(()=>new su({})),mi),yy={...Pn({label:"Prompt",evaluate(){return Or(this)}}),[tL]:{_Output:(e)=>e}},fL=z(function*(e,t,r){let n=di(e.initialState)?yield*e.initialState:e.initialState,o=Z.NextFrame({state:n});while(!0){let s=yield*e.render(n,o);if(yield*Rn(t.display(s)),e.events){let i=Co(r).pipe(K((c)=>({_tag:"Input",input:c}))),a=yield*Ta(i,Co(e.events).pipe(K((c)=>({_tag:"Event",value:c}))));o=yield*e.process(a,n)}else{let i=yield*Co(r);o=yield*e.process(i,n)}switch(o._tag){case"Beep":continue;case"NextFrame":{yield*Rn(t.display(yield*e.clear(n,o))),n=o.state;continue}case"Submit":{yield*Rn(t.display(yield*e.clear(n,o)));let i=yield*e.render(n,o);return yield*Rn(t.display(i)),o.value}}}},(e,t,r)=>hl(e,Rn(r.display(S_)))),Z=UE(),Li=E_,zi=/\r?\n/,hL=z(function*(e,t){let r=yield*Rt(t),n=xe(r.prefix,r.primaryColor),o=xe(r.pointerSmall,r.mutedColor),s=e.value?t.placeholder.defaultConfirm:t.placeholder.defaultDeny,i=De(s,r.mutedColor),a=Ey(i,n,o,t);return Cu+a}),mL=z(function*(e,t){let r=yield*Rt(t),n=xe(r.tick,r.successColor),o=xe(r.ellipsis,r.mutedColor),s=e?t.label.confirm:t.label.deny;return Ey(s,n,o,t)+`
|
|
90
|
+
`}),gL=/^y|t$/,xL=/^n|f$/,bL=z(function*(e,t){let r=yield*Rt(t),n=xe(r.prefix,r.primaryColor),o=xe(r.pointerSmall,r.mutedColor),s=N_(e,r),i=by(n,o,s,t),a=EL(e,r.pointerSmall,r);return Cu+i+a}),kL=z(function*(e,t){let r=yield*Rt(t),n=xe(r.tick,r.successColor),o=xe(r.ellipsis,r.mutedColor),s=N_(e,r,!0);return by(n,o,s,t)+`
|
|
91
|
+
`}),_L={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},RL=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,C_={1:({token:e,...t})=>new ky({token:e.replace(/\\(.)/g,"$1"),...t}),2:(e)=>new z_(e),3:(e)=>new X_(e),4:(e)=>new j_(e),5:(e)=>new V_(e),6:(e)=>new L_(e),7:(e)=>new W_(e),8:(e)=>new q_(e),9:(e)=>new Z_(e)};ky=class ky extends Yn{increment(){}decrement(){}setValue(e){this.token=this.token+e}isToken(){return!0}toString(){return this.token}};Z_=class Z_ extends Yn{increment(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}decrement(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setValue(e){this.date.setMilliseconds(Number.parseInt(e.slice(-this.token.length)))}toString(){return`${this.date.getMilliseconds()}`.padStart(4,"0").substring(0,this.token.length)}};q_=class q_ extends Yn{increment(){this.date.setSeconds(this.date.getSeconds()+1)}decrement(){this.date.setSeconds(this.date.getSeconds()-1)}setValue(e){this.date.setSeconds(Number.parseInt(e.slice(-2)))}toString(){let e=`${this.date.getSeconds()}`;return this.token.length>1?e.padStart(2,"0"):e}};W_=class W_ extends Yn{increment(){this.date.setMinutes(this.date.getMinutes()+1)}decrement(){this.date.setMinutes(this.date.getMinutes()-1)}setValue(e){this.date.setMinutes(Number.parseInt(e.slice(-2)))}toString(){let e=`${this.date.getMinutes()}`;return this.token.length>1?e.padStart(2,"0"):e}};L_=class L_ extends Yn{increment(){this.date.setHours(this.date.getHours()+1)}decrement(){this.date.setHours(this.date.getHours()-1)}setValue(e){this.date.setHours(Number.parseInt(e.slice(-2)))}toString(){let e=/h/.test(this.token)?this.date.getHours()%12||12:this.date.getHours();return this.token.length>1?`${e}`.padStart(2,"0"):`${e}`}};z_=class z_ extends Yn{increment(){this.date.setDate(this.date.getDate()+1)}decrement(){this.date.setDate(this.date.getDate()-1)}setValue(e){this.date.setDate(Number.parseInt(e.slice(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();switch(this.token){case"DD":return`${e}`.padStart(2,"0");case"Do":return`${e}${this.ordinalIndicator(e)}`;case"d":return`${t+1}`;case"ddd":return this.locales.weekdaysShort[t];case"dddd":return this.locales.weekdays[t];default:return`${e}`}}ordinalIndicator(e){if(e>=11&&e<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}};X_=class X_ extends Yn{increment(){this.date.setMonth(this.date.getMonth()+1)}decrement(){this.date.setMonth(this.date.getMonth()-1)}setValue(e){let t=Number.parseInt(e.slice(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let e=this.date.getMonth();switch(this.token.length){case 2:return`${e+1}`.padStart(2,"0");case 3:return this.locales.monthsShort[e];case 4:return this.locales.months[e];default:return`${e+1}`}}};j_=class j_ extends Yn{increment(){this.date.setFullYear(this.date.getFullYear()+1)}decrement(){this.date.setFullYear(this.date.getFullYear()-1)}setValue(e){this.date.setFullYear(Number.parseInt(e.slice(-4)))}toString(){let e=`${this.date.getFullYear()}`.padStart(4,"0");return this.token.length===2?e.slice(-2):e}};V_=class V_ extends Yn{increment(){this.date.setHours((this.date.getHours()+12)%24)}decrement(){this.increment()}setValue(e){}toString(){let e=this.date.getHours()>=12?"pm":"am";return/A/.test(this.token)?e.toUpperCase():e}};Y_=z(function*(e,t){let r=yield*Rt(t),n=xe(r.prefix,r.primaryColor),o=xe(r.pointerSmall,r.mutedColor),s=G_(e,r.pointerSmall,r);return Py(e,n,o,t,r)+s}),H_=z(function*(e,t){let r=yield*Rt(t),n=xe(r.tick,r.successColor),o=xe(r.ellipsis,r.mutedColor);return Py(e,n,o,t,r,void 0,!0)+`
|
|
92
|
+
`}),XL=z(function*(e,t){let r=yield*Rt(t),n=e$(e,t,r),o=xe(r.prefix,r.primaryColor),s=xe(r.pointerSmall,r.mutedColor),i=wy(o,s,t);return Cu+i+`
|
|
93
|
+
`+n}),jL=z(function*(e,t){let r=yield*Rt(t),n=t.choices[e].title,o=xe(r.tick,r.successColor),s=xe(r.ellipsis,r.mutedColor);return wy(o,s,t)+" "+De(n,r.submittedColor)+`
|
|
94
|
+
`}),KL=z(function*(e,t){let n=yield*(yield*mn).columns,o=yield*Rt(t),s=zs+Zi,i=t$(e,o.pointerSmall,o,{plain:!0});return Sy(Ty(e,o.prefix,o.pointerSmall,t,o,{plain:!0}),n,i)+s}),tz=z(function*(e,t){let r=yield*Rt(t),n=xe(r.prefix,r.primaryColor),o=xe(r.pointerSmall,r.mutedColor),s=Ty(e,n,o,t,r),i=t$(e,r.pointerSmall,r),a=t.type==="password"?r.passwordMask.length:1,c=(e.cursor-e.value.length)*a;return s+i+w_(c)}),rz=z(function*(e,t){let r=yield*Rt(t),n=xe(r.tick,r.successColor),o=xe(r.ellipsis,r.mutedColor);return Ty(e,n,o,t,r,void 0,!0)+`
|
|
95
|
+
`}),dz=z(function*(e){let r=yield*(yield*mn).columns,n=yield*Rt(e),o=zs+Zi,s=e.active+" "+Xs(n.toggleSeparator,e.inactive),i=Xi(s,e.message,n.prefix,n.pointerSmall,{plain:!0});return hc(i,r)+o}),pz=z(function*(e,t){let r=yield*Rt(t),n=xe(r.prefix,r.primaryColor),o=xe(r.pointerSmall,r.mutedColor),s=n$(e,t,r),i=o$(s,n,o,t);return Cu+i}),hz=z(function*(e,t){let r=yield*Rt(t),n=xe(r.tick,r.successColor),o=xe(r.ellipsis,r.mutedColor),s=n$(e,t,r,!0);return o$(s,n,o,t)+`
|
|
96
|
+
`}),$_=T(Z.NextFrame({state:!0})),A_=T(Z.NextFrame({state:!1}))});var i$="~effect/cli/Param",_u="argument",Hn="flag",$u,zp=(e)=>G(e,i$),Vi=(e)=>e.kind==="flag",mc=(e)=>{let t=(r)=>e.kind===_u?yz(e.name,e.primitiveType,r):Sz(e.name,e.primitiveType,r);return Object.setPrototypeOf({_tag:"Single",...e,description:e.description??L(),aliases:e.aliases??[],hidden:e.hidden??!1,parse:t},$u)},Xp=(e,t)=>mc({name:t,primitiveType:O_,kind:e}),a$=(e,t)=>mc({name:t,primitiveType:m_,kind:e}),jp=(e,t,r)=>mc({name:t,primitiveType:g_(r),kind:e}),Cy=(e,t,r)=>{let n=r.map((o)=>[o,o]);return jp(e,t,n)},xz,c$,Vp,Au,l$=(e,t,r=[])=>{let n=r.map((o)=>()=>o().parse);return Object.assign(Object.create($u),{_tag:"Transform",kind:e.kind,param:e,alternatives:r,f:t,parse:t(e.parse,n)})},Qy,ji=(e)=>{let t=z(function*(r){return Bp(e),yield*e.parse(r).pipe(K(([n,o])=>[n,ee(o)]),_k({MissingOption:()=>T([r.arguments,L()]),MissingArgument:()=>T([r.arguments,L()])}))});return Object.assign(Object.create($u),{_tag:"Optional",kind:e.kind,param:e,parse:t})},_y,$y=(e,t)=>{let r=Bp(e),n=(o)=>{if(r.kind==="argument")return Ez(e,r,o,t);else return bz(e,r,o,t)};return Object.assign(Object.create($u),{_tag:"Variadic",kind:e.kind,param:e,min:ua(t?.min),max:ua(t?.max),parse:n})},Ay,yz,Sz,Ez,bz,Ry=(e,t)=>{let r=e;switch(r._tag){case"Single":return t.Single(r);case"Map":return t.Map(r);case"Transform":return t.Transform(r);case"Optional":return t.Optional(r);case"Variadic":return t.Variadic(r)}},js=(e,t)=>Ry(e,{Single:(r)=>t(r),Map:(r)=>Au(js(r.param,t),r.f),Transform:(r)=>l$(js(r.param,t),r.f,r.alternatives.map((n)=>()=>js(n(),t))),Optional:(r)=>ji(js(r.param,t)),Variadic:(r)=>$y(js(r.param,t),{min:ur(r.min),max:ur(r.max)})}),Me=(e)=>Ry(e,{Single:(t)=>[t],Map:(t)=>Me(t.param),Transform:(t)=>[...Me(t.param),...t.alternatives.flatMap((r)=>Me(r()))],Optional:(t)=>Me(t.param),Variadic:(t)=>Me(t.param)}),Bp=(e)=>{let t=Me(e);if(t.length===0)throw Error("No Single param found in param structure");if(t.length>1)throw Error(`Multiple Single params found: ${t.map((r)=>r.name).join(", ")}`);return t[0]},gr=(e)=>Ry(e,{Single:()=>({isOptional:!1,isVariadic:!1,variadicMin:L(),variadicMax:L()}),Map:(t)=>gr(t.param),Transform:(t)=>gr(t.param),Optional:(t)=>({...gr(t.param),isOptional:!0}),Variadic:(t)=>({...gr(t.param),isVariadic:!0,variadicMin:t.min,variadicMax:t.max})});var Jn=E(()=>{ae();oe();ze();It();ye();wu();dc();$u={[i$]:{_A:B},pipe(){return pe(this,arguments)}},xz=/^-+/,c$=v(2,(e,t)=>js(e,(r)=>mc({...r,aliases:[...r.aliases,t.replace(xz,"")]}))),Vp=v(2,(e,t)=>js(e,(r)=>mc({...r,description:ee(t)}))),Au=v(2,(e,t)=>{let r=(n)=>K(e.parse(n),([o,s])=>[o,t(s)]);return Object.assign(Object.create($u),{_tag:"Map",kind:e.kind,param:e,f:t,parse:r})}),Qy=v(2,(e,t)=>l$(e,(r)=>(n)=>H(r(n),([o,s])=>t(s).pipe(K((i)=>[o,i]))))),_y=v(2,(e,t)=>{if(!di(t))return Au(ji(e),bt(()=>t));return Qy(ji(e),er({onNone:()=>t,onSome:T}))}),Ay=v(2,(e,t)=>js(e,(r)=>mc({...r,typeName:t}))),yz=z(function*(e,t,r){if(r.arguments.length===0)return yield*new Fp({argument:e});let n=r.arguments[0],o=yield*cn(t.parse(n),(s)=>new Sn({option:e,value:n,expected:s,kind:"argument"}));return[r.arguments.slice(1),o]}),Sz=z(function*(e,t,r){let n=r.flags[e];if(n===void 0||n.length===0)return yield*new Pu({option:e});let o=n[0],s=yield*cn(t.parse(o),(i)=>new Sn({option:e,value:o,expected:i,kind:"flag"}));return[r.arguments,s]}),Ez=z(function*(e,t,r,n){let o=[],s=n?.min??0,i=n?.max??Number.POSITIVE_INFINITY,a=0,c=r.arguments;while(c.length>0&&a<i){let[l,u]=yield*e.parse({flags:r.flags,arguments:c});o.push(u),c=l,a++}if(a<s)return yield*new Sn({option:t.name,value:`${a} values`,expected:`at least ${s} value${s===1?"":"s"}`,kind:t.kind});return[c,o]}),bz=z(function*(e,t,r,n){let o=[],i=[t.name,...t.aliases].flatMap((c)=>r.flags[c]??[]),a=i.length;if(wt(n?.min)&&a<n.min)return yield*a===0?new Pu({option:t.name}):new Sn({option:t.name,value:`${a} occurrences`,expected:`at least ${n.min} value${n.min===1?"":"s"}`,kind:t.kind});if(wt(n?.max)&&a>n.max)return yield*new Sn({option:t.name,value:`${a} occurrences`,expected:`at most ${n.max} value${n.max===1?"":"s"}`,kind:t.kind});for(let c of i){let[,l]=yield*e.parse({flags:{[t.name]:[c]},arguments:[]});o.push(l)}return[r.arguments,o]})});var Gp=(e)=>Xp(_u,e),Xz=(e)=>ji(e),Yp,jz;var f$=E(()=>{oe();Jn();Yp=v(2,(e,t)=>Vp(e,t)),jz=v((e)=>zp(e[0]),(e,t)=>$y(e,t))});var Vz,d$=(e)=>le((t)=>e(t.getRef(Vz))),Iy=(...e)=>d$((t)=>ve(()=>{t.error(...e)})),Wt=(...e)=>d$((t)=>ve(()=>{t.log(...e)}));var Hp=E(()=>{ct();Dt();Vz=Zm});var Oc,Jp=(e)=>e.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,(t)=>`\\x${t.charCodeAt(0).toString(16).padStart(2,"0")}`),Bz=(e)=>{let t=globalThis.process,r=typeof t==="object"&&t!==null,n=e?.colors!==void 0?e.colors:r&&typeof t.stdout==="object"&&t.stdout!==null&&t.stdout.isTTY===!0&&t.env?.NO_COLOR!=="1",o=n?{bold:(c)=>`\x1B[1m${c}\x1B[0m`,dim:(c)=>`\x1B[2m${c}\x1B[0m`,cyan:(c)=>`\x1B[36m${c}\x1B[0m`,green:(c)=>`\x1B[32m${c}\x1B[0m`,blue:(c)=>`\x1B[34m${c}\x1B[0m`,yellow:(c)=>`\x1B[33m${c}\x1B[0m`,magenta:(c)=>`\x1B[35m${c}\x1B[0m`}:{bold:(c)=>c,dim:(c)=>c,cyan:(c)=>c,green:(c)=>c,blue:(c)=>c,yellow:(c)=>c,magenta:(c)=>c},s=n?"\x1B[0m":"",i=n?"\x1B[31m":"",a=n?"\x1B[1m":"";return{formatHelpDoc:(c)=>Hz(c,o),formatCliError:(c)=>Jp(c.message),formatError:(c)=>`
|
|
117
97
|
${a}${i}ERROR${s}
|
|
118
|
-
${
|
|
98
|
+
${Jp(c.message)}${s}`,formatErrors:(c)=>{if(c.length===0)return"";if(c.length===1)return`
|
|
119
99
|
${a}${i}ERROR${s}
|
|
120
|
-
${
|
|
121
|
-
${a}${i}ERRORS${s}`);for(let[,f]of
|
|
122
|
-
`)},formatVersion:(c,
|
|
123
|
-
`)},
|
|
124
|
-
`)};var
|
|
125
|
-
`)};var
|
|
126
|
-
`)};var
|
|
127
|
-
`)};var _H=(e,t,n)=>{switch(t){case"bash":return bH(e,n);case"zsh":return AH(e,n);case"fish":return kH(e,n)}};var RH=()=>{};var Ct={};Un(Ct,{atLeast:()=>gse,atMost:()=>xse,between:()=>yse,boolean:()=>xp,choice:()=>c0,choiceWithValue:()=>a0,date:()=>tse,directory:()=>ose,file:()=>rse,fileParse:()=>ase,fileSchema:()=>cse,fileText:()=>ise,filter:()=>Ese,filterMap:()=>Sse,float:()=>ese,integer:()=>Xoe,keyValuePair:()=>use,map:()=>u0,mapEffect:()=>mse,mapTryCatch:()=>hse,none:()=>lse,optional:()=>iy,orElse:()=>bse,orElseResult:()=>wse,path:()=>nse,redacted:()=>sse,string:()=>Qoe,withAlias:()=>oy,withDefault:()=>yp,withDescription:()=>xc,withFallbackConfig:()=>dse,withFallbackPrompt:()=>pse,withHidden:()=>fse,withMetavar:()=>sy,withSchema:()=>vse});var Qoe=(e)=>_x(It,e),xp=(e)=>fH(It,e),Xoe=(e)=>Rx(It,e),ese=(e)=>Px(It,e),tse=(e)=>Fx(It,e),a0=(e,t)=>pp(It,e,t),c0=(e,t)=>Mx(It,e,t),nse=(e,t)=>ul(It,e,t),rse=(e,t)=>Dx(It,e,t),ose=(e,t)=>Nx(It,e,t),sse=(e)=>$x(It,e),ise=(e)=>Ux(It,e),ase=(e,t)=>Lx(It,e,t),cse=(e,t,n)=>jx(It,e,t,n),use=(e)=>dH(It,e),lse,oy,xc,sy,fse=(e)=>mH(e),iy=(e)=>lc(e),yp,dse,pse,u0,mse,hse,gse,xse,yse,Sse,Ese,bse,wse,vse;var l0=w(()=>{X();zo();lse=Bx(It),oy=p(2,(e,t)=>pH(e,t)),xc=p(2,(e,t)=>Hx(e,t)),sy=p(2,(e,t)=>Yx(e,t)),yp=zx,dse=p(2,(e,t)=>Wx(e,t)),pse=p(2,(e,t)=>Kx(e,t)),u0=p(2,(e,t)=>dc(e,t)),mse=p(2,(e,t)=>mc(e,t)),hse=p(3,(e,t,n)=>qx(e,t,n)),gse=p(2,(e,t)=>Jx(e,t)),xse=p(2,(e,t)=>Gx(e,t)),yse=p(3,(e,t,n)=>Vx(e,t,n)),Sse=p(3,(e,t,n)=>mp(e,t,n)),Ese=p(3,(e,t,n)=>Zx(e,t,n)),bse=p(2,(e,t)=>Xx(e,t)),wse=p(2,(e,t)=>ey(e,t)),vse=p(2,(e,t)=>Qx(e,t))});var ay="~effect/cli/Command/Config/Internal",cy=(e)=>{let t=[],n=[],r=[];function o(i){let a=Object.create(null);for(let c of Object.keys(i))a[c]=s(i[c]);return a}function s(i){if(Array.isArray(i))return{_tag:"Array",children:i.map((a)=>s(a))};else if(Ax(i)){let a=t.length;if(t.push(i),i.kind==="argument")r.push(i);else n.push(i);return{_tag:"Param",index:a}}else return{_tag:"Nested",tree:o(i)}}return{[ay]:ay,flags:n,arguments:r,orderedParams:t,tree:o(e)}},PH,FH=(e,t)=>{switch(e._tag){case"Param":return{_tag:"Param",index:e.index+t};case"Array":return{_tag:"Array",children:e.children.map((n)=>FH(n,t))};case"Nested":return{_tag:"Nested",tree:MH(e.tree,t)}}},MH=(e,t)=>{let n=Object.create(null);for(let r of Object.keys(e))n[r]=FH(e[r],t);return n},f0=(e,t)=>{let n=e.orderedParams.length;return{[ay]:ay,flags:[...e.flags,...t.flags],arguments:[...e.arguments,...t.arguments],orderedParams:[...e.orderedParams,...t.orderedParams],tree:Object.assign(Object.create(null),e.tree,MH(t.tree,n))}},d0=(e,t)=>{let n={};for(let o of Object.keys(e))U(n,o,r(e[o]));return n;function r(o){switch(o._tag){case"Param":return t[o.index];case"Array":return o.children.map((s)=>r(s));case"Nested":return d0(o.tree,t)}}};var p0=w(()=>{zo();PH=cy({})});var Sp="~effect/cli/Command",Me=(e)=>e,kse,tr=(e)=>{let t=e.config,n=e.contextConfig??PH,r=e.service??ze(`${Sp}/${e.name}`),o=e.annotations??hn(),s=e.globalFlags??[],i=e.subcommands??[],a=(f,d)=>Le(e.handle)?e.handle(f,d):A(new qi({commandPath:d,errors:[]})),c=e.parse??uy(t),u=e.parseContext??uy(n,{allowLeftovers:!0}),l=(f)=>{let d=[],m=[];for(let I of t.arguments){let C=ct(I),S=er(I);for(let y of C)d.push({name:y.name,type:y.typeName??cp(y.primitiveType),description:y.description,required:!S.isOptional&&(!S.isVariadic||Qy(S.variadicMin,(h)=>h>0)),variadic:S.isVariadic})}let g=f.length>0?f.join(" "):e.name;if(i.some((I)=>I.commands.some((C)=>!C.unlisted)))g+=" <subcommand>";g+=" [flags]";for(let I of d){let C=I.variadic?`<${I.name}...>`:`<${I.name}>`;g+=` ${I.required?C:`[${C}]`}`}for(let I of t.flags){let C=ct(I),S=er(I);for(let y of C){if(y.hidden)continue;m.push(ly(y,S))}}let b=[];for(let I of i){let C=I.commands.filter((S)=>!S.unlisted);if(C.length===0)continue;b.push({group:I.group,commands:jt(C,(S)=>({name:S.name,alias:S.alias,shortDescription:S.shortDescription,description:S.description??""}))})}let x=e.examples??[];return{description:e.description??"",usage:g,flags:m,annotations:o,...d.length>0&&{args:d},...b.length>0&&{subcommands:b},...x.length>0&&{examples:x}}};return Object.assign(Object.create(kse),{[Sp]:Sp,name:e.name,examples:e.examples??[],annotations:o,globalFlags:s,subcommands:i,unlisted:e.unlisted??!1,config:t,contextConfig:n,service:r,parse:c,parseContext:u,handle:a,buildHelpDoc:l,...Le(e.description)?{description:e.description}:{},...Le(e.shortDescription)?{shortDescription:e.shortDescription}:{},...Le(e.alias)?{alias:e.alias}:{}})},ly=(e,t)=>{let n=e.aliases.map((r)=>r.length===1?`-${r}`:`--${r}`);return{name:e.name,aliases:n,type:e.typeName??cp(e.primitiveType),description:Ise(e.description,Hs(e.primitiveType)),required:e.primitiveType._tag!=="Boolean"&&!t.isOptional}},Ise=(e,t)=>{if(t===void 0||t.length===0)return e;let n=`(choices: ${t.join(", ")})`;return et(e,{onNone:()=>_(n),onSome:(r)=>_(`${r} ${n}`)})},uy=(e,t)=>H(function*(n){let r={flags:n.flags,arguments:n.arguments},[o,s]=yield*Cse(r,e.orderedParams);if(t?.allowLeftovers!==!0&&o.length>0)return yield*new xx({arguments:o});return d0(e.tree,s)}),Cse,m0=(e,t,n)=>{let r=Me(e),o=new Set;((i)=>{for(let a of i){let c=ct(a);for(let u of c)o.add(u.name)}})((n?.contextConfig??r.contextConfig).flags);for(let i of t){let a=Me(i);for(let c of a.config.flags){let u=ct(c);for(let l of u)if(o.has(l.name))throw new hx({option:l.name,parentCommand:e.name,childCommand:i.name})}}};var fl=w(()=>{An();Ve();Oe();Pc();_e();he();ip();zo();il();p0();kse={...So({label:"Command",evaluate(){return Me(this).service}})},Cse=H(function*(e,t){let n=[],r=e.arguments;for(let o of t){let[s,i]=yield*o.parse({flags:e.flags,arguments:r});n.push(i),r=s}return[r,n]})});var Tse=(e)=>{switch(e.primitiveType._tag){case"Boolean":return{_tag:"Boolean"};case"Integer":return{_tag:"Integer"};case"Float":return{_tag:"Float"};case"Date":return{_tag:"Date"};case"Choice":return{_tag:"Choice",values:Hs(e.primitiveType)??[]};case"Path":return{_tag:"Path",pathType:$I(e.primitiveType)??"either"};case"FileText":case"FileParse":case"FileSchema":return{_tag:"Path",pathType:"file"};default:return{_tag:"String"}}},Ose=(e)=>{switch(e.primitiveType._tag){case"Integer":return{_tag:"Integer"};case"Float":return{_tag:"Float"};case"Date":return{_tag:"Date"};case"Choice":return{_tag:"Choice",values:Hs(e.primitiveType)??[]};case"Path":return{_tag:"Path",pathType:$I(e.primitiveType)??"either"};case"FileText":case"FileParse":case"FileSchema":return{_tag:"Path",pathType:"file"};default:return{_tag:"String"}}},h0=(e)=>{let n=Me(e).config,r=[];for(let i of n.flags){let a=ct(i);for(let c of a){if(c.kind!=="flag")continue;if(c.hidden)continue;r.push({name:c.name,aliases:c.aliases,description:mn(c.description),type:Tse(c)})}}let o=[];for(let i of n.arguments){let a=ct(i),c=er(i);for(let u of a){if(u.kind!=="argument")continue;o.push({name:u.name,description:mn(u.description),required:!c.isOptional,variadic:c.isVariadic,type:Ose(u)})}}let s=[];for(let i of e.subcommands)for(let a of i.commands){if(a.unlisted)continue;s.push(h0(a))}return{name:e.name,description:e.shortDescription??e.description,flags:r,arguments:o,subcommands:s}};var NH=w(()=>{_e();zo();il();fl()});var g0=(e)=>{let t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r),n.push(r)}return n},DH=(e,t)=>{let n=[e],r=e;for(let o=1;o<t.length;o++){let s=t[o],i=void 0;for(let a of r.subcommands)if(i=a.commands.find((c)=>c.name===s),i)break;if(!i)break;n.push(i),r=i}return n},x0=(e,t,n)=>{let o=DH(e,t).flatMap((s)=>Me(s).globalFlags);return g0([...n,...o])},_se=(e)=>{let t=[],n=(r)=>{let o=Me(r);for(let s of o.globalFlags)t.push(s);for(let s of r.subcommands)for(let i of s.commands)n(i)};return n(e),g0(t)},Rse=(e,t)=>{if(e.length<=1)return[];let n=new Set(t.map((o)=>o.name)),r=[];for(let o of e.slice(0,-1)){let s=Me(o);for(let i of s.contextConfig.flags){let a=ct(i),c=er(i);for(let u of a){if(n.has(u.name))continue;if(u.hidden)continue;n.add(u.name),r.push(ly(u,c))}}}return r},$H=(e,t)=>g0([...t,..._se(e)]),fy=(e,t,n)=>qt(function*(){let r=DH(e,t),o=r.length>0?r[r.length-1]:e,s=Me(o).buildHelpDoc(t),i=Rse(r,s.flags),a=x0(e,t,n),c=[];for(let u of a){let l=ct(u.flag),f=er(u.flag);for(let d of l){if(d.hidden)continue;c.push({...ly(d,f),required:!1})}}return{...s,flags:[...i,...s.flags],globalFlags:c}});var y0=w(()=>{Oe();zo();fl()});var dy=(e)=>({_tag:"Action",flag:e.flag,run:e.run}),Fse=(e)=>(t)=>{UH+=1;let n=ze(`effect/unstable/cli/GlobalFlag/${e}/${UH}`);return Object.assign(n,{_tag:"Setting",id:e,flag:t.flag})},UH=0,Mse,Nse,S0,Dse,dl,LH;var E0=w(()=>{ty();Ve();Oe();_e();n0();RH();l0();NH();y0();Mse=dy({flag:xp("help").pipe(oy("h"),xc("Show help information"),yp(!1)),run:H(function*(e,{builtIns:t,command:n,commandPath:r}){let o=yield*ll,s=yield*fy(n,r,t);yield*un(o.formatHelpDoc(s))})}),Nse=dy({flag:xp("version").pipe(oy("v"),xc("Show version information"),yp(!1)),run:H(function*(e,{command:t,version:n}){let r=yield*ll;yield*un(r.formatVersion(t.name,n))})}),S0=dy({flag:xp("wizard").pipe(xc("Start wizard mode for a command"),yp(!1)),run:()=>Te}),Dse=dy({flag:c0("completions",["bash","zsh","fish","sh"]).pipe(iy,u0((e)=>en(e,(t)=>t==="sh"?"bash":t)),sy("<bash|zsh|fish|sh>"),xc("Print shell completion script")),run:H(function*(e,{command:t}){if(me(e))return;let n=h0(t);yield*un(_H(t.name,e.value,n))})}),dl=Fse("log-level")({flag:a0("log-level",[["all","All"],["trace","Trace"],["debug","Debug"],["info","Info"],["warn","Warn"],["warning","Warn"],["error","Error"],["fatal","Fatal"],["none","None"]]).pipe(iy,xc("Sets the minimum log level"),sy("<all|trace|debug|info|warn|warning|error|fatal|none>"))}),LH=[Mse,Nse,S0,Dse,dl]});var py,$se;var BH=w(()=>{Ve();E0();py=class py extends ke("effect/unstable/cli/CliConfig",{defaultValue:()=>$se}){};$se={builtIns:LH}});function qH(e){let t=e.indexOf("--");if(t===-1)return{tokens:HH(e),trailingOperands:[]};return{tokens:HH(e.slice(0,t)),trailingOperands:e.slice(t+1)}}var HH=(e)=>{let t=[];for(let n of e)if(!n.startsWith("-"))t.push({_tag:"Value",value:n});else if(n.startsWith("--")){let r=n.indexOf("=");if(r!==-1){let o=n.slice(2,r),s=n.slice(r+1);t.push({_tag:"LongOption",name:o,raw:n,value:s})}else t.push({_tag:"LongOption",name:n.slice(2),raw:n})}else if(n.length>1){let r=n.slice(1),o=r.indexOf("=");if(o!==-1){let s=r.slice(0,o),i=r.slice(o+1);t.push({_tag:"ShortOption",flag:s,raw:`-${s}`,value:i})}else for(let s of r)t.push({_tag:"ShortOption",flag:s,raw:`-${s}`})}else t.push({_tag:"Value",value:n});return t};var jse=(e,t)=>{let n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let s=0;s<=n;s++)o[s][0]=s;for(let s=0;s<=r;s++)o[0][s]=s;for(let s=1;s<=n;s++)for(let i=1;i<=r;i++){let a=e[s-1]===t[i-1]?0:1;o[s][i]=Math.min(o[s-1][i]+1,o[s][i-1]+1,o[s-1][i-1]+a)}return o[n][r]},b0=(e,t)=>{let n=t.map((o)=>[jse(e,o),o]).filter(([o])=>o<=2).sort(([o],[s])=>o-s);if(n.length===0)return[];let r=n[0][0];return n.filter(([o])=>o===r).map(([,o])=>o)};var v0=(e)=>et(e.subcommand,{onNone:()=>[],onSome:(t)=>[t.name,...v0(t.parsedInput)]}),k0=(e,t,n=[])=>qt(function*(){let{tokens:r,trailingOperands:o}=e,s=[...n,t.name],i=Me(t),c=i.config.flags.flatMap(ct).filter(fc),u=ml(c),f=i.contextConfig.flags.flatMap(ct).filter(fc),d=ml(f),m=new Set(f.map((S)=>S.name)),g={command:t,commandPath:s,flagRegistry:u,inheritedFlagRegistry:d,localFlagNames:c.filter((S)=>!m.has(S.name)).map((S)=>S.name)},b=Xse(r,g);if(b._tag==="Leaf")return{flags:b.flags,arguments:[...b.arguments,...o],subcommand:O(),...b.errors.length>0&&{errors:b.errors}};let x={tokens:b.childTokens,trailingOperands:o},I=yield*k0(x,b.sub,s),C=[...b.errors,...I.errors??[]];return{flags:b.flags,arguments:[],subcommand:_({name:b.sub.name,parsedInput:I}),...C.length>0&&{errors:C}}}),my=(e)=>{let t=0;return{peek:()=>e[t],take:()=>e[t++],rest:()=>e.slice(t)}},ml=(e)=>{let t=new Map;for(let n of e){if(t.has(n.name))throw Error(`Duplicate flag name "${n.name}" in command definition`);t.set(n.name,n);for(let r of n.aliases){if(t.has(r))throw Error(`Duplicate flag/alias "${r}" in command definition (conflicts with "${t.get(r).name}")`);t.set(r,n)}}return{params:e,index:t}},KH=(e)=>{let t=new Map,n=(r,o)=>{let s=t.get(r);if(s&&s!==o)throw Error(`Duplicate subcommand name/alias "${r}" in command definition (conflicts with "${s.name}")`);t.set(r,o)};for(let r of e)for(let o of r.commands)if(n(o.name,o),o.alias&&o.alias!==o.name)n(o.alias,o);return t},I0=(e)=>Object.fromEntries(e.map((t)=>[t.name,[]])),Bse=(e)=>{let t=I0(e);return{add:(n,r)=>{if(r!==void 0)t[n].push(r)},merge:(n)=>{for(let r in n){let o=n[r];if(o?.length)for(let s=0;s<o.length;s++)t[r].push(o[s])}},snapshot:()=>t}},hy=(e)=>e._tag==="LongOption"||e._tag==="ShortOption",VH=(e)=>e._tag==="LongOption"?e.name:e.flag,pl=(e,t)=>{let n=VH(e),r=t.index.get(n);if(r&&r.name===n)return{param:r,negated:!1};if(e._tag==="LongOption"&&e.name.startsWith("no-")){let o=e.name.slice(3),s=t.index.get(o);if(s&&s.name===o&&wx(s.primitiveType))return{param:s,negated:!0}}if(r)return{param:r,negated:!1};return},zH=(e,t,n)=>new $n({option:t.name,value:n,expected:`omit the value and use ${e.raw} by itself to set --${t.name} to false`,kind:"flag"}),Hse=(e)=>{let t=Hs(e.primitiveType);return new $n({option:e.name,value:"",expected:t===void 0?e.typeName??cp(e.primitiveType):t.join(" | "),kind:"flag"})},WH=(e)=>e?._tag==="Value"&&(cB(e.value)||uB(e.value))?e.value:void 0,GH=(e,t,n,r=!1)=>{let o=Ep(e,t,n,r);switch(o._tag){case"Value":return{_tag:"Value",value:o.value};case"Error":return{_tag:"Error",error:o.error}}},Ep=(e,t,n,r=!1)=>{if(r){if(t.value!==void 0)return{_tag:"Error",error:zH(t,n,t.value),tokens:[]};let s=WH(e.peek());if(s!==void 0){let i=e.take();return{_tag:"Error",error:zH(t,n,s),tokens:i===void 0?[]:[i]}}return{_tag:"Value",value:"false",tokens:[]}}if(t.value!==void 0)return{_tag:"Value",value:t.value,tokens:[]};if(wx(n.primitiveType)){let s=WH(e.peek()),i=s!==void 0?e.take():void 0;return{_tag:"Value",value:s??"true",tokens:i===void 0?[]:[i]}}let o=e.peek();if(o?._tag==="Value"){let s=e.take();return{_tag:"Value",value:o.value,tokens:s===void 0?[]:[s]}}return{_tag:"Error",error:Hse(n),tokens:[]}},qse=(e,t)=>{let n=I0(t.params),r=[],o=[],s=my(e);for(let i=s.take();i;i=s.take()){if(!hy(i)){r.push(i);continue}let a=pl(i,t);if(!a){r.push(i);continue}let c=GH(s,i,a.param,a.negated);if(c._tag==="Error"){o.push(c.error);continue}if(c.value!==void 0)n[a.param.name].push(c.value)}return{flagMap:n,remainder:r,errors:o}},zse=(e)=>Me(e).config.flags.flatMap(ct).filter(fc),Wse=(e)=>Me(e).contextConfig.flags.flatMap(ct).filter(fc),JH=(e,t)=>{for(let n of t){let r=pl(e,n);if(r!==void 0)return r}return},w0=(e,t,n,r)=>{e.push(n);let o=Ep(t,n,r.param,r.negated);e.push(...o.tokens)},Kse=(e,t,n,r,o)=>{let s=my(t);Ep(s,e,n.param,n.negated);for(let i=s.take();i;i=s.take()){if(hy(i)){let a=JH(i,o);if(a!==void 0)Ep(s,i,a.param,a.negated);continue}if(i._tag==="Value")return r.has(i.value)}return!1},ZH=(e,t,n)=>{let r=I0(n.params),o=[],s=(i,a,c)=>{let u=ml(zse(a)),l=ml(Wse(a)),f=KH(a.subcommands),d=my(i),m=[],g=!0;for(let b=d.take();b;b=d.take()){if(hy(b)){let x=JH(b,c);if(x!==void 0){w0(m,d,b,x);continue}let I=pl(b,l);if(I!==void 0){w0(m,d,b,I);continue}let C=pl(b,u),S=pl(b,n);if(C!==void 0){if(S===void 0||!g||!Kse(b,d.rest(),C,f,[u,l,n])){w0(m,d,b,C);continue}}if(S!==void 0){let y=Ep(d,b,S.param,S.negated);if(y._tag==="Error"){o.push(y.error);continue}if(y.value!==void 0)r[S.param.name].push(y.value);continue}m.push(b);continue}if(b._tag==="Value"&&g){let x=f.get(b.value);if(x!==void 0)return m.push(b),m.push(...s(d.rest(),x,[...c,l])),m;g=!1}m.push(b)}return m};return{flagMap:r,remainder:s(e,t,[]),errors:o}},Vse=(e,t,n)=>{let r=e._tag==="LongOption"?`--${e.name}`:`-${e.flag}`,o=[];for(let i of t){if(i.hidden)continue;if(o.push(i.name),wx(i.primitiveType))o.push(`no-${i.name}`);for(let a of i.aliases)o.push(a)}let s=b0(VH(e),o).map((i)=>i.length===1?`-${i}`:`--${i}`);return new nc({option:r,suggestions:s,command:n})},Gse=(e)=>({flags:Bse(e.params),arguments:[],errors:[],mode:{_tag:"AwaitingFirstValue"}}),Jse=(e)=>({_tag:"Leaf",flags:e.flags.snapshot(),arguments:e.arguments,errors:e.errors}),Zse=(e,t,n,r)=>{let{command:o,commandPath:s,inheritedFlagRegistry:i,localFlagNames:a}=n,c=KH(o.subcommands),u=c.get(e);if(u){let f=[...s,u.name],d=r.flags.snapshot();for(let g of a){let b=d[g];if(b!==void 0&&b.length>0)r.errors.push(new nc({option:`--${g}`,suggestions:[],command:f}))}let m=qse(t.rest(),i);return r.flags.merge(m.flagMap),r.errors.push(...m.errors),{_tag:"Subcommand",result:{_tag:"Sub",flags:r.flags.snapshot(),sub:u,childTokens:m.remainder,errors:r.errors}}}if(!(Me(o).config.arguments.length>0)&&c.size>0){let f=[];for(let[m,g]of c)if(!g.unlisted)f.push(m);let d=b0(e,f);r.errors.push(new yx({subcommand:e,parent:s,suggestions:d}))}return{_tag:"Argument"}},Yse=(e,t,n,r)=>{let{commandPath:o,flagRegistry:s}=n,i=pl(e,s);if(!i){r.errors.push(Vse(e,s.params,o));return}let a=GH(t,e,i.param,i.negated);if(a._tag==="Error"){r.errors.push(a.error);return}r.flags.add(i.param.name,a.value)},Qse=(e,t,n,r)=>{if(r.mode._tag==="AwaitingFirstValue"){let o=Zse(e,t,n,r);if(o._tag==="Subcommand")return o.result;r.mode={_tag:"CollectingArguments"}}r.arguments.push(e);return},Xse=(e,t)=>{let n=my(e),r=Gse(t.flagRegistry);for(let o=n.take();o;o=n.take()){if(hy(o)){Yse(o,n,t,r);continue}if(o._tag==="Value"){let s=Qse(o.value,n,t,r);if(s)return s}}return Jse(r)};var YH=w(()=>{Oe();_e();ip();zo();il();fl()});var T0,tie=(e,t)=>{let n=e;for(let r of t.slice(1)){let o=n.subcommands.flatMap((s)=>s.commands).find((s)=>s.name===r||s.alias===r);if(o===void 0)break;n=o}return n},eq,nie=(e)=>e.subcommands.some((n)=>n.commands.some((r)=>!r.unlisted))||Me(e).config.orderedParams.length>0,QH,rie=(e)=>{let t=sie(e);switch(e.primitiveType._tag){case"Boolean":return oe(vn(jI({message:t,label:{confirm:"true",deny:"false"},placeholder:{defaultConfirm:"(T/f)",defaultDeny:"(t/F)"}})),(n)=>Wo(String(n)));case"Choice":{let n=Hs(e.primitiveType)??[];return oe(vn(HI({message:t,choices:n.map((r)=>({title:r,value:r}))})),Wo)}case"Date":return oe(vn(LB({message:t})),(n)=>Wo(n.toISOString()));case"Float":return oe(vn(jB({message:t})),(n)=>Wo(String(n)));case"Integer":return oe(vn(BI({message:t})),(n)=>Wo(String(n)));case"Redacted":return oe(vn(BB({message:t})),(n)=>Wo(Ui(n),"<redacted>"));default:return oe(vn(HB({message:t})),Wo)}},Wo=(e,t=e)=>({value:e,displayValue:t}),oie=(e)=>e.kind===It?`--${e.name}`:e.name,sie=(e)=>C0(e),C0=(e)=>{let t=mn(e.description)?.trim(),n=e.kind===It&&t!==void 0&&t.length<=32?t:iie(e.name);return e.kind===It?`${n} (${oie(e)})`:n},iie=(e)=>{let t=e.split(/[-_]+/).filter((n)=>n.length>0);if(t.length===0)return e;return[t[0][0].toUpperCase()+t[0].slice(1),...t.slice(1)].join(" ")},gy=(e)=>un(oq("Current command",e.map((t)=>t.displayValue),IB)),XH=(e,t)=>`${at(e.toUpperCase(),qs,al)} ${at("\xB7",fp)} ${at(t,qs,sc)}`,tq=(e,t,n)=>[`${at(e,qs,al)} ${at(`v${t}`,sc)} ${at("\xB7 Command wizard",qs,sc)}`,...n===void 0||n.length===0?[]:[n],at("Build a command interactively. Press Ctrl+C to cancel.",fp),""].join(`
|
|
128
|
-
`),
|
|
129
|
-
${
|
|
130
|
-
`)},aie=(e)=>{let o=e.map(cie),s=[],i=" $ ";for(let a of o){let c=i===" $ "||i===" "?"":" ";if(i.length+c.length+a.length>88&&i!==" $ ")s.push(`${i} \\`),i=` ${a}`;else i+=`${c}${a}`}if(i!==" $ ")s.push(i);return s},cie=(e)=>/^[A-Za-z0-9_./:@%+=,-]+$/.test(e)?e:`'${e.replaceAll("'",`'"'"'`)}'`;var sq=w(()=>{ty();Oe();_e();$d();zo();il();Ox();fl();T0=H(function*(e,t){let n=t?.commandPath??[e.name],r=tie(e,n),o=(t?.prefix??n).map((s)=>Wo(s));return yield*gy(o),yield*eq(r,o,r===e?"ROOT":r.name),{args:o.map((s)=>s.value),displayArgs:o.map((s)=>s.displayValue)}}),eq=H(function*(e,t,n){let r=Me(e),o=e.subcommands.flatMap((a)=>a.commands.filter((c)=>!c.unlisted)),s=o.length===0?r.config:r.contextConfig;if(s.flags.length>0){yield*un(XH(n,"FLAGS"));for(let a of s.flags)t.push(...yield*QH(a));if(s.arguments.length>0||o.length>0)yield*gy(t)}if(s.arguments.length>0){yield*un(XH(n,"ARGUMENTS"));for(let a of s.arguments)t.push(...yield*QH(a));if(o.length>0)yield*gy(t)}if(o.length===0)return;let i=yield*vn(HI({message:"Command",choices:o.map((a)=>({title:a.name,value:a,...a.shortDescription!==void 0?{description:a.shortDescription}:a.description!==void 0?{description:a.description}:{}}))}));if(yield*un(),t.push(Wo(i.name)),nie(i))yield*gy(t);yield*eq(i,t,i.name)}),QH=H(function*(e){let t=gc(e),n=er(e);if(n.isOptional){if(!(yield*vn(jI({message:`Set ${C0(t)}?`,initial:!1}))))return yield*un(),[]}let r=!n.isVariadic?1:yield*vn(BI({message:`${C0(t)} count`,default:mt(n.variadicMin,()=>0),min:mt(n.variadicMin,()=>0),...Ee(n.variadicMax)?{max:n.variadicMax.value}:{}})),o=[];for(let i=0;i<r;i++)o.push(yield*rie(t));let s=t.kind===It?{flags:{[t.name]:o.map((i)=>i.value)},arguments:[]}:{flags:{},arguments:o.map((i)=>i.value)};if(yield*e.parse(s),yield*un(),t.kind===Yt)return o;return o.flatMap((i)=>[Wo(`--${t.name}`),i])})});var ho={};Un(ho,{annotate:()=>Eie,annotateMerge:()=>bie,isCommand:()=>O0,make:()=>lie,provide:()=>vie,provideEffect:()=>Iie,provideEffectDiscard:()=>Cie,provideSync:()=>kie,run:()=>Rie,runWith:()=>A0,unlisted:()=>Sie,withAlias:()=>yie,withDescription:()=>gie,withExamples:()=>wie,withGlobalFlags:()=>hie,withHandler:()=>fie,withSharedFlags:()=>mie,withShortDescription:()=>xie,withSubcommands:()=>pie,wizard:()=>Tie});var O0=(e)=>M(e,Sp),lie=(e,t,n)=>{let r=cy(t??{});return tr({name:e,config:r,...Le(n)?{handle:n}:{}})},fie,die=(e)=>{let t=[],n=new Map,r=(i,a)=>{t.push(a);let c=n.get(i);if(c)c.push(a);else n.set(i,[a])};for(let i of e){if(O0(i)){r(void 0,i);continue}for(let a of i.commands)r(i.group,a)}let o=[],s=n.get(void 0);if(s&&s.length>0)o.push({group:void 0,commands:s});for(let[i,a]of n){if(i===void 0)continue;o.push({group:i,commands:a})}return{flat:t,groups:o}},pie,mie,hie,gie,xie,yie,Sie=(e)=>tr({...Me(e),unlisted:!0}),Eie,bie,wie,xy=(e,t)=>{let n=Me(e);return tr({...n,handle:(r,o)=>t(n.handle(r,o),r)})},vie,kie,Iie,Cie,Tie=(e,t)=>oe(T0(e,t),(n)=>n.args),Oie=(e,t,n,r)=>{let o=new Set(t),s=[],i=new Set;for(let a of e){if(o.has(a))continue;let c=ct(a.flag);for(let u of c){let l=n[u.name];if(!l||l.length===0)continue;let f=`--${u.name}`;if(i.has(f))continue;i.add(f),s.push(new nc({option:f,suggestions:[],command:r}))}}return s},Aie=(e,t,n)=>qt(function*(){let{builtIns:r}=yield*py,o=yield*ll,s=yield*fy(e,t.commandPath,r);if(yield*un(o.formatHelpDoc(s)),n&&t.errors.length>0)yield*XI(o.formatErrors(t.errors))}),_ie=(e)=>qt(function*(){let t=yield*ll;yield*XI(t.formatError(e)),e[Pa]=!1}),Rie,A0=(e,t)=>{let n=Me(e);return H(function*(r){let{builtIns:o}=yield*py,{tokens:s,trailingOperands:i}=qH(r),a=$H(e,o),c=a.flatMap((k)=>ct(k.flag)),u=ml(c.filter(fc)),{flagMap:l,remainder:f,errors:d}=ZH(s,e,u),m={flags:l,arguments:[]},g=yield*k0({tokens:f,trailingOperands:i},e),b=[e.name,...v0(g)],x={builtIns:o,command:e,commandPath:b,version:t.version},I=x0(e,b,o),C=Oie(a,I,l,b);if(C.length>0||d.length>0){let k=g.errors??[];return yield*new qi({commandPath:b,errors:[...d,...C,...k]})}for(let k of I){if(k._tag!=="Action")continue;if(!ct(k.flag).some((R)=>{let z=l[R.name];return z!==void 0&&z.length>0}))continue;let[,N]=yield*k.flag.parse(m);if(k===S0)return yield*qt(function*(){yield*un(tq(e.name,t.version,e.description));let R=[e.name,...r.filter((ue)=>ue!=="--wizard"&&!ue.startsWith("--wizard="))],z=yield*T0(e,{commandPath:b,prefix:R});if(yield*un(nq(z.displayArgs)),yield*vn(qB({message:"Run this command?",initial:!0,active:"yes",inactive:"no"})))yield*un(),yield*A0(e,{...t,renderErrors:!1})(z.args.slice(1))}).pipe(gs("QuitError",()=>un(rq())));yield*k.run(N,x);return}if(g.errors&&g.errors.length>0)return yield*new qi({commandPath:b,errors:g.errors});let S=yield*ih(n.parse(g));if(S._tag==="Failure")return yield*new qi({commandPath:b,errors:[S.failure]});let y=n.handle(S.success,[e.name]),h=I.includes(dl)?(yield*dl.flag.parse(m))[1]:O();y=Io(y,dl,h);for(let k of I){if(k._tag!=="Setting"||k===dl)continue;let[,T]=yield*k.flag.parse(m);y=Io(y,k,T)}let E=et(h,{onNone:()=>hn(),onSome:(k)=>os(I_,k)});yield*xs(y,E)},Mf((r)=>RI(r)&&r._tag==="ShowHelp"?G(r):te(r),(r)=>hr(Aie(e,r,t.renderErrors!==!1),A(r))),Mf((r)=>t.renderErrors!==!1&&RI(r)&&r._tag==="UserError"?G(r):te(r),(r)=>hr(_ie(r),A(r))),Mf((r)=>V2(r)?G(r):te(r),(r)=>hu))};var iq=w(()=>{ty();Ve();Oe();X();_e();he();tb();gn();xh();Wv();sx();BH();ip();n0();E0();fl();p0();y0();YH();sq();zo();Ox();fie=p(2,(e,t)=>tr({...Me(e),handle:t})),pie=p(2,(e,t)=>{let n=die(t);m0(e,n.flat);let r=Me(e),o=new Map(n.flat.map((c)=>[c.name,Me(c)])),s=Symbol("effect/cli/SubcommandState"),i=H(function*(c){if(me(c.subcommand))return yield*r.parse(c);let u=o.get(c.subcommand.value.name);if(!u)return yield*r.parse(c);let l=yield*r.parseContext(c),f=yield*u.parse(c.subcommand.value.parsedInput);return{...l,[s]:{name:u.name,result:f}}}),a=H(function*(c,u){let f=c[s];if(f){let d=o.get(f.name);if(!d)return yield*new qi({commandPath:u,errors:[]});return yield*d.handle(f.result,[...u,d.name]).pipe(Io(r.service,c))}return yield*r.handle(c,u)});return tr({name:r.name,config:r.config,contextConfig:r.contextConfig,description:r.description,shortDescription:r.shortDescription,alias:r.alias,unlisted:r.unlisted,annotations:r.annotations,globalFlags:r.globalFlags,examples:r.examples,service:r.service,subcommands:n.groups,parse:i,parseContext:r.parseContext,handle:a})}),mie=p(2,(e,t)=>{let n=Me(e),r=cy(t),o=f0(n.config,r),s=f0(n.contextConfig,r);if(n.subcommands.length>0){let l=n.subcommands.flatMap((f)=>f.commands);m0(e,l,{contextConfig:s})}let i=uy(r,{allowLeftovers:!0}),a=H(function*(l){let f=yield*n.parse(l),d=yield*i(l);return{...f,...d}}),c=H(function*(l){let f=yield*n.parseContext(l),d=yield*i(l);return{...f,...d}}),u=(l,f)=>n.handle(l,f);return tr({name:n.name,config:o,contextConfig:s,description:n.description,shortDescription:n.shortDescription,alias:n.alias,unlisted:n.unlisted,annotations:n.annotations,globalFlags:n.globalFlags,examples:n.examples,service:n.service,subcommands:n.subcommands,parse:a,parseContext:c,handle:u})}),hie=p(2,(e,t)=>{let n=Me(e),r=Array.from(new Set([...n.globalFlags,...t]));return tr({...n,globalFlags:r})}),gie=p(2,(e,t)=>tr({...Me(e),description:t})),xie=p(2,(e,t)=>tr({...Me(e),shortDescription:t})),yie=p(2,(e,t)=>tr({...Me(e),alias:t})),Eie=p(3,(e,t,n)=>{let r=Me(e);return tr({...r,annotations:tn(r.annotations,t,n)})}),bie=p(2,(e,t)=>{let n=Me(e);return tr({...n,annotations:ua(n.annotations,t)})}),wie=p(2,(e,t)=>tr({...Me(e),examples:t})),vie=p((e)=>O0(e[0]),(e,t,n)=>xy(e,(r,o)=>zb(r,typeof t==="function"?t(o):t,n))),kie=p(3,(e,t,n)=>xy(e,(r,o)=>Io(r,t,typeof n==="function"?n(o):n))),Iie=p(3,(e,t,n)=>xy(e,(r,o)=>Wb(r,t,typeof n==="function"?n(o):n))),Cie=p(2,(e,t)=>xy(e,(n,r)=>hr(typeof t==="function"?t(r):t,n))),Rie=p(2,(e,t)=>bg.use(({args:n})=>ne(n,(r)=>A0(e,t)(r))))});var aq=w(()=>{hH();iq();l0()});var cq=(e)=>{let t=e?.trim();return t===void 0||t.length===0?void 0:t},uq=()=>({bunExecutable:cq(process.env.TRIPWIRE_BUN),forcePortable:process.env.TRIPWIRE_FORCE_PORTABLE==="1",packageDist:cq(process.env.TRIPWIRE_PACKAGE_DIST)});var lq=()=>{};import{lstat as gq,mkdir as Pie,open as Fie,readFile as bp,readlink as Mie,realpath as Nie,rename as xq,rm as yy,stat as Die,symlink as fq}from"fs/promises";import{homedir as vp}from"os";import yc from"path";import{fileURLToPath as dq}from"url";var pq,yq,Ko=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),hl=(e,t)=>e instanceof Error&&("code"in e)&&e.code===t,wp=async(e,t,n={})=>{let r=e,o=!1;try{o=(await gq(e)).isSymbolicLink()}catch(c){if(!hl(c,"ENOENT"))throw c}if(o)r=await Nie(e);let s=`${r}.${process.pid}.next`,i,a=384;try{a=(await Die(r)).mode&4095}catch(c){if(!hl(c,"ENOENT"))throw c}await yy(s,{force:!0});try{i=await Fie(s,"wx",a),await i.writeFile(t,"utf8"),await i.chmod(a),await i.sync(),await i.close(),i=void 0,await n.beforeRename?.(s,r),await xq(s,r)}finally{try{if(i!==void 0)await i.close()}finally{await yy(s,{force:!0})}}},$ie=(e)=>Ko(e)&&typeof e.type==="string"&&typeof e.command==="string"&&(e.timeout===void 0||typeof e.timeout==="number"),mq=(e)=>Array.isArray(e)&&e.every((t)=>Ko(t)&&Array.isArray(t.hooks)&&t.hooks.every($ie)),Uie=(e)=>{if(!Ko(e))return!1;let{hooks:t}=e;if(t===void 0)return!0;return Ko(t)&&(t.PreToolUse===void 0||mq(t.PreToolUse))&&(t.PostToolUse===void 0||mq(t.PostToolUse))},_0=(e,t)=>{let n=JSON.parse(e);if(!Uie(n))throw Error(`${t} hook config has an unsupported shape`);return n},Lie=(e)=>{let t=JSON.parse(e);if(!Ko(t))throw Error("Cursor hooks.json must contain a JSON object");let{hooks:n}=t;if(n===void 0)return t;if(!Ko(n))throw Error("Cursor hooks.json `hooks` must be an object");for(let[r,o]of Object.entries(n))if(!Array.isArray(o)||o.some((s)=>!Ko(s)||typeof s.command!=="string"))throw Error(`Cursor hooks.json event ${r} must contain command hooks`);return t},Sc="tripwire-hook",Sq=async(e,t)=>{await Pie(yc.dirname(t),{recursive:!0});try{if(!(await gq(t)).isSymbolicLink())return{action:"already",success:!1};let r=await Mie(t);if(r===e)return{action:"already",success:!0};let o=yc.resolve(yc.dirname(t),r);if(yc.basename(o)!=="tripwire-pi.js")return{action:"already",success:!1};let s=`${t}.${process.pid}.next`;await yy(s,{force:!0});try{await fq(e,s),await xq(s,t)}finally{await yy(s,{force:!0})}return{action:"updated",success:!0}}catch(n){if(!(n instanceof Error&&("code"in n)&&n.code==="ENOENT"))throw n;return await fq(e,t),{action:"installed",success:!0}}},jie,Bie,Sy=(e)=>e===Sc||e.startsWith(`${Sc} `)||e.includes("/tripwire-darwin-arm64/")||e.includes("/tripwire-hook")||e.includes("/tripwire.js")||e.includes("/dist/tripwire"),Hie=(e,t,n=Sc)=>{let r=Bie.has(t),o={command:`${n} --cursor-event ${t}`,...r&&{failClosed:!0}};if(e===void 0)return[[o],!0];let s=!1,i=e.some((u)=>Sy(u.command)),a=`${n} --cursor-event ${t}`,c=e.map((u)=>{if(!Sy(u.command))return u;if(u.command===a&&(!r||u.failClosed===!0))return u;return s=!0,{...u,command:a,...r&&{failClosed:!0}}});if(i)return[c,s];return[[...c,o],!0]},Ey=(e,t=Sc)=>{if(!e)return[[{hooks:[{type:"command",command:t}]}],!1];let n=!1,r=e.map((i)=>({...i,hooks:i.hooks.map((a)=>{if(Sy(a.command)){if(a.command!==t)return n=!0,{...a,command:t};return a}return a})}));if(r.some((i)=>i.hooks.some((a)=>a.command===t)))return[r,!n];return[[...r,{hooks:[{type:"command",command:t}]}],!1]},R0=async(e={})=>{let t=e.homeDirectory??vp(),n=e.hookCommand??Sc,r=`${t}/.claude/settings.json`;try{let o=await bp(r,"utf8"),s=_0(o,"Claude");s.hooks??={};let[i,a]=Ey(s.hooks.PreToolUse,n),[c,u]=Ey(s.hooks.PostToolUse,n);if(s.hooks.PreToolUse=i,s.hooks.PostToolUse=c,a&&u)return{success:!0,message:`Already configured: ${r}`};return await wp(r,`${JSON.stringify(s,null,2)}
|
|
131
|
-
`),{success:!0,message:`Updated ${
|
|
132
|
-
`,c=a!==s,
|
|
100
|
+
${Jp(c[0].message)}${s}`;let l=new Map;for(let f of c){let d=f._tag??"Error",h=l.get(d)??[];h.push(f),l.set(d,h)}let u=[];u.push(`
|
|
101
|
+
${a}${i}ERRORS${s}`);for(let[,f]of l)for(let d of f)u.push(` ${Jp(d.message)}${s}`);return u.join(`
|
|
102
|
+
`)},formatVersion:(c,l)=>`${o.bold(c)} ${o.dim("v")}${o.bold(l)}`}},Gz=(e)=>e.replace(/\u001B\[[0-9;]*m/g,""),Uy=(e)=>Gz(e).length,Yz=(e,t)=>{let r=Uy(e),n=Math.max(0,t-r);return e+" ".repeat(n)},Ru=(e,t)=>{let r=Math.max(...e.map((o)=>Uy(o.left)))+4,n=t===void 0?r:Math.min(r,t);return e.map(({left:o,right:s})=>` ${Yz(o,Math.max(n,Uy(o)+1))}${s}`).join(`
|
|
103
|
+
`)},p$=(e,t)=>t?`${e}, ${t}`:e,Hz=(e,t)=>{let r=[];if(e.description)r.push(t.bold("DESCRIPTION")),r.push(` ${e.description}`),r.push("");if(r.push(t.bold("USAGE")),r.push(` ${t.cyan(e.usage)}`),r.push(""),e.args&&e.args.length>0){r.push(t.bold("ARGUMENTS"));let n=e.args.map((o)=>{let s=o.name;if(o.variadic)s+="...";let i=t.green(s),a=t.dim(o.type),c=`${i} ${a}`,l=o.required?"":t.dim(" (optional)"),u=bt(o.description,()=>"")+l;return{left:c,right:u}});r.push(Ru(n,25)),r.push("")}if(e.flags.length>0){r.push(t.bold("FLAGS"));let n=e.flags.map((o)=>{let s=[];s.push(t.green(`--${o.name}`));for(let c of o.aliases)s.push(t.green(c));let i=s.join(", "),a=o.type!=="boolean"?` ${t.dim(o.type)}`:"";return{left:i+a,right:bt(o.description,()=>"")}});r.push(Ru(n)),r.push("")}if(e.globalFlags&&e.globalFlags.length>0){r.push(t.bold("GLOBAL FLAGS"));let n=e.globalFlags.map((o)=>{let s=[];s.push(t.green(`--${o.name}`));for(let c of o.aliases)s.push(t.green(c));let i=s.join(", "),a=o.type!=="boolean"?` ${t.dim(o.type)}`:"";return{left:i+a,right:bt(o.description,()=>"")}});r.push(Ru(n)),r.push("")}if(e.subcommands&&e.subcommands.length>0){let n=e.subcommands.find((o)=>o.group===void 0);if(n){if(r.push(t.bold("SUBCOMMANDS")),r.push(Ru(n.commands.map((o)=>({left:t.cyan(p$(o.name,o.alias)),right:o.shortDescription??o.description})),20)),e.subcommands.length>1)r.push("")}for(let o of e.subcommands){if(o.group===void 0)continue;r.push(t.bold(`${o.group}:`)),r.push(Ru(o.commands.map((s)=>({left:t.cyan(p$(s.name,s.alias)),right:s.shortDescription??s.description})),20)),r.push("")}}if(e.examples&&e.examples.length>0){r.push(t.bold("EXAMPLES"));let n=!0,o=!1;for(let s of e.examples){if(s.description){if(!n)r.push("");r.push(` ${t.dim(`# ${s.description}`)}`)}else if(o)r.push("");r.push(` ${t.cyan(s.command)}`),n=!1,o=!!s.description}r.push("")}if(r[r.length-1]==="")r.pop();return r.join(`
|
|
104
|
+
`)};var Dy=E(()=>{lt();ze();Oc=Be("effect/cli/CliOutput",{defaultValue:()=>Bz()})});var Iu=(e)=>e.replace(/'/g,"'\\''"),My=(e)=>e.replace(/[^a-zA-Z0-9_]/g,"_"),Ny=(e)=>{let t=[`--${e.name}`];for(let r of e.aliases)t.push(r.length===1?`-${r}`:`--${r}`);if(e.type._tag==="Boolean")t.push(`--no-${e.name}`);return t},Jz=(e,t)=>{if(e.length===0)return;let r=e.map(Ny);t.push(` local ${r.map((n,o)=>`_used_${o}=""`).join(" ")}`),t.push(" for ((i = 1; i < cword; i++)); do"),t.push(' case "${words[i]%%=*}" in'),r.forEach((n,o)=>{t.push(` ${n.join("|")}) _used_${o}=1 ;;`)}),t.push(" esac"),t.push(" done"),t.push(' local _filtered_flags=""'),r.forEach((n,o)=>{t.push(` [[ -n "$_used_${o}" ]] || _filtered_flags+=" ${n.join(" ")}"`)}),t.push("")},Kz=(e,t)=>{t.push(`${e}()`),t.push("{"),t.push(' local _cur="$1" _word="$2"; shift 2'),t.push(""),t.push(' local _head="${_cur%"$_word"}"'),t.push(' local _open=""'),t.push(' case "$_head" in'),t.push(` *\\') _open="'" ;;`),t.push(` *\\") _open='"' ;;`),t.push(" esac"),t.push(""),t.push(' local _prefix="$_cur" _committed="$_head"'),t.push(" _prefix=${_prefix//\\\\/}; _prefix=${_prefix//\\\"/}; _prefix=${_prefix//\\'/}"),t.push(" _committed=${_committed//\\\\/}; _committed=${_committed//\\\"/}; _committed=${_committed//\\'/}"),t.push(""),t.push(" COMPREPLY=()"),t.push(" local _choice _rest _match"),t.push(' for _choice in "$@"; do'),t.push(' [[ "$_choice" == "$_prefix"* ]] || continue'),t.push(' _rest="${_choice#"$_committed"}"'),t.push(' case "$_open" in'),t.push(` "'")`),t.push(` if [[ "$_head" == "'" ]]; then`),t.push(" _match=${_rest//\\'/\\'\\\\\\'\\'}"),t.push(" else"),t.push(' [[ "$_rest" == *\\\'* ]] && continue'),t.push(' _match="$_rest"'),t.push(" fi"),t.push(" ;;"),t.push(` '"')`),t.push(' _match="${_rest//\\\\/\\\\\\\\}"'),t.push(' _match="${_match//\\$/\\\\$}"'),t.push(' _match="${_match//\\`/\\\\\\`}"'),t.push(' _match="${_match//\\"/\\\\\\"}"'),t.push(" ;;"),t.push(" *)"),t.push(` printf -v _match '%q' "$_rest"`),t.push(` [[ -z "$_head" && "$_match" == '~'* ]] && _match="\\\\$_match"`),t.push(" ;;"),t.push(" esac"),t.push(' [[ -n "$_open" && "$_match" == *"$_open" ]] && _match+="$_open"'),t.push(' COMPREPLY+=("$_match")'),t.push(" done"),t.push("}"),t.push("")},m$=(e,t)=>`${e} "$cur" "$_comp_word" ${t.map((r)=>`'${Iu(r)}'`).join(" ")}`,eX=(e,t)=>{switch(e._tag){case"Boolean":return;case"Choice":return m$(t,e.values);case"Path":if(e.pathType==="directory")return'COMPREPLY=( $(compgen -d -- "$cur") )';return'COMPREPLY=( $(compgen -f -- "$cur") )';default:return}},tX=(e,t)=>{switch(e._tag){case"Choice":return m$(t,e.values);case"Path":if(e.pathType==="directory")return'COMPREPLY=( $(compgen -d -- "$cur") )';return'COMPREPLY=( $(compgen -f -- "$cur") )';default:return}},O$=(e,t,r,n)=>{let o=[...t,e.name],s=`_${o.map(My).join("_")}`;if(r.push(`${s}()`),r.push("{"),r.push(" local cur prev words cword i"),r.push(t.length===0?" local _command_index=0":' local _command_index="$1"'),r.push(' _init_completion -n "$COMP_WORDBREAKS" || return'),t.length===0)r.push(' local _comp_word="$2"');r.push("");let i=e.flags.filter((c)=>c.type._tag!=="Boolean");if(i.length>0){r.push(" # Flag value completions"),r.push(' case "$prev" in');for(let c of i){let l=[`--${c.name}`];for(let f of c.aliases)l.push(f.length===1?`-${f}`:`--${f}`);let u=eX(c.type,n);if(u)r.push(` ${l.join("|")})`),r.push(` ${u}`),r.push(" return"),r.push(" ;;")}r.push(" esac"),r.push("")}if(e.subcommands.length>0){r.push(" # Subcommand dispatch"),r.push(" local cmd _skip_next=0"),r.push(" for ((i = _command_index + 1; i < cword; i++)); do"),r.push(" if (( _skip_next )); then"),r.push(" _skip_next=0"),r.push(" continue"),r.push(" fi"),r.push(' case "${words[i]}" in');for(let c of e.flags){if(c.type._tag==="Boolean")continue;let l=Ny(c);r.push(` ${l.join("|")}) _skip_next=1 ;;`),r.push(` ${l.map((u)=>`${u}=*`).join("|")}) ;;`)}for(let c of e.subcommands){let l=`_${[...o,c.name].map(My).join("_")}`;r.push(` ${c.name})`),r.push(` ${l} "$i"`),r.push(" return"),r.push(" ;;")}r.push(" esac"),r.push(" done"),r.push("")}if(Jz(e.flags,r),e.flags.length>0||e.subcommands.length>0){if(r.push(" # Complete flags (filtered) and subcommands"),r.push(' if [[ "$cur" == -* ]]; then'),e.flags.length>0)r.push(' COMPREPLY=( $(compgen -W "$_filtered_flags" -- "$cur") )');r.push(" return"),r.push(" fi"),r.push("")}let a=e.arguments.flatMap((c,l)=>{let u=tX(c.type,n);return u===void 0?[]:[{argument:c,completion:u,index:l}]});if(a.length>0){r.push(" # Positional argument completions"),r.push(" local _position=0 _skip_next=0 _end_of_options=0"),r.push(" for ((i = _command_index + 1; i < cword; i++)); do"),r.push(" if (( _skip_next )); then"),r.push(" _skip_next=0"),r.push(" continue"),r.push(" fi"),r.push(" if (( _end_of_options )); then"),r.push(" ((_position += 1))"),r.push(" continue"),r.push(" fi"),r.push(' case "${words[i]}" in'),r.push(" --) _end_of_options=1 ;;");for(let l of e.flags){let u=Ny(l);if(l.type._tag==="Boolean")r.push(` ${u.join("|")}) ;;`);else r.push(` ${u.join("|")}) _skip_next=1 ;;`),r.push(` ${u.map((f)=>`${f}=*`).join("|")}) ;;`)}r.push(" -*) ;;"),r.push(" *) ((_position += 1)) ;;"),r.push(" esac"),r.push(" done"),r.push(' case "$_position" in');for(let{argument:l,completion:u,index:f}of a){if(l.variadic)continue;r.push(` ${f})`),r.push(` ${u}`),r.push(" return"),r.push(" ;;")}r.push(" esac");let c=a.find(({argument:l})=>l.variadic);if(c!==void 0)r.push(` if (( _position >= ${c.index} )); then`),r.push(` ${c.completion}`),r.push(" return"),r.push(" fi")}else if(e.subcommands.length>0){let c=e.subcommands.map((l)=>l.name);r.push(` COMPREPLY=( $(compgen -W '${c.join(" ")}' -- "$cur") )`)}r.push("}"),r.push("");for(let c of e.subcommands)O$(c,o,r,n)},g$=(e,t)=>{let r=[],n=My(e),o=`_${n}--choices`;return r.push(`###-begin-${Iu(e)}-completions-###`),r.push("#"),r.push("# Static completion script for Bash"),r.push("#"),r.push("# Installation:"),r.push(`# ${Iu(e)} --completions bash >> ~/.bashrc`),r.push("#"),r.push(""),r.push("if ! type _init_completion &>/dev/null; then"),r.push(" _init_completion()"),r.push(" {"),r.push(" COMPREPLY=()"),r.push(' local _i _j=0 _piece _line="$COMP_LINE"'),r.push(' words=("${COMP_WORDS[0]}")'),r.push(" cword=0"),r.push(' _line="${_line#*"${COMP_WORDS[0]}"}"'),r.push(" for ((_i = 1; _i < ${#COMP_WORDS[@]}; _i++)); do"),r.push(' _piece="${COMP_WORDS[_i]}"'),r.push(' if [[ "$_line" == [[:blank:]]* ]]; then'),r.push(" ((_j++))"),r.push(' words[_j]="$_piece"'),r.push(" else"),r.push(' words[_j]="${words[_j]}$_piece"'),r.push(" fi"),r.push(" ((_i == COMP_CWORD)) && cword=$_j"),r.push(' _line="${_line#*"$_piece"}"'),r.push(" done"),r.push(' cur="${words[cword]}"'),r.push(' prev=""'),r.push(' ((cword > 0)) && prev="${words[cword-1]}"'),r.push(" return 0"),r.push(" }"),r.push("fi"),r.push(""),Kz(o,r),O$(t,[],r,o),r.push(`complete -F _${n} ${Iu(e)}`),r.push(`###-end-${Iu(e)}-completions-###`),r.join(`
|
|
105
|
+
`)};var Vs=(e)=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),x$=(e)=>Vs(e.replace(/[^A-Za-z0-9_.,/@%+-]/gu,"\\$&")),nX=(e,t)=>{if(e.length===0){if(t.length>0)return"__fish_use_subcommand";return""}let r=e.map((n)=>`__fish_seen_subcommand_from ${n}`).join("; and ");if(t.length>0)return`${r}; and not __fish_seen_subcommand_from ${t.join(" ")}`;return r},Zy=(e)=>{let t=[];for(let r of e.aliases)if(r.length===1)t.push(`-s ${r}`);t.push(e.name);for(let r of e.aliases)if(r.length>1)t.push(r);if(e.type._tag==="Boolean")t.push(`no-${e.name}`);return`not __fish_contains_opt ${t.join(" ")}`},oX=(e)=>{let t=[`--${e.name}`];for(let r of e.aliases)t.push(r.length===1?`-${r}`:`--${r}`);return`begin; ${Zy(e)}; or contains -- (commandline -poc)[-1] ${t.join(" ")}; end`},sX=(e)=>{let t=[`-l ${e.name}`];for(let n of e.aliases)if(n.length===1)t.push(`-s ${n}`);else t.push(`-l ${n}`);if(e.description)t.push(`-d '${Vs(e.description)}'`);let r=iX(e.type);if(r)t.push(r);return t},iX=(e)=>{switch(e._tag){case"Boolean":return;case"Choice":return`-r -f -a '${e.values.map(x$).join(" ")}'`;case"Path":if(e.pathType==="directory")return"-r -F";return"-r -F";default:return"-r -f"}},aX=(e)=>{switch(e._tag){case"Choice":return`-r -f -a '${e.values.map(x$).join(" ")}'`;case"Path":return"-r -F";default:return}},y$=(e,t,r,n)=>{let o=t.subcommands.map((c)=>c.name),s=nX(r,o),i=s?`-n '${s}'`:"";if(!t.arguments.some((c)=>c.type._tag==="Path")){let c=[`complete -c ${e}`];if(i)c.push(i);c.push("-f"),n.push(c.join(" "))}for(let c of t.subcommands){let l=[`complete -c ${e}`];if(i)l.push(i);if(l.push(`-f -a '${Vs(c.name)}'`),c.description)l.push(`-d '${Vs(c.description)}'`);n.push(l.join(" "))}for(let c of t.flags){let l=c.type._tag==="Boolean",u=l?Zy(c):oX(c),f=s?`${s}; and ${u}`:u,d=f?`-n '${f}'`:"",h=[`complete -c ${e}`];if(d)h.push(d);if(h.push(...sX(c)),n.push(h.join(" ")),l){let m=[`complete -c ${e}`];if(d)m.push(d);if(m.push(`-l no-${c.name}`),c.description)m.push(`-d '${Vs(`Disable ${c.name}`)}'`);n.push(m.join(" "))}}if(t.flags.length>0){let l=s?`${s}; and not string match -q -- "-*" (commandline -ct)`:'not string match -q -- "-*" (commandline -ct)';for(let u of t.flags){let f=`${l}; and ${Zy(u)}`,d=u.type._tag==="Boolean",h=[`complete -c ${e}`];if(h.push(`-n '${f}'`),h.push(`-f -a '--${u.name}'`),u.description)h.push(`-d '${Vs(u.description)}'`);if(n.push(h.join(" ")),d){let m=[`complete -c ${e}`];if(m.push(`-n '${f}'`),m.push(`-f -a '--no-${u.name}'`),u.description)m.push(`-d '${Vs(`Disable ${u.name}`)}'`);n.push(m.join(" "))}}}for(let c of t.arguments){let l=aX(c.type);if(l){let u=[`complete -c ${e}`];if(i)u.push(i);if(u.push(l),c.description)u.push(`-d '${Vs(c.description)}'`);n.push(u.join(" "))}}for(let c of t.subcommands)y$(e,c,[...r,c.name],n)},S$=(e,t)=>{let r=[];return r.push(`###-begin-${e}-completions-###`),r.push("#"),r.push("# Static completion script for Fish"),r.push("#"),r.push("# Installation:"),r.push(`# ${e} --completions fish > ~/.config/fish/completions/${e}.fish`),r.push("#"),r.push(""),y$(e,t,[],r),r.push(""),r.push(`###-end-${e}-completions-###`),r.join(`
|
|
106
|
+
`)};var Kp=(e)=>e.replace(/\\/g,"\\\\").replace(/'/g,"'\\''").replace(/:/g,"\\:"),k$=(e)=>e.replace(/[^A-Za-z0-9_.,/@%+-]/gu,"\\$&").replace(/'/g,"'\\''"),qy=(e)=>e.replace(/[^a-zA-Z0-9_]/g,"_"),lX=(e)=>{let t=[`--${e.name}`];for(let r of e.aliases)t.push(r.length===1?`-${r}`:`--${r}`);if(e.type._tag==="Boolean")t.push(`--no-${e.name}`);return t},uX=(e)=>{switch(e._tag){case"Boolean":return"";case"Choice":return`:value:(${e.values.map(k$).join(" ")})`;case"Path":return e.pathType==="directory"?":directory:_directories":":file:_files";case"Integer":return":integer:";case"Float":return":float:";case"Date":return":date:";default:return":value:"}},fX=(e)=>{switch(e._tag){case"Choice":return`(${e.values.map(k$).join(" ")})`;case"Path":return e.pathType==="directory"?"_directories":"_files";default:return""}},E$=(e)=>{let t=[],r=e.description?`[${Kp(e.description)}]`:"",n=uX(e.type),o=`(${lX(e).join(" ")})`;t.push(`'${o}--${e.name}${r}${n}'`);for(let s of e.aliases){let i=s.length===1?"-":"--";t.push(`'${o}${i}${s}${r}${n}'`)}if(e.type._tag==="Boolean"){let s=e.description?`[${Kp(`Disable ${e.name}`)}]`:"";t.push(`'${o}--no-${e.name}${s}'`)}return t},b$=(e)=>{let t=e.description?Kp(e.description):e.name,r=fX(e.type);return`'${e.variadic?"*":""}:${t}:${r}'`},P$=(e,t,r)=>{let n=[...t,e.name],o=`_${n.map(qy).join("_")}`;if(r.push(`${o}() {`),e.subcommands.length>0){r.push(" local context state state_descr line"),r.push(" typeset -A opt_args"),r.push(""),r.push(" local -a commands"),r.push(" commands=(");for(let s of e.subcommands){let i=s.description?Kp(s.description):"";r.push(` '${s.name}:${i}'`)}r.push(" )"),r.push(""),r.push(" local -a specs"),r.push(" specs=(");for(let s of e.flags)for(let i of E$(s))r.push(` ${i}`);if(e.arguments.length>0){r.push(" -"),r.push(" parent-arguments");for(let s of e.arguments)r.push(` ${b$(s)}`);r.push(" -"),r.push(" subcommands")}r.push(" '1:command:->command'"),r.push(" '*::arg:->args'"),r.push(" )"),r.push(""),r.push(' _arguments -C "${specs[@]}"'),r.push(""),r.push(' case "$state" in'),r.push(" command)"),r.push(" _describe -t commands 'commands' commands"),r.push(" ;;"),r.push(" args)"),r.push(' case "$words[1]" in');for(let s of e.subcommands){let i=`_${[...n,s.name].map(qy).join("_")}`;r.push(` ${s.name})`),r.push(` ${i}`),r.push(" ;;")}r.push(" esac"),r.push(" ;;"),r.push(" esac")}else{let s=[];for(let i of e.flags)s.push(...E$(i));for(let i of e.arguments)s.push(b$(i));if(s.length>0){r.push(" local -a specs"),r.push(" specs=(");for(let i of s)r.push(` ${i}`);r.push(" )"),r.push(' _arguments "${specs[@]}"')}}r.push("}"),r.push("");for(let s of e.subcommands)P$(s,n,r)},w$=(e,t)=>{let r=[],n=qy(e);return r.push(`#compdef ${e}`),r.push(`###-begin-${e}-completions-###`),r.push("#"),r.push("# Static completion script for Zsh"),r.push("#"),r.push("# Installation:"),r.push(`# ${e} --completions zsh > ~/.zsh/completions/_${e}`),r.push("# then add ~/.zsh/completions to your fpath"),r.push("#"),r.push(""),P$(t,[],r),r.push("# Handle both direct invocation and autoload"),r.push('if [[ "${zsh_eval_context[-1]}" == "loadautofunc" ]]; then'),r.push(` _${n} "$@"`),r.push("else"),r.push(` compdef _${n} ${e}`),r.push("fi"),r.push(`###-end-${e}-completions-###`),r.join(`
|
|
107
|
+
`)};var T$=(e,t,r)=>{switch(t){case"bash":return g$(e,r);case"zsh":return w$(e,r);case"fish":return S$(e,r)}};var v$=()=>{};var Fu=(e)=>Xp(Hn,e),Uu=(e)=>a$(Hn,e),C$=(e,t)=>jp(Hn,e,t),Q$=(e,t)=>Cy(Hn,e,t),Wy,rn,Ly,Bi=(e)=>ji(e),gc,_$;var Xy=E(()=>{oe();Jn();Wy=v(2,(e,t)=>c$(e,t)),rn=v(2,(e,t)=>Vp(e,t)),Ly=v(2,(e,t)=>Ay(e,t)),gc=_y,_$=v(2,(e,t)=>Au(e,t))});var $$="~effect/cli/Command/Config/Internal",jy=(e)=>{let t=[],r=[],n=[];function o(i){let a=Object.create(null);for(let c of Object.keys(i))a[c]=s(i[c]);return a}function s(i){if(Array.isArray(i))return{_tag:"Array",children:i.map((a)=>s(a))};else if(zp(i)){let a=t.length;if(t.push(i),i.kind==="argument")n.push(i);else r.push(i);return{_tag:"Param",index:a}}else return{_tag:"Nested",tree:o(i)}}return{[$$]:$$,flags:r,arguments:n,orderedParams:t,tree:o(e)}},A$,Vy=(e,t)=>{let r={};for(let o of Object.keys(e))Ar(r,o,n(e[o]));return r;function n(o){switch(o._tag){case"Param":return t[o.index];case"Array":return o.children.map((s)=>n(s));case"Nested":return Vy(o.tree,t)}}};var By=E(()=>{Jn();A$=jy({})});var Du="~effect/cli/Command",He=(e)=>e,hX,eh=(e)=>{let t=e.config,r=e.contextConfig??A$,n=e.service??rt(`${Du}/${e.name}`),o=e.annotations??Tn(),s=e.globalFlags??[],i=e.subcommands??[],a=(f,d)=>wt(e.handle)?e.handle(f,d):N(new Ls({commandPath:d,errors:[]})),c=e.parse??Gy(t),l=e.parseContext??Gy(r,{allowLeftovers:!0}),u=(f)=>{let d=[],h=[];for(let O of t.arguments){let S=Me(O),y=gr(O);for(let g of S)d.push({name:g.name,type:g.typeName??Tu(g.primitiveType),description:g.description,required:!y.isOptional&&(!y.isVariadic||eE(y.variadicMin,(C)=>C>0)),variadic:y.isVariadic})}let m=f.length>0?f.join(" "):e.name;if(i.some((O)=>O.commands.some((S)=>!S.unlisted)))m+=" <subcommand>";m+=" [flags]";for(let O of d){let S=O.variadic?`<${O.name}...>`:`<${O.name}>`;m+=` ${O.required?S:`[${S}]`}`}for(let O of t.flags){let S=Me(O),y=gr(O);for(let g of S){if(g.hidden)continue;h.push(th(g,y))}}let b=[];for(let O of i){let S=O.commands.filter((y)=>!y.unlisted);if(S.length===0)continue;b.push({group:O.group,commands:Sr(S,(y)=>({name:y.name,alias:y.alias,shortDescription:y.shortDescription,description:y.description??""}))})}let x=e.examples??[];return{description:e.description??"",usage:m,flags:h,annotations:o,...d.length>0&&{args:d},...b.length>0&&{subcommands:b},...x.length>0&&{examples:x}}};return Object.assign(Object.create(hX),{[Du]:Du,name:e.name,examples:e.examples??[],annotations:o,globalFlags:s,subcommands:i,unlisted:e.unlisted??!1,config:t,contextConfig:r,service:n,parse:c,parseContext:l,handle:a,buildHelpDoc:u,...wt(e.description)?{description:e.description}:{},...wt(e.shortDescription)?{shortDescription:e.shortDescription}:{},...wt(e.alias)?{alias:e.alias}:{}})},th=(e,t)=>{let r=e.aliases.map((n)=>n.length===1?`-${n}`:`--${n}`);return{name:e.name,aliases:r,type:e.typeName??Tu(e.primitiveType),description:mX(e.description,Xo(e.primitiveType)),required:e.primitiveType._tag!=="Boolean"&&!t.isOptional}},mX=(e,t)=>{if(t===void 0||t.length===0)return e;let r=`(choices: ${t.join(", ")})`;return er(e,{onNone:()=>ee(r),onSome:(n)=>ee(`${n} ${r}`)})},Gy=(e,t)=>z(function*(r){let n={flags:r.flags,arguments:r.arguments},[o,s]=yield*OX(n,e.orderedParams);if(t?.allowLeftovers!==!0&&o.length>0)return yield*new Up({arguments:o});return Vy(e.tree,s)}),OX,R$=(e,t,r)=>{let n=He(e),o=new Set;((i)=>{for(let a of i){let c=Me(a);for(let l of c)o.add(l.name)}})((r?.contextConfig??n.contextConfig).flags);for(let i of t){let a=He(i);for(let c of a.config.flags){let l=Me(c);for(let u of l)if(o.has(u.name))throw new Ip({option:u.name,parentCommand:e.name,childCommand:i.name})}}};var xc=E(()=>{_n();lt();ae();la();ze();ye();wu();Jn();dc();By();hX={...Pn({label:"Command",evaluate(){return He(this).service}})},OX=z(function*(e,t){let r=[],n=e.arguments;for(let o of t){let[s,i]=yield*o.parse({flags:e.flags,arguments:n});r.push(i),n=s}return[n,r]})});var gX=(e)=>{switch(e.primitiveType._tag){case"Boolean":return{_tag:"Boolean"};case"Integer":return{_tag:"Integer"};case"Float":return{_tag:"Float"};case"Date":return{_tag:"Date"};case"Choice":return{_tag:"Choice",values:Xo(e.primitiveType)??[]};case"Path":return{_tag:"Path",pathType:py(e.primitiveType)??"either"};case"FileText":case"FileParse":case"FileSchema":return{_tag:"Path",pathType:"file"};default:return{_tag:"String"}}},xX=(e)=>{switch(e.primitiveType._tag){case"Integer":return{_tag:"Integer"};case"Float":return{_tag:"Float"};case"Date":return{_tag:"Date"};case"Choice":return{_tag:"Choice",values:Xo(e.primitiveType)??[]};case"Path":return{_tag:"Path",pathType:py(e.primitiveType)??"either"};case"FileText":case"FileParse":case"FileSchema":return{_tag:"Path",pathType:"file"};default:return{_tag:"String"}}},Yy=(e)=>{let r=He(e).config,n=[];for(let i of r.flags){let a=Me(i);for(let c of a){if(c.kind!=="flag")continue;if(c.hidden)continue;n.push({name:c.name,aliases:c.aliases,description:ur(c.description),type:gX(c)})}}let o=[];for(let i of r.arguments){let a=Me(i),c=gr(i);for(let l of a){if(l.kind!=="argument")continue;o.push({name:l.name,description:ur(l.description),required:!c.isOptional,variadic:c.isVariadic,type:xX(l)})}}let s=[];for(let i of e.subcommands)for(let a of i.commands){if(a.unlisted)continue;s.push(Yy(a))}return{name:e.name,description:e.shortDescription??e.description,flags:n,arguments:o,subcommands:s}};var I$=E(()=>{ze();Jn();dc();xc()});var Hy=(e)=>{let t=new Set,r=[];for(let n of e){if(t.has(n))continue;t.add(n),r.push(n)}return r},F$=(e,t)=>{let r=[e],n=e;for(let o=1;o<t.length;o++){let s=t[o],i=void 0;for(let a of n.subcommands)if(i=a.commands.find((c)=>c.name===s),i)break;if(!i)break;r.push(i),n=i}return r},Jy=(e,t,r)=>{let o=F$(e,t).flatMap((s)=>He(s).globalFlags);return Hy([...r,...o])},SX=(e)=>{let t=[],r=(n)=>{let o=He(n);for(let s of o.globalFlags)t.push(s);for(let s of n.subcommands)for(let i of s.commands)r(i)};return r(e),Hy(t)},EX=(e,t)=>{if(e.length<=1)return[];let r=new Set(t.map((o)=>o.name)),n=[];for(let o of e.slice(0,-1)){let s=He(o);for(let i of s.contextConfig.flags){let a=Me(i),c=gr(i);for(let l of a){if(r.has(l.name))continue;if(l.hidden)continue;r.add(l.name),n.push(th(l,c))}}}return n},U$=(e,t)=>Hy([...t,...SX(e)]),rh=(e,t,r)=>We(function*(){let n=F$(e,t),o=n.length>0?n[n.length-1]:e,s=He(o).buildHelpDoc(t),i=EX(n,s.flags),a=Jy(e,t,r),c=[];for(let l of a){let u=Me(l.flag),f=gr(l.flag);for(let d of u){if(d.hidden)continue;c.push({...th(d,f),required:!1})}}return{...s,flags:[...i,...s.flags],globalFlags:c}});var Ky=E(()=>{ae();Jn();xc()});var nh=(e)=>({_tag:"Action",flag:e.flag,run:e.run}),kX=(e)=>(t)=>{D$+=1;let r=rt(`effect/unstable/cli/GlobalFlag/${e}/${D$}`);return Object.assign(r,{_tag:"Setting",id:e,flag:t.flag})},D$=0,PX,wX,eS,TX,yc,M$;var tS=E(()=>{Hp();lt();ae();ze();Dy();v$();Xy();I$();Ky();PX=nh({flag:Uu("help").pipe(Wy("h"),rn("Show help information"),gc(!1)),run:z(function*(e,{builtIns:t,command:r,commandPath:n}){let o=yield*Oc,s=yield*rh(r,n,t);yield*Wt(o.formatHelpDoc(s))})}),wX=nh({flag:Uu("version").pipe(Wy("v"),rn("Show version information"),gc(!1)),run:z(function*(e,{command:t,version:r}){let n=yield*Oc;yield*Wt(n.formatVersion(t.name,r))})}),eS=nh({flag:Uu("wizard").pipe(rn("Start wizard mode for a command"),gc(!1)),run:()=>ue}),TX=nh({flag:Q$("completions",["bash","zsh","fish","sh"]).pipe(Bi,_$((e)=>fa(e,(t)=>t==="sh"?"bash":t)),Ly("<bash|zsh|fish|sh>"),rn("Print shell completion script")),run:z(function*(e,{command:t}){if(Lt(e))return;let r=Yy(t);yield*Wt(T$(t.name,e.value,r))})}),yc=kX("log-level")({flag:C$("log-level",[["all","All"],["trace","Trace"],["debug","Debug"],["info","Info"],["warn","Warn"],["warning","Warn"],["error","Error"],["fatal","Fatal"],["none","None"]]).pipe(Bi,rn("Sets the minimum log level"),Ly("<all|trace|debug|info|warn|warning|error|fatal|none>"))}),M$=[PX,wX,eS,TX,yc]});var oh,vX;var Z$=E(()=>{lt();tS();oh=class oh extends Be("effect/unstable/cli/CliConfig",{defaultValue:()=>vX}){};vX={builtIns:M$}});function W$(e){let t=e.indexOf("--");if(t===-1)return{tokens:q$(e),trailingOperands:[]};return{tokens:q$(e.slice(0,t)),trailingOperands:e.slice(t+1)}}var q$=(e)=>{let t=[];for(let r of e)if(!r.startsWith("-"))t.push({_tag:"Value",value:r});else if(r.startsWith("--")){let n=r.indexOf("=");if(n!==-1){let o=r.slice(2,n),s=r.slice(n+1);t.push({_tag:"LongOption",name:o,raw:r,value:s})}else t.push({_tag:"LongOption",name:r.slice(2),raw:r})}else if(r.length>1){let n=r.slice(1),o=n.indexOf("=");if(o!==-1){let s=n.slice(0,o),i=n.slice(o+1);t.push({_tag:"ShortOption",flag:s,raw:`-${s}`,value:i})}else for(let s of n)t.push({_tag:"ShortOption",flag:s,raw:`-${s}`})}else t.push({_tag:"Value",value:r});return t};var _X=(e,t)=>{let r=e.length,n=t.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let i=1;i<=n;i++){let a=e[s-1]===t[i-1]?0:1;o[s][i]=Math.min(o[s-1][i]+1,o[s][i-1]+1,o[s-1][i-1]+a)}return o[r][n]},rS=(e,t)=>{let r=t.map((o)=>[_X(e,o),o]).filter(([o])=>o<=2).sort(([o],[s])=>o-s);if(r.length===0)return[];let n=r[0][0];return r.filter(([o])=>o===n).map(([,o])=>o)};var oS=(e)=>er(e.subcommand,{onNone:()=>[],onSome:(t)=>[t.name,...oS(t.parsedInput)]}),sS=(e,t,r=[])=>We(function*(){let{tokens:n,trailingOperands:o}=e,s=[...r,t.name],i=He(t),c=i.config.flags.flatMap(Me).filter(Vi),l=Ec(c),f=i.contextConfig.flags.flatMap(Me).filter(Vi),d=Ec(f),h=new Set(f.map((y)=>y.name)),m={command:t,commandPath:s,flagRegistry:l,inheritedFlagRegistry:d,localFlagNames:c.filter((y)=>!h.has(y.name)).map((y)=>y.name)},b=LX(n,m);if(b._tag==="Leaf")return{flags:b.flags,arguments:[...b.arguments,...o],subcommand:L(),...b.errors.length>0&&{errors:b.errors}};let x={tokens:b.childTokens,trailingOperands:o},O=yield*sS(x,b.sub,s),S=[...b.errors,...O.errors??[]];return{flags:b.flags,arguments:[],subcommand:ee({name:b.sub.name,parsedInput:O}),...S.length>0&&{errors:S}}}),sh=(e)=>{let t=0;return{peek:()=>e[t],take:()=>e[t++],rest:()=>e.slice(t)}},Ec=(e)=>{let t=new Map;for(let r of e){if(t.has(r.name))throw Error(`Duplicate flag name "${r.name}" in command definition`);t.set(r.name,r);for(let n of r.aliases){if(t.has(n))throw Error(`Duplicate flag/alias "${n}" in command definition (conflicts with "${t.get(n).name}")`);t.set(n,r)}}return{params:e,index:t}},X$=(e)=>{let t=new Map,r=(n,o)=>{let s=t.get(n);if(s&&s!==o)throw Error(`Duplicate subcommand name/alias "${n}" in command definition (conflicts with "${s.name}")`);t.set(n,o)};for(let n of e)for(let o of n.commands)if(r(o.name,o),o.alias&&o.alias!==o.name)r(o.alias,o);return t},iS=(e)=>Object.fromEntries(e.map((t)=>[t.name,[]])),$X=(e)=>{let t=iS(e);return{add:(r,n)=>{if(n!==void 0)t[r].push(n)},merge:(r)=>{for(let n in r){let o=r[n];if(o?.length)for(let s=0;s<o.length;s++)t[n].push(o[s])}},snapshot:()=>t}},ih=(e)=>e._tag==="LongOption"||e._tag==="ShortOption",j$=(e)=>e._tag==="LongOption"?e.name:e.flag,Sc=(e,t)=>{let r=j$(e),n=t.index.get(r);if(n&&n.name===r)return{param:n,negated:!1};if(e._tag==="LongOption"&&e.name.startsWith("no-")){let o=e.name.slice(3),s=t.index.get(o);if(s&&s.name===o&&Np(s.primitiveType))return{param:s,negated:!0}}if(n)return{param:n,negated:!1};return},L$=(e,t,r)=>new Sn({option:t.name,value:r,expected:`omit the value and use ${e.raw} by itself to set --${t.name} to false`,kind:"flag"}),AX=(e)=>{let t=Xo(e.primitiveType);return new Sn({option:e.name,value:"",expected:t===void 0?e.typeName??Tu(e.primitiveType):t.join(" | "),kind:"flag"})},z$=(e)=>e?._tag==="Value"&&(p_(e.value)||h_(e.value))?e.value:void 0,V$=(e,t,r,n=!1)=>{let o=Mu(e,t,r,n);switch(o._tag){case"Value":return{_tag:"Value",value:o.value};case"Error":return{_tag:"Error",error:o.error}}},Mu=(e,t,r,n=!1)=>{if(n){if(t.value!==void 0)return{_tag:"Error",error:L$(t,r,t.value),tokens:[]};let s=z$(e.peek());if(s!==void 0){let i=e.take();return{_tag:"Error",error:L$(t,r,s),tokens:i===void 0?[]:[i]}}return{_tag:"Value",value:"false",tokens:[]}}if(t.value!==void 0)return{_tag:"Value",value:t.value,tokens:[]};if(Np(r.primitiveType)){let s=z$(e.peek()),i=s!==void 0?e.take():void 0;return{_tag:"Value",value:s??"true",tokens:i===void 0?[]:[i]}}let o=e.peek();if(o?._tag==="Value"){let s=e.take();return{_tag:"Value",value:o.value,tokens:s===void 0?[]:[s]}}return{_tag:"Error",error:AX(r),tokens:[]}},RX=(e,t)=>{let r=iS(t.params),n=[],o=[],s=sh(e);for(let i=s.take();i;i=s.take()){if(!ih(i)){n.push(i);continue}let a=Sc(i,t);if(!a){n.push(i);continue}let c=V$(s,i,a.param,a.negated);if(c._tag==="Error"){o.push(c.error);continue}if(c.value!==void 0)r[a.param.name].push(c.value)}return{flagMap:r,remainder:n,errors:o}},IX=(e)=>He(e).config.flags.flatMap(Me).filter(Vi),FX=(e)=>He(e).contextConfig.flags.flatMap(Me).filter(Vi),B$=(e,t)=>{for(let r of t){let n=Sc(e,r);if(n!==void 0)return n}return},nS=(e,t,r,n)=>{e.push(r);let o=Mu(t,r,n.param,n.negated);e.push(...o.tokens)},UX=(e,t,r,n,o)=>{let s=sh(t);Mu(s,e,r.param,r.negated);for(let i=s.take();i;i=s.take()){if(ih(i)){let a=B$(i,o);if(a!==void 0)Mu(s,i,a.param,a.negated);continue}if(i._tag==="Value")return n.has(i.value)}return!1},G$=(e,t,r)=>{let n=iS(r.params),o=[],s=(i,a,c)=>{let l=Ec(IX(a)),u=Ec(FX(a)),f=X$(a.subcommands),d=sh(i),h=[],m=!0;for(let b=d.take();b;b=d.take()){if(ih(b)){let x=B$(b,c);if(x!==void 0){nS(h,d,b,x);continue}let O=Sc(b,u);if(O!==void 0){nS(h,d,b,O);continue}let S=Sc(b,l),y=Sc(b,r);if(S!==void 0){if(y===void 0||!m||!UX(b,d.rest(),S,f,[l,u,r])){nS(h,d,b,S);continue}}if(y!==void 0){let g=Mu(d,b,y.param,y.negated);if(g._tag==="Error"){o.push(g.error);continue}if(g.value!==void 0)n[y.param.name].push(g.value);continue}h.push(b);continue}if(b._tag==="Value"&&m){let x=f.get(b.value);if(x!==void 0)return h.push(b),h.push(...s(d.rest(),x,[...c,u])),h;m=!1}h.push(b)}return h};return{flagMap:n,remainder:s(e,t,[]),errors:o}},DX=(e,t,r)=>{let n=e._tag==="LongOption"?`--${e.name}`:`-${e.flag}`,o=[];for(let i of t){if(i.hidden)continue;if(o.push(i.name),Np(i.primitiveType))o.push(`no-${i.name}`);for(let a of i.aliases)o.push(a)}let s=rS(j$(e),o).map((i)=>i.length===1?`-${i}`:`--${i}`);return new Mi({option:n,suggestions:s,command:r})},MX=(e)=>({flags:$X(e.params),arguments:[],errors:[],mode:{_tag:"AwaitingFirstValue"}}),NX=(e)=>({_tag:"Leaf",flags:e.flags.snapshot(),arguments:e.arguments,errors:e.errors}),ZX=(e,t,r,n)=>{let{command:o,commandPath:s,inheritedFlagRegistry:i,localFlagNames:a}=r,c=X$(o.subcommands),l=c.get(e);if(l){let f=[...s,l.name],d=n.flags.snapshot();for(let m of a){let b=d[m];if(b!==void 0&&b.length>0)n.errors.push(new Mi({option:`--${m}`,suggestions:[],command:f}))}let h=RX(t.rest(),i);return n.flags.merge(h.flagMap),n.errors.push(...h.errors),{_tag:"Subcommand",result:{_tag:"Sub",flags:n.flags.snapshot(),sub:l,childTokens:h.remainder,errors:n.errors}}}if(!(He(o).config.arguments.length>0)&&c.size>0){let f=[];for(let[h,m]of c)if(!m.unlisted)f.push(h);let d=rS(e,f);n.errors.push(new Dp({subcommand:e,parent:s,suggestions:d}))}return{_tag:"Argument"}},qX=(e,t,r,n)=>{let{commandPath:o,flagRegistry:s}=r,i=Sc(e,s);if(!i){n.errors.push(DX(e,s.params,o));return}let a=V$(t,e,i.param,i.negated);if(a._tag==="Error"){n.errors.push(a.error);return}n.flags.add(i.param.name,a.value)},WX=(e,t,r,n)=>{if(n.mode._tag==="AwaitingFirstValue"){let o=ZX(e,t,r,n);if(o._tag==="Subcommand")return o.result;n.mode={_tag:"CollectingArguments"}}n.arguments.push(e);return},LX=(e,t)=>{let r=sh(e),n=MX(t.flagRegistry);for(let o=r.take();o;o=r.take()){if(ih(o)){qX(o,r,t,n);continue}if(o._tag==="Value"){let s=WX(o.value,r,t,n);if(s)return s}}return NX(n)};var Y$=E(()=>{ae();ze();wu();Jn();dc();xc()});var K$,XX=(e,t)=>{let r=e;for(let n of t.slice(1)){let o=r.subcommands.flatMap((s)=>s.commands).find((s)=>s.name===n||s.alias===n);if(o===void 0)break;r=o}return r},e1,jX=(e)=>e.subcommands.some((r)=>r.commands.some((n)=>!n.unlisted))||He(e).config.orderedParams.length>0,H$,VX=(e)=>{let t=GX(e);switch(e.primitiveType._tag){case"Boolean":return K(Or(Oy({message:t,label:{confirm:"true",deny:"false"},placeholder:{defaultConfirm:"(T/f)",defaultDeny:"(t/F)"}})),(r)=>Kn(String(r)));case"Choice":{let r=Xo(e.primitiveType)??[];return K(Or(xy({message:t,choices:r.map((n)=>({title:n,value:n}))})),Kn)}case"Date":return K(Or(I_({message:t})),(r)=>Kn(r.toISOString()));case"Float":return K(Or(F_({message:t})),(r)=>Kn(String(r)));case"Integer":return K(Or(gy({message:t})),(r)=>Kn(String(r)));case"Redacted":return K(Or(U_({message:t})),(r)=>Kn(dv(r),"<redacted>"));default:return K(Or(D_({message:t})),Kn)}},Kn=(e,t=e)=>({value:e,displayValue:t}),BX=(e)=>e.kind===Hn?`--${e.name}`:e.name,GX=(e)=>aS(e),aS=(e)=>{let t=ur(e.description)?.trim(),r=e.kind===Hn&&t!==void 0&&t.length<=32?t:YX(e.name);return e.kind===Hn?`${r} (${BX(e)})`:r},YX=(e)=>{let t=e.split(/[-_]+/).filter((r)=>r.length>0);if(t.length===0)return e;return[t[0][0].toUpperCase()+t[0].slice(1),...t.slice(1)].join(" ")},ah=(e)=>Wt(o1("Current command",e.map((t)=>t.displayValue),b_)),J$=(e,t)=>`${De(e.toUpperCase(),jo,pc)} ${De("\xB7",Qu)} ${De(t,jo,qi)}`,t1=(e,t,r)=>[`${De(e,jo,pc)} ${De(`v${t}`,qi)} ${De("\xB7 Command wizard",jo,qi)}`,...r===void 0||r.length===0?[]:[r],De("Build a command interactively. Press Ctrl+C to cancel.",Qu),""].join(`
|
|
108
|
+
`),r1=(e)=>o1("Command ready",e,pc,Lp),n1=()=>`
|
|
109
|
+
${De("Wizard cancelled.",Wp)}`,o1=(e,t,r,n=qi)=>{let o=HX(t);return[De(e,jo,n),...o.map((s)=>De(s,r)),""].join(`
|
|
110
|
+
`)},HX=(e)=>{let o=e.map(JX),s=[],i=" $ ";for(let a of o){let c=i===" $ "||i===" "?"":" ";if(i.length+c.length+a.length>88&&i!==" $ ")s.push(`${i} \\`),i=` ${a}`;else i+=`${c}${a}`}if(i!==" $ ")s.push(i);return s},JX=(e)=>/^[A-Za-z0-9_./:@%+=,-]+$/.test(e)?e:`'${e.replaceAll("'",`'"'"'`)}'`;var s1=E(()=>{Hp();ae();ze();vg();Jn();dc();vy();xc();K$=z(function*(e,t){let r=t?.commandPath??[e.name],n=XX(e,r),o=(t?.prefix??r).map((s)=>Kn(s));return yield*ah(o),yield*e1(n,o,n===e?"ROOT":n.name),{args:o.map((s)=>s.value),displayArgs:o.map((s)=>s.displayValue)}}),e1=z(function*(e,t,r){let n=He(e),o=e.subcommands.flatMap((a)=>a.commands.filter((c)=>!c.unlisted)),s=o.length===0?n.config:n.contextConfig;if(s.flags.length>0){yield*Wt(J$(r,"FLAGS"));for(let a of s.flags)t.push(...yield*H$(a));if(s.arguments.length>0||o.length>0)yield*ah(t)}if(s.arguments.length>0){yield*Wt(J$(r,"ARGUMENTS"));for(let a of s.arguments)t.push(...yield*H$(a));if(o.length>0)yield*ah(t)}if(o.length===0)return;let i=yield*Or(xy({message:"Command",choices:o.map((a)=>({title:a.name,value:a,...a.shortDescription!==void 0?{description:a.shortDescription}:a.description!==void 0?{description:a.description}:{}}))}));if(yield*Wt(),t.push(Kn(i.name)),jX(i))yield*ah(t);yield*e1(i,t,i.name)}),H$=z(function*(e){let t=Bp(e),r=gr(e);if(r.isOptional){if(!(yield*Or(Oy({message:`Set ${aS(t)}?`,initial:!1}))))return yield*Wt(),[]}let n=!r.isVariadic?1:yield*Or(gy({message:`${aS(t)} count`,default:bt(r.variadicMin,()=>0),min:bt(r.variadicMin,()=>0),...tt(r.variadicMax)?{max:r.variadicMax.value}:{}})),o=[];for(let i=0;i<n;i++)o.push(yield*VX(t));let s=t.kind===Hn?{flags:{[t.name]:o.map((i)=>i.value)},arguments:[]}:{flags:{},arguments:o.map((i)=>i.value)};if(yield*e.parse(s),yield*Wt(),t.kind===_u)return o;return o.flatMap((i)=>[Kn(`--${t.name}`),i])})});var e5=(e)=>G(e,Du),ch=(e,t,r)=>{let n=jy(t??{});return eh({name:e,config:n,...wt(r)?{handle:r}:{}})},t5=(e)=>{let t=[],r=new Map,n=(i,a)=>{t.push(a);let c=r.get(i);if(c)c.push(a);else r.set(i,[a])};for(let i of e){if(e5(i)){n(void 0,i);continue}for(let a of i.commands)n(i.group,a)}let o=[],s=r.get(void 0);if(s&&s.length>0)o.push({group:void 0,commands:s});for(let[i,a]of r){if(i===void 0)continue;o.push({group:i,commands:a})}return{flat:t,groups:o}},r5,lh,n5=(e,t,r,n)=>{let o=new Set(t),s=[],i=new Set;for(let a of e){if(o.has(a))continue;let c=Me(a.flag);for(let l of c){let u=r[l.name];if(!u||u.length===0)continue;let f=`--${l.name}`;if(i.has(f))continue;i.add(f),s.push(new Mi({option:f,suggestions:[],command:n}))}}return s},o5=(e,t,r)=>We(function*(){let{builtIns:n}=yield*oh,o=yield*Oc,s=yield*rh(e,t.commandPath,n);if(yield*Wt(o.formatHelpDoc(s)),r&&t.errors.length>0)yield*Iy(o.formatErrors(t.errors))}),s5=(e)=>We(function*(){let t=yield*Oc;yield*Iy(t.formatError(e)),e[Oi]=!1}),i5,i1=(e,t)=>{let r=He(e);return z(function*(n){let{builtIns:o}=yield*oh,{tokens:s,trailingOperands:i}=W$(n),a=U$(e,o),c=a.flatMap((w)=>Me(w.flag)),l=Ec(c.filter(Vi)),{flagMap:u,remainder:f,errors:d}=G$(s,e,l),h={flags:u,arguments:[]},m=yield*sS({tokens:f,trailingOperands:i},e),b=[e.name,...oS(m)],x={builtIns:o,command:e,commandPath:b,version:t.version},O=Jy(e,b,o),S=n5(a,O,u,b);if(S.length>0||d.length>0){let w=m.errors??[];return yield*new Ls({commandPath:b,errors:[...d,...S,...w]})}for(let w of O){if(w._tag!=="Action")continue;if(!Me(w.flag).some((R)=>{let A=u[R.name];return A!==void 0&&A.length>0}))continue;let[,F]=yield*w.flag.parse(h);if(w===eS)return yield*We(function*(){yield*Wt(t1(e.name,t.version,e.description));let R=[e.name,...n.filter((j)=>j!=="--wizard"&&!j.startsWith("--wizard="))],A=yield*K$(e,{commandPath:b,prefix:R});if(yield*Wt(r1(A.displayArgs)),yield*Or(M_({message:"Run this command?",initial:!0,active:"yes",inactive:"no"})))yield*Wt(),yield*i1(e,{...t,renderErrors:!1})(A.args.slice(1))}).pipe(wa("QuitError",()=>Wt(n1())));yield*w.run(F,x);return}if(m.errors&&m.errors.length>0)return yield*new Ls({commandPath:b,errors:m.errors});let y=yield*Qk(r.parse(m));if(y._tag==="Failure")return yield*new Ls({commandPath:b,errors:[y.failure]});let g=r.handle(y.success,[e.name]),C=O.includes(yc)?(yield*yc.flag.parse(h))[1]:L();g=hi(g,yc,C);for(let w of O){if(w._tag!=="Setting"||w===yc)continue;let[,_]=yield*w.flag.parse(h);g=hi(g,w,_)}let Q=er(C,{onNone:()=>Tn(),onSome:(w)=>ho(hk,w)});yield*ys(g,Q)},Vf((n)=>fy(n)&&n._tag==="ShowHelp"?gt(n):ut(n),(n)=>an(o5(e,n,t.renderErrors!==!1),N(n))),Vf((n)=>t.renderErrors!==!1&&fy(n)&&n._tag==="UserError"?gt(n):ut(n),(n)=>an(s5(n),N(n))),Vf((n)=>_v(n)?gt(n):ut(n),(n)=>Yf))};var c1=E(()=>{Hp();lt();ae();oe();ze();ye();mk();Oo();ed();bg();ep();Z$();wu();Dy();tS();xc();By();Ky();Y$();s1();Jn();vy();r5=v(2,(e,t)=>{let r=t5(t);R$(e,r.flat);let n=He(e),o=new Map(r.flat.map((c)=>[c.name,He(c)])),s=Symbol("effect/cli/SubcommandState"),i=z(function*(c){if(Lt(c.subcommand))return yield*n.parse(c);let l=o.get(c.subcommand.value.name);if(!l)return yield*n.parse(c);let u=yield*n.parseContext(c),f=yield*l.parse(c.subcommand.value.parsedInput);return{...u,[s]:{name:l.name,result:f}}}),a=z(function*(c,l){let f=c[s];if(f){let d=o.get(f.name);if(!d)return yield*new Ls({commandPath:l,errors:[]});return yield*d.handle(f.result,[...l,d.name]).pipe(hi(n.service,c))}return yield*n.handle(c,l)});return eh({name:n.name,config:n.config,contextConfig:n.contextConfig,description:n.description,shortDescription:n.shortDescription,alias:n.alias,unlisted:n.unlisted,annotations:n.annotations,globalFlags:n.globalFlags,examples:n.examples,service:n.service,subcommands:r.groups,parse:i,parseContext:n.parseContext,handle:a})}),lh=v(2,(e,t)=>eh({...He(e),description:t})),i5=v(2,(e,t)=>Xd.use(({args:r})=>H(r,(n)=>i1(e,t)(n))))});var l1=E(()=>{f$();c1();Xy()});var u1=(e)=>{let t=e?.trim();return t===void 0||t.length===0?void 0:t},f1=()=>({bunExecutable:u1(process.env.TRIPWIRE_BUN),forcePortable:process.env.TRIPWIRE_FORCE_PORTABLE==="1",packageDist:u1(process.env.TRIPWIRE_PACKAGE_DIST)}),d1=()=>({...process.env});var cS=()=>{};import{lstat as x1,mkdir as a5,open as c5,readFile as Nu,readlink as l5,realpath as u5,rename as y1,rm as uh,stat as f5,symlink as p1}from"fs/promises";import{homedir as qu}from"os";import Gi from"path";import{fileURLToPath as h1}from"url";var m1,S1,eo=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),bc=(e,t)=>e instanceof Error&&("code"in e)&&e.code===t,Zu=async(e,t,r={})=>{let n=e,o=!1;try{o=(await x1(e)).isSymbolicLink()}catch(c){if(!bc(c,"ENOENT"))throw c}if(o)n=await u5(e);let s=`${n}.${process.pid}.next`,i,a=384;try{a=(await f5(n)).mode&4095}catch(c){if(!bc(c,"ENOENT"))throw c}await uh(s,{force:!0});try{i=await c5(s,"wx",a),await i.writeFile(t,"utf8"),await i.chmod(a),await i.sync(),await i.close(),i=void 0,await r.beforeRename?.(s,n),await y1(s,n)}finally{try{if(i!==void 0)await i.close()}finally{await uh(s,{force:!0})}}},d5=(e)=>eo(e)&&typeof e.type==="string"&&typeof e.command==="string"&&(e.timeout===void 0||typeof e.timeout==="number"),O1=(e)=>Array.isArray(e)&&e.every((t)=>eo(t)&&Array.isArray(t.hooks)&&t.hooks.every(d5)),p5=(e)=>{if(!eo(e))return!1;let{hooks:t}=e;if(t===void 0)return!0;return eo(t)&&(t.PreToolUse===void 0||O1(t.PreToolUse))&&(t.PostToolUse===void 0||O1(t.PostToolUse))},lS=(e,t)=>{let r=JSON.parse(e);if(!p5(r))throw Error(`${t} hook config has an unsupported shape`);return r},h5=(e)=>{let t=JSON.parse(e);if(!eo(t))throw Error("Cursor hooks.json must contain a JSON object");let{hooks:r}=t;if(r===void 0)return t;if(!eo(r))throw Error("Cursor hooks.json `hooks` must be an object");for(let[n,o]of Object.entries(r))if(!Array.isArray(o)||o.some((s)=>!eo(s)||typeof s.command!=="string"))throw Error(`Cursor hooks.json event ${n} must contain command hooks`);return t},Yi="tripwire-hook",E1=async(e,t)=>{await a5(Gi.dirname(t),{recursive:!0});try{if(!(await x1(t)).isSymbolicLink())return{action:"already",success:!1};let n=await l5(t);if(n===e)return{action:"already",success:!0};let o=Gi.resolve(Gi.dirname(t),n);if(Gi.basename(o)!=="tripwire-pi.js")return{action:"already",success:!1};let s=`${t}.${process.pid}.next`;await uh(s,{force:!0});try{await p1(e,s),await y1(s,t)}finally{await uh(s,{force:!0})}return{action:"updated",success:!0}}catch(r){if(!(r instanceof Error&&("code"in r)&&r.code==="ENOENT"))throw r;return await p1(e,t),{action:"installed",success:!0}}},m5,O5,fh=(e)=>e===Yi||e.startsWith(`${Yi} `)||e.includes("/tripwire-darwin-arm64/")||e.includes("/tripwire-hook")||e.includes("/tripwire.js")||e.includes("/dist/tripwire"),g5=(e,t,r=Yi)=>{let n=O5.has(t),o={command:`${r} --cursor-event ${t}`,...n&&{failClosed:!0}};if(e===void 0)return[[o],!0];let s=!1,i=e.some((l)=>fh(l.command)),a=`${r} --cursor-event ${t}`,c=e.map((l)=>{if(!fh(l.command))return l;if(l.command===a&&(!n||l.failClosed===!0))return l;return s=!0,{...l,command:a,...n&&{failClosed:!0}}});if(i)return[c,s];return[[...c,o],!0]},dh=(e,t=Yi)=>{if(!e)return[[{hooks:[{type:"command",command:t}]}],!1];let r=!1,n=e.map((i)=>({...i,hooks:i.hooks.map((a)=>{if(fh(a.command)){if(a.command!==t)return r=!0,{...a,command:t};return a}return a})}));if(n.some((i)=>i.hooks.some((a)=>a.command===t)))return[n,!r];return[[...n,{hooks:[{type:"command",command:t}]}],!1]},uS=async(e={})=>{let t=e.homeDirectory??qu(),r=e.hookCommand??Yi,n=`${t}/.claude/settings.json`;try{let o=await Nu(n,"utf8"),s=lS(o,"Claude");s.hooks??={};let[i,a]=dh(s.hooks.PreToolUse,r),[c,l]=dh(s.hooks.PostToolUse,r);if(s.hooks.PreToolUse=i,s.hooks.PostToolUse=c,a&&l)return{success:!0,message:`Already configured: ${n}`};return await Zu(n,`${JSON.stringify(s,null,2)}
|
|
111
|
+
`),{success:!0,message:`Updated ${n}`}}catch(o){if(bc(o,"ENOENT"))return{success:!1,message:`Config file not found: ${n}`};return{success:!1,message:`Failed to update Claude config: ${o instanceof Error?o.message:String(o)}`}}},fS=async(e={})=>{let t=e.homeDirectory??qu(),r=`${t}/.pi/agent/settings.json`,n=`${t}/.pi/agent/extensions/tripwire.js`;try{let o=e.extensionSource??S1.find((f)=>Bun.file(f).size>0);if(o===void 0)return{success:!1,message:"Built Pi extension not found; run `bun run build` first"};let s=await Nu(r,"utf8"),i=lS(s,"Pi");if(i.hooks!==void 0){let{PreToolUse:f,PostToolUse:d,...h}=i.hooks,m=(S)=>S?.map((y)=>({...y,hooks:y.hooks.filter((g)=>!fh(g.command))})).filter((y)=>y.hooks.length>0)??[],b=m(f),x=m(d),O={...h,...b.length>0&&{PreToolUse:b},...x.length>0&&{PostToolUse:x}};if(Object.keys(O).length===0){let{hooks:S,...y}=i;i=y}else i.hooks=O}let a=`${JSON.stringify(i,null,2)}
|
|
112
|
+
`,c=a!==s,l=await E1(o,n);if(!l.success)return{success:!1,message:`Refusing to replace existing Pi extension: ${n}`};if(c)await Zu(r,a);if(l.action==="already"&&!c)return{success:!0,message:`Already configured: ${n}`};return{success:!0,message:`${l.action==="updated"?"Updated":"Installed"} ${n}`}}catch(o){if(bc(o,"ENOENT"))return{success:!1,message:`Config file not found: ${r}`};return{success:!1,message:`Failed to update pi config: ${o instanceof Error?o.message:String(o)}`}}},dS=async(e={})=>{let r=`${e.homeDirectory??qu()}/.omp/agent/extensions/tripwire.js`;try{let n=e.extensionSource??S1.find((i)=>Bun.file(i).size>0);if(n===void 0)return{success:!1,message:"Built Pi extension not found; run `bun run build` first"};let o=await E1(n,r);if(!o.success)return{success:!1,message:`Refusing to replace existing oh-my-pi extension: ${r}`};if(o.action==="already")return{success:!0,message:`Already configured: ${r}`};return{success:!0,message:`${o.action==="updated"?"Updated":"Installed"} ${r}`}}catch(n){return{success:!1,message:`Failed to install oh-my-pi extension: ${n instanceof Error?n.message:String(n)}`}}},g1=(e)=>{let t=Bun.TOML.parse(e),r=eo(t)?t.features:void 0;if(r!==void 0&&!eo(r))throw Error("Codex config.toml `features` must be a table");return r},x5=(e)=>{if(g1(e)?.hooks===!0)return e;let t=e.includes(`\r
|
|
133
113
|
`)?`\r
|
|
134
114
|
`:`
|
|
135
|
-
`,
|
|
115
|
+
`,r=/^[\t ]*\[features\][\t ]*(?:#.*)?(?:\r?\n|$)/mu.exec(e),n;if(r===null){let o=e.length===0||e.endsWith(`
|
|
136
116
|
`)?"":t,s=e.length===0||e.endsWith(`
|
|
137
|
-
`)?t:"";
|
|
138
|
-
`)?`hooks = true${t}`:`${t}hooks = true`;
|
|
139
|
-
`,d=
|
|
140
|
-
`),{success:!0,message:`Updated ${
|
|
141
|
-
`);
|
|
117
|
+
`)?t:"";n=`${e}${o}[features]${t}hooks = true${s}`}else{let o=r.index+r[0].length,s=/^[\t ]*\[/gmu;s.lastIndex=o;let a=s.exec(e)?.index??e.length,c=e.slice(o,a),l=/^(?<prefix>[\t ]*hooks[\t ]*=[\t ]*)(?<value>[^#\r\n]*?)(?<suffix>[\t ]*(?:#.*)?)$/mu.exec(c);if(l===null){let f=r[0].endsWith(`
|
|
118
|
+
`)?`hooks = true${t}`:`${t}hooks = true`;n=`${e.slice(0,o)}${f}${e.slice(o)}`}else{let u=l.groups?.prefix,f=l.groups?.value;if(u===void 0||f===void 0)throw Error("Could not locate Codex hooks value in config.toml");let d=o+l.index+u.length,h=d+f.length;n=`${e.slice(0,d)}true${e.slice(h)}`}}if(g1(n)?.hooks!==!0)throw Error("Could not enable Codex hooks in config.toml");return n},pS=async(e={})=>{let t=e.homeDirectory??qu(),r=e.hookCommand??Yi,n=`${t}/.codex/config.toml`,o=`${t}/.codex/hooks.json`;try{let[s,i]=await Promise.all([Nu(o,"utf8"),Nu(n,"utf8")]),a=lS(s,"Codex");a.hooks??={};let[c]=dh(a.hooks.PreToolUse,r),[l]=dh(a.hooks.PostToolUse,r),u=(b)=>b.map((x)=>({...x,hooks:x.hooks.map((O)=>O.command===r&&O.timeout===void 0?{...O,timeout:10}:O)}));a.hooks.PreToolUse=u(c),a.hooks.PostToolUse=u(l);let f=`${JSON.stringify(a,null,2)}
|
|
119
|
+
`,d=x5(i),h=f!==s,m=d!==i;if(h)await Zu(o,f);if(m)await Zu(n,d);if(!h&&!m)return{success:!0,message:`Already configured: ${n} and ${o}`};return{success:!0,message:`Updated ${n} and ${o}`}}catch(s){if(bc(s,"ENOENT"))return{success:!1,message:`Config file not found: ${eo(s)&&typeof s.path==="string"?s.path:`${n} or ${o}`}`};return{success:!1,message:`Failed to update Codex config: ${s instanceof Error?s.message:String(s)}`}}},hS=async(e={})=>{let t=e.homeDirectory??qu(),r=e.hookCommand??Yi,n=`${t}/.cursor/hooks.json`;try{let o=await Nu(n,"utf8"),s=h5(o);s.version??=1,s.hooks??={};let i=!1;for(let a of m5){let[c,l]=g5(s.hooks[a],a,r);s.hooks[a]=c,i||=l}if(!i)return{success:!0,message:`Already configured: ${n}`};return await Zu(n,`${JSON.stringify(s,null,2)}
|
|
120
|
+
`),{success:!0,message:`Updated ${n}`}}catch(o){if(bc(o,"ENOENT"))return{success:!1,message:`Config file not found: ${n}`};return{success:!1,message:`Failed to update Cursor hooks.json: ${o instanceof Error?o.message:String(o)}`}}},b1=async(e={})=>[{target:"claude",...await uS(e)},{target:"codex",...await pS(e)},{target:"cursor",...await hS(e)},{target:"pi",...await fS(e)},{target:"oh-my-pi",...await dS(e)}];var k1=E(()=>{cS();({packageDist:m1}=f1()),S1=[...m1===void 0?[]:[Gi.join(m1,"tripwire-pi.js")],Gi.join(Gi.dirname(process.execPath),"tripwire-pi.js"),h1(new URL("../../dist/tripwire-pi.js",import.meta.url)),h1(new URL("tripwire-pi.js",import.meta.url))],m5=["preToolUse","postToolUse","beforeShellExecution","afterShellExecution","beforeReadFile","afterFileEdit"],O5=new Set(["preToolUse","beforeShellExecution","beforeReadFile"])});import{readFile as y5}from"fs/promises";var kc,S5=(e)=>xt({try:()=>new TextDecoder("utf-8",{fatal:!0}).decode(e),catch:()=>new kc({message:"The checked script is not valid UTF-8, so Tripwire cannot parse it."})}),E5=(e)=>pi({try:()=>y5(e),catch:(t)=>new kc({message:`Tripwire could not read the checked script: ${String(t)}`})}),b5=()=>hp().pipe(H((e)=>e.ok?T(e.config):N(new kc({message:`Tripwire configuration failed to load: ${e.error}`})))),k5=(e,t)=>pi({try:async()=>{let r=Bun.spawn(["/bin/bash","-s","--",...t],{cwd:process.cwd(),env:d1(),stderr:"inherit",stdin:"pipe",stdout:"inherit"});return await r.stdin.write(e),await r.stdin.end(),r.exited},catch:(r)=>new kc({message:`Tripwire could not start the checked script: ${String(r)}`})}),P1=(e,t)=>We(function*(){let n=yield*E5(e),o=yield*S5(n),s=yield*b5(),i=r_(o,s,{cwd:process.cwd(),positionalArguments:t});if(i.kind==="deny"||i.kind==="ask")return yield*new kc({message:`[tripwire:${i.rule}] ${i.message}`});if(i.kind==="warn")process.stderr.write(`[tripwire:${i.rule}] ${i.message}
|
|
121
|
+
`);return process.exitCode=yield*k5(n,t),yield*ue});var w1=E(()=>{Zn();cy();px();cS();kc=class kc extends Fr("CheckedScriptError"){}});import T1 from"path";var v1=()=>{if(/(?:^|[/\\])bun(?:\.exe)?$/iu.test(process.execPath)){let t=import.meta.filename;if(T1.basename(t)==="tripwire.js")return[process.execPath,t,"--tripwire-hook"];let r=T1.join(import.meta.dirname,"..","main.ts");return[process.execPath,r,"--tripwire-hook"]}return[process.execPath,"--tripwire-hook"]},P5=(e)=>/^[A-Za-z0-9_/:=.,+@%-]+$/u.test(e)?e:`'${e.replaceAll("'",String.raw`'\''`)}'`,w5=()=>v1().map((e)=>P5(e)).join(" "),T5=(e,t,r,n)=>{if(e==="Bash")return{command:t??""};if(e==="Read")return{file_path:r??""};if(e==="Write")return{file_path:r??"",content:n??""};if(e==="Edit"||e==="MultiEdit")return{file_path:r??"",old_string:"",new_string:n??""};return null},v5=(e)=>{let{tool:t,post:r,command:n,path:o,stdout:s,stderr:i,content:a}=e,c=r?"PostToolUse":"PreToolUse",l=T5(t,n,o,a),u={hook_event_name:c,tool_name:t,cwd:process.cwd(),session_id:"tripwire-cli-test",...l!==null&&{tool_input:l}};if(r)u.tool_response=t==="Bash"?{stdout:s??"",stderr:i??""}:{content:a??""};return u},C5=(e)=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},Q5=(e)=>ne(()=>{let{command:t,content:r,path:n,post:o,stderr:s,stdout:i,tool:a}=e,c=v5({tool:a,post:o,command:t,path:n,stdout:i,stderr:s,content:r}),l=Bun.spawnSync(v1(),{stdin:new TextEncoder().encode(JSON.stringify(c)),timeout:1e4,stdout:"pipe",stderr:"pipe"});if(l.exitCode!==0){let f=new TextDecoder().decode(l.stderr);process.stderr.write(`error: ${f}
|
|
122
|
+
`),process.exit(1)}let u=new TextDecoder().decode(l.stdout);process.stdout.write(`${C5(u)}
|
|
123
|
+
`)}),_5,$5=(e)=>We(function*(){if(!["claude","codex","cursor","pi","oh-my-pi","omp","all"].includes(e))process.stderr.write(`error: unknown target "${e}"
|
|
124
|
+
`),process.stderr.write(`Valid targets: claude, codex, cursor, pi, oh-my-pi, all
|
|
125
|
+
`),process.exit(1);let r,n={hookCommand:w5()};switch(e){case"claude":{r=[{target:"claude",result:yield*gs(()=>uS(n))}];break}case"codex":{r=[{target:"codex",result:yield*gs(()=>pS(n))}];break}case"pi":{r=[{target:"pi",result:yield*gs(()=>fS(n))}];break}case"oh-my-pi":case"omp":{r=[{target:"oh-my-pi",result:yield*gs(()=>dS(n))}];break}case"cursor":{r=[{target:"cursor",result:yield*gs(()=>hS(n))}];break}case"all":{r=(yield*gs(()=>b1(n))).map((i)=>({target:i.target,result:i}));break}default:{r=[];break}}let o=!1;for(let{target:s,result:i}of r)if(i.success){let a=i.message.startsWith("Already configured")?"\u2299":"\u2713";process.stdout.write(`${a} [${s}] ${i.message}
|
|
126
|
+
`)}else process.stderr.write(`\u2717 [${s}] ${i.message}
|
|
127
|
+
`),o=!0;if(o)process.exit(1)}),A5,R5,I5,F5,U5,D5,C1=async()=>{try{await Dk(D5.pipe(Fk(aD)))}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`${t}
|
|
128
|
+
`),process.exitCode=1}};var Q1=E(async()=>{Ng();Zn();l1();hh();k1();w1();_5=ch("test",{command:Gp("command").pipe(Xz,Yp("Command to test (for Bash tool)")),content:Fu("content").pipe(Bi,rn("Content for Write/Edit tools")),path:Fu("path").pipe(Bi,rn("File path for Read/Write/Edit tools")),post:Uu("post").pipe(gc(!1),rn("Test PostToolUse instead of PreToolUse")),stderr:Fu("stderr").pipe(Bi,rn("Stderr for PostToolUse Bash")),stdout:Fu("stdout").pipe(Bi,rn("Stdout for PostToolUse Bash")),tool:Fu("tool").pipe(gc("Bash"),rn("Tool name (Bash, Read, Write, Edit, MultiEdit)"))},({command:e,content:t,path:r,post:n,stderr:o,stdout:s,tool:i})=>Q5({command:ur(e),content:ur(t),path:ur(r),post:n,stderr:ur(o),stdout:ur(s),tool:i})).pipe(lh("Test a synthetic hook event")),A5=ch("install",{target:Gp("target").pipe(Yp("Target agent (claude, codex, cursor, pi, oh-my-pi, or all)"))},({target:e})=>$5(e)).pipe(lh("Install tripwire hooks for AI agents")),R5=Gp("script").pipe(Yp("Bash script file to inspect and execute from the checked bytes")),I5=Gp("argument").pipe(jz(),Yp("Arguments passed to the script after --")),F5=ch("run-script",{script:R5,trailingArguments:I5},({script:e,trailingArguments:t})=>P1(e,t)).pipe(lh("Inspect one script snapshot, then execute those exact bytes with Bash")),U5=ch("tripwire").pipe(lh("Opinionated hooks dispatcher for AI coding agents"),r5([_5,A5,F5])),D5=i5(U5,{version:Wu.version})});var _1=async()=>{await Q1();await C1()};var $1=async()=>{};hh();import M5 from"path";var N5="--tripwire-hook",Z5="--tripwire-force-cli",A1=process.argv.indexOf(Z5,2),R1=A1!==-1;if(R1)process.argv.splice(A1,1);var ph=process.argv.slice(2),q5=M5.basename(process.argv0),W5=!R1&&(q5==="tripwire-hook"||ph.includes(N5)||ph.some((e)=>e.startsWith("--cursor-event")));if(W5){await Promise.resolve().then(() => cy());s_()}else if(ph.length===1&&ph[0]==="--version")process.stdout.write(`${Wu.version}
|
|
129
|
+
`);else{await $1();await _1()}
|