@lmvz-ds/components 0.13.0 → 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/cjs/{assets-CB5ikzmP.js → icons-FIfJEo6G.js} +1251 -773
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/lmvz-card.cjs.entry.js +3 -3
- package/dist/cjs/lmvz-icon.cjs.entry.js +3 -3
- package/dist/collection/components/lmvz-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- package/dist/collection/utils/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/http.unit.js +1 -1
- package/dist/collection/utils/validation/svg.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/p-BsS3QvWn.js +1 -0
- package/dist/components/p-CdYWDK7m.js +1 -0
- package/dist/esm/assets-BelZNJ1W.js +23 -0
- package/dist/esm/{assets-ozES4zSA.js → icons-CM7lsnuO.js} +1249 -708
- package/dist/esm/index.js +3 -2
- package/dist/esm/lmvz-card.entry.js +3 -3
- package/dist/esm/lmvz-icon.entry.js +2 -2
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-6e3314ab.entry.js +1 -0
- package/dist/lmvz-components/p-BoR31cjC.js +1 -0
- package/dist/lmvz-components/p-CVf2C8dL.js +1 -0
- package/dist/lmvz-components/p-d9dc29a1.entry.js +1 -0
- package/dist/manifest.json +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 +2131 -12411
- package/hydrate/index.mjs +2131 -12411
- package/package.json +4 -4
- package/dist/cjs/icons-DM_TTn48.js +0 -857
- package/dist/components/p-BBDH9X49.js +0 -1
- package/dist/components/p-Bs6_m7Uw.js +0 -1
- package/dist/esm/icons-kpJZ1u9g.js +0 -853
- package/dist/lmvz-components/p-4ad8c332.entry.js +0 -1
- package/dist/lmvz-components/p-5eee0752.entry.js +0 -1
- package/dist/lmvz-components/p-D9lc4ayG.js +0 -1
- package/dist/lmvz-components/p-iviTjlUy.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,h as e,d as r,t as n}from"./p-vi4YzJmv.js";import{R as s,A as i}from"./p-CMteT-Yo.js";import{c as o}from"./p-CdYWDK7m.js";const c=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)}}}},u=t=>t,a=t=>()=>t,h=a(!0),l=a(!1),f=a(void 0),d=f;function b(t,e,r,n,s,i,o,c,u){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 u(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 m=t=>(e,r)=>e===r||t(e,r),p=c(2,((t,e)=>m(((r,n)=>t(e(r),e(n)))))),g="effect/GlobalValue";let y;const S=(t,e)=>(y||(globalThis[g]??=new Map,y=globalThis[g]),y.has(t)||y.set(t,e()),y.get(t)),v=t=>"number"==typeof t,w=t=>"function"==typeof t,_=t=>(t=>"object"==typeof t&&null!==t)(t)||w(t),O=c(2,((t,e)=>_(t)&&e in t)),E=c(2,((t,e)=>O(t,"_tag")&&t._tag===e)),M=t=>null==t,k=t=>"string"==typeof t||O(t,Symbol.iterator),I=t=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;let C=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 N{_state;constructor(t,e,r,n){return M(e)&&M(t)?(e=4294967295*Math.random()>>>0,t=0):M(e)&&(e=t,t=0),M(n)&&M(r)?(n=this._state?this._state[3]:4150755663,r=this._state?this._state[2]:335903614):M(n)&&(n=r,r=0),this._state=new Int32Array([0,0,r>>>0,(1|(n||0))>>>0]),this._next(),j(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,u=19605*(r>>>16)+((o>>>16)+(i>>>16))>>>0;o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0&&(u=u+1>>>0),i=i<<16>>>0,c=c+i>>>0,c>>>0<i>>>0&&(u=u+1>>>0),u=u+Math.imul(r,1481765933)>>>0,u=u+Math.imul(e,s)>>>0,t[0]=u,t[1]=c}(this._state,t,e,0,1284865837),j(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 j(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 A=Symbol.for("effect/Utils/YieldWrap");class F{#t;constructor(t){this.#t=t}[A](){return this.#t}}function R(t){if("object"==typeof t&&null!==t&&A in t)return t[A]();throw new Error(I("yieldWrapGet"))}const x=S("effect/Utils/isStructuralRegion",(()=>({enabled:!1,tester:void 0}))),$={effect_internal_function:t=>t()},T=!0===$.effect_internal_function((()=>(new Error).stack))?.includes("effect_internal_function")?$.effect_internal_function:t=>{try{return t()}finally{}},L=S(Symbol.for("effect/Hash/randomHashCache"),(()=>new WeakMap)),D=Symbol.for("effect/Hash"),B=t=>{if(!0===x.enabled)return 0;switch(typeof t){case"number":return J(t);case"bigint":return V(t.toString(10));case"boolean":case"symbol":return V(String(t));case"string":return V(t);case"undefined":return V("undefined");case"function":case"object":return null===t?V("null"):t instanceof Date?Number.isNaN(t.getTime())?V("Invalid Date"):B(t.toISOString()):t instanceof URL?B(t.href):U(t)?t[D]():z(t);default:throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},z=t=>(L.has(t)||L.set(t,J(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),L.get(t)),P=t=>e=>53*e^t,q=t=>3221225471&t|t>>>1&1073741824,U=t=>O(t,D),J=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 q(e)},V=t=>{let e=5381,r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return q(e)},G=t=>((t,e)=>{let r=12289;for(let n=0;n<e.length;n++)r^=b(V(e[n]),P(B(t[e[n]])));return q(r)})(t,Object.keys(t)),H=t=>{let e=6151;for(let r=0;r<t.length;r++)e=b(e,P(B(t[r])));return q(e)},W=function(){if(1===arguments.length){const t=arguments[0];return function(e){return Object.defineProperty(t,D,{value:()=>e,enumerable:!1}),e}}const t=arguments[1];return Object.defineProperty(arguments[0],D,{value:()=>t,enumerable:!1}),t},Y=Symbol.for("effect/Equal");function K(){return 1===arguments.length?t=>Q(t,arguments[0]):Q(arguments[0],arguments[1])}function Q(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(Z(t)&&Z(e))return!(B(t)!==B(e)||!t[Y](e))||!(!x.enabled||!x.tester)&&x.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(x.enabled){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every(((t,r)=>Q(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)||!Q(t[n],e[n]))return!!x.tester&&x.tester(t,e);return!0}}return!!x.tester&&x.tester(t,e)}}return!(!x.enabled||!x.tester)&&x.tester(t,e)}const Z=t=>O(t,Y),X=()=>K,tt=Symbol.for("nodejs.util.inspect.custom"),et=t=>{try{if(O(t,"toJSON")&&w(t.toJSON)&&0===t.toJSON.length)return t.toJSON();if(Array.isArray(t))return t.map(et)}catch{return{}}return ut(t)},rt=t=>JSON.stringify(t,null,2),nt=(t,e=2)=>{if("string"==typeof t)return t;try{return"object"==typeof t?st(t,e):String(t)}catch{return String(t)}},st=(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!==ct.fiberRefs&&ot(e)?e[it](ct.fiberRefs):e):e),e);return r=void 0,n},it=Symbol.for("effect/Inspectable/Redactable"),ot=t=>"object"==typeof t&&null!==t&&it in t,ct=S("effect/Inspectable/redactableState",(()=>({fiberRefs:void 0}))),ut=t=>ot(t)&&void 0!==ct.fiberRefs?t[it](ct.fiberRefs):t,at=(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}}},ht="Async",lt="Commit",ft="Failure",dt="OnFailure",bt="OnSuccess",mt="OnSuccessAndFailure",pt="Success",gt="Sync",yt="Tag",St="UpdateRuntimeFlags",vt="While",wt="Iterator",_t="WithRuntime",Ot="Yield",Et="RevertFlags",Mt=()=>"3.19.14",kt=Symbol.for("effect/Effect"),It=Symbol.for("effect/Stream"),Ct=Symbol.for("effect/Sink"),Nt=Symbol.for("effect/Channel"),jt={_R:t=>t,_E:t=>t,_A:t=>t,_V:Mt()},At={[kt]:jt,[It]:jt,[Ct]:{_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t},[Nt]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},[Y](t){return this===t},[D](){return W(this,z(this))},[Symbol.iterator](){return new C(new F(this))},pipe(){return at(this,arguments)}},Ft={[D](){return W(this,G(this))},[Y](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)||!K(this[r],t[r]))return!1;return!0}},Rt={...At,_op:lt},xt={...Rt,...Ft},$t=function(){function t(){}return t.prototype=Rt,t}(),Tt=Symbol.for("effect/Option"),Lt={...At,[Tt]:{_A:t=>t},[tt](){return this.toJSON()},toString(){return rt(this.toJSON())}},Dt=Object.assign(Object.create(Lt),{_tag:"Some",_op:"Some",[Y](t){return Pt(t)&&Ut(t)&&K(this.value,t.value)},[D](){return W(this,P(B(this._tag))(B(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:et(this.value)}}}),Bt=B("None"),zt=Object.assign(Object.create(Lt),{_tag:"None",_op:"None",[Y]:t=>Pt(t)&&qt(t),[D]:()=>Bt,toJSON(){return{_id:"Option",_tag:this._tag}}}),Pt=t=>O(t,Tt),qt=t=>"None"===t._tag,Ut=t=>"Some"===t._tag,Jt=Object.create(zt),Vt=t=>{const e=Object.create(Dt);return e.value=t,e},Gt=Symbol.for("effect/Either"),Ht={...At,[Gt]:{_R:t=>t},[tt](){return this.toJSON()},toString(){return rt(this.toJSON())}},Wt=Object.assign(Object.create(Ht),{_tag:"Right",_op:"Right",[Y](t){return Kt(t)&&Zt(t)&&K(this.right,t.right)},[D](){return P(B(this._tag))(B(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:et(this.right)}}}),Yt=Object.assign(Object.create(Ht),{_tag:"Left",_op:"Left",[Y](t){return Kt(t)&&Qt(t)&&K(this.left,t.left)},[D](){return P(B(this._tag))(B(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:et(this.left)}}}),Kt=t=>O(t,Gt),Qt=t=>"Left"===t._tag,Zt=t=>"Right"===t._tag,Xt=t=>{const e=Object.create(Wt);return e.right=t,e},te=t=>{const e=Object.create(Yt);return e.left=t,e},ee=Qt,re=Zt,ne=c(2,((t,{onLeft:e,onRight:r})=>ee(t)?e(t.left):r(t.right)))({onLeft:u,onRight:u}),se=c(2,((t,e)=>{if(re(t))return t.right;throw e(t.left)})),ie=t=>t.length>0,oe=t=>(e,r)=>e===r?0:t(e,r),ce=oe(((t,e)=>t<e?-1:1)),ue=c(2,((t,e)=>oe(((r,n)=>t(e(r),e(n)))))),ae=t=>c(2,((e,r)=>1===t(e,r))),he=()=>Jt,le=Vt,fe=qt,de=Ut,be=c(2,((t,{onNone:e,onSome:r})=>fe(t)?e():r(t.value))),me=c(2,((t,e)=>fe(t)?e():t.value)),pe=c(2,((t,e)=>fe(t)?le(e()):t)),ge=t=>null==t?he():le(t),ye=me(f),Se=c(2,((t,e)=>fe(t)?he():le(e(t.value)))),ve=c(2,((t,e)=>fe(t)?he():e(t.value))),we=(t=>c(2,((e,r)=>!fe(e)&&t(e.value,r))))(X()),_e=(...t)=>t,Oe=t=>new Array(t),Ee=c(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})),Me=t=>Array.isArray(t)?t:Array.from(t),ke=c(2,((t,e)=>[e,...t])),Ie=c(2,((t,e)=>[...t,e])),Ce=c(2,((t,e)=>Me(t).concat(Me(e)))),Ne=ie,je=ie,Ae=(t,e)=>t<0||t>=e.length,Fe=c(2,((t,e)=>{const r=Math.floor(e);return Ae(r,t)?he():le(t[r])})),Re=c(2,((t,e)=>{const r=Math.floor(e);if(Ae(r,t))throw new Error(`Index ${r} out of bounds`);return t[r]})),xe=Fe(0),$e=Re(0),Te=t=>t[t.length-1],Le=t=>t.slice(1),De=c(2,((t,e)=>Ve(t,((t,e)=>{let r=0;for(const n of t){if(!e(n,r))break;r++}return r})(t,e)))),Be=c(2,((t,e)=>{const r=Me(t);return r.slice(((t,e)=>Math.floor(Math.min(Math.max(0,t),e.length)))(e,r),r.length)})),ze=t=>Array.from(t).reverse(),Pe=c(2,((t,e)=>{const r=Array.from(t);return r.sort(e),r})),qe=c(2,((t,e)=>Ue(t,e,_e))),Ue=c(3,((t,e,r)=>{const n=Me(t),s=Me(e);if(je(n)&&je(s)){const t=[r($e(n),$e(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[]})),Je=X(),Ve=c(2,((t,e)=>{const r=Array.from(t),n=Math.floor(e);return je(r)?n>=1?Ge(r,n):[[],r]:[r,[]]})),Ge=c(2,((t,e)=>{const r=Math.max(1,Math.floor(e));return r>=t.length?[He(t),[]]:[ke(t.slice(1,r),$e(t)),t.slice(r)]})),He=t=>t.slice(),We=c(3,((t,e,r)=>{const n=Me(t),s=Me(e);return je(n)?je(s)?rr(r)(Ce(n,s)):n:s})),Ye=c(2,((t,e)=>We(t,e,Je))),Ke=t=>[t],Qe=c(2,((t,e)=>t.map(e))),Ze=c(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}))(u),Xe=c(3,((t,e,r)=>Me(t).reduce(((t,e,n)=>r(t,e,n)),e))),tr=(t,e)=>{const r=[];let n,s=t;for(;de(n=e(s));){const[t,e]=n.value;r.push(t),s=e}return r},er=t=>m(((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=c(2,((t,e)=>{const r=Me(t);if(je(r)){const t=[$e(r)],n=Le(r);for(const r of n)t.every((t=>!e(r,t)))&&t.push(r);return t}return[]})),nr=t=>rr(t,X()),sr=c(2,((t,e)=>Me(t).join(e))),ir=ce,or=Symbol.for("effect/Brand/Refined"),cr=Symbol.for("effect/Context/Tag"),ur=Symbol.for("effect/Context/Reference"),ar=Symbol.for("effect/STM"),hr={...At,_op:"Tag",[ar]:jt,[cr]:{_Service:t=>t,_Identifier:t=>t},toString(){return rt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[tt](){return this.toJSON()},of:t=>t,context(t){return gr(this,t)}},lr={...hr,[ur]:ur},fr=Symbol.for("effect/Context"),dr={[fr]:{_Services:t=>t},[Y](t){if(mr(t)&&this.unsafeMap.size===t.unsafeMap.size){for(const e of this.unsafeMap.keys())if(!t.unsafeMap.has(e)||!K(this.unsafeMap.get(e),t.unsafeMap.get(e)))return!1;return!0}return!1},[D](){return W(this,J(this.unsafeMap.size))},pipe(){return at(this,arguments)},toString(){return rt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(et)}},[tt](){return this.toJSON()}},br=t=>{const e=Object.create(dr);return e.unsafeMap=t,e},mr=t=>O(t,fr),pr=br(new Map),gr=(t,e)=>br(new Map([[t.key,e]])),yr=c(3,((t,e,r)=>{const n=new Map(t.unsafeMap);return n.set(e.key,r),br(n)})),Sr=S("effect/Context/defaultValueCache",(()=>new Map)),vr=t=>{if(Sr.has(t.key))return Sr.get(t.key);const e=t.defaultValue();return Sr.set(t.key,e),e},wr=c(2,((t,e)=>{if(!t.unsafeMap.has(e.key)){if(ur in e)return vr(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,Or=c(2,((t,e)=>t.unsafeMap.has(e.key)?Vt(t.unsafeMap.get(e.key)):O(e,ur)?Vt(vr(e)):Jt)),Er=c(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(hr);return Object.defineProperty(n,"stack",{get:()=>r.stack}),n.key=t,n},kr=()=>pr,Ir=gr,Cr=yr,Nr=_r,jr=wr,Ar=Or,Fr=Er,Rr=()=>(t,e)=>{const r=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;function s(){}return Error.stackTraceLimit=r,Object.setPrototypeOf(s,lr),s.key=t,s.defaultValue=e.defaultValue,Object.defineProperty(s,"stack",{get:()=>n.stack}),s},xr=Symbol.for("effect/Chunk"),$r=[],Tr=(t=>m(((e,r)=>e.length===r.length&&Gr(e).every(((e,n)=>t(e,Kr(r,n)))))))(K),Lr={[xr]:{_A:t=>t},toString(){return rt(this.toJSON())},toJSON(){return{_id:"Chunk",values:Gr(this).map(et)}},[tt](){return this.toJSON()},[Y](t){return Br(t)&&Tr(this,t)},[D](){return W(this,H(Gr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return $r[Symbol.iterator]();default:return Gr(this)[Symbol.iterator]()}},pipe(){return at(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=zr,e.right=zr;break;case"ISingleton":e.length=1,e.depth=0,e.left=zr,e.right=zr;break;case"ISlice":e.length=t.length,e.depth=t.chunk.depth+1,e.left=zr,e.right=zr}return e},Br=t=>O(t,xr),zr=Dr({_tag:"IEmpty"}),Pr=()=>zr,qr=(...t)=>Yr(t),Ur=t=>Dr({_tag:"ISingleton",a:t}),Jr=t=>Br(t)?t:Wr(Me(t)),Vr=(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":Vr(t.left,e,r),Vr(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]=Kr(t,n),n+=1,s+=1;break}}},Gr=t=>{switch(t.backing._tag){case"IEmpty":return $r;case"IArray":return t.backing.array;default:{const e=new Array(t.length);return Vr(t,e,0),t.backing={_tag:"IArray",array:e},t.left=zr,t.right=zr,t.depth=0,e}}},Hr=t=>{switch(t.backing._tag){case"IEmpty":case"ISingleton":return t;case"IArray":return Dr({_tag:"IArray",array:ze(t.backing.array)});case"IConcat":return Dr({_tag:"IConcat",left:Hr(t.backing.right),right:Hr(t.backing.left)});case"ISlice":return Wr(ze(Gr(t)))}},Wr=t=>0===t.length?Pr():1===t.length?Ur(t[0]):Dr({_tag:"IArray",array:t}),Yr=t=>Wr(t),Kr=c(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?Kr(t.left,e):Kr(t.right,e-t.left.length);case"ISlice":return Kr(t.backing.chunk,e+t.backing.offset)}})),Qr=c(2,((t,e)=>tn(t,Ur(e)))),Zr=c(2,((t,e)=>tn(Ur(e),t))),Xr=c(2,((t,e)=>{if(e<=0)return t;if(e>=t.length)return zr;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?Xr(t.right,e-t.left.length):Dr({_tag:"IConcat",left:Xr(t.left,e),right:t.right});default:return Dr({_tag:"ISlice",chunk:t,offset:e,length:t.length-e})}})),tn=c(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=tn(t.right,e);return Dr({_tag:"IConcat",left:t.left,right:r})}{const r=tn(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=tn(t,e.left);return Dr({_tag:"IConcat",left:r,right:e.right})}{const r=tn(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})}}})),en=t=>t.length>0,rn=t=>Kr(t,0),nn=rn,sn=t=>Xr(t,1),on=Symbol.for("effect/Duration"),cn=BigInt(0),un=BigInt(24),an=BigInt(60),hn=BigInt(1e3),ln=BigInt(1e6),fn=BigInt(1e9),dn=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,bn=t=>{if(Sn(t))return t;if(v(t))return En(t);if((t=>"bigint"==typeof t)(t))return _n(t);if(Array.isArray(t)&&2===t.length&&t.every(v))return t[0]===-1/0||t[1]===-1/0||Number.isNaN(t[0])||Number.isNaN(t[1])?vn:t[0]===1/0||t[1]===1/0?wn:_n(BigInt(Math.round(1e9*t[0]))+BigInt(Math.round(t[1])));if((t=>"string"==typeof t)(t)){const e=dn.exec(t);if(e){const[t,r,n]=e,s=Number(r);switch(n){case"nano":case"nanos":return _n(BigInt(r));case"micro":case"micros":return On(BigInt(r));case"milli":case"millis":return En(s);case"second":case"seconds":return Mn(s);case"minute":case"minutes":return kn(s);case"hour":case"hours":return In(s);case"day":case"days":return Cn(s);case"week":case"weeks":return Nn(s)}}}throw new Error("Invalid DurationInput")},mn={_tag:"Millis",millis:0},pn={_tag:"Infinity"},gn={[on]:on,[D](){return W(this,G(this.value))},[Y](t){return Sn(t)&&Tn(this,t)},toString(){return`Duration(${Ln(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:An(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},yn=t=>{const e=Object.create(gn);return e.value=v(t)?isNaN(t)||t<=0?mn:Number.isFinite(t)?Number.isInteger(t)?{_tag:"Millis",millis:t}:{_tag:"Nanos",nanos:BigInt(Math.round(1e6*t))}:pn:t<=cn?mn:{_tag:"Nanos",nanos:t},e},Sn=t=>O(t,on),vn=yn(0),wn=yn(1/0),_n=t=>yn(t),On=t=>yn(t*hn),En=t=>yn(t),Mn=t=>yn(1e3*t),kn=t=>yn(6e4*t),In=t=>yn(36e5*t),Cn=t=>yn(864e5*t),Nn=t=>yn(6048e5*t),jn=t=>Fn(t,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),An=t=>{const e=bn(t);switch(e.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(e.value.nanos/fn),Number(e.value.nanos%fn)];case"Millis":return[Math.floor(e.value.millis/1e3),Math.round(e.value.millis%1e3*1e6)]}},Fn=c(2,((t,e)=>{const r=bn(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)}})),Rn=c(3,((t,e,r)=>{const n=bn(t),s=bn(e);if("Infinity"===n.value._tag||"Infinity"===s.value._tag)return r.onMillis(jn(n),jn(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)})),xn=c(2,((t,e)=>Rn(t,e,{onMillis:(t,e)=>t<=e,onNanos:(t,e)=>t<=e}))),$n=c(2,((t,e)=>Rn(t,e,{onMillis:(t,e)=>t>=e,onNanos:(t,e)=>t>=e}))),Tn=c(2,((t,e)=>((t,e)=>Rn(t,e,{onMillis:(t,e)=>t===e,onNanos:(t,e)=>t===e}))(bn(t),bn(e)))),Ln=t=>{const e=bn(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===cn;case"Infinity":return!1}})(e))return"0";const r=(t=>{const e=bn(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=bn(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/ln,s=n/hn,i=s/an,o=i/an;return{days:Number(o/un),hours:Number(o%un),minutes:Number(i%an),seconds:Number(s%an),millis:Number(n%hn),nanos:Number(r%ln)}})(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(" ")},Dn=Math.pow(2,5),Bn=Dn-1,zn=Dn/2,Pn=Dn/4;function qn(t,e){return e>>>t&Bn}function Un(t){return 1<<t}function Jn(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 Vn(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 Gn(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 Hn{_tag="EmptyNode";modify(t,e,r,n,s,i){const o=r(he());return fe(o)?new Hn:(++i.value,new Kn(t,n,s,o))}}function Wn(t){return E(t,"EmptyNode")}function Yn(t,e){return!Wn(t)&&e===t.edit}class Kn{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(K(s,this.key)){const e=r(this.value);return e===this.value?this:fe(e)?(--i.value,new Hn):Yn(this,t)?(this.value=e,this):new Kn(t,n,s,e)}const o=r(he());return fe(o)?this:(++i.value,es(t,e,this.hash,this,n,new Kn(t,n,s,o)))}}class Qn{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=Yn(this,t),n=this.updateCollisionList(e,t,this.hash,this.children,r,s,i);return n===this.children?this:n.length>1?new Qn(t,this.hash,n):n[0]}const o=r(he());return fe(o)?this:(++i.value,es(t,e,this.hash,this,n,new Kn(t,n,s,o)))}updateCollisionList(t,e,r,n,s,i,o){const c=n.length;for(let u=0;u<c;++u){const c=n[u];if("key"in c&&K(i,c.key)){const a=c.value,h=s(a);return h===a?n:fe(h)?(--o.value,Gn(t,u,n)):Vn(t,u,new Kn(e,r,i,h),n)}}const u=s(he());return fe(u)?n:(++o.value,Vn(t,c,new Kn(e,r,i,u),n))}}class Zn{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,u=qn(e,n),a=Un(u),h=Jn(o,a),l=o&a,f=Yn(this,t);if(!l){const l=(new Hn).modify(t,e+5,r,n,s,i);return l?c.length>=zn?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 Xn(t,c+1,i)}(t,u,l,o,c):new Zn(t,o|a,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 d=c[h],b=d.modify(t,e+5,r,n,s,i);if(d===b)return this;let m,p=o;if(Wn(b)){if(p&=~a,!p)return new Hn;if(c.length<=2&&(Wn(g=c[1^h])||"LeafNode"===g._tag||"CollisionNode"===g._tag))return c[1^h];m=Gn(f,h,c)}else m=Vn(f,h,b,c);var g;return f?(this.mask=p,this.children=m,this):new Zn(t,p,m)}}class Xn{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,u=qn(e,n),a=c[u],h=(a||new Hn).modify(t,e+5,r,n,s,i);if(a===h)return this;const l=Yn(this,t);let f;if(Wn(a)&&!Wn(h))++o,f=Vn(l,u,h,c);else if(!Wn(a)&&Wn(h)){if(--o,o<=Pn)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&&!Wn(e)&&(s[i++]=e,o|=1<<t)}return new Zn(t,o,s)}(t,o,u,c);f=Vn(l,u,new Hn,c)}else f=Vn(l,u,h,c);return l?(this.size=o,this.children=f,this):new Xn(t,o,f)}}function ts(t,e,r,n,s,i){if(r===s)return new Qn(t,r,[i,n]);const o=qn(e,r),c=qn(e,s);if(o===c)return e=>new Zn(t,Un(o)|Un(c),[e]);{const e=o<c?[n,i]:[i,n];return new Zn(t,Un(o)|Un(c),e)}}function es(t,e,r,n,s,i){let o,c=e;for(;;){const e=ts(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 rs="effect/HashMap",ns=Symbol.for(rs),ss={[ns]:ns,[Symbol.iterator](){return new os(this,((t,e)=>[t,e]))},[D](){let t=B(rs);for(const e of this)t^=b(B(e[0]),P(B(e[1])));return W(this,t)},[Y](t){if(fs(t)){if(t._size!==this._size)return!1;for(const e of this){const r=b(t,bs(e[0],B(e[0])));if(fe(r))return!1;if(!K(e[1],r.value))return!1}return!0}return!1},toString(){return rt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(et)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},is=(t,e,r,n)=>{const s=Object.create(ss);return s._editable=t,s._edit=e,s._root=r,s._size=n,s};class os{map;f;v;constructor(t,e){this.map=t,this.f=e,this.v=us(this.map._root,this.f,void 0)}next(){if(fe(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=cs(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new os(this.map,this.f)}}const cs=t=>t?as(t[0],t[1],t[2],t[3],t[4]):he(),us=(t,e,r)=>{switch(t._tag){case"LeafNode":return de(t.value)?le({value:e(t.key,t.value.value),cont:r}):cs(r);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const n=t.children;return as(n.length,n,0,e,r)}default:return cs(r)}},as=(t,e,r,n,s)=>{for(;r<t;){const i=e[r++];if(i&&!Wn(i))return us(i,n,[t,e,r,n,s])}return cs(s)},hs=is(!1,0,new Hn,0),ls=()=>hs,fs=t=>O(t,ns),ds=c(2,((t,e)=>bs(t,e,B(e)))),bs=c(3,((t,e,r)=>{let n=t._root,s=0;for(;;)switch(n._tag){case"LeafNode":return K(e,n.key)?n.value:he();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&&K(e,n.key))return n.value}}return he();case"IndexedNode":{const t=Un(qn(s,r));if(n.mask&t){n=n.children[Jn(n.mask,t)],s+=5;break}return he()}case"ArrayNode":if(n=n.children[qn(s,r)],n){s+=5;break}return he();default:return he()}})),ms=c(2,((t,e)=>de(bs(t,e,B(e))))),ps=c(3,((t,e,r)=>ws(t,e,(()=>le(r))))),gs=c(3,((t,e,r)=>t._editable?(t._root=e,t._size=r,t):e===t._root?t:is(t._editable,t._edit,e,r))),ys=t=>new os(t,(t=>t)),Ss=t=>t._size,vs=t=>is(!0,t._edit+1,t._root,t._size),ws=c(3,((t,e,r)=>_s(t,e,B(e),r))),_s=c(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 b(t,gs(i,s.value))})),Os=c(2,((t,e)=>ws(t,e,he))),Es=c(2,((t,e)=>ks(t,ls(),((t,r,n)=>ps(t,n,e(r,n)))))),Ms=c(2,((t,e)=>ks(t,void 0,((t,r,n)=>e(r,n))))),ks=c(3,((t,e,r)=>{const n=t._root;if("LeafNode"===n._tag)return de(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&&!Wn(n)&&("LeafNode"===n._tag?de(n.value)&&(e=r(e,n.value.value,n.key)):s.push(n.children))}return e})),Is="effect/HashSet",Cs=Symbol.for(Is),Ns={[Cs]:Cs,[Symbol.iterator](){return ys(this._keyMap)},[D](){return W(this,P(B(this._keyMap))(B(Is)))},[Y](t){return!!As(t)&&Ss(this._keyMap)===Ss(t._keyMap)&&K(this._keyMap,t._keyMap)},toString(){return rt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(et)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},js=t=>{const e=Object.create(Ns);return e._keyMap=t,e},As=t=>O(t,Cs),Fs=js(ls()),Rs=()=>Fs,xs=c(2,((t,e)=>ms(t._keyMap,e))),$s=t=>js(vs(t._keyMap)),Ts=t=>(t._keyMap._editable=!1,t),Ls=c(2,((t,e)=>{const r=$s(t);return e(r),Ts(r)})),Ds=c(2,((t,e)=>t._keyMap._editable?(ps(e,!0)(t._keyMap),t):js(ps(e,!0)(t._keyMap)))),Bs=c(2,((t,e)=>t._keyMap._editable?(Os(e)(t._keyMap),t):js(Os(e)(t._keyMap)))),zs=c(2,((t,e)=>Ls(t,(t=>{for(const r of e)Bs(t,r)})))),Ps=c(2,((t,e)=>Ls(Rs(),(r=>{qs(t,(t=>Ds(r,t)));for(const t of e)Ds(r,t)})))),qs=c(2,((t,e)=>Ms(t._keyMap,((t,r)=>e(r))))),Us=c(3,((t,e,r)=>ks(t._keyMap,e,((t,e,n)=>r(t,n))))),Js=Rs,Vs=(...t)=>{const e=$s(Rs());for(const r of t)Ds(e,r);return Ts(e)},Gs=xs,Hs=t=>Ss(t._keyMap),Ws=Ds,Ys=Bs,Ks=zs,Qs=Ps,Zs=Us,Xs=Symbol.for("effect/MutableRef"),ti={[Xs]:Xs,toString(){return rt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:et(this.current)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},ei=t=>{const e=Object.create(ti);return e.current=t,e},ri=c(3,((t,e,r)=>!!K(e,t.current)&&(t.current=r,!0))),ni=t=>t.current,si=c(2,((t,e)=>(t.current=e,t))),ii="effect/FiberId",oi=Symbol.for(ii),ci="None",ui="Runtime",ai=V(`${ii}-${ci}`);let hi=class{[oi]=oi;_tag=ci;id=-1;startTimeMillis=-1;[D](){return ai}[Y](t){return di(t)&&t._tag===ci}toString(){return rt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[tt](){return this.toJSON()}};class li{id;startTimeMillis;[oi]=oi;_tag=ui;constructor(t,e){this.id=t,this.startTimeMillis=e}[D](){return W(this,V(`${ii}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[Y](t){return di(t)&&t._tag===ui&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return rt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[tt](){return this.toJSON()}}const fi=new hi,di=t=>O(t,oi),bi=t=>{switch(t._tag){case ci:return Js();case ui:return Vs(t.id);case"Composite":return b(bi(t.left),Qs(bi(t.right)))}},mi=S(Symbol.for("effect/Fiber/Id/_fiberCounter"),(()=>ei(0))),pi=t=>Array.from(bi(t)).map((t=>`#${t}`)).join(","),gi=fi,yi=pi,Si=()=>{const t=ni(mi);return b(mi,si(t+1)),new li(t,Date.now())},vi=ls,wi=ds,_i=ps,Oi=ys,Ei=ws,Mi=Es,ki=ks,Ii=Symbol.for("effect/List"),Ci=t=>Me(t),Ni=(()=>p(er(K),Ci))(),ji={[Ii]:Ii,_tag:"Cons",toString(){return rt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:Ci(this).map(et)}},[tt](){return this.toJSON()},[Y](t){return $i(t)&&this._tag===t._tag&&Ni(this,t)},[D](){return W(this,H(Ci(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 at(this,arguments)}},Ai=(t,e)=>{const r=Object.create(ji);return r.head=t,r.tail=e,r},Fi=V("Nil"),Ri={[Ii]:Ii,_tag:"Nil",toString(){return rt(this.toJSON())},toJSON:()=>({_id:"List",_tag:"Nil"}),[tt](){return this.toJSON()},[D]:()=>Fi,[Y](t){return $i(t)&&this._tag===t._tag},[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})}),pipe(){return at(this,arguments)}},xi=Object.create(Ri),$i=t=>O(t,Ii),Ti=t=>"Nil"===t._tag,Li=(t,e)=>Ai(t,e),Di=()=>xi,Bi=t=>Ai(t,xi),zi=c(2,((t,e)=>qi(e,t))),Pi=c(2,((t,e)=>Li(e,t))),qi=c(2,((t,e)=>{if(Ti(t))return e;if(Ti(e))return t;{const r=Ai(e.head,t);let n=r,s=e.tail;for(;!Ti(s);){const e=Ai(s.head,t);n.tail=e,n=e,s=s.tail}return r}})),Ui=c(3,((t,e,r)=>{let n=e,s=t;for(;!Ti(s);)n=r(n,s.head),s=s.tail;return n})),Ji=t=>{let e=Di(),r=t;for(;!Ti(r);)e=Pi(e,r.head),r=r.tail;return e},Vi=function(){function t(t){t&&Object.assign(this,t)}return t.prototype=Ft,t}(),Gi=t=>Object.assign(Object.create(Ft),t),Hi=Symbol.for("effect/DifferContextPatch");function Wi(t){return t}const Yi={...Vi.prototype,[Hi]:{_Value:Wi,_Patch:Wi}},Ki=Object.create(Object.assign(Object.create(Yi),{_tag:"Empty"})),Qi=()=>Ki,Zi=Object.assign(Object.create(Yi),{_tag:"AndThen"}),Xi=Object.assign(Object.create(Yi),{_tag:"AddService"}),to=(t,e)=>{const r=Object.create(Xi);return r.key=t,r.service=e,r},eo=Object.assign(Object.create(Yi),{_tag:"RemoveService"}),ro=t=>{const e=Object.create(eo);return e.key=t,e},no=Object.assign(Object.create(Yi),{_tag:"UpdateService"}),so=(t,e)=>{const r=Object.create(no);return r.key=t,r.update=e,r},io=c(2,((t,e)=>((t,e)=>{const r=Object.create(Zi);return r.first=t,r.second=e,r})(t,e))),oo=c(2,((t,e)=>{if("Empty"===t._tag)return e;let r=!1,n=Ur(t);const s=new Map(e.unsafeMap);for(;en(n);){const t=nn(n),e=sn(n);switch(t._tag){case"Empty":n=e;break;case"AddService":s.set(t.key,t.service),n=e;break;case"AndThen":n=Zr(Zr(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)})),co=Symbol.for("effect/DifferHashSetPatch");function uo(t){return t}const ao={...Vi.prototype,[co]:{_Value:uo,_Key:uo,_Patch:uo}},ho=Object.create(Object.assign(Object.create(ao),{_tag:"Empty"})),lo=()=>ho,fo=Object.assign(Object.create(ao),{_tag:"AndThen"}),bo=Object.assign(Object.create(ao),{_tag:"Add"}),mo=t=>{const e=Object.create(bo);return e.value=t,e},po=Object.assign(Object.create(ao),{_tag:"Remove"}),go=c(2,((t,e)=>((t,e)=>{const r=Object.create(fo);return r.first=t,r.second=e,r})(t,e))),yo=c(2,((t,e)=>{if("Empty"===t._tag)return e;let r=e,n=Ur(t);for(;en(n);){const t=nn(n),e=sn(n);switch(t._tag){case"Empty":n=e;break;case"AndThen":n=Zr(t.first)(Zr(t.second)(e));break;case"Add":r=Ws(t.value)(r),n=e;break;case"Remove":r=Ys(t.value)(r),n=e}}return r})),So=Symbol.for("effect/DifferReadonlyArrayPatch");function vo(t){return t}const wo={...Vi.prototype,[So]:{_Value:vo,_Patch:vo}},_o=Object.create(Object.assign(Object.create(wo),{_tag:"Empty"})),Oo=()=>_o,Eo=Object.assign(Object.create(wo),{_tag:"AndThen"}),Mo=Object.assign(Object.create(wo),{_tag:"Append"}),ko=Object.assign(Object.create(wo),{_tag:"Slice"}),Io=Object.assign(Object.create(wo),{_tag:"Update"}),Co=(t,e)=>{const r=Object.create(Io);return r.index=t,r.patch=e,r},No=c(2,((t,e)=>((t,e)=>{const r=Object.create(Eo);return r.first=t,r.second=e,r})(t,e))),jo=c(3,((t,e,r)=>{if("Empty"===t._tag)return e;let n=e.slice(),s=Ke(t);for(;Ne(s);){const t=$e(s),e=Le(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})),Ao=Symbol.for("effect/Differ"),Fo={[Ao]:{_P:u,_V:u},pipe(){return at(this,arguments)}},Ro=t=>{const e=Object.create(Fo);return e.empty=t.empty,e.diff=t.diff,e.combine=t.combine,e.patch=t.patch,e},xo=()=>$o(((t,e)=>e)),$o=t=>Ro({empty:u,combine:(t,e)=>t===u?e:e===u?t:r=>e(t(r)),diff:(t,e)=>K(t,e)?u:a(e),patch:(e,r)=>t(r,e(r))}),To=255,Lo=t=>t&To,Do=t=>t>>8&To,Bo=(t,e)=>(t&To)+((e&t&To)<<8),zo=Bo(0,0),Po=c(2,((t,e)=>Bo(Lo(t)&~e,Do(t)))),qo=c(2,((t,e)=>t|e)),Uo=c(2,((t,e)=>t|e)),Jo=t=>Vo(t)&&!Ko(t),Vo=t=>Go(t,1),Go=c(2,((t,e)=>!!(t&e))),Ho=(...t)=>t.reduce(((t,e)=>t|e),0),Wo=Ho(0),Yo=t=>Go(t,4),Ko=t=>Go(t,16),Qo=c(2,((t,e)=>Bo(t^e,e))),Zo=c(2,((t,e)=>t&(~Lo(e)>>>0&To|Do(e))|Lo(e)&Do(e))),Xo=Ro({empty:zo,diff:(t,e)=>Qo(t,e),combine:(t,e)=>qo(e)(t),patch:(t,e)=>Zo(e,t)}),tc=t=>Bo(t,0),ec=Po,rc=(t,e)=>({_tag:"Par",left:t,right:e}),nc=(t,e)=>({_tag:"Seq",left:t,right:e}),sc=t=>{let e=t,r=ac(),n=Di(),s=Di();for(;;)switch(e._tag){case"Empty":if(Ti(n))return[r,s];e=n.head,n=n.tail;break;case"Par":n=Li(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=rc(nc(t.left,r),nc(n,r));break}case"Seq":e=nc(t.left,nc(t.right,r));break;case"Single":e=t,s=Li(r,s)}break}case"Single":if(r=hc(r,e),Ti(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")},ic=(t,e)=>{if(Ti(t))return Bi(bc(e));if(fc(e))return t;const r=vc(t.head),n=dc(e);return 1===r.length&&1===n.length&&K(r[0],n[0])?Li(Sc(t.head,bc(e)),t.tail):Li(bc(e),t)},oc=Symbol.for("effect/RequestBlock/RequestBlockParallel"),cc={_R:t=>t};class uc{map;[oc]=cc;constructor(t){this.map=t}}const ac=()=>new uc(vi()),hc=(t,e)=>new uc(Ei(t.map,e.dataSource,(t=>pe(Se(t,Qr(e.blockedRequest)),(()=>Ur(e.blockedRequest)))))),lc=(t,e)=>new uc(ki(t.map,e.map,((t,e,r)=>_i(t,r,be(wi(t,r),{onNone:()=>e,onSome:t=>tn(e,t)}))))),fc=t=>(t=>t&&Wn(t._root))(t.map),dc=t=>Array.from(Oi(t.map)),bc=t=>yc(Mi(t.map,(t=>Ur(t)))),mc=Symbol.for("effect/RequestBlock/RequestBlockSequential"),pc={_R:t=>t};class gc{map;[mc]=pc;constructor(t){this.map=t}}const yc=t=>new gc(t),Sc=(t,e)=>new gc(ki(e.map,t.map,((t,e,r)=>_i(t,r,be(wi(t,r),{onNone:()=>Pr(),onSome:t=>tn(t,e)}))))),vc=t=>Array.from(Oi(t.map)),wc="Die",_c="Empty",Oc="Fail",Ec="Interrupt",Mc="Parallel",kc="Sequential",Ic="effect/Cause",Cc=Symbol.for(Ic),Nc={[Cc]:{_E:t=>t},[D](){return b(B(Ic),P(B(Pc(this))),W(this))},[Y](t){return Tc(t)&&zc(this,t)},pipe(){return at(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:et(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:et(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:et(this.left),right:et(this.right)}}},toString(){return Qc(this)},[tt](){return this.toJSON()}},jc=(()=>{const t=Object.create(Nc);return t._tag=_c,t})(),Ac=t=>{const e=Object.create(Nc);return e._tag=Oc,e.error=t,e},Fc=t=>{const e=Object.create(Nc);return e._tag=wc,e.defect=t,e},Rc=t=>{const e=Object.create(Nc);return e._tag=Ec,e.fiberId=t,e},xc=(t,e)=>{const r=Object.create(Nc);return r._tag=Mc,r.left=t,r.right=e,r},$c=(t,e)=>{const r=Object.create(Nc);return r._tag=kc,r.left=t,r.right=e,r},Tc=t=>O(t,Cc),Lc=t=>Kc(void 0,Vc)(t),Dc=t=>{const e=(t=>Uc(t,(t=>t._tag===Oc?le(t.error):he())))(t);switch(e._tag){case"None":return Xt(t);case"Some":return te(e.value)}},Bc=t=>Wc(t,{onEmpty:jc,onFail:()=>jc,onDie:Fc,onInterrupt:Rc,onSequential:$c,onParallel:xc}),zc=(t,e)=>{let r=Ur(t),n=Ur(e);for(;en(r)&&en(n);){const[t,e]=b(nn(r),Yc([Js(),Pr()],(([t,e],r)=>{const[n,s]=Jc(r);return le([b(t,Qs(n)),b(e,tn(s))])}))),[s,i]=b(nn(n),Yc([Js(),Pr()],(([t,e],r)=>{const[n,s]=Jc(r);return le([b(t,Qs(n)),b(e,tn(s))])})));if(!K(t,s))return!1;r=e,n=i}return!0},Pc=t=>qc(Ur(t),Pr()),qc=(t,e)=>{for(;;){const[r,n]=b(t,Xe([Js(),Pr()],(([t,e],r)=>{const[n,s]=Jc(r);return[b(t,Qs(n)),b(e,tn(s))]}))),s=Hs(r)>0?b(e,Zr(r)):e;if(0===n.length)return Hr(s);t=n,e=s}throw new Error(I("Cause.flattenCauseLoop"))},Uc=c(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 kc:case Mc:r.push(t.right),r.push(t.left)}break;case"Some":return n}}return he()})),Jc=t=>{let e=t;const r=[];let n=Js(),s=Pr();for(;void 0!==e;)switch(e._tag){case _c:if(0===r.length)return[n,s];e=r.pop();break;case Oc:if(n=Ws(n,qr(e._tag,e.error)),0===r.length)return[n,s];e=r.pop();break;case wc:if(n=Ws(n,qr(e._tag,e.defect)),0===r.length)return[n,s];e=r.pop();break;case Ec:if(n=Ws(n,qr(e._tag,e.fiberId)),0===r.length)return[n,s];e=r.pop();break;case kc:switch(e.left._tag){case _c:e=e.right;break;case kc:e=$c(e.left.left,$c(e.left.right,e.right));break;case Mc:e=xc($c(e.left.left,e.right),$c(e.left.right,e.right));break;default:s=Zr(s,e.right),e=e.left}break;case Mc:r.push(e.right),e=e.left}throw new Error(I("Cause.evaluateCauseLoop"))},Vc={emptyCase:h,failCase:l,dieCase:l,interruptCase:h,sequentialCase:(t,e,r)=>e&&r,parallelCase:(t,e,r)=>e&&r},Gc="SequentialCase",Hc="ParallelCase",Wc=c(2,((t,{onDie:e,onEmpty:r,onFail:n,onInterrupt:s,onParallel:i,onSequential:o})=>Kc(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)}))),Yc=c(3,((t,e,r)=>{let n=e,s=t;const i=[];for(;void 0!==s;){const t=r(n,s);switch(n=de(t)?t.value:n,s._tag){case kc:case Mc:i.push(s.right),s=s.left;break;default:s=void 0}void 0===s&&i.length>0&&(s=i.pop())}return n})),Kc=c(3,((t,e,r)=>{const n=[t],s=[];for(;n.length>0;){const t=n.pop();switch(t._tag){case _c:s.push(Xt(r.emptyCase(e)));break;case Oc:s.push(Xt(r.failCase(e,t.error)));break;case wc:s.push(Xt(r.dieCase(e,t.defect)));break;case Ec:s.push(Xt(r.interruptCase(e,t.fiberId)));break;case kc:n.push(t.right),n.push(t.left),s.push(te({_tag:Gc}));break;case Mc:n.push(t.right),n.push(t.left),s.push(te({_tag:Hc}))}}const i=[];for(;s.length>0;){const t=s.pop();switch(t._tag){case"Left":switch(t.left._tag){case Gc:{const t=i.pop(),n=i.pop(),s=r.sequentialCase(e,t,n);i.push(s);break}case Hc:{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()})),Qc=(t,e)=>Lc(t)?"All fibers interrupted without errors.":iu(t).map((function(t){return!0!==e?.renderErrorCause||void 0===t.cause?t.stack:`${t.stack} {\n${Zc(t.cause," ")}\n}`})).join("\n"),Zc=(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${Zc(t.cause,`${e} `)}\n${e}}`),n};class Xc extends globalThis.Error{span=void 0;constructor(t){const e="object"==typeof t&&null!==t,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(tu(t),e&&"cause"in t&&void 0!==t.cause?{cause:new Xc(t.cause)}:void 0),""===this.message&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",e&&(su in t&&(this.span=t[su]),Object.keys(t).forEach((e=>{e in this||(this[e]=t[e])}))),this.stack=nu(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const tu=t=>{if("string"==typeof t)return t;if("object"==typeof t&&null!==t&&t instanceof Error)return t.message;try{if(O(t,"toString")&&w(t.toString)&&t.toString!==Object.prototype.toString&&t.toString!==globalThis.Array.prototype.toString)return t.toString()}catch{}return st(t)},eu=/\((.*)\)/g,ru=S("effect/Tracer/spanToTrace",(()=>new WeakMap)),nu=(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=ru.get(t);if("function"==typeof r){const e=r();if("string"==typeof e){const r=e.matchAll(eu);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=ye(t.parent),e++}}return n.join("\n")},su=Symbol.for("effect/SpanAnnotation"),iu=t=>Kc(t,void 0,{emptyCase:()=>[],dieCase:(t,e)=>[new Xc(e)],failCase:(t,e)=>[new Xc(e)],interruptCase:()=>[],parallelCase:(t,e,r)=>[...e,...r],sequentialCase:(t,e,r)=>[...e,...r]}),ou="Pending",cu="Done",uu=Symbol.for("effect/Deferred"),au={_E:t=>t,_A:t=>t},hu=t=>({_tag:cu,effect:t});class lu{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 lu(this.self)}}const fu=(t,e)=>{const r=new mu("Blocked");return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r},du=Symbol.for("effect/Effect");class bu{patch;op;_op=Et;constructor(t,e){this.patch=t,this.op=e}}class mu{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=jt;constructor(t){this._op=t}[Y](t){return this===t}[D](){return W(this,z(this))}pipe(){return at(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:et(this.effect_instruction_i0),effect_instruction_i1:et(this.effect_instruction_i1),effect_instruction_i2:et(this.effect_instruction_i2)}}toString(){return rt(this.toJSON())}[tt](){return this.toJSON()}[Symbol.iterator](){return new lu(new F(this))}}class pu{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=jt;constructor(t){this._op=t,this._tag=t}[Y](t){return Xa(t)&&"Failure"===t._op&&K(this.effect_instruction_i0,t.effect_instruction_i0)}[D](){return b(V(this._tag),P(B(this.effect_instruction_i0)),W(this))}get cause(){return this.effect_instruction_i0}pipe(){return at(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return rt(this.toJSON())}[tt](){return this.toJSON()}[Symbol.iterator](){return new lu(new F(this))}}class gu{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[du]=jt;constructor(t){this._op=t,this._tag=t}[Y](t){return Xa(t)&&"Success"===t._op&&K(this.effect_instruction_i0,t.effect_instruction_i0)}[D](){return b(V(this._tag),P(B(this.effect_instruction_i0)),W(this))}get value(){return this.effect_instruction_i0}pipe(){return at(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:et(this.value)}}toString(){return rt(this.toJSON())}[tt](){return this.toJSON()}[Symbol.iterator](){return new lu(new F(this))}}const yu=t=>O(t,du),Su=t=>{const e=new mu(_t);return e.effect_instruction_i0=t,e},vu=c(3,((t,e,r)=>sa((n=>Bu(t,(t=>Bu(Fu(ta((()=>n(e(t))))),(e=>ta((()=>r(t,e))).pipe(Uu({onFailure:t=>{switch(e._tag){case ft:return $u($c(e.effect_instruction_i0,t));case pt:return $u(t)}},onSuccess:()=>e})))))))))),wu=c(2,((t,e)=>Bu(t,(()=>Xu(e))))),_u=t=>wu(t,void 0),Ou=function(){const t=new mu(lt);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(I("you're not supposed to end up here"))}return t},Eu=(t,e=gi)=>{const r=new mu(ht);let n;return r.effect_instruction_i0=e=>{n=t(e)},r.effect_instruction_i1=e,Zu(r,(()=>yu(n)?n:ia))},Mu=(t,e=gi)=>Ou(t,(function(){let t,r;function n(e){t?t(e):void 0===r&&(r=e)}const s=new mu(ht);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=T((()=>this.effect_instruction_i0(n,o.signal)))):i=T((()=>this.effect_instruction_i0(n))),i||o?Zu(s,(()=>(o&&o.abort(),i??ia))):s})),ku=c(2,((t,e)=>Ju(t,{onFailure:e,onSuccess:Xu}))),Iu=Symbol.for("effect/OriginalAnnotation"),Cu=(t,e)=>de(e)?new Proxy(t,{has:(t,e)=>e===su||e===Iu||e in t,get:(r,n)=>n===su?e.value:n===Iu?t:r[n]}):t,Nu=t=>_(t)&&!(su in t)?Su((e=>$u(Fc(Cu(t,vh(e)))))):$u(Fc(t)),ju=t=>Tu((()=>Fc(new Ha(t)))),Au=t=>Ju(t,{onFailure:t=>Xu(te(t)),onSuccess:t=>Xu(Xt(t))}),Fu=t=>qu(t,{onFailure:rh,onSuccess:ih}),Ru=t=>_(t)&&!(su in t)?Su((e=>$u(Ac(Cu(t,vh(e)))))):$u(Ac(t)),xu=t=>Bu(ea(t),Ru),$u=t=>{const e=new pu(ft);return e.effect_instruction_i0=t,e},Tu=t=>Bu(ea(t),$u),Lu=Su((t=>Xu(t.id()))),Du=t=>Su((e=>t(e.id()))),Bu=c(2,((t,e)=>{const r=new mu(bt);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),zu=t=>{const e=new mu("OnStep");return e.effect_instruction_i0=t,e},Pu=t=>Bu(t,u),qu=c(2,((t,e)=>Uu(t,{onFailure:t=>Xu(e.onFailure(t)),onSuccess:t=>Xu(e.onSuccess(t))}))),Uu=c(2,((t,e)=>{const r=new mu(mt);return r.effect_instruction_i0=t,r.effect_instruction_i1=e.onFailure,r.effect_instruction_i2=e.onSuccess,r})),Ju=c(2,((t,e)=>Uu(t,{onFailure:t=>{const r=(t=>Hr(Yc(t,Pr(),((t,e)=>e._tag===wc?le(b(t,Zr(e.defect))):he()))))(t);if(r.length>0)return $u((t=>Wc(t,{onEmpty:jc,onFail:Fc,onDie:Fc,onInterrupt:Rc,onSequential:$c,onParallel:xc}))(t));const n=(t=>Hr(Yc(t,Pr(),((t,e)=>e._tag===Oc?le(b(t,Zr(e.error))):he()))))(t);return n.length>0?e.onFailure(rn(n)):$u(t)},onSuccess:e.onSuccess}))),Vu=c(2,((t,e)=>ta((()=>{const r=Me(t),n=Oe(r.length);let s=0;return wu(oa({while:()=>s<r.length,body:()=>e(r[s],s),step:t=>{n[s++]=t}}),n)})))),Gu=c(2,((t,e)=>ta((()=>{const r=Me(t);let n=0;return oa({while:()=>n<r.length,body:()=>e(r[n],n),step:()=>{n++}})})))),Hu=t=>{const e=new mu(St);return e.effect_instruction_i0=Bo(r=1,r),e.effect_instruction_i1=()=>t,e;var r},Wu=c(2,((t,e)=>Bu(t,(t=>ea((()=>e(t))))))),Yu=c(2,((t,e)=>Ju(t,{onFailure:t=>xu((()=>e.onFailure(t))),onSuccess:t=>ea((()=>e.onSuccess(t)))}))),Ku=c(2,((t,e)=>Uu(t,{onFailure:t=>{const r=Dc(t);switch(r._tag){case"Left":return xu((()=>e(r.left)));case"Right":return $u(r.right)}},onSuccess:Xu}))),Qu=c(2,((t,e)=>sa((r=>Uu(r(t),{onFailure:t=>{const r=rh(t);return Uu(e(r),{onFailure:e=>rh($c(t,e)),onSuccess:()=>r})},onSuccess:t=>{const r=ih(t);return ha(e(r),r)}}))))),Zu=c(2,((t,e)=>Qu(t,sh({onFailure:t=>Lc(t)?_u(e((t=>Yc(t,Js(),((t,e)=>e._tag===Ec?le(b(t,Ws(e.fiberId))):he())))(t))):ia,onSuccess:()=>ia})))),Xu=t=>{const e=new gu(pt);return e.effect_instruction_i0=t,e},ta=t=>{const e=new mu(lt);return e.commit=t,e},ea=t=>{const e=new mu(gt);return e.effect_instruction_i0=t,e},ra=c((t=>3===t.length||2===t.length&&!(_(t[1])&&"onlyEffect"in t[1])),((t,e)=>Bu(t,(t=>{const r="function"==typeof e?e(t):e;return yu(r)?wu(r,t):O(n=r,"then")&&w(n.then)?Eu((e=>{r.then((()=>e(Xu(t))),(t=>e(Ru(new Za(t,"An unknown error occurred in Effect.tap")))))})):Xu(t);var n})))),na=t=>{const e=new mu(St);return e.effect_instruction_i0=tc(1),e.effect_instruction_i1=()=>t,e},sa=t=>Ou(t,(function(){const t=new mu(St);return t.effect_instruction_i0=tc(1),t.effect_instruction_i1=t=>Vo(t)?T((()=>this.effect_instruction_i0(Hu))):T((()=>this.effect_instruction_i0(na))),t})),ia=Xu(void 0),oa=t=>{const e=new mu(vt);return e.effect_instruction_i0=t.while,e.effect_instruction_i1=t.body,e.effect_instruction_i2=t.step,e},ca=t=>{const e=new mu(Ot);return void 0!==t?.priority?$a(e,t.priority):e},ua=c(2,((t,e)=>Bu(t,(t=>Wu(e,(e=>[t,e])))))),aa=c(2,((t,e)=>Bu(t,(t=>wu(e,t))))),ha=c(2,((t,e)=>Bu(t,(()=>e)))),la=c(2,((t,e)=>Bu(t.interruptAsFork(e),(()=>t.await)))),fa={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return at(this,arguments)}},da={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return at(this,arguments)}},ba={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return at(this,arguments)}},ma={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return at(this,arguments)}},pa=Symbol.for("effect/FiberRef"),ga={_A:t=>t},ya=t=>Su((e=>ih(e.getFiberRef(t)))),Sa=c(2,((t,e)=>Bu(ya(t),e))),va=c(2,((t,e)=>wa(t,(()=>[void 0,e])))),wa=c(2,((t,e)=>Su((r=>{const[n,s]=e(r.getFiberRef(t));return r.setFiberRef(t,s),Xu(n)})))),_a=c(3,((t,e,r)=>vu(aa(ya(e),va(e,r)),(()=>t),(t=>va(e,t))))),Oa=(t,e)=>Ia(t,{differ:xo(),fork:e?.fork??u,join:e?.join}),Ea=t=>{const e=Ro({empty:lo(),combine:(t,e)=>go(e)(t),diff:(t,e)=>((t,e)=>{const[r,n]=Zs([t,lo()],(([t,e],r)=>Gs(r)(t)?[Ys(r)(t),e]:[t,go(mo(r))(e)]))(e);return Zs(n,((t,e)=>go((t=>{const e=Object.create(po);return e.value=t,e})(e))(t)))(r)})(t,e),patch:(t,e)=>yo(e)(t)});return Ia(t,{differ:e,fork:e.empty})},Ma=t=>{const e=(t=>Ro({empty:Oo(),combine:(t,e)=>No(t,e),diff:(e,r)=>(t=>{let e=0,r=Oo();for(;e<t.oldValue.length&&e<t.newValue.length;){const n=t.differ.diff(t.oldValue[e],t.newValue[e]);K(n,t.differ.empty)||(r=No(r,Co(e,n))),e+=1}return e<t.oldValue.length&&(r=No(r,((t,e)=>{const r=Object.create(ko);return r.from=0,r.until=e,r})(0,e))),e<t.newValue.length&&(r=No(r,(t=>{const e=Object.create(Mo);return e.values=t,e})(Be(e)(t.newValue)))),r})({oldValue:e,newValue:r,differ:t}),patch:(e,r)=>jo(e,r,t)}))(xo());return Ia(t,{differ:e,fork:e.empty})},ka=t=>{const e=Ro({empty:Qi(),combine:(t,e)=>io(e)(t),diff:(t,e)=>((t,e)=>{const r=new Map(t.unsafeMap);let n=Qi();for(const[t,s]of e.unsafeMap.entries())if(r.has(t)){const e=r.get(t);r.delete(t),K(e,s)||(n=io(so(t,(()=>s)))(n))}else r.delete(t),n=io(to(t,s))(n);for(const[t]of r.entries())n=io(ro(t))(n);return n})(t,e),patch:(t,e)=>oo(e)(t)});return Ia(t,{differ:e,fork:e.empty})},Ia=(t,e)=>({...Rt,[pa]:ga,initial:t,commit(){return ya(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)}),Ca=t=>Ia(t,{differ:Xo,fork:Xo.empty}),Na=S(Symbol.for("effect/FiberRef/currentContext"),(()=>ka(kr()))),ja=S(Symbol.for("effect/FiberRef/currentSchedulingPriority"),(()=>Oa(0))),Aa=S(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),(()=>Oa(2048))),Fa=S(Symbol.for("effect/FiberRef/currentLogAnnotation"),(()=>Oa(vi()))),Ra=S(Symbol.for("effect/FiberRef/currentLogLevel"),(()=>Oa(ba))),xa=S(Symbol.for("effect/FiberRef/currentLogSpan"),(()=>Oa(Di()))),$a=c(2,((t,e)=>_a(t,ja,e))),Ta=S(Symbol.for("effect/FiberRef/currentConcurrency"),(()=>Oa("unbounded"))),La=S(Symbol.for("effect/FiberRef/currentRequestBatching"),(()=>Oa(!0))),Da=S(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),(()=>Oa(le(ma)))),Ba=S(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),(()=>Oa(le(da)))),za=S(Symbol.for("effect/FiberRef/currentMetricLabels"),(()=>Ma([]))),Pa=S(Symbol.for("effect/FiberRef/currentForkScopeOverride"),(()=>Oa(he(),{fork:()=>he(),join:t=>t}))),qa=S(Symbol.for("effect/FiberRef/currentInterruptedCause"),(()=>Oa(jc,{fork:()=>jc,join:t=>t}))),Ua=(t,e)=>t.fork(e),Ja=function(){class t extends globalThis.Error{commit(){return Ru(this)}toJSON(){const t={...this};return this.message&&(t.message=this.message),this.cause&&(t.cause=this.cause),t}[tt](){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?Qc(Ac(this),{renderErrorCause:!0}):this}}return Object.assign(t.prototype,xt),t}(),Va=(t,e)=>{class r extends Ja{_tag=e}return Object.assign(r.prototype,t),r.prototype.name=e,r},Ga=Symbol.for("effect/Cause/errors/RuntimeException"),Ha=Va({[Ga]:Ga},"RuntimeException"),Wa=Symbol.for("effect/Cause/errors/InterruptedException"),Ya=Symbol.for("effect/Cause/errors/NoSuchElement"),Ka=Va({[Ya]:Ya},"NoSuchElementException"),Qa=Symbol.for("effect/Cause/errors/UnknownException"),Za=function(){class t extends Ja{_tag="UnknownException";error;constructor(t,e){super(e??"An unknown error occurred",{cause:t}),this.error=t}}return Object.assign(t.prototype,{[Qa]:Qa,name:"UnknownException"}),t}(),Xa=t=>yu(t)&&"_tag"in t&&("Success"===t._tag||"Failure"===t._tag),th=(t,e)=>uh(t,e?.parallel?xc:$c),eh=t=>rh(Ac(t)),rh=t=>{const e=new pu(ft);return e.effect_instruction_i0=t,e},nh=c(2,((t,e)=>{switch(t._tag){case ft:return rh(t.effect_instruction_i0);case pt:return ih(e(t.effect_instruction_i0))}})),sh=c(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case ft:return e(t.effect_instruction_i0);case pt:return r(t.effect_instruction_i0)}})),ih=t=>{const e=new gu(pt);return e.effect_instruction_i0=t,e},oh=ih(void 0),ch=c(3,((t,e,{onFailure:r,onSuccess:n})=>{switch(t._tag){case ft:switch(e._tag){case pt:return rh(t.effect_instruction_i0);case ft:return rh(r(t.effect_instruction_i0,e.effect_instruction_i0))}case pt:switch(e._tag){case pt:return ih(n(t.effect_instruction_i0,e.effect_instruction_i0));case ft:return rh(e.effect_instruction_i0)}}})),uh=(t,e)=>{const r=Jr(t);return en(r)?b(sn(r),Xe(b(nn(r),nh(Ur)),((t,r)=>b(t,ch(r,{onSuccess:(t,e)=>b(t,Zr(e)),onFailure:e})))),nh(Hr),nh((t=>Gr(t))),le):he()},ah=t=>{var e;return{...Rt,[uu]:au,state:ei((e=[],{_tag:ou,joiners:e})),commit(){return hh(this)},blockingOn:t}},hh=t=>((t,e=gi)=>ta((()=>Eu(t,e))))((e=>{const r=ni(t.state);switch(r._tag){case cu:return e(r.effect);case ou:return r.joiners.push(e),bh(t,e)}}),t.blockingOn),lh=c(2,((t,e)=>ea((()=>{const r=ni(t.state);switch(r._tag){case cu:return!1;case ou:si(t.state,hu(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e);return!0}})))),fh=c(2,((t,e)=>lh(t,e))),dh=(t,e)=>{const r=ni(t.state);if(r._tag===ou){si(t.state,hu(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e)}},bh=(t,e)=>ea((()=>{const r=ni(t.state);if(r._tag===ou){const t=r.joiners.indexOf(e);t>=0&&r.joiners.splice(t,1)}})),mh=Su((t=>ih(t.currentContext))),ph=()=>mh,gh=t=>Bu(ph(),t),yh=c(2,((t,e)=>_a(Na,e)(t))),Sh=c(2,((t,e)=>gh((r=>yh(t,e(r)))))),vh=t=>{const e=t.currentSpan;return void 0!==e&&"Span"===e._tag?le(e):he()},wh=hh,_h=fh,Oh=ah,Eh=ih,Mh=Symbol.for("effect/MutableHashMap"),kh={[Mh]:Mh,[Symbol.iterator](){return new Ih(this)},toString(){return rt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(et)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}};class Ih{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 Ch(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new Ih(this.self)}}class Ch{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 Nh=()=>{const t=Object.create(kh);return t.referential=new Map,t.buckets=new Map,t.bucketsSize=0,t},jh=c(2,((t,e)=>{if(!1===Z(e))return t.referential.has(e)?le(t.referential.get(e)):he();const r=e[D](),n=t.buckets.get(r);return void 0===n?he():Ah(t,n,e)})),Ah=(t,e,r,n=!1)=>{for(let s=0,i=e.length;s<i;s++)if(r[Y](e[s][0])){const r=e[s][1];return n&&(e.splice(s,1),t.bucketsSize--),le(r)}return he()},Fh=c(2,((t,e)=>de(jh(t,e)))),Rh=c(3,((t,e,r)=>{if(!1===Z(e))return t.referential.set(e,r),t;const n=e[D](),s=t.buckets.get(n);return void 0===s?(t.buckets.set(n,[[e,r]]),t.bucketsSize++,t):(xh(t,s,e),s.push([e,r]),t.bucketsSize++,t)})),xh=(t,e,r)=>{for(let n=0,s=e.length;n<s;n++)if(r[Y](e[n][0]))return e.splice(n,1),void t.bucketsSize--},$h=c(2,((t,e)=>{if(!1===Z(e))return t.referential.delete(e),t;const r=e[D](),n=t.buckets.get(r);return void 0===n||(xh(t,n,e),0===n.length&&t.buckets.delete(r)),t})),Th=t=>t.referential.size+t.bucketsSize,Lh=Symbol.for("effect/MutableList"),Dh={[Lh]:Lh,[Symbol.iterator](){let t=!1,e=this.head;return{next(){if(t)return this.return();if(null==e)return t=!0,this.return();const r=e.value;return e=e.next,{done:t,value:r}},return:e=>(t||(t=!0),{done:!0,value:e})}},toString(){return rt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(et)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},Bh=t=>t._length,zh=c(2,((t,e)=>{const r=(t=>({value:t,removed:!1,prev:void 0,next:void 0}))(e);return void 0===t.head&&(t.head=r),void 0===t.tail||(t.tail.next=r,r.prev=t.tail),t.tail=r,t._length+=1,t})),Ph=Symbol.for("effect/MutableQueue"),qh=Symbol.for("effect/mutable/MutableQueue/Empty"),Uh={[Ph]:Ph,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return rt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(et)}},[tt](){return this.toJSON()},pipe(){return at(this,arguments)}},Jh=t=>{const e=Object.create(Uh);return e.queue=(()=>{const t=Object.create(Dh);return t.head=void 0,t.tail=void 0,t._length=0,t})(),e.capacity=t,e},Vh=c(2,((t,e)=>{const r=Bh(t.queue);return(void 0===t.capacity||r!==t.capacity)&&(zh(e)(t.queue),!0)})),Gh=c(2,((t,e)=>(t=>0===Bh(t))(t.queue)?e:(t=>{const e=t.head;if(void 0!==e)return((t,e)=>{e.removed||(e.removed=!0,void 0!==e.prev&&void 0!==e.next?(e.prev.next=e.next,e.next.prev=e.prev):void 0!==e.prev?(t.tail=e.prev,e.prev.next=void 0):void 0!==e.next?(t.head=e.next,e.next.prev=void 0):(t.tail=void 0,t.head=void 0),t._length>0&&(t._length-=1))})(t,e),e.value})(t.queue))),Hh=Symbol.for("effect/Clock"),Wh=Mr("effect/Clock"),Yh={unsafeSchedule(t,e){const r=jn(e);if(r>2147483647)return l;let n=!1;const s=setTimeout((()=>{n=!0,t()}),r);return()=>(clearTimeout(s),!n)}},Kh=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())))}(),Qh=function(){const t="object"==typeof process&&"hrtime"in process&&"function"==typeof process.hrtime.bigint?process.hrtime:void 0;if(!t)return Kh;const e=Kh()-t.bigint();return()=>e+t.bigint()}();class Zh{[Hh]=Hh;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Qh()}currentTimeMillis=ea((()=>this.unsafeCurrentTimeMillis()));currentTimeNanos=ea((()=>this.unsafeCurrentTimeNanos()));scheduler(){return Xu(Yh)}sleep(t){return Mu((e=>{const r=Yh.unsafeSchedule((()=>e(ia)),t);return _u(ea(r))}))}}const Xh=()=>new Zh,tl="InvalidData",el="MissingData",rl="SourceUnavailable",nl="Unsupported",sl=Symbol.for("effect/ConfigError"),il={_tag:"ConfigError",[sl]:sl},ol=(t,e)=>{const r=Object.create(il);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},cl=(t,e)=>{const r=Object.create(il);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},ul=(t,e,r={pathDelim:"."})=>{const n=Object.create(il);return n._op=tl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Invalid data at ${b(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},al=(t,e,r={pathDelim:"."})=>{const n=Object.create(il);return n._op=el,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Missing data at ${b(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},hl=(t,e,r,n={pathDelim:"."})=>{const s=Object.create(il);return s._op=rl,s.path=t,s.message=e,s.cause=r,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${b(this.path,sr(n.pathDelim))}: "${this.message}")`}}),s},ll=(t,e,r={pathDelim:"."})=>{const n=Object.create(il);return n._op=nl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${b(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},fl=c(2,((t,e)=>{switch(t._op){case"And":return ol(fl(t.left,e),fl(t.right,e));case"Or":return cl(fl(t.left,e),fl(t.right,e));case tl:return ul([...e,...t.path],t.message);case el:return al([...e,...t.path],t.message);case rl:return hl([...e,...t.path],t.message,t.cause);case nl:return ll([...e,...t.path],t.message)}})),dl={_tag:"Empty"},bl=c(2,((t,e)=>{let r=Bi(e),n=t;for(;"Cons"===r._tag;){const t=r.head;switch(t._tag){case"Empty":r=r.tail;break;case"AndThen":r=Li(t.first,Li(t.second,r.tail));break;case"MapName":n=Qe(n,t.f),r=r.tail;break;case"Nested":n=ke(n,t.name),r=r.tail;break;case"Unnested":if(!b(xe(n),we(t.name)))return te(al(n,`Expected ${t.name} to be in path in ConfigProvider#unnested`));n=Le(n),r=r.tail}}return Xt(n)})),ml=(t,e)=>[...t,...e],pl=Symbol.for("effect/ConfigProvider"),gl=Mr("effect/ConfigProvider"),yl=Symbol.for("effect/ConfigProviderFlat"),Sl=t=>({[pl]:pl,pipe(){return at(this,arguments)},...t}),vl=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=>({[yl]:yl,patch:t.patch,load:(e,r,n=!0)=>t.load(e,r,n),enumerateChildren:t.enumerateChildren}))({load:(t,s,i=!0)=>{const o=(t=>b(t,sr(e)))(t),c=n();return b(o in c?le(c[o]):he(),Ku((()=>al(t,`Expected ${o} to exist in the process context`))),Bu((e=>Ol(e,t,s,r,i))))},enumerateChildren:t=>ea((()=>{const r=n();return(t=>{const e=$s(Rs());for(const r of t)Ds(e,r);return Ts(e)})(Object.keys(r).map((t=>t.toUpperCase().split(e))).filter((e=>{for(let r=0;r<t.length;r++){const n=b(t,Re(r)),s=e[r];if(void 0===s||n!==s)return!1}return!0})).flatMap((e=>e.slice(t.length,t.length+1))))})),patch:dl}),Sl({load:t=>Bu(wl(s,[],t,!1),(e=>be(xe(e),{onNone:()=>Ru(al([],`Expected a single value having structure: ${t}`)),onSome:Xu}))),flattened:s});var s},wl=(t,e,r,n)=>{const s=r;switch(s._tag){case"Constant":return Xu(Ke(s.value));case"Described":return ta((()=>wl(t,e,s.config,n)));case"Fail":return Ru(al(e,s.message));case"Fallback":return b(ta((()=>wl(t,e,s.first,n))),ku((r=>s.condition(r)?b(wl(t,e,s.second,n),ku((t=>Ru(cl(r,t))))):Ru(r))));case"Lazy":return ta((()=>wl(t,e,s.config(),n)));case"MapOrFail":return ta((()=>b(wl(t,e,s.original,n),Bu(Vu((t=>b(s.mapOrFail(t),Ku(fl(((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 ta((()=>wl(t,ml(e,Ke(s.name)),s.config,n)));case"Primitive":return b(bl(e,t.patch),Bu((e=>b(t.load(e,s,n),Bu((t=>{if(0===t.length){const t=b(je(r=e)?le(Te(r)):he(),me((()=>"<n/a>")));return Ru(al([],`Expected ${s.description} with name ${t}`))}var r;return Xu(t)}))))));case"Sequence":return b(bl(e,t.patch),Bu((r=>b(t.enumerateChildren(r),Bu(Ml),Bu((r=>0===r.length?ta((()=>Wu(wl(t,e,s.config,!0),Ke))):b(Vu(r,(r=>wl(t,Ie(e,`[${r}]`),s.config,!0))),Wu((t=>{const e=Ze(t);return Ke(0===e.length?[]:e)})))))))));case"HashMap":return ta((()=>b(bl(e,t.patch),Bu((e=>b(t.enumerateChildren(e),Bu((r=>b(r,Vu((r=>wl(t,ml(e,Ke(r)),s.valueConfig,n))),Wu((t=>0===t.length?Ke(vi()):b(El(t),Qe((t=>(t=>{const e=vs(ls());for(const r of t)ps(e,r[0],r[1]);return(r=e)._editable=!1,r;var r})(qe(Me(r),t))))))))))))))));case"ZipWith":return ta((()=>b(wl(t,e,s.left,n),Au,Bu((r=>b(wl(t,e,s.right,n),Au,Bu((t=>{if(ee(r)&&ee(t))return Ru(ol(r.left,t.left));if(ee(r)&&re(t))return Ru(r.left);if(re(r)&&ee(t))return Ru(t.left);if(re(r)&&re(t)){const n=b(e,sr(".")),i=_l(e,n),[o,c]=((t,e,r,n)=>{const s=tr(r.length,(e=>e>=n.length?he():le([t(e),e+1]))),i=tr(n.length,(t=>t>=r.length?he():le([e(t),t+1])));return[ml(r,s),ml(n,i)]})(i,i,b(r.right,Qe(Xt)),b(t.right,Qe(Xt)));return b(o,qe(c),Vu((([t,e])=>b(ua(t,e),Wu((([t,e])=>s.zip(t,e)))))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")}))))))))}},_l=(t,e)=>r=>te(al(t,`The element at index ${r} in a sequence at path "${e}" was missing`)),Ol=(t,e,r,n,s)=>s?b(((t,e)=>{const r=t.split(new RegExp(`\\s*${(t=>t.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"))(e)}\\s*`));return r})(t,n),Vu((t=>r.parse(t.trim()))),Ku(fl(e))):b(r.parse(t),Yu({onFailure:fl(e),onSuccess:Ke})),El=t=>Object.keys(t[0]).map((e=>t.map((t=>t[e])))),Ml=t=>b(Vu(t,Il),Yu({onFailure:()=>[],onSuccess:Pe(ir)}),Au,Wu(ne)),kl=/^(\[(\d+)\])$/,Il=t=>{const e=t.match(kl);if(null!==e){const t=e[2];return b(void 0!==t&&t.length>0?le(t):he(),ve(Cl))}return he()},Cl=t=>{const e=Number.parseInt(t);return Number.isNaN(e)?he():le(e)},Nl=Symbol.for("effect/Console"),jl=Mr("effect/Console"),Al={[Nl]:Nl,assert:(t,...e)=>ea((()=>{console.assert(t,...e)})),clear:ea((()=>{console.clear()})),count:t=>ea((()=>{console.count(t)})),countReset:t=>ea((()=>{console.countReset(t)})),debug:(...t)=>ea((()=>{console.debug(...t)})),dir:(t,e)=>ea((()=>{console.dir(t,e)})),dirxml:(...t)=>ea((()=>{console.dirxml(...t)})),error:(...t)=>ea((()=>{console.error(...t)})),group:t=>ea(t?.collapsed?()=>console.groupCollapsed(t?.label):()=>console.group(t?.label)),groupEnd:ea((()=>{console.groupEnd()})),info:(...t)=>ea((()=>{console.info(...t)})),log:(...t)=>ea((()=>{console.log(...t)})),table:(t,e)=>ea((()=>{console.table(t,e)})),time:t=>ea((()=>console.time(t))),timeEnd:t=>ea((()=>console.timeEnd(t))),timeLog:(t,...e)=>ea((()=>{console.timeLog(t,...e)})),trace:(...t)=>ea((()=>{console.trace(...t)})),warn:(...t)=>ea((()=>{console.warn(...t)})),unsafe:console},Fl=Symbol.for("effect/Random"),Rl=Mr("effect/Random");class xl{seed;[Fl]=Fl;PRNG;constructor(t){this.seed=t,this.PRNG=new N(t)}get next(){return ea((()=>this.PRNG.number()))}get nextBoolean(){return Wu(this.next,(t=>t>.5))}get nextInt(){return ea((()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER)))}nextRange(t,e){return Wu(this.next,(r=>(e-t)*r+t))}nextIntBetween(t,e){return ea((()=>this.PRNG.integer(e-t)+t))}shuffle(t){return $l(t,(t=>this.nextIntBetween(0,t)))}}const $l=(t,e)=>ta((()=>b(ea((()=>Array.from(t))),Bu((t=>{const r=[];for(let e=t.length;e>=2;e-=1)r.push(e);return b(r,Gu((r=>b(e(r),Wu((e=>Tl(t,r-1,e)))))),wu(Jr(t)))}))))),Tl=(t,e,r)=>{const n=t[e];return t[e]=t[r],t[r]=n,t},Ll=t=>new xl(B(t)),Dl=Symbol.for("effect/Tracer"),Bl=t=>({[Dl]:Dl,...t}),zl=Mr("effect/Tracer"),Pl=Mr("effect/ParentSpan"),ql=function(){return function(t){let e="";for(let r=0;r<t;r++)e+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return e}}();class Ul{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:ql(32),this.spanId=ql(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 Jl=Bl({span:(t,e,r,n,s,i)=>new Ul(t,e,r,n,s,i),context:t=>t()}),Vl=b(kr(),Cr(Wh,Xh()),Cr(jl,Al),Cr(Rl,Ll(Math.random())),Cr(gl,vl()),Cr(zl,Jl)),Gl=S(Symbol.for("effect/DefaultServices/currentServices"),(()=>ka(Vl))),Hl=Symbol.for("effect/FiberRefs");class Wl{locals;[Hl]=Hl;constructor(t){this.locals=t}pipe(){return at(this,arguments)}}const Yl=c(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][Y](e)){if(!n.has(r)){if(K(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,u=n;for(;void 0===i;)if(je(o)&&je(c)){const t=$e(o)[0],e=Le(o),r=$e(c)[0],n=$e(c)[1],s=Le(c);t.startTimeMillis<r.startTimeMillis?(c=s,u=!0):t.startTimeMillis>r.startTimeMillis?o=e:t.id<r.id?(c=s,u=!0):t.id>r.id?o=e:i=[n,u]}else i=[s.initial,!0];return i})(r,i,t);if(c){const t=r.diff(o,s),c=i[0][1],u=r.join(c,r.patch(t)(c));if(!K(c,u)){let t;const s=i[0][0];t=s[Y](e)?[[s,u],...i.slice(1)]:[[e,u],...i],n.set(r,t)}}}})),new Wl(n)})),Kl=c(2,((t,e)=>{const r=new Map;return Ql(t,r,e),new Wl(r)})),Ql=(t,e,r)=>{t.locals.forEach(((t,n)=>{const s=t[0][1],i=n.patch(n.fork)(s);K(s,i)?e.set(n,t):e.set(n,[[r,i],...t])}))},Zl=c(2,((t,e)=>{const r=new Map(t.locals);return r.delete(e),new Wl(r)})),Xl=c(2,((t,e)=>t.locals.has(e)?le($e(t.locals.get(e))[1]):he())),tf=c(2,((t,e)=>b(Xl(t,e),me((()=>e.initial))))),ef=c(2,((t,{fiberId:e,fiberRef:r,value:n})=>{if(0===t.locals.size)return new Wl(new Map([[r,[[e,n]]]]));const s=new Map(t.locals);return rf(s,e,r,n),new Wl(s)})),rf=(t,e,r,n)=>{const s=t.get(r)??[];let i;if(je(s)){const[t,r]=$e(s);if(t[Y](e)){if(K(r,n))return;i=[[e,n],...s.slice(1)]}else i=[[e,n],...s]}else i=[[e,n]];t.set(r,i)},nf=c(2,((t,{entries:e,forkAs:r})=>{if(0===t.locals.size)return new Wl(new Map(e));const n=new Map(t.locals);return void 0!==r&&Ql(t,n,r),e.forEach((([t,e])=>{1===e.length?rf(n,e[0][0],t,e[0][1]):e.forEach((([e,r])=>{rf(n,e,t,r)}))})),new Wl(n)})),sf=tf,of=nf,cf=function(){return t=new Map,new Wl(t);var t},uf=fa,af=da,hf=ba,lf=ae(b(ir,ue((t=>t.ordinal)))),ff=t=>t.replace(/[\s="]/g,"_"),df=t=>e=>`${ff(e.label)}=${t-e.startTime}ms`,bf=At,mf=$t;class pf extends mf{}const gf="Empty",yf="Remove",Sf="Update",vf="AndThen",wf={_tag:gf},_f=c(2,((t,e)=>({_tag:vf,first:t,second:e}))),Of=c(3,((t,e,r)=>{let n=r,s=Ke(t);for(;je(s);){const t=$e(s),r=Le(s);switch(t._tag){case gf:s=r;break;case"Add":n=ef(n,{fiberId:e,fiberRef:t.fiberRef,value:t.value}),s=r;break;case yf:n=Zl(n,t.fiberRef),s=r;break;case Sf:{const i=tf(n,t.fiberRef);n=ef(n,{fiberId:e,fiberRef:t.fiberRef,value:t.fiberRef.patch(t.patch)(i)}),s=r;break}case vf:s=ke(t.first)(ke(t.second)(r))}}return n})),Ef="effect/MetricLabel",Mf=Symbol.for(Ef);class kf{key;value;[Mf]=Mf;_hash;constructor(t,e){this.key=t,this.value=e,this._hash=V(Ef+this.key+this.value)}[D](){return this._hash}[Y](t){return Cf(t)&&this.key===t.key&&this.value===t.value}pipe(){return at(this,arguments)}}const If=(t,e)=>new kf(t,e),Cf=t=>O(t,Mf),Nf=t=>(t=>Su((e=>t(e.currentDefaultServices))))((e=>t(e.unsafeMap.get(Wh.key)))),jf=t=>(...e)=>{const r=ge(t);let n;for(let t=0,r=e.length;t<r;t++){const r=e[t];Tc(r)&&(n=void 0!==n?$c(n,r):r,e=[...e.slice(0,t),...e.slice(t+1)],t--)}return void 0===n&&(n=jc),Su((t=>(t.log(e,n,r),ia)))},Af=jf(af),Ff=jf(uf),Rf=c(2,((t,e)=>Uu(t,{onFailure:t=>{const r=Dc(t);switch(r._tag){case"Left":return ha(e(r.left),$u(t));case"Right":return $u(t)}},onSuccess:Xu}))),xf=c(2,((t,e)=>ta((()=>e()?Wu(t,le):Xu(he()))))),$f={_tag:"Sequential"},Tf=$f,Lf={_tag:"Parallel"},Df=t=>({_tag:"ParallelN",parallelism:t}),Bf=Of,zf="effect/FiberStatus",Pf=Symbol.for(zf),qf="Done",Uf="Running",Jf="Suspended",Vf=V(`${zf}-${qf}`);class Gf{[Pf]=Pf;_tag=qf;[D](){return Vf}[Y](t){return Yf(t)&&t._tag===qf}}class Hf{runtimeFlags;[Pf]=Pf;_tag=Uf;constructor(t){this.runtimeFlags=t}[D](){return b(B(zf),P(B(this._tag)),P(B(this.runtimeFlags)),W(this))}[Y](t){return Yf(t)&&t._tag===Uf&&this.runtimeFlags===t.runtimeFlags}}class Wf{runtimeFlags;blockingOn;[Pf]=Pf;_tag=Jf;constructor(t,e){this.runtimeFlags=t,this.blockingOn=e}[D](){return b(B(zf),P(B(this._tag)),P(B(this.runtimeFlags)),P(B(this.blockingOn)),W(this))}[Y](t){return Yf(t)&&t._tag===Jf&&this.runtimeFlags===t.runtimeFlags&&K(this.blockingOn,t.blockingOn)}}const Yf=t=>O(t,Pf),Kf=new Gf,Qf=t=>new Hf(t),Zf=Symbol.for("effect/Micro"),Xf=Symbol.for("effect/Micro/MicroExit"),td=Symbol.for("effect/Micro/MicroCause"),ed={_E:u};class rd extends globalThis.Error{_tag;traces;[td];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=nt(e,0),o=`${s}: ${i}`;r.length>0&&(o+=`\n ${r.join("\n ")}`),super(i),this._tag=t,this.traces=r,this[td]=ed,this.name=s,this.stack=o}pipe(){return at(this,arguments)}toString(){return this.stack}[tt](){return this.stack}}class nd extends rd{error;constructor(t,e=[]){super("Fail",t,e),this.error=t}}class sd extends rd{defect;constructor(t,e=[]){super("Die",t,e),this.defect=t}}class id extends rd{constructor(t=[]){super("Interrupt","interrupted",t)}}const od=(t=[])=>new id(t),cd=t=>"Interrupt"===t._tag,ud=Symbol.for("effect/Micro/MicroFiber"),ad={_A:u,_E:u};class hd{context;interruptible;[ud];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,e=!0){this.context=t,this.interruptible=e,this[ud]=ad}getRef(t){return(e=this.context).unsafeMap.has((r=t).key)?e.unsafeMap.get(r.key):vr(r);var e,r}addObserver(t){return this._exit?(t(this._exit),d):(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(Pd))}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===yd)return;const r=ld.interruptChildren&&ld.interruptChildren(this);if(void 0!==r)return this.evaluate(Td(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(Yd).shouldYield(this)){e=!0;const t=r;r=Td(Nd,(()=>t))}if(r=r[bd](this),r===yd){const t=this._yielded;return Xf in t?(this._yielded=void 0,t):yd}}}catch(t){return O(r,bd)?qd(t):qd(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const e=this._stack.pop();if(!e)return;const r=e[gd]&&e[gd](this);if(r)return{[t]:r};if(e[t])return e}}_yielded=void 0;yieldWith(t){return this._yielded=t,yd}children(){return this._children??=new Set}}const ld=S("effect/Micro/fiberMiddleware",(()=>({interruptChildren:void 0}))),fd=Symbol.for("effect/Micro/identifier"),dd=Symbol.for("effect/Micro/args"),bd=Symbol.for("effect/Micro/evaluate"),md=Symbol.for("effect/Micro/successCont"),pd=Symbol.for("effect/Micro/failureCont"),gd=Symbol.for("effect/Micro/ensureCont"),yd=Symbol.for("effect/Micro/Yield"),Sd={_A:u,_E:u,_R:u},vd={...bf,_op:"Micro",[Zf]:Sd,pipe(){return at(this,arguments)},[Symbol.iterator](){return new C(new F(this))},toJSON(){return{_id:"Micro",op:this[fd],...dd in this?{args:this[dd]}:void 0}},toString(){return rt(this)},[tt](){return rt(this)}};function wd(){return qd("Micro.evaluate: Not implemented")}const _d=t=>({...vd,[fd]:t.op,[bd]:t.eval??wd,[md]:t.contA,[pd]:t.contE,[gd]:t.ensure}),Od=t=>{const e=_d(t);return function(){const r=Object.create(e);return r[dd]=!1===t.single?arguments:arguments[0],r}},Ed=t=>{const e={..._d(t),[Xf]:Xf,_tag:t.op,get[t.prop](){return this[dd]},toJSON(){return{_id:"MicroExit",_tag:t.op,[t.prop]:this[dd]}},[Y](e){return Dd(e)&&e._tag===t.op&&K(this[dd],e[dd])},[D](){return W(this,P(V(t.op))(B(this[dd])))}};return function(t){const r=Object.create(e);return r[dd]=t,r[md]=void 0,r[pd]=void 0,r[gd]=void 0,r}},Md=Ed({op:"Success",prop:"value",eval(t){const e=t.getCont(md);return e?e[md](this[dd],t):t.yieldWith(this)}}),kd=Ed({op:"Failure",prop:"cause",eval(t){let e=t.getCont(pd);for(;cd(this[dd])&&e&&t.interruptible;)e=t.getCont(pd);return e?e[pd](this[dd],t):t.yieldWith(this)}}),Id=t=>kd(((t,e=[])=>new nd(t,e))(t)),Cd=Od({op:"Suspend",eval(t){return this[dd]()}}),Nd=Od({op:"Yield",eval(t){let e=!1;return t.getRef(Yd).scheduleTask((()=>{e||t.evaluate(Ud)}),this[dd]??0),t.yieldWith((()=>{e=!0}))}})(0),jd=Md(void 0),Ad=t=>Rd((function(e,r){try{t.try(r).then((t=>e(Md(t))),(r=>e(Id(t.catch(r)))))}catch(r){e(Id(t.catch(r)))}}),0!==t.try.length),Fd=Od({op:"WithMicroFiber",eval(t){return this[dd](t)}}),Rd=Od({op:"Async",single:!1,eval(t){const e=this[dd][0];let r=!1,n=!1;const s=this[dd][1]?new AbortController:void 0,i=e((e=>{r||(r=!0,n?t.evaluate(e):n=e)}),s?.signal);return!1!==n?n:(n=!0,t._yielded=()=>{r=!0},void 0===s&&void 0===i||t._stack.push(xd((()=>(r=!0,s?.abort(),i??Ud)))),yd)}}),xd=Od({op:"AsyncFinalizer",ensure(t){t.interruptible&&(t.interruptible=!1,t._stack.push(Xd(!0)))},contE(t,e){return cd(t)?Td(this[dd](),(()=>kd(t))):kd(t)}}),$d=Od({op:"Iterator",contA(t,e){const r=this[dd].next(t);return r.done?Md(r.value):(e._stack.push(this),R(r.value))},eval(t){return this[md](void 0,t)}}),Td=c(2,((t,e)=>{const r=Object.create(Ld);return r[dd]=t,r[md]=e,r})),Ld=_d({op:"OnSuccess",eval(t){return t._stack.push(this),this[dd]}}),Dd=t=>O(t,Xf),Bd=Md,zd=kd,Pd=zd(od()),qd=t=>zd(((t,e=[])=>new sd(t,e))(t)),Ud=Bd(void 0),Jd="setImmediate"in globalThis?globalThis.setImmediate:t=>setTimeout(t,0);class Vd{tasks=[];running=!1;scheduleTask(t,e){this.tasks.push(t),this.running||(this.running=!0,Jd(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(Wd)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const Gd=c(2,((t,e)=>Fd((r=>{const n=r.context;return r.context=e(n),Zd(t,(()=>(r.context=n,jd)))})))),Hd=c(2,((t,e)=>Gd(t,Fr(e))));class Wd extends(Rr()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048})){}class Yd extends(Rr()("effect/Micro/currentScheduler",{defaultValue:()=>new Vd})){}const Kd=c(2,((t,e)=>{const r=Object.create(Qd);return r[dd]=t,r[md]=e.onSuccess,r[pd]=e.onFailure,r})),Qd=_d({op:"OnSuccessAndFailure",eval(t){return t._stack.push(this),this[dd]}}),Zd=c(2,((t,e)=>eb((r=>Kd(r(t),{onFailure:t=>Td(e(zd(t)),(()=>kd(t))),onSuccess:t=>Td(e(Bd(t)),(()=>Md(t)))}))))),Xd=Od({op:"SetInterruptible",ensure(t){if(t.interruptible=this[dd],t._interrupted&&t.interruptible)return()=>Pd}}),tb=t=>Fd((e=>e.interruptible?t:(e.interruptible=!0,e._stack.push(Xd(!1)),e._interrupted?Pd:t))),eb=t=>Fd((e=>e.interruptible?(e.interruptible=!1,e._stack.push(Xd(!0)),t(tb)):t(u)));class rb{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 nb{maxNextTickBeforeTimer;running=!1;tasks=new rb;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(Aa)&&t.getFiberRef(ja)}scheduleTask(t,e){this.tasks.scheduleTask(t,e),this.running||(this.running=!0,this.starve())}}const sb=S(Symbol.for("effect/Scheduler/defaultScheduler"),(()=>new nb(2048))),ib=S(Symbol.for("effect/FiberRef/currentScheduler"),(()=>Oa(sb))),ob=S(Symbol.for("effect/FiberRef/currentRequestMap"),(()=>Oa(new Map))),cb=(t,e,r,n)=>{switch(t){case void 0:return e();case"unbounded":return r();case"inherit":return Sa(Ta,(t=>"unbounded"===t?r():t>1?n(t):e()));default:return t>1?n(t):e()}},ub="InterruptSignal",ab="Stateful",hb="Resume",lb="YieldNow",fb=t=>({_tag:ub,cause:t}),db=t=>({_tag:ab,onFiber:t}),bb=t=>({_tag:hb,effect:t}),mb=Symbol.for("effect/FiberScope");class pb{[mb]=mb;fiberId=gi;roots=new Set;add(t,e){this.roots.add(e),e.addObserver((()=>{this.roots.delete(e)}))}}class gb{fiberId;parent;[mb]=mb;constructor(t,e){this.fiberId=t,this.parent=e}add(t,e){this.parent.tell(db((t=>{t.addChild(e),e.addObserver((()=>{t.removeChild(e)}))})))}}const yb=S(Symbol.for("effect/FiberScope/Global"),(()=>new pb)),Sb=Symbol.for("effect/Fiber"),vb={_E:t=>t,_A:t=>t},wb=Symbol.for("effect/Fiber"),_b=t=>aa(Pu(t.await),t.inheritAll),Ob="effect/FiberCurrent",Eb=Symbol.for("effect/Logger"),Mb={_Message:t=>t,_Output:t=>t},kb=t=>({[Eb]:Mb,log:t,pipe(){return at(this,arguments)}}),Ib=/^[^\s"=]*$/,Cb=(t,e)=>({annotations:r,cause:n,date:s,fiberId:i,logLevel:o,message:c,spans:u})=>{const a=(e,r)=>`${ff(e)}=${(e=>e.match(Ib)?e:t(e))(r)}`,h=(t,e)=>" "+a(t,e);let l=a("timestamp",s.toISOString());l+=h("level",o.label),l+=h("fiber",pi(i));const f=(d=c,Array.isArray(d)?d:[d]);var d;for(let t=0;t<f.length;t++)l+=h("message",nt(f[t],e));(t=>t._tag===_c)(n)||(l+=h("cause",Qc(n,{renderErrorCause:!0})));for(const t of u)l+=" "+df(s.getTime())(t);for(const[t,n]of r)l+=h(t,nt(n,e));return l},Nb=kb(Cb((t=>`"${t.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`)));"object"==typeof process&&null!==process&&"object"==typeof process.stdout&&null!==process.stdout&&process;const jb="effect/MetricBoundaries",Ab=Symbol.for(jb);class Fb{values;[Ab]=Ab;constructor(t){this.values=t,this._hash=b(V(jb),P(H(this.values)))}_hash;[D](){return this._hash}[Y](t){return Rb(t)&&K(this.values,t.values)}pipe(){return at(this,arguments)}}const Rb=t=>O(t,Ab),xb=t=>{const e=b(t,Ce(Ur(Number.POSITIVE_INFINITY)),nr);return new Fb(e)},$b=t=>b(Ee(t.count-1,(e=>t.start*Math.pow(t.factor,e))),Wr,xb),Tb=Symbol.for("effect/MetricKeyType"),Lb="effect/MetricKeyType/Counter",Db=Symbol.for(Lb),Bb=Symbol.for("effect/MetricKeyType/Frequency"),zb=Symbol.for("effect/MetricKeyType/Gauge"),Pb="effect/MetricKeyType/Histogram",qb=Symbol.for(Pb),Ub=Symbol.for("effect/MetricKeyType/Summary"),Jb={_In:t=>t,_Out:t=>t};class Vb{incremental;bigint;[Tb]=Jb;[Db]=Db;constructor(t,e){this.incremental=t,this.bigint=e,this._hash=V(Lb)}_hash;[D](){return this._hash}[Y](t){return Hb(t)}pipe(){return at(this,arguments)}}class Gb{boundaries;[Tb]=Jb;[qb]=qb;constructor(t){this.boundaries=t,this._hash=b(V(Pb),P(B(this.boundaries)))}_hash;[D](){return this._hash}[Y](t){return Wb(t)&&K(this.boundaries,t.boundaries)}pipe(){return at(this,arguments)}}const Hb=t=>O(t,Db),Wb=t=>O(t,qb),Yb=Symbol.for("effect/MetricKey"),Kb={_Type:t=>t},Qb=er(K);class Zb{name;keyType;description;tags;[Yb]=Kb;constructor(t,e,r,n=[]){this.name=t,this.keyType=e,this.description=r,this.tags=n,this._hash=b(V(this.name+this.description),P(B(this.keyType)),P(H(this.tags)))}_hash;[D](){return this._hash}[Y](t){return Xb(t)&&this.name===t.name&&K(this.keyType,t.keyType)&&K(this.description,t.description)&&Qb(this.tags,t.tags)}pipe(){return at(this,arguments)}}const Xb=t=>O(t,Yb),tm=c(2,((t,e)=>0===e.length?t:new Zb(t.name,t.keyType,t.description,Ye(t.tags,e)))),em=Symbol.for("effect/MetricState"),rm="effect/MetricState/Counter",nm=Symbol.for(rm),sm="effect/MetricState/Frequency",im=Symbol.for(sm),om="effect/MetricState/Gauge",cm=Symbol.for(om),um="effect/MetricState/Histogram",am=Symbol.for(um),hm="effect/MetricState/Summary",lm=Symbol.for(hm),fm={_A:t=>t};class dm{count;[em]=fm;[nm]=nm;constructor(t){this.count=t}[D](){return b(B(rm),P(B(this.count)),W(this))}[Y](t){return Sm(t)&&this.count===t.count}pipe(){return at(this,arguments)}}const bm=er(K);class mm{occurrences;[em]=fm;[im]=im;constructor(t){this.occurrences=t}_hash;[D](){return b(V(sm),P(H(Me(this.occurrences.entries()))),W(this))}[Y](t){return vm(t)&&bm(Me(this.occurrences.entries()),Me(t.occurrences.entries()))}pipe(){return at(this,arguments)}}class pm{value;[em]=fm;[cm]=cm;constructor(t){this.value=t}[D](){return b(B(om),P(B(this.value)),W(this))}[Y](t){return wm(t)&&this.value===t.value}pipe(){return at(this,arguments)}}class gm{buckets;count;min;max;sum;[em]=fm;[am]=am;constructor(t,e,r,n,s){this.buckets=t,this.count=e,this.min=r,this.max=n,this.sum=s}[D](){return b(B(um),P(B(this.buckets)),P(B(this.count)),P(B(this.min)),P(B(this.max)),P(B(this.sum)),W(this))}[Y](t){return _m(t)&&K(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return at(this,arguments)}}class ym{error;quantiles;count;min;max;sum;[em]=fm;[lm]=lm;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}[D](){return b(B(hm),P(B(this.error)),P(B(this.quantiles)),P(B(this.count)),P(B(this.min)),P(B(this.max)),P(B(this.sum)),W(this))}[Y](t){return Om(t)&&this.error===t.error&&K(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return at(this,arguments)}}const Sm=t=>O(t,nm),vm=t=>O(t,im),wm=t=>O(t,cm),_m=t=>O(t,am),Om=t=>O(t,lm),Em=Symbol.for("effect/MetricHook"),Mm={_In:t=>t,_Out:t=>t},km=t=>({[Em]:Mm,pipe(){return at(this,arguments)},...t}),Im=BigInt(0),Cm=(t,e,r)=>{const n=r.length;if(!je(e))return[];const s=e[0],i=e.slice(1),o=Nm(t,n,he(),0,s,r),c=Ke(o);return i.forEach((e=>{c.push(Nm(t,n,o.value,o.consumed,e,o.rest))})),Qe(c,(t=>[t.quantile,t.value]))},Nm=(t,e,r,n,s,i)=>{let o=t,c=e,u=r,a=n,h=s,l=i,f=t,d=e,b=r,m=n,p=s,g=i;for(;;){if(!je(l))return{quantile:h,value:he(),consumed:a,rest:[]};if(1===h)return{quantile:h,value:le(Te(l)),consumed:a+l.length,rest:[]};const t=$e(l),e=De(l,(e=>e===t)),r=h*c,n=o/2*r,s=a+e[0].length,i=Math.abs(s-r);if(s<r-n)f=o,d=c,b=xe(l),m=s,p=h,g=e[1],o=f,c=d,u=b,a=m,h=p,l=g;else{if(s>r+n)return{quantile:h,value:fe(u)?le(t):u,consumed:a,rest:l};switch(u._tag){case"None":f=o,d=c,b=xe(l),m=s,p=h,g=e[1],o=f,c=d,u=b,a=m,h=p,l=g;continue;case"Some":if(i<Math.abs(r-u.value)){f=o,d=c,b=xe(l),m=s,p=h,g=e[1],o=f,c=d,u=b,a=m,h=p,l=g;continue}return{quantile:h,value:le(u.value),consumed:a,rest:l}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},jm=Symbol.for("effect/MetricPair"),Am={_Type:t=>t},Fm=(t,e)=>({[jm]:Am,metricKey:t,metricState:e,pipe(){return at(this,arguments)}}),Rm=Symbol.for("effect/MetricRegistry");class xm{[Rm]=Rm;map=Nh();snapshot(){const t=[];for(const[e,r]of this.map)t.push(Fm(e,r.get()));return t}get(t){const e=b(this.map,jh(t),ye);if(null==e){if(Hb(t.keyType))return this.getCounter(t);if(O(t.keyType,zb))return this.getGauge(t);if(O(t.keyType,Bb))return this.getFrequency(t);if(Wb(t.keyType))return this.getHistogram(t);if((t=>O(t,Ub))(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=b(this.map,jh(t),ye);if(null==e){const r=(t=>{let e=t.keyType.bigint?Im:0;const r=t.keyType.incremental?t.keyType.bigint?t=>t>=Im:t=>t>=0:()=>!0,n=t=>{r(t)&&(e+=t)};return km({get:()=>new dm(e),update:n,modify:n})})(t);b(this.map,Fh(t))||b(this.map,Rh(t,r)),e=r}return e}getFrequency(t){let e=b(this.map,jh(t),ye);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 km({get:()=>new mm(e),update:r,modify:r})})(t);b(this.map,Fh(t))||b(this.map,Rh(t,r)),e=r}return e}getGauge(t){let e=b(this.map,jh(t),ye);if(null==e){const r=((t,e)=>{let r=e;return km({get:()=>new pm(r),update:t=>{r=t},modify:t=>{r+=t}})})(0,t.keyType.bigint?BigInt(0):0);b(this.map,Fh(t))||b(this.map,Rh(t,r)),e=r}return e}getHistogram(t){let e=b(this.map,jh(t),ye);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,c=Number.MAX_VALUE,u=Number.MIN_VALUE;b(e,Pe(ir),Qe(((t,e)=>{s[e]=t})));const a=t=>{let e=0,a=r;for(;e!==a;){const r=Math.floor(e+(a-e)/2);t<=s[r]?a=r:e=r,a===e+1&&(t<=s[e]?a=e:e=a)}n[e]=n[e]+1,i+=1,o+=t,t<c&&(c=t),t>u&&(u=t)},h=()=>{const t=Oe(r);let e=0;for(let i=0;i<r;i++)e+=n[i],t[i]=[s[i],e];return t};return km({get:()=>{return t={buckets:h(),count:i,min:c,max:u,sum:o},new gm(t.buckets,t.count,t.min,t.max,t.sum);var t},update:a,modify:a})})(t);b(this.map,Fh(t))||b(this.map,Rh(t,r)),e=r}return e}getSummary(t){let e=b(this.map,jh(t),ye);if(null==e){const r=(t=>{const{error:e,maxAge:r,maxSize:n,quantiles:s}=t.keyType,i=b(s,Pe(ir)),o=Oe(n);let c=0,u=0,a=0,h=0,l=0;const f=t=>{const s=[];let c=0;for(;c!==n-1;){const e=o[c];if(null!=e){const[n,i]=e,o=En(t-n);$n(o,vn)&&xn(o,r)&&s.push(i)}c+=1}return Cm(e,i,Pe(s,ir))},d=(t,e)=>{n>0&&(c+=1,o[c%n]=[e,t]),h=0===u?t:Math.min(h,t),l=0===u?t:Math.max(l,t),u+=1,a+=t};return km({get:()=>{return t={error:e,quantiles:f(Date.now()),count:u,min:h,max:l,sum:a},new ym(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);b(this.map,Fh(t))||b(this.map,Rh(t,r)),e=r}return e}}const $m=Symbol.for("effect/Metric"),Tm={_Type:t=>t,_In:t=>t,_Out:t=>t},Lm=S(Symbol.for("effect/Metric/globalMetricRegistry"),(()=>new xm)),Dm=function(t,e,r,n){const s=Object.assign((t=>ra(t,(t=>Jm(s,t)))),{[$m]:Tm,keyType:t,unsafeUpdate:e,unsafeValue:r,unsafeModify:n,register(){return this.unsafeValue([]),this},pipe(){return at(this,arguments)}});return s},Bm=(t,e)=>zm(((t,e)=>new Zb(t,(t=>new Vb(t?.incremental??!1,t?.bigint??!1))(e),ge(e?.description)))(t,e)),zm=t=>{let e;const r=new WeakMap,n=n=>{if(0===n.length)return void 0!==e||(e=Lm.get(t)),e;let s=r.get(n);return void 0!==s||(s=Lm.get(tm(t,n)),r.set(n,s)),s};return Dm(t.keyType,((t,e)=>n(e).update(t)),(t=>n(t).get()),((t,e)=>n(e).modify(t)))},Pm=(t,e,r)=>zm(((t,e,r)=>new Zb(t,(t=>new Gb(t))(e),ge(r)))(t,e,r)),qm=c(3,((t,e,r)=>Um(t,[If(e,r)]))),Um=c(2,((t,e)=>Dm(t.keyType,((r,n)=>t.unsafeUpdate(r,Ye(e,n))),(r=>t.unsafeValue(Ye(e,r))),((r,n)=>t.unsafeModify(r,Ye(e,n)))))),Jm=c(2,((t,e)=>Sa(za,(r=>ea((()=>t.unsafeUpdate(e,r))))))),Vm=c(2,((t,e)=>Sa(ob,(r=>ea((()=>{if(r.has(t)){const n=r.get(t);n.state.completed||(n.state.completed=!0,dh(n.result,e))}})))))),Gm=Symbol.for("effect/Supervisor"),Hm={_T:t=>t};class Wm{underlying;value0;[Gm]=Hm;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 Wm(this,b(this.value,Wu(t)))}zip(t){return new Ym(this,t)}}class Ym{left;right;_tag="Zip";[Gm]=Hm;constructor(t,e){this.left=t,this.right=e}get value(){return ua(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 Wm(this,b(this.value,Wu(t)))}zip(t){return new Ym(this,t)}}const Km=t=>O(t,Gm)&&E(t,"Zip");class Qm{effect;[Gm]=Hm;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 Wm(this,b(this.value,Wu(t)))}zip(t){return new Ym(this,t)}onRun(t,e){return t()}}const Zm=S("effect/Supervisor/none",(()=>new Qm(ia))),Xm="Empty",tp="AddSupervisor",ep="RemoveSupervisor",rp="AndThen",np={_tag:Xm},sp=(t,e)=>({_tag:rp,first:t,second:e}),ip=(t,e)=>K(t,e)?Zm:Km(t)?ip(t.left,e).zip(ip(t.right,e)):t,op=t=>K(t,Zm)?Js():Km(t)?b(op(t.left),Qs(op(t.right))):Vs(t),cp=Ro({empty:np,patch:(t,e)=>((t,e)=>{let r=t,n=e;for(;en(n);){const t=nn(n);switch(t._tag){case Xm:n=sn(n);break;case tp:r=r.zip(t.supervisor),n=sn(n);break;case ep:r=ip(r,t.supervisor),n=sn(n);break;case rp:n=Zr(t.first)(Zr(t.second)(sn(n)))}}return r})(e,Ur(t)),combine:sp,diff:(t,e)=>{if(K(t,e))return np;const r=op(t),n=op(e),s=b(n,Ks(r),Zs(np,((t,e)=>sp(t,{_tag:tp,supervisor:e})))),i=b(r,Ks(n),Zs(np,((t,e)=>sp(t,{_tag:ep,supervisor:e}))));return sp(s,i)}}),up=Bm("effect_fiber_started",{incremental:!0}),ap=Bm("effect_fiber_active"),hp=Bm("effect_fiber_successes",{incremental:!0}),lp=Bm("effect_fiber_failures",{incremental:!0}),fp=qm(Pm("effect_fiber_lifetimes",$b({start:.5,factor:2,count:35})),"time_unit","milliseconds"),dp="Continue",bp="Yield",mp={_E:t=>t,_A:t=>t},pp=t=>{throw new Error(`BUG: FiberRuntime - ${nt(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},gp=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),yp=S("effect/internal/fiberRuntime/yieldedOpChannel",(()=>({currentOp:null}))),Sp={[bt]:(t,e,r)=>T((()=>e.effect_instruction_i1(r))),OnStep:(t,e,r)=>ih(ih(r)),[mt]:(t,e,r)=>T((()=>e.effect_instruction_i2(r))),[Et]:(t,e,r)=>(t.patchRuntimeFlags(t.currentRuntimeFlags,e.patch),Jo(t.currentRuntimeFlags)&&t.isInterrupted()?rh(t.getInterruptedCause()):ih(r)),[vt]:(t,e,r)=>(T((()=>e.effect_instruction_i2(r))),T((()=>e.effect_instruction_i0()))?(t.pushStack(e),T((()=>e.effect_instruction_i1()))):ia),[wt]:(t,e,r)=>{for(;;){const n=T((()=>e.effect_instruction_i0.next(r)));if(n.done)return ih(n.value);const s=R(n.value);if(!Xa(s))return t.pushStack(e),s;if("Failure"===s._tag)return s;r=s.value}}},vp={[ub]:(t,e,r,n)=>(t.processNewInterruptSignal(n.cause),Jo(e)?rh(n.cause):r),[hb]:()=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[ab]:(t,e,r,n)=>(n.onFiber(t,Qf(e)),r),[lb]:(t,e,r)=>Bu(ca(),(()=>r))},wp=Mt();class _p extends pf{[Sb]=vb;[wb]=mp;_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,Yo(r)){const t=this.getFiberRef(za);up.unsafeUpdate(1,t),ap.unsafeUpdate(1,t)}this.refreshRefCache()}commit(){return _b(this)}id(){return this._fiberId}resume(t){this.tell(bb(t))}get status(){return this.ask(((t,e)=>e))}get runtimeFlags(){return this.ask(((t,e)=>e._tag===qf?t.currentRuntimeFlags:e.runtimeFlags))}scope(){return new gb((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(qa)}fiberRefs(){return this.ask((t=>t.getFiberRefs()))}ask(t){return ta((()=>{const e=ah(this._fiberId);return this.tell(db(((r,n)=>{dh(e,ea((()=>t(r,n))))}))),hh(e)}))}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Mu((t=>{const e=e=>t(Xu(e));return this.tell(db((t=>{null!==t._exitValue?e(this._exitValue):t.addObserver(e)}))),ea((()=>this.tell(db((t=>{t.removeObserver(e)})))))}),this.id())}get inheritAll(){return Su(((t,e)=>{const r=t.id(),n=t.getFiberRefs(),s=e.runtimeFlags,i=this.getFiberRefs(),o=Yl(n,r,i);t.setFiberRefs(o);const c=t.getFiberRef(qp);return(t=>{const e=new mu(St);return e.effect_instruction_i0=t,e.effect_instruction_i1=void 0,e})(b(Qo(s,c),ec(1),ec(16)))}))}get poll(){return ea((()=>ge(this._exitValue)))}unsafePoll(){return this._exitValue}interruptAsFork(t){return ea((()=>this.tell(fb(Rc(t)))))}unsafeInterruptAsFork(t){this.tell(fb(Rc(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(qp,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=Zl(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=ef(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:e}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Gl),this.currentTracer=this.currentDefaultServices.unsafeMap.get(zl.key),this.currentSupervisor=this.getFiberRef(Up),this.currentScheduler=this.getFiberRef(ib),this.currentContext=this.getFiberRef(Na),this.currentSpan=this.currentContext.unsafeMap.get(Pl.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=dp;const r=globalThis[Ob];globalThis[Ob]=this;try{for(;e===dp;)e=0===this._queue.length?"Done":this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[Ob]=r}this._queue.length>0&&!this._running?(this._running=!0,e===bp?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(ja))}drainQueueWhileRunning(t,e){let r=e;for(;this._queue.length>0;){const e=this._queue.splice(0,1)[0];r=vp[e._tag](this,t,r,e)}return r}isInterrupted(){return!((t=this.getFiberRef(qa))._tag===_c||Yc(t,!0,((t,e)=>{switch(e._tag){case _c:return le(t);case wc:case Oc:case Ec:return le(!1);default:return he()}})));var t}addInterruptedCause(t){const e=this.getFiberRef(qa);this.setFiberRef(qa,$c(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(fb(Rc(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let e=!1;return oa({while:()=>!e,body:()=>{const r=t.next();return r.done?ea((()=>{e=!0})):_u(r.value.await)},step:()=>{}})}return null}reportExitValue(t){if(Yo(this.currentRuntimeFlags)){const e=this.getFiberRef(za),r=this.id().startTimeMillis,n=Date.now();switch(fp.unsafeUpdate(n-r,e),ap.unsafeUpdate(-1,e),t._tag){case pt:hp.unsafeUpdate(1,e);break;case ft:lp.unsafeUpdate(1,e)}}if("Failure"===t._tag){const e=this.getFiberRef(Da);Lc(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(kp)}log(t,e,r){const n=de(r)?r.value:this.getFiberRef(Ra),s=this.getFiberRef(Op);if(lf(s,n))return;const i=this.getFiberRef(xa),o=this.getFiberRef(Fa),c=this.getLoggers(),u=this.getFiberRefs();if(Hs(c)>0){const r=Nr(this.getFiberRef(Gl),Wh),s=new Date(r.unsafeCurrentTimeMillis());((t,e)=>{const r=ct.fiberRefs;ct.fiberRefs=t;try{return e()}finally{ct.fiberRefs=r}})(u,(()=>{for(const r of c)r.log({fiberId:this.id(),logLevel:n,message:t,cause:e,context:u,spans:i,annotations:o,date:s})}))}}evaluateMessageWhileSuspended(t){switch(t._tag){case lb:return bp;case ub:return this.processNewInterruptSignal(t.cause),null!==this._asyncInterruptor&&(this._asyncInterruptor(rh(t.cause)),this._asyncInterruptor=null),dp;case hb:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),dp;case ab:return t.onFiber(this,null!==this._exitValue?Kf:new Wf(this.currentRuntimeFlags,this._asyncBlockingOn)),dp;default:return pp(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let e=Jo(this.currentRuntimeFlags)&&this.isInterrupted()?rh(this.getInterruptedCause()):t;for(;null!==e;){const t=this.runLoop(e);if(t===gp){const t=yp.currentOp;yp.currentOp=null,t._op===Ot?Go(this.currentRuntimeFlags,32)?(this.tell({_tag:lb}),this.tell(bb(oh)),e=null):e=oh:t._op===ht&&(e=null)}else{this.currentRuntimeFlags=b(this.currentRuntimeFlags,Uo(16));const r=this.interruptAllChildren();null!==r?e=Bu(r,(()=>t)):(0===this._queue.length?this.setExitValue(t):this.tell(bb(t)),e=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(bb(t));else{this._running=!0;const e=globalThis[Ob];globalThis[Ob]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[Ob]=e,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(bb(t))}patchRuntimeFlags(t,e){const r=Zo(t,e);return globalThis[Ob]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,e){let r=!1;const n=t=>{r||(r=!0,this.tell(bb(t)))};Jo(t)&&(this._asyncInterruptor=n);try{e(n)}catch(t){n($u(Fc(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!==dt)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==bt&&t._op!==vt&&t._op!==wt)return t;t=this.popStack()}}[yt](t){return ea((()=>jr(this.currentContext,t)))}Left(t){return Ru(t.left)}None(t){return Ru(new Ka)}Right(t){return ih(t.right)}Some(t){return ih(t.value)}Micro(t){return Eu((e=>{let r=e;const n=(t=>{const e=new hd(Yd.context(new Vd));return e.evaluate(t),e})(Hd(t,this.currentContext));return n.addObserver((t=>{if("Success"===t._tag)return r(ih(t.value));switch(t.cause._tag){case"Interrupt":return r(rh(Rc(gi)));case"Fail":return r(Ru(t.cause.error));case"Die":return r(Nu(t.cause.defect))}})),Eu((t=>{r=()=>{t(ia)},n.unsafeInterrupt()}))}))}[gt](t){const e=T((()=>t.effect_instruction_i0())),r=this.getNextSuccessCont();return void 0!==r?(r._op in Sp||pp(r),Sp[r._op](this,r,e)):(yp.currentOp=ih(e),gp)}[pt](t){const e=t,r=this.getNextSuccessCont();return void 0!==r?(r._op in Sp||pp(r),Sp[r._op](this,r,e.effect_instruction_i0)):(yp.currentOp=e,gp)}[ft](t){const e=t.effect_instruction_i0,r=this.getNextFailCont();if(void 0===r)return yp.currentOp=rh(e),gp;switch(r._op){case dt:case mt:return Jo(this.currentRuntimeFlags)&&this.isInterrupted()?rh(Bc(e)):T((()=>r.effect_instruction_i1(e)));case"OnStep":return Jo(this.currentRuntimeFlags)&&this.isInterrupted()?rh(Bc(e)):ih(rh(e));case Et:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),Jo(this.currentRuntimeFlags)&&this.isInterrupted()?rh($c(e,this.getInterruptedCause())):rh(e);default:pp(r)}}[_t](t){return T((()=>t.effect_instruction_i0(this,Qf(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=((t,e)=>{const r=new Map(t.locals);let n=wf;for(const[t,s]of e.locals.entries()){const e=$e(s)[1],i=r.get(t);if(void 0!==i){const r=$e(i)[1];K(r,e)||(n=_f({_tag:Sf,fiberRef:t,patch:t.diff(r,e)})(n))}else n=_f({_tag:"Add",fiberRef:t,value:e})(n);r.delete(t)}for(const[t]of r.entries())n=_f({_tag:yf,fiberRef:t})(n);return n})(s.refs,e),c=Qo(s.flags,r);return ih(fu(t.effect_instruction_i0,Su((e=>{for(;n.length>0;)e.pushStack(n.pop());return e.setFiberRefs(Bf(e.id(),e.getFiberRefs())(o)),e.currentRuntimeFlags=Zo(c)(e.currentRuntimeFlags),t.effect_instruction_i1}))))}return sa((e=>Bu(Ap((t=>{const e=new mu("RunBlocked");return e.effect_instruction_i0=t,e})(t.effect_instruction_i0)),(()=>e(t.effect_instruction_i1)))))}RunBlocked(t){return Gu((t=>{let e=Bi(t),r=Di();for(;;){const[t,n]=Ui(e,[ac(),Di()],(([t,e],r)=>{const[n,s]=sc(r);return[lc(t,n),zi(e,s)]}));if(r=ic(r,t),Ti(n))return Ji(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=>Np((t=>Array.from(t.map))(t),(([t,e])=>{const r=new Map,n=[];for(const t of e){n.push(Gr(t));for(const e of t)r.set(e.request,e)}const s=n.flat();return _a(Jp(t.runAll(n),s,(()=>s.forEach((t=>{t.listeners.interrupted=!0})))),ob,r)}),!1,!1)))}[St](t){const e=t.effect_instruction_i0,r=this.currentRuntimeFlags,n=Zo(r,e);if(Jo(n)&&this.isInterrupted())return rh(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,e),t.effect_instruction_i1){const e=Qo(n,r);return this.pushStack(new bu(e,t)),T((()=>t.effect_instruction_i1(r)))}return oh}[bt](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[dt](t){return this.pushStack(t),t.effect_instruction_i0}[mt](t){return this.pushStack(t),t.effect_instruction_i0}[ht](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),yp.currentOp=t,gp}[Ot](t){return this._isYielding=!1,yp.currentOp=t,gp}[vt](t){const e=t.effect_instruction_i1;return(0,t.effect_instruction_i0)()?(this.pushStack(t),e()):oh}[wt](t){return Sp[wt](this,t,void 0)}[lt](t){return T((()=>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=Bu(ca({priority:t}),(()=>r))}}try{if(e=this.currentTracer.context((()=>{if(wp!==e[du]._V){const t=this.getFiberRef(Ba);"Some"===t._tag&&this.log(`Executing an Effect versioned ${e[du]._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`,jc,t)}return this[e._op](e)}),this),e===gp){const t=yp.currentOp;return t._op===Ot||t._op===ht?gp:(yp.currentOp=null,t._op===pt||t._op===ft?t:rh(Fc(t)))}}catch(t){e=e!==gp&&!O(e,"_op")||!(e._op in this)?ju(`Not a valid effect: ${nt(e)}`):O(t,Wa)?rh($c(Fc(t),Rc(gi))):Nu(t)}}}run=()=>{this.drainQueueOnCurrentThread()}}const Op=S("effect/FiberRef/currentMinimumLogLevel",(()=>Oa(hf))),Ep=S(Symbol.for("effect/Logger/defaultLogger"),(()=>{return t=Nb,kb((e=>{const r=sf(e.context,Gl);Nr(r,jl).unsafe.log(t.log(e))}));var t})),Mp=S(Symbol.for("effect/Logger/tracerLogger"),(()=>kb((({annotations:t,cause:e,context:r,fiberId:n,logLevel:s,message:i})=>{const o=Ar(tf(r,Na),Pl);if("None"===o._tag||"ExternalSpan"===o.value._tag)return;const c=jr(tf(r,Gl),Wh),u={};for(const[e,r]of t)u[e]=r;u["effect.fiberId"]=yi(n),u["effect.logLevel"]=s.label,null!==e&&"Empty"!==e._tag&&(u["effect.cause"]=Qc(e,{renderErrorCause:!0})),o.value.event(nt(Array.isArray(i)&&1===i.length?i[0]:i),c.unsafeCurrentTimeNanos(),u)})))),kp=S(Symbol.for("effect/FiberRef/currentLoggers"),(()=>Ea(Vs(Ep,Mp)))),Ip=c((t=>k(t[0])),((t,e,r)=>Su((n=>{const s=!0===r?.batching||"inherit"===r?.batching&&n.getFiberRef(La);return r?.discard?cb(r.concurrency,(()=>Lp(Tf,r?.concurrentFinalizers)((r=>s?Np(t,((t,n)=>r(e(t,n))),!0,!1,1):Gu(t,((t,n)=>r(e(t,n))))))),(()=>Lp(Lf,r?.concurrentFinalizers)((r=>Np(t,((t,n)=>r(e(t,n))),s,!1)))),(n=>Lp(Df(n),r?.concurrentFinalizers)((r=>Np(t,((t,n)=>r(e(t,n))),s,!1,n))))):cb(r?.concurrency,(()=>Lp(Tf,r?.concurrentFinalizers)((r=>s?jp(t,1,((t,n)=>r(e(t,n))),!0):Vu(t,((t,n)=>r(e(t,n))))))),(()=>Lp(Lf,r?.concurrentFinalizers)((r=>Cp(t,((t,n)=>r(e(t,n))),s)))),(n=>Lp(Df(n),r?.concurrentFinalizers)((r=>jp(t,n,((t,n)=>r(e(t,n))),s)))))})))),Cp=(t,e,r)=>ta((()=>{const n=Me(t),s=new Array(n.length);return ha(Np(n,((t,r)=>Bu(e(t,r),(t=>ea((()=>s[r]=t))))),r,!1),Xu(s))})),Np=(t,e,r,n,s)=>sa((i=>(t=>Su((e=>{const r=b(e.getFiberRef(Pa),me((()=>e.scope())));return t(_a(Pa,le(r)))})))((o=>Su((c=>{let u=Array.from(t).reverse(),a=u.length;if(0===a)return ia;let h=0,l=!1;const f=s?Math.min(u.length,s):u.length,d=new Set,b=new Array,m=new Array,p=new Array,g=new Array,y=()=>{const t=b.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(oh),t},S=(t,e=!1)=>{const r=na(o(t)),n=Fp(r,c,c.currentRuntimeFlags,yb);return c.currentScheduler.scheduleTask((()=>{e&&n.unsafeInterruptAsFork(c.id()),n.resume(r)}),0),n},v=()=>{n||(a-=u.length,u=[]),l=!0,d.forEach((t=>{t.currentScheduler.scheduleTask((()=>{t.unsafeInterruptAsFork(c.id())}),0)}))},w=r?zu:Fu,_=S(Mu((t=>{const n=(t,e)=>{"Blocked"===t._op?g.push(t):(b.push({index:e,exit:t}),"Failure"!==t._op||l||v())},o=()=>{if(u.length>0){const f=u.pop();let v=h++;const _=()=>{const t=u.pop();return v=h++,Bu(ca(),(()=>Bu(w(i(e(t,v))),O)))},O=t=>u.length>0&&(n(t,v),u.length>0)?_():Xu(t),E=Bu(w(i(e(f,v))),O),M=S(E);m.push(M),d.add(M),l&&M.currentScheduler.scheduleTask((()=>{M.unsafeInterruptAsFork(c.id())}),0),M.addObserver((e=>{let i;if(i="Failure"===e._op?e:e.effect_instruction_i0,p.push(M),d.delete(M),n(i,v),b.length===a)t(Xu(me(th(y(),{parallel:!0}),(()=>oh))));else if(g.length+b.length===a){const e=y(),n=g.map((t=>t.effect_instruction_i0)).reduce(rc);t(Xu(fu(n,Np([me(th(e,{parallel:!0}),(()=>oh)),...g.map((t=>t.effect_instruction_i1))],(t=>t),r,!0,s))))}else o()}))}};for(let t=0;t<f;t++)o()})));return _u(Qu(Pu(i(_b(_))),sh({onFailure:t=>{v();const e=g.length+1,r=Math.min("number"==typeof s?s:g.length,g.length),n=Array.from(g);return Mu((s=>{let i=0;const o=(r,o)=>()=>{i++,i===e&&s(ih(rh(t))),n.length>0&&o&&c()},c=()=>{S(n.pop(),!0).addObserver(o(0,!0))};_.addObserver(o(0,!1));for(let t=0;t<r;t++)c()}))},onSuccess:()=>Vu(p,(t=>t.inheritAll))})))})))))),jp=(t,e,r,n)=>ta((()=>{const s=Me(t),i=new Array(s.length);return ha(Np(s,((t,e)=>Wu(r(t,e),(t=>i[e]=t))),n,!1,e),Xu(i))})),Ap=t=>xp(t,yb),Fp=(t,e,r,n=null)=>Rp(t,e,r,n),Rp=(t,e,r,n=null)=>{const s=Si(),i=e.getFiberRefs(),o=Kl(i,s),c=new _p(s,o,r),u=tf(o,Na),a=c.currentSupervisor;return a.onStart(u,t,le(e),c),c.addObserver((t=>a.onEnd(t,c))),(null!==n?n:b(e.getFiberRef(Pa),me((()=>e.scope())))).add(r,c),c},xp=(t,e)=>Su(((r,n)=>Xu(((t,e,r,n=null)=>{const s=Rp(t,e,r,n);return s.resume(t),s})(t,r,n.runtimeFlags,e)))),$p=t=>gh((e=>be(Ar(e,Bp),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Parallel":return t;case"Sequential":case"ParallelN":return Bu(Ua(e,Lf),(e=>zp(t,e)))}}}))),Tp=t=>e=>gh((r=>be(Ar(r,Bp),{onNone:()=>e,onSome:r=>"ParallelN"===r.strategy._tag&&r.strategy.parallelism===t?e:Bu(Ua(r,Df(t)),(t=>zp(e,t)))}))),Lp=(t,e)=>r=>gh((n=>be(Ar(n,Bp),{onNone:()=>r(u),onSome:n=>{if(!0!==e)return r(u);{const e="Parallel"===t._tag?$p:"Sequential"===t._tag?Dp:Tp(t.parallelism);switch(n.strategy._tag){case"Parallel":return e(r($p));case"Sequential":return e(r(Dp));case"ParallelN":return e(r(Tp(n.strategy.parallelism)))}}}}))),Dp=t=>gh((e=>be(Ar(e,Bp),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Sequential":return t;case"Parallel":case"ParallelN":return Bu(Ua(e,Tf),(e=>zp(t,e)))}}}))),Bp=Mr("effect/Scope"),zp=c(2,((t,e)=>Sh(t,Fr(Ir(Bp,e))))),Pp=t=>Ia(t,{differ:cp,fork:np}),qp=Ca(Wo),Up=Pp(Zm),Jp=(t,e,r)=>Du((n=>Bu(Bu(Ap(Hu(t)),(t=>Mu((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||!Xa(t.result.state.current.effect)||"Failure"!==t.result.state.current.effect._tag||!(t=>de((t=>Uc(t,(t=>t._tag===Ec?le(t.fiberId):he())))(t)))(t.result.state.current.effect.cause))))&&(o.forEach((t=>t())),r?.(),n((t=>Bu(Lu,(e=>b(t,la(e)))))(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(),ea((()=>{o.forEach((t=>t()))}))})))),(()=>ta((()=>{const t=e.flatMap((t=>t.state.completed?[]:[t]));return Gu(t,(t=>Vm(t.request,(t=>rh(Rc(t)))(n))))})))))),Vp=(t,e,r,n)=>Gi({_tag:"Complete",key:t,exit:e,entryStats:r,timeToLiveMillis:n}),Gp=(t,e)=>Gi({_tag:"Pending",key:t,deferred:e}),Hp=Symbol.for("effect/Cache/MapKey");class Wp{current;[Hp]=Hp;previous=void 0;next=void 0;constructor(t){this.current=t}[D](){return b(B(this.current),P(B(this.previous)),P(B(this.next)),W(this))}[Y](t){return this===t||Kp(t)&&K(this.current,t.current)&&K(this.previous,t.previous)&&K(this.next,t.next)}}const Yp=t=>new Wp(t),Kp=t=>O(t,Hp);class Qp{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const e=t.previous,r=t.next;void 0!==r&&(t.next=void 0,void 0!==e?(e.next=r,r.previous=e):(this.head=r,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const e=t.next;void 0!==e?(t.next=void 0,this.head=e,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const Zp=Symbol.for("effect/Cache"),Xp={_Key:t=>t,_Error:t=>t,_Value:t=>t},tg=Symbol.for("effect/ConsumerCache"),eg={_Key:t=>t,_Error:t=>t,_Value:t=>t},rg=t=>({loadedMillis:t});class ng{capacity;context;fiberId;lookup;timeToLive;[Zp]=Xp;[tg]=eg;cacheState;constructor(t,e,r,n,s){this.capacity=t,this.context=e,this.fiberId=r,this.lookup=n,this.timeToLive=s,this.cacheState={map:Nh(),keys:new Qp,accesses:Jh(void 0),updating:ei(!1),hits:0,misses:0}}get(t){return Wu(this.getEither(t),ne)}get cacheStats(){return ea((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:Th(this.cacheState.map)})))}getOption(t){return ta((()=>be(jh(this.cacheState.map,t),{onNone:()=>{const e=Yp(t);return this.trackAccess(e),this.trackMiss(),Xu(he())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return ta((()=>be(jh(this.cacheState.map,t),{onNone:()=>{const e=Yp(t);return this.trackAccess(e),this.trackMiss(),Xu(he())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return ea((()=>Fh(this.cacheState.map,t)))}entryStats(t){return ea((()=>{const e=jh(this.cacheState.map,t);if(de(e))switch(e.value._tag){case"Complete":return le(rg(e.value.entryStats.loadedMillis));case"Pending":return he();case"Refreshing":return le(rg(e.value.complete.entryStats.loadedMillis))}return he()}))}getEither(t){return ta((()=>{const e=t;let r,n,s=ye(jh(this.cacheState.map,e));return void 0===s&&(n=Oh(this.fiberId),r=Yp(e),Fh(this.cacheState.map,e)?s=ye(jh(this.cacheState.map,e)):Rh(this.cacheState.map,e,Gp(r,n))),void 0===s?(this.trackAccess(r),this.trackMiss(),Wu(this.lookupValueOf(t,n),Xt)):Bu(this.resolveMapValue(s),be({onNone:()=>this.getEither(t),onSome:t=>Xu(te(t))}))}))}invalidate(t){return ea((()=>{$h(this.cacheState.map,t)}))}invalidateWhen(t,e){return ea((()=>{const r=jh(this.cacheState.map,t);de(r)&&"Complete"===r.value._tag&&"Success"===r.value.exit._tag&&e(r.value.exit.value)&&$h(this.cacheState.map,t)}))}get invalidateAll(){return ea((()=>{this.cacheState.map=Nh()}))}refresh(t){return Nf((e=>ta((()=>{const r=t,n=Oh(this.fiberId);let s=ye(jh(this.cacheState.map,r));if(void 0===s&&(Fh(this.cacheState.map,r)?s=ye(jh(this.cacheState.map,r)):Rh(this.cacheState.map,r,Gp(Yp(r),n))),void 0===s)return _u(this.lookupValueOf(t,n));switch(s._tag){case"Complete":return this.hasExpired(e,s.timeToLiveMillis)?(K(ye(jh(this.cacheState.map,r)),s)&&$h(this.cacheState.map,r),_u(this.get(t))):b(this.lookupValueOf(t,n),xf((()=>{if(K(ye(jh(this.cacheState.map,r)),s)){const t=((t,e)=>Gi({_tag:"Refreshing",deferred:t,complete:e}))(n,s);return Rh(this.cacheState.map,r,t),!0}return!1})),_u);case"Pending":case"Refreshing":return wh(s.deferred)}}))))}set(t,e){return Nf((r=>ea((()=>{const n=r.unsafeCurrentTimeMillis(),s=t,i=Eh(e),o=Vp(Yp(s),i,rg(n),n+jn(bn(this.timeToLive(i))));Rh(this.cacheState.map,s,o)}))))}get size(){return ea((()=>Th(this.cacheState.map)))}get values(){return ea((()=>{const t=[];for(const e of this.cacheState.map)"Complete"===e[1]._tag&&"Success"===e[1].exit._tag&&t.push(e[1].exit.value);return t}))}get entries(){return ea((()=>{const t=[];for(const e of this.cacheState.map)"Complete"===e[1]._tag&&"Success"===e[1].exit._tag&&t.push([e[0],e[1].exit.value]);return t}))}get keys(){return ea((()=>{const t=[];for(const e of this.cacheState.map)"Complete"===e[1]._tag&&"Success"===e[1].exit._tag&&t.push(e[0]);return t}))}resolveMapValue(t,e=!1){return Nf((r=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(r,t.timeToLiveMillis)?($h(this.cacheState.map,t.key.current),Xu(he())):(this.trackHit(),Wu(t.exit,le));case"Pending":return this.trackAccess(t.key),this.trackHit(),e?Xu(he()):Wu(wh(t.deferred),le);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(r,t.complete.timeToLiveMillis)?e?Xu(he()):Wu(wh(t.deferred),le):Wu(t.complete.exit,le)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(Vh(this.cacheState.accesses,t),ri(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const e=Gh(this.cacheState.accesses,qh);e===qh?t=!1:this.cacheState.keys.add(e)}let e=Th(this.cacheState.map);for(t=e>this.capacity;t;){const r=this.cacheState.keys.remove();void 0!==r?Fh(this.cacheState.map,r.current)&&($h(this.cacheState.map,r.current),e-=1,t=e>this.capacity):t=!1}si(this.cacheState.updating,!1)}}hasExpired(t,e){return t.unsafeCurrentTimeMillis()>e}lookupValueOf(t,e){return Nf((r=>ta((()=>{const n=t;return b(this.lookup(t),yh(this.context),Fu,Bu((t=>{const s=r.unsafeCurrentTimeMillis(),i=rg(s),o=Vp(Yp(n),t,i,s+jn(bn(this.timeToLive(t))));return Rh(this.cacheState.map,n,o),ha(_h(e,t),t)})),Zu((()=>{return ha((t=e,Bu(Lu,(e=>lh(t,(t=>$u(Rc(t)))(e))))),ea((()=>{$h(this.cacheState.map,n)})));var t})))}))))}}const sg=t=>Wu(((t,e)=>{const[r,n]=(t=>{if(Array.isArray(t)||k(t))return[t,he()];const e=Object.keys(t),r=e.length;return[e.map((e=>t[e])),le((t=>{const n={};for(let s=0;s<r;s++)n[e[s]]=t[s];return n}))]})(t);return"validate"===e?.mode?((t,e,r)=>{const n=[];for(const e of t)n.push(Au(e));return Bu(Ip(n,u,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(t=>{const n=he(),s=t.length,i=new Array(s),o=new Array(s);let c=!1;for(let e=0;e<s;e++){const r=t[e];"Left"===r._tag?(i[e]=le(r.left),c=!0):(o[e]=r.right,i[e]=n)}return c?Ru("Some"===e._tag?e.value(i):i):r?.discard?ia:Xu("Some"===e._tag?e.value(o):o)}))})(r,n,e):"either"===e?.mode?((t,e,r)=>{const n=[];for(const e of t)n.push(Au(e));return r?.discard?Ip(n,u,{concurrency:r?.concurrency,batching:r?.batching,discard:!0,concurrentFinalizers:r?.concurrentFinalizers}):Wu(Ip(n,u,{concurrency:r?.concurrency,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),(t=>"Some"===e._tag?e.value(t):t))})(r,n,e):!0!==e?.discard&&"Some"===n._tag?Wu(Ip(r,u,e),n.value):Ip(r,u,e)})([ph(),Lu]),(([e,r])=>new ng(t.capacity,e,r,t.lookup,(e=>bn(t.timeToLive(e)))))),ig=Ua,og=t=>function(){if(1===arguments.length){const e=arguments[0];return(r,...n)=>t(e,r,...n)}return t.apply(this,arguments)},cg=og(((t,e,r)=>{const n=Si(),s=[[Na,[[n,t.context]]]];r?.scheduler&&s.push([ib,[[n,r.scheduler]]]);let i=of(t.fiberRefs,{entries:s,forkAs:n});r?.updateRefs&&(i=r.updateRefs(i,n));const o=new _p(n,i,t.runtimeFlags);let c=e;r?.scope&&(c=Bu(ig(r.scope,$f),(t=>ha(((t,e)=>t.addFinalizer((()=>_u(e))))(t,Du((t=>K(t,o.id())?ia:la(o,t)))),Qu(e,(e=>((t,e)=>t.close(e))(t,e)))))));const u=o.currentSupervisor;return u!==Zm&&(u.onStart(t.context,c,he(),o),o.addObserver((t=>u.onEnd(t,o)))),yb.add(t.runtimeFlags,o),!1===r?.immediate?o.resume(c):o.start(c),o})),ug=Symbol.for("effect/Runtime/FiberFailure"),ag=Symbol.for("effect/Runtime/FiberFailure/Cause");class hg extends Error{[ug];[ag];constructor(t){const e=iu(t)[0];super(e?.message||"An error has occurred"),this[ug]=ug,this[ag]=t,this.name=e?`(FiberFailure) ${e.name}`:"FiberFailure",e?.stack&&(this.stack=e.stack)}toJSON(){return{_id:"FiberFailure",cause:this[ag].toJSON()}}toString(){return"(FiberFailure) "+Qc(this[ag],{renderErrorCause:!0})}[tt](){return this.toString()}}const lg=og(((t,e,r)=>fg(t,e,r).then((t=>{switch(t._tag){case pt:return t.effect_instruction_i0;case ft:throw(t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new hg(t);return Error.stackTraceLimit=e,r})(t.effect_instruction_i0)}})))),fg=og(((t,e,r)=>new Promise((n=>{const s=(t=>{const e=t;switch(e._op){case"Failure":case"Success":return e;case"Left":return eh(e.left);case"Right":return ih(e.right);case"Some":return ih(e.value);case"None":return eh(new Ka)}})(e);s&&n(s);const i=cg(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 dg{context;runtimeFlags;fiberRefs;constructor(t,e,r){this.context=t,this.runtimeFlags=e,this.fiberRefs=r}pipe(){return at(this,arguments)}}const bg=t=>new dg(t.context,t.runtimeFlags,t.fiberRefs),mg=Ho(1,32,4),pg=lg(bg({context:kr(),runtimeFlags:mg,fiberRefs:cf()})),gg=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends Ja{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}}}}(),yg=t=>{const e={BaseEffectError:class extends gg{_tag=t}};return e.BaseEffectError.prototype.name=t,e.BaseEffectError},Sg=function(){const t=1===arguments.length?arguments[0]:arguments[1].bind(arguments[0]);return e=()=>t(b),ta((()=>{const t=new mu(wt);return t.effect_instruction_i0=e(),t}));var e},vg=Xu,wg=ku,_g=Rf,Og=Af,Eg=Ff,Mg=pg;class kg extends(yg("FetchError")){}class Ig extends(yg("NotFoundError")){}class Cg extends(yg("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}const Ng=function(...t){const e=2===t.length?e=>t[0](e)?Xt(e):te(t[1](e)):e=>be(t[0](e),{onNone:()=>Xt(e),onSome:te});return Object.assign((t=>se(e(t),u)),{[or]:or,option:t=>{return r=e(t),Qt(r)?Jt:Vt(r.right);var r},either:e,is:t=>re(e(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class jg extends(yg("BrandValidationError")){constructor(t,e){super(new Error(`Brand validation failed for type ${e}.`,{cause:t}))}}const Ag=()=>(t=>{const e=bn(t.timeToLive);return sg({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>e})})({capacity:200,timeToLive:wn,lookup:t=>Sg((function*(){const e=o(`${t}.svg`,"icons"),r=yield*(s=e,((...t)=>Cd((()=>$d(1===t.length?t[0]():t[1].call(t[0])))))((function*(){const t=yield*Ad({try:()=>fetch(s,i),catch:t=>new kg({cause:t})});return 404===t.status?yield*Id(new Ig({url:t.url})):t}))),n=yield*(t=>Ad({try:()=>t.text(),catch:t=>new Cg(t)}))(r);var s,i,c,u;return yield*(c=n,u={try:()=>Ng(c),catch:t=>new jg(t,"SVGString")},Cd((()=>{try{return Md(u.try())}catch(t){return Id(u.catch(t))}})))}))});let Fg=null;function Rg(){return Sg((function*(){Fg?yield*Fg.invalidateAll:Og("Attempted to clear icon cache before it was initialized")}))}const xg=t(class extends s{intersectionObserver;get el(){return this}icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.addController(new i(this))}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()}))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}async loadIconPathData(){const{icon:t,visible:e}=this;t&&e&&(this.iconData=await Mg(function(t){const e=t;return Sg((function*(){return Fg||(Fg=yield*Ag()),yield*Fg.get(e)}))}(this.icon).pipe(_g((e=>Eg(`Error loading icon "${t}":`,e.message,e.cause,e.stack))),wg((()=>vg(Ng('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>')))))))}render(){return e(r,{key:"d4c1cbfbaf39ebf6aa26415d46100763b9f89b5b",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(t,e=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((e=>{e.some((e=>!!e.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t(),!0)))}),{rootMargin:`${e}px`}),this.intersectionObserver.observe(this.el)):t()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}]}]);function $g(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((t=>{"lmvz-icon"===t&&(customElements.get(n(t))||customElements.define(n(t),xg))}))}export{xg as L,Rg as c,$g as d,Mg as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t}from"./p-vi4YzJmv.js";const e=(e,o)=>{const n=function(...t){return t.filter(Boolean).join("/").replace("//","/").replace("/./","/")}("../../assets",o,e);try{return t(n)}catch{return console.warn(`Failed to create URL for asset "${e}" in path "${o}".\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.`),new URL(n,import.meta?.url??window?.location?.origin??"")}};export{e as c}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { a as getAssetPath } from './index-T5ljELGS.js';
|
|
2
|
+
|
|
3
|
+
function getLocationBase() {
|
|
4
|
+
return import.meta?.url ?? window?.location?.origin ?? '';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const relativeAssetsPath = '../../assets';
|
|
8
|
+
const createAssetUrlSafely = (file, pathFromAssetRoot) => {
|
|
9
|
+
const relativeAssetPath = joinPath(relativeAssetsPath, pathFromAssetRoot, file);
|
|
10
|
+
try {
|
|
11
|
+
return getAssetPath(relativeAssetPath);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
console.warn(`Failed to create URL for asset "${file}" in path "${pathFromAssetRoot}".
|
|
15
|
+
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.`);
|
|
16
|
+
return new URL(relativeAssetPath, getLocationBase());
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function joinPath(...parts) {
|
|
20
|
+
return parts.filter(Boolean).join('/').replace('//', '/').replace('/./', '/');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { createAssetUrlSafely as c };
|