@lmvz-ds/components 0.12.5 → 0.13.1
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/cjs/assets-CJzJZPzV.js +26 -0
- package/dist/{esm/Effect-BhQLGXPs.js → cjs/icons-FIfJEo6G.js} +1708 -5205
- package/dist/cjs/{index-CVw4GUo6.js → index-Bp6Dd2i1.js} +4 -2
- package/dist/cjs/{index-9ZJx0550.js → index-D3BMpL5w.js} +0 -3
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +7 -10
- package/dist/cjs/lmvz-card.cjs.entry.js +4 -5
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +13 -12
- package/dist/cjs/lmvz-icon.cjs.entry.js +8 -10
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -11
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +5 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reactive-controller-host-BMDEj1kX.js +168 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -3
- package/dist/collection/components/lmvz-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +21 -12
- package/dist/collection/components/lmvz-input/lmvz-input.css +5 -2
- package/dist/collection/components/lmvz-input/lmvz-input.js +3 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +3 -3
- package/dist/collection/integration/header-integration.js +3 -1
- package/dist/collection/utils/{validation → aria}/aria-validation-controller.js +15 -34
- package/dist/collection/utils/{list-keyboard-controller.js → aria/list-keyboard-controller.js} +1 -1
- package/dist/collection/utils/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/{http.test.js → http.unit.js} +8 -7
- package/dist/collection/utils/validation/svg.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-BsS3QvWn.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-CdYWDK7m.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/esm/assets-BelZNJ1W.js +23 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/icons-CM7lsnuO.js} +1751 -5457
- package/dist/esm/{index-Bt32KzDW.js → index-BfTCfPZ1.js} +3 -1
- package/dist/esm/{index-smGPjoDX.js → index-T5ljELGS.js} +1 -3
- package/dist/esm/index.js +4 -5
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +5 -8
- package/dist/esm/lmvz-card.entry.js +4 -5
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +11 -10
- package/dist/esm/lmvz-icon.entry.js +5 -7
- package/dist/esm/lmvz-input.entry.js +6 -9
- package/dist/esm/lmvz-menuitem.entry.js +3 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/reactive-controller-host-CZ3dGAjR.js +165 -0
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +1 -0
- package/dist/lmvz-components/p-6e3314ab.entry.js +1 -0
- package/dist/lmvz-components/p-8ea1a349.entry.js +1 -0
- package/dist/lmvz-components/{p-d4b68381.entry.js → p-980688a0.entry.js} +1 -1
- package/dist/lmvz-components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/lmvz-components/p-BoR31cjC.js +1 -0
- package/dist/lmvz-components/p-CVf2C8dL.js +1 -0
- package/dist/lmvz-components/p-CZ3dGAjR.js +1 -0
- package/dist/lmvz-components/p-T5ljELGS.js +2 -0
- package/dist/lmvz-components/p-a34542fa.entry.js +1 -0
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +1 -0
- package/dist/lmvz-components/p-d9dc29a1.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +5 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +2 -2
- package/dist/types/utils/{validation → aria}/aria-validation-controller.d.ts +1 -5
- package/dist/types/utils/{element-activation-controller.d.ts → aria/element-activation-controller.d.ts} +2 -2
- package/dist/types/utils/{list-keyboard-controller.d.ts → aria/list-keyboard-controller.d.ts} +1 -1
- package/dist/types/utils/assets.d.ts +1 -8
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +2 -2
- package/hydrate/index.js +3608 -54447
- package/hydrate/index.mjs +3608 -54447
- package/package.json +17 -18
- package/readme.md +18 -0
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +0 -462
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/cjs/aria-validation-controller-B3hMkau3.js +0 -2930
- package/dist/cjs/assets-BguFB3wV.js +0 -71
- package/dist/cjs/axe-BNqwbBGU.js +0 -32834
- package/dist/cjs/icons-7wUEcWEo.js +0 -607
- package/dist/components/p-3I3wZmp8.js +0 -1
- package/dist/components/p-B85MJLTf.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CAi33KTt.js +0 -1
- package/dist/components/p-CdofjRtQ.js +0 -1
- package/dist/components/p-D1HbKFuh.js +0 -12
- package/dist/components/p-UwhTS2ue.js +0 -1
- package/dist/esm/MutableQueue-CNlEFklh.js +0 -431
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/esm/aria-validation-controller-iA4YWFG-.js +0 -2927
- package/dist/esm/assets-Iu8neKuE.js +0 -67
- package/dist/esm/axe-cRQ9Ux1I.js +0 -32832
- package/dist/esm/icons-Bx1wWPM2.js +0 -603
- package/dist/lmvz-components/p-1a10fcbd.entry.js +0 -1
- package/dist/lmvz-components/p-274c36df.entry.js +0 -1
- package/dist/lmvz-components/p-2ba68483.entry.js +0 -1
- package/dist/lmvz-components/p-4XIjw3k8.js +0 -1
- package/dist/lmvz-components/p-51Fb_qqD.js +0 -1
- package/dist/lmvz-components/p-77e26e71.entry.js +0 -1
- package/dist/lmvz-components/p-B85MJLTf.js +0 -1
- package/dist/lmvz-components/p-BhQLGXPs.js +0 -1
- package/dist/lmvz-components/p-CXWyvf0D.js +0 -1
- package/dist/lmvz-components/p-D1HbKFuh.js +0 -12
- package/dist/lmvz-components/p-D7I-Bc5i.js +0 -1
- package/dist/lmvz-components/p-a5fe62b6.entry.js +0 -1
- package/dist/lmvz-components/p-c8b78793.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- /package/dist/collection/utils/{element-activation-controller.js → aria/element-activation-controller.js} +0 -0
- /package/dist/types/utils/{http.test.d.ts → http.unit.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as t,B as s}from"./p-BaPwpeMs.js";import{a6 as e,a7 as i,a8 as n,a9 as r,aa as o,ab as a,ac as c,ad as u,ae as h,af as l,ag as d,ah as f,ai as b,aj as v,ak as m,al as p,am as S,an as y,ao as w,ap as g,aq as _,ar as F,as as E,at as O,au as C,av as k,aw as D,ax as x,ay as j,az as R,aA as P,aB as A,aC as I,aD as L,aE as z,aF as N,aG as B,aH as Q,aI as U,aJ as M,aK as W,aL as q,aM as T,aN as V,aO as H,aP as J,aQ as K,J as G,B as Z,s as X,f as Y,H as $,aR as tt,p as st,aS as et,aT as it,aU as nt,u as rt,x as ot,aV as at,aW as ct,G as ut,Q as ht,aX as lt,U as dt,aY as ft,t as bt,aZ as vt,a_ as mt,a$ as pt,b0 as St,T as yt,b1 as wt,b2 as gt,b3 as _t,b4 as Ft,b5 as Et,b6 as Ot,b7 as Ct,k as kt,O as Dt,b8 as xt,i as jt,b9 as Rt,ba as Pt,bb as At,bc as It,bd as Lt,be as zt,bf as Nt,bg as Bt,bh as Qt,bi as Ut,bj as Mt,bk as Wt,bl as qt,bm as Tt,bn as Vt,bo as Ht,bp as Jt,bq as Kt,a3 as Gt,w as Zt,br as Xt,bs as Yt,bt as $t,bu as ts,bv as ss,bw as es,bx as is,by as ns,bz as rs,bA as os,bB as as,bC as cs,bD as us,bE as hs,bF as ls,bG as ds,bH as fs,bI as bs,bJ as vs,l as ms,b as ps,bK as Ss,bL as ys,bM as ws,bN as gs,bO as _s,X as Fs,bP as Es,bQ as Os,bR as Cs,bS as ks,bT as Ds,bU as xs,bV as js,bW as Rs,bX as Ps,bY as As,bZ as Is,b_ as Ls,m as zs,b$ as Ns,c0 as Bs,P as Qs,c1 as Us,c2 as Ms,c3 as Ws,c4 as qs,c5 as Ts,c6 as Vs,c7 as Hs,c8 as Js,c9 as Ks,ca as Gs,cb as Zs,a2 as Xs,cc as Ys,cd as $s,ce as te,cf as se,cg as ee}from"./p-CdofjRtQ.js";const ie=e,ne=i,re=c,oe=r,ae=a,ce=u,ue=n,he=o,le=h,de=l,fe=p,be=y,ve=v,me=f,pe=w,Se=d,ye=b,we=S,ge=g,_e=m,Fe=Symbol.for("effect/MutableList"),Ee={[Fe]:Fe,[Symbol.iterator](){let t=!1,s=this.head;return{next(){if(t)return this.return();if(null==s)return t=!0,this.return();const e=s.value;return s=s.next,{done:t,value:e}},return:s=>(t||(t=!0),{done:!0,value:s})}},toString(){return C(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(O)}},[E](){return this.toJSON()},pipe(){return F(this,arguments)}},Oe=t=>0===Ce(t),Ce=t=>t._length,ke=_(2,((t,s)=>{const e=(t=>({value:t,removed:!1,prev:void 0,next:void 0}))(s);return void 0===t.head&&(t.head=e),void 0===t.tail||(t.tail.next=e,e.prev=t.tail),t.tail=e,t._length+=1,t})),De=Symbol.for("effect/MutableQueue"),xe=Symbol.for("effect/mutable/MutableQueue/Empty"),je={[De]:De,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return C(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(O)}},[E](){return this.toJSON()},pipe(){return F(this,arguments)}},Re=t=>{const s=Object.create(je);return s.queue=(()=>{const t=Object.create(Ee);return t.head=void 0,t.tail=void 0,t._length=0,t})(),s.capacity=t,s},Pe=()=>Re(void 0),Ae=t=>Ce(t.queue),Ie=t=>Oe(t.queue),Le=_(2,((t,s)=>{const e=Ce(t.queue);return(void 0===t.capacity||e!==t.capacity)&&(ke(s)(t.queue),!0)})),ze=_(2,((t,s)=>{const e=s[Symbol.iterator]();let i,n=D(),r=!0;for(;r&&(i=e.next())&&!i.done;)r=Le(i.value)(t);for(;null!=i&&!i.done;)n=k(i.value)(n),i=e.next();return x(n)})),Ne=_(2,((t,s)=>Oe(t.queue)?s:(t=>{const s=t.head;if(void 0!==s)return((t,s)=>{s.removed||(s.removed=!0,void 0!==s.prev&&void 0!==s.next?(s.prev.next=s.next,s.next.prev=s.prev):void 0!==s.prev?(t.tail=s.prev,s.prev.next=void 0):void 0!==s.next?(t.head=s.next,s.next.prev=void 0):(t.tail=void 0,t.head=void 0),t._length>0&&(t._length-=1))})(t,s),s.value})(t.queue))),Be=_(2,((t,s)=>{let e=D(),i=0;for(;i<s;){const s=Ne(xe)(t);if(s===xe)break;e=k(s)(e),i+=1}return x(e)})),Qe=j,Ue=P,Me=R,We=A,qe=L,Te=Q,Ve=U,He=M,Je=I,Ke=q,Ge=W,Ze=z,Xe=N,Ye=B,$e=H,ti=J,si=V,ei=K,ii=T,ni=Symbol.for("effect/QueueEnqueue"),ri=Symbol.for("effect/QueueDequeue"),oi=Symbol.for("effect/QueueStrategy"),ai=Symbol.for("effect/BackingQueue"),ci={_A:t=>t},ui={_A:t=>t},hi={_In:t=>t},li={_Out:t=>t};class di extends tt{queue;takers;shutdownHook;shutdownFlag;strategy;[ni]=hi;[ri]=li;constructor(t,s,e,i,n){super(),this.queue=t,this.takers=s,this.shutdownHook=e,this.shutdownFlag=i,this.strategy=n}pipe(){return F(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return st((()=>et(this.unsafeSize(),(()=>it))))}unsafeSize(){return nt(this.shutdownFlag)?rt():ot(this.queue.length()-Ae(this.takers)+this.strategy.surplusSize())}get isEmpty(){return Y(this.size,(t=>t<=0))}get isFull(){return Y(this.size,(t=>t>=this.capacity()))}get shutdown(){return at(ct((t=>(G(this.shutdownFlag,ut(!0)),G(ft(Oi(this.takers),(s=>Ot(s,t.id())),!1,!1),dt(this.strategy.shutdown),lt(n(this.shutdownHook,void 0)),ht)))))}get isShutdown(){return X((()=>nt(this.shutdownFlag)))}get awaitShutdown(){return i(this.shutdownHook)}isActive(){return!nt(this.shutdownFlag)}unsafeOffer(t){if(nt(this.shutdownFlag))return!1;let s;if(0===this.queue.length()){const e=G(this.takers,Ne(xe));e!==xe?(Fi(e,t),s=!0):s=!1}else s=!1;if(s)return!0;const e=this.queue.offer(t);return Di(this.strategy,this.queue,this.takers),e}offer(t){return st((()=>{if(nt(this.shutdownFlag))return it;let s;if(0===this.queue.length()){const e=G(this.takers,Ne(xe));e!==xe?(Fi(e,t),s=!0):s=!1}else s=!1;if(s)return bt(!0);const e=this.queue.offer(t);return Di(this.strategy,this.queue,this.takers),e?bt(!0):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)}))}offerAll(t){return st((()=>{if(nt(this.shutdownFlag))return it;const s=vt(t),e=0===this.queue.length()?vt(Ci(this.takers,s.length)):mt,[i,n]=G(s,pt(e.length));for(let t=0;t<e.length;t++)Fi(e[t],i[t]);if(0===n.length)return bt(!0);const r=this.queue.offerAll(n);return Di(this.strategy,this.queue,this.takers),St(r)?bt(!0):this.strategy.handleSurplus(r,this.queue,this.takers,this.shutdownFlag)}))}get take(){return ct((t=>{if(nt(this.shutdownFlag))return it;const s=this.queue.poll(xe);if(s!==xe)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),bt(s);{const s=o(t.id());return G(st((()=>(G(this.takers,Le(s)),Di(this.strategy,this.queue,this.takers),nt(this.shutdownFlag)?it:i(s)))),yt((()=>X((()=>ki(this.takers,s))))))}}))}get takeAll(){return st((()=>nt(this.shutdownFlag)?it:X((()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),wt(t)}))))}takeUpTo(t){return st((()=>nt(this.shutdownFlag)?it:X((()=>{const s=this.queue.pollUpTo(t);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),wt(s)}))))}takeBetween(t,s){return st((()=>fi(this,t,s,D())))}}const fi=(t,s,e,i)=>e<s?bt(i):G(yi(t,e),Z((n=>{const r=s-n.length;return 1===r?G(Si(t),Y((t=>G(i,Ft(n),Et(t))))):r>1?G(Si(t),Z((s=>fi(t,r-1,e-n.length-1,G(i,Ft(n),Et(s)))))):bt(G(i,Ft(n)))}))),bi=(t,s)=>G(e(),Y((e=>((t,s,e,i,n)=>new di(t,s,e,i,n))(t,Pe(),e,$(!1),s))));class vi{mutable;[ai]=ui;constructor(t){this.mutable=t}poll(t){return Ne(this.mutable,t)}pollUpTo(t){return Be(this.mutable,t)}offerAll(t){return ze(this.mutable,t)}offer(t){return Le(this.mutable,t)}capacity(){return void 0===(t=this.mutable).capacity?1/0:t.capacity;var t}length(){return Ae(this.mutable)}}const mi=t=>new vi(t),pi=_(2,((t,s)=>t.offer(s))),Si=t=>t.take,yi=_(2,((t,s)=>t.takeUpTo(s))),wi=_(3,((t,s,e)=>t.takeBetween(s,e)));class gi{[oi]=ci;putters=Pe();surplusSize(){return Ae(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!Ie(this.putters)&&!Ie(t);){const s=Ne(t,void 0),e=Ne(this.putters,void 0);e[2]&&Fi(e[1],!0),Fi(s,e[0])}}get shutdown(){return G(kt,Z((t=>G(X((()=>Oi(this.putters))),Z((s=>ft(s,(([s,e,i])=>i?G(Ot(e,t),ht):Ct),!1,!1)))))))}handleSurplus(t,s,e,n){return ct((r=>{const a=o(r.id());return G(st((()=>(this.unsafeOffer(t,a),this.unsafeOnQueueEmptySpace(s,e),Di(this,s,e),nt(n)?it:i(a)))),yt((()=>X((()=>this.unsafeRemove(a))))))}))}unsafeOnQueueEmptySpace(t,s){let e=!0;for(;e&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const i=G(this.putters,Ne(xe));if(i===xe)e=!1;else{const e=t.offer(i[0]);e&&i[2]?Fi(i[1],!0):e||Ei(this.putters,G(Oi(this.putters),k(i))),Di(this,t,s)}}}unsafeOffer(t,s){const e=vt(t);for(let t=0;t<e.length;t++){const i=e[t];G(this.putters,Le(t===e.length-1?[i,s,!0]:[i,s,!1]))}}unsafeRemove(t){Ei(this.putters,G(Oi(this.putters),_t((([,s])=>s!==t))))}}class _i{[oi]=ci;surplusSize(){return 0}get shutdown(){return Ct}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,s,e,i){return bt(!1)}unsafeOnQueueEmptySpace(t,s){}}const Fi=(t,s)=>gt(t,bt(s)),Ei=(t,s)=>G(t,ze(s)),Oi=t=>G(t,Be(Number.POSITIVE_INFINITY)),Ci=(t,s)=>G(t,Be(s)),ki=(t,s)=>{Ei(t,G(Oi(t),_t((t=>s!==t))))},Di=(t,s,e)=>{let i=!0;for(;i&&0!==s.length();){const n=G(e,Ne(xe));if(n!==xe){const r=s.poll(xe);r!==xe?(Fi(n,r),t.unsafeOnQueueEmptySpace(s,e)):Ei(e,G(Oi(e),k(n))),i=!0}else i=!1}i&&0===s.length()&&!Ie(e)&&t.onCompleteTakersWithEmptyQueue(e)},xi=t=>G(X((()=>Re(t))),Z((t=>bi(mi(t),new gi)))),ji=()=>G(X((()=>Pe())),Z((t=>bi(mi(t),new _i)))),Ri=t=>t.shutdown,Pi=pi,Ai=Si,Ii=wi,Li="Continue",zi=Symbol.for("effect/ChannelChildExecutorDecision"),Ni={[zi]:zi},Bi=()=>{const t=Object.create(Ni);return t._tag=Li,t},Qi="ContinuationK",Ui=Symbol.for("effect/ChannelContinuation"),Mi={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutDone:t=>t,_OutErr2:t=>t,_OutElem:t=>t,_OutDone2:t=>t};class Wi{onSuccess;onHalt;_tag=Qi;[Ui]=Mi;constructor(t,s){this.onSuccess=t,this.onHalt=s}onExit(t){return le(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class qi{finalizer;_tag="ContinuationFinalizer";[Ui]=Mi;constructor(t){this.finalizer=t}}const Ti="PullAfterNext",Vi=Symbol.for("effect/ChannelUpstreamPullStrategy"),Hi={[Vi]:{_A:t=>t}},Ji=t=>{const s=Object.create(Hi);return s._tag=Ti,s.emitSeparator=t,s},Ki="BracketOut",Gi="Bridge",Zi="ConcatAll",Xi="Emit",Yi="Ensuring",$i="Fail",tn="Fold",sn="FromEffect",en="PipeTo",nn="Read",rn="Succeed",on="SucceedNow",an="Suspend",cn=Symbol.for("effect/Channel"),un={[cn]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},pipe(){return F(this,arguments)}},hn=t=>Dt(t,cn)||xt(t),ln=_(2,((t,s)=>{const e=Object.create(un);return e._tag=Ki,e.acquire=()=>t,e.finalizer=s,e})),dn=(t,s,e)=>{const i=Object.create(un);return i._tag=Zi,i.combineInners=s,i.combineAll=e,i.onPull=()=>Ji(rt()),i.onEmit=()=>Bi,i.value=()=>t,i.k=jt,i},fn=_(4,((t,s,e,i)=>{const n=Object.create(un);return n._tag=Zi,n.combineInners=e,n.combineAll=i,n.onPull=()=>Ji(rt()),n.onEmit=()=>Bi,n.value=()=>t,n.k=s,n})),bn=_(2,((t,s)=>{const e=Object.create(un);return e._tag=Gi,e.input=s,e.channel=t,e})),vn=_(2,((t,s)=>{const e=Object.create(un);return e._tag=Yi,e.channel=t,e.finalizer=s,e})),mn=t=>pn(qe(t)),pn=t=>Sn((()=>t)),Sn=t=>{const s=Object.create(un);return s._tag=$i,s.error=t,s},yn=_(2,((t,s)=>{const e=Object.create(un);return e._tag=tn,e.channel=t,e.k=new Wi(s,pn),e})),wn=t=>{const s=Object.create(un);return s._tag=sn,s.effect=()=>t,s},gn=_(2,((t,s)=>{const e=Object.create(un);return e._tag=en,e.left=()=>t,e.right=()=>s,e})),_n=t=>Fn({onInput:t.onInput,onFailure:s=>Rt(Ze(s),{onLeft:t.onFailure,onRight:pn}),onDone:t.onDone}),Fn=t=>{const s=Object.create(un);return s._tag=nn,s.more=t.onInput,s.done=new Wi(t.onDone,t.onFailure),s},En=t=>kn((()=>t)),On=t=>{const s=Object.create(un);return s._tag=on,s.terminal=t,s},Cn=t=>{const s=Object.create(un);return s._tag=an,s.channel=t,s},kn=t=>{const s=Object.create(un);return s._tag=rn,s.evaluate=t,s},Dn=On(void 0),xn=t=>{const s=Object.create(un);return s._tag=Xi,s.out=t,s},jn="Done",Rn="Emit",Pn="FromEffect",An="Read",In=Symbol.for("effect/ChannelState"),Ln={[In]:{_E:t=>t,_R:t=>t}},zn=()=>{const t=Object.create(Ln);return t._tag=jn,t},Nn=()=>{const t=Object.create(Ln);return t._tag=Rn,t},Bn=t=>{const s=Object.create(Ln);return s._tag=Pn,s.effect=t,s},Qn=(t,s,e,i)=>{const n=Object.create(Ln);return n._tag=An,n.upstream=t,n.onEffect=s,n.onEmit=e,n.onDone=i,n},Un=t=>t._tag===Pn,Mn=t=>Un(t)?At(t.effect):void 0,Wn="PullFromChild",qn="PullFromUpstream",Tn="DrainChildExecutors",Vn="Emit";class Hn{childExecutor;parentSubexecutor;onEmit;_tag=Wn;constructor(t,s,e){this.childExecutor=t,this.parentSubexecutor=s,this.onEmit=e}close(t){const s=this.childExecutor.close(t),e=this.parentSubexecutor.close(t);return void 0!==s&&void 0!==e?It(Lt(s),Lt(e),((t,s)=>G(t,_e(s)))):void 0!==s?s:void 0!==e?e:void 0}enqueuePullFromChild(t){return this}}class Jn{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=qn;constructor(t,s,e,i,n,r,o,a){this.upstreamExecutor=t,this.createChild=s,this.lastDone=e,this.activeChildExecutors=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o,this.onEmit=a}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?It(t,Lt(s),((t,s)=>_e(t,s))):void 0!==t?t:void 0!==s?Lt(s):void 0),void 0)}enqueuePullFromChild(t){return new Jn(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class Kn{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=Tn;constructor(t,s,e,i,n,r,o){this.upstreamExecutor=t,this.lastDone=s,this.activeChildExecutors=e,this.upstreamDone=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?It(t,Lt(s),((t,s)=>_e(t,s))):void 0!==t?t:void 0!==s?Lt(s):void 0),void 0)}enqueuePullFromChild(t){return new Kn(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class Gn{value;next;_tag=Vn;constructor(t,s){this.value=t,this.next=s}close(t){return this.next.close(t)}enqueuePullFromChild(t){return this}}const Zn=Symbol.for("effect/ChannelUpstreamPullRequest"),Xn={[Zn]:{_A:t=>t}},Yn=t=>{const s=Object.create(Xn);return s._tag="Pulled",s.value=t,s};class $n{_activeSubexecutor=void 0;_cancelled=void 0;_closeLastSubstream=void 0;_currentChannel;_done=void 0;_doneStack=[];_emitted=void 0;_executeCloseLastSubstream;_input=void 0;_inProgressFinalizer=void 0;_providedEnv;constructor(t,s,e){this._currentChannel=t,this._executeCloseLastSubstream=e,this._providedEnv=s}run(){let t;for(;void 0===t;)if(void 0!==this._cancelled)t=this.processCancellation();else if(void 0!==this._activeSubexecutor)t=this.runSubexecutor();else try{if(void 0===this._currentChannel)t=zn();else switch(xt(this._currentChannel)&&(this._currentChannel=wn(this._currentChannel)),this._currentChannel._tag){case Ki:t=this.runBracketOut(this._currentChannel);break;case Gi:{const s=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,void 0!==this._input){const e=this._input;this._input=void 0;const i=()=>Ut(s.awaitRead(),(()=>qt((()=>{const t=e.run();switch(t._tag){case jn:return Se(e.getDone(),{onFailure:t=>s.error(t),onSuccess:t=>s.done(t)});case Rn:return Ut(s.emit(e.getEmit()),(()=>i()));case Pn:return Bt(t.effect,{onFailure:t=>s.error(t),onSuccess:()=>i()});case An:return er(t,(()=>i()),(t=>s.error(t)))}}))));t=Bn(Ut(Mt(Wt(i())),(t=>zt((()=>this.addFinalizer((s=>Ut(si(t),(()=>qt((()=>{const t=this.restorePipe(s,e);return void 0!==t?t:Pt})))))))))))}break}case Zi:{const t=new $n(this._currentChannel.value(),this._providedEnv,(t=>zt((()=>{this._closeLastSubstream=G(void 0===this._closeLastSubstream?Pt:this._closeLastSubstream,Qt(t))}))));t._input=this._input;const s=this._currentChannel;this._activeSubexecutor=new Jn(t,(t=>s.k(t)),void 0,[],((t,e)=>s.combineInners(t,e)),((t,e)=>s.combineAll(t,e)),(t=>s.onPull(t)),(t=>s.onEmit(t))),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case Xi:this._emitted=this._currentChannel.out,this._currentChannel=void 0!==this._activeSubexecutor?void 0:Dn,t=Nn();break;case Yi:this.runEnsuring(this._currentChannel);break;case $i:t=this.doneHalt(this._currentChannel.error());break;case tn:this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break;case sn:{const s=void 0===this._providedEnv?this._currentChannel.effect():G(this._currentChannel.effect(),Nt(this._providedEnv));t=Bn(Bt(s,{onFailure:t=>{const s=this.doneHalt(t);return void 0!==s&&Un(s)?s.effect:Pt},onSuccess:t=>{const s=this.doneSucceed(t);return void 0!==s&&Un(s)?s.effect:Pt}}));break}case en:{const t=this._input,s=new $n(this._currentChannel.left(),this._providedEnv,(t=>this._executeCloseLastSubstream(t)));s._input=t,this._input=s,this.addFinalizer((s=>{const e=this.restorePipe(s,t);return void 0!==e?e:Pt})),this._currentChannel=this._currentChannel.right();break}case"Provide":{const t=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer((()=>zt((()=>{this._providedEnv=t}))));break}case nn:{const s=this._currentChannel;t=Qn(this._input,jt,(t=>{try{this._currentChannel=s.more(t)}catch(t){this._currentChannel=s.done.onExit(be(t))}}),(t=>{this._currentChannel=(t=>s.done.onExit(t))(t)}));break}case rn:t=this.doneSucceed(this._currentChannel.evaluate());break;case on:t=this.doneSucceed(this._currentChannel.terminal);break;case an:this._currentChannel=this._currentChannel.channel()}}catch(t){this._currentChannel=pn(Te(t))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const s=[];let e=this._doneStack.pop();for(;e;)"ContinuationFinalizer"===e._tag&&s.push(e.finalizer),e=this._doneStack.pop();const i=0===s.length?Pt:sr(s,t);return this.storeInProgressFinalizer(i),i}popNextFinalizers(){const t=[];for(;0!==this._doneStack.length;){const s=this._doneStack[this._doneStack.length-1];if(s._tag===Qi)return t;t.push(s),this._doneStack.pop()}return t}restorePipe(t,s){const e=this._input;return this._input=s,void 0!==e?e.close(t):Pt}close(t){let s;const e=this._inProgressFinalizer;let i;void 0!==e&&(s=G(e,Tt(zt((()=>this.clearInProgressFinalizer())))));const n=this.popAllFinalizers(t);void 0!==n&&(i=G(n,Tt(zt((()=>this.clearInProgressFinalizer())))));const r=void 0===this._activeSubexecutor?void 0:this._activeSubexecutor.close(t);if(void 0!==r||void 0!==s||void 0!==i)return G(Lt(tr(r)),Jt(Lt(tr(s))),Jt(Lt(tr(i))),Ht((([[t,s],e])=>G(t,_e(s),_e(e)))),Vt,Ut((t=>qt((()=>t)))))}doneSucceed(t){if(0===this._doneStack.length)return this._done=ye(t),this._currentChannel=void 0,zn();const s=this._doneStack[this._doneStack.length-1];if(s._tag===Qi)return this._doneStack.pop(),void(this._currentChannel=s.onSuccess(t));const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=ye(t),this._currentChannel=void 0,zn();const i=sr(e.map((t=>t.finalizer)),ye(t));this.storeInProgressFinalizer(i);const n=G(i,Tt(zt((()=>this.clearInProgressFinalizer()))),Vt,Ut((()=>zt((()=>this.doneSucceed(t))))));return Bn(n)}doneHalt(t){if(0===this._doneStack.length)return this._done=me(t),this._currentChannel=void 0,zn();const s=this._doneStack[this._doneStack.length-1];if(s._tag===Qi){this._doneStack.pop();try{this._currentChannel=s.onHalt(t)}catch(t){this._currentChannel=pn(Te(t))}return}const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=me(t),this._currentChannel=void 0,zn();const i=sr(e.map((t=>t.finalizer)),me(t));this.storeInProgressFinalizer(i);const n=G(i,Tt(zt((()=>this.clearInProgressFinalizer()))),Vt,Ut((()=>zt((()=>this.doneHalt(t))))));return Bn(n)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,zn()}runBracketOut(t){const s=Vt(Bt(this.provide(t.acquire()),{onFailure:t=>zt((()=>{this._currentChannel=pn(t)})),onSuccess:s=>zt((()=>{this.addFinalizer((e=>this.provide(t.finalizer(s,e)))),this._currentChannel=xn(s)}))}));return Bn(s)}provide(t){return void 0===this._providedEnv?t:G(t,Nt(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new qi(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case Wn:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case qn:return this.pullFromUpstream(t);case Tn:return this.drainChildExecutors(t);case Vn:return this._emitted=t.value,this._activeSubexecutor=t.next,Nn()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const s=Se(t,{onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)});return this._activeSubexecutor=void 0,void 0===s?Pt:Un(e=s)?e.effect:Pt;var e}finishSubexecutorWithCloseEffect(t,...s){this.addFinalizer((()=>G(s,Kt((s=>G(zt((()=>s(t))),Ut((t=>void 0!==t?t:Pt)))),{discard:!0}))));const e=G(t,Se({onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)}));return this._activeSubexecutor=void 0,e}applyUpstreamPullStrategy(t,s,e){switch(e._tag){case Ti:{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[void 0,...s]:s]}case"PullAfterAllEnqueued":{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[...s,void 0]:s]}}}pullFromChild(t,s,e,i){return Qn(t,jt,(n=>{const r=e(n);switch(r._tag){case Li:break;case"Close":this.finishWithDoneValue(t,s,r.value);break;case"Yield":{const t=s.enqueuePullFromChild(i);this.replaceSubexecutor(t);break}}this._activeSubexecutor=new Gn(n,this._activeSubexecutor)}),Se({onFailure:e=>{const i=this.handleSubexecutorFailure(t,s,e);return void 0===i?void 0:Mn(i)},onSuccess:e=>{this.finishWithDoneValue(t,s,e)}}))}finishWithDoneValue(t,s,e){const i=s;switch(i._tag){case qn:{const s=new Jn(i.upstreamExecutor,i.createChild,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.combineChildResults,i.combineWithChildResult,i.onPull,i.onEmit);this._closeLastSubstream=t.close(ye(e)),this.replaceSubexecutor(s);break}case Tn:{const s=new Kn(i.upstreamExecutor,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.upstreamDone,i.combineChildResults,i.combineWithChildResult,i.onPull);this._closeLastSubstream=t.close(ye(e)),this.replaceSubexecutor(s);break}}}handleSubexecutorFailure(t,s,e){return this.finishSubexecutorWithCloseEffect(me(e),(t=>s.close(t)),(s=>t.close(s)))}pullFromUpstream(t){if(0===t.activeChildExecutors.length)return this.performPullFromUpstream(t);const s=t.activeChildExecutors[0],e=new Jn(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(void 0===s)return this.performPullFromUpstream(e);this.replaceSubexecutor(new Hn(s.childExecutor,e,s.onEmit))}performPullFromUpstream(t){return Qn(t.upstreamExecutor,(t=>{const s=void 0===this._closeLastSubstream?Pt:this._closeLastSubstream;return this._closeLastSubstream=void 0,G(this._executeCloseLastSubstream(s),Qt(t))}),(s=>{if(void 0!==this._closeLastSubstream){const e=this._closeLastSubstream;return this._closeLastSubstream=void 0,G(this._executeCloseLastSubstream(e),Ht((()=>{const e=new $n(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(Yn(s)));this._activeSubexecutor=new Hn(e,new Jn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Zt(i)&&(this._activeSubexecutor=new Gn(i.value,this._activeSubexecutor))})))}const e=new $n(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(Yn(s)));this._activeSubexecutor=new Hn(e,new Jn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Zt(i)&&(this._activeSubexecutor=new Gn(i.value,this._activeSubexecutor))}),(s=>{if(t.activeChildExecutors.some((t=>void 0!==t))){const s=new Kn(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(void 0!==this._closeLastSubstream){const t=this._closeLastSubstream;return this._closeLastSubstream=void 0,G(this._executeCloseLastSubstream(t),Ht((()=>this.replaceSubexecutor(s))))}return void this.replaceSubexecutor(s)}const e=this._closeLastSubstream,i=this.finishSubexecutorWithCloseEffect(G(s,pe((s=>t.combineWithChildResult(t.lastDone,s)))),(()=>e),(s=>t.upstreamExecutor.close(s)));return void 0===i?void 0:Mn(i)}))}drainChildExecutors(t){if(0===t.activeChildExecutors.length){const s=this._closeLastSubstream;return void 0!==s&&this.addFinalizer((()=>Gt(s))),this.finishSubexecutorWithCloseEffect(t.upstreamDone,(()=>s),(s=>t.upstreamExecutor.close(s)))}const s=t.activeChildExecutors[0],e=t.activeChildExecutors.slice(1);if(void 0===s){const[s,i]=this.applyUpstreamPullStrategy(!0,e,t.onPull((t=>{const s=Object.create(Xn);return s._tag="NoUpstream",s.activeDownstreamCount=t,s})(e.reduce(((t,s)=>void 0!==s?t+1:t),0))));return this.replaceSubexecutor(new Kn(t.upstreamExecutor,t.lastDone,i,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),Zt(s)?(this._emitted=s.value,Nn()):void 0}const i=new Kn(t.upstreamExecutor,t.lastDone,e,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new Hn(s.childExecutor,i,s.onEmit))}}const tr=t=>void 0!==t?t:Pt,sr=(t,s)=>G(Kt(t,(t=>Lt(t(s)))),Ht((t=>G(fe(t),Xt((()=>we))))),Ut((t=>qt((()=>t))))),er=(t,s,e)=>{const i=[t],n=()=>{const t=i.pop();if(void 0===t||void 0===t.upstream)return Yt("Unexpected end of input for channel execution");const r=t.upstream.run();switch(r._tag){case Rn:{const r=t.onEmit(t.upstream.getEmit());return 0===i.length?void 0===r?qt(s):G(r,Bt({onFailure:e,onSuccess:s})):void 0===r?qt((()=>n())):G(r,Bt({onFailure:e,onSuccess:()=>n()}))}case jn:{const r=t.onDone(t.upstream.getDone());return 0===i.length?void 0===r?qt(s):G(r,Bt({onFailure:e,onSuccess:s})):void 0===r?qt((()=>n())):G(r,Bt({onFailure:e,onSuccess:()=>n()}))}case Pn:return i.push(t),G(t.onEffect(r.effect),$t((s=>qt((()=>{const e=t.onDone(me(s));return void 0===e?Pt:e})))),Bt({onFailure:e,onSuccess:()=>n()}));case An:return i.push(t),i.push(r),qt((()=>n()))}};return n()},ir=_(2,((t,s)=>ts((e=>ss([es(s,is),ie(),ie()]).pipe(Ut((([i,n,r])=>e(((s,e,i)=>ns(zt((()=>new $n(t,void 0,jt))),(t=>qt((()=>nr(t.run(),t).pipe(cs(s),Qt(ne(s)),us(ne(e)))))),((t,s)=>{const e=t.close(s);return void 0===e?Pt:hs(e,(t=>ls(i,ds(t))))})))(n,r,i)).pipe(rs(s),Ut((t=>s.addFinalizer((s=>{const e=le(s)?Ge(s.cause):void 0;return ce(n).pipe(Ut((s=>s?ue(r,void 0).pipe(Qt($e(t)),Qt(ti(t))):ue(r,void 0).pipe(Qt(e&&os(e)>0?ei(t,as(e)):si(t)),Qt(ti(t))))))})).pipe(Qt(e(ne(n)))))))))))))),nr=(t,s)=>{const e=t;switch(e._tag){case Pn:return G(e.effect,Ut((()=>nr(s.run(),s))));case Rn:return nr(s.run(),s);case jn:return qt((()=>s.getDone()));case An:return er(e,(()=>nr(s.run(),s)),ds)}},rr=Symbol.for("effect/ChannelMergeDecision"),or={[rr]:{_R:t=>t,_E0:t=>t,_Z0:t=>t,_E:t=>t,_Z:t=>t}},ar=t=>{const s=Object.create(or);return s._tag="Await",s.f=t,s},cr="BothRunning",ur="LeftDone",hr="RightDone",lr=Symbol.for("effect/ChannelMergeState"),dr={[lr]:lr},fr=(t,s)=>{const e=Object.create(dr);return e._tag=cr,e.left=t,e.right=s,e},br=t=>{const s=Object.create(dr);return s._tag=ur,s.f=t,s},vr=t=>{const s=Object.create(dr);return s._tag=hr,s.f=t,s},mr="BackPressure",pr="BufferSliding",Sr=Symbol.for("effect/ChannelMergeStrategy"),yr={[Sr]:Sr},wr=()=>{const t=Object.create(yr);return t._tag=mr,t},gr=()=>{const t=Object.create(yr);return t._tag=pr,t},_r=_(2,((t,{onBackPressure:s,onBufferSliding:e})=>{switch(t._tag){case mr:return s();case pr:return e()}})),Fr="Empty",Er="Emit",Or="Error",Cr="Done",kr=t=>({_tag:Fr,notifyProducer:t}),Dr=t=>({_tag:Er,notifyConsumers:t}),xr=t=>({_tag:Or,cause:t}),jr=t=>({_tag:Cr,done:t});class Rr{ref;constructor(t){this.ref=t}awaitRead(){return fs(Me(this.ref,(t=>t._tag===Fr?[ne(t.notifyProducer),t]:[Pt,t])))}get close(){return bs((t=>this.error(Ve(t))))}done(t){return fs(Me(this.ref,(s=>{switch(s._tag){case Fr:return[ne(s.notifyProducer),s];case Er:return[Kt(s.notifyConsumers,(s=>ue(s,ms(t))),{discard:!0}),jr(t)];case Or:case Cr:return[vs,s]}})))}emit(t){return Ut(ie(),(s=>fs(Me(this.ref,(e=>{switch(e._tag){case Fr:return[ne(e.notifyProducer),e];case Er:{const i=e.notifyConsumers[0],n=e.notifyConsumers.slice(1);if(void 0!==i)return[ue(i,ps(t)),0===n.length?kr(s):Dr(n)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Or:case Cr:return[vs,e]}})))))}error(t){return fs(Me(this.ref,(s=>{switch(s._tag){case Fr:return[ne(s.notifyProducer),s];case Er:return[Kt(s.notifyConsumers,(s=>oe(s,t)),{discard:!0}),xr(t)];case Or:case Cr:return[vs,s]}})))}get take(){return this.takeWith((t=>me(Ye(t,ms))),(t=>ye(t)),(t=>ve(ps(t))))}takeWith(t,s,e){return Ut(ie(),(i=>fs(Me(this.ref,(n=>{switch(n._tag){case Fr:return[Qt(ue(n.notifyProducer,void 0),Ss(ne(i),{onFailure:t,onSuccess:Rt({onLeft:e,onRight:s})})),Dr([i])];case Er:return[Ss(ne(i),{onFailure:t,onSuccess:Rt({onLeft:e,onRight:s})}),Dr([...n.notifyConsumers,i])];case Or:return[Gt(t(n.cause)),n];case Cr:return[Gt(e(n.done)),n]}})))))}}const Pr=()=>G(ie(),Ut((t=>Qe(kr(t)))),Ht((t=>new Rr(t)))),Ar=_(2,((t,s)=>fn(t,s,(()=>{}),(()=>{})))),Ir=t=>{const s=Fn({onInput:()=>s,onFailure:pn,onDone:En});return gn(t,s)},Lr=_(2,((t,s)=>vn(t,(()=>s)))),zr=t=>Kr(t.takeWith(pn,(s=>yn(xn(s),(()=>zr(t)))),En)),Nr=()=>_n({onInput:t=>yn(xn(t),(()=>Nr())),onFailure:mn,onDone:On}),Br=_(2,((t,s)=>yn(t,(t=>kn((()=>s(t))))))),Qr=_(2,((t,s)=>{const e=_n({onInput:t=>yn(xn(s(t)),(()=>e)),onFailure:mn,onDone:On});return gn(t,e)})),Ur=_(3,((t,s,e)=>Zr((i=>Fs((function*(){const n=yield*Pr(),r=zr(n),o=yield*xi(e);yield*ls(i,Ri(o));const a=yield*ie(),c=e===Number.POSITIVE_INFINITY?()=>jt:(yield*Ps(e)).withPermits,u=yield*r.pipe(gn(t),Hr(i));yield*u.pipe(Bt({onFailure:t=>Pi(o,ds(t)),onSuccess:Rt({onLeft:t=>Qt(Wt(c(e)(Pt)),Bs(Pi(o,Gt(ms(t))))),onRight:t=>Fs((function*(){const e=yield*ie(),n=yield*ie();yield*Pi(o,Ht(ne(e),ps)),yield*ue(n,void 0).pipe(Qt(ts((e=>Lt(e(ne(a))).pipe(Us(Lt(e(s(t)))),Ut(jt)))).pipe(hs((t=>oe(a,t))),cs(e))),c(1),rs(i)),yield*ne(n)}))})}),Ms,Wt,rs(i));const h=Kr(Ss(fs(Ai(o)),{onFailure:pn,onSuccess:Rt({onLeft:On,onRight:t=>yn(xn(t),(()=>h))})}));return bn(h,n)})))))),Mr=_(3,((t,s,e)=>(t=>s=>(({bufferSize:t=16,concurrency:s,mergeStrategy:e=wr()})=>(i,n)=>Zr((r=>Fs((function*(){const o="unbounded"===s?Number.MAX_SAFE_INTEGER:s,a=yield*Pr(),c=zr(a),u=yield*xi(t);yield*ls(r,Ri(u));const h=yield*ji();yield*ls(r,Ri(h));const l=yield*Qe(rt()),d=yield*ie(),f=(yield*Ps(o)).withPermits,b=yield*Hr(gn(c,i),r);function v(t){return t.pipe(Ut(Rt({onLeft:t=>Gt(ot(t)),onRight:t=>Ls(Pi(u,Gt(ps(t))),rt())})),Ns({until:t=>Zt(t)}),Ut((t=>We(l,zs({onNone:()=>ot(t.value),onSome:s=>ot(n(s,t.value))})))),$t((t=>Je(t)?ds(t):Pi(u,ds(t)).pipe(Qt(ue(d,void 0)),Bs))))}yield*b.pipe(Bt({onFailure:t=>Pi(u,ds(t)).pipe(Qt(Gt(!1))),onSuccess:Rt({onLeft:t=>Ds(Wt(ne(d)),Wt(f(o)(Pt)),{onSelfDone:(t,s)=>Ls(si(s),!1),onOtherDone:(s,e)=>Qt(si(e),Ue(l).pipe(Ut(zs({onNone:()=>Pi(u,Gt(ms(t))),onSome:s=>Pi(u,Gt(ms(n(s,t))))})),Ls(!1)))}),onRight:t=>_r(e,{onBackPressure:()=>Fs((function*(){const s=yield*ie(),e=ys((s=>Hr(gn(c,t),s).pipe(Ut((t=>Is(Lt(v(t)),Lt(Wt(ne(d)))))),Ut(jt))));return yield*ue(s,void 0).pipe(Qt(e),f(1),rs(r)),yield*ne(s),!(yield*ce(d))})),onBufferSliding:()=>Fs((function*(){const s=yield*ie(),e=yield*ie(),i=yield*(n=h,n.size);var n;yield*Ai(h).pipe(Ut((t=>ue(t,void 0))),As((()=>i>=o))),yield*Pi(h,s);const a=ys((e=>Hr(gn(c,t),e).pipe(Ut((t=>Lt(v(t)).pipe(Is(Lt(Wt(ne(d)))),Is(Lt(Wt(ne(s))))))),Ut(jt))));return yield*ue(e,void 0).pipe(Qt(a),f(1),rs(r)),yield*ne(e),!(yield*ce(d))}))})})}),Ns({while:t=>t}),rs(r));const m=G(Ai(u),fs,Ss({onFailure:pn,onSuccess:Rt({onLeft:On,onRight:t=>yn(xn(t),(()=>m))})}),Kr);return bn(m,a)})))))(t)(s,gs))(e)(Qr(t,s)))),Wr=_(2,((t,s)=>Zr((function(e){return Fs((function*(){const i=yield*Pr(),n=zr(i),r=yield*Hr(gn(n,t),e),o=yield*Hr(gn(n,s.other),e);function a(t,s,i){return(n,r,o)=>{function a(t){const e=t;return"Done"===e._tag?Gt(wn(Qt(si(s),e.effect))):Ht($e(s),Se({onFailure:t=>wn(e.f(me(t))),onSuccess:Rt({onLeft:t=>wn(e.f(ye(t))),onRight:t=>to(xn(t),c(o(e.f)))})}))}return Se(t,{onFailure:t=>a(n(me(t))),onSuccess:Rt({onLeft:t=>a(n(ye(t))),onRight:t=>Gt(yn(xn(t),(()=>yn(wn(rs(Wt(i),e)),(t=>c(r(t,s)))))))})})}}function c(t){switch(t._tag){case cr:{const e=Wt(ii(t.left)),i=Wt(ii(t.right));return Kr(Ds(e,i,{onSelfDone:(e,i)=>Qt(si(i),a(e,t.right,r)(s.onSelfDone,fr,(t=>br(t)))),onOtherDone:(e,i)=>Qt(si(i),a(e,t.left,o)(s.onOtherDone,((t,s)=>fr(s,t)),(t=>vr(t))))}))}case ur:return Kr(Ht(Lt(o),Se({onFailure:s=>wn(t.f(me(s))),onSuccess:Rt({onLeft:s=>wn(t.f(ye(s))),onRight:s=>yn(xn(s),(()=>c(br(t.f))))})})));case hr:return Kr(Ht(Lt(r),Se({onFailure:s=>wn(t.f(me(s))),onSuccess:Rt({onLeft:s=>wn(t.f(ye(s))),onRight:s=>yn(xn(s),(()=>c(vr(t.f))))})})))}}return wn(Es((t=>{const s=Es((s=>(s.transferChildren(t.scope()),Pt))),i=Wt(r).pipe(Tt(s),rs(e)),n=Wt(o).pipe(Tt(s),rs(e));return It(i,n,((t,s)=>fr(t,s)))}))).pipe(yn(c),bn(i))}))})))),qr=_(2,((t,s)=>Cn((()=>{let e;const i=_n({onInput:t=>yn(xn(t),(()=>i)),onFailure:t=>(e=eo(t),pn(Te(e))),onDone:On}),n=Fn({onInput:t=>G(xn(t),yn((()=>n))),onFailure:t=>He(t)&&io(t.defect)&&Qs(t.defect,e)?mn(t.defect.error):pn(t),onDone:On});return gn(gn(gn(t,i),s),n)})))),Tr=t=>(t=>ys((s=>ir(t,s))))(Ir(t)),Vr=t=>Gr(Ht(_s,(s=>yn(wn(t(s)),xn)))),Hr=_(2,((t,s)=>Jt(zt((()=>new $n(t,void 0,jt))),xs()).pipe(js((([t,e])=>Rs(s,(s=>{const i=t.close(s);return void 0!==i?Nt(i,e):Pt})))),Vt,Ht((([t])=>qt((()=>Jr(t.run(),t)))))))),Jr=(t,s)=>{const e=t;switch(e._tag){case jn:return Se(s.getDone(),{onFailure:ds,onSuccess:t=>Gt(ms(t))});case Rn:return Gt(ps(s.getEmit()));case Pn:return G(e.effect,Ut((()=>Jr(s.run(),s))));case An:return er(e,(()=>Jr(s.run(),s)),(t=>ds(t)))}},Kr=t=>{return s=wn(t),yn(s,jt);var s},Gr=t=>{return dn((s=t,Kr(ts((t=>Ht(Os(),(e=>ln(hs(t(Cs(s,e)),(t=>ks(e,me(t)))),((t,s)=>ks(e,s))))))))),(t=>t),(t=>t));var s},Zr=t=>dn(Vr(t),(t=>t),(t=>t)),Xr=t=>Yr(0,t.length,t),Yr=(t,s,e)=>t===s?Dn:G(xn(G(e,ws(t))),yn((()=>Yr(t+1,s,e)))),$r=_((t=>hn(t[1])),((t,s,e)=>e?.concurrent?Wr(t,{other:s,onSelfDone:t=>ar((s=>qt((()=>ge(t,s))))),onOtherDone:t=>ar((s=>qt((()=>ge(s,t)))))}):yn(t,(t=>Br(s,(s=>[t,s])))))),to=_((t=>hn(t[1])),((t,s,e)=>e?.concurrent?Br($r(t,s,{concurrent:!0}),(t=>t[1])):yn(t,(()=>s)))),so=Symbol.for("effect/Channel/ChannelException"),eo=t=>({_tag:"ChannelException",[so]:so,error:t}),io=t=>Dt(t,so),no=Symbol.for("effect/Sink"),ro={_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t};class oo{channel;[no]=ro;constructor(t){this.channel=t}pipe(){return F(this,arguments)}}const ao=new oo(Ir(Nr())),co=t=>xt(t)?co(new oo(wn(t))):t.channel,uo=Symbol.for("effect/Take"),ho={_A:t=>t,_E:t=>t};class lo{exit;[uo]=ho;constructor(t){this.exit=t}pipe(){return F(this,arguments)}}const fo=t=>new lo(ye(t)),bo=new lo(ve(rt())),vo=Symbol.for("effect/Stream"),mo={_R:t=>t,_E:t=>t,_A:t=>t};class po{channel;[vo]=mo;constructor(t){this.channel=t}pipe(){return F(this,arguments)}}const So=t=>Dt(t,vo)||xt(t),yo=_(2,((t,s)=>new po(G(Oo(t),Lr(s))))),wo=_((t=>So(t[0])),((t,s,e)=>{const i=e?.bufferSize??16;return e?.switch?go(e?.concurrency,(()=>_o(t,1,i,s)),(e=>_o(t,e,i,s))):go(e?.concurrency,(()=>new po(Ar(Oo(t),(t=>G(t,Hs((t=>Oo(s(t)))),Vs(Dn,((t,s)=>G(t,to(s))))))))),(()=>new po(G(Oo(t),Ar(Xr),Mr((t=>Oo(s(t))),e)))))})),go=(t,s,e)=>{switch(t){case void 0:return s();case"unbounded":return e(Number.MAX_SAFE_INTEGER);default:return t>1?e(t):s()}},_o=_(4,((t,s,e,i)=>new po(G(Oo(t),Ar(Xr),Mr((t=>Oo(i(t))),{concurrency:s,mergeStrategy:gr(),bufferSize:e}))))),Fo=_((t=>So(t[0])),((t,s)=>wo(t,jt,s))),Eo=t=>(t=>{const s=Fn({onInput:t=>yn(Xr(t),(()=>s)),onFailure:pn,onDone:()=>Dn});return new po(G(Oo(t),gn(s)))})((t=>{const s=Fn({onInput:t=>((t,s)=>{const[e,i]=G(t,Ks((t=>!de(t)))),n=G(Gs(i),zs({onNone:()=>s,onSome:Se({onFailure:t=>zs(Xe(t),{onNone:()=>Dn,onSome:pn}),onSuccess:()=>Dn})}));return G(xn(G(e,Zs((t=>de(t)?ot(t.value):rt())))),yn((()=>n)))})(t,s),onFailure:t=>pn(t),onDone:()=>Dn});return new po(G(Oo(t),gn(s)))})(G(t,xo((t=>t.exit))))),Oo=t=>{if("channel"in t)return t.channel;if(xt(t))return Oo(Co(t));throw new TypeError("Expected a Stream.")},Co=t=>G(t,Ts(ot),ko),ko=t=>new po(Kr(Js(t,{onFailure:zs({onNone:()=>Dn,onSome:mn}),onSuccess:t=>xn(Ws(t))}))),Do=(t,s)=>G(Ii(t,1,s?.maxChunkSize??4096),$t((s=>G(t.isShutdown,Ut((t=>t&&Je(s)?qs(rt()):(t=>Ts(ds(t),ot))(s)))))),Po,s?.shutdown?yo(Ri(t)):jt),xo=_(2,((t,s)=>new po(G(Oo(t),Qr(Hs(s)))))),jo=_(2,((t,s)=>{const e=t=>{const i=t.next();return i.done?Fn({onInput:t=>e(t[Symbol.iterator]()),onFailure:pn,onDone:En}):Kr(Ht(s(i.value),(s=>yn(xn(Ws(s)),(()=>e(t))))))};return new po(G(Oo(t),gn(Cn((()=>e(D()[Symbol.iterator]()))))))})),Ro=_(3,((t,s,e)=>new po(G(Oo(t),Ar(Xr),Ur(e,s),Qr(Ws))))),Po=t=>Io(t,(t=>G(Ht(t,(s=>ot([s,t]))),Xs(zs({onNone:()=>Gt(rt()),onSome:qs}))))),Ao=_(2,((t,s)=>Oo(t).pipe(qr(co(s)),Tr))),Io=(t,s)=>{return e=()=>{const e=t=>Kr(Ht(s(t),zs({onNone:()=>Dn,onSome:([t,s])=>yn(xn(t),(()=>e(s)))})));return new po(e(t))},new po(Cn((()=>Oo(e()))));var e},Lo=Symbol.for("effect/GroupBy"),zo={_R:t=>t,_E:t=>t,_K:t=>t,_V:t=>t},No=_((t=>Dt(t[0],Lo)),((t,s,e)=>wo(t.grouped,(([t,e])=>s(t,Eo(Do(e,{shutdown:!0})))),{concurrency:"unbounded",bufferSize:e?.bufferSize??16}))),Bo=t=>({[Lo]:zo,pipe(){return F(this,arguments)},grouped:t}),Qo=_((t=>"function"!=typeof t[0]),((t,s,e)=>e?.key?No(Uo(t,e.key,{bufferSize:e.bufferSize}),((t,e)=>jo(e,s))):go(e?.concurrency,(()=>jo(t,s)),(i=>e?.unordered?wo(t,(t=>Co(s(t))),{concurrency:i}):Ro(t,i,s))))),Uo=_((t=>"function"!=typeof t[0]),((t,s,e)=>{const i=(t,n)=>Fn({onInput:r=>yn(wn(Kt(Mo(r,s),(([s,i])=>{const r=t.get(s);return void 0===r?G(xi(e?.bufferSize??16),Ut((e=>G(zt((()=>{t.set(s,e)})),Qt(Pi(n,new lo(ye(Ws([s,e]))))),Qt(G(Pi(e,fo(i)),Ys((t=>Ke(t)?ot(Pt):rt())))))))):Ys(Pi(r,fo(i)),(t=>Ke(t)?ot(Pt):rt()))}),{discard:!0})),(()=>i(t,n))),onFailure:t=>wn(Pi(n,(t=>new lo(me(G(t,Ye(ot)))))(t))),onDone:()=>wn(G(Kt(t.entries(),(([t,s])=>G(Pi(s,bo),Ys((t=>Ke(t)?ot(Pt):rt())))),{discard:!0}),Qt(Pi(n,bo))))});return Bo((t=>Fo((t=>new po(Vr((s=>t(s).pipe(Ht(Ws))))))((s=>t(s)))))((s=>Fs((function*(){const e=new Map,n=yield*ji();return yield*ls(s,Ri(n)),yield*Oo(t).pipe(gn(i(e,n)),Ir,ir(s),rs(s),Ls(Eo(Do(n,{shutdown:!0}))))})))))})),Mo=_(2,((t,s)=>{const e=[],i=t[Symbol.iterator](),n=new Map;let r;for(;(r=i.next())&&!r.done;){const t=r.value,i=s(t);if(n.has(i))n.get(i).push(t);else{const s=[t];e.push([i,s]),n.set(i,s)}}return $s(e.map((t=>[t[0],$s(t[1])])))})),Wo=Do,qo=Qo,To=class extends t{constructor(){super(!1)}controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){this.controllers.size||console.warn("ReactiveControllerHost connected with no controllers registered.",this),this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}};class Vo{host;config;static get globalValidationEnabled(){return s.isDev}static axe=this.globalValidationEnabled?import("./p-D1HbKFuh.js").then((function(t){return t.a})):null;static axeQueue=null;static axeStreamFiber=null;visibilityObserver;elementQueued=!1;elementValidated=!1;knownValidationErrors=[];get disabled(){return!0}constructor(t,s){this.host=t,this.config=s,Vo.initializeAxeStream()}static initializeAxeStream(){if(!this.globalValidationEnabled)return;if(this.axeStreamFiber)return;const t=Fs((function*(){const t=Vo.axeQueue=yield*xi(100),s=yield*se((()=>Vo.axe));if(!s)return void console.error("Axe library not available, ARIA validation will not run.");const e=Wo(t).pipe(qo((({context:t,onComplete:e})=>ee((i=>{s.run(t,{},((t,s)=>{e(t,s),i(Pt)}))})))));var i;yield*(i=e,Ao(i,ao))}));this.axeStreamFiber=te(t)}hostDidLoad(){this.elementQueued||this.elementValidated||(this.host.el.checkVisibility()?this.enqueueValidation():this.observeVisibilityOnce())}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver()}observeVisibilityOnce(){this.visibilityObserver=new IntersectionObserver((t=>{for(const s of t)s.target===this.host.el&&s.isIntersecting&&(this.checkLazyValidation(),this.discardVisibilityObserver())}),{root:this.host.el.parentElement,rootMargin:"0px",threshold:.01}),this.visibilityObserver.observe(this.host.el)}checkLazyValidation(){(this.config?.reValidateOnPropChanges||!this.elementQueued&&!this.elementValidated)&&this.enqueueValidation()}enqueueValidation(){}discardVisibilityObserver(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0)}}export{Vo as A,xe as E,To as R,ne as _,Pe as a,re as d,ae as i,Le as o,Ne as p,ye as s,he as u}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{t as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={isDev:!1},n=(t=>(t.Undefined="undefined",t.Null="null",t.String="string",t.Number="number",t.SpecialNumber="number",t.Boolean="boolean",t.BigInt="bigint",t))(n||{}),e=(t=>(t.Array="array",t.Date="date",t.Map="map",t.Object="object",t.RegularExpression="regexp",t.Set="set",t.Channel="channel",t.Symbol="symbol",t))(e||{}),o="type",l="value",s="serialized:";function i(t,n,e){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,n);if(o&&(!e||o.get))return o;t=Object.getPrototypeOf(t)}}var r,c=(t,n)=>{var e;Object.entries(null!=(e=n.o.t)?e:{}).map((([e,[o]])=>{if(31&o||32&o){const o=t[e],l=i(Object.getPrototypeOf(t),e,!0)||Object.getOwnPropertyDescriptor(t,e);l&&Object.defineProperty(t,e,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(e)?t[e]=n.l.get(e):void 0!==o&&(t[e]=o)}}))},f=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},u=(t,n)=>n in t,a=(t,n)=>(0,console.error)(t,n),d=new Map,$="s-id",p="sty-id",h="c-id",v="http://www.w3.org/1999/xlink",y=["formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"],m="undefined"!=typeof window?window:{},b=m.HTMLElement||class{},g={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,o)=>t.addEventListener(n,e,o),rel:(t,n,e,o)=>t.removeEventListener(n,e,o),ce:(t,n)=>new CustomEvent(t,n)},w=(()=>{try{return!!m.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),j=!!w&&(()=>!!m.document&&Object.getOwnPropertyDescriptor(m.document.adoptedStyleSheets,"length").writable)(),O=!1,S=[],N=[],k=(t,n)=>e=>{t.push(e),O||(O=!0,n&&4&g.i?C(M):g.raf(M))},x=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){a(t)}t.length=0},M=()=>{x(S),x(N),(O=S.length>0)&&g.raf(M)},C=t=>Promise.resolve(undefined).then(t),E=k(N,!0),A=t=>{const n=new URL(t,g.u);return n.origin!==m.location.origin?n.href:n.pathname},I=t=>g.u=t;function L(t){const n={mode:"open"};n.delegatesFocus=!!(16&t.i);const e=this.attachShadow(n);void 0===r&&(r=null),r&&(j?e.adoptedStyleSheets.push(r):e.adoptedStyleSheets=[...e.adoptedStyleSheets,r])}var R=t=>{const n=V(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&_(n,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!D(t,T(t),!1).length)}));let e=0;for(e=0;e<n.length;e++){const t=n[e];1===t.nodeType&&V(t,"childNodes").length&&R(t)}};function _(t,n,e){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&(!n||o["s-hn"]===n)&&(void 0===e||T(o)===e)&&(s.push(o),void 0!==e))return s;s=[...s,..._(o.childNodes,n,e)]}return s}var D=(t,n,e=!0)=>{const o=[];(e&&t["s-sr"]||!t["s-sr"])&&o.push(t);let l=t;for(;l=l.nextSibling;)T(l)!==n||!e&&l["s-sr"]||o.push(l);return o},B=(t,n)=>1===t.nodeType?null===t.getAttribute("slot")&&""===n||t.getAttribute("slot")===n:t["s-sn"]===n||""===n,F=(t,n,e,o)=>{if(t["s-ol"]&&t["s-ol"].isConnected)return;const l=document.createTextNode("");if(l["s-nr"]=t,!n["s-cr"]||!n["s-cr"].parentNode)return;const s=n["s-cr"].parentNode,i=V(s,"appendChild");if(void 0!==o){l["s-oo"]=o;const t=V(s,"childNodes"),n=[l];t.forEach((t=>{t["s-nr"]&&n.push(t)})),n.sort(((t,n)=>!t["s-oo"]||t["s-oo"]<(n["s-oo"]||0)?-1:!n["s-oo"]||n["s-oo"]<t["s-oo"]?1:0)),n.forEach((t=>i.call(s,t)))}else i.call(s,l);t["s-ol"]=l,t["s-sh"]=n["s-hn"]},T=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function U(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const n=n=>function(t){const e=[],o=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const l=this["s-cr"].parentElement;return(l.__childNodes?l.childNodes:(t=>{const n=[];for(let e=0;e<t.length;e++){const o=t[e]["s-nr"]||void 0;o&&o.isConnected&&n.push(o)}return n})(l.childNodes)).forEach((t=>{o===T(t)&&e.push(t)})),n?e.filter((t=>1===t.nodeType)):e}.bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}function V(t,n){if("__"+n in t){const e=t["__"+n];return"function"!=typeof e?e:e.bind(t)}return"function"!=typeof t[n]?t[n]:t[n].bind(t)}var H=new WeakMap,P=(t,n,e)=>{let o=d.get(t);w&&e?(o=o||new CSSStyleSheet,"string"==typeof o?o=n:o.replaceSync(n)):o=n,d.set(t,o)},z=(t,n)=>{var e,o,l;const s=W(n),i=d.get(s);if(!m.document)return s;if(t=11===t.nodeType?t:m.document,i)if("string"==typeof i){let l,r=H.get(t=t.head||t);r||H.set(t,r=new Set);const c=t.querySelector(`[${p}="${s}"]`);if(c)c.textContent=i;else if(!r.has(s)){l=m.document.createElement("style"),l.textContent=i;const c=null!=(e=g.$)?e:function(){var t,n,e;return null!=(e=null==(n=null==(t=m.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?e:void 0}();if(null!=c&&l.setAttribute("nonce",c),!(1&n.i))if("HEAD"===t.nodeName){const n=t.querySelectorAll("link[rel=preconnect]"),e=n.length>0?n[n.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==e?void 0:e.parentNode)===t?e:null)}else if("host"in t)if(w){const n=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;n.replaceSync(i),j?t.adoptedStyleSheets.unshift(n):t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}else{const n=t.querySelector("style");n?n.textContent=i+n.textContent:t.prepend(l)}else t.append(l);1&n.i&&t.insertBefore(l,null),4&n.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(s)}}else{let n=H.get(t);if(n||H.set(t,n=new Set),!n.has(s)){const e=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(i.constructor===e.CSSStyleSheet)o=i;else{o=new e.CSSStyleSheet;for(let t=0;t<i.cssRules.length;t++)o.insertRule(i.cssRules[t].cssText,t)}if(j?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],n.add(s),"host"in t){const n=t.querySelector(`[${p}="${s}"]`);n&&E((()=>n.remove()))}}}return s},W=t=>"sc-"+t.p,q=t=>"object"==(t=typeof t)||"function"===t,Y=(t,n,...e)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],f=n=>{for(let e=0;e<n.length;e++)o=n[e],Array.isArray(o)?f(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!q(o))&&(o=String(o)),i&&r?c[c.length-1].h+=o:c.push(i?J(null,o):o),r=i)};if(f(e),n){n.key&&(l=n.key),n.name&&(s=n.name);{const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}}const u=J(t,null);return u.v=n,c.length>0&&(u.m=c),u.j=l,u.O=s,u},J=(t,n)=>({i:0,S:t,h:null!=n?n:null,N:null,m:null,v:null,j:null,O:null}),Z={},G=(t,n,e,o,l,s,i,r=[])=>{let c,f,u,a;const d=l["s-sc"];if(1===s.nodeType){if(c=s.getAttribute(h),c&&(f=c.split("."),f[0]===i||"0"===f[0])){u=Q({i:0,k:f[0],M:f[1],C:f[2],A:f[3],S:s.tagName.toLowerCase(),N:s,v:{class:s.className||""}}),n.push(u),s.removeAttribute(h),t.m||(t.m=[]),d&&f[0]===i&&(s["s-si"]=d,u.v.class+=" "+d);const l=u.N.getAttribute("s-sn");"string"==typeof l&&("slot-fb"===u.S&&(X(l,f[2],u,s,t,n,e,o,r),d&&s.classList.add(d)),u.N["s-sn"]=l,u.N.removeAttribute("s-sn")),void 0!==u.A&&(t.m[u.A]=u),t=u,o&&"0"===u.C&&(o[u.A]=u.N)}if(s.shadowRoot)for(a=s.shadowRoot.childNodes.length-1;a>=0;a--)G(t,n,e,o,l,s.shadowRoot.childNodes[a],i,r);const $=s.__childNodes||s.childNodes;for(a=$.length-1;a>=0;a--)G(t,n,e,o,l,$[a],i,r)}else if(8===s.nodeType)f=s.nodeValue.split("."),(f[1]===i||"0"===f[1])&&(c=f[0],u=Q({k:f[1],M:f[2],C:f[3],A:f[4]||"0",N:s,v:null,m:null,j:null,O:null,S:null,h:null}),"t"===c?(u.N=lt(s,3),u.N&&3===u.N.nodeType&&(u.h=u.N.textContent,n.push(u),s.remove(),i===u.k&&(t.m||(t.m=[]),t.m[u.A]=u),o&&"0"===u.C&&(o[u.A]=u.N))):"c"===c?(u.N=lt(s,8),u.N&&8===u.N.nodeType&&(n.push(u),s.remove())):u.k===i&&("s"===c?X(s["s-sn"]=f[5]||"",f[2],u,s,t,n,e,o,r):"r"===c&&(o?s.remove():(l["s-cr"]=s,s["s-cn"]=!0))));else if(t&&"style"===t.S){const n=J(null,s.textContent);n.N=s,n.A="0",t.m=[n]}return t},K=(t,n)=>{if(1===t.nodeType){const e=t[$]||t.getAttribute($);e&&n.set(e,t);let o=0;if(t.shadowRoot)for(;o<t.shadowRoot.childNodes.length;o++)K(t.shadowRoot.childNodes[o],n);const l=t.__childNodes||t.childNodes;for(o=0;o<l.length;o++)K(l[o],n)}else if(8===t.nodeType){const e=t.nodeValue.split(".");"o"===e[0]&&(n.set(e[1]+"."+e[2],t),t.nodeValue="",t["s-en"]=e[3])}},Q=t=>({i:0,k:null,M:null,C:null,A:"0",N:null,v:null,m:null,j:null,O:null,S:null,h:null,...t});function X(t,n,e,o,l,s,i,r,c){o["s-sr"]=!0,e.O=t||null,e.S="slot";const f=(null==l?void 0:l.N)?l.N["s-id"]||l.N.getAttribute("s-id"):"";if(r&&m.document){const s=e.N=m.document.createElement(e.S);e.O&&e.N.setAttribute("name",t),l.N.shadowRoot&&f&&f!==e.k?V(l.N,"insertBefore")(s,V(l.N,"children")[0]):V(V(o,"parentNode"),"insertBefore")(s,o),ot(c,n,t,o,e.k),o.remove(),"0"===e.C&&(r[e.A]=e.N)}else{const s=e.N,i=f&&f!==e.k&&l.N.shadowRoot;ot(c,n,t,o,i?f:e.k),U(o),i&&l.N.insertBefore(s,l.N.children[0])}s.push(e),i.push(e),l.m||(l.m=[]),l.m[e.A]=e}var tt,nt,et,ot=(t,n,e,o,l)=>{var s,i;let r=o.nextSibling;if(t[n]=t[n]||[],r&&!(null==(s=r.nodeValue)?void 0:s.startsWith("s.")))do{!r||(r.getAttribute&&r.getAttribute("slot")||r["s-sn"])!==e&&(""!==e||r["s-sn"]||r.getAttribute&&r.getAttribute("slot")||8!==r.nodeType&&3!==r.nodeType)||(r["s-sn"]=e,t[n].push({slot:o,node:r,hostId:l})),r=null==r?void 0:r.nextSibling}while(r&&!(null==(i=r.nodeValue)?void 0:i.startsWith("s.")))},lt=(t,n)=>{let e=t;do{e=e.nextSibling}while(e&&(e.nodeType!==n||!e.nodeValue));return e},st=class t{static fromLocalValue(n){const e=n[o],s=l in n?n[l]:void 0;switch(e){case"string":case"boolean":return s;case"bigint":return BigInt(s);case"undefined":return;case"null":return null;case"number":return"NaN"===s?NaN:"-0"===s?-0:"Infinity"===s?1/0:"-Infinity"===s?-1/0:s;case"array":return s.map((n=>t.fromLocalValue(n)));case"date":return new Date(s);case"map":const n=new Map;for(const[e,o]of s){const l="object"==typeof e&&null!==e?t.fromLocalValue(e):e,s=t.fromLocalValue(o);n.set(l,s)}return n;case"object":const o={};for(const[n,e]of s)o[n]=t.fromLocalValue(e);return o;case"regexp":const{pattern:l,flags:i}=s;return new RegExp(l,i);case"set":const r=new Set;for(const n of s)r.add(t.fromLocalValue(n));return r;case"symbol":return Symbol(s);default:throw new Error(`Unsupported type: ${e}`)}}static fromLocalValueArray(n){return n.map((n=>t.fromLocalValue(n)))}static isLocalValueObject(t){if("object"!=typeof t||null===t)return!1;if(!t.hasOwnProperty(o))return!1;const s=t[o];return!!Object.values({...n,...e}).includes(s)&&("null"===s||"undefined"===s||t.hasOwnProperty(l))}},it=(t,n,e)=>{return"string"==typeof t&&t.startsWith(s)?t="string"==typeof(o=t)&&o.startsWith(s)?st.fromLocalValue(JSON.parse(atob(o.slice(11)))):o:null==t||q(t)?t:4&n?(e&&"string"==typeof t||"false"!==t)&&(""===t||!!t):2&n?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&n?String(t):t;var o},rt=(t,n)=>{const e=t;return{emit:t=>ct(e,n,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},ct=(t,n,e)=>{const o=g.ce(n,e);return t.dispatchEvent(o),o},ft=(t,n,e,o,l,s,i)=>{if(e===o)return;let r=u(t,n),c=n.toLowerCase();if("class"===n){const n=t.classList,l=at(e);let s=at(o);if((t["s-si"]||t["s-sc"])&&i){const e=t["s-sc"]||t["s-si"];s.push(e),l.forEach((t=>{t.startsWith(e)&&s.push(t)})),s=[...new Set(s)].filter((t=>t)),n.add(...s)}else n.remove(...l.filter((t=>t&&!s.includes(t)))),n.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===n){for(const n in e)o&&null!=o[n]||(n.includes("-")?t.style.removeProperty(n):t.style[n]="");for(const n in o)e&&o[n]===e[n]||(n.includes("-")?t.style.setProperty(n,o[n]):t.style[n]=o[n])}else if("key"===n);else if("ref"===n)o&&Lt(o,t);else if(t.__lookupSetter__(n)||"o"!==n[0]||"n"!==n[1]){if("a"===n[0]&&n.startsWith("attr:")){const e=n.slice(5);let l;{const n=f(t);if(n&&n.o&&n.o.t){const t=n.o.t[e];t&&t[1]&&(l=t[1])}}return l||(l=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==o||!1===o?!1===o&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===o?"":o))}if("p"===n[0]&&n.startsWith("prop:")){const e=n.slice(5);try{t[e]=o}catch(t){}return}{const i=q(o);if((r||i&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[n]!==o&&(t[n]=o);else{const l=null==o?"":o;"list"===n?r=!1:null!=e&&t[n]===l||("function"==typeof t.__lookupSetter__(n)?t[n]=l:t.setAttribute(n,l))}}catch(t){}let f=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(n=c,f=!0),null==o||!1===o?!1===o&&""!==t.getAttribute(n)||(f?t.removeAttributeNS(v,n):t.removeAttribute(n)):(!r||4&s||l)&&!i&&1===t.nodeType&&(o=!0===o?"":o,f?t.setAttributeNS(v,n,o):t.setAttribute(n,o))}}else if(n="-"===n[2]?n.slice(3):u(m,c)?c.slice(2):c[2]+n.slice(3),e||o){const l=n.endsWith(dt);n=n.replace($t,""),e&&g.rel(t,n,e,l),o&&g.ael(t,n,o,l)}},ut=/\s/,at=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(ut):[]),dt="Capture",$t=new RegExp(dt+"$"),pt=(t,n,e,o)=>{const l=11===n.N.nodeType&&n.N.host?n.N.host:n.N,s=t&&t.v||{},i=n.v||{};for(const t of ht(Object.keys(s)))t in i||ft(l,t,s[t],void 0,e,n.i,o);for(const t of ht(Object.keys(i)))ft(l,t,s[t],i[t],e,n.i,o)};function ht(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var vt=!1,yt=!1,mt=!1,bt=!1,gt=[],wt=[],jt=(t,n,e)=>{var o;const l=n.m[e];let s,i,r,c=0;if(vt||(mt=!0,"slot"===l.S&&(l.i|=l.m?2:1)),null!=l.h)s=l.N=m.document.createTextNode(l.h);else if(1&l.i)s=l.N=m.document.createTextNode(""),pt(null,l,bt);else{if(!m.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=l.N=m.document.createElement(!vt&&2&l.i?"slot-fb":l.S),pt(null,l,bt),null!=(f=tt)&&void 0!==f&&s["s-si"]!==tt&&s.classList.add(s["s-si"]=tt),l.m){const n="template"===l.S?s.content:s;for(c=0;c<l.m.length;++c)i=jt(t,l,c),i&&n.appendChild(i)}}var f;return s["s-hn"]=et,3&l.i&&(s["s-sr"]=!0,s["s-cr"]=nt,s["s-sn"]=l.O||"",s["s-rf"]=null==(o=l.v)?void 0:o.ref,U(s),r=t&&t.m&&t.m[e],r&&r.S===l.S&&t.N&&Ot(t.N),_t(nt,s,n.N,null==t?void 0:t.N)),s},Ot=t=>{g.i|=1;const n=t.closest(et.toLowerCase());if(null!=n){const e=Array.from(n.__childNodes||n.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of e?o.reverse():o)null!=t["s-sh"]&&(Rt(n,t,null!=e?e:null),t["s-sh"]=void 0,mt=!0)}g.i&=-2},St=(t,n)=>{g.i|=1;const e=Array.from(t.__childNodes||t.childNodes);if(t["s-sr"]){let n=t;for(;n=n.nextSibling;)n&&n["s-sn"]===t["s-sn"]&&n["s-sh"]===et&&e.push(n)}for(let t=e.length-1;t>=0;t--){const o=e[t];o["s-hn"]!==et&&o["s-ol"]&&(Rt(Mt(o).parentNode,o,Mt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,mt=!0),n&&St(o,n)}g.i&=-2},Nt=(t,n,e,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for(r.shadowRoot&&r.tagName===et&&(r=r.shadowRoot),"template"===e.S&&(r=r.content);l<=s;++l)o[l]&&(i=jt(null,e,l),i&&(o[l].N=i,Rt(r,i,Mt(n))))},kt=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.N;It(n),t&&(yt=!0,t["s-ol"]?t["s-ol"].remove():St(t,!0),t.remove())}}},xt=(t,n,e=!1)=>t.S===n.S&&("slot"===t.S?t.O===n.O:e?(e&&!t.j&&n.j&&(t.j=n.j),!0):t.j===n.j),Mt=t=>t&&t["s-ol"]||t,Ct=(t,n,e=!1)=>{const o=n.N=t.N,l=t.m,s=n.m,i=n.h;let r;null==i?("slot"!==n.S||vt||t.O!==n.O&&(n.N["s-sn"]=n.O||"",Ot(n.N.parentElement)),pt(t,n,bt,e),null!==l&&null!==s?((t,n,e,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=n.length-1,d=n[0],$=n[a],p=o.length-1,h=o[0],v=o[p];const y="template"===e.S?t.content:t;for(;r<=a&&c<=p;)if(null==d)d=n[++r];else if(null==$)$=n[--a];else if(null==h)h=o[++c];else if(null==v)v=o[--p];else if(xt(d,h,l))Ct(d,h,l),d=n[++r],h=o[++c];else if(xt($,v,l))Ct($,v,l),$=n[--a],v=o[--p];else if(xt(d,v,l))"slot"!==d.S&&"slot"!==v.S||St(d.N.parentNode,!1),Ct(d,v,l),Rt(y,d.N,$.N.nextSibling),d=n[++r],v=o[--p];else if(xt($,h,l))"slot"!==d.S&&"slot"!==v.S||St($.N.parentNode,!1),Ct($,h,l),Rt(y,$.N,d.N),$=n[--a],h=o[++c];else{for(f=-1,u=r;u<=a;++u)if(n[u]&&null!==n[u].j&&n[u].j===h.j){f=u;break}f>=0?(i=n[f],i.S!==h.S?s=jt(n&&n[c],e,f):(Ct(i,h,l),n[f]=void 0,s=i.N),h=o[++c]):(s=jt(n&&n[c],e,c),h=o[++c]),s&&Rt(Mt(d.N).parentNode,s,Mt(d.N))}r>a?Nt(t,null==o[p+1]?null:o[p+1].N,e,o,c,p):c>p&&kt(n,r,a)})(o,l,n,s,e):null!==s?(null!==t.h&&(o.textContent=""),Nt(o,null,n,s,0,s.length-1)):e||null===l?e&&null!==l&&null===s&&(n.m=l):kt(l,0,l.length-1)):(r=o["s-cr"])?r.parentNode.textContent=i:t.h!==i&&(o.data=i)},Et=[],At=t=>{let n,e,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(n=t["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const l=t["s-sn"];for(o=e.length-1;o>=0;o--)if(n=e[o],!(n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||n["s-sh"]&&n["s-sh"]===t["s-hn"]))if(B(n,l)){let e=Et.find((t=>t.I===n));yt=!0,n["s-sn"]=n["s-sn"]||l,e?(e.I["s-sh"]=t["s-hn"],e.L=t):(n["s-sh"]=t["s-hn"],Et.push({L:t,I:n})),n["s-sr"]&&Et.map((t=>{B(t.I,n["s-sn"])&&(e=Et.find((t=>t.I===n)),e&&!t.L&&(t.L=e.L))}))}else Et.some((t=>t.I===n))||Et.push({I:n})}1===t.nodeType&&At(t)}},It=t=>{t.v&&t.v.ref&>.push((()=>t.v.ref(null))),t.m&&t.m.map(It)},Lt=(t,n)=>{wt.push((()=>t(n)))},Rt=(t,n,e,o)=>{if("string"==typeof n["s-sn"]&&n["s-sr"]&&n["s-cr"])_t(n["s-cr"],n,t,n.parentElement);else if("string"==typeof n["s-sn"]){t.insertBefore(n,e);const{slotNode:l}=function(t,n){var e;if(!(n=n||(null==(e=t["s-ol"])?void 0:e.parentElement)))return{slotNode:null,slotName:""};const o=t["s-sn"]=T(t)||"";return{slotNode:_(V(n,"childNodes"),n.tagName,o)[0],slotName:o}}(n);return l&&!o&&l.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1})),n}return t.__insertBefore?t.__insertBefore(n,e):null==t?void 0:t.insertBefore(n,e)};function _t(t,n,e,o){var l,s;let i;if(t&&"string"==typeof n["s-sn"]&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=n["s-si"]||t.parentNode["s-sc"])){const t=n["s-sn"],r=n["s-hn"];if(null==(l=e.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let n=(o.__childNodes||o.childNodes)[0],e=!1;for(;n;){if(n["s-sn"]!==t&&n["s-hn"]===r&&n["s-sr"]){e=!0;break}n=n.nextSibling}e||o.classList.remove(i+"-s")}}}var Dt=(t,n,e=!1)=>{var o,l,s,i,r;const c=t.$hostElement$,f=t.o,u=t.R||J(null,null);var a;const d=(a=n)&&a.S===Z?n:Y(null,null,n);if(et=c.tagName,f._&&(d.v=d.v||{},f._.forEach((([t,n])=>{d.v[n]=c[t]}))),e&&d.v)for(const t of Object.keys(d.v))c.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(d.v[t]=c[t]);if(d.S=null,d.i|=4,t.R=d,d.N=u.N=c.shadowRoot||c,tt=c["s-sc"],vt=!(!(1&f.i)||128&f.i),nt=c["s-cr"],yt=!1,Ct(u,d,e),g.i|=1,mt){At(d.N);for(const t of Et){const n=t.I;if(!n["s-ol"]&&m.document){const t=m.document.createTextNode("");t["s-nr"]=n,Rt(n.parentNode,n["s-ol"]=t,n,e)}}for(const t of Et){const n=t.I,r=t.L;if(1===n.nodeType&&e&&(n["s-ih"]=null!=(o=n.hidden)&&o),r){const t=r.parentNode;let o=r.nextSibling;if(o&&1===o.nodeType){let e=null==(l=n["s-ol"])?void 0:l.previousSibling;for(;e;){let l=null!=(s=e["s-nr"])?s:null;if(l&&l["s-sn"]===n["s-sn"]&&t===(l.__parentNode||l.parentNode)){for(l=l.nextSibling;l===n||(null==l?void 0:l["s-sr"]);)l=null==l?void 0:l.nextSibling;if(!l||!l["s-nr"]){o=l;break}}e=e.previousSibling}}if((!o&&t!==(n.__parentNode||n.parentNode)||(n.__nextSibling||n.nextSibling)!==o)&&n!==o){if(Rt(t,n,o,e),8===n.nodeType&&n.nodeValue.startsWith("s-nt-")){const t=m.document.createTextNode(n.nodeValue.replace(/^s-nt-/,""));t["s-hn"]=n["s-hn"],t["s-sn"]=n["s-sn"],t["s-sh"]=n["s-sh"],t["s-sr"]=n["s-sr"],t["s-ol"]=n["s-ol"],t["s-ol"]["s-nr"]=t,Rt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}1===n.nodeType&&"SLOT-FB"!==n.tagName&&(n.hidden=null!=(i=n["s-ih"])&&i)}n&&"function"==typeof r["s-rf"]&&r["s-rf"](r)}else 1===n.nodeType&&(n.hidden=!0)}}if(yt&&R(d.N),g.i&=-2,Et.length=0,!vt&&!(1&f.i)&&c["s-cr"]){const t=d.N.__childNodes||d.N.childNodes;for(const n of t)if(n["s-hn"]!==et&&!n["s-sh"])if(e&&null==n["s-ih"]&&(n["s-ih"]=null!=(r=n.hidden)&&r),1===n.nodeType)n.hidden=!0;else if(3===n.nodeType&&n.nodeValue.trim()){const t=m.document.createComment("s-nt-"+n.nodeValue);t["s-sn"]=n["s-sn"],Rt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}}nt=void 0,gt.forEach((t=>t())),gt.length=0,wt.forEach((t=>t())),wt.length=0},Bt=(t,n)=>{if(n&&!t.D&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t.D=()=>{n["s-p"].splice(e-1,1),o()})))}},Ft=(t,n)=>{if(t.i|=16,4&t.i)return void(t.i|=512);Bt(t,t.B);const e=()=>Tt(t,n);if(!n)return E(e);queueMicrotask((()=>{e()}))},Tt=(t,n)=>{const e=t.$hostElement$,o=e;if(!o)throw new Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=qt(o,n?"componentWillLoad":"componentWillUpdate",void 0,e),l=Ut(l,(()=>qt(o,"componentWillRender",void 0,e))),Ut(l,(()=>Ht(t,o,n)))},Ut=(t,n)=>Vt(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),Vt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Ht=async(t,n,e)=>{var o;const l=t.$hostElement$,s=l["s-rc"];e&&(t=>{const n=t.o,e=t.$hostElement$,o=n.i,l=z(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);10&o&&(e["s-sc"]=l,e.classList.add(l+"-h"))})(t);Pt(t,n,l,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const n=null!=(o=l["s-p"])?o:[],e=()=>zt(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.i|=4,n.length=0)}},Pt=(t,n,e,o)=>{try{n=n.render(),t.i&=-17,t.i|=2,Dt(t,n,o)}catch(n){a(n,t.$hostElement$)}return null},zt=t=>{const n=t.$hostElement$,e=n,o=t.B;qt(e,"componentDidRender",void 0,n),64&t.i?qt(e,"componentDidUpdate",void 0,n):(t.i|=64,Yt(n),qt(e,"componentDidLoad",void 0,n),t.F(n),o||Wt()),t.D&&(t.D(),t.D=void 0),512&t.i&&C((()=>Ft(t,!1))),t.i&=-517},Wt=()=>{var t;C((()=>ct(m,"appload",{detail:{namespace:"lmvz-components"}}))),(null==(t=g.T)?void 0:t.size)&&g.T.clear()},qt=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){a(t,o)}},Yt=t=>t.classList.add("hydrated"),Jt=(t,n,e,o)=>{const l=f(t);if(!l)return;const s=t,i=l.l.get(n),r=l.i,c=s;e=it(e,o.t[n][0],!!(64&o.i));const u=Number.isNaN(i)&&Number.isNaN(e);if(e!==i&&!u){if(l.l.set(n,e),o.U){const t=o.U[n];t&&t.map((t=>{try{const[[o,s]]=Object.entries(t);(128&r||1&s)&&(c?c[o](e,i,n):l.V.push((()=>{l.H[o](e,i,n)})))}catch(t){a(t,s)}}))}if(2&r){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(e,i,n)&&!(16&r))return;16&r||Ft(l,!1)}}},Zt=(t,n,e)=>{var o,l;const s=t.prototype;64&n.i&&1&e&&y.forEach((t=>{const n=s[t];Object.defineProperty(s,t,{value(...e){var o;const l=f(this),s=this;s?"function"==typeof n&&n.call(s,...e):null==(o=null==l?void 0:l.P)||o.then((n=>{const o=n[t];"function"==typeof o&&o.call(n,...e)}))}})}));{t.watchers&&!n.U&&(n.U=t.watchers),t.deserializers&&!n.W&&(n.W=t.deserializers),t.serializers&&!n.q&&(n.q=t.serializers);const e=Object.entries(null!=(o=n.t)?o:{});e.map((([t,[e]])=>{if(31&e||32&e){const{get:o,set:l}=i(s,t)||{};o&&(n.t[t][0]|=2048),l&&(n.t[t][0]|=4096),Object.defineProperty(s,t,{get(){return o?o.apply(this):(n=t,f(this).l.get(n));var n},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(o){const s=f(this);if(s){if(l)return void 0===(32&e?this[t]:s.$hostElement$[t])&&s.l.get(t)&&(o=s.l.get(t)),l.apply(this,[it(o,e,!!(64&n.i))]),void Jt(this,t,o=32&e?this[t]:s.$hostElement$[t],n);Jt(this,t,o,n)}}})}}));{const o=new Map;s.attributeChangedCallback=function(t,l,i){g.jmp((()=>{var r;const c=o.get(t),u=f(this);if(this.hasOwnProperty(c),s.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==i)return;if(null==c){const e=null==u?void 0:u.i;if(u&&e&&!(8&e)&&i!==l){const o=this,s=null==(r=n.U)?void 0:r[t];null==s||s.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&e||1&r)&&o[s].call(o,i,l,t)}))}return}const a=e.find((([t])=>t===c));a&&4&a[1][0]&&(i=null!==i&&"false"!==i);const d=Object.getOwnPropertyDescriptor(s,c);i==this[c]||d.get&&!d.set||(this[c]=i)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(l=n.U)?l:{}),...e.filter((([t,n])=>31&n[0])).map((([t,e])=>{var l;const s=e[1]||t;return o.set(s,t),512&e[0]&&(null==(l=n._)||l.push([t,s])),s}))]))}}return t},Gt=t=>{if(!m.document)return;const n=t["s-cr"]=m.document.createComment("");n["s-cn"]=!0,Rt(t,n,t.firstChild)},Kt=(t,n)=>{const e={i:n[0],p:n[1]};try{e.t=n[2],e.U=t.U,e.W=t.W,e.q=t.q,e._=[],(()=>{if(!m.document)return;const t=m.document.querySelectorAll(`[${p}]`);let n=0;for(;n<t.length;n++)P(t[n].getAttribute(p),t[n].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),!0)})();const o=t.prototype.connectedCallback,l=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,n)=>{const e={i:0,$hostElement$:t,o:n,l:new Map,Y:new Map};e.P=new Promise((t=>e.F=t)),t["s-p"]=[],t["s-rc"]=[];const o=e;t.__stencil__getHostRef=()=>o,512&n.i&&c(t,e)})(this,e)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!f(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&g.i)){const n=f(t);if(!n)return;const e=n.o,o=()=>{};if(1&n.i)(null==n?void 0:n.H)||(null==n?void 0:n.P)&&n.P.then((()=>{}));else{let o;if(n.i|=1,o=t.getAttribute($),o){if(1&e.i){const n=z(t.shadowRoot,e);t.classList.remove(n+"-h",n+"-s")}else if(2&e.i){const n=W(e);t["s-sc"]=n}((t,n,e,o)=>{var l,s,i,r;const c=t.shadowRoot,u=[],a=[],d=[],p=c?[]:null,h=J(n,null);let v;h.N=t;{const n=o.o;n&&10&n.i&&t["s-sc"]?(v=t["s-sc"],t.classList.add(v+"-h")):t["s-sc"]&&delete t["s-sc"]}!m.document||g.T&&g.T.size||K(m.document.body,g.T=new Map),t[$]=e,t.removeAttribute($),o.R=G(h,u,a,p,t,t,e,d);let y=0;const b=u.length;let w;for(;y<b;y++){w=u[y];const e=w.k+"."+w.M,o=g.T.get(e),s=w.N;if(c){if((null==(l=w.S)?void 0:l.toString().includes("-"))&&"slot-fb"!==w.S&&!w.N.shadowRoot){const t=f(w.N);if(t){const n=W(t.o),e=m.document.querySelector(`style[sty-id="${n}"]`);e&&p.unshift(e.cloneNode(!0))}}}else s["s-hn"]=n.toUpperCase(),"slot"===w.S&&(s["s-cr"]=t["s-cr"]);"slot"===w.S&&(w.O=w.N["s-sn"]||w.N.name||null,w.m?(w.i|=2,w.N.childNodes.length||w.m.forEach((t=>{w.N.appendChild(t.N)}))):w.i|=1),o&&o.isConnected&&(o.parentElement.shadowRoot&&""===o["s-en"]&&o.parentNode.insertBefore(s,o.nextSibling),o.parentNode.removeChild(o),c||(s["s-oo"]=parseInt(w.M))),o&&!o["s-id"]&&g.T.delete(e)}const j=[],O=d.length;let S,N,k,x,M=0,C=0;for(;M<O;M++)if(S=d[M],S&&S.length)for(k=S.length,N=0;N<k;N++){if(x=S[N],j[x.hostId]||(j[x.hostId]=g.T.get(x.hostId)),!j[x.hostId])continue;const t=j[x.hostId];t.shadowRoot&&x.node.parentElement!==t&&t.insertBefore(x.node,null==(i=null==(s=S[N-1])?void 0:s.node)?void 0:i.nextSibling),t.shadowRoot&&c||(x.slot["s-cr"]||(x.slot["s-cr"]=t["s-cr"],x.slot["s-cr"]=!x.slot["s-cr"]&&t.shadowRoot?t:(t.__childNodes||t.childNodes)[0]),F(x.node,x.slot,0,x.node["s-oo"]||C),(null==(r=x.node.parentElement)?void 0:r.shadowRoot)&&x.node.getAttribute&&x.node.getAttribute("slot")&&x.node.removeAttribute("slot")),C=(x.node["s-oo"]||C)+1}if(v&&a.length&&a.forEach((t=>{t.N.parentElement.classList.add(v+"-s")})),c&&!c.childNodes.length){let n=0;const e=p.length;if(e){for(;n<e;n++){const t=p[n];t&&c.appendChild(t)}Array.from(t.childNodes).forEach((t=>{"string"!=typeof t["s-en"]&&"string"!=typeof t["s-sn"]&&(1===t.nodeType&&t.slot&&t.hidden?t.removeAttribute("hidden"):8!==t.nodeType||t.nodeValue||t.parentNode.removeChild(t))}))}}o.$hostElement$=t})(t,e.p,o,n)}o||12&e.i&&Gt(t);{let e=t;for(;e=e.parentNode||e.host;)if(1===e.nodeType&&e.hasAttribute("s-id")&&e["s-p"]||e["s-p"]){Bt(n,n.B=e);break}}e.t&&Object.entries(e.t).map((([n,[e]])=>{if(31&e&&Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e)=>{let o;try{if(!(32&n.i)&&(n.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>n.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const n=W(e);if(!d.has(n)){const o=()=>{};P(n,t,!!(1&e.i)),o()}}const l=n.B,s=()=>Ft(n,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(e){a(e,t),n.D&&(n.D(),n.D=void 0),n.F&&n.F(t)}})(t,n,e)}o()}})(this),o&&o.call(this)},disconnectedCallback(){(async t=>{1&g.i||f(t),H.has(t)&&H.delete(t),t.shadowRoot&&H.has(t.shadowRoot)&&H.delete(t.shadowRoot)})(this),l&&l.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${e.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else L.call(this,e)}}),Object.defineProperty(t,"is",{value:e.p,configurable:!0}),Zt(t,e,3)}catch(n){return a(n),t}},Qt=t=>g.$=t,Xt=t=>Object.assign(g,t);function tn(t,n){Dt({o:{i:0,p:n.tagName},$hostElement$:n},t)}function nn(t){return t}export{t as B,b as H,Qt as a,Xt as b,rt as c,Z as d,A as g,Y as h,Kt as p,tn as r,I as s,nn as t}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-BaPwpeMs.js";import{a4 as e,Z as s,a0 as a,_ as r,a5 as o}from"./p-CdofjRtQ.js";const n=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends e{constructor(e){super(e?.message,e?.cause?{cause:e.cause}:void 0),e&&(Object.assign(this,e),Object.defineProperty(this,t,{value:e,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),i=t=>{const e={BaseEffectError:class extends n{_tag=t}};return e.BaseEffectError.prototype.name=t,e.BaseEffectError};i("URLCreationError");const c=(e,n)=>{const i=function(...t){return t.filter(Boolean).join("/").replace("//","/").replace("/./","/")}("../../assets",n,e);return s((()=>t(i))).pipe(a((()=>r(`Failed to create URL for asset "${e}" in path "${n}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration! Falling back to a relative URL, which may work in some environments but is not guaranteed to be correct.`))),o((()=>new URL(i,import.meta?.url??window?.location?.origin??""))))};export{i as T,c as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=function(t,e){if("function"==typeof t)return function(){return t(arguments)?e.apply(this,arguments):t=>e(t,...arguments)};switch(t){case 0:case 1:throw new RangeError(`Invalid arity ${t}`);case 2:return function(t,r){return arguments.length>=2?e(t,r):function(r){return e(r,t)}};case 3:return function(t,r,n){return arguments.length>=3?e(t,r,n):function(n){return e(n,t,r)}};case 4:return function(t,r,n,s){return arguments.length>=4?e(t,r,n,s):function(s){return e(s,t,r,n)}};case 5:return function(t,r,n,s,i){return arguments.length>=5?e(t,r,n,s,i):function(i){return e(i,t,r,n,s)}};default:return function(){if(arguments.length>=t)return e.apply(this,arguments);const r=arguments;return function(t){return e(t,...r)}}}},e=t=>t,r=t=>()=>t,n=r(!0),s=r(!1),i=r(void 0),o=i;function c(t,e,r,n,s,i,o,c,a){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return r(e(t));case 4:return n(r(e(t)));case 5:return s(n(r(e(t))));case 6:return i(s(n(r(e(t)))));case 7:return o(i(s(n(r(e(t))))));case 8:return c(o(i(s(n(r(e(t)))))));case 9:return a(c(o(i(s(n(r(e(t))))))));default:{let t=arguments[0];for(let e=1;e<arguments.length;e++)t=arguments[e](t);return t}}}const a=t=>(e,r)=>e===r||t(e,r),u=t(2,((t,e)=>a(((r,n)=>t(e(r),e(n)))))),h="effect/GlobalValue";let l;const f=(t,e)=>(l||(globalThis[h]??=new Map,l=globalThis[h]),l.has(t)||l.set(t,e()),l.get(t)),b=t=>"number"==typeof t,d=t=>"function"==typeof t,p=t=>(t=>"object"==typeof t&&null!==t)(t)||d(t),m=t(2,((t,e)=>p(t)&&e in t)),S=t(2,((t,e)=>m(t,"_tag")&&t._tag===e)),g=t=>null==t,y=t=>"string"==typeof t||m(t,Symbol.iterator),w=t=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;let _=class t{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new t(this.self)}};class v{_state;constructor(t,e,r,n){return g(e)&&g(t)?(e=4294967295*Math.random()>>>0,t=0):g(e)&&(e=t,t=0),g(n)&&g(r)?(n=this._state?this._state[3]:4150755663,r=this._state?this._state[2]:335903614):g(n)&&(n=r,r=0),this._state=new Int32Array([0,0,r>>>0,(1|(n||0))>>>0]),this._next(),O(this._state,this._state[0],this._state[1],t>>>0,e>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=1|t[3]}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){return(1*(67108863&this._next())*134217728+1*(134217727&this._next()))/9007199254740992}_next(){const t=this._state[0]>>>0,e=this._state[1]>>>0;!function(t,e,r,n,s){let i=32557*(r>>>16)>>>0,o=19605*(65535&r)>>>0,c=32557*(65535&r)>>>0,a=19605*(r>>>16)+((o>>>16)+(i>>>16))>>>0;o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0&&(a=a+1>>>0),i=i<<16>>>0,c=c+i>>>0,c>>>0<i>>>0&&(a=a+1>>>0),a=a+Math.imul(r,1481765933)>>>0,a=a+Math.imul(e,s)>>>0,t[0]=a,t[1]=c}(this._state,t,e,0,1284865837),O(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,n=(e>>>18|t<<14)>>>0;r=(r^t)>>>0,n=(n^e)>>>0;const s=(n>>>27|r<<5)>>>0,i=t>>>27;return(s>>>i|s<<((-i>>>0&31)>>>0))>>>0}}function O(t,e,r,n,s){let i=e+n>>>0;const o=r+s>>>0;o>>>0<r>>>0&&(i=i+1|0),t[0]=i,t[1]=o}const M=Symbol.for("effect/Utils/YieldWrap");class E{#t;constructor(t){this.#t=t}[M](){return this.#t}}function I(t){if("object"==typeof t&&null!==t&&M in t)return t[M]();throw new Error(w("yieldWrapGet"))}const k=f("effect/Utils/isStructuralRegion",(()=>({enabled:!1,tester:void 0}))),F={effect_internal_function:t=>t()},N=!0===F.effect_internal_function((()=>(new Error).stack))?.includes("effect_internal_function")?F.effect_internal_function:t=>{try{return t()}finally{}},C=f(Symbol.for("effect/Hash/randomHashCache"),(()=>new WeakMap)),j=Symbol.for("effect/Hash"),A=t=>{if(!0===k.enabled)return 0;switch(typeof t){case"number":return L(t);case"bigint":return D(t.toString(10));case"boolean":case"symbol":return D(String(t));case"string":return D(t);case"undefined":return D("undefined");case"function":case"object":return null===t?D("null"):t instanceof Date?Number.isNaN(t.getTime())?D("Invalid Date"):A(t.toISOString()):t instanceof URL?A(t.href):T(t)?t[j]():R(t);default:throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},R=t=>(C.has(t)||C.set(t,L(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),C.get(t)),x=t=>e=>53*e^t,$=t=>3221225471&t|t>>>1&1073741824,T=t=>m(t,j),L=t=>{if(t!=t||t===1/0)return 0;let e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return $(e)},D=t=>{let e=5381,r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return $(e)},P=t=>((t,e)=>{let r=12289;for(let n=0;n<e.length;n++)r^=c(D(e[n]),x(A(t[e[n]])));return $(r)})(t,Object.keys(t)),B=t=>{let e=6151;for(let r=0;r<t.length;r++)e=c(e,x(A(t[r])));return $(e)},q=function(){if(1===arguments.length){const t=arguments[0];return function(e){return Object.defineProperty(t,j,{value:()=>e,enumerable:!1}),e}}const t=arguments[1];return Object.defineProperty(arguments[0],j,{value:()=>t,enumerable:!1}),t},U=Symbol.for("effect/Equal");function J(){return 1===arguments.length?t=>G(t,arguments[0]):G(arguments[0],arguments[1])}function G(t,e){if(t===e)return!0;const r=typeof t;if(r!==typeof e)return!1;if("object"===r||"function"===r){if(null!==t&&null!==e){if(W(t)&&W(e))return!(A(t)!==A(e)||!t[U](e))||!(!k.enabled||!k.tester)&&k.tester(t,e);if(t instanceof Date&&e instanceof Date){const r=t.getTime(),n=e.getTime();return r===n||Number.isNaN(r)&&Number.isNaN(n)}if(t instanceof URL&&e instanceof URL)return t.href===e.href}if(k.enabled){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every(((t,r)=>G(t,e[r])));if(Object.getPrototypeOf(t)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(t),n=Object.keys(e);if(r.length===n.length){for(const n of r)if(!(n in e)||!G(t[n],e[n]))return!!k.tester&&k.tester(t,e);return!0}}return!!k.tester&&k.tester(t,e)}}return!(!k.enabled||!k.tester)&&k.tester(t,e)}const W=t=>m(t,U),V=()=>J,H=Symbol.for("nodejs.util.inspect.custom"),z=t=>{try{if(m(t,"toJSON")&&d(t.toJSON)&&0===t.toJSON.length)return t.toJSON();if(Array.isArray(t))return t.map(z)}catch{return{}}return et(t)},Y=t=>JSON.stringify(t,null,2),K=(t,e=2)=>{if("string"==typeof t)return t;try{return"object"==typeof t?Q(t,e):String(t)}catch{return String(t)}},Q=(t,e)=>{let r=[];const n=JSON.stringify(t,((t,e)=>"object"==typeof e&&null!==e?r.includes(e)?void 0:r.push(e)&&(void 0!==tt.fiberRefs&&X(e)?e[Z](tt.fiberRefs):e):e),e);return r=void 0,n},Z=Symbol.for("effect/Inspectable/Redactable"),X=t=>"object"==typeof t&&null!==t&&Z in t,tt=f("effect/Inspectable/redactableState",(()=>({fiberRefs:void 0}))),et=t=>X(t)&&void 0!==tt.fiberRefs?t[Z](tt.fiberRefs):t,rt=(t,e)=>{switch(e.length){case 0:return t;case 1:return e[0](t);case 2:return e[1](e[0](t));case 3:return e[2](e[1](e[0](t)));case 4:return e[3](e[2](e[1](e[0](t))));case 5:return e[4](e[3](e[2](e[1](e[0](t)))));case 6:return e[5](e[4](e[3](e[2](e[1](e[0](t))))));case 7:return e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))));case 8:return e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t))))))));case 9:return e[8](e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))))));default:{let r=t;for(let t=0,n=e.length;t<n;t++)r=e[t](r);return r}}},nt="Async",st="Commit",it="Failure",ot="OnFailure",ct="OnSuccess",at="OnSuccessAndFailure",ut="Success",ht="Sync",lt="Tag",ft="UpdateRuntimeFlags",bt="While",dt="Iterator",pt="WithRuntime",mt="Yield",St="RevertFlags",gt=()=>"3.19.14",yt=Symbol.for("effect/Effect"),wt=Symbol.for("effect/Stream"),_t=Symbol.for("effect/Sink"),vt=Symbol.for("effect/Channel"),Ot={_R:t=>t,_E:t=>t,_A:t=>t,_V:gt()},Mt={[yt]:Ot,[wt]:Ot,[_t]:{_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t},[vt]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},[U](t){return this===t},[j](){return q(this,R(this))},[Symbol.iterator](){return new _(new E(this))},pipe(){return rt(this,arguments)}},Et={[j](){return q(this,P(this))},[U](t){const e=Object.keys(this),r=Object.keys(t);if(e.length!==r.length)return!1;for(const r of e)if(!(r in t)||!J(this[r],t[r]))return!1;return!0}},It={...Mt,_op:st},kt={...It,...Et},Ft=function(){function t(){}return t.prototype=It,t}(),Nt=Symbol.for("effect/Option"),Ct={...Mt,[Nt]:{_A:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},jt=Object.assign(Object.create(Ct),{_tag:"Some",_op:"Some",[U](t){return xt(t)&&Tt(t)&&J(this.value,t.value)},[j](){return q(this,x(A(this._tag))(A(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:z(this.value)}}}),At=A("None"),Rt=Object.assign(Object.create(Ct),{_tag:"None",_op:"None",[U]:t=>xt(t)&&$t(t),[j]:()=>At,toJSON(){return{_id:"Option",_tag:this._tag}}}),xt=t=>m(t,Nt),$t=t=>"None"===t._tag,Tt=t=>"Some"===t._tag,Lt=Object.create(Rt),Dt=t=>{const e=Object.create(jt);return e.value=t,e},Pt=Symbol.for("effect/Either"),Bt={...Mt,[Pt]:{_R:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},qt=Object.assign(Object.create(Bt),{_tag:"Right",_op:"Right",[U](t){return Jt(t)&&Wt(t)&&J(this.right,t.right)},[j](){return x(A(this._tag))(A(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:z(this.right)}}}),Ut=Object.assign(Object.create(Bt),{_tag:"Left",_op:"Left",[U](t){return Jt(t)&&Gt(t)&&J(this.left,t.left)},[j](){return x(A(this._tag))(A(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:z(this.left)}}}),Jt=t=>m(t,Pt),Gt=t=>"Left"===t._tag,Wt=t=>"Right"===t._tag,Vt=t=>{const e=Object.create(qt);return e.right=t,e},Ht=t=>{const e=Object.create(Ut);return e.left=t,e},zt=Gt,Yt=Wt,Kt=t(2,((t,{onLeft:e,onRight:r})=>zt(t)?e(t.left):r(t.right))),Qt=Kt({onLeft:e,onRight:e}),Zt=t(2,((t,e)=>{if(Yt(t))return t.right;throw e(t.left)})),Xt=t=>t.length>0,te=t=>(e,r)=>e===r?0:t(e,r),ee=te(((t,e)=>t<e?-1:1)),re=t(2,((t,e)=>te(((r,n)=>t(e(r),e(n)))))),ne=e=>t(2,((t,r)=>1===e(t,r))),se=()=>Lt,ie=Dt,oe=$t,ce=Tt,ae=t(2,((t,{onNone:e,onSome:r})=>oe(t)?e():r(t.value))),ue=t=>Gt(t)?Lt:Dt(t.right),he=t(2,((t,e)=>oe(t)?e():t.value)),le=t(2,((t,e)=>oe(t)?ie(e()):t)),fe=t=>null==t?se():ie(t),be=he(i),de=t(2,((t,e)=>{if(ce(t))return t.value;throw e()}))((()=>new Error("getOrThrow called on a None"))),pe=t(2,((t,e)=>oe(t)?se():ie(e(t.value)))),me=t(2,((t,e)=>oe(t)?se():e(t.value))),Se=(e=>t(2,((t,r)=>!oe(t)&&e(t.value,r))))(V()),ge=t=>(e,r)=>oe(e)?r:oe(r)?e:ie(t(e.value,r.value)),ye=(...t)=>t,we=t=>new Array(t),_e=t(2,((t,e)=>{const r=Math.max(1,Math.floor(t)),n=new Array(r);for(let t=0;t<r;t++)n[t]=e(t);return n})),ve=t=>Array.isArray(t)?t:Array.from(t),Oe=t(2,((t,e)=>[e,...t])),Me=t(2,((t,e)=>[...t,e])),Ee=t(2,((t,e)=>ve(t).concat(ve(e)))),Ie=Xt,ke=Xt,Fe=(t,e)=>t<0||t>=e.length,Ne=t(2,((t,e)=>{const r=Math.floor(e);return Fe(r,t)?se():ie(t[r])})),Ce=t(2,((t,e)=>{const r=Math.floor(e);if(Fe(r,t))throw new Error(`Index ${r} out of bounds`);return t[r]})),je=Ne(0),Ae=Ce(0),Re=t=>t[t.length-1],xe=t=>t.slice(1),$e=t(2,((t,e)=>Ue(t,((t,e)=>{let r=0;for(const n of t){if(!e(n,r))break;r++}return r})(t,e)))),Te=t(2,((t,e)=>{const r=ve(t);return r.slice(((t,e)=>Math.floor(Math.min(Math.max(0,t),e.length)))(e,r),r.length)})),Le=t=>Array.from(t).reverse(),De=t(2,((t,e)=>{const r=Array.from(t);return r.sort(e),r})),Pe=t(2,((t,e)=>Be(t,e,ye))),Be=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);if(ke(n)&&ke(s)){const t=[r(Ae(n),Ae(s))],e=Math.min(n.length,s.length);for(let i=1;i<e;i++)t[i]=r(n[i],s[i]);return t}return[]})),qe=V(),Ue=t(2,((t,e)=>{const r=Array.from(t),n=Math.floor(e);return ke(r)?n>=1?Je(r,n):[[],r]:[r,[]]})),Je=t(2,((t,e)=>{const r=Math.max(1,Math.floor(e));return r>=t.length?[Ge(t),[]]:[Oe(t.slice(1,r),Ae(t)),t.slice(r)]})),Ge=t=>t.slice(),We=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);return ke(n)?ke(s)?rr(r)(Ee(n,s)):n:s})),Ve=t(2,((t,e)=>We(t,e,qe))),He=()=>[],ze=t=>[t],Ye=t(2,((t,e)=>t.map(e))),Ke=t(2,((t,e)=>{if((t=>0===t.length)(t))return[];const r=[];for(let n=0;n<t.length;n++){const s=e(t[n],n);for(let t=0;t<s.length;t++)r.push(s[t])}return r}))(e),Qe=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++){const s=e(r[t],t);ce(s)&&n.push(s.value)}return n})),Ze=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++)e(r[t],t)&&n.push(r[t]);return n})),Xe=t(3,((t,e,r)=>ve(t).reduce(((t,e,n)=>r(t,e,n)),e))),tr=(t,e)=>{const r=[];let n,s=t;for(;ce(n=e(s));){const[t,e]=n.value;r.push(t),s=e}return r},er=t=>a(((e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0})),rr=t(2,((t,e)=>{const r=ve(t);if(ke(r)){const t=[Ae(r)],n=xe(r);for(const r of n)t.every((t=>!e(r,t)))&&t.push(r);return t}return[]})),nr=t=>rr(t,V()),sr=t(2,((t,e)=>ve(t).join(e))),ir=ee,or=Symbol.for("effect/Context/Tag"),cr=Symbol.for("effect/Context/Reference"),ar=Symbol.for("effect/STM"),ur={...Mt,_op:"Tag",[ar]:Ot,[or]:{_Service:t=>t,_Identifier:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[H](){return this.toJSON()},of:t=>t,context(t){return mr(this,t)}},hr={...ur,[cr]:cr},lr=Symbol.for("effect/Context"),fr={[lr]:{_Services:t=>t},[U](t){if(dr(t)&&this.unsafeMap.size===t.unsafeMap.size){for(const e of this.unsafeMap.keys())if(!t.unsafeMap.has(e)||!J(this.unsafeMap.get(e),t.unsafeMap.get(e)))return!1;return!0}return!1},[j](){return q(this,L(this.unsafeMap.size))},pipe(){return rt(this,arguments)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(z)}},[H](){return this.toJSON()}},br=t=>{const e=Object.create(fr);return e.unsafeMap=t,e},dr=t=>m(t,lr),pr=br(new Map),mr=(t,e)=>br(new Map([[t.key,e]])),Sr=t(3,((t,e,r)=>{const n=new Map(t.unsafeMap);return n.set(e.key,r),br(n)})),gr=f("effect/Context/defaultValueCache",(()=>new Map)),yr=t=>{if(gr.has(t.key))return gr.get(t.key);const e=t.defaultValue();return gr.set(t.key,e),e},wr=t(2,((t,e)=>{if(!t.unsafeMap.has(e.key)){if(cr in e)return yr(e);throw(t=>{const e=new Error("Service not found"+(t.key?`: ${String(t.key)}`:""));if(t.stack){const r=t.stack.split("\n");if(r.length>2){const t=r[2].match(/at (.*)/);t&&(e.message=e.message+` (defined at ${t[1]})`)}}if(e.stack){const t=e.stack.split("\n");t.splice(1,3),e.stack=t.join("\n")}return e})(e)}return t.unsafeMap.get(e.key)})),_r=wr,vr=t(2,((t,e)=>t.unsafeMap.has(e.key)?Dt(t.unsafeMap.get(e.key)):m(e,cr)?Dt(yr(e)):Lt)),Or=t(2,((t,e)=>{const r=new Map(t.unsafeMap);for(const[t,n]of e.unsafeMap)r.set(t,n);return br(r)})),Mr=t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=e;const n=Object.create(ur);return Object.defineProperty(n,"stack",{get:()=>r.stack}),n.key=t,n},Er=dr,Ir=()=>pr,kr=mr,Fr=Sr,Nr=_r,Cr=wr,jr=vr,Ar=Or,Rr=()=>(t,e)=>{const r=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;function s(){}return Error.stackTraceLimit=r,Object.setPrototypeOf(s,hr),s.key=t,s.defaultValue=e.defaultValue,Object.defineProperty(s,"stack",{get:()=>n.stack}),s},xr=Symbol.for("effect/Chunk"),$r=[],Tr=(t=>a(((e,r)=>e.length===r.length&&Vr(e).every(((e,n)=>t(e,Qr(r,n)))))))(J),Lr={[xr]:{_A:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Chunk",values:Vr(this).map(z)}},[H](){return this.toJSON()},[U](t){return Pr(t)&&Tr(this,t)},[j](){return q(this,B(Vr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return $r[Symbol.iterator]();default:return Vr(this)[Symbol.iterator]()}},pipe(){return rt(this,arguments)}},Dr=t=>{const e=Object.create(Lr);switch(e.backing=t,t._tag){case"IEmpty":e.length=0,e.depth=0,e.left=e,e.right=e;break;case"IConcat":e.length=t.left.length+t.right.length,e.depth=1+Math.max(t.left.depth,t.right.depth),e.left=t.left,e.right=t.right;break;case"IArray":e.length=t.array.length,e.depth=0,e.left=Br,e.right=Br;break;case"ISingleton":e.length=1,e.depth=0,e.left=Br,e.right=Br;break;case"ISlice":e.length=t.length,e.depth=t.chunk.depth+1,e.left=Br,e.right=Br}return e},Pr=t=>m(t,xr),Br=Dr({_tag:"IEmpty"}),qr=()=>Br,Ur=(...t)=>Kr(t),Jr=t=>Dr({_tag:"ISingleton",a:t}),Gr=t=>Pr(t)?t:Yr(ve(t)),Wr=(t,e,r)=>{switch(t.backing._tag){case"IArray":!function(t,e,r,n,s){for(let e=0;e<Math.min(t.length,0+s);e++)r[n+e-0]=t[e]}(t.backing.array,0,e,r,t.length);break;case"IConcat":Wr(t.left,e,r),Wr(t.right,e,r+t.left.length);break;case"ISingleton":e[r]=t.backing.a;break;case"ISlice":{let n=0,s=r;for(;n<t.length;)e[s]=Qr(t,n),n+=1,s+=1;break}}},Vr=t=>{switch(t.backing._tag){case"IEmpty":return $r;case"IArray":return t.backing.array;default:{const e=new Array(t.length);return Wr(t,e,0),t.backing={_tag:"IArray",array:e},t.left=Br,t.right=Br,t.depth=0,e}}},Hr=t=>{switch(t.backing._tag){case"IEmpty":case"ISingleton":return t;case"IArray":return Dr({_tag:"IArray",array:Le(t.backing.array)});case"IConcat":return Dr({_tag:"IConcat",left:Hr(t.backing.right),right:Hr(t.backing.left)});case"ISlice":return Yr(Le(Vr(t)))}},zr=t(2,((t,e)=>e<0||e>=t.length?se():ie(Qr(t,e)))),Yr=t=>0===t.length?qr():1===t.length?Jr(t[0]):Dr({_tag:"IArray",array:t}),Kr=t=>Yr(t),Qr=t(2,((t,e)=>{switch(t.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":if(0!==e)throw new Error("Index out of bounds");return t.backing.a;case"IArray":if(e>=t.length||e<0)throw new Error("Index out of bounds");return t.backing.array[e];case"IConcat":return e<t.left.length?Qr(t.left,e):Qr(t.right,e-t.left.length);case"ISlice":return Qr(t.backing.chunk,e+t.backing.offset)}})),Zr=t(2,((t,e)=>rn(t,Jr(e)))),Xr=t(2,((t,e)=>rn(Jr(e),t))),tn=t(2,((t,e)=>{if(e<=0)return Br;if(e>=t.length)return t;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,length:e,offset:t.backing.offset});case"IConcat":return e>t.left.length?Dr({_tag:"IConcat",left:t.left,right:tn(t.right,e-t.left.length)}):tn(t.left,e);default:return Dr({_tag:"ISlice",chunk:t,offset:0,length:e})}})),en=t(2,((t,e)=>{if(e<=0)return t;if(e>=t.length)return Br;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,offset:t.backing.offset+e,length:t.backing.length-e});case"IConcat":return e>t.left.length?en(t.right,e-t.left.length):Dr({_tag:"IConcat",left:en(t.left,e),right:t.right});default:return Dr({_tag:"ISlice",chunk:t,offset:e,length:t.length-e})}})),rn=t(2,((t,e)=>{if("IEmpty"===t.backing._tag)return e;if("IEmpty"===e.backing._tag)return t;const r=e.depth-t.depth;if(Math.abs(r)<=1)return Dr({_tag:"IConcat",left:t,right:e});if(r<-1){if(t.left.depth>=t.right.depth){const r=rn(t.right,e);return Dr({_tag:"IConcat",left:t.left,right:r})}{const r=rn(t.right.right,e);if(r.depth===t.depth-3){const e=Dr({_tag:"IConcat",left:t.right.left,right:r});return Dr({_tag:"IConcat",left:t.left,right:e})}{const e=Dr({_tag:"IConcat",left:t.left,right:t.right.left});return Dr({_tag:"IConcat",left:e,right:r})}}}if(e.right.depth>=e.left.depth){const r=rn(t,e.left);return Dr({_tag:"IConcat",left:r,right:e.right})}{const r=rn(t,e.left.left);if(r.depth===e.depth-3){const t=Dr({_tag:"IConcat",left:r,right:e.left.right});return Dr({_tag:"IConcat",left:t,right:e.right})}{const t=Dr({_tag:"IConcat",left:e.left.right,right:e.right});return Dr({_tag:"IConcat",left:r,right:t})}}})),nn=t(2,((t,e)=>Yr(Qe(t,e)))),sn=t(2,((t,e)=>Yr(Ze(t,e)))),on=t=>0===t.length,cn=t=>t.length>0,an=zr(0),un=t=>Qr(t,0),hn=un,ln=t(2,((t,e)=>"ISingleton"===t.backing._tag?Jr(e(t.backing.a,0)):Yr(c(Vr(t),Ye(((t,r)=>e(t,r))))))),fn=t(2,((t,e)=>[tn(t,e),en(t,e)])),bn=t(2,((t,e)=>{let r=0;for(const n of Vr(t)){if(e(n))break;r++}return fn(t,r)})),dn=t=>en(t,1),pn=Xe,mn=Symbol.for("effect/Duration"),Sn=BigInt(0),gn=BigInt(24),yn=BigInt(60),wn=BigInt(1e3),_n=BigInt(1e6),vn=BigInt(1e9),On=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Mn=t=>{if(Nn(t))return t;if(b(t))return xn(t);if((t=>"bigint"==typeof t)(t))return An(t);if(Array.isArray(t)&&2===t.length&&t.every(b))return t[0]===-1/0||t[1]===-1/0||Number.isNaN(t[0])||Number.isNaN(t[1])?Cn:t[0]===1/0||t[1]===1/0?jn:An(BigInt(Math.round(1e9*t[0]))+BigInt(Math.round(t[1])));if((t=>"string"==typeof t)(t)){const e=On.exec(t);if(e){const[t,r,n]=e,s=Number(r);switch(n){case"nano":case"nanos":return An(BigInt(r));case"micro":case"micros":return Rn(BigInt(r));case"milli":case"millis":return xn(s);case"second":case"seconds":return $n(s);case"minute":case"minutes":return Tn(s);case"hour":case"hours":return Ln(s);case"day":case"days":return Dn(s);case"week":case"weeks":return Pn(s)}}}throw new Error("Invalid DurationInput")},En={_tag:"Millis",millis:0},In={_tag:"Infinity"},kn={[mn]:mn,[j](){return q(this,P(this.value))},[U](t){return Nn(t)&&Vn(this,t)},toString(){return`Duration(${Hn(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:qn(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Fn=t=>{const e=Object.create(kn);return e.value=b(t)?isNaN(t)||t<=0?En:Number.isFinite(t)?Number.isInteger(t)?{_tag:"Millis",millis:t}:{_tag:"Nanos",nanos:BigInt(Math.round(1e6*t))}:In:t<=Sn?En:{_tag:"Nanos",nanos:t},e},Nn=t=>m(t,mn),Cn=Fn(0),jn=Fn(1/0),An=t=>Fn(t),Rn=t=>Fn(t*wn),xn=t=>Fn(t),$n=t=>Fn(1e3*t),Tn=t=>Fn(6e4*t),Ln=t=>Fn(36e5*t),Dn=t=>Fn(864e5*t),Pn=t=>Fn(6048e5*t),Bn=t=>Un(t,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),qn=t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(e.value.nanos/vn),Number(e.value.nanos%vn)];case"Millis":return[Math.floor(e.value.millis/1e3),Math.round(e.value.millis%1e3*1e6)]}},Un=t(2,((t,e)=>{const r=Mn(t);switch(r.value._tag){case"Nanos":return e.onNanos(r.value.nanos);case"Infinity":return e.onMillis(1/0);case"Millis":return e.onMillis(r.value.millis)}})),Jn=t(3,((t,e,r)=>{const n=Mn(t),s=Mn(e);if("Infinity"===n.value._tag||"Infinity"===s.value._tag)return r.onMillis(Bn(n),Bn(s));if("Nanos"===n.value._tag||"Nanos"===s.value._tag){const t="Nanos"===n.value._tag?n.value.nanos:BigInt(Math.round(1e6*n.value.millis)),e="Nanos"===s.value._tag?s.value.nanos:BigInt(Math.round(1e6*s.value.millis));return r.onNanos(t,e)}return r.onMillis(n.value.millis,s.value.millis)})),Gn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t<=e,onNanos:(t,e)=>t<=e}))),Wn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t>=e,onNanos:(t,e)=>t>=e}))),Vn=t(2,((t,e)=>((t,e)=>Jn(t,e,{onMillis:(t,e)=>t===e,onNanos:(t,e)=>t===e}))(Mn(t),Mn(e)))),Hn=t=>{const e=Mn(t);if("Infinity"===e.value._tag)return"Infinity";if((t=>{switch(t.value._tag){case"Millis":return 0===t.value.millis;case"Nanos":return t.value.nanos===Sn;case"Infinity":return!1}})(e))return"0";const r=(t=>{const e=Mn(t);if("Infinity"===e.value._tag)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const r=(t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(1e6*e.value.millis))}})(e),n=r/_n,s=n/wn,i=s/yn,o=i/yn;return{days:Number(o/gn),hours:Number(o%gn),minutes:Number(i%yn),seconds:Number(s%yn),millis:Number(n%wn),nanos:Number(r%_n)}})(e),n=[];return 0!==r.days&&n.push(`${r.days}d`),0!==r.hours&&n.push(`${r.hours}h`),0!==r.minutes&&n.push(`${r.minutes}m`),0!==r.seconds&&n.push(`${r.seconds}s`),0!==r.millis&&n.push(`${r.millis}ms`),0!==r.nanos&&n.push(`${r.nanos}ns`),n.join(" ")},zn=Math.pow(2,5),Yn=zn-1,Kn=zn/2,Qn=zn/4;function Zn(t,e){return e>>>t&Yn}function Xn(t){return 1<<t}function ts(t,e){return r=t&e-1,r=(r=(858993459&(r-=r>>1&1431655765))+(r>>2&858993459))+(r>>4)&252645135,127&(r+=r>>8)+(r>>16);var r}function es(t,e,r,n){let s=n;if(!t){const t=n.length;s=new Array(t);for(let e=0;e<t;++e)s[e]=n[e]}return s[e]=r,s}function rs(t,e,r){const n=r.length-1;let s=0,i=0,o=r;if(t)s=i=e;else for(o=new Array(n);s<e;)o[i++]=r[s++];for(++s;s<=n;)o[i++]=r[s++];return t&&(o.length=n),o}class ns{_tag="EmptyNode";modify(t,e,r,n,s,i){const o=r(se());return oe(o)?new ns:(++i.value,new os(t,n,s,o))}}function ss(t){return S(t,"EmptyNode")}function is(t,e){return!ss(t)&&e===t.edit}class os{edit;hash;key;value;_tag="LeafNode";constructor(t,e,r,n){this.edit=t,this.hash=e,this.key=r,this.value=n}modify(t,e,r,n,s,i){if(J(s,this.key)){const e=r(this.value);return e===this.value?this:oe(e)?(--i.value,new ns):is(this,t)?(this.value=e,this):new os(t,n,s,e)}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}}class cs{edit;hash;children;_tag="CollisionNode";constructor(t,e,r){this.edit=t,this.hash=e,this.children=r}modify(t,e,r,n,s,i){if(n===this.hash){const e=is(this,t),n=this.updateCollisionList(e,t,this.hash,this.children,r,s,i);return n===this.children?this:n.length>1?new cs(t,this.hash,n):n[0]}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}updateCollisionList(t,e,r,n,s,i,o){const c=n.length;for(let a=0;a<c;++a){const c=n[a];if("key"in c&&J(i,c.key)){const u=c.value,h=s(u);return h===u?n:oe(h)?(--o.value,rs(t,a,n)):es(t,a,new os(e,r,i,h),n)}}const a=s(se());return oe(a)?n:(++o.value,es(t,c,new os(e,r,i,a),n))}}class as{edit;mask;children;_tag="IndexedNode";constructor(t,e,r){this.edit=t,this.mask=e,this.children=r}modify(t,e,r,n,s,i){const o=this.mask,c=this.children,a=Zn(e,n),u=Xn(a),h=ts(o,u),l=o&u,f=is(this,t);if(!l){const l=(new ns).modify(t,e+5,r,n,s,i);return l?c.length>=Kn?function(t,e,r,n,s){const i=[];let o=n,c=0;for(let t=0;o;++t)1&o&&(i[t]=s[c++]),o>>>=1;return i[e]=r,new us(t,c+1,i)}(t,a,l,o,c):new as(t,o|u,function(t,e,r,n){const s=n.length;if(t){let t=s;for(;t>=e;)n[t--]=n[t];return n[e]=r,n}let i=0,o=0;const c=new Array(s+1);for(;i<e;)c[o++]=n[i++];for(c[e]=r;i<s;)c[++o]=n[i++];return c}(f,h,l,c)):this}const b=c[h],d=b.modify(t,e+5,r,n,s,i);if(b===d)return this;let p,m=o;if(ss(d)){if(m&=~u,!m)return new ns;if(c.length<=2&&(ss(S=c[1^h])||"LeafNode"===S._tag||"CollisionNode"===S._tag))return c[1^h];p=rs(f,h,c)}else p=es(f,h,d,c);var S;return f?(this.mask=m,this.children=p,this):new as(t,m,p)}}class us{edit;size;children;_tag="ArrayNode";constructor(t,e,r){this.edit=t,this.size=e,this.children=r}modify(t,e,r,n,s,i){let o=this.size;const c=this.children,a=Zn(e,n),u=c[a],h=(u||new ns).modify(t,e+5,r,n,s,i);if(u===h)return this;const l=is(this,t);let f;if(ss(u)&&!ss(h))++o,f=es(l,a,h,c);else if(!ss(u)&&ss(h)){if(--o,o<=Qn)return function(t,e,r,n){const s=new Array(e-1);let i=0,o=0;for(let t=0,e=n.length;t<e;++t)if(t!==r){const e=n[t];e&&!ss(e)&&(s[i++]=e,o|=1<<t)}return new as(t,o,s)}(t,o,a,c);f=es(l,a,new ns,c)}else f=es(l,a,h,c);return l?(this.size=o,this.children=f,this):new us(t,o,f)}}function hs(t,e,r,n,s,i){if(r===s)return new cs(t,r,[i,n]);const o=Zn(e,r),c=Zn(e,s);if(o===c)return e=>new as(t,Xn(o)|Xn(c),[e]);{const e=o<c?[n,i]:[i,n];return new as(t,Xn(o)|Xn(c),e)}}function ls(t,e,r,n,s,i){let o,c=e;for(;;){const e=hs(t,c,r,n,s,i);if("function"!=typeof e){let t=e;for(;null!=o;)t=o.value(t),o=o.previous;return t}o={value:e,previous:o},c+=5}}const fs="effect/HashMap",bs=Symbol.for(fs),ds={[bs]:bs,[Symbol.iterator](){return new ms(this,((t,e)=>[t,e]))},[j](){let t=A(fs);for(const e of this)t^=c(A(e[0]),x(A(e[1])));return q(this,t)},[U](t){if(vs(t)){if(t._size!==this._size)return!1;for(const e of this){const r=c(t,Ms(e[0],A(e[0])));if(oe(r))return!1;if(!J(e[1],r.value))return!1}return!0}return!1},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},ps=(t,e,r,n)=>{const s=Object.create(ds);return s._editable=t,s._edit=e,s._root=r,s._size=n,s};class ms{map;f;v;constructor(t,e){this.map=t,this.f=e,this.v=gs(this.map._root,this.f,void 0)}next(){if(oe(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Ss(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new ms(this.map,this.f)}}const Ss=t=>t?ys(t[0],t[1],t[2],t[3],t[4]):se(),gs=(t,e,r)=>{switch(t._tag){case"LeafNode":return ce(t.value)?ie({value:e(t.key,t.value.value),cont:r}):Ss(r);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const n=t.children;return ys(n.length,n,0,e,r)}default:return Ss(r)}},ys=(t,e,r,n,s)=>{for(;r<t;){const i=e[r++];if(i&&!ss(i))return gs(i,n,[t,e,r,n,s])}return Ss(s)},ws=ps(!1,0,new ns,0),_s=()=>ws,vs=t=>m(t,bs),Os=t(2,((t,e)=>Ms(t,e,A(e)))),Ms=t(3,((t,e,r)=>{let n=t._root,s=0;for(;;)switch(n._tag){case"LeafNode":return J(e,n.key)?n.value:se();case"CollisionNode":if(r===n.hash){const t=n.children;for(let r=0,n=t.length;r<n;++r){const n=t[r];if("key"in n&&J(e,n.key))return n.value}}return se();case"IndexedNode":{const t=Xn(Zn(s,r));if(n.mask&t){n=n.children[ts(n.mask,t)],s+=5;break}return se()}case"ArrayNode":if(n=n.children[Zn(s,r)],n){s+=5;break}return se();default:return se()}})),Es=t(2,((t,e)=>ce(Ms(t,e,A(e))))),Is=t(3,((t,e,r)=>js(t,e,(()=>ie(r))))),ks=t(3,((t,e,r)=>t._editable?(t._root=e,t._size=r,t):e===t._root?t:ps(t._editable,t._edit,e,r))),Fs=t=>new ms(t,(t=>t)),Ns=t=>t._size,Cs=t=>ps(!0,t._edit+1,t._root,t._size),js=t(3,((t,e,r)=>As(t,e,A(e),r))),As=t(4,((t,e,r,n)=>{const s={value:t._size},i=t._root.modify(t._editable?t._edit:NaN,0,n,r,e,s);return c(t,ks(i,s.value))})),Rs=t(2,((t,e)=>js(t,e,se))),xs=t(2,((t,e)=>Ts(t,_s(),((t,r,n)=>Is(t,n,e(r,n)))))),$s=t(2,((t,e)=>Ts(t,void 0,((t,r,n)=>e(r,n))))),Ts=t(3,((t,e,r)=>{const n=t._root;if("LeafNode"===n._tag)return ce(n.value)?r(e,n.value.value,n.key):e;if("EmptyNode"===n._tag)return e;const s=[n.children];let i;for(;i=s.pop();)for(let t=0,n=i.length;t<n;){const n=i[t++];n&&!ss(n)&&("LeafNode"===n._tag?ce(n.value)&&(e=r(e,n.value.value,n.key)):s.push(n.children))}return e})),Ls="effect/HashSet",Ds=Symbol.for(Ls),Ps={[Ds]:Ds,[Symbol.iterator](){return Fs(this._keyMap)},[j](){return q(this,x(A(this._keyMap))(A(Ls)))},[U](t){return!!qs(t)&&Ns(this._keyMap)===Ns(t._keyMap)&&J(this._keyMap,t._keyMap)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Bs=t=>{const e=Object.create(Ps);return e._keyMap=t,e},qs=t=>m(t,Ds),Us=Bs(_s()),Js=()=>Us,Gs=t(2,((t,e)=>Es(t._keyMap,e))),Ws=t=>Bs(Cs(t._keyMap)),Vs=t=>(t._keyMap._editable=!1,t),Hs=t(2,((t,e)=>{const r=Ws(t);return e(r),Vs(r)})),zs=t(2,((t,e)=>t._keyMap._editable?(Is(e,!0)(t._keyMap),t):Bs(Is(e,!0)(t._keyMap)))),Ys=t(2,((t,e)=>t._keyMap._editable?(Rs(e)(t._keyMap),t):Bs(Rs(e)(t._keyMap)))),Ks=t(2,((t,e)=>Hs(t,(t=>{for(const r of e)Ys(t,r)})))),Qs=t(2,((t,e)=>Hs(Js(),(r=>{Zs(t,(t=>zs(r,t)));for(const t of e)zs(r,t)})))),Zs=t(2,((t,e)=>$s(t._keyMap,((t,r)=>e(r))))),Xs=t(3,((t,e,r)=>Ts(t._keyMap,e,((t,e,n)=>r(t,n))))),ti=Js,ei=(...t)=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)},ri=Gs,ni=t=>Ns(t._keyMap),si=zs,ii=Ys,oi=Ks,ci=Qs,ai=Xs,ui=Symbol.for("effect/MutableRef"),hi={[ui]:ui,toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableRef",current:z(this.current)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},li=t=>{const e=Object.create(hi);return e.current=t,e},fi=t(3,((t,e,r)=>!!J(e,t.current)&&(t.current=r,!0))),bi=t=>t.current,di=t(2,((t,e)=>(t.current=e,t))),pi="effect/FiberId",mi=Symbol.for(pi),Si="None",gi="Runtime",yi="Composite",wi=D(`${pi}-${Si}`);let _i=class{[mi]=mi;_tag=Si;id=-1;startTimeMillis=-1;[j](){return wi}[U](t){return Ei(t)&&t._tag===Si}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[H](){return this.toJSON()}};class vi{id;startTimeMillis;[mi]=mi;_tag=gi;constructor(t,e){this.id=t,this.startTimeMillis=e}[j](){return q(this,D(`${pi}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[U](t){return Ei(t)&&t._tag===gi&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[H](){return this.toJSON()}}class Oi{left;right;[mi]=mi;_tag=yi;constructor(t,e){this.left=t,this.right=e}_hash;[j](){return c(D(`${pi}-${this._tag}`),x(A(this.left)),x(A(this.right)),q(this))}[U](t){return Ei(t)&&t._tag===yi&&J(this.left,t.left)&&J(this.right,t.right)}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:z(this.left),right:z(this.right)}}[H](){return this.toJSON()}}const Mi=new _i,Ei=t=>m(t,mi),Ii=t(2,((t,e)=>t._tag===Si?e:e._tag===Si?t:new Oi(t,e))),ki=t=>{switch(t._tag){case Si:return ti();case gi:return ei(t.id);case yi:return c(ki(t.left),ci(ki(t.right)))}},Fi=f(Symbol.for("effect/Fiber/Id/_fiberCounter"),(()=>li(0))),Ni=t=>Array.from(ki(t)).map((t=>`#${t}`)).join(","),Ci=Mi,ji=Ii,Ai=t=>c(t,ai(Mi,((t,e)=>Ii(e)(t)))),Ri=Ni,xi=()=>{const t=bi(Fi);return c(Fi,di(t+1)),new vi(t,Date.now())},$i=_s,Ti=Os,Li=Is,Di=Fs,Pi=js,Bi=xs,qi=Ts,Ui=Symbol.for("effect/List"),Ji=t=>ve(t),Gi=(()=>u(er(J),Ji))(),Wi={[Ui]:Ui,_tag:"Cons",toString(){return Y(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:Ji(this).map(z)}},[H](){return this.toJSON()},[U](t){return Ki(t)&&this._tag===t._tag&&Gi(this,t)},[j](){return q(this,B(Ji(this)))},[Symbol.iterator](){let t=!1,e=this;return{next(){if(t)return this.return();if("Nil"===e._tag)return t=!0,this.return();const r=e.head;return e=e.tail,{done:t,value:r}},return:e=>(t||(t=!0),{done:!0,value:e})}},pipe(){return rt(this,arguments)}},Vi=(t,e)=>{const r=Object.create(Wi);return r.head=t,r.tail=e,r},Hi=D("Nil"),zi={[Ui]:Ui,_tag:"Nil",toString(){return Y(this.toJSON())},toJSON:()=>({_id:"List",_tag:"Nil"}),[H](){return this.toJSON()},[j]:()=>Hi,[U](t){return Ki(t)&&this._tag===t._tag},[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})}),pipe(){return rt(this,arguments)}},Yi=Object.create(zi),Ki=t=>m(t,Ui),Qi=t=>"Nil"===t._tag,Zi=(t,e)=>Vi(t,e),Xi=()=>Yi,to=t=>Vi(t,Yi),eo=t(2,((t,e)=>no(e,t))),ro=t(2,((t,e)=>Zi(e,t))),no=t(2,((t,e)=>{if(Qi(t))return e;if(Qi(e))return t;{const r=Vi(e.head,t);let n=r,s=e.tail;for(;!Qi(s);){const e=Vi(s.head,t);n.tail=e,n=e,s=s.tail}return r}})),so=t(3,((t,e,r)=>{let n=e,s=t;for(;!Qi(s);)n=r(n,s.head),s=s.tail;return n})),io=t=>{let e=Xi(),r=t;for(;!Qi(r);)e=ro(e,r.head),r=r.tail;return e},oo=function(){function t(t){t&&Object.assign(this,t)}return t.prototype=Et,t}(),co=t=>Object.assign(Object.create(Et),t),ao=Symbol.for("effect/DifferContextPatch");function uo(t){return t}const ho={...oo.prototype,[ao]:{_Value:uo,_Patch:uo}},lo=Object.create(Object.assign(Object.create(ho),{_tag:"Empty"})),fo=()=>lo,bo=Object.assign(Object.create(ho),{_tag:"AndThen"}),po=Object.assign(Object.create(ho),{_tag:"AddService"}),mo=(t,e)=>{const r=Object.create(po);return r.key=t,r.service=e,r},So=Object.assign(Object.create(ho),{_tag:"RemoveService"}),go=t=>{const e=Object.create(So);return e.key=t,e},yo=Object.assign(Object.create(ho),{_tag:"UpdateService"}),wo=(t,e)=>{const r=Object.create(yo);return r.key=t,r.update=e,r},_o=t(2,((t,e)=>((t,e)=>{const r=Object.create(bo);return r.first=t,r.second=e,r})(t,e))),vo=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=!1,n=Jr(t);const s=new Map(e.unsafeMap);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AddService":s.set(t.key,t.service),n=e;break;case"AndThen":n=Xr(Xr(e,t.second),t.first);break;case"RemoveService":s.delete(t.key),n=e;break;case"UpdateService":s.set(t.key,t.update(s.get(t.key))),r=!0,n=e}}if(!r)return br(s);const i=new Map;for(const[t]of e.unsafeMap)s.has(t)&&(i.set(t,s.get(t)),s.delete(t));for(const[t,e]of s)i.set(t,e);return br(i)})),Oo=Symbol.for("effect/DifferHashSetPatch");function Mo(t){return t}const Eo={...oo.prototype,[Oo]:{_Value:Mo,_Key:Mo,_Patch:Mo}},Io=Object.create(Object.assign(Object.create(Eo),{_tag:"Empty"})),ko=()=>Io,Fo=Object.assign(Object.create(Eo),{_tag:"AndThen"}),No=Object.assign(Object.create(Eo),{_tag:"Add"}),Co=t=>{const e=Object.create(No);return e.value=t,e},jo=Object.assign(Object.create(Eo),{_tag:"Remove"}),Ao=t(2,((t,e)=>((t,e)=>{const r=Object.create(Fo);return r.first=t,r.second=e,r})(t,e))),Ro=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=e,n=Jr(t);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AndThen":n=Xr(t.first)(Xr(t.second)(e));break;case"Add":r=si(t.value)(r),n=e;break;case"Remove":r=ii(t.value)(r),n=e}}return r})),xo=Symbol.for("effect/DifferReadonlyArrayPatch");function $o(t){return t}const To={...oo.prototype,[xo]:{_Value:$o,_Patch:$o}},Lo=Object.create(Object.assign(Object.create(To),{_tag:"Empty"})),Do=()=>Lo,Po=Object.assign(Object.create(To),{_tag:"AndThen"}),Bo=Object.assign(Object.create(To),{_tag:"Append"}),qo=Object.assign(Object.create(To),{_tag:"Slice"}),Uo=Object.assign(Object.create(To),{_tag:"Update"}),Jo=(t,e)=>{const r=Object.create(Uo);return r.index=t,r.patch=e,r},Go=t(2,((t,e)=>((t,e)=>{const r=Object.create(Po);return r.first=t,r.second=e,r})(t,e))),Wo=t(3,((t,e,r)=>{if("Empty"===t._tag)return e;let n=e.slice(),s=ze(t);for(;Ie(s);){const t=Ae(s),e=xe(s);switch(t._tag){case"Empty":s=e;break;case"AndThen":e.unshift(t.first,t.second),s=e;break;case"Append":for(const e of t.values)n.push(e);s=e;break;case"Slice":n=n.slice(t.from,t.until),s=e;break;case"Update":n[t.index]=r.patch(t.patch,n[t.index]),s=e}}return n})),Vo=Symbol.for("effect/Differ"),Ho={[Vo]:{_P:e,_V:e},pipe(){return rt(this,arguments)}},zo=t=>{const e=Object.create(Ho);return e.empty=t.empty,e.diff=t.diff,e.combine=t.combine,e.patch=t.patch,e},Yo=()=>Ko(((t,e)=>e)),Ko=t=>zo({empty:e,combine:(t,r)=>t===e?r:r===e?t:e=>r(t(e)),diff:(t,n)=>J(t,n)?e:r(n),patch:(e,r)=>t(r,e(r))}),Qo=255,Zo=t=>t&Qo,Xo=t=>t>>8&Qo,tc=(t,e)=>(t&Qo)+((e&t&Qo)<<8),ec=tc(0,0),rc=t(2,((t,e)=>tc(Zo(t)&~e,Xo(t)))),nc=t(2,((t,e)=>t|e)),sc=t(2,((t,e)=>t|e)),ic=t=>oc(t)&&!lc(t),oc=t=>cc(t,1),cc=t(2,((t,e)=>!!(t&e))),ac=(...t)=>t.reduce(((t,e)=>t|e),0),uc=ac(0),hc=t=>cc(t,4),lc=t=>cc(t,16),fc=t(2,((t,e)=>tc(t^e,e))),bc=t(2,((t,e)=>t&(~Zo(e)>>>0&Qo|Xo(e))|Zo(e)&Xo(e))),dc=zo({empty:ec,diff:(t,e)=>fc(t,e),combine:(t,e)=>nc(e)(t),patch:(t,e)=>bc(e,t)}),pc=t=>tc(t,0),mc=rc,Sc=(t,e)=>({_tag:"Par",left:t,right:e}),gc=(t,e)=>({_tag:"Seq",left:t,right:e}),yc=t=>{let e=t,r=Mc(),n=Xi(),s=Xi();for(;;)switch(e._tag){case"Empty":if(Qi(n))return[r,s];e=n.head,n=n.tail;break;case"Par":n=Zi(e.right,n),e=e.left;break;case"Seq":{const t=e.left,r=e.right;switch(t._tag){case"Empty":e=r;break;case"Par":{const n=t.right;e=Sc(gc(t.left,r),gc(n,r));break}case"Seq":e=gc(t.left,gc(t.right,r));break;case"Single":e=t,s=Zi(r,s)}break}case"Single":if(r=Ec(r,e),Qi(n))return[r,s];e=n.head,n=n.tail}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},wc=(t,e)=>{if(Qi(t))return to(Nc(e));if(kc(e))return t;const r=$c(t.head),n=Fc(e);return 1===r.length&&1===n.length&&J(r[0],n[0])?Zi(xc(t.head,Nc(e)),t.tail):Zi(Nc(e),t)},_c=Symbol.for("effect/RequestBlock/RequestBlockParallel"),vc={_R:t=>t};class Oc{map;[_c]=vc;constructor(t){this.map=t}}const Mc=()=>new Oc($i()),Ec=(t,e)=>new Oc(Pi(t.map,e.dataSource,(t=>le(pe(t,Zr(e.blockedRequest)),(()=>Jr(e.blockedRequest)))))),Ic=(t,e)=>new Oc(qi(t.map,e.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>e,onSome:t=>rn(e,t)}))))),kc=t=>(t=>t&&ss(t._root))(t.map),Fc=t=>Array.from(Di(t.map)),Nc=t=>Rc(Bi(t.map,(t=>Jr(t)))),Cc=Symbol.for("effect/RequestBlock/RequestBlockSequential"),jc={_R:t=>t};class Ac{map;[Cc]=jc;constructor(t){this.map=t}}const Rc=t=>new Ac(t),xc=(t,e)=>new Ac(qi(e.map,t.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>qr(),onSome:t=>rn(t,e)}))))),$c=t=>Array.from(Di(t.map)),Tc="Die",Lc="Empty",Dc="Fail",Pc="Interrupt",Bc="Parallel",qc="Sequential",Uc="effect/Cause",Jc=Symbol.for(Uc),Gc={[Jc]:{_E:t=>t},[j](){return c(A(Uc),x(A(ha(this))),q(this))},[U](t){return Qc(t)&&ua(this,t)},pipe(){return rt(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:z(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:z(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:z(this.left),right:z(this.right)}}},toString(){return wa(this)},[H](){return this.toJSON()}},Wc=(()=>{const t=Object.create(Gc);return t._tag=Lc,t})(),Vc=t=>{const e=Object.create(Gc);return e._tag=Dc,e.error=t,e},Hc=t=>{const e=Object.create(Gc);return e._tag=Tc,e.defect=t,e},zc=t=>{const e=Object.create(Gc);return e._tag=Pc,e.fiberId=t,e},Yc=(t,e)=>{const r=Object.create(Gc);return r._tag=Bc,r.left=t,r.right=e,r},Kc=(t,e)=>{const r=Object.create(Gc);return r._tag=qc,r.left=t,r.right=e,r},Qc=t=>m(t,Jc),Zc=t=>t._tag===Tc,Xc=t=>ce(ia(t)),ta=t=>ya(void 0,da)(t),ea=t=>Hr(ga(t,qr(),((t,e)=>e._tag===Tc?ie(c(t,Xr(e.defect))):se()))),ra=t=>ga(t,ti(),((t,e)=>e._tag===Pc?ie(c(t,si(e.fiberId))):se())),na=t=>{const e=(t=>fa(t,(t=>t._tag===Dc?ie(t.error):se())))(t);switch(e._tag){case"None":return Vt(t);case"Some":return Ht(e.value)}},sa=t=>Sa(t,{onEmpty:ie(Wc),onFail:pe(Vc),onDie:t=>ie(Hc(t)),onInterrupt:t=>ie(zc(t)),onSequential:ge(Kc),onParallel:ge(Yc)}),ia=t=>fa(t,(t=>t._tag===Pc?ie(t.fiberId):se())),oa=t=>Sa(t,{onEmpty:Wc,onFail:()=>Wc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}),ca=t(2,((t,e)=>aa(t,(t=>Vc(e(t)))))),aa=t(2,((t,e)=>Sa(t,{onEmpty:Wc,onFail:t=>e(t),onDie:t=>Hc(t),onInterrupt:t=>zc(t),onSequential:(t,e)=>Kc(t,e),onParallel:(t,e)=>Yc(t,e)}))),ua=(t,e)=>{let r=Jr(t),n=Jr(e);for(;cn(r)&&cn(n);){const[t,e]=c(hn(r),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])}))),[s,i]=c(hn(n),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])})));if(!J(t,s))return!1;r=e,n=i}return!0},ha=t=>la(Jr(t),qr()),la=(t,e)=>{for(;;){const[r,n]=c(t,Xe([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return[c(t,ci(n)),c(e,rn(s))]}))),s=ni(r)>0?c(e,Xr(r)):e;if(on(n))return Hr(s);t=n,e=s}throw new Error(w("Cause.flattenCauseLoop"))},fa=t(2,((t,e)=>{const r=[t];for(;r.length>0;){const t=r.pop(),n=e(t);switch(n._tag){case"None":switch(t._tag){case qc:case Bc:r.push(t.right),r.push(t.left)}break;case"Some":return n}}return se()})),ba=t=>{let e=t;const r=[];let n=ti(),s=qr();for(;void 0!==e;)switch(e._tag){case Lc:if(0===r.length)return[n,s];e=r.pop();break;case Dc:if(n=si(n,Ur(e._tag,e.error)),0===r.length)return[n,s];e=r.pop();break;case Tc:if(n=si(n,Ur(e._tag,e.defect)),0===r.length)return[n,s];e=r.pop();break;case Pc:if(n=si(n,Ur(e._tag,e.fiberId)),0===r.length)return[n,s];e=r.pop();break;case qc:switch(e.left._tag){case Lc:e=e.right;break;case qc:e=Kc(e.left.left,Kc(e.left.right,e.right));break;case Bc:e=Yc(Kc(e.left.left,e.right),Kc(e.left.right,e.right));break;default:s=Xr(s,e.right),e=e.left}break;case Bc:r.push(e.right),e=e.left}throw new Error(w("Cause.evaluateCauseLoop"))},da={emptyCase:n,failCase:s,dieCase:s,interruptCase:n,sequentialCase:(t,e,r)=>e&&r,parallelCase:(t,e,r)=>e&&r},pa="SequentialCase",ma="ParallelCase",Sa=t(2,((t,{onDie:e,onEmpty:r,onFail:n,onInterrupt:s,onParallel:i,onSequential:o})=>ya(t,void 0,{emptyCase:()=>r,failCase:(t,e)=>n(e),dieCase:(t,r)=>e(r),interruptCase:(t,e)=>s(e),sequentialCase:(t,e,r)=>o(e,r),parallelCase:(t,e,r)=>i(e,r)}))),ga=t(3,((t,e,r)=>{let n=e,s=t;const i=[];for(;void 0!==s;){const t=r(n,s);switch(n=ce(t)?t.value:n,s._tag){case qc:case Bc:i.push(s.right),s=s.left;break;default:s=void 0}void 0===s&&i.length>0&&(s=i.pop())}return n})),ya=t(3,((t,e,r)=>{const n=[t],s=[];for(;n.length>0;){const t=n.pop();switch(t._tag){case Lc:s.push(Vt(r.emptyCase(e)));break;case Dc:s.push(Vt(r.failCase(e,t.error)));break;case Tc:s.push(Vt(r.dieCase(e,t.defect)));break;case Pc:s.push(Vt(r.interruptCase(e,t.fiberId)));break;case qc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:pa}));break;case Bc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:ma}))}}const i=[];for(;s.length>0;){const t=s.pop();switch(t._tag){case"Left":switch(t.left._tag){case pa:{const t=i.pop(),n=i.pop(),s=r.sequentialCase(e,t,n);i.push(s);break}case ma:{const t=i.pop(),n=i.pop(),s=r.parallelCase(e,t,n);i.push(s);break}}break;case"Right":i.push(t.right)}}if(0===i.length)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return i.pop()})),wa=(t,e)=>ta(t)?"All fibers interrupted without errors.":Fa(t).map((function(t){return!0!==e?.renderErrorCause||void 0===t.cause?t.stack:`${t.stack} {\n${_a(t.cause," ")}\n}`})).join("\n"),_a=(t,e)=>{const r=t.stack.split("\n");let n=`${e}[cause]: ${r[0]}`;for(let t=1,s=r.length;t<s;t++)n+=`\n${e}${r[t]}`;return t.cause&&(n+=` {\n${_a(t.cause,`${e} `)}\n${e}}`),n};class va extends globalThis.Error{span=void 0;constructor(t){const e="object"==typeof t&&null!==t,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(Oa(t),e&&"cause"in t&&void 0!==t.cause?{cause:new va(t.cause)}:void 0),""===this.message&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",e&&(ka in t&&(this.span=t[ka]),Object.keys(t).forEach((e=>{e in this||(this[e]=t[e])}))),this.stack=Ia(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const Oa=t=>{if("string"==typeof t)return t;if("object"==typeof t&&null!==t&&t instanceof Error)return t.message;try{if(m(t,"toString")&&d(t.toString)&&t.toString!==Object.prototype.toString&&t.toString!==globalThis.Array.prototype.toString)return t.toString()}catch{}return Q(t)},Ma=/\((.*)\)/g,Ea=f("effect/Tracer/spanToTrace",(()=>new WeakMap)),Ia=(t,e,r)=>{const n=[t],s=e.startsWith(t)?e.slice(t.length).split("\n"):e.split("\n");for(let t=1;t<s.length;t++)if(s[t].includes(" at new BaseEffectError")||s[t].includes(" at new YieldableError"))t++;else{if(s[t].includes("Generator.next"))break;if(s[t].includes("effect_internal_function"))break;n.push(s[t].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(r){let t=r,e=0;for(;t&&"Span"===t._tag&&e<10;){const r=Ea.get(t);if("function"==typeof r){const e=r();if("string"==typeof e){const r=e.matchAll(Ma);let s=!1;for(const[,e]of r)s=!0,n.push(` at ${t.name} (${e})`);s||n.push(` at ${t.name} (${e.replace(/^at /,"")})`)}else n.push(` at ${t.name}`)}else n.push(` at ${t.name}`);t=be(t.parent),e++}}return n.join("\n")},ka=Symbol.for("effect/SpanAnnotation"),Fa=t=>ya(t,void 0,{emptyCase:()=>[],dieCase:(t,e)=>[new va(e)],failCase:(t,e)=>[new va(e)],interruptCase:()=>[],parallelCase:(t,e,r)=>[...e,...r],sequentialCase:(t,e,r)=>[...e,...r]}),Na="Pending",Ca="Done",ja=Symbol.for("effect/Deferred"),Aa={_E:t=>t,_A:t=>t},Ra=t=>({_tag:Ca,effect:t});class xa{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new xa(this.self)}}const $a=(t,e)=>{const r=new Da("Blocked");return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r},Ta=Symbol.for("effect/Effect");class La{patch;op;_op=St;constructor(t,e){this.patch=t,this.op=e}}class Da{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t}[U](t){return this===t}[j](){return q(this,R(this))}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:z(this.effect_instruction_i0),effect_instruction_i1:z(this.effect_instruction_i1),effect_instruction_i2:z(this.effect_instruction_i2)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}class Pa{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Failure"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[j](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get cause(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}class Ba{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Success"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[j](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get value(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:z(this.value)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}const qa=t=>m(t,Ta),Ua=t=>{const e=new Da(pt);return e.effect_instruction_i0=t,e},Ja=t(3,((t,e,r)=>$u((n=>hu(t,(t=>hu(nu(Cu((()=>n(e(t))))),(e=>Cu((()=>r(t,e))).pipe(du({onFailure:t=>{switch(e._tag){case it:return ou(Kc(e.effect_instruction_i0,t));case ut:return ou(t)}},onSuccess:()=>e})))))))))),Ga=t(2,((t,e)=>hu(t,(()=>Nu(e))))),Wa=t=>Ga(t,void 0),Va=function(){const t=new Da(st);switch(arguments.length){case 2:t.effect_instruction_i0=arguments[0],t.commit=arguments[1];break;case 3:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.commit=arguments[2];break;case 4:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.effect_instruction_i2=arguments[2],t.commit=arguments[3];break;default:throw new Error(w("you're not supposed to end up here"))}return t},Ha=(t,e=Ci)=>{const r=new Da(nt);let n;return r.effect_instruction_i0=e=>{n=t(e)},r.effect_instruction_i1=e,Iu(r,(()=>qa(n)?n:Tu))},za=(t,e=Ci)=>Cu((()=>Ha(t,e))),Ya=(t,e=Ci)=>Va(t,(function(){let t,r;function n(e){t?t(e):void 0===r&&(r=e)}const s=new Da(nt);let i,o;return s.effect_instruction_i0=e=>{t=e,r&&e(r)},s.effect_instruction_i1=e,1!==this.effect_instruction_i0.length?(o=new AbortController,i=N((()=>this.effect_instruction_i0(n,o.signal)))):i=N((()=>this.effect_instruction_i0(n))),i||o?Iu(s,(()=>(o&&o.abort(),i??Tu))):s})),Ka=t(2,((t,e)=>{const r=new Da(ot);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),Qa=t(2,((t,e)=>pu(t,{onFailure:e,onSuccess:Nu}))),Za=Symbol.for("effect/OriginalAnnotation"),Xa=(t,e)=>ce(e)?new Proxy(t,{has:(t,e)=>e===ka||e===Za||e in t,get:(r,n)=>n===ka?e.value:n===Za?t:r[n]}):t,tu=t=>p(t)&&!(ka in t)?Ua((e=>ou(Hc(Xa(t,El(e)))))):ou(Hc(t)),eu=t=>cu((()=>Hc(new Th(t)))),ru=t=>pu(t,{onFailure:t=>Nu(Ht(t)),onSuccess:t=>Nu(Vt(t))}),nu=t=>bu(t,{onFailure:Kh,onSuccess:tl}),su=t=>p(t)&&!(ka in t)?Ua((e=>ou(Vc(Xa(t,El(e)))))):ou(Vc(t)),iu=t=>hu(ju(t),su),ou=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},cu=t=>hu(ju(t),ou),au=Ua((t=>Nu(t.id()))),uu=t=>Ua((e=>t(e.id()))),hu=t(2,((t,e)=>{const r=new Da(ct);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),lu=t=>{const e=new Da("OnStep");return e.effect_instruction_i0=t,e},fu=t=>hu(t,e),bu=t(2,((t,e)=>du(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),du=t(2,((t,e)=>{const r=new Da(at);return r.effect_instruction_i0=t,r.effect_instruction_i1=e.onFailure,r.effect_instruction_i2=e.onSuccess,r})),pu=t(2,((t,e)=>du(t,{onFailure:t=>{if(ea(t).length>0)return ou((t=>Sa(t,{onEmpty:Wc,onFail:Hc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}))(t));const r=(t=>Hr(ga(t,qr(),((t,e)=>e._tag===Dc?ie(c(t,Xr(e.error))):se()))))(t);return r.length>0?e.onFailure(un(r)):ou(t)},onSuccess:e.onSuccess}))),mu=t(2,((t,e)=>Cu((()=>{const r=ve(t),n=we(r.length);let s=0;return Ga(Du({while:()=>s<r.length,body:()=>e(r[s],s),step:t=>{n[s++]=t}}),n)})))),Su=t(2,((t,e)=>Cu((()=>{const r=ve(t);let n=0;return Du({while:()=>n<r.length,body:()=>e(r[n],n),step:()=>{n++}})})))),gu=hu(au,(t=>yu(t))),yu=t=>ou(zc(t)),wu=t=>{const e=new Da(ft);return e.effect_instruction_i0=tc(r=1,r),e.effect_instruction_i1=()=>t,e;var r},_u=t(2,((t,e)=>$u((r=>hu(nu(r(t)),(t=>ll(e,t))))))),vu=t(2,((t,e)=>hu(t,(t=>ju((()=>e(t))))))),Ou=t(2,((t,e)=>pu(t,{onFailure:t=>iu((()=>e.onFailure(t))),onSuccess:t=>ju((()=>e.onSuccess(t)))}))),Mu=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return iu((()=>e(r.left)));case"Right":return ou(r.right)}},onSuccess:Nu}))),Eu=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>{const r=Kh(t);return du(e(r),{onFailure:e=>Kh(Kc(t,e)),onSuccess:()=>r})},onSuccess:t=>{const r=tl(t);return Wu(e(r),r)}}))))),Iu=t(2,((t,e)=>Eu(t,Zh({onFailure:t=>ta(t)?Wa(e(ra(t))):Tu,onSuccess:()=>Tu})))),ku=t(2,((t,e)=>Ru(t,e,Nu))),Fu=t(2,((t,e)=>pu(t,{onFailure:t=>tu(e(t)),onSuccess:Nu}))),Nu=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},Cu=t=>{const e=new Da(st);return e.commit=t,e},ju=t=>{const e=new Da(ht);return e.effect_instruction_i0=t,e},Au=t((t=>3===t.length||2===t.length&&!(p(t[1])&&"onlyEffect"in t[1])),((t,e)=>hu(t,(t=>{const r="function"==typeof e?e(t):e;return qa(r)?Ga(r,t):m(n=r,"then")&&d(n.then)?Ha((e=>{r.then((()=>e(Nu(t))),(t=>e(su(new qh(t,"An unknown error occurred in Effect.tap")))))})):Nu(t);var n})))),Ru=t(3,((t,e,r)=>du(t,{onFailure:t=>ea(t).length>0?ou(de((t=>Sa(t,{onEmpty:se(),onFail:t=>ie(Hc(t)),onDie:t=>ie(Hc(t)),onInterrupt:()=>se(),onSequential:ge(Kc),onParallel:ge(Yc)}))(t))):e(),onSuccess:r}))),xu=t=>{const e=new Da(ft);return e.effect_instruction_i0=pc(1),e.effect_instruction_i1=()=>t,e},$u=t=>Va(t,(function(){const t=new Da(ft);return t.effect_instruction_i0=pc(1),t.effect_instruction_i1=t=>oc(t)?N((()=>this.effect_instruction_i0(wu))):N((()=>this.effect_instruction_i0(xu))),t})),Tu=Nu(void 0),Lu=t(2,((t,e)=>hu(e,(e=>e?c(t,vu(ie)):Nu(se()))))),Du=t=>{const e=new Da(bt);return e.effect_instruction_i0=t.while,e.effect_instruction_i1=t.body,e.effect_instruction_i2=t.step,e},Pu=t=>Cu((()=>{const e=new Da(dt);return e.effect_instruction_i0=t(),e})),Bu=function(){const t=1===arguments.length?arguments[0]:arguments[1].bind(arguments[0]);return Pu((()=>t(c)))},qu=(t,...e)=>Object.defineProperty(0===e.length?function(...e){return Pu((()=>t.apply(this,e)))}:function(...r){let n=Pu((()=>t.apply(this,r)));for(const t of e)n=t(n,...r);return n},"length",{value:t.length,configurable:!0}),Uu=t=>{const e=new Da(mt);return void 0!==t?.priority?yh(e,t.priority):e},Ju=t(2,((t,e)=>hu(t,(t=>vu(e,(e=>[t,e])))))),Gu=t(2,((t,e)=>hu(t,(t=>Ga(e,t))))),Wu=t(2,((t,e)=>hu(t,(()=>e)))),Vu=t(3,((t,e,r)=>hu(t,(t=>vu(e,(e=>r(t,e))))))),Hu=t=>hu(au,(e=>c(t,zu(e)))),zu=t(2,((t,e)=>hu(t.interruptAsFork(e),(()=>t.await)))),Yu={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return rt(this,arguments)}},Ku={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return rt(this,arguments)}},Qu={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return rt(this,arguments)}},Zu={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return rt(this,arguments)}},Xu=Symbol.for("effect/FiberRef"),th={_A:t=>t},eh=t=>Ua((e=>tl(e.getFiberRef(t)))),rh=t(2,((t,e)=>hu(eh(t),e))),nh=t(2,((t,e)=>sh(t,(()=>[void 0,e])))),sh=t(2,((t,e)=>Ua((r=>{const[n,s]=e(r.getFiberRef(t));return r.setFiberRef(t,s),Nu(n)})))),ih=t(3,((t,e,r)=>Ja(Gu(eh(e),nh(e,r)),(()=>t),(t=>nh(e,t))))),oh=t(3,((t,e,r)=>rh(e,(n=>ih(t,e,r(n)))))),ch=(t,r)=>lh(t,{differ:Yo(),fork:r?.fork??e,join:r?.join}),ah=t=>{const e=zo({empty:ko(),combine:(t,e)=>Ao(e)(t),diff:(t,e)=>((t,e)=>{const[r,n]=ai([t,ko()],(([t,e],r)=>ri(r)(t)?[ii(r)(t),e]:[t,Ao(Co(r))(e)]))(e);return ai(n,((t,e)=>Ao((t=>{const e=Object.create(jo);return e.value=t,e})(e))(t)))(r)})(t,e),patch:(t,e)=>Ro(e)(t)});return lh(t,{differ:e,fork:e.empty})},uh=t=>{const e=(t=>zo({empty:Do(),combine:(t,e)=>Go(t,e),diff:(e,r)=>(t=>{let e=0,r=Do();for(;e<t.oldValue.length&&e<t.newValue.length;){const n=t.differ.diff(t.oldValue[e],t.newValue[e]);J(n,t.differ.empty)||(r=Go(r,Jo(e,n))),e+=1}return e<t.oldValue.length&&(r=Go(r,((t,e)=>{const r=Object.create(qo);return r.from=0,r.until=e,r})(0,e))),e<t.newValue.length&&(r=Go(r,(t=>{const e=Object.create(Bo);return e.values=t,e})(Te(e)(t.newValue)))),r})({oldValue:e,newValue:r,differ:t}),patch:(e,r)=>Wo(e,r,t)}))(Yo());return lh(t,{differ:e,fork:e.empty})},hh=t=>{const e=zo({empty:fo(),combine:(t,e)=>_o(e)(t),diff:(t,e)=>((t,e)=>{const r=new Map(t.unsafeMap);let n=fo();for(const[t,s]of e.unsafeMap.entries())if(r.has(t)){const e=r.get(t);r.delete(t),J(e,s)||(n=_o(wo(t,(()=>s)))(n))}else r.delete(t),n=_o(mo(t,s))(n);for(const[t]of r.entries())n=_o(go(t))(n);return n})(t,e),patch:(t,e)=>vo(e)(t)});return lh(t,{differ:e,fork:e.empty})},lh=(t,e)=>({...It,[Xu]:th,initial:t,commit(){return eh(this)},diff:(t,r)=>e.differ.diff(t,r),combine:(t,r)=>e.differ.combine(t,r),patch:t=>r=>e.differ.patch(t,r),fork:e.fork,join:e.join??((t,e)=>e)}),fh=t=>lh(t,{differ:dc,fork:dc.empty}),bh=f(Symbol.for("effect/FiberRef/currentContext"),(()=>hh(Ir()))),dh=f(Symbol.for("effect/FiberRef/currentSchedulingPriority"),(()=>ch(0))),ph=f(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),(()=>ch(2048))),mh=f(Symbol.for("effect/FiberRef/currentLogAnnotation"),(()=>ch($i()))),Sh=f(Symbol.for("effect/FiberRef/currentLogLevel"),(()=>ch(Qu))),gh=f(Symbol.for("effect/FiberRef/currentLogSpan"),(()=>ch(Xi()))),yh=t(2,((t,e)=>ih(t,dh,e))),wh=f(Symbol.for("effect/FiberRef/currentConcurrency"),(()=>ch("unbounded"))),_h=f(Symbol.for("effect/FiberRef/currentRequestBatching"),(()=>ch(!0))),vh=f(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),(()=>ch(ie(Zu)))),Oh=f(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),(()=>ch(ie(Ku)))),Mh=f(Symbol.for("effect/FiberRef/currentMetricLabels"),(()=>uh([]))),Eh=f(Symbol.for("effect/FiberRef/currentForkScopeOverride"),(()=>ch(se(),{fork:()=>se(),join:t=>t}))),Ih=f(Symbol.for("effect/FiberRef/currentInterruptedCause"),(()=>ch(Wc,{fork:()=>Wc,join:t=>t}))),kh=Symbol.for("effect/Scope"),Fh=Symbol.for("effect/CloseableScope"),Nh=(t,e)=>t.addFinalizer((()=>Wa(e))),Ch=(t,e)=>t.addFinalizer(e),jh=(t,e)=>t.close(e),Ah=(t,e)=>t.fork(e),Rh=function(){class t extends globalThis.Error{commit(){return su(this)}toJSON(){const t={...this};return this.message&&(t.message=this.message),this.cause&&(t.cause=this.cause),t}[H](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}`:this.toString():"Bun"in globalThis?wa(Vc(this),{renderErrorCause:!0}):this}}return Object.assign(t.prototype,kt),t}(),xh=(t,e)=>{class r extends Rh{_tag=e}return Object.assign(r.prototype,t),r.prototype.name=e,r},$h=Symbol.for("effect/Cause/errors/RuntimeException"),Th=xh({[$h]:$h},"RuntimeException"),Lh=Symbol.for("effect/Cause/errors/InterruptedException"),Dh=Symbol.for("effect/Cause/errors/NoSuchElement"),Ph=xh({[Dh]:Dh},"NoSuchElementException"),Bh=Symbol.for("effect/Cause/errors/UnknownException"),qh=function(){class t extends Rh{_tag="UnknownException";error;constructor(t,e){super(e??"An unknown error occurred",{cause:t}),this.error=t}}return Object.assign(t.prototype,{[Bh]:Bh,name:"UnknownException"}),t}(),Uh=t=>qa(t)&&"_tag"in t&&("Success"===t._tag||"Failure"===t._tag),Jh=t=>"Failure"===t._tag,Gh=t=>"Success"===t._tag,Wh=t(2,((t,e)=>{switch(t._tag){case it:return Kh(t.effect_instruction_i0);case ut:return tl(e)}})),Vh=t=>Wh(t,void 0),Hh=(t,e)=>il(t,e?.parallel?Yc:Kc),zh=t=>Kh(Hc(t)),Yh=t=>Kh(Vc(t)),Kh=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},Qh=t(2,((t,e)=>{switch(t._tag){case it:return Kh(t.effect_instruction_i0);case ut:return tl(e(t.effect_instruction_i0))}})),Zh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),Xh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),tl=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},el=tl(void 0),rl=t(2,((t,e)=>sl(t,e,{onSuccess:(t,e)=>[t,e],onFailure:Kc}))),nl=t(2,((t,e)=>sl(t,e,{onSuccess:(t,e)=>e,onFailure:Kc}))),sl=t(3,((t,e,{onFailure:r,onSuccess:n})=>{switch(t._tag){case it:switch(e._tag){case ut:return Kh(t.effect_instruction_i0);case it:return Kh(r(t.effect_instruction_i0,e.effect_instruction_i0))}case ut:switch(e._tag){case ut:return tl(n(t.effect_instruction_i0,e.effect_instruction_i0));case it:return Kh(e.effect_instruction_i0)}}})),il=(t,e)=>{const r=Gr(t);return cn(r)?c(dn(r),Xe(c(hn(r),Qh(Jr)),((t,r)=>c(t,sl(r,{onSuccess:(t,e)=>c(t,Xr(e)),onFailure:e})))),Qh(Hr),Qh((t=>Vr(t))),ie):se()},ol=t=>{var e;return{...It,[ja]:Aa,state:li((e=[],{_tag:Na,joiners:e})),commit(){return ul(this)},blockingOn:t}},cl=()=>hu(au,(t=>al(t))),al=t=>ju((()=>ol(t))),ul=t=>za((e=>{const r=bi(t.state);switch(r._tag){case Ca:return e(r.effect);case Na:return r.joiners.push(e),gl(t,e)}}),t.blockingOn),hl=t(2,((t,e)=>ju((()=>{const r=bi(t.state);switch(r._tag){case Ca:return!1;case Na:di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e);return!0}})))),ll=t(2,((t,e)=>hl(t,e))),fl=t(2,((t,e)=>hl(t,ou(e)))),bl=t=>hu(au,(e=>hl(t,yu(e)))),dl=t(2,((t,e)=>hl(t,yu(e)))),pl=t=>ju((()=>bi(t.state)._tag===Ca)),ml=t(2,((t,e)=>hl(t,Nu(e)))),Sl=(t,e)=>{const r=bi(t.state);if(r._tag===Na){di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e)}},gl=(t,e)=>ju((()=>{const r=bi(t.state);if(r._tag===Na){const t=r.joiners.indexOf(e);t>=0&&r.joiners.splice(t,1)}})),yl=Ua((t=>tl(t.currentContext))),wl=()=>yl,_l=t=>hu(wl(),t),vl=t(2,((t,e)=>ih(bh,e)(t))),Ol=t(2,((t,e)=>oh(bh,(t=>Ar(t,e)))(t))),Ml=t(2,((t,e)=>_l((r=>vl(t,e(r)))))),El=t=>{const e=t.currentSpan;return void 0!==e&&"Span"===e._tag?ie(e):se()},Il=Symbol.for("effect/MutableHashMap"),kl={[Il]:Il,[Symbol.iterator](){return new Fl(this)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}};class Fl{self;referentialIterator;bucketIterator;constructor(t){this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(void 0!==this.bucketIterator)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new Nl(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new Fl(this.self)}}class Nl{backing;constructor(t){this.backing=t}currentBucket;next(){if(void 0===this.currentBucket){const t=this.backing.next();if(t.done)return t;this.currentBucket=t.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const Cl=()=>{const t=Object.create(kl);return t.referential=new Map,t.buckets=new Map,t.bucketsSize=0,t},jl=t(2,((t,e)=>{if(!1===W(e))return t.referential.has(e)?ie(t.referential.get(e)):se();const r=e[j](),n=t.buckets.get(r);return void 0===n?se():Al(t,n,e)})),Al=(t,e,r,n=!1)=>{for(let s=0,i=e.length;s<i;s++)if(r[U](e[s][0])){const r=e[s][1];return n&&(e.splice(s,1),t.bucketsSize--),ie(r)}return se()},Rl=t(2,((t,e)=>ce(jl(t,e)))),xl=t(3,((t,e,r)=>{if(!1===W(e))return t.referential.set(e,r),t;const n=e[j](),s=t.buckets.get(n);return void 0===s?(t.buckets.set(n,[[e,r]]),t.bucketsSize++,t):($l(t,s,e),s.push([e,r]),t.bucketsSize++,t)})),$l=(t,e,r)=>{for(let n=0,s=e.length;n<s;n++)if(r[U](e[n][0]))return e.splice(n,1),void t.bucketsSize--},Tl=t(2,((t,e)=>{if(!1===W(e))return t.referential.delete(e),t;const r=e[j](),n=t.buckets.get(r);return void 0===n||($l(t,n,e),0===n.length&&t.buckets.delete(r)),t})),Ll=t=>t.referential.size+t.bucketsSize,Dl=Symbol.for("effect/Clock"),Pl=Mr("effect/Clock"),Bl={unsafeSchedule(t,e){const r=Bn(e);if(r>2147483647)return s;let n=!1;const i=setTimeout((()=>{n=!0,t()}),r);return()=>(clearTimeout(i),!n)}},ql=function(){const t=BigInt(1e6);if("undefined"==typeof performance||"function"!=typeof performance.now)return()=>BigInt(Date.now())*t;let e;return()=>(void 0===e&&(e=BigInt(Date.now())*t-BigInt(Math.round(1e6*performance.now()))),e+BigInt(Math.round(1e6*performance.now())))}(),Ul=function(){const t="object"==typeof process&&"hrtime"in process&&"function"==typeof process.hrtime.bigint?process.hrtime:void 0;if(!t)return ql;const e=ql()-t.bigint();return()=>e+t.bigint()}();class Jl{[Dl]=Dl;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Ul()}currentTimeMillis=ju((()=>this.unsafeCurrentTimeMillis()));currentTimeNanos=ju((()=>this.unsafeCurrentTimeNanos()));scheduler(){return Nu(Bl)}sleep(t){return Ya((e=>{const r=Bl.unsafeSchedule((()=>e(Tu)),t);return Wa(ju(r))}))}}const Gl=()=>new Jl,Wl="InvalidData",Vl="MissingData",Hl="SourceUnavailable",zl="Unsupported",Yl=Symbol.for("effect/ConfigError"),Kl={_tag:"ConfigError",[Yl]:Yl},Ql=(t,e)=>{const r=Object.create(Kl);return r._op="And",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Zl=(t,e)=>{const r=Object.create(Kl);return r._op="Or",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Xl=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=Wl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Invalid data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},tf=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=Vl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Missing data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},ef=(t,e,r,n={pathDelim:"."})=>{const s=Object.create(Kl);return s._op=Hl,s.path=t,s.message=e,s.cause=r,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${c(this.path,sr(n.pathDelim))}: "${this.message}")`}}),s},rf=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=zl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},nf=t(2,((t,e)=>{switch(t._op){case"And":return Ql(nf(t.left,e),nf(t.right,e));case"Or":return Zl(nf(t.left,e),nf(t.right,e));case Wl:return Xl([...e,...t.path],t.message);case Vl:return tf([...e,...t.path],t.message);case Hl:return ef([...e,...t.path],t.message,t.cause);case zl:return rf([...e,...t.path],t.message)}})),sf={_tag:"Empty"},of=t(2,((t,e)=>{let r=to(e),n=t;for(;"Cons"===r._tag;){const t=r.head;switch(t._tag){case"Empty":r=r.tail;break;case"AndThen":r=Zi(t.first,Zi(t.second,r.tail));break;case"MapName":n=Ye(n,t.f),r=r.tail;break;case"Nested":n=Oe(n,t.name),r=r.tail;break;case"Unnested":if(!c(je(n),Se(t.name)))return Ht(tf(n,`Expected ${t.name} to be in path in ConfigProvider#unnested`));n=xe(n),r=r.tail}}return Vt(n)})),cf=(t,e)=>[...t,...e],af=Symbol.for("effect/ConfigProvider"),uf=Mr("effect/ConfigProvider"),hf=Symbol.for("effect/ConfigProviderFlat"),lf=t=>({[af]:af,pipe(){return rt(this,arguments)},...t}),ff=t=>{const{pathDelim:e,seqDelim:r}=Object.assign({},{pathDelim:"_",seqDelim:","},t),n=()=>"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env?process.env:{};return s=(t=>({[hf]:hf,patch:t.patch,load:(e,r,n=!0)=>t.load(e,r,n),enumerateChildren:t.enumerateChildren}))({load:(t,s,i=!0)=>{const o=(t=>c(t,sr(e)))(t),a=n();return c(o in a?ie(a[o]):se(),Mu((()=>tf(t,`Expected ${o} to exist in the process context`))),hu((e=>pf(e,t,s,r,i))))},enumerateChildren:t=>ju((()=>{const r=n();return(t=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)})(Object.keys(r).map((t=>t.toUpperCase().split(e))).filter((e=>{for(let r=0;r<t.length;r++){const n=c(t,Ce(r)),s=e[r];if(void 0===s||n!==s)return!1}return!0})).flatMap((e=>e.slice(t.length,t.length+1))))})),patch:sf}),lf({load:t=>hu(bf(s,[],t,!1),(e=>ae(je(e),{onNone:()=>su(tf([],`Expected a single value having structure: ${t}`)),onSome:Nu}))),flattened:s});var s},bf=(t,e,r,n)=>{const s=r;switch(s._tag){case"Constant":return Nu(ze(s.value));case"Described":return Cu((()=>bf(t,e,s.config,n)));case"Fail":return su(tf(e,s.message));case"Fallback":return c(Cu((()=>bf(t,e,s.first,n))),Qa((r=>s.condition(r)?c(bf(t,e,s.second,n),Qa((t=>su(Zl(r,t))))):su(r))));case"Lazy":return Cu((()=>bf(t,e,s.config(),n)));case"MapOrFail":return Cu((()=>c(bf(t,e,s.original,n),hu(mu((t=>c(s.mapOrFail(t),Mu(nf(((t,e)=>{let r=e;if("Nested"===r._tag){const e=t.slice();for(;"Nested"===r._tag;)e.push(r.name),r=r.config;return e}return t})(e,s.original))))))))));case"Nested":return Cu((()=>bf(t,cf(e,ze(s.name)),s.config,n)));case"Primitive":return c(of(e,t.patch),hu((e=>c(t.load(e,s,n),hu((t=>{if(0===t.length){const t=c(ke(r=e)?ie(Re(r)):se(),he((()=>"<n/a>")));return su(tf([],`Expected ${s.description} with name ${t}`))}var r;return Nu(t)}))))));case"Sequence":return c(of(e,t.patch),hu((r=>c(t.enumerateChildren(r),hu(Sf),hu((r=>0===r.length?Cu((()=>vu(bf(t,e,s.config,!0),ze))):c(mu(r,(r=>bf(t,Me(e,`[${r}]`),s.config,!0))),vu((t=>{const e=Ke(t);return ze(0===e.length?[]:e)})))))))));case"HashMap":return Cu((()=>c(of(e,t.patch),hu((e=>c(t.enumerateChildren(e),hu((r=>c(r,mu((r=>bf(t,cf(e,ze(r)),s.valueConfig,n))),vu((t=>0===t.length?ze($i()):c(mf(t),Ye((t=>(t=>{const e=Cs(_s());for(const r of t)Is(e,r[0],r[1]);return(r=e)._editable=!1,r;var r})(Pe(ve(r),t))))))))))))))));case"ZipWith":return Cu((()=>c(bf(t,e,s.left,n),ru,hu((r=>c(bf(t,e,s.right,n),ru,hu((t=>{if(zt(r)&&zt(t))return su(Ql(r.left,t.left));if(zt(r)&&Yt(t))return su(r.left);if(Yt(r)&&zt(t))return su(t.left);if(Yt(r)&&Yt(t)){const n=c(e,sr(".")),i=df(e,n),[o,a]=((t,e,r,n)=>{const s=tr(r.length,(e=>e>=n.length?se():ie([t(e),e+1]))),i=tr(n.length,(t=>t>=r.length?se():ie([e(t),t+1])));return[cf(r,s),cf(n,i)]})(i,i,c(r.right,Ye(Vt)),c(t.right,Ye(Vt)));return c(o,Pe(a),mu((([t,e])=>c(Ju(t,e),vu((([t,e])=>s.zip(t,e)))))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")}))))))))}},df=(t,e)=>r=>Ht(tf(t,`The element at index ${r} in a sequence at path "${e}" was missing`)),pf=(t,e,r,n,s)=>s?c(((t,e)=>{const r=t.split(new RegExp(`\\s*${(t=>t.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"))(e)}\\s*`));return r})(t,n),mu((t=>r.parse(t.trim()))),Mu(nf(e))):c(r.parse(t),Ou({onFailure:nf(e),onSuccess:ze})),mf=t=>Object.keys(t[0]).map((e=>t.map((t=>t[e])))),Sf=t=>c(mu(t,yf),Ou({onFailure:()=>[],onSuccess:De(ir)}),ru,vu(Qt)),gf=/^(\[(\d+)\])$/,yf=t=>{const e=t.match(gf);if(null!==e){const t=e[2];return c(void 0!==t&&t.length>0?ie(t):se(),me(wf))}return se()},wf=t=>{const e=Number.parseInt(t);return Number.isNaN(e)?se():ie(e)},_f=Symbol.for("effect/Console"),vf=Mr("effect/Console"),Of={[_f]:_f,assert:(t,...e)=>ju((()=>{console.assert(t,...e)})),clear:ju((()=>{console.clear()})),count:t=>ju((()=>{console.count(t)})),countReset:t=>ju((()=>{console.countReset(t)})),debug:(...t)=>ju((()=>{console.debug(...t)})),dir:(t,e)=>ju((()=>{console.dir(t,e)})),dirxml:(...t)=>ju((()=>{console.dirxml(...t)})),error:(...t)=>ju((()=>{console.error(...t)})),group:t=>ju(t?.collapsed?()=>console.groupCollapsed(t?.label):()=>console.group(t?.label)),groupEnd:ju((()=>{console.groupEnd()})),info:(...t)=>ju((()=>{console.info(...t)})),log:(...t)=>ju((()=>{console.log(...t)})),table:(t,e)=>ju((()=>{console.table(t,e)})),time:t=>ju((()=>console.time(t))),timeEnd:t=>ju((()=>console.timeEnd(t))),timeLog:(t,...e)=>ju((()=>{console.timeLog(t,...e)})),trace:(...t)=>ju((()=>{console.trace(...t)})),warn:(...t)=>ju((()=>{console.warn(...t)})),unsafe:console},Mf=Symbol.for("effect/Random"),Ef=Mr("effect/Random");class If{seed;[Mf]=Mf;PRNG;constructor(t){this.seed=t,this.PRNG=new v(t)}get next(){return ju((()=>this.PRNG.number()))}get nextBoolean(){return vu(this.next,(t=>t>.5))}get nextInt(){return ju((()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER)))}nextRange(t,e){return vu(this.next,(r=>(e-t)*r+t))}nextIntBetween(t,e){return ju((()=>this.PRNG.integer(e-t)+t))}shuffle(t){return kf(t,(t=>this.nextIntBetween(0,t)))}}const kf=(t,e)=>Cu((()=>c(ju((()=>Array.from(t))),hu((t=>{const r=[];for(let e=t.length;e>=2;e-=1)r.push(e);return c(r,Su((r=>c(e(r),vu((e=>Ff(t,r-1,e)))))),Ga(Gr(t)))}))))),Ff=(t,e,r)=>{const n=t[e];return t[e]=t[r],t[r]=n,t},Nf=t=>new If(A(t)),Cf=Symbol.for("effect/Tracer"),jf=t=>({[Cf]:Cf,...t}),Af=Mr("effect/Tracer"),Rf=Mr("effect/ParentSpan"),xf=function(){return function(t){let e="";for(let r=0;r<t;r++)e+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return e}}();class $f{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(t,e,r,n,s,i){this.name=t,this.parent=e,this.context=r,this.startTime=s,this.kind=i,this.status={_tag:"Started",startTime:s},this.attributes=new Map,this.traceId="Some"===e._tag?e.value.traceId:xf(32),this.spanId=xf(16),this.links=Array.from(n)}end(t,e){this.status={_tag:"Ended",endTime:t,exit:e,startTime:this.status.startTime}}attribute(t,e){this.attributes.set(t,e)}event(t,e,r){this.events.push([t,e,r??{}])}addLinks(t){this.links.push(...t)}}const Tf=jf({span:(t,e,r,n,s,i)=>new $f(t,e,r,n,s,i),context:t=>t()}),Lf=c(Ir(),Fr(Pl,Gl()),Fr(vf,Of),Fr(Ef,Nf(Math.random())),Fr(uf,ff()),Fr(Af,Tf)),Df=f(Symbol.for("effect/DefaultServices/currentServices"),(()=>hh(Lf))),Pf=t=>(t=>Ua((e=>t(e.currentDefaultServices))))((e=>t(e.unsafeMap.get(Pl.key)))),Bf=Pf((t=>t.currentTimeMillis)),qf=Pf,Uf=Symbol.for("effect/FiberRefs");class Jf{locals;[Uf]=Uf;constructor(t){this.locals=t}pipe(){return rt(this,arguments)}}const Gf=t(3,((t,e,r)=>{const n=new Map(t.locals);return r.locals.forEach(((t,r)=>{const s=t[0][1];if(!t[0][0][U](e)){if(!n.has(r)){if(J(s,r.initial))return;return void n.set(r,[[e,r.join(r.initial,s)]])}const i=n.get(r),[o,c]=((t,e,r,n=!1)=>{const s=t;let i,o=e,c=r,a=n;for(;void 0===i;)if(ke(o)&&ke(c)){const t=Ae(o)[0],e=xe(o),r=Ae(c)[0],n=Ae(c)[1],s=xe(c);t.startTimeMillis<r.startTimeMillis?(c=s,a=!0):t.startTimeMillis>r.startTimeMillis?o=e:t.id<r.id?(c=s,a=!0):t.id>r.id?o=e:i=[n,a]}else i=[s.initial,!0];return i})(r,i,t);if(c){const t=r.diff(o,s),c=i[0][1],a=r.join(c,r.patch(t)(c));if(!J(c,a)){let t;const s=i[0][0];t=s[U](e)?[[s,a],...i.slice(1)]:[[e,a],...i],n.set(r,t)}}}})),new Jf(n)})),Wf=t(2,((t,e)=>{const r=new Map;return Vf(t,r,e),new Jf(r)})),Vf=(t,e,r)=>{t.locals.forEach(((t,n)=>{const s=t[0][1],i=n.patch(n.fork)(s);J(s,i)?e.set(n,t):e.set(n,[[r,i],...t])}))},Hf=t(2,((t,e)=>{const r=new Map(t.locals);return r.delete(e),new Jf(r)})),zf=t(2,((t,e)=>t.locals.has(e)?ie(Ae(t.locals.get(e))[1]):se())),Yf=t(2,((t,e)=>c(zf(t,e),he((()=>e.initial))))),Kf=t(2,((t,{fiberId:e,fiberRef:r,value:n})=>{if(0===t.locals.size)return new Jf(new Map([[r,[[e,n]]]]));const s=new Map(t.locals);return Qf(s,e,r,n),new Jf(s)})),Qf=(t,e,r,n)=>{const s=t.get(r)??[];let i;if(ke(s)){const[t,r]=Ae(s);if(t[U](e)){if(J(r,n))return;i=[[e,n],...s.slice(1)]}else i=[[e,n],...s]}else i=[[e,n]];t.set(r,i)},Zf=t(2,((t,{entries:e,forkAs:r})=>{if(0===t.locals.size)return new Jf(new Map(e));const n=new Map(t.locals);return void 0!==r&&Vf(t,n,r),e.forEach((([t,e])=>{1===e.length?Qf(n,e[0][0],t,e[0][1]):e.forEach((([e,r])=>{Qf(n,e,t,r)}))})),new Jf(n)})),Xf=Yf,tb=Zf,eb=function(){return t=new Map,new Jf(t);var t},rb=Yu,nb=Ku,sb=Qu,ib=ne(c(ir,re((t=>t.ordinal)))),ob=t=>t.replace(/[\s="]/g,"_"),cb=t=>e=>`${ob(e.label)}=${t-e.startTime}ms`,ab=Mt,ub=Ft;class hb extends ub{}const lb=Symbol.for("effect/Readable"),fb=Symbol.for("effect/Ref"),bb={_A:t=>t};class db extends hb{ref;commit(){return this.get}[fb]=bb;[lb]=lb;constructor(t){super(),this.ref=t,this.get=ju((()=>bi(this.ref)))}get;modify(t){return ju((()=>{const e=bi(this.ref),[r,n]=t(e);return e!==n&&di(n)(this.ref),r}))}}const pb=t=>new db(li(t)),mb=t=>ju((()=>pb(t))),Sb=t=>t.get,gb=t(2,((t,e)=>t.modify((()=>[void 0,e])))),yb=t(2,((t,e)=>t.modify(e))),wb=t(2,((t,e)=>t.modify((t=>[void 0,e(t)])))),_b="Empty",vb="Remove",Ob="Update",Mb="AndThen",Eb={_tag:_b},Ib=(t,e)=>{const r=new Map(t.locals);let n=Eb;for(const[t,s]of e.locals.entries()){const e=Ae(s)[1],i=r.get(t);if(void 0!==i){const r=Ae(i)[1];J(r,e)||(n=kb({_tag:Ob,fiberRef:t,patch:t.diff(r,e)})(n))}else n=kb({_tag:"Add",fiberRef:t,value:e})(n);r.delete(t)}for(const[t]of r.entries())n=kb({_tag:vb,fiberRef:t})(n);return n},kb=t(2,((t,e)=>({_tag:Mb,first:t,second:e}))),Fb=t(3,((t,e,r)=>{let n=r,s=ze(t);for(;ke(s);){const t=Ae(s),r=xe(s);switch(t._tag){case _b:s=r;break;case"Add":n=Kf(n,{fiberId:e,fiberRef:t.fiberRef,value:t.value}),s=r;break;case vb:n=Hf(n,t.fiberRef),s=r;break;case Ob:{const i=Yf(n,t.fiberRef);n=Kf(n,{fiberId:e,fiberRef:t.fiberRef,value:t.fiberRef.patch(t.patch)(i)}),s=r;break}case Mb:s=Oe(t.first)(Oe(t.second)(r))}}return n})),Nb="effect/MetricLabel",Cb=Symbol.for(Nb);class jb{key;value;[Cb]=Cb;_hash;constructor(t,e){this.key=t,this.value=e,this._hash=D(Nb+this.key+this.value)}[j](){return this._hash}[U](t){return Rb(t)&&this.key===t.key&&this.value===t.value}pipe(){return rt(this,arguments)}}const Ab=(t,e)=>new jb(t,e),Rb=t=>m(t,Cb),xb=t(2,((t,e)=>du(t,{onFailure:t=>{const r=e(t);switch(r._tag){case"None":return ou(t);case"Some":return r.value}},onSuccess:Nu}))),$b=qf,Tb=t(2,((t,e)=>pu(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),Lb=Ua((t=>Nu(t.getFiberRefs()))),Db=t=>(...e)=>{const r=fe(t);let n;for(let t=0,r=e.length;t<r;t++){const r=e[t];Qc(r)&&(n=void 0!==n?Kc(n,r):r,e=[...e.slice(0,t),...e.slice(t+1)],t--)}return void 0===n&&(n=Wc),Ua((t=>(t.log(e,n,r),Tu)))},Pb=Db(nb),Bb=Db(rb),qb=t(2,((t,e)=>du(t,{onFailure:t=>cu((()=>e(t))),onSuccess:Nu}))),Ub=t(2,((t,e)=>ku(t,(()=>ju(e))))),Jb=t(3,((t,e,r)=>_l((n=>vl(t,Fr(n,e,r)))))),Gb=t(3,((t,e,r)=>_l((n=>hu(r,(r=>vl(t,c(n,Fr(e,r))))))))),Wb=t=>{const e=Mn(t);return Pf((t=>t.sleep(e)))},Vb=Nu(se()),Hb=t(3,((t,e,r)=>hu(e,(n=>hu(t,(t=>vu(e,(e=>[r(n,e),t])))))))),zb=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return Wu(e(r.left),ou(t));case"Right":return ou(t)}},onSuccess:Nu}))),Yb=t(2,((t,e)=>du(t,{onFailure:t=>Wu(e(t),ou(t)),onSuccess:Nu}))),Kb=t(2,((t,e)=>Cu((()=>e()?vu(t,ie):Nu(se()))))),Qb="Sequential",Zb="Parallel",Xb={_tag:Qb},td={_tag:Zb},ed=Xb,rd=td,nd=t=>({_tag:"ParallelN",parallelism:t}),sd=Ib,id=Fb,od="effect/FiberStatus",cd=Symbol.for(od),ad="Done",ud="Running",hd="Suspended",ld=D(`${od}-${ad}`);class fd{[cd]=cd;_tag=ad;[j](){return ld}[U](t){return pd(t)&&t._tag===ad}}class bd{runtimeFlags;[cd]=cd;_tag=ud;constructor(t){this.runtimeFlags=t}[j](){return c(A(od),x(A(this._tag)),x(A(this.runtimeFlags)),q(this))}[U](t){return pd(t)&&t._tag===ud&&this.runtimeFlags===t.runtimeFlags}}class dd{runtimeFlags;blockingOn;[cd]=cd;_tag=hd;constructor(t,e){this.runtimeFlags=t,this.blockingOn=e}[j](){return c(A(od),x(A(this._tag)),x(A(this.runtimeFlags)),x(A(this.blockingOn)),q(this))}[U](t){return pd(t)&&t._tag===hd&&this.runtimeFlags===t.runtimeFlags&&J(this.blockingOn,t.blockingOn)}}const pd=t=>m(t,cd),md=new fd,Sd=t=>new bd(t),gd=Symbol.for("effect/Micro"),yd=Symbol.for("effect/Micro/MicroExit"),wd=Symbol.for("effect/Micro/MicroCause"),_d={_E:e};class vd extends globalThis.Error{_tag;traces;[wd];constructor(t,e,r){const n=`MicroCause.${t}`;let s,i,o;if(e instanceof globalThis.Error){s=`(${n}) ${e.name}`,i=e.message;const t=i.split("\n").length;o=e.stack?`(${n}) ${e.stack.split("\n").slice(0,t+3).join("\n")}`:`${s}: ${i}`}else s=n,i=K(e,0),o=`${s}: ${i}`;r.length>0&&(o+=`\n ${r.join("\n ")}`),super(i),this._tag=t,this.traces=r,this[wd]=_d,this.name=s,this.stack=o}pipe(){return rt(this,arguments)}toString(){return this.stack}[H](){return this.stack}}class Od extends vd{defect;constructor(t,e=[]){super("Die",t,e),this.defect=t}}class Md extends vd{constructor(t=[]){super("Interrupt","interrupted",t)}}const Ed=(t=[])=>new Md(t),Id=Symbol.for("effect/Micro/MicroFiber"),kd={_A:e,_E:e};class Fd{context;interruptible;[Id];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,e=!0){this.context=t,this.interruptible=e,this[Id]=kd}getRef(t){return(e=this.context).unsafeMap.has((r=t).key)?e.unsafeMap.get(r.key):yr(r);var e,r}addObserver(t){return this._exit?(t(this._exit),o):(this._observers.push(t),()=>{const e=this._observers.indexOf(t);e>=0&&this._observers.splice(e,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(Xd))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(void 0!==this._yielded){const t=this._yielded;this._yielded=void 0,t()}const e=this.runLoop(t);if(e===Td)return;const r=Nd.interruptChildren&&Nd.interruptChildren(this);if(void 0!==r)return this.evaluate(zd(r,(()=>e)));this._exit=e;for(let t=0;t<this._observers.length;t++)this._observers[t](e);this._observers.length=0}runLoop(t){let e=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!e&&this.getRef(cp).shouldYield(this)){e=!0;const t=r;r=zd(Wd,(()=>t))}if(r=r[Ad](this),r===Td){const t=this._yielded;return yd in t?(this._yielded=void 0,t):Td}}}catch(t){return m(r,Ad)?tp(t):tp(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const e=this._stack.pop();if(!e)return;const r=e[$d]&&e[$d](this);if(r)return{[t]:r};if(e[t])return e}}_yielded=void 0;yieldWith(t){return this._yielded=t,Td}children(){return this._children??=new Set}}const Nd=f("effect/Micro/fiberMiddleware",(()=>({interruptChildren:void 0}))),Cd=Symbol.for("effect/Micro/identifier"),jd=Symbol.for("effect/Micro/args"),Ad=Symbol.for("effect/Micro/evaluate"),Rd=Symbol.for("effect/Micro/successCont"),xd=Symbol.for("effect/Micro/failureCont"),$d=Symbol.for("effect/Micro/ensureCont"),Td=Symbol.for("effect/Micro/Yield"),Ld={_A:e,_E:e,_R:e},Dd={...ab,_op:"Micro",[gd]:Ld,pipe(){return rt(this,arguments)},[Symbol.iterator](){return new _(new E(this))},toJSON(){return{_id:"Micro",op:this[Cd],...jd in this?{args:this[jd]}:void 0}},toString(){return Y(this)},[H](){return Y(this)}};function Pd(){return tp("Micro.evaluate: Not implemented")}const Bd=t=>({...Dd,[Cd]:t.op,[Ad]:t.eval??Pd,[Rd]:t.contA,[xd]:t.contE,[$d]:t.ensure}),qd=t=>{const e=Bd(t);return function(){const r=Object.create(e);return r[jd]=!1===t.single?arguments:arguments[0],r}},Ud=t=>{const e={...Bd(t),[yd]:yd,_tag:t.op,get[t.prop](){return this[jd]},toJSON(){return{_id:"MicroExit",_tag:t.op,[t.prop]:this[jd]}},[U](e){return Kd(e)&&e._tag===t.op&&J(this[jd],e[jd])},[j](){return q(this,x(D(t.op))(A(this[jd])))}};return function(t){const r=Object.create(e);return r[jd]=t,r[Rd]=void 0,r[xd]=void 0,r[$d]=void 0,r}},Jd=Ud({op:"Success",prop:"value",eval(t){const e=t.getCont(Rd);return e?e[Rd](this[jd],t):t.yieldWith(this)}}),Gd=Ud({op:"Failure",prop:"cause",eval(t){let e=t.getCont(xd);for(;"Interrupt"===this[jd]._tag&&e&&t.interruptible;)e=t.getCont(xd);return e?e[xd](this[jd],t):t.yieldWith(this)}}),Wd=qd({op:"Yield",eval(t){let e=!1;return t.getRef(cp).scheduleTask((()=>{e||t.evaluate(ep)}),this[jd]??0),t.yieldWith((()=>{e=!0}))}})(0),Vd=Jd(void 0),Hd=qd({op:"WithMicroFiber",eval(t){return this[jd](t)}}),zd=t(2,((t,e)=>{const r=Object.create(Yd);return r[jd]=t,r[Rd]=e,r})),Yd=Bd({op:"OnSuccess",eval(t){return t._stack.push(this),this[jd]}}),Kd=t=>m(t,yd),Qd=Jd,Zd=Gd,Xd=Zd(Ed()),tp=t=>Zd(((t,e=[])=>new Od(t,e))(t)),ep=Qd(void 0),rp="setImmediate"in globalThis?globalThis.setImmediate:t=>setTimeout(t,0);class np{tasks=[];running=!1;scheduleTask(t,e){this.tasks.push(t),this.running||(this.running=!0,rp(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){const t=this.tasks;this.tasks=[];for(let e=0,r=t.length;e<r;e++)t[e]()}shouldYield(t){return t.currentOpCount>=t.getRef(op)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const sp=t(2,((t,e)=>Hd((r=>{const n=r.context;return r.context=e(n),hp(t,(()=>(r.context=n,Vd)))})))),ip=t(2,((t,e)=>sp(t,Ar(e))));class op extends(Rr()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048})){}class cp extends(Rr()("effect/Micro/currentScheduler",{defaultValue:()=>new np})){}const ap=t(2,((t,e)=>{const r=Object.create(up);return r[jd]=t,r[Rd]=e.onSuccess,r[xd]=e.onFailure,r})),up=Bd({op:"OnSuccessAndFailure",eval(t){return t._stack.push(this),this[jd]}}),hp=t(2,((t,e)=>bp((r=>ap(r(t),{onFailure:t=>zd(e(Zd(t)),(()=>Gd(t))),onSuccess:t=>zd(e(Qd(t)),(()=>Jd(t)))}))))),lp=qd({op:"SetInterruptible",ensure(t){if(t.interruptible=this[jd],t._interrupted&&t.interruptible)return()=>Xd}}),fp=t=>Hd((e=>e.interruptible?t:(e.interruptible=!0,e._stack.push(lp(!1)),e._interrupted?Xd:t))),bp=t=>Hd((r=>r.interruptible?(r.interruptible=!1,r._stack.push(lp(!0)),t(fp)):t(e)));class dp{buckets=[];scheduleTask(t,e){const r=this.buckets.length;let n,s=0;for(;s<r&&this.buckets[s][0]<=e;s++)n=this.buckets[s];n&&n[0]===e?n[1].push(t):s===r?this.buckets.push([e,[t]]):this.buckets.splice(s,0,[e,[t]])}}class pp{maxNextTickBeforeTimer;running=!1;tasks=new dp;constructor(t){this.maxNextTickBeforeTimer=t}starveInternal(t){const e=this.tasks.buckets;this.tasks.buckets=[];for(const[t,r]of e)for(let t=0;t<r.length;t++)r[t]();0===this.tasks.buckets.length?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout((()=>this.starveInternal(0)),0):Promise.resolve(void 0).then((()=>this.starveInternal(t+1)))}shouldYield(t){return t.currentOpCount>t.getFiberRef(ph)&&t.getFiberRef(dh)}scheduleTask(t,e){this.tasks.scheduleTask(t,e),this.running||(this.running=!0,this.starve())}}const mp=f(Symbol.for("effect/Scheduler/defaultScheduler"),(()=>new pp(2048)));class Sp{tasks=new dp;deferred=!1;scheduleTask(t,e){this.deferred?mp.scheduleTask(t,e):this.tasks.scheduleTask(t,e)}shouldYield(t){return t.currentOpCount>t.getFiberRef(ph)&&t.getFiberRef(dh)}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[e,r]of t)for(let t=0;t<r.length;t++)r[t]()}this.deferred=!0}}const gp=f(Symbol.for("effect/FiberRef/currentScheduler"),(()=>ch(mp))),yp=f(Symbol.for("effect/FiberRef/currentRequestMap"),(()=>ch(new Map))),wp=(t,e,r,n)=>{switch(t){case void 0:return e();case"unbounded":return r();case"inherit":return rh(wh,(t=>"unbounded"===t?r():t>1?n(t):e()));default:return t>1?n(t):e()}},_p="InterruptSignal",vp="Stateful",Op="Resume",Mp="YieldNow",Ep=t=>({_tag:_p,cause:t}),Ip=t=>({_tag:vp,onFiber:t}),kp=t=>({_tag:Op,effect:t}),Fp=Symbol.for("effect/FiberScope");class Np{[Fp]=Fp;fiberId=Ci;roots=new Set;add(t,e){this.roots.add(e),e.addObserver((()=>{this.roots.delete(e)}))}}class Cp{fiberId;parent;[Fp]=Fp;constructor(t,e){this.fiberId=t,this.parent=e}add(t,e){this.parent.tell(Ip((t=>{t.addChild(e),e.addObserver((()=>{t.removeChild(e)}))})))}}const jp=f(Symbol.for("effect/FiberScope/Global"),(()=>new Np)),Ap=Symbol.for("effect/Fiber"),Rp={_E:t=>t,_A:t=>t},xp=Symbol.for("effect/Fiber"),$p=t=>t.await,Tp=t=>t.inheritAll,Lp=t=>Gu(fu(t.await),t.inheritAll),Dp="effect/FiberCurrent",Pp=Symbol.for("effect/Logger"),Bp={_Message:t=>t,_Output:t=>t},qp=t=>({[Pp]:Bp,log:t,pipe(){return rt(this,arguments)}}),Up=/^[^\s"=]*$/,Jp=(t,e)=>({annotations:r,cause:n,date:s,fiberId:i,logLevel:o,message:c,spans:a})=>{const u=(e,r)=>`${ob(e)}=${(e=>e.match(Up)?e:t(e))(r)}`,h=(t,e)=>" "+u(t,e);let l=u("timestamp",s.toISOString());l+=h("level",o.label),l+=h("fiber",Ni(i));const f=(b=c,Array.isArray(b)?b:[b]);var b;for(let t=0;t<f.length;t++)l+=h("message",K(f[t],e));(t=>t._tag===Lc)(n)||(l+=h("cause",wa(n,{renderErrorCause:!0})));for(const t of a)l+=" "+cb(s.getTime())(t);for(const[t,n]of r)l+=h(t,K(n,e));return l},Gp=qp(Jp((t=>`"${t.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`)));"object"==typeof process&&null!==process&&"object"==typeof process.stdout&&null!==process.stdout&&process;const Wp="effect/MetricBoundaries",Vp=Symbol.for(Wp);class Hp{values;[Vp]=Vp;constructor(t){this.values=t,this._hash=c(D(Wp),x(B(this.values)))}_hash;[j](){return this._hash}[U](t){return zp(t)&&J(this.values,t.values)}pipe(){return rt(this,arguments)}}const zp=t=>m(t,Vp),Yp=t=>{const e=c(t,Ee(Jr(Number.POSITIVE_INFINITY)),nr);return new Hp(e)},Kp=t=>c(_e(t.count-1,(e=>t.start*Math.pow(t.factor,e))),Yr,Yp),Qp=Symbol.for("effect/MetricKeyType"),Zp="effect/MetricKeyType/Counter",Xp=Symbol.for(Zp),tm=Symbol.for("effect/MetricKeyType/Frequency"),em=Symbol.for("effect/MetricKeyType/Gauge"),rm="effect/MetricKeyType/Histogram",nm=Symbol.for(rm),sm=Symbol.for("effect/MetricKeyType/Summary"),im={_In:t=>t,_Out:t=>t};class om{incremental;bigint;[Qp]=im;[Xp]=Xp;constructor(t,e){this.incremental=t,this.bigint=e,this._hash=D(Zp)}_hash;[j](){return this._hash}[U](t){return am(t)}pipe(){return rt(this,arguments)}}class cm{boundaries;[Qp]=im;[nm]=nm;constructor(t){this.boundaries=t,this._hash=c(D(rm),x(A(this.boundaries)))}_hash;[j](){return this._hash}[U](t){return um(t)&&J(this.boundaries,t.boundaries)}pipe(){return rt(this,arguments)}}const am=t=>m(t,Xp),um=t=>m(t,nm),hm=Symbol.for("effect/MetricKey"),lm={_Type:t=>t},fm=er(J);class bm{name;keyType;description;tags;[hm]=lm;constructor(t,e,r,n=[]){this.name=t,this.keyType=e,this.description=r,this.tags=n,this._hash=c(D(this.name+this.description),x(A(this.keyType)),x(B(this.tags)))}_hash;[j](){return this._hash}[U](t){return dm(t)&&this.name===t.name&&J(this.keyType,t.keyType)&&J(this.description,t.description)&&fm(this.tags,t.tags)}pipe(){return rt(this,arguments)}}const dm=t=>m(t,hm),pm=t(2,((t,e)=>0===e.length?t:new bm(t.name,t.keyType,t.description,Ve(t.tags,e)))),mm=Symbol.for("effect/MetricState"),Sm="effect/MetricState/Counter",gm=Symbol.for(Sm),ym="effect/MetricState/Frequency",wm=Symbol.for(ym),_m="effect/MetricState/Gauge",vm=Symbol.for(_m),Om="effect/MetricState/Histogram",Mm=Symbol.for(Om),Em="effect/MetricState/Summary",Im=Symbol.for(Em),km={_A:t=>t};class Fm{count;[mm]=km;[gm]=gm;constructor(t){this.count=t}[j](){return c(A(Sm),x(A(this.count)),q(this))}[U](t){return xm(t)&&this.count===t.count}pipe(){return rt(this,arguments)}}const Nm=er(J);class Cm{occurrences;[mm]=km;[wm]=wm;constructor(t){this.occurrences=t}_hash;[j](){return c(D(ym),x(B(ve(this.occurrences.entries()))),q(this))}[U](t){return $m(t)&&Nm(ve(this.occurrences.entries()),ve(t.occurrences.entries()))}pipe(){return rt(this,arguments)}}class jm{value;[mm]=km;[vm]=vm;constructor(t){this.value=t}[j](){return c(A(_m),x(A(this.value)),q(this))}[U](t){return Tm(t)&&this.value===t.value}pipe(){return rt(this,arguments)}}class Am{buckets;count;min;max;sum;[mm]=km;[Mm]=Mm;constructor(t,e,r,n,s){this.buckets=t,this.count=e,this.min=r,this.max=n,this.sum=s}[j](){return c(A(Om),x(A(this.buckets)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return Lm(t)&&J(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}class Rm{error;quantiles;count;min;max;sum;[mm]=km;[Im]=Im;constructor(t,e,r,n,s,i){this.error=t,this.quantiles=e,this.count=r,this.min=n,this.max=s,this.sum=i}[j](){return c(A(Em),x(A(this.error)),x(A(this.quantiles)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return Dm(t)&&this.error===t.error&&J(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}const xm=t=>m(t,gm),$m=t=>m(t,wm),Tm=t=>m(t,vm),Lm=t=>m(t,Mm),Dm=t=>m(t,Im),Pm=Symbol.for("effect/MetricHook"),Bm={_In:t=>t,_Out:t=>t},qm=t=>({[Pm]:Bm,pipe(){return rt(this,arguments)},...t}),Um=BigInt(0),Jm=(t,e,r)=>{const n=r.length;if(!ke(e))return[];const s=e[0],i=e.slice(1),o=Gm(t,n,se(),0,s,r),c=ze(o);return i.forEach((e=>{c.push(Gm(t,n,o.value,o.consumed,e,o.rest))})),Ye(c,(t=>[t.quantile,t.value]))},Gm=(t,e,r,n,s,i)=>{let o=t,c=e,a=r,u=n,h=s,l=i,f=t,b=e,d=r,p=n,m=s,S=i;for(;;){if(!ke(l))return{quantile:h,value:se(),consumed:u,rest:[]};if(1===h)return{quantile:h,value:ie(Re(l)),consumed:u+l.length,rest:[]};const t=Ae(l),e=$e(l,(e=>e===t)),r=h*c,n=o/2*r,s=u+e[0].length,i=Math.abs(s-r);if(s<r-n)f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;else{if(s>r+n)return{quantile:h,value:oe(a)?ie(t):a,consumed:u,rest:l};switch(a._tag){case"None":f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue;case"Some":if(i<Math.abs(r-a.value)){f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue}return{quantile:h,value:ie(a.value),consumed:u,rest:l}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},Wm=Symbol.for("effect/MetricPair"),Vm={_Type:t=>t},Hm=(t,e)=>({[Wm]:Vm,metricKey:t,metricState:e,pipe(){return rt(this,arguments)}}),zm=Symbol.for("effect/MetricRegistry");class Ym{[zm]=zm;map=Cl();snapshot(){const t=[];for(const[e,r]of this.map)t.push(Hm(e,r.get()));return t}get(t){const e=c(this.map,jl(t),be);if(null==e){if(am(t.keyType))return this.getCounter(t);if(m(t.keyType,em))return this.getGauge(t);if(m(t.keyType,tm))return this.getFrequency(t);if(um(t.keyType))return this.getHistogram(t);if((t=>m(t,sm))(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}return e}getCounter(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{let e=t.keyType.bigint?Um:0;const r=t.keyType.incremental?t.keyType.bigint?t=>t>=Um:t=>t>=0:()=>!0,n=t=>{r(t)&&(e+=t)};return qm({get:()=>new Fm(e),update:n,modify:n})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getFrequency(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const e=new Map;for(const r of t.keyType.preregisteredWords)e.set(r,0);const r=t=>{const r=e.get(t)??0;e.set(t,r+1)};return qm({get:()=>new Cm(e),update:r,modify:r})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getGauge(t){let e=c(this.map,jl(t),be);if(null==e){const r=((t,e)=>{let r=e;return qm({get:()=>new jm(r),update:t=>{r=t},modify:t=>{r+=t}})})(0,t.keyType.bigint?BigInt(0):0);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getHistogram(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const e=t.keyType.boundaries.values,r=e.length,n=new Uint32Array(r+1),s=new Float64Array(r);let i=0,o=0,a=Number.MAX_VALUE,u=Number.MIN_VALUE;c(e,De(ir),Ye(((t,e)=>{s[e]=t})));const h=t=>{let e=0,c=r;for(;e!==c;){const r=Math.floor(e+(c-e)/2);t<=s[r]?c=r:e=r,c===e+1&&(t<=s[e]?c=e:e=c)}n[e]=n[e]+1,i+=1,o+=t,t<a&&(a=t),t>u&&(u=t)},l=()=>{const t=we(r);let e=0;for(let i=0;i<r;i++)e+=n[i],t[i]=[s[i],e];return t};return qm({get:()=>{return t={buckets:l(),count:i,min:a,max:u,sum:o},new Am(t.buckets,t.count,t.min,t.max,t.sum);var t},update:h,modify:h})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getSummary(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const{error:e,maxAge:r,maxSize:n,quantiles:s}=t.keyType,i=c(s,De(ir)),o=we(n);let a=0,u=0,h=0,l=0,f=0;const b=t=>{const s=[];let c=0;for(;c!==n-1;){const e=o[c];if(null!=e){const[n,i]=e,o=xn(t-n);Wn(o,Cn)&&Gn(o,r)&&s.push(i)}c+=1}return Jm(e,i,De(s,ir))},d=(t,e)=>{n>0&&(a+=1,o[a%n]=[e,t]),l=0===u?t:Math.min(l,t),f=0===u?t:Math.max(f,t),u+=1,h+=t};return qm({get:()=>{return t={error:e,quantiles:b(Date.now()),count:u,min:l,max:f,sum:h},new Rm(t.error,t.quantiles,t.count,t.min,t.max,t.sum);var t},update:([t,e])=>d(t,e),modify:([t,e])=>d(t,e)})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}}const Km=Symbol.for("effect/Metric"),Qm={_Type:t=>t,_In:t=>t,_Out:t=>t},Zm=f(Symbol.for("effect/Metric/globalMetricRegistry"),(()=>new Ym)),Xm=function(t,e,r,n){const s=Object.assign((t=>Au(t,(t=>iS(s,t)))),{[Km]:Qm,keyType:t,unsafeUpdate:e,unsafeValue:r,unsafeModify:n,register(){return this.unsafeValue([]),this},pipe(){return rt(this,arguments)}});return s},tS=(t,e)=>eS(((t,e)=>new bm(t,(t=>new om(t?.incremental??!1,t?.bigint??!1))(e),fe(e?.description)))(t,e)),eS=t=>{let e;const r=new WeakMap,n=n=>{if(0===n.length)return void 0!==e||(e=Zm.get(t)),e;let s=r.get(n);return void 0!==s||(s=Zm.get(pm(t,n)),r.set(n,s)),s};return Xm(t.keyType,((t,e)=>n(e).update(t)),(t=>n(t).get()),((t,e)=>n(e).modify(t)))},rS=(t,e,r)=>eS(((t,e,r)=>new bm(t,(t=>new cm(t))(e),fe(r)))(t,e,r)),nS=t(3,((t,e,r)=>sS(t,[Ab(e,r)]))),sS=t(2,((t,e)=>Xm(t.keyType,((r,n)=>t.unsafeUpdate(r,Ve(e,n))),(r=>t.unsafeValue(Ve(e,r))),((r,n)=>t.unsafeModify(r,Ve(e,n)))))),iS=t(2,((t,e)=>rh(Mh,(r=>ju((()=>t.unsafeUpdate(e,r))))))),oS=t(2,((t,e)=>rh(yp,(r=>ju((()=>{if(r.has(t)){const n=r.get(t);n.state.completed||(n.state.completed=!0,Sl(n.result,e))}})))))),cS=Symbol.for("effect/Supervisor"),aS={_T:t=>t};class uS{underlying;value0;[cS]=aS;constructor(t,e){this.underlying=t,this.value0=e}get value(){return this.value0}onStart(t,e,r,n){this.underlying.onStart(t,e,r,n)}onEnd(t,e){this.underlying.onEnd(t,e)}onEffect(t,e){this.underlying.onEffect(t,e)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}}class hS{left;right;_tag="Zip";[cS]=aS;constructor(t,e){this.left=t,this.right=e}get value(){return Ju(this.left.value,this.right.value)}onStart(t,e,r,n){this.left.onStart(t,e,r,n),this.right.onStart(t,e,r,n)}onEnd(t,e){this.left.onEnd(t,e),this.right.onEnd(t,e)}onEffect(t,e){this.left.onEffect(t,e),this.right.onEffect(t,e)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}}const lS=t=>m(t,cS)&&S(t,"Zip");class fS{effect;[cS]=aS;constructor(t){this.effect=t}get value(){return this.effect}onStart(t,e,r,n){}onEnd(t,e){}onEffect(t,e){}onSuspend(t){}onResume(t){}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}onRun(t,e){return t()}}const bS=f("effect/Supervisor/none",(()=>new fS(Tu))),dS="Empty",pS="AddSupervisor",mS="RemoveSupervisor",SS="AndThen",gS={_tag:dS},yS=(t,e)=>({_tag:SS,first:t,second:e}),wS=(t,e)=>J(t,e)?bS:lS(t)?wS(t.left,e).zip(wS(t.right,e)):t,_S=t=>J(t,bS)?ti():lS(t)?c(_S(t.left),ci(_S(t.right))):ei(t),vS=zo({empty:gS,patch:(t,e)=>((t,e)=>{let r=t,n=e;for(;cn(n);){const t=hn(n);switch(t._tag){case dS:n=dn(n);break;case pS:r=r.zip(t.supervisor),n=dn(n);break;case mS:r=wS(r,t.supervisor),n=dn(n);break;case SS:n=Xr(t.first)(Xr(t.second)(dn(n)))}}return r})(e,Jr(t)),combine:yS,diff:(t,e)=>{if(J(t,e))return gS;const r=_S(t),n=_S(e),s=c(n,oi(r),ai(gS,((t,e)=>yS(t,{_tag:pS,supervisor:e})))),i=c(r,oi(n),ai(gS,((t,e)=>yS(t,{_tag:mS,supervisor:e}))));return yS(s,i)}}),OS=tS("effect_fiber_started",{incremental:!0}),MS=tS("effect_fiber_active"),ES=tS("effect_fiber_successes",{incremental:!0}),IS=tS("effect_fiber_failures",{incremental:!0}),kS=nS(rS("effect_fiber_lifetimes",Kp({start:.5,factor:2,count:35})),"time_unit","milliseconds"),FS="Continue",NS="Yield",CS={_E:t=>t,_A:t=>t},jS=t=>{throw new Error(`BUG: FiberRuntime - ${K(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},AS=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),RS=f("effect/internal/fiberRuntime/yieldedOpChannel",(()=>({currentOp:null}))),xS={[ct]:(t,e,r)=>N((()=>e.effect_instruction_i1(r))),OnStep:(t,e,r)=>tl(tl(r)),[at]:(t,e,r)=>N((()=>e.effect_instruction_i2(r))),[St]:(t,e,r)=>(t.patchRuntimeFlags(t.currentRuntimeFlags,e.patch),ic(t.currentRuntimeFlags)&&t.isInterrupted()?Kh(t.getInterruptedCause()):tl(r)),[bt]:(t,e,r)=>(N((()=>e.effect_instruction_i2(r))),N((()=>e.effect_instruction_i0()))?(t.pushStack(e),N((()=>e.effect_instruction_i1()))):Tu),[dt]:(t,e,r)=>{for(;;){const n=N((()=>e.effect_instruction_i0.next(r)));if(n.done)return tl(n.value);const s=I(n.value);if(!Uh(s))return t.pushStack(e),s;if("Failure"===s._tag)return s;r=s.value}}},$S={[_p]:(t,e,r,n)=>(t.processNewInterruptSignal(n.cause),ic(e)?Kh(n.cause):r),[Op]:()=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[vp]:(t,e,r,n)=>(n.onFiber(t,Sd(e)),r),[Mp]:(t,e,r)=>hu(Uu(),(()=>r))},TS=gt();class LS extends hb{[Ap]=Rp;[xp]=CS;_fiberRefs;_fiberId;_queue=new Array;_children=null;_observers=new Array;_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(t,e,r){if(super(),this.currentRuntimeFlags=r,this._fiberId=t,this._fiberRefs=e,hc(r)){const t=this.getFiberRef(Mh);OS.unsafeUpdate(1,t),MS.unsafeUpdate(1,t)}this.refreshRefCache()}commit(){return Lp(this)}id(){return this._fiberId}resume(t){this.tell(kp(t))}get status(){return this.ask(((t,e)=>e))}get runtimeFlags(){return this.ask(((t,e)=>e._tag===ad?t.currentRuntimeFlags:e.runtimeFlags))}scope(){return new Cp((t=this).id(),t);var t}get children(){return this.ask((t=>Array.from(t.getChildren())))}getChildren(){return null===this._children&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Ih)}fiberRefs(){return this.ask((t=>t.getFiberRefs()))}ask(t){return Cu((()=>{const e=ol(this._fiberId);return this.tell(Ip(((r,n)=>{Sl(e,ju((()=>t(r,n))))}))),ul(e)}))}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Ya((t=>{const e=e=>t(Nu(e));return this.tell(Ip((t=>{null!==t._exitValue?e(this._exitValue):t.addObserver(e)}))),ju((()=>this.tell(Ip((t=>{t.removeObserver(e)})))))}),this.id())}get inheritAll(){return Ua(((t,e)=>{const r=t.id(),n=t.getFiberRefs(),s=e.runtimeFlags,i=this.getFiberRefs(),o=Gf(n,r,i);t.setFiberRefs(o);const a=t.getFiberRef(dg);return(t=>{const e=new Da(ft);return e.effect_instruction_i0=t,e.effect_instruction_i1=void 0,e})(c(fc(s,a),mc(1),mc(16)))}))}get poll(){return ju((()=>fe(this._exitValue)))}unsafePoll(){return this._exitValue}interruptAsFork(t){return ju((()=>this.tell(Ep(zc(t)))))}unsafeInterruptAsFork(t){this.tell(Ep(zc(t)))}addObserver(t){null!==this._exitValue?t(this._exitValue):this._observers.push(t)}removeObserver(t){this._observers=this._observers.filter((e=>e!==t))}getFiberRefs(){return this.setFiberRef(dg,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=Hf(this._fiberRefs,t)}getFiberRef(t){return this._fiberRefs.locals.has(t)?this._fiberRefs.locals.get(t)[0][1]:t.initial}setFiberRef(t,e){this._fiberRefs=Kf(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:e}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Df),this.currentTracer=this.currentDefaultServices.unsafeMap.get(Af.key),this.currentSupervisor=this.getFiberRef(pg),this.currentScheduler=this.getFiberRef(gp),this.currentContext=this.getFiberRef(bh),this.currentSpan=this.currentContext.unsafeMap.get(Rf.key)}setFiberRefs(t){this._fiberRefs=t,this.refreshRefCache()}addChild(t){this.getChildren().add(t)}removeChild(t){this.getChildren().delete(t)}transferChildren(t){const e=this._children;if(this._children=null,null!==e&&e.size>0)for(const r of e)null===r._exitValue&&t.add(this.currentRuntimeFlags,r)}drainQueueOnCurrentThread(){let t=!0;for(;t;){let e=FS;const r=globalThis[Dp];globalThis[Dp]=this;try{for(;e===FS;)e=0===this._queue.length?"Done":this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[Dp]=r}this._queue.length>0&&!this._running?(this._running=!0,e===NS?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(dh))}drainQueueWhileRunning(t,e){let r=e;for(;this._queue.length>0;){const e=this._queue.splice(0,1)[0];r=$S[e._tag](this,t,r,e)}return r}isInterrupted(){return!((t=this.getFiberRef(Ih))._tag===Lc||ga(t,!0,((t,e)=>{switch(e._tag){case Lc:return ie(t);case Tc:case Dc:case Pc:return ie(!1);default:return se()}})));var t}addInterruptedCause(t){const e=this.getFiberRef(Ih);this.setFiberRef(Ih,Kc(e,t))}processNewInterruptSignal(t){this.addInterruptedCause(t),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(null===this._children||0===this._children.size)return!1;let t=!1;for(const e of this._children)e.tell(Ep(zc(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let e=!1;return Du({while:()=>!e,body:()=>{const r=t.next();return r.done?ju((()=>{e=!0})):Wa(r.value.await)},step:()=>{}})}return null}reportExitValue(t){if(hc(this.currentRuntimeFlags)){const e=this.getFiberRef(Mh),r=this.id().startTimeMillis,n=Date.now();switch(kS.unsafeUpdate(n-r,e),MS.unsafeUpdate(-1,e),t._tag){case ut:ES.unsafeUpdate(1,e);break;case it:IS.unsafeUpdate(1,e)}}if("Failure"===t._tag){const e=this.getFiberRef(vh);ta(t.cause)||"Some"!==e._tag||this.log("Fiber terminated with an unhandled error",t.cause,e)}}setExitValue(t){this._exitValue=t,this.reportExitValue(t);for(let e=this._observers.length-1;e>=0;e--)this._observers[e](t);this._observers=[]}getLoggers(){return this.getFiberRef(qS)}log(t,e,r){const n=ce(r)?r.value:this.getFiberRef(Sh),s=this.getFiberRef(DS);if(ib(s,n))return;const i=this.getFiberRef(gh),o=this.getFiberRef(mh),c=this.getLoggers(),a=this.getFiberRefs();if(ni(c)>0){const r=Nr(this.getFiberRef(Df),Pl),s=new Date(r.unsafeCurrentTimeMillis());((t,e)=>{const r=tt.fiberRefs;tt.fiberRefs=t;try{return e()}finally{tt.fiberRefs=r}})(a,(()=>{for(const r of c)r.log({fiberId:this.id(),logLevel:n,message:t,cause:e,context:a,spans:i,annotations:o,date:s})}))}}evaluateMessageWhileSuspended(t){switch(t._tag){case Mp:return NS;case _p:return this.processNewInterruptSignal(t.cause),null!==this._asyncInterruptor&&(this._asyncInterruptor(Kh(t.cause)),this._asyncInterruptor=null),FS;case Op:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),FS;case vp:return t.onFiber(this,null!==this._exitValue?md:new dd(this.currentRuntimeFlags,this._asyncBlockingOn)),FS;default:return jS(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let e=ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(this.getInterruptedCause()):t;for(;null!==e;){const t=this.runLoop(e);if(t===AS){const t=RS.currentOp;RS.currentOp=null,t._op===mt?cc(this.currentRuntimeFlags,32)?(this.tell({_tag:Mp}),this.tell(kp(el)),e=null):e=el:t._op===nt&&(e=null)}else{this.currentRuntimeFlags=c(this.currentRuntimeFlags,sc(16));const r=this.interruptAllChildren();null!==r?e=hu(r,(()=>t)):(0===this._queue.length?this.setExitValue(t):this.tell(kp(t)),e=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(kp(t));else{this._running=!0;const e=globalThis[Dp];globalThis[Dp]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[Dp]=e,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(kp(t))}patchRuntimeFlags(t,e){const r=bc(t,e);return globalThis[Dp]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,e){let r=!1;const n=t=>{r||(r=!0,this.tell(kp(t)))};ic(t)&&(this._asyncInterruptor=n);try{e(n)}catch(t){n(ou(Hc(t)))}}pushStack(t){this._stack.push(t),"OnStep"===t._op&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const t=this._stack.pop();if(t)return"OnStep"===t._op&&this._steps.pop(),t}getNextSuccessCont(){let t=this.popStack();for(;t;){if(t._op!==ot)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==ct&&t._op!==bt&&t._op!==dt)return t;t=this.popStack()}}[lt](t){return ju((()=>Cr(this.currentContext,t)))}Left(t){return su(t.left)}None(t){return su(new Ph)}Right(t){return tl(t.right)}Some(t){return tl(t.value)}Micro(t){return Ha((e=>{let r=e;const n=(t=>{const e=new Fd(cp.context(new np));return e.evaluate(t),e})(ip(t,this.currentContext));return n.addObserver((t=>{if("Success"===t._tag)return r(tl(t.value));switch(t.cause._tag){case"Interrupt":return r(Kh(zc(Ci)));case"Fail":return r(su(t.cause.error));case"Die":return r(tu(t.cause.defect))}})),Ha((t=>{r=()=>{t(Tu)},n.unsafeInterrupt()}))}))}[ht](t){const e=N((()=>t.effect_instruction_i0())),r=this.getNextSuccessCont();return void 0!==r?(r._op in xS||jS(r),xS[r._op](this,r,e)):(RS.currentOp=tl(e),AS)}[ut](t){const e=t,r=this.getNextSuccessCont();return void 0!==r?(r._op in xS||jS(r),xS[r._op](this,r,e.effect_instruction_i0)):(RS.currentOp=e,AS)}[it](t){const e=t.effect_instruction_i0,r=this.getNextFailCont();if(void 0===r)return RS.currentOp=Kh(e),AS;switch(r._op){case ot:case at:return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(oa(e)):N((()=>r.effect_instruction_i1(e)));case"OnStep":return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(oa(e)):tl(Kh(e));case St:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(Kc(e,this.getInterruptedCause())):Kh(e);default:jS(r)}}[pt](t){return N((()=>t.effect_instruction_i0(this,Sd(this.currentRuntimeFlags))))}Blocked(t){const e=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){const n=[],s=this._steps[this._steps.length-1];let i=this.popStack();for(;i&&"OnStep"!==i._op;)n.push(i),i=this.popStack();this.setFiberRefs(s.refs),this.currentRuntimeFlags=s.flags;const o=sd(s.refs,e),c=fc(s.flags,r);return tl($a(t.effect_instruction_i0,Ua((e=>{for(;n.length>0;)e.pushStack(n.pop());return e.setFiberRefs(id(e.id(),e.getFiberRefs())(o)),e.currentRuntimeFlags=bc(c)(e.currentRuntimeFlags),t.effect_instruction_i1}))))}return $u((e=>hu(HS((t=>{const e=new Da("RunBlocked");return e.effect_instruction_i0=t,e})(t.effect_instruction_i0)),(()=>e(t.effect_instruction_i1)))))}RunBlocked(t){return Su((t=>{let e=to(t),r=Xi();for(;;){const[t,n]=so(e,[Mc(),Xi()],(([t,e],r)=>{const[n,s]=yc(r);return[Ic(t,n),eo(e,s)]}));if(r=wc(r,t),Qi(n))return io(r);e=n}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")})(t.effect_instruction_i0),(t=>WS((t=>Array.from(t.map))(t),(([t,e])=>{const r=new Map,n=[];for(const t of e){n.push(Vr(t));for(const e of t)r.set(e.request,e)}const s=n.flat();return ih(_g(t.runAll(n),s,(()=>s.forEach((t=>{t.listeners.interrupted=!0})))),yp,r)}),!1,!1)))}[ft](t){const e=t.effect_instruction_i0,r=this.currentRuntimeFlags,n=bc(r,e);if(ic(n)&&this.isInterrupted())return Kh(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,e),t.effect_instruction_i1){const e=fc(n,r);return this.pushStack(new La(e,t)),N((()=>t.effect_instruction_i1(r)))}return el}[ct](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[ot](t){return this.pushStack(t),t.effect_instruction_i0}[at](t){return this.pushStack(t),t.effect_instruction_i0}[nt](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),RS.currentOp=t,AS}[mt](t){return this._isYielding=!1,RS.currentOp=t,AS}[bt](t){const e=t.effect_instruction_i1;return(0,t.effect_instruction_i0)()?(this.pushStack(t),e()):el}[dt](t){return xS[dt](this,t,void 0)}[st](t){return N((()=>t.commit()))}runLoop(t){let e=t;for(this.currentOpCount=0;;){if(2&this.currentRuntimeFlags&&this.currentSupervisor.onEffect(this,e),this._queue.length>0&&(e=this.drainQueueWhileRunning(this.currentRuntimeFlags,e)),!this._isYielding){this.currentOpCount+=1;const t=this.currentScheduler.shouldYield(this);if(!1!==t){this._isYielding=!0,this.currentOpCount=0;const r=e;e=hu(Uu({priority:t}),(()=>r))}}try{if(e=this.currentTracer.context((()=>{if(TS!==e[Ta]._V){const t=this.getFiberRef(Oh);"Some"===t._tag&&this.log(`Executing an Effect versioned ${e[Ta]._V} with a Runtime of version 3.19.14, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Wc,t)}return this[e._op](e)}),this),e===AS){const t=RS.currentOp;return t._op===mt||t._op===nt?AS:(RS.currentOp=null,t._op===ut||t._op===it?t:Kh(Hc(t)))}}catch(t){e=e!==AS&&!m(e,"_op")||!(e._op in this)?eu(`Not a valid effect: ${K(e)}`):m(t,Lh)?Kh(Kc(Hc(t),zc(Ci))):tu(t)}}}run=()=>{this.drainQueueOnCurrentThread()}}const DS=f("effect/FiberRef/currentMinimumLogLevel",(()=>ch(sb))),PS=f(Symbol.for("effect/Logger/defaultLogger"),(()=>{return t=Gp,qp((e=>{const r=Xf(e.context,Df);Nr(r,vf).unsafe.log(t.log(e))}));var t})),BS=f(Symbol.for("effect/Logger/tracerLogger"),(()=>qp((({annotations:t,cause:e,context:r,fiberId:n,logLevel:s,message:i})=>{const o=jr(Yf(r,bh),Rf);if("None"===o._tag||"ExternalSpan"===o.value._tag)return;const c=Cr(Yf(r,Df),Pl),a={};for(const[e,r]of t)a[e]=r;a["effect.fiberId"]=Ri(n),a["effect.logLevel"]=s.label,null!==e&&"Empty"!==e._tag&&(a["effect.cause"]=wa(e,{renderErrorCause:!0})),o.value.event(K(Array.isArray(i)&&1===i.length?i[0]:i),c.unsafeCurrentTimeNanos(),a)})))),qS=f(Symbol.for("effect/FiberRef/currentLoggers"),(()=>ah(ei(PS,BS)))),US=(t,r)=>{const[n,s]=(t=>{if(Array.isArray(t)||y(t))return[t,se()];const e=Object.keys(t),r=e.length;return[e.map((e=>t[e])),ie((t=>{const n={};for(let s=0;s<r;s++)n[e[s]]=t[s];return n}))]})(t);return"validate"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return hu(JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>{const e=se(),s=t.length,i=new Array(s),o=new Array(s);let c=!1;for(let r=0;r<s;r++){const n=t[r];"Left"===n._tag?(i[r]=ie(n.left),c=!0):(o[r]=n.right,i[r]=e)}return c?su("Some"===r._tag?r.value(i):i):n?.discard?Tu:Nu("Some"===r._tag?r.value(o):o)}))})(n,s,r):"either"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return n?.discard?JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):vu(JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>"Some"===r._tag?r.value(t):t))})(n,s,r):!0!==r?.discard&&"Some"===s._tag?vu(JS(n,e,r),s.value):JS(n,e,r)},JS=t((t=>y(t[0])),((t,e,r)=>Ua((n=>{const s=!0===r?.batching||"inherit"===r?.batching&&n.getFiberRef(_h);return r?.discard?wp(r.concurrency,(()=>tg(ed,r?.concurrentFinalizers)((r=>s?WS(t,((t,n)=>r(e(t,n))),!0,!1,1):Su(t,((t,n)=>r(e(t,n))))))),(()=>tg(rd,r?.concurrentFinalizers)((r=>WS(t,((t,n)=>r(e(t,n))),s,!1)))),(n=>tg(nd(n),r?.concurrentFinalizers)((r=>WS(t,((t,n)=>r(e(t,n))),s,!1,n))))):wp(r?.concurrency,(()=>tg(ed,r?.concurrentFinalizers)((r=>s?VS(t,1,((t,n)=>r(e(t,n))),!0):mu(t,((t,n)=>r(e(t,n))))))),(()=>tg(rd,r?.concurrentFinalizers)((r=>GS(t,((t,n)=>r(e(t,n))),s)))),(n=>tg(nd(n),r?.concurrentFinalizers)((r=>VS(t,n,((t,n)=>r(e(t,n))),s)))))})))),GS=(t,e,r)=>Cu((()=>{const n=ve(t),s=new Array(n.length);return Wu(WS(n,((t,r)=>hu(e(t,r),(t=>ju((()=>s[r]=t))))),r,!1),Nu(s))})),WS=(t,e,r,n,s)=>$u((i=>(t=>Ua((e=>{const r=c(e.getFiberRef(Eh),he((()=>e.scope())));return t(ih(Eh,ie(r)))})))((o=>Ua((c=>{let a=Array.from(t).reverse(),u=a.length;if(0===u)return Tu;let h=0,l=!1;const f=s?Math.min(a.length,s):a.length,b=new Set,d=new Array,p=new Array,m=new Array,S=new Array,g=()=>{const t=d.filter((({exit:t})=>"Failure"===t._tag)).sort(((t,e)=>t.index<e.index?-1:t.index===e.index?0:1)).map((({exit:t})=>t));return 0===t.length&&t.push(el),t},y=(t,e=!1)=>{const r=xu(o(t)),n=YS(r,c,c.currentRuntimeFlags,jp);return c.currentScheduler.scheduleTask((()=>{e&&n.unsafeInterruptAsFork(c.id()),n.resume(r)}),0),n},w=()=>{n||(u-=a.length,a=[]),l=!0,b.forEach((t=>{t.currentScheduler.scheduleTask((()=>{t.unsafeInterruptAsFork(c.id())}),0)}))},_=r?lu:nu,v=y(Ya((t=>{const n=(t,e)=>{"Blocked"===t._op?S.push(t):(d.push({index:e,exit:t}),"Failure"!==t._op||l||w())},o=()=>{if(a.length>0){const f=a.pop();let w=h++;const v=()=>{const t=a.pop();return w=h++,hu(Uu(),(()=>hu(_(i(e(t,w))),O)))},O=t=>a.length>0&&(n(t,w),a.length>0)?v():Nu(t),M=hu(_(i(e(f,w))),O),E=y(M);p.push(E),b.add(E),l&&E.currentScheduler.scheduleTask((()=>{E.unsafeInterruptAsFork(c.id())}),0),E.addObserver((e=>{let i;if(i="Failure"===e._op?e:e.effect_instruction_i0,m.push(E),b.delete(E),n(i,w),d.length===u)t(Nu(he(Hh(g(),{parallel:!0}),(()=>el))));else if(S.length+d.length===u){const e=g(),n=S.map((t=>t.effect_instruction_i0)).reduce(Sc);t(Nu($a(n,WS([he(Hh(e,{parallel:!0}),(()=>el)),...S.map((t=>t.effect_instruction_i1))],(t=>t),r,!0,s))))}else o()}))}};for(let t=0;t<f;t++)o()})));return Wa(Eu(fu(i(Lp(v))),Zh({onFailure:t=>{w();const e=S.length+1,r=Math.min("number"==typeof s?s:S.length,S.length),n=Array.from(S);return Ya((s=>{let i=0;const o=(r,o)=>()=>{i++,i===e&&s(tl(Kh(t))),n.length>0&&o&&c()},c=()=>{y(n.pop(),!0).addObserver(o(0,!0))};v.addObserver(o(0,!1));for(let t=0;t<r;t++)c()}))},onSuccess:()=>mu(m,(t=>t.inheritAll))})))})))))),VS=(t,e,r,n)=>Cu((()=>{const s=ve(t),i=new Array(s.length);return Wu(WS(s,((t,e)=>vu(r(t,e),(t=>i[e]=t))),n,!1,e),Nu(i))})),HS=t=>QS(t,jp),zS=(t,e,r,n=null)=>{const s=KS(t,e,r,n);return s.resume(t),s},YS=(t,e,r,n=null)=>KS(t,e,r,n),KS=(t,e,r,n=null)=>{const s=xi(),i=e.getFiberRefs(),o=Wf(i,s),a=new LS(s,o,r),u=Yf(o,bh),h=a.currentSupervisor;return h.onStart(u,t,ie(e),a),a.addObserver((t=>h.onEnd(t,a))),(null!==n?n:c(e.getFiberRef(Eh),he((()=>e.scope())))).add(r,a),a},QS=(t,e)=>Ua(((r,n)=>Nu(zS(t,r,n.runtimeFlags,e)))),ZS=t=>_l((e=>ae(jr(e,cg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Parallel":return t;case"Sequential":case"ParallelN":return hu(Ah(e,rd),(e=>fg(t,e)))}}}))),XS=t=>e=>_l((r=>ae(jr(r,cg),{onNone:()=>e,onSome:r=>"ParallelN"===r.strategy._tag&&r.strategy.parallelism===t?e:hu(Ah(r,nd(t)),(t=>fg(e,t)))}))),tg=(t,r)=>n=>_l((s=>ae(jr(s,cg),{onNone:()=>n(e),onSome:s=>{if(!0!==r)return n(e);{const e="Parallel"===t._tag?ZS:"Sequential"===t._tag?rg:XS(t.parallelism);switch(s.strategy._tag){case"Parallel":return e(n(ZS));case"Sequential":return e(n(rg));case"ParallelN":return e(n(XS(s.strategy.parallelism)))}}}}))),eg=t=>hu(lg(),(e=>Eu(t(e),(t=>e.close(t))))),rg=t=>_l((e=>ae(jr(e,cg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Sequential":return t;case"Parallel":case"ParallelN":return hu(Ah(e,ed),(e=>fg(t,e)))}}}))),ng=t((t=>qa(t[1])),((t,e,r)=>og(t,e,((t,e)=>[t,e]),r))),sg=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?og(t,e,(t=>t),r):Gu(t,e))),ig=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?og(t,e,((t,e)=>e),r):Wu(t,e))),og=t((t=>qa(t[1])),((t,e,r,n)=>vu(US([t,e],{concurrency:n?.concurrent?2:1,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(([t,e])=>r(t,e))))),cg=Mr("effect/Scope"),ag=cg,ug={[kh]:kh,[Fh]:Fh,pipe(){return rt(this,arguments)},fork(t){return ju((()=>{const e=hg(t);if("Closed"===this.state._tag)return e.state=this.state,e;const r={};return this.state.finalizers.set(r,(t=>e.close(t))),((t,e)=>{"Open"===t.state._tag&&t.state.finalizers.set({},e)})(e,(()=>ju((()=>{"Open"===this.state._tag&&this.state.finalizers.delete(r)})))),e}))},close(t){return Cu((()=>{if("Closed"===this.state._tag)return Tu;const e=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:t},0===e.length?Tu:this.strategy._tag===Qb?c(mu(e,(e=>nu(e(t)))),hu((t=>c(Hh(t),pe(Vh),he((()=>el)))))):(()=>this.strategy._tag===Zb)()?c(GS(e,(e=>nu(e(t))),!1),hu((t=>c(Hh(t,{parallel:!0}),pe(Vh),he((()=>el)))))):c(VS(e,this.strategy.parallelism,(e=>nu(e(t))),!1),hu((t=>c(Hh(t,{parallel:!0}),pe(Vh),he((()=>el))))))}))},addFinalizer(t){return Cu((()=>"Closed"===this.state._tag?t(this.state.exit):(this.state.finalizers.set({},t),Tu)))}},hg=(t=Xb)=>{const e=Object.create(ug);return e.strategy=t,e.state={_tag:"Open",finalizers:new Map},e},lg=(t=Xb)=>ju((()=>hg(t))),fg=t(2,((t,e)=>Ml(t,Ar(kr(cg,e))))),bg=t=>lh(t,{differ:vS,fork:gS}),dg=fh(uc),pg=bg(bS),mg=t(3,((t,e,r)=>gg(t,e,{onSelfWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onSelfDone(n,e)));case it:return r.onSelfDone(n,e)}})),onOtherWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onOtherDone(n,e)));case it:return r.onOtherDone(n,e)}}))}))),Sg=t(2,((t,e)=>uu((r=>mg(t,e,{onSelfDone:(t,e)=>Xh(t,{onFailure:t=>c(Lp(e),qb((e=>Yc(t,e)))),onSuccess:t=>c(e,zu(r),Ga(t))}),onOtherDone:(t,e)=>Xh(t,{onFailure:t=>c(Lp(e),qb((e=>Yc(e,t)))),onSuccess:t=>c(e,zu(r),Ga(t))})}))))),gg=t(3,((t,e,r)=>Ua(((n,s)=>{const i=s.runtimeFlags,o=li(!0),c=KS(t,n,i,r.selfScope),a=KS(e,n,i,r.otherScope);return Ya((n=>{c.addObserver((()=>yg(c,a,r.onSelfWin,o,n))),a.addObserver((()=>yg(a,c,r.onOtherWin,o,n))),c.startFork(t),a.startFork(e)}),ji(c.id(),a.id()))})))),yg=(t,e,r,n,s)=>{fi(!0,!1)(n)&&s(r(t,e))},wg=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>du(e,{onFailure:e=>ou(Kc(t,e)),onSuccess:()=>ou(t)}),onSuccess:t=>Ga(e,t)}))))),_g=(t,e,r)=>uu((n=>hu(hu(HS(wu(t)),(t=>Ya((n=>{const s=e.map((t=>t.listeners.count)),i=()=>{s.every((t=>0===t))&&e.every((t=>"Pending"===t.result.state.current._tag||!("Done"!==t.result.state.current._tag||!Uh(t.result.state.current.effect)||"Failure"!==t.result.state.current.effect._tag||!Xc(t.result.state.current.effect.cause))))&&(o.forEach((t=>t())),r?.(),n(Hu(t)))};t.addObserver((t=>{o.forEach((t=>t())),n(t)}));const o=e.map(((t,e)=>{const r=t=>{s[e]=t,i()};return t.listeners.addObserver(r),()=>t.listeners.removeObserver(r)}));return i(),ju((()=>{o.forEach((t=>t()))}))})))),(()=>Cu((()=>{const t=e.flatMap((t=>t.state.completed?[]:[t]));return Su(t,(t=>oS(t.request,(t=>Kh(zc(t)))(n))))})))))),vg=Symbol.for("effect/ScheduleInterval"),Og={[vg]:vg,startMillis:0,endMillis:0},Mg=(t,e)=>t>e?Og:{[vg]:vg,startMillis:t,endMillis:e},Eg=t(2,((t,e)=>Ig(t,e)===t)),Ig=t(2,((t,e)=>t.endMillis<=e.startMillis?t:e.endMillis<=t.startMillis?e:t.startMillis<e.startMillis?t:e.startMillis<t.startMillis?e:t.endMillis<=e.endMillis?t:e)),kg=t(2,((t,e)=>{const r=Math.max(t.startMillis,e.startMillis),n=Math.min(t.endMillis,e.endMillis);return Mg(r,n)})),Fg=Og,Ng=Eg,Cg=kg,jg=Symbol.for("effect/ScheduleIntervals"),Ag=t=>({[jg]:jg,intervals:t}),Rg=t(2,((t,e)=>xg(t.intervals,e.intervals,qr()))),xg=(t,e,r)=>{let n=t,s=e,i=r;for(;cn(n)&&cn(s);){const t=c(hn(n),Cg(hn(s))),e=(o=t).startMillis>=o.endMillis?i:c(i,Xr(t));c(hn(n),Ng(hn(s)))?n=dn(n):s=dn(s),i=e}var o;return Ag(Hr(i))},$g=t=>c(t.intervals,an,he((()=>Fg))).startMillis,Tg=t(2,((t,e)=>$g(t)<$g(e))),Lg=Ag,Dg=Rg,Pg=$g,Bg=t=>c(t.intervals,an,he((()=>Fg))).endMillis,qg=Tg,Ug="Continue",Jg="Done",Gg={_tag:Jg},Wg=t=>t._tag===Ug,Vg=t=>t._tag===Jg,Hg=Nh,zg=Ch,Yg=jh,Kg=fg,Qg=Ah,Zg=lg;class Xg{permits;waiters=new Set;taken=0;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take=t=>za((e=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),this.taken+=t,e(Nu(t)))};return this.waiters.add(r),ju((()=>{this.waiters.delete(r)}))}return this.taken+=t,e(Nu(t))}));updateTakenUnsafe(t,e){return this.taken=e(this.taken),this.waiters.size>0&&t.getFiberRef(gp).scheduleTask((()=>{const t=this.waiters.values();let e=t.next();for(;!1===e.done&&this.free>0;)e.value(),e=t.next()}),t.getFiberRef(dh)),Nu(this.free)}updateTaken(t){return Ua((e=>this.updateTakenUnsafe(e,t)))}resize=t=>Wa(Ua((e=>(this.permits=t,this.free<0?Tu:this.updateTakenUnsafe(e,(t=>t))))));release=t=>this.updateTaken((e=>e-t));releaseAll=this.updateTaken((()=>0));withPermits=t=>e=>$u((r=>hu(r(this.take(t)),(t=>wg(r(e),this.release(t))))));withPermitsIfAvailable=t=>e=>$u((r=>Cu((()=>this.free<t?Vb:(this.taken+=t,wg(r((t=>vu(t,ie))(e)),this.release(t)))))))}const ty=t=>new Xg(t),ey=t(2,((t,e)=>Ua(((r,n)=>{const s=e,i=zS(t,r,n.runtimeFlags,jp);if("Open"===s.state._tag){const t=()=>uu((t=>J(t,i.id())?Tu:Wa(Hu(i)))),e={};s.state.finalizers.set(e,t),i.addObserver((()=>{"Closed"!==s.state._tag&&s.state.finalizers.delete(e)}))}else i.unsafeInterruptAsFork(r.id());return Nu(i)})))),ry=t(2,((t,e)=>c(nu(t),Sg(nu(e)),(t=>fu(t))))),ny=Symbol.for("effect/Ref/SynchronizedRef"),sy={_A:t=>t};class iy extends hb{ref;withLock;[ny]=sy;[fb]=bb;[lb]=lb;constructor(t,e){super(),this.ref=t,this.withLock=e,this.get=Sb(this.ref)}get;commit(){return this.get}modify(t){return this.modifyEffect((e=>Nu(t(e))))}modifyEffect(t){return this.withLock(c(hu(Sb(this.ref),t),hu((([t,e])=>Ga(gb(this.ref,e),t)))))}}const oy=t=>{const e=pb(t),r=ty(1);return new iy(e,r.withPermits(1))},cy=Symbol.for("effect/ManagedRuntime"),ay=t=>function(){if(1===arguments.length){const e=arguments[0];return(r,...n)=>t(e,r,...n)}return t.apply(this,arguments)},uy=ay(((t,e,r)=>{const n=xi(),s=[[bh,[[n,t.context]]]];r?.scheduler&&s.push([gp,[[n,r.scheduler]]]);let i=tb(t.fiberRefs,{entries:s,forkAs:n});r?.updateRefs&&(i=r.updateRefs(i,n));const o=new LS(n,i,t.runtimeFlags);let c=e;r?.scope&&(c=hu(Qg(r.scope,Xb),(t=>Wu(Nh(t,uu((t=>J(t,o.id())?Tu:zu(o,t)))),Eu(e,(e=>Yg(t,e)))))));const a=o.currentSupervisor;return a!==bS&&(a.onStart(t.context,c,se(),o),o.addObserver((t=>a.onEnd(t,o)))),jp.add(t.runtimeFlags,o),!1===r?.immediate?o.resume(c):o.start(c),o})),hy=ay(((t,e)=>{const r=Sy(t)(e);if("Failure"===r._tag)throw py(r.effect_instruction_i0);return r.effect_instruction_i0}));class ly extends Error{fiber;_tag="AsyncFiberException";constructor(t){super(`Fiber #${t.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`),this.fiber=t,this.name=this._tag,this.stack=this.message}}const fy=Symbol.for("effect/Runtime/FiberFailure"),by=Symbol.for("effect/Runtime/FiberFailure/Cause");class dy extends Error{[fy];[by];constructor(t){const e=Fa(t)[0];super(e?.message||"An error has occurred"),this[fy]=fy,this[by]=t,this.name=e?`(FiberFailure) ${e.name}`:"FiberFailure",e?.stack&&(this.stack=e.stack)}toJSON(){return{_id:"FiberFailure",cause:this[by].toJSON()}}toString(){return"(FiberFailure) "+wa(this[by],{renderErrorCause:!0})}[H](){return this.toString()}}const py=t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new dy(t);return Error.stackTraceLimit=e,r},my=t=>{const e=t;switch(e._op){case"Failure":case"Success":return e;case"Left":return Yh(e.left);case"Right":return tl(e.right);case"Some":return tl(e.value);case"None":return Yh(new Ph)}},Sy=ay(((t,e)=>{const r=my(e);if(r)return r;const n=new Sp,s=uy(t)(e,{scheduler:n});n.flush();return s.unsafePoll()||zh(Xa((t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new ly(t);return Error.stackTraceLimit=e,r})(s),El(s)))})),gy=ay(((t,e,r)=>yy(t,e,r).then((t=>{switch(t._tag){case ut:return t.effect_instruction_i0;case it:throw py(t.effect_instruction_i0)}})))),yy=ay(((t,e,r)=>new Promise((n=>{const s=my(e);s&&n(s);const i=uy(t)(e);i.addObserver((t=>{n(t)})),void 0!==r?.signal&&(r.signal.aborted?i.unsafeInterruptAsFork(i.id()):r.signal.addEventListener("abort",(()=>{i.unsafeInterruptAsFork(i.id())}),{once:!0}))}))));class wy{context;runtimeFlags;fiberRefs;constructor(t,e,r){this.context=t,this.runtimeFlags=e,this.fiberRefs=r}pipe(){return rt(this,arguments)}}const _y=t=>new wy(t.context,t.runtimeFlags,t.fiberRefs),vy=ac(1,32,4),Oy=_y({context:Ir(),runtimeFlags:vy,fiberRefs:eb()}),My=uy(Oy),Ey=gy(Oy),Iy=hy(Oy),ky=t(2,((t,e)=>t.modifyEffect(e))),Fy=Symbol.for("effect/Layer"),Ny={[Fy]:{_RIn:t=>t,_E:t=>t,_ROut:t=>t},pipe(){return rt(this,arguments)}},Cy=Symbol.for("effect/Layer/MemoMap"),jy=Rr()("effect/Layer/CurrentMemoMap",{defaultValue:()=>xy()});class Ay{ref;[Cy];constructor(t){this.ref=t,this[Cy]=Cy}getOrElseMemoize(t,e){return c(ky(this.ref,(r=>{const n=r.get(t);if(void 0!==n){const[t,s]=n,i=c(t,hu((([t,e])=>c((t=>{return e=(e,r)=>c(t,Fb(e,r)),Ua((t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),Tu)));var e})(t),Ga(e)))),Eu(Zh({onFailure:()=>Tu,onSuccess:()=>Ch(e,s)})));return Nu([i,r])}return c(mb(0),hu((n=>c(cl(),hu((s=>c(mb((()=>Tu)),vu((i=>{const o=$u((o=>c(lg(),hu((a=>c(o(hu(Ly(t,a,!0),(t=>{return e=t(this),Hb(e,Lb,Ib);var e}))),nu,hu((o=>{switch(o._tag){case it:return c(fl(s,o.effect_instruction_i0),Wu(jh(a,o)),Wu(ou(o.effect_instruction_i0)));case ut:return c(gb(i,(t=>c(jh(a,t),Lu(yb(n,(t=>[1===t,t-1]))),Wa))),Wu(wb(n,(t=>t+1))),Wu(Ch(e,(e=>c(ju((()=>r.delete(t))),Wu(Sb(i)),hu((t=>t(e))))))),Wu(ml(s,o.effect_instruction_i0)),Ga(o.effect_instruction_i0[1]))}})))))))),a=[c(ul(s),Eu(Xh({onFailure:()=>Tu,onSuccess:()=>wb(n,(t=>t+1))}))),t=>c(Sb(i),hu((e=>e(t))))];return[o,(u=t,"Fresh"===u._op_layer?r:r.set(t,a))];var u})))))))))})),fu)}}const Ry=Cu((()=>{return vu((t=new Map,ju((()=>oy(t)))),(t=>new Ay(t)));var t})),xy=()=>new Ay(oy(new Map)),$y=t(2,((t,e)=>hu(Ry,(r=>Ty(t,r,e))))),Ty=t(3,((t,e,r)=>hu(Ly(t,r),(t=>Jb(t(e),jy,e))))),Ly=(t,e,r=!1)=>{const n=t;switch(n._op_layer){case"Locally":return ju((()=>t=>n.f(t.getOrElseMemoize(n.self,e))));case"ExtendScope":return ju((()=>t=>{return e=e=>t.getOrElseMemoize(n.layer,e),hu(cg,e);var e}));case"Fold":return ju((()=>t=>c(t.getOrElseMemoize(n.layer,e),du({onFailure:r=>t.getOrElseMemoize(n.failureK(r),e),onSuccess:r=>t.getOrElseMemoize(n.successK(r),e)}))));case"Fresh":return ju((()=>()=>c(n.layer,$y(e))));case"FromEffect":return ju(r?()=>()=>n.effect:()=>r=>r.getOrElseMemoize(t,e));case"Provide":return ju((()=>t=>c(t.getOrElseMemoize(n.first,e),hu((r=>c(t.getOrElseMemoize(n.second,e),vl(r)))))));case"Scoped":return ju(r?()=>()=>fg(n.effect,e):()=>r=>r.getOrElseMemoize(t,e));case"Suspend":return ju((()=>t=>t.getOrElseMemoize(n.evaluate(),e)));case"ProvideMerge":return ju((()=>t=>c(t.getOrElseMemoize(n.first,e),Vu(t.getOrElseMemoize(n.second,e),n.zipK))));case"ZipWith":return Bu((function*(){const t=yield*Ah(e,td),r=yield*Ah(t,Xb),s=yield*Ah(t,Xb);return t=>c(t.getOrElseMemoize(n.first,r),og(t.getOrElseMemoize(n.second,s),n.zipK,{concurrent:!0}))}));case"MergeAll":{const t=n.layers;return vu(Ah(e,td),(e=>r=>{const n=new Array(t.length);return vu(WS(t,qu((function*(t,s){const i=yield*Ah(e,Xb),o=yield*r.getOrElseMemoize(t,i);n[s]=o})),!1,!1),(()=>((...t)=>{const e=new Map;for(let r=0;r<t.length;r++)t[r].unsafeMap.forEach(((t,r)=>{e.set(r,t)}));return br(e)})(...n)))}))}}},Dy=t(2,((t,e)=>eg((r=>hu($y(e,r),(e=>Ol(t,e))))))),Py=t(2,((t,e)=>{const r=sd(Oy.fiberRefs,e.fiberRefs),n=fc(Oy.runtimeFlags,e.runtimeFlags);return $u((s=>Ua((i=>{const o=i.getFiberRef(bh),c=i.getFiberRefs(),a=id(i.id(),c)(r),u=i.currentRuntimeFlags,h=bc(n)(u),l=sd(a,c),f=fc(h,u);return i.setFiberRefs(a),i.currentRuntimeFlags=h,wg(Ol(s(t),Ar(o,e.context)),Ua((t=>(t.setFiberRefs(id(t.id(),t.getFiberRefs())(l)),t.currentRuntimeFlags=bc(f)(t.currentRuntimeFlags),Tu))))}))))})),By=t(2,((t,e)=>Array.isArray(e)?Dy(t,((...t)=>{const e=Object.create(Ny);return e._op_layer="MergeAll",e.layers=t,e})(...e)):m(e,Fy)?Dy(t,e):Er(e)?Ol(t,e):cy in e?hu(e.runtimeEffect,(e=>Py(t,e))):Py(t,e))),qy=Symbol.for("effect/Schedule"),Uy=Symbol.for("effect/ScheduleDriver"),Jy={start:0,now:0,input:void 0,output:void 0,elapsed:Cn,elapsedSincePrevious:Cn,recurrence:0},Gy=Rr()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>Jy}),Wy={_Out:t=>t,_In:t=>t,_R:t=>t},Vy={_Out:t=>t,_In:t=>t,_R:t=>t};class Hy{initial;step;[qy]=Wy;constructor(t,e){this.initial=t,this.step=e}pipe(){return rt(this,arguments)}}const zy=(t,e,r,n)=>wb(t,(t=>0===t.recurrence?{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:Cn,elapsedSincePrevious:Cn,start:e}:{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:xn(e-t.start),elapsedSincePrevious:xn(e-t.now),start:t.start}));class Yy{schedule;ref;[Uy]=Vy;constructor(t,e){this.schedule=t,this.ref=e}get state(){return vu(Sb(this.ref),(t=>t[1]))}get last(){return hu(Sb(this.ref),(([t,e])=>{switch(t._tag){case"None":return iu((()=>new Ph));case"Some":return Nu(t.value)}}))}iterationMeta=pb(Jy);get reset(){return gb(this.ref,[se(),this.schedule.initial]).pipe(Gu(gb(this.iterationMeta,Jy)))}next(t){return c(vu(Sb(this.ref),(t=>t[1])),hu((e=>c(Bf,hu((r=>c(Cu((()=>this.schedule.step(r,t,e))),hu((([e,n,s])=>{const i=gb(this.ref,[ie(n),e]);if(Vg(s))return i.pipe(Wu(su(se())));const o=Pg(s.intervals)-r;if(o<=0)return i.pipe(Wu(zy(this.iterationMeta,r,t,n)),Ga(n));const a=xn(o);return c(i,Wu(zy(this.iterationMeta,r,t,n)),Wu(Wb(a)),Ga(n))})))))))))}}const Ky=(t,e)=>new Hy(t,e),Qy=t(2,((t,e)=>Zy(t,((t,r)=>ju((()=>e(t,r))))))),Zy=t(2,((t,e)=>Ky(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,s])=>Vg(s)?Nu([t,r,Gg]):vu(e(n,r),(e=>e?[t,r,s]:[t,r,Gg])))))))),Xy=t(2,((t,e)=>tw(t,e,Dg))),tw=t(3,((t,e,r)=>Ky([t.initial,e.initial],((n,s,i)=>c(Vu(t.step(n,s,i[0]),e.step(n,s,i[1]),((t,e)=>[t,e])),hu((([[n,i,o],[c,a,u]])=>Wg(o)&&Wg(u)?ew(t,e,s,n,i,o.intervals,c,a,u.intervals,r):Nu([[n,c],[i,a],Gg])))))))),ew=(t,e,r,n,s,i,o,a,u,h)=>{const l=h(i,u);return(t=>cn(t.intervals))(l)?Nu([[n,o],[s,a],(f=l,{_tag:Ug,intervals:f})]):c(i,qg(u))?hu(t.step(Bg(i),r,n),(([n,s,i])=>Vg(i)?Nu([[n,o],[s,a],Gg]):ew(t,e,r,n,s,i.intervals,o,a,u,h))):hu(e.step(Bg(u),r,o),(([o,c,a])=>Vg(a)?Nu([[n,o],[s,c],Gg]):ew(t,e,r,n,s,i,o,c,a.intervals,h)));var f},rw=t(2,((t,e)=>nw(t,(t=>ju((()=>e(t))))))),nw=t(2,((t,e)=>Ky(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,n])=>vu(e(r),(e=>[t,e,n])))))))),sw=(t,e)=>Ky(t,((t,r,n)=>ju((()=>{return[e(n),n,(s=t,r=Mg(s,Number.POSITIVE_INFINITY),{_tag:Ug,intervals:Lg(Jr(r))})];var r,s})))),iw=t(2,((t,e)=>Zy(t,(t=>(t=>vu(t,(t=>!t)))(e(t)))))),ow=t(2,((t,e)=>Zy(t,(t=>e(t))))),cw=t(2,((t,e)=>Qy(t,((t,r)=>e(r))))),aw=Symbol.for("effect/Schedule/ScheduleDefect");class uw{error;[aw];constructor(t){this.error=t,this[aw]=aw}}const hw=t=>Qa(t,(t=>tu(new uw(t)))),lw=t(2,((t,e)=>bw(t,e,(t=>su(t))))),fw=t(2,((t,e)=>{if(m(e,qy))return lw(t,e);const r=e.schedule??(t=>Ky(t.initial,((e,r,n)=>c(t.step(e,r,n),vu((([t,e,n])=>[t,r,n]))))))(pw),n=e.while?ow(r,(t=>{const r=e.while(t);return"boolean"==typeof r?Nu(r):hw(r)})):r,s=e.until?iw(n,(t=>{const r=e.until(t);return"boolean"==typeof r?Nu(r):hw(r)})):n,i=e.times?Xy(s,(o=e.times,cw(pw,(t=>t<o)))).pipe(rw((t=>t[0]))):s;var o,a;return a=lw(t,i),Ka(a,(t=>ou((t=>ae(fa(t,(t=>Zc(t)&&m(t.defect,aw)?ie(t.defect):se())),{onNone:()=>t,onSome:t=>Vc(t.error)}))(t))))})),bw=t(3,((t,e,r)=>hu((t=>c(mb([se(),t.initial]),vu((e=>new Yy(t,e)))))(e),(e=>pu(t,{onFailure:t=>r(t,se()),onSuccess:n=>dw(Gb(t,Gy,Sb(e.iterationMeta)),e,((t,n)=>Gb(r(t,n),Gy,Sb(e.iterationMeta))),n)}))))),dw=(t,r,n,s)=>pu(r.next(s),{onFailure:()=>(t=>Fu(t,e))(r.last),onSuccess:e=>pu(t,{onFailure:t=>n(t,ie(e)),onSuccess:e=>dw(t,r,n,e)})}),pw=sw(0,(t=>t+1)),mw=qa,Sw=US,gw=JS,yw=Ya,ww=Ua,_w=su,vw=ou,Ow=eu,Mw=Bu,Ew=t=>Ya(t.length>=1?(e,r)=>{try{t(r).then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}:e=>{try{t().then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}),Iw=Nu,kw=Cu,Fw=ju,Nw=Tu,Cw=Qa,jw=Ka,Aw=xb,Rw=t=>Tb(t,{onFailure:o,onSuccess:o}),xw=t=>{let e,r;return"function"==typeof t?e=t:(e=t.try,r=t.catch),Cu((()=>{try{return Nu(N(e))}catch(t){return su(r?N((()=>r(t))):new qh(t,"An unknown error occurred in Effect.try"))}}))},$w=t=>{let e,r;"function"==typeof t?e=t:(e=t.try,r=t.catch);const n=t=>r?iu((()=>r(t))):su(new qh(t,"An unknown error occurred in Effect.tryPromise"));return Ya(e.length>=1?(t,r)=>{try{e(r).then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}}:t=>{try{e().then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}})},Tw=gu,Lw=wu,Dw=xu,Pw=$u,Bw=Ga,qw=Wa,Uw=vu,Jw=Mu,Gw=Ja,Ww=wg,Vw=ag,Hw=eg,zw=uu,Yw=HS,Kw=ey,Qw=By,Zw=nu,Xw=_u,t_=Kb,e_=hu,r_=fu,n_=Sg,s_=ry,i_=mg,o_=Au,c_=zb,a_=Yb,u_=t=>{const e=hu(hu(t,(()=>Uu())),(()=>e));return e},h_=fw,l_=Tb,f_=bu,b_=du,d_=Pb,p_=Bb,m_=Ub,S_=()=>Ua(((t,e)=>Nu(new wy(t.getFiberRef(bh),e.runtimeFlags,t.getFiberRefs())))),g_=t=>ju((()=>ty(t))),y_=My,w_=Ey,__=Iy,v_=ng,O_=sg,M_=ig,E_=og;export{jn as $,co as A,hu as B,Tl as C,Cl as D,$b as E,fi as F,di as G,li as H,j as I,c as J,q as K,x as L,A as M,U as N,m as O,J as P,Wa as Q,Kb as R,Bn as S,Iu as T,Wu as U,nu as V,vl as W,Mw as X,$w as Y,xw as Z,d_ as _,__ as a,Ue as a$,c_ as a0,p_ as a1,Cw as a2,Iw as a3,Rh as a4,m_ as a5,cl as a6,ul as a7,ml as a8,fl as a9,Sb as aA,wb as aB,Xc as aC,Vc as aD,na as aE,sa as aF,ca as aG,Hc as aH,zc as aI,Zc as aJ,ra as aK,ta as aL,Lp as aM,Hu as aN,$p as aO,Tp as aP,zu as aQ,hb as aR,Qa as aS,gu as aT,bi as aU,xu as aV,Ua as aW,Lu as aX,WS as aY,ve as aZ,He as a_,ol as aa,bl as ab,ll as ac,pl as ad,Jh as ae,Gh as af,Zh as ag,Kh as ah,tl as ai,Yh as aj,nl as ak,Hh as al,el as am,zh as an,Qh as ao,rl as ap,t as aq,rt as ar,H as as,z as at,Y as au,Xr as av,qr as aw,Hr as ax,mb as ay,yb as az,Vt as b,h_ as b$,on as b0,Gr as b1,Sl as b2,sn as b3,rn as b4,Zr as b5,dl as b6,Tu as b7,mw as b8,Kt as b9,ni as bA,Ai as bB,Xw as bC,O_ as bD,a_ as bE,Hg as bF,vw as bG,r_ as bH,zw as bI,Tw as bJ,f_ as bK,Hw as bL,Qr as bM,o as bN,Vw as bO,ww as bP,Zg as bQ,Kg as bR,Yg as bS,i_ as bT,S_ as bU,o_ as bV,zg as bW,g_ as bX,t_ as bY,n_ as bZ,Bw as b_,Nw as ba,Rw as bb,E_ as bc,Zw as bd,Fw as be,Qw as bf,b_ as bg,M_ as bh,e_ as bi,Yw as bj,Lw as bk,kw as bl,Ww as bm,Dw as bn,Uw as bo,v_ as bp,gw as bq,he as br,Ow as bs,jw as bt,Pw as bu,Sw as bv,Qg as bw,ed as bx,Gw as by,Kw as bz,Yt as c,qw as c0,s_ as c1,u_ as c2,Jr as c3,_w as c4,Jw as c5,pn as c6,ln as c7,l_ as c8,bn as c9,an as ca,nn as cb,Aw as cc,Yr as cd,y_ as ce,Ew as cf,yw as cg,ue as d,Mn as e,vu as f,Zt as g,US as h,e as i,wl as j,au as k,Ht as l,ae as m,Qt as n,Ll as o,Cu as p,jl as q,w_ as r,ju as s,Nu as t,se as u,Rl as v,ce as w,ie as x,be as y,xl as z}
|