@llm4ts/shell 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cli.d.ts +1 -1
- package/dist/Cli.d.ts.map +1 -1
- package/dist/Cli.js +11 -2
- package/dist/Cli.js.map +1 -1
- package/dist/Watch.d.ts +8 -0
- package/dist/Watch.d.ts.map +1 -1
- package/dist/Watch.js +6 -4
- package/dist/Watch.js.map +1 -1
- package/dist/WebFrame.d.ts +283 -0
- package/dist/WebFrame.d.ts.map +1 -0
- package/dist/WebFrame.js +124 -0
- package/dist/WebFrame.js.map +1 -0
- package/dist/WebWatch.d.ts +63 -0
- package/dist/WebWatch.d.ts.map +1 -0
- package/dist/WebWatch.js +226 -0
- package/dist/WebWatch.js.map +1 -0
- package/dist/WebWatchView.d.ts +51 -0
- package/dist/WebWatchView.d.ts.map +1 -0
- package/dist/WebWatchView.js +229 -0
- package/dist/WebWatchView.js.map +1 -0
- package/package.json +5 -4
- package/src/Cli.ts +18 -4
- package/src/Watch.ts +8 -4
- package/src/WebFrame.ts +145 -0
- package/src/WebWatch.ts +398 -0
- package/src/WebWatchView.ts +322 -0
- package/web/app.js +25 -0
- package/web/fonts/Geist-Variable.woff2 +0 -0
- package/web/fonts/GeistMono-Variable.woff2 +0 -0
- package/web/fonts/OFL.txt +92 -0
- package/web/index.html +169 -0
- package/web/style.css +1179 -0
package/web/app.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";(()=>{var Z=(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}}},As={pipe(){return Z(this,arguments)}},Dn=(function(){function e(){}return e.prototype=As,e})();var b=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 new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(o){return t(o,n)}};case 3:return function(n,r,o){return arguments.length>=3?t(n,r,o):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)}}}};var F=e=>e;var Ye=e=>()=>e,lt=Ye(!0),vs=Ye(!1);var Xe=Ye(void 0),At=Xe;function $n(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 Yt(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!==n&&t.set(o,o),o}}var Bn=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");let n=Object.getPrototypeOf(e),r=n;for(;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)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},jn=new WeakSet,zn=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);var Mr=0,yi=()=>{Mr++};function _s(e){return typeof e=="string"}function Rr(e){return typeof e=="number"}function Ei(e){return typeof e=="boolean"}function vt(e){return typeof e=="function"}function Os(e){return e!=null}function bi(e){return!0}function Nr(e){return typeof e=="object"&&e!==null||vt(e)}var P=b(2,(e,t)=>Nr(e)&&t in e);var Y="~effect/Hash",N=e=>{switch(typeof e){case"number":return Wn(e);case"bigint":return ke(e.toString(10));case"string":return ke(e);case"function":case"object":{if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?ke("Invalid Date"):ke(e.toISOString());if(e instanceof RegExp)return ke(e.toString());{if(jn.has(e))return Ur(e);let t=Ii.get(e);if(t!==void 0)return t;if(Ms.has(e))return yi(),ke("[Circular]");Ms.add(e);let n=Mr,r;try{Y in e?r=e[Y]():typeof e=="function"?r=Ur(e):e instanceof DataView?r=Dr(zn(e)):Array.isArray(e)||ArrayBuffer.isView(e)?r=Dr(e):e instanceof Map?r=Md(e):e instanceof Set?r=Rd(e):r=Ns(e)}finally{Ms.delete(e)}return n===Mr&&Ii.set(e,r),r}}}return pt(Ci(ke(String(e))))},Ur=e=>(Ps.has(e)||Ps.set(e,pt(Math.random()*4294967296|0)),Ps.get(e)),Ci=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),fe=b(2,(e,t)=>Ci(Math.imul(e,2654435761)+Math.imul(t,2246822507))),pt=e=>e&3221225471|e>>>1&1073741824;var Fs=new DataView(new ArrayBuffer(8)),Wn=e=>{let t=e|0;return t===e?pt(t):(Fs.setFloat64(0,e!==e?NaN:e),pt(fe(Fs.getInt32(0),Fs.getInt32(4))))},ke=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return pt(t)},Rs=(e,t)=>{let n=12289;for(let r of t)n^=fe(N(r),N(e[r]));return pt(n)},Ns=e=>Rs(e,Bn(e)),wi=(e,t)=>n=>{let r=e;for(let o of n)r^=t(o);return pt(r)},Dr=e=>{let t=6151;for(let n of e)t=fe(t,N(n));return pt(t)},Md=wi(ke("Map"),([e,t])=>fe(N(e),N(t))),Ti=ke("Set"),Rd=wi(Ti,e=>fe(Ti,N(e))),Ps=new WeakMap,Ii=new WeakMap,Ms=new WeakSet;var X="~effect/Equal";function le(){return arguments.length===1?e=>Ot(e,arguments[0]):Ot(arguments[0],arguments[1])}function Ot(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||jn.has(e)||jn.has(t)?!1:Nd(e,t)}function Nd(e,t){let n=Lr.length;for(let s=n;s-- >0;)if(Lr[s]===e&&Us[s]===t)return!0;if(n)return ki(e,t);let r=Ai.get(e);r||Ai.set(e,r=new WeakMap);let o=r.get(t);return o===void 0&&r.set(t,o=ki(e,t)),o}function ki(e,t){Lr.push(e),Us.push(t);try{return Ud(e,t)}finally{Lr.pop(),Us.pop()}}var Lr=[],Us=[],Ai=new WeakMap;function Ud(e,t){if(N(e)!==N(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let r=e.getTime(),o=t.getTime();return r===o||Number.isNaN(r)&&Number.isNaN(o)}else if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Oi(e);if(n!==Oi(t)||typeof e=="function"&&!n)return!1;if(n)return e[X](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Dd(e,t);if(ArrayBuffer.isView(e)){let r=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||r!==t instanceof DataView?!1:r?vi(zn(e),zn(t)):vi(e,t)}else{if(e instanceof Map)return!(t instanceof Map)||e.size!==t.size?!1:_i(e,t,$d,Bd);if(e instanceof Set)return!(t instanceof Set)||e.size!==t.size?!1:_i(e,t,N,Ot)}return Ld(e,t)}function Dd(e,t){for(let n=0;n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function vi(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 Ld(e,t){let n=Bn(e),r=Bn(t);if(n.size!==r.size)return!1;for(let o of n)if(!r.has(o)||!Ot(e[o],t[o]))return!1;return!0}function _i(e,t,n,r){let o=new Map;for(let s of t){let a=n(s),u=o.get(a);u?u.push(s):o.set(a,[s])}e:for(let s of e){let a=o.get(n(s));if(a){for(let u=0;u<a.length;u++)if(r(s,a[u])){a[u]=a[a.length-1],a.pop();continue e}}return!1}return!0}var $d=e=>N(e[0]),Bd=(e,t)=>Ot(e[0],t[0])&&Ot(e[1],t[1]);var Oi=e=>P(e,X);var $r=Symbol.for("~effect/Redactable"),jd=e=>P(e,$r);function Br(e){return jd(e)?Ds(e):e}function Ds(e){return e[$r](globalThis[tn]?.context??zd)}var tn="~effect/Fiber/currentFiber",Fi=new Map,zd={"~effect/Context":{},base:Fi,depth:0,mapUnsafe:Fi,pipe(){return Z(this,arguments)}};function J(e,t){let n=t?.space??0,r=new WeakSet,o=n?typeof n=="number"?" ".repeat(n):n:"",s=c=>o.repeat(c),a=(c,f)=>{let h=c?.constructor;return h&&h!==Object.prototype.constructor&&h.name?`${h.name}(${f})`:f},u=c=>{try{return Reflect.ownKeys(c)}catch{return["[ownKeys threw]"]}};function d(c,f=0){try{return g(c,f)}catch{return(typeof c=="object"&&c!==null||typeof c=="function")&&r.delete(c),"[inspection threw]"}}function g(c,f=0){if(typeof c=="string")return JSON.stringify(c);if(typeof c=="number"||c==null||typeof c=="boolean"||typeof c=="symbol")return String(c);if(typeof c=="bigint")return String(c)+"n";if(typeof c=="object"||typeof c=="function"){if(r.has(c))return Wd;r.add(c);let h;if($r in c)h=d(Ds(c),f);else if(Array.isArray(c))h=!o||c.length<=1?`[${c.map(x=>d(x,f)).join(",")}]`:`[
|
|
2
|
+
${s(f+1)}${c.map(x=>d(x,f+1)).join(`,
|
|
3
|
+
`+s(f+1))}
|
|
4
|
+
${s(f)}]`;else if(c instanceof Date)h=qd(c);else if(!t?.ignoreToString&&P(c,"toString")&&typeof c.toString=="function"&&c.toString!==Object.prototype.toString&&c.toString!==Array.prototype.toString){let x=Jd(c);h=c instanceof Error&&c.cause!==void 0?`${x} (cause: ${d(c.cause,f)})`:x}else if(Symbol.iterator in c)h=`${c.constructor.name}(${d(Array.from(c),f)})`;else{let x=u(c);if(!o||x.length<=1){let y=`{${x.map(E=>`${nn(E)}:${d(Pi(c,E),f)}`).join(",")}}`;h=a(c,y)}else{let y=`{
|
|
5
|
+
${x.map(E=>`${s(f+1)}${nn(E)}: ${d(Pi(c,E),f+1)}`).join(`,
|
|
6
|
+
`)}
|
|
7
|
+
${s(f)}}`;h=a(c,y)}}return r.delete(c),h}return String(c)}return d(e,0)}var Wd="[Circular]";function nn(e){return typeof e=="string"?JSON.stringify(e):String(e)}function Mi(e){return e.map(t=>`[${nn(t)}]`).join("")}function qd(e){try{return e.toISOString()}catch{return"Invalid Date"}}function Jd(e){try{let t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function Pi(e,t){try{return e[t]}catch{return"[property access threw]"}}var dt=Symbol.for("nodejs.util.inspect.custom"),et=e=>{try{return e=Br(e),P(e,"toJSON")&&vt(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(et):e}catch{return"[toJSON threw]"}};var ry={toJSON(){return et(this)},[dt](){return this.toJSON()},toString(){return J(this.toJSON())}},Ri=class{[dt](){return this.toJSON()}toString(){return J(this.toJSON())}};var Gd=()=>{let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,"writable")?e.writable===!0:e.set!==void 0},Hd=Gd(),Ft=()=>Error.stackTraceLimit,mt=e=>{Hd&&(Error.stackTraceLimit=e)};var ht=class{constructor(t){this.value=t,this.done=!1}next(t){return this.done?(this.value=t,this):(this.done=!0,{value:this.value,done:!1})}},Vd=()=>{let e="~effect/Utils/internal",t={[e]:o=>o()},n={[e]:o=>o()};return Ft()!==0&&t[e](()=>new Error().stack)?.includes(e)===!0?t[e]:n[e]},Ls=Vd();function rn(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Ni(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&rn(e,n,t[n])}var xt="~effect/Effect",Pt="~effect/Exit",Kd={_A:F,_E:F,_R:F},Li=`${xt}/identifier`,w=`${xt}/args`,G=`${xt}/evaluate`,re=`${xt}/successCont`,$e=`${xt}/failureCont`,Mt=`${xt}/ensureCont`,Rt=Symbol.for("effect/Effect/Yield"),Re={pipe(){return Z(this,arguments)},toJSON(){return{...this}},toString(){return J(this.toJSON(),{ignoreToString:!0,space:2})},[dt](){return this.toJSON()}},my={[Y](){return Rs(this,Object.keys(this))},[X](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]||!le(this[t[r]],e[t[r]]))return!1;return!0}},Qd={[xt]:Kd,...Re,[Symbol.iterator](){return new ht(this)},toJSON(){return{_id:"Effect",op:this[Li],...w in this?{args:this[w]}:void 0}}},Nt=e=>P(e,xt),$i=e=>P(e,Pt),zr="~effect/Cause",jr="~effect/Cause/Reason",Jr=e=>P(e,zr);var tt=class{constructor(t){this[zr]=zr,this.reasons=t}pipe(){return Z(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${J(this.reasons)})`}[dt](){return this.toJSON()}[X](t){return Jr(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,r)=>le(n,t.reasons[r]))}[Y](){return Dr(this.reasons)}},Di=new WeakMap,on=class{[jr];annotations;_tag;constructor(t,n,r){if(this[jr]=jr,this._tag=t,n!==qn&&typeof r=="object"&&r!==null&&n.size>0){let o=Di.get(r);o&&(n=new Map([...o,...n])),Di.set(r,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;let r=new Map(this.annotations);t.mapUnsafe.forEach((s,a)=>{n?.overwrite!==!0&&r.has(a)||r.set(a,s)});let o=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return o.annotations=r,o}pipe(){return Z(this,arguments)}toString(){return J(this)}[dt](){return this.toString()}},qn=new Map,sn=class extends on{constructor(t,n=qn){super("Fail",n,t),this.error=t}toString(){return`Fail(${J(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[X](t){return un(t)&&le(this.error,t.error)&&le(this.annotations,t.annotations)}[Y](){return fe(ke(this._tag))(fe(N(this.error))(N(this.annotations)))}},cn=e=>new tt(e);var Jn=e=>new tt([new sn(e)]),Wr=class extends on{constructor(t,n=qn){super("Die",n,t),this.defect=t}toString(){return`Die(${J(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[X](t){return Bs(t)&&le(this.defect,t.defect)&&le(this.annotations,t.annotations)}[Y](){return fe(ke(this._tag))(fe(N(this.defect))(N(this.annotations)))}},Gr=e=>new tt([new Wr(e)]),Gn=b(e=>Jr(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new tt(e.reasons.map(r=>r.annotate(t,n)))),un=e=>e._tag==="Fail",Bs=e=>e._tag==="Die",Hr=e=>e._tag==="Interrupt";function Zd(e){return We("Effect.evaluate: Not implemented")}var Be=e=>({...Qd,[Li]:e.op,[G]:e[G]??Zd,[re]:e[re],[$e]:e[$e],[Mt]:e[Mt]}),Ge=e=>{let t=Be(e),n=function(r){this[w]=r};return n.prototype=t,function(r){return new n(r)}},Bi=e=>{let t={[Pt]:Pt,_tag:e.op,get[e.prop](){return this[w]},...Be(e),toString(){return`${e.op}(${J(this[w])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[w]}},[X](r){return $i(r)&&r._tag===this._tag&&le(this[w],r[w])},[Y](){return fe(ke(e.op),N(this[w]))}},n=function(r){this[w]=r};return n.prototype=t,function(r){return new n(r)}},q=Bi({op:"Success",prop:"value",[G](e){let t=e.getCont(re);return t?t[re](this[w],e,this):e.yieldWith(this)}}),js={key:"effect/Cause/StackTrace"},ji={key:"effect/Cause/InterruptorStackTrace"},Ae=Bi({op:"Failure",prop:"cause",[G](e){let t=this[w],n=!1;e.cache.stackFrame&&(t=Gn(t,{mapUnsafe:new Map([[js.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont($e);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont($e);return r?r[$e](t,e,n?void 0:this):e.yieldWith(n?Ae(t):this)}}),He=e=>Ae(Jn(e)),We=e=>Ae(Gr(e)),H=Ge({op:"WithFiber",[G](e){return this[w](e)}}),hy=Ge({op:"WithFiberSucceed",[G](e){let t=this[w](e),n=e.getCont(re);return n?n[re](t,e):e.yieldWith(q(t))}}),Yd=(function(){class e extends globalThis.Error{}let t=Be({op:"YieldableError",[G](){return He(this)}});return delete t.toString,Object.assign(e.prototype,t),e})(),Vr=(function(){let e=Symbol.for("effect/Data/Error/plainArgs");return class extends Yd{constructor(n){super(n?.message,n?.cause?{cause:n.cause}:void 0),n&&(Ni(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),nt=e=>{class t extends Vr{_tag=e}return t.prototype.name=e,t},$s="~effect/Cause/NoSuchElementError";var qr=class extends nt("NoSuchElementError"){[$s]=$s;constructor(t){super({message:t})}},an="~effect/Cause/Done",zi=e=>P(e,an),Wi={[an]:an,_tag:"Done",value:void 0},Hn=e=>e===void 0?Wi:{[an]:an,_tag:"Done",value:e},Xd=He(Wi),qi=e=>e===void 0?Xd:He(Hn(e));var Ji=e=>Be({op:e.label,[G]:e.evaluate});var Gi="~effect/Option",Hi={[Gi]:{_A:e=>e},...Re,[Symbol.iterator](){return new ht(this)}},tm=Object.defineProperty(Object.assign(Object.create(Hi),{_tag:"Some",_op:"Some",[X](e){return zs(e)&&qs(e)&&le(this.value,e.value)},[Y](){return fe(N(this._tag))(N(this.value))},toString(){return`some(${J(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:et(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),nm=N("None"),rm=Object.assign(Object.create(Hi),{_tag:"None",_op:"None",valueOrUndefined:void 0,[X](e){return zs(e)&&Ws(e)},[Y](){return nm},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),zs=e=>P(e,Gi),Ws=e=>e._tag==="None",qs=e=>e._tag==="Some",Vi=Object.create(rm),Ki=function(e){this.value=e};Ki.prototype=tm;var Qi=e=>new Ki(e);var Zi="~effect/Result",Yi={[Zi]:{_A:e=>e,_E:e=>e},...Re,[Symbol.iterator](){return new ht(this)}},sm=Object.assign(Object.create(Yi),{_tag:"Success",_op:"Success",[X](e){return Js(e)&&Hs(e)&&le(this.success,e.success)},[Y](){return fe(N(this._tag))(N(this.success))},toString(){return`success(${J(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:et(this.success)}}}),am=Object.assign(Object.create(Yi),{_tag:"Failure",_op:"Failure",[X](e){return Js(e)&&Gs(e)&&le(this.failure,e.failure)},[Y](){return fe(N(this._tag))(N(this.failure))},toString(){return`failure(${J(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:et(this.failure)}}}),Js=e=>P(e,Zi),Gs=e=>e._tag==="Failure",Hs=e=>e._tag==="Success",Xi=function(e){this.failure=e};Xi.prototype=am;var eu=e=>new Xi(e),tu=function(e){this.success=e};tu.prototype=sm;var nu=e=>new tu(e);function ru(e){return(t,n)=>t===n?0:e(t,n)}var ou=ru((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1);var su=b(2,(e,t)=>ru((n,r)=>e(t(n),t(r))));var au=e=>b(2,(t,n)=>e(t,n)===1);var rt=()=>Vi,gt=Qi;var Vs=Ws,cu=qs;var fm=b(2,(e,t)=>Vs(e)?t():e.value);var Kr=fm(Xe);var iu="~effect/Context/Service",Vn=function(){function e(){}let t=e;Object.setPrototypeOf(t,lm);let n=(r,o)=>(t.key=r,o?.defaultValue&&(t[Qs]=Qs,t.defaultValue=o.defaultValue),o?.make&&(t.make=o.make),o?.fiberCached&&uu.add(r),t);return arguments.length>0?n(arguments[0],arguments[1]):n},lm={[iu]:iu,...Ji({label:"Service",evaluate(e){return q(Oe(e.context,this))}}),toJSON(){return{_id:"Service",key:this.key}},of(e){return e},context(e){return Xs(this,e)},use(e){return H(t=>e(Oe(t.context,this)))},useSync(e){return H(t=>q(e(Oe(t.context,this))))}},uu=new Set,Qs="~effect/Context/Reference",fu="~effect/Context",pm=8,dm=8,Zs=(e,t,n,r)=>{let o=Object.create(hm);return o.cacheRoot=e??o,o.base=t,o.overlay=n,o.depth=r,o._flat=void 0,o.baseHits=0,o},lu=(e,t)=>{t&&(lu(e,t.parent),e.set(t.key,t.value))},pu=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return lu(t,e.overlay),e._flat=t},mm=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),Kn(n)},Ys=Symbol(),du=(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);return r===void 0&&!n.base.has(t)?Ys:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=dm&&(n.base=pu(n),n.overlay=void 0,n.depth=0),r)},Kn=e=>Zs(void 0,e,void 0,0),hm={get mapUnsafe(){return pu(this)},...Re,[fu]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[X](e){if(!xm(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)||!le(o,n.get(r)))return!1;return!0},[Y](){return Wn(this.mapUnsafe.size)}},mu=(e,t)=>e.cacheRoot===t.cacheRoot,xm=e=>P(e,fu);var gm=e=>!!e[Qs],Ut=()=>Sm,Sm=Kn(new Map),Xs=(e,t)=>Kn(new Map([[e.key,t]])),ln=b(3,(e,t,n)=>ym(e,t.key,n)),ym=(e,t,n)=>{let r=e,o=uu.has(t)?void 0:r.cacheRoot;if(r.depth>=pm){let s=new Map(r.mapUnsafe);return s.set(t,n),Zs(o,s,void 0,0)}return Zs(o,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)};var Zr=(e,t)=>{let n=du(e,t);return n===Ys?void 0:n},ea=b(2,(e,t)=>{let n=du(e,t.key);if(n===Ys){if(gm(t))return Em(t);throw bm(t)}return n}),Oe=ea,Ks="~effect/Context/defaultValue",Em=e=>Ks in e?e[Ks]:e[Ks]=e.defaultValue(),bm=e=>{let t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(t.stack){let n=t.stack.split(`
|
|
8
|
+
`);n.splice(1,3),t.stack=n.join(`
|
|
9
|
+
`)}return t};var ta=b(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:mm(e,n=>t.mapUnsafe.forEach((r,o)=>n.set(o,r))));var pe=Vn;var eo="~effect/Duration",Tu=BigInt(0),Iu=BigInt(1),Tm=BigInt(2),Im=BigInt(10);var Cm=BigInt(1e3);var to=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Cu=e=>to(e*1e6),hu=(e,t)=>{let n=e.indexOf(".");if(n===-1)return BigInt(e)*t;let r=e[0]==="-",o=e.slice(n+1),s=Im**BigInt(o.length),a=(BigInt(e.slice(r?1:0,n))*s+BigInt(o))*t,u=a/s+(a%s*Tm>=s?Iu:Tu);return r?-u:u};var wm=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,na=e=>{switch(typeof e){case"number":return Eu(e);case"bigint":return Xr(e);case"string":{if(e==="Infinity")return Su;if(e==="-Infinity")return yu;let t=wm.exec(e);if(!t)break;let[n,r,o]=t;if(o==="nano"||o==="nanos")return Xr(hu(r,Iu));if(o==="micro"||o==="micros")return Xr(hu(r,Cm));let s=Number(r);switch(o){case"milli":case"millis":return Eu(s);case"second":case"seconds":return Fm(s);case"minute":case"minutes":return Pm(s);case"hour":case"hours":return Mm(s);case"day":case"days":return Rm(s);case"week":case"weeks":return Nm(s)}break}case"object":{if(e===null)break;if(eo in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Rr)?xu(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Om:e[0]===-1/0||e[1]===-1/0?yu:e[0]===1/0||e[1]===1/0?Su:Ne(to(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?Ne(n):Ne(to(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return xu(e)},xu=e=>{throw new Error(`Invalid Input: ${e}`)};var gu={_tag:"Millis",millis:0},km={_tag:"Infinity"},Am={_tag:"NegativeInfinity"},vm={[eo]:eo,[Y](){switch(this.value._tag){case"Millis":{let e=this.value.millis*1e6;return Number.isFinite(e)?N(to(e)):Wn(this.value.millis)}case"Nanos":return N(this.value.nanos);default:return Ns(this.value)}},[X](e){return _m(e)&&$m(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"}}},[dt](){return this.toJSON()},pipe(){return Z(this,arguments)}},Ne=e=>{let t=Object.create(vm);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=gu:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:Cu(e)}:t.value=e>0?km:Am:e===Tu?t.value=gu:t.value={_tag:"Nanos",nanos:e},t},_m=e=>P(e,eo);var Om=Ne(0),Su=Ne(1/0),yu=Ne(-1/0),Xr=e=>Ne(e);var Eu=e=>Ne(e),Fm=e=>Ne(e*1e3),Pm=e=>Ne(e*6e4),Mm=e=>Ne(e*36e5),Rm=e=>Ne(e*864e5),Nm=e=>Ne(e*6048e5),wu=e=>Um(na(e),{onMillis:F,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var bu=e=>{let t=na(e);switch(t.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return Cu(t.value.millis)}};var Um=b(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)()}}),Dm=b(3,(e,t,n)=>e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity"?n.onInfinity(e,t):e.value._tag==="Millis"?t.value._tag==="Millis"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(bu(e),t.value.nanos):n.onNanos(e.value.nanos,bu(t)));var Lm=(e,t)=>Dm(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r,onInfinity:(n,r)=>n.value._tag===r.value._tag});var $m=b(2,(e,t)=>Lm(e,t));var ra=e=>e.length>0;var Qn=e=>e>0?Math.floor(e):0;var Ve=nu,Ue=eu;var Dt=Gs,no=Hs;var ro=b(2,(e,t)=>Dt(e)?Ue(t(e.failure)):e);var oo=b(2,(e,{onFailure:t,onSuccess:n})=>Dt(e)?t(e.failure):n(e.success));var zm=globalThis.Array;var oa=b(2,(e,t)=>[...e,t]);var zy=zm.isArray;var sa=ra,Au=ra;var so=()=>[];var vu=b(2,(e,t)=>e.map(t));var ua=pe("effect/Scheduler",{fiberCached:!0,defaultValue:()=>new Zn}),_u=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Wm="setImmediate"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Ou=e=>{try{return Wm(e)}catch{return _u(e)}},ca=class{buckets=[];scheduleTask(t,n){let r=this.buckets,o=r.length,s,a=0;for(;a<o&&!(r[a][0]>n);a++)s=r[a];s&&s[0]===n?s[1].push(t):a===o?r.push([n,[t]]):r.splice(a,0,[n,[t]])}drain(){let t=this.buckets;return this.buckets=[],t}},Zn=class{executionMode;setImmediate;constructor(t="async",n){this.executionMode=t,this.setImmediate=n??(t==="sync"?_u:Ou)}shouldYield(t){return t.currentOpCount>=t.cache.maxOpsBeforeYield}makeDispatcher(){return new ia(this.setImmediate)}},ia=class{tasks=new ca;running=void 0;setImmediate;constructor(t=Ou){this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let t=this.tasks.drain();for(let n=0;n<t.length;n++){let r=t[n][1];for(let o=0;o<r.length;o++)r[o]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},Fu=pe("effect/Scheduler/MaxOpsBeforeYield",{fiberCached:!0,defaultValue:()=>2048}),Pu=pe("effect/Scheduler/PreventSchedulerYield",{fiberCached:!0,defaultValue:()=>!1});var ao=nt;var Ru="~effect/encoding/EncodingError",dn=class extends ao("EncodingError"){[Ru]=Ru};var fa=e=>{switch(e){case 16:return Gm();case 32:return Hm();default:{let t="";for(let n=e>>>3;n>0;n--)t+=Jm();return t}}},C=Uint8Array.from("0123456789abcdef",e=>e.charCodeAt(0)),Lt=()=>Math.random()*4294967296>>>0,Jm=()=>{let e=Lt();return String.fromCharCode(C[e>>>28],C[e>>>24&15],C[e>>>20&15],C[e>>>16&15],C[e>>>12&15],C[e>>>8&15],C[e>>>4&15],C[e&15])},Gm=()=>{let e=Lt(),t=Lt();return String.fromCharCode(C[e>>>28],C[e>>>24&15],C[e>>>20&15],C[e>>>16&15],C[e>>>12&15],C[e>>>8&15],C[e>>>4&15],C[e&15],C[t>>>28],C[t>>>24&15],C[t>>>20&15],C[t>>>16&15],C[t>>>12&15],C[t>>>8&15],C[t>>>4&15],C[t&15])},Hm=()=>{let e=Lt(),t=Lt(),n=Lt(),r=Lt();return String.fromCharCode(C[e>>>28],C[e>>>24&15],C[e>>>20&15],C[e>>>16&15],C[e>>>12&15],C[e>>>8&15],C[e>>>4&15],C[e&15],C[t>>>28],C[t>>>24&15],C[t>>>20&15],C[t>>>16&15],C[t>>>12&15],C[t>>>8&15],C[t>>>4&15],C[t&15],C[n>>>28],C[n>>>24&15],C[n>>>20&15],C[n>>>16&15],C[n>>>12&15],C[n>>>8&15],C[n>>>4&15],C[n&15],C[r>>>28],C[r>>>24&15],C[r>>>20&15],C[r>>>16&15],C[r>>>12&15],C[r>>>8&15],C[r>>>4&15],C[r&15])};var pa="effect/Tracer/ParentSpan",co=class extends Vn()(pa,{fiberCached:!0}){},Km=e=>e;var io=pe("effect/Tracer/DisablePropagation",{defaultValue:vs}),Nu=pe("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),Uu=pe("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),Du="effect/Tracer";var Lu=Km({span:e=>new la(e)}),la=class{_tag="Span";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(t){this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:"Started",startTime:t.startTime}}get traceId(){return this._traceId??=Kr(this.parent)?.traceId??fa(32)}get spanId(){return this._spanId??=fa(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,r){this.events.push([t,n,r??{}])}addLinks(t){this.links.push(...t)}};var $u="effect/Metric/FiberRuntimeMetrics";var da=pe("effect/References/CurrentStackFrame",{fiberCached:!0,defaultValue:Xe}),Bu=pe("effect/References/TracerEnabled",{fiberCached:!0,defaultValue:lt}),ma=pe("effect/References/TracerTimingEnabled",{defaultValue:lt}),ju=pe("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),zu=pe("effect/References/TracerSpanLinks",{defaultValue:()=>[]});var Wu=pe("effect/References/CurrentLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),qu=pe("effect/References/MinimumLogLevel",{fiberCached:!0,defaultValue:()=>"Info"});var Ju=e=>t=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let o=r.split(`
|
|
10
|
+
`);if(o[e]!==void 0)return n=o[e].trim(),n}};var xa=class extends on{constructor(t,n=qn){super("Interrupt",n,"Interrupted"),this.fiberId=t}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[X](t){return Hr(t)&&this.fiberId===t.fiberId&&this.annotations===t.annotations}[Y](){return fe(ke(`${this._tag}:${this.fiberId}`))(Ur(this.annotations))}};var mo=e=>new tt([new xa(e)]);var Oa=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag==="Fail")return Ve(n.error)}return Ue(e)};var Zu=e=>e.reasons.some(Hr);var eh=(e,t)=>{let n=new Map,r=[];for(let o of e.concat(t)){let s=N(o),a=n.get(s);if(a===void 0)n.set(s,[o]);else{if(a.some(u=>le(u,o)))continue;a.push(o)}r.push(o)}return r},ho=b(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new tt(eh(e.reasons,t.reasons));return le(e,n)?e:n}),Yu=b(2,(e,t)=>{let n=!1,r=e.reasons.map(o=>un(o)?(n=!0,new sn(t(o.error),o.annotations)):o);return n?cn(r):e});var Fa="~effect/Fiber",th={_A:F,_E:F},nh={id:0},mn=()=>globalThis[tn],uo=class{constructor(t,n=!0){this.setContext(t),this.id=++nh.id,this.currentOpCount=0,this.interruptible=n,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[Fa](){return th}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(t){return Oe(this.context,t)}addObserver(t){return this._exit?(t(this._exit),At):(this._observers===void 0?this._observers=[t]:this._observers.push(t),()=>this.removeObserver(t))}removeObserver(t){if(this._exit||this._observers===void 0)return;let n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)}interruptUnsafe(t,n){if(this._exit)return;let r=mo(t);this.cache.stackFrame&&(r=Gn(r,Xs(js,this.cache.stackFrame))),n&&(r=Gn(r,n)),this._interruptedCause=this._interruptedCause?ho(this._interruptedCause,r):r,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Fe(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(t){if(this._exit)return;if(this._yielded!==void 0){let o=this._yielded;this._yielded=void 0,o()}let n=this.runLoop(t);if(n===Rt)return;let r=Gu.interruptChildren&&Gu.interruptChildren(this);if(r!==void 0)return this.evaluate(Se(r,()=>n));if(this._exit=n,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),this._observers!==void 0){let o=this._observers;this._observers=void 0;for(let s=0;s<o.length;s++)o[s](n)}this._stack.length=0,this._children=void 0,this.context=Ut()}runLoop(t){let n=globalThis[tn];globalThis[tn]=this;let r=this._running;this._running=!0;let o=!1,s=t;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,s=Fe(this._interruptedCause)),this.currentOpCount++;let a=this.cache;if(!o&&!a.preventYield&&a.scheduler.shouldYield(this)){o=!0;let u=s;s=Se(go,()=>u)}if(s=a.tracerContext?a.tracerContext(s,this):s[G](this),s===Rt){let u=this._yielded;if(Pt in u)return this._deferredInterrupt=!1,this._yielded=void 0,u;if(this._deferredInterrupt){this._yielded=void 0,u();continue}return Rt}}}catch(a){return P(s,G)?this.runLoop(We(a)):We(`Fiber.runLoop: Not a valid effect: ${String(s)}`)}finally{this._running=r,globalThis[tn]=n}}getCont(t){if(this._deferredInterrupt)return this._deferredInterrupt=!1,oh;for(;;){let n=this._stack.pop();if(!n)return;let r=n[Mt];if(r!==void 0){let o=r.call(n,this);if(o)return o[t]=o,o}if(n[t])return n}}succeedWith(t){if((++this.currentOpCount&sh-1)===0)return q(t);let n=this.getCont(re);return n?n[re](t,this):this.yieldWith(q(t))}yieldWith(t){return this._yielded=t,Rt}children(){return this._children??=new Set}pipe(){return Z(this,arguments)}setContext(t){let n=this.context;if(this.context=t,n!==void 0&&mu(n,t))return;let r=t.cacheRoot,o=r._fiberCache??=rh(t);this.cache?.scheduler!==o.scheduler&&(this._dispatcher=void 0),this.cache=o}get currentSpanLocal(){let t=this.cache.span;return t?._tag==="Span"?t:void 0}},rh=e=>{let t=Zr(e,Du);return{scheduler:Oe(e,ua),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Oe(e,Bu),span:Zr(e,pa),logLevel:Oe(e,Wu),minimumLogLevel:Oe(e,qu),stackFrame:Oe(e,da),runtimeMetrics:Zr(e,$u),maxOpsBeforeYield:Oe(e,Fu),preventYield:Oe(e,Pu)}},oh={[re](e,t){return Fe(t._interruptedCause)},[$e](e,t){return Fe(t._interruptedCause)}},sh=32,Gu={interruptChildren:void 0},xo=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(ji.key,e.cache.stackFrame),Kn(t)};var Xu=e=>{let t=e;return t._exit?K(t._exit):Ke(n=>t._exit?n(K(t._exit)):ve(e.addObserver(r=>n(K(r)))))},Pa=e=>Ke(t=>{let n=e[Symbol.iterator](),r=[],o;function s(){let a=n.next();for(;!a.done;){if(a.value._exit){r.push(a.value._exit),a=n.next();continue}o=a.value.addObserver(u=>{r.push(u),s()});return}t(K(r))}return s(),ve(()=>o?.())});var Ma=e=>H(t=>ef(e,t.id)),ef=b(e=>P(e[0],Fa),(e,t,n)=>H(r=>{let o=xo(r);return o=o&&n?ta(o,n):o??n,e.interruptUnsafe(t,o),Ba(Xu(e))})),ga=e=>H(t=>{let n=xo(t),r=so();for(let o of e)o.interruptUnsafe(t.id,n),r.push(o);return Ba(Pa(r))});var K=q,Fe=Ae,hn=He,ve=Ge({op:"Sync",[G](e){let t=this[w](),n=e.getCont(re);return n?n[re](t,e):e.yieldWith(q(t))}}),ee=Ge({op:"Suspend",[G](e){return this[w]()}});var tf=oo({onFailure:hn,onSuccess:K});var nf=Ge({op:"Yield",[G](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Pe)},this[w]??0),e.yieldWith(()=>{t=!0})}}),go=nf(0);var Ra=K(rt());var rf=e=>ee(()=>Fe(e())),So=e=>We(e),of=e=>ee(()=>hn(e())),ge=K(void 0);var sf=e=>{let t=typeof e=="function"?e:e.try,n=typeof e=="function"?r=>new Yn(r,"An error occurred in Effect.try"):e.catch;return ee(()=>{try{return K(t())}catch(r){return hn(n(r))}})};var af=e=>{let t=typeof e=="function"?e:e.try,n=typeof e=="function"?r=>new Yn(r,"An error occurred in Effect.tryPromise"):e.catch;return cf(function(r,o){let s=a=>{try{r(hn(Ls(()=>n(a))))}catch(u){r(So(u))}};try{t(o).then(a=>r(K(a)),s)}catch(a){s(a)}},t.length!==0)},ah=e=>H(t=>e(t.id));var cf=(function(){let e=Be({op:"Async",[G](n){let r=!1,o=!1,s=this.withSignal?new AbortController:void 0,a=this.register.call(n.cache.scheduler,u=>{r||(r=!0,o?n.evaluate(u):o=u)},s?.signal);return o!==!1?o:(o=!0,n._yielded=()=>{r=!0},s===void 0&&a===void 0?Rt:(n._stack.push(ch(()=>(r=!0,s?.abort(),a??Pe))),Rt))}}),t=function(n,r){this.register=n,this.withSignal=r};return t.prototype=e,function(n,r){return new t(n,r)}})(),ch=Ge({op:"AsyncFinalizer",[Mt](e){e.interruptible&&(e.interruptible=!1,e._stack.push(er))},[$e](e,t){return Zu(e)?Se(Ff(Ae(e),this[w]()),()=>Fe(e)):Fe(e)}}),Ke=e=>cf(e,e.length>=2),Na=Ke(At),uf=(...e)=>{if(e.length===1){let r=e[0];return ee(()=>Bt(r()))}let[t,n]=e;return ee(()=>Bt(n.call(t.self)))},ff=(e,...t)=>{let n=t.length===0?function(){return ee(()=>Bt(e.apply(this,arguments)))}:function(){let r=ee(()=>Bt(e.apply(this,arguments)));for(let o=0;o<t.length;o++)r=t[o](r,...arguments);return r};return Ua(e.length,n)},Ua=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Hu=Ju(2),lf=function(){let e=typeof arguments[0]=="string",t=e?arguments[0]:"Effect.fn",n=e?arguments[1]:void 0,r=Ft(),o;return r!==0&&(mt(2),o=new globalThis.Error,mt(r)),e?(s,...a)=>Vu(t,s,o,a,e,n):Vu(t,arguments[0],o,Array.prototype.slice.call(arguments,1),e,n)},Vu=(e,t,n,r,o,s)=>{let a=typeof t=="function"?t:r.shift().bind(t.self),u=`${e} (definition)`,d=n?Hu(()=>n.stack):Xe;return Ua(a.length,function(...g){let c=ee(()=>{let x=a.apply(this,arguments);return Nt(x)?x:Bt(x)});for(let x=0;x<r.length;x++)c=r[x](c,...g);if(!Nt(c))return c;let f=Ft(),h;return f!==0&&(mt(2),h=new globalThis.Error,mt(f)),If(o?Vf(e,s,x=>kh(c,x)):c,da,x=>({name:e,stack:h?Hu(()=>h.stack):Xe,parent:{name:u,stack:d,parent:x}}))})},pf=(e,...t)=>Ua(e.length,t.length===0?function(){return Ku(()=>e.apply(this,arguments))}:function(){let n=Ku(()=>e.apply(this,arguments));for(let r of t)n=r(n,...arguments);return n}),Ku=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return K(r.value);let o=r.value;if(o&&o._tag==="Success"){n=o.value;continue}else{if(o&&o._tag==="Failure")return r.value;{let s=!0;return ee(()=>s?(s=!1,Se(r.value,a=>Bt(t,a))):ee(()=>Bt(e())))}}}}catch(t){return So(t)}},Bt=(function(){let e=Be({op:"Iterator",[re](n,r){let o=this.iterator;for(;;){let s=o.next(n);if(s.done)return K(s.value);if(B(s.value)){if(s.value._tag==="Failure")return s.value}else return r._stack.push(this),s.value;n=s.value.value}},[G](n){return this[re](this.initial,n)}}),t=function(n,r){this.iterator=n,this.initial=r};return t.prototype=e,function(n,r){return new t(n,r)}})();var Da=function(e){return e._stack.push(this),this[w]},ih=Be({op:"OnSuccess",[G]:Da}),St=function(e,t,n){this[w]=e,this[re]=t,this.payload=n};St.prototype=ih;var df=function(){return this.payload},mf=function(e,t){return t.succeedWith(this.payload)},uh=(()=>{let e="~effect/Effect/stackProbe";return{[e]:function(){return new Error().stack}}[e]()?.includes("[as "+e+"]")===!0})(),fh=function(e,t){let n=this.payload;return t.succeedWith(uh?n(e):Ls(()=>n(e)))},hf=function(e){let t=this.payload;return t(e)},lh=function(e){let t=this.payload;return new St(t(e),mf,e)},ph=function(e){return new St(this.payload,mf,e)},La=e=>Eo(e,gt);var yo=b(2,(e,t)=>new St(e,Nt(t)?df:hf,t)),$a=b(2,(e,t)=>new St(e,Nt(t)?ph:lh,t)),Ba=e=>new St(e,df,Pe);var Se=b(2,(e,t)=>new St(e,hf,t));var B=e=>e[Pt]!==void 0,xf=b(2,(e,t)=>B(e)?e._tag==="Success"?t(e.value):e:Se(e,t));var Eo=b(2,(e,t)=>new St(e,fh,t)),gf=b(2,(e,t)=>B(e)?yf(e,t):Eo(e,t)),Sf=b(2,(e,t)=>B(e)?Ef(e,t):qa(e,t));var ja=e=>Ae(mo(e)),bo=e=>e._tag==="Success";var Pe=q(void 0),yf=b(2,(e,t)=>e._tag==="Success"?q(t(e.value)):e),Ef=b(2,(e,t)=>{if(e._tag==="Success")return e;let n=Oa(e.cause);return Dt(n)?e:He(t(n.success))});var bf=b(2,(e,t)=>bo(e)?t:e);var Tf=e=>{let t=[];for(let n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?Pe:Ae(cn(t))};var To=b(2,(e,t)=>H(n=>{let r=n.context,o=t(r);return r===o||(n.setContext(o),Ka(n,()=>{n.setContext(r)})),e})),If=b(3,(e,t,n)=>To(e,r=>{let o=ea(r,t),s=n(o);return o===s?r:ln(r,t,s)}));var Cf=e=>H(t=>e(t.context));var wf=b(2,(e,t)=>B(e)?e:To(e,ta(t))),za=function(){return arguments.length===1?b(2,(e,t)=>Qu(e,arguments[0],t)):b(3,(e,t,n)=>Qu(e,t,n)).apply(this,arguments)},Qu=(e,t,n)=>To(e,ln(t,n));var kf=b(e=>Nt(e[0]),(e,t)=>vo({while:lt,body:Ye(t?.disableYield?e:Se(e,n=>go)),step:At})),Io=b(2,(e,t)=>new Af(e,t.length!==1?n=>t(n):t)),dh=Be({op:"OnFailure",[G]:Da}),Af=function(e,t){this[w]=e,this[$e]=t};Af.prototype=dh;var Co=b(3,(e,t,n)=>Io(e,r=>{let o=t(r);return Dt(o)?Fe(o.failure):n(o.success,r)})),Wa=b(2,(e,t)=>Co(e,Oa,n=>t(n)));var qa=b(2,(e,t)=>Wa(e,n=>of(()=>t(n))));var wo=b(2,(e,t)=>new vf(e,t.onSuccess.length!==1?n=>t.onSuccess(n):t.onSuccess,t.onFailure.length!==1?n=>t.onFailure(n):t.onFailure)),mh=Be({op:"OnSuccessAndFailure",[G]:Da}),vf=function(e,t,n){this[w]=e,this[re]=t,this[$e]=n};vf.prototype=mh;var _f=b(2,(e,t)=>wo(e,{onFailure:n=>{let r=n.reasons.find(un);return r?t.onFailure(r.error):Fe(n)},onSuccess:t.onSuccess}));var ko=e=>B(e)?q(e):hh(e),hh=Ge({op:"Exit",[G](e){return e._stack.push(this),this[w]},[re](e,t,n){return t.succeedWith(n??q(e))},[$e](e,t,n){return t.succeedWith(n??Ae(e))}});var Sa="~effect/Scope",ya="~effect/Scope/Closeable",Ao=Vn("effect/Scope"),Of=(e,t)=>H(n=>{let r=Ja(e,t);return r===void 0?ge:(Eh(n),r)}),Ja=(e,t)=>{let n=e.state;if(n._tag==="Closed"||(e.state={_tag:"Closed",exit:t},e.parent!==void 0&&Rf(e.parent,e),n._tag==="Empty"))return;if(n.finalizer!==void 0)return fo(n.finalizer,t);let r=n.finalizers;return r.size===1?fo(r.values().next().value,t):xh(e,r,t)},fo=(e,t)=>{try{return e(t)}catch(n){return We(n)}},Ff=(e,t)=>bo(e)?t:Io(t,n=>Fe(ho(e.cause,n))),xh=ff(function*(e,t,n){let r=[],o=[],s=Array.from(t.values()),a=mn();for(let u=s.length-1;u>=0;u--){let d=s[u];e.strategy==="sequential"?r.push(yield*ko(fo(d,n))):o.push(Qa(a,fo(d,n),!0,!0,"inherit"))}return o.length>0&&(r=yield*Pa(o)),yield*Tf(r)});var Ga=(e,t)=>ee(()=>e.state._tag==="Closed"?t(e.state.exit):(Mf(e,{},t),ge)),Pf=(e,t)=>Ga(e,Ye(t)),Mf=(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;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)}},Rf=(e,t)=>{if(e.state._tag!=="Open")return;let n=e.state;n.finalizerKey===t?e.state=Ea:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Ea))},Ha=e=>gh(e,void 0),gh=(e="sequential",t)=>({[ya]:ya,[Sa]:Sa,strategy:e,parent:t,state:Ea}),Ea={_tag:"Empty"};var Va=Ao,Nf=za(Ao),Uf=e=>H(t=>{let n=t.context,r=Ha();return t.setContext(ln(t.context,Ao,r)),Ka(t,o=>(t.setContext(n),Ja(r,o))),e});var Df=(e,t,n)=>Cf(r=>xn(o=>Se(Va,s=>$a(n?.interruptible?o(e):e,a=>Ga(s,u=>wf(t(a,u),r))))));var Lf=(function(){let e=Be({op:"OnExit",[G](n){return n._stack.push(this),this.effect},[Mt](n){n.interruptible&&this.interruptible!==!0&&(n._stack.push(er),n.interruptible=!1)},[re](n,r,o){o??=q(n);let s;try{s=this.onExit(o)}catch(a){s=We(a)}return s?Se(s,a=>o):o},[$e](n,r,o){o??=Ae(n);let s;try{s=this.onExit(o)}catch(a){s=We(a)}return s?Se(Ff(o,s),a=>o):o}}),t=function(n,r,o){this.effect=n,this.onExit=r,this.interruptible=o};return t.prototype=e,t})(),Xn=(e,t,n)=>new Lf(e,t,n),Ka=(e,t)=>{e._stack.push(new Lf(void 0,t,void 0))},$f=b(2,Xn);var Bf=e=>H(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(er)),e)),jf=Ge({op:"SetInterruptible",[Mt](e){if(e.interruptible=this[w],e._interruptedCause&&e.interruptible)return()=>Fe(e._interruptedCause)}}),er=jf(!0),Sh=jf(!1),yh=e=>{if(e.interruptible=!0,e._stack.push(Sh),e._interruptedCause)return Fe(e._interruptedCause)},Eh=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(er))};var zf=e=>H(t=>t.interruptible?e:yh(t)??e),xn=e=>H(t=>t.interruptible?(t.interruptible=!1,t._stack.push(er),e(zf)):e(F));var vo=Ge({op:"While",[re](e,t){return this[w].step(e),this[w].while()?(t._stack.push(this),this[w].body()):Pe},[G](e){return this[w].while()?(e._stack.push(this),this[w].body()):Pe}});var _o=e=>e==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,e??1),Oo=()=>e=>{let t=e.onItem,n=e.step,r=(s,a,u,d,g)=>Se(ko(g),c=>n(s,a[u],c,u)??o(s,a,u+1,d)??ge),o=(s,a,u=0,d=a.length)=>{for(;u<d;u++){let g=a[u],c=t(s,g,u);if(!B(c))return r(s,a,u,d,c);let f=n(s,g,c,u);if(f)return f._tag==="Failure"?f:void 0}};return o},bh=e=>{let t=e.onItem,n=e.step;return(r,o,s)=>{let a=0,u=s.end??o.length,d=s.concurrency,g=!1,c,f,h,x,y,E=i=>{let l=We(i);return x=l,g=!0,f&&f.size>0?Se(Bf(ga(Array.from(f))),()=>x??l):l},m=()=>{let i=!1;for(;!x&&a<u;a++){let l=o[a],S=y??t(r,l,a);if(B(S)){if(x=n(r,l,S,a),x)break}else if(c){y=void 0;let p=Qa(c,S,!0,!0,"inherit");if(p._exit){if(x=n(r,l,p._exit,a),x)break;continue}f.add(p);let I=a;if(p.addObserver(T=>{f.delete(p);try{if(x){if(T._tag==="Failure"){let _=T.cause.reasons.filter(L=>L._tag!=="Interrupt");if(_.length>0){let L=cn(_);x=Ae(x._tag==="Failure"?ho(x.cause,L):L)}}}else{let _=n(r,l,T,I);_&&(x=_,m())}if(i){let _=m();_&&h(_)}else g&&f.size===0&&h(x??ge)}catch(_){h(E(_))}}),f.size<d)continue;i=!0,a++;return}else return Ke(p=>{c=mn(),f=new Set,y=S,h=p;let I;try{I=m()}catch(T){return p(E(T))}return I?p(I):ee(()=>(x??=Pe,Se(f?ga(f):ge,()=>x?._tag==="Failure"?x:ge)))})}if(g=!0,x){if(f&&f.size>0){let l=xo(c);f.forEach(S=>S.interruptUnsafe(c.id,l));return}if(h||x._tag==="Failure")return x}else if(h)if(f)f.size===0&&h(ge);else return Pe};return m()}},Fo=()=>e=>bh(e);var Qa=(e,t,n=!1,r=!1,o=!1)=>{let s=e,a=o==="inherit"?s.interruptible:!o,u=new uo(s.context,a);return n?u.evaluate(t):s.currentDispatcher.scheduleTask(()=>u.evaluate(t),0),!r&&!u._exit&&(s.children().add(u),u._parent=s),u};var Wf=b(e=>Nt(e[0]),(e,t,n)=>H(r=>{let o=Qa(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!o._exit)if(t.state._tag!=="Closed"){let s={};Mf(t,s,()=>ah(u=>u===o.id?ge:Ma(o))),o.addObserver(()=>Rf(t,s))}else o.interruptUnsafe(r.id,xo(r));return K(o)}));var Za=e=>(t,n)=>{let r=new uo(n?.scheduler?ln(e,ua,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))}return n?.onFiberStart&&n.onFiberStart(r),r};var qf=Za(Ut());var Jf=e=>{let t=Za(e);return n=>{if(B(n))return n;let r=new Zn("sync"),o=t(n,{scheduler:r});return o._dispatcher?.flush(),o._exit??We(new po(o))}},Gf=Jf(Ut());var lo=BigInt(0),Th={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:lo,endTime:lo,exit:Pe},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},Ih=e=>Object.assign(Object.create(Th),e),Hf=e=>e?Oe(e.annotations,io)?e._tag==="Span"?Hf(Kr(e.parent)):rt():gt(e):rt(),Ch=(e,t,n)=>{let r=!e.cache.tracerEnabled||n?.annotations&&Oe(n.annotations,io),o=n?.parent!==void 0?gt(n.parent):n?.root?rt():Hf(e.cache.span),s;if(r)s=Ih({name:t,parent:o,annotations:ln(n?.annotations??Ut(),io,!0)});else{let a=e.cache.tracer??Lu,u=e.getRef(Kf),d=e.getRef(ma),g=e.getRef(ju),c=e.getRef(zu),f=n?.level??e.getRef(Nu),h=n?.links!==void 0?[...c,...n.links]:c.length===0?[]:c.slice();s=a.span({name:t,parent:o,annotations:n?.annotations??Ut(),links:h,startTime:d?u.currentTimeNanosUnsafe():lo,kind:n?.kind??"internal",root:n?.root??Vs(o),sampled:n?.sampled??(cu(o)&&o.value.sampled===!1?!1:!Oh(e.getRef(Uu),f))});for(let x in g)s.attribute(x,g[x]);if(n?.attributes!==void 0)for(let x in n.attributes)s.attribute(x,n.attributes[x])}return s};var wh=(e,t,n,r)=>ve(()=>{e.status._tag!=="Ended"&&e.end(r?n.currentTimeNanosUnsafe():lo,t)}),Vf=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return H(o=>{let s=Ch(o,e,n),a=o.getRef(Kf),u=o.getRef(ma);return Ka(o,d=>wh(s,d,a,u)),r(s)})},kh=za(co);var Kf=pe("effect/Clock",{defaultValue:()=>new ba}),ha=2**31-1,ba=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=ve(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Ah()}currentTimeNanos=ve(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Zf()}monotonicTimeNanos=ve(()=>this.monotonicTimeNanosUnsafe());sleep(t){return this.sleepMillis(wu(t))}sleepMillis(t){return t<=0?go:Number.isFinite(t)?Ke(n=>{let r=t>ha?this.sleepMillis(t-ha):ge,o=setTimeout(()=>n(r),Math.min(t,ha));return ve(()=>clearTimeout(o))}):Na}},Qf=BigInt(1e6),Zf=(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())*Qf;return n>t&&(t=n),t}})(),Ah=(function(){let e=BigInt(1e9),t;return()=>{let n=Zf(),r=BigInt(Date.now())*Qf;if(t===void 0)t=r-n;else{let o=t+n;(r>o?r-o:o-r)>e&&(t=r-n)}return t+n}})();var Ta="~effect/Cause/TimeoutError";var Ia=class extends nt("TimeoutError"){[Ta]=Ta;constructor(t){super({message:t})}},Ca="~effect/Cause/IllegalArgumentError";var wa=class extends nt("IllegalArgumentError"){[Ca]=Ca;constructor(t){super({message:t})}},ka="~effect/Cause/ExceededCapacityError";var Aa=class extends nt("ExceededCapacityError"){[ka]=ka;constructor(t){super({message:t})}},va="~effect/Cause/AsyncFiberError";var po=class extends nt("AsyncFiberError"){[va]=va;constructor(t){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:t})}},_a="~effect/Cause/UnknownError";var Yn=class extends nt("UnknownError"){[_a]=_a;constructor(t,n){super({message:n,cause:t})}};var vh=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},_h=su(ou,vh),Oh=au(_h);var Fh="~effect/Logger",hE={[Fh]:{_Message:F,_Output:F},pipe(){return Z(this,arguments)}};var $t={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},xE={None:[],All:[],Trace:[$t.gray],Debug:[$t.blue],Info:[$t.green],Warn:[$t.yellow],Error:[$t.red],Fatal:[$t.bgBrightRed,$t.black]};var Ya=q,tr=Ae,gn=He;var Sn=Pe;var yn=bo;var Yf=Ha,Xf=Nf;var el=Pf;var tl=Of;var Xa=un;var ec=cn;var nl=Jn,tc=Gr;var jt=Yu;var nc=zi;var rl=qi;var oc=b(2,(e,t)=>Co(e,Mh,n=>t(n))),Mo=e=>e.reasons.some(rc),rc=e=>e._tag==="Fail"&&nc(e.error),ol=e=>{let t,n=!1;for(let r of e.reasons)rc(r)?t??=r.error:r._tag!=="Interrupt"&&(n=!0);return t===void 0?Ue(e):n?Ue(ec(e.reasons.filter(r=>!rc(r)))):Ve(t)};var Mh=e=>{let t=ol(e);return Dt(t)?t:Ve(t.success.value)};var sc=vo;var En=af,W=K;var nr=ee,oe=ve,bn=ge;var Ro=Na;var ye=uf,U=hn;var ac=Fe,rr=rf,zt=So,or=sf;var No=tf;var Q=Se;var Tn=yo,Uo=$a;var In=ko,sr=Eo;var Do=Wa;var ot=Io;var al=qa;var Lo=_f;var $o=Va,cc=Uf;var Bo=Df;var ic=$f;var uc=kf;var ar=Wf;var cr=qf;var ir=Gf;var cl=lf;var fc=gf,lc=Sf;var Ee=xf;var il=pf;var zo=e=>Nh(typeof e=="string"?Uh.encode(e):e),Wo=e=>{let t=Dh(e),n=t.length;if(n%4!==0)return Ue(new dn({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 Ue(new dn({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 a=0,u=0;a<n;a+=4,u+=3){let d=jo(t.charCodeAt(a))<<18|jo(t.charCodeAt(a+1))<<12|jo(t.charCodeAt(a+2))<<6|jo(t.charCodeAt(a+3));s[u]=d>>16,s[u+1]=d>>8&255,s[u+2]=d&255}return Ve(s)}catch(o){return Ue(new dn({kind:"Decode",module:"Base64",input:t,message:o instanceof Error?o.message:"Invalid input"}))}};var Nh=e=>{let t=e.length,n="",r;for(r=2;r<t;r+=3)n+=qe[e[r-2]>>2],n+=qe[(e[r-2]&3)<<4|e[r-1]>>4],n+=qe[(e[r-1]&15)<<2|e[r]>>6],n+=qe[e[r]&63];return r===t+1&&(n+=qe[e[r-2]>>2],n+=qe[(e[r-2]&3)<<4],n+="=="),r===t&&(n+=qe[e[r-2]>>2],n+=qe[(e[r-2]&3)<<4|e[r-1]>>4],n+=qe[(e[r-1]&15)<<2],n+="="),n},Uh=new TextEncoder;var Dh=e=>e.replace(/[\n\r]/g,""),qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ur=new Uint8Array(123).fill(255);for(let e=0;e<qe.length;e++)ur[qe.charCodeAt(e)]=e;ur[61]=0;var jo=e=>{if(e>=ur.length||ur[e]===255)throw new TypeError(`Invalid character ${String.fromCharCode(e)}`);return ur[e]};function pc(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var dc="~structural";var qo="~sentinels",Jo="~constructor";var Go=$n(e=>{let t=pc(e)?.identifier;return typeof t=="string"?t:e.getExpected(Go)});var k=Symbol();var me=Ya,je=me(k),$=me(k),fr=e=>e===k?rt():gt(e),hc=e=>e._tag==="None"?je:me(e.value);var dr="~effect/SchemaIssue/Issue";function gc(e){return P(e,dr)&&e[dr]===dr}function Lh(e){return Object.hasOwn(e,"input")}var ze=class{[dr]=dr;constructor(t,n){n?.reportInput===!0&&t!==k&&(this.input=t)}},fl=class extends ze{_tag="Filter";filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},ll=class extends ze{_tag="Encoding";ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},st=class extends ze{_tag="Pointer";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},xr=class extends ze{_tag="MissingKey";annotations;constructor(e){super(),this.annotations=e}},Sc=class extends ze{_tag="UnexpectedKey";ast;constructor(e,t,n){super(t,n),this.ast=e}},Te=class extends ze{_tag="Composite";ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Je=class extends ze{_tag="InvalidType";ast;constructor(e,t,n){super(t,n),this.ast=e}},be=class extends ze{_tag="InvalidValue";annotations;constructor(e,t,n){super(t,n),this.annotations=e}};var gr=class extends ze{_tag="AnyOf";ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},pl=class extends ze{_tag="OneOf";ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function xc(e,t,n){if(gc(e))return e;if(typeof e=="string")return new be({message:e},t,n);let r=typeof e.issue=="string"?new be({message:e.issue},t,n):e.issue;return new st(e.path,r)}function dl(e,t,n){if(e!==void 0)return typeof e=="boolean"?e?void 0:new be(void 0,t,n):xc(e,t,n)}function ml(e,t,n,r){return Array.isArray(t)?Au(t)?t.length===1?xc(t[0],n,r):new Te(e,vu(t,o=>xc(o,n,r)),n,r):void 0:dl(t,n,r)}var $h=e=>{let t=hr(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return mr(Go(e.ast),e);case"InvalidValue":{let n=hl(e);if(n!==void 0)return mr(n,e);let r=Ho(e);return r===void 0?"Expected a valid value":`Invalid data ${r}`}case"MissingKey":return"Missing key";case"UnexpectedKey":{let n=Ho(e);return n===void 0?"Expected no excess property":`Unexpected key with value ${n}`}case"Forbidden":return"Forbidden operation";case"OneOf":{let n=Ho(e);return n===void 0?"Expected exactly one member to match":`Expected exactly one member to match the input ${n}`}}},Bh=e=>hr(e.issue)??hr(e);function Ho(e){return Lh(e)?J(e.input):void 0}function hl(e){let t=e.annotations?.expected;return typeof t=="string"?t:void 0}function mr(e,t){let n=Ho(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function xl(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(n=>xl(n)).join(" & ")}}function jh(){return e=>pr(e,"")}var gl=jh();function pr(e,t){let n;switch(e._tag){case"Filter":{let r=Bh(e);if(r!==void 0)n=r;else{if(e.issue._tag!=="InvalidValue")return pr(e.issue,t);let o=hl(e.issue);n=o===void 0?mr(xl(e.filter),e):mr(o,e.issue)}break}case"Encoding":return pr(e.issue,t);case"Pointer":return pr(e.issue,t+Mi(e.path));case"Composite":case"AnyOf":{if(e._tag==="Composite"||e.issues.length>0)return e.issues.map(r=>pr(r,t)).join(`
|
|
11
|
+
`);n=hr(e)??mr(Go(e.ast),e);break}default:n=$h(e);break}return t?`${n}
|
|
12
|
+
at ${t}`:n}function hr(e){if(e._tag==="Pointer")return;if(e._tag==="Encoding")return hr(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}function Sr(e){let t;for(let n of e.reasons){if(!Xa(n)||!gc(n.error))return;t??=n.error}return t}function yr(e,t){let n=Sr(e);if(n===void 0)throw new Error(t,{cause:e});return n}var yc=e=>Object.assign(Object.create(As),e);var Wh=yc({_tag:"Passthrough"});function Er(){return Wh}function Ie(e){return yc({_tag:"Transform",transform:e})}function bt(e){return yc({_tag:"TransformEffect",transform:e})}function Ec(){return Ie(globalThis.String)}function Vo(){return Ie(globalThis.Number)}function El(e){return bt((t,n)=>or({try:()=>JSON.parse(t,e?.reviver),catch:()=>new be({expected:"a valid JSON string"},t,n)}))}function bl(e){return bt((t,n)=>or({try:()=>{let r=JSON.stringify(t,e?.replacer,e?.space);if(r===void 0)throw new TypeError("Value cannot be represented as JSON");return r},catch:()=>new be({expected:"a JSON-serializable value"},t,n)}))}function Tl(){return Ie(zo)}function Il(){return bt((e,t)=>lc(No(Wo(e)),()=>new be({expected:"a valid Base64 string"},e,t)))}var br="~effect/SchemaTransformation/Transformation",Me=class extends Dn{[br]=br;_tag="Transformation";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Me(this.encode,this.decode)}};function Gh(e){return P(e,br)&&e[br]===br}var Tc=e=>Gh(e)?e:new Me(e.decode,e.encode);function Tr(e){return new Me(bt(e.decode),bt(e.encode))}function Cl(e){return new Me(Ie(e.decode),Ie(e.encode))}var Hh=new Me(Er(),Er());function Cn(){return Hh}var Ko=new Me(Vo(),Ec());var wl=Tr({decode:(e,t)=>URL.canParse(e)?W(new URL(e)):U(new be({expected:"a valid URL string"},e,t)),encode:e=>W(e.href)});var kl=new Me(Il(),Tl());function Al(e){return new Me(El(e??{}),bl(e))}function Jt(e){return t=>t._tag===e}var Ul=Jt("Declaration");var Zh=Jt("Never");var kn=Jt("Literal"),Cc=Jt("UniqueSymbol");var Dl=Jt("Arrays"),Yh=Jt("Objects");var Ll=Jt("Suspend"),he=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},ts={},Tt=class{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}},_l="~effect/Schema",Le=class{[_l]=_l;annotations;checks;encoding;context;constructor(t=void 0,n=void 0,r=void 0,o=void 0){this.annotations=t,this.checks=n,this.encoding=r,this.context=o}toString(){return`<${this._tag}>`}},vn=class extends Le{_tag="Declaration";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,o,s,a,u){super(n,r,o,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=u}getParser(){let e;return(t,n)=>t===k?je:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,o){let s=An(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&o===this.encodingRun?this:new vn(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;return typeof e=="string"?e:"<Declaration>"}},Xh=class extends Le{_tag="Null";getParser(){return $c(this,null)}getExpected(){return"null"}},$l=new Xh;var ex=class extends Le{_tag="Undefined";getParser(){return $c(this,void 0)}toCodecJson(){return Ce(this,[tx])}getExpected(){return"undefined"}},tx=new he($l,new Me(Ie(()=>{}),Ie(()=>null))),Oc=new ex;var nx=class extends Le{_tag="Unknown";getParser(){return wr(this,bi)}getExpected(){return"unknown"}},Zo=new nx;var qt=class extends Le{_tag="Literal";literal;constructor(e,t,n,r,o){if(super(t,n,r,o),typeof e=="number"&&!globalThis.Number.isFinite(e))throw new Error(`A numeric literal must be finite, got ${J(e)}`);this.literal=e}getParser(){return $c(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal=="bigint"?Ol(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:Ol(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Ol(e){let t=globalThis.String(e.literal);return Ce(e,[new he(new qt(t),new Me(Ie(()=>e.literal),Ie(()=>t)))])}var rx=class extends Le{_tag="String";getParser(){return wr(this,_s)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&wt(n,e,void 0,this,t)?void 0:e}getExpected(){return"string"}},at=new rx,ox=class extends Le{_tag="Number";getParser(){return wr(this,Rr)}matchKey(e,t){return this._match(Tx,e,t)}matchPart(e,t){return this._match(_c,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:wt(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(wc(this.checks,"effect/schema/isFinite")||wc(this.checks,"effect/schema/isInt"))?this:Ce(this,[xx])}toCodecStringTree(){return this.toCodecJson()===this?Ce(this,[Ix]):Ce(this,[Cx])}getExpected(){return"number"}};function wc(e,t){return e.some(n=>n.annotations?.representation?.id===t||n._tag==="FilterGroup"&&wc(n.checks,t))}var Fc=new ox,sx=class extends Le{_tag="Boolean";getParser(){return wr(this,Ei)}getExpected(){return"boolean"}},Bl=new sx;var _n=class extends Le{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,o,s,a,u){super(r,o,s,a),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=u;let d=!1;for(let g=0;g<t.length;g++)if(It(t[g]))d=!0;else if(d)throw new Error("A required element cannot follow an optional element. ts(1257)");if(d&&n.length>1)throw new Error("A required element cannot follow an optional element. ts(1257)");for(let g=1;g<n.length;g++)if(It(n[g]))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(e,t=e){let n=this,r,o,s=n.elements.length,a=Math.max(0,n.rest.length-1);function u(c,f){return f<s?r[f]:f>=c?o[f-c+1]:o[0]}let d=c=>{let{input:f,len:h,options:x}=c;if(n.rest.length===0&&h>s)for(let y=s;y<h;y++){let E=new Sc(n,f[y],x),m=new st([y],E);if(x.errors==="all")c.issues?c.issues.push(m):c.issues=[m];else return U(new Te(n,[m],f,x))}return c.issues?U(new Te(n,c.issues,f,x)):me(c.output)},g=(c,f)=>{let h=c.length,x={ast:n,getParser:u,input:c,len:h,tailThreshold:Math.max(s,h-a),output:new globalThis.Array(h),issues:void 0,options:f},y=n.rest.length===0?s:Math.max(h,s+a),E=f.concurrency===void 0?1:_o(f.concurrency),m=E===1?cx(x,c,0,y):ix(x,c,{concurrency:E,end:y});if(!m)return d(x);if(B(m))return Ee(m,()=>d(x));let i=!0;return nr(()=>i?(i=!1,Q(m,()=>d(x))):g(c,f))};return(c,f)=>{if(c===k)return je;try{return Array.isArray(c)?(r||(r=n.elements.map(h=>({ast:h,parser:t(h)})),o=n.rest.map(h=>({ast:h,parser:t(h)}))),g(c,f)):U(new Je(n,c,f))}catch(h){return zt(h)}}}_rebuild(e,t,n){let r=An(this.elements,e),o=An(this.rest,e);return r===this.elements&&o===this.rest&&t===this.checks&&n===this.encodingChecks?this:new _n(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"}};function ax(e,t,n,r){if(n._tag==="Failure")return Yo(e,e.ast,r,n);let o=n===$?t:n[w];if(o!==k)e.output[r]=o;else{let s=e.getParser(e.tailThreshold,r);if(It(s.ast))return;let a=new st([r],new xr(s.ast.context?.annotations));if(e.options.errors==="all")e.issues?e.issues.push(a):e.issues=[a];else return gn(new Te(e.ast,[a],e.input,e.options))}}var jl={onItem(e,t,n){let r=n<e.len?t:k;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:ax},cx=Oo()(jl),ix=Fo()(jl),Yo=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let o=Sr(r.cause);if(o===void 0)return tr(jt(r.cause,a=>new Te(t,[new st([n],a)],e.input,e.options)));let s=new st([n],o);if(e.options.errors==="all")e.issues?e.issues.push(s):e.issues=[s];else return gn(new Te(t,[s],e.input,e.options))},zl="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";function Ic(e,t,n=ts){let r,o;function s(a){switch(a._tag){case"String":case"TemplateLiteral":return(r??=Object.keys(e)).filter(u=>a.matchPart(u,n)!==void 0);case"Number":return(r??=Object.keys(e)).filter(u=>a.matchKey(u,n)!==void 0);case"Symbol":return(o??=Object.getOwnPropertySymbols(e)).filter(u=>Object.prototype.propertyIsEnumerable.call(e,u)&&a.matchKey(u,n)!==void 0);case"Union":return[...new Set(a.types.flatMap(s))];default:return[]}}return s(Bc(Ht(t)))}var Wl=class{name;type;constructor(e,t){this.name=e,this.type=t}};function ql(e){switch(e._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return e.types.every(ql);default:return!1}}function Jl(e){let t=ep(e);switch(t._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return t.types.every(Jl);default:return!1}}function ux(e){return ql(e)&&Jl(e)}var Gl=class{parameter;type;constructor(e,t){if(!ux(e))throw new Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,It(t)&&!ip(t))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Pc=class extends Le{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,o,s,a){super(n,r,o,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let n=this,r=n.propertySignatures.length,o=n.indexSignatures.length;if(!r&&!o)return wr(n,Os);let s,a,u=()=>(s||(s=n.propertySignatures.map(f=>({parser:t(f.type),name:f.name,type:f.type})),a=o?n.indexSignatures.map(f=>({is:f,parserKey:e(Bc(f.parameter)),parserValue:t(f.type)})):void 0),s),d=()=>{let f=new Set(n.propertySignatures.map(m=>typeof m.name=="number"?globalThis.String(m.name):m.name)),h=(m,i,l,S,p)=>{if(p._tag==="Failure")return Yo(m,n,i,p)??Sn;let I=p===$?S:p[w];if(l!==k&&I!==k){if(r&&(f.has(i)||f.has(typeof l=="number"?globalThis.String(l):l)))return Sn;rn(m.out,l,I)}return Sn},x=(m,i,l,S)=>{if(!S){let _=l.parserKey(i,m.options);if(!B(_))return Q(In(_),L=>x(m,i,l,L));S=_}if(S._tag==="Failure")return Yo(m,n,i,S)??Sn;let p=S===$?i:S[w],I=m.input[i],T=l.parserValue(I,m.options);return B(T)?h(m,i,p,I,T):Q(In(T),_=>h(m,i,p,I,_))},y=(m,i,l)=>{let S=m.input[i],p=l.parserValue(S,m.options);return B(p)?h(m,i,i,S,p):Q(In(p),I=>h(m,i,i,S,I))},E=o?Fo()({onItem:(m,[i,l])=>l.is.parameter===at?y(m,i,l):x(m,i,l),step:(m,i,l)=>l._tag==="Failure"?l:void 0}):void 0;return il(function*(m,i){if(m===k)return k;if(!(typeof m=="object"&&m!==null&&!Array.isArray(m)))return yield*U(new Je(n,m,i));u();let l=m,S={},p={ast:n,input:l,out:S,issues:void 0,options:i},I=i.errors==="all",T=i.onExcessProperty==="error",_=i.concurrency===void 0?1:_o(i.concurrency),L=o&&T?n.indexSignatures.map(M=>Ic(l,M.parameter,i)):void 0;if(T){let M=L?new Set(f):f;if(L)for(let ne of L)for(let D of ne)M.add(D);let ie=Reflect.ownKeys(l);for(let ne=0;ne<ie.length;ne++){let D=ie[ne];if(!M.has(D)&&Object.prototype.propertyIsEnumerable.call(l,D)){let R=new Sc(n,l[D],i),j=new st([D],R);if(I){p.issues?p.issues.push(j):p.issues=[j];continue}else return yield*U(new Te(n,[j],m,i))}}}if(r){let M=_===1?Fl(p,s):fx(p,s,{concurrency:_});M&&(yield*M)}if(o&&_===1)for(let M=0;M<o;M++){let ie=a[M],ne=ie.is.parameter===at?y:x,D=L?.[M]??(ie.is.parameter===at?Object.keys(l):Ic(l,ie.is.parameter,i));for(let R=0;R<D.length;R++){let j=ne(p,D[R],ie);if(!B(j))yield*j;else if(j._tag==="Failure")return yield*j}}else if(E){let M=so();for(let ne=0;ne<o;ne++){let D=a[ne],R=L?.[ne]??(D.is.parameter===at?Object.keys(l):Ic(l,D.is.parameter,i));for(let j=0;j<R.length;j++)M.push([R[j],D])}let ie=E(p,M,{concurrency:_});ie&&(yield*ie)}return p.issues?yield*U(new Te(n,p.issues,m,i)):S})};if(o)return d();let g,c=(f,h,x)=>{let y=s[h];return Q(In(x),E=>{let m=kc(f,y,E);if(m)return m;let i=()=>me(f.out),l=Fl(f,s.slice(h+1));return l?Ee(l,i):i()})};return(f,h)=>{if(f===k)return je;if(h.errors==="all"||h.onExcessProperty!==void 0||h.concurrency!==void 0&&_o(h.concurrency)!==1)return(g??=d())(f,h);if(!(typeof f=="object"&&f!==null&&!Array.isArray(f)))return U(new Je(n,f,h));let x=u(),y=f,E={},m={ast:n,input:y,out:E,issues:void 0,options:h};try{for(let i=0;i<x.length;i++){let l=x[i],S=l.name,p=wn(y,S),I=p?y[S]:k,T=l.parser(I,h);if(!B(T))return c(m,i,T);if(T===$){p&&rn(E,S,I);continue}let _=kc(m,l,T);if(_)return _}}catch(i){return zt(i)}return me(E)}}_rebuild(e,t,n,r){let o=An(this.propertySignatures,a=>{let u=e(a.type);return u===a.type?a:new Wl(a.name,u)}),s=An(this.indexSignatures,a=>{let u=t(a.parameter),d=e(a.type);return u===a.parameter&&d===a.type?a:new Gl(u,d)});return o===this.propertySignatures&&s===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Pc(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(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}};function kc(e,t,n){if(n._tag==="Failure")return Yo(e,e.ast,t.name,n);if(n===$)return;let r=n[w];if(r!==k){rn(e.out,t.name,r);return}if(delete e.out[t.name],!It(t.type)){let o=new st([t.name],new xr(t.type.context?.annotations));if(e.options.errors==="all"){e.issues?e.issues.push(o):e.issues=[o];return}else return gn(new Te(e.ast,[o],e.input,e.options))}}var Hl={onItem(e,t){if(!wn(e.input,t.name))return t.parser(k,e.options);let n=e.input[t.name];return rn(e.out,t.name,n),t.parser(n,e.options)},step:kc},Fl=Oo()(Hl),fx=Fo()(Hl);function Vl(e,t){return e?t?[...e,...t]:e:t}function ns(e,t,n){return new Pc(Reflect.ownKeys(e).map(r=>new Wl(r,e[r].ast)),[],n,t)}function Mc(e){return e.ast}function Rc(e,t=void 0){return new _n(!1,e.map(n=>n.ast),[],void 0,t)}function rs(e,t,n){return new it(e.map(Mc),t,void 0,n)}var Nc=Yt(e=>{for(;;){if(Ll(e))return Zo;let t=e.encoding;if(!t)return e.recur?.(Nc,F)??e;if(t.some(n=>n.transformation._tag==="Middleware"&&n.transformation.decode!==F))return Zo;e=t[t.length-1].to}});function Kl(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(Kl)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Ir(e){switch(e._tag){default:return[];case"Declaration":{let t=e.annotations?.[qo];return Array.isArray(t)?t:[]}case"Objects":return e.propertySignatures.flatMap(t=>{let n=t.type;if(!It(n)){if(kn(n))return[{key:t.name,literal:n.literal}];if(Cc(n))return[{key:t.name,literal:n.symbol}]}return[]});case"Arrays":return e.elements.flatMap((t,n)=>{if(!It(t)){if(kn(t))return[{key:n,literal:t.literal}];if(Cc(t))return[{key:n,literal:t.symbol}]}return[]});case"Union":{if(e.types.length===0)return[];let t=e.types.map(n=>Ir(Nc(n)));return t[0].filter(n=>t.every(r=>r.some(o=>o.key===n.key&&o.literal===n.literal)))}case"Suspend":return Ir(e.thunk())}}var Pl=new WeakMap,Qo=Object.freeze([]),Ml=e=>e===null?"null":Array.isArray(e)?"array":typeof e,wn=(e,t)=>t==="__proto__"?Object.hasOwn(e,t):t in e;function lx(e){let t=Pl.get(e);if(t)return t;let n,r=0,o,s,a=!0,u=[];for(let c=0;c<e.length;c++){let f=e[c],h=Nc(f);if(Zh(h))continue;if(kn(h)||Cc(h)){s??=new Map;let y=kn(h)?h.literal:h.symbol;u[c]=y;let E=s.get(y);E||s.set(y,E=[]),E.push(c)}else a=!1;let x=Ir(h);if(x.length){n??=new Map,r++;for(let{key:y,literal:E}of x){let m=n.get(y);m||n.set(y,m=[new Map,new Set]),m[1].add(c);let i=m[0].get(E);i||m[0].set(E,i=new Set),i.add(c)}}else{o??={};let y=Kl(h);for(let E of y)(o[E]??=[]).push(c)}}let d={},g=c=>d[c]??=Object.freeze(o?.[c]??Qo);if(a&&s)s.forEach(Object.freeze),t=c=>s.get(c)??Qo;else if(n?.size===1&&!o){let[c,[f]]=n.entries().next().value,h=new Map;for(let[y,E]of f)h.set(y,Object.freeze(Array.from(E)));let x=Object.freeze(e.map((y,E)=>E));t=(y,E)=>{if(Nr(y)){let m=wn(y,c)?y[c]:void 0;if(m!==void 0)return h.get(m)??Qo;if(E)return x}return Qo}}else if(n){let c;for(let f of n)(!c||f[1][0].size>c[1][0].size)&&f[1][1].size===r&&(c=f);t=(f,h)=>{let x=Ml(f);if(!Nr(f))return g(x);let y=new Set(o?.[x]),E;if(c){let[m,[i]]=c,l=wn(f,m),S=l?f[m]:void 0;if(l&&(!h||S!==void 0)){let p=i.get(S);if(!p)return g(x);for(let I of p)y.add(I);E=m}}if(E===void 0)for(let[m,[i,l]]of n){let S=wn(f,m),p=S?f[m]:void 0;if(S&&(!h||p!==void 0)){let I=i.get(p);if(I)for(let T of I)y.add(T)}else if(h)for(let I of l)y.add(I)}for(let[m,[i,l]]of n){if(m===E)continue;let S=wn(f,m),p=S?f[m]:void 0;if(S&&(!h||p!==void 0)){let I=i.get(p);for(let T of y)l.has(T)&&!I?.has(T)&&y.delete(T)}}return Array.from(y).sort((m,i)=>m-i)}}else t=c=>{let f=g(Ml(c));return s?f.filter(h=>u[h]===void 0||u[h]===c):f};return Pl.set(e,t),t}var it=class extends Le{_tag="Union";types;options;encodingChecks;constructor(e,t,n,r,o,s,a){super(n,r,o,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let n=this,r=t!==void 0,o=[],s=u=>o[u]??=e(n.types[u]),a;return(u,d)=>{if(u===k)return je;let g=(a??=lx(n.types))(u,r);if(g.length===0)return U(new gr(n,[],u,d));if(g.length===1){let c=s(g[0])(u,d);return c._tag==="Success"?c:B(c)?Ql(n,c.cause,u,d):px(n,c,u,d)}return dx(n,s,g,u,d)}}_rebuild(e,t,n){let r=An(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new it(r,this.options,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}}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=Ht(r);switch(o._tag){case"Arrays":{let s=o.elements.filter(kn);if(s.length>0)return`${Rl(o.isMutable)}[ ${s.map(a=>e(a)+Nl(a.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let s=o.propertySignatures.filter(a=>kn(a.type));if(s.length>0)return`{ ${s.map(a=>`${Rl(a.type.context?.isMutable)}${nn(a.name)}${Nl(a.type.context?.isOptional)}: ${e(a.type)}`).join(", ")}, ... }`;break}}return e(o)});return Array.from(new Set(n)).join(" | ")}};function Ql(e,t,n,r){let o=Sr(t);return o?gn(new gr(e,[o],n,r)):tr(t)}function px(e,t,n,r){return ot(t,o=>Ql(e,o,n,r))}function dx(e,t,n,r,o){let s={ast:e,parser:t,input:r,out:void 0,successes:e.options?.mode==="oneOf"?[]:void 0,issues:void 0,options:o},a=hx(s,n);return a?mx(a,s):s.out?s.out:U(new gr(e,s.issues??[],r,o))}function mx(e,t){return Ee(e,n=>t.out===$?W(t.input):t.out?t.out:U(new gr(t.ast,t.issues??[],t.input,t.options)))}var hx=Oo()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag==="Failure"){let r=Sr(n.cause);if(r===void 0)return n;e.issues?e.issues.push(r):e.issues=[r]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),gn(new pl(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return Sn}}}),Zl=new it([new qt("Infinity"),new qt("-Infinity"),new qt("NaN")]);function Rl(e){return e?"":"readonly "}function Nl(e){return e?"?":""}var Ac=class extends Dn{_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 Ac(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Ac(this.run,this.annotations,!0)}and(e,t){return new Xo([this,e],t)}},Xo=class extends Dn{_tag="FilterGroup";checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new Xo(this.checks,{...this.annotations,...e})}and(e,t){return new Xo([this,e],t)}};function os(e,t,n=!1){return new Ac((r,o,s)=>ml(o,e(r,o,s),r,s),t,n)}function Yl(e){return os(t=>globalThis.Number.isFinite(t),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitraryConstraint:{number:"finite"},...e})}var Xl=Gt(Fc,[Yl()]),xx=new he(new it([Xl,Zl]),new Me(Vo(),Ie(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function Uc(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return os(o=>(n.lastIndex=0,n.test(o)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:"effect/schema/isPattern",payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var vc=new WeakMap;function Cr(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(r=>r==="context"||r==="encoding")&&vc.set(n,ss(e)),n}function ss(e){let t=vc.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return vc.set(e,n),n}function Ce(e,t){return e.encoding===t?e:Cr(e,{encoding:t})}function On(e,t){if(e.context===t)return e;let n=ss(e);return n.context===t&&n.encoding===e.encoding?n:Cr(e,{context:t})}function ep(e){return e.encoding?ep(e.encoding[e.encoding.length-1].to):e}function as(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return tp(e,oa(e.checks.slice(0,-1),n.annotate(t)))}return Cr(e,{annotations:{...e.annotations,...t}})}function tp(e,t){if(e._tag==="Suspend"&&t)throw new Error("Cannot add checks to Suspend");return e.checks===t?e:Cr(e,{checks:t})}function Gt(e,t){return tp(e,Vl(e.checks,t))}function Dc(e,t){let n=t(e.to);return n===e.to?e:new he(n,e.transformation)}function np(e,t){let n=e,r=n[n.length-1],o=Dc(r,t);return o===r?e:oa(e.slice(0,e.length-1),o)}function rp(e){return t=>t.encoding?Ce(t,np(t.encoding,e)):t}function op(e,t){return rp(n=>On(n,t))(e)}function cs(e,t){function n(r){if(r.encoding){let o=r.encoding[r.encoding.length-1];return t?.stopAt?.(o)?r:Ce(r,np(r.encoding,n))}return e(r)}return Yt(n)}function gx(e,t,n){let r=new he(e,t);return Ce(n,n.encoding?[...n.encoding,r]:[r])}function An(e,t){let n;for(let r=0;r<e.length;r++){let o=e[r],s=t(o);if(n)n[r]=s;else if(s!==o){n=new Array(e.length);for(let a=0;a<r;a++)n[a]=e[a];n[r]=s}}return n??e}function is(e,t){let n=e.context?new Tt(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Tt(!1,!1,void 0,t);return On(e,n)}var us=Yt(e=>{let t=e.context?e.context.isOptional===!1?new Tt(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Tt(!0,!1);return Sx(On(e,t))}),Sx=rp(us),sp=$n(e=>us(new it([e,Oc])));function ap(e,t){let n=e.context?new Tt(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new Tt(!1,!1,t);return On(e,n)}function Lc(e,t,n){return gx(e,n,t)}function It(e){return e.context?.isOptional??!1}function cp(e){return e.annotations?.[dc]===!0||e._tag==="FilterGroup"&&e.checks.every(cp)}function yx(e){function t(r){return cp(r)?[r]:r._tag==="FilterGroup"?r.checks.flatMap(t):[]}let n=e.flatMap(t);return sa(n)?n:void 0}function Ex(e){let t=!0;function n(r){return t=t&&!r.encoding&&!Ll(r),t&&"recur"in r&&r.recur(n),r}return"recur"in e&&e.recur(n),t}var Ct=Yt(e=>{let t=ss(e);if(t!==e){let r=Ct(t);return r===t&&e.encoding===void 0?e:On(r,e.context)}let n="recur"in e?e.recur(Ct):e;if("encodingChecks"in n&&n.encodingChecks){let r=Ex(e)?n.encodingChecks:Dl(n)||Yh(n)||Ul(n)&&n.typeParameters.length>0?yx(n.encodingChecks):void 0;return Cr(n,{encodingChecks:void 0,checks:Vl(n.checks,r)})}return n}),Ht=Yt(e=>Ct(ct(e)));function bx(e,t){let n=t,r=n.length,o=n[r-1],s=[new he(ct(Ce(e,void 0)),n[0].transformation.flip())];for(let u=1;u<r;u++)s.unshift(new he(ct(n[u-1].to),n[u].transformation.flip()));let a=ct(o.to);return a.encoding?Ce(a,[...a.encoding,...s]):Ce(a,s)}var ct=$n(e=>{if(e.encoding)return bx(e,e.encoding);let t=ss(e);if(t!==e){let n=ct(t);return n===t?e:On(n,e.context)}return"flip"in e?e.flip(ct):"recur"in e?e.recur(ct):e});function ip(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(ip);default:return!1}}function $c(e,t){let n=t===0?$:me(t);return(r,o)=>r===k?je:r===t?n:U(new Je(e,r,o))}function wr(e,t){return(n,r)=>n===k?je:t(n)?$:U(new Je(e,n,r))}var Bc=cs(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(Bc)}}),jc=cs(e=>{switch(e._tag){default:return e;case"Symbol":case"UniqueSymbol":return e.toCodecStringTree();case"Union":return e.recur(jc)}});var _c=new globalThis.RegExp(`^${zl}$`),Tx=new globalThis.RegExp(`^(?:${zl}|Infinity|-Infinity|NaN)$`);function up(e){return Uc(_c,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:_c.source}),...e})}var fp=Gt(at,[up()]),Ix=new he(fp,Ko),Cx=new he(new it([fp,Zl]),Ko),wx="-?\\d+",MC=new globalThis.RegExp(`^${wx}$`);var kx="Symbol\\(([\\s\\S]*)\\)",RC=new globalThis.RegExp(`^${kx}$`);function wt(e,t,n,r,o){for(let s=0;s<e.length;s++){let a=e[s];if(a._tag==="FilterGroup"){if(n=wt(a.checks,t,n,r,o),n&&(o.errors!=="all"||n[n.length-1].filter.aborted))return n}else{let u=a.run(t,r,o);if(u){let d=new fl(a,u,t,o);if(n?n.push(d):n=[d],o.errors!=="all"||a.aborted)return n}}}return n}function lp(e){if(!Ul(e))return;let t=e.annotations?.[Jo];return vt(t)?t(e.typeParameters):void 0}function Ax(e){return e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"&&globalThis.Number.isFinite(e)}function vx(e){return e===void 0||typeof e=="string"}function pp(e,t){let n=new WeakMap,r=[];e:for(;;){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 a=Array.isArray(o);if(!a){let u=Object.getPrototypeOf(o);if(u!==null&&u!==Object.prototype&&Object.getPrototypeOf(u)!==null)return!1}n.set(o,!1),r.push({value:o,keys:a?o.length:Object.keys(o),index:0})}}for(;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 _x(e){return pp(e,Ax)}var es=new vn([],()=>(e,t,n)=>_x(e)?$:U(new Je(t,e,n)),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>{},toCodecStringTree:()=>mp});var zc=new he(es,Cn()),dp=new he(new it([new _n(!1,[],[es]),new Pc([],[new Gl(at,es)])]),Cn());function Ox(e){return pp(e,vx)}var Fx=new vn([],()=>(e,t,n)=>Ox(e)?$:U(new Je(t,e,n)),{expected:"StringTree",toCodecStringTree:()=>{}}),mp=new he(Fx,Cn());var fs=(e,t,n)=>e===$?n(t):Ee(e,n);function xp(e){if(e._tag==="Middleware")return(n,r,o)=>{let s=n===$?e.decode(me(fr(r)),o):e.decode(fc(n,fr),o);return hp(s)};let t=e.decode;switch(t._tag){case"Passthrough":return(n,r)=>n===$?me(r):n;case"Transform":{let n=r=>r===k?je:me(t.transform(r));return(r,o)=>fs(r,o,n)}case"TransformOptional":{let n=r=>hc(t.transform(fr(r)));return(r,o)=>fs(r,o,n)}case"TransformEffect":return(n,r,o)=>fs(n,r,s=>s===k?je:t.transform(s,o));case"TransformOptionalEffect":return(n,r,o)=>fs(n,r,s=>hp(t.transform(fr(s),o)))}}var hp=e=>Ee(e,hc),gp=(e,t,n,r)=>ot(r,o=>rr(()=>jt(o,s=>new ll(e,s,t,n))));function Px(e,t){let n=xp(e.link.transformation),r;return(o,s)=>{if(o===k)return je;if(e.isConstructed(o))return $;let a=(r??=t(e.link.to))(o,s);return n(a,o,s)}}function Mx(e,t){let n=e.context.constructorDefault;return(r,o)=>{if(r!==k&&r!==void 0)return t(r,o);let s=n;if(B(s)&&s._tag==="Success"){let a=t(s[w],o);return a===$?s:a}return Ee(gp(e,r,o,s),a=>{let u=t(a,o);return u===$?me(a):u})}}function Wc(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:Mx(e,n)}function Ar(e,t,n,r,o){if(e._tag==="Declaration")for(let y of e.typeParameters)t(y);let s=n?lp(e):void 0,a=s?Px(s,t):r??e.getParser(t,n),u=e.checks,d=e.encoding,g=d?.map(y=>xp(y.transformation)),c=e.encodingChecks;if(!d&&!u&&!c)return a;let f,h=(y,E)=>{let m=a(y,E);if(c&&!E.disableChecks)if(B(m)){if(m._tag==="Success"){let i=m===$?y:m[w];if(y!==k&&i!==k){let l=wt(c,y,void 0,e,E);l&&(m=U(new Te(e,l,y,E)))}}}else m=Q(m,i=>{if(y!==k&&i!==k){let l=wt(c,y,void 0,e,E);if(l)return U(new Te(e,l,y,E))}return W(i)});if(u&&!E.disableChecks)if(B(m)){if(m._tag==="Success"){let i=m===$?y:m[w];if(i===k)return m;let l=wt(u,i,void 0,e,E);l&&(m=U(new Te(e,l,i,E)))}}else m=Q(m,i=>{if(i!==k){let l=wt(u,i,void 0,e,E);if(l)return U(new Te(e,l,i,E))}return W(i)});return m},x=o===void 0?h:o(h);return d?(y,E)=>{let m=f??=d.map(S=>t(S.to)),i=y,l=m[m.length-1](y,E);for(let S=d.length-1;S>=0;S--)if(l=g[S](l,i,E),S!==0){let p=m[S-1];l._tag==="Success"?(i=l[w],l=p(i,E)):l=Ee(l,I=>{let T=p(I,E);return T===$?me(I):T})}if(l._tag==="Success"){let S=l[w],p=x(S,E);return p===$?l:p}return l=gp(e,y,E,l),Ee(l,S=>{let p=x(S,E);return p===$?me(S):p})}:x}var Jc=Symbol(),Sp=new WeakMap,yp,Gc=!1;var Nx=e=>Gc?ps(Qe,e,"parser"):Qe(e).parser,Ep=e=>Gc?ps(Qe,e,"makeEffect"):Qe(e).makeEffect,Ux=e=>Wc(e,Ep),ls=class{ast;constructor(t){this.ast=t}get decodeEffect(){return this.cachedDecodeEffect??=Ar(this.ast,Nx)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=Ar(this.ast,Ep,Ux)}},qc=class extends ls{compiled;resolve;constructor(t,n,r){super(t),this.compiled=n,this.resolve=r}save(t,n){return Object.defineProperty(this,t,{value:n}),n}operation(t){let n=this.compiled;return typeof n=="function"?n(this.ast,this.resolve,t):n?.[t]}get is(){return this.save("is",this.operation("is"))}get decode(){return this.save("decode",this.operation("decode"))}get make(){return this.save("make",this.operation("make"))}get decodeEffect(){return this.save("decodeEffect",this.operation("decodeEffect")??Ar(this.ast,t=>ps(this.resolve,t,"parser")))}get parser(){let t=this.decode;return t===void 0?this.decodeEffect:this.save("parser",Dx(t,()=>this.decodeEffect))}get makeEffect(){let t=this.operation("makeEffect");if(t!==void 0)return this.save("makeEffect",t);let n=r=>ps(this.resolve,r,"makeEffect");return this.save("makeEffect",Ar(this.ast,n,r=>Wc(r,n)))}};function Dx(e,t){let n;return(r,o)=>{if(r!==k)try{let s=e(r,o);if(s!==Jc)return s===r?$:me(s)}catch(s){return zt(s)}return(n??=t())(r,o)}}function ps(e,t,n){let r=e(t);if(r.compiled===void 0||Object.hasOwn(r,n))return r[n];let o;return(s,a)=>(o??=r[n])(s,a)}function Qe(e){let t=Sp.get(e);if(t!==void 0)return t;let n=yp===void 0?new ls(e):new qc(e,yp(e,Qe),Qe);return Sp.set(e,n),n}function Hc(e){let t=e.ast,n;return(r,o)=>(n??=Tp(Vx,Ct(t)))(r,o?.disableChecks?o?.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions)}function ms(e){let t=Hc(e);return(n,r)=>{let o=ir(t(n,r));return yn(o)?gt(o.value):(yr(o.cause,"Option adapter can only return none for schema issues"),rt())}}function hs(e){return Gx(Ct(e.ast))}function Vc(e,t){let n=jx(e.ast);return t===void 0?n:(r,o)=>n(r,Bx(t,o))}function bp(e,t){return qx(Vc(e,t))}var Bx=(e,t)=>t?{...e,...t}:e,ds=e=>e===k?U(new be):W(e);function jx(e){return Tp(Hx,e)}function zx(e,t){return e===$?W(t):B(e)?e[w]===k?ds(k):e:Ee(e,ds)}function Tp(e,t){let n;return(r,o)=>{let s=(n??=e(t))(r,o??ts);return s===$?W(r):B(s)?s[w]===k?ds(k):s:Ee(s,ds)}}function Wx(e){return(t,n)=>ir(e(t,n))}function qx(e){let t=Wx(e);return(n,r)=>{let o=t(n,r);return yn(o)?Ve(o.value):Ue(yr(o.cause,"Result adapter can only return schema issues"))}}function Jx(e,t){let n=ir(e);if(yn(n))return n.value;let r=yr(n.cause,t);throw new Error("Schema validation failed",{cause:r})}function Gx(e){let t,n;return(r,o)=>{t??=Qe(e);let s=o?.disableChecks?o.parseOptions?{...o.parseOptions,disableChecks:!0}:{disableChecks:!0}:o?.parseOptions??ts,a=t.make;if(a!==void 0&&r!==k){let d;try{d=a(r,s)}catch(g){throw yr(tc(g),"Constructor adapter can only throw schema issues"),g}if(d!==Jc&&d!==k)return d}let u=(n??=t.makeEffect)(r,s);return Jx(zx(u,r),"Constructor adapter can only throw schema issues")}}var Hx=e=>Qe(e).parser,Vx=e=>Qe(e).makeEffect;var xs="~effect/Schema/Schema",Cp=Symbol(),Kx={[xs]:xs,get make(){let e=hs(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=Hc(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=ms(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return Z(this,arguments)},annotate(e){return this.rebuild(as(this.ast,e))},annotateKey(e){return this.rebuild(is(this.ast,e))},check(...e){return this.rebuild(Gt(this.ast,e))},rebuild(e){return Fn(e,this[Cp])}};function Fn(e,t){function n(){}let r=Object.setPrototypeOf(n,Kx);return t&&(Object.hasOwn(t,"name")||Object.hasOwn(t,"length")||Object.hasOwn(t,"__proto__"))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[Cp]=t,r.ast=e,r}function kp(e){return Fn(Kc(e.ast),{schema:e})}var Kc=cs(e=>{let t=eg(e,Kc),n=e.context;return t===e||n===void 0?t:op(t,Qx(n))});function Qx(e){return e.constructorDefault===void 0?e:new Tt(e.isOptional,e.isMutable,void 0,e.annotations)}function Zx(e){if(e.propertySignatures.some(t=>typeof t.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e})}function Yx(e){return t=>{let n=[...t].sort((o,s)=>e(Ht(o))-e(Ht(s)));return n.some((o,s)=>o!==t[s])?n:t}}var Xx=Yx(e=>{switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}});function eg(e,t){switch(e._tag){case"Declaration":{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!vt(n))return Ce(e,[zc]);let r=e.typeParameters.map(s=>Fn(Ht(s))),o=n(r);return o===void 0?e:Ce(e,[Dc(o,t)])}case"Unknown":return Ce(e,[zc]);case"ObjectKeyword":return Ce(e,[dp]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return Zx(e),e.recur(t,jc);case"Union":{let n=Xx(e.types);return n!==e.types?new it(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t):e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}var gs=e=>e;var Qc="~effect/Schema/SchemaError";var vr=xs;function rg(){return(e,t,n)=>we(new vn(e.map(Mc),r=>t(r.map(o=>we(o))),n))}function og(e,t){return rg()([],()=>(n,r,o)=>e(n)?W(n):U(new Je(r,n,o)),t)}var _r=class extends ao("SchemaError"){[Qc]=Qc;constructor(t){let n=Ft();mt(0);try{super({issue:t})}finally{mt(n)}}get message(){return gl(this.issue)}toString(){return`SchemaError(${this.message})`}};function sg(e){return B(e)?ag(e):ot(e,t=>rr(()=>jt(t,n=>new _r(n))))}function ag(e){return yn(e)?e:tr(jt(e.cause,t=>new _r(t)))}function Ap(e,t){let n=Vc(e,t);return(r,o)=>sg(n(r,o))}function vp(e,t){let n=bp(e,t);return(r,o)=>ro(n(r,o),s=>new _r(s))}var we=Fn;function cg(e){return P(e,vr)&&e[vr]===vr}var te=gs(e=>{let t=fg(e);return we(sp(e.ast),{schema:t})});function Yc(e){let t=we(new qt(e),{literal:e,transform(n){return t.pipe(ti(Yc(n),{decode:Ie(()=>n),encode:Ie(()=>e)}))}});return t}var ig=we(Oc),O=we(at);var v=we(Fc),Xc=we(Bl);function ei(e,t){return we(e,{fields:t,mapFields(n,r){let o=n(this.fields);return ei(ns(o,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function se(e){return ei(ns(e,void 0),e)}function _p(e,t){return we(e,{elements:t,mapElements(n,r){let o=n(this.elements);return _p(Rc(o,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function ug(e){return _p(Rc(e),e)}var Ze=gs(e=>we(new _n(!1,[],[e.ast]),{value:e}));function Op(e,t){return we(e,{members:t,mapMembers(n,r){let o=n(this.members);return Op(rs(o,this.ast.options,r?.unsafePreserveChecks?this.ast.checks:void 0),o)}})}function Ss(e,t){return Op(rs(e,t,void 0),e)}function Vt(e){let t=e.map(Yc);return we(rs(t,void 0,void 0),{literals:e,members:t,mapMembers(n){return Ss(n(this.members))},pick(n){return Vt(n)},transform(n){return Ss(t.map((r,o)=>r.transform(n[o])))}})}var fg=gs(e=>Ss([e,ig]));function ti(e,t){return n=>we(Lc(n.ast,e.ast,t?Tc(t):Cn()),{from:n,to:e})}function lg(e){return t=>we(ap(t.ast,e),{schema:t})}function ys(e){return Yc(e).pipe(lg(W(e)))}function pg(e,t){return se({_tag:ys(e),...t})}function Pn(e,t){return og(n=>n instanceof e,t)}function Mn(){return(e,t)=>new he(e.ast,Tc(t))}var dg=os;function mg(e,t){let n=e.source,r=e.flags,o=/^[dg]*uy?$/.test(r),s=r===""?`new RegExp(${J(n)})`:`new RegExp(${J(n)}, ${J(r)})`;return Uc(e,{toJsonSchema:()=>o?{pattern:r.endsWith("y")?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${s})`}),...t})}function hg(e){let t=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return mg(t,{expected:"a base64 encoded string",representation:{id:"effect/schema/isBase64",payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:"Schema.isBase64()"}),...e})}function xg(e){return dg(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>[{type:"integer"},!0],toCode:()=>({runtime:"Schema.isInt()"}),arbitraryConstraint:{number:"integer"},...e})}var gg=v.check(xg());var Fk=Pn(globalThis.RegExp,{representation:{id:"effect/schema/RegExp",payload:null},toCode:()=>({runtime:"Schema.RegExp",Type:"globalThis.RegExp"}),expected:"RegExp",toCodecJson:()=>Mn()(se({source:O,flags:O}),Tr({decode:(e,t)=>or({try:()=>new globalThis.RegExp(e.source,e.flags),catch:()=>new be({expected:"valid RegExp source and flags"},e,t)}),encode:e=>W({source:e.source,flags:e.flags})}))}),Sg=O.annotate({expected:"a string that will be decoded as a URL"}),Pk=Pn(globalThis.URL,{representation:{id:"effect/schema/URL",payload:null},toCode:()=>({runtime:"Schema.URL",Type:"globalThis.URL"}),expected:"URL",toCodecJson:()=>Mn()(Sg,wl)});var yg=O.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json"});function ni(e,t){return yg.pipe(ti(e,Al(t)))}var Eg=Pn(globalThis.File,{representation:{id:"effect/schema/File",payload:null},toCode:()=>({runtime:"Schema.File",Type:"globalThis.File"}),expected:"File",toCodecJson:()=>Mn()(se({data:O.check(hg()),type:O,name:O,lastModified:gg}),Tr({decode:(e,t)=>oo(Wo(e.data),{onFailure:()=>U(new be({expected:"a valid Base64 string"},e.data,t)),onSuccess:n=>{let r=new globalThis.Uint8Array(n);return W(new globalThis.File([r],e.name,{type:e.type,lastModified:e.lastModified}))}}),encode:(e,t)=>En({try:async()=>{let n=new globalThis.Uint8Array(await e.arrayBuffer());return{data:zo(n),type:e.type,name:e.name,lastModified:e.lastModified}},catch:()=>new be({expected:"a readable File"},e,t)})}))}),Mk=Pn(globalThis.FormData,{representation:{id:"effect/schema/FormData",payload:null},toCode:()=>({runtime:"Schema.FormData",Type:"globalThis.FormData"}),expected:"FormData",toCodecJson:()=>Mn()(Ze(ug([O,Ss([se({_tag:ys("String"),value:O}),se({_tag:ys("File"),value:Eg})])])),Tr({decode:e=>{let t=new globalThis.FormData;for(let[n,r]of e)t.append(n,r.value);return W(t)},encode:e=>W(globalThis.Array.from(e.entries()).map(([t,n])=>typeof n=="string"?[t,{_tag:"String",value:n}]:[t,{_tag:"File",value:n}]))}))});var Rk=Pn(globalThis.URLSearchParams,{representation:{id:"effect/schema/URLSearchParams",payload:null},toCode:()=>({runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"}),expected:"URLSearchParams",toCodecJson:()=>Mn()(O.annotate({expected:"a query string that will be decoded as URLSearchParams"}),Cl({decode:e=>new globalThis.URLSearchParams(e),encode:e=>e.toString()}))});var bg=O.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),Nk=Pn(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>Mn()(bg,kl)});var Tg=-864e13,Ig=864e13,Uk=Tg+840*60*1e3,Dk=Ig-840*60*1e3,Lk=-720*60*1e3,$k=840*60*1e3;var Cg=globalThis.Symbol.for("immer-draftable"),Zc={};function Fp(e,t,n,r,o){let s=kg(n,t,r),a=Pp(t),u=class extends e{constructor(...[d,g]){let f=g?.["~payload"],h=f?.token===Zc?f.value:n.make(d??{},g);super(h,{...g,disableChecks:!0,"~payload":{token:Zc,value:h}})}static[vr]=vr;get[a](){return a}static[Cg]=!0;static identifier=t;static fields=n.fields;static get ast(){return s(this).ast}static pipe(){return Z(this,arguments)}static rebuild(d){return s(this).rebuild(d)}static make(d,g){return hs(s(this))(d??{},g)}static makeOption(d,g){return ms(s(this))(d??{},g)}static makeEffect(d,g){return s(this).makeEffect(d??{},g)}static annotate(d){return this.rebuild(as(this.ast,d))}static annotateKey(d){return this.rebuild(is(this.ast,d))}static check(...d){return this.rebuild(Gt(this.ast,d))}static extend(d){return(g,c)=>{let f=ri(g)?g:se(g),h={...n.fields,...f.fields},x=ns(h,n.ast.checks,{identifier:d});return Fp(this,d,ei(Gt(x,f.ast.checks),h),c,o)}}static mapFields(d,g){return n.mapFields(d,g)}};return o!==void 0&&Object.assign(u.prototype,o(t)),u}function wg(e){return new Me(Ie(t=>new e(t,{"~payload":{token:Zc,value:t}})),Er())}function Pp(e){return`~effect/Schema/Class/${e}`}function kg(e,t,n){let r;return o=>{if(r!==void 0)return r;let s=Pp(t),a=g=>g instanceof o||P(g,s),u=wg(o),d=we(new vn([e.ast],()=>(g,c,f)=>a(g)?W(g):U(new Je(c,g,f)),{identifier:t,[Jo]:([g])=>({isConstructed:a,link:new he(g,u)}),toCodec:([g])=>new he(g.ast,u),toEquivalence:([g])=>g,toFormatter:([g])=>c=>`${o.identifier}(${g(c)})`,[qo]:Ir(e.ast),...n}));return r=ti(d,u)(e)}}function ri(e){return cg(e)}var Ag=e=>(t,n)=>{let r=ri(t)?t:se(t);return Fp(Vr,e,r,n,s=>({name:s}))},Mp=e=>(t,n,r)=>{let o=ri(n)?n.mapFields(s=>({_tag:ys(t),...s}),{unsafePreserveChecks:!0}):pg(t,n);return Ag(e??t)(o,r)};var oi=kp;var Rp=Ma;var Np="~effect/MutableRef",_g={[Np]:Np,...Re,toJSON(){return{_id:"MutableRef",current:et(this.current)}}},Up=e=>{let t=Object.create(_g);return t.current=e,t};var Dp=b(2,(e,t)=>(e.current=t,e));var Fg=Symbol.for("effect/MutableList/Empty"),$p=()=>({head:void 0,tail:void 0,length:0}),Bp=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},Lp=()=>({array:[],mutable:!0,offset:0,next:void 0}),Nn=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Lp(),e.tail=e.tail.next):e.head=e.tail=Lp(),e.tail.array.push(t),e.length++};var Rn=e=>{e.head=e.tail=void 0,e.length=0},jp=(e,t)=>{if(t=Qn(t),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 Rn(e),s}let n=new Array(t),r=0,o=e.head;for(;o;){for(;o.offset<o.array.length;)if(n[r++]=o.array[o.offset],o.mutable&&(o.array[o.offset]=void 0),o.offset++,r===t)return e.head=o.offset===o.array.length&&o.next?o.next:o,e.length-=t,e.length===0?Rn(e):Bp(e),n;o=o.next}return Rn(e),n};var zp=e=>{if(!e.head)return Fg;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:Rn(e):Bp(e),t};var Mg="~effect/Queue",Rg="~effect/Queue/Enqueue",Ng="~effect/Queue/Dequeue";var ai={_A:F,_E:F},Ug={[Mg]:ai,[Rg]:ai,[Ng]:ai,...Re,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:Lg(this)}}},Wp=e=>H(t=>{let n=Object.create(Ug);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??Number.POSITIVE_INFINITY,n.strategy=e?.strategy??"suspend",n.messages=$p(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},K(n)});var qp=(e,t)=>e.state._tag!=="Open"?!1:e.messages.length>=e.capacity?e.strategy==="sliding"?(zp(e.messages),Nn(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(Nn(e.messages,t),Kp(e),!0):!1:(Nn(e.messages,t),Qp(e),!0);var Es=(e,t)=>{if(e.state._tag!=="Open")return!1;let n=Ae(t),r=bf(n,Bg);return e.state.offers.size===0&&e.messages.length===0?(ci(e,r),!0):(e.state={...e.state,_tag:"Closing",exit:r},Qp(e),!0)};var bs=e=>Es(e,Jn(Hn()));var Jp=e=>ve(()=>Dg(e)),Dg=e=>{if(e.state._tag==="Done")return!1;Rn(e.messages);let t=e.state.offers;ci(e,e.state._tag==="Open"?jg:e.state.exit);for(let n of t)qg(n);return!0};var Gp=e=>Hp(e,1,Number.POSITIVE_INFINITY);var Hp=b(3,(e,t,n)=>(t=Qn(t),n=Qn(n),ee(()=>zg(e,t,n)??yo(Wg(e,()=>Zp(e,t)),Hp(e,t,n)))));var Lg=e=>e.state._tag==="Done"?0:e.messages.length;var $g=q(!1),Vp=q(!0),Bg=He(Hn()),jg=ja(),Kp=e=>{if(!(e.state._tag==="Done"||e.state.takers.size===0)){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(Pe),e.messages.length===0))break}},Qp=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,Kp(e)},0))},zg=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return q([]);if(!Zp(e,t))return;let r=e.messages.length>0?jp(e.messages,n):[Jg(e.state.offers)];return Gg(e),q(r)},Zp=(e,t)=>e.messages.length>=(e.state._tag==="Closing"?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!=="Done"&&e.state.offers.size>0,Wg=(e,t)=>Ke(n=>{if(e.state._tag==="Done")return n(e.state.exit);if(t())return n(Pe);let r={ready:t,resume:n};return e.state.takers.add(r),ve(()=>{e.state._tag!=="Done"&&e.state.takers.delete(r)})});var qg=e=>e._tag==="Single"?e.resume($g):e.resume(q(e.remaining.slice(e.offset))),Jg=e=>{let t=e.values().next().value;if(t._tag==="Single")return e.delete(t),t.resume(Vp),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(q([]))),n},Gg=e=>{if(e.state._tag==="Done")return Mo(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(ci(e,e.state.exit),Mo(e.state.exit.cause)):!1;for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag==="Single")Nn(e.messages,t.message),e.state.offers.delete(t),t.resume(Vp);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;Nn(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(q([]))}}return!1};var ci=(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.resume(t);n.takers.clear();for(let r of n.awaiters)r(t);n.awaiters.clear()};var Xp=(e,t,n)=>Ke(r=>{if(e.free>=t)return r(n);let o=()=>{e.free<t||(e.waiters.delete(o),r(n))};return e.waiters.add(o),ve(()=>{e.waiters.delete(o)})}),ii=class{waiters=new Set;taken=0;permits;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take(t){let n=ee(()=>this.free<t?Xp(this,t,n):(this.taken+=t,K(t)));return n}takeIfAvailable(t){return ee(()=>this.free<t?K(!1):(this.taken+=t,K(!0)))}releaseUnsafe(t,n){return this.taken-=n,this.waiters.size>0&&t.currentDispatcher.scheduleTask(()=>{for(let r of this.waiters){if(this.free<=0)break;r()}},0),this.free}resize(t){return H(n=>(this.permits=t,this.free<0?ge:(this.releaseUnsafe(n,0),ge)))}release(t){return H(n=>K(this.releaseUnsafe(n,t)))}get releaseAll(){return H(t=>K(this.releaseUnsafe(t,this.taken)))}withPermits(t){return n=>xn(r=>{let o=ee(()=>{if(this.free<t){let s=Xp(this,t,ge);return Se(r(s),()=>o)}return this.taken+=t,Xn(r(n),()=>{this.releaseUnsafe(mn(),t)},!0)});return o})}withPermit=this.withPermits(1);withPermitsIfAvailable(t){return n=>xn(r=>this.free<t?Ra:(this.taken+=t,Xn(r(La(n)),()=>{this.releaseUnsafe(mn(),t)},!0)))}},ed=e=>ve(()=>new ii(e));var td=(e,t)=>t?e.withPermit(t):e.withPermit;var cS="~effect/Channel";var iS={[cS]:{_Env:F,_InErr:F,_InElem:F,_OutErr:F,_OutElem:F},pipe(){return Z(this,arguments)}},nd=e=>{let t=Object.create(iS);return t.transform=(n,r)=>ot(e(n,r),o=>W(ac(o))),t};var rd=e=>e.transform;var uS=(e,t,n)=>Wp({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(Uo(r=>el(e,Jp(r))),Uo(r=>ar(Xf(t(r),e),e)));var od=(e,t)=>nd((n,r)=>sr(uS(r,e,t),Gp));var fS=(e,t,n)=>nr(()=>{let r=Yf(),o=rd(e)(rl(),r);return oc(Q(o,t),n||W).pipe(ic(s=>tl(r,s)))});var sd=b(2,(e,t)=>fS(e,n=>uc(Q(n,t),{disableYield:!0})));var pS="~effect/Stream",dS={_R:F,_E:F,_A:F},ad=function(e){this.channel=e};ad.prototype={[pS]:dS,pipe(){return Z(this,arguments)}};var cd=e=>new ad(e);var hS=cd;var id=(e,t)=>hS(od(e,t));var Ts=b(2,(e,t)=>sd(e.channel,n=>{let r=0;return sc({while:()=>r<n.length,body:()=>t(n[r++]),step:At})}));var ud=e=>e<1e3?`${Math.max(0,Math.round(e))}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(1)}M`,ut=(e,t)=>{let n=Math.max(0,Math.round((t-(e??t))/1e3));return[Math.floor(n/3600),Math.floor(n/60)%60,n%60].map(r=>String(r).padStart(2,"0")).join(":")},Kt=(e,t)=>{let n=Math.max(0,Math.floor(((t??0)-(e??t??0))/1e3)),r=Math.floor(n/60);return n<60?`${n}s`:r<60?`${r}m${String(n%60).padStart(2,"0")}s`:`${Math.floor(r/60)}h${String(r%60).padStart(2,"0")}m`},fd=e=>`~$${e.toFixed(2)}`;var xS=Vt(["orchestrator","judgment","judge","running","log","tool","done","failed","issue"]),gS=Vt(["planned","running","waiting","done","failed"]),ld=se({seq:v,at:v,who:O,what:O,tone:xS}),SS=se({lane:O,round:v,cleared:Xc,issues:v,dimensions:Ze(se({id:O,score:v,max:v})),seq:v}),yS=se({id:O,status:gS,executor:te(O),stage:te(O),startedAt:te(v),endedAt:te(v),tokens:v,prompt:v,completion:v,model:te(O),merged:Xc,failStage:te(O),failMessage:te(O),tools:Ze(O),activity:te(se({text:O,since:v})),note:te(O),tasks:v}),ES=se({name:O,state:Vt(["busy","idle","out"]),text:O}),bS=se({count:v,steps:v,seq:te(v),lastSeq:te(v),startedAt:te(v),now:te(v),ended:te(O),title:O,action:te(O),stage:O,agents:O,counts:se({planned:v,running:v,waiting:v,done:v,failed:v,total:v}),tokens:v,costUsd:v,stories:Ze(yS),focus:te(O),judge:se({executor:te(O),state:Vt(["idle","waiting","running"]),reviews:v,verdicts:v,borrowed:v}),verdicts:Ze(SS),merged:v,roster:Ze(ES),timeline:Ze(ld),timelineCount:v,gapMs:v}),TS=se({seq:v,at:v}),IS=se({mode:Vt(["live","replay"]),runId:te(O),trace:O,speed:v,steps:Ze(TS),lastSeq:te(v),timeline:Ze(ld)}),pd=ni(oi(bS)),dd=ni(oi(IS));var Qt=class extends Mp()("PageError",{message:O}){},CS=vp(pd),fi=e=>ro(CS(e),t=>new Qt({message:`a frame did not decode: ${t.message}`})),md=(e,t)=>id(n=>ye(function*(){let r=yield*Bo(oe(e),o=>oe(()=>o.close()));r.addEventListener("frame",o=>{let s=fi(o.data);no(s)?qp(n,s.success):Es(n,nl(s.failure))}),r.addEventListener("end",()=>{bs(n)}),t.endOnError&&r.addEventListener("error",()=>{bs(n)})}));var wS="~effect/Ref",kS={[wS]:{_A:F},...Re,toJSON(){return{_id:"Ref",ref:this.ref}}},AS=e=>{let t=Object.create(kS);return t.ref=Up(e),t},li=e=>oe(()=>AS(e)),Zt=e=>oe(()=>e.ref.current),pi=b(2,(e,t)=>oe(()=>Dp(e.ref,t))),hd=b(2,(e,t)=>oe(()=>{let n=e.ref.current;return e.ref.current=t,n}));var Is=b(2,(e,t)=>oe(()=>{e.ref.current=t(e.ref.current)})),xd=b(2,(e,t)=>oe(()=>e.ref.current=t(e.ref.current)));var di={_tag:"Paused"},Sd=(e,t)=>Math.max(1,e.filter(n=>n.seq<=t).length),yd=(e,t)=>Math.max(1,e.filter(n=>n.at<=t).length),Ed=cl("watch-web/ReplayController.make")(function*(e,t,n){let r=yield*$o,o=yield*ed(1),s=yield*li(di),a=yield*li({count:gd(t.count,t.steps),speed:t.speed}),u=0,d=ye(function*(){let{count:i,speed:l}=yield*Zt(a),S=yield*Zt(s);return{count:i,speed:l,steps:t.steps,playing:S._tag==="Playing"}}),g=Q(d,i=>oe(()=>n.chrome(i))),c=i=>td(o,i),f=ye(function*(){let i=yield*hd(s,di);i._tag==="Playing"&&(yield*Rp(i.fiber))}),h=(i,l)=>ye(function*(){yield*Is(a,S=>({...S,count:i.count})),n.draw(i,l),yield*g}),x=i=>c(ye(function*(){let l=yield*Zt(s);l._tag==="Playing"&&l.token===i&&(yield*pi(s,di),yield*g)})),y=ye(function*(){yield*f;let i=yield*xd(a,T=>T.count>=t.steps?{...T,count:1}:T),l=++u,S=!0,p=e.stream({count:i.count,speed:i.speed}).pipe(Ts(T=>{let _=!S;return S=!1,h(T,_)}),Do(T=>oe(()=>n.failed(T))),Tn(x(l))),I=yield*ar(p,r);yield*pi(s,{_tag:"Playing",token:l,fiber:I}),yield*g}),E=Tn(f,g),m=(i,l)=>ye(function*(){yield*f;let S=gd(i,t.steps);yield*Is(a,p=>({...p,count:S})),yield*Lo(e.frame(S),{onSuccess:p=>h(p,l),onFailure:p=>Tn(oe(()=>n.failed(p)),g)})});return{state:d,play:c(y),pause:c(E),toggle:c(Q(Zt(s),i=>i._tag==="Playing"?E:y)),step:i=>c(Q(Zt(a),l=>m(l.count+i,!0))),seek:(i,l)=>c(m(i,l)),setSpeed:i=>c(ye(function*(){yield*Is(a,S=>({...S,speed:i})),yield*(yield*Zt(s))._tag==="Playing"?y:g}))}}),gd=(e,t)=>Math.min(t,Math.max(1,e));var wd=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,Cs=e=>`${e} issue${e===1?"":"s"}`,Fr=e=>ud(e),_S={"&":"&","<":"<",">":">",'"':"""},de=e=>String(e).replace(/[&<>"]/g,t=>_S[t]??t),V=(e,t)=>{let n=e.querySelector(t);return n instanceof HTMLElement?n:void 0},kt=(e,t)=>[...e.querySelectorAll(t)].filter(n=>n instanceof HTMLElement),ce=(e,t,n)=>{for(let r of kt(e,`[data-bind="${t}"]`))r.textContent=String(n)},ft=(e,t)=>{e===void 0||!(e instanceof HTMLElement||e instanceof SVGElement)||e.dataset.html!==t&&(e.dataset.html=t,e.innerHTML=t)},OS=e=>{for(let t of kt(e,"[data-pct]"))t.style.width=`${t.dataset.pct??0}%`},FS=e=>{let t=/^(epic)\s+(.+)$/u.exec(e.title),n=t?.[1],r=t?.[2];return n!==void 0&&r!==void 0?{kind:n,name:r,branch:`epic/${r}`}:{kind:e.title,name:e.action??"",branch:"merge"}},ae={orch:40,story:330,judge:720,jmt:960,merge:1180},Or=198,kd=84,bd=e=>{let t=Math.max(560,32+e*kd+24);return{height:t,oy:Math.round(t/2)-28,top:32}},Td=(e,t,n,r)=>{let o=(e+n)/2;return`M${e} ${t} C${o} ${t} ${o} ${r} ${n} ${r}`},Id={star:'<svg class="icon" viewBox="0 0 24 24"><path d="M12 1.5c.7 5.6 3.4 8.5 10.5 10.5-7.1 2-9.8 4.9-10.5 10.5C11.3 16.9 8.6 14 1.5 12 8.6 10 11.3 7.1 12 1.5z"/></svg>',fail:'<svg class="icon" viewBox="0 0 24 24"><path d="M8 2h8l6 6v8l-6 6H8l-6-6V8zm2.1 5L7 10.1 8.9 12 7 13.9 10.1 17 12 15.1 13.9 17 17 13.9 15.1 12 17 10.1 13.9 7 12 8.9z"/></svg>'},PS=(e,t)=>e==="done"||e==="issues"?`<span class="content">${de(t)}</span>`:e==="failed"?`<span class="content">${Id.fail}</span>`:e==="running"?"":`<span class="content">${Id.star}</span>`,mi=e=>e==="planned"?"idle":e,Cd=(e,t)=>{e.classList.remove(t),e.offsetWidth,e.classList.add(t)},hi=(e,t)=>{let{mode:n,reduce:r,frozen:o}=t,s=V(e,"[data-graph]"),a=new Map,u=new Map,d,g="",c,f,h=()=>{let i=f?.stories.map(l=>l.id)??[];return d!==void 0&&i.includes(d)?d:f?.focus},x=i=>{let l=String(i);if(l===g||s===void 0)return;g=l;let{height:S}=bd(i);s.style.height=`${S}px`,s.innerHTML=`<svg class="edges" width="1390" height="${S}" viewBox="0 0 1390 ${S}"></svg>`;let p=s.querySelector("svg");c=p instanceof SVGSVGElement?p:void 0,a.clear(),u.clear();let I=[["orchestrator",ae.orch],[`stories \xB7 ${i}`,ae.story],["judge seat",ae.judge],["judgment",ae.jmt],["merge",ae.merge]];for(let[T,_]of I){let L=document.createElement("span");L.className="caption",L.style.left=`${_}px`,L.textContent=T,s.append(L)}},y=(i,l,S,p)=>{let I=a.get(i);if(I!==void 0)return I.style.top=`${S}px`,I;let T=document.createElement("div");return T.className=p?"node story":"node",T.style.left=`${l}px`,T.style.top=`${S}px`,T.dataset.id=i,T.innerHTML='<div class="box"><div class="shine"></div><div class="slot"></div></div><div class="label"><span class="n"></span><span class="s"></span><span class="t"></span></div>',p&&T.addEventListener("click",()=>{d=i,f!==void 0&&m(f,!1)}),s?.append(T),a.set(i,T),T},E=(i,l,S,p,I,T,_,L=!1)=>{let M=y(i,l,S,L),ie=u.get(i),ne=`${p}|${T}`;M.dataset.state=p;let D=(R,j)=>{let _e=V(M,R);_e!==void 0&&(_e.textContent=j)};if(D(".n",I.name),D(".s",I.sub),D(".t",I.time),M.classList.toggle("selected",L&&i===h()),ie!==ne){let R=V(M,".slot");if(R!==void 0&&(R.innerHTML=PS(p,T)),_&&!r&&ie!==void 0){let j=V(M,".box");(p==="done"||p==="issues")&&R?.firstElementChild?.classList.add("pop"),j!==void 0&&p==="failed"&&Cd(j,"shake"),j!==void 0&&i==="merge"&&p==="done"&&Cd(j,"flash")}}u.set(i,ne)},m=(i,l)=>{f=i;let S=i.now??0,p=i.startedAt??S,I=i.stories;x(I.length);let{oy:T,top:_}=bd(I.length),L=A=>_+A*kd,M=FS(i),ie=I.length>0&&I.every(A=>A.status==="done"),ne=i.ended==="failed"?"failed":ie||i.ended!==void 0?"done":"running";E("orch",ae.orch,T,ne,{name:M.kind,sub:M.name,time:Kt(p,S)},"done",l),I.forEach((A,ue)=>{let z=mi(A.status),xe=z==="running"?`${Kt(A.startedAt,S)} \xB7 ${Fr(A.tokens)} tok`:z==="done"&&A.startedAt!==void 0?`${Kt(A.startedAt,A.endedAt??S)} \xB7 ${Fr(A.tokens)} tok`:z==="failed"?A.failStage??"":"";E(A.id,ae.story,L(ue),z,{name:A.id,sub:A.executor??A.status,time:xe},A.merged?"merged":"done",l,!0)});let D=i.judge;E("judge",ae.judge,T,D.state,{name:"judge seat",sub:D.executor!==void 0?`${D.executor} \xB7 on call`:"[not leased yet]",time:`reviews ${D.reviews} \xB7 verdicts ${D.verdicts}`},"",l);let R=i.verdicts.at(-1);E("jmt",ae.jmt,T,R===void 0?"idle":R.cleared?"done":"issues",{name:"judgment",sub:R===void 0?"[none yet]":`${R.lane} r${R.round}`,time:R===void 0?"":R.cleared?"cleared \u2192 merge":`${Cs(R.issues)} \u2192 coder`},R===void 0?"":R.cleared?"cleared":Cs(R.issues),l),E("merge",ae.merge,T,i.merged>0?"done":"idle",{name:"merge",sub:M.branch,time:`${i.counts.done}/${i.counts.total} done`},`${i.merged}/${i.counts.total}`,l);let j=[ae.orch+Or-10,T+28],_e="";if(I.forEach((A,ue)=>{let z=mi(A.status),xe=L(ue)+28;_e+=`<path id="${n}-e-o-${ue}" class="edge ${z}" d="${Td(j[0],j[1],ae.story-8,xe)}"/>`;let Fd=i.verdicts.some(Si=>Si.lane===A.id);(z==="running"||z==="done"||Fd)&&(_e+=`<path id="${n}-e-j-${ue}" class="edge ${z==="done"?"done":"pending"}" d="${Td(ae.story+Or+6,xe,ae.judge-8,T+28)}"/>`)}),_e+=`<path class="edge ${R!==void 0?"done":"idle"}" d="M${ae.judge+Or-20} ${T+28} L${ae.jmt-8} ${T+28}"/>`,_e+=`<path class="edge ${i.merged>0?"done":"idle"}" d="M${ae.jmt+Or-20} ${T+28} L${ae.merge-8} ${T+28}"/>`,I.forEach((A,ue)=>{if(A.status==="running")for(let z of[`${n}-e-o-${ue}`,`${n}-e-j-${ue}`])for(let xe of[0,.6])_e+=`<circle class="token" r="3"><animateMotion dur="1.2s" begin="-${xe}s" repeatCount="indefinite" calcMode="linear"><mpath href="#${z}"/></animateMotion></circle>`}),ft(c,_e),(r||o)&&c?.pauseAnimations(),s!==void 0){for(let A of kt(s,".bubble"))I.some(ue=>ue.status==="failed"&&ue.failMessage!==void 0&&A.dataset.id===ue.id)||A.remove();I.forEach((A,ue)=>{if(A.status!=="failed"||A.failMessage===void 0)return;let z=V(s,`.bubble[data-id="${CSS.escape(A.id)}"]`);if(z!==void 0){z.style.top=`${L(ue)+12}px`;return}let xe=document.createElement("div");xe.className=`bubble${l&&!r?" bubble-in":""}`,xe.dataset.id=A.id,xe.style.left=`${ae.story+Or+14}px`,xe.style.top=`${L(ue)+12}px`,xe.textContent=A.failMessage,s.append(xe)})}ft(V(e,"[data-bind-title]"),M.name!==""?`<span class="muted">${de(M.kind)}</span> ${de(M.name)}`:de(M.kind)),document.title=`${i.title} \xB7 llm4ts watch`,ce(e,"elapsed",n==="live"?Kt(p,S):ut(p,S)),ce(e,"stories",`${i.counts.done}/${i.counts.total} done \xB7 ${i.counts.running} running \xB7 ${i.counts.failed} failed`),ce(e,"tokens",Fr(i.tokens)),ce(e,"cost",fd(i.costUsd)),ce(e,"stage",i.stage),ce(e,"agents",i.agents),ft(V(e,"[data-roster]"),i.roster.length>0?i.roster.map(A=>`<div class="exec"><i class="dot-${A.state}"></i><div><div class="nm">${de(A.name)}</div><div class="ln" title="${de(A.text)}">${de(A.text)}</div></div></div>`).join(""):'<div class="exec"><div><div class="ln">no executors yet</div></div></div>'),MS(e,i,h(),S),NS(e,i)};return{render:m}},MS=(e,t,n,r)=>{let o=t.stories.find(f=>f.id===n),s=V(e,"[data-detail]");if(o===void 0){ft(s,`<div class="card-head"><div class="mini idle"></div><div class="head-title"><div class="card-title">no stories yet</div><div class="card-desc">waiting for the run's first lane</div></div></div><div class="body"><div class="empty">no stories in flight</div></div>`);return}let a=mi(o.status),u=[],d=(f,h,x="")=>{u.push(`<div class="kv"><span>${f}</span><span${x===""?"":` class="${x}"`}>${de(h)}</span></div>`)};o.stage!==void 0&&o.stage!==""&&d("stage",o.stage),a==="running"&&o.activity!==void 0&&d("now",`${Kt(o.activity.since,r)} \xB7 ${o.activity.text}`,"v-time"),o.tools.length>0&&d("tools",o.tools.join(" \xB7 ")),o.failMessage!==void 0&&o.failMessage!==""&&d("error",`${o.failStage!==void 0&&o.failStage!==""?`${o.failStage}: `:""}${o.failMessage}`,"v-err"),o.note!==void 0&&o.note!==""&&a!=="done"&&d("review",o.note,"v-int"),o.model!==void 0&&o.model!==""&&d("model",o.model),o.startedAt!==void 0?(d("tokens",o.prompt>0?`${Fr(o.tokens)} (${o.prompt.toLocaleString("en-US")} prompt \xB7 ${o.completion.toLocaleString("en-US")} completion)`:Fr(o.tokens)),d("elapsed",Kt(o.startedAt,o.endedAt??r),"v-time")):d("status",o.status,"v-faint");let g=a==="running"?o.tasks>0?`<div class="kv"><span>plan</span><span>${o.tasks} tasks</span></div>`:'<div class="kv"><span>plan</span><span class="v-dim">no task plan yet</span></div><div class="indeterminate"></div>':"",c=[o.executor,o.executor!==void 0?"coder":void 0,o.stage].filter(f=>f!==void 0&&f!=="").join(" \xB7 ");ft(s,`
|
|
13
|
+
<div class="card-head"><div class="mini ${a}"></div><div class="head-title"><div class="card-title">${de(o.id)}</div><div class="card-desc">${de(c===""?o.status:c)}</div></div><span class="key"><kbd>t</kbd>tail</span><span class="key"><kbd>enter</kbd>expand</span></div>
|
|
14
|
+
<div class="body">${u.join("")}${g}</div>`)},RS=(e,t)=>`
|
|
15
|
+
<div class="round ${t===0?"latest":"older"}">
|
|
16
|
+
<div class="round-head"><span class="eyebrow">JUDGMENT \xB7 ${de(e.lane)} r${e.round}</span>
|
|
17
|
+
<span class="verdict ${e.cleared?"cleared":"issues"}">${e.cleared?"cleared \u2192 merge":`${Cs(e.issues)} \u2192 coder`}</span></div>
|
|
18
|
+
${e.dimensions.map(n=>`<div class="score ${n.score<n.max?"part":""}"><span>${de(n.id)}</span><span class="bar"><i data-pct="${n.max>0?100*n.score/n.max:0}"></i></span><span class="v">${n.score}/${n.max}</span></div>`).join("")}
|
|
19
|
+
</div>`,NS=(e,t)=>{let n=t.judge,r=n.executor!==void 0?`${de(n.executor)} \xB7 on call`:'<span class="placeholder">[judge seat not leased yet]</span>',o=[...t.verdicts].reverse(),s=t.verdicts.at(-1),a=V(e,"[data-judge]");ft(a,`
|
|
20
|
+
<div class="card-head"><div class="mini judge${n.executor!==void 0?"":" unleased"}"></div><div class="head-title"><div class="card-title">JUDGE SEAT</div><div class="card-desc">${r}</div></div>
|
|
21
|
+
<div class="seat-stats"><span class="stat"><b>reviews</b>${n.reviews}</span><span class="stat"><b>verdicts</b>${n.verdicts}</span></div></div>
|
|
22
|
+
<div class="body">
|
|
23
|
+
${s!==void 0?`<div class="kv"><span>verdict</span><span class="v-judge">\xBB ${de(s.lane)} r${s.round}: ${s.cleared?"cleared":Cs(s.issues)}</span></div>`:""}
|
|
24
|
+
${o.length>0?o.map(RS).join(""):'<div class="empty">no judgment yet</div>'}
|
|
25
|
+
</div>`),a!==void 0&&OS(a)},xi=(e,t,n)=>`<li class="${n}"><i class="tone-${e.tone}"></i><div><div class="meta"><span class="tm">${ut(t,e.at)}</span><span class="src">${de(e.who)}</span><span class="src">seq ${e.seq}</span></div><div class="txt">${de(e.what)}</div></div></li>`;var gi=new URLSearchParams(location.search),Pr=gi.has("freeze"),ws=wd();Pr&&document.body.classList.add("frozen");var Ad=e=>t=>new Qt({message:`${e}: ${t instanceof Error?t.message:String(t)}`}),vd=e=>ye(function*(){let t=yield*En({try:r=>fetch(e,{signal:r}),catch:Ad(e)}),n=yield*En({try:()=>t.text(),catch:Ad(e)});return t.ok?n:yield*new Qt({message:n})}),US=Ap(dd),ks={run:Q(vd("/api/run"),e=>al(US(e),t=>new Qt({message:`the run did not decode: ${t.message}`}))),frame:e=>Q(vd(e===void 0?"/api/frame":`/api/frame?count=${e}`),t=>No(fi(t))),stream:e=>md(()=>new EventSource(e===void 0?"/api/stream":`/api/stream?count=${e.count}&speed=${e.speed}`),{endOnError:e!==void 0})},Un=V(document,"[data-boot]"),_d=e=>{Un!==void 0&&(Un.hidden=!1,Un.classList.add("error"),Un.textContent=e)},Od=e=>{Un!==void 0&&(Un.hidden=!0);for(let t of kt(document,".screen"))t.classList.toggle("on",t.dataset.screen===e)},DS=e=>Lo(e,{onSuccess:()=>bn,onFailure:t=>oe(()=>_d(`llm4ts watch --web: ${t.message}`))}),LS=e=>{let t=document.getElementById("screen-live");if(t===null)return bn;let n=hi(t,{mode:"live",reduce:ws,frozen:Pr}),r=-1,o=s=>{let a=s.count!==r&&r>=0;r=s.count,n.render(s,a),ce(t,"runId",e.runId??""),V(t,"[data-live-pill]")?.classList.toggle("paused",s.ended!==void 0),ce(t,"runState",s.ended??"live");let u=s.timeline.slice(-12),d=s.startedAt??0;ft(V(t,"[data-timeline]"),u.map((g,c)=>xi(g,d,`${c===u.length-1?"current":""} ${a&&c===u.length-1&&!ws?"fresh":""}`)).join("")),ce(t,"timelineDesc",`last ${u.length} of ${s.timelineCount} \xB7 trace seq ${e.steps[0]?.seq??0}\u2013${s.lastSeq??0}`)};return Od("live"),Pr?sr(ks.frame(),o):Ts(ks.stream(void 0),s=>oe(()=>o(s)))},$S=e=>ye(function*(){let t=document.getElementById("screen-replay");if(t===null)return;let n=hi(t,{mode:"replay",reduce:ws,frozen:Pr}),r=e.steps,o=e.timeline,s=r[0]?.at??0,a=Math.max(1,(r.at(-1)?.at??s)-s),u=p=>100*(p-s)/a,d=gi.get("seq"),g=Number(gi.get("speed")??e.speed),c=V(t,"[data-track]"),f=V(t,"[data-markers]");f!==void 0&&(f.innerHTML=o.map(p=>`<i class="tone-${p.tone}" data-seq="${p.seq}" title="${de(`${ut(s,p.at)} ${p.who} ${p.what}`)}"></i>`).join(""),kt(f,"i").forEach((p,I)=>{p.style.left=`${u(o[I]?.at??s)}%`})),ce(t,"total",ut(0,a)),ce(t,"mid",ut(0,a/2)),ce(t,"lastSeq",e.lastSeq??0),ce(t,"trace",e.trace),ce(t,"runId",e.runId??"");let h=V(t,'[data-act="play"]'),x=V(t,'[data-act="back"]'),y=V(t,'[data-act="fwd"]'),E=kt(t,"[data-speed] button"),m=p=>{ce(t,"replayLabel",`${p.playing?"replay":"paused"} \xD7${p.speed}`),V(t,".status-pill")?.classList.toggle("paused",!p.playing),h!==void 0&&(h.textContent=p.playing?"\u275A\u275A pause":"\u25B6 play"),x instanceof HTMLButtonElement&&(x.disabled=p.count<=1),y instanceof HTMLButtonElement&&(y.disabled=p.count>=p.steps);for(let I of E)I.setAttribute("aria-pressed",String(Number(I.dataset.speed)===p.speed));c?.classList.toggle("playing",p.playing)},i=(p,I)=>{let T=r[p.count-1]??r[0];n.render(p,I);let _=T?.seq??0,L=o.findIndex(z=>z.seq>_),M=L<0?o.length:L,ie=Math.max(0,M-7),ne=o.slice(ie,ie+12),D=[...o].reverse().find(z=>z.seq<=_);ft(V(t,"[data-timeline]"),ne.map(z=>{let xe=D!==void 0&&z===D;return xi(z,s,`${z.seq>_?"future":""} ${xe?"current":""} ${I&&xe&&!ws?"fresh":""}`)}).join("")),ce(t,"timelineDesc",`at seq ${_} \xB7 later events dimmed`);let R=T?.at??s;ce(t,"clock",ut(s,R)),ce(t,"seq",_);let j=u(R),_e=V(t,"[data-played]"),A=V(t,"[data-playhead]");_e!==void 0&&A!==void 0&&(_e.style.transitionDuration=`${p.gapMs}ms`,A.style.transitionDuration=`${p.gapMs}ms`,_e.style.width=`${j}%`,A.style.left=`${j}%`);let ue=V(t,"[data-tip]");ue!==void 0&&(ue.textContent=`${ut(s,R)}${D!==void 0?` \xB7 ${D.who} ${D.what}`:""}`.slice(0,96));for(let z of kt(t,"[data-markers] i"))z.classList.toggle("future",Number(z.dataset.seq)>_)},l=yield*Ed(ks,{steps:r.length,count:d===null?1:Sd(r,Number(d)),speed:Number.isFinite(g)&&g>0?g:e.speed},{draw:i,chrome:m,failed:p=>_d(p.message)}),S=p=>()=>{cr(p)};h?.addEventListener("click",S(l.toggle)),x?.addEventListener("click",S(l.step(-1))),y?.addEventListener("click",S(l.step(1)));for(let p of E)p.addEventListener("click",S(l.setSpeed(Number(p.dataset.speed))));return c?.addEventListener("click",p=>{let I=c.getBoundingClientRect(),T=s+(p.clientX-I.left)/I.width*a;cr(l.seek(yd(r,T),!0))}),addEventListener("keydown",p=>{p.key===" "&&(p.preventDefault(),h?.click()),p.key==="ArrowRight"&&y?.click(),p.key==="ArrowLeft"&&x?.click()}),Od("replay"),yield*l.seek((yield*l.state).count,!1),!Pr&&d===null&&(yield*l.play),yield*Ro}),BS=ye(function*(){let e=yield*ks.run;yield*e.mode==="replay"?$S(e):LS(e)});cr(DS(cc(BS)));})();
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Copyright (c) 2023 Vercel, in collaboration with basement.studio
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
-----------------------------------------------------------
|
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
PREAMBLE
|
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
13
|
+
development of collaborative font projects, to support the font creation
|
|
14
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
15
|
+
open framework in which fonts may be shared and improved in partnership
|
|
16
|
+
with others.
|
|
17
|
+
|
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
23
|
+
however, cannot be released under any other type of license. The
|
|
24
|
+
requirement for fonts to remain under this license does not apply
|
|
25
|
+
to any document created using the fonts or their derivatives.
|
|
26
|
+
|
|
27
|
+
DEFINITIONS
|
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
30
|
+
include source files, build scripts and documentation.
|
|
31
|
+
|
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
33
|
+
copyright statement(s).
|
|
34
|
+
|
|
35
|
+
"Original Version" refers to the collection of Font Software components as
|
|
36
|
+
distributed by the Copyright Holder(s).
|
|
37
|
+
|
|
38
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
39
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
40
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
41
|
+
new environment.
|
|
42
|
+
|
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
44
|
+
writer or other person who contributed to the Font Software.
|
|
45
|
+
|
|
46
|
+
PERMISSION AND CONDITIONS
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
49
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
50
|
+
Software, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
1) Neither the Font Software nor any of its individual components,
|
|
53
|
+
in Original or Modified Versions, may be sold by itself.
|
|
54
|
+
|
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
|
57
|
+
contains the above copyright notice and this license. These can be
|
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
61
|
+
|
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
63
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
64
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
65
|
+
presented to the users.
|
|
66
|
+
|
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
71
|
+
permission.
|
|
72
|
+
|
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
74
|
+
must be distributed entirely under this license, and must not be
|
|
75
|
+
distributed under any other license. The requirement for fonts to
|
|
76
|
+
remain under this license does not apply to any document created
|
|
77
|
+
using the Font Software.
|
|
78
|
+
|
|
79
|
+
TERMINATION
|
|
80
|
+
This license becomes null and void if any of the above conditions are
|
|
81
|
+
not met.
|
|
82
|
+
|
|
83
|
+
DISCLAIMER
|
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/web/index.html
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=1440" />
|
|
6
|
+
<title>llm4ts watch</title>
|
|
7
|
+
<link rel="stylesheet" href="style.css" />
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<!-- `llm4ts watch --web` (ADR 0051): the page shows the screen of the run's mode. -->
|
|
11
|
+
|
|
12
|
+
<!-- ───────────── LIVE ───────────── -->
|
|
13
|
+
<main id="screen-live" class="screen" data-screen="live">
|
|
14
|
+
<header class="topbar">
|
|
15
|
+
<div class="title">
|
|
16
|
+
<div class="eyebrow-row">
|
|
17
|
+
<span class="eyebrow">llm4ts watch</span><span class="dot-sep">·</span
|
|
18
|
+
><span class="faint mono" data-bind="runId"></span>
|
|
19
|
+
</div>
|
|
20
|
+
<h1 data-bind-title></h1>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="status-row">
|
|
23
|
+
<span class="status-pill live" data-live-pill
|
|
24
|
+
><i class="pulse"></i><span data-bind="runState">live</span></span
|
|
25
|
+
>
|
|
26
|
+
<span class="stat"><b>elapsed</b><span class="time" data-bind="elapsed"></span></span>
|
|
27
|
+
<span class="stat"><b>stories</b><span data-bind="stories"></span></span>
|
|
28
|
+
<span class="stat"><b>tokens</b><span data-bind="tokens"></span></span>
|
|
29
|
+
<span class="stat"><b>cost</b><span data-bind="cost"></span></span>
|
|
30
|
+
</div>
|
|
31
|
+
</header>
|
|
32
|
+
<section class="card flow-card">
|
|
33
|
+
<div class="card-head">
|
|
34
|
+
<div class="head-title">
|
|
35
|
+
<div class="card-title">stage <span data-bind="stage"></span></div>
|
|
36
|
+
<div class="card-desc" data-bind="agents"></div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="seg" role="group">
|
|
39
|
+
<button aria-pressed="true">flow</button><button disabled>executors <kbd>e</kbd></button
|
|
40
|
+
><button disabled>boards <kbd>b</kbd></button>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="legend">
|
|
43
|
+
<span><i class="sw idle"></i>planned</span><span><i class="sw running"></i>running</span
|
|
44
|
+
><span><i class="sw done"></i>done</span><span><i class="sw failed"></i>failed</span
|
|
45
|
+
><span><i class="sw waiting"></i>waiting</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="viz" data-graph></div>
|
|
49
|
+
<div class="roster">
|
|
50
|
+
<span class="eyebrow">roster</span>
|
|
51
|
+
<div class="roster-list" data-roster></div>
|
|
52
|
+
</div>
|
|
53
|
+
</section>
|
|
54
|
+
<div class="lower">
|
|
55
|
+
<section class="card detail-card" data-detail></section>
|
|
56
|
+
<section class="card judge-card" data-judge></section>
|
|
57
|
+
<section class="card timeline-card">
|
|
58
|
+
<div class="card-head">
|
|
59
|
+
<div class="head-title">
|
|
60
|
+
<div class="card-title">events</div>
|
|
61
|
+
<div class="card-desc" data-bind="timelineDesc"></div>
|
|
62
|
+
</div>
|
|
63
|
+
<span class="key"><kbd>l</kbd>full log</span>
|
|
64
|
+
</div>
|
|
65
|
+
<ol class="timeline" data-timeline></ol>
|
|
66
|
+
</section>
|
|
67
|
+
</div>
|
|
68
|
+
</main>
|
|
69
|
+
|
|
70
|
+
<!-- ───────────── REPLAY ───────────── -->
|
|
71
|
+
<main id="screen-replay" class="screen" data-screen="replay">
|
|
72
|
+
<header class="topbar">
|
|
73
|
+
<div class="title">
|
|
74
|
+
<div class="eyebrow-row">
|
|
75
|
+
<span class="eyebrow">llm4ts watch --replay</span><span class="dot-sep">·</span
|
|
76
|
+
><span class="faint mono" data-bind="runId"></span>
|
|
77
|
+
</div>
|
|
78
|
+
<h1 data-bind-title></h1>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="status-row">
|
|
81
|
+
<span class="status-pill replay"
|
|
82
|
+
><i class="pulse"></i><span data-bind="replayLabel">replay ×10</span></span
|
|
83
|
+
>
|
|
84
|
+
<span class="stat"><b>at</b><span class="time" data-bind="elapsed"></span></span>
|
|
85
|
+
<span class="stat"><b>stories</b><span data-bind="stories"></span></span>
|
|
86
|
+
<span class="stat"><b>tokens</b><span data-bind="tokens"></span></span>
|
|
87
|
+
</div>
|
|
88
|
+
</header>
|
|
89
|
+
<section class="card scrub-card">
|
|
90
|
+
<div class="card-head">
|
|
91
|
+
<div class="transport">
|
|
92
|
+
<button class="btn play" data-act="play">▶ play</button>
|
|
93
|
+
<button class="btn" data-act="back">◀ step</button>
|
|
94
|
+
<button class="btn" data-act="fwd">step ▶</button>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="head-title">
|
|
97
|
+
<div class="card-title">
|
|
98
|
+
<span data-bind="clock"></span>
|
|
99
|
+
<span class="muted">/ <span data-bind="total"></span></span>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="card-desc">
|
|
102
|
+
seq <span data-bind="seq"></span> of <span data-bind="lastSeq"></span> · trace
|
|
103
|
+
<span data-bind="trace"></span>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="speed">
|
|
107
|
+
<div class="speed-row">
|
|
108
|
+
<span class="eyebrow">speed</span>
|
|
109
|
+
<div class="seg" role="group" data-speed>
|
|
110
|
+
<button data-speed="1">×1</button><button data-speed="10">×10</button
|
|
111
|
+
><button data-speed="50">×50</button>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="card-desc">default 10 · each gap = min(Δt, 2s) ÷ speed</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="scrub">
|
|
118
|
+
<div class="track" data-track>
|
|
119
|
+
<div class="played" data-played></div>
|
|
120
|
+
<div class="markers" data-markers></div>
|
|
121
|
+
<div class="playhead" data-playhead><span class="tip" data-tip></span></div>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="scale">
|
|
124
|
+
<span>00:00:00</span><span data-bind="mid"></span><span data-bind="total"></span>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</section>
|
|
128
|
+
<section class="card flow-card">
|
|
129
|
+
<div class="card-head">
|
|
130
|
+
<div class="head-title">
|
|
131
|
+
<div class="card-title">stage <span data-bind="stage"></span></div>
|
|
132
|
+
<div class="card-desc" data-bind="agents"></div>
|
|
133
|
+
</div>
|
|
134
|
+
<div class="seg" role="group">
|
|
135
|
+
<button aria-pressed="true">flow</button><button disabled>executors <kbd>e</kbd></button
|
|
136
|
+
><button disabled>boards <kbd>b</kbd></button>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="legend">
|
|
139
|
+
<span><i class="sw idle"></i>planned</span><span><i class="sw running"></i>running</span
|
|
140
|
+
><span><i class="sw done"></i>done</span><span><i class="sw failed"></i>failed</span
|
|
141
|
+
><span><i class="sw waiting"></i>waiting</span>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="viz" data-graph></div>
|
|
145
|
+
<div class="roster">
|
|
146
|
+
<span class="eyebrow">roster</span>
|
|
147
|
+
<div class="roster-list" data-roster></div>
|
|
148
|
+
</div>
|
|
149
|
+
</section>
|
|
150
|
+
<div class="lower">
|
|
151
|
+
<section class="card detail-card" data-detail></section>
|
|
152
|
+
<section class="card judge-card" data-judge></section>
|
|
153
|
+
<section class="card timeline-card">
|
|
154
|
+
<div class="card-head">
|
|
155
|
+
<div class="head-title">
|
|
156
|
+
<div class="card-title">events</div>
|
|
157
|
+
<div class="card-desc" data-bind="timelineDesc"></div>
|
|
158
|
+
</div>
|
|
159
|
+
<span class="key"><kbd>l</kbd>full log</span>
|
|
160
|
+
</div>
|
|
161
|
+
<ol class="timeline" data-timeline></ol>
|
|
162
|
+
</section>
|
|
163
|
+
</div>
|
|
164
|
+
</main>
|
|
165
|
+
|
|
166
|
+
<p class="boot" data-boot>connecting to llm4ts watch…</p>
|
|
167
|
+
<script src="app.js"></script>
|
|
168
|
+
</body>
|
|
169
|
+
</html>
|