@seanmozeik/tripwire 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tripwire.js CHANGED
@@ -1,96 +1,96 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun @bytecode @bun-cjs
3
- (function(exports, require, module, __filename, __dirname) {var pA=Object.create;var{getPrototypeOf:dA,defineProperty:L9,getOwnPropertyNames:AW,getOwnPropertyDescriptor:cA}=Object,wW=Object.prototype.hasOwnProperty;function CW(X){return this[X]}var fA,uA,O=(X,Q,Y)=>{var J=X!=null&&typeof X==="object";if(J){var $=Q?fA??=new WeakMap:uA??=new WeakMap,G=$.get(X);if(G)return G}Y=X!=null?pA(dA(X)):{};let Z=Q||!X||!X.__esModule?L9(Y,"default",{value:X,enumerable:!0}):Y;for(let K of AW(X))if(!wW.call(Z,K))L9(Z,K,{get:CW.bind(X,K),enumerable:!0});if(J)$.set(X,Z);return Z},lA=(X)=>{var Q=(MW??=new WeakMap).get(X),Y;if(Q)return Q;if(Q=L9({},"__esModule",{value:!0}),X&&typeof X==="object"||typeof X==="function"){for(var J of AW(X))if(!wW.call(Q,J))L9(Q,J,{get:CW.bind(X,J),enumerable:!(Y=cA(X,J))||Y.enumerable})}return MW.set(X,Q),Q},MW,J3=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports);var rA=(X)=>X;function oA(X,Q){this[X]=rA.bind(null,Q)}var $6=(X,Q)=>{for(var Y in Q)L9(X,Y,{get:Q[Y],enumerable:!0,configurable:!0,set:oA.bind(Q,Y)})};var EM=J3((N60,jM)=>{jM.exports=function(Q){return Q.map(function(Y){if(Y==="")return"''";if(Y&&typeof Y==="object")return Y.op.replace(/(.)/g,"\\$1");if(/["\s\\]/.test(Y)&&!/'/.test(Y))return"'"+Y.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Y))return'"'+Y.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Y).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var gM=J3((M60,bM)=>{var yM="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",SM=new RegExp("^"+yM+"$"),vM="|&;()<> \\t",mr='"((\\\\"|[^"])*?)"',pr="'((\\\\'|[^'])*?)'",dr=/^#$/,xM="'",kM='"',WW="$",$5="",cr=4294967296;for(s2=0;s2<4;s2++)$5+=(cr*Math.random()).toString(16);var s2,fr=new RegExp("^"+$5);function ur(X,Q){var Y=Q.lastIndex,J=[],$;while($=Q.exec(X))if(J.push($),Q.lastIndex===$.index)Q.lastIndex+=1;return Q.lastIndex=Y,J}function lr(X,Q,Y){var J=typeof X==="function"?X(Y):X[Y];if(typeof J>"u"&&Y!="")J="";else if(typeof J>"u")J="$";if(typeof J==="object")return Q+$5+JSON.stringify(J)+$5;return Q+J}function rr(X,Q,Y){if(!Y)Y={};var J=Y.escape||"\\",$="(\\"+J+`['"`+vM+`]|[^\\s'"`+vM+"])+",G=new RegExp(["("+yM+")","("+$+"|"+mr+"|"+pr+")+"].join("|"),"g"),Z=ur(X,G);if(Z.length===0)return[];if(!Q)Q={};var K=!1;return Z.map(function(W){var H=W[0];if(!H||K)return;if(SM.test(H))return{op:H};var _=!1,V=!1,q="",D=!1,U;function R(){U+=1;var P,y,Y0=H.charAt(U);if(Y0==="{"){if(U+=1,H.charAt(U)==="}")throw Error("Bad substitution: "+H.slice(U-2,U+1));if(P=H.indexOf("}",U),P<0)throw Error("Bad substitution: "+H.slice(U));y=H.slice(U,P),U=P}else if(/[*@#?$!_-]/.test(Y0))y=Y0,U+=1;else{var X8=H.slice(U);if(P=X8.match(/[^\w\d_]/),!P)y=X8,U=H.length;else y=X8.slice(0,P.index),U+=P.index-1}return lr(Q,"",y)}for(U=0;U<H.length;U++){var L=H.charAt(U);if(D=D||!_&&(L==="*"||L==="?"),V)q+=L,V=!1;else if(_)if(L===_)_=!1;else if(_==xM)q+=L;else if(L===J)if(U+=1,L=H.charAt(U),L===kM||L===J||L===WW)q+=L;else q+=J+L;else if(L===WW)q+=R();else q+=L;else if(L===kM||L===xM)_=L;else if(SM.test(L))return{op:H};else if(dr.test(L)){K=!0;var N={comment:X.slice(W.index+U+1)};if(q.length)return[q,N];return[N]}else if(L===J)V=!0;else if(L===WW)q+=R();else q+=L}if(D)return{op:"glob",pattern:q};return q}).reduce(function(W,H){return typeof H>"u"?W:W.concat(H)},[])}bM.exports=function(Q,Y,J){var $=rr(Q,Y,J);if(typeof Y!=="function")return $;return $.reduce(function(G,Z){if(typeof Z==="object")return G.concat(Z);var K=Z.split(RegExp("("+$5+".*?"+$5+")","g"));if(K.length===1)return G.concat(K[0]);return G.concat(K.filter(Boolean).map(function(W){if(fr.test(W))return JSON.parse(W.split($5)[1]);return W}))},[])}});var hM=J3((HW)=>{HW.quote=EM();HW.parse=gM()});var rn={};$6(rn,{runRulesSync:()=>PW,runRules:()=>dn,normalizeToolName:()=>NW,decide:()=>RW,collectPreToolUseRules:()=>gA,collectPostToolUseRules:()=>hA});module.exports=lA(rn);var XY={};$6(XY,{runMain:()=>hv});var k1={};$6(k1,{squash:()=>I6,reasonAnnotations:()=>pT,prettyErrors:()=>LT,pretty:()=>$$,map:()=>KT,makeInterruptReason:()=>HX,makeFailReason:()=>KX,makeDieReason:()=>WX,isUnknownError:()=>gT,isTimeoutError:()=>CT,isReason:()=>J$,isNoSuchElementError:()=>PT,isInterruptReason:()=>YT,isIllegalArgumentError:()=>jT,isFailReason:()=>XT,isExceededCapacityError:()=>ET,isDone:()=>m7,isDieReason:()=>QT,isCause:()=>Y$,isAsyncFiberError:()=>kT,interruptors:()=>zT,interrupt:()=>ZT,hasInterruptsOnly:()=>h7,hasInterrupts:()=>UT,hasFails:()=>HT,hasDies:()=>qT,fromReasons:()=>ZX,findInterrupt:()=>OT,findFail:()=>VT,findErrorOption:()=>_T,findError:()=>S8,findDie:()=>DT,findDefect:()=>BT,filterInterruptors:()=>FT,fail:()=>$T,empty:()=>JT,done:()=>p7,die:()=>GT,combine:()=>WT,annotations:()=>dT,annotate:()=>mT,UnknownErrorTypeId:()=>bT,UnknownError:()=>hT,TypeId:()=>tC,TimeoutErrorTypeId:()=>wT,TimeoutError:()=>TT,StackTrace:()=>kq,ReasonTypeId:()=>eC,NoSuchElementErrorTypeId:()=>RT,NoSuchElementError:()=>NT,InterruptorStackTrace:()=>yq,IllegalArgumentErrorTypeId:()=>IT,IllegalArgumentError:()=>VX,ExceededCapacityErrorTypeId:()=>ST,ExceededCapacityError:()=>vT,DoneTypeId:()=>MT,Done:()=>AT,AsyncFiberErrorTypeId:()=>xT,AsyncFiberError:()=>yT});var a=(X,Q)=>{switch(Q.length){case 0:return X;case 1:return Q[0](X);case 2:return Q[1](Q[0](X));case 3:return Q[2](Q[1](Q[0](X)));case 4:return Q[3](Q[2](Q[1](Q[0](X))));case 5:return Q[4](Q[3](Q[2](Q[1](Q[0](X)))));case 6:return Q[5](Q[4](Q[3](Q[2](Q[1](Q[0](X))))));case 7:return Q[6](Q[5](Q[4](Q[3](Q[2](Q[1](Q[0](X)))))));case 8:return Q[7](Q[6](Q[5](Q[4](Q[3](Q[2](Q[1](Q[0](X))))))));case 9:return Q[8](Q[7](Q[6](Q[5](Q[4](Q[3](Q[2](Q[1](Q[0](X)))))))));default:{let Y=X;for(let J=0,$=Q.length;J<$;J++)Y=Q[J](Y);return Y}}},nA={pipe(){return a(this,arguments)}},G6=function(){function X(){}return X.prototype=nA,X}();var B=function(X,Q){if(typeof X==="function")return function(){return X(arguments)?Q.apply(this,arguments):(Y)=>Q(Y,...arguments)};switch(X){case 0:case 1:throw RangeError(`Invalid arity ${X}`);case 2:return function(Y,J){if(arguments.length>=2)return Q(Y,J);return function($){return Q($,Y)}};case 3:return function(Y,J,$){if(arguments.length>=3)return Q(Y,J,$);return function(G){return Q(G,Y,J)}};default:return function(){if(arguments.length>=X)return Q.apply(this,arguments);let Y=arguments;return function(J){return Q(J,...Y)}}}};var b=(X)=>X;var i0=(X)=>()=>X,R4=i0(!0),IQ=i0(!1),$3=i0(null),A8=i0(void 0),Z5=A8;function G3(X,...Q){return a(X,Q)}function TW(X,Q,Y,J,$,G,Z,K,W){switch(arguments.length){case 1:return X;case 2:return function(){return Q(X.apply(this,arguments))};case 3:return function(){return Y(Q(X.apply(this,arguments)))};case 4:return function(){return J(Y(Q(X.apply(this,arguments))))};case 5:return function(){return $(J(Y(Q(X.apply(this,arguments)))))};case 6:return function(){return G($(J(Y(Q(X.apply(this,arguments))))))};case 7:return function(){return Z(G($(J(Y(Q(X.apply(this,arguments)))))))};case 8:return function(){return K(Z(G($(J(Y(Q(X.apply(this,arguments))))))))};case 9:return function(){return W(K(Z(G($(J(Y(Q(X.apply(this,arguments)))))))))}}return}function d0(X){let Q=new WeakMap;return(Y)=>{if(Q.has(Y))return Q.get(Y);let J=X(Y);return Q.set(Y,J),J}}var R9=(X)=>{let Q=new Set(Reflect.ownKeys(X));if(X.constructor===Object)return Q;if(X instanceof Error)Q.delete("stack");let Y=Object.getPrototypeOf(X),J=Y;while(J!==null&&J!==Object.prototype){let $=Reflect.ownKeys(J);for(let G=0;G<$.length;G++)Q.add($[G]);J=Object.getPrototypeOf(J)}if(Q.has("constructor")&&typeof X.constructor==="function"&&Y===X.constructor.prototype)Q.delete("constructor");return Q},K5=new WeakSet;function Q8(X){return typeof X==="string"}function N9(X){return typeof X==="number"}function IW(X){return typeof X==="boolean"}function jW(X){return typeof X==="bigint"}function Z3(X){return typeof X==="symbol"}function jQ(X){return Q8(X)||N9(X)||Z3(X)}function Y8(X){return typeof X==="function"}function EW(X){return X===void 0}function $1(X){return X!==void 0}function EQ(X){return X!=null}function SW(X){return!1}function K3(X){return!0}function f1(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}function W3(X){return typeof X==="object"&&X!==null||Y8(X)}var M=B(2,(X,Q)=>W3(X)&&(Q in X)),Z6=B(2,(X,Q)=>M(X,"_tag")&&X._tag===Q);function d8(X){return M(X,Symbol.iterator)||Q8(X)}var W0="~effect/interfaces/Hash",s=(X)=>{switch(typeof X){case"number":return c8(X);case"bigint":return C0(X.toString(10));case"boolean":return C0(String(X));case"symbol":return C0(String(X));case"string":return C0(X);case"undefined":return C0("undefined");case"function":case"object":if(X===null)return C0("null");else if(X instanceof Date)return C0(X.toISOString());else if(X instanceof RegExp)return C0(X.toString());else{if(K5.has(X))return SQ(X);if(V3.has(X))return V3.get(X);let Q=tA(X,()=>{if(iA(X))return X[W0]();else if(typeof X==="function")return SQ(X);else if(Array.isArray(X)||ArrayBuffer.isView(X))return M9(X);else if(X instanceof Map)return aA(X);else if(X instanceof Set)return sA(X);return D3(X)});return V3.set(X,Q),Q}default:throw Error(`BUG: unhandled typeof ${typeof X} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},SQ=(X)=>{if(!H3.has(X))H3.set(X,c8(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return H3.get(X)},f0=B(2,(X,Q)=>X*53^Q),vQ=(X)=>X&3221225471|X>>>1&1073741824,iA=(X)=>M(X,W0),c8=(X)=>{if(X!==X)return C0("NaN");if(X===1/0)return C0("Infinity");if(X===-1/0)return C0("-Infinity");let Q=X|0;if(Q!==X)Q^=X*4294967295;while(X>4294967295)Q^=X/=4294967295;return vQ(Q)},C0=(X)=>{let Q=5381,Y=X.length;while(Y)Q=Q*33^X.charCodeAt(--Y);return vQ(Q)},q3=(X,Q)=>{let Y=12289;for(let J of Q)Y^=f0(s(J),s(X[J]));return vQ(Y)},D3=(X)=>q3(X,R9(X)),B3=(X,Q)=>(Y)=>{let J=X;for(let $ of Y)J^=Q($);return vQ(J)},M9=B3(6151,s),aA=B3(C0("Map"),([X,Q])=>f0(s(X),s(Q))),sA=B3(C0("Set"),s),H3=new WeakMap,V3=new WeakMap,_3=new WeakSet;function tA(X,Q){if(_3.has(X))return C0("[Circular]");_3.add(X);let Y=Q();return _3.delete(X),Y}var H0="~effect/interfaces/Equal";function o(){if(arguments.length===1)return(X)=>K6(X,arguments[0]);return K6(arguments[0],arguments[1])}function K6(X,Q){if(X===Q)return!0;if(X==null||Q==null)return!1;let Y=typeof X;if(Y!==typeof Q)return!1;if(Y==="number"&&X!==X&&Q!==Q)return!0;if(Y!=="object"&&Y!=="function")return!1;if(K5.has(X)||K5.has(Q))return!1;return Qw(X,Q,Xw)}function eA(X,Q,Y){let J=U3.has(X),$=O3.has(Q);if(J&&$)return!0;if(J||$)return!1;U3.add(X),O3.add(Q);let G=Y();return U3.delete(X),O3.delete(Q),G}var U3=new WeakSet,O3=new WeakSet;function Xw(X,Q){if(s(X)!==s(Q))return!1;else if(X instanceof Date){if(!(Q instanceof Date))return!1;return X.toISOString()===Q.toISOString()}else if(X instanceof RegExp){if(!(Q instanceof RegExp))return!1;return X.toString()===Q.toString()}let Y=vW(X),J=vW(Q);if(Y!==J)return!1;let $=Y&&J;if(typeof X==="function"&&!$)return!1;return eA(X,Q,()=>{if($)return X[H0](Q);else if(Array.isArray(X)){if(!Array.isArray(Q)||X.length!==Q.length)return!1;return Yw(X,Q)}else if(ArrayBuffer.isView(X)){if(!ArrayBuffer.isView(Q)||X.byteLength!==Q.byteLength)return!1;return Jw(X,Q)}else if(X instanceof Map){if(!(Q instanceof Map)||X.size!==Q.size)return!1;return Gw(X,Q)}else if(X instanceof Set){if(!(Q instanceof Set)||X.size!==Q.size)return!1;return Zw(X,Q)}return $w(X,Q)})}function Qw(X,Q,Y){let J=xQ.get(X);if(!J)J=new WeakMap,xQ.set(X,J);else if(J.has(Q))return J.get(Q);let $=Y(X,Q);J.set(Q,$);let G=xQ.get(Q);if(!G)G=new WeakMap,xQ.set(Q,G);return G.set(X,$),$}var xQ=new WeakMap;function Yw(X,Q){for(let Y=0;Y<X.length;Y++)if(!K6(X[Y],Q[Y]))return!1;return!0}function Jw(X,Q){if(X.length!==Q.length)return!1;for(let Y=0;Y<X.length;Y++)if(X[Y]!==Q[Y])return!1;return!0}function $w(X,Q){let Y=R9(X),J=R9(Q);if(Y.size!==J.size)return!1;for(let $ of Y)if(!J.has($)||!K6(X[$],Q[$]))return!1;return!0}function kQ(X,Q){return function(J,$){for(let[G,Z]of J){let K=!1;for(let[W,H]of $)if(X(G,W)&&Q(Z,H)){K=!0;break}if(!K)return!1}return!0}}var Gw=kQ(K6,K6);function yQ(X){return function(Y,J){for(let $ of Y){let G=!1;for(let Z of J)if(X($,Z)){G=!0;break}if(!G)return!1}return!0}}var Zw=yQ(K6),vW=(X)=>M(X,H0),bQ=()=>o;var xW=(X)=>{return K5.add(X),X};var gQ=Symbol.for("~effect/Redactable"),Kw=(X)=>M(X,gQ);function A9(X){if(Kw(X))return z3(X);return X}function z3(X){return X[gQ](globalThis[W5]?.context??Ww)}var W5="~effect/Fiber/currentFiber",Ww={"~effect/Context":{},mapUnsafe:new Map,pipe(){return a(this,arguments)}};function g(X,Q){let Y=Q?.space??0,J=new WeakSet,$=!Y?"":typeof Y==="number"?" ".repeat(Y):Y,G=(H)=>$.repeat(H),Z=(H,_)=>{let V=H?.constructor;return V&&V!==Object.prototype.constructor&&V.name?`${V.name}(${_})`:_},K=(H)=>{try{return Reflect.ownKeys(H)}catch{return["[ownKeys threw]"]}};function W(H,_=0){if(Array.isArray(H)){if(J.has(H))return kW;if(J.add(H),!$||H.length<=1)return`[${H.map((q)=>W(q,_)).join(",")}]`;let V=H.map((q)=>W(q,_+1)).join(`,
3
+ (function(exports, require, module, __filename, __dirname) {var rA=Object.create;var{getPrototypeOf:oA,defineProperty:P9,getOwnPropertyNames:qW,getOwnPropertyDescriptor:nA}=Object,DW=Object.prototype.hasOwnProperty;function BW(Q){return this[Q]}var iA,aA,O=(Q,X,Y)=>{var J=Q!=null&&typeof Q==="object";if(J){var $=X?iA??=new WeakMap:aA??=new WeakMap,G=$.get(Q);if(G)return G}Y=Q!=null?rA(oA(Q)):{};let Z=X||!Q||!Q.__esModule?P9(Y,"default",{value:Q,enumerable:!0}):Y;for(let K of qW(Q))if(!DW.call(Z,K))P9(Z,K,{get:BW.bind(Q,K),enumerable:!0});if(J)$.set(Q,Z);return Z},sA=(Q)=>{var X=(_W??=new WeakMap).get(Q),Y;if(X)return X;if(X=P9({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var J of qW(Q))if(!DW.call(X,J))P9(X,J,{get:BW.bind(Q,J),enumerable:!(Y=nA(Q,J))||Y.enumerable})}return _W.set(Q,X),X},_W,n2=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var tA=(Q)=>Q;function eA(Q,X){this[Q]=tA.bind(null,X)}var Z6=(Q,X)=>{for(var Y in X)P9(Q,Y,{get:X[Y],enumerable:!0,configurable:!0,set:eA.bind(X,Y)})};var yM=n2((i60,kM)=>{var sr=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],vM=/[\n\r\u2028\u2029]/,tr=/[\s#!"$&'():;<=>@\\^`|]/g;kM.exports=function(X){return X.map(function(Y){if(Y==="")return"''";if(Y&&typeof Y==="object"){if(Y.op==="glob"){if(typeof Y.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(vM.test(Y.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Y.pattern.replace(tr,"\\$&")}if(typeof Y.op==="string"){if(sr.indexOf(Y.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Y.op));return Y.op.replace(/[\s\S]/g,"\\$&")}if(typeof Y.comment==="string"){if(vM.test(Y.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Y.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Y)&&!/'/.test(Y))return"'"+Y.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Y))return'"'+Y.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Y).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var cM=n2((a60,pM)=>{var dM="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",bM=new RegExp("^"+dM+"$"),gM="|&;()<> \\t",er='"((\\\\"|[^"])*?)"',Qo="'((\\\\'|[^'])*?)'",Xo=/^#$/,hM="'",mM='"',sK="$",Y5="",Yo=4294967296;for(c2=0;c2<4;c2++)Y5+=(Yo*Math.random()).toString(16);var c2,Jo=new RegExp("^"+Y5);function $o(Q,X){var Y=X.lastIndex,J=[],$;while($=X.exec(Q))if(J.push($),X.lastIndex===$.index)X.lastIndex+=1;return X.lastIndex=Y,J}function Go(Q,X,Y){var J=typeof Q==="function"?Q(Y):Q[Y];if(typeof J>"u"&&Y!="")J="";else if(typeof J>"u")J="$";if(typeof J==="object")return X+Y5+JSON.stringify(J)+Y5;return X+J}function Zo(Q,X,Y){if(!Y)Y={};var J=Y.escape||"\\",$="(\\"+J+`['"`+gM+`]|[^\\s'"`+gM+"])+",G=new RegExp(["("+dM+")","("+$+"|"+er+"|"+Qo+")+"].join("|"),"g"),Z=$o(Q,G);if(Z.length===0)return[];if(!X)X={};var K=!1;return Z.map(function(W){var H=W[0];if(!H||K)return;if(bM.test(H))return{op:H};var _=!1,V=!1,q="",D=!1,U;function P(){U+=1;var w,R,i=H.charAt(U);if(i==="{"){if(U+=1,H.charAt(U)==="}")throw Error("Bad substitution: "+H.slice(U-2,U+1));if(w=H.indexOf("}",U),w<0)throw Error("Bad substitution: "+H.slice(U));R=H.slice(U,w),U=w}else if(/[*@#?$!_-]/.test(i))R=i,U+=1;else{var $1=H.slice(U);if(w=$1.match(/[^\w\d_]/),!w)R=$1,U=H.length;else R=$1.slice(0,w.index),U+=w.index-1}return Go(X,"",R)}for(U=0;U<H.length;U++){var L=H.charAt(U);if(D=D||!_&&(L==="*"||L==="?"),V)q+=L,V=!1;else if(_)if(L===_)_=!1;else if(_==hM)q+=L;else if(L===J)if(U+=1,L=H.charAt(U),L===mM||L===J||L===sK)q+=L;else q+=J+L;else if(L===sK)q+=P();else q+=L;else if(L===mM||L===hM)_=L;else if(bM.test(L))return{op:H};else if(Xo.test(L)){K=!0;var M={comment:Q.slice(W.index+U+1)};if(q.length)return[q,M];return[M]}else if(L===J)V=!0;else if(L===sK)q+=P();else q+=L}if(D)return{op:"glob",pattern:q};return q}).reduce(function(W,H){return typeof H>"u"?W:W.concat(H)},[])}pM.exports=function(X,Y,J){var $=Zo(X,Y,J);if(typeof Y!=="function")return $;return $.reduce(function(G,Z){if(typeof Z==="object")return G.concat(Z);var K=Z.split(RegExp("("+Y5+".*?"+Y5+")","g"));if(K.length===1)return G.concat(K[0]);return G.concat(K.filter(Boolean).map(function(W){if(Jo.test(W))return JSON.parse(W.split(Y5)[1]);return W}))},[])}});var fM=n2((tK)=>{tK.quote=yM();tK.parse=cM()});var Bi={};Z6(Bi,{runRulesSync:()=>WW,runRules:()=>Hi,normalizeToolName:()=>VW,decide:()=>HW,collectPreToolUseRules:()=>fA,collectPostToolUseRules:()=>uA});module.exports=sA(Bi);var i7={};Z6(i7,{runMain:()=>lx});var y1={};Z6(y1,{squash:()=>j6,reasonAnnotations:()=>rT,prettyErrors:()=>wT,pretty:()=>iJ,map:()=>DT,makeInterruptReason:()=>KQ,makeFailReason:()=>GQ,makeDieReason:()=>ZQ,isUnknownError:()=>fT,isTimeoutError:()=>xT,isReason:()=>nJ,isNoSuchElementError:()=>CT,isInterruptReason:()=>WT,isIllegalArgumentError:()=>yT,isFailReason:()=>ZT,isExceededCapacityError:()=>bT,isDone:()=>k7,isDieReason:()=>KT,isCause:()=>oJ,isAsyncFiberError:()=>dT,interruptors:()=>MT,interrupt:()=>qT,hasInterruptsOnly:()=>v7,hasInterrupts:()=>RT,hasFails:()=>UT,hasDies:()=>FT,fromReasons:()=>$Q,findInterrupt:()=>NT,findFail:()=>OT,findErrorOption:()=>zT,findError:()=>E8,findDie:()=>LT,findDefect:()=>PT,filterInterruptors:()=>AT,fail:()=>VT,empty:()=>HT,done:()=>y7,die:()=>_T,combine:()=>BT,annotations:()=>oT,annotate:()=>lT,UnknownErrorTypeId:()=>cT,UnknownError:()=>uT,TypeId:()=>$T,TimeoutErrorTypeId:()=>ST,TimeoutError:()=>vT,StackTrace:()=>Mq,ReasonTypeId:()=>GT,NoSuchElementErrorTypeId:()=>TT,NoSuchElementError:()=>IT,InterruptorStackTrace:()=>Aq,IllegalArgumentErrorTypeId:()=>kT,IllegalArgumentError:()=>WQ,ExceededCapacityErrorTypeId:()=>gT,ExceededCapacityError:()=>hT,DoneTypeId:()=>jT,Done:()=>ET,AsyncFiberErrorTypeId:()=>mT,AsyncFiberError:()=>pT});var X0=(Q,X)=>{switch(X.length){case 0:return Q;case 1:return X[0](Q);case 2:return X[1](X[0](Q));case 3:return X[2](X[1](X[0](Q)));case 4:return X[3](X[2](X[1](X[0](Q))));case 5:return X[4](X[3](X[2](X[1](X[0](Q)))));case 6:return X[5](X[4](X[3](X[2](X[1](X[0](Q))))));case 7:return X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))));case 8:return X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q))))))));case 9:return X[8](X[7](X[6](X[5](X[4](X[3](X[2](X[1](X[0](Q)))))))));default:{let Y=Q;for(let J=0,$=X.length;J<$;J++)Y=X[J](Y);return Y}}},Qw={pipe(){return X0(this,arguments)}},K6=function(){function Q(){}return Q.prototype=Qw,Q}();var B=function(Q,X){if(typeof Q==="function")return function(){return Q(arguments)?X.apply(this,arguments):(Y)=>X(Y,...arguments)};switch(Q){case 0:case 1:throw RangeError(`Invalid arity ${Q}`);case 2:return function(Y,J){if(arguments.length>=2)return X(Y,J);return function($){return X($,Y)}};case 3:return function(Y,J,$){if(arguments.length>=3)return X(Y,J,$);return function(G){return X(G,Y,J)}};default:return function(){if(arguments.length>=Q)return X.apply(this,arguments);let Y=arguments;return function(J){return X(J,...Y)}}}};var g=(Q)=>Q;var G1=(Q)=>()=>Q,P4=G1(!0),MX=G1(!1),i2=G1(null),N8=G1(void 0),$5=N8;function a2(Q,...X){return X0(Q,X)}function UW(Q,X,Y,J,$,G,Z,K,W){switch(arguments.length){case 1:return Q;case 2:return function(){return X(Q.apply(this,arguments))};case 3:return function(){return Y(X(Q.apply(this,arguments)))};case 4:return function(){return J(Y(X(Q.apply(this,arguments))))};case 5:return function(){return $(J(Y(X(Q.apply(this,arguments)))))};case 6:return function(){return G($(J(Y(X(Q.apply(this,arguments))))))};case 7:return function(){return Z(G($(J(Y(X(Q.apply(this,arguments)))))))};case 8:return function(){return K(Z(G($(J(Y(X(Q.apply(this,arguments))))))))};case 9:return function(){return W(K(Z(G($(J(Y(X(Q.apply(this,arguments)))))))))}}return}function p0(Q){let X=new WeakMap;return(Y)=>{if(X.has(Y))return X.get(Y);let J=Q(Y);return X.set(Y,J),J}}var N9=(Q)=>{let X=new Set(Reflect.ownKeys(Q));if(Q.constructor===Object)return X;if(Q instanceof Error)X.delete("stack");let Y=Object.getPrototypeOf(Q),J=Y;while(J!==null&&J!==Object.prototype){let $=Reflect.ownKeys(J);for(let G=0;G<$.length;G++)X.add($[G]);J=Object.getPrototypeOf(J)}if(X.has("constructor")&&typeof Q.constructor==="function"&&Y===Q.constructor.prototype)X.delete("constructor");return X},G5=new WeakSet;function X8(Q){return typeof Q==="string"}function M9(Q){return typeof Q==="number"}function OW(Q){return typeof Q==="boolean"}function zW(Q){return typeof Q==="bigint"}function s2(Q){return typeof Q==="symbol"}function AX(Q){return X8(Q)||M9(Q)||s2(Q)}function Y8(Q){return typeof Q==="function"}function FW(Q){return Q===void 0}function Z1(Q){return Q!==void 0}function wX(Q){return Q!=null}function LW(Q){return!1}function t2(Q){return!0}function N1(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function e2(Q){return typeof Q==="object"&&Q!==null||Y8(Q)}var N=B(2,(Q,X)=>e2(Q)&&(X in Q)),W6=B(2,(Q,X)=>N(Q,"_tag")&&Q._tag===X);function PW(Q){return Q instanceof Error}function d8(Q){return N(Q,Symbol.iterator)||X8(Q)}var K0="~effect/interfaces/Hash",t=(Q)=>{switch(typeof Q){case"number":return p8(Q);case"bigint":return T0(Q.toString(10));case"boolean":return T0(String(Q));case"symbol":return T0(String(Q));case"string":return T0(Q);case"undefined":return T0("undefined");case"function":case"object":if(Q===null)return T0("null");else if(Q instanceof Date)return T0(Q.toISOString());else if(Q instanceof RegExp)return T0(Q.toString());else{if(G5.has(Q))return CX(Q);if(X3.has(Q))return X3.get(Q);let X=$w(Q,()=>{if(Xw(Q))return Q[K0]();else if(typeof Q==="function")return CX(Q);else if(Array.isArray(Q)||ArrayBuffer.isView(Q))return A9(Q);else if(Q instanceof Map)return Yw(Q);else if(Q instanceof Set)return Jw(Q);return $3(Q)});return X3.set(Q,X),X}default:throw Error(`BUG: unhandled typeof ${typeof Q} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},CX=(Q)=>{if(!Q3.has(Q))Q3.set(Q,p8(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)));return Q3.get(Q)},u0=B(2,(Q,X)=>Q*53^X),TX=(Q)=>Q&3221225471|Q>>>1&1073741824,Xw=(Q)=>N(Q,K0),p8=(Q)=>{if(Q!==Q)return T0("NaN");if(Q===1/0)return T0("Infinity");if(Q===-1/0)return T0("-Infinity");let X=Q|0;if(X!==Q)X^=Q*4294967295;while(Q>4294967295)X^=Q/=4294967295;return TX(X)},T0=(Q)=>{let X=5381,Y=Q.length;while(Y)X=X*33^Q.charCodeAt(--Y);return TX(X)},J3=(Q,X)=>{let Y=12289;for(let J of X)Y^=u0(t(J),t(Q[J]));return TX(Y)},$3=(Q)=>J3(Q,N9(Q)),G3=(Q,X)=>(Y)=>{let J=Q;for(let $ of Y)J^=X($);return TX(J)},A9=G3(6151,t),Yw=G3(T0("Map"),([Q,X])=>u0(t(Q),t(X))),Jw=G3(T0("Set"),t),Q3=new WeakMap,X3=new WeakMap,Y3=new WeakSet;function $w(Q,X){if(Y3.has(Q))return T0("[Circular]");Y3.add(Q);let Y=X();return Y3.delete(Q),Y}var W0="~effect/interfaces/Equal";function n(){if(arguments.length===1)return(Q)=>H6(Q,arguments[0]);return H6(arguments[0],arguments[1])}function H6(Q,X){if(Q===X)return!0;if(Q==null||X==null)return!1;let Y=typeof Q;if(Y!==typeof X)return!1;if(Y==="number"&&Q!==Q&&X!==X)return!0;if(Y!=="object"&&Y!=="function")return!1;if(G5.has(Q)||G5.has(X))return!1;return Kw(Q,X,Zw)}function Gw(Q,X,Y){let J=Z3.has(Q),$=K3.has(X);if(J&&$)return!0;if(J||$)return!1;Z3.add(Q),K3.add(X);let G=Y();return Z3.delete(Q),K3.delete(X),G}var Z3=new WeakSet,K3=new WeakSet;function Zw(Q,X){if(t(Q)!==t(X))return!1;else if(Q instanceof Date){if(!(X instanceof Date))return!1;return Q.toISOString()===X.toISOString()}else if(Q instanceof RegExp){if(!(X instanceof RegExp))return!1;return Q.toString()===X.toString()}let Y=RW(Q),J=RW(X);if(Y!==J)return!1;let $=Y&&J;if(typeof Q==="function"&&!$)return!1;return Gw(Q,X,()=>{if($)return Q[W0](X);else if(Array.isArray(Q)){if(!Array.isArray(X)||Q.length!==X.length)return!1;return Ww(Q,X)}else if(ArrayBuffer.isView(Q)){if(!ArrayBuffer.isView(X)||Q.byteLength!==X.byteLength)return!1;return Hw(Q,X)}else if(Q instanceof Map){if(!(X instanceof Map)||Q.size!==X.size)return!1;return _w(Q,X)}else if(Q instanceof Set){if(!(X instanceof Set)||Q.size!==X.size)return!1;return qw(Q,X)}return Vw(Q,X)})}function Kw(Q,X,Y){let J=IX.get(Q);if(!J)J=new WeakMap,IX.set(Q,J);else if(J.has(X))return J.get(X);let $=Y(Q,X);J.set(X,$);let G=IX.get(X);if(!G)G=new WeakMap,IX.set(X,G);return G.set(Q,$),$}var IX=new WeakMap;function Ww(Q,X){for(let Y=0;Y<Q.length;Y++)if(!H6(Q[Y],X[Y]))return!1;return!0}function Hw(Q,X){if(Q.length!==X.length)return!1;for(let Y=0;Y<Q.length;Y++)if(Q[Y]!==X[Y])return!1;return!0}function Vw(Q,X){let Y=N9(Q),J=N9(X);if(Y.size!==J.size)return!1;for(let $ of Y)if(!J.has($)||!H6(Q[$],X[$]))return!1;return!0}function jX(Q,X){return function(J,$){for(let[G,Z]of J){let K=!1;for(let[W,H]of $)if(Q(G,W)&&X(Z,H)){K=!0;break}if(!K)return!1}return!0}}var _w=jX(H6,H6);function EX(Q){return function(Y,J){for(let $ of Y){let G=!1;for(let Z of J)if(Q($,Z)){G=!0;break}if(!G)return!1}return!0}}var qw=EX(H6),RW=(Q)=>N(Q,W0),SX=()=>n;var NW=(Q)=>{return G5.add(Q),Q};var xX=Symbol.for("~effect/Redactable"),Dw=(Q)=>N(Q,xX);function w9(Q){if(Dw(Q))return W3(Q);return Q}function W3(Q){return Q[xX](globalThis[Z5]?.context??Bw)}var Z5="~effect/Fiber/currentFiber",Bw={"~effect/Context":{},mapUnsafe:new Map,pipe(){return X0(this,arguments)}};function v(Q,X){let Y=X?.space??0,J=new WeakSet,$=!Y?"":typeof Y==="number"?" ".repeat(Y):Y,G=(H)=>$.repeat(H),Z=(H,_)=>{let V=H?.constructor;return V&&V!==Object.prototype.constructor&&V.name?`${V.name}(${_})`:_},K=(H)=>{try{return Reflect.ownKeys(H)}catch{return["[ownKeys threw]"]}};function W(H,_=0){if(Array.isArray(H)){if(J.has(H))return MW;if(J.add(H),!$||H.length<=1)return`[${H.map((q)=>W(q,_)).join(",")}]`;let V=H.map((q)=>W(q,_+1)).join(`,
4
4
  `+G(_+1));return`[
5
5
  ${G(_+1)}${V}
6
- ${G(_)}]`}if(H instanceof Date)return F3(H);if(!Q?.ignoreToString&&M(H,"toString")&&typeof H.toString==="function"&&H.toString!==Object.prototype.toString&&H.toString!==Array.prototype.toString){let V=Hw(H);if(H instanceof Error&&H.cause)return`${V} (cause: ${W(H.cause,_)})`;return V}if(typeof H==="string")return JSON.stringify(H);if(typeof H==="number"||H==null||typeof H==="boolean"||typeof H==="symbol")return String(H);if(typeof H==="bigint")return String(H)+"n";if(typeof H==="object"||typeof H==="function"){if(J.has(H))return kW;if(J.add(H),gQ in H)return g(z3(H));if(Symbol.iterator in H)return`${H.constructor.name}(${W(Array.from(H),_)})`;let V=K(H);if(!$||V.length<=1){let D=`{${V.map((U)=>`${N4(U)}:${W(H[U],_)}`).join(",")}}`;return Z(H,D)}let q=`{
7
- ${V.map((D)=>`${G(_+1)}${N4(D)}: ${W(H[D],_+1)}`).join(`,
6
+ ${G(_)}]`}if(H instanceof Date)return H3(H);if(!X?.ignoreToString&&N(H,"toString")&&typeof H.toString==="function"&&H.toString!==Object.prototype.toString&&H.toString!==Array.prototype.toString){let V=Uw(H);if(H instanceof Error&&H.cause)return`${V} (cause: ${W(H.cause,_)})`;return V}if(typeof H==="string")return JSON.stringify(H);if(typeof H==="number"||H==null||typeof H==="boolean"||typeof H==="symbol")return String(H);if(typeof H==="bigint")return String(H)+"n";if(typeof H==="object"||typeof H==="function"){if(J.has(H))return MW;if(J.add(H),xX in H)return v(W3(H));if(Symbol.iterator in H)return`${H.constructor.name}(${W(Array.from(H),_)})`;let V=K(H);if(!$||V.length<=1){let D=`{${V.map((U)=>`${R4(U)}:${W(H[U],_)}`).join(",")}}`;return Z(H,D)}let q=`{
7
+ ${V.map((D)=>`${G(_+1)}${R4(D)}: ${W(H[D],_+1)}`).join(`,
8
8
  `)}
9
- ${G(_)}}`;return Z(H,q)}return String(H)}return W(X,0)}var kW="[Circular]";function N4(X){return typeof X==="string"?JSON.stringify(X):String(X)}function hQ(X){return X.map((Q)=>`[${N4(Q)}]`).join("")}function F3(X){try{return X.toISOString()}catch{return"Invalid Date"}}function Hw(X){try{let Q=X.toString();return typeof Q==="string"?Q:String(Q)}catch{return"[toString threw]"}}function w9(X,Q){let Y=[];return JSON.stringify(X,function(J,$){let G=A9($);if(typeof G!=="object"||G===null)return G;while(Y.length>0&&Y[Y.length-1]!==this)Y.pop();if(Y.includes(G))return;return Y.push(G),G},Q?.space)}var a0=Symbol.for("nodejs.util.inspect.custom"),G1=(X)=>{try{if(M(X,"toJSON")&&Y8(X.toJSON)&&X.toJSON.length===0)return X.toJSON();else if(Array.isArray(X))return X.map(G1)}catch{return"[toJSON threw]"}return A9(X)},yW=(X,Q=2)=>{if(typeof X==="string")return X;try{return typeof X==="object"?w9(X,{space:Q}):String(X)}catch{return String(X)}},_i={toJSON(){return G1(this)},[a0](){return this.toJSON()},toString(){return g(this.toJSON())}};class W6{called=!1;self;constructor(X){this.self=X}next(X){return this.called?{value:X,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new W6(this.self)}}var H5="~effect/Utils/internal",bW={[H5]:(X)=>{return X()}},_w={[H5]:(X)=>{try{return X()}finally{}}},qw=bW[H5](()=>Error().stack)?.includes(H5)===!0,J0=qw?bW[H5]:_w[H5];var f8="~effect/Effect",H6="~effect/Exit",Dw={_A:b,_E:b,_R:b},hW=`${f8}/identifier`,t=`${f8}/args`,u0=`${f8}/evaluate`,R1=`${f8}/successCont`,J8=`${f8}/failureCont`,M4=`${f8}/ensureCont`,A4=Symbol.for("effect/Effect/Yield"),w8={pipe(){return a(this,arguments)},toJSON(){return{...this}},toString(){return g(this.toJSON(),{ignoreToString:!0,space:2})},[a0](){return this.toJSON()}},mW={[W0](){return q3(this,Object.keys(this))},[H0](X){let Q=Object.keys(this),Y=Object.keys(X);if(Q.length!==Y.length)return!1;for(let J=0;J<Q.length;J++)if(Q[J]!==Y[J]&&!o(this[Q[J]],X[Q[J]]))return!1;return!0}},_6={[Symbol.iterator](){return new W6(this)}},Bw={..._6,pipe(){return a(this,arguments)}},Uw={[f8]:Dw,...w8,[Symbol.iterator](){return new W6(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[hW],...t in this?{args:this[t]}:void 0}}},d=(X)=>M(X,f8),L3=(X)=>M(X,H6),V5="~effect/Cause",_5="~effect/Cause/Reason",q5=(X)=>M(X,V5),pW=(X)=>M(X,_5);class u8{[V5];reasons;constructor(X){this[V5]=V5,this.reasons=X}pipe(){return a(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((X)=>X.toJSON())}}toString(){return`Cause(${g(this.reasons)})`}[a0](){return this.toJSON()}[H0](X){return q5(X)&&this.reasons.length===X.reasons.length&&this.reasons.every((Q,Y)=>o(Q,X.reasons[Y]))}[W0](){return M9(this.reasons)}}var gW=new WeakMap;class T9{[_5];annotations;_tag;constructor(X,Q,Y){if(this[_5]=_5,this._tag=X,Q!==I9&&typeof Y==="object"&&Y!==null&&Q.size>0){let J=gW.get(Y);if(J)Q=new Map([...J,...Q]);gW.set(Y,Q)}this.annotations=Q}annotate(X,Q){if(X.mapUnsafe.size===0)return this;let Y=new Map(this.annotations);X.mapUnsafe.forEach(($,G)=>{if(Q?.overwrite!==!0&&Y.has(G))return;Y.set(G,$)});let J=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return J.annotations=Y,J}pipe(){return a(this,arguments)}toString(){return g(this)}[a0](){return this.toString()}}var I9=new Map;class D5 extends T9{error;constructor(X,Q=I9){super("Fail",Q,X);this.error=X}toString(){return`Fail(${g(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[H0](X){return w4(X)&&o(this.error,X.error)&&o(this.annotations,X.annotations)}[W0](){return f0(C0(this._tag))(f0(s(this.error))(s(this.annotations)))}}var l8=(X)=>new u8(X),mQ=new u8([]),P3=(X)=>new u8([new D5(X)]);class pQ extends T9{defect;constructor(X,Q=I9){super("Die",Q,X);this.defect=X}toString(){return`Die(${g(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[H0](X){return q6(X)&&o(this.defect,X.defect)&&o(this.annotations,X.annotations)}[W0](){return f0(C0(this._tag))(f0(s(this.defect))(s(this.annotations)))}}var R3=(X)=>new u8([new pQ(X)]),B5=B((X)=>q5(X[0]),(X,Q,Y)=>{if(Q.mapUnsafe.size===0)return X;return new u8(X.reasons.map((J)=>J.annotate(Q,Y)))}),w4=(X)=>X._tag==="Fail",q6=(X)=>X._tag==="Die",D6=(X)=>X._tag==="Interrupt";function Ow(X){return C8("Effect.evaluate: Not implemented")}var U5=(X)=>({...Uw,[hW]:X.op,[u0]:X[u0]??Ow,[R1]:X[R1],[J8]:X[J8],[M4]:X[M4]}),u1=(X)=>{let Q=U5(X);return function(){let Y=Object.create(Q);return Y[t]=X.single===!1?arguments:arguments[0],Y}},dW=(X)=>{let Q={...U5(X),[H6]:H6,_tag:X.op,get[X.prop](){return this[t]},toString(){return`${X.op}(${g(this[t])})`},toJSON(){return{_id:"Exit",_tag:X.op,[X.prop]:this[t]}},[H0](Y){return L3(Y)&&Y._tag===this._tag&&o(this[t],Y[t])},[W0](){return f0(C0(X.op),s(this[t]))}};return function(Y){let J=Object.create(Q);return J[t]=Y,J}},j0=dW({op:"Success",prop:"value",[u0](X){let Q=X.getCont(R1);return Q?Q[R1](this[t],X,this):X.yieldWith(this)}}),j9={key:"effect/Cause/StackTrace"},cW={key:"effect/Cause/InterruptorStackTrace"},N1=dW({op:"Failure",prop:"cause",[u0](X){let Q=this[t],Y=!1;if(X.currentStackFrame)Q=B5(Q,{mapUnsafe:new Map([[j9.key,X.currentStackFrame]])}),Y=!0;let J=X.getCont(J8);while(X.interruptible&&X._interruptedCause&&J)J=X.getCont(J8);return J?J[J8](Q,X,Y?void 0:this):X.yieldWith(Y?this:N1(Q))}}),M1=(X)=>N1(P3(X)),C8=(X)=>N1(R3(X)),c=u1({op:"WithFiber",[u0](X){return this[t](X)}}),zw=function(){class X extends globalThis.Error{asEffect(){return M1(this)}}return Object.assign(X.prototype,Bw),X}(),dQ=function(){let X=Symbol.for("effect/Data/Error/plainArgs");return class extends zw{constructor(Y){super(Y?.message,Y?.cause?{cause:Y.cause}:void 0);if(Y)Object.assign(this,Y),Object.defineProperty(this,X,{value:Y,enumerable:!1})}toJSON(){return{...this[X],...this}}}}(),r8=(X)=>{class Q extends dQ{_tag=X}return Q.prototype.name=X,Q},C9="~effect/Cause/NoSuchElementError",cQ=(X)=>M(X,C9);class $8 extends r8("NoSuchElementError"){[C9]=C9;constructor(X){super({message:X})}}var V6="~effect/Cause/Done",E9=(X)=>M(X,V6),fW={[V6]:V6,_tag:"Done",value:void 0},N3=(X)=>{if(X===void 0)return fW;return{[V6]:V6,_tag:"Done",value:X}},Fw=M1(fW),uW=(X)=>{if(X===void 0)return Fw;return M1(N3(X))};function lW(X){return{combine:X}}function o8(X,Q,Y){return{combine:X,initialValue:Q,combineAll:Y??((J)=>{let $=Q;for(let G of J)$=X($,G);return $})}}var s0=(X)=>(Q,Y)=>Q===Y||X(Q,Y);function rW(X){return s0((Q,Y)=>{if(Q.length!==Y.length)return!1;for(let J=0;J<Q.length;J++)if(!X(Q[J],Y[J]))return!1;return!0})}var oW=(X)=>B(3,(Q,Y,J)=>X(Q,($)=>({...$,[Y]:J($)}))),nW=(X)=>B(2,(Q,Y)=>X(Q,(J)=>({[Y]:J}))),iW=(X,Q)=>B(3,(Y,J,$)=>Q(Y,(G)=>X($(G),(Z)=>({...G,[J]:Z}))));var aW="~effect/data/Option",sW={[aW]:{_A:(X)=>X},...w8,..._6},tW=Object.assign(Object.create(sW),{_tag:"Some",_op:"Some",[H0](X){return uQ(X)&&A3(X)&&o(this.value,X.value)},[W0](){return f0(s(this._tag))(s(this.value))},toString(){return`some(${g(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:G1(this.value)}},asEffect(){return j0(this.value)}});Object.defineProperty(tW,"valueOrUndefined",{get(){return this.value}});var Rw=s("None"),Nw=Object.assign(Object.create(sW),{_tag:"None",_op:"None",valueOrUndefined:void 0,[H0](X){return uQ(X)&&M3(X)},[W0](){return Rw},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return M1(new $8)}}),uQ=(X)=>M(X,aW),M3=(X)=>X._tag==="None",A3=(X)=>X._tag==="Some",eW=Object.create(Nw),XH=(X)=>{let Q=Object.create(tW);return Q.value=X,Q};var QH="~effect/data/Result",YH={[QH]:{_A:(X)=>X,_E:(X)=>X},...w8,..._6},Aw=Object.assign(Object.create(YH),{_tag:"Success",_op:"Success",[H0](X){return lQ(X)&&C3(X)&&o(this.success,X.success)},[W0](){return f0(s(this._tag))(s(this.success))},toString(){return`success(${g(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:G1(this.success)}},asEffect(){return j0(this.success)}}),ww=Object.assign(Object.create(YH),{_tag:"Failure",_op:"Failure",[H0](X){return lQ(X)&&w3(X)&&o(this.failure,X.failure)},[W0](){return f0(s(this._tag))(s(this.failure))},toString(){return`failure(${g(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:G1(this.failure)}},asEffect(){return M1(this.failure)}}),lQ=(X)=>M(X,QH),w3=(X)=>X._tag==="Failure",C3=(X)=>X._tag==="Success",JH=(X)=>{let Q=Object.create(ww);return Q.failure=X,Q},$H=(X)=>{let Q=Object.create(Aw);return Q.success=X,Q};function S9(X){return(Q,Y)=>Q===Y?0:X(Q,Y)}var D1=S9((X,Q)=>{if(globalThis.Number.isNaN(X)&&globalThis.Number.isNaN(Q))return 0;if(globalThis.Number.isNaN(X))return-1;if(globalThis.Number.isNaN(Q))return 1;return X<Q?-1:1});var T8=S9((X,Q)=>X<Q?-1:1);var T3=B(2,(X,Q)=>S9((Y,J)=>X(Q(Y),Q(J)))),O5=T3(D1,(X)=>X.getTime());var rQ=(X)=>B(2,(Q,Y)=>X(Q,Y)===-1),z5=(X)=>B(2,(Q,Y)=>X(Q,Y)===1),oQ=(X)=>B(2,(Q,Y)=>X(Q,Y)!==1),nQ=(X)=>B(2,(Q,Y)=>X(Q,Y)!==-1);var x=()=>eW,F=XH,GH=uQ,T0=M3,B1=A3,G8=B(2,(X,{onNone:Q,onSome:Y})=>T0(X)?Q():Y(X.value));var aQ=B(2,(X,Q)=>T0(X)?Q():X.value);var ZH=(X)=>X==null?x():F(X),KH=(X)=>X===void 0?x():F(X),WH=(X)=>X===null?x():F(X);var I3=aQ($3),B6=aQ(A8),U6=(X)=>(...Q)=>{try{return F(X(...Q))}catch{return x()}};var I4=B(2,(X,Q)=>T0(X)?x():F(Q(X.value)));var Tw=B(2,(X,Q)=>T0(X)?x():Q(X.value));var F5=Tw(b);var L5=B(2,(X,Q)=>T0(X)?x():Q(X.value)?F(X.value):x()),HH=(X)=>s0((Q,Y)=>T0(Q)?T0(Y):T0(Y)?!1:X(Q.value,Y.value));var VH="~effect/Context/Service",l1=function(){let X=Error.stackTraceLimit;Error.stackTraceLimit=2;let Q=Error();Error.stackTraceLimit=X;function Y(){}let J=Y;if(Object.setPrototypeOf(J,Iw),Object.defineProperty(J,"stack",{get(){return Q.stack}}),arguments.length>0){if(J.key=arguments[0],arguments[1]?.defaultValue)J[sQ]=sQ,J.defaultValue=arguments[1].defaultValue;return J}return function($,G){if(J.key=$,G?.make)J.make=G.make;return J}},Iw={[VH]:VH,...w8,..._6,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=i0(c((Q)=>j0(E1(Q.context,this)))))()},of(X){return X},context(X){return tQ(this,X)},use(X){return c((Q)=>X(E1(Q.context,this)))},useSync(X){return c((Q)=>j0(X(E1(Q.context,this))))}},sQ="~effect/Context/Reference",_H="~effect/Context",j4=(X)=>{let Q=Object.create(jw);return Q.mapUnsafe=X,Q.mutable=!1,Q},jw={...w8,[_H]:{_Services:(X)=>X},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([X,Q])=>({key:X,value:Q}))}},[H0](X){if(!E3(X)||this.mapUnsafe.size!==X.mapUnsafe.size)return!1;for(let Q of this.mapUnsafe.keys())if(!X.mapUnsafe.has(Q)||!o(this.mapUnsafe.get(Q),X.mapUnsafe.get(Q)))return!1;return!0},[W0](){return c8(this.mapUnsafe.size)}},E3=(X)=>M(X,_H);var qH=(X)=>M(X,sQ),Z8=()=>Ew,Ew=j4(new Map),tQ=(X,Q)=>j4(new Map([[X.key,Q]])),K8=B(3,(X,Q,Y)=>zH(X,(J)=>{J.set(Q.key,Y)}));var DH=B(3,(X,Q,Y)=>{if(X.mapUnsafe.has(Q.key))return X.mapUnsafe.get(Q.key);return qH(Q)?eQ(Q):Y()});var O6=B(2,(X,Q)=>{if(!X.mapUnsafe.has(Q.key)){if(sQ in Q)return eQ(Q);throw Sw(Q)}return X.mapUnsafe.get(Q.key)}),E1=O6,BH=(X,Q)=>{if(!X.mapUnsafe.has(Q.key))return eQ(Q);return X.mapUnsafe.get(Q.key)},j3="~effect/Context/defaultValue",eQ=(X)=>{if(j3 in X)return X[j3];return X[j3]=X.defaultValue()},Sw=(X)=>{let Q=Error(`Service not found${X.key?`: ${String(X.key)}`:""}`);if(X.stack){let Y=X.stack.split(`
10
- `);if(Y.length>2){let J=Y[2].match(/at (.*)/);if(J)Q.message=Q.message+` (defined at ${J[1]})`}}if(Q.stack){let Y=Q.stack.split(`
11
- `);Y.splice(1,3),Q.stack=Y.join(`
12
- `)}return Q},UH=B(2,(X,Q)=>{if(X.mapUnsafe.has(Q.key))return F(X.mapUnsafe.get(Q.key));return qH(Q)?F(eQ(Q)):x()}),X7=B(2,(X,Q)=>{if(X.mapUnsafe.size===0)return Q;if(Q.mapUnsafe.size===0)return X;return zH(X,(Y)=>{Q.mapUnsafe.forEach((J,$)=>Y.set($,J))})}),OH=(...X)=>{let Q=new Map;for(let Y=0;Y<X.length;Y++)X[Y].mapUnsafe.forEach((J,$)=>{Q.set($,J)});return j4(Q)};var zH=(X,Q)=>{if(X.mutable)return Q(X.mapUnsafe),X;let Y=new Map(X.mapUnsafe);return Q(Y),j4(Y)},_0=l1;var S3=(X)=>X.length>0;var l=$H,f=JH;var FH=lQ,u=w3,A1=C3;var LH=(X,Q)=>s0((Y,J)=>u(Y)?u(J)&&Q(Y.failure,J.failure):A1(J)&&X(Y.success,J.success));var v9=B(2,(X,Q)=>u(X)?f(Q(X.failure)):l(X.success)),z6=B(2,(X,Q)=>A1(X)?l(Q(X.success)):f(X.failure)),I8=B(2,(X,{onFailure:Q,onSuccess:Y})=>u(X)?Q(X.failure):Y(X.success));var x9=B(2,(X,Q)=>u(X)?Q(X.failure):X.success);var Q7=B(2,(X,Q)=>u(X)?f(X.failure):Q(X.success));var hi={[Symbol.iterator](){return xw}},xw={next(){return{done:!0,value:void 0}}};var PH=B(2,(X,Q)=>({[Symbol.iterator](){let Y=X[Symbol.iterator](),J=0;return{next(){let $=Y.next();while(!$.done){if(Q($.value,J++))return{done:!1,value:$.value};$=Y.next()}return{done:!0,value:void 0}}}}}));var yw=()=>({}),v3=(X)=>Object.keys(X).length===0;var P5=B(2,(X,Q)=>{let Y={...X};for(let J of NH(X))Y[J]=Q(X[J],J);return Y});var RH=B(2,(X,Q)=>{let Y=yw();for(let J of NH(X))if(Q(X[J],J))Y[J]=X[J];return Y});var NH=(X)=>Object.keys(X);var R5=globalThis.Array;var k3=(X)=>new R5(X);var Z1=(X)=>R5.isArray(X)?X:R5.from(X),MH=(X)=>R5.isArray(X)?X:[X];var Y7=B(2,(X,Q)=>[...X,Q]),bw=B(2,(X,Q)=>Z1(X).concat(Z1(Q)));var ci=R5.isArray;var H8=S3,F6=S3;function gw(X,Q){return X<0||X>=Q.length}var hw=B(2,(X,Q)=>{let Y=Math.floor(Q);if(gw(Y,X))throw Error(`Index out of bounds: ${Y}`);return X[Y]});var mw=hw(0);var pw=(X)=>X.slice(1);var k9=B(2,(X,Q)=>{let Y=R5.from(X);return Y.sort(Q),Y});var dw=B(3,(X,Q,Y)=>{let J=Z1(X),$=Z1(Q);if(F6(J)){if(F6($))return h3(Y)(bw(J,$));return J}return $}),y3=B(2,(X,Q)=>dw(X,Q,bQ()));var b3=()=>[];var E4=B(2,(X,Q)=>X.map(Q));var AH=(X)=>{let Q=[];for(let Y of X)if(B1(Y))Q.push(Y.value);return Q};var g3=B(2,(X,Q)=>{let Y=[],J=[],$=0;for(let G of X){let Z=Q(G,$++);if(A1(Z))J.push(Z.success);else Y.push(Z.failure)}return[Y,J]});var h3=B(2,(X,Q)=>{let Y=Z1(X);if(F6(Y)){let J=[mw(Y)],$=pw(Y);for(let G of $)if(J.every((Z)=>!Q(G,Z)))J.push(G);return J}return[]});var cw=o8((X,Q)=>X.concat(Q),[]);function wH(){return cw}var J7="~effect/time/Duration",fw=BigInt(0);var IH=BigInt(1000),uw=BigInt(1e6);var lw=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,S1=(X)=>{switch(typeof X){case"number":return S4(X);case"bigint":return a8(X);case"string":{if(X==="Infinity")return i8;if(X==="-Infinity")return L6;let Q=lw.exec(X);if(!Q)break;let[Y,J,$]=Q,G=Number(J);switch($){case"nano":case"nanos":return a8(BigInt(J));case"micro":case"micros":return iw(BigInt(J));case"milli":case"millis":return S4(G);case"second":case"seconds":return aw(G);case"minute":case"minutes":return sw(G);case"hour":case"hours":return tw(G);case"day":case"days":return ew(G);case"week":case"weeks":return XC(G)}break}case"object":{if(X===null)break;if(J7 in X)return X;if(Array.isArray(X)){if(X.length!==2||!X.every(N9))return CH(X);if(Number.isNaN(X[0])||Number.isNaN(X[1]))return N5;if(X[0]===-1/0||X[1]===-1/0)return L6;if(X[0]===1/0||X[1]===1/0)return i8;return K1(BigInt(Math.round(X[0]*1e9))+BigInt(Math.round(X[1])))}let Q=X,Y=0;if(Q.weeks)Y+=Q.weeks*604800000;if(Q.days)Y+=Q.days*86400000;if(Q.hours)Y+=Q.hours*3600000;if(Q.minutes)Y+=Q.minutes*60000;if(Q.seconds)Y+=Q.seconds*1000;if(Q.milliseconds)Y+=Q.milliseconds;if(!Q.microseconds&&!Q.nanoseconds)return K1(Y);let J=BigInt(Y)*uw;if(Q.microseconds)J+=BigInt(Q.microseconds)*IH;if(Q.nanoseconds)J+=BigInt(Q.nanoseconds);return K1(J)}}return CH(X)},CH=(X)=>{throw Error(`Invalid Input: ${X}`)},jH=U6(S1),TH={_tag:"Millis",millis:0},rw={_tag:"Infinity"},ow={_tag:"NegativeInfinity"},nw={[J7]:J7,[W0](){return D3(this.value)},[H0](X){return p3(X)&&YC(this,X)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[a0](){return this.toJSON()},pipe(){return a(this,arguments)}},K1=(X)=>{let Q=Object.create(nw);if(typeof X==="number")if(isNaN(X)||X===0||Object.is(X,-0))Q.value=TH;else if(!Number.isFinite(X))Q.value=X>0?rw:ow;else if(!Number.isInteger(X))Q.value={_tag:"Nanos",nanos:BigInt(Math.round(X*1e6))};else Q.value={_tag:"Millis",millis:X};else if(X===fw)Q.value=TH;else Q.value={_tag:"Nanos",nanos:X};return Q},p3=(X)=>M(X,J7);var N5=K1(0),i8=K1(1/0),L6=K1(-1/0),a8=(X)=>K1(X),iw=(X)=>K1(X*IH),S4=(X)=>K1(X),aw=(X)=>K1(X*1000),sw=(X)=>K1(X*60000),tw=(X)=>K1(X*3600000),ew=(X)=>K1(X*86400000),XC=(X)=>K1(X*604800000),v4=(X)=>QC(S1(X),{onMillis:b,onNanos:(Q)=>Number(Q)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var m3=(X)=>{let Q=S1(X);switch(Q.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return Q.value.nanos;case"Millis":return BigInt(Math.round(Q.value.millis*1e6))}},EH=U6(m3);var QC=B(2,(X,Q)=>{switch(X.value._tag){case"Millis":return Q.onMillis(X.value.millis);case"Nanos":return Q.onNanos(X.value.nanos);case"Infinity":return Q.onInfinity();case"NegativeInfinity":return(Q.onNegativeInfinity??Q.onInfinity)()}}),SH=B(3,(X,Q,Y)=>{if(X.value._tag==="Infinity"||X.value._tag==="NegativeInfinity"||Q.value._tag==="Infinity"||Q.value._tag==="NegativeInfinity")return Y.onInfinity(X,Q);if(X.value._tag==="Millis")return Q.value._tag==="Millis"?Y.onMillis(X.value.millis,Q.value.millis):Y.onNanos(m3(X),Q.value.nanos);else return Y.onNanos(X.value.nanos,m3(Q))});var d3=(X,Q)=>SH(X,Q,{onMillis:(Y,J)=>Y===J,onNanos:(Y,J)=>Y===J,onInfinity:(Y,J)=>Y.value._tag===J.value._tag});var vH=B(2,(X,Q)=>SH(X,Q,{onMillis:(Y,J)=>K1(Y-J),onNanos:(Y,J)=>K1(Y-J),onInfinity:(Y,J)=>{let $=Y.value._tag,G=J.value._tag;if($==="Infinity")return G==="Infinity"?N5:i8;if($==="NegativeInfinity")return G==="NegativeInfinity"?N5:L6;return G==="Infinity"?L6:i8}}));var YC=B(2,(X,Q)=>d3(X,Q));var A5=B(2,(X,Q)=>(Y)=>{let J=X(Y);if(u(J))return f(Y);let $=Q(J.success);if(u($))return f(Y);return $}),xH=(X)=>(Q)=>{let Y=X(Q);return u(Y)?x():F(Y.success)};var y9=_0("effect/Scheduler",{defaultValue:()=>new w5}),yH="setImmediate"in globalThis?(X)=>{let Q=globalThis.setImmediate(X);return()=>globalThis.clearImmediate(Q)}:(X)=>{let Q=setTimeout(X,0);return()=>clearTimeout(Q)};class bH{buckets=[];scheduleTask(X,Q){let Y=this.buckets,J=Y.length,$,G=0;for(;G<J;G++){if(Y[G][0]>Q)break;$=Y[G]}if($&&$[0]===Q)$[1].push(X);else if(G===J)Y.push([Q,[X]]);else Y.splice(G,0,[Q,[X]])}drain(){let X=this.buckets;return this.buckets=[],X}}class w5{executionMode;setImmediate;constructor(X="async",Q=yH){this.executionMode=X,this.setImmediate=Q}shouldYield(X){return X.currentOpCount>=X.maxOpsBeforeYield}makeDispatcher(){return new gH(this.setImmediate)}}class gH{tasks=new bH;running=void 0;setImmediate;constructor(X=yH){this.setImmediate=X}scheduleTask(X,Q){if(this.tasks.scheduleTask(X,Q),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let X=this.tasks.drain();for(let Q=0;Q<X.length;Q++){let Y=X[Q][1];for(let J=0;J<Y.length;J++)Y[J]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var hH=_0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),mH=_0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var c3="effect/Tracer/ParentSpan";class $7 extends l1()(c3){}var JC=(X)=>X;var G7=_0("effect/Tracer/DisablePropagation",{defaultValue:IQ}),cH=_0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),fH=_0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),f3="effect/Tracer",Z7=_0(f3,{defaultValue:()=>JC({span:(X)=>new uH(X)})});class uH{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(X){this.name=X.name,this.parent=X.parent,this.annotations=X.annotations,this.links=X.links,this.startTime=X.startTime,this.kind=X.kind,this.sampled=X.sampled,this.status={_tag:"Started",startTime:X.startTime},this.attributes=new Map,this.traceId=B6(X.parent)?.traceId??dH(32),this.spanId=dH(16)}end(X,Q){this.status={_tag:"Ended",endTime:X,exit:Q,startTime:this.status.startTime}}attribute(X,Q){this.attributes.set(X,Q)}event(X,Q,Y){this.events.push([X,Q,Y??{}])}addLinks(X){this.links.push(...X)}}var dH=function(){return function(Y){let J="";for(let $=0;$<Y;$++)J+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return J}}();var lH="effect/observability/Metric/FiberRuntimeMetricsKey";var K7=_0("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),rH=_0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),b9=_0("effect/References/CurrentStackFrame",{defaultValue:A8}),W7=_0("effect/References/TracerEnabled",{defaultValue:R4}),g9=_0("effect/References/TracerTimingEnabled",{defaultValue:R4}),h9=_0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),m9=_0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),s8=_0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),u3=_0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),l3=_0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var H7=_0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var V7=(X)=>{if(X?.captureStackTrace===!1)return X;else if(X?.captureStackTrace!==void 0&&typeof X.captureStackTrace!=="boolean")return X;let Q=Error.stackTraceLimit;Error.stackTraceLimit=3;let Y=Error();return Error.stackTraceLimit=Q,{...X,captureStackTrace:KC(()=>Y.stack)}},r3=(X)=>(Q)=>{let Y;return()=>{if(Y!==void 0)return Y;let J=Q();if(!J)return;let $=J.split(`
13
- `);if($[X]!==void 0)return Y=$[X].trim(),Y}},KC=r3(3);var oH="dev";class XJ extends T9{fiberId;constructor(X,Q=I9){super("Interrupt",Q,"Interrupted");this.fiberId=X}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[H0](X){return D6(X)&&this.fiberId===X.fiberId&&this.annotations===X.annotations}[W0](){return f0(C0(`${this._tag}:${this.fiberId}`))(SQ(this.annotations))}}var QV=(X)=>new XJ(X),j5=(X)=>new u8([new XJ(X)]),QJ=(X)=>X.reasons.some(w4),YJ=(X)=>{let Q=X.reasons.find(w4);return Q?l(Q):f(X)},i1=(X)=>{for(let Q=0;Q<X.reasons.length;Q++){let Y=X.reasons[Q];if(Y._tag==="Fail")return l(Y.error)}return f(X)},YV=xH(i1),q7=(X)=>X.reasons.some(q6),JV=(X)=>{let Q=X.reasons.find(q6);return Q?l(Q):f(X)},o9=(X)=>{let Q=X.reasons.find(q6);return Q?l(Q.defect):f(X)},D7=(X)=>X.reasons.some(D6),$V=(X)=>{let Q=X.reasons.find(D6);return Q?l(Q):f(X)},B7=(X)=>{let Q;for(let Y=0;Y<X.reasons.length;Y++){let J=X.reasons[Y];if(J._tag!=="Interrupt")continue;if(Q??=new Set,J.fiberId!==void 0)Q.add(J.fiberId)}return Q?l(Q):f(X)},GV=(X)=>{let Q=B7(X);return u(Q)?WC:Q.success},WC=new Set,ZV=(X)=>X.reasons.length>0&&X.reasons.every(D6),KV=(X)=>j4(X.annotations),WV=(X)=>{let Q=new Map;for(let Y of X.reasons)if(Y.annotations.size>0)for(let[J,$]of Y.annotations)Q.set(J,$);return j4(Q)},JJ=B(2,(X,Q)=>{if(X.reasons.length===0)return Q;else if(Q.reasons.length===0)return X;let Y=new u8(y3(X.reasons,Q.reasons));return o(X,Y)?X:Y}),HV=B(2,(X,Q)=>{let Y=!1,J=X.reasons.map(($)=>{if(w4($))return Y=!0,new D5(Q($.error));return $});return Y?l8(J):X}),HC=(X)=>{let Q={Fail:[],Die:[],Interrupt:[]};for(let Y=0;Y<X.reasons.length;Y++)Q[X.reasons[Y]._tag].push(X.reasons[Y]);return Q},U7=(X)=>{let Q=HC(X);if(Q.Fail.length>0)return Q.Fail[0].error;else if(Q.Die.length>0)return Q.Die[0].defect;else if(Q.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},$J=(X)=>{let Q=[],Y=[];if(X.reasons.length===0)return Q;let J=Error.stackTraceLimit;Error.stackTraceLimit=1;for(let $ of X.reasons){if($._tag==="Interrupt"){Y.push($);continue}Q.push(o3($._tag==="Die"?$.defect:$.error,$.annotations))}if(Q.length===0){let $=Error("The fiber was interrupted by:");$.name="InterruptCause",$.stack=DC($,Y);let G=new globalThis.Error("All fibers interrupted without error",{cause:$});G.name="InterruptError",G.stack=`${G.name}: ${G.message}`,Q.push(o3(G,Y[0].annotations))}return Error.stackTraceLimit=J,Q},o3=(X,Q)=>{let Y=typeof X,J;if(X&&Y==="object"){if(J=new globalThis.Error(VC(X),{cause:X.cause?o3(X.cause):void 0}),typeof X.name==="string")J.name=X.name;if(typeof X.stack==="string")J.stack=qC(X.stack,J,Q);else{let $=`${J.name}: ${J.message}`;J.stack=Q?VV($,Q):$}for(let $ of Object.keys(X))if(!($ in J))J[$]=X[$]}else J=new globalThis.Error(!X?`Unknown error: ${X}`:Y==="string"?X:w9(X));return J},VC=(X)=>{if(typeof X.message==="string")return X.message;else if(typeof X.toString==="function"&&X.toString!==Object.prototype.toString&&X.toString!==Array.prototype.toString)try{return X.toString()}catch{}return w9(X)},_C=/\((.*)\)/g,qC=(X,Q,Y)=>{let J=`${Q.name}: ${Q.message}`,$=(X.startsWith(J)?X.slice(J.length):X).split(`
14
- `),G=[J];for(let Z=1;Z<$.length;Z++){if(/(?:Generator\.next|~effect\/Effect)/.test($[Z]))break;G.push($[Z])}return Y?VV(G.join(`
9
+ ${G(_)}}`;return Z(H,q)}return String(H)}return W(Q,0)}var MW="[Circular]";function R4(Q){return typeof Q==="string"?JSON.stringify(Q):String(Q)}function vX(Q){return Q.map((X)=>`[${R4(X)}]`).join("")}function H3(Q){try{return Q.toISOString()}catch{return"Invalid Date"}}function Uw(Q){try{let X=Q.toString();return typeof X==="string"?X:String(X)}catch{return"[toString threw]"}}function V6(Q,X){let Y=[];return JSON.stringify(Q,function(J,$){let G=w9($);if(typeof G!=="object"||G===null)return G;while(Y.length>0&&Y[Y.length-1]!==this)Y.pop();if(Y.includes(G))return;return Y.push(G),G},X?.space)}var n0=Symbol.for("nodejs.util.inspect.custom"),K1=(Q)=>{try{if(N(Q,"toJSON")&&Y8(Q.toJSON)&&Q.toJSON.length===0)return Q.toJSON();else if(Array.isArray(Q))return Q.map(K1)}catch{return"[toJSON threw]"}return w9(Q)},AW=(Q,X=2)=>{if(typeof Q==="string")return Q;try{return typeof Q==="object"?V6(Q,{space:X}):String(Q)}catch{return String(Q)}},xi={toJSON(){return K1(this)},[n0](){return this.toJSON()},toString(){return v(this.toJSON())}};class N4{called=!1;self;constructor(Q){this.self=Q}next(Q){return this.called?{value:Q,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new N4(this.self)}}var K5="~effect/Utils/internal",wW={[K5]:(Q)=>{return Q()}},zw={[K5]:(Q)=>{try{return Q()}finally{}}},Fw=wW[K5](()=>Error().stack)?.includes(K5)===!0,J0=Fw?wW[K5]:zw[K5];var M8="~effect/Effect",_6="~effect/Exit",Lw={_A:g,_E:g,_R:g},TW=`${M8}/identifier`,e=`${M8}/args`,x0=`${M8}/evaluate`,M1=`${M8}/successCont`,J8=`${M8}/failureCont`,M4=`${M8}/ensureCont`,A4=Symbol.for("effect/Effect/Yield"),c8={pipe(){return X0(this,arguments)},toJSON(){return{...this}},toString(){return v(this.toJSON(),{ignoreToString:!0,space:2})},[n0](){return this.toJSON()}},IW={[K0](){return J3(this,Object.keys(this))},[W0](Q){let X=Object.keys(this),Y=Object.keys(Q);if(X.length!==Y.length)return!1;for(let J=0;J<X.length;J++)if(X[J]!==Y[J]&&!n(this[X[J]],Q[X[J]]))return!1;return!0}},Pw={[M8]:Lw,...c8,[Symbol.iterator](){return new N4(this)},toJSON(){return{_id:"Effect",op:this[TW],...e in this?{args:this[e]}:void 0}}},d=(Q)=>N(Q,M8),V3=(Q)=>N(Q,_6),W5="~effect/Cause",H5="~effect/Cause/Reason",V5=(Q)=>N(Q,W5),jW=(Q)=>N(Q,H5);class f8{[W5];reasons;constructor(Q){this[W5]=W5,this.reasons=Q}pipe(){return X0(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map((Q)=>Q.toJSON())}}toString(){return`Cause(${v(this.reasons)})`}[n0](){return this.toJSON()}[W0](Q){return V5(Q)&&this.reasons.length===Q.reasons.length&&this.reasons.every((X,Y)=>n(X,Q.reasons[Y]))}[K0](){return A9(this.reasons)}}var CW=new WeakMap;class T9{[H5];annotations;_tag;constructor(Q,X,Y){if(this[H5]=H5,this._tag=Q,X!==I9&&typeof Y==="object"&&Y!==null&&X.size>0){let J=CW.get(Y);if(J)X=new Map([...J,...X]);CW.set(Y,X)}this.annotations=X}annotate(Q,X){if(Q.mapUnsafe.size===0)return this;let Y=new Map(this.annotations);Q.mapUnsafe.forEach(($,G)=>{if(X?.overwrite!==!0&&Y.has(G))return;Y.set(G,$)});let J=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return J.annotations=Y,J}pipe(){return X0(this,arguments)}toString(){return v(this)}[n0](){return this.toString()}}var I9=new Map;class _5 extends T9{error;constructor(Q,X=I9){super("Fail",X,Q);this.error=Q}toString(){return`Fail(${v(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[W0](Q){return w4(Q)&&n(this.error,Q.error)&&n(this.annotations,Q.annotations)}[K0](){return u0(T0(this._tag))(u0(t(this.error))(t(this.annotations)))}}var u8=(Q)=>new f8(Q),kX=new f8([]),_3=(Q)=>new f8([new _5(Q)]);class yX extends T9{defect;constructor(Q,X=I9){super("Die",X,Q);this.defect=Q}toString(){return`Die(${v(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[W0](Q){return D6(Q)&&n(this.defect,Q.defect)&&n(this.annotations,Q.annotations)}[K0](){return u0(T0(this._tag))(u0(t(this.defect))(t(this.annotations)))}}var q3=(Q)=>new f8([new yX(Q)]),q5=B((Q)=>V5(Q[0]),(Q,X,Y)=>{if(X.mapUnsafe.size===0)return Q;return new f8(Q.reasons.map((J)=>J.annotate(X,Y)))}),w4=(Q)=>Q._tag==="Fail",D6=(Q)=>Q._tag==="Die",B6=(Q)=>Q._tag==="Interrupt";function Rw(Q){return w8("Effect.evaluate: Not implemented")}var l8=(Q)=>({...Pw,[TW]:Q.op,[x0]:Q[x0]??Rw,[M1]:Q[M1],[J8]:Q[J8],[M4]:Q[M4]}),u1=(Q)=>{let X=l8(Q);return function(){let Y=Object.create(X);return Y[e]=Q.single===!1?arguments:arguments[0],Y}},EW=(Q)=>{let X={...l8(Q),[_6]:_6,_tag:Q.op,get[Q.prop](){return this[e]},toString(){return`${Q.op}(${v(this[e])})`},toJSON(){return{_id:"Exit",_tag:Q.op,[Q.prop]:this[e]}},[W0](Y){return V3(Y)&&Y._tag===this._tag&&n(this[e],Y[e])},[K0](){return u0(T0(Q.op),t(this[e]))}};return function(Y){let J=Object.create(X);return J[e]=Y,J}},c0=EW({op:"Success",prop:"value",[x0](Q){let X=Q.getCont(M1);return X?X[M1](this[e],Q,this):Q.yieldWith(this)}}),j9={key:"effect/Cause/StackTrace"},SW={key:"effect/Cause/InterruptorStackTrace"},A1=EW({op:"Failure",prop:"cause",[x0](Q){let X=this[e],Y=!1;if(Q.currentStackFrame)X=q5(X,{mapUnsafe:new Map([[j9.key,Q.currentStackFrame]])}),Y=!0;let J=Q.getCont(J8);while(Q.interruptible&&Q._interruptedCause&&J)J=Q.getCont(J8);return J?J[J8](X,Q,Y?void 0:this):Q.yieldWith(Y?this:A1(X))}}),A8=(Q)=>A1(_3(Q)),w8=(Q)=>A1(q3(Q)),c=u1({op:"WithFiber",[x0](Q){return this[e](Q)}}),Nw=function(){class Q extends globalThis.Error{}let X=l8({op:"YieldableError",[x0](){return A8(this)}});return delete X.toString,Object.assign(Q.prototype,X),Q}(),bX=function(){let Q=Symbol.for("effect/Data/Error/plainArgs");return class extends Nw{constructor(Y){super(Y?.message,Y?.cause?{cause:Y.cause}:void 0);if(Y)Object.assign(this,Y),Object.defineProperty(this,Q,{value:Y,enumerable:!1})}toJSON(){return{...this[Q],...this}}}}(),r8=(Q)=>{class X extends bX{_tag=Q}return X.prototype.name=Q,X},C9="~effect/Cause/NoSuchElementError",gX=(Q)=>N(Q,C9);class C8 extends r8("NoSuchElementError"){[C9]=C9;constructor(Q){super({message:Q})}}var q6="~effect/Cause/Done",E9=(Q)=>N(Q,q6),xW={[q6]:q6,_tag:"Done",value:void 0},D3=(Q)=>{if(Q===void 0)return xW;return{[q6]:q6,_tag:"Done",value:Q}},Mw=A8(xW),vW=(Q)=>{if(Q===void 0)return Mw;return A8(D3(Q))};var kW=(Q)=>l8({op:Q.label,[x0]:Q.evaluate});function yW(Q){return{combine:Q}}function o8(Q,X,Y){return{combine:Q,initialValue:X,combineAll:Y??((J)=>{let $=X;for(let G of J)$=Q($,G);return $})}}var i0=(Q)=>(X,Y)=>X===Y||Q(X,Y);function bW(Q){return i0((X,Y)=>{if(X.length!==Y.length)return!1;for(let J=0;J<X.length;J++)if(!Q(X[J],Y[J]))return!1;return!0})}var gW=(Q)=>B(3,(X,Y,J)=>Q(X,($)=>({...$,[Y]:J($)}))),hW=(Q)=>B(2,(X,Y)=>Q(X,(J)=>({[Y]:J}))),mW=(Q,X)=>B(3,(Y,J,$)=>X(Y,(G)=>Q($(G),(Z)=>({...G,[J]:Z}))));var dW="~effect/data/Option",pW={[dW]:{_A:(Q)=>Q},...c8,[Symbol.iterator](){return new N4(this)}},cW=Object.assign(Object.create(pW),{_tag:"Some",_op:"Some",[W0](Q){return mX(Q)&&U3(Q)&&n(this.value,Q.value)},[K0](){return u0(t(this._tag))(t(this.value))},toString(){return`some(${v(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:K1(this.value)}}});Object.defineProperty(cW,"valueOrUndefined",{get(){return this.value}});var Tw=t("None"),Iw=Object.assign(Object.create(pW),{_tag:"None",_op:"None",valueOrUndefined:void 0,[W0](Q){return mX(Q)&&B3(Q)},[K0](){return Tw},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}}}),mX=(Q)=>N(Q,dW),B3=(Q)=>Q._tag==="None",U3=(Q)=>Q._tag==="Some",fW=Object.create(Iw),uW=(Q)=>{let X=Object.create(cW);return X.value=Q,X};var lW="~effect/data/Result",rW={[lW]:{_A:(Q)=>Q,_E:(Q)=>Q},...c8,[Symbol.iterator](){return new N4(this)}},Ew=Object.assign(Object.create(rW),{_tag:"Success",_op:"Success",[W0](Q){return dX(Q)&&z3(Q)&&n(this.success,Q.success)},[K0](){return u0(t(this._tag))(t(this.success))},toString(){return`success(${v(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:K1(this.success)}}}),Sw=Object.assign(Object.create(rW),{_tag:"Failure",_op:"Failure",[W0](Q){return dX(Q)&&O3(Q)&&n(this.failure,Q.failure)},[K0](){return u0(t(this._tag))(t(this.failure))},toString(){return`failure(${v(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:K1(this.failure)}}}),dX=(Q)=>N(Q,lW),O3=(Q)=>Q._tag==="Failure",z3=(Q)=>Q._tag==="Success",oW=(Q)=>{let X=Object.create(Sw);return X.failure=Q,X},nW=(Q)=>{let X=Object.create(Ew);return X.success=Q,X};function S9(Q){return(X,Y)=>X===Y?0:Q(X,Y)}var U1=S9((Q,X)=>{if(globalThis.Number.isNaN(Q)&&globalThis.Number.isNaN(X))return 0;if(globalThis.Number.isNaN(Q))return-1;if(globalThis.Number.isNaN(X))return 1;return Q<X?-1:1});var T8=S9((Q,X)=>Q<X?-1:1);var F3=B(2,(Q,X)=>S9((Y,J)=>Q(X(Y),X(J)))),D5=F3(U1,(Q)=>Q.getTime());var pX=(Q)=>B(2,(X,Y)=>Q(X,Y)===-1),B5=(Q)=>B(2,(X,Y)=>Q(X,Y)===1),cX=(Q)=>B(2,(X,Y)=>Q(X,Y)!==1),fX=(Q)=>B(2,(X,Y)=>Q(X,Y)!==-1);var b=()=>fW,F=uW,iW=mX,I0=B3,O1=U3,E1=B(2,(Q,{onNone:X,onSome:Y})=>I0(Q)?X():Y(Q.value));var lX=B(2,(Q,X)=>I0(Q)?X():Q.value);var aW=(Q)=>Q==null?b():F(Q),sW=(Q)=>Q===void 0?b():F(Q),tW=(Q)=>Q===null?b():F(Q);var L3=lX(i2),U6=lX(N8),O6=(Q)=>(...X)=>{try{return F(Q(...X))}catch{return b()}};var I4=B(2,(Q,X)=>I0(Q)?b():F(X(Q.value)));var vw=B(2,(Q,X)=>I0(Q)?b():X(Q.value));var U5=vw(g);var O5=B(2,(Q,X)=>I0(Q)?b():X(Q.value)?F(Q.value):b()),eW=(Q)=>i0((X,Y)=>I0(X)?I0(Y):I0(Y)?!1:Q(X.value,Y.value));var QH="~effect/Context/Service",l1=function(){let Q=Error.stackTraceLimit;Error.stackTraceLimit=2;let X=Error();Error.stackTraceLimit=Q;function Y(){}let J=Y;if(Object.setPrototypeOf(J,kw),Object.defineProperty(J,"stack",{get(){return X.stack}}),arguments.length>0){if(J.key=arguments[0],arguments[1]?.defaultValue)J[rX]=rX,J.defaultValue=arguments[1].defaultValue;return J}return function($,G){if(J.key=$,G?.make)J.make=G.make;return J}},kw={[QH]:QH,...kW({label:"Service",evaluate(Q){return c0(S1(Q.context,this))}}),toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},of(Q){return Q},context(Q){return oX(this,Q)},use(Q){return c((X)=>Q(S1(X.context,this)))},useSync(Q){return c((X)=>c0(Q(S1(X.context,this))))}},rX="~effect/Context/Reference",XH="~effect/Context",j4=(Q)=>{let X=Object.create(yw);return X.mapUnsafe=Q,X.mutable=!1,X},yw={...c8,[XH]:{_Services:(Q)=>Q},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([Q,X])=>({key:Q,value:X}))}},[W0](Q){if(!R3(Q)||this.mapUnsafe.size!==Q.mapUnsafe.size)return!1;for(let X of this.mapUnsafe.keys())if(!Q.mapUnsafe.has(X)||!n(this.mapUnsafe.get(X),Q.mapUnsafe.get(X)))return!1;return!0},[K0](){return p8(this.mapUnsafe.size)}},R3=(Q)=>N(Q,XH);var YH=(Q)=>N(Q,rX),$8=()=>bw,bw=j4(new Map),oX=(Q,X)=>j4(new Map([[Q.key,X]])),G8=B(3,(Q,X,Y)=>KH(Q,(J)=>{J.set(X.key,Y)}));var JH=B(3,(Q,X,Y)=>{if(Q.mapUnsafe.has(X.key))return Q.mapUnsafe.get(X.key);return YH(X)?nX(X):Y()});var z6=B(2,(Q,X)=>{if(!Q.mapUnsafe.has(X.key)){if(rX in X)return nX(X);throw gw(X)}return Q.mapUnsafe.get(X.key)}),S1=z6,$H=(Q,X)=>{if(!Q.mapUnsafe.has(X.key))return nX(X);return Q.mapUnsafe.get(X.key)},P3="~effect/Context/defaultValue",nX=(Q)=>{if(P3 in Q)return Q[P3];return Q[P3]=Q.defaultValue()},gw=(Q)=>{let X=Error(`Service not found${Q.key?`: ${String(Q.key)}`:""}`);if(Q.stack){let Y=Q.stack.split(`
10
+ `);if(Y.length>2){let J=Y[2].match(/at (.*)/);if(J)X.message=X.message+` (defined at ${J[1]})`}}if(X.stack){let Y=X.stack.split(`
11
+ `);Y.splice(1,3),X.stack=Y.join(`
12
+ `)}return X},GH=B(2,(Q,X)=>{if(Q.mapUnsafe.has(X.key))return F(Q.mapUnsafe.get(X.key));return YH(X)?F(nX(X)):b()}),iX=B(2,(Q,X)=>{if(Q.mapUnsafe.size===0)return X;if(X.mapUnsafe.size===0)return Q;return KH(Q,(Y)=>{X.mapUnsafe.forEach((J,$)=>Y.set($,J))})}),ZH=(...Q)=>{let X=new Map;for(let Y=0;Y<Q.length;Y++)Q[Y].mapUnsafe.forEach((J,$)=>{X.set($,J)});return j4(X)};var KH=(Q,X)=>{if(Q.mutable)return X(Q.mapUnsafe),Q;let Y=new Map(Q.mapUnsafe);return X(Y),j4(Y)},_0=l1;var N3=(Q)=>Q.length>0;var l=nW,f=oW;var WH=dX,u=O3,w1=z3;var HH=(Q,X)=>i0((Y,J)=>u(Y)?u(J)&&X(Y.failure,J.failure):w1(J)&&Q(Y.success,J.success));var z5=B(2,(Q,X)=>u(Q)?f(X(Q.failure)):l(Q.success)),F6=B(2,(Q,X)=>w1(Q)?l(X(Q.success)):f(Q.failure)),o1=B(2,(Q,{onFailure:X,onSuccess:Y})=>u(Q)?X(Q.failure):Y(Q.success));var x9=B(2,(Q,X)=>u(Q)?X(Q.failure):Q.success);var aX=B(2,(Q,X)=>u(Q)?f(Q.failure):X(Q.success));var Wa={[Symbol.iterator](){return mw}},mw={next(){return{done:!0,value:void 0}}};var VH=B(2,(Q,X)=>({[Symbol.iterator](){let Y=Q[Symbol.iterator](),J=0;return{next(){let $=Y.next();while(!$.done){if(X($.value,J++))return{done:!1,value:$.value};$=Y.next()}return{done:!0,value:void 0}}}}}));var pw=()=>({}),M3=(Q)=>Object.keys(Q).length===0;var F5=B(2,(Q,X)=>{let Y={...Q};for(let J of qH(Q))Y[J]=X(Q[J],J);return Y});var _H=B(2,(Q,X)=>{let Y=pw();for(let J of qH(Q))if(X(Q[J],J))Y[J]=Q[J];return Y});var qH=(Q)=>Object.keys(Q);var L5=globalThis.Array;var w3=(Q)=>new L5(Q);var W1=(Q)=>L5.isArray(Q)?Q:L5.from(Q),DH=(Q)=>L5.isArray(Q)?Q:[Q];var sX=B(2,(Q,X)=>[...Q,X]),cw=B(2,(Q,X)=>W1(Q).concat(W1(X)));var qa=L5.isArray;var K8=N3,L6=N3;function fw(Q,X){return Q<0||Q>=X.length}var uw=B(2,(Q,X)=>{let Y=Math.floor(X);if(fw(Y,Q))throw Error(`Index out of bounds: ${Y}`);return Q[Y]});var lw=uw(0);var rw=(Q)=>Q.slice(1);var v9=B(2,(Q,X)=>{let Y=L5.from(Q);return Y.sort(X),Y});var ow=B(3,(Q,X,Y)=>{let J=W1(Q),$=W1(X);if(L6(J)){if(L6($))return j3(Y)(cw(J,$));return J}return $}),C3=B(2,(Q,X)=>ow(Q,X,SX()));var T3=()=>[];var E4=B(2,(Q,X)=>Q.map(X));var BH=(Q)=>{let X=[];for(let Y of Q)if(O1(Y))X.push(Y.value);return X};var I3=B(2,(Q,X)=>{let Y=[],J=[],$=0;for(let G of Q){let Z=X(G,$++);if(w1(Z))J.push(Z.success);else Y.push(Z.failure)}return[Y,J]});var j3=B(2,(Q,X)=>{let Y=W1(Q);if(L6(Y)){let J=[lw(Y)],$=rw(Y);for(let G of $)if(J.every((Z)=>!X(G,Z)))J.push(G);return J}return[]});var nw=o8((Q,X)=>Q.concat(X),[]);function UH(){return nw}var tX="~effect/time/Duration",iw=BigInt(0);var FH=BigInt(1000),aw=BigInt(1e6);var sw=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,x1=(Q)=>{switch(typeof Q){case"number":return S4(Q);case"bigint":return a8(Q);case"string":{if(Q==="Infinity")return i8;if(Q==="-Infinity")return P6;let X=sw.exec(Q);if(!X)break;let[Y,J,$]=X,G=Number(J);switch($){case"nano":case"nanos":return a8(BigInt(J));case"micro":case"micros":return XC(BigInt(J));case"milli":case"millis":return S4(G);case"second":case"seconds":return YC(G);case"minute":case"minutes":return JC(G);case"hour":case"hours":return $C(G);case"day":case"days":return GC(G);case"week":case"weeks":return ZC(G)}break}case"object":{if(Q===null)break;if(tX in Q)return Q;if(Array.isArray(Q)){if(Q.length!==2||!Q.every(M9))return OH(Q);if(Number.isNaN(Q[0])||Number.isNaN(Q[1]))return P5;if(Q[0]===-1/0||Q[1]===-1/0)return P6;if(Q[0]===1/0||Q[1]===1/0)return i8;return H1(BigInt(Math.round(Q[0]*1e9))+BigInt(Math.round(Q[1])))}let X=Q,Y=0;if(X.weeks)Y+=X.weeks*604800000;if(X.days)Y+=X.days*86400000;if(X.hours)Y+=X.hours*3600000;if(X.minutes)Y+=X.minutes*60000;if(X.seconds)Y+=X.seconds*1000;if(X.milliseconds)Y+=X.milliseconds;if(!X.microseconds&&!X.nanoseconds)return H1(Y);let J=BigInt(Y)*aw;if(X.microseconds)J+=BigInt(X.microseconds)*FH;if(X.nanoseconds)J+=BigInt(X.nanoseconds);return H1(J)}}return OH(Q)},OH=(Q)=>{throw Error(`Invalid Input: ${Q}`)},LH=O6(x1),zH={_tag:"Millis",millis:0},tw={_tag:"Infinity"},ew={_tag:"NegativeInfinity"},QC={[tX]:tX,[K0](){return $3(this.value)},[W0](Q){return S3(Q)&&WC(this,Q)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},H1=(Q)=>{let X=Object.create(QC);if(typeof Q==="number")if(isNaN(Q)||Q===0||Object.is(Q,-0))X.value=zH;else if(!Number.isFinite(Q))X.value=Q>0?tw:ew;else if(!Number.isInteger(Q))X.value={_tag:"Nanos",nanos:BigInt(Math.round(Q*1e6))};else X.value={_tag:"Millis",millis:Q};else if(Q===iw)X.value=zH;else X.value={_tag:"Nanos",nanos:Q};return X},S3=(Q)=>N(Q,tX);var P5=H1(0),i8=H1(1/0),P6=H1(-1/0),a8=(Q)=>H1(Q),XC=(Q)=>H1(Q*FH),S4=(Q)=>H1(Q),YC=(Q)=>H1(Q*1000),JC=(Q)=>H1(Q*60000),$C=(Q)=>H1(Q*3600000),GC=(Q)=>H1(Q*86400000),ZC=(Q)=>H1(Q*604800000),x4=(Q)=>KC(x1(Q),{onMillis:g,onNanos:(X)=>Number(X)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0});var E3=(Q)=>{let X=x1(Q);switch(X.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return X.value.nanos;case"Millis":return BigInt(Math.round(X.value.millis*1e6))}},PH=O6(E3);var KC=B(2,(Q,X)=>{switch(Q.value._tag){case"Millis":return X.onMillis(Q.value.millis);case"Nanos":return X.onNanos(Q.value.nanos);case"Infinity":return X.onInfinity();case"NegativeInfinity":return(X.onNegativeInfinity??X.onInfinity)()}}),RH=B(3,(Q,X,Y)=>{if(Q.value._tag==="Infinity"||Q.value._tag==="NegativeInfinity"||X.value._tag==="Infinity"||X.value._tag==="NegativeInfinity")return Y.onInfinity(Q,X);if(Q.value._tag==="Millis")return X.value._tag==="Millis"?Y.onMillis(Q.value.millis,X.value.millis):Y.onNanos(E3(Q),X.value.nanos);else return Y.onNanos(Q.value.nanos,E3(X))});var x3=(Q,X)=>RH(Q,X,{onMillis:(Y,J)=>Y===J,onNanos:(Y,J)=>Y===J,onInfinity:(Y,J)=>Y.value._tag===J.value._tag});var NH=B(2,(Q,X)=>RH(Q,X,{onMillis:(Y,J)=>H1(Y-J),onNanos:(Y,J)=>H1(Y-J),onInfinity:(Y,J)=>{let $=Y.value._tag,G=J.value._tag;if($==="Infinity")return G==="Infinity"?P5:i8;if($==="NegativeInfinity")return G==="NegativeInfinity"?P5:P6;return G==="Infinity"?P6:i8}}));var WC=B(2,(Q,X)=>x3(Q,X));var N5=B(2,(Q,X)=>(Y)=>{let J=Q(Y);if(u(J))return f(Y);let $=X(J.success);if(u($))return f(Y);return $}),MH=(Q)=>(X)=>{let Y=Q(X);return u(Y)?b():F(Y.success)};var k9=_0("effect/Scheduler",{defaultValue:()=>new M5}),wH="setImmediate"in globalThis?(Q)=>{let X=globalThis.setImmediate(Q);return()=>globalThis.clearImmediate(X)}:(Q)=>{let X=setTimeout(Q,0);return()=>clearTimeout(X)};class CH{buckets=[];scheduleTask(Q,X){let Y=this.buckets,J=Y.length,$,G=0;for(;G<J;G++){if(Y[G][0]>X)break;$=Y[G]}if($&&$[0]===X)$[1].push(Q);else if(G===J)Y.push([X,[Q]]);else Y.splice(G,0,[X,[Q]])}drain(){let Q=this.buckets;return this.buckets=[],Q}}class M5{executionMode;setImmediate;constructor(Q="async",X=wH){this.executionMode=Q,this.setImmediate=X}shouldYield(Q){return Q.currentOpCount>=Q.maxOpsBeforeYield}makeDispatcher(){return new TH(this.setImmediate)}}class TH{tasks=new CH;running=void 0;setImmediate;constructor(Q=wH){this.setImmediate=Q}scheduleTask(Q,X){if(this.tasks.scheduleTask(Q,X),this.running===void 0)this.running=this.setImmediate(this.afterScheduled)}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let Q=this.tasks.drain();for(let X=0;X<Q.length;X++){let Y=Q[X][1];for(let J=0;J<Y.length;J++)Y[J]()}}flush(){while(this.tasks.buckets.length>0){if(this.running!==void 0)this.running(),this.running=void 0;this.runTasks()}}}var IH=_0("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),jH=_0("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1});var v3="effect/Tracer/ParentSpan";class eX extends l1()(v3){}var HC=(Q)=>Q;var Q7=_0("effect/Tracer/DisablePropagation",{defaultValue:MX}),xH=_0("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),vH=_0("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),k3="effect/Tracer",X7=_0(k3,{defaultValue:()=>HC({span:(Q)=>new kH(Q)})});class kH{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(Q){this.name=Q.name,this.parent=Q.parent,this.annotations=Q.annotations,this.links=Q.links,this.startTime=Q.startTime,this.kind=Q.kind,this.sampled=Q.sampled,this.status={_tag:"Started",startTime:Q.startTime},this.attributes=new Map,this.traceId=U6(Q.parent)?.traceId??SH(32),this.spanId=SH(16)}end(Q,X){this.status={_tag:"Ended",endTime:Q,exit:X,startTime:this.status.startTime}}attribute(Q,X){this.attributes.set(Q,X)}event(Q,X,Y){this.events.push([Q,X,Y??{}])}addLinks(Q){this.links.push(...Q)}}var SH=function(){return function(Y){let J="";for(let $=0;$<Y;$++)J+="abcdef0123456789".charAt(Math.floor(Math.random()*16));return J}}();var yH="effect/observability/Metric/FiberRuntimeMetricsKey";var Y7=_0("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),bH=_0("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),y9=_0("effect/References/CurrentStackFrame",{defaultValue:N8}),J7=_0("effect/References/TracerEnabled",{defaultValue:P4}),b9=_0("effect/References/TracerTimingEnabled",{defaultValue:P4}),g9=_0("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),h9=_0("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),s8=_0("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),y3=_0("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),b3=_0("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"});var $7=_0("effect/References/CurrentLogSpans",{defaultValue:()=>[]});var G7=(Q)=>{if(Q?.captureStackTrace===!1)return Q;else if(Q?.captureStackTrace!==void 0&&typeof Q.captureStackTrace!=="boolean")return Q;let X=Error.stackTraceLimit;Error.stackTraceLimit=3;let Y=Error();return Error.stackTraceLimit=X,{...Q,captureStackTrace:DC(()=>Y.stack)}},g3=(Q)=>(X)=>{let Y;return()=>{if(Y!==void 0)return Y;let J=X();if(!J)return;let $=J.split(`
13
+ `);if($[Q]!==void 0)return Y=$[Q].trim(),Y}},DC=g3(3);var gH="dev";class l3 extends T9{fiberId;constructor(Q,X=I9){super("Interrupt",X,"Interrupted");this.fiberId=Q}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[W0](Q){return B6(Q)&&this.fiberId===Q.fiberId&&this.annotations===Q.annotations}[K0](){return u0(T0(`${this._tag}:${this.fiberId}`))(CX(this.annotations))}}var lH=(Q)=>new l3(Q),T5=(Q)=>new f8([new l3(Q)]),r3=(Q)=>Q.reasons.some(w4),o3=(Q)=>{let X=Q.reasons.find(w4);return X?l(X):f(Q)},a1=(Q)=>{for(let X=0;X<Q.reasons.length;X++){let Y=Q.reasons[X];if(Y._tag==="Fail")return l(Y.error)}return f(Q)},rH=MH(a1),K7=(Q)=>Q.reasons.some(D6),oH=(Q)=>{let X=Q.reasons.find(D6);return X?l(X):f(Q)},r9=(Q)=>{let X=Q.reasons.find(D6);return X?l(X.defect):f(Q)},W7=(Q)=>Q.reasons.some(B6),nH=(Q)=>{let X=Q.reasons.find(B6);return X?l(X):f(Q)},H7=(Q)=>{let X;for(let Y=0;Y<Q.reasons.length;Y++){let J=Q.reasons[Y];if(J._tag!=="Interrupt")continue;if(X??=new Set,J.fiberId!==void 0)X.add(J.fiberId)}return X?l(X):f(Q)},iH=(Q)=>{let X=H7(Q);return u(X)?BC:X.success},BC=new Set,aH=(Q)=>Q.reasons.length>0&&Q.reasons.every(B6),sH=(Q)=>j4(Q.annotations),tH=(Q)=>{let X=new Map;for(let Y of Q.reasons)if(Y.annotations.size>0)for(let[J,$]of Y.annotations)X.set(J,$);return j4(X)},n3=B(2,(Q,X)=>{if(Q.reasons.length===0)return X;else if(X.reasons.length===0)return Q;let Y=new f8(C3(Q.reasons,X.reasons));return n(Q,Y)?Q:Y}),eH=B(2,(Q,X)=>{let Y=!1,J=Q.reasons.map(($)=>{if(w4($))return Y=!0,new _5(X($.error));return $});return Y?u8(J):Q}),UC=(Q)=>{let X={Fail:[],Die:[],Interrupt:[]};for(let Y=0;Y<Q.reasons.length;Y++)X[Q.reasons[Y]._tag].push(Q.reasons[Y]);return X},V7=(Q)=>{let X=UC(Q);if(X.Fail.length>0)return X.Fail[0].error;else if(X.Die.length>0)return X.Die[0].defect;else if(X.Interrupt.length>0)return new globalThis.Error("All fibers interrupted without error");return new globalThis.Error("Empty cause")},i3=(Q)=>{let X=[],Y=[];if(Q.reasons.length===0)return X;let J=Error.stackTraceLimit;Error.stackTraceLimit=1;for(let $ of Q.reasons){if($._tag==="Interrupt"){Y.push($);continue}X.push(h3($._tag==="Die"?$.defect:$.error,$.annotations))}if(X.length===0){let $=Error("The fiber was interrupted by:");$.name="InterruptCause",$.stack=LC($,Y);let G=new globalThis.Error("All fibers interrupted without error",{cause:$});G.name="InterruptError",G.stack=`${G.name}: ${G.message}`,X.push(h3(G,Y[0].annotations))}return Error.stackTraceLimit=J,X},h3=(Q,X)=>{let Y=typeof Q,J;if(Q&&Y==="object"){if(J=new globalThis.Error(OC(Q),{cause:Q.cause?h3(Q.cause):void 0}),typeof Q.name==="string")J.name=Q.name;if(typeof Q.stack==="string")J.stack=FC(Q.stack,J,X);else{let $=`${J.name}: ${J.message}`;J.stack=X?QV($,X):$}for(let $ of Object.keys(Q))if(!($ in J))J[$]=Q[$]}else J=new globalThis.Error(!Q?`Unknown error: ${Q}`:Y==="string"?Q:V6(Q));return J},OC=(Q)=>{if(typeof Q.message==="string")return Q.message;else if(typeof Q.toString==="function"&&Q.toString!==Object.prototype.toString&&Q.toString!==Array.prototype.toString)try{return Q.toString()}catch{}return V6(Q)},zC=/\((.*)\)/g,FC=(Q,X,Y)=>{let J=`${X.name}: ${X.message}`,$=(Q.startsWith(J)?Q.slice(J.length):Q).split(`
14
+ `),G=[J];for(let Z=1;Z<$.length;Z++){if(/(?:Generator\.next|~effect\/Effect)/.test($[Z]))break;G.push($[Z])}return Y?QV(G.join(`
15
15
  `),Y):G.join(`
16
- `)},VV=(X,Q)=>{let Y=Q?.get(j9.key);if(Y)X=`${X}
17
- ${_V(Y)}`;return X},DC=(X,Q)=>{let Y=[`${X.name}: ${X.message}`];for(let J of Q){let $=J.fiberId!==void 0?`#${J.fiberId}`:"unknown",G=J.annotations.get(cW.key);if(Y.push(` at fiber (${$})`),G)Y.push(_V(G))}return Y.join(`
18
- `)},_V=(X)=>{let Q=[],Y=X,J=0;while(Y&&J<10){let $=Y.stack();if($){let G=$.matchAll(_C),Z=!1;for(let[,K]of G)Z=!0,Q.push(` at ${Y.name} (${K})`);if(!Z)Q.push(` at ${Y.name} (${$.replace(/^at /,"")})`)}else Q.push(` at ${Y.name}`);Y=Y.parent,J++}return Q.join(`
19
- `)},O7=(X)=>$J(X).map((Q)=>Q.cause?`${Q.stack} {
20
- ${qV(Q.cause," ")}
21
- }`:Q.stack).join(`
22
- `),qV=(X,Q)=>{let Y=X.stack.split(`
23
- `),J=`${Q}[cause]: ${Y[0]}`;for(let $=1,G=Y.length;$<G;$++)J+=`
24
- ${Q}${Y[$]}`;if(X.cause)J+=` {
25
- ${qV(X.cause,`${Q} `)}
26
- ${Q}}`;return J},n3=`~effect/Fiber/${oH}`,BC={_A:b,_E:b},UC={id:0},z7=()=>globalThis[W5];class GJ{constructor(X,Q=!0){this[n3]=BC,this.setContext(X),this.id=++UC.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=Q,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this.runtimeMetrics?.recordFiberStart(this.context)}[n3];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(X){return BH(this.context,X)}addObserver(X){if(this._exit)return X(this._exit),Z5;return this._observers.push(X),()=>{let Q=this._observers.indexOf(X);if(Q>=0)this._observers.splice(Q,1)}}interruptUnsafe(X,Q){if(this._exit)return;let Y=j5(X);if(this.currentStackFrame)Y=B5(Y,tQ(j9,this.currentStackFrame));if(Q)Y=B5(Y,Q);if(this._interruptedCause=this._interruptedCause?JJ(this._interruptedCause,Y):Y,this.interruptible)this.evaluate(N0(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(X){if(this._exit)return;else if(this._yielded!==void 0){let J=this._yielded;this._yielded=void 0,J()}let Q=this.runLoop(X);if(Q===A4)return;let Y=i3.interruptChildren&&i3.interruptChildren(this);if(Y!==void 0)return this.evaluate(C(Y,()=>Q));this._exit=Q,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let J=0;J<this._observers.length;J++)this._observers[J](Q);this._observers.length=0}runLoop(X){let Q=globalThis[W5];globalThis[W5]=this;let Y=!1,J=X;this.currentOpCount=0;let $=++this.currentLoopCount;try{while(!0){if(this.currentOpCount++,!Y&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){Y=!0;let G=J;J=C(E5,()=>G)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[u0](this),$!==this.currentLoopCount)return A4;else if(J===A4){let G=this._yielded;if(H6 in G)return this._yielded=void 0,G;return A4}}}catch(G){if(!M(J,u0))return C8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(C8(G))}finally{globalThis[W5]=Q}}getCont(X){while(!0){let Q=this._stack.pop();if(!Q)return;let Y=Q[M4]&&Q[M4](this);if(Y)return Y[X]=Y,Y;if(Q[X])return Q}}yieldWith(X){return this._yielded=X,A4}children(){return this._children??=new Set}pipe(){return a(this,arguments)}setContext(X){this.context=X;let Q=this.getRef(y9);if(Q!==this.currentScheduler)this.currentScheduler=Q,this._dispatcher=void 0;this.currentSpan=X.mapUnsafe.get(c3),this.currentLogLevel=this.getRef(u3),this.minimumLogLevel=this.getRef(l3),this.currentStackFrame=X.mapUnsafe.get(b9.key),this.maxOpsBeforeYield=this.getRef(hH),this.currentPreventYield=this.getRef(mH),this.runtimeMetrics=X.mapUnsafe.get(lH);let Y=X.mapUnsafe.get(f3);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var i3={interruptChildren:void 0},F7=(X)=>{if(!X.currentStackFrame)return;let Q=new Map;return Q.set(j9.key,X.currentStackFrame),j4(Q)},OC=(X)=>{if(X._children===void 0||X._children.size===0)return;return C5(X._children)},zC=(X)=>{let Q=X;if(Q._exit)return A(Q._exit);return w1((Y)=>{if(Q._exit)return Y(A(Q._exit));return $0(X.addObserver((J)=>Y(A(J))))})},ZJ=(X)=>w1((Q)=>{let Y=X[Symbol.iterator](),J=[],$=void 0;function G(){let Z=Y.next();while(!Z.done){if(Z.value._exit){J.push(Z.value._exit),Z=Y.next();continue}$=Z.value.addObserver((K)=>{J.push(K),G()});return}Q(A(J))}return G(),$0(()=>$?.())});var FC=(X)=>c((Q)=>LC(X,Q.id)),LC=B((X)=>M(X[0],n3),(X,Q,Y)=>c((J)=>{let $=F7(J);return $=$&&Y?X7($,Y):$??Y,X.interruptUnsafe(Q,$),i9(zC(X))})),C5=(X)=>c((Q)=>{let Y=F7(Q);for(let J of X)J.interruptUnsafe(Q.id,Y);return i9(ZJ(X))});var A=j0,N0=N1,M0=M1,$0=u1({op:"Sync",[u0](X){let Q=this[t](),Y=X.getCont(R1);return Y?Y[R1](Q,X):X.yieldWith(j0(Q))}}),i=u1({op:"Suspend",[u0](X){return this[t]()}}),n9=(X)=>X.asEffect(),DV=n9,BV=n9,UV=(X)=>X==null?M0(new $8):A(X),KJ=u1({op:"Yield",[u0](X){let Q=!1;return X.currentDispatcher.scheduleTask(()=>{if(Q)return;X.evaluate(n1)},this[t]??0),X.yieldWith(()=>{Q=!0})}}),E5=KJ(0),WJ=(X)=>A(F(X)),L7=A(x()),OV=(X)=>i(()=>N0(J0(X))),R6=(X)=>C8(X),P7=(X)=>i(()=>M0(J0(X))),X0=A(void 0);var zV=(X)=>i(()=>{try{return A(J0(X.try))}catch(Q){return M0(J0(()=>X.catch(Q)))}});var HJ=(X)=>VJ(function(Q,Y){J0(()=>X(Y)).then((J)=>Q(A(J)),(J)=>Q(R6(J)))},X.length!==0),FV=(X)=>{let Q=typeof X==="function"?X:X.try,Y=typeof X==="function"?(J)=>new g7(J,"An error occurred in Effect.tryPromise"):X.catch;return VJ(function(J,$){try{J0(()=>Q($)).then((G)=>J(A(G)),(G)=>J(M0(J0(()=>Y(G)))))}catch(G){J(M0(J0(()=>Y(G))))}},eval.length!==0)},LV=(X)=>c((Q)=>X(Q.id)),PV=c(A),RV=LV(A),VJ=u1({op:"Async",single:!1,[u0](X){let Q=J0(()=>this[t][0].bind(X.currentScheduler)),Y=!1,J=!1,$=this[t][1]?new AbortController:void 0,G=Q((Z)=>{if(Y)return;if(Y=!0,J)X.evaluate(Z);else J=Z},$?.signal);if(J!==!1)return J;if(J=!0,X._yielded=()=>{Y=!0},$===void 0&&G===void 0)return A4;return X._stack.push(PC(()=>{return Y=!0,$?.abort(),G??n1})),A4}}),PC=u1({op:"AsyncFinalizer",[M4](X){if(X.interruptible)X.interruptible=!1,X._stack.push(S7)},[J8](X,Q){return D7(X)?C(this[t](),()=>N0(X)):N0(X)}}),w1=(X)=>VJ(X,X.length>=2),_J=w1(Z5),NV=(...X)=>i(()=>T5(X.length===1?X[0]():X[1].call(X[0].self))),qJ=(X,...Q)=>{let Y=Q.length===0?function(){return i(()=>T5(X.apply(this,arguments)))}:function(){let J=i(()=>T5(X.apply(this,arguments)));for(let $=0;$<Q.length;$++)J=Q[$](J,...arguments);return J};return DJ(X.length,Y)},DJ=(X,Q)=>Object.defineProperty(Q,"length",{value:X,configurable:!0}),nH=r3(2),MV=function(){let X=typeof arguments[0]==="string",Q=X?arguments[0]:"Effect.fn",Y=X?arguments[1]:void 0,J=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let $=new globalThis.Error;if(globalThis.Error.stackTraceLimit=J,X)return(G,...Z)=>iH(Q,G,$,Z,X,Y);return iH(Q,arguments[0],$,Array.prototype.slice.call(arguments,1),X,Y)},iH=(X,Q,Y,J,$,G)=>{let Z=typeof Q==="function"?Q:J.pop().bind(Q.self);return DJ(Z.length,function(...K){let W=i(()=>{let V=Z.apply(this,arguments);return d(V)?V:T5(V)});for(let V=0;V<J.length;V++)W=J[V](W,...K);if(!d(W))return W;let H=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let _=new globalThis.Error;return globalThis.Error.stackTraceLimit=H,e8($?d9(X,G,(V)=>e3(W,V)):W,b9,(V)=>({name:X,stack:nH(()=>_.stack),parent:{name:`${X} (definition)`,stack:nH(()=>Y.stack),parent:V}}))})},AV=(X,...Q)=>DJ(X.length,Q.length===0?function(){return aH(()=>X.apply(this,arguments))}:function(){let Y=aH(()=>X.apply(this,arguments));for(let J of Q)Y=J(Y);return Y}),aH=(X)=>{try{let Q=X(),Y=void 0;while(!0){let J=Q.next(Y);if(J.done)return A(J.value);let G=J.value.asEffect(),Z=G;if(Z&&Z._tag==="Success"){Y=Z.value;continue}else if(Z&&Z._tag==="Failure")return G;else{let K=!0;return i(()=>{if(K)return K=!1,C(G,(W)=>T5(Q,W));else return i(()=>T5(X()))})}}}catch(Q){return R6(Q)}},T5=u1({op:"Iterator",single:!1,[R1](X,Q){let Y=this[t][0];while(!0){let J=Y.next(X);if(J.done)return A(J.value);let $=J.value.asEffect();if(!W1($))return Q._stack.push(this),$;else if($._tag==="Failure")return $;X=$.value}},[u0](X){return this[R1](this[t][1],X)}}),v1=B(2,(X,Q)=>{let Y=A(Q);return C(X,(J)=>Y)}),R7=(X)=>L0(X,F),wV=(X)=>M6(X,{onFailure:A,onSuccess:M0}),t8=B(2,(X,Q)=>C(X,(Y)=>d(Q)?Q:J0(()=>Q(Y)))),N6=B(2,(X,Q)=>C(X,(Y)=>v1(d(Q)?Q:J0(()=>Q(Y)),Y))),i9=(X)=>C(X,(Q)=>n1),CV=(X)=>a1(X,M0),BJ=(X,Q)=>c((Y)=>w1((J)=>{let $=Z1(X),G=$.length,Z=0,K=!1,W=new Set,H=[],_=(V,q,D)=>{if(Z++,V._tag==="Failure"){if(H.push(...V.cause.reasons),Z>=G)J(N0(l8(H)));return}let U=!K;if(K=!0,J(W.size===0?V:C(A6(C5(W)),()=>V)),U&&Q?.onWinner)Q.onWinner({fiber:q,index:D,parentFiber:Y})};for(let V=0;V<G;V++){let q=w6(Y,$[V],!0,!0,!1);if(W.add(q),q.addObserver((D)=>{W.delete(q),_(D,q,V)}),K)break}return C5(W)})),UJ=(X,Q)=>c((Y)=>w1((J)=>{let $=!1,G=new Set,Z=(W)=>{$=!0,J(G.size===0?W:C(A6(C5(G)),()=>W))},K=0;for(let W of X){if($)break;let H=K++,_=w6(Y,W,!0,!0,!1);G.add(_),_.addObserver((V)=>{G.delete(_);let q=!$;if(Z(V),q&&Q?.onWinner)Q.onWinner({fiber:_,index:H,parentFiber:Y})})}return C5(G)})),TV=B((X)=>d(X[1]),(X,Q,Y)=>BJ([X,Q],Y)),N7=B((X)=>d(X[1]),(X,Q,Y)=>UJ([X,Q],Y)),C=B(2,(X,Q)=>{let Y=Object.create(RC);return Y[t]=X,Y[R1]=Q.length!==1?(J)=>Q(J):Q,Y}),RC=U5({op:"OnSuccess",[u0](X){return X._stack.push(this),this[t]}}),IV=B(2,(X,Q)=>{if(W1(X))return X._tag==="Success"?Q.onSuccess(X.value):Q.onFailure(X.cause);return j8(X,Q)}),W1=(X)=>(H6 in X),jV=B(2,(X,Q)=>{if(W1(X))return X._tag==="Success"?Q(X.value):X;return C(X,Q)}),EV=(X)=>C(X,b),L0=B(2,(X,Q)=>C(X,(Y)=>A(J0(()=>Q(Y))))),SV=B(2,(X,Q)=>W1(X)?FJ(X,Q):L0(X,Q)),vV=B(2,(X,Q)=>W1(X)?LJ(X,Q):jJ(X,Q)),xV=B(2,(X,Q)=>W1(X)?PJ(X,Q):EJ(X,Q)),kV=B(2,(X,Q)=>{if(W1(X)){if(X._tag==="Success")return X;let Y=i1(X.cause);if(u(Y))return X;return Q(Y.success)}return x1(X,Q)}),yV=(X)=>N1(j5(X)),S5=(X)=>X._tag==="Success",bV=(X)=>X._tag==="Success"?l(X):f(X),gV=(X)=>X._tag==="Success"?l(X.value):f(X),OJ=(X)=>X._tag==="Failure",hV=(X)=>X._tag==="Failure"?l(X):f(X),a9=(X)=>X._tag==="Failure"?l(X.cause):f(X),zJ=A5(a9,i1),mV=A5(a9,o9),pV=(X)=>X._tag==="Failure"&&D7(X.cause),dV=(X)=>X._tag==="Failure"&&q7(X.cause),cV=(X)=>X._tag==="Failure"&&QJ(X.cause),n1=j0(void 0),FJ=B(2,(X,Q)=>X._tag==="Success"?j0(Q(X.value)):X),LJ=B(2,(X,Q)=>{if(X._tag==="Success")return X;let Y=i1(X.cause);if(u(Y))return X;return M1(Q(Y.success))}),PJ=B(2,(X,Q)=>{if(X._tag==="Success")return j0(Q.onSuccess(X.value));let Y=i1(X.cause);if(u(Y))return X;return M1(Q.onFailure(Y.success))}),NC=B(2,(X,Q)=>S5(X)?j0(Q):X);var fV=B(2,(X,Q)=>S5(X)?Q.onSuccess(X.value):Q.onFailure(X.cause)),uV=NC(void 0),RJ=(X)=>{let Q=[];for(let Y of X)if(Y._tag==="Failure")Q.push(...Y.cause.reasons);return Q.length===0?n1:N1(l8(Q))},lV=(X)=>S5(X)?F(X.value):x(),rV=(X)=>OJ(X)?F(X.cause):x(),oV=(X)=>{let Q=zJ(X);return u(Q)?x():F(Q.success)},nV=n9,iV=(X)=>c((Q)=>A(UH(Q.context,X))),MC=(X)=>c((Q)=>Q.context.mapUnsafe.has(X.key)?A(O6(Q.context,X)):M0(new $8)),s9=B(2,(X,Q)=>c((Y)=>{let J=Y.context,$=Q(J);if(J===$)return X;return Y.setContext($),x5(X,()=>{Y.setContext(J);return})})),e8=B(3,(X,Q,Y)=>s9(X,(J)=>{let $=O6(J,Q),G=Y($);if($===G)return J;return K8(J,Q,G)})),NJ=()=>AC,AC=c((X)=>A(X.context)),k4=(X)=>c((Q)=>X(Q.context)),X4=B(2,(X,Q)=>{if(W1(X))return X;return s9(X,X7(Q))}),U1=function(){if(arguments.length===1)return B(2,(X,Q)=>sH(X,arguments[0],Q));return B(3,(X,Q,Y)=>sH(X,Q,Y)).apply(this,arguments)},sH=(X,Q,Y)=>s9(X,(J)=>{if(J.mapUnsafe.get(Q.key)===Y)return J;return K8(J,Q,Y)}),M7=B(3,(X,Q,Y)=>C(Y,(J)=>U1(X,Q,J))),aV=U1(K7),MJ=B((X)=>d(X[1]),(X,Q,Y)=>AJ(X,Q,(J,$)=>[J,$],Y)),AJ=B((X)=>d(X[1]),(X,Q,Y,J)=>J?.concurrent?L0(v7([X,Q],{concurrency:2}),([$,G])=>J0(()=>Y($,G))):C(X,($)=>L0(Q,(G)=>J0(()=>Y($,G))))),sV=B((X)=>d(X[0]),(X,Q,Y)=>rJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),tV=B(2,(X,Q)=>C(Q,(Y)=>Y?R7(X):L7)),wJ=B(2,(X,Q)=>Array.from({length:Q},()=>X)),eV=B((X)=>d(X[0]),(X,Q,Y)=>v7(wJ(X,Q),Y)),A7=B((X)=>d(X[0]),(X,Q)=>b4({while:R4,body:i0(Q?.disableYield?X:C(X,(Y)=>E5)),step:Z5})),a1=B(2,(X,Q)=>{let Y=Object.create(wC);return Y[t]=X,Y[J8]=Q.length!==1?(J)=>Q(J):Q,Y}),wC=U5({op:"OnFailure",[u0](X){return X._stack.push(this),this[t]}}),CJ=B(3,(X,Q,Y)=>a1(X,(J)=>{if(!Q(J))return N0(J);return J0(()=>Y(J))})),v5=B(3,(X,Q,Y)=>a1(X,(J)=>{let $=Q(J);return u($)?N0($.failure):J0(()=>Y($.success,J))})),x1=B(2,(X,Q)=>v5(X,i1,(Y)=>Q(Y))),X_=(X)=>M6(X,{onFailure:(Q)=>cQ(Q)?L7:M0(Q),onSuccess:WJ}),Q_=B(2,(X,Q)=>v5(X,o9,Q)),Y_=B(2,(X,Q)=>a1(X,(Y)=>t8(J0(()=>Q(Y)),N0(Y)))),J_=B(3,(X,Q,Y)=>CJ(X,Q,(J)=>t8(J0(()=>Y(J)),N0(J)))),w7=B(3,(X,Q,Y)=>a1(X,(J)=>{let $=Q(J);if(u($))return N0(J);return t8(J0(()=>Y($.success,J)),N0(J))})),TJ=B(2,(X,Q)=>w7(X,i1,(Y)=>Q(Y))),$_=B(3,(X,Q,Y)=>{let J=Array.isArray(Q)?($)=>M($,"_tag")&&Q.includes($._tag):Z6(Q);return TJ(X,($)=>J($)?Y($):X0)}),G_=B(2,(X,Q)=>w7(X,o9,(Y)=>Q(Y))),t9=B((X)=>d(X[0]),(X,Q,Y,J)=>a1(X,($)=>{let G=i1($);if(u(G))return N0(G.failure);if(!Q(G.success))return J?J0(()=>J(G.success)):N0($);return J0(()=>Y(G.success))})),C7=B((X)=>d(X[0]),(X,Q,Y,J)=>a1(X,($)=>{let G=i1($);if(u(G))return N0(G.failure);let Z=Q(G.success);if(u(Z))return J?J0(()=>J(Z.failure)):N0($);return J0(()=>Y(Z.success))})),IJ=B((X)=>d(X[0]),(X,Q,Y,J)=>{let $=Array.isArray(Q)?(G)=>M(G,"_tag")&&Q.includes(G._tag):Z6(Q);return t9(X,$,Y,J)}),Z_=B((X)=>d(X[0]),(X,Q,Y)=>{let J;return C7(X,($)=>{return J??=Object.keys(Q),M($,"_tag")&&Q8($._tag)&&J.includes($._tag)?l($):f($)},($)=>J0(()=>Q[$._tag]($)),Y)}),K_=B((X)=>d(X[0]),(X,Q,Y,J,$)=>t9(X,(G)=>Z6(G,Q)&&M(G,"reason"),(G)=>{let Z=G.reason;if(Z6(Z,Y))return J(Z,G);return $?J0(()=>$(Z,G)):M0(G)})),W_=B((X)=>d(X[0]),(X,Q,Y,J)=>{let $;return t9(X,(G)=>Z6(G,Q)&&M(G,"reason")&&M(G.reason,"_tag")&&Q8(G.reason._tag),(G)=>{let Z=G.reason;if($??=Object.keys(Y),$.includes(Z._tag))return J0(()=>Y[Z._tag](Z,G));return J?J0(()=>J(Z,G)):M0(G)})}),H_=B(2,(X,Q)=>C7(X,(Y)=>{if(Z6(Y,Q)&&M(Y,"reason"))return l(Y.reason);return f(Y)},M0));var jJ=B(2,(X,Q)=>x1(X,(Y)=>P7(()=>Q(Y)))),EJ=B(2,(X,Q)=>M6(X,{onFailure:(Y)=>P7(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),SJ=(X)=>x1(X,R6),V_=B(2,(X,Q)=>x1(X,(Y)=>$0(Q))),__=(X)=>i(()=>{let Q=X[Symbol.iterator](),Y=Q.next();if(Y.done)return R6(Error("Received an empty collection of effects"));function J($){let G=Q.next();if(G.done)return $.value;return x1($.value,(Z)=>J(G))}return J(Y)}),vJ=(X)=>x1(X,(Q)=>C(E5,()=>vJ(X))),q_=B((X)=>d(X[0]),(X,Q)=>{if(!Q?.log)return M6(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=V8(Q.log===!0?void 0:Q.log);return j8(X,{onFailure(J){let $=YJ(J);return u($)?N0($.failure):Q.message===void 0?Y(J):Y(Q.message,J)},onSuccess:(J)=>X0})}),D_=B((X)=>d(X[0]),(X,Q)=>{if(!Q?.log)return j8(X,{onFailure:(J)=>X0,onSuccess:(J)=>X0});let Y=V8(Q.log===!0?void 0:Q.log);return j8(X,{onFailure:(J)=>Q.message===void 0?Y(J):Y(Q.message,J),onSuccess:(J)=>X0})}),B_=(X)=>T7(X,{onFailure:x,onSuccess:F}),x4=(X)=>e9(X,{onFailure:f,onSuccess:l}),j8=B(2,(X,Q)=>{let Y=Object.create(CC);return Y[t]=X,Y[R1]=Q.onSuccess.length!==1?(J)=>Q.onSuccess(J):Q.onSuccess,Y[J8]=Q.onFailure.length!==1?(J)=>Q.onFailure(J):Q.onFailure,Y}),CC=U5({op:"OnSuccessAndFailure",[u0](X){return X._stack.push(this),this[t]}}),xJ=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),M6=B(2,(X,Q)=>j8(X,{onFailure:(Y)=>{let J=Y.reasons.find(w4);return J?J0(()=>Q.onFailure(J.error)):N0(Y)},onSuccess:Q.onSuccess})),T7=B(2,(X,Q)=>M6(X,{onFailure:(Y)=>$0(()=>Q.onFailure(Y)),onSuccess:(Y)=>$0(()=>Q.onSuccess(Y))})),e9=B(2,(X,Q)=>{if(W1(X)){if(X._tag==="Success")return j0(Q.onSuccess(X.value));let Y=i1(X.cause);if(u(Y))return X;return j0(Q.onFailure(Y.success))}return T7(X,Q)}),U_=B(2,(X,Q)=>{if(W1(X)){if(X._tag==="Success")return j0(Q.onSuccess(X.value));return j0(Q.onFailure(X.cause))}return xJ(X,Q)}),XX=(X)=>W1(X)?j0(X):TC(X),TC=u1({op:"Exit",[u0](X){return X._stack.push(this),this[t]},[R1](X,Q,Y){return A(Y??j0(X))},[J8](X,Q,Y){return A(Y??N1(X))}}),O_=e9({onFailure:()=>!0,onSuccess:()=>!1}),z_=e9({onFailure:()=>!1,onSuccess:()=>!0}),F_=B(2,(X,Q)=>t8(T6(Q),X)),kJ=B(2,(X,Q)=>N7(X,C(T6(Q.duration),Q.orElse))),L_=B(2,(X,Q)=>kJ(X,{duration:Q,orElse:()=>M0(new y7)})),P_=B(2,(X,Q)=>N7(R7(X),v1(T6(Q),x()))),R_=(X)=>C6((Q)=>{let Y=Q.currentTimeNanosUnsafe();return L0(X,(J)=>[a8(Q.currentTimeNanosUnsafe()-Y),J])}),a3="~effect/Scope",s3="~effect/Scope/Closeable",QX=l1("effect/Scope"),yJ=(X,Q)=>i(()=>I7(X,Q)??X0),I7=(X,Q)=>{if(X.state._tag==="Closed")return;let Y={_tag:"Closed",exit:Q};if(X.state._tag==="Empty"){X.state=Y;return}let{finalizers:J}=X.state;if(X.state=Y,J.size===0)return;else if(J.size===1)return J.values().next().value(Q);return IC(X,J,Q)},IC=qJ(function*(X,Q,Y){let J=[],$=[],G=Array.from(Q.values()),Z=z7();for(let K=G.length-1;K>=0;K--){let W=G[K];if(X.strategy==="sequential")J.push(yield*XX(W(Y)));else $.push(w6(Z,W(Y),!0,!0,"inherit"))}if($.length>0)J=yield*ZJ($);return yield*RJ(J)});var N_=(X,Q)=>{let Y=YX(Q);if(X.state._tag==="Closed")return Y.state=X.state,Y;let J={};return _7(X,J,($)=>yJ(Y,$)),_7(Y,J,($)=>$0(()=>M_(X,J))),Y},y4=(X,Q)=>{return i(()=>{if(X.state._tag==="Closed")return Q(X.state.exit);return _7(X,{},Q),X0})};var _7=(X,Q,Y)=>{if(X.state._tag==="Empty")X.state={_tag:"Open",finalizers:new Map([[Q,Y]])};else if(X.state._tag==="Open")X.state.finalizers.set(Q,Y)},M_=(X,Q)=>{if(X.state._tag==="Open")X.state.finalizers.delete(Q)},YX=(X="sequential")=>({[s3]:s3,[a3]:a3,strategy:X,state:jC}),jC={_tag:"Empty"};var JX=QX.asEffect();var bJ=(X)=>c((Q)=>{let Y=Q.context,J=YX();return Q.setContext(K8(Q.context,QX,J)),x5(X,($)=>{return Q.setContext(Y),I7(J,$)})});var j7=(X)=>i(()=>{let Q=YX();return O1(X(Q),(Y)=>i(()=>I7(Q,Y)??X0))}),E7=(X,Q,Y)=>k4((J)=>$X(($)=>C(JX,(G)=>N6(Y?.interruptible?$(X):X,(Z)=>y4(G,(K)=>X4(Q(Z,K),J)))))),gJ=(X)=>C(JX,(Q)=>k4((Y)=>y4(Q,(J)=>X4(X(J),Y)))),x5=u1({op:"OnExit",single:!1,[u0](X){return X._stack.push(this),this[t][0]},[M4](X){if(X.interruptible&&this[t][2]!==!0)X._stack.push(S7),X.interruptible=!1},[R1](X,Q,Y){Y??=j0(X);let J=this[t][1](Y);return J?C(J,($)=>Y):Y},[J8](X,Q,Y){Y??=N1(X);let J=this[t][1](Y);return J?C(J,($)=>Y):Y}}),O1=B(2,x5),A_=B(2,(X,Q)=>O1(X,(Y)=>Q)),hJ=B(3,(X,Q,Y)=>O1(X,(J)=>{if(!Q(J))return X0;return Y(J)})),mJ=B(3,(X,Q,Y)=>O1(X,(J)=>{let $=Q(J);return u($)?X0:Y($.success,J)})),pJ=B(2,(X,Q)=>mJ(X,a9,Q)),w_=B(3,(X,Q,Y)=>hJ(X,(J)=>{if(J._tag!=="Failure")return!1;return Q(J.cause)},(J)=>Y(J.cause))),dJ=B(3,(X,Q,Y)=>O1(X,(J)=>{if(J._tag!=="Failure")return X0;let $=Q(J.cause);return u($)?X0:Y($.success,J.cause)})),C_=B(2,(X,Q)=>dJ(B7,Q)(X)),T_=(X,Q,Y)=>$X((J)=>C(X,($)=>x5(J(Q($)),(G)=>Y($,G),!0))),I_=(X)=>E7(X,(Q)=>M(Q,Symbol.asyncDispose)?HJ(()=>Q[Symbol.asyncDispose]()):$0(()=>Q[Symbol.dispose]())),cJ=B(2,(X,Q)=>$0(()=>{let Y=v4(S1(Q)),J=Number.isFinite(Y),$=vC(!1),G=0,Z=!1,K,W=C($.await,()=>K);return[c((H)=>{let _=H.getRef(E8),V=J?_.currentTimeMillisUnsafe():0;if(Z||V<G)return K??W;return Z=!0,$.closeUnsafe(),K=void 0,O1(X,(q)=>$0(()=>{Z=!1,G=_.currentTimeMillisUnsafe()+Y,K=q,$.openUnsafe()}))}),$0(()=>{G=0,$.closeUnsafe(),K=void 0})]})),fJ=B(2,(X,Q)=>L0(cJ(X,Q),(Y)=>Y[0])),j_=(X)=>fJ(X,i8),E_=c((X)=>N0(j5(X.id))),A6=(X)=>c((Q)=>{if(!Q.interruptible)return X;return Q.interruptible=!1,Q._stack.push(S7),X}),S_=u1({op:"SetInterruptible",[M4](X){if(X.interruptible=this[t],X._interruptedCause&&X.interruptible)return()=>N0(X._interruptedCause)}}),S7=S_(!0),v_=S_(!1),uJ=(X)=>c((Q)=>{if(Q.interruptible)return X;if(Q.interruptible=!0,Q._stack.push(v_),Q._interruptedCause)return N0(Q._interruptedCause);return X}),$X=(X)=>c((Q)=>{if(!Q.interruptible)return X(b);return Q.interruptible=!1,Q._stack.push(S7),X(uJ)}),x_=(X)=>c((Q)=>{if(Q.interruptible)return X(b);return Q.interruptible=!0,Q._stack.push(v_),X(A6)}),k_=L0(E7($0(()=>new AbortController),(X)=>$0(()=>X.abort())),(X)=>X.signal),v7=(X,Q)=>{if(d8(X))return Q?.mode==="result"?o1(X,x4,Q):o1(X,b,Q);else if(Q?.discard)return Q.mode==="result"?o1(Object.values(X),x4,Q):o1(Object.values(X),b,Q);return i(()=>{let Y={};return v1(o1(Object.entries(X),([J,$])=>L0(Q?.mode==="result"?x4($):$,(G)=>{Y[J]=G}),{discard:!0,concurrency:Q?.concurrency}),Y)})},lJ=B((X)=>d8(X[0])&&!d(X[0]),(X,Q,Y)=>L0(o1(X,(J,$)=>x4(Q(J,$)),Y),(J)=>g3(J,b))),y_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q,Y)=>C(lJ(X,Q,{concurrency:Y?.concurrency}),([J,$])=>{if(H8(J))return M0(J);return Y?.discard?X0:A($)})),b_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return g_(Y,0,Q,J.value);return A(x())})),g_=(X,Q,Y,J)=>C(Y(J,Q),($)=>{if($)return A(F(J));let G=X.next();if(!G.done)return g_(X,Q+1,Y,G.value);return A(x())}),h_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q)=>i(()=>{let Y=X[Symbol.iterator](),J=Y.next();if(!J.done)return m_(Y,0,Q,J.value);return A(x())})),m_=(X,Q,Y,J)=>C(Y(J,Q),($)=>{if(A1($))return A(F($.success));let G=X.next();if(!G.done)return m_(X,Q+1,Y,G.value);return A(x())}),b4=u1({op:"While",[R1](X,Q){if(this[t].step(X),this[t].while())return Q._stack.push(this),this[t].body();return n1},[u0](X){if(this[t].while())return X._stack.push(this),this[t].body();return n1}}),o1=B((X)=>typeof X[1]==="function",(X,Q,Y)=>c((J)=>{let $=Y?.concurrency==="inherit"?J.getRef(K7):Y?.concurrency??1,G=$==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,$);if(G===1)return EC(X,Q,Y);let Z=Z1(X),K=Z.length;if(K===0)return Y?.discard?X0:A([]);let W=Y?.discard?void 0:Array(K),H=SC({f:Q,out:W},Z,{concurrency:G});return H?v1(H,W):A(W)})),EC=(X,Q,Y)=>i(()=>{let J=Y?.discard?void 0:[],$=X[Symbol.iterator](),G=$.next(),Z=0;return v1(b4({while:()=>!G.done,body:()=>Q(G.value,Z++),step:(K)=>{if(J)J.push(K);G=$.next()}}),J)}),p_=(X)=>{let{onItem:Q,step:Y}=X;return(J,$,G)=>{let Z=G?.start??0,K=G?.end??$.length,W=G?.concurrency??1,H=!1,_,V,q,D=!1,U,R,L=()=>{let N=!1;for(;!U&&Z<K;Z++){let P=$[Z],y=R??Q(J,P,Z);if(W1(y)){if(U=Y(J,P,y,Z),U)break}else if(W===1)return C(XX(y),(Y0)=>{return U=Y(J,P,Y0,Z),Z++,U??L()??X0});else if(!_)return w1((Y0)=>{_=z7(),R=y,q=Y0;let X8=L();if(X8)return Y0(X8);return i(()=>{return U=n1,D=!0,V?C5(V):X0})});else{R=void 0;let Y0=w6(_,y,!0,!0,"inherit");if(Y0._exit){if(U=Y(J,P,Y0._exit,Z),U)break;continue}if(V)V.add(Y0);else V=new Set([Y0]);let X8=Z;if(Y0.addObserver((G5)=>{if(V.delete(Y0),U){if(!D&&G5._tag==="Failure")for(let _1 of G5.cause.reasons)if(_1._tag==="Interrupt")continue;else if(U._tag==="Failure")U.cause.reasons.push(_1);else U=N1(l8([_1]))}else{let _1=Y(J,P,G5,X8);if(_1)U=_1._tag==="Failure"?N1(l8(_1.cause.reasons.slice())):_1,L()}if(N){let _1=L();if(_1)q(_1)}else if(H&&V.size===0)q(U??X0)}),V.size<W)continue;N=!0,Z++;return}}if(H=!0,U){if(V&&V.size>0){let P=F7(_);V.forEach((y)=>y.interruptUnsafe(_.id,P));return}if(q||U._tag==="Failure")return U}else if(q){if(!V)return n1;else if(V.size===0)q(X0)}};return L()}},GX=()=>p_,SC=p_({onItem(X,Q,Y){return X.f(Q,Y)},step(X,Q,Y,J){if(Y._tag==="Failure")return Y;else if(X.out)X.out[J]=Y.value}}),rJ=B(3,(X,Q,Y)=>C(X,(J)=>Q(J)?A(J):Y(J))),oJ=B(3,(X,Q,Y)=>C(X,(J)=>{let $=Q(J);return u($)?Y($.failure):A($.success)})),d_=B((X)=>d(X[0]),(X,Q,Y)=>oJ(X,Q,Y?(J)=>M0(Y(J)):()=>M0(new $8))),c_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q,Y)=>i(()=>{let J=[];return v1(o1(X,($,G)=>{let Z=Q($,G);if(typeof Z==="boolean"){if(Z)J.push($);return X0}return L0(Z,(K)=>{if(K)J.push($)})},{discard:!0,concurrency:Y?.concurrency}),J)})),f_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q)=>i(()=>{let Y=[];for(let J of X){let $=Q(J);if(A1($))Y.push($.success)}return A(Y)})),u_=B((X)=>d8(X[0])&&!d(X[0]),(X,Q,Y)=>i(()=>{let J=[];return v1(o1(X,($)=>L0(Q($),(G)=>{if(A1(G))J.push(G.success)}),{discard:!0,concurrency:Y?.concurrency}),J)})),l_=A({}),r_=nW(L0),o_=iW(L0,C),n_=oW(L0);var i_=B((X)=>d(X[0]),(X,Q)=>c((Y)=>{return aC(),A(w6(Y,X,Q?.startImmediately,!1,Q?.uninterruptible??!1))})),w6=(X,Q,Y=!1,J=!1,$=!1)=>{let G=$==="inherit"?X.interruptible:!$,Z=new GJ(X.context,G);if(Y)Z.evaluate(Q);else X.currentDispatcher.scheduleTask(()=>Z.evaluate(Q),0);if(!J&&!Z._exit)X.children().add(Z),Z.addObserver(()=>X._children.delete(Z));return Z},a_=B((X)=>d(X[0]),(X,Q)=>c((Y)=>A(w6(Y,X,Q?.startImmediately,!0,Q?.uninterruptible)))),s_=(X)=>c((Q)=>{let Y=Q._children&&Z1(Q._children);return O1(X,(J)=>{let $=Q._children;if($===void 0||$.size===0)return X0;else if(Y)$=PH($,(G)=>!Y.includes(G));return i9(ZJ($))})}),nJ=B((X)=>d(X[0]),(X,Q,Y)=>c((J)=>{let $=w6(J,X,Y?.startImmediately,!0,Y?.uninterruptible);if(!$._exit)if(Q.state._tag!=="Closed"){let G={};_7(Q,G,()=>LV((K)=>K===$.id?X0:FC($))),$.addObserver(()=>M_(Q,G))}else $.interruptUnsafe(J.id,F7(J));return A($)})),t_=B((X)=>d(X[0]),(X,Q)=>C(JX,(Y)=>nJ(X,Y,Q))),Q4=(X)=>(Q,Y)=>{let J=new GJ(Y?.scheduler?K8(X,y9,Y.scheduler):X,Y?.uninterruptible!==!0);if(J.evaluate(Q),J._exit)return J;if(Y?.signal)if(Y.signal.aborted)J.interruptUnsafe();else{let $=()=>J.interruptUnsafe();Y.signal.addEventListener("abort",$,{once:!0}),J.addObserver(()=>Y.signal.removeEventListener("abort",$))}if(Y?.onFiberStart)Y.onFiberStart(J);return J};var e_=Q4(Z8()),iJ=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);if(J?.onExit)$.addObserver(J.onExit);return(G)=>{return $.interruptUnsafe(G)}}},Xq=iJ(Z8()),x7=(X)=>{let Q=Q4(X);return(Y,J)=>{let $=Q(Y,J);return new Promise((G)=>{$.addObserver((Z)=>G(Z))})}},Qq=x7(Z8()),aJ=(X)=>{let Q=x7(X);return(Y,J)=>Q(Y,J).then(($)=>{if($._tag==="Failure")throw U7($.cause);return $.value})},Yq=aJ(Z8()),k7=(X)=>{let Q=Q4(X);return(Y)=>{if(W1(Y))return Y;let J=new w5("sync"),$=Q(Y,{scheduler:J});return $.currentDispatcher?.flush(),$._exit??C8(new b7($))}},Jq=k7(Z8()),sJ=(X)=>{let Q=k7(X);return(Y)=>{let J=Q(Y);if(J._tag==="Failure")throw U7(J.cause);return J.value}},$q=sJ(Z8()),tH=A(!0),eH=A(!1);class Gq{waiters=[];scheduled=!1;isOpen;constructor(X){this.isOpen=X}scheduleUnsafe(X){if(this.scheduled||this.waiters.length===0)return tH;return this.scheduled=!0,X.currentDispatcher.scheduleTask(this.flushWaiters,0),tH}flushWaiters=()=>{this.scheduled=!1;let X=this.waiters;this.waiters=[];for(let Q=0;Q<X.length;Q++)X[Q](n1)};open=c((X)=>{if(this.isOpen)return eH;return this.isOpen=!0,this.scheduleUnsafe(X)});release=c((X)=>this.isOpen?eH:this.scheduleUnsafe(X));openUnsafe(){if(this.isOpen)return!1;return this.isOpen=!0,this.flushWaiters(),!0}await=w1((X)=>{if(this.isOpen)return X(X0);return this.waiters.push(X),$0(()=>{let Q=this.waiters.indexOf(X);if(Q!==-1)this.waiters.splice(Q,1)})});closeUnsafe(){if(!this.isOpen)return!1;return this.isOpen=!1,!0}close=$0(()=>this.closeUnsafe());whenOpen=(X)=>C(this.await,()=>X)}var vC=(X)=>new Gq(X??!1);var Zq=c((X)=>A(X.getRef(Z7))),Kq=B(2,(X,Q)=>U1(X,Z7,Q)),Wq=U1(W7),Hq=U1(g9),t3=BigInt(0),xC={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:t3,endTime:t3,exit:n1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},kC=(X)=>Object.assign(Object.create(xC),X),Vq=(X)=>{if(!X)return x();return E1(X.annotations,G7)?X._tag==="Span"?Vq(B6(X.parent)):x():F(X)},tJ=(X,Q,Y)=>{let J=!X.getRef(W7)||Y?.annotations&&E1(Y.annotations,G7),$=Y?.parent!==void 0?F(Y.parent):Y?.root?x():Vq(X.currentSpan),G;if(J)G=kC({name:Q,parent:$,annotations:K8(Y?.annotations??Z8(),G7,!0)});else{let Z=X.getRef(Z7),K=X.getRef(E8),W=X.getRef(g9),H=X.getRef(h9),_=X.getRef(m9),V=Y?.level??X.getRef(cH),q=Y?.links!==void 0?[..._,...Y.links]:_.slice();G=Z.span({name:Q,parent:$,annotations:Y?.annotations??Z8(),links:q,startTime:W?K.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??T0($),sampled:Y?.sampled??(B1($)&&$.value.sampled===!1?!1:!Iq(X.getRef(fH),V))});for(let[D,U]of Object.entries(H))G.attribute(D,U);if(Y?.attributes!==void 0)for(let[D,U]of Object.entries(Y.attributes))G.attribute(D,U)}return G},_q=(X,Q)=>c((Y)=>A(tJ(Y,X,Q))),p9=(X,Q)=>A6(c((Y)=>{let J=O6(Y.context,QX),$=tJ(Y,X,Q??{}),G=Y.getRef(E8),Z=Y.getRef(g9);return v1(y4(J,(K)=>bC($,K,G,Z)),$)})),qq=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=V7(X?arguments[2]:arguments[1]);if(X){let J=arguments[0];return C(p9(Q,Y),($)=>I5(J,$,Y))}return(J)=>C(p9(Q,Y),($)=>I5(J,$,Y))},yC=(X,Q)=>{return Q=typeof Q==="function"?Q:A8,e8(b9,(Y)=>({name:X,stack:Q,parent:Y}))},Dq=h9.asEffect(),Bq=m9.asEffect(),Uq=B((X)=>d(X[0]),(X,Q,Y={})=>{let $=(Array.isArray(Q)?Q:[Q]).map((G)=>({span:G,attributes:Y}));return e8(X,m9,(G)=>[...G,...$])}),bC=(X,Q,Y,J)=>$0(()=>{if(X.status._tag==="Ended")return;X.end(J?Y.currentTimeNanosUnsafe():t3,Q)}),d9=(X,...Q)=>{let Y=Q.length===1?void 0:Q[0],J=Q[Q.length-1];return c(($)=>{let G=tJ($,X,Y),Z=$.getRef(E8);return O1(J0(()=>J(G)),(K)=>$0(()=>{if(G.status._tag==="Ended")return;G.end(Z.currentTimeNanosUnsafe(),K)}))})},e3=U1($7),I5=function(){let X=d(arguments[0]),Q=X?arguments[1]:arguments[0],Y=X?arguments[2]:arguments[1],J=b;if(Q._tag==="Span")Y=V7(Y),J=yC(Q.name,Y?.captureStackTrace);if(X)return e3(J(arguments[0]),Q);return($)=>e3(J($),Q)},Oq=function(){let X=typeof arguments[0]!=="string",Q=X?arguments[1]:arguments[0],Y=V7(arguments[2]);if(X){let G=arguments[0];return d9(Q,arguments[2],(Z)=>I5(G,Z,Y))}let J=typeof arguments[1]==="function"?arguments[1]:void 0,$=J?void 0:arguments[1];return(G,...Z)=>d9(Q,J?J(...Z):$,(K)=>I5(G,K,Y))},zq=B((X)=>d(X[0]),(X,...Q)=>e8(X,h9,(Y)=>{let J={...Y};if(Q.length===1)Object.assign(J,Q[0]);else J[Q[0]]=Q[1];return J})),Fq=(...X)=>c((Q)=>{let Y=Q.currentSpanLocal;if(Y)if(X.length===1)for(let[J,$]of Object.entries(X[0]))Y.attribute(J,$);else Y.attribute(X[0],X[1]);return X0}),Lq=c((X)=>{let Q=X.currentSpanLocal;return Q?A(Q):M0(new $8)}),Pq=MC($7),E8=_0("effect/Clock",{defaultValue:()=>new Rq}),gC=2147483647;class Rq{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=$0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return hC()}currentTimeNanos=$0(()=>this.currentTimeNanosUnsafe());sleep(X){let Q=v4(X);if(Q<=0)return E5;return w1((Y)=>{if(Q>gC)return;let J=setTimeout(()=>Y(X0),Q);return $0(()=>clearTimeout(J))})}}var XV=function(){let X=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*X;else if(typeof performance.timeOrigin==="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));let Q=BigInt(Date.now())*X-BigInt(Math.round(performance.now()*1e6));return()=>Q+BigInt(Math.round(performance.now()*1e6))}(),hC=function(){let X=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!X)return XV;let Q=XV()-X.bigint();return()=>Q+X.bigint()}(),C6=(X)=>c((Q)=>X(Q.getRef(E8))),T6=(X)=>C6((Q)=>Q.sleep(S1(X))),Nq=C6((X)=>X.currentTimeMillis);var c9="~effect/Cause/TimeoutError",Mq=(X)=>M(X,c9);class y7 extends r8("TimeoutError"){[c9]=c9;constructor(X){super({message:X})}}var f9="~effect/Cause/IllegalArgumentError",Aq=(X)=>M(X,f9);class eJ extends r8("IllegalArgumentError"){[f9]=f9;constructor(X){super({message:X})}}var u9="~effect/Cause/ExceededCapacityError",wq=(X)=>M(X,u9);class X$ extends r8("ExceededCapacityError"){[u9]=u9;constructor(X){super({message:X})}}var l9="~effect/Cause/AsyncFiberError",Cq=(X)=>M(X,l9);class b7 extends r8("AsyncFiberError"){[l9]=l9;constructor(X){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:X})}}var r9="~effect/Cause/UnknownError",Tq=(X)=>M(X,r9);class g7 extends r8("UnknownError"){[r9]=r9;constructor(X,Q){super({message:Q,cause:X})}}var mC=_0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),pC=(X)=>{switch(X){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},dC=T3(D1,pC),Iq=z5(dC),Q$=_0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([nC,iC])}),cC=_0("effect/Logger/LogToStderr",{defaultValue:IQ}),jq=function(){let X=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return A6(c((Q)=>{let Y=Q.getRef(s8),J={...Y};for(let $=0;$<X.length;$++){let[G,Z]=X[$];J[G]=Z}return Q.setContext(K8(Q.context,s8,J)),y4(O6(Q.context,QX),($)=>{let G=Q.getRef(s8),Z={...G};for(let K=0;K<X.length;K++){let[W,H]=X[K];if(G[W]!==H)continue;if(W in Y)Z[W]=Y[W];else delete Z[W]}return Q.setContext(K8(Q.context,s8,Z)),X0})}))},fC="~effect/Logger",uC={[fC]:{_Message:b,_Output:b},pipe(){return a(this,arguments)}},Eq=(X)=>{let Q=Object.create(uC);return Q.log=X,Q},lC=(X)=>X.replace(/[\s="]/g,"_"),rC=(X,Q)=>{return`${lC(X[0])}=${Q-X[1]}ms`};var V8=(X)=>(...Q)=>{let Y=void 0;for(let J=0,$=Q.length;J<$;J++){let G=Q[J];if(q5(G)){if(Y)Q.splice(J,1);else Q=Q.slice(0,J).concat(Q.slice(J+1));Y=Y?l8(Y.reasons.concat(G.reasons)):G,J--}}if(Y===void 0)Y=mQ;return c((J)=>{let $=X??J.currentLogLevel;if(Iq(J.minimumLogLevel,$))return X0;let G=J.getRef(E8),Z=J.getRef(Q$);if(Z.size>0){let K=new Date(G.currentTimeMillisUnsafe());for(let W of Z)W.log({cause:Y,fiber:J,date:K,logLevel:$,message:Q})}return X0})};var P6={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},Ha={None:[],All:[],Trace:[P6.gray],Debug:[P6.blue],Info:[P6.green],Warn:[P6.yellow],Error:[P6.red],Fatal:[P6.bgBrightRed,P6.black]};var oC=(X)=>`${X.getHours().toString().padStart(2,"0")}:${X.getMinutes().toString().padStart(2,"0")}:${X.getSeconds().toString().padStart(2,"0")}.${X.getMilliseconds().toString().padStart(3,"0")}`,Sq=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,Va=Sq&&process.stdout.isTTY===!0,_a=Sq||"Deno"in globalThis;var nC=Eq(({cause:X,date:Q,fiber:Y,logLevel:J,message:$})=>{let G=Array.isArray($)?$.slice():[$];if(X.reasons.length>0)G.push(O7(X));let Z=Q.getTime(),K=Y.getRef(H7),W="";for(let q of K)W+=` ${rC(q,Z)}`;let H=Y.getRef(s8);if(Object.keys(H).length>0)G.push(H);let _=Y.getRef(mC);(Y.getRef(cC)?_.error:_.log)(`[${oC(Q)}] ${J.toUpperCase()} (#${Y.id})${W}:`,...G)}),iC=Eq(({cause:X,fiber:Q,logLevel:Y,message:J})=>{let $=Q.getRef(E8),G=Q.getRef(s8),Z=Q.currentSpan;if(Z===void 0||Z._tag==="ExternalSpan")return;let K={};for(let[W,H]of Object.entries(G))K[W]=H;if(K["effect.fiberId"]=Q.id,K["effect.logLevel"]=Y.toUpperCase(),X.reasons.length>0)K["effect.cause"]=O7(X);Z.event(yW(Array.isArray(J)&&J.length===1?J[0]:J),$.currentTimeNanosUnsafe(),K)});function aC(){i3.interruptChildren??=OC}var vq=A(void 0);var xq=B((X)=>d(X[0]),(X,Q)=>pJ(X,(Y)=>c((J)=>{return sC(J,Y,Q?.defectsOnly),X0}))),sC=(X,Q,Y)=>{let J=X.getRef(rH);if(J.size===0)return;if(Y&&!q7(Q))return;let $={cause:Q,fiber:X,timestamp:X.getRef(E8).currentTimeNanosUnsafe()};J.forEach((G)=>G.report($))};var tC=V5,eC=_5,Y$=q5,J$=pW,XT=w4,QT=q6,YT=D6,ZX=l8,JT=mQ,$T=P3,GT=R3,ZT=j5,KX=(X)=>new D5(X),WX=(X)=>new pQ(X),HX=QV,h7=ZV,KT=HV,WT=JJ,I6=U7,HT=QJ,VT=YJ,S8=i1,_T=YV,qT=q7,DT=JV,BT=o9,UT=D7,OT=$V,zT=GV,FT=B7,LT=$J,$$=O7,PT=cQ,RT=C9,NT=$8,m7=E9,MT=V6,AT=N3,p7=uW,wT=c9,CT=Mq,TT=y7,IT=f9,jT=Aq,VX=eJ,ET=wq,ST=u9,vT=X$,xT=l9,kT=Cq,yT=b7,bT=r9,gT=Tq,hT=g7,mT=B5,pT=KV,dT=WV;class kq extends l1()("effect/Cause/StackTrace"){}class yq extends l1()("effect/Cause/InterruptorStackTrace"){}var U0={};$6(U0,{zipWith:()=>dj,zip:()=>pj,yieldNowWith:()=>Tj,yieldNow:()=>Cj,withTracerTiming:()=>jS,withTracerEnabled:()=>IS,withTracer:()=>TS,withSpanScoped:()=>dS,withSpan:()=>pS,withParentSpan:()=>cS,withLogger:()=>Uv,withLogSpan:()=>Fv,withFiber:()=>nD,withExecutionPlan:()=>DE,withErrorReporting:()=>BE,withConcurrency:()=>sE,whileLoop:()=>uD,when:()=>kE,void:()=>h4,validate:()=>_j,useSpan:()=>mS,updateService:()=>iE,updateContext:()=>nE,unwrapReason:()=>oj,uninterruptibleMask:()=>XB,uninterruptible:()=>zS,undefined:()=>Oj,txRetry:()=>Iv,tx:()=>Av,tryPromise:()=>y$,try:()=>m4,trackSuccesses:()=>Pv,trackErrors:()=>Rv,trackDuration:()=>Mv,trackDefects:()=>Nv,track:()=>Lv,tracer:()=>CS,timeoutOrElse:()=>LE,timeoutOption:()=>FE,timeout:()=>zE,timed:()=>NE,tapErrorTag:()=>$E,tapError:()=>aD,tapDefect:()=>sD,tapCauseIf:()=>GE,tapCauseFilter:()=>ZE,tapCause:()=>t7,tap:()=>iD,sync:()=>rD,suspend:()=>lD,succeedSome:()=>s7,succeedNone:()=>x8,succeed:()=>h,spanLinks:()=>yS,spanAnnotations:()=>kS,sleep:()=>RE,serviceOption:()=>oE,service:()=>rE,scopedWith:()=>XS,scoped:()=>eE,scope:()=>tE,scheduleFrom:()=>QB,schedule:()=>wS,satisfiesSuccessType:()=>Ev,satisfiesServicesType:()=>vv,satisfiesErrorType:()=>Sv,sandbox:()=>VE,runSyncWith:()=>$v,runSyncExitWith:()=>Gv,runSyncExit:()=>e7,runSync:()=>wX,runPromiseWith:()=>Qv,runPromiseExitWith:()=>Jv,runPromiseExit:()=>Yv,runPromise:()=>p$,runForkWith:()=>tS,runFork:()=>m5,runCallbackWith:()=>eS,runCallback:()=>Xv,retryOrElse:()=>HE,retry:()=>WE,result:()=>kj,requestUnsafe:()=>uS,request:()=>fS,replicateEffect:()=>AS,replicate:()=>MS,repeatOrElse:()=>NS,repeat:()=>RS,raceFirst:()=>CE,raceAllFirst:()=>AE,raceAll:()=>ME,race:()=>wE,provideServiceEffect:()=>aE,provideService:()=>tD,provideContext:()=>lE,provide:()=>uE,promise:()=>Uj,partition:()=>Vj,orElseSucceed:()=>UE,orDie:()=>JE,option:()=>yj,onInterrupt:()=>OS,onExitPrimitive:()=>HS,onExitIf:()=>VS,onExitFilter:()=>_S,onExit:()=>m$,onErrorIf:()=>KS,onErrorFilter:()=>WS,onError:()=>ZS,never:()=>zj,matchEffect:()=>mE,matchEager:()=>h$,matchCauseEffectEager:()=>gE,matchCauseEffect:()=>hE,matchCauseEager:()=>bE,matchCause:()=>yE,match:()=>g$,mapErrorEager:()=>y1,mapError:()=>QE,mapEager:()=>p5,mapBothEager:()=>t0,mapBoth:()=>YE,map:()=>AX,makeSpanScoped:()=>hS,makeSpan:()=>gS,logWithLevel:()=>Wv,logWarning:()=>_v,logTrace:()=>Bv,logInfo:()=>qv,logFatal:()=>Vv,logError:()=>d$,logDebug:()=>Dv,log:()=>Hv,linkSpans:()=>bS,let:()=>Pj,isSuccess:()=>dE,isFailure:()=>pE,isEffect:()=>Y4,interruptibleMask:()=>FS,interruptible:()=>US,interrupt:()=>eD,ignoreCause:()=>qE,ignore:()=>_E,gen:()=>Nj,fromYieldable:()=>Sj,fromResult:()=>Ij,fromOption:()=>jj,fromNullishOr:()=>Ej,forkScoped:()=>oS,forkIn:()=>rS,forkDetach:()=>nS,forkChild:()=>lS,forever:()=>PS,forEach:()=>Bj,fnUntracedEager:()=>CX,fnUntraced:()=>Zv,fn:()=>Kv,flip:()=>mj,flatten:()=>vj,flatMapEager:()=>D8,flatMap:()=>NX,firstSuccessOf:()=>OE,findFirstFilter:()=>Dj,findFirst:()=>qj,filterOrFail:()=>vE,filterOrElse:()=>EE,filterMapOrFail:()=>xE,filterMapOrElse:()=>SE,filterMapEffect:()=>jE,filterMap:()=>IE,filter:()=>TE,fiberId:()=>sS,fiber:()=>aS,failSync:()=>Mj,failCauseSync:()=>wj,failCause:()=>Aj,fail:()=>v,exit:()=>MX,eventually:()=>KE,ensuring:()=>GS,effectify:()=>jv,die:()=>oD,delay:()=>PE,currentSpan:()=>vS,currentParentSpan:()=>xS,contextWith:()=>fE,context:()=>cE,clockWith:()=>YB,catchTags:()=>uj,catchTag:()=>fj,catchReasons:()=>rj,catchReason:()=>lj,catchNoSuchElement:()=>tj,catchIf:()=>aj,catchFilter:()=>sj,catchEager:()=>d5,catchDefect:()=>ij,catchCauseIf:()=>ej,catchCauseFilter:()=>XE,catchCause:()=>nj,catch:()=>cj,callback:()=>b$,cachedWithTTL:()=>DS,cachedInvalidateWithTTL:()=>BS,cached:()=>qS,bindTo:()=>Lj,bind:()=>Rj,awaitAllChildren:()=>iS,asVoid:()=>hj,asSome:()=>gj,as:()=>bj,annotateSpans:()=>ES,annotateLogsScoped:()=>zv,annotateLogs:()=>Ov,annotateCurrentSpan:()=>SS,andThen:()=>xj,all:()=>Hj,addFinalizer:()=>$S,acquireUseRelease:()=>JS,acquireRelease:()=>QS,acquireDisposable:()=>YS,abortSignal:()=>LS,YieldableClass:()=>fD,Transaction:()=>RX,Do:()=>Fj});var q8={};$6(q8,{void:()=>Z$,succeed:()=>_X,match:()=>eT,mapError:()=>d7,mapBoth:()=>QI,map:()=>XI,isSuccess:()=>_8,isFailure:()=>K$,isExit:()=>G$,interrupt:()=>fT,hasInterrupts:()=>rT,hasFails:()=>uT,hasDies:()=>lT,getSuccess:()=>c7,getCause:()=>$I,findErrorOption:()=>GI,findError:()=>sT,findDefect:()=>tT,filterValue:()=>nT,filterSuccess:()=>oT,filterFailure:()=>iT,filterCause:()=>aT,failCause:()=>qX,fail:()=>k5,die:()=>cT,asVoidAll:()=>JI,asVoid:()=>YI});var G$=L3,_X=j0,qX=N1,k5=M1,cT=C8,fT=yV,Z$=n1;var _8=S5,K$=OJ,uT=cV,lT=dV,rT=pV,oT=bV,nT=gV,iT=hV,aT=a9,sT=zJ,tT=mV,eT=fV,XI=FJ,d7=LJ,QI=PJ,YI=uV,JI=RJ,c7=lV,$I=rV,GI=oV;var ZI="~effect/Deferred";var KI={[ZI]:{_A:b,_E:b},pipe(){return a(this,arguments)}},bq=()=>{let X=Object.create(KI);return X.resumes=void 0,X.effect=void 0,X};var gq=(X)=>w1((Q)=>{if(X.effect)return Q(X.effect);return X.resumes??=[],X.resumes.push(Q),$0(()=>{let Y=X.resumes.indexOf(Q);X.resumes.splice(Y,1)})});var WI=B(2,(X,Q)=>$0(()=>HI(X,Q))),hq=WI;var HI=(X,Q)=>{if(X.effect)return!1;if(X.effect=Q,X.resumes){for(let Y=0;Y<X.resumes.length;Y++)X.resumes[Y](Q);X.resumes=void 0}return!0};var mq=s8;var pq=H7;var dq=YX;var f7=N_,W$=yJ;var fq="~effect/Layer",cq="~effect/Layer/MemoMap",uq=(X)=>M(X,fq),qI={[fq]:{_ROut:b,_E:b,_RIn:b},pipe(){return a(this,arguments)}},lq=(X)=>{let Q=Object.create(qI);return Q.build=X,Q},rq=(X)=>lq((Q,Y)=>{let J=f7(Y);return O1(X(Q,J),($)=>$._tag==="Failure"?W$(J,$):X0)});class oq{get[cq](){return cq}map=new Map;getOrElseMemoize(X,Q,Y){if(this.map.has(X)){let Z=this.map.get(X);return Z.observers++,t8(y4(Q,(K)=>Z.finalizer(K)),Z.effect)}let J=dq(),$=bq(),G={observers:1,effect:gq($),finalizer:(Z)=>i(()=>{if(G.observers--,G.observers===0)return this.map.delete(X),W$(J,Z);return X0})};return this.map.set(X,G),y4(Q,G.finalizer).pipe(C(()=>Y(this,J)),O1((Z)=>{return G.effect=Z,hq($,Z)}))}}var H$=()=>new oq;class u7 extends l1()("effect/Layer/CurrentMemoMap"){static getOrCreate=DH(this,H$)}var V$=B(3,(X,Q,Y)=>U1(L0(X.build(Q,Y),K8(u7,Q)),u7,Q));var nq=B(2,(X,Q)=>c((Y)=>V$(X,u7.getOrCreate(Y.context),Q)));var iq=(X)=>lq(i0(A(X)));var aq=(X,Q,Y)=>{let J=f7(Y,"parallel");return o1(X,($)=>$.build(Q,f7(J,"sequential")),{concurrency:X.length}).pipe(L0(($)=>OH(...$)))},sq=(...X)=>rq((Q,Y)=>aq(X,Q,Y));var DI=(X,Q,Y)=>rq((J,$)=>C(Array.isArray(Q)?aq(Q,J,$):Q.build(J,$),(G)=>X.build(J,$).pipe(X4(G),L0((Z)=>Y(Z,G))))),tq=B(2,(X,Q)=>DI(X,Q,b));var XD="~effect/ExecutionPlan";var BI={[XD]:XD,get withRequirements(){let X=this;return k4((Q)=>A(UI(X.steps.map((Y)=>({...Y,provide:uq(Y.provide)?tq(Y.provide,iq(Q)):Y.provide})))))},pipe(){return a(this,arguments)}},UI=(X)=>{let Q=Object.create(BI);return Q.steps=X,Q};var QD=_0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:i0({attempt:0,stepIndex:0})});var YD=class extends G6{constructor(X){super();if(X)Object.assign(this,X)}};var JD=r8;var l7="~effect/time/DateTime",r7="~effect/time/DateTime/TimeZone",ZD={[l7]:l7,pipe(){return a(this,arguments)},[a0](){return this.toString()},toJSON(){return OX(this).toJSON()}},zI={...ZD,_tag:"Utc",[W0](){return c8(this.epochMilliseconds)},[H0](X){return b5(X)&&X._tag==="Utc"&&this.epochMilliseconds===X.epochMilliseconds},toString(){return`DateTime.Utc(${OX(this).toJSON()})`}},FI={...ZD,_tag:"Zoned",[W0](){return f0(c8(this.epochMilliseconds))(s(this.zone))},[H0](X){return b5(X)&&X._tag==="Zoned"&&this.epochMilliseconds===X.epochMilliseconds&&o(this.zone,X.zone)},toString(){return`DateTime.Zoned(${A$(this)})`}},KD={[r7]:r7,[a0](){return this.toString()}},LI={...KD,_tag:"Named",[W0](){return C0(`Named:${this.id}`)},[H0](X){return j6(X)&&X._tag==="Named"&&this.id===X.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},PI={...KD,_tag:"Offset",[W0](){return C0(`Offset:${this.offset}`)},[H0](X){return j6(X)&&X._tag==="Offset"&&this.offset===X.offset},toString(){return`TimeZone.Offset(${R$(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},v8=(X,Q,Y)=>{let J=Object.create(FI);return J.epochMilliseconds=X,J.zone=Q,Object.defineProperty(J,"partsUtc",{value:Y,enumerable:!1,writable:!0}),Object.defineProperty(J,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(J,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),J},b5=(X)=>M(X,l7);var j6=(X)=>M(X,r7),WD=(X)=>j6(X)&&X._tag==="Offset",HD=(X)=>j6(X)&&X._tag==="Named",VD=(X)=>X._tag==="Utc",D$=(X)=>X._tag==="Zoned",_D=s0((X,Q)=>X.epochMilliseconds===Q.epochMilliseconds);var B$=(X)=>{let Q=Object.create(zI);return Q.epochMilliseconds=X,Object.defineProperty(Q,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),Q},y5=(X)=>{let Q=X.getTime();if(Number.isNaN(Q))throw new VX("Invalid date");return B$(Q)},U$=(X)=>{if(b5(X))return X;else if(X instanceof Date)return y5(X);else if(typeof X==="object"){if("epochMilliseconds"in X)return B$(X.epochMilliseconds);let Q=new Date(0);return II(Q,X),y5(Q)}else if(typeof X==="string"&&!RI(X))return y5(new Date(X+"Z"));return y5(new Date(X))},RI=(X)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(X),NI=-8639999956800000,MI=8639999949600000,O$=(X,Q)=>{let Y=Q?.timeZone;if(Y===void 0&&b5(X)&&D$(X))return X;let J=U$(X);if(J.epochMilliseconds<NI||J.epochMilliseconds>MI)throw RangeError(`Epoch millis out of range: ${J.epochMilliseconds}`);if(Y===void 0&&typeof X==="object"&&"timeZoneId"in X)Y=X.timeZoneId;let $;if(Y===void 0){let G=new Date(J.epochMilliseconds).getTimezoneOffset()*-60*1000;$=UX(G)}else if(j6(Y))$=Y;else if(typeof Y==="number")$=UX(Y);else{let G=L$(Y);if(T0(G))throw new VX(`Invalid time zone: ${Y}`);$=G.value}if(Q?.adjustForTimeZone!==!0)return v8(J.epochMilliseconds,$,J.partsUtc);return jI(J.epochMilliseconds,$,Q?.disambiguation??"compatible")},_$=U6(O$),qD=U6(U$),AI=/^(.{17,35})\[(.+)\]$/,DD=(X)=>{let Q=AI.exec(X);if(Q===null){let $=M$(X);return $!==null?_$(X,{timeZone:$}):x()}let[,Y,J]=Q;return _$(Y,{timeZone:J})};var BD=(X)=>B$(X.epochMilliseconds);var BX=new Map,wI={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},CI=(X)=>{let Q=X.resolvedOptions().timeZone;if(BX.has(Q))return BX.get(Q);let Y=Object.create(LI);return Y.id=Q,Y.format=X,BX.set(Q,Y),Y},z$=(X)=>{if(BX.has(X))return BX.get(X);try{return CI(new Intl.DateTimeFormat("en-US",{...wI,timeZone:X}))}catch{throw new VX(`Invalid time zone: ${X}`)}},UX=(X)=>{let Q=Object.create(PI);return Q.offset=X,Q},F$=U6(z$);var TI=/^(?:GMT|[+-])/,L$=(X)=>{if(TI.test(X)){let Q=M$(X);return Q===null?x():F(UX(Q))}return F$(X)},UD=(X)=>{if(X._tag==="Offset")return R$(X.offset);return X.id};var OX=(X)=>new Date(X.epochMilliseconds),o7=(X)=>{if(X._tag==="Utc")return new Date(X.epochMilliseconds);else if(X.zone._tag==="Offset")return new Date(X.epochMilliseconds+X.zone.offset);else if(X.adjustedEpochMilliseconds!==void 0)return new Date(X.adjustedEpochMilliseconds);let Q=X.zone.format.formatToParts(X.epochMilliseconds).filter((J)=>J.type!=="literal"),Y=new Date(0);return Y.setUTCFullYear(Number(Q[2].value),Number(Q[0].value)-1,Number(Q[1].value)),Y.setUTCHours(Number(Q[3].value),Number(Q[4].value),Number(Q[5].value),Number(Q[6].value)),X.adjustedEpochMilliseconds=Y.getTime(),Y},P$=(X)=>{return o7(X).getTime()-N$(X)},R$=(X)=>{let Q=Math.abs(X),Y=Math.floor(Q/3600000),J=Math.round(Q%3600000/60000);if(J===60)Y+=1,J=0;return`${X<0?"-":"+"}${String(Y).padStart(2,"0")}:${String(J).padStart(2,"0")}`},OD=(X)=>R$(P$(X)),N$=(X)=>X.epochMilliseconds;var II=(X,Q)=>{if(Q.year!==void 0)X.setUTCFullYear(Q.year);if(Q.month!==void 0)X.setUTCMonth(Q.month-1);if(Q.day!==void 0)X.setUTCDate(Q.day);if(Q.weekDay!==void 0){let Y=Q.weekDay-X.getUTCDay();X.setUTCDate(X.getUTCDate()+Y)}if(Q.hour!==void 0)X.setUTCHours(Q.hour);if(Q.minute!==void 0)X.setUTCMinutes(Q.minute);if(Q.second!==void 0)X.setUTCSeconds(Q.second);if(Q.millisecond!==void 0)X.setUTCMilliseconds(Q.millisecond)};var GD=86400000,jI=(X,Q,Y)=>{if(Q._tag==="Offset")return v8(X-Q.offset,Q);let J=DX(X-GD,X,Q),$=DX(X+GD,X,Q);if(J===$)return v8(X-J,Q);let G=J<$,Z=J-$;if(G){if(DX(X-$,X,Q)===$)return v8(X-$,Q);let H=v8(X-J,Q),_=o7(H).getTime();if(X!==_)switch(Y){case"reject":{let V=new Date(X).toISOString();throw RangeError(`Gap time: ${V} does not exist in time zone ${Q.id}`)}case"earlier":return v8(X-$,Q);case"compatible":case"later":return H}return H}if(DX(X-J,X,Q)===J){if(Y==="earlier"||Y==="compatible")return v8(X-J,Q);if(DX(X-J+Z,X+Z,Q)===J)return v8(X-J,Q);if(Y==="reject"){let H=new Date(X).toISOString();throw RangeError(`Ambiguous time: ${H} occurs twice in time zone ${Q.id}`)}}return v8(X-$,Q)},EI=/([+-])(\d{2}):(\d{2})$/,M$=(X)=>{let Q=EI.exec(X);if(Q===null)return null;let[,Y,J,$]=Q;return(Y==="+"?1:-1)*(Number(J)*60+Number($))*60*1000},DX=(X,Q,Y)=>{let J=Y.format.formatToParts(X).find((G)=>G.type==="timeZoneName")?.value??"";if(J==="GMT")return 0;let $=M$(J);if($===null)return P$(v8(Q,Y));return $};var zD=(X)=>OX(X).toISOString();var q$=(X)=>{let Q=o7(X);return X._tag==="Utc"?Q.toISOString():`${Q.toISOString().slice(0,-1)}${OD(X)}`},A$=(X)=>X.zone._tag==="Offset"?q$(X):`${q$(X)}[${X.zone.id}]`;var va=globalThis.Number;var LD=B(2,(X,Q)=>{let Y=FD(X),J=FD(Q),$=Y>J?Y:J,G=parseInt(X.toFixed($).replace(".","")),Z=parseInt(Q.toFixed($).replace(".",""));return G%Z/Math.pow(10,$)});function FD(X){let Q=X.toString(),Y=Q.indexOf("e-");if(Y!==-1){let J=parseInt(Q.slice(Y+2));return(Q.slice(0,Y).split(".")[1]||"").length+J}return(Q.split(".")[1]||"").length}var PD=o8((X,Q)=>Math.max(X,Q),-1/0),RD=o8((X,Q)=>Math.min(X,Q),1/0);var xa=globalThis.String;var ND=(X)=>X.trim();var w$=B(2,(X,Q)=>v5(X,yI,(Y)=>Q(Y)));var kI=A5(S8,(X)=>m7(X)?l(X):f(X));var yI=A5(S8,(X)=>m7(X)?l(X.value):f(X));var MD=B(2,(X,Q)=>j8(X,{onSuccess:Q.onSuccess,onFailure:(Y)=>{let J=kI(Y);return!u(J)?Q.onDone(J.success.value):Q.onFailure(J.failure)}}));var wD="~effect/Schedule";var E6=_0("effect/Schedule/CurrentMetadata",{defaultValue:i0({input:void 0,output:void 0,duration:N5,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),bI={[wD]:{_Out:b,_In:b,_Env:b},pipe(){return a(this,arguments)}},C$=(X)=>M(X,wD),T$=(X)=>{let Q=Object.create(bI);return Q.step=X,Q},I$=()=>{let X=0,Q,Y;return(J,$)=>{if(Y===void 0)Y=J;let G=J-Y,Z=Q===void 0?0:J-Q;return Q=J,{input:$,attempt:++X,start:Y,now:J,elapsed:G,elapsedSincePrevious:Z}}},gI=(X)=>T$(L0(X,(Q)=>{let Y=I$();return(J,$)=>Q(Y(J,$))})),j$=(X)=>a1(X.step,(Q)=>A(()=>N0(Q))),n7=(X)=>C6((Q)=>L0(j$(X),(Y)=>{let J=I$();return($)=>i(()=>{let G=Q.currentTimeMillisUnsafe();return C(Y(G,$),([Z,K])=>{let W=J(G,$);return W.output=Z,W.duration=K,v1(T6(K),W)})})}));var E$=(X)=>T$(L0(j$(X),(Q)=>(Y,J)=>MD(Q(Y,J),{onSuccess:($)=>A([J,$[1]]),onFailure:N0,onDone:()=>p7(J)}))),CD=(X)=>zX(S$,({attempt:Q})=>A(Q<=X));var hI=(X)=>{let Q=S1(X);return gI(A((Y)=>A([Y.attempt-1,Q])))};var zX=B(2,(X,Q)=>T$(L0(j$(X),(Y)=>{let J=I$();return($,G)=>C(Y($,G),(Z)=>{let[K,W]=Z,H=Q({...J($,G),output:K,duration:W});return C(d(H)?H:A(H),(_)=>_?A(Z):p7(K))})})));var S$=hI(N5);var mI=(X,Q,Y)=>j7((J)=>C(Y?.local?V$(Q,H$(),J):nq(Q,J),($)=>X4(X,$))),i7=B((X)=>d(X[0]),(X,Q,Y)=>E3(Q)?X4(X,Q):mI(X,Array.isArray(Q)?sq(...Q):Q,Y));var v$=B(3,(X,Q,Y)=>C(n7(Q),(J)=>{let $=E6.defaultValue();return x1(A7(N6(C(i(()=>U1(X,E6,$)),J),(G)=>$0(()=>{$=G})),{disableYield:!0}),(G)=>E9(G)?A(G.value):Y(G,$.attempt===0?x():F($)))})),x$=B(3,(X,Q,Y)=>C(n7(Q),(J)=>{let $=E6.defaultValue(),G,Z=x1(i(()=>U1(X,E6,$)),(K)=>{return G=K,C(J(K),(W)=>{return $=W,Z})});return w$(Z,(K)=>J0(()=>Y(G,K)))})),jD=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):C$(Q)?Q:LX(Q);return v$(X,Y,M0)}),FX=B(2,(X,Q)=>{let Y=typeof Q==="function"?Q(b):C$(Q)?Q:LX(Q);return x$(X,Y,M0)}),ED=B(3,(X,Q,Y)=>C(n7(Y),(J)=>{let $=E6.defaultValue(),G=i(()=>U1(X,E6,$));return x1(C(J(Q),(Z)=>{$=Z;let K=i0(C(G,J));return b4({while:R4,body:K,step(W){$=W}})}),(Z)=>E9(Z)?A(Z.value):M0(Z))})),pI=E$(S$),LX=(X)=>{let Q=X.schedule?E$(X.schedule):pI;if(X.while)Q=zX(Q,({input:Y})=>{let J=X.while(Y);return d(J)?J:A(J)});if(X.until)Q=zX(Q,({input:Y})=>{let J=X.until(Y);return d(J)?L0(J,($)=>!$):A(!J)});if(X.times!==void 0)Q=zX(Q,({attempt:Y})=>A(Y<=X.times));return Q};var xD=B(2,(X,Q)=>i(()=>{let Y=0,J={attempt:0,stepIndex:0},$=M7(QD,$0(()=>{return J={attempt:J.attempt+1,stepIndex:Y},J})),G;return C(b4({while:()=>Y<Q.steps.length&&(G===void 0||u(G)),body(){let Z=Q.steps[Y],K=$(i7(X,Z.provide));if(G){let W=!1,H=K;K=i(()=>{if(W)return H;return W=!0,G.asEffect()}),K=FX(K,vD(Z,!1))}else{let W=vD(Z,!0);K=W?FX(K,W):K}return x4(K)},step(Z){G=Z,Y++}}),()=>G.asEffect())})),vD=(X,Q)=>{if(!Q)return LX({schedule:X.schedule?X.schedule:X.attempts?void 0:dI,times:X.attempts,while:X.while});else if(X.attempts===1||!(X.schedule||X.attempts))return;return LX({schedule:X.schedule,while:X.while,times:X.attempts?X.attempts-1:void 0})},dI=CD(1);var fI="~effect/Request",uI=xW({_E:(X)=>X,_A:(X)=>X,_R:(X)=>X}),ia={...mW,[fI]:uI};var kD=(X)=>X;var bD=B(2,(X,Q)=>{let Y=(J)=>w1(($)=>{let G=hD(J,X,$,z7());return lI(J,G)});return d(Q)?C(Q,Y):Y(Q)}),gD=(X,Q)=>{let Y=hD(Q.resolver,X,Q.onExit,{context:Q.context,currentScheduler:E1(Q.context,y9)});return()=>mD(Q.resolver,Y)},a7=[],k$=new Map,hD=(X,Q,Y,J)=>{let $=k$.get(X);if(!$)$=new Map,k$.set(X,$);let G,Z=!1,K=kD({request:Q,context:J.context,uninterruptible:!1,completeUnsafe(H){if(Z)return;Z=!0,Y(H),G?.entrySet.delete(K)}});if(X.preCheck!==void 0&&!X.preCheck(K))return K;let W=X.batchKey(K);if(G=$.get(W),!G){if(a7.length>0)G=a7.pop(),G.key=W,G.resolver=X,G.map=$;else{let H={key:W,resolver:X,map:$,entrySet:new Set,entries:new Set,delayEffect:C(i(()=>H.resolver.delay),(_)=>yD(H)),run:O1(i(()=>H.resolver.runAll(Array.from(H.entries),H.key)),(_)=>{for(let V of H.entrySet)V.completeUnsafe(_._tag==="Success"?C8(Error("Effect.request: RequestResolver did not complete request",{cause:V.request})):_);if(H.entries.clear(),a7.length<128)H.entrySet.clear(),H.key=void 0,H.fiber=void 0,a7.push(H);return X0})};G=H}$.set(W,G),G.fiber=Q4(J.context)(G.delayEffect,{scheduler:J.currentScheduler})}if(G.entrySet.add(K),G.entries.add(K),G.resolver.collectWhile(G.entries))return K;return G.fiber.interruptUnsafe(J.id),G.fiber=Q4(J.context)(yD(G),{scheduler:J.currentScheduler}),K},mD=(X,Q)=>{if(Q.uninterruptible)return;let Y=k$.get(X);if(!Y)return;let J=X.batchKey(Q.request),$=Y.get(J);if(!$)return;if($.entries.delete(Q),$.entrySet.delete(Q),$.entries.size===0)Y.delete(J),$.fiber?.interruptUnsafe()},lI=(X,Q)=>$0(()=>mD(X,Q));function yD(X){if(!X.map.has(X.key))return X0;return X.map.delete(X.key),X.run}var iI="effect/Metric/CurrentMetricAttributes",aI=_0(iI,{defaultValue:()=>({})}),sI="~effect/observability/Metric/MetricRegistryKey",tI=_0(sI,{defaultValue:()=>new Map}),pD="~effect/observability/Metric";class g5{[pD]=pD;#X=new WeakMap;#Q;id;description;attributes;constructor(X,Q,Y){this.id=X,this.description=Q,this.attributes=Y}valueUnsafe(X){return this.hook(X).get(X)}modifyUnsafe(X,Q){return this.hook(Q).modify(X,Q)}updateUnsafe(X,Q){return this.hook(Q).update(X,Q)}hook(X){let Q=E1(X,aI);if(Object.keys(Q).length===0){if($1(this.#Q))return this.#Q.hooks;return this.#Q=this.getOrCreate(X,this.attributes),this.#Q.hooks}let Y=Kj(this.attributes,Q),J=this.#X.get(Y);if($1(J))return J.hooks;return J=this.getOrCreate(X,Y),this.#X.set(Y,J),J.hooks}getOrCreate(X,Q){let Y=$j(this,Q),J=E1(X,tI);if(J.has(Y))return J.get(Y);let $=this.createHooks(),G={id:this.id,type:this.type,description:this.description,attributes:g4(Q),hooks:$};return J.set(Y,G),G}pipe(){return a(this,arguments)}}var dD=BigInt(0);class eI extends g5{type="Counter";#X;#Q;constructor(X,Q){super(X,Q?.description,g4(Q?.attributes));this.#X=Q?.bigint??!1,this.#Q=Q?.incremental??!1}createHooks(){let X=this.#X?dD:0,Q=this.#Q?this.#X?(J)=>J>=dD:(J)=>J>=0:(J)=>!0;return PX(()=>({count:X,incremental:this.#Q}),(J)=>{if(Q(J))X=X+J})}}class Xj extends g5{type="Gauge";#X;constructor(X,Q){super(X,Q?.description,g4(Q?.attributes));this.#X=Q?.bigint??!1}createHooks(){let X=this.#X?BigInt(0):0;return PX(()=>({value:X}),(J)=>{X=J},(J)=>{X=X+J})}}class Qj extends g5{type="Frequency";#X;constructor(X,Q){super(X,Q?.description,g4(Q?.attributes));this.#X=Q?.preregisteredWords}createHooks(){let X=new Map;if($1(this.#X))for(let Y of this.#X)X.set(Y,0);return PX(()=>({occurrences:X}),(Y)=>{let J=X.get(Y)??0;X.set(Y,J+1)})}}class Yj extends g5{type="Histogram";#X;constructor(X,Q){super(X,Q?.description,g4(Q?.attributes));this.#X=Q.boundaries}createHooks(){let X=this.#X,Q=X.length,Y=new Uint32Array(Q+1),J=new Float64Array(Q),$=0,G=0,Z=Number.MAX_VALUE,K=Number.MIN_VALUE;E4(k9(X,D1),(_,V)=>{J[V]=_});let W=(_)=>{let V=0,q=Q;while(V!==q){let D=Math.floor(V+(q-V)/2),U=J[D];if(_<=U)q=D;else V=D;if(q===V+1)if(_<=J[V])q=V;else V=q}if(Y[V]=Y[V]+1,$=$+1,G=G+_,_<Z)Z=_;if(_>K)K=_},H=()=>{let _=k3(Q),V=0;for(let q=0;q<Q;q++){let D=J[q],U=Y[q];V=V+U,_[q]=[D,V]}return _};return PX(()=>({buckets:H(),count:$,min:Z,max:K,sum:G}),W)}}class Jj extends g5{type="Summary";#X;#Q;#Y;constructor(X,Q){super(X,Q?.description,g4(Q?.attributes));this.#X=Math.max(v4(S1(Q.maxAge)),0),this.#Q=Q.maxSize,this.#Y=Q.quantiles}createHooks(){let X=k9(this.#Y,D1),Q=k3(this.#Q);for(let V of this.#Y)if(V<0||V>1)throw Error(`Quantile must be between 0 and 1, found: ${V}`);let Y=0,J=0,$=0,G=Number.MAX_VALUE,Z=Number.MIN_VALUE,K=(V)=>{let q=[],D=0;while(D<this.#Q){let L=Q[D];if($1(L)){let[N,P]=L,y=V-N;if(y>=0&&y<=this.#X)q.push(P)}D=D+1}let U=k9(q,D1),R=U.length;if(R===0)return X.map((L)=>[L,void 0]);return X.map((L)=>{if(L<=0)return[L,U[0]];if(L>=1)return[L,U[R-1]];let N=Math.ceil(L*R)-1;return[L,U[N]]})},W=(V,q)=>{if(this.#Q>0){let D=Y%this.#Q;Q[D]=[q,V],Y=Y+1}if(J=J+1,$=$+V,V<G)G=V;if(V>Z)Z=V};return PX((V)=>{let q=E1(V,E8);return{quantiles:K(q.currentTimeMillisUnsafe()),count:J,min:G,max:Z,sum:$}},([V,q])=>W(V,q))}}var h5=B(2,(X,Q)=>k4((Y)=>$0(()=>X.updateUnsafe(Q,Y))));function $j(X,Q){let Y=`${X.type}:${X.id}`;if($1(X.description))Y+=`:${X.description}`;if($1(Q))Y+=`:${Gj(Q)}`;return Y}function PX(X,Q,Y){return{get:X,update:Q,modify:Y??Q}}function Gj(X){return Zj(Array.isArray(X)?X:Object.entries(X))}function Zj(X){return X.map(([Q,Y])=>`${Q}=${Y}`).join(",")}function Kj(X,Q){return{...g4(X),...g4(Q)}}function g4(X){if($1(X)&&Array.isArray(X))return X.reduce((Q,[Y,J])=>{return Q[Y]=J,Q},{});return X}class fD{[Symbol.iterator](){return new W6(this)}}var Y4=d,Hj=v7,Vj=lJ,_j=y_,qj=b_,Dj=h_,Bj=o1,uD=b4,Uj=HJ,y$=FV,h=A,x8=L7,s7=WJ,lD=i,rD=$0,h4=X0;var Oj=vq;var b$=w1,zj=_J,Fj=l_,Lj=r_,Pj=n_;var Rj=o_,Nj=NV,v=M0,Mj=P7,Aj=N0,wj=OV,oD=R6,m4=zV;var Cj=E5,Tj=KJ,nD=c,Ij=BV,jj=DV,Ej=UV,Sj=n9,NX=C,vj=EV,xj=t8,iD=N6,kj=x4,yj=B_,MX=XX,AX=L0,bj=v1,gj=R7,hj=i9,mj=wV,pj=MJ,dj=AJ,cj=x1;var fj=IJ,uj=Z_,lj=K_,rj=W_,oj=H_,nj=a1,ij=Q_,aj=t9,sj=C7,tj=X_,ej=CJ,XE=v5,QE=jJ,YE=EJ,JE=SJ,aD=TJ,$E=$_,t7=Y_,GE=J_,ZE=w7,sD=G_,KE=vJ,WE=FX,HE=x$,VE=CV,_E=q_,qE=D_,DE=xD,BE=xq,UE=V_,OE=__,zE=L_,FE=P_,LE=kJ,PE=F_,RE=T6,NE=R_,ME=BJ,AE=UJ,wE=TV,CE=N7,TE=c_,IE=f_,jE=u_,EE=rJ,SE=oJ,vE=sV,xE=d_,kE=tV,g$=T7,h$=e9,yE=xJ,bE=U_,gE=IV,hE=j8,mE=M6,pE=O_,dE=z_,cE=NJ,fE=k4,uE=i7,lE=X4,rE=nV,oE=iV,nE=s9,iE=e8,tD=U1,aE=M7,sE=aV,tE=JX,eE=bJ,XS=j7,QS=E7,YS=I_,JS=T_,$S=gJ,GS=A_,ZS=pJ,KS=w_,WS=dJ,HS=x5,m$=O1,VS=hJ,_S=mJ,qS=j_,DS=fJ,BS=cJ,eD=E_,US=uJ,OS=C_,zS=A6,XB=$X,FS=x_,LS=k_,PS=A7,RS=jD,NS=v$,MS=wJ,AS=eV,wS=B(2,(X,Q)=>QB(X,void 0,Q)),QB=ED,CS=Zq,TS=Kq,IS=Wq,jS=Hq,ES=zq,SS=Fq,vS=Lq,xS=Pq,kS=Dq,yS=Bq,bS=Uq,gS=_q,hS=p9,mS=d9,pS=Oq,dS=qq,cS=I5,fS=bD,uS=gD,lS=i_,rS=nJ,oS=t_,nS=a_,iS=s_,aS=PV,sS=RV,m5=e_,tS=Q4,eS=iJ,Xv=Xq,p$=Yq,Qv=aJ,Yv=Qq,Jv=x7,wX=$q,$v=sJ,e7=Jq,Gv=k7,Zv=qJ,Kv=MV,YB=C6,Wv=V8,Hv=V8(),Vv=V8("Fatal"),_v=V8("Warn"),d$=V8("Error"),qv=V8("Info"),Dv=V8("Debug"),Bv=V8("Trace"),Uv=B(2,(X,Q)=>e8(X,Q$,(Y)=>new Set([...Y,Q]))),Ov=B((X)=>Y4(X[0]),(X,...Q)=>e8(X,mq,(Y)=>{let J={...Y};if(Q.length===1)Object.assign(J,Q[0]);else J[Q[0]]=Q[1];return J})),zv=jq,Fv=B(2,(X,Q)=>C(Nq,(Y)=>e8(X,pq,(J)=>{return[[Q,Y],...J]}))),Lv=B((X)=>Y4(X[0]),(X,Q,Y)=>m$(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(Q,$)})),Pv=B((X)=>Y4(X[0]),(X,Q,Y)=>iD(X,(J)=>{let $=Y===void 0?J:Y(J);return h5(Q,$)})),Rv=B((X)=>Y4(X[0]),(X,Q,Y)=>aD(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(Q,$)})),Nv=B((X)=>Y4(X[0]),(X,Q,Y)=>sD(X,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return h5(Q,$)})),Mv=B((X)=>Y4(X[0]),(X,Q,Y)=>YB((J)=>{let $=J.currentTimeNanosUnsafe();return m$(X,()=>{let G=J.currentTimeNanosUnsafe(),Z=vH(S1(G),S1($)),K=Y===void 0?Z:J0(()=>Y(Z));return h5(Q,K)})}));class RX extends l1()("effect/Effect/Transaction"){}var Av=(X)=>nD((Q)=>{if(Q.context.mapUnsafe.has(RX.key))return X;let Y={journal:new Map,retry:!1},J;return XB(($)=>NX(uD({while:()=>!J,body:i0($(X).pipe(tD(RX,Y),t7(()=>{if(!Y.retry)return h4;return $(Cv(Y))}),MX)),step(G){if(Y.retry||!wv(Y))return cD(Y);if(_8(G))Tv(Q,Y);else cD(Y);J=G}}),()=>J))}),wv=(X)=>{for(let[Q,{version:Y}]of X.journal)if(Q.version!==Y)return!1;return!0},Cv=(X)=>lD(()=>{let Q={},Y=Array.from(X.journal.keys()),J=()=>{for(let $ of Y)$.pending.delete(Q)};return b$(($)=>{let G=()=>{J(),$(h4)};for(let Z of Y)Z.pending.set(Q,G);return rD(J)})});function Tv(X,Q){for(let[Y,{value:J}]of Q.journal){if(J!==Y.value)Y.version=Y.version+1,Y.value=J;for(let $ of Y.pending.values())X.currentDispatcher.scheduleTask($,0);Y.pending.clear()}}function cD(X){X.retry=!1,X.journal.clear()}var Iv=NX(RX.asEffect(),(X)=>{return X.retry=!0,eD}),jv=(X,Q,Y)=>(...J)=>b$(($)=>{try{X(...J,(G,Z)=>{if(G)$(v(Q?Q(G,J):G));else $(h(Z))})}catch(G){$(Y?v(Y(G,J)):oD(G))}}),Ev=()=>(X)=>X,Sv=()=>(X)=>X,vv=()=>(X)=>X,p5=SV,y1=vV,t0=xV,D8=jV,d5=kV,CX=AV;var xv=(X,Q)=>{if(_8(X))return Q(0);if(h7(X.cause))return Q(130);return Q(kv(I6(X.cause)))},GB=(X)=>B((Q)=>Y4(Q[0]),(Q,Y)=>{let J=Y?.disableErrorReporting===!0?m5(Q):m5(t7(Q,(G)=>{if(h7(G))return h4;return yv(I6(G))?d$(G):h4}));try{let G=globalThis.setInterval(Z5,2147483647);J.addObserver(()=>{clearInterval(G)})}catch{}let $=Y?.teardown??xv;return X({fiber:J,teardown:$})}),JB="~effect/Runtime/errorExitCode",kv=(X)=>{if(typeof X==="object"&&X!==null&&JB in X){let Q=X[JB];if(typeof Q==="number")return Q}return 1},$B="~effect/Runtime/errorReported",yv=(X)=>{if(typeof X==="object"&&X!==null&&$B in X){let Q=X[$B];if(typeof Q==="boolean")return Q}return!0};var ZB=GB(({fiber:X,teardown:Q})=>{let Y=!1;X.addObserver(($)=>{process.removeListener("SIGINT",J),process.removeListener("SIGTERM",J),Q($,(G)=>{if(Y||G!==0)process.exit(G)})});function J(){Y=!0,X.interruptUnsafe(X.id)}process.on("SIGINT",J),process.on("SIGTERM",J)});var hv=ZB;var w={};$6(w,{withDecodingDefaultTypeKey:()=>Lu,withDecodingDefaultType:()=>Pu,withDecodingDefaultKey:()=>JW,withDecodingDefault:()=>TN,withConstructorDefault:()=>CN,toType:()=>P1,toTaggedUnion:()=>IN,toStandardSchemaV1:()=>Rf,toStandardJSONSchemaV1:()=>Nf,toRepresentation:()=>FM,toJsonSchemaDocument:()=>LM,toIsoSource:()=>Er,toIsoFocus:()=>Sr,toIso:()=>jr,toFormatter:()=>Or,toEquivalence:()=>Fr,toEncoderXml:()=>Rr,toEncoded:()=>O9,toDifferJsonPatch:()=>xr,toCodecStringTree:()=>AM,toCodecJson:()=>PM,toCodecIso:()=>NM,toArbitraryLazy:()=>zM,toArbitrary:()=>Br,tagDefaultOmit:()=>Ru,tag:()=>Y5,suspend:()=>RN,revealCodec:()=>Lf,revealBottom:()=>Uf,resolveAnnotationsKey:()=>hr,resolveAnnotations:()=>gr,requiredKey:()=>uf,required:()=>lf,refine:()=>Du,redact:()=>GW,readonlyKey:()=>of,overrideToFormatter:()=>Ur,overrideToEquivalence:()=>zr,overrideToCodecIso:()=>vr,optionalKey:()=>Q5,optional:()=>U9,mutableKey:()=>rf,mutable:()=>_u,middlewareEncoding:()=>MN,middlewareDecoding:()=>QW,makeIsMultipleOf:()=>vN,makeIsLessThanOrEqualTo:()=>wQ,makeIsLessThan:()=>AQ,makeIsGreaterThanOrEqualTo:()=>MQ,makeIsGreaterThan:()=>NQ,makeIsBetween:()=>CQ,makeFilterGroup:()=>Au,makeFilter:()=>F0,make:()=>T,link:()=>O0,isUppercased:()=>yu,isUnique:()=>mN,isUncapitalized:()=>hu,isUint32:()=>uu,isUUID:()=>ju,isULID:()=>Eu,isTrimmed:()=>jN,isStringSymbol:()=>Tu,isStringFinite:()=>wu,isStringBigInt:()=>Cu,isStartsWith:()=>vu,isSizeBetween:()=>Wl,isSchemaError:()=>Pf,isSchema:()=>m2,isPropertyNames:()=>ql,isPropertiesLengthBetween:()=>_l,isPattern:()=>RQ,isNonEmpty:()=>gN,isMultipleOf:()=>cu,isMinSize:()=>Zl,isMinProperties:()=>Hl,isMinLength:()=>bN,isMaxSize:()=>Kl,isMaxProperties:()=>Vl,isMaxLength:()=>Gl,isLowercased:()=>bu,isLessThanOrEqualToDate:()=>nu,isLessThanOrEqualToBigInt:()=>tu,isLessThanOrEqualToBigDecimal:()=>Jl,isLessThanOrEqualTo:()=>du,isLessThanDate:()=>ou,isLessThanBigInt:()=>su,isLessThanBigDecimal:()=>Yl,isLessThan:()=>pu,isLengthBetween:()=>hN,isInt32:()=>fu,isInt:()=>u2,isIncludes:()=>ku,isGreaterThanOrEqualToDate:()=>ru,isGreaterThanOrEqualToBigInt:()=>yN,isGreaterThanOrEqualToBigDecimal:()=>Ql,isGreaterThanOrEqualTo:()=>xN,isGreaterThanDate:()=>lu,isGreaterThanBigInt:()=>au,isGreaterThanBigDecimal:()=>Xl,isGreaterThan:()=>mu,isFinite:()=>SN,isEndsWith:()=>xu,isDateValid:()=>kN,isCapitalized:()=>gu,isBetweenDate:()=>iu,isBetweenBigInt:()=>eu,isBetweenBigDecimal:()=>$l,isBetween:()=>$W,isBase64Url:()=>Su,isBase64:()=>EN,is:()=>WN,instanceOf:()=>p8,fromURLSearchParams:()=>cl,fromJsonString:()=>QM,fromFormData:()=>dl,fromBrand:()=>Bu,flip:()=>rK,fieldsAssign:()=>Ju,extendTo:()=>Gu,encodeUnknownSync:()=>df,encodeUnknownResult:()=>gf,encodeUnknownPromise:()=>mf,encodeUnknownOption:()=>yf,encodeUnknownExit:()=>DN,encodeUnknownEffect:()=>_N,encodeTo:()=>YW,encodeSync:()=>cf,encodeResult:()=>hf,encodePromise:()=>pf,encodeOption:()=>bf,encodeKeys:()=>$u,encodeExit:()=>kf,encodeEffect:()=>qN,encode:()=>Fu,decodeUnknownSync:()=>vf,decodeUnknownResult:()=>If,decodeUnknownPromise:()=>Ef,decodeUnknownOption:()=>Cf,decodeUnknownExit:()=>VN,decodeUnknownEffect:()=>HN,decodeTo:()=>m,decodeSync:()=>xf,decodeResult:()=>jf,decodePromise:()=>Sf,decodeOption:()=>Tf,decodeExit:()=>wf,decodeEffect:()=>Af,decode:()=>zu,declareConstructor:()=>c1,declare:()=>z4,check:()=>qu,catchEncodingWithContext:()=>wN,catchEncoding:()=>Ou,catchDecodingWithContext:()=>AN,catchDecoding:()=>Uu,brand:()=>NN,asserts:()=>Mf,asClass:()=>ff,annotateKey:()=>Ff,annotateEncoded:()=>zf,annotate:()=>Of,Void:()=>Xu,UnknownFromJsonString:()=>pl,Unknown:()=>p2,UniqueSymbol:()=>Yu,UniqueArray:()=>Vu,Union:()=>o0,UndefinedOr:()=>c2,Undefined:()=>sK,Uint8ArrayFromHex:()=>Qr,Uint8ArrayFromBase64Url:()=>Xr,Uint8ArrayFromBase64:()=>el,Uint8Array:()=>n2,URLSearchParams:()=>$M,URLFromString:()=>vl,URL:()=>aN,TupleWithRest:()=>Ku,Tuple:()=>B9,Trimmed:()=>ZM,Trim:()=>rl,Tree:()=>kr,TimeZoneOffset:()=>Gr,TimeZoneNamedFromString:()=>Zr,TimeZoneNamed:()=>HM,TimeZoneFromString:()=>Kr,TimeZone:()=>_M,TemplateLiteralParser:()=>sf,TemplateLiteral:()=>af,TaggedUnion:()=>Nu,TaggedStruct:()=>f2,TaggedErrorClass:()=>Dr,TaggedClass:()=>qr,Symbol:()=>ON,StructWithRest:()=>Zu,Struct:()=>R0,StringFromUriComponent:()=>al,StringFromHex:()=>il,StringFromBase64Url:()=>nl,StringFromBase64:()=>ol,String:()=>r,StandardSchemaV1FailureResult:()=>sl,SchemaError:()=>V4,Result:()=>Rl,RegExp:()=>Sl,RedactedFromValue:()=>Nl,Redacted:()=>pN,Record:()=>zN,ReadonlySet:()=>Il,ReadonlyMap:()=>Cl,PropertyKey:()=>iK,OptionFromUndefinedOr:()=>Ol,OptionFromOptionalNullOr:()=>Pl,OptionFromOptionalKey:()=>Fl,OptionFromOptional:()=>Ll,OptionFromNullishOr:()=>zl,OptionFromNullOr:()=>Ul,Option:()=>J5,Opaque:()=>Mu,ObjectKeyword:()=>Qu,NumberFromString:()=>fl,Number:()=>X6,NullishOr:()=>PN,NullOr:()=>XW,Null:()=>aK,NonEmptyString:()=>Dl,NonEmptyArray:()=>Wu,Never:()=>ef,MutableJson:()=>br,Literals:()=>eK,Literal:()=>X1,Json:()=>yr,Int:()=>GM,HashSet:()=>jl,HashMap:()=>Tl,FormData:()=>JM,FiniteFromString:()=>ul,Finite:()=>o2,File:()=>YM,Exit:()=>wl,ErrorWithStack:()=>nN,ErrorClass:()=>OM,Error:()=>oN,Enum:()=>tf,DurationFromString:()=>yl,DurationFromNanos:()=>gl,DurationFromMillis:()=>hl,Duration:()=>r2,DefectWithStack:()=>Al,Defect:()=>Ml,DateValid:()=>tN,DateTimeZonedFromString:()=>Wr,DateTimeZoned:()=>DM,DateTimeUtcFromString:()=>Jr,DateTimeUtcFromMillis:()=>$r,DateTimeUtcFromDate:()=>Yr,DateTimeUtc:()=>i2,DateFromString:()=>xl,Date:()=>ZW,Class:()=>UM,Chunk:()=>El,Char:()=>Bl,CauseReason:()=>oK,Cause:()=>nK,BooleanFromBit:()=>tl,Boolean:()=>UN,BigIntFromString:()=>ll,BigInt:()=>d2,BigDecimalFromString:()=>ml,BigDecimal:()=>XM,ArrayEnsure:()=>Hu,Array:()=>c0,Any:()=>PQ});var KB=/^[+-]?\d+$/,c$="~effect/BigDecimal",mv={[c$]:c$,[W0](){let X=l$(this);return f0(s(X.value),c8(X.scale))},[H0](X){return u$(X)&&dv(this,X)},toString(){return`BigDecimal(${y8(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[a0](){return this.toJSON()},pipe(){return a(this,arguments)}},u$=(X)=>M(X,c$),S6=(X,Q)=>{let Y=Object.create(mv);return Y.value=X,Y.scale=Q,Y},HB=(X,Q)=>{if(X!==k8&&X%f$===k8)throw RangeError("Value must be normalized");let Y=S6(X,Q);return Y.normalized=Y,Y},k8=BigInt(0);var f$=BigInt(10),VB=HB(k8,0);var l$=(X)=>{if(X.normalized===void 0)if(X.value===k8)X.normalized=VB;else{let Q=`${X.value}`,Y=0;for(let G=Q.length-1;G>=0;G--)if(Q[G]==="0")Y++;else break;if(Y===0)X.normalized=X;let J=BigInt(Q.substring(0,Q.length-Y)),$=X.scale-Y;X.normalized=HB(J,$)}return X.normalized},QY=B(2,(X,Q)=>{if(Q>X.scale)return S6(X.value*f$**BigInt(Q-X.scale),Q);if(Q<X.scale)return S6(X.value/f$**BigInt(X.scale-Q),Q);return X});var c5=S9((X,Q)=>{let Y=D1(WB(X),WB(Q));if(Y!==0)return Y;if(X.scale>Q.scale)return T8(X.value,QY(Q,X.scale).value);if(X.scale<Q.scale)return T8(QY(X,Q.scale).value,Q.value);return T8(X.value,Q.value)});var WB=(X)=>X.value===k8?0:X.value<k8?-1:1,pv=(X)=>X.value<k8?S6(-X.value,X.scale):X;var r$=s0((X,Q)=>{if(X.scale>Q.scale)return QY(Q,X.scale).value===X.value;if(X.scale<Q.scale)return QY(X,Q.scale).value===Q.value;return X.value===Q.value}),dv=B(2,(X,Q)=>r$(X,Q));var _B=(X)=>{if(X==="")return F(VB);let Q,Y,J=X.search(/[eE]/);if(J!==-1){let W=X.slice(J+1);if(Q=X.slice(0,J),Y=Number(W),Q===""||!Number.isSafeInteger(Y)||!KB.test(W))return x()}else Q=X,Y=0;let $,G,Z=Q.search(/\./);if(Z!==-1){let W=Q.slice(0,Z),H=Q.slice(Z+1);$=`${W}${H}`,G=H.length}else $=Q,G=0;if(!KB.test($))return x();let K=G-Y;if(!Number.isSafeInteger(K))return x();return F(S6(BigInt($),K))};var y8=(X)=>{let Q=l$(X);if(Math.abs(Q.scale)>=16)return cv(Q);let Y=Q.value<k8,J=Y?`${Q.value}`.substring(1):`${Q.value}`,$,G;if(Q.scale>=J.length)$="0",G="0".repeat(Q.scale-J.length)+J;else{let K=J.length-Q.scale;if(K>J.length){let W=K-J.length;$=`${J}${"0".repeat(W)}`,G=""}else G=J.slice(K),$=J.slice(0,K)}let Z=G===""?$:`${$}.${G}`;return Y?`-${Z}`:Z},cv=(X)=>{if(fv(X))return"0e+0";let Q=l$(X),Y=`${pv(Q).value}`,J=Y.slice(0,1),$=Y.slice(1),G=`${uv(Q)?"-":""}${J}`;if($!=="")G+=`.${$}`;let Z=$.length-Q.scale;return`${G}e${Z>=0?"+":""}${Z}`};var fv=(X)=>X.value===k8,uv=(X)=>X.value<k8;var DB="~effect/collections/Chunk";function lv(X,Q,Y,J,$){for(let G=Q;G<Math.min(X.length,Q+$);G++)Y[J+G-Q]=X[G];return Y}var BB=[],n$=(X)=>s0((Q,Y)=>Q.length===Y.length&&TX(Q).every((J,$)=>X(J,IX(Y,$)))),rv=n$(o),ov={[DB]:{_A:(X)=>X},toString(){return`Chunk(${g(TX(this))})`},toJSON(){return{_id:"Chunk",values:G1(TX(this))}},[a0](){return this.toJSON()},[H0](X){return YY(X)&&rv(this,X)},[W0](){return M9(TX(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return BB[Symbol.iterator]();default:return TX(this)[Symbol.iterator]()}},pipe(){return a(this,arguments)}},i$=(X)=>{let Q=Object.create(ov);switch(Q.backing=X,X._tag){case"IEmpty":{Q.length=0,Q.depth=0,Q.left=Q,Q.right=Q;break}case"IConcat":{Q.length=X.left.length+X.right.length,Q.depth=1+Math.max(X.left.depth,X.right.depth),Q.left=X.left,Q.right=X.right;break}case"IArray":{Q.length=X.array.length,Q.depth=0,Q.left=J4,Q.right=J4;break}case"ISingleton":{Q.length=1,Q.depth=0,Q.left=J4,Q.right=J4;break}case"ISlice":{Q.length=X.length,Q.depth=X.chunk.depth+1,Q.left=J4,Q.right=J4;break}}return Q},YY=(X)=>M(X,DB),J4=i$({_tag:"IEmpty"}),nv=()=>J4;var iv=(X)=>i$({_tag:"ISingleton",a:X}),JY=(X)=>YY(X)?X:sv(Z1(X)),o$=(X,Q,Y)=>{switch(X.backing._tag){case"IArray":{lv(X.backing.array,0,Q,Y,X.length);break}case"IConcat":{o$(X.left,Q,Y),o$(X.right,Q,Y+X.left.length);break}case"ISingleton":{Q[Y]=X.backing.a;break}case"ISlice":{let J=0,$=Y;while(J<X.length)Q[$]=IX(X,J),J+=1,$+=1;break}}};var av=(X)=>{switch(X.backing._tag){case"IEmpty":return BB;case"IArray":return X.backing.array;default:{let Q=Array(X.length);return o$(X,Q,0),X.backing={_tag:"IArray",array:Q},X.left=J4,X.right=J4,X.depth=0,Q}}},TX=av;var sv=(X)=>X.length===0?nv():X.length===1?iv(X[0]):i$({_tag:"IArray",array:X});var IX=B(2,(X,Q)=>{let Y=Math.floor(Q);switch(X.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${Y}`);case"ISingleton":{if(Q!==0)throw Error(`Index out of bounds: ${Y}`);return X.backing.a}case"IArray":{if(Y>=X.length||Y<0)throw Error(`Index out of bounds: ${Y}`);return X.backing.array[Y]}case"IConcat":return Y<X.left.length?IX(X.left,Y):IX(X.right,Y-X.left.length);case"ISlice":return IX(X.backing.chunk,Y+X.backing.offset)}});var UB=(X)=>X.length;var a$=b5,OB=j6,zB=WD,FB=HD,LB=VD,PB=D$,s$=_D;var RB=y5;var NB=O$;var $Y=qD,MB=DD;var GY=BD;var t$=z$,jX=UX,AB=F$;var wB=L$,p4=UD;var CB=OX;var TB=N$;var IB=zD;var ZY=A$;var jB="~effect/encoding/EncodingError";class d4 extends JD("EncodingError"){[jB]=jB}var WY=(X)=>typeof X==="string"?XG(JG.encode(X)):XG(X),f5=(X)=>{let Q=mB(X),Y=Q.length;if(Y%4!==0)return f(new d4({kind:"Decode",module:"Base64",input:Q,message:`Length must be a multiple of 4, but is ${Y}`}));let J=Q.indexOf("=");if(J!==-1&&(J<Y-2||J===Y-2&&Q[Y-1]!=="="))return f(new d4({kind:"Decode",module:"Base64",input:Q,message:"Found a '=' character, but it is not at the end"}));try{let $=Q.endsWith("==")?2:Q.endsWith("=")?1:0,G=new Uint8Array(3*(Y/4)-$);for(let Z=0,K=0;Z<Y;Z+=4,K+=3){let W=KY(Q.charCodeAt(Z))<<18|KY(Q.charCodeAt(Z+1))<<12|KY(Q.charCodeAt(Z+2))<<6|KY(Q.charCodeAt(Z+3));G[K]=W>>16,G[K+1]=W>>8&255,G[K+2]=W&255}return l(G)}catch($){return f(new d4({kind:"Decode",module:"Base64",input:Q,message:$ instanceof Error?$.message:"Invalid input"}))}},kB=(X)=>z6(f5(X),(Q)=>$G.decode(Q)),yB=(X)=>typeof X==="string"?SB(JG.encode(X)):SB(X),QG=(X)=>{let Q=mB(X),Y=Q.length;if(Y%4===1)return f(new d4({module:"Base64Url",kind:"Decode",input:Q,message:`Length should be a multiple of 4, but is ${Y}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(Q))return f(new d4({module:"Base64Url",kind:"Decode",input:Q,message:"Invalid input"}));let J=Y%4===2?`${Q}==`:Y%4===3?`${Q}=`:Q;return J=J.replace(/-/g,"+").replace(/_/g,"/"),f5(J)},bB=(X)=>z6(QG(X),(Q)=>$G.decode(Q)),gB=(X)=>typeof X==="string"?vB(JG.encode(X)):vB(X),YG=(X)=>{let Q=new TextEncoder().encode(X);if(Q.length%2!==0)return f(new d4({module:"Hex",kind:"Decode",input:X,message:`Length must be a multiple of 2, but is ${Q.length}`}));try{let Y=Q.length/2,J=new Uint8Array(Y);for(let $=0;$<Y;$++){let G=xB(Q[$*2]),Z=xB(Q[$*2+1]);J[$]=G<<4|Z}return l(J)}catch(Y){return f(new d4({module:"Hex",kind:"Decode",input:X,message:Y instanceof Error?Y.message:"Invalid input"}))}},hB=(X)=>z6(YG(X),(Q)=>$G.decode(Q)),JG=new TextEncoder,$G=new TextDecoder,mB=(X)=>X.replace(/[\n\r]/g,""),XG=(X)=>{let Q=X.length,Y="",J;for(J=2;J<Q;J+=3)Y+=$4[X[J-2]>>2],Y+=$4[(X[J-2]&3)<<4|X[J-1]>>4],Y+=$4[(X[J-1]&15)<<2|X[J]>>6],Y+=$4[X[J]&63];if(J===Q+1)Y+=$4[X[J-2]>>2],Y+=$4[(X[J-2]&3)<<4],Y+="==";if(J===Q)Y+=$4[X[J-2]>>2],Y+=$4[(X[J-2]&3)<<4|X[J-1]>>4],Y+=$4[(X[J-1]&15)<<2],Y+="=";return Y};function KY(X){if(X>=EB.length)throw TypeError(`Invalid character ${String.fromCharCode(X)}`);let Q=EB[X];if(Q===255)throw TypeError(`Invalid character ${String.fromCharCode(X)}`);return Q}var $4=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],EB=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],SB=(X)=>XG(X).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),vB=(X)=>{let Q="";for(let Y=0;Y<X.length;++Y)Q+=ev[X[Y]];return Q},xB=(X)=>{if(48<=X&&X<=57)return X-48;if(97<=X&&X<=102)return X-97+10;if(65<=X&&X<=70)return X-65+10;throw TypeError("Invalid input")},ev=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var VY="~effect/collections/HashMap",B8=5,xX=1<<B8,Xx=xX/4,dB=xX/2,Qx=xX-1,Yx=(X)=>{return X=X-(X>>>1&1431655765),X=(X&858993459)+(X>>>2&858993459),(X+(X>>>4)&252645135)*16843009>>>24},EX=(X,Q)=>X>>>Q&Qx,c4=(X,Q)=>1<<EX(X,Q),HY=(X,Q)=>Yx(X&Q-1);function cB(X,Q,Y,J,$,G){if(Q>32)throw Error("HashMap: max depth exceeded");let Z=c4(Y,Q),K=c4($,Q);if(Z===K){let _=cB(X,Q+B8,Y,J,$,G);return new b8(X,Z,[_])}let W=Z|K,H=Z>>>0<K>>>0?[J,G]:[G,J];return new b8(X,W,H)}class u5{canEdit(X){return this.edit===X}}class fB extends u5{_tag="EmptyNode";edit=0;get size(){return 0}get(X,Q,Y){return x()}has(X,Q,Y){return!1}set(X,Q,Y,J,$,G){return G.value=!0,new G4(X,Y,J,$)}remove(X,Q,Y,J,$){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit(X){return!1}}class G4 extends u5{_tag="LeafNode";edit;hash;key;value;constructor(X,Q,Y,J){super();this.edit=X,this.hash=Q,this.key=Y,this.value=J}get size(){return 1}get(X,Q,Y){if(this.hash===Q&&o(this.key,Y))return F(this.value);return x()}has(X,Q,Y){return this.hash===Q&&o(this.key,Y)}set(X,Q,Y,J,$,G){if(this.hash===Y&&o(this.key,J)){if(o(this.value,$))return this;if(this.canEdit(X))return this.value=$,this;return new G4(X,Y,J,$)}if(G.value=!0,this.hash===Y)return new SX(X,Y,[[this.key,this.value],[J,$]]);let Z=c4(Y,Q),K=c4(this.hash,Q);if(Z===K)return new b8(X,Z,[this.set(X,Q+B8,Y,J,$,G)]);let W=Z|K,H=Z>>>0<K>>>0?[new G4(X,Y,J,$),this]:[this,new G4(X,Y,J,$)];return new b8(X,W,H)}remove(X,Q,Y,J,$){if(this.hash===Y&&o(this.key,J)){$.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class SX extends u5{_tag="CollisionNode";edit;hash;entries;constructor(X,Q,Y){super();this.edit=X,this.hash=Q,this.entries=Y}get size(){return this.entries.length}get(X,Q,Y){if(this.hash!==Q)return x();for(let[J,$]of this.entries)if(o(J,Y))return F($);return x()}has(X,Q,Y){if(this.hash!==Q)return!1;for(let[J]of this.entries)if(o(J,Y))return!0;return!1}set(X,Q,Y,J,$,G){if(this.hash!==Y)return G.value=!0,cB(X,Q,this.hash,this,Y,new G4(X,Y,J,$));for(let Z=0;Z<this.entries.length;Z++)if(o(this.entries[Z][0],J)){if(o(this.entries[Z][1],$))return this;if(this.canEdit(X))return this.entries[Z]=[J,$],this;let K=[...this.entries];return K[Z]=[J,$],new SX(X,this.hash,K)}if(G.value=!0,this.canEdit(X))return this.entries.push([J,$]),this;return new SX(X,this.hash,[...this.entries,[J,$]])}remove(X,Q,Y,J,$){if(this.hash!==Y)return this;let G=this.entries.findIndex(([K])=>o(K,J));if(G===-1)return this;if($.value=!0,this.entries.length===1)return;if(this.entries.length===2){let K=this.entries[G===0?1:0];return new G4(X,this.hash,K[0],K[1])}if(this.canEdit(X))return this.entries.splice(G,1),this;let Z=[...this.entries];return Z.splice(G,1),new SX(X,this.hash,Z)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class b8 extends u5{_tag="IndexedNode";edit;_size;bitmap;children;constructor(X,Q,Y){super();this.edit=X,this.bitmap=Q,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((X,Q)=>X+Q.size,0);return this._size}get(X,Q,Y){let J=c4(Q,X);if((this.bitmap&J)===0)return x();let $=HY(this.bitmap,J);return this.children[$].get(X+B8,Q,Y)}has(X,Q,Y){let J=c4(Q,X);if((this.bitmap&J)===0)return!1;let $=HY(this.bitmap,J);return this.children[$].has(X+B8,Q,Y)}set(X,Q,Y,J,$,G){let Z=c4(Y,Q),K=HY(this.bitmap,Z);if((this.bitmap&Z)!==0){let W=this.children[K],H=W.set(X,Q+B8,Y,J,$,G);if(W===H)return this;if(this.canEdit(X))return this.children[K]=H,this;let _=[...this.children];return _[K]=H,new b8(X,this.bitmap,_)}else{G.value=!0;let W=new G4(X,Y,J,$),H=this.bitmap|Z;if(this.canEdit(X)){if(this.children.splice(K,0,W),this.bitmap=H,this._size=void 0,this.children.length>dB)return this.expand(X,H,this.children);return this}let _=[...this.children];if(_.splice(K,0,W),_.length>dB)return this.expand(X,H,_);return new b8(X,H,_)}}remove(X,Q,Y,J,$){let G=c4(Y,Q);if((this.bitmap&G)===0)return this;let Z=HY(this.bitmap,G),K=this.children[Z],W=K.remove(X,Q+B8,Y,J,$);if(!$.value)return this;if(W===void 0){let _=this.bitmap^G;if(_===0)return;if(this.children.length===2){let q=this.children[Z===0?1:0];if(q._tag==="LeafNode")return q}if(this.canEdit(X))return this.children.splice(Z,1),this.bitmap=_,this._size=void 0,this;let V=[...this.children];return V.splice(Z,1),new b8(X,_,V)}if(K===W)return this;if(this.canEdit(X))return this.children[Z]=W,this;let H=[...this.children];return H[Z]=W,new b8(X,this.bitmap,H)}expand(X,Q,Y){let J=new globalThis.Array(xX),$=0;for(let G=0;G<xX;G++)if((Q&1<<G)!==0)J[G]=Y[$++];return new vX(X,Y.length,J)}iterator(){let X=0,Q;return{next:()=>{while(X<this.children.length){if(!Q)Q=this.children[X].iterator();let Y=Q.next();if(!Y.done)return Y;Q=void 0,X++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class vX extends u5{_tag="ArrayNode";edit;_size;count;children;constructor(X,Q,Y){super();this.edit=X,this.count=Q,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((X,Q)=>X+(Q?.size??0),0);return this._size}get(X,Q,Y){let J=EX(Q,X),$=this.children[J];return $?$.get(X+B8,Q,Y):x()}has(X,Q,Y){let J=EX(Q,X),$=this.children[J];return $?$.has(X+B8,Q,Y):!1}set(X,Q,Y,J,$,G){let Z=EX(Y,Q),K=this.children[Z];if(K){let W=K.set(X,Q+B8,Y,J,$,G);if(K===W)return this;if(this.canEdit(X))return this.children[Z]=W,this;let H=[...this.children];return H[Z]=W,new vX(X,this.count,H)}else{G.value=!0;let W=new G4(X,Y,J,$);if(this.canEdit(X))return this.children[Z]=W,this.count++,this._size=void 0,this;let H=[...this.children];return H[Z]=W,new vX(X,this.count+1,H)}}remove(X,Q,Y,J,$){let G=EX(Y,Q),Z=this.children[G];if(!Z)return this;let K=Z.remove(X,Q+B8,Y,J,$);if(!$.value)return this;let W=this.count-(K?0:1);if(W<Xx)return this.pack(X,G,K);if(Z===K)return this;if(this.canEdit(X)){if(this.children[G]=K,!K)this.count=W;return this._size=void 0,this}let H=[...this.children];return H[G]=K,new vX(X,W,H)}pack(X,Q,Y){let J=[],$=0,G=1;for(let Z=0;Z<this.children.length;Z++){let K=Z===Q?Y:this.children[Z];if(K)J.push(K),$|=G;G<<=1}return new b8(X,$,J)}iterator(){let X=0,Q;return{next:()=>{while(X<this.children.length){let Y=this.children[X];if(!Y){X++;continue}if(!Q)Q=Y.iterator();let J=Q.next();if(!J.done)return J;Q=void 0,X++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class _Y{[VY]=VY;_editable;_edit;_root;_size;constructor(X,Q,Y,J){this._editable=X,this._edit=Q,this._root=Y,this._size=J}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[H0](X){if(GG(X)){let Q=X;if(this.size!==Q.size)return!1;for(let[Y,J]of this){let $=G3(X,rB(Y));if(T0($)||!o(J,$.value))return!1}return!0}return!1}[W0](){let X=C0("HashMap");for(let[Q,Y]of this)X=X^s(Q)+s(Y);return X}[a0](){return G1(this)}toString(){return`HashMap(${g(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([X,Q])=>[G1(X),G1(Q)])}}pipe(){return a(this,arguments)}}var uB=new fB,GG=(X)=>M(X,VY),ZG=()=>new _Y(!1,0,uB,0);var lB=(X)=>{let Q=uB,Y=0,J={value:!1};for(let[$,G]of X){let Z=s($);if(J.value=!1,Q=Q.set(NaN,0,Z,$,G,J),J.value)Y++}return new _Y(!1,0,Q,Y)};var rB=B(2,(X,Q)=>{return X._root.get(0,s(Q),Q)});var KG=B(2,(X,Q)=>{return X._root.has(0,s(Q),Q)});var WG=B(3,(X,Q,Y)=>{let J=X,$=s(Q),G={value:!1},Z=J._editable?J._edit:NaN,K=J._root.set(Z,0,$,Q,Y,G);if(J._editable){if(J._root=K,G.value)J._size++;return X}if(J._root===K)return X;return new _Y(!1,J._edit,K,J._size+(G.value?1:0))}),HG=(X)=>{let Q=X[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let Y=Q.next();if(Y.done)return{done:!0,value:void 0};return{done:!1,value:Y.value[0]}}}};var oB=(X)=>{let Q=X[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return Q.next()}}},qY=(X)=>X.size;var iB=GG;var DY=lB;var Gx=oB,BY=(X)=>Array.from(Gx(X)),aB=qY;var kX="~effect/collections/HashSet",Kx={[W0](){return s(kX)},[H0](X){return VG(X)&&UY(this)===UY(X)&&eB(this,(Q)=>tB(X,Q))},[Symbol.iterator](){return HG(_G(this))},toString(){return`HashSet(${g(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:G1(Array.from(this))}},[a0](){return this.toJSON()},pipe(){return a(this,arguments)}},Wx=(X)=>{let Q=Object.create(Kx);return Q[kX]=kX,Q.keyMap=X,Q},VG=(X)=>M(X,kX),_G=(X)=>X.keyMap;var sB=(X)=>{let Q=ZG();for(let Y of X)Q=WG(Q,Y,!0);return Wx(Q)},tB=(X,Q)=>KG(_G(X),Q);var UY=(X)=>qY(_G(X));var eB=(X,Q)=>{for(let Y of X)if(!Q(Y))return!1;return!0};var OY=sB,XU=VG;var QU=UY;function U8(X){return X.checks?X.checks[X.checks.length-1].annotations:X.annotations}function zY(X){return(Q)=>U8(Q)?.[X]}var l5=zY("identifier"),qG=zY("title");var YU=zY("brands"),FY=d0((X)=>{let Q=l5(X);if(typeof Q==="string")return Q;return X.getExpected(FY)});var X00=globalThis.Boolean;var JU=o8((X,Q)=>X||Q,!1);function r5(X,Q,Y){if(Q==="__proto__")Object.defineProperty(X,Q,{value:Y,writable:!0,enumerable:!0,configurable:!0});else X[Q]=Y;return X}var Q00=globalThis.RegExp;var LY=(X)=>X.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var x6=new WeakMap,GU=(X)=>{if(x6.has(X))return x6.get(X);else throw Error("Unable to get redacted value"+(X.label?` with label: "${X.label}"`:""))};var ZU="~effect/data/Redacted",DG=(X)=>M(X,ZU),Z4=(X,Q)=>{let Y=Object.create(Bx);if(Q?.label)Y.label=Q.label;return x6.set(Y,X),Y},Bx={[ZU]:{_A:(X)=>X},label:void 0,...w8,toJSON(){return this.toString()},toString(){return`<redacted${Q8(this.label)?":"+this.label:""}>`},[W0](){return s(x6.get(this))},[H0](X){return DG(X)&&o(x6.get(this),x6.get(X))}},PY=GU;var KU=(X)=>s0((Q,Y)=>X(PY(Q),PY(Y)));var BG="~effect/SchemaIssue/Issue";function Ux(X){return M(X,BG)}class s1{[BG]=BG;toString(){return zx(this)}}class NY extends s1{_tag="Filter";actual;filter;issue;constructor(X,Q,Y){super();this.actual=X,this.filter=Q,this.issue=Y}}class zG extends s1{_tag="Encoding";ast;actual;issue;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.issue=Y}}class A0 extends s1{_tag="Pointer";path;issue;constructor(X,Q){super();this.path=X,this.issue=Q}}class gX extends s1{_tag="MissingKey";annotations;constructor(X){super();this.annotations=X}}class MY extends s1{_tag="UnexpectedKey";ast;actual;constructor(X,Q){super();this.ast=X,this.actual=Q}}class q0 extends s1{_tag="Composite";ast;actual;issues;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.issues=Y}}class x0 extends s1{_tag="InvalidType";ast;actual;constructor(X,Q){super();this.ast=X,this.actual=Q}}class Z0 extends s1{_tag="InvalidValue";actual;annotations;constructor(X,Q){super();this.actual=X,this.annotations=Q}}class o5 extends s1{_tag="Forbidden";actual;annotations;constructor(X,Q){super();this.actual=X,this.annotations=Q}}class AY extends s1{_tag="AnyOf";ast;actual;issues;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.issues=Y}}class FG extends s1{_tag="OneOf";ast;actual;successes;constructor(X,Q,Y){super();this.ast=X,this.actual=Q,this.successes=Y}}function UG(X,Q){if(Ux(Q))return Q;if(typeof Q==="string")return new Z0(F(X),{message:Q});let Y=typeof Q.issue==="string"?new Z0(F(X),{message:Q.issue}):Q.issue;return new A0(Q.path,Y)}function VU(X,Q){if(Q===void 0)return;if(typeof Q==="boolean")return Q?void 0:new Z0(F(X));return UG(X,Q)}function _U(X,Q,Y){if(Array.isArray(Y)){if(F6(Y)){if(Y.length===1)return UG(X,Y[0]);return new q0(Q,F(X),E4(Y,(J)=>UG(X,J)))}return}return VU(X,Y)}var qU=(X)=>{let Q=bX(X);if(Q!==void 0)return Q;switch(X._tag){case"InvalidType":return OG(FY(X.ast),HU(X.actual));case"InvalidValue":return`Invalid data ${HU(X.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${g(X.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${g(X.actual)}`}},DU=(X)=>{return bX(X.issue)??bX(X)};function BU(X){return(Q)=>({issues:k6(Q,[],X?.leafHook??qU,X?.checkHook??DU)})}function OG(X,Q){return`Expected ${X}, got ${Q}`}function k6(X,Q,Y,J){switch(X._tag){case"Filter":{let $=J(X);if($!==void 0)return[{path:Q,message:$}];switch(X.issue._tag){case"InvalidValue":return[{path:Q,message:OG(UU(X.filter),g(X.actual))}];default:return k6(X.issue,Q,Y,J)}}case"Encoding":return k6(X.issue,Q,Y,J);case"Pointer":return k6(X.issue,[...Q,...X.path],Y,J);case"Composite":return X.issues.flatMap(($)=>k6($,Q,Y,J));case"AnyOf":{let $=bX(X);if(X.issues.length===0){if($!==void 0)return[{path:Q,message:$}];let G=OG(FY(X.ast),g(X.actual));return[{path:Q,message:G}]}return X.issues.flatMap((G)=>k6(G,Q,Y,J))}default:return[{path:Q,message:Y(X)}]}}function UU(X){let Q=X.annotations?.expected;if(typeof Q==="string")return Q;switch(X._tag){case"Filter":return"<filter>";case"FilterGroup":return X.checks.map((Y)=>UU(Y)).join(" & ")}}function Ox(){return(X)=>k6(X,[],qU,DU).map(Fx).join(`
27
- `)}var zx=Ox();function Fx(X){let Q=X.message;if(X.path&&X.path.length>0){let Y=hQ(X.path);Q+=`
28
- at ${Y}`}return Q}function bX(X){switch(X._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return yX(X.ast.annotations);case"InvalidValue":case"Forbidden":return yX(X.annotations);case"MissingKey":return yX(X.annotations,"messageMissingKey");case"UnexpectedKey":return yX(X.ast.annotations,"messageUnexpectedKey");case"Filter":return yX(X.filter.annotations);case"Encoding":return bX(X.issue)}}function yX(X,Q="message"){let Y=X?.[Q];if(typeof Y==="string")return Y}function HU(X){if(T0(X))return"no value provided";return g(X.value)}function RY(X){switch(X._tag){case"MissingKey":return X;case"Forbidden":return new o5(I4(X.actual,Z4),X.annotations);case"Filter":return new NY(Z4(X.actual),X.filter,RY(X.issue));case"Pointer":return new A0(X.path,RY(X.issue));case"Encoding":case"InvalidType":case"InvalidValue":case"Composite":return new Z0(I4(X.actual,Z4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new Z0(F(Z4(X.actual)))}}class K4 extends G6{run;constructor(X){super();this.run=X}map(X){return new K4((Q,Y)=>this.run(Q,Y).pipe(p5(I4(X))))}compose(X){if(OU(this))return X;if(OU(X))return this;return new K4((Q,Y)=>this.run(Q,Y).pipe(D8((J)=>X.run(J,Y))))}}function Lx(X){return new K4((Q)=>v(X(Q)))}function LG(X){return Lx((Q)=>new o5(Q,{message:X(Q)}))}var zU=new K4(h);function OU(X){return X.run===zU.run}function T1(){return zU}function PG(X){return new K4((Q,Y)=>T0(Q)?x8:X(Q.value,Y))}function n(X){return wY(I4(X))}function I1(X){return PG((Q,Y)=>X(Q,Y).pipe(p5(F)))}function wY(X){return new K4((Q)=>h(X(Q)))}function RG(){return new K4(()=>x8)}function mX(X){return new K4((Q)=>{let Y=L5(Q,$1);return B1(Y)?h(Y):AX(X,F)})}function y6(){return n(globalThis.String)}function CY(){return n(globalThis.Number)}function FU(){return n(globalThis.BigInt)}function LU(){return n((X)=>new globalThis.Date(X))}function PU(){return n(ND)}function RU(X){return PG((Q)=>m4({try:()=>F(JSON.parse(Q,X?.reviver)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function NU(X){return PG((Q)=>m4({try:()=>F(JSON.stringify(Q,X?.replacer,X?.space)),catch:(Y)=>new Z0(F(Q),{message:globalThis.String(Y)})}))}function MU(X){let Q=X?.separator??",";return n((Y)=>Y===""?[]:Y.split(Q))}function NG(){return n(WY)}function TY(){return n(yB)}function IY(){return n(gB)}function AU(){return I1((X)=>v9(f5(X),(Q)=>new Z0(F(X),{message:Q.message})).asEffect())}function wU(){return I1((X)=>I8(kB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function CU(){return I1((X)=>I8(QG(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function TU(){return I1((X)=>I8(bB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function IU(){return I1((X)=>I8(YG(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function jU(){return I1((X)=>I8(hB(X),{onFailure:(Q)=>v(new Z0(F(X),{message:Q.message})),onSuccess:h}))}function EU(){return n(encodeURIComponent)}function SU(){return I1((X)=>{try{return h(globalThis.decodeURIComponent(X))}catch(Q){return v(new Z0(F(X),{message:Q instanceof URIError?Q.message:"Invalid URI component"}))}})}function MG(){return I1((X)=>{return G8($Y(X),{onNone:()=>v(new Z0(F(X),{message:"Invalid DateTime input"})),onSome:(Q)=>h(GY(Q))})})}function vU(){return n((X)=>bU(Array.from(X.entries())))}var Px=gU((X)=>typeof X==="string"||typeof Blob<"u"&&X instanceof Blob);function xU(){return n((X)=>{let Q=new FormData;if(typeof X==="object"&&X!==null)Px(X).forEach(([J,$])=>{Q.append(J,$)});return Q})}function kU(){return n((X)=>bU(Array.from(X.entries())))}var Rx=gU(Q8);function yU(){return n((X)=>{if(typeof X==="object"&&X!==null)return new URLSearchParams(Rx(X));return new URLSearchParams})}var Nx=/^\d+$/;function Mx(X){if(X==="")return[""];let Q=X.replace(/\[(.*?)\]/g,".$1"),Y=Q.split("."),J=Q.startsWith(".")?1:0;return Y.slice(J).map(($)=>Nx.test($)?globalThis.Number($):$)}function bU(X){let Q={};return X.forEach(([Y,J])=>{let $=Mx(Y),G=Q;$.forEach((Z,K)=>{let W=K===$.length-1;if(Array.isArray(G)&&Z==="")if(W)G.push(J);else{let H=$[K+1],_=typeof H==="number"||H==="",V=G.length;if(G[V]===void 0)G[V]=_?[]:{};G=G[V]}else if(W)if(Array.isArray(G[Z]))G[Z].push(J);else if(Object.prototype.hasOwnProperty.call(G,Z))G[Z]=[G[Z],J];else G[Z]=J;else{let H=$[K+1],_=typeof H==="number"||H==="";if(G[Z]===void 0)G[Z]=_?[]:{};G=G[Z]}})}),Q}function gU(X){return(Q)=>{let Y=[];function J($,G){if(X(G))Y.push([$,G]);else if(Array.isArray(G))if(G.every(X))G.forEach((K)=>{Y.push([$,K])});else G.forEach((K,W)=>{J(`${$}[${W}]`,K)});else if(typeof G==="object"&&G!==null)for(let[Z,K]of Object.entries(G))J(`${$}[${Z}]`,K)}for(let[$,G]of Object.entries(Q))J($,G);return Y}}class pX{_tag="Middleware";decode;encode;constructor(X,Q){this.decode=X,this.encode=Q}flip(){return new pX(this.encode,this.decode)}}var wG="~effect/SchemaTransformation/Transformation";class K0{[wG]=wG;_tag="Transformation";decode;encode;constructor(X,Q){this.decode=X,this.encode=Q}flip(){return new K0(this.encode,this.decode)}compose(X){return new K0(this.decode.compose(X.decode),X.encode.compose(this.encode))}}function Ax(X){return M(X,wG)}var jY=(X)=>{if(Ax(X))return X;return new K0(X.decode,X.encode)};function t1(X){return new K0(I1(X.decode),I1(X.encode))}function v0(X){return new K0(n(X.decode),n(X.encode))}function EY(X){return new K0(wY(X.decode),wY(X.encode))}function hU(){return new K0(PU(),T1())}var wx=new K0(T1(),T1());function b6(){return wx}var n5=new K0(CY(),y6()),SY=new K0(FU(),y6()),CG=new K0(LU(),n(F3)),mU=t1({decode:(X)=>G8(jH(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Duration string: ${X}`})),onSome:h}),encode:(X)=>h(globalThis.String(X))}),pU=t1({decode:(X)=>h(a8(X)),encode:(X)=>G8(EH(X),{onNone:()=>v(new Z0(F(X),{message:`Unable to encode ${X} into a bigint`})),onSome:(Q)=>h(Q)})}),dU=v0({decode:(X)=>S4(X),encode:(X)=>v4(X)}),dX=(X)=>v0({decode:(Q)=>{let Y=Error(Q.message);if(typeof Q.name==="string"&&Q.name!=="Error")Y.name=Q.name;if(typeof Q.stack==="string")Y.stack=Q.stack;return Y},encode:(Q)=>{let Y={name:Q.name,message:Q.message};if(X?.includeStack&&typeof Q.stack==="string")Y.stack=Q.stack;return Y}});function cU(){return v0({decode:WH,encode:I3})}function fU(){return v0({decode:KH,encode:B6})}function uU(X){return v0({decode:ZH,encode:X?.onNoneEncoding===null?I3:B6})}function lU(){return EY({decode:F,encode:F5})}function rU(){return EY({decode:(X)=>X.pipe(L5($1),F),encode:F5})}var TG=t1({decode:(X)=>m4({try:()=>new URL(X),catch:()=>new Z0(F(X),{message:`Invalid URL string: ${X}`})}),encode:(X)=>h(X.href)}),IG=t1({decode:(X)=>{let Q=_B(X);return T0(Q)?v(new Z0(F(X),{message:`Invalid BigDecimal string: ${X}`})):h(Q.value)},encode:(X)=>h(y8(X))}),jG=new K0(AU(),NG()),oU=new K0(wU(),NG()),nU=new K0(TU(),TY()),iU=new K0(jU(),IY()),aU=new K0(SU(),EU()),sU=new K0(RU(),NU()),tU=new K0(vU(),xU()),eU=new K0(kU(),yU()),XO=v0({decode:(X)=>jX(X),encode:(X)=>X.offset}),EG=t1({decode:(X)=>{return G8(AB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid IANA time zone: ${X}`})),onSome:h})},encode:(X)=>h(X.id)}),SG=t1({decode:(X)=>{return G8(wB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid time zone: ${X}`})),onSome:h})},encode:(X)=>h(p4(X))}),vG=t1({decode:(X)=>{return G8($Y(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid UTC DateTime string: ${X}`})),onSome:(Q)=>h(GY(Q))})},encode:(X)=>h(IB(X))}),xG=t1({decode:(X)=>{return G8(MB(X),{onNone:()=>v(new Z0(F(X),{message:`Invalid Zoned DateTime string: ${X}`})),onSome:h})},encode:(X)=>h(ZY(X))});function h6(X){return(Q)=>Q._tag===X}function HO(X){return M(X,fX)&&X[fX]===fX}var g8=h6("Declaration");var Cx=h6("Never");var vY=h6("Literal"),Tx=h6("UniqueSymbol");var kY=h6("Arrays"),VO=h6("Objects"),yY=h6("Union");class B0{to;transformation;constructor(X,Q){this.to=X,this.transformation=Q}}var a5={};class W4{isOptional;isMutable;defaultValue;annotations;constructor(X,Q,Y=void 0,J=void 0){this.isOptional=X,this.isMutable=Q,this.defaultValue=Y,this.annotations=J}}var fX="~effect/Schema";class k0{[fX]=fX;annotations;checks;encoding;context;constructor(X=void 0,Q=void 0,Y=void 0,J=void 0){this.annotations=X,this.checks=Q,this.encoding=Y,this.context=J}toString(){return`<${this._tag}>`}}class m6 extends k0{_tag="Declaration";typeParameters;run;constructor(X,Q,Y,J,$,G){super(Y,J,$,G);this.typeParameters=X,this.run=Q}getParser(){let X=this.run(this.typeParameters);return(Q,Y)=>{if(T0(Q))return x8;return p5(X(Q.value,this,Y),F)}}recur(X){let Q=i5(this.typeParameters,X);return Q===this.typeParameters?this:new m6(Q,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){let X=this.annotations?.expected;if(typeof X==="string")return X;return"<Declaration>"}}class _O extends k0{_tag="Null";getParser(){return eX(this,null)}getExpected(){return"null"}}var s5=new _O;class qO extends k0{_tag="Undefined";getParser(){return eX(this,void 0)}toCodecJson(){return D0(this,[DO])}getExpected(){return"undefined"}}var DO=new B0(s5,new K0(n(()=>{return}),n(()=>null))),yG=new qO;class BO extends k0{_tag="Void";getParser(){return eX(this,void 0)}toCodecJson(){return D0(this,[DO])}getExpected(){return"void"}}var UO=new BO;class OO extends k0{_tag="Never";getParser(){return F8(this,SW)}getExpected(){return"never"}}var zO=new OO;class FO extends k0{_tag="Any";getParser(){return F8(this,K3)}getExpected(){return"any"}}var LO=new FO;class PO extends k0{_tag="Unknown";getParser(){return F8(this,K3)}getExpected(){return"unknown"}}var g6=new PO;class RO extends k0{_tag="ObjectKeyword";getParser(){return F8(this,W3)}getExpected(){return"object | array | function"}}var NO=new RO;class bG extends k0{_tag="Enum";enums;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.enums=X}getParser(){let X=new Set(this.enums.map(([,Q])=>Q));return F8(this,(Q)=>X.has(Q))}toCodecStringTree(){if(this.enums.some(([X,Q])=>typeof Q==="number")){let X=Object.fromEntries(this.enums.map(([Q,Y])=>[globalThis.String(Y),Y]));return D0(this,[new B0(new g1(Object.keys(X).map((Q)=>new b1(Q)),"anyOf"),new K0(n((Q)=>X[Q]),y6()))])}return this}getExpected(){return this.enums.map(([X,Q])=>JSON.stringify(Q)).join(" | ")}}function MO(X){switch(X._tag){case"String":case"Number":case"BigInt":case"Literal":case"TemplateLiteral":return!0;case"Union":return X.types.every(MO);default:return!1}}class gG extends k0{_tag="TemplateLiteral";parts;encodedParts;constructor(X,Q,Y,J,$){super(Q,Y,J,$);let G=[];for(let Z of X){let K=J1(Z);if(MO(K))G.push(K);else throw Error(`Invalid TemplateLiteral part ${K._tag}`)}this.parts=X,this.encodedParts=G}getParser(X){let Q=X(this.asTemplateLiteralParser());return(Y,J)=>t0(Q(Y,J),{onSuccess:()=>Y,onFailure:($)=>new q0(this,Y,[$])})}getExpected(){return"string"}asTemplateLiteralParser(){let X=new H4(!1,this.parts.map(aO),[]),Q=oY(this);return rY(p6,X,new K0(I1((Y)=>{let J=Q.exec(Y);if(J)return h(J.slice(1,this.parts.length+1));return v(new Z0(F(Y),{message:`Expected a value matching ${Q.source}, got ${g(Y)}`}))}),n((Y)=>Y.join(""))))}}class hG extends k0{_tag="UniqueSymbol";symbol;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.symbol=X}getParser(){return eX(this,this.symbol)}toCodecStringTree(){return D0(this,[eO])}getExpected(){return globalThis.String(this.symbol)}}class b1 extends k0{_tag="Literal";literal;constructor(X,Q,Y,J,$){super(Q,Y,J,$);if(typeof X==="number"&&!globalThis.Number.isFinite(X))throw Error(`A numeric literal must be finite, got ${g(X)}`);this.literal=X}getParser(){return eX(this,this.literal)}toCodecJson(){return typeof this.literal==="bigint"?YO(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:YO(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function YO(X){let Q=globalThis.String(X.literal);return D0(X,[new B0(new b1(Q),new K0(n(()=>X.literal),n(()=>Q)))])}class AO extends k0{_tag="String";getParser(){return F8(this,Q8)}getExpected(){return"string"}}var p6=new AO;class wO extends k0{_tag="Number";getParser(){return F8(this,N9)}toCodecJson(){if(this.checks&&(cX(this.checks,"isFinite")||cX(this.checks,"isInt")))return this;return D0(this,[yx])}toCodecStringTree(){if(this.checks&&(cX(this.checks,"isFinite")||cX(this.checks,"isInt")))return D0(this,[mx]);return D0(this,[px])}getExpected(){return"number"}}function cX(X,Q){return X.some((Y)=>{switch(Y._tag){case"Filter":return Y.annotations?.meta?._tag===Q;case"FilterGroup":return cX(Y.checks,Q)}})}var mG=new wO;class CO extends k0{_tag="Boolean";getParser(){return F8(this,IW)}getExpected(){return"boolean"}}var TO=new CO;class IO extends k0{_tag="Symbol";getParser(){return F8(this,Z3)}toCodecStringTree(){return D0(this,[eO])}getExpected(){return"symbol"}}var jO=new IO;class EO extends k0{_tag="BigInt";getParser(){return F8(this,jW)}toCodecStringTree(){return D0(this,[dx])}getExpected(){return"bigint"}}var SO=new EO;class H4 extends k0{_tag="Arrays";isMutable;elements;rest;constructor(X,Q,Y,J,$,G,Z){super(J,$,G,Z);this.isMutable=X,this.elements=Q,this.rest=Y;let K=Q.findIndex(E0);if(K!==-1&&(Q.slice(K+1).some((W)=>!E0(W))||Y.length>1))throw Error("A required element cannot follow an optional element. ts(1257)");if(Y.length>1&&Y.slice(1).some(E0))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(X){let Q=this,Y=Q.elements.map((H)=>({ast:H,parser:X(H)})),J=Q.rest.map((H)=>({ast:H,parser:X(H)})),$=Y.length,[G,...Z]=J,K=Z.length;function W(H,_){if(_<$)return Y[_];else if(_>=H)return Z[_-H];return G}return CX(function*(H,_){if(H._tag==="None")return H;let V=H.value;if(!Array.isArray(V))return yield*v(new x0(Q,H));let q=V.length,D={ast:Q,getParser:W,oinput:H,len:q,tailThreshold:jx(q,$,K),output:new globalThis.Array(q),issues:void 0,options:_},U=pG(_?.concurrency),R=Ix(D,V,{concurrency:U?.concurrency,end:Q.rest.length===0?$:Math.max(q,$+K)});if(R)yield*R;if(Q.rest.length===0&&q>$)for(let L=$;L<=q-1;L++){let N=new A0([L],new MY(Q,V[L]));if(_.errors==="all")if(D.issues)D.issues.push(N);else D.issues=[N];else return yield*v(new q0(Q,H,[N]))}if(D.issues)return yield*v(new q0(Q,H,D.issues));return F(D.output)})}recur(X){let Q=i5(this.elements,X),Y=i5(this.rest,X);return Q===this.elements&&Y===this.rest?this:new H4(this.isMutable,Q,Y,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}var Ix=GX()({onItem(X,Q,Y){let J=Y<X.len?F(Q):x();return X.getParser(X.tailThreshold,Y).parser(J,X.options)},step(X,Q,Y,J){if(Y._tag==="Failure")return xY(X,X.ast,J,Y);else if(Y.value._tag==="Some")X.output[J]=Y.value.value;else{let $=X.getParser(X.tailThreshold,J);if(E0($.ast))return;let G=new A0([J],new gX($.ast.context?.annotations));if(X.options.errors==="all")if(X.issues)X.issues.push(G);else X.issues=[G];else return k5(new q0(X.ast,X.oinput,[G]))}}});function jx(X,Q,Y){return Math.max(Q,X-Y)}var pG=(X)=>{return X=X==="unbounded"?1/0:X??1,X>1?{concurrency:X}:void 0},xY=(X,Q,Y,J)=>{let $=S8(J.cause);if(u($))return J;let G=new A0([Y],$.success);if(X.options.errors==="all")if(X.issues)X.issues.push(G);else X.issues=[G];else return k5(new q0(Q,X.oinput,[G]))},lX="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",Ex=new globalThis.RegExp(`(?:${lX}|Infinity|-Infinity|NaN)`);function d6(X,Q){let Y=J1(Q);switch(Y._tag){case"String":return Object.keys(X);case"TemplateLiteral":{let J=oY(Y);return Object.keys(X).filter(($)=>J.test($))}case"Symbol":return Object.getOwnPropertySymbols(X);case"Number":return Object.keys(X).filter((J)=>Ex.test(J));case"Union":return[...new Set(Y.types.flatMap((J)=>d6(X,J)))];default:return[]}}class bY{name;type;constructor(X,Q){this.name=X,this.type=Q}}class gY{decode;encode;constructor(X,Q){this.decode=X,this.encode=Q}flip(){return new gY(this.encode,this.decode)}}class dG{parameter;type;merge;constructor(X,Q,Y){if(this.parameter=X,this.type=Q,this.merge=Y,E0(Q)&&!lO(Q))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class rX extends k0{_tag="Objects";propertySignatures;indexSignatures;constructor(X,Q,Y,J,$,G){super(Y,J,$,G);this.propertySignatures=X,this.indexSignatures=Q;let Z=X.map((K)=>K.name).filter((K,W,H)=>H.indexOf(K)!==W);if(Z.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(Z)}. ts(2300)`)}getParser(X){let Q=this,Y=[],J=new Set,$=[];for(let K of Q.propertySignatures)Y.push(K.name),J.add(K.name),$.push({ps:K,parser:X(K.type),name:K.name,type:K.type});let G=Q.indexSignatures.length;if(Q.propertySignatures.length===0&&Q.indexSignatures.length===0)return F8(Q,EQ);let Z=G>0?GX()({onItem:CX(function*(K,[W,H]){let V=X(iO(H.parameter))(F(W),K.options),q=W1(V)?V:yield*MX(V);if(q._tag==="Failure"){let N=xY(K,Q,W,q);if(N)yield*N;return}let D=F(K.input[W]),R=X(H.type)(D,K.options),L=W1(R)?R:yield*MX(R);if(L._tag==="Failure"){let N=xY(K,Q,W,L);if(N)yield*N;return}else if(q.value._tag==="Some"&&L.value._tag==="Some"){let N=q.value.value,P=L.value.value;if(H.merge&&H.merge.decode&&Object.hasOwn(K.out,N)){let[y,Y0]=H.merge.decode.combine([N,K.out[N]],[N,P]);r5(K.out,y,Y0)}else r5(K.out,N,P)}}),step:(K,W,H)=>H._tag==="Failure"?H:void 0}):void 0;return CX(function*(K,W){if(K._tag==="None")return K;let H=K.value;if(!(typeof H==="object"&&H!==null&&!Array.isArray(H)))return yield*v(new x0(Q,K));let _={},V={ast:Q,oinput:K,input:H,out:_,issues:void 0,options:W},q=W.errors==="all",D=W.onExcessProperty==="error",U=W.onExcessProperty==="preserve",R;if(Q.indexSignatures.length===0&&(D||U)){R=Reflect.ownKeys(H);for(let P=0;P<R.length;P++){let y=R[P];if(!J.has(y))if(D){let Y0=new A0([y],new MY(Q,H[y]));if(q){if(V.issues)V.issues.push(Y0);else V.issues=[Y0];continue}else return yield*v(new q0(Q,K,[Y0]))}else r5(_,y,H[y])}}let L=pG(W?.concurrency),N=Sx(V,$,L);if(N)yield*N;if(Z){let P=b3();for(let Y0=0;Y0<G;Y0++){let X8=Q.indexSignatures[Y0],G5=d6(H,X8.parameter);for(let _1=0;_1<G5.length;_1++){let mA=G5[_1];P.push([mA,X8])}}let y=Z(V,P,L);if(y)yield*y}if(V.issues)return yield*v(new q0(Q,K,V.issues));if(W.propertyOrder==="original"){let P=(R??Reflect.ownKeys(H)).concat(Y),y={};for(let Y0 of P)if(Object.hasOwn(_,Y0))r5(y,Y0,_[Y0]);return F(y)}return F(_)})}rebuild(X,Q){let Y=i5(this.propertySignatures,($)=>{let G=X($.type);return G===$.type?$:new bY($.name,G)}),J=i5(this.indexSignatures,($)=>{let G=X($.parameter),Z=X($.type),K=Q?$.merge?.flip():$.merge;return G===$.parameter&&Z===$.type&&K===$.merge?$:new dG(G,Z,K)});return Y===this.propertySignatures&&J===this.indexSignatures?this:new rX(Y,J,this.annotations,this.checks,void 0,this.context)}flip(X){return this.rebuild(X,!0)}recur(X){return this.rebuild(X,!1)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}}var Sx=GX()({onItem(X,Q){let Y=Object.hasOwn(X.input,Q.name)?F(X.input[Q.name]):x();return Q.parser(Y,X.options)},step(X,Q,Y){if(Y._tag==="Failure")return xY(X,X.ast,Q.name,Y);else if(Y.value._tag==="Some")r5(X.out,Q.name,Y.value.value);else if(!E0(Q.type)){let J=new A0([Q.name],new gX(Q.type.context?.annotations));if(X.options.errors==="all"){if(X.issues)X.issues.push(J);else X.issues=[J];return}else return k5(new q0(X.ast,X.oinput,[J]))}}});function vx(X,Q){if(!X)return Q.checks;if(!Q.checks)return X;return[...X,...Q.checks]}function hY(X,Q,Y){return new rX(Reflect.ownKeys(X).map((J)=>{return new bY(J,X[J].ast)}),[],Y,Q)}function oX(X){return X.ast}function cG(X,Q=void 0){return new H4(!1,X.map((Y)=>Y.ast),[],void 0,Q)}function mY(X,Q,Y){return new g1(X.map(oX),Q,void 0,Y)}function vO(X,Q){if(X.encoding||Q.some((G)=>G.encoding))throw Error("StructWithRest does not support encodings");let{propertySignatures:Y,indexSignatures:J,checks:$}=X;for(let G of Q)Y=Y.concat(G.propertySignatures),J=J.concat(G.indexSignatures),$=vx($,G);return new rX(Y,J,void 0,$)}function xO(X,Q){if(X.encoding)throw Error("TupleWithRest does not support encodings");return new H4(X.isMutable,X.elements,Q,void 0,X.checks)}function kO(X){switch(X._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return X.propertySignatures.length||X.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(X.enums.map(([,Q])=>typeof Q)));case"Literal":return[typeof X.literal];case"Union":return Array.from(new Set(X.types.flatMap(kO)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function nX(X){switch(X._tag){default:return[];case"Declaration":{let Q=X.annotations?.["~sentinels"];return Array.isArray(Q)?Q:[]}case"Objects":return X.propertySignatures.flatMap((Q)=>{let Y=Q.type;if(!E0(Y)){if(vY(Y))return[{key:Q.name,literal:Y.literal}];if(Tx(Y))return[{key:Q.name,literal:Y.symbol}]}return[]});case"Arrays":return X.elements.flatMap((Q,Y)=>{return vY(Q)&&!E0(Q)?[{key:Y,literal:Q.literal}]:[]});case"Suspend":return nX(X.thunk())}}var JO=new WeakMap;function xx(X){let Q=JO.get(X);if(Q)return Q;Q={};for(let Y of X){let J=J1(Y);if(Cx(J))continue;let $=kO(J),G=nX(J);Q.byType??={};for(let Z of $)(Q.byType[Z]??=[]).push(Y);if(G.length>0){Q.bySentinel??=new Map;for(let{key:Z,literal:K}of G){let W=Q.bySentinel.get(Z);if(!W)Q.bySentinel.set(Z,W=new Map);let H=W.get(K);if(!H)W.set(K,H=[]);H.push(Y)}}else{Q.otherwise??={};for(let Z of $)(Q.otherwise[Z]??=[]).push(Y)}}return JO.set(X,Q),Q}function $O(X){return(Q)=>{let Y=J1(Q);return Y._tag==="Literal"?Y.literal===X:Y._tag==="UniqueSymbol"?Y.symbol===X:!0}}function iX(X,Q){let Y=xx(Q),J=X===null?"null":Array.isArray(X)?"array":typeof X;if(Y.bySentinel){let $=Y.otherwise?.[J]??[];if(J==="object"||J==="array"){for(let[G,Z]of Y.bySentinel)if(Object.hasOwn(X,G)){let K=Z.get(X[G]);if(K)return[...K,...$].filter($O(X))}}return $}return(Y.byType?.[J]??[]).filter($O(X))}class g1 extends k0{_tag="Union";types;mode;constructor(X,Q,Y,J,$,G){super(Y,J,$,G);this.types=X,this.mode=Q}getParser(X){let Q=this;return(Y,J)=>{if(Y._tag==="None")return h(Y);let $=Y.value,G=iX($,Q.types),Z={ast:Q,recur:X,oinput:Y,input:$,out:void 0,successes:[],issues:void 0,options:J},K=pG(J?.concurrency),W=kx(Z,G,K);if(!W)return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]));return NX(W,(H)=>{return Z.out?h(Z.out):v(new AY(Q,$,Z.issues??[]))})}}recur(X){let Q=i5(this.types,X);return Q===this.types?this:new g1(Q,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(X){let Q=this.annotations?.expected;if(typeof Q==="string")return Q;if(this.types.length===0)return"never";let Y=this.types.map((J)=>{let $=J1(J);switch($._tag){case"Arrays":{let G=$.elements.filter(vY);if(G.length>0)return`${GO($.isMutable)}[ ${G.map((Z)=>X(Z)+ZO(Z.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let G=$.propertySignatures.filter((Z)=>vY(Z.type));if(G.length>0)return`{ ${G.map((Z)=>`${GO(Z.type.context?.isMutable)}${N4(Z.name)}${ZO(Z.type.context?.isOptional)}: ${X(Z.type)}`).join(", ")}, ... }`;break}}return X($)});return Array.from(new Set(Y)).join(" | ")}}var kx=GX()({onItem(X,Q){return X.recur(Q)(X.oinput,X.options)},step(X,Q,Y){if(Y._tag==="Failure"){let J=S8(Y.cause);if(u(J))return Y;if(X.issues)X.issues.push(J.success);else X.issues=[J.success]}else{if(X.out&&X.ast.mode==="oneOf")return X.successes.push(Q),k5(new FG(X.ast,X.input,X.successes));if(X.out=Y.value,X.successes.push(Q),X.ast.mode==="anyOf")return Z$}}}),yO=new g1([new b1("Infinity"),new b1("-Infinity"),new b1("NaN")],"anyOf"),yx=new B0(new g1([mG,yO],"anyOf"),new K0(CY(),n((X)=>globalThis.Number.isFinite(X)?X:globalThis.String(X))));function GO(X){return X?"":"readonly "}function ZO(X){return X?"?":""}function c6(X){let Q=!1,Y;return()=>{if(Q)return Y;return Y=X(),Q=!0,Y}}class pY extends k0{_tag="Suspend";thunk;constructor(X,Q,Y,J,$){super(Q,Y,J,$);this.thunk=c6(X)}getParser(X){return X(this.thunk())}recur(X){return new pY(()=>X(this.thunk()),this.annotations,this.checks,void 0,this.context)}getExpected(X){return X(this.thunk())}}class uX extends G6{_tag="Filter";run;annotations;aborted;constructor(X,Q=void 0,Y=!1){super();this.run=X,this.annotations=Q,this.aborted=Y}annotate(X){return new uX(this.run,{...this.annotations,...X},this.aborted)}abort(){return new uX(this.run,this.annotations,!0)}and(X,Q){return new f4([this,X],Q)}}class f4 extends G6{_tag="FilterGroup";checks;annotations;constructor(X,Q=void 0){super();this.checks=X,this.annotations=Q}annotate(X){return new f4(this.checks,{...this.annotations,...X})}and(X,Q){return new f4([this,X],Q)}}function fG(X,Q,Y=!1){return new uX((J,$,G)=>_U(J,$,X(J,$,G)),Q,Y)}function dY(X,Q){return new uX((Y)=>X(Y)?void 0:new Z0(F(Y)),Q,!0)}function aX(X,Q){let Y=X.source;return fG((J)=>X.test(J),{expected:`a string matching the RegExp ${Y}`,meta:{_tag:"isPattern",regExp:X},toArbitraryConstraint:{string:{patterns:[X.source]}},...Q})}function cY(X,Q){let Y=Object.getOwnPropertyDescriptors(X);return Q(Y),Object.create(Object.getPrototypeOf(X),Y)}function D0(X,Q){if(X.encoding===Q)return X;return cY(X,(Y)=>{Y.encoding.value=Q})}function fY(X,Q){if(X.context===Q)return X;return cY(X,(Y)=>{Y.context.value=Q})}function sX(X){return X.encoding?sX(X.encoding[X.encoding.length-1].to):X}function f6(X,Q){if(X.checks){let Y=X.checks[X.checks.length-1];return uY(X,Y7(X.checks.slice(0,-1),Y.annotate(Q)))}return cY(X,(Y)=>{Y.annotations.value={...Y.annotations.value,...Q}})}function uY(X,Q){if(X.checks===Q)return X;return cY(X,(Y)=>{Y.checks.value=Q})}function u4(X,Q){return uY(X,X.checks?[...X.checks,...Q]:Q)}function bO(X,Q){let Y=X,J=Y[Y.length-1],$=Q(J.to);if($!==J.to)return Y7(X.slice(0,X.length-1),new B0($,J.transformation));return X}function gO(X){return(Q)=>Q.encoding?D0(Q,bO(Q.encoding,X)):Q}function hO(X,Q){return uG(X,Q,z8(X))}function mO(X,Q){return uG(J1(X),Q,X)}function uG(X,Q,Y){let J=new B0(X,Q);return D0(Y,Y.encoding?[...Y.encoding,J]:[J])}function pO(X,Q){let Y=YU(X),J=Y?[...Y,Q]:[Q];return f6(X,{brands:J})}function i5(X,Q){let Y=!1,J=Array(X.length);for(let $=0;$<X.length;$++){let G=X[$],Z=Q(G);if(Z!==G)Y=!0;J[$]=Z}return Y?J:X}function tX(X,Q){let Y=X.context?new W4(X.context.isOptional,X.context.isMutable,X.context.defaultValue,{...X.context.annotations,...Q}):new W4(!1,!1,void 0,Q);return fY(X,Y)}var t5=gO(lY);function lY(X){let Q=X.context?X.context.isOptional===!1?new W4(!0,X.context.isMutable,X.context.defaultValue,X.context.annotations):X.context:new W4(!0,!1);return t5(fY(X,Q))}var bx=gO(lG);function lG(X){let Q=X.context?X.context.isMutable===!1?new W4(X.context.isOptional,!0,X.context.defaultValue,X.context.annotations):X.context:new W4(!1,!0);return bx(fY(X,Q))}function dO(X,Q){let Y=new K0(mX(Q),T1()),J=[new B0(g6,Y)],$=X.context?new W4(X.context.isOptional,X.context.isMutable,J,X.context.annotations):new W4(!1,!1,J);return fY(X,$)}function rY(X,Q,Y){return uG(X,Y,Q)}function cO(X){switch(X._tag){case"Literal":return{literals:jQ(X.literal)?[X.literal]:[],parameters:[]};case"UniqueSymbol":return{literals:[X.symbol],parameters:[]};case"String":case"Number":case"Symbol":case"TemplateLiteral":return{literals:[],parameters:[X]};case"Union":{let Q={literals:[],parameters:[]};for(let Y=0;Y<X.types.length;Y++){let J=cO(X.types[Y]);Q.literals=Q.literals.concat(J.literals),Q.parameters=Q.parameters.concat(J.parameters)}return Q}}return{literals:[],parameters:[]}}function fO(X,Q,Y){let{literals:J,parameters:$}=cO(X);return new rX(J.map((G)=>new bY(G,Q)),$.map((G)=>new dG(G,Q,Y)))}function E0(X){return X.context?.isOptional??!1}function uO(X){return X.context?.isMutable??!1}var z8=d0((X)=>{if(X.encoding)return z8(D0(X,void 0));let Q=X;return Q.recur?.(z8)??Q}),J1=d0((X)=>{return z8(O8(X))});function gx(X,Q){let Y=Q,J=Y.length,$=Y[J-1],G=[new B0(O8(D0(X,void 0)),Y[0].transformation.flip())];for(let K=1;K<J;K++)G.unshift(new B0(O8(Y[K-1].to),Y[K].transformation.flip()));let Z=O8($.to);if(Z.encoding)return D0(Z,[...Z.encoding,...G]);else return D0(Z,G)}var O8=d0((X)=>{if(X.encoding)return gx(X,X.encoding);let Q=X;return Q.flip?.(O8)??Q.recur?.(O8)??Q});function lO(X){switch(X._tag){case"Undefined":return!0;case"Union":return X.types.some(lO);default:return!1}}function rO(X,Q){return X.encodedParts.map((Y)=>hx(Y,oO(Y),Q)).join("")}var oY=d0((X)=>{return new globalThis.RegExp(`^${rO(X,!0)}$`)});function oO(X){switch(X._tag){case"Literal":return LY(globalThis.String(X.literal));case"String":return rG;case"Number":return lX;case"BigInt":return tO;case"TemplateLiteral":return rO(X,!1);case"Union":return X.types.map(oO).join("|")}}function hx(X,Q,Y){if(yY(X)){if(!Y)return`(?:${Q})`}else if(!Y)return Q;return`(${Q})`}function eX(X,Q){let Y=s7(Q);return(J)=>{if(J._tag==="None")return x8;return J.value===Q?Y:v(new x0(X,J))}}function F8(X,Q){return(Y)=>{if(Y._tag==="None")return x8;return Q(Y.value)?h(Y):v(new x0(X,Y))}}var nO=d0((X)=>{return new g1(X.enums.map((Q)=>new b1(Q[1],{title:Q[0]})),"anyOf")});function u6(X){function Q(Y){return Y.encoding?D0(Y,bO(Y.encoding,Q)):X(Y)}return d0(Q)}var iO=u6((X)=>{switch(X._tag){default:return X;case"Number":return X.toCodecStringTree();case"Union":return X.recur(iO)}}),aO=u6((X)=>{switch(X._tag){default:return X;case"String":case"TemplateLiteral":return X;case"BigInt":case"Number":case"Literal":return X.toCodecStringTree();case"Union":return X.recur(aO)}}),rG="[\\s\\S]*?",KO=new globalThis.RegExp(`^${lX}$`);function oG(X){return aX(KO,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:KO},...X})}var sO=u4(p6,[oG()]),mx=new B0(sO,n5),px=new B0(new g1([sO,yO],"anyOf"),n5),tO="-?\\d+",WO=new globalThis.RegExp(`^${tO}$`);function nG(X){return aX(WO,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:WO},...X})}var iG=u4(p6,[nG({expected:"a string representing a bigint"})]),dx=new B0(iG,SY),cx="Symbol\\((.*)\\)",kG=new globalThis.RegExp(`^${cx}$`),fx=u4(p6,[aG()]),eO=new B0(fx,new K0(n((X)=>globalThis.Symbol.for(kG.exec(X)[1])),I1((X)=>{if(globalThis.Symbol.keyFor(X)!==void 0)return h(globalThis.String(X));return v(new o5(F(X),{message:"cannot serialize to string, Symbol is not registered"}))})));function aG(X){return aX(kG,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:kG},...X})}function XQ(X,Q,Y,J,$){for(let G=0;G<X.length;G++){let Z=X[G];if(Z._tag==="FilterGroup")XQ(Z.checks,Q,Y,J,$);else{let K=Z.run(Q,J,$);if(K){if(Y.push(new NY(Q,Z,K)),Z.aborted||$?.errors!=="all")return}}}}function Xz(X,Q){let Y=[];if(XQ(X,Q,Y,g6,{errors:"all"}),H8(Y)){let J=new q0(g6,F(Q),Y);return f(J)}return l(Q)}var e5="~effect/Schema/Class",h1="~structural";function ux(X){let Q=new Set,Y=new Set;return J(X);function J($){if($===null||typeof $==="string"||typeof $==="boolean")return!0;if(typeof $==="number")return globalThis.Number.isFinite($);if(typeof $!=="object"||$===void 0)return!1;if(Q.has($))return!1;if(Y.has($))return!0;Q.add($);let G=Array.isArray($)?$.every(J):Object.keys($).every((Z)=>J($[Z]));if(Q.delete($),G)Y.add($);return G}}var nY=new m6([],()=>(X,Q)=>ux(X)?h(X):v(new x0(Q,F(X))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new B0(g6,b6())}),Qz=f6(nY,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),Yz=new B0(s5,new K0(T1(),n(()=>null))),Jz=new B0(nY,b6());function lx(X){let Q=new Set;return Y(X);function Y(J){if(J===void 0||typeof J==="string")return!0;if(typeof J!=="object"||J===null)return!1;if(Q.has(J))return!1;if(Q.add(J),Array.isArray(J))return J.every(Y);return Object.keys(J).every(($)=>Y(J[$]))}}var rx=new m6([],()=>(X,Q)=>lx(X)?h(X):v(new x0(Q,F(X))),{expected:"StringTree",toCodecStringTree:()=>new B0(g6,b6())}),$z=new B0(rx,b6());var Gz=B(2,(X,Q)=>{return tG(X,(Y,J)=>Q.includes(Y)?[Y,J]:void 0)}),Zz=B(2,(X,Q)=>{return tG(X,(Y,J)=>!Q.includes(Y)?[Y,J]:void 0)}),Kz=B(2,(X,Q)=>{return{...X,...Q}});var sG=B(2,(X,Q)=>{return tG(X,(Y,J)=>[Object.hasOwn(Q,Y)?Q[Y]:Y,J])});var H1=(X)=>X;function tG(X,Q){let Y={};for(let J in X){let $=Q(J,X[J]);if($){let[G,Z]=$;Y[G]=Z}}return Y}function Wz(X,Q){let Y=Q?.omitKeyWhen??(()=>!1);return lW((J,$)=>{let G=Reflect.ownKeys(X),Z={};for(let K of G){let W=X[K].combine(J[K],$[K]);if(Y(W))continue;Z[K]=W}return Z})}function QQ(X){return o8((Q,Y)=>{if(Q===void 0)return Y;if(Y===void 0)return Q;return X.combine(Q,Y)},void 0)}function iY(X,Q){if(Q.length>0)X+=`
29
- at ${hQ(Q)}`;return Error(X)}var Hz=new WeakMap;function Vz(X,Q,Y){return Q.map((J)=>($)=>J.run($,X,a5)===void 0).reduce((J,$)=>J.filter($),Y)}function nx(X){return X?.comparator!==void 0}function _z(X,Q,Y){let J=Q.constraints?.array,$=nx(J)?X.uniqueArray(Y,J):X.array(Y,J);if(Q.isSuspend)return X.oneof({maxDepth:2,depthIdentifier:""},X.constant([]),$);return $}var qz=QQ(PD),Dz=QQ(RD),l4=QQ(JU),ix=QQ(wH()),ax=Wz({isInteger:l4,max:Dz,maxExcluded:l4,maxLength:Dz,min:qz,minExcluded:l4,minLength:qz,noDefaultInfinity:l4,noInteger:l4,noInvalidDate:l4,noNaN:l4,patterns:ix,comparator:l4},{omitKeyWhen:EW});function sx(X,Q,Y){let J=Q[X];return{...Q,[X]:J?ax.combine(J,Y):Y}}var tx={string:null,number:null,bigint:null,array:null,date:null};function ex(X){return X in tx}function Bz(X){let Q=X.map((Y)=>Y.annotations?.toArbitraryConstraint).filter($1);return(Y)=>{let J=Q.reduce(($,G)=>{let Z=Object.keys(G);for(let K of Z)if(ex(K))$=sx(K,$,G[K]);return $},Y.constraints||{});return{...Y,constraints:J}}}function XZ(X){return{...X,constraints:void 0}}function QZ(X){if(X)return X.flatMap((Q)=>{switch(Q._tag){case"Filter":return[Q];case"FilterGroup":return QZ(Q.checks)}});return[]}var Uz=d0((X)=>{return L8(X,[])});function L8(X,Q){let Y=U8(X)?.toArbitrary;if(Y){let J=g8(X)?X.typeParameters.map((Z)=>L8(Z,Q)):[],$=QZ(X.checks),G=Bz($);return(Z,K)=>Vz(X,$,Y(J.map((W)=>W(Z,XZ(K))))(Z,G(K)))}if(X.checks){let J=QZ(X.checks),$=Bz(J),G=L8(uY(X,void 0),Q);return(Z,K)=>Vz(X,J,G(Z,$(K)))}return Xk(X,Q)}function Xk(X,Q){switch(X._tag){case"Never":case"Declaration":throw iY(`Unsupported AST ${X._tag}`,Q);case"Null":return(Y)=>Y.constant(null);case"Void":case"Undefined":return(Y)=>Y.constant(void 0);case"Unknown":case"Any":return(Y)=>Y.anything();case"String":return(Y,J)=>{let $=J.constraints?.string,G=$?.patterns;if(G)return Y.oneof(...G.map((Z)=>Y.stringMatching(new RegExp(Z))));return Y.string($)};case"Number":return(Y,J)=>{let $=J.constraints?.number;if($?.isInteger)return Y.integer($);return Y.float($)};case"Boolean":return(Y)=>Y.boolean();case"BigInt":return(Y,J)=>Y.bigInt(J.constraints?.bigint??{});case"Symbol":return(Y)=>Y.string().map(Symbol.for);case"Literal":return(Y)=>Y.constant(X.literal);case"UniqueSymbol":return(Y)=>Y.constant(X.symbol);case"ObjectKeyword":return(Y)=>Y.oneof(Y.object(),Y.array(Y.anything()));case"Enum":return L8(nO(X),Q);case"TemplateLiteral":return(Y)=>Y.stringMatching(oY(X));case"Arrays":return(Y,J)=>{let $=XZ(J),G=X.elements.map((K,W)=>{let H=L8(K,[...Q,W])(Y,$);if(!E0(K))return H.map(F);return H.chain((_)=>Y.boolean().map((V)=>V?F(_):x()))}),Z=Y.tuple(...G).map(AH);if(F6(X.rest)){let K=X.elements.length,[W,...H]=X.rest.map((V,q)=>L8(V,[...Q,K+q])(Y,$)),_=_z(Y,X.elements.length===0?J:$,W);if(Z=Z.chain((V)=>{if(V.length<K)return Y.constant(V);return _.map((q)=>[...V,...q])}),H.length>0){let V=Y.tuple(...H);Z=Z.chain((q)=>{if(q.length<K)return Y.constant(q);return V.map((D)=>[...q,...D])})}}return Z};case"Objects":return(Y,J)=>{let $=XZ(J),G={},Z=[];for(let W of X.propertySignatures){let H=W.name;if(!E0(W.type))Z.push(H);G[H]=L8(W.type,[...Q,H])(Y,$)}let K=Y.record(G,{requiredKeys:Z});for(let W of X.indexSignatures){let H=Y.tuple(L8(W.parameter,Q)(Y,$),L8(W.type,Q)(Y,$)),_=_z(Y,X.propertySignatures.length===0?J:$,H);K=K.chain((V)=>{return _.map((q)=>{return{...Object.fromEntries(q),...V}})})}return K};case"Union":return(Y,J)=>Y.oneof(...X.types.map(($)=>L8($,Q)(Y,J)));case"Suspend":{let Y=Hz.get(X);if(Y)return Y;let J=c6(()=>L8(X.thunk(),Q)),$=(G,Z)=>G.constant(null).chain(()=>J()(G,{...Z,isSuspend:!0}));return Hz.set(X,$),$}}}var YQ=d0((X)=>{switch(X._tag){case"Declaration":{let Q=X.annotations?.[e5];if(Y8(Q)){let Y=Q(X.typeParameters),J=YQ(Y.to);return D0(X,J===Y.to?[Y]:[new B0(J,Y.transformation)])}return X}case"Objects":case"Arrays":return X.recur((Q)=>{let Y=Q.context?.defaultValue;if(Y)return D0(YQ(Q),Y);return YQ(Q)});case"Suspend":return X.recur(YQ);default:return X}});function X9(X){let Q=YQ(z8(X.ast)),Y=Q9(Q);return(J,$)=>{return Y(J,$?.disableChecks?$?.parseOptions?{...$.parseOptions,disableChecks:!0}:{disableChecks:!0}:$?.parseOptions)}}function sY(X){let Q=X9(X);return(Y,J)=>{return c7(e7(Q(Y,J)))}}function Oz(X){let Q=X9(X);return(Y,J)=>{return wX(y1(Q(Y,J),($)=>Error($.toString(),{cause:$})))}}function zz(X){return JQ(X.ast)}function JQ(X){let Q=Y9(Q9(z8(X)));return(Y)=>{return _8(Q(Y,a5))}}function Fz(X){let Q=Q9(X);return(Y,J)=>{return wX(h$(Q(Y,J),{onSuccess:()=>{return},onFailure:b}))}}function Lz(X){let Q=Y9(Q9(z8(X.ast)));return(Y)=>{let J=Q(Y,a5);if(K$(J)){let $=S8(J.cause);if(u($))throw I6($.failure);throw Error($.success.toString(),{cause:$.success})}}}function y0(X){return Q9(X.ast)}var tY=y0;function Pz(X){return HZ(y0(X))}function Rz(X){return HZ(tY(X))}function Nz(X){return Y9(y0(X))}function YZ(X){return jz(y0(X))}var Mz=YZ;function JZ(X){return Ez(y0(X))}var Az=JZ;function $Z(X){return Sz(y0(X))}var eY=$Z;function r6(X){return Q9(O8(X.ast))}var GZ=(X)=>HZ(r6(X)),wz=GZ;function Cz(X){return Y9(r6(X))}function ZZ(X){return jz(r6(X))}var Tz=ZZ;function KZ(X){return Ez(r6(X))}var Iz=KZ;function WZ(X){return Sz(r6(X))}var X2=WZ;function Q9(X){let Q=aY(X);return(Y,J)=>D8(Q(F(Y),J??a5),($)=>{if($._tag==="None")return v(new Z0($));return h($.value)})}function HZ(X){return(Q,Y)=>p$(X(Q,Y))}function Y9(X){return(Q,Y)=>e7(X(Q,Y))}function jz(X){let Q=Y9(X);return(Y,J)=>c7(Q(Y,J))}function Ez(X){let Q=Y9(X);return(Y,J)=>{let $=Q(Y,J);if(_8($))return l($.value);let G=S8($.cause);if(u(G))throw I6(G.failure);return f(G.success)}}function Sz(X){return(Q,Y)=>wX(y1(X(Q,Y),(J)=>Error(J.toString(),{cause:J})))}var aY=d0((X)=>{let Q,Y=U8(X)?.parseOptions;if(!X.context&&!X.encoding&&!X.checks)return($,G)=>{if(Q??=X.getParser(aY),Y)G={...G,...Y};return Q($,G)};let J=kY(X)||VO(X)||g8(X)&&X.typeParameters.length>0;return($,G)=>{if(Y)G={...G,...Y};let Z=X.encoding,K;if(Z){let H=Z,_=H.length;for(let V=_-1;V>=0;V--){let q=H[V],D=q.to,U=aY(D);if(K=K?D8(K,(R)=>U(R,G)):U($,G),q.transformation._tag==="Transformation"){let R=q.transformation.decode;K=D8(K,(L)=>R.run(L,G))}else K=q.transformation.decode(K,G)}K=y1(K,(V)=>new zG(X,$,V))}Q??=X.getParser(aY);let W=K?D8(K,(H)=>Q(H,G)):Q($,G);if(X.checks&&!G?.disableChecks){let H=X.checks;if(G?.errors==="all"&&J&&B1($))W=d5(W,(_)=>{let V=[];XQ(H.filter((D)=>D.annotations?.[h1]),$.value,V,X,G);let q=H8(V)?_._tag==="Composite"&&_.ast===X?new q0(X,_.actual,[..._.issues,...V]):new q0(X,$,[_,...V]):_;return v(q)});W=D8(W,(_)=>{if(B1(_)){let V=_.value,q=[];if(XQ(H,V,q,X,G),H8(q))return v(new q0(X,_,q))}return h(_)})}return W}});var vz=d0((X)=>{return r4(X,[])});function r4(X,Q){let Y=U8(X)?.toEquivalence;if(Y)return Y(g8(X)?X.typeParameters.map((J)=>r4(J,Q)):[]);switch(X._tag){case"Never":throw iY(`Unsupported AST ${X._tag}`,Q);case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return o;case"Arrays":{let J=X.elements.map((Z,K)=>r4(Z,[...Q,K])),$=X.elements.length,G=X.rest.map((Z,K)=>r4(Z,[...Q,$+K]));return s0((Z,K)=>{if(!Array.isArray(Z)||!Array.isArray(K))return!1;let W=Z.length;if(W!==K.length)return!1;let H=0;for(;H<Math.min(W,X.elements.length);H++)if(!J[H](Z[H],K[H]))return!1;if(G.length>0){let[_,...V]=G;for(;H<W-V.length;H++)if(!_(Z[H],K[H]))return!1;for(let q=0;q<V.length;q++)if(H+=q,!V[q](Z[H],K[H]))return!1}return!0})}case"Objects":{if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return o;let J=X.propertySignatures.map((G)=>r4(G.type,[...Q,G.name])),$=X.indexSignatures.map((G)=>r4(G.type,Q));return s0((G,Z)=>{if(!f1(G)||!f1(Z))return!1;for(let K=0;K<J.length;K++){let W=X.propertySignatures[K],H=W.name,_=Object.hasOwn(G,H),V=Object.hasOwn(Z,H);if(E0(W.type)){if(_!==V)return!1}if(_&&V&&!J[K](G[H],Z[H]))return!1}for(let K=0;K<$.length;K++){let W=X.indexSignatures[K],H=d6(G,W.parameter),_=d6(Z,W.parameter);if(H.length!==_.length)return!1;for(let V=0;V<H.length;V++){let q=H[V];if(!Object.hasOwn(Z,q)||!$[K](G[q],Z[q]))return!1}}return!0})}case"Union":return s0((J,$)=>{let G=iX(J,X.types),Z=G.map(JQ);for(let K=0;K<G.length;K++){let W=Z[K];if(W(J)&&W($))return r4(G[K],Q)(J,$)}return!1});case"Suspend":{let J=c6(()=>r4(X.thunk(),Q));return s0(($,G)=>J()($,G))}}}function Q2(X){return X.replace(/~/g,"~0").replace(/\//g,"~1")}function xz(X){return X.replace(/~1/g,"/").replace(/~0/g,"~")}var Y2="~effect/Schema/Schema",Jk={[Y2]:Y2,pipe(){return a(this,arguments)},annotate(X){return this.rebuild(f6(this.ast,X))},annotateKey(X){return this.rebuild(tX(this.ast,X))},check(...X){return this.rebuild(u4(this.ast,X))}};function o6(X,Q){let Y=Object.create(Jk);if(Q)Object.assign(Y,Q);return Y.ast=X,Y.rebuild=(J)=>o6(J,Q),Y.makeEffect=TW(X9(Y),y1((J)=>new V4(J))),Y.make=Oz(Y),Y.makeOption=sY(Y),Y}var J2="~effect/Schema/SchemaError";class V4{[J2]=J2;_tag="SchemaError";name="SchemaError";issue;constructor(X){this.issue=X}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}var $2=_Z($k);function $k(X){switch(X._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function _Z(X){return(Q)=>{let Y=new Map;for(let G=0;G<Q.length;G++)Y.set(J1(Q[G]),G);let J=[...Q].sort((G,Z)=>{G=J1(G),Z=J1(Z);let K=X(G),W=X(Z);if(K!==W)return K-W;return Y.get(G)-Y.get(Z)});if(!J.some((G,Z)=>G!==Q[Z]))return Q;return J}}function yz(X){let{references:Q,representations:Y}=Gk([X]);return{representation:Y[0],references:Q}}function Gk(X){let Q={},Y=new Map,J=new Set,$=new Set;return{representations:E4(X,(V)=>K(V)),references:Q};function Z(V){let q=V,D=0;while(J.has(q))q=`${V}${++D}`;return J.add(q),q}function K(V,q){let D=Y.get(V);if(D!==void 0)return{_tag:"Reference",$ref:D};let U=sX(V),R=l5(V)??q;if(V!==U)return K(U,R);if(R!==void 0){let P=Z(R);Y.set(V,P);let y=H(V),Y0=Q[R];if(Y0!==void 0&&o(y,Y0))return Y.set(V,R),{_tag:"Reference",$ref:R};return Q[P]=y,{_tag:"Reference",$ref:P}}if($.has(V)){let P=Z(`${V._tag}_`);return Y.set(V,P),{_tag:"Reference",$ref:P}}$.add(V);let L=H(V);$.delete(V);let N=Y.get(V);if(N!==void 0)return Q[N]=L,{_tag:"Reference",$ref:N};return L}function W(V){let q=V.annotations?.toCodecJson??V.annotations?.toCodec;if(Y8(q)){let D=V.typeParameters.map((R)=>o6(J1(R))),U=q(D);return D0(V,[U])}return s5}function H(V){let q=$Q(V.annotations);switch(V._tag){case"Declaration":{let D=K(W(V));return{_tag:"Declaration",typeParameters:V.typeParameters.map((U)=>K(U)),encodedSchema:D,checks:_(V.checks),...q}}case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"Boolean":case"Symbol":return{_tag:V._tag,...q};case"String":{let D=V.annotations?.contentMediaType,U=V.annotations?.contentSchema;return{_tag:V._tag,checks:_(V.checks),...q,...typeof D==="string"&&HO(U)?{contentSchema:K(U)}:void 0}}case"Number":case"BigInt":return{_tag:V._tag,checks:_(V.checks),...q};case"Literal":return{_tag:V._tag,literal:V.literal,...q};case"UniqueSymbol":return{_tag:V._tag,symbol:V.symbol,...q};case"ObjectKeyword":return{_tag:V._tag,...q};case"Enum":return{_tag:V._tag,enums:V.enums,...q};case"TemplateLiteral":return{_tag:V._tag,parts:V.parts.map((D)=>K(D)),...q};case"Arrays":return{_tag:V._tag,elements:V.elements.map((D)=>{let U=sX(D);return{isOptional:E0(U),type:K(D),...$Q(U.context?.annotations)}}),rest:V.rest.map((D)=>K(D)),checks:_(V.checks),...q};case"Objects":return{_tag:V._tag,propertySignatures:V.propertySignatures.map((D)=>{let U=sX(D.type);return{name:D.name,type:K(D.type),isOptional:E0(U),isMutable:uO(U),...$Q(U.context?.annotations)}}),indexSignatures:V.indexSignatures.map((D)=>({parameter:K(D.parameter),type:K(D.type)})),checks:_(V.checks),...q};case"Union":{let D=$2(V.types);return{_tag:V._tag,types:D.map((U)=>K(U)),mode:V.mode,...q}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:K(V.thunk()),...q}}}function _(V){if(!V)return[];return V.map(q).filter((D)=>D!==void 0);function q(D){switch(D._tag){case"Filter":{let U=D.annotations?.meta;if(U)return{_tag:"Filter",meta:U._tag==="isPropertyNames"?{_tag:"isPropertyNames",propertyNames:K(U.propertyNames)}:U,...$Q(D.annotations)};return}case"FilterGroup":{let U=_(D.checks);if(H8(U))return{_tag:"FilterGroup",checks:U,...$Q(D.annotations)}}}}}}var Zk=new Set(["~structural","~sentinels","meta","toArbitrary","toArbitraryConstraint","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",e5]);function $Q(X){if(X!==void 0){let Q=RH(X,(Y,J)=>!Zk.has(J));if(!v3(Q))return{annotations:Q}}return}function bz(X,Q){let{definitions:Y,dialect:J,schemas:$}=Kk({representations:[X.representation],references:X.references},Q),G=$[0];return{dialect:J,schema:G,definitions:Y}}function Kk(X,Q){let Y=Q?.generateDescriptions??!1,J=Q?.additionalProperties??!1,$=P5(X.references,(q)=>G(q));return{dialect:"draft-2020-12",schemas:E4(X.representations,(q)=>G(q)),definitions:$};function G(q){let D=Z(q);if("annotations"in q){let U=W(q.annotations);if(U)D={...D,...U}}if("checks"in q){let U=H(q.checks,D.type);for(let R of U)D=qZ(D,R)}return D}function Z(q){switch(q._tag){case"Any":case"Unknown":case"ObjectKeyword":return{};case"Void":case"Undefined":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return G(q.encodedSchema);case"Suspend":return G(q.thunk);case"Reference":return{$ref:`#/$defs/${Q2(q.$ref)}`};case"Null":return{type:"null"};case"Never":return{not:{}};case"String":{let D={type:"string"};if(q.contentMediaType!==void 0)D.contentMediaType=q.contentMediaType;if(q.contentSchema!==void 0)D.contentSchema=G(q.contentSchema);return D}case"Number":return DZ(q.checks,"isInt")?{type:"integer"}:DZ(q.checks,"isFinite")?{type:"number"}:{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let D=q.literal;if(typeof D==="string")return{type:"string",enum:[D]};if(typeof D==="number")return{type:"number",enum:[D]};if(typeof D==="boolean")return{type:"boolean",enum:[D]};return{type:"string",enum:[String(D)]}}case"Enum":return G({_tag:"Union",types:q.enums.map(([D,U])=>({_tag:"Literal",literal:U,annotations:{title:D}})),mode:"anyOf",annotations:q.annotations});case"TemplateLiteral":return{type:"string",pattern:`^${q.parts.map(G2).join("")}$`};case"Arrays":{if(q.rest.length>1)throw new globalThis.Error("Generating a JSON Schema for post-rest elements is not supported");let D={type:"array"},U=q.elements.length,R=q.elements.map((L)=>{if(L.isOptional)U--;let N=G(L.type),P=W(L.annotations);return P?qZ(N,P):N});if(R.length>0){if(D.prefixItems=R,D.maxItems=q.elements.length,U>0)D.minItems=U}else D.items=!1;if(q.rest.length>0){delete D.maxItems;let L=G(q.rest[0]);if(Object.keys(L).length>0)D.items=L;else delete D.items}return D}case"Objects":{if(q.propertySignatures.length===0&&q.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let D={type:"object"},U={},R=[];for(let N of q.propertySignatures){let P=N.name;if(typeof P!=="string")throw new globalThis.Error(`Unsupported property signature name: ${g(P)}`);let y=G(N.type),Y0=W(N.annotations);if(U[P]=Y0?qZ(y,Y0):y,!N.isOptional)R.push(P)}if(Object.keys(U).length>0)D.properties=U;if(R.length>0)D.required=R;D.additionalProperties=J;let L={};for(let N of q.indexSignatures){let P=G(N.type);if(Object.keys(P).length===1&&"not"in P)P=!1;let y=V(N.parameter);if(y.length>0)for(let Y0 of y)L[Y0]=P;else D.additionalProperties=P}if(Object.keys(L).length>0)D.patternProperties=L,delete D.additionalProperties;if(f1(D.additionalProperties)&&v3(D.additionalProperties))delete D.additionalProperties;return D}case"Union":{let D=q.types.map(G);if(D.length===0)return{not:{}};if(D.length>1){let U=K(D);if(U)return U}return q.mode==="anyOf"?{anyOf:D}:{oneOf:D}}}}function K(q){let D,U=[];for(let R of q){if(Object.keys(R).length!==2||R.type===void 0||!Array.isArray(R.enum)||R.enum.length===0)return;if(D===void 0)D=R.type;else if(R.type!==D)return;for(let N of R.enum)U.push(N)}return{type:D,enum:U}}function W(q){if(q){let D={};if(typeof q.title==="string")D.title=q.title;if(typeof q.description==="string")D.description=q.description;else if(Y&&typeof q.expected==="string")D.description=q.expected;if(q.default!==void 0)D.default=q.default;if(Array.isArray(q.examples))D.examples=q.examples;if(typeof q.readOnly==="boolean")D.readOnly=q.readOnly;if(typeof q.writeOnly==="boolean")D.writeOnly=q.writeOnly;if(typeof q.format==="string")D.format=q.format;if(typeof q.contentEncoding==="string")D.contentEncoding=q.contentEncoding;if(typeof q.contentMediaType==="string")D.contentMediaType=q.contentMediaType;if(Object.keys(D).length>0)return D}}function H(q,D){return q.map(U).filter((R)=>R!==void 0);function U(R){switch(R._tag){case"Filter":return _(R,D);case"FilterGroup":{let L=R.checks.map(U).filter((y)=>y!==void 0);if(L.length===0)return;let N={allOf:L},P=W(R.annotations);if(P)N={...N,...P};return N}}}}function _(q,D){let U=q.meta;if(!U)return;let R=N(U),L=W(q.annotations);if(L)R={...R,...L};return R;function N(P){switch(P._tag){case"isMinLength":return D==="array"?{minItems:P.minLength}:{minLength:P.minLength};case"isMaxLength":return D==="array"?{maxItems:P.maxLength}:{maxLength:P.maxLength};case"isLengthBetween":return D==="array"?{allOf:[{minItems:P.minimum},{maxItems:P.maximum}]}:{allOf:[{minLength:P.minimum},{maxLength:P.maximum}]};case"isPattern":case"isULID":case"isBase64":case"isBase64Url":case"isStartsWith":case"isEndsWith":case"isIncludes":case"isUppercased":case"isLowercased":case"isCapitalized":case"isUncapitalized":case"isTrimmed":case"isStringFinite":case"isStringBigInt":case"isStringSymbol":return{pattern:P.regExp.source};case"isUUID":return{pattern:P.regExp.source,format:"uuid"};case"isFinite":case"isInt":return;case"isMultipleOf":return{multipleOf:P.divisor};case"isGreaterThanOrEqualTo":return{minimum:P.minimum};case"isLessThanOrEqualTo":return{maximum:P.maximum};case"isGreaterThan":return{exclusiveMinimum:P.exclusiveMinimum};case"isLessThan":return{exclusiveMaximum:P.exclusiveMaximum};case"isBetween":return{[P.exclusiveMinimum?"exclusiveMinimum":"minimum"]:P.minimum,[P.exclusiveMaximum?"exclusiveMaximum":"maximum"]:P.maximum};case"isUnique":return{uniqueItems:!0};case"isMinProperties":return{minProperties:P.minProperties};case"isMaxProperties":return{maxProperties:P.maxProperties};case"isPropertiesLengthBetween":return{minProperties:P.minimum,maxProperties:P.maximum};case"isPropertyNames":return{propertyNames:G(P.propertyNames)};case"isDateValid":return{format:"date-time"}}}}function V(q){switch(q._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${q._tag}`);case"Reference":return V(X.references[q.$ref]);case"String":return Wk(q);case"TemplateLiteral":return[`^${q.parts.map(G2).join("")}$`];case"Union":return q.types.flatMap(V)}}}function Wk(X){return Q(X.checks);function Q(Y){return Y.flatMap((J)=>{switch(J._tag){case"Filter":{if("regExp"in J.meta)return[J.meta.regExp.source];return[]}case"FilterGroup":return Q(J.checks)}})}}function DZ(X,Q){return X.some((Y)=>{switch(Y._tag){case"Filter":return Y.meta._tag===Q;case"FilterGroup":return DZ(Y.checks,Q)}})}function qZ(X,Q){if(Object.keys(X).length===0)return Q;let Y=Object.keys(Q).length;if(Y===0)return X;let J=Array.isArray(Q.allOf)&&Y===1?Q.allOf:[Q];if(Array.isArray(X.allOf))return{...X,allOf:[...X.allOf,...J]};if(typeof X.$ref==="string")return{allOf:[X,...J]};return{...X,allOf:J}}function G2(X){switch(X._tag){case"Literal":return LY(globalThis.String(X.literal));case"String":return rG;case"Number":return lX;case"TemplateLiteral":return X.parts.map(G2).join("");case"Union":return X.types.map(G2).join("|");default:throw new globalThis.Error("Unsupported part",{cause:X})}}function Z2(X,Q){if(Object.is(X,Q))return[];let Y=[];if(Array.isArray(X)&&Array.isArray(Q)){let J=X.length,$=Q.length,G=Math.min(J,$);for(let Z=0;Z<G;Z++){let K=`/${Z}`,W=Z2(X[Z],Q[Z]);for(let H of W)gz(H,K),Y.push(H)}for(let Z=J-1;Z>=$;Z--)Y.push({op:"remove",path:`/${Z}`});for(let Z=J;Z<$;Z++)Y.push({op:"add",path:`/${Z}`,value:Q[Z]});return Y}if(K2(X)&&K2(Q)){let J=Object.keys(X),$=Object.keys(Q),G=Array.from(new Set([...J,...$])).sort();for(let Z of G){let W=`/${Q2(Z)}`,H=Object.hasOwn(X,Z),_=Object.hasOwn(Q,Z);if(H&&_){let V=Z2(X[Z],Q[Z]);for(let q of V)gz(q,W),Y.push(q)}else if(!H&&_)Y.push({op:"add",path:W,value:Q[Z]});else if(H&&!_)Y.push({op:"remove",path:W})}return Y}return Y.push({op:"replace",path:"",value:Q}),Y}function mz(X,Q){let Y=Q;for(let J of X)switch(J.op){case"replace":{Y=J.path===""?J.value:hz(Y,J.path,J.value,"replace");break}case"add":{Y=_k(Y,J.path,J.value);break}case"remove":{Y=hz(Y,J.path,void 0,"remove");break}}return Y}function gz(X,Q){X.path=X.path===""?Q:Q+X.path}function K2(X){return f1(X)}function Vk(X){if(X==="")return[];if(X.charCodeAt(0)!==47)throw Error(`Invalid JSON Pointer, it must start with "/": ${g(X)}`);return X.split("/").slice(1).map(xz)}function BZ(X){if(!/^(0|[1-9]\d*)$/.test(X))throw Error(`Invalid array index: "${X}"`);return Number(X)}function _k(X,Q,Y){if(Q==="")return Y;let J=pz(X,Q);if(J===null)throw Error(`Cannot add at "${Q}" (parent not found or not a container).`);let{lastToken:$,parent:G,stack:Z}=J;if(Array.isArray(G)){let K=$==="-"?G.length:BZ($);if(K<0||K>G.length)throw Error(`Array index out of bounds at "${Q}".`);let W=G.slice();return W.splice(K,0,Y),W2(Z,W)}if(K2(G)){let K={...G};return K[$]=Y,W2(Z,K)}throw Error(`Cannot add at "${Q}" (parent not found or not a container).`)}function hz(X,Q,Y,J){if(Q===""){if(J==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let $=pz(X,Q);if($===null)throw Error(`Cannot ${J} at "${Q}" (parent not found or not a container).`);let{lastToken:G,parent:Z,stack:K}=$;if(Array.isArray(Z)){if(G==="-")throw Error(`"-" is not valid for ${J} at "${Q}".`);let W=BZ(G);if(W<0||W>=Z.length)throw Error(`Array index out of bounds at "${Q}".`);let H=Z.slice();if(J==="remove")H.splice(W,1);else H[W]=Y;return W2(K,H)}if(K2(Z)){if(!Object.hasOwn(Z,G))throw Error(`Property "${G}" does not exist at "${Q}".`);let W={...Z};if(J==="remove")delete W[G];else W[G]=Y;return W2(K,W)}throw Error(`Cannot ${J} at "${Q}" (parent not found or not a container).`)}function pz(X,Q){let Y=Vk(Q);if(Y.length===0)return null;let J=Y[Y.length-1],$=[],G=X;for(let Z=0;Z<Y.length-1;Z++){let K=Y[Z];if(G==null)return null;if(Array.isArray(G)){let W=BZ(K);if(W<0||W>=G.length)return null;$.push({container:G,token:W}),G=G[W];continue}if(G&&typeof G==="object"){if(!Object.hasOwn(G,K))return null;$.push({container:G,token:K}),G=G[K];continue}return null}return{stack:$,parent:G,lastToken:J}}function W2(X,Q){let Y=Q;for(let J=X.length-1;J>=0;J--){let{container:$,token:G}=X[J];if(Array.isArray($)){let Z=$.slice();Z[G]=Y,Y=Z}else{let Z={...$};Z[G]=Y,Y=Z}}return Y}var Dk=/^#\/\$defs(?=\/|$)/;function cz(X){return{dialect:"draft-07",schema:dz(X.schema),definitions:P5(X.definitions,dz)}}function dz(X){return Q(X);function Q(J){return Y(UZ(J,($)=>$.replace(Dk,"#/definitions")),!0)}function Y(J,$){if(Array.isArray(J))return J.map((H)=>Y(H,!1));if(!f1(J))return J;let G=J,Z={},K=void 0,W=void 0;for(let H of Object.keys(G)){let _=G[H];switch(H){case"$ref":case"type":case"required":case"enum":case"const":case"title":case"description":case"default":case"examples":case"format":case"pattern":case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":case"minLength":case"maxLength":case"minItems":case"maxItems":case"minProperties":case"maxProperties":case"multipleOf":case"uniqueItems":Z[H]=_;break;case"properties":case"patternProperties":{let V=Bk(_,Y);Z[H]=V??_;break}case"additionalProperties":case"propertyNames":Z[H]=Y(_,!1);break;case"allOf":case"anyOf":case"oneOf":Z[H]=Array.isArray(_)?_.map((V)=>Y(V,!1)):_;break;case"prefixItems":K=_;break;case"items":W=_;break;default:break}}if(K!==void 0)if(Array.isArray(K)){if(Z.items=K.map((H)=>Y(H,!1)),W!==void 0)Z.additionalItems=Y(W,!1)}else Z.items=Y(K,!1);else if(W!==void 0)Z.items=Y(W,!1);return Z}}function UZ(X,Q){if(Array.isArray(X))return X.map((J)=>UZ(J,Q));if(!f1(X))return X;let Y={};for(let J of Object.keys(X)){let $=X[J];if(J==="$ref")Y[J]=typeof $==="string"?Q($):$;else if(Array.isArray($)||f1($))Y[J]=UZ($,Q);else Y[J]=$}return Y}function Bk(X,Q){if(!f1(X))return;let Y={};for(let J of Object.keys(X))Y[J]=Q(X[J],!1);return Y}function uz(X,Q){return P8(new nz(X,Q))}function fz(X,Q){return P8(new zZ(X,Q))}class lz{_tag="IdentityNode"}var rz=new lz;class oz{_tag="CompositionNode";nodes;constructor(X){this.nodes=X}}class nz{_tag="IsoNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class zZ{_tag="LensNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class iz{_tag="PrismNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class FZ{_tag="OptionalNode";get;set;constructor(X,Q){this.get=X,this.set=Q}}class LZ{_tag="PathNode";path;constructor(X){this.path=X}}class V2{_tag="CheckNode";checks;constructor(X){this.checks=X}}function Ok(X,Q){let Y=X[X.length-1];if(Y){if(Y._tag==="PathNode"&&Q._tag==="PathNode"){X[X.length-1]=new LZ([...Y.path,...Q.path]);return}if(Y._tag==="CheckNode"&&Q._tag==="CheckNode"){X[X.length-1]=new V2([...Y.checks,...Q.checks]);return}}X.push(Q)}function OZ(X,Q){if(X._tag==="IdentityNode")return;if(X._tag==="CompositionNode"){for(let Y=0;Y<X.nodes.length;Y++)OZ(X.nodes[Y],Q);return}Ok(Q,X)}function n6(X,Q){let Y=[];switch(OZ(X,Y),OZ(Q,Y),Y.length){case 0:return rz;case 1:return Y[0];default:return new oz(Y)}}function zk(X,Q){return P8(new FZ(X,Q))}class GQ{node;getResult;replaceResult;constructor(X,Q,Y){this.node=X,this.getResult=Q,this.replaceResult=Y}replace(X,Q){return x9(this.replaceResult(X,Q),()=>Q)}modify(X){return(Q)=>x9(Q7(this.getResult(Q),(Y)=>this.replaceResult(X(Y),Q)),()=>Q)}compose(X){return P8(n6(this.node,X.node))}key(X){return P8(n6(this.node,new LZ([X])))}optionalKey(X){return P8(n6(this.node,new zZ((Q)=>Q[X],(Q,Y)=>{let J=_2(Y);if(Q===void 0)if(Array.isArray(J)&&typeof X==="number")J.splice(X,1);else delete J[X];else J[X]=Q;return J})))}check(...X){return P8(n6(this.node,new V2(X)))}refine(X,Q){return P8(n6(this.node,new V2([dY(X,Q)])))}tag(X){return P8(n6(this.node,new iz((Q)=>Q._tag===X?l(Q):f(`Expected ${g(X)} tag, got ${g(Q._tag)}`),b)))}at(X,...Q){let Y=f(`Key ${g(X)} not found`);return P8(n6(this.node,new FZ((J)=>Object.hasOwn(J,X)?l(J[X]):Y,(J,$)=>{if(Object.hasOwn($,X)){let G=_2($);return G[X]=J,l(G)}else return Y})))}pick(X){return this.compose(fz(Gz(X),(Q,Y)=>({...Y,...Q})))}omit(X){return this.compose(fz(Zz(X),(Q,Y)=>({...Y,...Q})))}notUndefined(){return this.refine($1,{expected:"a value other than `undefined`"})}forEach(X){let Q=X(q2());return zk((Y)=>z6(this.getResult(Y),(J)=>{let $=[];for(let G=0;G<J.length;G++){let Z=Q.getResult(J[G]);if(A1(Z))$.push(Z.success)}return $}),(Y,J)=>Q7(this.getResult(J),($)=>{let G=[];for(let K=0;K<$.length;K++)if(A1(Q.getResult($[K])))G.push(K);if(Y.length!==G.length)return f(`each: replacement length mismatch: ${Y.length} !== ${G.length}`);let Z=$.slice();for(let K=0;K<G.length;K++){let W=G[K],H=Q.replaceResult(Y[K],$[W]);if(u(H))return f(`each: could not set element ${W}`);Z[W]=H.success}return this.replaceResult(Z,J)}))}modifyAll(X){return(Q)=>x9(Q7(this.getResult(Q),(Y)=>this.replaceResult(Y.map(X),Q)),()=>Q)}}class az extends GQ{get;set;constructor(X,Q,Y){super(X,(J)=>l(Q(J)),(J)=>l(Y(J)));this.get=Q,this.set=Y}replace(X,Q){return this.set(X)}modify(X){return(Q)=>this.set(X(this.get(Q)))}}class sz extends GQ{get;constructor(X,Q,Y){super(X,(J)=>l(Q(J)),(J,$)=>l(Y(J,$)));this.get=Q,this.replace=Y}modify(X){return(Q)=>this.replace(X(this.get(Q)),Q)}}class tz extends GQ{set;constructor(X,Q,Y){super(X,Q,(J,$)=>l(Y(J)));this.set=Y}replace(X,Q){return this.set(X)}modify(X){return(Q)=>x9(z6(this.getResult(Q),(Y)=>this.set(X(Y))),()=>Q)}}function P8(X){let Q=ez(X);switch(Q._tag){case"IsoNode":return new az(X,Q.get,Q.set);case"LensNode":return new sz(X,Q.get,Q.set);case"PrismNode":return new tz(X,Q.get,Q.set);case"OptionalNode":return new GQ(X,Q.get,Q.set)}}function _2(X){if(Array.isArray(X))return X.slice();if(typeof X==="object"&&X!==null){let Q=Object.getPrototypeOf(X);if(Q!==Object.prototype&&Q!==null)throw Error("Cannot clone object with non-Object constructor or null prototype");return{...X}}return X}var ez=d0((X)=>{switch(X._tag){case"IdentityNode":return{_tag:"IsoNode",get:b,set:b};case"IsoNode":case"LensNode":case"PrismNode":case"OptionalNode":return{_tag:X._tag,get:X.get,set:X.set};case"PathNode":return{_tag:"LensNode",get:(Q)=>{let Y=X.path,J=Q;for(let $=0,G=Y.length;$<G;$++)J=J[Y[$]];return J},set:(Q,Y)=>{let J=X.path,$=_2(Y),G=$,Z=0;for(;Z<J.length-1;Z++){let W=J[Z];G[W]=_2(G[W]),G=G[W]}let K=J[Z];return G[K]=Q,$}};case"CheckNode":return{_tag:"PrismNode",get:(Q)=>v9(Xz(X.checks,Q),String),set:b};case"CompositionNode":{let Q=X.nodes.map(ez),Y=Q.reduce((J,$)=>Fk(J,$._tag),"IsoNode");return{_tag:Y,get:(J)=>{for(let $=0;$<Q.length;$++){let G=Q[$],Z=G.get(J);if(H2(G._tag)){if(u(Z))return Z;J=Z.success}else J=Z}return H2(Y)?l(J):J},set:(J,$)=>{let G=$,Z=Q.length,K=Array(Z+1);K[0]=$;for(let W=0;W<Z;W++){let H=Q[W];if(H2(H._tag)){let _=H.get($);if(u(_))return Y==="OptionalNode"?_:G;$=_.success}else $=H.get($);K[W+1]=$}for(let W=Z-1;W>=0;W--){let H=Q[W];if(XF(H._tag))J=H.set(J);else if(H._tag==="LensNode")J=H.set(J,K[W]);else{let _=H.set(J,K[W]);if(u(_))return _;J=_.success}}return Y==="OptionalNode"?l(J):J}}}}});function H2(X){return X==="PrismNode"||X==="OptionalNode"}function XF(X){return X==="IsoNode"||X==="PrismNode"}function Fk(X,Q){switch(X){case"IsoNode":return Q;case"LensNode":return H2(Q)?"OptionalNode":"LensNode";case"PrismNode":return XF(Q)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var Lk=P8(rz);function q2(){return Lk}var lK={};$6(lK,{webUrl:()=>Nc,webSegment:()=>dR,webQueryParameters:()=>fR,webPath:()=>cR,webFragments:()=>pR,webAuthority:()=>hR,uuid:()=>Hc,uniqueArray:()=>X5,ulid:()=>Yc,uint8ClampedArray:()=>IR,uint8Array:()=>TR,uint32Array:()=>CR,uint16Array:()=>wR,tuple:()=>e,toStringMethod:()=>M8,subarray:()=>od,stringify:()=>g0,stringMatching:()=>$f,string:()=>p0,stream:()=>s4,statistics:()=>Xg,sparseArray:()=>jR,shuffledSubarray:()=>nd,set:()=>ER,schedulerFor:()=>bc,scheduler:()=>yc,scheduledModelRun:()=>xc,sample:()=>tb,resetConfigureGlobal:()=>$b,record:()=>DK,readConfigureGlobal:()=>N8,property:()=>Kb,pre:()=>xk,option:()=>U4,oneof:()=>l0,object:()=>Id,noShrink:()=>k2,noBias:()=>v2,nat:()=>i4,modelRun:()=>Sc,mixedCase:()=>Zd,memo:()=>Xd,maxSafeNat:()=>sm,maxSafeInteger:()=>UR,mapToConstant:()=>q9,map:()=>BK,lorem:()=>ap,limitShrink:()=>_f,letrec:()=>FR,jsonValue:()=>kR,json:()=>xd,ipV6:()=>zR,ipV4Extended:()=>OR,ipV4:()=>pK,integer:()=>z0,int8Array:()=>AR,int32Array:()=>MR,int16Array:()=>NR,infiniteStream:()=>bd,hash:()=>x2,hasToStringMethod:()=>MK,hasCloneMethod:()=>t6,hasAsyncToStringMethod:()=>AK,getDepthContextFor:()=>IK,gen:()=>Gg,func:()=>om,float64Array:()=>RR,float32Array:()=>PR,float:()=>qR,falsy:()=>vg,entityGraph:()=>cp,emailAddress:()=>Ym,double:()=>b2,domain:()=>bK,dictionary:()=>vK,defaultReportMessage:()=>gP,date:()=>nP,createDepthIdentifier:()=>jK,context:()=>kg,constantFrom:()=>m8,constant:()=>b0,configureGlobal:()=>Jb,compareFunc:()=>um,compareBooleanFunc:()=>cm,commands:()=>Cc,cloneMethod:()=>r0,cloneIfNeeded:()=>K9,clone:()=>fg,check:()=>pP,boolean:()=>zQ,bigUint64Array:()=>hc,bigInt64Array:()=>gc,bigInt:()=>t4,base64String:()=>fd,asyncToStringMethod:()=>B4,asyncStringify:()=>wK,asyncProperty:()=>Zb,asyncModelRun:()=>vc,asyncDefaultReportMessage:()=>hP,assert:()=>ab,array:()=>P0,anything:()=>xR,__version:()=>Df,__type:()=>qf,__commitHash:()=>Bf,VerbosityLevel:()=>z1,Value:()=>k,Stream:()=>Q0,Random:()=>CK,PreconditionFailure:()=>e4,ExecutionStatus:()=>a6,Arbitrary:()=>I0});var Rk=class X{constructor(Q){this.seed=Q}clone(){return new X(this.seed)}next(){let Q=PZ(this.seed),Y=RZ(Q),J=PZ(Q),$=RZ(J);return this.seed=PZ(J),RZ(this.seed)+($+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function PZ(X){return Math.imul(X,214013)+2531011&4294967295}function RZ(X){return(X&-2147483649)>>16}function QF(X){return new Rk(X)}var Nk=class X{constructor(Q,Y){this.states=Q,this.index=Y}clone(){return new X(this.states.slice(),this.index)}next(){let Q=this.states[this.index];return Q^=Q>>>11,Q^=Q<<7&2636928640,Q^=Q<<15&4022730752,Q^=Q>>>18,this.index=D2(this.states,this.index),Q}getState(){return[this.index,...this.states]}jump(){let Q=this.states.slice(),Y=this.index;this.index=D2(this.states,this.index);for(let J=19932;J>0;--J){if("SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000".charCodeAt(J/6|0)-48&1<<J%6)YF(this.states,this.index,Q,Y);this.index=D2(this.states,this.index)}YF(this.states,this.index,Q,Y)}};function YF(X,Q,Y,J){let $=0;if(J>=Q){for(;$<624-J;$++)X[$+Q]^=Y[$+J];for(;$<624-Q;$++)X[$+Q]^=Y[$+J-624];for(;$<624;$++)X[$+Q-624]^=Y[$+J-624]}else{for(;$<624-Q;$++)X[$+Q]^=Y[$+J];for(;$<624-J;$++)X[$+Q-624]^=Y[$+J];for(;$<624;$++)X[$+Q-624]^=Y[$+J-624]}}function D2(X,Q){if(Q<227){let Y=X[Q]&2147483648|X[Q+1]&2147483647;return X[Q]=X[Q+397]^Y>>>1^-(Y&1)&2567483615,Q+1}else if(Q<623){let Y=X[Q]&2147483648|X[Q+1]&2147483647;return X[Q]=X[Q+397-624]^Y>>>1^-(Y&1)&2567483615,Q+1}else{let Y=X[Q]&2147483648|X[0]&2147483647;return X[Q]=X[396]^Y>>>1^-(Y&1)&2567483615,0}}function Mk(X){for(let Q=0;Q!==624;++Q)D2(X,Q)}function JF(X){let Q=[X|0];for(let Y=1;Y!==624;++Y){let J=Q[Y-1]^Q[Y-1]>>>30;Q.push(Math.imul(1812433253,J)+Y|0)}return Mk(Q),new Nk(Q,0)}var Ak=class X{constructor(Q,Y,J,$){this.s01=Q,this.s00=Y,this.s11=J,this.s10=$}clone(){return new X(this.s01,this.s00,this.s11,this.s10)}next(){let Q=this.s00^this.s00<<23,Y=this.s01^(this.s01<<23|this.s00>>>9),J=Q^this.s10^(Q>>>18|Y<<14)^(this.s10>>>5|this.s11<<27),$=Y^this.s11^Y>>>18^this.s11>>>5,G=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=$,this.s10=J,G}jump(){let Q=0,Y=0,J=0,$=0,G=[1667051007,2321340297,1548169110,304075285];for(let Z=0;Z!==4;++Z)for(let K=1;K;K<<=1){if(G[Z]&K)Q^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=Q,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function NZ(X){return new Ak(-1,~X,X|0,0)}var wk=class X{constructor(Q,Y,J,$){this.s01=Q,this.s00=Y,this.s11=J,this.s10=$}clone(){return new X(this.s01,this.s00,this.s11,this.s10)}next(){let Q=this.s00+this.s10|0,Y=this.s10^this.s00,J=this.s11^this.s01,$=this.s00,G=this.s01;return this.s00=$<<24^G>>>8^Y^Y<<16,this.s01=G<<24^$>>>8^J^(J<<16|Y>>>16),this.s10=J<<5^Y>>>27,this.s11=Y<<5^J>>>27,Q}jump(){let Q=0,Y=0,J=0,$=0,G=[3639956645,3750757012,1261568508,386426335];for(let Z=0;Z!==4;++Z)for(let K=1;K;K<<=1){if(G[Z]&K)Q^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=Q,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function $F(X){return new wk(-1,~X,X|0,0)}function GF(X,Q){for(let Y=0;Y!==Q;++Y)X.next()}var ZF=BigInt,Ck=4294967296n;function WF(X,Q,Y){let J=Y-Q+1n,$=Ck,G=1;while($<J)$<<=32n,++G;let Z=KF(G,X);if(Z<J)return Z+Q;if(Z+J<$)return Z%J+Q;let K=$-$%J;while(Z>=K)Z=KF(G,X);return Z%J+Q}function KF(X,Q){let Y=ZF(Q.next()+2147483648);for(let J=1;J<X;++J){let $=Q.next();Y=(Y<<32n)+ZF($+2147483648)}return Y}function ZQ(X,Q){let Y=Q>2?~~(4294967296/Q)*Q:4294967296,J=X.next()+2147483648;while(J>=Y)J=X.next()+2147483648;return J%Q}function MZ(X,Q){if(Q<0){let Y=-Q;X.sign=-1,X.data[0]=~~(Y/4294967296),X.data[1]=Y>>>0}else X.sign=1,X.data[0]=~~(Q/4294967296),X.data[1]=Q>>>0;return X}function Tk(X,Q,Y){let J=Q.data[1],$=Q.data[0],G=Q.sign,Z=Y.data[1],K=Y.data[0],W=Y.sign;if(X.sign=1,G===1&&W===-1){let R=J+Z,L=$+K+(R>4294967295?1:0);return X.data[0]=L>>>0,X.data[1]=R>>>0,X}let H=J,_=$,V=Z,q=K;if(G===-1)H=Z,_=K,V=J,q=$;let D=0,U=H-V;if(U<0)D=1,U=U>>>0;return X.data[0]=_-q-D,X.data[1]=U,X}function Ik(X,Q,Y){let J=Y[0]+1;Q[0]=ZQ(X,J),Q[1]=ZQ(X,4294967296);while(Q[0]>=Y[0]&&(Q[0]!==Y[0]||Q[1]>=Y[1]))Q[0]=ZQ(X,J),Q[1]=ZQ(X,4294967296);return Q}var jk=Number.MAX_SAFE_INTEGER,Ek={sign:1,data:[0,0]},Sk={sign:1,data:[0,0]},HF={sign:1,data:[0,0]},AZ=[0,0];function vk(X,Q,Y,J){let $=J<=jk?MZ(HF,J):Tk(HF,MZ(Ek,Y),MZ(Sk,Q));if($.data[1]===4294967295)$.data[0]+=1,$.data[1]=0;else $.data[1]+=1;return Ik(X,AZ,$.data),AZ[0]*4294967296+AZ[1]+Q}function B2(X,Q,Y){let J=Y-Q;if(J<=4294967295)return ZQ(X,J+1)+Q;return vk(X,Q,Y,J)}var VF=Symbol.for("fast-check/PreconditionFailure"),e4=class extends Error{constructor(X=!1){super();this.interruptExecution=X,this.footprint=VF}static isFailure(X){return X!==null&&X!==void 0&&X.footprint===VF}};function xk(X){if(!X)throw new e4}var kk=class{[Symbol.iterator](){return this}next(X){return{value:X,done:!0}}},yk=new kk;function bk(){return yk}function*gk(X,Q){for(let Y of X)yield Q(Y)}function*hk(X,Q){for(let Y of X)yield*Q(Y)}function*mk(X,Q){for(let Y of X)if(Q(Y))yield Y}function*pk(X,Q){for(let Y=0;Y<Q;++Y){let J=X.next();if(J.done)break;yield J.value}}function*dk(X,Q){let Y=X.next();while(!Y.done&&Q(Y.value))yield Y.value,Y=X.next()}function*ck(X,Q){for(let Y=X.next();!Y.done;Y=X.next())yield Y.value;for(let Y of Q)for(let J=Y.next();!J.done;J=Y.next())yield J.value}var fk=Symbol.iterator,Q0=class X{static nil(){return new X(bk())}static of(...Q){return new X(Q[fk]())}constructor(Q){this.g=Q}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(Q){return new X(gk(this.g,Q))}flatMap(Q){return new X(hk(this.g,Q))}dropWhile(Q){let Y=!1;function*J($){if(Y||!Q($))Y=!0,yield $}return this.flatMap(J)}drop(Q){if(Q<=0)return this;let Y=0;function J(){return Y++<Q}return this.dropWhile(J)}takeWhile(Q){return new X(dk(this.g,Q))}take(Q){return new X(pk(this.g,Q))}filter(Q){return new X(mk(this.g,Q))}every(Q){for(let Y of this.g)if(!Q(Y))return!1;return!0}has(Q){for(let Y of this.g)if(Q(Y))return[!0,Y];return[!1,null]}join(...Q){return new X(ck(this.g,Q))}getNthOrLast(Q){let Y=Q,J=null;for(let $ of this.g){if(Y--===0)return $;J=$}return J}};function s4(X){return new Q0(X)}var r0=Symbol.for("fast-check/cloneMethod");function t6(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&r0 in X&&typeof X[r0]==="function"}function K9(X){return t6(X)?X[r0]():X}var uk=Object.defineProperty,k=class{constructor(X,Q,Y=void 0){if(this.value_=X,this.context=Q,this.hasToBeCloned=Y!==void 0||t6(X),this.readOnce=!1,this.hasToBeCloned)uk(this,"value",{get:Y!==void 0?Y:this.getValue});else this.value=X}getValue(){if(this.hasToBeCloned){if(!this.readOnce)return this.readOnce=!0,this.value_;return this.value_[r0]()}return this.value_}},I0=class{filter(X){return new ok(this,X)}map(X,Q){return new rk(this,X,Q)}chain(X){return new lk(this,X)}},lk=class extends I0{constructor(X,Q){super();this.arb=X,this.chainer=Q}generate(X,Q){let Y=X.clone(),J=this.arb.generate(X,Q);return this.valueChainer(J,X,Y,Q)}canShrinkWithoutContext(X){return!1}shrink(X,Q){if(this.isSafeContext(Q))return(!Q.stoppedForOriginal?this.arb.shrink(Q.originalValue,Q.originalContext).map((Y)=>this.valueChainer(Y,Q.clonedMrng.clone(),Q.clonedMrng,Q.originalBias)):Q0.nil()).join(Q.chainedArbitrary.shrink(X,Q.chainedContext).map((Y)=>{let J={...Q,chainedContext:Y.context,stoppedForOriginal:!0};return new k(Y.value_,J)}));return Q0.nil()}valueChainer(X,Q,Y,J){let $=this.chainer(X.value_),G=$.generate(Q,J),Z={originalBias:J,originalValue:X.value_,originalContext:X.context,stoppedForOriginal:!1,chainedArbitrary:$,chainedContext:G.context,clonedMrng:Y};return new k(G.value_,Z)}isSafeContext(X){return X!==null&&X!==void 0&&typeof X==="object"&&"originalBias"in X&&"originalValue"in X&&"originalContext"in X&&"stoppedForOriginal"in X&&"chainedArbitrary"in X&&"chainedContext"in X&&"clonedMrng"in X}},rk=class extends I0{constructor(X,Q,Y){super();this.arb=X,this.mapper=Q,this.unmapper=Y,this.bindValueMapper=(J)=>this.valueMapper(J)}generate(X,Q){let Y=this.arb.generate(X,Q);return this.valueMapper(Y)}canShrinkWithoutContext(X){if(this.unmapper!==void 0)try{let Q=this.unmapper(X);return this.arb.canShrinkWithoutContext(Q)}catch{return!1}return!1}shrink(X,Q){if(this.isSafeContext(Q))return this.arb.shrink(Q.originalValue,Q.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let Y=this.unmapper(X);return this.arb.shrink(Y,void 0).map(this.bindValueMapper)}return Q0.nil()}mapperWithCloneIfNeeded(X){let Q=X.value,Y=this.mapper(Q);if(X.hasToBeCloned&&(typeof Y==="object"&&Y!==null||typeof Y==="function")&&Object.isExtensible(Y)&&!t6(Y))Object.defineProperty(Y,r0,{get:()=>()=>this.mapperWithCloneIfNeeded(X)[0]});return[Y,Q]}valueMapper(X){let[Q,Y]=this.mapperWithCloneIfNeeded(X);return new k(Q,{originalValue:Y,originalContext:X.context})}isSafeContext(X){return X!==null&&X!==void 0&&typeof X==="object"&&"originalValue"in X&&"originalContext"in X}},ok=class extends I0{constructor(X,Q){super();this.arb=X,this.refinement=Q,this.bindRefinementOnValue=(Y)=>this.refinementOnValue(Y)}generate(X,Q){while(!0){let Y=this.arb.generate(X,Q);if(this.refinementOnValue(Y))return Y}}canShrinkWithoutContext(X){return this.arb.canShrinkWithoutContext(X)&&this.refinement(X)}shrink(X,Q){return this.arb.shrink(X,Q).filter(this.bindRefinementOnValue)}refinementOnValue(X){return this.refinement(X.value)}};function VP(X){return typeof X==="object"&&X!==null&&"generate"in X&&"shrink"in X&&"canShrinkWithoutContext"in X}function _P(X){if(!VP(X))throw Error("Unexpected value received: not an instance of Arbitrary")}var qP=Function.prototype.apply,wZ=Symbol("apply");function nk(X){try{return X.apply}catch{return}}function ik(X,Q,Y){let J=X;J[wZ]=qP;let $=J[wZ](Q,Y);return delete J[wZ],$}function V0(X,Q,Y){if(nk(X)===qP)return X.apply(Q,Y);return ik(X,Q,Y)}var DP=Array,j=BigInt,ak=BigInt64Array,sk=BigUint64Array,BP=Boolean,j2=Date,E=Error,UP=Float32Array,OP=Float64Array,tk=Int8Array,ek=Int16Array,Xy=Int32Array,q4=Number,F1=String,W9=Set,Qy=Uint8Array,Yy=Uint8ClampedArray,Jy=Uint16Array,$y=Uint32Array,Gy=encodeURIComponent,D4=Map,N2=Symbol,_F=Array.prototype.forEach,qF=Array.prototype.indexOf,DF=Array.prototype.join,BF=Array.prototype.map,UF=Array.prototype.flat,OF=Array.prototype.filter,zF=Array.prototype.push,FF=Array.prototype.pop,LF=Array.prototype.splice,PF=Array.prototype.slice,RF=Array.prototype.sort,NF=Array.prototype.every;function Zy(X){try{return X.forEach}catch{return}}function Ky(X){try{return X.indexOf}catch{return}}function Wy(X){try{return X.join}catch{return}}function Hy(X){try{return X.map}catch{return}}function Vy(X){try{return X.flat}catch{return}}function _y(X){try{return X.filter}catch{return}}function qy(X){try{return X.push}catch{return}}function Dy(X){try{return X.pop}catch{return}}function By(X){try{return X.splice}catch{return}}function Uy(X){try{return X.slice}catch{return}}function Oy(X){try{return X.sort}catch{return}}function zy(X){try{return X.every}catch{return}}function zP(X,Q){if(Zy(X)===_F)return X.forEach(Q);return V0(_F,X,[Q])}function _4(X,...Q){if(Ky(X)===qF)return X.indexOf(...Q);return V0(qF,X,Q)}function w0(X,...Q){if(Wy(X)===DF)return X.join(...Q);return V0(DF,X,Q)}function G0(X,Q){if(Hy(X)===BF)return X.map(Q);return V0(BF,X,[Q])}function Fy(X,Q){if(Vy(X)===UF)return[].flat(),X.flat(Q);return V0(UF,X,[Q])}function Ly(X,Q){if(_y(X)===OF)return X.filter(Q);return V0(OF,X,[Q])}function S(X,...Q){if(qy(X)===zF)return X.push(...Q);return V0(zF,X,Q)}function FP(X){if(Dy(X)===FF)return X.pop();return V0(FF,X,[])}function LP(X,...Q){if(By(X)===LF)return X.splice(...Q);return V0(LF,X,Q)}function e0(X,...Q){if(Uy(X)===PF)return X.slice(...Q);return V0(PF,X,Q)}function PP(X,...Q){if(Oy(X)===RF)return X.sort(...Q);return V0(RF,X,Q)}function RP(X,...Q){if(zy(X)===NF)return X.every(...Q);return V0(NF,X,Q)}var MF=Date.prototype.getTime,AF=Date.prototype.toISOString;function Py(X){try{return X.getTime}catch{return}}function Ry(X){try{return X.toISOString}catch{return}}function E2(X){if(Py(X)===MF)return X.getTime();return V0(MF,X,[])}function Ny(X){if(Ry(X)===AF)return X.toISOString();return V0(AF,X,[])}var wF=Set.prototype.add,CF=Set.prototype.has;function My(X){try{return X.add}catch{return}}function Ay(X){try{return X.has}catch(Q){return}}function _Q(X,Q){if(My(X)===wF)return X.add(Q);return V0(wF,X,[Q])}function S2(X,Q){if(Ay(X)===CF)return X.has(Q);return V0(CF,X,[Q])}var TF=WeakMap.prototype.set,IF=WeakMap.prototype.get;function wy(X){try{return X.set}catch(Q){return}}function Cy(X){try{return X.get}catch(Q){return}}function Ty(X,Q,Y){if(wy(X)===TF)return X.set(Q,Y);return V0(TF,X,[Q,Y])}function Iy(X,Q){if(Cy(X)===IF)return X.get(Q);return V0(IF,X,[Q])}var jF=Map.prototype.set,EF=Map.prototype.get,SF=Map.prototype.has;function jy(X){try{return X.set}catch(Q){return}}function Ey(X){try{return X.get}catch(Q){return}}function Sy(X){try{return X.has}catch(Q){return}}function R8(X,Q,Y){if(jy(X)===jF)return X.set(Q,Y);return V0(jF,X,[Q,Y])}function d1(X,Q){if(Ey(X)===EF)return X.get(Q);return V0(EF,X,[Q])}function vy(X,Q){if(Sy(X)===SF)return X.has(Q);return V0(SF,X,[Q])}var vF=String.prototype.split,xF=String.prototype.startsWith,kF=String.prototype.endsWith,yF=String.prototype.substring,bF=String.prototype.toLowerCase,gF=String.prototype.toUpperCase,hF=String.prototype.padStart,mF=String.prototype.charCodeAt,pF=String.prototype.normalize,dF=String.prototype.replace;function xy(X){try{return X.split}catch{return}}function ky(X){try{return X.startsWith}catch{return}}function yy(X){try{return X.endsWith}catch{return}}function by(X){try{return X.substring}catch{return}}function gy(X){try{return X.toLowerCase}catch{return}}function hy(X){try{return X.toUpperCase}catch{return}}function my(X){try{return X.padStart}catch{return}}function py(X){try{return X.charCodeAt}catch{return}}function dy(X){try{return X.normalize}catch(Q){return}}function cy(X){try{return X.replace}catch{return}}function L1(X,...Q){if(xy(X)===vF)return X.split(...Q);return V0(vF,X,Q)}function fy(X,...Q){if(ky(X)===xF)return X.startsWith(...Q);return V0(xF,X,Q)}function uy(X,...Q){if(yy(X)===kF)return X.endsWith(...Q);return V0(kF,X,Q)}function S0(X,...Q){if(by(X)===yF)return X.substring(...Q);return V0(yF,X,Q)}function aZ(X){if(gy(X)===bF)return X.toLowerCase();return V0(bF,X,[])}function PK(X){if(hy(X)===gF)return X.toUpperCase();return V0(gF,X,[])}function ly(X,...Q){if(my(X)===hF)return X.padStart(...Q);return V0(hF,X,Q)}function H9(X,Q){if(py(X)===mF)return X.charCodeAt(Q);return V0(mF,X,[Q])}function ry(X,Q){if(dy(X)===pF)return X.normalize(Q);return V0(pF,X,[Q])}function oy(X,Q,Y){if(cy(X)===dF)return X.replace(Q,Y);return V0(dF,X,[Q,Y])}var cF=Number.prototype.toString;function ny(X){try{return X.toString}catch{return}}function qQ(X,...Q){if(ny(X)===cF)return X.toString(...Q);return V0(cF,X,Q)}var iy=Object.prototype.hasOwnProperty,ay=Object.prototype.toString;function NP(X,Q){return V0(iy,X,[Q])}function sZ(X){return V0(ay,X,[])}var sy=Error.prototype.toString;function ty(X){return V0(sy,X,[])}var ey=class{constructor(X){this.producer=X}[Symbol.iterator](){if(this.it===void 0)this.it=this.producer();return this.it}next(){if(this.it===void 0)this.it=this.producer();return this.it.next()}};function a4(X){return new ey(X)}var MP=Array.isArray,Xb=Object.defineProperty;function AP(X,Q){return Xb(X,r0,{value:()=>{let Y=[];for(let J=0;J!==Q.length;++J)S(Y,Q[J].value);return AP(Y,Q),Y}})}function wP(X){let Q=!1,Y=[],J=[];for(let $=0;$!==X.length;++$){let G=X[$];Q=Q||G.hasToBeCloned,S(Y,G.value),S(J,G.context)}if(Q)AP(Y,X);return new k(Y,J)}function CP(X,Q,Y){let J=[],$=MP(Y)?Y:[];for(let G=0;G!==X.length;++G)S(J,a4(()=>X[G].shrink(Q[G],$[G]).map((Z)=>{let K=G0(Q,(W,H)=>new k(K9(W),$[H]));return[...e0(K,0,G),Z,...e0(K,G+1)]}).map(wP)));return Q0.nil().join(...J)}var Qb=class extends I0{constructor(X){super();this.arbs=X;for(let Q=0;Q!==X.length;++Q){let Y=X[Q];if(Y===null||Y===void 0||Y.generate===null||Y.generate===void 0)throw Error(`Invalid parameter encountered at index ${Q}: expecting an Arbitrary`)}}generate(X,Q){let Y=[];for(let J=0;J!==this.arbs.length;++J)S(Y,this.arbs[J].generate(X,Q));return wP(Y)}canShrinkWithoutContext(X){if(!MP(X)||X.length!==this.arbs.length)return!1;for(let Q=0;Q!==this.arbs.length;++Q)if(!this.arbs[Q].canShrinkWithoutContext(X[Q]))return!1;return!0}shrink(X,Q){return CP(this.arbs,X,Q)}};function e(...X){return new Qb(X)}var Yb=Math.log;function TP(X){return 2+~~(Yb(X+1)*0.4342944819032518)}var RK={};function Jb(X){RK=X}function N8(){return RK}function $b(){RK={}}var DQ=Symbol("UndefinedContextPlaceholder");function V9(X){if(X.context!==void 0)return X;if(X.hasToBeCloned)return new k(X.value_,DQ,()=>X.value);return new k(X.value_,DQ)}var fF=()=>{},Gb=class{constructor(X,Q){this.arb=X,this.predicate=Q;let{asyncBeforeEach:Y,asyncAfterEach:J,beforeEach:$,afterEach:G}=N8()||{};if(Y!==void 0&&$!==void 0)throw E(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(J!==void 0&&G!==void 0)throw E(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=Y||$||fF,this.afterEachHook=J||G||fF}isAsync(){return!0}generate(X,Q){return V9(this.arb.generate(X,Q!==void 0?TP(Q):void 0))}shrink(X){if(X.context===void 0&&!this.arb.canShrinkWithoutContext(X.value_))return Q0.nil();let Q=X.context!==DQ?X.context:void 0;return this.arb.shrink(X.value_,Q).map(V9)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(X){try{let Q=await this.predicate(X);return Q===void 0||Q===!0?null:{error:new E("Property failed by returning false")}}catch(Q){if(e4.isFailure(Q))return Q;return{error:Q}}}beforeEach(X){let Q=this.beforeEachHook;return this.beforeEachHook=()=>X(Q),this}afterEach(X){let Q=this.afterEachHook;return this.afterEachHook=()=>X(Q),this}},IP=class extends I0{constructor(X){super();this.arb=X}generate(X,Q){return V9(this.arb.generate(X,Q))}canShrinkWithoutContext(X){return!0}shrink(X,Q){if(Q===void 0&&!this.arb.canShrinkWithoutContext(X))return Q0.nil();let Y=Q!==DQ?Q:void 0;return this.arb.shrink(X,Y).map(V9)}};function Zb(...X){if(X.length<2)throw Error("asyncProperty expects at least two parameters");let Q=e0(X,0,X.length-1),Y=X[X.length-1];return zP(Q,_P),new Gb(e(...G0(Q,(J)=>new IP(J))),(J)=>Y(...J))}var uF=()=>{},jP=class{constructor(X,Q){this.arb=X,this.predicate=Q;let{beforeEach:Y=uF,afterEach:J=uF,asyncBeforeEach:$,asyncAfterEach:G}=N8()||{};if($!==void 0)throw E(`"asyncBeforeEach" can't be set when running synchronous properties`);if(G!==void 0)throw E(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=Y,this.afterEachHook=J}isAsync(){return!1}generate(X,Q){return V9(this.arb.generate(X,Q!==void 0?TP(Q):void 0))}shrink(X){if(X.context===void 0&&!this.arb.canShrinkWithoutContext(X.value_))return Q0.nil();let Q=X.context!==DQ?X.context:void 0;return this.arb.shrink(X.value_,Q).map(V9)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(X){try{let Q=this.predicate(X);return Q===void 0||Q===!0?null:{error:new E("Property failed by returning false")}}catch(Q){if(e4.isFailure(Q))return Q;return{error:Q}}}beforeEach(X){let Q=this.beforeEachHook;return this.beforeEachHook=()=>X(Q),this}afterEach(X){let Q=this.afterEachHook;return this.afterEachHook=()=>X(Q),this}};function Kb(...X){if(X.length<2)throw Error("property expects at least two parameters");let Q=e0(X,0,X.length-1),Y=X[X.length-1];return zP(Q,_P),new jP(e(...G0(Q,(J)=>new IP(J))),(J)=>Y(...J))}var z1=function(X){return X[X.None=0]="None",X[X.Verbose=1]="Verbose",X[X.VeryVerbose=2]="VeryVerbose",X}({});function tZ(X){if("unsafeNext"in X){if(X.unsafeJump===void 0)return{clone:()=>tZ(X),next:()=>X.unsafeNext(),getState:()=>X.getState()};return{clone:()=>tZ(X),next:()=>X.unsafeNext(),jump:()=>X.unsafeJump(),getState:()=>X.getState()}}return X}function EP(X){if("jump"in X&&typeof X.jump==="function")return X;return{clone:()=>EP(X),next:()=>X.next(),jump:()=>GF(X,42),getState:()=>X.getState()}}function y2(X){return EP(tZ(X))}var Wb=Date.now,Hb=Math.min,Vb=Math.random,_b=class{constructor(X){let Q=X||{};this.seed=qb(Q),this.randomType=Db(Q),this.numRuns=Bb(Q),this.verbose=Ub(Q),this.maxSkipsPerRun=Q.maxSkipsPerRun!==void 0?Q.maxSkipsPerRun:100,this.timeout=TZ(Q.timeout),this.skipAllAfterTimeLimit=TZ(Q.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=TZ(Q.interruptAfterTimeLimit),this.markInterruptAsFailure=Q.markInterruptAsFailure===!0,this.skipEqualValues=Q.skipEqualValues===!0,this.ignoreEqualValues=Q.ignoreEqualValues===!0,this.logger=Q.logger!==void 0?Q.logger:(Y)=>{console.log(Y)},this.path=Q.path!==void 0?Q.path:"",this.unbiased=Q.unbiased===!0,this.examples=Q.examples!==void 0?Q.examples:[],this.endOnFailure=Q.endOnFailure===!0,this.reporter=Q.reporter,this.asyncReporter=Q.asyncReporter,this.includeErrorInReport=Q.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function CZ(X){return(Q)=>{return y2(X(Q))}}function qb(X){if(X.seed===void 0)return Wb()^Vb()*4294967296;let Q=X.seed|0;if(X.seed===Q)return Q;return Q^(X.seed-Q)*4294967296}function Db(X){if(X.randomType===void 0)return NZ;if(typeof X.randomType==="string")switch(X.randomType){case"mersenne":return CZ(JF);case"congruential":case"congruential32":return CZ(QF);case"xorshift128plus":return NZ;case"xoroshiro128plus":return $F;default:throw Error(`Invalid random specified: '${X.randomType}'`)}let Q=X.randomType(0);if("min"in Q&&Q.min!==-2147483648)throw Error(`Invalid random number generator: min must equal -0x80000000, got ${String(Q.min)}`);if("max"in Q&&Q.max!==2147483647)throw Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(Q.max)}`);if(Q===y2(Q))return X.randomType;return CZ(X.randomType)}function Bb(X){if(X.numRuns!==void 0)return X.numRuns;if(X.num_runs!==void 0)return X.num_runs;return 100}function Ub(X){if(X.verbose===void 0)return z1.None;if(typeof X.verbose==="boolean")return X.verbose===!0?z1.Verbose:z1.None;if(X.verbose<=z1.None)return z1.None;if(X.verbose>=z1.VeryVerbose)return z1.VeryVerbose;return X.verbose|0}function TZ(X){if(X===void 0)return;return Hb(X,2147483647)}function NK(X){return new _b(X)}function Ob(X,Q,Y){let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=Q(()=>{$(new e4(!0))},X)})}}var lF=class{constructor(X,Q,Y,J,$,G){this.property=X,this.getTime=Q,this.interruptExecution=J,this.setTimeoutSafe=$,this.clearTimeoutSafe=G,this.skipAfterTime=this.getTime()+Y}isAsync(){return this.property.isAsync()}generate(X,Q){return this.property.generate(X,Q)}shrink(X){return this.property.shrink(X)}run(X){let Q=this.skipAfterTime-this.getTime();if(Q<=0){let Y=new e4(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=Ob(Q,this.setTimeoutSafe,this.clearTimeoutSafe),J=Promise.race([this.property.run(X),Y.promise]);return J.then(Y.clear,Y.clear),J}return this.property.run(X)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},zb=(X,Q,Y)=>{let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=Q(()=>{$({error:new E(`Property timeout: exceeded limit of ${X} milliseconds`)})},X)})}},Fb=class{constructor(X,Q,Y,J){this.property=X,this.timeMs=Q,this.setTimeoutSafe=Y,this.clearTimeoutSafe=J}isAsync(){return!0}generate(X,Q){return this.property.generate(X,Q)}shrink(X){return this.property.shrink(X)}async run(X){let Q=zb(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),Y=Promise.race([this.property.run(X),Q.promise]);return Y.then(Q.clear,Q.clear),Y}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},SP=class{constructor(X){this.property=X}isAsync(){return this.property.isAsync()}generate(X,Q){return this.property.generate(X,void 0)}shrink(X){return this.property.shrink(X)}run(X){return this.property.run(X)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},rF=Array.from,oF=typeof Buffer<"u"?Buffer.isBuffer:void 0,J9=JSON.stringify,nF=Number.isNaN,Lb=Object.keys,Pb=Object.getOwnPropertySymbols,Rb=Object.getOwnPropertyDescriptor,iF=Object.getPrototypeOf,aF=Number.NEGATIVE_INFINITY,Nb=Number.POSITIVE_INFINITY,M8=Symbol.for("fast-check/toStringMethod");function MK(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&M8 in X&&typeof X[M8]==="function"}var B4=Symbol.for("fast-check/asyncToStringMethod");function AK(X){return X!==null&&(typeof X==="object"||typeof X==="function")&&B4 in X&&typeof X[B4]==="function"}var Mb=/^Symbol\((.*)\)$/;function Ab(X){if(X.description!==void 0)return X.description;let Q=Mb.exec(F1(X));return Q&&Q[1].length?Q[1]:null}function sF(X){switch(X){case 0:return 1/X===aF?"-0":"0";case aF:return"Number.NEGATIVE_INFINITY";case Nb:return"Number.POSITIVE_INFINITY";default:return X===X?F1(X):"Number.NaN"}}function wb(X){let Q=-1;for(let Y in X){let J=Number(Y);if(J!==Q+1)return!0;Q=J}return Q+1!==X.length}function p1(X,Q,Y){let J=[...Q,X];if(typeof X==="object"){if(_4(Q,X)!==-1)return"[cyclic]"}if(AK(X)){let $=Y(X);if($.state==="fulfilled")return $.value}if(MK(X))try{return X[M8]()}catch{}switch(sZ(X)){case"[object Array]":{let $=X;if($.length>=50&&wb($)){let Z=[];for(let K in $)if(!nF(Number(K)))S(Z,`${K}:${p1($[K],J,Y)}`);return Z.length!==0?`Object.assign(Array(${$.length}),{${w0(Z,",")}})`:`Array(${$.length})`}let G=w0(G0($,(Z)=>p1(Z,J,Y)),",");return $.length===0||$.length-1 in $?`[${G}]`:`[${G},]`}case"[object BigInt]":return`${X}n`;case"[object Boolean]":{let $=X==!0?"true":"false";return typeof X==="boolean"?$:`new Boolean(${$})`}case"[object Date]":{let $=X;return nF(E2($))?"new Date(NaN)":`new Date(${J9(Ny($))})`}case"[object Map]":return`new Map(${p1(Array.from(X),J,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof X==="number"?sF(X):`new Number(${sF(Number(X))})`;case"[object Object]":{try{let G=X.toString;if(typeof G==="function"&&G!==Object.prototype.toString)return X.toString()}catch{return"[object Object]"}let $=(G)=>`${G==="__proto__"?'["__proto__"]':typeof G==="symbol"?`[${p1(G,J,Y)}]`:J9(G)}:${p1(X[G],J,Y)}`;return"{"+w0([...iF(X)===null?["__proto__:null"]:[],...G0(Lb(X),$),...G0(Ly(Pb(X),(G)=>{let Z=Rb(X,G);return Z&&Z.enumerable}),$)],",")+"}"}case"[object Set]":return`new Set(${p1(Array.from(X),J,Y)})`;case"[object String]":return typeof X==="string"?J9(X):`new String(${J9(X)})`;case"[object Symbol]":{let $=X;if(N2.keyFor($)!==void 0)return`Symbol.for(${J9(N2.keyFor($))})`;let G=Ab($);if(G===null)return"Symbol()";return $===(G.startsWith("Symbol.")&&N2[G.substring(7)])?G:`Symbol(${J9(G)})`}case"[object Promise]":{let $=Y(X);switch($.state){case"fulfilled":return`Promise.resolve(${p1($.value,J,Y)})`;case"rejected":return`Promise.reject(${p1($.value,J,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(X instanceof Error)return`new Error(${p1(X.message,J,Y)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof oF==="function"&&oF(X))return`Buffer.from(${X.buffer.detached?"/*detached ArrayBuffer*/":p1(rF(X.values()),J,Y)})`;let $=iF(X),G=$&&$.constructor&&$.constructor.name;if(typeof G==="string"){let Z=X;if(Z.buffer.detached)return`${G}.from(/*detached ArrayBuffer*/)`;return`${G}.from(${p1(rF(Z.values()),J,Y)})`}break}}try{return X.toString()}catch{return sZ(X)}}function g0(X){return p1(X,[],()=>({state:"unknown",value:void 0}))}function vP(X){let Q=N2(),Y=[],J=new D4;function $(){let W=null,H=()=>{if(W!==null)clearTimeout(W)};return{delay:new Promise((_)=>{W=setTimeout(()=>{W=null,_(Q)},0)}),cancel:H}}let G={state:"unknown",value:void 0},Z=function(H){let _=H;if(J.has(_))return J.get(_);let V=$(),q=B4 in H?Promise.resolve().then(()=>H[B4]()):H;return q.catch(()=>{}),Y.push(Promise.race([q,V.delay]).then((D)=>{if(D===Q)J.set(_,{state:"pending",value:void 0});else J.set(_,{state:"fulfilled",value:D});V.cancel()},(D)=>{J.set(_,{state:"rejected",value:D}),V.cancel()})),J.set(_,G),G};function K(){let W=p1(X,[],Z);if(Y.length===0)return W;return Promise.all(Y.splice(0)).then(K)}return K()}async function wK(X){return Promise.resolve(vP(X))}function tF(X){return X===null?new e4:X}function Cb(...X){if(X[1])return X[0].then(tF);return tF(X[0])}function Tb(X,Q){return Cb(X,Q)}var eF=class{constructor(X,Q){this.property=X,this.skipRuns=Q,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(X,Q){return this.property.generate(X,Q)}shrink(X){return this.property.shrink(X)}run(X){let Q=g0(X);if(this.coveredCases.has(Q)){let J=this.coveredCases.get(Q);if(!this.skipRuns)return J;return Tb(J,this.property.isAsync())}let Y=this.property.run(X);return this.coveredCases.set(Q,Y),Y}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},XL=Date.now,IZ=setTimeout,jZ=clearTimeout;function Ib(X,Q){let Y=X;if(X.isAsync()&&Q.timeout!==void 0)Y=new Fb(Y,Q.timeout,IZ,jZ);if(Q.unbiased)Y=new SP(Y);if(Q.skipAllAfterTimeLimit!==void 0)Y=new lF(Y,XL,Q.skipAllAfterTimeLimit,!1,IZ,jZ);if(Q.interruptAfterTimeLimit!==void 0)Y=new lF(Y,XL,Q.interruptAfterTimeLimit,!0,IZ,jZ);if(Q.skipEqualValues)Y=new eF(Y,!0);if(Q.ignoreEqualValues)Y=new eF(Y,!1);return Y}var a6=function(X){return X[X.Success=0]="Success",X[X.Skipped=-1]="Skipped",X[X.Failure=1]="Failure",X}({}),jb=class X{constructor(Q,Y){this.verbosity=Q,this.interruptedAsFailure=Y,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(Q,Y){let J={status:Q,value:Y,children:[]};return this.currentLevelExecutionTrees.push(J),J}fail(Q,Y,J){if(this.verbosity>=z1.Verbose)this.currentLevelExecutionTrees=this.appendExecutionTree(a6.Failure,Q).children;if(this.pathToFailure===void 0)this.pathToFailure=`${Y}`;else this.pathToFailure+=`:${Y}`;this.value=Q,this.failure=J}skip(Q){if(this.verbosity>=z1.VeryVerbose)this.appendExecutionTree(a6.Skipped,Q);if(this.pathToFailure===void 0)++this.numSkips}success(Q){if(this.verbosity>=z1.VeryVerbose)this.appendExecutionTree(a6.Success,Q);if(this.pathToFailure===void 0)++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+L1(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?L1(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let Q=[],Y=this.rootExecutionTrees;while(Y.length>0&&Y[Y.length-1].status===a6.Failure){let J=Y[Y.length-1];Q.push(J.value),Y=J.children}return Q}static mergePaths(Q,Y){if(Q.length===0)return Y;let J=Q.split(":"),$=Y.split(":"),G=+J[J.length-1]+ +$[0];return[...J.slice(0,J.length-1),`${G}`,...$.slice(1)].join(":")}toRunDetails(Q,Y,J,$){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:Q,counterexample:this.value,counterexamplePath:X.mergePaths(Y,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()};let G=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>J||this.interrupted&&G,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:Q,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()}}},xP=class{constructor(X,Q,Y,J){this.sourceValues=X,this.shrink=Q,this.runExecution=new jb(Y,J),this.currentIdx=-1,this.nextValues=X}[Symbol.iterator](){return this}next(){let X=this.nextValues.next();if(X.done||this.runExecution.interrupted)return{done:!0,value:void 0};return this.currentValue=X.value,++this.currentIdx,{done:!1,value:X.value.value_}}handleResult(X){if(X!==null&&typeof X==="object"&&!e4.isFailure(X))this.runExecution.fail(this.currentValue.value_,this.currentIdx,X),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue);else if(X!==null)if(!X.interruptExecution)this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne();else this.runExecution.interrupt();else this.runExecution.success(this.currentValue.value_)}},Eb=class{constructor(X,Q,Y){this.initialValues=X,this.maxInitialIterations=Q,this.remainingSkips=Y}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let X=this.initialValues.next();if(!X.done)return{value:X.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},Sb=-2147483648,vb=2147483647,xb=Math.pow(2,27),kb=Math.pow(2,-53),CK=class X{constructor(Q){this.internalRng=y2(Q.clone())}clone(){return new X(this.internalRng)}next(Q){return B2(this.internalRng,0,(1<<Q)-1)}nextBoolean(){return B2(this.internalRng,0,1)===1}nextInt(Q,Y){return B2(this.internalRng,Q===void 0?Sb:Q,Y===void 0?vb:Y)}nextBigInt(Q,Y){return WF(this.internalRng,Q,Y)}nextDouble(){let Q=this.next(26),Y=this.next(27);return(Q*xb+Y)*kb}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function yb(X,Q,Y){return Q.jump(),X.generate(new CK(Q),Y)}function*kP(X,Q,Y,J){for(let $=0;$!==J.length;++$)yield new k(J[$],void 0);for(let $=0,G=Y(Q);;++$)yield yb(X,G,$)}function bb(X,Q,Y){return()=>X.generate(new CK(Q),Y)}function*yP(X,Q,Y,J){yield*G0(J,(Z)=>()=>new k(Z,void 0));let $=0,G=y2(Y(Q));for(;;)G.jump(),yield bb(X,G,$++)}function QL(X){return X()}function bP(X,Q,Y){let J=Q,$=X.split(":").map((Z)=>+Z);if($.length===0)return J.map(QL);if(!$.every((Z)=>!Number.isNaN(Z)))throw Error(`Unable to replay, got invalid path=${X}`);let G=J.drop($[0]).map(QL);for(let Z of $.slice(1)){let K=G.getNthOrLast(0);if(K===null)throw Error(`Unable to replay, got wrong path=${X}`);G=Y(K).drop(Z)}return G}var gb=Object.assign;function hb(X){if(X.length===1)return`Hint: ${X[0]}`;return X.map((Q,Y)=>`Hint (${Y+1}): ${Q}`).join(`
30
- `)}function mb(X,Q){return`Encountered failures were:
31
- - ${X.map(Q).join(`
32
- - `)}`}function TK(X,Q){let Y=[],J=[];for(let $=X.length-1;$>=0;--$)J.push({depth:1,tree:X[$]});while(J.length!==0){let $=J.pop(),G=$.tree,Z=$.depth,K=G.status===a6.Success?"\x1B[32m\u221A\x1B[0m":G.status===a6.Failure?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",W=Z!==0?". ".repeat(Z-1):"";Y.push(`${W}${K} ${Q(G.value)}`);for(let H=G.children.length-1;H>=0;--H)J.push({depth:Z+1,tree:G.children[H]})}return`Execution summary:
16
+ `)},QV=(Q,X)=>{let Y=X?.get(j9.key);if(Y)Q=`${Q}
17
+ ${XV(Y)}`;return Q},LC=(Q,X)=>{let Y=[`${Q.name}: ${Q.message}`];for(let J of X){let $=J.fiberId!==void 0?`#${J.fiberId}`:"unknown",G=J.annotations.get(SW.key);if(Y.push(` at fiber (${$})`),G)Y.push(XV(G))}return Y.join(`
18
+ `)},XV=(Q)=>{let X=[],Y=Q,J=0;while(Y&&J<10){let $=Y.stack();if($){let G=$.matchAll(zC),Z=!1;for(let[,K]of G)Z=!0,X.push(` at ${Y.name} (${K})`);if(!Z)X.push(` at ${Y.name} (${$.replace(/^at /,"")})`)}else X.push(` at ${Y.name}`);Y=Y.parent,J++}return X.join(`
19
+ `)},_7=(Q)=>i3(Q).map((X)=>X.cause?`${X.stack} {
20
+ ${YV(X.cause," ")}
21
+ }`:X.stack).join(`
22
+ `),YV=(Q,X)=>{let Y=Q.stack.split(`
23
+ `),J=`${X}[cause]: ${Y[0]}`;for(let $=1,G=Y.length;$<G;$++)J+=`
24
+ ${X}${Y[$]}`;if(Q.cause)J+=` {
25
+ ${YV(Q.cause,`${X} `)}
26
+ ${X}}`;return J},m3=`~effect/Fiber/${gH}`,PC={_A:g,_E:g},RC={id:0},q7=()=>globalThis[Z5];class a3{constructor(Q,X=!0){this[m3]=PC,this.setContext(Q),this.id=++RC.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=X,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this.runtimeMetrics?.recordFiberStart(this.context)}[m3];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(Q){return $H(this.context,Q)}addObserver(Q){if(this._exit)return Q(this._exit),$5;return this._observers.push(Q),()=>{let X=this._observers.indexOf(Q);if(X>=0)this._observers.splice(X,1)}}interruptUnsafe(Q,X){if(this._exit)return;let Y=T5(Q);if(this.currentStackFrame)Y=q5(Y,oX(j9,this.currentStackFrame));if(X)Y=q5(Y,X);if(this._interruptedCause=this._interruptedCause?n3(this._interruptedCause,Y):Y,this.interruptible)this.evaluate(M0(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(Q){if(this._exit)return;else if(this._yielded!==void 0){let J=this._yielded;this._yielded=void 0,J()}let X=this.runLoop(Q);if(X===A4)return;let Y=d3.interruptChildren&&d3.interruptChildren(this);if(Y!==void 0)return this.evaluate(T(Y,()=>X));this._exit=X,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let J=0;J<this._observers.length;J++)this._observers[J](X);this._observers.length=0}runLoop(Q){let X=globalThis[Z5];globalThis[Z5]=this;let Y=!1,J=Q;this.currentOpCount=0;let $=++this.currentLoopCount;try{while(!0){if(this.currentOpCount++,!Y&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){Y=!0;let G=J;J=T(j5,()=>G)}if(J=this.currentTracerContext?this.currentTracerContext(J,this):J[x0](this),$!==this.currentLoopCount)return A4;else if(J===A4){let G=this._yielded;if(_6 in G)return this._yielded=void 0,G;return A4}}}catch(G){if(!N(J,x0))return w8(`Fiber.runLoop: Not a valid effect: ${String(J)}`);return this.runLoop(w8(G))}finally{globalThis[Z5]=X}}getCont(Q){while(!0){let X=this._stack.pop();if(!X)return;let Y=X[M4]&&X[M4](this);if(Y)return Y[Q]=Y,Y;if(X[Q])return X}}yieldWith(Q){return this._yielded=Q,A4}children(){return this._children??=new Set}pipe(){return X0(this,arguments)}setContext(Q){this.context=Q;let X=this.getRef(k9);if(X!==this.currentScheduler)this.currentScheduler=X,this._dispatcher=void 0;this.currentSpan=Q.mapUnsafe.get(v3),this.currentLogLevel=this.getRef(y3),this.minimumLogLevel=this.getRef(b3),this.currentStackFrame=Q.mapUnsafe.get(y9.key),this.maxOpsBeforeYield=this.getRef(IH),this.currentPreventYield=this.getRef(jH),this.runtimeMetrics=Q.mapUnsafe.get(yH);let Y=Q.mapUnsafe.get(k3);this.currentTracerContext=Y?Y.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}var d3={interruptChildren:void 0},D7=(Q)=>{if(!Q.currentStackFrame)return;let X=new Map;return X.set(j9.key,Q.currentStackFrame),j4(X)},NC=(Q)=>{if(Q._children===void 0||Q._children.size===0)return;return A5(Q._children)},MC=(Q)=>{let X=Q;if(X._exit)return A(X._exit);return C1((Y)=>{if(X._exit)return Y(A(X._exit));return $0(Q.addObserver((J)=>Y(A(J))))})},s3=(Q)=>C1((X)=>{let Y=Q[Symbol.iterator](),J=[],$=void 0;function G(){let Z=Y.next();while(!Z.done){if(Z.value._exit){J.push(Z.value._exit),Z=Y.next();continue}$=Z.value.addObserver((K)=>{J.push(K),G()});return}X(A(J))}return G(),$0(()=>$?.())});var AC=(Q)=>c((X)=>wC(Q,X.id)),wC=B((Q)=>N(Q[0],m3),(Q,X,Y)=>c((J)=>{let $=D7(J);return $=$&&Y?iX($,Y):$??Y,Q.interruptUnsafe(X,$),o9(MC(Q))})),A5=(Q)=>c((X)=>{let Y=D7(X);for(let J of Q)J.interruptUnsafe(X.id,Y);return o9(s3(Q))});var A=c0,M0=A1,F0=A8,$0=u1({op:"Sync",[x0](Q){let X=this[e](),Y=Q.getCont(M1);return Y?Y[M1](X,Q):Q.yieldWith(c0(X))}}),a=u1({op:"Suspend",[x0](Q){return this[e]()}}),JV=E1({onNone:()=>F0(new C8("Effect.fromOption: Option.none")),onSome:A}),I5=o1({onFailure:F0,onSuccess:A}),$V=(Q)=>Q==null?F0(new C8):A(Q),t3=u1({op:"Yield",[x0](Q){let X=!1;return Q.currentDispatcher.scheduleTask(()=>{if(X)return;Q.evaluate(i1)},this[e]??0),Q.yieldWith(()=>{X=!0})}}),j5=t3(0),e3=(Q)=>A(F(Q)),B7=A(b()),GV=(Q)=>a(()=>M0(J0(Q))),N6=(Q)=>w8(Q),U7=(Q)=>a(()=>F0(J0(Q))),Y0=A(void 0);var ZV=(Q)=>a(()=>{try{return A(J0(Q.try))}catch(X){return F0(J0(()=>Q.catch(X)))}});var QJ=(Q)=>XJ(function(X,Y){J0(()=>Q(Y)).then((J)=>X(A(J)),(J)=>X(N6(J)))},Q.length!==0),KV=(Q)=>{let X=typeof Q==="function"?Q:Q.try,Y=typeof Q==="function"?(J)=>new x7(J,"An error occurred in Effect.tryPromise"):Q.catch;return XJ(function(J,$){try{J0(()=>X($)).then((G)=>J(A(G)),(G)=>J(F0(J0(()=>Y(G)))))}catch(G){J(F0(J0(()=>Y(G))))}},eval.length!==0)},WV=(Q)=>c((X)=>Q(X.id)),HV=c(A),VV=WV(A),XJ=u1({op:"Async",single:!1,[x0](Q){let X=J0(()=>this[e][0].bind(Q.currentScheduler)),Y=!1,J=!1,$=this[e][1]?new AbortController:void 0,G=X((Z)=>{if(Y)return;if(Y=!0,J)Q.evaluate(Z);else J=Z},$?.signal);if(J!==!1)return J;if(J=!0,Q._yielded=()=>{Y=!0},$===void 0&&G===void 0)return A4;return Q._stack.push(CC(()=>{return Y=!0,$?.abort(),G??i1})),A4}}),CC=u1({op:"AsyncFinalizer",[M4](Q){if(Q.interruptible)Q.interruptible=!1,Q._stack.push(C7)},[J8](Q,X){return W7(Q)?T(this[e](),()=>M0(Q)):M0(Q)}}),C1=(Q)=>XJ(Q,Q.length>=2),YJ=C1($5),_V=(...Q)=>a(()=>w5(Q.length===1?Q[0]():Q[1].call(Q[0].self))),JJ=(Q,...X)=>{let Y=X.length===0?function(){return a(()=>w5(Q.apply(this,arguments)))}:function(){let J=a(()=>w5(Q.apply(this,arguments)));for(let $=0;$<X.length;$++)J=X[$](J,...arguments);return J};return $J(Q.length,Y)},$J=(Q,X)=>Object.defineProperty(X,"length",{value:Q,configurable:!0}),hH=g3(2),qV=function(){let Q=typeof arguments[0]==="string",X=Q?arguments[0]:"Effect.fn",Y=Q?arguments[1]:void 0,J=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let $=new globalThis.Error;if(globalThis.Error.stackTraceLimit=J,Q)return(G,...Z)=>mH(X,G,$,Z,Q,Y);return mH(X,arguments[0],$,Array.prototype.slice.call(arguments,1),Q,Y)},mH=(Q,X,Y,J,$,G)=>{let Z=typeof X==="function"?X:J.pop().bind(X.self);return $J(Z.length,function(...K){let W=a(()=>{let V=Z.apply(this,arguments);return d(V)?V:w5(V)});for(let V=0;V<J.length;V++)W=J[V](W,...K);if(!d(W))return W;let H=globalThis.Error.stackTraceLimit;globalThis.Error.stackTraceLimit=2;let _=new globalThis.Error;return globalThis.Error.stackTraceLimit=H,e8($?d9(Q,G,(V)=>u3(W,V)):W,y9,(V)=>({name:Q,stack:hH(()=>_.stack),parent:{name:`${Q} (definition)`,stack:hH(()=>Y.stack),parent:V}}))})},DV=(Q,...X)=>$J(Q.length,X.length===0?function(){return dH(()=>Q.apply(this,arguments))}:function(){let Y=dH(()=>Q.apply(this,arguments));for(let J of X)Y=J(Y);return Y}),dH=(Q)=>{try{let X=Q(),Y=void 0;while(!0){let J=X.next(Y);if(J.done)return A(J.value);let $=J.value;if($&&$._tag==="Success"){Y=$.value;continue}else if($&&$._tag==="Failure")return J.value;else{let G=!0;return a(()=>{if(G)return G=!1,T(J.value,(Z)=>w5(X,Z));else return a(()=>w5(Q()))})}}}catch(X){return N6(X)}},w5=u1({op:"Iterator",single:!1,[M1](Q,X){let Y=this[e][0];while(!0){let J=Y.next(Q);if(J.done)return A(J.value);if(!V1(J.value))return X._stack.push(this),J.value;else if(J.value._tag==="Failure")return J.value;Q=J.value.value}},[x0](Q){return this[M1](this[e][1],Q)}}),v1=B(2,(Q,X)=>{let Y=A(X);return T(Q,(J)=>Y)}),O7=(Q)=>L0(Q,F),BV=(Q)=>A6(Q,{onFailure:A,onSuccess:F0}),t8=B(2,(Q,X)=>T(Q,(Y)=>d(X)?X:J0(()=>X(Y)))),M6=B(2,(Q,X)=>T(Q,(Y)=>v1(d(X)?X:J0(()=>X(Y)),Y))),o9=(Q)=>T(Q,(X)=>i1),UV=(Q)=>s1(Q,F0),GJ=(Q,X)=>c((Y)=>C1((J)=>{let $=W1(Q),G=$.length,Z=0,K=!1,W=new Set,H=[],_=(V,q,D)=>{if(Z++,V._tag==="Failure"){if(H.push(...V.cause.reasons),Z>=G)J(M0(u8(H)));return}let U=!K;if(K=!0,J(W.size===0?V:T(w6(A5(W)),()=>V)),U&&X?.onWinner)X.onWinner({fiber:q,index:D,parentFiber:Y})};for(let V=0;V<G;V++){let q=C6(Y,$[V],!0,!0,!1);if(W.add(q),q.addObserver((D)=>{W.delete(q),_(D,q,V)}),K)break}return A5(W)})),ZJ=(Q,X)=>c((Y)=>C1((J)=>{let $=!1,G=new Set,Z=(W)=>{$=!0,J(G.size===0?W:T(w6(A5(G)),()=>W))},K=0;for(let W of Q){if($)break;let H=K++,_=C6(Y,W,!0,!0,!1);G.add(_),_.addObserver((V)=>{G.delete(_);let q=!$;if(Z(V),q&&X?.onWinner)X.onWinner({fiber:_,index:H,parentFiber:Y})})}return A5(G)})),OV=B((Q)=>d(Q[1]),(Q,X,Y)=>GJ([Q,X],Y)),z7=B((Q)=>d(Q[1]),(Q,X,Y)=>ZJ([Q,X],Y)),T=B(2,(Q,X)=>{let Y=Object.create(TC);return Y[e]=Q,Y[M1]=X.length!==1?(J)=>X(J):X,Y}),TC=l8({op:"OnSuccess",[x0](Q){return Q._stack.push(this),this[e]}}),zV=B(2,(Q,X)=>{if(V1(Q))return Q._tag==="Success"?X.onSuccess(Q.value):X.onFailure(Q.cause);return I8(Q,X)}),V1=(Q)=>(_6 in Q),FV=B(2,(Q,X)=>{if(V1(Q))return Q._tag==="Success"?X(Q.value):Q;return T(Q,X)}),LV=(Q)=>T(Q,g),L0=B(2,(Q,X)=>T(Q,(Y)=>A(J0(()=>X(Y))))),PV=B(2,(Q,X)=>V1(Q)?HJ(Q,X):L0(Q,X)),RV=B(2,(Q,X)=>V1(Q)?VJ(Q,X):PJ(Q,X)),NV=B(2,(Q,X)=>V1(Q)?_J(Q,X):RJ(Q,X)),MV=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return Q;let Y=a1(Q.cause);if(u(Y))return Q;return X(Y.success)}return k1(Q,X)}),AV=(Q)=>A1(T5(Q)),E5=(Q)=>Q._tag==="Success",wV=(Q)=>Q._tag==="Success"?l(Q):f(Q),CV=(Q)=>Q._tag==="Success"?l(Q.value):f(Q),KJ=(Q)=>Q._tag==="Failure",TV=(Q)=>Q._tag==="Failure"?l(Q):f(Q),n9=(Q)=>Q._tag==="Failure"?l(Q.cause):f(Q),WJ=N5(n9,a1),IV=N5(n9,r9),jV=(Q)=>Q._tag==="Failure"&&W7(Q.cause),EV=(Q)=>Q._tag==="Failure"&&K7(Q.cause),SV=(Q)=>Q._tag==="Failure"&&r3(Q.cause),i1=c0(void 0),HJ=B(2,(Q,X)=>Q._tag==="Success"?c0(X(Q.value)):Q),VJ=B(2,(Q,X)=>{if(Q._tag==="Success")return Q;let Y=a1(Q.cause);if(u(Y))return Q;return A8(X(Y.success))}),_J=B(2,(Q,X)=>{if(Q._tag==="Success")return c0(X.onSuccess(Q.value));let Y=a1(Q.cause);if(u(Y))return Q;return A8(X.onFailure(Y.success))}),IC=B(2,(Q,X)=>E5(Q)?c0(X):Q);var xV=B(2,(Q,X)=>E5(Q)?X.onSuccess(Q.value):X.onFailure(Q.cause)),vV=IC(void 0),qJ=(Q)=>{let X=[];for(let Y of Q)if(Y._tag==="Failure")X.push(...Y.cause.reasons);return X.length===0?i1:A1(u8(X))},kV=(Q)=>E5(Q)?F(Q.value):b(),yV=(Q)=>KJ(Q)?F(Q.cause):b(),bV=(Q)=>{let X=WJ(Q);return u(X)?b():F(X.success)},gV=(Q)=>Q,hV=(Q)=>c((X)=>A(GH(X.context,Q))),jC=(Q)=>c((X)=>X.context.mapUnsafe.has(Q.key)?A(z6(X.context,Q)):F0(new C8)),i9=B(2,(Q,X)=>c((Y)=>{let J=Y.context,$=X(J);if(J===$)return Q;return Y.setContext($),x5(Q,()=>{Y.setContext(J);return})})),e8=B(3,(Q,X,Y)=>i9(Q,(J)=>{let $=z6(J,X),G=Y($);if($===G)return J;return G8(J,X,G)})),DJ=()=>EC,EC=c((Q)=>A(Q.context)),k4=(Q)=>c((X)=>Q(X.context)),Q4=B(2,(Q,X)=>{if(V1(Q))return Q;return i9(Q,iX(X))}),z1=function(){if(arguments.length===1)return B(2,(Q,X)=>pH(Q,arguments[0],X));return B(3,(Q,X,Y)=>pH(Q,X,Y)).apply(this,arguments)},pH=(Q,X,Y)=>i9(Q,(J)=>{if(J.mapUnsafe.get(X.key)===Y)return J;return G8(J,X,Y)}),F7=B(3,(Q,X,Y)=>T(Y,(J)=>z1(Q,X,J))),mV=z1(Y7),BJ=B((Q)=>d(Q[1]),(Q,X,Y)=>UJ(Q,X,(J,$)=>[J,$],Y)),UJ=B((Q)=>d(Q[1]),(Q,X,Y,J)=>J?.concurrent?L0(T7([Q,X],{concurrency:2}),([$,G])=>J0(()=>Y($,G))):T(Q,($)=>L0(X,(G)=>J0(()=>Y($,G))))),dV=B((Q)=>d(Q[0]),(Q,X,Y)=>gJ(Q,X,Y?(J)=>F0(Y(J)):()=>F0(new C8))),pV=B(2,(Q,X)=>T(X,(Y)=>Y?O7(Q):B7)),OJ=B(2,(Q,X)=>Array.from({length:X},()=>Q)),cV=B((Q)=>d(Q[0]),(Q,X,Y)=>T7(OJ(Q,X),Y)),L7=B((Q)=>d(Q[0]),(Q,X)=>b4({while:P4,body:G1(X?.disableYield?Q:T(Q,(Y)=>j5)),step:$5})),s1=B(2,(Q,X)=>{let Y=Object.create(SC);return Y[e]=Q,Y[J8]=X.length!==1?(J)=>X(J):X,Y}),SC=l8({op:"OnFailure",[x0](Q){return Q._stack.push(this),this[e]}}),zJ=B(3,(Q,X,Y)=>s1(Q,(J)=>{if(!X(J))return M0(J);return J0(()=>Y(J))})),S5=B(3,(Q,X,Y)=>s1(Q,(J)=>{let $=X(J);return u($)?M0($.failure):J0(()=>Y($.success,J))})),k1=B(2,(Q,X)=>S5(Q,a1,(Y)=>X(Y))),fV=(Q)=>A6(Q,{onFailure:(X)=>gX(X)?B7:F0(X),onSuccess:e3}),uV=B(2,(Q,X)=>S5(Q,r9,X)),lV=B(2,(Q,X)=>s1(Q,(Y)=>t8(J0(()=>X(Y)),M0(Y)))),rV=B(3,(Q,X,Y)=>zJ(Q,X,(J)=>t8(J0(()=>Y(J)),M0(J)))),P7=B(3,(Q,X,Y)=>s1(Q,(J)=>{let $=X(J);if(u($))return M0(J);return t8(J0(()=>Y($.success,J)),M0(J))})),FJ=B(2,(Q,X)=>P7(Q,a1,(Y)=>X(Y))),oV=B(3,(Q,X,Y)=>{let J=Array.isArray(X)?($)=>N($,"_tag")&&X.includes($._tag):W6(X);return FJ(Q,($)=>J($)?Y($):Y0)}),nV=B(2,(Q,X)=>P7(Q,r9,(Y)=>X(Y))),a9=B((Q)=>d(Q[0]),(Q,X,Y,J)=>s1(Q,($)=>{let G=a1($);if(u(G))return M0(G.failure);if(!X(G.success))return J?J0(()=>J(G.success)):M0($);return J0(()=>Y(G.success))})),R7=B((Q)=>d(Q[0]),(Q,X,Y,J)=>s1(Q,($)=>{let G=a1($);if(u(G))return M0(G.failure);let Z=X(G.success);if(u(Z))return J?J0(()=>J(Z.failure)):M0($);return J0(()=>Y(Z.success))})),LJ=B((Q)=>d(Q[0]),(Q,X,Y,J)=>{let $=Array.isArray(X)?(G)=>N(G,"_tag")&&X.includes(G._tag):W6(X);return a9(Q,$,Y,J)}),iV=B((Q)=>d(Q[0]),(Q,X,Y)=>{let J;return R7(Q,($)=>{return J??=Object.keys(X),N($,"_tag")&&X8($._tag)&&J.includes($._tag)?l($):f($)},($)=>J0(()=>X[$._tag]($)),Y)}),aV=B((Q)=>d(Q[0]),(Q,X,Y,J,$)=>a9(Q,(G)=>W6(G,X)&&N(G,"reason"),(G)=>{let Z=G.reason;if(W6(Z,Y))return J(Z,G);return $?J0(()=>$(Z,G)):F0(G)})),sV=B((Q)=>d(Q[0]),(Q,X,Y,J)=>{let $;return a9(Q,(G)=>W6(G,X)&&N(G,"reason")&&N(G.reason,"_tag")&&X8(G.reason._tag),(G)=>{let Z=G.reason;if($??=Object.keys(Y),$.includes(Z._tag))return J0(()=>Y[Z._tag](Z,G));return J?J0(()=>J(Z,G)):F0(G)})}),tV=B(2,(Q,X)=>R7(Q,(Y)=>{if(W6(Y,X)&&N(Y,"reason"))return l(Y.reason);return f(Y)},F0));var PJ=B(2,(Q,X)=>k1(Q,(Y)=>U7(()=>X(Y)))),RJ=B(2,(Q,X)=>A6(Q,{onFailure:(Y)=>U7(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),NJ=(Q)=>k1(Q,N6),eV=B(2,(Q,X)=>k1(Q,(Y)=>$0(X))),Q_=(Q)=>a(()=>{let X=Q[Symbol.iterator](),Y=X.next();if(Y.done)return N6(Error("Received an empty collection of effects"));function J($){let G=X.next();if(G.done)return $.value;return k1($.value,(Z)=>J(G))}return J(Y)}),MJ=(Q)=>k1(Q,(X)=>T(j5,()=>MJ(Q))),X_=B((Q)=>d(Q[0]),(Q,X)=>{if(!X?.log)return A6(Q,{onFailure:(J)=>Y0,onSuccess:(J)=>Y0});let Y=W8(X.log===!0?void 0:X.log);return I8(Q,{onFailure(J){let $=o3(J);return u($)?M0($.failure):X.message===void 0?Y(J):Y(X.message,J)},onSuccess:(J)=>Y0})}),Y_=B((Q)=>d(Q[0]),(Q,X)=>{if(!X?.log)return I8(Q,{onFailure:(J)=>Y0,onSuccess:(J)=>Y0});let Y=W8(X.log===!0?void 0:X.log);return I8(Q,{onFailure:(J)=>X.message===void 0?Y(J):Y(X.message,J),onSuccess:(J)=>Y0})}),J_=(Q)=>N7(Q,{onFailure:b,onSuccess:F}),v4=(Q)=>s9(Q,{onFailure:f,onSuccess:l}),I8=B(2,(Q,X)=>{let Y=Object.create(xC);return Y[e]=Q,Y[M1]=X.onSuccess.length!==1?(J)=>X.onSuccess(J):X.onSuccess,Y[J8]=X.onFailure.length!==1?(J)=>X.onFailure(J):X.onFailure,Y}),xC=l8({op:"OnSuccessAndFailure",[x0](Q){return Q._stack.push(this),this[e]}}),AJ=B(2,(Q,X)=>I8(Q,{onFailure:(Y)=>$0(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),A6=B(2,(Q,X)=>I8(Q,{onFailure:(Y)=>{let J=Y.reasons.find(w4);return J?J0(()=>X.onFailure(J.error)):M0(Y)},onSuccess:X.onSuccess})),N7=B(2,(Q,X)=>A6(Q,{onFailure:(Y)=>$0(()=>X.onFailure(Y)),onSuccess:(Y)=>$0(()=>X.onSuccess(Y))})),s9=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return c0(X.onSuccess(Q.value));let Y=a1(Q.cause);if(u(Y))return Q;return c0(X.onFailure(Y.success))}return N7(Q,X)}),$_=B(2,(Q,X)=>{if(V1(Q)){if(Q._tag==="Success")return c0(X.onSuccess(Q.value));return c0(X.onFailure(Q.cause))}return AJ(Q,X)}),t9=(Q)=>V1(Q)?c0(Q):vC(Q),vC=u1({op:"Exit",[x0](Q){return Q._stack.push(this),this[e]},[M1](Q,X,Y){return A(Y??c0(Q))},[J8](Q,X,Y){return A(Y??A1(Q))}}),G_=s9({onFailure:()=>!0,onSuccess:()=>!1}),Z_=s9({onFailure:()=>!1,onSuccess:()=>!0}),K_=B(2,(Q,X)=>t8(I6(X),Q)),wJ=B(2,(Q,X)=>z7(Q,T(I6(X.duration),X.orElse))),W_=B(2,(Q,X)=>wJ(Q,{duration:X,orElse:()=>F0(new E7)})),H_=B(2,(Q,X)=>z7(O7(Q),v1(I6(X),b()))),V_=(Q)=>T6((X)=>{let Y=X.currentTimeNanosUnsafe();return L0(Q,(J)=>[a8(X.currentTimeNanosUnsafe()-Y),J])}),p3="~effect/Scope",c3="~effect/Scope/Closeable",e9=l1("effect/Scope"),CJ=(Q,X)=>a(()=>M7(Q,X)??Y0),M7=(Q,X)=>{if(Q.state._tag==="Closed")return;let Y={_tag:"Closed",exit:X};if(Q.state._tag==="Empty"){Q.state=Y;return}let{finalizers:J}=Q.state;if(Q.state=Y,J.size===0)return;else if(J.size===1)return J.values().next().value(X);return kC(Q,J,X)},kC=JJ(function*(Q,X,Y){let J=[],$=[],G=Array.from(X.values()),Z=q7();for(let K=G.length-1;K>=0;K--){let W=G[K];if(Q.strategy==="sequential")J.push(yield*t9(W(Y)));else $.push(C6(Z,W(Y),!0,!0,"inherit"))}if($.length>0)J=yield*s3($);return yield*qJ(J)});var __=(Q,X)=>{let Y=QQ(X);if(Q.state._tag==="Closed")return Y.state=Q.state,Y;let J={};return Z7(Q,J,($)=>CJ(Y,$)),Z7(Y,J,($)=>$0(()=>q_(Q,J))),Y},y4=(Q,X)=>{return a(()=>{if(Q.state._tag==="Closed")return X(Q.state.exit);return Z7(Q,{},X),Y0})};var Z7=(Q,X,Y)=>{if(Q.state._tag==="Empty")Q.state={_tag:"Open",finalizers:new Map([[X,Y]])};else if(Q.state._tag==="Open")Q.state.finalizers.set(X,Y)},q_=(Q,X)=>{if(Q.state._tag==="Open")Q.state.finalizers.delete(X)},QQ=(Q="sequential")=>({[c3]:c3,[p3]:p3,strategy:Q,state:yC}),yC={_tag:"Empty"};var XQ=e9;var TJ=(Q)=>c((X)=>{let Y=X.context,J=QQ();return X.setContext(G8(X.context,e9,J)),x5(Q,($)=>{return X.setContext(Y),M7(J,$)})});var A7=(Q)=>a(()=>{let X=QQ();return F1(Q(X),(Y)=>a(()=>M7(X,Y)??Y0))}),w7=(Q,X,Y)=>k4((J)=>YQ(($)=>T(XQ,(G)=>M6(Y?.interruptible?$(Q):Q,(Z)=>y4(G,(K)=>Q4(X(Z,K),J)))))),IJ=(Q)=>T(XQ,(X)=>k4((Y)=>y4(X,(J)=>Q4(Q(J),Y)))),x5=u1({op:"OnExit",single:!1,[x0](Q){return Q._stack.push(this),this[e][0]},[M4](Q){if(Q.interruptible&&this[e][2]!==!0)Q._stack.push(C7),Q.interruptible=!1},[M1](Q,X,Y){Y??=c0(Q);let J=this[e][1](Y);return J?T(J,($)=>Y):Y},[J8](Q,X,Y){Y??=A1(Q);let J=this[e][1](Y);return J?T(J,($)=>Y):Y}}),F1=B(2,x5),D_=B(2,(Q,X)=>F1(Q,(Y)=>X)),jJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{if(!X(J))return Y0;return Y(J)})),EJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{let $=X(J);return u($)?Y0:Y($.success,J)})),SJ=B(2,(Q,X)=>EJ(Q,n9,X)),B_=B(3,(Q,X,Y)=>jJ(Q,(J)=>{if(J._tag!=="Failure")return!1;return X(J.cause)},(J)=>Y(J.cause))),xJ=B(3,(Q,X,Y)=>F1(Q,(J)=>{if(J._tag!=="Failure")return Y0;let $=X(J.cause);return u($)?Y0:Y($.success,J.cause)})),U_=B(2,(Q,X)=>xJ(H7,X)(Q)),O_=(Q,X,Y)=>YQ((J)=>T(Q,($)=>x5(J(X($)),(G)=>Y($,G),!0))),z_=(Q)=>w7(Q,(X)=>N(X,Symbol.asyncDispose)?QJ(()=>X[Symbol.asyncDispose]()):$0(()=>X[Symbol.dispose]())),vJ=B(2,(Q,X)=>$0(()=>{let Y=x4(x1(X)),J=Number.isFinite(Y),$=hC(!1),G=0,Z=!1,K,W=T($.await,()=>K);return[c((H)=>{let _=H.getRef(j8),V=J?_.currentTimeMillisUnsafe():0;if(Z||V<G)return K??W;return Z=!0,$.closeUnsafe(),K=void 0,F1(Q,(q)=>$0(()=>{Z=!1,G=_.currentTimeMillisUnsafe()+Y,K=q,$.openUnsafe()}))}),$0(()=>{G=0,$.closeUnsafe(),K=void 0})]})),kJ=B(2,(Q,X)=>L0(vJ(Q,X),(Y)=>Y[0])),F_=(Q)=>kJ(Q,i8),L_=c((Q)=>M0(T5(Q.id))),w6=(Q)=>c((X)=>{if(!X.interruptible)return Q;return X.interruptible=!1,X._stack.push(C7),Q}),P_=u1({op:"SetInterruptible",[M4](Q){if(Q.interruptible=this[e],Q._interruptedCause&&Q.interruptible)return()=>M0(Q._interruptedCause)}}),C7=P_(!0),R_=P_(!1),yJ=(Q)=>c((X)=>{if(X.interruptible)return Q;if(X.interruptible=!0,X._stack.push(R_),X._interruptedCause)return M0(X._interruptedCause);return Q}),YQ=(Q)=>c((X)=>{if(!X.interruptible)return Q(g);return X.interruptible=!1,X._stack.push(C7),Q(yJ)}),N_=(Q)=>c((X)=>{if(X.interruptible)return Q(g);return X.interruptible=!0,X._stack.push(R_),Q(w6)}),M_=L0(w7($0(()=>new AbortController),(Q)=>$0(()=>Q.abort())),(Q)=>Q.signal),T7=(Q,X)=>{if(d8(Q))return X?.mode==="result"?n1(Q,v4,X):n1(Q,g,X);else if(X?.discard)return X.mode==="result"?n1(Object.values(Q),v4,X):n1(Object.values(Q),g,X);return a(()=>{let Y={};return v1(n1(Object.entries(Q),([J,$])=>L0(X?.mode==="result"?v4($):$,(G)=>{Y[J]=G}),{discard:!0,concurrency:X?.concurrency}),Y)})},bJ=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>L0(n1(Q,(J,$)=>v4(X(J,$)),Y),(J)=>I3(J,g))),A_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>T(bJ(Q,X,{concurrency:Y?.concurrency}),([J,$])=>{if(K8(J))return F0(J);return Y?.discard?Y0:A($)})),w_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=Q[Symbol.iterator](),J=Y.next();if(!J.done)return C_(Y,0,X,J.value);return A(b())})),C_=(Q,X,Y,J)=>T(Y(J,X),($)=>{if($)return A(F(J));let G=Q.next();if(!G.done)return C_(Q,X+1,Y,G.value);return A(b())}),T_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=Q[Symbol.iterator](),J=Y.next();if(!J.done)return I_(Y,0,X,J.value);return A(b())})),I_=(Q,X,Y,J)=>T(Y(J,X),($)=>{if(w1($))return A(F($.success));let G=Q.next();if(!G.done)return I_(Q,X+1,Y,G.value);return A(b())}),b4=u1({op:"While",[M1](Q,X){if(this[e].step(Q),this[e].while())return X._stack.push(this),this[e].body();return i1},[x0](Q){if(this[e].while())return Q._stack.push(this),this[e].body();return i1}}),n1=B((Q)=>typeof Q[1]==="function",(Q,X,Y)=>c((J)=>{let $=Y?.concurrency==="inherit"?J.getRef(Y7):Y?.concurrency??1,G=$==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,$);if(G===1)return bC(Q,X,Y);let Z=W1(Q),K=Z.length;if(K===0)return Y?.discard?Y0:A([]);let W=Y?.discard?void 0:Array(K),H=gC({f:X,out:W},Z,{concurrency:G});return H?v1(H,W):A(W)})),bC=(Q,X,Y)=>a(()=>{let J=Y?.discard?void 0:[],$=Q[Symbol.iterator](),G=$.next(),Z=0;return v1(b4({while:()=>!G.done,body:()=>X(G.value,Z++),step:(K)=>{if(J)J.push(K);G=$.next()}}),J)}),j_=(Q)=>{let{onItem:X,step:Y}=Q;return(J,$,G)=>{let Z=G?.start??0,K=G?.end??$.length,W=G?.concurrency??1,H=!1,_,V,q,D=!1,U,P,L=()=>{let M=!1;for(;!U&&Z<K;Z++){let w=$[Z],R=P??X(J,w,Z);if(V1(R)){if(U=Y(J,w,R,Z),U)break}else if(W===1)return T(t9(R),(i)=>{return U=Y(J,w,i,Z),Z++,U??L()??Y0});else if(!_)return C1((i)=>{_=q7(),P=R,q=i;let $1=L();if($1)return i($1);return a(()=>{return U=i1,D=!0,V?A5(V):Y0})});else{P=void 0;let i=C6(_,R,!0,!0,"inherit");if(i._exit){if(U=Y(J,w,i._exit,Z),U)break;continue}if(V)V.add(i);else V=new Set([i]);let $1=Z;if(i.addObserver((J5)=>{if(V.delete(i),U){if(!D&&J5._tag==="Failure")for(let D1 of J5.cause.reasons)if(D1._tag==="Interrupt")continue;else if(U._tag==="Failure")U.cause.reasons.push(D1);else U=A1(u8([D1]))}else{let D1=Y(J,w,J5,$1);if(D1)U=D1._tag==="Failure"?A1(u8(D1.cause.reasons.slice())):D1,L()}if(M){let D1=L();if(D1)q(D1)}else if(H&&V.size===0)q(U??Y0)}),V.size<W)continue;M=!0,Z++;return}}if(H=!0,U){if(V&&V.size>0){let w=D7(_);V.forEach((R)=>R.interruptUnsafe(_.id,w));return}if(q||U._tag==="Failure")return U}else if(q){if(!V)return i1;else if(V.size===0)q(Y0)}};return L()}},JQ=()=>j_,gC=j_({onItem(Q,X,Y){return Q.f(X,Y)},step(Q,X,Y,J){if(Y._tag==="Failure")return Y;else if(Q.out)Q.out[J]=Y.value}}),gJ=B(3,(Q,X,Y)=>T(Q,(J)=>X(J)?A(J):Y(J))),hJ=B(3,(Q,X,Y)=>T(Q,(J)=>{let $=X(J);return u($)?Y($.failure):A($.success)})),E_=B((Q)=>d(Q[0]),(Q,X,Y)=>hJ(Q,X,Y?(J)=>F0(Y(J)):()=>F0(new C8))),S_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>a(()=>{let J=[];return v1(n1(Q,($,G)=>{let Z=X($,G);if(typeof Z==="boolean"){if(Z)J.push($);return Y0}return L0(Z,(K)=>{if(K)J.push($)})},{discard:!0,concurrency:Y?.concurrency}),J)})),x_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X)=>a(()=>{let Y=[];for(let J of Q){let $=X(J);if(w1($))Y.push($.success)}return A(Y)})),v_=B((Q)=>d8(Q[0])&&!d(Q[0]),(Q,X,Y)=>a(()=>{let J=[];return v1(n1(Q,($)=>L0(X($),(G)=>{if(w1(G))J.push(G.success)}),{discard:!0,concurrency:Y?.concurrency}),J)})),k_=A({}),y_=hW(L0),b_=mW(L0,T),g_=gW(L0);var h_=B((Q)=>d(Q[0]),(Q,X)=>c((Y)=>{return YT(),A(C6(Y,Q,X?.startImmediately,!1,X?.uninterruptible??!1))})),C6=(Q,X,Y=!1,J=!1,$=!1)=>{let G=$==="inherit"?Q.interruptible:!$,Z=new a3(Q.context,G);if(Y)Z.evaluate(X);else Q.currentDispatcher.scheduleTask(()=>Z.evaluate(X),0);if(!J&&!Z._exit)Q.children().add(Z),Z.addObserver(()=>Q._children.delete(Z));return Z},m_=B((Q)=>d(Q[0]),(Q,X)=>c((Y)=>A(C6(Y,Q,X?.startImmediately,!0,X?.uninterruptible)))),d_=(Q)=>c((X)=>{let Y=X._children&&W1(X._children);return F1(Q,(J)=>{let $=X._children;if($===void 0||$.size===0)return Y0;else if(Y)$=VH($,(G)=>!Y.includes(G));return o9(s3($))})}),mJ=B((Q)=>d(Q[0]),(Q,X,Y)=>c((J)=>{let $=C6(J,Q,Y?.startImmediately,!0,Y?.uninterruptible);if(!$._exit)if(X.state._tag!=="Closed"){let G={};Z7(X,G,()=>WV((K)=>K===$.id?Y0:AC($))),$.addObserver(()=>q_(X,G))}else $.interruptUnsafe(J.id,D7(J));return A($)})),p_=B((Q)=>d(Q[0]),(Q,X)=>T(XQ,(Y)=>mJ(Q,Y,X))),X4=(Q)=>(X,Y)=>{let J=new a3(Y?.scheduler?G8(Q,k9,Y.scheduler):Q,Y?.uninterruptible!==!0);if(J.evaluate(X),J._exit)return J;if(Y?.signal)if(Y.signal.aborted)J.interruptUnsafe();else{let $=()=>J.interruptUnsafe();Y.signal.addEventListener("abort",$,{once:!0}),J.addObserver(()=>Y.signal.removeEventListener("abort",$))}if(Y?.onFiberStart)Y.onFiberStart(J);return J};var c_=X4($8()),dJ=(Q)=>{let X=X4(Q);return(Y,J)=>{let $=X(Y,J);if(J?.onExit)$.addObserver(J.onExit);return(G)=>{return $.interruptUnsafe(G)}}},f_=dJ($8()),I7=(Q)=>{let X=X4(Q);return(Y,J)=>{let $=X(Y,J);return new Promise((G)=>{$.addObserver((Z)=>G(Z))})}},u_=I7($8()),pJ=(Q)=>{let X=I7(Q);return(Y,J)=>X(Y,J).then(($)=>{if($._tag==="Failure")throw V7($.cause);return $.value})},l_=pJ($8()),j7=(Q)=>{let X=X4(Q);return(Y)=>{if(V1(Y))return Y;let J=new M5("sync"),$=X(Y,{scheduler:J});return $.currentDispatcher?.flush(),$._exit??w8(new S7($))}},r_=j7($8()),cJ=(Q)=>{let X=j7(Q);return(Y)=>{let J=X(Y);if(J._tag==="Failure")throw V7(J.cause);return J.value}},o_=cJ($8()),cH=A(!0),fH=A(!1);class n_{waiters=[];scheduled=!1;isOpen;constructor(Q){this.isOpen=Q}scheduleUnsafe(Q){if(this.scheduled||this.waiters.length===0)return cH;return this.scheduled=!0,Q.currentDispatcher.scheduleTask(this.flushWaiters,0),cH}flushWaiters=()=>{this.scheduled=!1;let Q=this.waiters;this.waiters=[];for(let X=0;X<Q.length;X++)Q[X](i1)};open=c((Q)=>{if(this.isOpen)return fH;return this.isOpen=!0,this.scheduleUnsafe(Q)});release=c((Q)=>this.isOpen?fH:this.scheduleUnsafe(Q));openUnsafe(){if(this.isOpen)return!1;return this.isOpen=!0,this.flushWaiters(),!0}await=C1((Q)=>{if(this.isOpen)return Q(Y0);return this.waiters.push(Q),$0(()=>{let X=this.waiters.indexOf(Q);if(X!==-1)this.waiters.splice(X,1)})});closeUnsafe(){if(!this.isOpen)return!1;return this.isOpen=!1,!0}close=$0(()=>this.closeUnsafe());whenOpen=(Q)=>T(this.await,()=>Q)}var hC=(Q)=>new n_(Q??!1);var i_=c((Q)=>A(Q.getRef(X7))),a_=B(2,(Q,X)=>z1(Q,X7,X)),s_=z1(J7),t_=z1(b9),f3=BigInt(0),mC={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:f3,endTime:f3,exit:i1},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},dC=(Q)=>Object.assign(Object.create(mC),Q),e_=(Q)=>{if(!Q)return b();return S1(Q.annotations,Q7)?Q._tag==="Span"?e_(U6(Q.parent)):b():F(Q)},fJ=(Q,X,Y)=>{let J=!Q.getRef(J7)||Y?.annotations&&S1(Y.annotations,Q7),$=Y?.parent!==void 0?F(Y.parent):Y?.root?b():e_(Q.currentSpan),G;if(J)G=dC({name:X,parent:$,annotations:G8(Y?.annotations??$8(),Q7,!0)});else{let Z=Q.getRef(X7),K=Q.getRef(j8),W=Q.getRef(b9),H=Q.getRef(g9),_=Q.getRef(h9),V=Y?.level??Q.getRef(xH),q=Y?.links!==void 0?[..._,...Y.links]:_.slice();G=Z.span({name:X,parent:$,annotations:Y?.annotations??$8(),links:q,startTime:W?K.currentTimeNanosUnsafe():BigInt(0),kind:Y?.kind??"internal",root:Y?.root??I0($),sampled:Y?.sampled??(O1($)&&$.value.sampled===!1?!1:!zq(Q.getRef(vH),V))});for(let[D,U]of Object.entries(H))G.attribute(D,U);if(Y?.attributes!==void 0)for(let[D,U]of Object.entries(Y.attributes))G.attribute(D,U)}return G},Qq=(Q,X)=>c((Y)=>A(fJ(Y,Q,X))),m9=(Q,X)=>w6(c((Y)=>{let J=z6(Y.context,e9),$=fJ(Y,Q,X??{}),G=Y.getRef(j8),Z=Y.getRef(b9);return v1(y4(J,(K)=>cC($,K,G,Z)),$)})),Xq=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=G7(Q?arguments[2]:arguments[1]);if(Q){let J=arguments[0];return T(m9(X,Y),($)=>C5(J,$,Y))}return(J)=>T(m9(X,Y),($)=>C5(J,$,Y))},pC=(Q,X)=>{return X=typeof X==="function"?X:N8,e8(y9,(Y)=>({name:Q,stack:X,parent:Y}))},Yq=g9,Jq=h9,$q=B((Q)=>d(Q[0]),(Q,X,Y={})=>{let $=(Array.isArray(X)?X:[X]).map((G)=>({span:G,attributes:Y}));return e8(Q,h9,(G)=>[...G,...$])}),cC=(Q,X,Y,J)=>$0(()=>{if(Q.status._tag==="Ended")return;Q.end(J?Y.currentTimeNanosUnsafe():f3,X)}),d9=(Q,...X)=>{let Y=X.length===1?void 0:X[0],J=X[X.length-1];return c(($)=>{let G=fJ($,Q,Y),Z=$.getRef(j8);return F1(J0(()=>J(G)),(K)=>$0(()=>{if(G.status._tag==="Ended")return;G.end(Z.currentTimeNanosUnsafe(),K)}))})},u3=z1(eX),C5=function(){let Q=d(arguments[0]),X=Q?arguments[1]:arguments[0],Y=Q?arguments[2]:arguments[1],J=g;if(X._tag==="Span")Y=G7(Y),J=pC(X.name,Y?.captureStackTrace);if(Q)return u3(J(arguments[0]),X);return($)=>u3(J($),X)},Gq=function(){let Q=typeof arguments[0]!=="string",X=Q?arguments[1]:arguments[0],Y=G7(arguments[2]);if(Q){let G=arguments[0];return d9(X,arguments[2],(Z)=>C5(G,Z,Y))}let J=typeof arguments[1]==="function"?arguments[1]:void 0,$=J?void 0:arguments[1];return(G,...Z)=>d9(X,J?J(...Z):$,(K)=>C5(G,K,Y))},Zq=B((Q)=>d(Q[0]),(Q,...X)=>e8(Q,g9,(Y)=>{let J={...Y};if(X.length===1)Object.assign(J,X[0]);else J[X[0]]=X[1];return J})),Kq=(...Q)=>c((X)=>{let Y=X.currentSpanLocal;if(Y)if(Q.length===1)for(let[J,$]of Object.entries(Q[0]))Y.attribute(J,$);else Y.attribute(Q[0],Q[1]);return Y0}),Wq=c((Q)=>{let X=Q.currentSpanLocal;return X?A(X):F0(new C8)}),Hq=jC(eX),j8=_0("effect/Clock",{defaultValue:()=>new Vq}),fC=2147483647;class Vq{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=$0(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return uC()}currentTimeNanos=$0(()=>this.currentTimeNanosUnsafe());sleep(Q){let X=x4(Q);if(X<=0)return j5;return C1((Y)=>{if(X>fC)return;let J=setTimeout(()=>Y(Y0),X);return $0(()=>clearTimeout(J))})}}var uH=function(){let Q=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*Q;else if(typeof performance.timeOrigin==="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));let X=BigInt(Date.now())*Q-BigInt(Math.round(performance.now()*1e6));return()=>X+BigInt(Math.round(performance.now()*1e6))}(),uC=function(){let Q=typeof process==="object"&&"hrtime"in process&&typeof process.hrtime.bigint==="function"?process.hrtime:void 0;if(!Q)return uH;let X=uH()-Q.bigint();return()=>X+Q.bigint()}(),T6=(Q)=>c((X)=>Q(X.getRef(j8))),I6=(Q)=>T6((X)=>X.sleep(x1(Q))),_q=T6((Q)=>Q.currentTimeMillis);var p9="~effect/Cause/TimeoutError",qq=(Q)=>N(Q,p9);class E7 extends r8("TimeoutError"){[p9]=p9;constructor(Q){super({message:Q})}}var c9="~effect/Cause/IllegalArgumentError",Dq=(Q)=>N(Q,c9);class uJ extends r8("IllegalArgumentError"){[c9]=c9;constructor(Q){super({message:Q})}}var f9="~effect/Cause/ExceededCapacityError",Bq=(Q)=>N(Q,f9);class lJ extends r8("ExceededCapacityError"){[f9]=f9;constructor(Q){super({message:Q})}}var u9="~effect/Cause/AsyncFiberError",Uq=(Q)=>N(Q,u9);class S7 extends r8("AsyncFiberError"){[u9]=u9;constructor(Q){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:Q})}}var l9="~effect/Cause/UnknownError",Oq=(Q)=>N(Q,l9);class x7 extends r8("UnknownError"){[l9]=l9;constructor(Q,X){super({message:X,cause:Q})}}var lC=_0("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),rC=(Q)=>{switch(Q){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 50000;case"Error":return 40000;case"Warn":return 30000;case"Info":return 20000;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},oC=F3(U1,rC),zq=B5(oC),rJ=_0("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([QT,XT])}),nC=_0("effect/Logger/LogToStderr",{defaultValue:MX}),Fq=function(){let Q=typeof arguments[0]==="string"?[[arguments[0],arguments[1]]]:Object.entries(arguments[0]);return w6(c((X)=>{let Y=X.getRef(s8),J={...Y};for(let $=0;$<Q.length;$++){let[G,Z]=Q[$];J[G]=Z}return X.setContext(G8(X.context,s8,J)),y4(z6(X.context,e9),($)=>{let G=X.getRef(s8),Z={...G};for(let K=0;K<Q.length;K++){let[W,H]=Q[K];if(G[W]!==H)continue;if(W in Y)Z[W]=Y[W];else delete Z[W]}return X.setContext(G8(X.context,s8,Z)),Y0})}))},iC="~effect/Logger",aC={[iC]:{_Message:g,_Output:g},pipe(){return X0(this,arguments)}},Lq=(Q)=>{let X=Object.create(aC);return X.log=Q,X},sC=(Q)=>Q.replace(/[\s="]/g,"_"),tC=(Q,X)=>{return`${sC(Q[0])}=${X-Q[1]}ms`};var W8=(Q)=>(...X)=>{let Y=void 0;for(let J=0,$=X.length;J<$;J++){let G=X[J];if(V5(G)){if(Y)X.splice(J,1);else X=X.slice(0,J).concat(X.slice(J+1));Y=Y?u8(Y.reasons.concat(G.reasons)):G,J--}}if(Y===void 0)Y=kX;return c((J)=>{let $=Q??J.currentLogLevel;if(zq(J.minimumLogLevel,$))return Y0;let G=J.getRef(j8),Z=J.getRef(rJ);if(Z.size>0){let K=new Date(G.currentTimeMillisUnsafe());for(let W of Z)W.log({cause:Y,fiber:J,date:K,logLevel:$,message:X})}return Y0})};var R6={bold:"1",red:"31",green:"32",yellow:"33",blue:"34",cyan:"36",white:"37",gray:"90",black:"30",bgBrightRed:"101"},va={None:[],All:[],Trace:[R6.gray],Debug:[R6.blue],Info:[R6.green],Warn:[R6.yellow],Error:[R6.red],Fatal:[R6.bgBrightRed,R6.black]};var eC=(Q)=>`${Q.getHours().toString().padStart(2,"0")}:${Q.getMinutes().toString().padStart(2,"0")}:${Q.getSeconds().toString().padStart(2,"0")}.${Q.getMilliseconds().toString().padStart(3,"0")}`,Pq=typeof process==="object"&&process!==null&&typeof process.stdout==="object"&&process.stdout!==null,ka=Pq&&process.stdout.isTTY===!0,ya=Pq||"Deno"in globalThis;var QT=Lq(({cause:Q,date:X,fiber:Y,logLevel:J,message:$})=>{let G=Array.isArray($)?$.slice():[$];if(Q.reasons.length>0)G.push(_7(Q));let Z=X.getTime(),K=Y.getRef($7),W="";for(let q of K)W+=` ${tC(q,Z)}`;let H=Y.getRef(s8);if(Object.keys(H).length>0)G.push(H);let _=Y.getRef(lC);(Y.getRef(nC)?_.error:_.log)(`[${eC(X)}] ${J.toUpperCase()} (#${Y.id})${W}:`,...G)}),XT=Lq(({cause:Q,fiber:X,logLevel:Y,message:J})=>{let $=X.getRef(j8),G=X.getRef(s8),Z=X.currentSpan;if(Z===void 0||Z._tag==="ExternalSpan")return;let K={};for(let[W,H]of Object.entries(G))K[W]=H;if(K["effect.fiberId"]=X.id,K["effect.logLevel"]=Y.toUpperCase(),Q.reasons.length>0)K["effect.cause"]=_7(Q);Z.event(AW(Array.isArray(J)&&J.length===1?J[0]:J),$.currentTimeNanosUnsafe(),K)});function YT(){d3.interruptChildren??=NC}var Rq=A(void 0);var Nq=B((Q)=>d(Q[0]),(Q,X)=>SJ(Q,(Y)=>c((J)=>{return JT(J,Y,X?.defectsOnly),Y0}))),JT=(Q,X,Y)=>{let J=Q.getRef(bH);if(J.size===0)return;if(Y&&!K7(X))return;let $={cause:X,fiber:Q,timestamp:Q.getRef(j8).currentTimeNanosUnsafe()};J.forEach((G)=>G.report($))};var $T=W5,GT=H5,oJ=V5,nJ=jW,ZT=w4,KT=D6,WT=B6,$Q=u8,HT=kX,VT=_3,_T=q3,qT=T5,GQ=(Q)=>new _5(Q),ZQ=(Q)=>new yX(Q),KQ=lH,v7=aH,DT=eH,BT=n3,j6=V7,UT=r3,OT=o3,E8=a1,zT=rH,FT=K7,LT=oH,PT=r9,RT=W7,NT=nH,MT=iH,AT=H7,wT=i3,iJ=_7,CT=gX,TT=C9,IT=C8,k7=E9,jT=q6,ET=D3,y7=vW,ST=p9,xT=qq,vT=E7,kT=c9,yT=Dq,WQ=uJ,bT=Bq,gT=f9,hT=lJ,mT=u9,dT=Uq,pT=S7,cT=l9,fT=Oq,uT=x7,lT=q5,rT=sH,oT=tH;class Mq extends l1()("effect/Cause/StackTrace"){}class Aq extends l1()("effect/Cause/InterruptorStackTrace"){}var U0={};Z6(U0,{zipWith:()=>nj,zip:()=>oj,yieldNowWith:()=>bj,yieldNow:()=>yj,withTracerTiming:()=>bS,withTracerEnabled:()=>yS,withTracer:()=>kS,withSpanScoped:()=>nS,withSpan:()=>oS,withParentSpan:()=>iS,withLogger:()=>Nx,withLogSpan:()=>wx,withFiber:()=>bD,withExecutionPlan:()=>PE,withErrorReporting:()=>RE,withConcurrency:()=>$S,whileLoop:()=>xD,when:()=>pE,void:()=>h4,validate:()=>Pj,useSpan:()=>rS,updateService:()=>YS,updateContext:()=>XS,unwrapReason:()=>QE,uninterruptibleMask:()=>cD,uninterruptible:()=>AS,undefined:()=>wj,txRetry:()=>yx,tx:()=>Sx,tryPromise:()=>C$,try:()=>m4,trackSuccesses:()=>Tx,trackErrors:()=>Ix,trackDuration:()=>Ex,trackDefects:()=>jx,track:()=>Cx,tracer:()=>vS,timeoutOrElse:()=>CE,timeoutOption:()=>wE,timeout:()=>AE,timed:()=>jE,tapErrorTag:()=>_E,tapError:()=>hD,tapDefect:()=>mD,tapCauseIf:()=>qE,tapCauseFilter:()=>DE,tapCause:()=>o7,tap:()=>gD,sync:()=>kD,suspend:()=>vD,succeedSome:()=>r7,succeedNone:()=>x8,succeed:()=>h,spanLinks:()=>cS,spanAnnotations:()=>pS,sleep:()=>IE,serviceOption:()=>QS,service:()=>eE,scopedWith:()=>KS,scoped:()=>ZS,scope:()=>GS,scheduleFrom:()=>fD,schedule:()=>xS,satisfiesSuccessType:()=>gx,satisfiesServicesType:()=>mx,satisfiesErrorType:()=>hx,sandbox:()=>zE,runSyncWith:()=>_x,runSyncExitWith:()=>qx,runSyncExit:()=>n7,runSync:()=>d4,runPromiseWith:()=>Wx,runPromiseExitWith:()=>Vx,runPromiseExit:()=>Hx,runPromise:()=>NQ,runForkWith:()=>Gx,runFork:()=>h5,runCallbackWith:()=>Zx,runCallback:()=>Kx,retryOrElse:()=>OE,retry:()=>UE,result:()=>pj,requestUnsafe:()=>sS,request:()=>aS,replicateEffect:()=>SS,replicate:()=>ES,repeatOrElse:()=>jS,repeat:()=>IS,raceFirst:()=>vE,raceAllFirst:()=>SE,raceAll:()=>EE,race:()=>xE,provideServiceEffect:()=>JS,provideService:()=>dD,provideContext:()=>tE,provide:()=>sE,promise:()=>Aj,partition:()=>Lj,orElseSucceed:()=>NE,orDie:()=>VE,option:()=>cj,onInterrupt:()=>MS,onExitPrimitive:()=>OS,onExitIf:()=>zS,onExitFilter:()=>FS,onExit:()=>x$,onErrorIf:()=>BS,onErrorFilter:()=>US,onError:()=>DS,never:()=>Cj,matchEffect:()=>rE,matchEager:()=>S$,matchCauseEffectEager:()=>uE,matchCauseEffect:()=>lE,matchCauseEager:()=>fE,matchCause:()=>cE,match:()=>E$,mapErrorEager:()=>X1,mapError:()=>WE,mapEager:()=>x6,mapBothEager:()=>a0,mapBoth:()=>HE,map:()=>j$,makeSpanScoped:()=>lS,makeSpan:()=>uS,logWithLevel:()=>Ux,logWarning:()=>Fx,logTrace:()=>Rx,logInfo:()=>Lx,logFatal:()=>zx,logError:()=>v$,logDebug:()=>Px,log:()=>Ox,linkSpans:()=>fS,let:()=>jj,isSuccess:()=>nE,isFailure:()=>oE,isEffect:()=>Y4,interruptibleMask:()=>wS,interruptible:()=>NS,interrupt:()=>pD,ignoreCause:()=>LE,ignore:()=>FE,gen:()=>Sj,fromResult:()=>I$,fromOption:()=>gj,fromNullishOr:()=>hj,forkScoped:()=>Qx,forkIn:()=>eS,forkDetach:()=>Xx,forkChild:()=>tS,forever:()=>TS,forEach:()=>Mj,fnUntracedEager:()=>MQ,fnUntraced:()=>Dx,fn:()=>Bx,flip:()=>rj,flatten:()=>mj,flatMapEager:()=>_8,flatMap:()=>PQ,firstSuccessOf:()=>ME,findFirstFilter:()=>Nj,findFirst:()=>Rj,filterOrFail:()=>mE,filterOrElse:()=>gE,filterMapOrFail:()=>dE,filterMapOrElse:()=>hE,filterMapEffect:()=>bE,filterMap:()=>yE,filter:()=>kE,fiberId:()=>$x,fiber:()=>Jx,failSync:()=>xj,failCauseSync:()=>kj,failCause:()=>vj,fail:()=>y,exit:()=>RQ,eventually:()=>BE,ensuring:()=>qS,effectify:()=>bx,die:()=>yD,delay:()=>TE,currentSpan:()=>mS,currentParentSpan:()=>dS,contextWith:()=>aE,context:()=>iE,clockWith:()=>uD,catchTags:()=>sj,catchTag:()=>aj,catchReasons:()=>ej,catchReason:()=>tj,catchNoSuchElement:()=>GE,catchIf:()=>JE,catchFilter:()=>$E,catchEager:()=>m5,catchDefect:()=>YE,catchCauseIf:()=>ZE,catchCauseFilter:()=>KE,catchCause:()=>XE,catch:()=>ij,callback:()=>T$,cachedWithTTL:()=>PS,cachedInvalidateWithTTL:()=>RS,cached:()=>LS,bindTo:()=>Ij,bind:()=>Ej,awaitAllChildren:()=>Yx,asVoid:()=>lj,asSome:()=>uj,as:()=>fj,annotateSpans:()=>gS,annotateLogsScoped:()=>Ax,annotateLogs:()=>Mx,annotateCurrentSpan:()=>hS,andThen:()=>dj,all:()=>Fj,addFinalizer:()=>_S,acquireUseRelease:()=>VS,acquireRelease:()=>WS,acquireDisposable:()=>HS,abortSignal:()=>CS,TypeId:()=>zj,Transaction:()=>LQ,Do:()=>Tj});var V8={};Z6(V8,{void:()=>sJ,succeed:()=>HQ,match:()=>GI,mapError:()=>b7,mapBoth:()=>KI,map:()=>ZI,isSuccess:()=>H8,isFailure:()=>tJ,isExit:()=>aJ,interrupt:()=>iT,hasInterrupts:()=>tT,hasFails:()=>aT,hasDies:()=>sT,getSuccess:()=>g7,getCause:()=>VI,findErrorOption:()=>_I,findError:()=>JI,findDefect:()=>$I,filterValue:()=>QI,filterSuccess:()=>eT,filterFailure:()=>XI,filterCause:()=>YI,failCause:()=>VQ,fail:()=>v5,die:()=>nT,asVoidAll:()=>HI,asVoid:()=>WI});var aJ=V3,HQ=c0,VQ=A1,v5=A8,nT=w8,iT=AV,sJ=i1;var H8=E5,tJ=KJ,aT=SV,sT=EV,tT=jV,eT=wV,QI=CV,XI=TV,YI=n9,JI=WJ,$I=IV,GI=xV,ZI=HJ,b7=VJ,KI=_J,WI=vV,HI=qJ,g7=kV,VI=yV,_I=bV;var qI="~effect/Deferred";var DI={[qI]:{_A:g,_E:g},pipe(){return X0(this,arguments)}},wq=()=>{let Q=Object.create(DI);return Q.resumes=void 0,Q.effect=void 0,Q};var Cq=(Q)=>C1((X)=>{if(Q.effect)return X(Q.effect);return Q.resumes??=[],Q.resumes.push(X),$0(()=>{let Y=Q.resumes.indexOf(X);Q.resumes.splice(Y,1)})});var BI=B(2,(Q,X)=>$0(()=>UI(Q,X))),Tq=BI;var UI=(Q,X)=>{if(Q.effect)return!1;if(Q.effect=X,Q.resumes){for(let Y=0;Y<Q.resumes.length;Y++)Q.resumes[Y](X);Q.resumes=void 0}return!0};var Iq=s8;var jq=$7;var Eq=QQ;var h7=__,eJ=CJ;var xq="~effect/Layer",Sq="~effect/Layer/MemoMap",FI=(Q,X)=>{return Q.observers++,t8(y4(X,(Y)=>Q.finalizer(Y)),Q.effect)},vq=(Q)=>N(Q,xq),LI={[xq]:{_ROut:g,_E:g,_RIn:g},pipe(){return X0(this,arguments)}},kq=(Q)=>{let X=Object.create(LI);return X.build=Q,X},yq=(Q)=>kq((X,Y)=>{let J=h7(Y);return F1(Q(X,J),($)=>$._tag==="Failure"?eJ(J,$):Y0)});var PI=(Q,X,Y,J)=>{let $=Eq(),G=wq(),Z={observers:1,effect:Cq(G),finalizer:(K)=>a(()=>{if(Z.observers--,Z.observers===0)return Q.map.delete(X),eJ($,K);return Y0})};return Q.map.set(X,Z),y4(Y,Z.finalizer).pipe(T(()=>J(Q,$)),F1((K)=>{return Z.effect=K,Tq(G,K)}))};class bq{get[Sq](){return Sq}parent;constructor(Q){this.parent=Q}map=new Map;get(Q,X){let Y=this.map.get(Q);if(Y)return FI(Y,X);return this.parent?.get(Q,X)}getOrElseMemoize(Q,X,Y){let J=this.get(Q,X);if(J)return J;return PI(this,Q,X,Y)}}var Q$=()=>new bq;class m7 extends l1()("effect/Layer/CurrentMemoMap"){static getOrCreate=JH(this,Q$)}var X$=B(3,(Q,X,Y)=>z1(L0(Q.build(X,Y),G8(m7,X)),m7,X));var gq=B(2,(Q,X)=>c((Y)=>X$(Q,m7.getOrCreate(Y.context),X)));var hq=(Q)=>kq(G1(A(Q)));var mq=(Q,X,Y)=>{let J=h7(Y,"parallel");return n1(Q,($)=>$.build(X,h7(J,"sequential")),{concurrency:Q.length}).pipe(L0(($)=>ZH(...$)))},dq=(...Q)=>yq((X,Y)=>mq(Q,X,Y));var RI=(Q,X,Y)=>yq((J,$)=>T(Array.isArray(X)?mq(X,J,$):X.build(J,$),(G)=>Q.build(J,$).pipe(Q4(G),L0((Z)=>Y(Z,G))))),pq=B(2,(Q,X)=>RI(Q,X,g));var fq="~effect/ExecutionPlan";var NI={[fq]:fq,get captureRequirements(){let Q=this;return k4((X)=>A(MI(Q.steps.map((Y)=>({...Y,provide:vq(Y.provide)?pq(Y.provide,hq(X)):Y.provide})))))},pipe(){return X0(this,arguments)}},MI=(Q)=>{let X=Object.create(NI);return X.steps=Q,X};var uq=_0("effect/ExecutionPlan/CurrentMetadata",{defaultValue:G1({attempt:0,stepIndex:0})});var lq=class extends K6{constructor(Q){super();if(Q)Object.assign(this,Q)}};var rq=r8;var d7="~effect/time/DateTime",p7="~effect/time/DateTime/TimeZone",iq={[d7]:d7,pipe(){return X0(this,arguments)},[n0](){return this.toString()},toJSON(){return BQ(this).toJSON()}},wI={...iq,_tag:"Utc",[K0](){return p8(this.epochMilliseconds)},[W0](Q){return y5(Q)&&Q._tag==="Utc"&&this.epochMilliseconds===Q.epochMilliseconds},toString(){return`DateTime.Utc(${BQ(this).toJSON()})`}},CI={...iq,_tag:"Zoned",[K0](){return u0(p8(this.epochMilliseconds))(t(this.zone))},[W0](Q){return y5(Q)&&Q._tag==="Zoned"&&this.epochMilliseconds===Q.epochMilliseconds&&n(this.zone,Q.zone)},toString(){return`DateTime.Zoned(${U$(this)})`}},aq={[p7]:p7,[n0](){return this.toString()}},TI={...aq,_tag:"Named",[K0](){return T0(`Named:${this.id}`)},[W0](Q){return E6(Q)&&Q._tag==="Named"&&this.id===Q.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},II={...aq,_tag:"Offset",[K0](){return T0(`Offset:${this.offset}`)},[W0](Q){return E6(Q)&&Q._tag==="Offset"&&this.offset===Q.offset},toString(){return`TimeZone.Offset(${q$(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},S8=(Q,X,Y)=>{let J=Object.create(CI);return J.epochMilliseconds=Q,J.zone=X,Object.defineProperty(J,"partsUtc",{value:Y,enumerable:!1,writable:!0}),Object.defineProperty(J,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(J,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),J},y5=(Q)=>N(Q,d7);var E6=(Q)=>N(Q,p7),sq=(Q)=>E6(Q)&&Q._tag==="Offset",tq=(Q)=>E6(Q)&&Q._tag==="Named",eq=(Q)=>Q._tag==="Utc",$$=(Q)=>Q._tag==="Zoned",QD=i0((Q,X)=>Q.epochMilliseconds===X.epochMilliseconds);var G$=(Q)=>{let X=Object.create(wI);return X.epochMilliseconds=Q,Object.defineProperty(X,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),X},k5=(Q)=>{let X=Q.getTime();if(Number.isNaN(X))throw new WQ("Invalid date");return G$(X)},Z$=(Q)=>{if(y5(Q))return Q;else if(Q instanceof Date)return k5(Q);else if(typeof Q==="object"){if("epochMilliseconds"in Q)return G$(Q.epochMilliseconds);let X=new Date(0);return bI(X,Q),k5(X)}else if(typeof Q==="string"&&!jI(Q))return k5(new Date(Q+"Z"));return k5(new Date(Q))},jI=(Q)=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(Q),EI=-8639999956800000,SI=8639999949600000,K$=(Q,X)=>{let Y=X?.timeZone;if(Y===void 0&&y5(Q)&&$$(Q))return Q;let J=Z$(Q);if(J.epochMilliseconds<EI||J.epochMilliseconds>SI)throw RangeError(`Epoch millis out of range: ${J.epochMilliseconds}`);if(Y===void 0&&typeof Q==="object"&&"timeZoneId"in Q)Y=Q.timeZoneId;let $;if(Y===void 0){let G=new Date(J.epochMilliseconds).getTimezoneOffset()*-60*1000;$=DQ(G)}else if(E6(Y))$=Y;else if(typeof Y==="number")$=DQ(Y);else{let G=V$(Y);if(I0(G))throw new WQ(`Invalid time zone: ${Y}`);$=G.value}if(X?.adjustForTimeZone!==!0)return S8(J.epochMilliseconds,$,J.partsUtc);return gI(J.epochMilliseconds,$,X?.disambiguation??"compatible")},Y$=O6(K$),XD=O6(Z$),xI=/^(.{17,35})\[(.+)\]$/,YD=(Q)=>{let X=xI.exec(Q);if(X===null){let $=B$(Q);return $!==null?Y$(Q,{timeZone:$}):b()}let[,Y,J]=X;return Y$(Y,{timeZone:J})};var JD=(Q)=>G$(Q.epochMilliseconds);var qQ=new Map,vI={day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},kI=(Q)=>{let X=Q.resolvedOptions().timeZone;if(qQ.has(X))return qQ.get(X);let Y=Object.create(TI);return Y.id=X,Y.format=Q,qQ.set(X,Y),Y},W$=(Q)=>{if(qQ.has(Q))return qQ.get(Q);try{return kI(new Intl.DateTimeFormat("en-US",{...vI,timeZone:Q}))}catch{throw new WQ(`Invalid time zone: ${Q}`)}},DQ=(Q)=>{let X=Object.create(II);return X.offset=Q,X},H$=O6(W$);var yI=/^(?:GMT|[+-])/,V$=(Q)=>{if(yI.test(Q)){let X=B$(Q);return X===null?b():F(DQ(X))}return H$(Q)},$D=(Q)=>{if(Q._tag==="Offset")return q$(Q.offset);return Q.id};var BQ=(Q)=>new Date(Q.epochMilliseconds),c7=(Q)=>{if(Q._tag==="Utc")return new Date(Q.epochMilliseconds);else if(Q.zone._tag==="Offset")return new Date(Q.epochMilliseconds+Q.zone.offset);else if(Q.adjustedEpochMilliseconds!==void 0)return new Date(Q.adjustedEpochMilliseconds);let X=Q.zone.format.formatToParts(Q.epochMilliseconds).filter((J)=>J.type!=="literal"),Y=new Date(0);return Y.setUTCFullYear(Number(X[2].value),Number(X[0].value)-1,Number(X[1].value)),Y.setUTCHours(Number(X[3].value),Number(X[4].value),Number(X[5].value),Number(X[6].value)),Q.adjustedEpochMilliseconds=Y.getTime(),Y},_$=(Q)=>{return c7(Q).getTime()-D$(Q)},q$=(Q)=>{let X=Math.abs(Q),Y=Math.floor(X/3600000),J=Math.round(X%3600000/60000);if(J===60)Y+=1,J=0;return`${Q<0?"-":"+"}${String(Y).padStart(2,"0")}:${String(J).padStart(2,"0")}`},GD=(Q)=>q$(_$(Q)),D$=(Q)=>Q.epochMilliseconds;var bI=(Q,X)=>{if(X.year!==void 0)Q.setUTCFullYear(X.year);if(X.month!==void 0)Q.setUTCMonth(X.month-1);if(X.day!==void 0)Q.setUTCDate(X.day);if(X.weekDay!==void 0){let Y=X.weekDay-Q.getUTCDay();Q.setUTCDate(Q.getUTCDate()+Y)}if(X.hour!==void 0)Q.setUTCHours(X.hour);if(X.minute!==void 0)Q.setUTCMinutes(X.minute);if(X.second!==void 0)Q.setUTCSeconds(X.second);if(X.millisecond!==void 0)Q.setUTCMilliseconds(X.millisecond)};var nq=86400000,gI=(Q,X,Y)=>{if(X._tag==="Offset")return S8(Q-X.offset,X);let J=_Q(Q-nq,Q,X),$=_Q(Q+nq,Q,X);if(J===$)return S8(Q-J,X);let G=J<$,Z=J-$;if(G){if(_Q(Q-$,Q,X)===$)return S8(Q-$,X);let H=S8(Q-J,X),_=c7(H).getTime();if(Q!==_)switch(Y){case"reject":{let V=new Date(Q).toISOString();throw RangeError(`Gap time: ${V} does not exist in time zone ${X.id}`)}case"earlier":return S8(Q-$,X);case"compatible":case"later":return H}return H}if(_Q(Q-J,Q,X)===J){if(Y==="earlier"||Y==="compatible")return S8(Q-J,X);if(_Q(Q-J+Z,Q+Z,X)===J)return S8(Q-J,X);if(Y==="reject"){let H=new Date(Q).toISOString();throw RangeError(`Ambiguous time: ${H} occurs twice in time zone ${X.id}`)}}return S8(Q-$,X)},hI=/([+-])(\d{2}):(\d{2})$/,B$=(Q)=>{let X=hI.exec(Q);if(X===null)return null;let[,Y,J,$]=X;return(Y==="+"?1:-1)*(Number(J)*60+Number($))*60*1000},_Q=(Q,X,Y)=>{let J=Y.format.formatToParts(Q).find((G)=>G.type==="timeZoneName")?.value??"";if(J==="GMT")return 0;let $=B$(J);if($===null)return _$(S8(X,Y));return $};var ZD=(Q)=>BQ(Q).toISOString();var J$=(Q)=>{let X=c7(Q);return Q._tag==="Utc"?X.toISOString():`${X.toISOString().slice(0,-1)}${GD(Q)}`},U$=(Q)=>Q.zone._tag==="Offset"?J$(Q):`${J$(Q)}[${Q.zone.id}]`;var Ys=globalThis.Number;var WD=B(2,(Q,X)=>{let Y=KD(Q),J=KD(X),$=Y>J?Y:J,G=parseInt(Q.toFixed($).replace(".","")),Z=parseInt(X.toFixed($).replace(".",""));return G%Z/Math.pow(10,$)});function KD(Q){let X=Q.toString(),Y=X.indexOf("e-");if(Y!==-1){let J=parseInt(X.slice(Y+2));return(X.slice(0,Y).split(".")[1]||"").length+J}return(X.split(".")[1]||"").length}var HD=o8((Q,X)=>Math.max(Q,X),-1/0),VD=o8((Q,X)=>Math.min(Q,X),1/0);var Js=globalThis.String;var _D=(Q)=>Q.trim();var O$=B(2,(Q,X)=>S5(Q,fI,(Y)=>X(Y)));var cI=N5(E8,(Q)=>k7(Q)?l(Q):f(Q));var fI=N5(E8,(Q)=>k7(Q)?l(Q.value):f(Q));var qD=B(2,(Q,X)=>I8(Q,{onSuccess:X.onSuccess,onFailure:(Y)=>{let J=cI(Y);return!u(J)?X.onDone(J.success.value):X.onFailure(J.failure)}}));var BD="~effect/Schedule";var S6=_0("effect/Schedule/CurrentMetadata",{defaultValue:G1({input:void 0,output:void 0,duration:P5,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),uI={[BD]:{_Out:g,_In:g,_Env:g},pipe(){return X0(this,arguments)}},z$=(Q)=>N(Q,BD),F$=(Q)=>{let X=Object.create(uI);return X.step=Q,X},L$=()=>{let Q=0,X,Y;return(J,$)=>{if(Y===void 0)Y=J;let G=J-Y,Z=X===void 0?0:J-X;return X=J,{input:$,attempt:++Q,start:Y,now:J,elapsed:G,elapsedSincePrevious:Z}}},lI=(Q)=>F$(L0(Q,(X)=>{let Y=L$();return(J,$)=>X(Y(J,$))})),P$=(Q)=>s1(Q.step,(X)=>A(()=>M0(X))),f7=(Q)=>T6((X)=>L0(P$(Q),(Y)=>{let J=L$();return($)=>a(()=>{let G=X.currentTimeMillisUnsafe();return T(Y(G,$),([Z,K])=>{let W=J(G,$);return W.output=Z,W.duration=K,v1(I6(K),W)})})}));var R$=(Q)=>F$(L0(P$(Q),(X)=>(Y,J)=>qD(X(Y,J),{onSuccess:($)=>A([J,$[1]]),onFailure:M0,onDone:()=>y7(J)}))),UD=(Q)=>UQ(N$,({attempt:X})=>A(X<=Q));var rI=(Q)=>{let X=x1(Q);return lI(A((Y)=>A([Y.attempt-1,X])))};var UQ=B(2,(Q,X)=>F$(L0(P$(Q),(Y)=>{let J=L$();return($,G)=>T(Y($,G),(Z)=>{let[K,W]=Z,H=X({...J($,G),output:K,duration:W});return T(d(H)?H:A(H),(_)=>_?A(Z):y7(K))})})));var N$=rI(P5);var oI=(Q,X,Y)=>A7((J)=>T(Y?.local?X$(X,Q$(),J):gq(X,J),($)=>Q4(Q,$))),u7=B((Q)=>d(Q[0]),(Q,X,Y)=>R3(X)?Q4(Q,X):oI(Q,Array.isArray(X)?dq(...X):X,Y));var M$=B(3,(Q,X,Y)=>T(f7(X),(J)=>{let $=S6.defaultValue();return k1(L7(M6(T(a(()=>z1(Q,S6,$)),J),(G)=>$0(()=>{$=G})),{disableYield:!0}),(G)=>E9(G)?A(G.value):Y(G,$.attempt===0?b():F($)))})),A$=B(3,(Q,X,Y)=>T(f7(X),(J)=>{let $=S6.defaultValue(),G,Z=k1(a(()=>z1(Q,S6,$)),(K)=>{return G=K,T(J(K),(W)=>{return $=W,Z})});return O$(Z,(K)=>J0(()=>Y(G,K)))})),FD=B(2,(Q,X)=>{let Y=typeof X==="function"?X(g):z$(X)?X:zQ(X);return M$(Q,Y,F0)}),OQ=B(2,(Q,X)=>{let Y=typeof X==="function"?X(g):z$(X)?X:zQ(X);return A$(Q,Y,F0)}),LD=B(3,(Q,X,Y)=>T(f7(Y),(J)=>{let $=S6.defaultValue(),G=a(()=>z1(Q,S6,$));return k1(T(J(X),(Z)=>{$=Z;let K=G1(T(G,J));return b4({while:P4,body:K,step(W){$=W}})}),(Z)=>E9(Z)?A(Z.value):F0(Z))})),nI=R$(N$),zQ=(Q)=>{let X=Q.schedule?R$(Q.schedule):nI;if(Q.while)X=UQ(X,({input:Y})=>{let J=Q.while(Y);return d(J)?J:A(J)});if(Q.until)X=UQ(X,({input:Y})=>{let J=Q.until(Y);return d(J)?L0(J,($)=>!$):A(!J)});if(Q.times!==void 0)X=UQ(X,({attempt:Y})=>A(Y<=Q.times));return X};var ND=B(2,(Q,X)=>a(()=>{let Y=0,J={attempt:0,stepIndex:0},$=F7(uq,$0(()=>{return J={attempt:J.attempt+1,stepIndex:Y},J})),G;return T(b4({while:()=>Y<X.steps.length&&(G===void 0||u(G)),body(){let Z=X.steps[Y],K=$(u7(Q,Z.provide));if(G){let W=!1,H=K;K=a(()=>{if(W)return H;return W=!0,I5(G)}),K=OQ(K,RD(Z,!1))}else{let W=RD(Z,!0);K=W?OQ(K,W):K}return v4(K)},step(Z){G=Z,Y++}}),()=>I5(G))})),RD=(Q,X)=>{if(!X)return zQ({schedule:Q.schedule?Q.schedule:Q.attempts?void 0:iI,times:Q.attempts,while:Q.while});else if(Q.attempts===1||!(Q.schedule||Q.attempts))return;return zQ({schedule:Q.schedule,while:Q.while,times:Q.attempts?Q.attempts-1:void 0})},iI=UD(1);var sI="~effect/Request",tI=NW({_E:(Q)=>Q,_A:(Q)=>Q,_R:(Q)=>Q}),Ls={...IW,[sI]:tI};var MD=(Q)=>Q;var wD=B(2,(Q,X)=>{let Y=(J)=>C1(($)=>{let G=TD(J,Q,$,q7());return eI(J,G)});return d(X)?T(X,Y):Y(X)}),CD=(Q,X)=>{let Y=TD(X.resolver,Q,X.onExit,{context:X.context,currentScheduler:S1(X.context,k9)});return()=>ID(X.resolver,Y)},l7=[],w$=new WeakMap,TD=(Q,X,Y,J)=>{let $=w$.get(Q);if(!$)$=new Map,w$.set(Q,$);let G,Z=!1,K=MD({request:X,context:J.context,uninterruptible:!1,completeUnsafe(H){if(Z)return;Z=!0,Y(H),G?.entrySet.delete(K)}});if(Q.preCheck!==void 0&&!Q.preCheck(K))return K;let W=Q.batchKey(K);if(G=$.get(W),!G){if(l7.length>0)G=l7.pop(),G.key=W,G.resolver=Q,G.map=$;else{let H={key:W,resolver:Q,map:$,entrySet:new Set,entries:new Set,delayEffect:T(a(()=>H.resolver.delay),(_)=>AD(H)),run:F1(a(()=>H.resolver.runAll(Array.from(H.entries),H.key)),(_)=>{for(let V of H.entrySet)V.completeUnsafe(_._tag==="Success"?w8(Error("Effect.request: RequestResolver did not complete request",{cause:V.request})):_);if(H.entries.clear(),l7.length<128)H.entrySet.clear(),H.key=void 0,H.fiber=void 0,H.resolver=void 0,H.map=void 0,l7.push(H);return Y0})};G=H}$.set(W,G),G.fiber=X4(J.context)(G.delayEffect,{scheduler:J.currentScheduler})}if(G.entrySet.add(K),G.entries.add(K),G.resolver.collectWhile(G.entries))return K;return G.fiber.interruptUnsafe(J.id),G.fiber=X4(J.context)(AD(G),{scheduler:J.currentScheduler}),K},ID=(Q,X)=>{if(X.uninterruptible)return;let Y=w$.get(Q);if(!Y)return;let J=Q.batchKey(X.request),$=Y.get(J);if(!$)return;if($.entries.delete(X),$.entrySet.delete(X),$.entries.size===0)Y.delete(J),$.fiber?.interruptUnsafe()},eI=(Q,X)=>$0(()=>ID(Q,X));function AD(Q){if(!Q.map.has(Q.key))return Y0;return Q.map.delete(Q.key),Q.run}var Jj="effect/Metric/CurrentMetricAttributes",$j=_0(Jj,{defaultValue:()=>({})}),Gj="~effect/observability/Metric/MetricRegistryKey",Zj=_0(Gj,{defaultValue:()=>new Map}),jD="~effect/observability/Metric";class b5{[jD]=jD;#Q=new WeakMap;#X;id;description;attributes;constructor(Q,X,Y){this.id=Q,this.description=X,this.attributes=Y}valueUnsafe(Q){return this.hook(Q).get(Q)}modifyUnsafe(Q,X){return this.hook(X).modify(Q,X)}updateUnsafe(Q,X){return this.hook(X).update(Q,X)}hook(Q){let X=S1(Q,$j);if(Object.keys(X).length===0){if(Z1(this.#X))return this.#X.hooks;return this.#X=this.getOrCreate(Q,this.attributes),this.#X.hooks}let Y=Uj(this.attributes,X),J=this.#Q.get(Y);if(Z1(J))return J.hooks;return J=this.getOrCreate(Q,Y),this.#Q.set(Y,J),J.hooks}getOrCreate(Q,X){let Y=qj(this,X),J=S1(Q,Zj);if(J.has(Y))return J.get(Y);let $=this.createHooks(),G={id:this.id,type:this.type,description:this.description,attributes:g4(X),hooks:$};return J.set(Y,G),G}pipe(){return X0(this,arguments)}}var ED=BigInt(0);class Kj extends b5{type="Counter";#Q;#X;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.bigint??!1,this.#X=X?.incremental??!1}createHooks(){let Q=this.#Q?ED:0,X=this.#X?this.#Q?(J)=>J>=ED:(J)=>J>=0:(J)=>!0;return FQ(()=>({count:Q,incremental:this.#X}),(J)=>{if(X(J))Q=Q+J})}}class Wj extends b5{type="Gauge";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.bigint??!1}createHooks(){let Q=this.#Q?BigInt(0):0;return FQ(()=>({value:Q}),(J)=>{Q=J},(J)=>{Q=Q+J})}}class Hj extends b5{type="Frequency";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X?.preregisteredWords}createHooks(){let Q=new Map;if(Z1(this.#Q))for(let Y of this.#Q)Q.set(Y,0);return FQ(()=>({occurrences:Q}),(Y)=>{let J=Q.get(Y)??0;Q.set(Y,J+1)})}}class Vj extends b5{type="Histogram";#Q;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=X.boundaries}createHooks(){let Q=this.#Q,X=Q.length,Y=new Uint32Array(X+1),J=new Float64Array(X),$=0,G=0,Z=Number.MAX_VALUE,K=Number.MIN_VALUE;E4(v9(Q,U1),(_,V)=>{J[V]=_});let W=(_)=>{let V=0,q=X;while(V!==q){let D=Math.floor(V+(q-V)/2),U=J[D];if(_<=U)q=D;else V=D;if(q===V+1)if(_<=J[V])q=V;else V=q}if(Y[V]=Y[V]+1,$=$+1,G=G+_,_<Z)Z=_;if(_>K)K=_},H=()=>{let _=w3(X),V=0;for(let q=0;q<X;q++){let D=J[q],U=Y[q];V=V+U,_[q]=[D,V]}return _};return FQ(()=>({buckets:H(),count:$,min:Z,max:K,sum:G}),W)}}class _j extends b5{type="Summary";#Q;#X;#Y;constructor(Q,X){super(Q,X?.description,g4(X?.attributes));this.#Q=Math.max(x4(x1(X.maxAge)),0),this.#X=X.maxSize,this.#Y=X.quantiles}createHooks(){let Q=v9(this.#Y,U1),X=w3(this.#X);for(let V of this.#Y)if(V<0||V>1)throw Error(`Quantile must be between 0 and 1, found: ${V}`);let Y=0,J=0,$=0,G=Number.MAX_VALUE,Z=Number.MIN_VALUE,K=(V)=>{let q=[],D=0;while(D<this.#X){let L=X[D];if(Z1(L)){let[M,w]=L,R=V-M;if(R>=0&&R<=this.#Q)q.push(w)}D=D+1}let U=v9(q,U1),P=U.length;if(P===0)return Q.map((L)=>[L,void 0]);return Q.map((L)=>{if(L<=0)return[L,U[0]];if(L>=1)return[L,U[P-1]];let M=Math.ceil(L*P)-1;return[L,U[M]]})},W=(V,q)=>{if(this.#X>0){let D=Y%this.#X;X[D]=[q,V],Y=Y+1}if(J=J+1,$=$+V,V<G)G=V;if(V>Z)Z=V};return FQ((V)=>{let q=S1(V,j8);return{quantiles:K(q.currentTimeMillisUnsafe()),count:J,min:G,max:Z,sum:$}},([V,q])=>W(V,q))}}var g5=B(2,(Q,X)=>k4((Y)=>$0(()=>Q.updateUnsafe(X,Y))));function qj(Q,X){let Y=`${Q.type}:${Q.id}`;if(Z1(Q.description))Y+=`:${Q.description}`;if(Z1(X))Y+=`:${Dj(X)}`;return Y}function FQ(Q,X,Y){return{get:Q,update:X,modify:Y??X}}function Dj(Q){return Bj(Array.isArray(Q)?Q:Object.entries(Q))}function Bj(Q){return Q.map(([X,Y])=>`${X}=${Y}`).join(",")}function Uj(Q,X){return{...g4(Q),...g4(X)}}function g4(Q){if(Z1(Q)&&Array.isArray(Q))return Q.reduce((X,[Y,J])=>{return X[Y]=J,X},{});return Q}var zj=M8,Y4=d,Fj=T7,Lj=bJ,Pj=A_,Rj=w_,Nj=T_,Mj=n1,xD=b4,Aj=QJ,C$=KV,h=A,x8=B7,r7=e3,vD=a,kD=$0,h4=Y0;var wj=Rq;var T$=C1,Cj=YJ,Tj=k_,Ij=y_,jj=g_;var Ej=b_,Sj=_V,y=F0,xj=U7,vj=M0,kj=GV,yD=N6,m4=ZV;var yj=j5,bj=t3,bD=c,I$=I5,gj=JV,hj=$V,PQ=T,mj=LV,dj=t8,gD=M6,pj=v4,cj=J_,RQ=t9,j$=L0,fj=v1,uj=O7,lj=o9,rj=BV,oj=BJ,nj=UJ,ij=k1;var aj=LJ,sj=iV,tj=aV,ej=sV,QE=tV,XE=s1,YE=uV,JE=a9,$E=R7,GE=fV,ZE=zJ,KE=S5,WE=PJ,HE=RJ,VE=NJ,hD=FJ,_E=oV,o7=lV,qE=rV,DE=P7,mD=nV,BE=MJ,UE=OQ,OE=A$,zE=UV,FE=X_,LE=Y_,PE=ND,RE=Nq,NE=eV,ME=Q_,AE=W_,wE=H_,CE=wJ,TE=K_,IE=I6,jE=V_,EE=GJ,SE=ZJ,xE=OV,vE=z7,kE=S_,yE=x_,bE=v_,gE=gJ,hE=hJ,mE=dV,dE=E_,pE=pV,E$=N7,S$=s9,cE=AJ,fE=$_,uE=zV,lE=I8,rE=A6,oE=G_,nE=Z_,iE=DJ,aE=k4,sE=u7,tE=Q4,eE=gV,QS=hV,XS=i9,YS=e8,dD=z1,JS=F7,$S=mV,GS=XQ,ZS=TJ,KS=A7,WS=w7,HS=z_,VS=O_,_S=IJ,qS=D_,DS=SJ,BS=B_,US=xJ,OS=x5,x$=F1,zS=jJ,FS=EJ,LS=F_,PS=kJ,RS=vJ,pD=L_,NS=yJ,MS=U_,AS=w6,cD=YQ,wS=N_,CS=M_,TS=L7,IS=FD,jS=M$,ES=OJ,SS=cV,xS=B(2,(Q,X)=>fD(Q,void 0,X)),fD=LD,vS=i_,kS=a_,yS=s_,bS=t_,gS=Zq,hS=Kq,mS=Wq,dS=Hq,pS=Yq,cS=Jq,fS=$q,uS=Qq,lS=m9,rS=d9,oS=Gq,nS=Xq,iS=C5,aS=wD,sS=CD,tS=h_,eS=mJ,Qx=p_,Xx=m_,Yx=d_,Jx=HV,$x=VV,h5=c_,Gx=X4,Zx=dJ,Kx=f_,NQ=l_,Wx=pJ,Hx=u_,Vx=I7,d4=o_,_x=cJ,n7=r_,qx=j7,Dx=JJ,Bx=qV,uD=T6,Ux=W8,Ox=W8(),zx=W8("Fatal"),Fx=W8("Warn"),v$=W8("Error"),Lx=W8("Info"),Px=W8("Debug"),Rx=W8("Trace"),Nx=B(2,(Q,X)=>e8(Q,rJ,(Y)=>new Set([...Y,X]))),Mx=B((Q)=>Y4(Q[0]),(Q,...X)=>e8(Q,Iq,(Y)=>{let J={...Y};if(X.length===1)Object.assign(J,X[0]);else J[X[0]]=X[1];return J})),Ax=Fq,wx=B(2,(Q,X)=>T(_q,(Y)=>e8(Q,jq,(J)=>{return[[X,Y],...J]}))),Cx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>x$(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(X,$)})),Tx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>gD(Q,(J)=>{let $=Y===void 0?J:Y(J);return g5(X,$)})),Ix=B((Q)=>Y4(Q[0]),(Q,X,Y)=>hD(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(X,$)})),jx=B((Q)=>Y4(Q[0]),(Q,X,Y)=>mD(Q,(J)=>{let $=Y===void 0?J:J0(()=>Y(J));return g5(X,$)})),Ex=B((Q)=>Y4(Q[0]),(Q,X,Y)=>uD((J)=>{let $=J.currentTimeNanosUnsafe();return x$(Q,()=>{let G=J.currentTimeNanosUnsafe(),Z=NH(x1(G),x1($)),K=Y===void 0?Z:J0(()=>Y(Z));return g5(X,K)})}));class LQ extends l1()("effect/Effect/Transaction"){}var Sx=(Q)=>bD((X)=>{if(X.context.mapUnsafe.has(LQ.key))return Q;let Y={journal:new Map,retry:!1},J;return cD(($)=>PQ(xD({while:()=>!J,body:G1($(Q).pipe(dD(LQ,Y),o7(()=>{if(!Y.retry)return h4;return $(vx(Y))}),RQ)),step(G){if(Y.retry||!xx(Y))return SD(Y);if(H8(G))kx(X,Y);else SD(Y);J=G}}),()=>J))}),xx=(Q)=>{for(let[X,{version:Y}]of Q.journal)if(X.version!==Y)return!1;return!0},vx=(Q)=>vD(()=>{let X={},Y=Array.from(Q.journal.keys()),J=()=>{for(let $ of Y)$.pending.delete(X)};return T$(($)=>{let G=()=>{J(),$(h4)};for(let Z of Y)Z.pending.set(X,G);return kD(J)})});function kx(Q,X){for(let[Y,{value:J}]of X.journal){if(J!==Y.value)Y.version=Y.version+1,Y.value=J;for(let $ of Y.pending.values())Q.currentDispatcher.scheduleTask($,0);Y.pending.clear()}}function SD(Q){Q.retry=!1,Q.journal.clear()}var yx=PQ(LQ,(Q)=>{return Q.retry=!0,pD}),bx=(Q,X,Y)=>(...J)=>T$(($)=>{try{Q(...J,(G,Z)=>{if(G)$(y(X?X(G,J):G));else $(h(Z))})}catch(G){$(Y?y(Y(G,J)):yD(G))}}),gx=()=>(Q)=>Q,hx=()=>(Q)=>Q,mx=()=>(Q)=>Q,x6=PV,X1=RV,a0=NV,_8=FV,m5=MV,MQ=DV;var dx=(Q,X)=>{if(H8(Q))return X(0);if(v7(Q.cause))return X(130);return X(px(j6(Q.cause)))},oD=(Q)=>B((X)=>Y4(X[0]),(X,Y)=>{let J=Y?.disableErrorReporting===!0?h5(X):h5(o7(X,(G)=>{if(v7(G))return h4;return cx(j6(G))?v$(G):h4}));try{let G=globalThis.setInterval($5,2147483647);J.addObserver(()=>{clearInterval(G)})}catch{}let $=Y?.teardown??dx;return Q({fiber:J,teardown:$})}),lD="~effect/Runtime/errorExitCode",px=(Q)=>{if(typeof Q==="object"&&Q!==null&&lD in Q){let X=Q[lD];if(typeof X==="number")return X}return 1},rD="~effect/Runtime/errorReported",cx=(Q)=>{if(typeof Q==="object"&&Q!==null&&rD in Q){let X=Q[rD];if(typeof X==="boolean")return X}return!0};var nD=oD(({fiber:Q,teardown:X})=>{let Y=!1;Q.addObserver(($)=>{process.removeListener("SIGINT",J),process.removeListener("SIGTERM",J),X($,(G)=>{if(Y||G!==0)process.exit(G)})});function J(){Y=!0,Q.interruptUnsafe(Q.id)}process.on("SIGINT",J),process.on("SIGTERM",J)});var lx=nD;var C={};Z6(C,{withDecodingDefaultTypeKey:()=>Eu,withDecodingDefaultType:()=>Su,withDecodingDefaultKey:()=>lK,withDecodingDefault:()=>TN,withConstructorDefault:()=>CN,toType:()=>R1,toTaggedUnion:()=>IN,toStandardSchemaV1:()=>mf,toStandardJSONSchemaV1:()=>df,toRepresentation:()=>NM,toJsonSchemaDocument:()=>MM,toIsoSource:()=>cr,toIsoFocus:()=>fr,toIso:()=>pr,toFormatter:()=>Ir,toEquivalence:()=>Er,toEncoderXml:()=>vr,toEncoded:()=>U9,toDifferJsonPatch:()=>lr,toCodecStringTree:()=>IM,toCodecJson:()=>AM,toCodecIso:()=>CM,toArbitraryLazy:()=>RM,toArbitrary:()=>Cr,tagDefaultOmit:()=>xu,tag:()=>Q5,suspend:()=>RN,revealCodec:()=>gf,revealBottom:()=>vf,resolveAnnotationsKey:()=>ar,resolveAnnotations:()=>ir,requiredKey:()=>Xu,required:()=>Yu,refine:()=>Au,redact:()=>oK,readonlyKey:()=>$u,overrideToFormatter:()=>Tr,overrideToEquivalence:()=>jr,overrideToCodecIso:()=>ur,optionalKey:()=>X6,optional:()=>B9,mutableKey:()=>Ju,mutable:()=>Nu,middlewareEncoding:()=>MN,middlewareDecoding:()=>fK,makeIsMultipleOf:()=>xN,makeIsLessThanOrEqualTo:()=>LX,makeIsLessThan:()=>FX,makeIsGreaterThanOrEqualTo:()=>zX,makeIsGreaterThan:()=>OX,makeIsBetween:()=>PX,makeFilterGroup:()=>yu,makeFilter:()=>z0,make:()=>I,link:()=>N0,isUppercased:()=>ou,isUnique:()=>fN,isUncapitalized:()=>au,isUint32:()=>Yl,isUUID:()=>du,isULID:()=>cu,isTrimmed:()=>jN,isStringSymbol:()=>hu,isStringFinite:()=>bu,isStringBigInt:()=>gu,isStartsWith:()=>uu,isSizeBetween:()=>Pl,isSchemaError:()=>hf,isSchema:()=>x2,isPropertyNames:()=>Al,isPropertiesLengthBetween:()=>Ml,isPattern:()=>O9,isNonEmpty:()=>pN,isMultipleOf:()=>Ql,isMinSize:()=>Fl,isMinProperties:()=>Rl,isMinLength:()=>dN,isMaxSize:()=>Ll,isMaxProperties:()=>Nl,isMaxLength:()=>zl,isLowercased:()=>nu,isLessThanOrEqualToDate:()=>Zl,isLessThanOrEqualToBigInt:()=>Vl,isLessThanOrEqualToBigDecimal:()=>Ul,isLessThanOrEqualTo:()=>eu,isLessThanDate:()=>Gl,isLessThanBigInt:()=>Hl,isLessThanBigDecimal:()=>Bl,isLessThan:()=>tu,isLengthBetween:()=>cN,isInt32:()=>Xl,isInt:()=>b2,isIncludes:()=>ru,isGreaterThanOrEqualToDate:()=>$l,isGreaterThanOrEqualToBigInt:()=>mN,isGreaterThanOrEqualToBigDecimal:()=>Dl,isGreaterThanOrEqualTo:()=>vN,isGreaterThanDate:()=>Jl,isGreaterThanBigInt:()=>Wl,isGreaterThanBigDecimal:()=>ql,isGreaterThan:()=>su,isGUID:()=>pu,isFinite:()=>SN,isEndsWith:()=>lu,isDateValid:()=>kN,isCapitalized:()=>iu,isBetweenDate:()=>Kl,isBetweenBigInt:()=>_l,isBetweenBigDecimal:()=>Ol,isBetween:()=>rK,isBase64Url:()=>fu,isBase64:()=>EN,is:()=>YN,instanceOf:()=>z4,fromURLSearchParams:()=>Qr,fromJsonString:()=>GM,fromFormData:()=>el,fromBrand:()=>wu,flip:()=>vK,fieldsAssign:()=>Bu,extendTo:()=>Ou,encodeUnknownSync:()=>DN,encodeUnknownResult:()=>_N,encodeUnknownPromise:()=>qN,encodeUnknownOption:()=>VN,encodeUnknownExit:()=>HN,encodeUnknownEffect:()=>S2,encodeTo:()=>uK,encodeSync:()=>ef,encodeResult:()=>sf,encodePromise:()=>tf,encodeOption:()=>af,encodeKeys:()=>Uu,encodeExit:()=>nf,encodeEffect:()=>WN,encode:()=>ju,decodeUnknownSync:()=>KN,decodeUnknownResult:()=>GN,decodeUnknownPromise:()=>ZN,decodeUnknownOption:()=>$N,decodeUnknownExit:()=>JN,decodeUnknownEffect:()=>E2,decodeTo:()=>p,decodeSync:()=>of,decodeResult:()=>lf,decodePromise:()=>rf,decodeOption:()=>uf,decodeExit:()=>ff,decodeEffect:()=>cf,decode:()=>Iu,declareConstructor:()=>f1,declare:()=>O4,check:()=>Mu,catchEncodingWithContext:()=>wN,catchEncoding:()=>Tu,catchDecodingWithContext:()=>AN,catchDecoding:()=>Cu,brand:()=>NN,asserts:()=>pf,asClass:()=>Qu,annotateKey:()=>bf,annotateEncoded:()=>yf,annotate:()=>kf,Void:()=>_u,UnknownFromJsonString:()=>tl,Unknown:()=>gK,UniqueSymbol:()=>Du,UniqueArray:()=>Ru,Union:()=>J1,UndefinedOr:()=>k2,Undefined:()=>mK,Uint8ArrayFromHex:()=>Dr,Uint8ArrayFromBase64Url:()=>qr,Uint8ArrayFromBase64:()=>_r,Uint8Array:()=>m2,URLSearchParams:()=>WM,URLFromString:()=>ul,URL:()=>QM,TupleWithRest:()=>Fu,Tuple:()=>D9,Trimmed:()=>VM,Trim:()=>$r,Tree:()=>rr,TimeZoneOffset:()=>zr,TimeZoneNamedFromString:()=>Fr,TimeZoneNamed:()=>DM,TimeZoneFromString:()=>Lr,TimeZone:()=>UM,TemplateLiteralParser:()=>Ku,TemplateLiteral:()=>Zu,TaggedUnion:()=>vu,TaggedStruct:()=>y2,TaggedErrorClass:()=>wr,TaggedClass:()=>Ar,Symbol:()=>ON,StructWithRest:()=>zu,Struct:()=>R0,StringFromUriComponent:()=>Wr,StringFromHex:()=>Kr,StringFromBase64Url:()=>Zr,StringFromBase64:()=>Gr,String:()=>o,StandardSchemaV1FailureResult:()=>Hr,SchemaError:()=>g8,Result:()=>vl,RegExp:()=>fl,RedactedFromValue:()=>kl,Redacted:()=>uN,Record:()=>zN,ReadonlySet:()=>dl,ReadonlyMap:()=>hl,PropertyKey:()=>bK,OptionFromUndefinedOr:()=>Il,OptionFromOptionalNullOr:()=>xl,OptionFromOptionalKey:()=>El,OptionFromOptional:()=>Sl,OptionFromNullishOr:()=>jl,OptionFromNullOr:()=>Tl,Option:()=>X5,Opaque:()=>ku,ObjectKeyword:()=>qu,NumberFromString:()=>Xr,Number:()=>Y6,NullishOr:()=>PN,NullOr:()=>cK,Null:()=>hK,NonEmptyString:()=>wl,NonEmptyArray:()=>Lu,Never:()=>Hu,MutableJson:()=>nr,Literals:()=>pK,Literal:()=>t0,Json:()=>aK,Int:()=>HM,HashSet:()=>pl,HashMap:()=>ml,FormData:()=>KM,FiniteFromString:()=>Yr,Finite:()=>h2,File:()=>ZM,Exit:()=>gl,ErrorClass:()=>PM,Error:()=>yl,Enum:()=>Wu,DurationFromString:()=>ol,DurationFromNanos:()=>il,DurationFromMillis:()=>al,Duration:()=>g2,Defect:()=>bl,DateValid:()=>YM,DateTimeZonedFromString:()=>Pr,DateTimeZoned:()=>zM,DateTimeUtcFromString:()=>Ur,DateTimeUtcFromMillis:()=>Or,DateTimeUtcFromDate:()=>Br,DateTimeUtc:()=>d2,DateFromString:()=>ll,Date:()=>nK,Class:()=>LM,Chunk:()=>cl,Char:()=>Cl,CauseReason:()=>kK,Cause:()=>yK,BooleanFromBit:()=>Vr,Boolean:()=>UN,BigIntFromString:()=>Jr,BigInt:()=>v2,BigDecimalFromString:()=>sl,BigDecimal:()=>$M,ArrayEnsure:()=>Pu,Array:()=>f0,Any:()=>Vu});var iD=/^[+-]?\d+$/,k$="~effect/BigDecimal",rx={[k$]:k$,[K0](){let Q=g$(this);return u0(t(Q.value),p8(Q.scale))},[W0](Q){return b$(Q)&&nx(this,Q)},toString(){return`BigDecimal(${k8(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},b$=(Q)=>N(Q,k$),v6=(Q,X)=>{let Y=Object.create(rx);return Y.value=Q,Y.scale=X,Y},sD=(Q,X)=>{if(Q!==v8&&Q%y$===v8)throw RangeError("Value must be normalized");let Y=v6(Q,X);return Y.normalized=Y,Y},v8=BigInt(0);var y$=BigInt(10),tD=sD(v8,0);var g$=(Q)=>{if(Q.normalized===void 0)if(Q.value===v8)Q.normalized=tD;else{let X=`${Q.value}`,Y=0;for(let G=X.length-1;G>=0;G--)if(X[G]==="0")Y++;else break;if(Y===0)Q.normalized=Q;let J=BigInt(X.substring(0,X.length-Y)),$=Q.scale-Y;Q.normalized=sD(J,$)}return Q.normalized},a7=B(2,(Q,X)=>{if(X>Q.scale)return v6(Q.value*y$**BigInt(X-Q.scale),X);if(X<Q.scale)return v6(Q.value/y$**BigInt(Q.scale-X),X);return Q});var d5=S9((Q,X)=>{let Y=U1(aD(Q),aD(X));if(Y!==0)return Y;if(Q.scale>X.scale)return T8(Q.value,a7(X,Q.scale).value);if(Q.scale<X.scale)return T8(a7(Q,X.scale).value,X.value);return T8(Q.value,X.value)});var aD=(Q)=>Q.value===v8?0:Q.value<v8?-1:1,ox=(Q)=>Q.value<v8?v6(-Q.value,Q.scale):Q;var h$=i0((Q,X)=>{if(Q.scale>X.scale)return a7(X,Q.scale).value===Q.value;if(Q.scale<X.scale)return a7(Q,X.scale).value===X.value;return Q.value===X.value}),nx=B(2,(Q,X)=>h$(Q,X));var eD=(Q)=>{if(Q==="")return F(tD);let X,Y,J=Q.search(/[eE]/);if(J!==-1){let W=Q.slice(J+1);if(X=Q.slice(0,J),Y=Number(W),X===""||!Number.isSafeInteger(Y)||!iD.test(W))return b()}else X=Q,Y=0;let $,G,Z=X.search(/\./);if(Z!==-1){let W=X.slice(0,Z),H=X.slice(Z+1);$=`${W}${H}`,G=H.length}else $=X,G=0;if(!iD.test($))return b();let K=G-Y;if(!Number.isSafeInteger(K))return b();return F(v6(BigInt($),K))};var k8=(Q)=>{let X=g$(Q);if(Math.abs(X.scale)>=16)return ix(X);let Y=X.value<v8,J=Y?`${X.value}`.substring(1):`${X.value}`,$,G;if(X.scale>=J.length)$="0",G="0".repeat(X.scale-J.length)+J;else{let K=J.length-X.scale;if(K>J.length){let W=K-J.length;$=`${J}${"0".repeat(W)}`,G=""}else G=J.slice(K),$=J.slice(0,K)}let Z=G===""?$:`${$}.${G}`;return Y?`-${Z}`:Z},ix=(Q)=>{if(ax(Q))return"0e+0";let X=g$(Q),Y=`${ox(X).value}`,J=Y.slice(0,1),$=Y.slice(1),G=`${sx(X)?"-":""}${J}`;if($!=="")G+=`.${$}`;let Z=$.length-X.scale;return`${G}e${Z>=0?"+":""}${Z}`};var ax=(Q)=>Q.value===v8,sx=(Q)=>Q.value<v8;var XB="~effect/collections/Chunk";function tx(Q,X,Y,J,$){for(let G=X;G<Math.min(Q.length,X+$);G++)Y[J+G-X]=Q[G];return Y}var YB=[],d$=(Q)=>i0((X,Y)=>X.length===Y.length&&AQ(X).every((J,$)=>Q(J,wQ(Y,$)))),ex=d$(n),Qv={[XB]:{_A:(Q)=>Q},toString(){return`Chunk(${v(AQ(this))})`},toJSON(){return{_id:"Chunk",values:K1(AQ(this))}},[n0](){return this.toJSON()},[W0](Q){return s7(Q)&&ex(this,Q)},[K0](){return A9(AQ(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return YB[Symbol.iterator]();default:return AQ(this)[Symbol.iterator]()}},pipe(){return X0(this,arguments)}},p$=(Q)=>{let X=Object.create(Qv);switch(X.backing=Q,Q._tag){case"IEmpty":{X.length=0,X.depth=0,X.left=X,X.right=X;break}case"IConcat":{X.length=Q.left.length+Q.right.length,X.depth=1+Math.max(Q.left.depth,Q.right.depth),X.left=Q.left,X.right=Q.right;break}case"IArray":{X.length=Q.array.length,X.depth=0,X.left=J4,X.right=J4;break}case"ISingleton":{X.length=1,X.depth=0,X.left=J4,X.right=J4;break}case"ISlice":{X.length=Q.length,X.depth=Q.chunk.depth+1,X.left=J4,X.right=J4;break}}return X},s7=(Q)=>N(Q,XB),J4=p$({_tag:"IEmpty"}),Xv=()=>J4;var Yv=(Q)=>p$({_tag:"ISingleton",a:Q}),t7=(Q)=>s7(Q)?Q:$v(W1(Q)),m$=(Q,X,Y)=>{switch(Q.backing._tag){case"IArray":{tx(Q.backing.array,0,X,Y,Q.length);break}case"IConcat":{m$(Q.left,X,Y),m$(Q.right,X,Y+Q.left.length);break}case"ISingleton":{X[Y]=Q.backing.a;break}case"ISlice":{let J=0,$=Y;while(J<Q.length)X[$]=wQ(Q,J),J+=1,$+=1;break}}};var Jv=(Q)=>{switch(Q.backing._tag){case"IEmpty":return YB;case"IArray":return Q.backing.array;default:{let X=Array(Q.length);return m$(Q,X,0),Q.backing={_tag:"IArray",array:X},Q.left=J4,Q.right=J4,Q.depth=0,X}}},AQ=Jv;var $v=(Q)=>Q.length===0?Xv():Q.length===1?Yv(Q[0]):p$({_tag:"IArray",array:Q});var wQ=B(2,(Q,X)=>{let Y=Math.floor(X);switch(Q.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${Y}`);case"ISingleton":{if(X!==0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.a}case"IArray":{if(Y>=Q.length||Y<0)throw Error(`Index out of bounds: ${Y}`);return Q.backing.array[Y]}case"IConcat":return Y<Q.left.length?wQ(Q.left,Y):wQ(Q.right,Y-Q.left.length);case"ISlice":return wQ(Q.backing.chunk,Y+Q.backing.offset)}});var JB=(Q)=>Q.length;var c$=y5,$B=E6,GB=sq,ZB=tq,KB=eq,WB=$$,f$=QD;var HB=k5;var VB=K$;var e7=XD,_B=YD;var QY=JD;var u$=W$,CQ=DQ,qB=H$;var DB=V$,p4=$D;var BB=BQ;var UB=D$;var OB=ZD;var XY=U$;var zB="~effect/encoding/EncodingError";class c4 extends rq("EncodingError"){[zB]=zB}var JY=(Q)=>typeof Q==="string"?r$(i$.encode(Q)):r$(Q),p5=(Q)=>{let X=TB(Q),Y=X.length;if(Y%4!==0)return f(new c4({kind:"Decode",module:"Base64",input:X,message:`Length must be a multiple of 4, but is ${Y}`}));let J=X.indexOf("=");if(J!==-1&&(J<Y-2||J===Y-2&&X[Y-1]!=="="))return f(new c4({kind:"Decode",module:"Base64",input:X,message:"Found a '=' character, but it is not at the end"}));try{let $=X.endsWith("==")?2:X.endsWith("=")?1:0,G=new Uint8Array(3*(Y/4)-$);for(let Z=0,K=0;Z<Y;Z+=4,K+=3){let W=YY(X.charCodeAt(Z))<<18|YY(X.charCodeAt(Z+1))<<12|YY(X.charCodeAt(Z+2))<<6|YY(X.charCodeAt(Z+3));G[K]=W>>16,G[K+1]=W>>8&255,G[K+2]=W&255}return l(G)}catch($){return f(new c4({kind:"Decode",module:"Base64",input:X,message:$ instanceof Error?$.message:"Invalid input"}))}},NB=(Q)=>F6(p5(Q),(X)=>a$.decode(X)),MB=(Q)=>typeof Q==="string"?LB(i$.encode(Q)):LB(Q),o$=(Q)=>{let X=TB(Q),Y=X.length;if(Y%4===1)return f(new c4({module:"Base64Url",kind:"Decode",input:X,message:`Length should be a multiple of 4, but is ${Y}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(X))return f(new c4({module:"Base64Url",kind:"Decode",input:X,message:"Invalid input"}));let J=Y%4===2?`${X}==`:Y%4===3?`${X}=`:X;return J=J.replace(/-/g,"+").replace(/_/g,"/"),p5(J)},AB=(Q)=>F6(o$(Q),(X)=>a$.decode(X)),wB=(Q)=>typeof Q==="string"?PB(i$.encode(Q)):PB(Q),n$=(Q)=>{let X=new TextEncoder().encode(Q);if(X.length%2!==0)return f(new c4({module:"Hex",kind:"Decode",input:Q,message:`Length must be a multiple of 2, but is ${X.length}`}));try{let Y=X.length/2,J=new Uint8Array(Y);for(let $=0;$<Y;$++){let G=RB(X[$*2]),Z=RB(X[$*2+1]);J[$]=G<<4|Z}return l(J)}catch(Y){return f(new c4({module:"Hex",kind:"Decode",input:Q,message:Y instanceof Error?Y.message:"Invalid input"}))}},CB=(Q)=>F6(n$(Q),(X)=>a$.decode(X)),i$=new TextEncoder,a$=new TextDecoder,TB=(Q)=>Q.replace(/[\n\r]/g,""),r$=(Q)=>{let X=Q.length,Y="",J;for(J=2;J<X;J+=3)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4|Q[J-1]>>4],Y+=$4[(Q[J-1]&15)<<2|Q[J]>>6],Y+=$4[Q[J]&63];if(J===X+1)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4],Y+="==";if(J===X)Y+=$4[Q[J-2]>>2],Y+=$4[(Q[J-2]&3)<<4|Q[J-1]>>4],Y+=$4[(Q[J-1]&15)<<2],Y+="=";return Y};function YY(Q){if(Q>=FB.length)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);let X=FB[Q];if(X===255)throw TypeError(`Invalid character ${String.fromCharCode(Q)}`);return X}var $4=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],FB=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],LB=(Q)=>r$(Q).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),PB=(Q)=>{let X="";for(let Y=0;Y<Q.length;++Y)X+=Zv[Q[Y]];return X},RB=(Q)=>{if(48<=Q&&Q<=57)return Q-48;if(97<=Q&&Q<=102)return Q-97+10;if(65<=Q&&Q<=70)return Q-65+10;throw TypeError("Invalid input")},Zv=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var GY="~effect/collections/HashMap",q8=5,EQ=1<<q8,Kv=EQ/4,jB=EQ/2,Wv=EQ-1,Hv=(Q)=>{return Q=Q-(Q>>>1&1431655765),Q=(Q&858993459)+(Q>>>2&858993459),(Q+(Q>>>4)&252645135)*16843009>>>24},TQ=(Q,X)=>Q>>>X&Wv,f4=(Q,X)=>1<<TQ(Q,X),$Y=(Q,X)=>Hv(Q&X-1);function EB(Q,X,Y,J,$,G){if(X>32)throw Error("HashMap: max depth exceeded");let Z=f4(Y,X),K=f4($,X);if(Z===K){let _=EB(Q,X+q8,Y,J,$,G);return new y8(Q,Z,[_])}let W=Z|K,H=Z>>>0<K>>>0?[J,G]:[G,J];return new y8(Q,W,H)}class c5{canEdit(Q){return this.edit===Q}}class SB extends c5{_tag="EmptyNode";edit=0;get size(){return 0}get(Q,X,Y){return b()}has(Q,X,Y){return!1}set(Q,X,Y,J,$,G){return G.value=!0,new G4(Q,Y,J,$)}remove(Q,X,Y,J,$){return this}iterator(){return[][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}canEdit(Q){return!1}}class G4 extends c5{_tag="LeafNode";edit;hash;key;value;constructor(Q,X,Y,J){super();this.edit=Q,this.hash=X,this.key=Y,this.value=J}get size(){return 1}get(Q,X,Y){if(this.hash===X&&n(this.key,Y))return F(this.value);return b()}has(Q,X,Y){return this.hash===X&&n(this.key,Y)}set(Q,X,Y,J,$,G){if(this.hash===Y&&n(this.key,J)){if(n(this.value,$))return this;if(this.canEdit(Q))return this.value=$,this;return new G4(Q,Y,J,$)}if(G.value=!0,this.hash===Y)return new IQ(Q,Y,[[this.key,this.value],[J,$]]);let Z=f4(Y,X),K=f4(this.hash,X);if(Z===K)return new y8(Q,Z,[this.set(Q,X+q8,Y,J,$,G)]);let W=Z|K,H=Z>>>0<K>>>0?[new G4(Q,Y,J,$),this]:[this,new G4(Q,Y,J,$)];return new y8(Q,W,H)}remove(Q,X,Y,J,$){if(this.hash===Y&&n(this.key,J)){$.value=!0;return}return this}iterator(){return[[this.key,this.value]][Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class IQ extends c5{_tag="CollisionNode";edit;hash;entries;constructor(Q,X,Y){super();this.edit=Q,this.hash=X,this.entries=Y}get size(){return this.entries.length}get(Q,X,Y){if(this.hash!==X)return b();for(let[J,$]of this.entries)if(n(J,Y))return F($);return b()}has(Q,X,Y){if(this.hash!==X)return!1;for(let[J]of this.entries)if(n(J,Y))return!0;return!1}set(Q,X,Y,J,$,G){if(this.hash!==Y)return G.value=!0,EB(Q,X,this.hash,this,Y,new G4(Q,Y,J,$));for(let Z=0;Z<this.entries.length;Z++)if(n(this.entries[Z][0],J)){if(n(this.entries[Z][1],$))return this;if(this.canEdit(Q))return this.entries[Z]=[J,$],this;let K=[...this.entries];return K[Z]=[J,$],new IQ(Q,this.hash,K)}if(G.value=!0,this.canEdit(Q))return this.entries.push([J,$]),this;return new IQ(Q,this.hash,[...this.entries,[J,$]])}remove(Q,X,Y,J,$){if(this.hash!==Y)return this;let G=this.entries.findIndex(([K])=>n(K,J));if(G===-1)return this;if($.value=!0,this.entries.length===1)return;if(this.entries.length===2){let K=this.entries[G===0?1:0];return new G4(Q,this.hash,K[0],K[1])}if(this.canEdit(Q))return this.entries.splice(G,1),this;let Z=[...this.entries];return Z.splice(G,1),new IQ(Q,this.hash,Z)}iterator(){return this.entries[Symbol.iterator]()}[Symbol.iterator](){return this.iterator()}}class y8 extends c5{_tag="IndexedNode";edit;_size;bitmap;children;constructor(Q,X,Y){super();this.edit=Q,this.bitmap=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+X.size,0);return this._size}get(Q,X,Y){let J=f4(X,Q);if((this.bitmap&J)===0)return b();let $=$Y(this.bitmap,J);return this.children[$].get(Q+q8,X,Y)}has(Q,X,Y){let J=f4(X,Q);if((this.bitmap&J)===0)return!1;let $=$Y(this.bitmap,J);return this.children[$].has(Q+q8,X,Y)}set(Q,X,Y,J,$,G){let Z=f4(Y,X),K=$Y(this.bitmap,Z);if((this.bitmap&Z)!==0){let W=this.children[K],H=W.set(Q,X+q8,Y,J,$,G);if(W===H)return this;if(this.canEdit(Q))return this.children[K]=H,this;let _=[...this.children];return _[K]=H,new y8(Q,this.bitmap,_)}else{G.value=!0;let W=new G4(Q,Y,J,$),H=this.bitmap|Z;if(this.canEdit(Q)){if(this.children.splice(K,0,W),this.bitmap=H,this._size=void 0,this.children.length>jB)return this.expand(Q,H,this.children);return this}let _=[...this.children];if(_.splice(K,0,W),_.length>jB)return this.expand(Q,H,_);return new y8(Q,H,_)}}remove(Q,X,Y,J,$){let G=f4(Y,X);if((this.bitmap&G)===0)return this;let Z=$Y(this.bitmap,G),K=this.children[Z],W=K.remove(Q,X+q8,Y,J,$);if(!$.value)return this;if(W===void 0){let _=this.bitmap^G;if(_===0)return;if(this.children.length===2){let q=this.children[Z===0?1:0];if(q._tag==="LeafNode")return q}if(this.canEdit(Q))return this.children.splice(Z,1),this.bitmap=_,this._size=void 0,this;let V=[...this.children];return V.splice(Z,1),new y8(Q,_,V)}if(K===W)return this;if(this.canEdit(Q))return this.children[Z]=W,this;let H=[...this.children];return H[Z]=W,new y8(Q,this.bitmap,H)}expand(Q,X,Y){let J=new globalThis.Array(EQ),$=0;for(let G=0;G<EQ;G++)if((X&1<<G)!==0)J[G]=Y[$++];return new jQ(Q,Y.length,J)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){if(!X)X=this.children[Q].iterator();let Y=X.next();if(!Y.done)return Y;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class jQ extends c5{_tag="ArrayNode";edit;_size;count;children;constructor(Q,X,Y){super();this.edit=Q,this.count=X,this.children=Y}get size(){if(this._size===void 0)this._size=this.children.reduce((Q,X)=>Q+(X?.size??0),0);return this._size}get(Q,X,Y){let J=TQ(X,Q),$=this.children[J];return $?$.get(Q+q8,X,Y):b()}has(Q,X,Y){let J=TQ(X,Q),$=this.children[J];return $?$.has(Q+q8,X,Y):!1}set(Q,X,Y,J,$,G){let Z=TQ(Y,X),K=this.children[Z];if(K){let W=K.set(Q,X+q8,Y,J,$,G);if(K===W)return this;if(this.canEdit(Q))return this.children[Z]=W,this;let H=[...this.children];return H[Z]=W,new jQ(Q,this.count,H)}else{G.value=!0;let W=new G4(Q,Y,J,$);if(this.canEdit(Q))return this.children[Z]=W,this.count++,this._size=void 0,this;let H=[...this.children];return H[Z]=W,new jQ(Q,this.count+1,H)}}remove(Q,X,Y,J,$){let G=TQ(Y,X),Z=this.children[G];if(!Z)return this;let K=Z.remove(Q,X+q8,Y,J,$);if(!$.value)return this;let W=this.count-(K?0:1);if(W<Kv)return this.pack(Q,G,K);if(Z===K)return this;if(this.canEdit(Q)){if(this.children[G]=K,!K)this.count=W;return this._size=void 0,this}let H=[...this.children];return H[G]=K,new jQ(Q,W,H)}pack(Q,X,Y){let J=[],$=0,G=1;for(let Z=0;Z<this.children.length;Z++){let K=Z===X?Y:this.children[Z];if(K)J.push(K),$|=G;G<<=1}return new y8(Q,$,J)}iterator(){let Q=0,X;return{next:()=>{while(Q<this.children.length){let Y=this.children[Q];if(!Y){Q++;continue}if(!X)X=Y.iterator();let J=X.next();if(!J.done)return J;X=void 0,Q++}return{done:!0,value:void 0}}}}[Symbol.iterator](){return this.iterator()}}class ZY{[GY]=GY;_editable;_edit;_root;_size;constructor(Q,X,Y,J){this._editable=Q,this._edit=X,this._root=Y,this._size=J}get size(){return this._size}[Symbol.iterator](){return this._root.iterator()}[W0](Q){if(s$(Q)){let X=Q;if(this.size!==X.size)return!1;for(let[Y,J]of this){let $=a2(Q,kB(Y));if(I0($)||!n(J,$.value))return!1}return!0}return!1}[K0](){let Q=T0("HashMap");for(let[X,Y]of this)Q=Q^t(X)+t(Y);return Q}[n0](){return K1(this)}toString(){return`HashMap(${v(Array.from(this))})`}toJSON(){return{_id:"HashMap",values:Array.from(this).map(([Q,X])=>[K1(Q),K1(X)])}}pipe(){return X0(this,arguments)}}var xB=new SB,s$=(Q)=>N(Q,GY),t$=()=>new ZY(!1,0,xB,0);var vB=(Q)=>{let X=xB,Y=0,J={value:!1};for(let[$,G]of Q){let Z=t($);if(J.value=!1,X=X.set(NaN,0,Z,$,G,J),J.value)Y++}return new ZY(!1,0,X,Y)};var kB=B(2,(Q,X)=>{return Q._root.get(0,t(X),X)});var e$=B(2,(Q,X)=>{return Q._root.has(0,t(X),X)});var QG=B(3,(Q,X,Y)=>{let J=Q,$=t(X),G={value:!1},Z=J._editable?J._edit:NaN,K=J._root.set(Z,0,$,X,Y,G);if(J._editable){if(J._root=K,G.value)J._size++;return Q}if(J._root===K)return Q;return new ZY(!1,J._edit,K,J._size+(G.value?1:0))}),XG=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){let Y=X.next();if(Y.done)return{done:!0,value:void 0};return{done:!1,value:Y.value[0]}}}};var yB=(Q)=>{let X=Q[Symbol.iterator]();return{[Symbol.iterator](){return this},next(){return X.next()}}},KY=(Q)=>Q.size;var gB=s$;var WY=vB;var qv=yB,HY=(Q)=>Array.from(qv(Q)),hB=KY;var SQ="~effect/collections/HashSet",Bv={[K0](){return t(SQ)},[W0](Q){return YG(Q)&&VY(this)===VY(Q)&&pB(this,(X)=>dB(Q,X))},[Symbol.iterator](){return XG(JG(this))},toString(){return`HashSet(${v(Array.from(this))})`},toJSON(){return{_id:"HashSet",values:K1(Array.from(this))}},[n0](){return this.toJSON()},pipe(){return X0(this,arguments)}},Uv=(Q)=>{let X=Object.create(Bv);return X[SQ]=SQ,X.keyMap=Q,X},YG=(Q)=>N(Q,SQ),JG=(Q)=>Q.keyMap;var mB=(Q)=>{let X=t$();for(let Y of Q)X=QG(X,Y,!0);return Uv(X)},dB=(Q,X)=>e$(JG(Q),X);var VY=(Q)=>KY(JG(Q));var pB=(Q,X)=>{for(let Y of Q)if(!X(Y))return!1;return!0};var _Y=mB,cB=YG;var fB=VY;function D8(Q){return Q.checks?Q.checks[Q.checks.length-1].annotations:Q.annotations}function qY(Q){return(X)=>D8(X)?.[Q]}var f5=qY("identifier"),$G=qY("title");var uB=qY("brands"),DY=p0((Q)=>{let X=f5(Q);if(typeof X==="string")return X;return Q.getExpected(DY)});var w00=globalThis.Boolean;var lB=o8((Q,X)=>Q||X,!1);function u5(Q,X,Y){if(X==="__proto__")Object.defineProperty(Q,X,{value:Y,writable:!0,enumerable:!0,configurable:!0});else Q[X]=Y;return Q}var C00=globalThis.RegExp;var BY=(Q)=>Q.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var y6=new WeakMap,oB=(Q)=>{if(y6.has(Q))return y6.get(Q);else throw Error("Unable to get redacted value"+(Q.label?` with label: "${Q.label}"`:""))};var nB="~effect/data/Redacted",GG=(Q)=>N(Q,nB),Z4=(Q,X)=>{let Y=Object.create(Rv);if(X?.label)Y.label=X.label;return y6.set(Y,Q),Y},Rv={[nB]:{_A:(Q)=>Q},label:void 0,...c8,toJSON(){return this.toString()},toString(){return`<redacted${X8(this.label)?":"+this.label:""}>`},[K0](){return t(y6.get(this))},[W0](Q){return GG(Q)&&n(y6.get(this),y6.get(Q))}},l5=oB;var iB=(Q)=>i0((X,Y)=>Q(l5(X),l5(Y)));var ZG="~effect/SchemaIssue/Issue";function Nv(Q){return N(Q,ZG)}class t1{[ZG]=ZG;toString(){return Av(this)}}class OY extends t1{_tag="Filter";actual;filter;issue;constructor(Q,X,Y){super();this.actual=Q,this.filter=X,this.issue=Y}}class HG extends t1{_tag="Encoding";ast;actual;issue;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issue=Y}}class A0 extends t1{_tag="Pointer";path;issue;constructor(Q,X){super();this.path=Q,this.issue=X}}class kQ extends t1{_tag="MissingKey";annotations;constructor(Q){super();this.annotations=Q}}class zY extends t1{_tag="UnexpectedKey";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class q0 extends t1{_tag="Composite";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class v0 extends t1{_tag="InvalidType";ast;actual;constructor(Q,X){super();this.ast=Q,this.actual=X}}class Z0 extends t1{_tag="InvalidValue";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class r5 extends t1{_tag="Forbidden";actual;annotations;constructor(Q,X){super();this.actual=Q,this.annotations=X}}class FY extends t1{_tag="AnyOf";ast;actual;issues;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.issues=Y}}class VG extends t1{_tag="OneOf";ast;actual;successes;constructor(Q,X,Y){super();this.ast=Q,this.actual=X,this.successes=Y}}function KG(Q,X){if(Nv(X))return X;if(typeof X==="string")return new Z0(F(Q),{message:X});let Y=typeof X.issue==="string"?new Z0(F(Q),{message:X.issue}):X.issue;return new A0(X.path,Y)}function tB(Q,X){if(X===void 0)return;if(typeof X==="boolean")return X?void 0:new Z0(F(Q));return KG(Q,X)}function eB(Q,X,Y){if(Array.isArray(Y)){if(L6(Y)){if(Y.length===1)return KG(Q,Y[0]);return new q0(X,F(Q),E4(Y,(J)=>KG(Q,J)))}return}return tB(Q,Y)}var QU=(Q)=>{let X=vQ(Q);if(X!==void 0)return X;switch(Q._tag){case"InvalidType":return WG(DY(Q.ast),sB(Q.actual));case"InvalidValue":return`Invalid data ${sB(Q.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${v(Q.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${v(Q.actual)}`}},XU=(Q)=>{return vQ(Q.issue)??vQ(Q)};function YU(Q){return(X)=>({issues:b6(X,[],Q?.leafHook??QU,Q?.checkHook??XU)})}function WG(Q,X){return`Expected ${Q}, got ${X}`}function b6(Q,X,Y,J){switch(Q._tag){case"Filter":{let $=J(Q);if($!==void 0)return[{path:X,message:$}];switch(Q.issue._tag){case"InvalidValue":return[{path:X,message:WG(JU(Q.filter),v(Q.actual))}];default:return b6(Q.issue,X,Y,J)}}case"Encoding":return b6(Q.issue,X,Y,J);case"Pointer":return b6(Q.issue,[...X,...Q.path],Y,J);case"Composite":return Q.issues.flatMap(($)=>b6($,X,Y,J));case"AnyOf":{let $=vQ(Q);if(Q.issues.length===0){if($!==void 0)return[{path:X,message:$}];let G=WG(DY(Q.ast),v(Q.actual));return[{path:X,message:G}]}return Q.issues.flatMap((G)=>b6(G,X,Y,J))}default:return[{path:X,message:Y(Q)}]}}function JU(Q){let X=Q.annotations?.expected;if(typeof X==="string")return X;switch(Q._tag){case"Filter":return"<filter>";case"FilterGroup":return Q.checks.map((Y)=>JU(Y)).join(" & ")}}function Mv(){return(Q)=>b6(Q,[],QU,XU).map(wv).join(`
27
+ `)}var Av=Mv();function wv(Q){let X=Q.message;if(Q.path&&Q.path.length>0){let Y=vX(Q.path);X+=`
28
+ at ${Y}`}return X}function vQ(Q){switch(Q._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return xQ(Q.ast.annotations);case"InvalidValue":case"Forbidden":return xQ(Q.annotations);case"MissingKey":return xQ(Q.annotations,"messageMissingKey");case"UnexpectedKey":return xQ(Q.ast.annotations,"messageUnexpectedKey");case"Filter":return xQ(Q.filter.annotations);case"Encoding":return vQ(Q.issue)}}function xQ(Q,X="message"){let Y=Q?.[X];if(typeof Y==="string")return Y}function sB(Q){if(I0(Q))return"no value provided";return v(Q.value)}function UY(Q){switch(Q._tag){case"MissingKey":return Q;case"Forbidden":return new r5(I4(Q.actual,Z4),Q.annotations);case"Filter":return new OY(Z4(Q.actual),Q.filter,UY(Q.issue));case"Pointer":return new A0(Q.path,UY(Q.issue));case"Encoding":case"InvalidType":case"InvalidValue":case"Composite":return new Z0(I4(Q.actual,Z4));case"AnyOf":case"OneOf":case"UnexpectedKey":return new Z0(F(Z4(Q.actual)))}}class K4 extends K6{run;constructor(Q){super();this.run=Q}map(Q){return new K4((X,Y)=>this.run(X,Y).pipe(x6(I4(Q))))}compose(Q){if($U(this))return Q;if($U(Q))return this;return new K4((X,Y)=>this.run(X,Y).pipe(_8((J)=>Q.run(J,Y))))}}function Cv(Q){return new K4((X)=>y(Q(X)))}function _G(Q){return Cv((X)=>new r5(X,{message:Q(X)}))}var GU=new K4(h);function $U(Q){return Q.run===GU.run}function b1(){return GU}function qG(Q){return new K4((X,Y)=>I0(X)?x8:Q(X.value,Y))}function r(Q){return LY(I4(Q))}function I1(Q){return qG((X,Y)=>Q(X,Y).pipe(x6(F)))}function LY(Q){return new K4((X)=>h(Q(X)))}function DG(){return new K4(()=>x8)}function bQ(Q){return new K4((X)=>{let Y=O5(X,Z1);return O1(Y)?h(Y):x6(Q,F)})}function g6(){return r(globalThis.String)}function PY(){return r(globalThis.Number)}function ZU(){return r(globalThis.BigInt)}function KU(){return r((Q)=>new globalThis.Date(Q))}function WU(){return r(_D)}function HU(Q){return qG((X)=>m4({try:()=>F(JSON.parse(X,Q?.reviver)),catch:(Y)=>new Z0(F(X),{message:globalThis.String(Y)})}))}function VU(Q){return qG((X)=>m4({try:()=>F(JSON.stringify(X,Q?.replacer,Q?.space)),catch:(Y)=>new Z0(F(X),{message:globalThis.String(Y)})}))}function _U(Q){let X=Q?.separator??",";return r((Y)=>Y===""?[]:Y.split(X))}function BG(){return r(JY)}function RY(){return r(MB)}function NY(){return r(wB)}function qU(){return I1((Q)=>X1(I$(p5(Q)),(X)=>new Z0(F(Q),{message:X.message})))}function DU(){return I1((Q)=>o1(NB(Q),{onFailure:(X)=>y(new Z0(F(Q),{message:X.message})),onSuccess:h}))}function BU(){return I1((Q)=>o1(o$(Q),{onFailure:(X)=>y(new Z0(F(Q),{message:X.message})),onSuccess:h}))}function UU(){return I1((Q)=>o1(AB(Q),{onFailure:(X)=>y(new Z0(F(Q),{message:X.message})),onSuccess:h}))}function OU(){return I1((Q)=>o1(n$(Q),{onFailure:(X)=>y(new Z0(F(Q),{message:X.message})),onSuccess:h}))}function zU(){return I1((Q)=>o1(CB(Q),{onFailure:(X)=>y(new Z0(F(Q),{message:X.message})),onSuccess:h}))}function FU(){return r(encodeURIComponent)}function LU(){return I1((Q)=>{try{return h(globalThis.decodeURIComponent(Q))}catch(X){return y(new Z0(F(Q),{message:X instanceof URIError?X.message:"Invalid URI component"}))}})}function UG(){return I1((Q)=>{return E1(e7(Q),{onNone:()=>y(new Z0(F(Q),{message:"Invalid DateTime input"})),onSome:(X)=>h(QY(X))})})}function PU(){return r((Q)=>AU(Array.from(Q.entries())))}var Tv=wU((Q)=>typeof Q==="string"||typeof Blob<"u"&&Q instanceof Blob);function RU(){return r((Q)=>{let X=new FormData;if(typeof Q==="object"&&Q!==null)Tv(Q).forEach(([J,$])=>{X.append(J,$)});return X})}function NU(){return r((Q)=>AU(Array.from(Q.entries())))}var Iv=wU(X8);function MU(){return r((Q)=>{if(typeof Q==="object"&&Q!==null)return new URLSearchParams(Iv(Q));return new URLSearchParams})}var jv=/^\d+$/;function Ev(Q){if(Q==="")return[""];let X=Q.replace(/\[(.*?)\]/g,".$1"),Y=X.split("."),J=X.startsWith(".")?1:0;return Y.slice(J).map(($)=>jv.test($)?globalThis.Number($):$)}function AU(Q){let X={};return Q.forEach(([Y,J])=>{let $=Ev(Y),G=X;$.forEach((Z,K)=>{let W=K===$.length-1;if(Array.isArray(G)&&Z==="")if(W)G.push(J);else{let H=$[K+1],_=typeof H==="number"||H==="",V=G.length;if(G[V]===void 0)G[V]=_?[]:{};G=G[V]}else if(W)if(Array.isArray(G[Z]))G[Z].push(J);else if(Object.prototype.hasOwnProperty.call(G,Z))G[Z]=[G[Z],J];else G[Z]=J;else{let H=$[K+1],_=typeof H==="number"||H==="";if(G[Z]===void 0)G[Z]=_?[]:{};G=G[Z]}})}),X}function wU(Q){return(X)=>{let Y=[];function J($,G){if(Q(G))Y.push([$,G]);else if(Array.isArray(G))if(G.every(Q))G.forEach((K)=>{Y.push([$,K])});else G.forEach((K,W)=>{J(`${$}[${W}]`,K)});else if(typeof G==="object"&&G!==null)for(let[Z,K]of Object.entries(G))J(`${$}[${Z}]`,K)}for(let[$,G]of Object.entries(X))J($,G);return Y}}class gQ{_tag="Middleware";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new gQ(this.encode,this.decode)}}var zG="~effect/SchemaTransformation/Transformation";class H0{[zG]=zG;_tag="Transformation";decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new H0(this.encode,this.decode)}compose(Q){return new H0(this.decode.compose(Q.decode),Q.encode.compose(this.encode))}}function Sv(Q){return N(Q,zG)}var MY=(Q)=>{if(Sv(Q))return Q;return new H0(Q.decode,Q.encode)};function e1(Q){return new H0(I1(Q.decode),I1(Q.encode))}function j0(Q){return new H0(r(Q.decode),r(Q.encode))}function AY(Q){return new H0(LY(Q.decode),LY(Q.encode))}function CU(){return new H0(WU(),b1())}var xv=new H0(b1(),b1());function h6(){return xv}var o5=new H0(PY(),g6()),wY=new H0(ZU(),g6()),FG=new H0(KU(),r(H3)),TU=e1({decode:(Q)=>E1(LH(Q),{onNone:()=>y(new Z0(F(Q),{message:`Invalid Duration string: ${Q}`})),onSome:h}),encode:(Q)=>h(globalThis.String(Q))}),IU=e1({decode:(Q)=>h(a8(Q)),encode:(Q)=>E1(PH(Q),{onNone:()=>y(new Z0(F(Q),{message:`Unable to encode ${Q} into a bigint`})),onSome:(X)=>h(X)})}),jU=j0({decode:(Q)=>S4(Q),encode:(Q)=>x4(Q)}),vv=(Q)=>N1(Q)&&typeof Q.message==="string",EU=(Q)=>{let Y=Object.hasOwn(Q,"cause")?Error(Q.message,{cause:xU(Q.cause)}):Error(Q.message);if(typeof Q.name==="string"&&Q.name!=="Error")Y.name=Q.name;if(typeof Q.stack==="string")Y.stack=Q.stack;return Y},kv=(Q)=>{try{let X=V6(Q);return X===void 0?v(Q):JSON.parse(X)}catch{return v(Q)}},yv=(Q,X,Y)=>{let J={name:Q.name,message:Q.message};if(X?.includeStack&&typeof Q.stack==="string")J.stack=Q.stack;if(!X?.excludeCause&&Q.cause!==void 0)J.cause=Y(Q.cause);return J},SU=(Q)=>{let X=new WeakSet,Y=(J)=>{if(PW(J)){if(X.has(J))return"[Circular]";X.add(J);let $=yv(J,Q,Y);return X.delete(J),$}return kv(J)};return Y},xU=(Q)=>vv(Q)?EU(Q):Q,vU=(Q)=>j0({decode:EU,encode:(X)=>SU(Q)(X)}),kU=(Q)=>j0({decode:xU,encode:SU(Q)});function yU(){return j0({decode:tW,encode:L3})}function bU(){return j0({decode:sW,encode:U6})}function gU(Q){return j0({decode:aW,encode:Q?.onNoneEncoding===null?L3:U6})}function hU(){return AY({decode:F,encode:U5})}function mU(){return AY({decode:(Q)=>Q.pipe(O5(Z1),F),encode:U5})}var LG=e1({decode:(Q)=>m4({try:()=>new URL(Q),catch:()=>new Z0(F(Q),{message:`Invalid URL string: ${Q}`})}),encode:(Q)=>h(Q.href)}),PG=e1({decode:(Q)=>{let X=eD(Q);return I0(X)?y(new Z0(F(Q),{message:`Invalid BigDecimal string: ${Q}`})):h(X.value)},encode:(Q)=>h(k8(Q))}),RG=new H0(qU(),BG()),dU=new H0(DU(),BG()),pU=new H0(UU(),RY()),cU=new H0(zU(),NY()),fU=new H0(LU(),FU()),uU=new H0(HU(),VU()),lU=new H0(PU(),RU()),rU=new H0(NU(),MU()),oU=j0({decode:(Q)=>CQ(Q),encode:(Q)=>Q.offset}),NG=e1({decode:(Q)=>{return E1(qB(Q),{onNone:()=>y(new Z0(F(Q),{message:`Invalid IANA time zone: ${Q}`})),onSome:h})},encode:(Q)=>h(Q.id)}),MG=e1({decode:(Q)=>{return E1(DB(Q),{onNone:()=>y(new Z0(F(Q),{message:`Invalid time zone: ${Q}`})),onSome:h})},encode:(Q)=>h(p4(Q))}),AG=e1({decode:(Q)=>{return E1(e7(Q),{onNone:()=>y(new Z0(F(Q),{message:`Invalid UTC DateTime string: ${Q}`})),onSome:(X)=>h(QY(X))})},encode:(Q)=>h(OB(Q))}),wG=e1({decode:(Q)=>{return E1(_B(Q),{onNone:()=>y(new Z0(F(Q),{message:`Invalid Zoned DateTime string: ${Q}`})),onSome:h})},encode:(Q)=>h(XY(Q))});function d6(Q){return(X)=>X._tag===Q}function YO(Q){return N(Q,mQ)&&Q[mQ]===mQ}var b8=d6("Declaration");var bv=d6("Never");var CY=d6("Literal"),gv=d6("UniqueSymbol");var IY=d6("Arrays"),JO=d6("Objects"),jY=d6("Union");class B0{to;transformation;constructor(Q,X){this.to=Q,this.transformation=X}}var i5={};class W4{isOptional;isMutable;defaultValue;annotations;constructor(Q,X,Y=void 0,J=void 0){this.isOptional=Q,this.isMutable=X,this.defaultValue=Y,this.annotations=J}}var mQ="~effect/Schema";class k0{[mQ]=mQ;annotations;checks;encoding;context;constructor(Q=void 0,X=void 0,Y=void 0,J=void 0){this.annotations=Q,this.checks=X,this.encoding=Y,this.context=J}toString(){return`<${this._tag}>`}}class p6 extends k0{_tag="Declaration";typeParameters;run;constructor(Q,X,Y,J,$,G){super(Y,J,$,G);this.typeParameters=Q,this.run=X}getParser(){let Q=this.run(this.typeParameters);return(X,Y)=>{if(I0(X))return x8;return x6(Q(X.value,this,Y),F)}}recur(Q){let X=n5(this.typeParameters,Q);return X===this.typeParameters?this:new p6(X,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){let Q=this.annotations?.expected;if(typeof Q==="string")return Q;return"<Declaration>"}}class $O extends k0{_tag="Null";getParser(){return iQ(this,null)}getExpected(){return"null"}}var a5=new $O;class GO extends k0{_tag="Undefined";getParser(){return iQ(this,void 0)}toCodecJson(){return D0(this,[ZO])}getExpected(){return"undefined"}}var ZO=new B0(a5,new H0(r(()=>{return}),r(()=>null))),TG=new GO;class KO extends k0{_tag="Void";getParser(){return iQ(this,void 0)}toCodecJson(){return D0(this,[ZO])}getExpected(){return"void"}}var WO=new KO;class HO extends k0{_tag="Never";getParser(){return O8(this,LW)}getExpected(){return"never"}}var VO=new HO;class _O extends k0{_tag="Any";getParser(){return O8(this,t2)}getExpected(){return"any"}}var qO=new _O;class DO extends k0{_tag="Unknown";getParser(){return O8(this,t2)}getExpected(){return"unknown"}}var m6=new DO;class BO extends k0{_tag="ObjectKeyword";getParser(){return O8(this,e2)}getExpected(){return"object | array | function"}}var UO=new BO;class IG extends k0{_tag="Enum";enums;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.enums=Q}getParser(){let Q=new Set(this.enums.map(([,X])=>X));return O8(this,(X)=>Q.has(X))}toCodecStringTree(){if(this.enums.some(([Q,X])=>typeof X==="number")){let Q=Object.fromEntries(this.enums.map(([X,Y])=>[globalThis.String(Y),Y]));return D0(this,[new B0(new h1(Object.keys(Q).map((X)=>new g1(X)),"anyOf"),new H0(r((X)=>Q[X]),g6()))])}return this}getExpected(){return this.enums.map(([Q,X])=>JSON.stringify(X)).join(" | ")}}function OO(Q){switch(Q._tag){case"String":case"Number":case"BigInt":case"Literal":case"TemplateLiteral":return!0;case"Union":return Q.types.every(OO);default:return!1}}class jG extends k0{_tag="TemplateLiteral";parts;encodedParts;constructor(Q,X,Y,J,$){super(X,Y,J,$);let G=[];for(let Z of Q){let K=Y1(Z);if(OO(K))G.push(K);else throw Error(`Invalid TemplateLiteral part ${K._tag}`)}this.parts=Q,this.encodedParts=G}getParser(Q){let X=Q(this.asTemplateLiteralParser());return(Y,J)=>a0(X(Y,J),{onSuccess:()=>Y,onFailure:($)=>new q0(this,Y,[$])})}getExpected(){return"string"}asTemplateLiteralParser(){let Q=new H4(!1,this.parts.map(fO),[]),X=pY(this);return dY(c6,Q,new H0(I1((Y)=>{let J=X.exec(Y);if(J)return h(J.slice(1,this.parts.length+1));return y(new Z0(F(Y),{message:`Expected a value matching ${X.source}, got ${v(Y)}`}))}),r((Y)=>Y.join(""))))}}class EG extends k0{_tag="UniqueSymbol";symbol;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.symbol=Q}getParser(){return iQ(this,this.symbol)}toCodecStringTree(){return D0(this,[rO])}getExpected(){return globalThis.String(this.symbol)}}class g1 extends k0{_tag="Literal";literal;constructor(Q,X,Y,J,$){super(X,Y,J,$);if(typeof Q==="number"&&!globalThis.Number.isFinite(Q))throw Error(`A numeric literal must be finite, got ${v(Q)}`);this.literal=Q}getParser(){return iQ(this,this.literal)}toCodecJson(){return typeof this.literal==="bigint"?iU(this):this}toCodecStringTree(){return typeof this.literal==="string"?this:iU(this)}getExpected(){return typeof this.literal==="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}}function iU(Q){let X=globalThis.String(Q.literal);return D0(Q,[new B0(new g1(X),new H0(r(()=>Q.literal),r(()=>X)))])}class zO extends k0{_tag="String";getParser(){return O8(this,X8)}getExpected(){return"string"}}var c6=new zO;class FO extends k0{_tag="Number";getParser(){return O8(this,M9)}toCodecJson(){if(this.checks&&(hQ(this.checks,"isFinite")||hQ(this.checks,"isInt")))return this;return D0(this,[lv])}toCodecStringTree(){if(this.checks&&(hQ(this.checks,"isFinite")||hQ(this.checks,"isInt")))return D0(this,[iv]);return D0(this,[av])}getExpected(){return"number"}}function hQ(Q,X){return Q.some((Y)=>{switch(Y._tag){case"Filter":return Y.annotations?.meta?._tag===X;case"FilterGroup":return hQ(Y.checks,X)}})}var SG=new FO;class LO extends k0{_tag="Boolean";getParser(){return O8(this,OW)}getExpected(){return"boolean"}}var PO=new LO;class RO extends k0{_tag="Symbol";getParser(){return O8(this,s2)}toCodecStringTree(){return D0(this,[rO])}getExpected(){return"symbol"}}var NO=new RO;class MO extends k0{_tag="BigInt";getParser(){return O8(this,zW)}toCodecStringTree(){return D0(this,[sv])}getExpected(){return"bigint"}}var AO=new MO;class H4 extends k0{_tag="Arrays";isMutable;elements;rest;constructor(Q,X,Y,J,$,G,Z){super(J,$,G,Z);this.isMutable=Q,this.elements=X,this.rest=Y;let K=X.findIndex(E0);if(K!==-1&&(X.slice(K+1).some((W)=>!E0(W))||Y.length>1))throw Error("A required element cannot follow an optional element. ts(1257)");if(Y.length>1&&Y.slice(1).some(E0))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(Q){let X=this,Y=X.elements.map((H)=>({ast:H,parser:Q(H)})),J=X.rest.map((H)=>({ast:H,parser:Q(H)})),$=Y.length,[G,...Z]=J,K=Z.length;function W(H,_){if(_<$)return Y[_];else if(_>=H)return Z[_-H];return G}return MQ(function*(H,_){if(H._tag==="None")return H;let V=H.value;if(!Array.isArray(V))return yield*y(new v0(X,H));let q=V.length,D={ast:X,getParser:W,oinput:H,len:q,tailThreshold:mv(q,$,K),output:new globalThis.Array(q),issues:void 0,options:_},U=xG(_?.concurrency),P=hv(D,V,{concurrency:U?.concurrency,end:X.rest.length===0?$:Math.max(q,$+K)});if(P)yield*P;if(X.rest.length===0&&q>$)for(let L=$;L<=q-1;L++){let M=new A0([L],new zY(X,V[L]));if(_.errors==="all")if(D.issues)D.issues.push(M);else D.issues=[M];else return yield*y(new q0(X,H,[M]))}if(D.issues)return yield*y(new q0(X,H,D.issues));return F(D.output)})}recur(Q){let X=n5(this.elements,Q),Y=n5(this.rest,Q);return X===this.elements&&Y===this.rest?this:new H4(this.isMutable,X,Y,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}var hv=JQ()({onItem(Q,X,Y){let J=Y<Q.len?F(X):b();return Q.getParser(Q.tailThreshold,Y).parser(J,Q.options)},step(Q,X,Y,J){if(Y._tag==="Failure")return TY(Q,Q.ast,J,Y);else if(Y.value._tag==="Some")Q.output[J]=Y.value.value;else{let $=Q.getParser(Q.tailThreshold,J);if(E0($.ast))return;let G=new A0([J],new kQ($.ast.context?.annotations));if(Q.options.errors==="all")if(Q.issues)Q.issues.push(G);else Q.issues=[G];else return v5(new q0(Q.ast,Q.oinput,[G]))}}});function mv(Q,X,Y){return Math.max(X,Q-Y)}var xG=(Q)=>{return Q=Q==="unbounded"?1/0:Q??1,Q>1?{concurrency:Q}:void 0},TY=(Q,X,Y,J)=>{let $=E8(J.cause);if(u($))return J;let G=new A0([Y],$.success);if(Q.options.errors==="all")if(Q.issues)Q.issues.push(G);else Q.issues=[G];else return v5(new q0(X,Q.oinput,[G]))},pQ="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",dv=new globalThis.RegExp(`(?:${pQ}|Infinity|-Infinity|NaN)`);function f6(Q,X){let Y=Y1(X);switch(Y._tag){case"String":return Object.keys(Q);case"TemplateLiteral":{let J=pY(Y);return Object.keys(Q).filter(($)=>J.test($))}case"Symbol":return Object.getOwnPropertySymbols(Q);case"Number":return Object.keys(Q).filter((J)=>dv.test(J));case"Union":return[...new Set(Y.types.flatMap((J)=>f6(Q,J)))];default:return[]}}class EY{name;type;constructor(Q,X){this.name=Q,this.type=X}}class SY{decode;encode;constructor(Q,X){this.decode=Q,this.encode=X}flip(){return new SY(this.encode,this.decode)}}class vG{parameter;type;merge;constructor(Q,X,Y){if(this.parameter=Q,this.type=X,this.merge=Y,E0(X)&&!hO(X))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class cQ extends k0{_tag="Objects";propertySignatures;indexSignatures;constructor(Q,X,Y,J,$,G){super(Y,J,$,G);this.propertySignatures=Q,this.indexSignatures=X;let Z=Q.map((K)=>K.name).filter((K,W,H)=>H.indexOf(K)!==W);if(Z.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(Z)}. ts(2300)`)}getParser(Q){let X=this,Y=[],J=new Set,$=[];for(let K of X.propertySignatures)Y.push(K.name),J.add(K.name),$.push({ps:K,parser:Q(K.type),name:K.name,type:K.type});let G=X.indexSignatures.length;if(X.propertySignatures.length===0&&X.indexSignatures.length===0)return O8(X,wX);let Z=G>0?JQ()({onItem:MQ(function*(K,[W,H]){let V=Q(cO(H.parameter))(F(W),K.options),q=V1(V)?V:yield*RQ(V);if(q._tag==="Failure"){let M=TY(K,X,W,q);if(M)yield*M;return}let D=F(K.input[W]),P=Q(H.type)(D,K.options),L=V1(P)?P:yield*RQ(P);if(L._tag==="Failure"){let M=TY(K,X,W,L);if(M)yield*M;return}else if(q.value._tag==="Some"&&L.value._tag==="Some"){let M=q.value.value,w=L.value.value;if(H.merge&&H.merge.decode&&Object.hasOwn(K.out,M)){let[R,i]=H.merge.decode.combine([M,K.out[M]],[M,w]);u5(K.out,R,i)}else u5(K.out,M,w)}}),step:(K,W,H)=>H._tag==="Failure"?H:void 0}):void 0;return MQ(function*(K,W){if(K._tag==="None")return K;let H=K.value;if(!(typeof H==="object"&&H!==null&&!Array.isArray(H)))return yield*y(new v0(X,K));let _={},V={ast:X,oinput:K,input:H,out:_,issues:void 0,options:W},q=W.errors==="all",D=W.onExcessProperty==="error",U=W.onExcessProperty==="preserve",P;if(X.indexSignatures.length===0&&(D||U)){P=Reflect.ownKeys(H);for(let w=0;w<P.length;w++){let R=P[w];if(!J.has(R))if(D){let i=new A0([R],new zY(X,H[R]));if(q){if(V.issues)V.issues.push(i);else V.issues=[i];continue}else return yield*y(new q0(X,K,[i]))}else u5(_,R,H[R])}}let L=xG(W?.concurrency),M=pv(V,$,L);if(M)yield*M;if(Z){let w=T3();for(let i=0;i<G;i++){let $1=X.indexSignatures[i],J5=f6(H,$1.parameter);for(let D1=0;D1<J5.length;D1++){let lA=J5[D1];w.push([lA,$1])}}let R=Z(V,w,L);if(R)yield*R}if(V.issues)return yield*y(new q0(X,K,V.issues));if(W.propertyOrder==="original"){let w=(P??Reflect.ownKeys(H)).concat(Y),R={};for(let i of w)if(Object.hasOwn(_,i))u5(R,i,_[i]);return F(R)}return F(_)})}rebuild(Q,X){let Y=n5(this.propertySignatures,($)=>{let G=Q($.type);return G===$.type?$:new EY($.name,G)}),J=n5(this.indexSignatures,($)=>{let G=Q($.parameter),Z=Q($.type),K=X?$.merge?.flip():$.merge;return G===$.parameter&&Z===$.type&&K===$.merge?$:new vG(G,Z,K)});return Y===this.propertySignatures&&J===this.indexSignatures?this:new cQ(Y,J,this.annotations,this.checks,void 0,this.context)}flip(Q){return this.rebuild(Q,!0)}recur(Q){return this.rebuild(Q,!1)}getExpected(){if(this.propertySignatures.length===0&&this.indexSignatures.length===0)return"object | array";return"object"}}var pv=JQ()({onItem(Q,X){let Y=Object.hasOwn(Q.input,X.name)?F(Q.input[X.name]):b();return X.parser(Y,Q.options)},step(Q,X,Y){if(Y._tag==="Failure")return TY(Q,Q.ast,X.name,Y);else if(Y.value._tag==="Some")u5(Q.out,X.name,Y.value.value);else if(!E0(X.type)){let J=new A0([X.name],new kQ(X.type.context?.annotations));if(Q.options.errors==="all"){if(Q.issues)Q.issues.push(J);else Q.issues=[J];return}else return v5(new q0(Q.ast,Q.oinput,[J]))}}});function cv(Q,X){if(!Q)return X.checks;if(!X.checks)return Q;return[...Q,...X.checks]}function xY(Q,X,Y){return new cQ(Reflect.ownKeys(Q).map((J)=>{return new EY(J,Q[J].ast)}),[],Y,X)}function fQ(Q){return Q.ast}function kG(Q,X=void 0){return new H4(!1,Q.map((Y)=>Y.ast),[],void 0,X)}function vY(Q,X,Y){return new h1(Q.map(fQ),X,void 0,Y)}function wO(Q,X){if(Q.encoding||X.some((G)=>G.encoding))throw Error("StructWithRest does not support encodings");let{propertySignatures:Y,indexSignatures:J,checks:$}=Q;for(let G of X)Y=Y.concat(G.propertySignatures),J=J.concat(G.indexSignatures),$=cv($,G);return new cQ(Y,J,void 0,$)}function CO(Q,X){if(Q.encoding)throw Error("TupleWithRest does not support encodings");return new H4(Q.isMutable,Q.elements,X,void 0,Q.checks)}function TO(Q){switch(Q._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return Q.propertySignatures.length||Q.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(Q.enums.map(([,X])=>typeof X)));case"Literal":return[typeof Q.literal];case"Union":return Array.from(new Set(Q.types.flatMap(TO)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function uQ(Q){switch(Q._tag){default:return[];case"Declaration":{let X=Q.annotations?.["~sentinels"];return Array.isArray(X)?X:[]}case"Objects":return Q.propertySignatures.flatMap((X)=>{let Y=X.type;if(!E0(Y)){if(CY(Y))return[{key:X.name,literal:Y.literal}];if(gv(Y))return[{key:X.name,literal:Y.symbol}]}return[]});case"Arrays":return Q.elements.flatMap((X,Y)=>{return CY(X)&&!E0(X)?[{key:Y,literal:X.literal}]:[]});case"Suspend":return uQ(Q.thunk())}}var aU=new WeakMap;function fv(Q){let X=aU.get(Q);if(X)return X;X={};for(let Y of Q){let J=Y1(Y);if(bv(J))continue;let $=TO(J),G=uQ(J);X.byType??={};for(let Z of $)(X.byType[Z]??=[]).push(Y);if(G.length>0){X.bySentinel??=new Map;for(let{key:Z,literal:K}of G){let W=X.bySentinel.get(Z);if(!W)X.bySentinel.set(Z,W=new Map);let H=W.get(K);if(!H)W.set(K,H=[]);H.push(Y)}}else{X.otherwise??={};for(let Z of $)(X.otherwise[Z]??=[]).push(Y)}}return aU.set(Q,X),X}function sU(Q){return(X)=>{let Y=Y1(X);return Y._tag==="Literal"?Y.literal===Q:Y._tag==="UniqueSymbol"?Y.symbol===Q:!0}}function lQ(Q,X){let Y=fv(X),J=Q===null?"null":Array.isArray(Q)?"array":typeof Q;if(Y.bySentinel){let $=Y.otherwise?.[J]??[];if(J==="object"||J==="array"){for(let[G,Z]of Y.bySentinel)if(Object.hasOwn(Q,G)){let K=Z.get(Q[G]);if(K)return[...K,...$].filter(sU(Q))}}return $}return(Y.byType?.[J]??[]).filter(sU(Q))}class h1 extends k0{_tag="Union";types;mode;constructor(Q,X,Y,J,$,G){super(Y,J,$,G);this.types=Q,this.mode=X}getParser(Q){let X=this;return(Y,J)=>{if(Y._tag==="None")return h(Y);let $=Y.value,G=lQ($,X.types),Z={ast:X,recur:Q,oinput:Y,input:$,out:void 0,successes:[],issues:void 0,options:J},K=xG(J?.concurrency),W=uv(Z,G,K);if(!W)return Z.out?h(Z.out):y(new FY(X,$,Z.issues??[]));return PQ(W,(H)=>{return Z.out?h(Z.out):y(new FY(X,$,Z.issues??[]))})}}recur(Q){let X=n5(this.types,Q);return X===this.types?this:new h1(X,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(Q){let X=this.annotations?.expected;if(typeof X==="string")return X;if(this.types.length===0)return"never";let Y=this.types.map((J)=>{let $=Y1(J);switch($._tag){case"Arrays":{let G=$.elements.filter(CY);if(G.length>0)return`${tU($.isMutable)}[ ${G.map((Z)=>Q(Z)+eU(Z.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{let G=$.propertySignatures.filter((Z)=>CY(Z.type));if(G.length>0)return`{ ${G.map((Z)=>`${tU(Z.type.context?.isMutable)}${R4(Z.name)}${eU(Z.type.context?.isOptional)}: ${Q(Z.type)}`).join(", ")}, ... }`;break}}return Q($)});return Array.from(new Set(Y)).join(" | ")}}var uv=JQ()({onItem(Q,X){return Q.recur(X)(Q.oinput,Q.options)},step(Q,X,Y){if(Y._tag==="Failure"){let J=E8(Y.cause);if(u(J))return Y;if(Q.issues)Q.issues.push(J.success);else Q.issues=[J.success]}else{if(Q.out&&Q.ast.mode==="oneOf")return Q.successes.push(X),v5(new VG(Q.ast,Q.input,Q.successes));if(Q.out=Y.value,Q.successes.push(X),Q.ast.mode==="anyOf")return sJ}}}),IO=new h1([new g1("Infinity"),new g1("-Infinity"),new g1("NaN")],"anyOf"),lv=new B0(new h1([SG,IO],"anyOf"),new H0(PY(),r((Q)=>globalThis.Number.isFinite(Q)?Q:globalThis.String(Q))));function tU(Q){return Q?"":"readonly "}function eU(Q){return Q?"?":""}function u6(Q){let X=!1,Y;return()=>{if(X)return Y;return Y=Q(),X=!0,Y}}class kY extends k0{_tag="Suspend";thunk;constructor(Q,X,Y,J,$){super(X,Y,J,$);this.thunk=u6(Q)}getParser(Q){return Q(this.thunk())}recur(Q){return new kY(()=>Q(this.thunk()),this.annotations,this.checks,void 0,this.context)}getExpected(Q){return Q(this.thunk())}}class dQ extends K6{_tag="Filter";run;annotations;aborted;constructor(Q,X=void 0,Y=!1){super();this.run=Q,this.annotations=X,this.aborted=Y}annotate(Q){return new dQ(this.run,{...this.annotations,...Q},this.aborted)}abort(){return new dQ(this.run,this.annotations,!0)}and(Q,X){return new u4([this,Q],X)}}class u4 extends K6{_tag="FilterGroup";checks;annotations;constructor(Q,X=void 0){super();this.checks=Q,this.annotations=X}annotate(Q){return new u4(this.checks,{...this.annotations,...Q})}and(Q,X){return new u4([this,Q],X)}}function yG(Q,X,Y=!1){return new dQ((J,$,G)=>eB(J,$,Q(J,$,G)),X,Y)}function yY(Q,X){return new dQ((Y)=>Q(Y)?void 0:new Z0(F(Y)),X,!0)}function rQ(Q,X){let Y=Q.source;return yG((J)=>Q.test(J),{expected:`a string matching the RegExp ${Y}`,meta:{_tag:"isPattern",regExp:Q},toArbitraryConstraint:{string:{patterns:[Q.source]}},...X})}function bY(Q,X){let Y=Object.getOwnPropertyDescriptors(Q);return X(Y),Object.create(Object.getPrototypeOf(Q),Y)}function D0(Q,X){if(Q.encoding===X)return Q;return bY(Q,(Y)=>{Y.encoding.value=X})}function gY(Q,X){if(Q.context===X)return Q;return bY(Q,(Y)=>{Y.context.value=X})}function oQ(Q){return Q.encoding?oQ(Q.encoding[Q.encoding.length-1].to):Q}function l6(Q,X){if(Q.checks){let Y=Q.checks[Q.checks.length-1];return hY(Q,sX(Q.checks.slice(0,-1),Y.annotate(X)))}return bY(Q,(Y)=>{Y.annotations.value={...Y.annotations.value,...X}})}function hY(Q,X){if(Q.checks===X)return Q;return bY(Q,(Y)=>{Y.checks.value=X})}function l4(Q,X){return hY(Q,Q.checks?[...Q.checks,...X]:X)}function jO(Q,X){let Y=Q,J=Y[Y.length-1],$=X(J.to);if($!==J.to)return sX(Q.slice(0,Q.length-1),new B0($,J.transformation));return Q}function EO(Q){return(X)=>X.encoding?D0(X,jO(X.encoding,Q)):X}function SO(Q,X){return bG(Q,X,U8(Q))}function xO(Q,X){return bG(Y1(Q),X,Q)}function bG(Q,X,Y){let J=new B0(Q,X);return D0(Y,Y.encoding?[...Y.encoding,J]:[J])}function vO(Q,X){let Y=uB(Q),J=Y?[...Y,X]:[X];return l6(Q,{brands:J})}function n5(Q,X){let Y=!1,J=Array(Q.length);for(let $=0;$<Q.length;$++){let G=Q[$],Z=X(G);if(Z!==G)Y=!0;J[$]=Z}return Y?J:Q}function nQ(Q,X){let Y=Q.context?new W4(Q.context.isOptional,Q.context.isMutable,Q.context.defaultValue,{...Q.context.annotations,...X}):new W4(!1,!1,void 0,X);return gY(Q,Y)}var s5=EO(mY);function mY(Q){let X=Q.context?Q.context.isOptional===!1?new W4(!0,Q.context.isMutable,Q.context.defaultValue,Q.context.annotations):Q.context:new W4(!0,!1);return s5(gY(Q,X))}var rv=EO(gG);function gG(Q){let X=Q.context?Q.context.isMutable===!1?new W4(Q.context.isOptional,!0,Q.context.defaultValue,Q.context.annotations):Q.context:new W4(!1,!0);return rv(gY(Q,X))}function kO(Q,X){let Y=new H0(bQ(X),b1()),J=[new B0(m6,Y)],$=Q.context?new W4(Q.context.isOptional,Q.context.isMutable,J,Q.context.annotations):new W4(!1,!1,J);return gY(Q,$)}function dY(Q,X,Y){return bG(Q,Y,X)}function yO(Q){switch(Q._tag){case"Literal":return{literals:AX(Q.literal)?[Q.literal]:[],parameters:[]};case"UniqueSymbol":return{literals:[Q.symbol],parameters:[]};case"String":case"Number":case"Symbol":case"TemplateLiteral":return{literals:[],parameters:[Q]};case"Union":{let X={literals:[],parameters:[]};for(let Y=0;Y<Q.types.length;Y++){let J=yO(Q.types[Y]);X.literals=X.literals.concat(J.literals),X.parameters=X.parameters.concat(J.parameters)}return X}}return{literals:[],parameters:[]}}function bO(Q,X,Y){let{literals:J,parameters:$}=yO(Q);return new cQ(J.map((G)=>new EY(G,X)),$.map((G)=>new vG(G,X,Y)))}function E0(Q){return Q.context?.isOptional??!1}function gO(Q){return Q.context?.isMutable??!1}var U8=p0((Q)=>{if(Q.encoding)return U8(D0(Q,void 0));let X=Q;return X.recur?.(U8)??X}),Y1=p0((Q)=>{return U8(B8(Q))});function ov(Q,X){let Y=X,J=Y.length,$=Y[J-1],G=[new B0(B8(D0(Q,void 0)),Y[0].transformation.flip())];for(let K=1;K<J;K++)G.unshift(new B0(B8(Y[K-1].to),Y[K].transformation.flip()));let Z=B8($.to);if(Z.encoding)return D0(Z,[...Z.encoding,...G]);else return D0(Z,G)}var B8=p0((Q)=>{if(Q.encoding)return ov(Q,Q.encoding);let X=Q;return X.flip?.(B8)??X.recur?.(B8)??X});function hO(Q){switch(Q._tag){case"Undefined":return!0;case"Union":return Q.types.some(hO);default:return!1}}function mO(Q,X){return Q.encodedParts.map((Y)=>nv(Y,dO(Y),X)).join("")}var pY=p0((Q)=>{return new globalThis.RegExp(`^${mO(Q,!0)}$`)});function dO(Q){switch(Q._tag){case"Literal":return BY(globalThis.String(Q.literal));case"String":return hG;case"Number":return pQ;case"BigInt":return lO;case"TemplateLiteral":return mO(Q,!1);case"Union":return Q.types.map(dO).join("|")}}function nv(Q,X,Y){if(jY(Q)){if(!Y)return`(?:${X})`}else if(!Y)return X;return`(${X})`}function iQ(Q,X){let Y=r7(X);return(J)=>{if(J._tag==="None")return x8;return J.value===X?Y:y(new v0(Q,J))}}function O8(Q,X){return(Y)=>{if(Y._tag==="None")return x8;return X(Y.value)?h(Y):y(new v0(Q,Y))}}var pO=p0((Q)=>{return new h1(Q.enums.map((X)=>new g1(X[1],{title:X[0]})),"anyOf")});function r6(Q){function X(Y){return Y.encoding?D0(Y,jO(Y.encoding,X)):Q(Y)}return p0(X)}var cO=r6((Q)=>{switch(Q._tag){default:return Q;case"Number":return Q.toCodecStringTree();case"Union":return Q.recur(cO)}}),fO=r6((Q)=>{switch(Q._tag){default:return Q;case"String":case"TemplateLiteral":return Q;case"BigInt":case"Number":case"Literal":return Q.toCodecStringTree();case"Union":return Q.recur(fO)}}),hG="[\\s\\S]*?",QO=new globalThis.RegExp(`^${pQ}$`);function mG(Q){return rQ(QO,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:QO},...Q})}var uO=l4(c6,[mG()]),iv=new B0(uO,o5),av=new B0(new h1([uO,IO],"anyOf"),o5),lO="-?\\d+",XO=new globalThis.RegExp(`^${lO}$`);function dG(Q){return rQ(XO,{expected:"a string representing a bigint",meta:{_tag:"isStringBigInt",regExp:XO},...Q})}var pG=l4(c6,[dG({expected:"a string representing a bigint"})]),sv=new B0(pG,wY),tv="Symbol\\((.*)\\)",CG=new globalThis.RegExp(`^${tv}$`),ev=l4(c6,[cG()]),rO=new B0(ev,new H0(r((Q)=>globalThis.Symbol.for(CG.exec(Q)[1])),I1((Q)=>{if(globalThis.Symbol.keyFor(Q)!==void 0)return h(globalThis.String(Q));return y(new r5(F(Q),{message:"cannot serialize to string, Symbol is not registered"}))})));function cG(Q){return rQ(CG,{expected:"a string representing a symbol",meta:{_tag:"isStringSymbol",regExp:CG},...Q})}function aQ(Q,X,Y,J,$){for(let G=0;G<Q.length;G++){let Z=Q[G];if(Z._tag==="FilterGroup")aQ(Z.checks,X,Y,J,$);else{let K=Z.run(X,J,$);if(K){if(Y.push(new OY(X,Z,K)),Z.aborted||$?.errors!=="all")return}}}}function oO(Q,X){let Y=[];if(aQ(Q,X,Y,m6,{errors:"all"}),K8(Y)){let J=new q0(m6,F(X),Y);return f(J)}return l(X)}var t5="~effect/Schema/Class",m1="~structural";function Qk(Q){let X=new Set,Y=new Set;return J(Q);function J($){if($===null||typeof $==="string"||typeof $==="boolean")return!0;if(typeof $==="number")return globalThis.Number.isFinite($);if(typeof $!=="object"||$===void 0)return!1;if(X.has($))return!1;if(Y.has($))return!0;X.add($);let G=Array.isArray($)?$.every(J):Object.keys($).every((Z)=>J($[Z]));if(X.delete($),G)Y.add($);return G}}var cY=new p6([],()=>(Q,X)=>Qk(Q)?h(Q):y(new v0(X,F(Q))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new B0(m6,h6()),toArbitrary:()=>(Q)=>Q.jsonValue()}),nO=l6(cY,{typeConstructor:{_tag:"effect/MutableJson"},generation:{runtime:"Schema.MutableJson",Type:"Schema.MutableJson"}}),iO=new B0(a5,new H0(b1(),r(()=>null))),aO=new B0(cY,h6());function Xk(Q){let X=new Set;return Y(Q);function Y(J){if(J===void 0||typeof J==="string")return!0;if(typeof J!=="object"||J===null)return!1;if(X.has(J))return!1;if(X.add(J),Array.isArray(J))return J.every(Y);return Object.keys(J).every(($)=>Y(J[$]))}}var Yk=new p6([],()=>(Q,X)=>Xk(Q)?h(Q):y(new v0(X,F(Q))),{expected:"StringTree",toCodecStringTree:()=>new B0(m6,h6())}),sO=new B0(Yk,h6());var tO=B(2,(Q,X)=>{return uG(Q,(Y,J)=>X.includes(Y)?[Y,J]:void 0)}),eO=B(2,(Q,X)=>{return uG(Q,(Y,J)=>!X.includes(Y)?[Y,J]:void 0)}),Qz=B(2,(Q,X)=>{return{...Q,...X}});var fG=B(2,(Q,X)=>{return uG(Q,(Y,J)=>[Object.hasOwn(X,Y)?X[Y]:Y,J])});var _1=(Q)=>Q;function uG(Q,X){let Y={};for(let J in Q){let $=X(J,Q[J]);if($){let[G,Z]=$;Y[G]=Z}}return Y}function Xz(Q,X){let Y=X?.omitKeyWhen??(()=>!1);return yW((J,$)=>{let G=Reflect.ownKeys(Q),Z={};for(let K of G){let W=Q[K].combine(J[K],$[K]);if(Y(W))continue;Z[K]=W}return Z})}function sQ(Q){return o8((X,Y)=>{if(X===void 0)return Y;if(Y===void 0)return X;return Q.combine(X,Y)},void 0)}function fY(Q,X){if(X.length>0)Q+=`
29
+ at ${vX(X)}`;return Error(Q)}var Yz=new WeakMap;function Jz(Q,X,Y){return X.map((J)=>($)=>J.run($,Q,i5)===void 0).reduce((J,$)=>J.filter($),Y)}function $k(Q){return Q?.comparator!==void 0}function $z(Q,X,Y){let J=X.constraints?.array,$=$k(J)?Q.uniqueArray(Y,J):Q.array(Y,J);if(X.isSuspend)return Q.oneof({maxDepth:2,depthIdentifier:""},Q.constant([]),$);return $}var Gz=sQ(HD),Zz=sQ(VD),r4=sQ(lB),Gk=sQ(UH()),Zk=Xz({isInteger:r4,max:Zz,maxExcluded:r4,maxLength:Zz,min:Gz,minExcluded:r4,minLength:Gz,noDefaultInfinity:r4,noInteger:r4,noInvalidDate:r4,noNaN:r4,patterns:Gk,comparator:r4},{omitKeyWhen:FW});function Kk(Q,X,Y){let J=X[Q];return{...X,[Q]:J?Zk.combine(J,Y):Y}}var Wk={string:null,number:null,bigint:null,array:null,date:null};function Hk(Q){return Q in Wk}function Kz(Q){let X=Q.map((Y)=>Y.annotations?.toArbitraryConstraint).filter(Z1);return(Y)=>{let J=X.reduce(($,G)=>{let Z=Object.keys(G);for(let K of Z)if(Hk(K))$=Kk(K,$,G[K]);return $},Y.constraints||{});return{...Y,constraints:J}}}function rG(Q){return{...Q,constraints:void 0}}function Vk(Q){let X={};if(Q.min!==void 0)X.min=Q.minExcluded?Math.floor(Q.min)+1:Math.ceil(Q.min);if(Q.max!==void 0)X.max=Q.maxExcluded?Math.ceil(Q.max)-1:Math.floor(Q.max);return X}function oG(Q){if(Q)return Q.flatMap((X)=>{switch(X._tag){case"Filter":return[X];case"FilterGroup":return oG(X.checks)}});return[]}var Wz=p0((Q)=>{return z8(Q,[])});function z8(Q,X){let Y=D8(Q)?.toArbitrary;if(Y){let J=b8(Q)?Q.typeParameters.map((Z)=>z8(Z,X)):[],$=oG(Q.checks),G=Kz($);return(Z,K)=>Jz(Q,$,Y(J.map((W)=>W(Z,rG(K))))(Z,G(K)))}if(Q.checks){let J=oG(Q.checks),$=Kz(J),G=z8(hY(Q,void 0),X);return(Z,K)=>Jz(Q,J,G(Z,$(K)))}return _k(Q,X)}function _k(Q,X){switch(Q._tag){case"Never":case"Declaration":throw fY(`Unsupported AST ${Q._tag}`,X);case"Null":return(Y)=>Y.constant(null);case"Void":case"Undefined":return(Y)=>Y.constant(void 0);case"Unknown":case"Any":return(Y)=>Y.anything();case"String":return(Y,J)=>{let $=J.constraints?.string,G=$?.patterns;if(G)return Y.oneof(...G.map((Z)=>Y.stringMatching(new RegExp(Z))));return Y.string($)};case"Number":return(Y,J)=>{let $=J.constraints?.number;if($?.isInteger)return Y.integer(Vk($));return Y.float($)};case"Boolean":return(Y)=>Y.boolean();case"BigInt":return(Y,J)=>Y.bigInt(J.constraints?.bigint??{});case"Symbol":return(Y)=>Y.string().map(Symbol.for);case"Literal":return(Y)=>Y.constant(Q.literal);case"UniqueSymbol":return(Y)=>Y.constant(Q.symbol);case"ObjectKeyword":return(Y)=>Y.oneof(Y.object(),Y.array(Y.anything()));case"Enum":return z8(pO(Q),X);case"TemplateLiteral":return(Y)=>Y.stringMatching(pY(Q));case"Arrays":return(Y,J)=>{let $=rG(J),G=Q.elements.map((K,W)=>{let H=z8(K,[...X,W])(Y,$);if(!E0(K))return H.map(F);return H.chain((_)=>Y.boolean().map((V)=>V?F(_):b()))}),Z=Y.tuple(...G).map(BH);if(L6(Q.rest)){let K=Q.elements.length,[W,...H]=Q.rest.map((V,q)=>z8(V,[...X,K+q])(Y,$)),_=$z(Y,Q.elements.length===0?J:$,W);if(Z=Z.chain((V)=>{if(V.length<K)return Y.constant(V);return _.map((q)=>[...V,...q])}),H.length>0){let V=Y.tuple(...H);Z=Z.chain((q)=>{if(q.length<K)return Y.constant(q);return V.map((D)=>[...q,...D])})}}return Z};case"Objects":return(Y,J)=>{let $=rG(J),G={},Z=[];for(let W of Q.propertySignatures){let H=W.name;if(!E0(W.type))Z.push(H);G[H]=z8(W.type,[...X,H])(Y,$)}let K=Y.record(G,{requiredKeys:Z});for(let W of Q.indexSignatures){let H=Y.tuple(z8(W.parameter,X)(Y,$),z8(W.type,X)(Y,$)),_=$z(Y,Q.propertySignatures.length===0?J:$,H);K=K.chain((V)=>{return _.map((q)=>{return{...Object.fromEntries(q),...V}})})}return K};case"Union":return(Y,J)=>Y.oneof(...Q.types.map(($)=>z8($,X)(Y,J)));case"Suspend":{let Y=Yz.get(Q);if(Y)return Y;let J=u6(()=>z8(Q.thunk(),X)),$=(G,Z)=>G.constant(null).chain(()=>J()(G,{...Z,isSuspend:!0}));return Yz.set(Q,$),$}}}var tQ=p0((Q)=>{switch(Q._tag){case"Declaration":{let X=Q.annotations?.[t5];if(Y8(X)){let Y=X(Q.typeParameters),J=tQ(Y.to);return D0(Q,J===Y.to?[Y]:[new B0(J,Y.transformation)])}return Q}case"Objects":case"Arrays":return Q.recur((X)=>{let Y=X.context?.defaultValue;if(Y)return D0(tQ(X),Y);return tQ(X)});case"Suspend":return Q.recur(tQ);default:return Q}});function lY(Q){let X=tQ(U8(Q.ast)),Y=Q9(X);return(J,$)=>{return Y(J,$?.disableChecks?$?.parseOptions?{...$.parseOptions,disableChecks:!0}:{disableChecks:!0}:$?.parseOptions)}}function rY(Q){let X=lY(Q);return(Y,J)=>{return g7(n7(X(Y,J)))}}function Hz(Q){let X=lY(Q);return(Y,J)=>{return d4(X1(X(Y,J),($)=>Error($.toString(),{cause:$})))}}function Vz(Q){return eQ(Q.ast)}function eQ(Q){let X=X9(Q9(U8(Q)));return(Y)=>{return H8(X(Y,i5))}}function _z(Q){let X=Q9(Q);return(Y,J)=>{return d4(S$(X(Y,J),{onSuccess:()=>{return},onFailure:g}))}}function qz(Q,X){let J=X9(Q9(U8(Q.ast)))(X,i5);if(tJ(J)){let $=E8(J.cause);if(u($))throw j6($.failure);throw Error($.success.toString(),{cause:$.success})}}function h0(Q,X){let Y=Q9(Q.ast);return X===void 0?Y:(J,$)=>Y(J,Lz(X,$))}var nG=h0;function Dz(Q,X){return X9(h0(Q,X))}function Bz(Q,X){return Pz(h0(Q,X))}function Uz(Q,X){return Rz(h0(Q,X))}function Dk(Q,X){return Nz(h0(Q,X))}var iG=Dk;function e5(Q,X){let Y=Q9(B8(Q.ast));return X===void 0?Y:(J,$)=>Y(J,Lz(X,$))}function Oz(Q,X){return X9(e5(Q,X))}function zz(Q,X){return Pz(e5(Q,X))}function Fz(Q,X){return Rz(e5(Q,X))}function Bk(Q,X){return Nz(e5(Q,X))}var aG=Bk,Lz=(Q,X)=>X===void 0?Q:{...Q,...X};function Q9(Q){let X=uY(Q);return(Y,J)=>_8(X(F(Y),J??i5),($)=>{if($._tag==="None")return y(new Z0($));return h($.value)})}function X9(Q){return(X,Y)=>n7(Q(X,Y))}function Pz(Q){let X=X9(Q);return(Y,J)=>g7(X(Y,J))}function Rz(Q){let X=X9(Q);return(Y,J)=>{let $=X(Y,J);if(H8($))return l($.value);let G=E8($.cause);if(u(G))throw j6(G.failure);return f(G.success)}}function Nz(Q){return(X,Y)=>d4(X1(Q(X,Y),(J)=>Error(J.toString(),{cause:J})))}var uY=p0((Q)=>{let X,Y=D8(Q)?.parseOptions;if(!Q.context&&!Q.encoding&&!Q.checks)return($,G)=>{if(X??=Q.getParser(uY),Y)G={...G,...Y};return X($,G)};let J=IY(Q)||JO(Q)||b8(Q)&&Q.typeParameters.length>0;return($,G)=>{if(Y)G={...G,...Y};let Z=Q.encoding,K;if(Z){let H=Z,_=H.length;for(let V=_-1;V>=0;V--){let q=H[V],D=q.to,U=uY(D);if(K=K?_8(K,(P)=>U(P,G)):U($,G),q.transformation._tag==="Transformation"){let P=q.transformation.decode;K=_8(K,(L)=>P.run(L,G))}else K=q.transformation.decode(K,G)}K=X1(K,(V)=>new HG(Q,$,V))}X??=Q.getParser(uY);let W=K?_8(K,(H)=>X(H,G)):X($,G);if(Q.checks&&!G?.disableChecks){let H=Q.checks;if(G?.errors==="all"&&J&&O1($))W=m5(W,(_)=>{let V=[];aQ(H.filter((D)=>D.annotations?.[m1]),$.value,V,Q,G);let q=K8(V)?_._tag==="Composite"&&_.ast===Q?new q0(Q,_.actual,[..._.issues,...V]):new q0(Q,$,[_,...V]):_;return y(q)});W=_8(W,(_)=>{if(O1(_)){let V=_.value,q=[];if(aQ(H,V,q,Q,G),K8(q))return y(new q0(Q,_,q))}return h(_)})}return W}});var Mz=p0((Q)=>{return o4(Q,[])});function o4(Q,X){let Y=D8(Q)?.toEquivalence;if(Y)return Y(b8(Q)?Q.typeParameters.map((J)=>o4(J,X)):[]);switch(Q._tag){case"Never":throw fY(`Unsupported AST ${Q._tag}`,X);case"Declaration":case"Null":case"Undefined":case"Void":case"Unknown":case"Any":case"String":case"Number":case"Boolean":case"BigInt":case"Symbol":case"Literal":case"UniqueSymbol":case"ObjectKeyword":case"Enum":case"TemplateLiteral":return n;case"Arrays":{let J=Q.elements.map((Z,K)=>o4(Z,[...X,K])),$=Q.elements.length,G=Q.rest.map((Z,K)=>o4(Z,[...X,$+K]));return i0((Z,K)=>{if(!Array.isArray(Z)||!Array.isArray(K))return!1;let W=Z.length;if(W!==K.length)return!1;let H=0;for(;H<Math.min(W,Q.elements.length);H++)if(!J[H](Z[H],K[H]))return!1;if(G.length>0){let[_,...V]=G;for(;H<W-V.length;H++)if(!_(Z[H],K[H]))return!1;for(let q=0;q<V.length;q++)if(H+=q,!V[q](Z[H],K[H]))return!1}return!0})}case"Objects":{if(Q.propertySignatures.length===0&&Q.indexSignatures.length===0)return n;let J=Q.propertySignatures.map((G)=>o4(G.type,[...X,G.name])),$=Q.indexSignatures.map((G)=>o4(G.type,X));return i0((G,Z)=>{if(!N1(G)||!N1(Z))return!1;for(let K=0;K<J.length;K++){let W=Q.propertySignatures[K],H=W.name,_=Object.hasOwn(G,H),V=Object.hasOwn(Z,H);if(E0(W.type)){if(_!==V)return!1}if(_&&V&&!J[K](G[H],Z[H]))return!1}for(let K=0;K<$.length;K++){let W=Q.indexSignatures[K],H=f6(G,W.parameter),_=f6(Z,W.parameter);if(H.length!==_.length)return!1;for(let V=0;V<H.length;V++){let q=H[V];if(!Object.hasOwn(Z,q)||!$[K](G[q],Z[q]))return!1}}return!0})}case"Union":return i0((J,$)=>{let G=lQ(J,Q.types),Z=G.map(eQ);for(let K=0;K<G.length;K++){let W=Z[K];if(W(J)&&W($))return o4(G[K],X)(J,$)}return!1});case"Suspend":{let J=u6(()=>o4(Q.thunk(),X));return i0(($,G)=>J()($,G))}}}function oY(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}function Az(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}var nY="~effect/Schema/Schema",Ok={[nY]:nY,pipe(){return X0(this,arguments)},annotate(Q){return this.rebuild(l6(this.ast,Q))},annotateKey(Q){return this.rebuild(nQ(this.ast,Q))},check(...Q){return this.rebuild(l4(this.ast,Q))}};function n6(Q,X){let Y=Object.create(Ok);if(X)Object.assign(Y,X);return Y.ast=Q,Y.rebuild=(J)=>n6(J,X),Y.makeEffect=UW(lY(Y),X1((J)=>new g8(J))),Y.make=Hz(Y),Y.makeOption=rY(Y),Y}var iY="~effect/Schema/SchemaError";class g8{[iY]=iY;_tag="SchemaError";name="SchemaError";issue;constructor(Q){this.issue=Q}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}var aY=tG(zk);function zk(Q){switch(Q._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function tG(Q){return(X)=>{let Y=new Map;for(let G=0;G<X.length;G++)Y.set(Y1(X[G]),G);let J=[...X].sort((G,Z)=>{G=Y1(G),Z=Y1(Z);let K=Q(G),W=Q(Z);if(K!==W)return K-W;return Y.get(G)-Y.get(Z)});if(!J.some((G,Z)=>G!==X[Z]))return X;return J}}function Cz(Q){let{references:X,representations:Y}=Fk([Q]);return{representation:Y[0],references:X}}function Fk(Q){let X={},Y=new Map,J=new Set,$=new Set;return{representations:E4(Q,(V)=>K(V)),references:X};function Z(V){let q=V,D=0;while(J.has(q))q=`${V}${++D}`;return J.add(q),q}function K(V,q){let D=Y.get(V);if(D!==void 0)return{_tag:"Reference",$ref:D};let U=oQ(V),P=f5(V)??q;if(V!==U)return K(U,P);if(P!==void 0){let w=Z(P);Y.set(V,w);let R=H(V),i=X[P];if(i!==void 0&&n(R,i))return Y.set(V,P),{_tag:"Reference",$ref:P};return X[w]=R,{_tag:"Reference",$ref:w}}if($.has(V)){let w=Z(`${V._tag}_`);return Y.set(V,w),{_tag:"Reference",$ref:w}}$.add(V);let L=H(V);$.delete(V);let M=Y.get(V);if(M!==void 0)return X[M]=L,{_tag:"Reference",$ref:M};return L}function W(V){let q=V.annotations?.toCodecJson??V.annotations?.toCodec;if(Y8(q)){let D=V.typeParameters.map((P)=>n6(Y1(P))),U=q(D);return D0(V,[U])}return a5}function H(V){let q=QX(V.annotations);switch(V._tag){case"Declaration":{let D=K(W(V));return{_tag:"Declaration",typeParameters:V.typeParameters.map((U)=>K(U)),encodedSchema:D,checks:_(V.checks),...q}}case"Null":case"Undefined":case"Void":case"Never":case"Unknown":case"Any":case"Boolean":case"Symbol":return{_tag:V._tag,...q};case"String":{let D=V.annotations?.contentMediaType,U=V.annotations?.contentSchema;return{_tag:V._tag,checks:_(V.checks),...q,...typeof D==="string"&&YO(U)?{contentSchema:K(U)}:void 0}}case"Number":case"BigInt":return{_tag:V._tag,checks:_(V.checks),...q};case"Literal":return{_tag:V._tag,literal:V.literal,...q};case"UniqueSymbol":return{_tag:V._tag,symbol:V.symbol,...q};case"ObjectKeyword":return{_tag:V._tag,...q};case"Enum":return{_tag:V._tag,enums:V.enums,...q};case"TemplateLiteral":return{_tag:V._tag,parts:V.parts.map((D)=>K(D)),...q};case"Arrays":return{_tag:V._tag,elements:V.elements.map((D)=>{let U=oQ(D);return{isOptional:E0(U),type:K(D),...QX(U.context?.annotations)}}),rest:V.rest.map((D)=>K(D)),checks:_(V.checks),...q};case"Objects":return{_tag:V._tag,propertySignatures:V.propertySignatures.map((D)=>{let U=oQ(D.type);return{name:D.name,type:K(D.type),isOptional:E0(U),isMutable:gO(U),...QX(U.context?.annotations)}}),indexSignatures:V.indexSignatures.map((D)=>({parameter:K(D.parameter),type:K(D.type)})),checks:_(V.checks),...q};case"Union":{let D=aY(V.types);return{_tag:V._tag,types:D.map((U)=>K(U)),mode:V.mode,...q}}case"Suspend":return{_tag:"Suspend",checks:[],thunk:K(V.thunk()),...q}}}function _(V){if(!V)return[];return V.map(q).filter((D)=>D!==void 0);function q(D){switch(D._tag){case"Filter":{let U=D.annotations?.meta;if(U)return{_tag:"Filter",meta:U._tag==="isPropertyNames"?{_tag:"isPropertyNames",propertyNames:K(U.propertyNames)}:U,...QX(D.annotations)};return}case"FilterGroup":{let U=_(D.checks);if(K8(U))return{_tag:"FilterGroup",checks:U,...QX(D.annotations)}}}}}}var Lk=new Set(["~structural","~sentinels","meta","toArbitrary","toArbitraryConstraint","toEquivalence","toFormatter","toCodec","toCodecJson","toCodecIso",t5]),Pk=new Set(["title","description","default","examples","readOnly","writeOnly","format","contentEncoding","contentMediaType","contentSchema"]);function QX(Q){if(Q!==void 0){let X=_H(Q,(Y,J)=>!Lk.has(J));if(!M3(X))return{annotations:X}}return}function Tz(Q,X){let{definitions:Y,dialect:J,schemas:$}=Rk({representations:[Q.representation],references:Q.references},X),G=$[0];return{dialect:J,schema:G,definitions:Y}}function Rk(Q,X){let Y=X?.generateDescriptions??!1,J=X?.additionalProperties??!1,$=X?.includeAnnotationKey,G=F5(Q.references,(D)=>Z(D));return{dialect:"draft-2020-12",schemas:E4(Q.representations,(D)=>Z(D)),definitions:G};function Z(D){let U=K(D);if("annotations"in D){let P=H(D.annotations);if(P)U={...U,...P}}if("checks"in D){let P=_(D.checks,U.type);for(let L of P)U=eG(U,L)}return U}function K(D){switch(D._tag){case"Any":case"Unknown":case"ObjectKeyword":return{};case"Void":case"Undefined":return{type:"null"};case"BigInt":return{type:"string",allOf:[{pattern:"^-?\\d+$"}]};case"Symbol":case"UniqueSymbol":return{type:"string",allOf:[{pattern:"^Symbol\\((.*)\\)$"}]};case"Declaration":return Z(D.encodedSchema);case"Suspend":return Z(D.thunk);case"Reference":return{$ref:`#/$defs/${oY(D.$ref)}`};case"Null":return{type:"null"};case"Never":return{not:{}};case"String":{let U={type:"string"};if(D.contentMediaType!==void 0)U.contentMediaType=D.contentMediaType;if(D.contentSchema!==void 0)U.contentSchema=Z(D.contentSchema);return U}case"Number":return QZ(D.checks,"isInt")?{type:"integer"}:QZ(D.checks,"isFinite")?{type:"number"}:{anyOf:[{type:"number"},{type:"string",enum:["NaN"]},{type:"string",enum:["Infinity"]},{type:"string",enum:["-Infinity"]}]};case"Boolean":return{type:"boolean"};case"Literal":{let U=D.literal;if(typeof U==="string")return{type:"string",enum:[U]};if(typeof U==="number")return{type:"number",enum:[U]};if(typeof U==="boolean")return{type:"boolean",enum:[U]};return{type:"string",enum:[String(U)]}}case"Enum":return Z({_tag:"Union",types:D.enums.map(([U,P])=>({_tag:"Literal",literal:P,annotations:{title:U}})),mode:"anyOf",annotations:D.annotations});case"TemplateLiteral":return{type:"string",pattern:`^${D.parts.map(sY).join("")}$`};case"Arrays":{if(D.rest.length>1)throw new globalThis.Error("Generating a JSON Schema for post-rest elements is not supported");let U={type:"array"},P=D.elements.length,L=D.elements.map((M)=>{if(M.isOptional)P--;let w=Z(M.type),R=H(M.annotations);return R?eG(w,R):w});if(L.length>0){if(U.prefixItems=L,U.maxItems=D.elements.length,P>0)U.minItems=P}else U.items=!1;if(D.rest.length>0){delete U.maxItems;let M=Z(D.rest[0]);if(Object.keys(M).length>0)U.items=M;else delete U.items}return U}case"Objects":{if(D.propertySignatures.length===0&&D.indexSignatures.length===0)return{anyOf:[{type:"object"},{type:"array"}]};let U={type:"object"},P={},L=[];for(let w of D.propertySignatures){let R=w.name;if(typeof R!=="string")throw new globalThis.Error(`Unsupported property signature name: ${v(R)}`);let i=Z(w.type),$1=H(w.annotations);if(P[R]=$1?eG(i,$1):i,!w.isOptional)L.push(R)}if(Object.keys(P).length>0)U.properties=P;if(L.length>0)U.required=L;U.additionalProperties=J;let M={};for(let w of D.indexSignatures){let R=Z(w.type);if(Object.keys(R).length===1&&"not"in R)R=!1;let i=q(w.parameter);if(i.length>0)for(let $1 of i)M[$1]=R;else U.additionalProperties=R}if(Object.keys(M).length>0)U.patternProperties=M,delete U.additionalProperties;if(N1(U.additionalProperties)&&M3(U.additionalProperties))delete U.additionalProperties;return U}case"Union":{let U=D.types.map(Z);if(U.length===0)return{not:{}};if(U.length>1){let P=W(U);if(P)return P}return D.mode==="anyOf"?{anyOf:U}:{oneOf:U}}}}function W(D){let U,P=[];for(let L of D){if(Object.keys(L).length!==2||L.type===void 0||!Array.isArray(L.enum)||L.enum.length===0)return;if(U===void 0)U=L.type;else if(L.type!==U)return;for(let w of L.enum)P.push(w)}return{type:U,enum:P}}function H(D){if(D===void 0)return;let U={};if(typeof D.title==="string")U.title=D.title;if(typeof D.description==="string")U.description=D.description;else if(Y&&typeof D.expected==="string")U.description=D.expected;if(D.default!==void 0)U.default=D.default;if(Array.isArray(D.examples))U.examples=D.examples;if(typeof D.readOnly==="boolean")U.readOnly=D.readOnly;if(typeof D.writeOnly==="boolean")U.writeOnly=D.writeOnly;if(typeof D.format==="string")U.format=D.format;if(typeof D.contentEncoding==="string")U.contentEncoding=D.contentEncoding;if(typeof D.contentMediaType==="string")U.contentMediaType=D.contentMediaType;if($)for(let[P,L]of Object.entries(D)){if(L===void 0)continue;if(Pk.has(P))continue;if(!$(P))continue;U[P]=L}if(Object.keys(U).length>0)return U}function _(D,U){return D.map(P).filter((L)=>L!==void 0);function P(L){switch(L._tag){case"Filter":return V(L,U);case"FilterGroup":{let M=L.checks.map(P).filter((i)=>i!==void 0);if(M.length===0)return;let w={allOf:M},R=H(L.annotations);if(R)w={...w,...R};return w}}}}function V(D,U){let P=D.meta;if(!P)return;let L=w(P),M=H(D.annotations);if(M)L={...L,...M};return L;function w(R){switch(R._tag){case"isMinLength":return U==="array"?{minItems:R.minLength}:{minLength:R.minLength};case"isMaxLength":return U==="array"?{maxItems:R.maxLength}:{maxLength:R.maxLength};case"isLengthBetween":return U==="array"?{allOf:[{minItems:R.minimum},{maxItems:R.maximum}]}:{allOf:[{minLength:R.minimum},{maxLength:R.maximum}]};case"isPattern":case"isGUID":case"isULID":case"isBase64":case"isBase64Url":case"isStartsWith":case"isEndsWith":case"isIncludes":case"isUppercased":case"isLowercased":case"isCapitalized":case"isUncapitalized":case"isTrimmed":case"isStringFinite":case"isStringBigInt":case"isStringSymbol":return{pattern:R.regExp.source};case"isUUID":return{pattern:R.regExp.source,format:"uuid"};case"isFinite":case"isInt":return;case"isMultipleOf":return{multipleOf:R.divisor};case"isGreaterThanOrEqualTo":return{minimum:R.minimum};case"isLessThanOrEqualTo":return{maximum:R.maximum};case"isGreaterThan":return{exclusiveMinimum:R.exclusiveMinimum};case"isLessThan":return{exclusiveMaximum:R.exclusiveMaximum};case"isBetween":return{[R.exclusiveMinimum?"exclusiveMinimum":"minimum"]:R.minimum,[R.exclusiveMaximum?"exclusiveMaximum":"maximum"]:R.maximum};case"isUnique":return{uniqueItems:!0};case"isMinProperties":return{minProperties:R.minProperties};case"isMaxProperties":return{maxProperties:R.maxProperties};case"isPropertiesLengthBetween":return{minProperties:R.minimum,maxProperties:R.maximum};case"isPropertyNames":return{propertyNames:Z(R.propertyNames)};case"isDateValid":return{format:"date-time"}}}}function q(D){switch(D._tag){default:throw new globalThis.Error(`Unsupported index signature parameter: ${D._tag}`);case"Reference":return q(Q.references[D.$ref]);case"String":return Nk(D);case"TemplateLiteral":return[`^${D.parts.map(sY).join("")}$`];case"Union":return D.types.flatMap(q)}}}function Nk(Q){return X(Q.checks);function X(Y){return Y.flatMap((J)=>{switch(J._tag){case"Filter":{if("regExp"in J.meta)return[J.meta.regExp.source];return[]}case"FilterGroup":return X(J.checks)}})}}function QZ(Q,X){return Q.some((Y)=>{switch(Y._tag){case"Filter":return Y.meta._tag===X;case"FilterGroup":return QZ(Y.checks,X)}})}function eG(Q,X){if(Object.keys(Q).length===0)return X;let Y=Object.keys(X).length;if(Y===0)return Q;let J=Array.isArray(X.allOf)&&Y===1?X.allOf:[X];if(Array.isArray(Q.allOf))return{...Q,allOf:[...Q.allOf,...J]};if(typeof Q.$ref==="string")return{allOf:[Q,...J]};return{...Q,allOf:J}}function sY(Q){switch(Q._tag){case"Literal":return BY(globalThis.String(Q.literal));case"String":return hG;case"Number":return pQ;case"TemplateLiteral":return Q.parts.map(sY).join("");case"Union":return Q.types.map(sY).join("|");default:throw new globalThis.Error("Unsupported part",{cause:Q})}}function tY(Q,X){if(Object.is(Q,X))return[];let Y=[];if(Array.isArray(Q)&&Array.isArray(X)){let J=Q.length,$=X.length,G=Math.min(J,$);for(let Z=0;Z<G;Z++){let K=`/${Z}`,W=tY(Q[Z],X[Z]);for(let H of W)Iz(H,K),Y.push(H)}for(let Z=J-1;Z>=$;Z--)Y.push({op:"remove",path:`/${Z}`});for(let Z=J;Z<$;Z++)Y.push({op:"add",path:`/${Z}`,value:X[Z]});return Y}if(eY(Q)&&eY(X)){let J=Object.keys(Q),$=Object.keys(X),G=Array.from(new Set([...J,...$])).sort();for(let Z of G){let W=`/${oY(Z)}`,H=Object.hasOwn(Q,Z),_=Object.hasOwn(X,Z);if(H&&_){let V=tY(Q[Z],X[Z]);for(let q of V)Iz(q,W),Y.push(q)}else if(!H&&_)Y.push({op:"add",path:W,value:X[Z]});else if(H&&!_)Y.push({op:"remove",path:W})}return Y}return Y.push({op:"replace",path:"",value:X}),Y}function Ez(Q,X){let Y=X;for(let J of Q)switch(J.op){case"replace":{Y=J.path===""?J.value:jz(Y,J.path,J.value,"replace");break}case"add":{Y=wk(Y,J.path,J.value);break}case"remove":{Y=jz(Y,J.path,void 0,"remove");break}}return Y}function Iz(Q,X){Q.path=Q.path===""?X:X+Q.path}function eY(Q){return N1(Q)}function Ak(Q){if(Q==="")return[];if(Q.charCodeAt(0)!==47)throw Error(`Invalid JSON Pointer, it must start with "/": ${v(Q)}`);return Q.split("/").slice(1).map(Az)}function XZ(Q){if(!/^(0|[1-9]\d*)$/.test(Q))throw Error(`Invalid array index: "${Q}"`);return Number(Q)}function wk(Q,X,Y){if(X==="")return Y;let J=Sz(Q,X);if(J===null)throw Error(`Cannot add at "${X}" (parent not found or not a container).`);let{lastToken:$,parent:G,stack:Z}=J;if(Array.isArray(G)){let K=$==="-"?G.length:XZ($);if(K<0||K>G.length)throw Error(`Array index out of bounds at "${X}".`);let W=G.slice();return W.splice(K,0,Y),Q2(Z,W)}if(eY(G)){let K={...G};return K[$]=Y,Q2(Z,K)}throw Error(`Cannot add at "${X}" (parent not found or not a container).`)}function jz(Q,X,Y,J){if(X===""){if(J==="remove"||Y===void 0)throw Error("Unsupported operation at the root");return Y}let $=Sz(Q,X);if($===null)throw Error(`Cannot ${J} at "${X}" (parent not found or not a container).`);let{lastToken:G,parent:Z,stack:K}=$;if(Array.isArray(Z)){if(G==="-")throw Error(`"-" is not valid for ${J} at "${X}".`);let W=XZ(G);if(W<0||W>=Z.length)throw Error(`Array index out of bounds at "${X}".`);let H=Z.slice();if(J==="remove")H.splice(W,1);else H[W]=Y;return Q2(K,H)}if(eY(Z)){if(!Object.hasOwn(Z,G))throw Error(`Property "${G}" does not exist at "${X}".`);let W={...Z};if(J==="remove")delete W[G];else W[G]=Y;return Q2(K,W)}throw Error(`Cannot ${J} at "${X}" (parent not found or not a container).`)}function Sz(Q,X){let Y=Ak(X);if(Y.length===0)return null;let J=Y[Y.length-1],$=[],G=Q;for(let Z=0;Z<Y.length-1;Z++){let K=Y[Z];if(G==null)return null;if(Array.isArray(G)){let W=XZ(K);if(W<0||W>=G.length)return null;$.push({container:G,token:W}),G=G[W];continue}if(G&&typeof G==="object"){if(!Object.hasOwn(G,K))return null;$.push({container:G,token:K}),G=G[K];continue}return null}return{stack:$,parent:G,lastToken:J}}function Q2(Q,X){let Y=X;for(let J=Q.length-1;J>=0;J--){let{container:$,token:G}=Q[J];if(Array.isArray($)){let Z=$.slice();Z[G]=Y,Y=Z}else{let Z={...$};Z[G]=Y,Y=Z}}return Y}var Tk=/^#\/\$defs(?=\/|$)/;function vz(Q){return{dialect:"draft-07",schema:xz(Q.schema),definitions:F5(Q.definitions,xz)}}function xz(Q){return X(Q);function X(J){return Y(YZ(J,($)=>$.replace(Tk,"#/definitions")),!0)}function Y(J,$){if(Array.isArray(J))return J.map((H)=>Y(H,!1));if(!N1(J))return J;let G=J,Z={},K=void 0,W=void 0;for(let H of Object.keys(G)){let _=G[H];switch(H){case"$ref":case"type":case"required":case"enum":case"const":case"title":case"description":case"default":case"examples":case"format":case"pattern":case"minimum":case"maximum":case"exclusiveMinimum":case"exclusiveMaximum":case"minLength":case"maxLength":case"minItems":case"maxItems":case"minProperties":case"maxProperties":case"multipleOf":case"uniqueItems":Z[H]=_;break;case"properties":case"patternProperties":{let V=Ik(_,Y);Z[H]=V??_;break}case"additionalProperties":case"propertyNames":Z[H]=Y(_,!1);break;case"allOf":case"anyOf":case"oneOf":Z[H]=Array.isArray(_)?_.map((V)=>Y(V,!1)):_;break;case"prefixItems":K=_;break;case"items":W=_;break;default:break}}if(K!==void 0)if(Array.isArray(K)){if(Z.items=K.map((H)=>Y(H,!1)),W!==void 0)Z.additionalItems=Y(W,!1)}else Z.items=Y(K,!1);else if(W!==void 0)Z.items=Y(W,!1);return Z}}function YZ(Q,X){if(Array.isArray(Q))return Q.map((J)=>YZ(J,X));if(!N1(Q))return Q;let Y={};for(let J of Object.keys(Q)){let $=Q[J];if(J==="$ref")Y[J]=typeof $==="string"?X($):$;else if(Array.isArray($)||N1($))Y[J]=YZ($,X);else Y[J]=$}return Y}function Ik(Q,X){if(!N1(Q))return;let Y={};for(let J of Object.keys(Q))Y[J]=X(Q[J],!1);return Y}function yz(Q,X){return F8(new mz(Q,X))}function kz(Q,X){return F8(new $Z(Q,X))}class bz{_tag="IdentityNode"}var gz=new bz;class hz{_tag="CompositionNode";nodes;constructor(Q){this.nodes=Q}}class mz{_tag="IsoNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class $Z{_tag="LensNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class dz{_tag="PrismNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class GZ{_tag="OptionalNode";get;set;constructor(Q,X){this.get=Q,this.set=X}}class ZZ{_tag="PathNode";path;constructor(Q){this.path=Q}}class Y2{_tag="CheckNode";checks;constructor(Q){this.checks=Q}}function Ek(Q,X){let Y=Q[Q.length-1];if(Y){if(Y._tag==="PathNode"&&X._tag==="PathNode"){Q[Q.length-1]=new ZZ([...Y.path,...X.path]);return}if(Y._tag==="CheckNode"&&X._tag==="CheckNode"){Q[Q.length-1]=new Y2([...Y.checks,...X.checks]);return}}Q.push(X)}function JZ(Q,X){if(Q._tag==="IdentityNode")return;if(Q._tag==="CompositionNode"){for(let Y=0;Y<Q.nodes.length;Y++)JZ(Q.nodes[Y],X);return}Ek(X,Q)}function i6(Q,X){let Y=[];switch(JZ(Q,Y),JZ(X,Y),Y.length){case 0:return gz;case 1:return Y[0];default:return new hz(Y)}}function Sk(Q,X){return F8(new GZ(Q,X))}class XX{node;getResult;replaceResult;constructor(Q,X,Y){this.node=Q,this.getResult=X,this.replaceResult=Y}replace(Q,X){return x9(this.replaceResult(Q,X),()=>X)}modify(Q){return(X)=>x9(aX(this.getResult(X),(Y)=>this.replaceResult(Q(Y),X)),()=>X)}compose(Q){return F8(i6(this.node,Q.node))}key(Q){return F8(i6(this.node,new ZZ([Q])))}optionalKey(Q){return F8(i6(this.node,new $Z((X)=>X[Q],(X,Y)=>{let J=J2(Y);if(X===void 0)if(Array.isArray(J)&&typeof Q==="number")J.splice(Q,1);else delete J[Q];else J[Q]=X;return J})))}check(...Q){return F8(i6(this.node,new Y2(Q)))}refine(Q,X){return F8(i6(this.node,new Y2([yY(Q,X)])))}tag(Q){return F8(i6(this.node,new dz((X)=>X._tag===Q?l(X):f(`Expected ${v(Q)} tag, got ${v(X._tag)}`),g)))}at(Q,...X){let Y=f(`Key ${v(Q)} not found`);return F8(i6(this.node,new GZ((J)=>Object.hasOwn(J,Q)?l(J[Q]):Y,(J,$)=>{if(Object.hasOwn($,Q)){let G=J2($);return G[Q]=J,l(G)}else return Y})))}pick(Q){return this.compose(kz(tO(Q),(X,Y)=>({...Y,...X})))}omit(Q){return this.compose(kz(eO(Q),(X,Y)=>({...Y,...X})))}notUndefined(){return this.refine(Z1,{expected:"a value other than `undefined`"})}forEach(Q){let X=Q($2());return Sk((Y)=>F6(this.getResult(Y),(J)=>{let $=[];for(let G=0;G<J.length;G++){let Z=X.getResult(J[G]);if(w1(Z))$.push(Z.success)}return $}),(Y,J)=>aX(this.getResult(J),($)=>{let G=[];for(let K=0;K<$.length;K++)if(w1(X.getResult($[K])))G.push(K);if(Y.length!==G.length)return f(`each: replacement length mismatch: ${Y.length} !== ${G.length}`);let Z=$.slice();for(let K=0;K<G.length;K++){let W=G[K],H=X.replaceResult(Y[K],$[W]);if(u(H))return f(`each: could not set element ${W}`);Z[W]=H.success}return this.replaceResult(Z,J)}))}modifyAll(Q){return(X)=>x9(aX(this.getResult(X),(Y)=>this.replaceResult(Y.map(Q),X)),()=>X)}}class pz extends XX{get;set;constructor(Q,X,Y){super(Q,(J)=>l(X(J)),(J)=>l(Y(J)));this.get=X,this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>this.set(Q(this.get(X)))}}class cz extends XX{get;constructor(Q,X,Y){super(Q,(J)=>l(X(J)),(J,$)=>l(Y(J,$)));this.get=X,this.replace=Y}modify(Q){return(X)=>this.replace(Q(this.get(X)),X)}}class fz extends XX{set;constructor(Q,X,Y){super(Q,X,(J,$)=>l(Y(J)));this.set=Y}replace(Q,X){return this.set(Q)}modify(Q){return(X)=>x9(F6(this.getResult(X),(Y)=>this.set(Q(Y))),()=>X)}}function F8(Q){let X=uz(Q);switch(X._tag){case"IsoNode":return new pz(Q,X.get,X.set);case"LensNode":return new cz(Q,X.get,X.set);case"PrismNode":return new fz(Q,X.get,X.set);case"OptionalNode":return new XX(Q,X.get,X.set)}}function J2(Q){if(Array.isArray(Q))return Q.slice();if(typeof Q==="object"&&Q!==null){let X=Object.getPrototypeOf(Q);if(X!==Object.prototype&&X!==null)throw Error("Cannot clone object with non-Object constructor or null prototype");return{...Q}}return Q}var uz=p0((Q)=>{switch(Q._tag){case"IdentityNode":return{_tag:"IsoNode",get:g,set:g};case"IsoNode":case"LensNode":case"PrismNode":case"OptionalNode":return{_tag:Q._tag,get:Q.get,set:Q.set};case"PathNode":return{_tag:"LensNode",get:(X)=>{let Y=Q.path,J=X;for(let $=0,G=Y.length;$<G;$++)J=J[Y[$]];return J},set:(X,Y)=>{let J=Q.path,$=J2(Y),G=$,Z=0;for(;Z<J.length-1;Z++){let W=J[Z];G[W]=J2(G[W]),G=G[W]}let K=J[Z];return G[K]=X,$}};case"CheckNode":return{_tag:"PrismNode",get:(X)=>z5(oO(Q.checks,X),String),set:g};case"CompositionNode":{let X=Q.nodes.map(uz),Y=X.reduce((J,$)=>xk(J,$._tag),"IsoNode");return{_tag:Y,get:(J)=>{for(let $=0;$<X.length;$++){let G=X[$],Z=G.get(J);if(X2(G._tag)){if(u(Z))return Z;J=Z.success}else J=Z}return X2(Y)?l(J):J},set:(J,$)=>{let G=$,Z=X.length,K=Array(Z+1);K[0]=$;for(let W=0;W<Z;W++){let H=X[W];if(X2(H._tag)){let _=H.get($);if(u(_))return Y==="OptionalNode"?_:G;$=_.success}else $=H.get($);K[W+1]=$}for(let W=Z-1;W>=0;W--){let H=X[W];if(lz(H._tag))J=H.set(J);else if(H._tag==="LensNode")J=H.set(J,K[W]);else{let _=H.set(J,K[W]);if(u(_))return _;J=_.success}}return Y==="OptionalNode"?l(J):J}}}}});function X2(Q){return Q==="PrismNode"||Q==="OptionalNode"}function lz(Q){return Q==="IsoNode"||Q==="PrismNode"}function xk(Q,X){switch(Q){case"IsoNode":return X;case"LensNode":return X2(X)?"OptionalNode":"LensNode";case"PrismNode":return lz(X)?"PrismNode":"OptionalNode";case"OptionalNode":return"OptionalNode"}}var vk=F8(gz);function $2(){return vk}var xK={};Z6(xK,{webUrl:()=>dc,webSegment:()=>xR,webQueryParameters:()=>kR,webPath:()=>vR,webFragments:()=>SR,webAuthority:()=>jR,uuid:()=>Tc,uniqueArray:()=>e6,ulid:()=>Pc,uint8ClampedArray:()=>LR,uint8Array:()=>FR,uint32Array:()=>zR,uint16Array:()=>OR,tuple:()=>Q0,toStringMethod:()=>R8,subarray:()=>_c,stringify:()=>b0,stringMatching:()=>Nf,string:()=>d0,stream:()=>t4,statistics:()=>Og,sparseArray:()=>PR,shuffledSubarray:()=>qc,set:()=>RR,schedulerFor:()=>Qf,scheduler:()=>ec,scheduledModelRun:()=>sc,sample:()=>Bg,resetConfigureGlobal:()=>Fb,record:()=>QK,readConfigureGlobal:()=>P8,property:()=>Rb,pre:()=>ok,option:()=>B4,oneof:()=>l0,object:()=>rp,noShrink:()=>C2,noBias:()=>A2,nat:()=>a4,modelRun:()=>ic,mixedCase:()=>Ap,memo:()=>Fp,maxSafeNat:()=>Ud,maxSafeInteger:()=>ZR,mapToConstant:()=>_9,map:()=>XK,lorem:()=>Bp,limitShrink:()=>jf,letrec:()=>HR,jsonValue:()=>wR,json:()=>sp,ipV6:()=>WR,ipV4Extended:()=>KR,ipV4:()=>TK,integer:()=>O0,int8Array:()=>UR,int32Array:()=>BR,int16Array:()=>DR,infiniteStream:()=>Qc,hash:()=>w2,hasToStringMethod:()=>VK,hasCloneMethod:()=>s6,hasAsyncToStringMethod:()=>_K,getDepthContextFor:()=>UK,gen:()=>Rg,func:()=>_d,float64Array:()=>qR,float32Array:()=>_R,float:()=>JR,falsy:()=>ng,entityGraph:()=>Zp,emailAddress:()=>Pm,double:()=>I2,domain:()=>MK,dictionary:()=>LK,defaultReportMessage:()=>IP,date:()=>mP,createDepthIdentifier:()=>OK,context:()=>ag,constantFrom:()=>m8,constant:()=>y0,configureGlobal:()=>zb,compareFunc:()=>Wd,compareBooleanFunc:()=>Zd,commands:()=>uc,cloneMethod:()=>r0,cloneIfNeeded:()=>Z9,clone:()=>Kh,check:()=>SP,chainUntil:()=>Yh,boolean:()=>DX,bigUint64Array:()=>Yf,bigInt64Array:()=>Xf,bigInt:()=>e4,base64String:()=>Kc,asyncToStringMethod:()=>D4,asyncStringify:()=>qK,asyncProperty:()=>Pb,asyncModelRun:()=>ac,asyncDefaultReportMessage:()=>jP,assert:()=>qg,array:()=>P0,anything:()=>AR,__version:()=>Sf,__type:()=>Ef,__commitHash:()=>xf,VerbosityLevel:()=>Nb,Value:()=>k,Stream:()=>s,Random:()=>DK,PreconditionFailure:()=>Q6,ExecutionStatus:()=>ub,Arbitrary:()=>C0});var yk=class Q{constructor(X){this.seed=X}clone(){return new Q(this.seed)}next(){let X=KZ(this.seed),Y=WZ(X),J=KZ(X),$=WZ(J);return this.seed=KZ(J),WZ(this.seed)+($+(Y<<15)<<15)|0}jump(){this.seed=Math.imul(this.seed,1994129409)+916127744&4294967295}getState(){return[this.seed]}};function KZ(Q){return Math.imul(Q,214013)+2531011&4294967295}function WZ(Q){return(Q&-2147483649)>>16}function rz(Q){return new yk(Q)}var bk=class Q{constructor(X,Y){this.states=X,this.index=Y}clone(){return new Q(this.states.slice(),this.index)}next(){let X=this.states[this.index];return X^=X>>>11,X^=X<<7&2636928640,X^=X<<15&4022730752,X^=X>>>18,this.index=G2(this.states,this.index),X}getState(){return[this.index,...this.states]}jump(){let X=this.states.slice(),Y=this.index;this.index=G2(this.states,this.index);for(let J=19932;J>0;--J){if("SUSgbA\\W`E[]KN2RUSo8XVU?HKBFRl11E\\KoWOg5B]XEWG;BE;1:oVK[`B^Z9Qd23^XTnhL>]Unda4f[X;_j9H5QD=cN<5H`3bW>9bk1mjoI2fK0obmAAINOV:>Mek_V9dd<hZ\\gC3?Fm7FEk07QH_3PLm^@?^i\\QMkgP<]oLHmFnlecg5F@7U^@4jhZ?WZS0k@GHehmM36:5^9;>Hmm`co>k:KOSkSbIINb1VFf>LXgP>GUAQTD>Ci>XMGkUflLlb?_FaFUk@?5N7i70@;1o68ah@I<HFH7R2^J:G][Gf962ITWID9GWK8ElD2G5=DcHcL]cA]P2n7A=[<bInM;IHDQnJMReRXDWbVldnGEIPij`E08Xdci3@0c:IBbD4:Nk]?lEN9j^;T`0blZX7eiWE8c`<ak7j05FZi>AjUDh?M1B?^??FAXKThf<aBOXZf7jXYGK>R<;NHk3S9YhM7STJ6`:MIE`S@7298X8W>PNK=@;lLX<i\\TXLL<W@X[X54H]in8M;;n?kkQbajgAMY=Tf9b;ZKf0QUB2FHYWfnfkDoU9YkcLd95T>lK6GM1YL\\lid:J>KYS=iJ]Y>QlF>?R5_[5QeYC=66;A32Ac>OHk_ne^0g>bK:g;KFPgbGUcPR_Z=TX3H9d03bKZ2IhEPKBo>LSGWd0iFdV8C<Y:<>T[O6lC\\blaZ>GoAYP4clf^j1IfnZJ]QeDe2X<HE[LJNWnaCg[P]Co^:IRbWPY?97UePBlZNNHY6LOBM8P>=h?Ye:_f_Sb9Ki5GDYBF4dWeMfdg^ccPllNWM7G1\\UMdoYeOOD5^e@foA22G?ADYo5:FVG[bWo96;>3kc_c1Ab30>30;1@4F8g2hY?DJ4[LOL;ZLLKo2]jo>[KMDUcR279N_kF=3WL@Dd620bMTdA\\U9k``ef2iD9JgJ8CZBHS>F^Uk;<laeaeHS<15OSeS`PcSSKBRBFY]aQ=EgUXGNg=?d56`KA@2BejY0^[_DCX`L=CGMT=BW^6S1i@2ATBVk>3_ocRA>2U:4GPQ6o>5jX2HIcV3S@On6KB<[SKB?FC_AAji9agbBFkAi\\;4I\\UJ]c36Ub@[;gQACVGY<V]SDJBUU]La\\_a@JdOO8gm2T0DJMa:8Hf7>E]noQ[1Kambn??QQ]S?1i0oMGOijb\\aGY6lQ^CJ?9bFle8<eH4UUjBINX;n8@VOA5ah^URV49B[A?ONHhHAC1J5;;h0SXYlG^0W=eJdHh^K4SGe=1HZLLam;D<Q3AOdbPcdX``82\\jo0En8jRVGC73WMCF9`d:0heS?80?C188cSn7H9<daZ]MgS4Pb^1HkA:1PU^5>^h_g[RQV@PnYBRI_]`B]Bh@Uk03eXGY`I16L76H28X`R>IROMeNVUdU[:lghLhPCQZ:4a<30YBZCYnXe[?;jc8gKI2QH2MjnWBm4nGCZW`aVU2a;P<AMI25mlW_Nm][2?b6o851X@lAm]YZ`bWRF1g<Ga:T]1NXH5Veja5P9S9>:aNg:Th1Y=5o78K>LQ8hW@5S?I83Lk5Xk;j5@I3o[d:4RjE^oS30:WP9gC\\i8aSI>QRE@4lP:7lDg8g2`Ql[2I8aBU\\BQ?B4_clL9Q]S;^e1Ob5[>3JER2`c7B=o]fPOWO<DGi;Niba1PoWPPE_Q3aX0OB0mZej\\f_M[J4Y6]1`h2MkF[GiW8Q^d3^_=<I1N2Q7]2<2j[iP7V3V821FaI]A`93bC^Z\\G=WJ;^Ih?B97_iIF@\\Dl<eK1je8SNTWo_=XFMZH<<JYLZ^YQMPgYOV45K_:]kSI8^XlO0]GY=VUfe_C_F6TOcoAlVUH:o=WhhT@K`2KFhe<3\\KXQ>W:M?S_4S5d@J^`[AGA7@3]DnGSCO`\\?E8HT75^d9\\:m\\m1egIfk8cd6bD9\\eU8\\n[Pb0Cgd^S0n9kGJHb]i5XodlKHc34Fhi9K>0U5WK`>7Ff2^KL=WC6:kc?e5C^a1T1:4:^S5flXlGNIj08AfO?Dh7T7dWO>E]NI9?ob7B7P_h[4TEP[EU;GllFTnSmg9:\\[N]<SAoKP_kPlG56A:I3T6EG8Hj=XnUE`KT5U@OQ?]7[N^MFN1_NU4KO_3::Le`8IL9[1Z1H1;V3SC\\N3]S@4U[F2mhT5dYM7[4Pg_Na0_8WTH0`bgceQS8]EG;XgD4Ib4iLTP@kE79Mn>AYRJA1U5^Blhgno:aHVYc03c3J0Vc9FjEV^M75Zfd8kVC9>iJDk`AJ[6f7DK2D^DL\\AX:6b5h31XH;RQB\\N<ZSM=J;6L[`UW^eOIFc1Y]6_dfedIe4ARh72mTXC0WND_IDHVCZRDE0eODARCEETQI5TPUQE=jEH5bS?LP[ai`F5ABRYDo2o\\@=]GT?_9;hc4Lm:\\SF9k1T<0E@fX9BG[]g0nY7k[Qmi@la8`PF0j6@Q?Ii7bLkXQ<lLHf]`:DCh@9JY5>hEVLTdhL\\b1EB0lLh<=WaO@F<;8g<d:@e:LA:cFIEdmQh7hNHfSRToW?8N4:Z1K;XEDRO;OIDh<UdVln?bjgL>?VE98[B\\K<BVjkG8LiSX;fb>jf?DUK00Aih<WY6QD6cEnHBZ8iN_fd<G8Ci`11RUW2QlW]IXV:m?;J0GXXHfGNQ>:D`=fLPbO?VOTEYLj^cNj5PM>jKB5HVjJ4U7lXaTQNL9<@\\1`m\\Ug@VQHd7>jW=ca0`miF7;N0F=GjoQ`RFchKMGTmn8cF@Oh4GGCm7m2`U9j93Tb>=kSERjE_J939F01I1;`<ijk_=_Vn=7RVAI6fnQI5KlF:C44bN<<8K=Z<2TP<1]5?<dB>^LA=ebloE2Y2:9lkh0\\<YKbHD97iE`<C5oj^1>X:??`H6BXF2hG1Q[dF0Q=>W=J?7C\\k1T?<;R44oW?1hY^G8Zm]ZKnfOf0eCFYo6?=D8?<`6HU5SXh1;=:23LmV_FSi;OJfV<^?GkIDPISeHg1LaGE:V3Y3K3H<QJfbY?=;ldZRhnhQT_mGXDLFXXhSONE6Do_0iNZagB:BPGOTH;VhHUTd6LhQm^[;dO]5Hlkg<R:F<Kn\\:I:EGojgWZ2X@SYO_dlH;G8S<>oEKabY`:oU;=JW7ig?S?EYb86b7n8ce\\]IRa]koiWY<RfO;5kUI;7lVeC?[@ZaXDiF04B8R]bg@>O<mQDoUcBLcf^f>m2kMBUloD>Ze@NN^Z11TM`inXYhE_I=kA`:ZF4d\\>`L@;ZP[`ENU5cL[BV6\\Z?Di76:jg3hE6oG6jFc8kP=[GS1;WSedYQW1:U4\\OF32GgmMC<AjO]872bdBb`bKAA?8j78b>T3VfcUB2m4J^CPRU;8dScI]LU]^bBYA5_3:Y0N5i^?200000".charCodeAt(J/6|0)-48&1<<J%6)oz(this.states,this.index,X,Y);this.index=G2(this.states,this.index)}oz(this.states,this.index,X,Y)}};function oz(Q,X,Y,J){let $=0;if(J>=X){for(;$<624-J;$++)Q[$+X]^=Y[$+J];for(;$<624-X;$++)Q[$+X]^=Y[$+J-624];for(;$<624;$++)Q[$+X-624]^=Y[$+J-624]}else{for(;$<624-X;$++)Q[$+X]^=Y[$+J];for(;$<624-J;$++)Q[$+X-624]^=Y[$+J];for(;$<624;$++)Q[$+X-624]^=Y[$+J-624]}}function G2(Q,X){if(X<227){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397]^Y>>>1^-(Y&1)&2567483615,X+1}else if(X<623){let Y=Q[X]&2147483648|Q[X+1]&2147483647;return Q[X]=Q[X+397-624]^Y>>>1^-(Y&1)&2567483615,X+1}else{let Y=Q[X]&2147483648|Q[0]&2147483647;return Q[X]=Q[396]^Y>>>1^-(Y&1)&2567483615,0}}function gk(Q){for(let X=0;X!==624;++X)G2(Q,X)}function nz(Q){let X=[Q|0];for(let Y=1;Y!==624;++Y){let J=X[Y-1]^X[Y-1]>>>30;X.push(Math.imul(1812433253,J)+Y|0)}return gk(X),new bk(X,0)}var hk=class Q{constructor(X,Y,J,$){this.s01=X,this.s00=Y,this.s11=J,this.s10=$}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00^this.s00<<23,Y=this.s01^(this.s01<<23|this.s00>>>9),J=X^this.s10^(X>>>18|Y<<14)^(this.s10>>>5|this.s11<<27),$=Y^this.s11^Y>>>18^this.s11>>>5,G=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=$,this.s10=J,G}jump(){let X=0,Y=0,J=0,$=0,G=[1667051007,2321340297,1548169110,304075285];for(let Z=0;Z!==4;++Z)for(let K=1;K;K<<=1){if(G[Z]&K)X^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function HZ(Q){return new hk(-1,~Q,Q|0,0)}var mk=class Q{constructor(X,Y,J,$){this.s01=X,this.s00=Y,this.s11=J,this.s10=$}clone(){return new Q(this.s01,this.s00,this.s11,this.s10)}next(){let X=this.s00+this.s10|0,Y=this.s10^this.s00,J=this.s11^this.s01,$=this.s00,G=this.s01;return this.s00=$<<24^G>>>8^Y^Y<<16,this.s01=G<<24^$>>>8^J^(J<<16|Y>>>16),this.s10=J<<5^Y>>>27,this.s11=Y<<5^J>>>27,X}jump(){let X=0,Y=0,J=0,$=0,G=[3639956645,3750757012,1261568508,386426335];for(let Z=0;Z!==4;++Z)for(let K=1;K;K<<=1){if(G[Z]&K)X^=this.s01,Y^=this.s00,J^=this.s11,$^=this.s10;this.next()}this.s01=X,this.s00=Y,this.s11=J,this.s10=$}getState(){return[this.s01,this.s00,this.s11,this.s10]}};function iz(Q){return new mk(-1,~Q,Q|0,0)}function az(Q,X){for(let Y=0;Y!==X;++Y)Q.next()}var sz=BigInt,dk=4294967296n;function ez(Q,X,Y){let J=Y-X+1n,$=dk,G=1;while($<J)$<<=32n,++G;let Z=tz(G,Q);if(Z<J)return Z+X;if(Z+J<$)return Z%J+X;let K=$-$%J;while(Z>=K)Z=tz(G,Q);return Z%J+X}function tz(Q,X){let Y=sz(X.next()+2147483648);for(let J=1;J<Q;++J){let $=X.next();Y=(Y<<32n)+sz($+2147483648)}return Y}function YX(Q,X){let Y=X>2?~~(4294967296/X)*X:4294967296,J=Q.next()+2147483648;while(J>=Y)J=Q.next()+2147483648;return J%X}function VZ(Q,X){if(X<0){let Y=-X;Q.sign=-1,Q.data[0]=~~(Y/4294967296),Q.data[1]=Y>>>0}else Q.sign=1,Q.data[0]=~~(X/4294967296),Q.data[1]=X>>>0;return Q}function pk(Q,X,Y){let J=X.data[1],$=X.data[0],G=X.sign,Z=Y.data[1],K=Y.data[0],W=Y.sign;if(Q.sign=1,G===1&&W===-1){let P=J+Z,L=$+K+(P>4294967295?1:0);return Q.data[0]=L>>>0,Q.data[1]=P>>>0,Q}let H=J,_=$,V=Z,q=K;if(G===-1)H=Z,_=K,V=J,q=$;let D=0,U=H-V;if(U<0)D=1,U=U>>>0;return Q.data[0]=_-q-D,Q.data[1]=U,Q}function ck(Q,X,Y){let J=Y[0]+1;X[0]=YX(Q,J),X[1]=YX(Q,4294967296);while(X[0]>=Y[0]&&(X[0]!==Y[0]||X[1]>=Y[1]))X[0]=YX(Q,J),X[1]=YX(Q,4294967296);return X}var fk=Number.MAX_SAFE_INTEGER,uk={sign:1,data:[0,0]},lk={sign:1,data:[0,0]},QF={sign:1,data:[0,0]},_Z=[0,0];function rk(Q,X,Y,J){let $=J<=fk?VZ(QF,J):pk(QF,VZ(uk,Y),VZ(lk,X));if($.data[1]===4294967295)$.data[0]+=1,$.data[1]=0;else $.data[1]+=1;return ck(Q,_Z,$.data),_Z[0]*4294967296+_Z[1]+X}function Z2(Q,X,Y){let J=Y-X;if(J<=4294967295)return YX(Q,J+1)+X;return rk(Q,X,Y,J)}var XF=Symbol.for("fast-check/PreconditionFailure"),Q6=class extends Error{constructor(Q=!1){super();this.interruptExecution=Q,this.footprint=XF}static isFailure(Q){return Q!==null&&Q!==void 0&&Q.footprint===XF}};function ok(Q){if(!Q)throw new Q6}var nk=class{[Symbol.iterator](){return this}next(Q){return{value:Q,done:!0}}},ik=new nk;function ak(){return ik}function*sk(Q,X){for(let Y of Q)yield X(Y)}function*tk(Q,X){for(let Y of Q)yield*X(Y)}function*ek(Q,X){for(let Y of Q)if(X(Y))yield Y}function*Qy(Q,X){for(let Y=0;Y<X;++Y){let J=Q.next();if(J.done)break;yield J.value}}function*Xy(Q,X){let Y=Q.next();while(!Y.done&&X(Y.value))yield Y.value,Y=Q.next()}function*Yy(Q,X){for(let Y=Q.next();!Y.done;Y=Q.next())yield Y.value;for(let Y of X)for(let J=Y.next();!J.done;J=Y.next())yield J.value}var Jy=Symbol.iterator,s=class Q{static nil(){return new Q(ak())}static of(...X){return new Q(X[Jy]())}constructor(X){this.g=X}next(){return this.g.next()}[Symbol.iterator](){return this.g}map(X){return new Q(sk(this.g,X))}flatMap(X){return new Q(tk(this.g,X))}dropWhile(X){let Y=!1;function*J($){if(Y||!X($))Y=!0,yield $}return this.flatMap(J)}drop(X){if(X<=0)return this;let Y=0;function J(){return Y++<X}return this.dropWhile(J)}takeWhile(X){return new Q(Xy(this.g,X))}take(X){return new Q(Qy(this.g,X))}filter(X){return new Q(ek(this.g,X))}every(X){for(let Y of this.g)if(!X(Y))return!1;return!0}has(X){for(let Y of this.g)if(X(Y))return[!0,Y];return[!1,null]}join(...X){return new Q(Yy(this.g,X))}getNthOrLast(X){let Y=X,J=null;for(let $ of this.g){if(Y--===0)return $;J=$}return J}};function t4(Q){return new s(Q)}var r0=Symbol.for("fast-check/cloneMethod");function s6(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&r0 in Q&&typeof Q[r0]==="function"}function Z9(Q){return s6(Q)?Q[r0]():Q}var $y=Object.defineProperty,k=class{constructor(Q,X,Y){if(this.value_=Q,this.context=X,this.hasToBeCloned=Y!==void 0||s6(Q),this.readOnce=!1,this.value=Q,this.hasToBeCloned)$y(this,"value",{get:Y!==void 0?Y:this.getValue,enumerable:!1,configurable:!1})}getValue(){if(this.hasToBeCloned){if(!this.readOnce)return this.readOnce=!0,this.value_;return this.value_[r0]()}return this.value_}},C0=class{filter(Q){return new Ky(this,Q)}map(Q,X){return new Zy(this,Q,X)}chain(Q){return new Gy(this,Q)}},Gy=class extends C0{constructor(Q,X){super();this.arb=Q,this.chainer=X}generate(Q,X){let Y=Q.clone(),J=this.arb.generate(Q,X);return this.valueChainer(J,Q,Y,X)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(this.isSafeContext(X))return(!X.stoppedForOriginal?this.arb.shrink(X.originalValue,X.originalContext).map((Y)=>this.valueChainer(Y,X.clonedMrng.clone(),X.clonedMrng,X.originalBias)):s.nil()).join(X.chainedArbitrary.shrink(Q,X.chainedContext).map((Y)=>{let J={...X,chainedContext:Y.context,stoppedForOriginal:!0};return new k(Y.value_,J)}));return s.nil()}valueChainer(Q,X,Y,J){let $=this.chainer(Q.value_),G=$.generate(X,J),Z={originalBias:J,originalValue:Q.value_,originalContext:Q.context,stoppedForOriginal:!1,chainedArbitrary:$,chainedContext:G.context,clonedMrng:Y};return new k(G.value_,Z)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalBias"in Q&&"originalValue"in Q&&"originalContext"in Q&&"stoppedForOriginal"in Q&&"chainedArbitrary"in Q&&"chainedContext"in Q&&"clonedMrng"in Q}},Zy=class extends C0{constructor(Q,X,Y){super();this.arb=Q,this.mapper=X,this.unmapper=Y,this.bindValueMapper=(J)=>this.valueMapper(J)}generate(Q,X){let Y=this.arb.generate(Q,X);return this.valueMapper(Y)}canShrinkWithoutContext(Q){if(this.unmapper!==void 0)try{let X=this.unmapper(Q);return this.arb.canShrinkWithoutContext(X)}catch{return!1}return!1}shrink(Q,X){if(this.isSafeContext(X))return this.arb.shrink(X.originalValue,X.originalContext).map(this.bindValueMapper);if(this.unmapper!==void 0){let Y=this.unmapper(Q);return this.arb.shrink(Y,void 0).map(this.bindValueMapper)}return s.nil()}mapperWithCloneIfNeeded(Q){let X=Q.value,Y=this.mapper(X);if(Q.hasToBeCloned&&(typeof Y==="object"&&Y!==null||typeof Y==="function")&&Object.isExtensible(Y)&&!s6(Y))Object.defineProperty(Y,r0,{get:()=>()=>this.mapperWithCloneIfNeeded(Q)[0]});return[Y,X]}valueMapper(Q){let[X,Y]=this.mapperWithCloneIfNeeded(Q);return new k(X,{originalValue:Y,originalContext:Q.context})}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalValue"in Q&&"originalContext"in Q}},Ky=class extends C0{constructor(Q,X){super();this.arb=Q,this.refinement=X,this.bindRefinementOnValue=(Y)=>this.refinementOnValue(Y)}generate(Q,X){while(!0){let Y=this.arb.generate(Q,X);if(this.refinementOnValue(Y))return Y}}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)&&this.refinement(Q)}shrink(Q,X){return this.arb.shrink(Q,X).filter(this.bindRefinementOnValue)}refinementOnValue(Q){return this.refinement(Q.value)}};function XP(Q){return typeof Q==="object"&&Q!==null&&"generate"in Q&&"shrink"in Q&&"canShrinkWithoutContext"in Q}function YP(Q){if(!XP(Q))throw Error("Unexpected value received: not an instance of Arbitrary")}var JP=Function.prototype.apply,qZ=Symbol("apply");function Wy(Q){try{return Q.apply}catch{return}}function Hy(Q,X,Y){let J=Q;J[qZ]=JP;let $=J[qZ](X,Y);return delete J[qZ],$}function V0(Q,X,Y){if(Wy(Q)===JP)return Q.apply(X,Y);return Hy(Q,X,Y)}var $P=Array,E=BigInt,Vy=BigInt64Array,_y=BigUint64Array,GP=Boolean,R2=Date,S=Error,ZP=Float32Array,KP=Float64Array,qy=Int8Array,Dy=Int16Array,By=Int32Array,_4=Number,L1=String,K9=Set,Uy=Uint8Array,Oy=Uint8ClampedArray,zy=Uint16Array,Fy=Uint32Array,Ly=encodeURIComponent,q4=Map,B2=Symbol,YF=Array.prototype.forEach,JF=Array.prototype.indexOf,$F=Array.prototype.join,GF=Array.prototype.map,ZF=Array.prototype.flat,KF=Array.prototype.filter,WF=Array.prototype.push,HF=Array.prototype.pop,VF=Array.prototype.splice,_F=Array.prototype.slice,qF=Array.prototype.sort,DF=Array.prototype.every;function Py(Q){try{return Q.forEach}catch{return}}function Ry(Q){try{return Q.indexOf}catch{return}}function Ny(Q){try{return Q.join}catch{return}}function My(Q){try{return Q.map}catch{return}}function Ay(Q){try{return Q.flat}catch{return}}function wy(Q){try{return Q.filter}catch{return}}function Cy(Q){try{return Q.push}catch{return}}function Ty(Q){try{return Q.pop}catch{return}}function Iy(Q){try{return Q.splice}catch{return}}function jy(Q){try{return Q.slice}catch{return}}function Ey(Q){try{return Q.sort}catch{return}}function Sy(Q){try{return Q.every}catch{return}}function WP(Q,X){if(Py(Q)===YF)return Q.forEach(X);return V0(YF,Q,[X])}function V4(Q,...X){if(Ry(Q)===JF)return Q.indexOf(...X);return V0(JF,Q,X)}function w0(Q,...X){if(Ny(Q)===$F)return Q.join(...X);return V0($F,Q,X)}function G0(Q,X){if(My(Q)===GF)return Q.map(X);return V0(GF,Q,[X])}function xy(Q,X){if(Ay(Q)===ZF)return[].flat(),Q.flat(X);return V0(ZF,Q,[X])}function vy(Q,X){if(wy(Q)===KF)return Q.filter(X);return V0(KF,Q,[X])}function x(Q,...X){if(Cy(Q)===WF)return Q.push(...X);return V0(WF,Q,X)}function HP(Q){if(Ty(Q)===HF)return Q.pop();return V0(HF,Q,[])}function VP(Q,...X){if(Iy(Q)===VF)return Q.splice(...X);return V0(VF,Q,X)}function s0(Q,...X){if(jy(Q)===_F)return Q.slice(...X);return V0(_F,Q,X)}function _P(Q,...X){if(Ey(Q)===qF)return Q.sort(...X);return V0(qF,Q,X)}function qP(Q,...X){if(Sy(Q)===DF)return Q.every(...X);return V0(DF,Q,X)}var BF=Date.prototype.getTime,UF=Date.prototype.toISOString;function ky(Q){try{return Q.getTime}catch{return}}function yy(Q){try{return Q.toISOString}catch{return}}function N2(Q){if(ky(Q)===BF)return Q.getTime();return V0(BF,Q,[])}function by(Q){if(yy(Q)===UF)return Q.toISOString();return V0(UF,Q,[])}var OF=Set.prototype.add,zF=Set.prototype.has;function gy(Q){try{return Q.add}catch{return}}function hy(Q){try{return Q.has}catch(X){return}}function KX(Q,X){if(gy(Q)===OF)return Q.add(X);return V0(OF,Q,[X])}function M2(Q,X){if(hy(Q)===zF)return Q.has(X);return V0(zF,Q,[X])}var FF=WeakMap.prototype.set,LF=WeakMap.prototype.get;function my(Q){try{return Q.set}catch(X){return}}function dy(Q){try{return Q.get}catch(X){return}}function py(Q,X,Y){if(my(Q)===FF)return Q.set(X,Y);return V0(FF,Q,[X,Y])}function cy(Q,X){if(dy(Q)===LF)return Q.get(X);return V0(LF,Q,[X])}var PF=Map.prototype.set,RF=Map.prototype.get,NF=Map.prototype.has;function fy(Q){try{return Q.set}catch(X){return}}function uy(Q){try{return Q.get}catch(X){return}}function ly(Q){try{return Q.has}catch(X){return}}function L8(Q,X,Y){if(fy(Q)===PF)return Q.set(X,Y);return V0(PF,Q,[X,Y])}function c1(Q,X){if(uy(Q)===RF)return Q.get(X);return V0(RF,Q,[X])}function ry(Q,X){if(ly(Q)===NF)return Q.has(X);return V0(NF,Q,[X])}var MF=String.prototype.split,AF=String.prototype.startsWith,wF=String.prototype.endsWith,CF=String.prototype.substring,TF=String.prototype.toLowerCase,IF=String.prototype.toUpperCase,jF=String.prototype.padStart,EF=String.prototype.charCodeAt,SF=String.prototype.normalize,xF=String.prototype.replace;function oy(Q){try{return Q.split}catch{return}}function ny(Q){try{return Q.startsWith}catch{return}}function iy(Q){try{return Q.endsWith}catch{return}}function ay(Q){try{return Q.substring}catch{return}}function sy(Q){try{return Q.toLowerCase}catch{return}}function ty(Q){try{return Q.toUpperCase}catch{return}}function ey(Q){try{return Q.padStart}catch{return}}function Qb(Q){try{return Q.charCodeAt}catch{return}}function Xb(Q){try{return Q.normalize}catch(X){return}}function Yb(Q){try{return Q.replace}catch{return}}function P1(Q,...X){if(oy(Q)===MF)return Q.split(...X);return V0(MF,Q,X)}function Jb(Q,...X){if(ny(Q)===AF)return Q.startsWith(...X);return V0(AF,Q,X)}function $b(Q,...X){if(iy(Q)===wF)return Q.endsWith(...X);return V0(wF,Q,X)}function S0(Q,...X){if(ay(Q)===CF)return Q.substring(...X);return V0(CF,Q,X)}function gZ(Q){if(sy(Q)===TF)return Q.toLowerCase();return V0(TF,Q,[])}function KK(Q){if(ty(Q)===IF)return Q.toUpperCase();return V0(IF,Q,[])}function Gb(Q,...X){if(ey(Q)===jF)return Q.padStart(...X);return V0(jF,Q,X)}function W9(Q,X){if(Qb(Q)===EF)return Q.charCodeAt(X);return V0(EF,Q,[X])}function Zb(Q,X){if(Xb(Q)===SF)return Q.normalize(X);return V0(SF,Q,[X])}function Kb(Q,X,Y){if(Yb(Q)===xF)return Q.replace(X,Y);return V0(xF,Q,[X,Y])}var vF=Number.prototype.toString;function Wb(Q){try{return Q.toString}catch{return}}function WX(Q,...X){if(Wb(Q)===vF)return Q.toString(...X);return V0(vF,Q,X)}var Hb=Object.prototype.hasOwnProperty,Vb=Object.prototype.toString;function DP(Q,X){return V0(Hb,Q,[X])}function hZ(Q){return V0(Vb,Q,[])}var _b=Error.prototype.toString;function qb(Q){return V0(_b,Q,[])}var Db=class{constructor(Q){this.producer=Q}[Symbol.iterator](){if(this.it===void 0)this.it=this.producer();return this.it}next(){if(this.it===void 0)this.it=this.producer();return this.it.next()}};function s4(Q){return new Db(Q)}var BP=Array.isArray,Bb=Object.defineProperty;function UP(Q,X){return Bb(Q,r0,{value:()=>{let Y=[];for(let J=0;J!==X.length;++J)x(Y,X[J].value);return UP(Y,X),Y}})}function OP(Q){let X=!1,Y=[],J=[];for(let $=0;$!==Q.length;++$){let G=Q[$];X=X||G.hasToBeCloned,x(Y,G.value),x(J,G.context)}if(X)UP(Y,Q);return new k(Y,J)}function zP(Q,X,Y){let J=[],$=BP(Y)?Y:[];for(let G=0;G!==Q.length;++G)x(J,s4(()=>Q[G].shrink(X[G],$[G]).map((Z)=>{let K=G0(X,(W,H)=>new k(Z9(W),$[H]));return[...s0(K,0,G),Z,...s0(K,G+1)]}).map(OP)));return s.nil().join(...J)}var Ub=class extends C0{constructor(Q){super();this.arbs=Q;for(let X=0;X!==Q.length;++X){let Y=Q[X];if(Y===null||Y===void 0||Y.generate===null||Y.generate===void 0)throw Error(`Invalid parameter encountered at index ${X}: expecting an Arbitrary`)}}generate(Q,X){let Y=[];for(let J=0;J!==this.arbs.length;++J)x(Y,this.arbs[J].generate(Q,X));return OP(Y)}canShrinkWithoutContext(Q){if(!BP(Q)||Q.length!==this.arbs.length)return!1;for(let X=0;X!==this.arbs.length;++X)if(!this.arbs[X].canShrinkWithoutContext(Q[X]))return!1;return!0}shrink(Q,X){return zP(this.arbs,Q,X)}};function Q0(...Q){return new Ub(Q)}var Ob=Math.log;function FP(Q){return 2+~~(Ob(Q+1)*0.4342944819032518)}var WK={};function zb(Q){WK=Q}function P8(){return WK}function Fb(){WK={}}var HX=Symbol("UndefinedContextPlaceholder");function H9(Q){if(Q.context!==void 0)return Q;if(Q.hasToBeCloned)return new k(Q.value_,HX,()=>Q.value);return new k(Q.value_,HX)}var kF=()=>{},Lb=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{asyncBeforeEach:Y,asyncAfterEach:J,beforeEach:$,afterEach:G}=P8()||{};if(Y!==void 0&&$!==void 0)throw S(`Global "asyncBeforeEach" and "beforeEach" parameters can't be set at the same time when running async properties`);if(J!==void 0&&G!==void 0)throw S(`Global "asyncAfterEach" and "afterEach" parameters can't be set at the same time when running async properties`);this.beforeEachHook=Y||$||kF,this.afterEachHook=J||G||kF}isAsync(){return!0}generate(Q,X){return H9(this.arb.generate(Q,X!==void 0?FP(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return s.nil();let X=Q.context!==HX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(H9)}async runBeforeEach(){await this.beforeEachHook()}async runAfterEach(){await this.afterEachHook()}async run(Q){try{let X=await this.predicate(Q);return X===void 0||X===!0?null:{error:new S("Property failed by returning false")}}catch(X){if(Q6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}},LP=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return H9(this.arb.generate(Q,X))}canShrinkWithoutContext(Q){return!0}shrink(Q,X){if(X===void 0&&!this.arb.canShrinkWithoutContext(Q))return s.nil();let Y=X!==HX?X:void 0;return this.arb.shrink(Q,Y).map(H9)}};function Pb(...Q){if(Q.length<2)throw Error("asyncProperty expects at least two parameters");let X=s0(Q,0,Q.length-1),Y=Q[Q.length-1];return WP(X,YP),new Lb(Q0(...G0(X,(J)=>new LP(J))),(J)=>Y(...J))}var yF=()=>{},PP=class{constructor(Q,X){this.arb=Q,this.predicate=X;let{beforeEach:Y=yF,afterEach:J=yF,asyncBeforeEach:$,asyncAfterEach:G}=P8()||{};if($!==void 0)throw S(`"asyncBeforeEach" can't be set when running synchronous properties`);if(G!==void 0)throw S(`"asyncAfterEach" can't be set when running synchronous properties`);this.beforeEachHook=Y,this.afterEachHook=J}isAsync(){return!1}generate(Q,X){return H9(this.arb.generate(Q,X!==void 0?FP(X):void 0))}shrink(Q){if(Q.context===void 0&&!this.arb.canShrinkWithoutContext(Q.value_))return s.nil();let X=Q.context!==HX?Q.context:void 0;return this.arb.shrink(Q.value_,X).map(H9)}runBeforeEach(){this.beforeEachHook()}runAfterEach(){this.afterEachHook()}run(Q){try{let X=this.predicate(Q);return X===void 0||X===!0?null:{error:new S("Property failed by returning false")}}catch(X){if(Q6.isFailure(X))return X;return{error:X}}}beforeEach(Q){let X=this.beforeEachHook;return this.beforeEachHook=()=>Q(X),this}afterEach(Q){let X=this.afterEachHook;return this.afterEachHook=()=>Q(X),this}};function Rb(...Q){if(Q.length<2)throw Error("property expects at least two parameters");let X=s0(Q,0,Q.length-1),Y=Q[Q.length-1];return WP(X,YP),new PP(Q0(...G0(X,(J)=>new LP(J))),(J)=>Y(...J))}var Nb=function(Q){return Q[Q.None=0]="None",Q[Q.Verbose=1]="Verbose",Q[Q.VeryVerbose=2]="VeryVerbose",Q}({});function mZ(Q){if("unsafeNext"in Q){if(Q.unsafeJump===void 0)return{clone:()=>mZ(Q),next:()=>Q.unsafeNext(),getState:()=>Q.getState()};return{clone:()=>mZ(Q),next:()=>Q.unsafeNext(),jump:()=>Q.unsafeJump(),getState:()=>Q.getState()}}return Q}function RP(Q){if("jump"in Q&&typeof Q.jump==="function")return Q;return{clone:()=>RP(Q),next:()=>Q.next(),jump:()=>az(Q,42),getState:()=>Q.getState()}}function T2(Q){return RP(mZ(Q))}var Mb=Date.now,Ab=Math.min,wb=Math.random,Cb=class{constructor(Q){let X=Q||{};this.seed=Tb(X),this.randomType=Ib(X),this.numRuns=jb(X),this.verbose=Eb(X),this.maxSkipsPerRun=X.maxSkipsPerRun!==void 0?X.maxSkipsPerRun:100,this.timeout=BZ(X.timeout),this.skipAllAfterTimeLimit=BZ(X.skipAllAfterTimeLimit),this.interruptAfterTimeLimit=BZ(X.interruptAfterTimeLimit),this.markInterruptAsFailure=X.markInterruptAsFailure===!0,this.skipEqualValues=X.skipEqualValues===!0,this.ignoreEqualValues=X.ignoreEqualValues===!0,this.logger=X.logger!==void 0?X.logger:(Y)=>{console.log(Y)},this.path=X.path!==void 0?X.path:"",this.unbiased=X.unbiased===!0,this.examples=X.examples!==void 0?X.examples:[],this.endOnFailure=X.endOnFailure===!0,this.reporter=X.reporter,this.asyncReporter=X.asyncReporter,this.includeErrorInReport=X.includeErrorInReport===!0}toParameters(){return{seed:this.seed,randomType:this.randomType,numRuns:this.numRuns,maxSkipsPerRun:this.maxSkipsPerRun,timeout:this.timeout,skipAllAfterTimeLimit:this.skipAllAfterTimeLimit,interruptAfterTimeLimit:this.interruptAfterTimeLimit,markInterruptAsFailure:this.markInterruptAsFailure,skipEqualValues:this.skipEqualValues,ignoreEqualValues:this.ignoreEqualValues,path:this.path,logger:this.logger,unbiased:this.unbiased,verbose:this.verbose,examples:this.examples,endOnFailure:this.endOnFailure,reporter:this.reporter,asyncReporter:this.asyncReporter,includeErrorInReport:this.includeErrorInReport}}};function DZ(Q){return(X)=>{return T2(Q(X))}}function Tb(Q){if(Q.seed===void 0)return Mb()^wb()*4294967296;let X=Q.seed|0;if(Q.seed===X)return X;return X^(Q.seed-X)*4294967296}function Ib(Q){if(Q.randomType===void 0)return HZ;if(typeof Q.randomType==="string")switch(Q.randomType){case"mersenne":return DZ(nz);case"congruential":case"congruential32":return DZ(rz);case"xorshift128plus":return HZ;case"xoroshiro128plus":return iz;default:throw Error(`Invalid random specified: '${Q.randomType}'`)}let X=Q.randomType(0);if("min"in X&&X.min!==-2147483648)throw Error(`Invalid random number generator: min must equal -0x80000000, got ${String(X.min)}`);if("max"in X&&X.max!==2147483647)throw Error(`Invalid random number generator: max must equal 0x7fffffff, got ${String(X.max)}`);if(X===T2(X))return Q.randomType;return DZ(Q.randomType)}function jb(Q){if(Q.numRuns!==void 0)return Q.numRuns;if(Q.num_runs!==void 0)return Q.num_runs;return 100}function Eb(Q){if(Q.verbose===void 0)return 0;if(typeof Q.verbose==="boolean")return Q.verbose===!0?1:0;if(Q.verbose<=0)return 0;if(Q.verbose>=2)return 2;return Q.verbose|0}function BZ(Q){if(Q===void 0)return;return Ab(Q,2147483647)}function HK(Q){return new Cb(Q)}function Sb(Q,X,Y){let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=X(()=>{$(new Q6(!0))},Q)})}}var bF=class{constructor(Q,X,Y,J,$,G){this.property=Q,this.getTime=X,this.interruptExecution=J,this.setTimeoutSafe=$,this.clearTimeoutSafe=G,this.skipAfterTime=this.getTime()+Y}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=this.skipAfterTime-this.getTime();if(X<=0){let Y=new Q6(this.interruptExecution);if(this.isAsync())return Promise.resolve(Y);else return Y}if(this.interruptExecution&&this.isAsync()){let Y=Sb(X,this.setTimeoutSafe,this.clearTimeoutSafe),J=Promise.race([this.property.run(Q),Y.promise]);return J.then(Y.clear,Y.clear),J}return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},xb=(Q,X,Y)=>{let J=null;return{clear:()=>Y(J),promise:new Promise(($)=>{J=X(()=>{$({error:new S(`Property timeout: exceeded limit of ${Q} milliseconds`)})},Q)})}},vb=class{constructor(Q,X,Y,J){this.property=Q,this.timeMs=X,this.setTimeoutSafe=Y,this.clearTimeoutSafe=J}isAsync(){return!0}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}async run(Q){let X=xb(this.timeMs,this.setTimeoutSafe,this.clearTimeoutSafe),Y=Promise.race([this.property.run(Q),X.promise]);return Y.then(X.clear,X.clear),Y}runBeforeEach(){return Promise.resolve(this.property.runBeforeEach())}runAfterEach(){return Promise.resolve(this.property.runAfterEach())}},NP=class{constructor(Q){this.property=Q}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,void 0)}shrink(Q){return this.property.shrink(Q)}run(Q){return this.property.run(Q)}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},gF=Array.from,hF=typeof Buffer<"u"?Buffer.isBuffer:void 0,Y9=JSON.stringify,mF=Number.isNaN,kb=Object.keys,yb=Object.getOwnPropertySymbols,bb=Object.getOwnPropertyDescriptor,dF=Object.getPrototypeOf,pF=Number.NEGATIVE_INFINITY,gb=Number.POSITIVE_INFINITY,R8=Symbol.for("fast-check/toStringMethod");function VK(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&R8 in Q&&typeof Q[R8]==="function"}var D4=Symbol.for("fast-check/asyncToStringMethod");function _K(Q){return Q!==null&&(typeof Q==="object"||typeof Q==="function")&&D4 in Q&&typeof Q[D4]==="function"}var hb=/^Symbol\((.*)\)$/;function mb(Q){if(Q.description!==void 0)return Q.description;let X=hb.exec(L1(Q));return X&&X[1].length?X[1]:null}function cF(Q){switch(Q){case 0:return 1/Q===pF?"-0":"0";case pF:return"Number.NEGATIVE_INFINITY";case gb:return"Number.POSITIVE_INFINITY";default:return Q===Q?L1(Q):"Number.NaN"}}function db(Q){let X=-1;for(let Y in Q){let J=Number(Y);if(J!==X+1)return!0;X=J}return X+1!==Q.length}function p1(Q,X,Y){let J=[...X,Q];if(typeof Q==="object"){if(V4(X,Q)!==-1)return"[cyclic]"}if(_K(Q)){let $=Y(Q);if($.state==="fulfilled")return $.value}if(VK(Q))try{return Q[R8]()}catch{}switch(hZ(Q)){case"[object Array]":{let $=Q;if($.length>=50&&db($)){let Z=[];for(let K in $)if(!mF(Number(K)))x(Z,`${K}:${p1($[K],J,Y)}`);return Z.length!==0?`Object.assign(Array(${$.length}),{${w0(Z,",")}})`:`Array(${$.length})`}let G=w0(G0($,(Z)=>p1(Z,J,Y)),",");return $.length===0||$.length-1 in $?`[${G}]`:`[${G},]`}case"[object BigInt]":return`${Q}n`;case"[object Boolean]":{let $=Q==!0?"true":"false";return typeof Q==="boolean"?$:`new Boolean(${$})`}case"[object Date]":{let $=Q;return mF(N2($))?"new Date(NaN)":`new Date(${Y9(by($))})`}case"[object Map]":return`new Map(${p1(Array.from(Q),J,Y)})`;case"[object Null]":return"null";case"[object Number]":return typeof Q==="number"?cF(Q):`new Number(${cF(Number(Q))})`;case"[object Object]":{try{let G=Q.toString;if(typeof G==="function"&&G!==Object.prototype.toString)return Q.toString()}catch{return"[object Object]"}let $=(G)=>`${G==="__proto__"?'["__proto__"]':typeof G==="symbol"?`[${p1(G,J,Y)}]`:Y9(G)}:${p1(Q[G],J,Y)}`;return"{"+w0([...dF(Q)===null?["__proto__:null"]:[],...G0(kb(Q),$),...G0(vy(yb(Q),(G)=>{let Z=bb(Q,G);return Z&&Z.enumerable}),$)],",")+"}"}case"[object Set]":return`new Set(${p1(Array.from(Q),J,Y)})`;case"[object String]":return typeof Q==="string"?Y9(Q):`new String(${Y9(Q)})`;case"[object Symbol]":{let $=Q;if(B2.keyFor($)!==void 0)return`Symbol.for(${Y9(B2.keyFor($))})`;let G=mb($);if(G===null)return"Symbol()";return $===(G.startsWith("Symbol.")&&B2[G.substring(7)])?G:`Symbol(${Y9(G)})`}case"[object Promise]":{let $=Y(Q);switch($.state){case"fulfilled":return`Promise.resolve(${p1($.value,J,Y)})`;case"rejected":return`Promise.reject(${p1($.value,J,Y)})`;case"pending":return"new Promise(() => {/*pending*/})";default:return"new Promise(() => {/*unknown*/})"}}case"[object Error]":if(Q instanceof Error)return`new Error(${p1(Q.message,J,Y)})`;break;case"[object Undefined]":return"undefined";case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object BigInt64Array]":case"[object BigUint64Array]":{if(typeof hF==="function"&&hF(Q))return`Buffer.from(${Q.buffer.detached?"/*detached ArrayBuffer*/":p1(gF(Q.values()),J,Y)})`;let $=dF(Q),G=$&&$.constructor&&$.constructor.name;if(typeof G==="string"){let Z=Q;if(Z.buffer.detached)return`${G}.from(/*detached ArrayBuffer*/)`;return`${G}.from(${p1(gF(Z.values()),J,Y)})`}break}}try{return Q.toString()}catch{return hZ(Q)}}function b0(Q){return p1(Q,[],()=>({state:"unknown",value:void 0}))}function MP(Q){let X=B2(),Y=[],J=new q4;function $(){let W=null,H=()=>{if(W!==null)clearTimeout(W)};return{delay:new Promise((_)=>{W=setTimeout(()=>{W=null,_(X)},0)}),cancel:H}}let G={state:"unknown",value:void 0},Z=function(H){let _=H;if(J.has(_))return J.get(_);let V=$(),q=D4 in H?Promise.resolve().then(()=>H[D4]()):H;return q.catch(()=>{}),Y.push(Promise.race([q,V.delay]).then((D)=>{if(D===X)J.set(_,{state:"pending",value:void 0});else J.set(_,{state:"fulfilled",value:D});V.cancel()},(D)=>{J.set(_,{state:"rejected",value:D}),V.cancel()})),J.set(_,G),G};function K(){let W=p1(Q,[],Z);if(Y.length===0)return W;return Promise.all(Y.splice(0)).then(K)}return K()}async function qK(Q){return Promise.resolve(MP(Q))}function fF(Q){return Q===null?new Q6:Q}function pb(...Q){if(Q[1])return Q[0].then(fF);return fF(Q[0])}function cb(Q,X){return pb(Q,X)}var uF=class{constructor(Q,X){this.property=Q,this.skipRuns=X,this.coveredCases=new Map}isAsync(){return this.property.isAsync()}generate(Q,X){return this.property.generate(Q,X)}shrink(Q){return this.property.shrink(Q)}run(Q){let X=b0(Q);if(this.coveredCases.has(X)){let J=this.coveredCases.get(X);if(!this.skipRuns)return J;return cb(J,this.property.isAsync())}let Y=this.property.run(Q);return this.coveredCases.set(X,Y),Y}runBeforeEach(){return this.property.runBeforeEach()}runAfterEach(){return this.property.runAfterEach()}},lF=Date.now,UZ=setTimeout,OZ=clearTimeout;function fb(Q,X){let Y=Q;if(Q.isAsync()&&X.timeout!==void 0)Y=new vb(Y,X.timeout,UZ,OZ);if(X.unbiased)Y=new NP(Y);if(X.skipAllAfterTimeLimit!==void 0)Y=new bF(Y,lF,X.skipAllAfterTimeLimit,!1,UZ,OZ);if(X.interruptAfterTimeLimit!==void 0)Y=new bF(Y,lF,X.interruptAfterTimeLimit,!0,UZ,OZ);if(X.skipEqualValues)Y=new uF(Y,!0);if(X.ignoreEqualValues)Y=new uF(Y,!1);return Y}var ub=function(Q){return Q[Q.Success=0]="Success",Q[Q.Skipped=-1]="Skipped",Q[Q.Failure=1]="Failure",Q}({}),lb=class Q{constructor(X,Y){this.verbosity=X,this.interruptedAsFailure=Y,this.rootExecutionTrees=[],this.currentLevelExecutionTrees=this.rootExecutionTrees,this.failure=null,this.numSkips=0,this.numSuccesses=0,this.interrupted=!1}appendExecutionTree(X,Y){let J={status:X,value:Y,children:[]};return this.currentLevelExecutionTrees.push(J),J}fail(X,Y,J){if(this.verbosity>=1){let $=this.appendExecutionTree(1,X);this.currentLevelExecutionTrees=$.children}if(this.pathToFailure===void 0)this.pathToFailure=`${Y}`;else this.pathToFailure+=`:${Y}`;this.value=X,this.failure=J}skip(X){if(this.verbosity>=2)this.appendExecutionTree(-1,X);if(this.pathToFailure===void 0)++this.numSkips}success(X){if(this.verbosity>=2)this.appendExecutionTree(0,X);if(this.pathToFailure===void 0)++this.numSuccesses}interrupt(){this.interrupted=!0}isSuccess(){return this.pathToFailure===void 0}firstFailure(){return this.pathToFailure!==void 0?+P1(this.pathToFailure,":")[0]:-1}numShrinks(){return this.pathToFailure!==void 0?P1(this.pathToFailure,":").length-1:0}extractFailures(){if(this.isSuccess())return[];let X=[],Y=this.rootExecutionTrees;while(Y.length>0&&Y[Y.length-1].status===1){let J=Y[Y.length-1];X.push(J.value),Y=J.children}return X}static mergePaths(X,Y){if(X.length===0)return Y;let J=X.split(":"),$=Y.split(":"),G=+J[J.length-1]+ +$[0];return[...J.slice(0,J.length-1),`${G}`,...$.slice(1)].join(":")}toRunDetails(X,Y,J,$){if(!this.isSuccess())return{failed:!0,interrupted:this.interrupted,numRuns:this.firstFailure()+1-this.numSkips,numSkips:this.numSkips,numShrinks:this.numShrinks(),seed:X,counterexample:this.value,counterexamplePath:Q.mergePaths(Y,this.pathToFailure),errorInstance:this.failure.error,failures:this.extractFailures(),executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()};let G=this.interruptedAsFailure||this.numSuccesses===0;return{failed:this.numSkips>J||this.interrupted&&G,interrupted:this.interrupted,numRuns:this.numSuccesses,numSkips:this.numSkips,numShrinks:0,seed:X,counterexample:null,counterexamplePath:null,error:null,errorInstance:null,failures:[],executionSummary:this.rootExecutionTrees,verbose:this.verbosity,runConfiguration:$.toParameters()}}},AP=class{constructor(Q,X,Y,J){this.sourceValues=Q,this.shrink=X,this.runExecution=new lb(Y,J),this.currentIdx=-1,this.nextValues=Q}[Symbol.iterator](){return this}next(){let Q=this.nextValues.next();if(Q.done||this.runExecution.interrupted)return{done:!0,value:void 0};return this.currentValue=Q.value,++this.currentIdx,{done:!1,value:Q.value.value_}}handleResult(Q){if(Q!==null&&typeof Q==="object"&&!Q6.isFailure(Q))this.runExecution.fail(this.currentValue.value_,this.currentIdx,Q),this.currentIdx=-1,this.nextValues=this.shrink(this.currentValue);else if(Q!==null)if(!Q.interruptExecution)this.runExecution.skip(this.currentValue.value_),this.sourceValues.skippedOne();else this.runExecution.interrupt();else this.runExecution.success(this.currentValue.value_)}},rb=class{constructor(Q,X,Y){this.initialValues=Q,this.maxInitialIterations=X,this.remainingSkips=Y}[Symbol.iterator](){return this}next(){if(--this.maxInitialIterations!==-1&&this.remainingSkips>=0){let Q=this.initialValues.next();if(!Q.done)return{value:Q.value,done:!1}}return{value:void 0,done:!0}}skippedOne(){--this.remainingSkips,++this.maxInitialIterations}},ob=-2147483648,nb=2147483647,ib=Math.pow(2,27),ab=Math.pow(2,-53),DK=class Q{constructor(X){this.internalRng=T2(X.clone())}clone(){return new Q(this.internalRng)}next(X){return Z2(this.internalRng,0,(1<<X)-1)}nextBoolean(){return Z2(this.internalRng,0,1)===1}nextInt(X,Y){return Z2(this.internalRng,X===void 0?ob:X,Y===void 0?nb:Y)}nextBigInt(X,Y){return ez(this.internalRng,X,Y)}nextDouble(){let X=this.next(26),Y=this.next(27);return(X*ib+Y)*ab}getState(){if("getState"in this.internalRng&&typeof this.internalRng.getState==="function")return this.internalRng.getState()}};function sb(Q,X,Y){return X.jump(),Q.generate(new DK(X),Y)}function*wP(Q,X,Y,J){for(let $=0;$!==J.length;++$)yield new k(J[$],void 0);for(let $=0,G=Y(X);;++$)yield sb(Q,G,$)}function tb(Q,X,Y){return()=>Q.generate(new DK(X),Y)}function*CP(Q,X,Y,J){yield*G0(J,(Z)=>()=>new k(Z,void 0));let $=0,G=T2(Y(X));for(;;)G.jump(),yield tb(Q,G,$++)}function rF(Q){return Q()}function TP(Q,X,Y){let J=X,$=Q.split(":").map((Z)=>+Z);if($.length===0)return J.map(rF);if(!$.every((Z)=>!Number.isNaN(Z)))throw Error(`Unable to replay, got invalid path=${Q}`);let G=J.drop($[0]).map(rF);for(let Z of $.slice(1)){let K=G.getNthOrLast(0);if(K===null)throw Error(`Unable to replay, got wrong path=${Q}`);G=Y(K).drop(Z)}return G}var eb=Object.assign;function Qg(Q){if(Q.length===1)return`Hint: ${Q[0]}`;return Q.map((X,Y)=>`Hint (${Y+1}): ${X}`).join(`
30
+ `)}function Xg(Q,X){return`Encountered failures were:
31
+ - ${Q.map(X).join(`
32
+ - `)}`}function BK(Q,X){let Y=[],J=[];for(let $=Q.length-1;$>=0;--$)J.push({depth:1,tree:Q[$]});while(J.length!==0){let $=J.pop(),G=$.tree,Z=$.depth,K=G.status===0?"\x1B[32m\u221A\x1B[0m":G.status===1?"\x1B[31m\xD7\x1B[0m":"\x1B[33m!\x1B[0m",W=Z!==0?". ".repeat(Z-1):"";Y.push(`${W}${K} ${X(G.value)}`);for(let H=G.children.length-1;H>=0;--H)J.push({depth:Z+1,tree:G.children[H]})}return`Execution summary:
33
33
  ${Y.join(`
34
- `)}`}function pb(X,Q){let Y=`Failed to run property, too many pre-condition failures encountered
35
- { seed: ${X.seed} }
34
+ `)}`}function Yg(Q,X){let Y=`Failed to run property, too many pre-condition failures encountered
35
+ { seed: ${Q.seed} }
36
36
 
37
- Ran ${X.numRuns} time(s)
38
- Skipped ${X.numSkips} time(s)`,J=null,$=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];if(X.verbose>=z1.VeryVerbose)J=TK(X.executionSummary,Q);else S($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function db(X){if(X instanceof E&&X.stack!==void 0)return X.stack;try{return F1(X)}catch(Q){}if(X instanceof E)try{return ty(X)}catch(Q){}if(X!==null&&typeof X==="object")try{return sZ(X)}catch(Q){}return"Failed to serialize errorInstance"}function cb(X,Q){let Y=X.runConfiguration.includeErrorInReport?`
39
- Got ${oy(db(X.errorInstance),/^Error: /,"error: ")}`:"",J=`Property failed after ${X.numRuns} tests
40
- { seed: ${X.seed}, path: "${X.counterexamplePath}", endOnFailure: true }
41
- Counterexample: ${Q(X.counterexample)}
42
- Shrunk ${X.numShrinks} time(s)${Y}`,$=null,G=[];if(X.verbose>=z1.VeryVerbose)$=TK(X.executionSummary,Q);else if(X.verbose===z1.Verbose)$=mb(X.failures,Q);else S(G,"Enable verbose mode in order to have the list of all failing values encountered during the run");return{message:J,details:$,hints:G}}function fb(X,Q){let Y=`Property interrupted after ${X.numRuns} tests
43
- { seed: ${X.seed} }`,J=null,$=[];if(X.verbose>=z1.VeryVerbose)J=TK(X.executionSummary,Q);else S($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function eZ(X,Q){if(!X.failed)return;let{message:Y,details:J,hints:$}=X.counterexamplePath===null?X.interrupted?fb(X,Q):pb(X,Q):cb(X,Q),G=Y;if(J!==null)G+=`
37
+ Ran ${Q.numRuns} time(s)
38
+ Skipped ${Q.numSkips} time(s)`,J=null,$=["Try to reduce the number of rejected values by combining map, chain and built-in arbitraries","Increase failure tolerance by setting maxSkipsPerRun to an higher value"];if(Q.verbose>=2)J=BK(Q.executionSummary,X);else x($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function Jg(Q){if(Q instanceof S&&Q.stack!==void 0)return Q.stack;try{return L1(Q)}catch(X){}if(Q instanceof S)try{return qb(Q)}catch(X){}if(Q!==null&&typeof Q==="object")try{return hZ(Q)}catch(X){}return"Failed to serialize errorInstance"}function $g(Q,X){let Y=Q.runConfiguration.includeErrorInReport?`
39
+ Got ${Kb(Jg(Q.errorInstance),/^Error: /,"error: ")}`:"",J=`Property failed after ${Q.numRuns} tests
40
+ { seed: ${Q.seed}, path: "${Q.counterexamplePath}", endOnFailure: true }
41
+ Counterexample: ${X(Q.counterexample)}
42
+ Shrunk ${Q.numShrinks} time(s)${Y}`,$=null,G=[];if(Q.verbose>=2)$=BK(Q.executionSummary,X);else if(Q.verbose===1)$=Xg(Q.failures,X);else x(G,"Enable verbose mode in order to have the list of all failing values encountered during the run");return{message:J,details:$,hints:G}}function Gg(Q,X){let Y=`Property interrupted after ${Q.numRuns} tests
43
+ { seed: ${Q.seed} }`,J=null,$=[];if(Q.verbose>=2)J=BK(Q.executionSummary,X);else x($,"Enable verbose mode at level VeryVerbose in order to check all generated values and their associated status");return{message:Y,details:J,hints:$}}function dZ(Q,X){if(!Q.failed)return;let{message:Y,details:J,hints:$}=Q.counterexamplePath===null?Q.interrupted?Gg(Q,X):Yg(Q,X):$g(Q,X),G=Y;if(J!==null)G+=`
44
44
 
45
45
  ${J}`;if($.length>0)G+=`
46
46
 
47
- ${hb($)}`;return G}function gP(X){return eZ(X,g0)}async function hP(X){let Q=[];function Y(Z){let K=vP(Z);if(typeof K==="string")return K;return Q.push(Promise.all([Z,K])),"\u2026"}let J=eZ(X,Y);if(Q.length===0)return J;let $=new D4(await Promise.all(Q));function G(Z){let K=d1($,Z);if(K!==void 0)return K;return g0(Z)}return eZ(X,G)}function mP(X,Q){if(Q.runConfiguration.includeErrorInReport)throw new E(X);let Y=new E(X,{cause:Q.errorInstance});if(!("cause"in Y))gb(Y,{cause:Q.errorInstance});return Y}function ub(X){if(!X.failed)return;throw mP(gP(X),X)}async function lb(X){if(!X.failed)return;throw mP(await hP(X),X)}function rb(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return ub(X)}async function ob(X){if(X.runConfiguration.asyncReporter)return X.runConfiguration.asyncReporter(X);else if(X.runConfiguration.reporter)return X.runConfiguration.reporter(X);else return lb(X)}function nb(X,Q,Y,J,$){let G=new xP(Y,Q,J,$);for(let Z of G){X.runBeforeEach();let K=X.run(Z);X.runAfterEach(),G.handleResult(K)}return G.runExecution}async function ib(X,Q,Y,J,$){let G=new xP(Y,Q,J,$);for(let Z of G){await X.runBeforeEach();let K=await X.run(Z);await X.runAfterEach(),G.handleResult(K)}return G.runExecution}function pP(X,Q){if(X===null||X===void 0||X.generate===null||X.generate===void 0)throw Error("Invalid property encountered, please use a valid property");if(X.run===null||X.run===void 0)throw Error("Invalid property encountered, please use a valid property not an arbitrary");let Y=NK({...N8(),...Q});if(Y.reporter!==void 0&&Y.asyncReporter!==void 0)throw Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(Y.asyncReporter!==void 0&&!X.isAsync())throw Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let J=Ib(X,Y),$=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,G=Y.numRuns*Y.maxSkipsPerRun,Z=(...H)=>J.shrink(...H),K=new Eb(Y.path.length===0?kP(J,Y.seed,Y.randomType,Y.examples):bP(Y.path,s4(yP(J,Y.seed,Y.randomType,Y.examples)),Z),$,G),W=!Y.endOnFailure?Z:Q0.nil;return J.isAsync()?ib(J,W,K,Y.verbose,Y.markInterruptAsFailure).then((H)=>H.toRunDetails(Y.seed,Y.path,G,Y)):nb(J,W,K,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,G,Y)}function ab(X,Q){let Y=pP(X,Q);if(X.isAsync())return Y.then(ob);else rb(Y)}function sb(X,Q){let Y=!Object.prototype.hasOwnProperty.call(X,"isAsync")?new jP(X,()=>!0):X;return Q.unbiased===!0?new SP(Y):Y}function dP(X,Q){let Y=NK(typeof Q==="number"?{...N8(),numRuns:Q}:{...N8(),...Q}),J=sb(X,Y),$=J.shrink.bind(J);return(Y.path.length===0?s4(kP(J,Y.seed,Y.randomType,Y.examples)):bP(Y.path,s4(yP(J,Y.seed,Y.randomType,Y.examples)),$)).take(Y.numRuns).map((G)=>G.value_)}function tb(X,Q){return[...dP(X,Q)]}function eb(X){return(Math.round(X*100)/100).toFixed(2)}function Xg(X,Q,Y){let J=NK(typeof Y==="number"?{...N8(),numRuns:Y}:{...N8(),...Y}),$={};for(let W of dP(X,Y)){let H=Q(W),_=Array.isArray(H)?H:[H];for(let V of _)$[V]=($[V]||0)+1}let G=Object.entries($).sort((W,H)=>H[1]-W[1]).map((W)=>[W[0],`${eb(W[1]*100/J.numRuns)}%`]),Z=G.map((W)=>W[0].length).reduce((W,H)=>Math.max(W,H),0),K=G.map((W)=>W[1].length).reduce((W,H)=>Math.max(W,H),0);for(let W of G)J.logger(`${W[0].padEnd(Z,".")}..${W[1].padStart(K,".")}`)}var Qg=Object.assign;function XK(X,Q,Y,J){let $=Y(),G=X.clone(),Z={mrng:X.clone(),biasFactor:Q,history:[]},K=(H)=>{let _=$[Z.history.length];if(_!==void 0&&_.arb===H){let q=_.value;return S(Z.history,{arb:H,value:q,context:_.context,mrng:_.mrng}),G=_.mrng.clone(),q}let V=H.generate(G,Q);return S(Z.history,{arb:H,value:V.value_,context:V.context,mrng:G.clone()}),V.value};return new k(Qg((H,..._)=>{return K(J(H,_))},{values(){return G0(Z.history,(H)=>H.value)},[r0](){return XK(X,Q,Y,J).value},[M8](){return g0(G0(Z.history,(H)=>H.value))}}),Z)}var EZ=Array.isArray,YL=Object.keys,Yg=Object.is;function Jg(X){let Q=new D4;return function(J,$){let G=d1(Q,J);if(G===void 0){let W=J(...$);return R8(Q,J,[{args:$,value:W}]),W}let Z=G;for(let W of Z)if(X($,W.args))return W.value;let K=J(...$);return S(Z,{args:$,value:K}),K}}function cP(X,Q){if(X!==null&&typeof X==="object"&&Q!==null&&typeof Q==="object"){if(EZ(X)){if(!EZ(Q))return!1;if(X.length!==Q.length)return!1}else if(EZ(Q))return!1;if(YL(X).length!==YL(Q).length)return!1;for(let Y in X){if(!(Y in Q))return!1;if(!cP(X[Y],Q[Y]))return!1}return!0}else return Yg(X,Q)}var $g=class extends I0{constructor(...X){super(...X);this.arbitraryCache=Jg(cP)}generate(X,Q){return XK(X,Q,()=>[],this.arbitraryCache)}canShrinkWithoutContext(X){return!1}shrink(X,Q){if(Q===void 0)return Q0.nil();let Y=Q,J=Y.mrng,$=Y.biasFactor,G=Y.history;return CP(G.map((Z)=>Z.arb),G.map((Z)=>Z.value),G.map((Z)=>Z.context)).map((Z)=>{function K(){let{value:W,context:H}=Z;return G0(G,(_,V)=>({arb:_.arb,value:W[V],context:H[V],mrng:_.mrng}))}return XK(J,$,K,this.arbitraryCache)})}};function Gg(){return new $g}var{floor:Zg,log:JL}=Math;function Kg(X){return Zg(JL(X)/JL(2))}function Wg(X){if(X===j(0))return j(0);return j(F1(X).length)}function fP(X,Q,Y){if(X===Q)return[{min:X,max:Q}];if(X<0&&Q>0){let Z=Y(-X),K=Y(Q);return[{min:-Z,max:K},{min:Q-K,max:Q},{min:X,max:X+Z}]}let J=Y(Q-X),$={min:X,max:X+J},G={min:Q-J,max:Q};return X<0?[G,$]:[$,G]}var{ceil:Hg,floor:Vg}=Math;function $L(X){return Vg(X/2)}function GL(X){return Hg(X/2)}function ZL(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:$L(J);for(let W=K;W>0;W=$L(W)){let H=W===J?Q:X-W;yield new k(H,Z),Z=H}}function*G(){let Z=Y?void 0:Q,K=Y?J:GL(J);for(let W=K;W<0;W=GL(W)){let H=W===J?Q:X-W;yield new k(H,Z),Z=H}}return J>0?s4($()):s4(G())}var KL=Math.sign,_g=Number.isInteger,qg=Object.is,_9=class X extends I0{constructor(Q,Y){super();this.min=Q,this.max=Y}generate(Q,Y){let J=this.computeGenerateRange(Q,Y);return new k(Q.nextInt(J.min,J.max),void 0)}canShrinkWithoutContext(Q){return typeof Q==="number"&&_g(Q)&&!qg(Q,-0)&&this.min<=Q&&Q<=this.max}shrink(Q,Y){if(!X.isValidContext(Q,Y))return ZL(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return ZL(Q,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return 0;return this.min<0?this.max:this.min}computeGenerateRange(Q,Y){if(Y===void 0||Q.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=fP(this.min,this.max,Kg);if(J.length===1)return J[0];let $=Q.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}isLastChanceTry(Q,Y){if(Q>0)return Q===Y+1&&Q>this.min;if(Q<0)return Q===Y-1&&Q<this.max;return!1}static isValidContext(Q,Y){if(Y===void 0)return!1;if(typeof Y!=="number")throw Error("Invalid context type passed to IntegerArbitrary (#1)");if(Y!==0&&KL(Q)!==KL(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},WL=Number.isInteger;function Dg(X){return{min:X.min!==void 0?X.min:-2147483648,max:X.max!==void 0?X.max:2147483647}}function z0(X={}){let Q=Dg(X);if(Q.min>Q.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!WL(Q.min))throw Error("fc.integer minimum value should be an integer");if(!WL(Q.max))throw Error("fc.integer maximum value should be an integer");return new _9(Q.min,Q.max)}var HL=new Map;function IK(X){if(X===void 0)return{depth:0};if(typeof X!=="string")return X;let Q=d1(HL,X);if(Q!==void 0)return Q;let Y={depth:0};return R8(HL,X,Y),Y}function jK(){return{depth:0}}var Bg=class{constructor(X,Q,Y){this.arb=X,this.mrng=Q,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},Ug=Math.min,Og=Math.max,zg=class{constructor(X,Q,Y,J){this.arb=X,this.mrng=Q,this.slices=Y,this.biasFactor=J,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(X){if(X!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let Q=[];for(let Y=0;Y!==this.slices.length;++Y)if(this.slices[Y].length===X)S(Q,Y);if(Q.length===0)return;this.activeSliceIndex=Q[this.mrng.nextInt(0,Q.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=X-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new k(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let X=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=X.length-1,new k(X[0],void 0);let Q=this.mrng.nextInt(0,X.length-1),Y=this.mrng.nextInt(0,X.length-1);return this.nextIndexInSlice=Ug(Q,Y),this.lastIndexInSlice=Og(Q,Y),new k(X[this.nextIndexInSlice++],void 0)}};function VL(X,Q,Y,J){if(J===void 0||Y.length===0||Q.nextInt(1,J)!==1)return new Bg(X,Q,J);return new zg(X,Q,Y,J)}var{floor:Fg,log:_L,max:qL}=Math,Lg=Array.isArray;function SZ(X,Q){if(X===Q)return X;return X+Fg(_L(Q-X)/_L(2))}var uP=class X extends I0{constructor(Q,Y,J,$,G,Z,K){super();this.arb=Q,this.minLength=Y,this.maxGeneratedLength=J,this.maxLength=$,this.setBuilder=Z,this.customSlices=K,this.lengthArb=z0({min:Y,max:J}),this.depthContext=IK(G)}preFilter(Q){if(this.setBuilder===void 0)return Q;let Y=this.setBuilder();for(let J=0;J!==Q.length;++J)Y.tryAdd(Q[J]);return Y.getData()}static makeItCloneable(Q,Y){return Q[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)S(J,Y[$].value);return this.makeItCloneable(J,Y),J},Q}generateNItemsNoDuplicates(Q,Y,J,$){let G=0,Z=Q(),K=VL(this.arb,J,this.customSlices,$);while(Z.size()<Y&&G<this.maxGeneratedLength){let W=K.next();if(Z.tryAdd(W))G=0;else G+=1}return Z.getData()}safeGenerateNItemsNoDuplicates(Q,Y,J,$){let G=qL(0,Y-SZ(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=G;try{return this.generateNItemsNoDuplicates(Q,Y,J,$)}finally{this.depthContext.depth-=G}}generateNItems(Q,Y,J){let $=[],G=VL(this.arb,Y,this.customSlices,J);G.attemptExact(Q);for(let Z=0;Z!==Q;++Z)S($,G.next());return $}safeGenerateNItems(Q,Y,J){let $=qL(0,Q-SZ(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=$;try{return this.generateNItems(Q,Y,J)}finally{this.depthContext.depth-=$}}wrapper(Q,Y,J,$){let G=Y?this.preFilter(Q):Q,Z=!1,K=[],W=[];for(let H=0;H!==G.length;++H){let _=G[H];Z=Z||_.hasToBeCloned,S(K,_.value),S(W,_.context)}if(Z)X.makeItCloneable(K,G);return new k(K,{shrunkOnce:Y,lengthContext:Q.length===G.length&&J!==void 0?J:void 0,itemsContexts:W,startIndex:$})}generate(Q,Y){let J=this.applyBias(Q,Y),$=J.size,G=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,$,Q,J.biasFactorItems):this.safeGenerateNItems($,Q,J.biasFactorItems);return this.wrapper(G,!1,void 0,0)}applyBias(Q,Y){if(Y===void 0)return{size:this.lengthArb.generate(Q,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(Q,void 0).value,biasFactorItems:Y};if(Q.nextInt(1,Y)!==1)return{size:this.lengthArb.generate(Q,void 0).value};if(Q.nextInt(1,Y)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(Q,void 0).value,biasFactorItems:Y};let J=SZ(this.minLength,this.maxGeneratedLength);return{size:z0({min:this.minLength,max:J}).generate(Q,void 0).value,biasFactorItems:Y}}canShrinkWithoutContext(Q){if(!Lg(Q)||this.minLength>Q.length||Q.length>this.maxLength)return!1;for(let Y=0;Y!==Q.length;++Y){if(!(Y in Q))return!1;if(!this.arb.canShrinkWithoutContext(Q[Y]))return!1}return this.preFilter(G0(Q,(Y)=>new k(Y,void 0))).length===Q.length}shrinkItemByItem(Q,Y,J){let $=[];for(let G=Y.startIndex;G<J;++G)S($,a4(()=>this.arb.shrink(Q[G],Y.itemsContexts[G]).map((Z)=>{let K=G0(e0(Q,0,G),(H,_)=>new k(K9(H),Y.itemsContexts[_])),W=G0(e0(Q,G+1),(H,_)=>new k(K9(H),Y.itemsContexts[_+G+1]));return[[...K,Z,...W],void 0,G]})));return Q0.nil().join(...$)}shrinkImpl(Q,Y){if(Q.length===0)return Q0.nil();let J=Y!==void 0?Y:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(Q.length,J.lengthContext).drop(J.shrunkOnce&&J.lengthContext===void 0&&Q.length>this.minLength+1?1:0).map(($)=>{let G=Q.length-$.value;return[G0(e0(Q,G),(Z,K)=>new k(K9(Z),J.itemsContexts[K+G])),$.context,0]}).join(a4(()=>Q.length>this.minLength?this.shrinkItemByItem(Q,J,1):this.shrinkItemByItem(Q,J,Q.length))).join(Q.length>this.minLength?a4(()=>{let $={shrunkOnce:!1,lengthContext:void 0,itemsContexts:e0(J.itemsContexts,1),startIndex:0};return this.shrinkImpl(e0(Q,1),$).filter((G)=>this.minLength<=G[0].length+1).map((G)=>{return[[new k(K9(Q[0]),J.itemsContexts[0]),...G[0]],void 0,0]})}):Q0.nil())}shrink(Q,Y){return this.shrinkImpl(Q,Y).map((J)=>this.wrapper(J[0],!0,J[1],J[2]))}},Pg=Math.floor,Rg=Math.min,e6=2147483647,$9=["xsmall","small","medium","large","xlarge"],Ng=["-4","-3","-2","-1","=","+1","+2","+3","+4"],EK="small";function Mg(X,Q){switch(Q){case"xsmall":return Pg(1.1*X)+1;case"small":return 2*X+10;case"medium":return 11*X+100;case"large":return 101*X+1000;case"xlarge":return 1001*X+1e4;default:throw Error(`Unable to compute lengths based on received size: ${Q}`)}}function OQ(X,Q){let Y=_4(Ng,X);if(Y===-1)return X;let J=_4($9,Q);if(J===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${Q}`);let $=J+Y-4;return $<0?$9[0]:$>=$9.length?$9[$9.length-1]:$9[$]}function BQ(X,Q,Y,J){let{baseSize:$=EK,defaultSizeToMaxWhenMaxSpecified:G}=N8()||{},Z=X!==void 0?X:J&&G?"max":$;if(Z==="max")return Y;return Rg(Mg(Q,OQ(Z,$)),Y)}function Ag(X,Q){if(typeof X==="number")return 1/X;let{baseSize:Y=EK,defaultSizeToMaxWhenMaxSpecified:J}=N8()||{},$=X!==void 0?X:Q&&J?"max":Y;if($==="max")return 0;switch(OQ($,Y)){case"xsmall":return 1;case"small":return 0.5;case"medium":return 0.25;case"large":return 0.125;case"xlarge":return 0.0625}}function SK(X){let{baseSize:Q=EK}=N8()||{};if(X===void 0)return Q;return OQ(X,Q)}function P0(X,Q={}){let Y=Q.size,J=Q.minLength||0,$=Q.maxLength,G=Q.depthIdentifier,Z=$!==void 0?$:e6;return new uP(X,J,BQ(Y,J,Z,$!==void 0),Z,G,void 0,Q.experimentalCustomSlices||[])}function U2(X){return X/j(2)}function DL(X,Q,Y){let J=X-Q;function*$(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let W=K;W>0;W=U2(W)){let H=X-W;yield new k(H,Z),Z=H}}function*G(){let Z=Y?void 0:Q,K=Y?J:U2(J);for(let W=K;W<0;W=U2(W)){let H=X-W;yield new k(H,Z),Z=H}}return J>0?s4($()):s4(G())}var wg=class X extends I0{constructor(Q,Y){super();this.min=Q,this.max=Y}generate(Q,Y){let J=this.computeGenerateRange(Q,Y);return new k(Q.nextBigInt(J.min,J.max),void 0)}computeGenerateRange(Q,Y){if(Y===void 0||Q.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=fP(this.min,this.max,Wg);if(J.length===1)return J[0];let $=Q.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}canShrinkWithoutContext(Q){return typeof Q==="bigint"&&this.min<=Q&&Q<=this.max}shrink(Q,Y){if(!X.isValidContext(Q,Y))return DL(Q,this.defaultTarget(),!0);if(this.isLastChanceTry(Q,Y))return Q0.of(new k(Y,void 0));return DL(Q,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return j(0);return this.min<0?this.max:this.min}isLastChanceTry(Q,Y){if(Q>0)return Q===Y+j(1)&&Q>this.min;if(Q<0)return Q===Y-j(1)&&Q<this.max;return!1}static isValidContext(Q,Y){if(Y===void 0)return!1;if(typeof Y!=="bigint")throw Error("Invalid context type passed to BigIntArbitrary (#1)");let J=Q>0&&Y<0||Q<0&&Y>0;if(Y!==j(0)&&J)throw Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function Cg(X){let Y=j(-1)<<j(255),J=(j(1)<<j(255))-j(1),$=X.min,G=X.max;return{min:$!==void 0?$:Y-(G!==void 0&&G<j(0)?G*G:j(0)),max:G!==void 0?G:J+($!==void 0&&$>j(0)?$*$:j(0))}}function Tg(X){if(X[0]===void 0)return{};if(X[1]===void 0)return X[0];return{min:X[0],max:X[1]}}function t4(...X){let Q=Cg(Tg(X));if(Q.min>Q.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new wg(Q.min,Q.max)}var Ig=Object.getPrototypeOf,KQ=class extends I0{constructor(X){super();this.arb=X}generate(X,Q){return this.arb.generate(X,void 0)}canShrinkWithoutContext(X){return this.arb.canShrinkWithoutContext(X)}shrink(X,Q){return this.arb.shrink(X,Q)}};function v2(X){if(Ig(X)===KQ.prototype&&X.generate===KQ.prototype.generate&&X.canShrinkWithoutContext===KQ.prototype.canShrinkWithoutContext&&X.shrink===KQ.prototype.shrink)return X;return new KQ(X)}function jg(X){return X===1}function Eg(X){if(typeof X!=="boolean")throw Error("Unsupported input type");return X===!0?1:0}function zQ(){return v2(z0({min:0,max:1}).map(jg,Eg))}var VQ=Object.is,Sg=class{constructor(X){this.values=X,this.fastValues=new W9(this.values);let Q=!1,Y=!1;if(S2(this.fastValues,0))for(let J=0;J!==this.values.length;++J){let $=this.values[J];Q=Q||VQ($,-0),Y=Y||VQ($,0)}this.hasMinusZero=Q,this.hasPlusZero=Y}has(X){if(X===0){if(VQ(X,0))return this.hasPlusZero;return this.hasMinusZero}return S2(this.fastValues,X)}},lP=class extends I0{constructor(X){super();this.values=X}generate(X,Q){let Y=this.values.length===1?0:X.nextInt(0,this.values.length-1),J=this.values[Y];if(!t6(J))return new k(J,Y);return new k(J,Y,()=>J[r0]())}canShrinkWithoutContext(X){if(this.values.length===1)return VQ(this.values[0],X);if(this.fastValues===void 0)this.fastValues=new Sg(this.values);return this.fastValues.has(X)}shrink(X,Q){if(Q===0||VQ(X,this.values[0]))return Q0.nil();return Q0.of(new k(this.values[0],0))}};function m8(...X){if(X.length===0)throw Error("fc.constantFrom expects at least one parameter");return new lP(X)}function vg(X){if(!X||!X.withBigInt)return m8(!1,null,void 0,0,"",NaN);return m8(!1,null,void 0,0,"",NaN,j(0))}function b0(X){return new lP([X])}var xg=class X{constructor(){this.receivedLogs=[]}log(Q){this.receivedLogs.push(Q)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[r0](){return new X}};function kg(){return b0(new xg)}var yg=NaN,bg=Number.isNaN;function rP(X){return new j2(X)}function oP(X){if(!(X instanceof j2)||X.constructor!==j2)throw new E("Not a valid value for date unmapper");return E2(X)}function gg(X){return(Q)=>{return Q===X?new j2(yg):rP(Q)}}function hg(X){return(Q)=>{let Y=oP(Q);return bg(Y)?X:Y}}var BL=Number.isNaN;function nP(X={}){let Q=X.min!==void 0?E2(X.min):-8640000000000000,Y=X.max!==void 0?E2(X.max):8640000000000000,J=X.noInvalidDate;if(BL(Q))throw Error("fc.date min must be valid instance of Date");if(BL(Y))throw Error("fc.date max must be valid instance of Date");if(Q>Y)throw Error("fc.date max must be greater or equal to min");if(J)return z0({min:Q,max:Y}).map(rP,oP);let $=Y+1;return z0({min:Q,max:Y+1}).map(gg($),hg($))}var mg=Symbol.iterator,pg=Array.isArray,dg=Object.is,cg=class X extends I0{constructor(Q,Y){super();this.arb=Q,this.numValues=Y}generate(Q,Y){let J=[];if(this.numValues<=0)return this.wrapper(J);for(let $=0;$!==this.numValues-1;++$)S(J,this.arb.generate(Q.clone(),Y));return S(J,this.arb.generate(Q,Y)),this.wrapper(J)}canShrinkWithoutContext(Q){if(!pg(Q)||Q.length!==this.numValues)return!1;if(Q.length===0)return!0;for(let Y=1;Y<Q.length;++Y)if(!dg(Q[0],Q[Y]))return!1;return this.arb.canShrinkWithoutContext(Q[0])}shrink(Q,Y){if(Q.length===0)return Q0.nil();return new Q0(this.shrinkImpl(Q,Y!==void 0?Y:[])).map((J)=>this.wrapper(J))}*shrinkImpl(Q,Y){let J=G0(Q,(G,Z)=>this.arb.shrink(G,Y[Z])[mg]()),$=G0(J,(G)=>G.next());while(!$[0].done)yield G0($,(G)=>G.value),$=G0(J,(G)=>G.next())}static makeItCloneable(Q,Y){return Q[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)S(J,Y[$].value);return this.makeItCloneable(J,Y),J},Q}wrapper(Q){let Y=!1,J=[],$=[];for(let G=0;G!==Q.length;++G){let Z=Q[G];Y=Y||Z.hasToBeCloned,S(J,Z.value),S($,Z.context)}if(Y)X.makeItCloneable(J,Q);return new k(J,$)}};function fg(X,Q){return new cg(X,Q)}var UL=class{constructor(X){this.isEqual=X,this.data=[]}tryAdd(X){for(let Q=0;Q!==this.data.length;++Q)if(this.isEqual(this.data[Q],X))return!1;return S(this.data,X),!0}size(){return this.data.length}getData(){return this.data}},ug=Number.isNaN,lg=class{constructor(X){this.selector=X,this.selectedItemsExceptNaN=new W9,this.data=[]}tryAdd(X){let Q=this.selector(X);if(ug(Q))return S(this.data,X),!0;let Y=this.selectedItemsExceptNaN.size;if(_Q(this.selectedItemsExceptNaN,Q),Y!==this.selectedItemsExceptNaN.size)return S(this.data,X),!0;return!1}size(){return this.data.length}getData(){return this.data}},rg=Object.is,og=class{constructor(X){this.selector=X,this.selectedItemsExceptMinusZero=new W9,this.data=[],this.hasMinusZero=!1}tryAdd(X){let Q=this.selector(X);if(rg(Q,-0)){if(this.hasMinusZero)return!1;return S(this.data,X),this.hasMinusZero=!0,!0}let Y=this.selectedItemsExceptMinusZero.size;if(_Q(this.selectedItemsExceptMinusZero,Q),Y!==this.selectedItemsExceptMinusZero.size)return S(this.data,X),!0;return!1}size(){return this.data.length}getData(){return this.data}},ng=class{constructor(X){this.selector=X,this.selectedItems=new W9,this.data=[]}tryAdd(X){let Q=this.selector(X),Y=this.selectedItems.size;if(_Q(this.selectedItems,Q),Y!==this.selectedItems.size)return S(this.data,X),!0;return!1}size(){return this.data.length}getData(){return this.data}};function ig(X){if(typeof X.comparator==="function"){if(X.selector===void 0){let K=X.comparator,W=(H,_)=>K(H.value_,_.value_);return()=>new UL(W)}let{comparator:J,selector:$}=X,G=(K)=>$(K.value_),Z=(K,W)=>J(G(K),G(W));return()=>new UL(Z)}let Q=X.selector||((J)=>J),Y=(J)=>Q(J.value_);switch(X.comparator){case"IsStrictlyEqual":return()=>new lg(Y);case"SameValueZero":return()=>new ng(Y);case"SameValue":case void 0:return()=>new og(Y)}}function X5(X,Q={}){let Y=Q.minLength!==void 0?Q.minLength:0,J=Q.maxLength!==void 0?Q.maxLength:e6,$=BQ(Q.size,Y,J,Q.maxLength!==void 0),G=Q.depthIdentifier,Z=new uP(X,Y,$,J,G,ig(Q),[]);if(Y===0)return Z;return Z.filter((K)=>K.length>=Y)}var{create:ag,defineProperty:sg,getOwnPropertyDescriptor:tg,getPrototypeOf:OL,prototype:eg}=Object,Xh=Reflect.ownKeys;function Qh(X){let Q=X[1]?ag(null):{};for(let Y of X[0])sg(Q,Y[0],{enumerable:!0,configurable:!0,writable:!0,value:Y[1]});return Q}function Yh(X){return X!==void 0&&!!X.configurable&&!!X.enumerable&&!!X.writable&&X.get===void 0&&X.set===void 0}function Jh(X){if(typeof X!=="object"||X===null)throw new E("Incompatible instance received: should be a non-null object");let Q=OL(X)===null,Y=OL(X)===eg;if(!Q&&!Y)throw new E("Incompatible instance received: should be of exact type Object");let J=G0(Xh(X),($)=>[$,tg(X,$)]);if(!RP(J,([,$])=>Yh($)))throw new E("Incompatible instance received: should contain only c/e/w properties without get/set");return[G0(J,([$,G])=>[$,G.value]),Q]}function $h(X){return X[0]}function vK(X,Q,Y={}){let J=!!Y.noNullPrototype;return e(X5(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:$h,depthIdentifier:Y.depthIdentifier}),J?b0(!1):zQ()).map(Qh,Jh)}var{POSITIVE_INFINITY:Gh,MAX_SAFE_INTEGER:Zh,isInteger:Kh}=Number,Wh=Math.floor,Hh=Math.pow,Vh=Math.min,QK=class X extends I0{static from(Q,Y,J){if(Q.length===0)throw Error(`${J} expects at least one weighted arbitrary`);let $=0;for(let G=0;G!==Q.length;++G){if(Q[G].arbitrary===void 0)throw Error(`${J} expects arbitraries to be specified`);let Z=Q[G].weight;if($+=Z,!Kh(Z))throw Error(`${J} expects weights to be integer values`);if(Z<0)throw Error(`${J} expects weights to be superior or equal to 0`)}if($<=0)throw Error(`${J} expects the sum of weights to be strictly superior to 0`);return new X(Q,{depthBias:Ag(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:Gh,withCrossShrink:!!Y.withCrossShrink},IK(Y.depthIdentifier))}constructor(Q,Y,J){super();this.warbs=Q,this.constraints=Y,this.context=J;let $=0;this.cumulatedWeights=[];for(let G=0;G!==Q.length;++G)$+=Q[G].weight,S(this.cumulatedWeights,$);this.totalWeight=$}generate(Q,Y){if(this.mustGenerateFirst())return this.safeGenerateForIndex(Q,0,Y);let J=Q.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let $=0;$!==this.cumulatedWeights.length;++$)if(J<this.cumulatedWeights[$])return this.safeGenerateForIndex(Q,$,Y);throw Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(Q){return this.canShrinkWithoutContextIndex(Q)!==-1}shrink(Q,Y){if(Y!==void 0){let $=Y,G=$.selectedIndex,Z=$.originalBias,K=this.warbs[G].arbitrary.shrink(Q,$.originalContext).map((W)=>this.mapIntoValue(G,W,null,Z));if($.clonedMrngForFallbackFirst!==null){if($.cachedGeneratedForFirst===void 0)$.cachedGeneratedForFirst=this.safeGenerateForIndex($.clonedMrngForFallbackFirst,0,Z);let W=$.cachedGeneratedForFirst;return Q0.of(W).join(K)}return K}let J=this.canShrinkWithoutContextIndex(Q);if(J===-1)return Q0.nil();return this.defaultShrinkForFirst(J).join(this.warbs[J].arbitrary.shrink(Q,void 0).map(($)=>this.mapIntoValue(J,$,null,void 0)))}defaultShrinkForFirst(Q){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(Q)||this.warbs[0].fallbackValue===void 0)return Q0.nil()}finally{--this.context.depth}let Y=new k(this.warbs[0].fallbackValue.default,void 0);return Q0.of(this.mapIntoValue(0,Y,null,void 0))}canShrinkWithoutContextIndex(Q){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(Q)?0:-1;try{++this.context.depth;for(let Y=0;Y!==this.warbs.length;++Y){let J=this.warbs[Y];if(J.weight!==0&&J.arbitrary.canShrinkWithoutContext(Q))return Y}return-1}finally{--this.context.depth}}mapIntoValue(Q,Y,J,$){let G={selectedIndex:Q,originalBias:$,originalContext:Y.context,clonedMrngForFallbackFirst:J};return new k(Y.value,G)}safeGenerateForIndex(Q,Y,J){++this.context.depth;try{let $=this.warbs[Y].arbitrary.generate(Q,J),G=this.mustFallbackToFirstInShrink(Y)?Q.clone():null;return this.mapIntoValue(Y,$,G,J)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(Q){return Q!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let Q=this.constraints.depthBias;if(Q<=0||this.warbs[0].weight===0)return 0;let Y=Wh(Hh(1+Q,this.context.depth))-1;return-Vh(this.totalWeight*Y,Zh)||0}};function _h(X){return X!==null&&X!==void 0&&typeof X==="object"&&!("generate"in X)&&!("arbitrary"in X)&&!("weight"in X)}function zL(X){if(VP(X))return{arbitrary:X,weight:1};return X}function l0(...X){let Q=X[0];if(_h(Q)){let J=G0(e0(X,1),zL);return QK.from(J,Q,"fc.oneof")}let Y=G0(X,zL);return QK.from(Y,{},"fc.oneof")}var qh=Number.isInteger;function i4(X){let Q=typeof X==="number"?X:X&&X.max!==void 0?X.max:2147483647;if(Q<0)throw Error("fc.nat value should be greater than or equal to 0");if(!qh(Q))throw Error("fc.nat maximum value should be an integer");return new _9(0,Q)}var Dh=Object.is;function Bh(X){let Q=0,Y=[];for(let J of X){let $=Q;Q=$+J.num;let G=Q-1;Y.push({from:$,to:G,entry:J})}return Y}function Uh(X,Q){let Y=0,J=X.length;while(J-Y>1){let $=~~((Y+J)/2);if(Q<X[$].from)J=$;else Y=$}return X[Y]}function Oh(X){let Q=Bh(X);return function(J){let $=Uh(Q,J);return $.entry.build(J-$.from)}}function zh(X){let Q={mapping:new D4,negativeZeroIndex:void 0},Y=0;for(let J=0;J!==X.length;++J){let $=X[J];for(let G=0;G!==$.num;++G){let Z=$.build(G);if(Z===0&&1/Z===q4.NEGATIVE_INFINITY)Q.negativeZeroIndex=Y;else R8(Q.mapping,Z,Y);++Y}}return Q}function Fh(X){let Q=null;return function(J){if(Q===null)Q=zh(X);let $=Dh(J,-0)?Q.negativeZeroIndex:d1(Q.mapping,J);if($===void 0)throw new E("Unknown value encountered cannot be built using this mapToConstant");return $}}function Lh(X){if(X.length===0)throw new E("fc.mapToConstant expects at least one option");let Q=0;for(let Y=0;Y!==X.length;++Y){if(X[Y].num<0)throw new E("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");Q+=X[Y].num}if(Q===0)throw new E("fc.mapToConstant expects at least one choice among options");return Q}function q9(...X){return i4({max:Lh(X)-1}).map(Oh(X),Fh(X))}function iP(X,Q,Y,J){if(Q.length===0){if(Y>0)return;return[]}if(J<=0)return;let $=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];while($.length>0){let G=FP($);for(let Z=G.nextStartIndex;Z<=Q.length;++Z){let K=S0(Q,G.endIndexChunks,Z);if(X.canShrinkWithoutContext(K)){let W=[...G.chunks,K];if(Z===Q.length){if(W.length<Y)break;return W}if(S($,{endIndexChunks:G.endIndexChunks,nextStartIndex:Z+1,chunks:G.chunks}),W.length<J)S($,{endIndexChunks:Z,nextStartIndex:Z+1,chunks:W});break}}}}function Ph(X){return w0(X,"")}function aP(X){return X.minLength!==void 0?X.minLength:0}function sP(X){return X.maxLength!==void 0?X.maxLength:e6}function Rh(X,Q){return aP(Q)<=X.length&&X.length<=sP(Q)}function Nh(X,Q){return function(J){if(typeof J!=="string")throw new E("Unsupported value");let $=iP(X,J,aP(Q),sP(Q));if($===void 0)throw new E("Unable to unmap received string");return $}}var tP=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function Mh(X,Q,Y){let J;try{J=Y(X)}catch{return}for(let $ of J)if(!Q.canShrinkWithoutContext($))return;return J}function Ah(X,Q){let Y=[];for(let J of tP){let $=Mh(J,X,Q);if($!==void 0)S(Y,$)}return Y}var FL=new WeakMap;function wh(X){let Q=[];for(let Y of tP){let J=iP(X,Y,0,e6);if(J!==void 0)S(Q,J)}return Q}function Ch(X,Q){let Y=Iy(FL,X);if(Y===void 0)Y=wh(X),Ty(FL,X,Y);let J=[];for(let $ of Y)if(Rh($,Q))S(J,$);return J}var Th=[[0,127]],Ih=[[0,55295],[57344,1114111]],jh=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6000],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66000,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128000,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],Eh=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],LL=String.fromCodePoint,Sh=Math.min,vh=Math.max;function YK(X){if(X.length===1){let Y=LL(X[0]);return{num:1,build:()=>Y}}let Q=X[0];return{num:X[1]-X[0]+1,build:(Y)=>LL(Q+Y)}}function PL(X,Q){let Y=[],J=0,$=0;while(J<X.length&&$<Q.length){let G=X[J],Z=G[0],K=G.length===1?G[0]:G[1],W=Q[$],H=W[0],_=W.length===1?W[0]:W[1];if(K<H)J+=1;else if(_<Z)$+=1;else{let V=vh(Z,H),q=Sh(K,_);if(Y.length>=1){let D=Y[Y.length-1];if((D.length===1?D[0]:D[1])+1===V)V=D[0],FP(Y)}if(S(Y,V===q?[V]:[V,q]),K<=q)J+=1;if(_<=q)$+=1}}return Y}var RL=Object.create(null);function xh(X){switch(X){case"full":return Ih;case"ascii":return Th}}function kh(X,Q){let Y=`${X}:${Q}`,J=RL[Y];if(J!==void 0)return J;let $=xh(Q),G=X==="binary"?$:PL($,jh),Z=[];for(let W of G)S(Z,YK(W));if(X==="grapheme"){let W=PL($,Eh);for(let H of W){let _=YK(H);S(Z,{num:_.num,build:(V)=>ry(_.build(V),"NFD")})}}let K=q9(...Z);return RL[Y]=K,K}function WQ(X,Q){return kh(X,Q)}function yh(X){if(typeof X.unit==="object")return X.unit;switch(X.unit){case"grapheme":return WQ("grapheme","full");case"grapheme-composite":return WQ("composite","full");case"grapheme-ascii":case void 0:return WQ("grapheme","ascii");case"binary":return WQ("binary","full");case"binary-ascii":return WQ("binary","ascii")}}function p0(X={}){let Q=yh(X),Y=Nh(Q,X),J=Ch(Q,X);return P0(Q,{...X,experimentalCustomSlices:J}).map(Ph,Y)}var eP=Map,xK=String.fromCharCode,kK={num:26,build:(X)=>xK(X+97)},bh={num:26,build:(X)=>xK(X+65)},XR={num:10,build:(X)=>xK(X+48)};function gh(X){let Q=Gy(X);return X!==Q?Q:`%${qQ(H9(X,0),16)}`}function hh(X){if(typeof X!=="string")throw Error("Unsupported");return decodeURIComponent(X)}var mh=()=>p0({unit:"binary",minLength:1,maxLength:1}).map(gh,hh),vZ=void 0;function ph(){if(vZ===void 0)vZ=q9(kK);return vZ}var O2=void 0;function JK(X){if(O2===void 0)O2=new eP;let Q=d1(O2,X);if(Q===void 0)Q=q9(kK,XR,{num:X.length,build:(Y)=>X[Y]}),R8(O2,X,Q);return Q}function dh(X){return q9(kK,bh,XR,{num:X.length,build:(Q)=>X[Q]})}var z2=void 0;function yK(X){if(z2===void 0)z2=new eP;let Q=d1(z2,X);if(Q===void 0)Q=l0({weight:10,arbitrary:dh(X)},{weight:1,arbitrary:mh()}),R8(z2,X,Q);return Q}function U4(X,Q={}){let Y=Q.freq===void 0?6:Q.freq,J=NP(Q,"nil")?Q.nil:null,$=[{arbitrary:b0(J),weight:1,fallbackValue:{default:J}},{arbitrary:X,weight:Y-1}],G={withCrossShrink:!0,depthSize:Q.depthSize,maxDepth:Q.maxDepth,depthIdentifier:Q.depthIdentifier};return QK.from($,G,"fc.option")}function ch(X){if(X.length>63)return!1;return X.length<4||X[0]!=="x"||X[1]!=="n"||X[2]!=="-"||X[3]!=="-"}var QR=Symbol("adapted-value");function fh(X,Q){let Y=Q(X.value_);if(!Y.adapted)return X;return new k(Y.value,QR)}var uh=class extends I0{constructor(X,Q){super();this.sourceArb=X,this.adapter=Q,this.adaptValue=(Y)=>fh(Y,Q)}generate(X,Q){let Y=this.sourceArb.generate(X,Q);return this.adaptValue(Y)}canShrinkWithoutContext(X){return this.sourceArb.canShrinkWithoutContext(X)&&!this.adapter(X).adapted}shrink(X,Q){if(Q===QR){if(!this.sourceArb.canShrinkWithoutContext(X))return Q0.nil();return this.sourceArb.shrink(X,void 0).map(this.adaptValue)}return this.sourceArb.shrink(X,Q).map(this.adaptValue)}};function YR(X,Q){return new uh(X,Q)}function lh([X,Q]){return Q===null?X:`${X}${Q[0]}${Q[1]}`}function rh(X){if(typeof X!=="string"||X.length===0)throw Error("Unsupported");if(X.length===1)return[X[0],null];return[X[0],[S0(X,1,X.length-1),X[X.length-1]]]}function oh(X){let Q=JK("");return e(Q,U4(e(p0({unit:JK("-"),size:X,maxLength:61}),Q))).map(lh,rh).filter(ch)}function nh(X){return`${w0(X[0],".")}.${X[1]}`}function ih(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=X.lastIndexOf(".");return[L1(S0(X,0,Q),"."),S0(X,Q+1)]}function ah(X){let[Q,Y]=X,J=Y.length;for(let $=0;$!==Q.length;++$)if(J+=1+Q[$].length,J>255)return{adapted:!0,value:[e0(Q,0,$),Y]};return{adapted:!1,value:X}}function bK(X={}){let Q=SK(X.size),Y=OQ("-1",Q),J=p0({unit:ph(),minLength:2,maxLength:63,size:Y});return YR(e(P0(oh(Q),{size:Y,minLength:1,maxLength:127}),J),ah).map(nh,ih)}function sh(X){let Q=X[0].length;for(let Y=1;Y!==X.length;++Y)if(Q+=1+X[Y].length,Q>64)return{adapted:!0,value:e0(X,0,Y)};return{adapted:!1,value:X}}function th(X){return w0(X,".")}function eh(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,".")}function Xm(X){return`${X[0]}@${X[1]}`}function Qm(X){if(typeof X!=="string")throw Error("Unsupported");return L1(X,"@",2)}function Ym(X={}){return e(YR(P0(p0({unit:JK("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:X.size}),{minLength:1,maxLength:32,size:X.size}),sh).map(th,eh),bK({size:X.size})).map(Xm,Qm)}var{NEGATIVE_INFINITY:Jm,POSITIVE_INFINITY:$K,EPSILON:JR}=q4,gK=j(2146435072)*j(4294967296),$m=-gK-j(1),NL=4503599627370496,Gm=j(4503599627370495),ML=j("9007199254740992"),GK=new Float64Array(1),AL=new Uint32Array(GK.buffer,GK.byteOffset);function Zm(X){return GK[0]=X,[AL[1],AL[0]]}function Km(X){let{0:Q,1:Y}=Zm(X),J=Q>>>31,$=Q>>>20&2047,G=(Q&1048575)*4294967296+Y,Z=$===0?-1022:$-1023,K=$===0?0:1;return K+=G*JR,K*=J===0?1:-1,{exponent:Z,significand:K}}function wL(X,Q){if(X===-1022)return j(Q*NL);return j((Q-1)*NL)+(j(X+1023)<<j(52))}function hK(X){if(X===$K)return gK;if(X===Jm)return $m;let Q=Km(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===$K)return wL(Y,J);else return-wL(Y,-J)-j(1)}function ZK(X){if(X<0)return-ZK(-X-j(1));if(X===gK)return $K;if(X<ML)return q4(X)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let Q=X-ML,Y=-1021+q4(Q>>j(52));return(1+q4(Q&Gm)*JR)*2**Y}var CL=Number.isInteger,TL=Object.is,xZ=Number.NEGATIVE_INFINITY,kZ=Number.POSITIVE_INFINITY;function $R(X,Q,Y,J){let{noDefaultInfinity:$=!1,minExcluded:G=!1,maxExcluded:Z=!1,min:K=$?-Q:xZ,max:W=$?Q:kZ}=X,H=G?K<-Y?-J:Math.max(K,-Y):K===xZ?Math.max(K,-J):Math.max(K,-Y),_=Z?W>Y?J:Math.min(W,Y):W===kZ?Math.min(W,J):Math.min(W,Y);return{noDefaultInfinity:!1,minExcluded:G||(K!==xZ||G)&&CL(H),maxExcluded:Z||(W!==kZ||Z)&&CL(_),min:TL(H,-0)?0:H,max:TL(_,0)?-0:_,noNaN:X.noNaN||!1}}var{NEGATIVE_INFINITY:GR,POSITIVE_INFINITY:ZR,MAX_VALUE:Wm}=Number,Hm=4503599627370495.5,KK=4503599627370496;function Vm(X){return $R(X,Wm,Hm,KK)}function _m(X){return X===4503599627370496?ZR:X===-4503599627370496?GR:X}function qm(X){if(typeof X!=="number")throw Error("Unsupported type");return X===ZR?KK:X===GR?-KK:X}var{isInteger:Dm,isNaN:KR,NEGATIVE_INFINITY:Bm,POSITIVE_INFINITY:Um,MAX_VALUE:IL}=Number,Om=NaN;function jL(X,Q){if(KR(X))throw Error("fc.double constraints."+Q+" must be a 64-bit float");return hK(X)}function zm(X){if(typeof X!=="number")throw Error("Unsupported type");return hK(X)}function Fm(X){return!Dm(X)}function EL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-IL:Bm,max:Z=Q?IL:Um}=X,K=jL(G,"min"),W=J?K+j(1):K,H=jL(Z,"max"),_=$?H-j(1):H;if(_<W)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return t4({min:W,max:_}).map(ZK,zm);let V=_>j(0),q=V?W:W-j(1),D=V?_+j(1):_;return t4({min:q,max:D}).map((U)=>{if(_<U||U<W)return Om;else return ZK(U)},(U)=>{if(typeof U!=="number")throw Error("Unsupported type");if(KR(U))return _!==D?D:q;return hK(U)})}function b2(X={}){if(!X.noInteger)return EL(X);return EL(Vm(X)).map(_m,qm).filter(Fm)}var{NEGATIVE_INFINITY:Lm,POSITIVE_INFINITY:WK}=Number,Pm=Math.imul,HK=340282346638528860000000000000000000000,WR=2139095040,Rm=-2139095041,VK=new Float32Array(1),Nm=new Uint32Array(VK.buffer,VK.byteOffset);function Mm(X){return VK[0]=X,Nm[0]}function Am(X){let Q=Mm(X),Y=Q>>>31,J=Q>>>23&255,$=Q&8388607,G=J===0?-126:J-127,Z=J===0?0:1;return Z+=$/8388608,Z*=Y===0?1:-1,{exponent:G,significand:Z}}function SL(X,Q){if(X===-126)return Q*8388608;return Pm(X+127,8388608)+(Q-1)*8388608}function mK(X){if(X===WK)return WR;if(X===Lm)return Rm;let Q=Am(X),Y=Q.exponent,J=Q.significand;if(X>0||X===0&&1/X===WK)return SL(Y,J);else return-SL(Y,-J)-1}function _K(X){if(X<0)return-_K(-X-1);if(X===WR)return WK;if(X<16777216)return X*0.000000000000000000000000000000000000000000001401298464324817;let Q=X-16777216,Y=-125+(Q>>23);return(1+(Q&8388607)/8388608)*2**Y}var{NEGATIVE_INFINITY:HR,POSITIVE_INFINITY:VR}=Number,wm=HK,Cm=8388607.5,qK=8388608;function Tm(X){return $R(X,wm,Cm,qK)}function Im(X){return X===8388608?VR:X===-8388608?HR:X}function jm(X){if(typeof X!=="number")throw Error("Unsupported type");return X===VR?qK:X===HR?-qK:X}var{isInteger:Em,isNaN:_R}=Number,Sm=Math.fround,vm=Number.NEGATIVE_INFINITY,xm=Number.POSITIVE_INFINITY,km=NaN;function vL(X,Q){let Y="fc.float constraints."+Q+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(_R(X)||Sm(X)!==X)throw Error(Y);return mK(X)}function ym(X){if(typeof X!=="number")throw Error("Unsupported type");return mK(X)}function bm(X){return!Em(X)}function xL(X){let{noDefaultInfinity:Q=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=Q?-HK:vm,max:Z=Q?HK:xm}=X,K=vL(G,"min"),W=J?K+1:K,H=vL(Z,"max"),_=$?H-1:H;if(W>_)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return z0({min:W,max:_}).map(_K,ym);let V=_>0?W:W-1,q=_>0?_+1:_;return z0({min:V,max:q}).map((D)=>{if(D>_||D<W)return km;else return _K(D)},(D)=>{if(typeof D!=="number")throw Error("Unsupported type");if(_R(D))return _!==q?q:V;return mK(D)})}function qR(X={}){if(!X.noInteger)return xL(X);return xL(Tm(X)).map(Im,jm).filter(bm)}function gm(X){return X.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function DR(X){return X.replace(/\*\//g,"*\\/")}var m1=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function x2(X){let Q=4294967295;for(let Y=0;Y<X.length;++Y){let J=H9(X,Y);if(J<128)Q=m1[Q&255^J]^Q>>8;else if(J<2048)Q=m1[Q&255^(192|J>>6&31)]^Q>>8,Q=m1[Q&255^(128|J&63)]^Q>>8;else if(J>=55296&&J<57344){let $=H9(X,++Y);if(J>=56320||$<56320||$>57343||Number.isNaN($))Y-=1,Q=m1[Q&255^239]^Q>>8,Q=m1[Q&255^191]^Q>>8,Q=m1[Q&255^189]^Q>>8;else{let G=(J&1023)+64,Z=$&1023;Q=m1[Q&255^(240|G>>8&7)]^Q>>8,Q=m1[Q&255^(128|G>>2&63)]^Q>>8,Q=m1[Q&255^(128|Z>>6&15|(G&3)<<4)]^Q>>8,Q=m1[Q&255^(128|Z&63)]^Q>>8}}else Q=m1[Q&255^(224|J>>12&15)]^Q>>8,Q=m1[Q&255^(128|J>>6&63)]^Q>>8,Q=m1[Q&255^(128|J&63)]^Q>>8}return(Q|0)+2147483648}var hm=Object.getPrototypeOf,HQ=class extends I0{constructor(X){super();this.arb=X}generate(X,Q){return this.arb.generate(X,Q)}canShrinkWithoutContext(X){return this.arb.canShrinkWithoutContext(X)}shrink(X,Q){return Q0.nil()}};function k2(X){if(hm(X)===HQ.prototype&&X.generate===HQ.prototype.generate&&X.canShrinkWithoutContext===HQ.prototype.canShrinkWithoutContext&&X.shrink===HQ.prototype.shrink)return X;return new HQ(X)}var{assign:mm,keys:pm}=Object;function BR(X){return e(k2(z0()),k2(z0({min:1,max:4294967295}))).map(([Q,Y])=>{let J=()=>{let $={};return mm((Z,K)=>{let W=g0(Z),H=g0(K),_=X(x2(`${Q}${W}`)%Y,x2(`${Q}${H}`)%Y);return $[`[${W},${H}]`]=_,_},{toString:()=>{let Z=pm($).sort().map((K)=>`${K} => ${g0($[K])}`).map((K)=>`/* ${DR(K)} */`);return`function(a, b) {
47
+ ${Qg($)}`;return G}function IP(Q){return dZ(Q,b0)}async function jP(Q){let X=[];function Y(Z){let K=MP(Z);if(typeof K==="string")return K;return X.push(Promise.all([Z,K])),"\u2026"}let J=dZ(Q,Y);if(X.length===0)return J;let $=new q4(await Promise.all(X));function G(Z){let K=c1($,Z);if(K!==void 0)return K;return b0(Z)}return dZ(Q,G)}function EP(Q,X){if(X.runConfiguration.includeErrorInReport)throw new S(Q);let Y=new S(Q,{cause:X.errorInstance});if(!("cause"in Y))eb(Y,{cause:X.errorInstance});return Y}function Zg(Q){if(!Q.failed)return;throw EP(IP(Q),Q)}async function Kg(Q){if(!Q.failed)return;throw EP(await jP(Q),Q)}function Wg(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return Zg(Q)}async function Hg(Q){if(Q.runConfiguration.asyncReporter)return Q.runConfiguration.asyncReporter(Q);else if(Q.runConfiguration.reporter)return Q.runConfiguration.reporter(Q);else return Kg(Q)}function Vg(Q,X,Y,J,$){let G=new AP(Y,X,J,$);for(let Z of G){Q.runBeforeEach();let K=Q.run(Z);Q.runAfterEach(),G.handleResult(K)}return G.runExecution}async function _g(Q,X,Y,J,$){let G=new AP(Y,X,J,$);for(let Z of G){await Q.runBeforeEach();let K=await Q.run(Z);await Q.runAfterEach(),G.handleResult(K)}return G.runExecution}function SP(Q,X){if(Q===null||Q===void 0||Q.generate===null||Q.generate===void 0)throw Error("Invalid property encountered, please use a valid property");if(Q.run===null||Q.run===void 0)throw Error("Invalid property encountered, please use a valid property not an arbitrary");let Y=HK({...P8(),...X});if(Y.reporter!==void 0&&Y.asyncReporter!==void 0)throw Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");if(Y.asyncReporter!==void 0&&!Q.isAsync())throw Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");let J=fb(Q,Y),$=Y.path.length===0||Y.path.indexOf(":")===-1?Y.numRuns:-1,G=Y.numRuns*Y.maxSkipsPerRun,Z=(...H)=>J.shrink(...H),K=new rb(Y.path.length===0?wP(J,Y.seed,Y.randomType,Y.examples):TP(Y.path,t4(CP(J,Y.seed,Y.randomType,Y.examples)),Z),$,G),W=!Y.endOnFailure?Z:s.nil;return J.isAsync()?_g(J,W,K,Y.verbose,Y.markInterruptAsFailure).then((H)=>H.toRunDetails(Y.seed,Y.path,G,Y)):Vg(J,W,K,Y.verbose,Y.markInterruptAsFailure).toRunDetails(Y.seed,Y.path,G,Y)}function qg(Q,X){let Y=SP(Q,X);if(Q.isAsync())return Y.then(Hg);else Wg(Y)}function Dg(Q,X){let Y=!Object.prototype.hasOwnProperty.call(Q,"isAsync")?new PP(Q,()=>!0):Q;return X.unbiased===!0?new NP(Y):Y}function xP(Q,X){let Y=HK(typeof X==="number"?{...P8(),numRuns:X}:{...P8(),...X}),J=Dg(Q,Y),$=J.shrink.bind(J);return(Y.path.length===0?t4(wP(J,Y.seed,Y.randomType,Y.examples)):TP(Y.path,t4(CP(J,Y.seed,Y.randomType,Y.examples)),$)).take(Y.numRuns).map((G)=>G.value_)}function Bg(Q,X){return[...xP(Q,X)]}function Ug(Q){return(Math.round(Q*100)/100).toFixed(2)}function Og(Q,X,Y){let J=HK(typeof Y==="number"?{...P8(),numRuns:Y}:{...P8(),...Y}),$={};for(let W of xP(Q,Y)){let H=X(W),_=Array.isArray(H)?H:[H];for(let V of _)$[V]=($[V]||0)+1}let G=Object.entries($).sort((W,H)=>H[1]-W[1]).map((W)=>[W[0],`${Ug(W[1]*100/J.numRuns)}%`]),Z=G.map((W)=>W[0].length).reduce((W,H)=>Math.max(W,H),0),K=G.map((W)=>W[1].length).reduce((W,H)=>Math.max(W,H),0);for(let W of G)J.logger(`${W[0].padEnd(Z,".")}..${W[1].padStart(K,".")}`)}var zg=Object.assign;function pZ(Q,X,Y,J){let $=Y(),G=Q.clone(),Z={mrng:Q.clone(),biasFactor:X,history:[]},K=(H)=>{let _=$[Z.history.length];if(_!==void 0&&_.arb===H){let q=_.value;return x(Z.history,{arb:H,value:q,context:_.context,mrng:_.mrng}),G=_.mrng.clone(),q}let V=H.generate(G,X);return x(Z.history,{arb:H,value:V.value_,context:V.context,mrng:G.clone()}),V.value};return new k(zg((H,..._)=>{return K(J(H,_))},{values(){return G0(Z.history,(H)=>H.value)},[r0](){return pZ(Q,X,Y,J).value},[R8](){return b0(G0(Z.history,(H)=>H.value))}}),Z)}var zZ=Array.isArray,oF=Object.keys,Fg=Object.is;function Lg(Q){let X=new q4;return function(J,$){let G=c1(X,J);if(G===void 0){let W=J(...$);return L8(X,J,[{args:$,value:W}]),W}let Z=G;for(let W of Z)if(Q($,W.args))return W.value;let K=J(...$);return x(Z,{args:$,value:K}),K}}function vP(Q,X){if(Q!==null&&typeof Q==="object"&&X!==null&&typeof X==="object"){if(zZ(Q)){if(!zZ(X))return!1;if(Q.length!==X.length)return!1}else if(zZ(X))return!1;if(oF(Q).length!==oF(X).length)return!1;for(let Y in Q){if(!(Y in X))return!1;if(!vP(Q[Y],X[Y]))return!1}return!0}else return Fg(Q,X)}var Pg=class extends C0{constructor(...Q){super(...Q);this.arbitraryCache=Lg(vP)}generate(Q,X){return pZ(Q,X,()=>[],this.arbitraryCache)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(X===void 0)return s.nil();let Y=X,J=Y.mrng,$=Y.biasFactor,G=Y.history;return zP(G.map((Z)=>Z.arb),G.map((Z)=>Z.value),G.map((Z)=>Z.context)).map((Z)=>{function K(){let{value:W,context:H}=Z;return G0(G,(_,V)=>({arb:_.arb,value:W[V],context:H[V],mrng:_.mrng}))}return pZ(J,$,K,this.arbitraryCache)})}};function Rg(){return new Pg}var{floor:Ng,log:nF}=Math;function Mg(Q){return Ng(nF(Q)/nF(2))}function Ag(Q){if(Q===E(0))return E(0);return E(L1(Q).length)}function kP(Q,X,Y){if(Q===X)return[{min:Q,max:X}];if(Q<0&&X>0){let Z=Y(-Q),K=Y(X);return[{min:-Z,max:K},{min:X-K,max:X},{min:Q,max:Q+Z}]}let J=Y(X-Q),$={min:Q,max:Q+J},G={min:X-J,max:X};return Q<0?[G,$]:[$,G]}var{ceil:wg,floor:Cg}=Math;function iF(Q){return Cg(Q/2)}function aF(Q){return wg(Q/2)}function sF(Q,X,Y){let J=Q-X;function*$(){let Z=Y?void 0:X,K=Y?J:iF(J);for(let W=K;W>0;W=iF(W)){let H=W===J?X:Q-W;yield new k(H,Z),Z=H}}function*G(){let Z=Y?void 0:X,K=Y?J:aF(J);for(let W=K;W<0;W=aF(W)){let H=W===J?X:Q-W;yield new k(H,Z),Z=H}}return J>0?t4($()):t4(G())}var tF=Math.sign,Tg=Number.isInteger,Ig=Object.is,V9=class Q extends C0{constructor(X,Y){super();this.min=X,this.max=Y}generate(X,Y){let J=this.computeGenerateRange(X,Y);return new k(X.nextInt(J.min,J.max),void 0)}canShrinkWithoutContext(X){return typeof X==="number"&&Tg(X)&&!Ig(X,-0)&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return sF(X,this.defaultTarget(),!0);if(this.isLastChanceTry(X,Y))return s.of(new k(Y,void 0));return sF(X,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return 0;return this.min<0?this.max:this.min}computeGenerateRange(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=kP(this.min,this.max,Mg);if(J.length===1)return J[0];let $=X.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}isLastChanceTry(X,Y){if(X>0)return X===Y+1&&X>this.min;if(X<0)return X===Y-1&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="number")throw Error("Invalid context type passed to IntegerArbitrary (#1)");if(Y!==0&&tF(X)!==tF(Y))throw Error("Invalid context value passed to IntegerArbitrary (#2)");return!0}},eF=Number.isInteger;function jg(Q){return{min:Q.min!==void 0?Q.min:-2147483648,max:Q.max!==void 0?Q.max:2147483647}}function O0(Q={}){let X=jg(Q);if(X.min>X.max)throw Error("fc.integer maximum value should be equal or greater than the minimum one");if(!eF(X.min))throw Error("fc.integer minimum value should be an integer");if(!eF(X.max))throw Error("fc.integer maximum value should be an integer");return new V9(X.min,X.max)}var QL=new Map;function UK(Q){if(Q===void 0)return{depth:0};if(typeof Q!=="string")return Q;let X=c1(QL,Q);if(X!==void 0)return X;let Y={depth:0};return L8(QL,Q,Y),Y}function OK(){return{depth:0}}var Eg=class{constructor(Q,X,Y){this.arb=Q,this.mrng=X,this.biasFactor=Y}attemptExact(){}next(){return this.arb.generate(this.mrng,this.biasFactor)}},Sg=Math.min,xg=Math.max,vg=class{constructor(Q,X,Y,J){this.arb=Q,this.mrng=X,this.slices=Y,this.biasFactor=J,this.activeSliceIndex=0,this.nextIndexInSlice=0,this.lastIndexInSlice=-1}attemptExact(Q){if(Q!==0&&this.mrng.nextInt(1,this.biasFactor)===1){let X=[];for(let Y=0;Y!==this.slices.length;++Y)if(this.slices[Y].length===Q)x(X,Y);if(X.length===0)return;this.activeSliceIndex=X[this.mrng.nextInt(0,X.length-1)],this.nextIndexInSlice=0,this.lastIndexInSlice=Q-1}}next(){if(this.nextIndexInSlice<=this.lastIndexInSlice)return new k(this.slices[this.activeSliceIndex][this.nextIndexInSlice++],void 0);if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.arb.generate(this.mrng,this.biasFactor);this.activeSliceIndex=this.mrng.nextInt(0,this.slices.length-1);let Q=this.slices[this.activeSliceIndex];if(this.mrng.nextInt(1,this.biasFactor)!==1)return this.nextIndexInSlice=1,this.lastIndexInSlice=Q.length-1,new k(Q[0],void 0);let X=this.mrng.nextInt(0,Q.length-1),Y=this.mrng.nextInt(0,Q.length-1);return this.nextIndexInSlice=Sg(X,Y),this.lastIndexInSlice=xg(X,Y),new k(Q[this.nextIndexInSlice++],void 0)}};function XL(Q,X,Y,J){if(J===void 0||Y.length===0||X.nextInt(1,J)!==1)return new Eg(Q,X,J);return new vg(Q,X,Y,J)}var{floor:kg,log:YL,max:JL}=Math,yg=Array.isArray;function FZ(Q,X){if(Q===X)return Q;return Q+kg(YL(X-Q)/YL(2))}var yP=class Q extends C0{constructor(X,Y,J,$,G,Z,K){super();this.arb=X,this.minLength=Y,this.maxGeneratedLength=J,this.maxLength=$,this.setBuilder=Z,this.customSlices=K,this.lengthArb=O0({min:Y,max:J}),this.depthContext=UK(G)}preFilter(X){if(this.setBuilder===void 0)return X;let Y=this.setBuilder();for(let J=0;J!==X.length;++J)Y.tryAdd(X[J]);return Y.getData()}static makeItCloneable(X,Y){return X[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)x(J,Y[$].value);return this.makeItCloneable(J,Y),J},X}generateNItemsNoDuplicates(X,Y,J,$){let G=0,Z=X(),K=XL(this.arb,J,this.customSlices,$);while(Z.size()<Y&&G<this.maxGeneratedLength){let W=K.next();if(Z.tryAdd(W))G=0;else G+=1}return Z.getData()}safeGenerateNItemsNoDuplicates(X,Y,J,$){let G=JL(0,Y-FZ(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=G;try{return this.generateNItemsNoDuplicates(X,Y,J,$)}finally{this.depthContext.depth-=G}}generateNItems(X,Y,J){let $=[],G=XL(this.arb,Y,this.customSlices,J);G.attemptExact(X);for(let Z=0;Z!==X;++Z)x($,G.next());return $}safeGenerateNItems(X,Y,J){let $=JL(0,X-FZ(this.minLength,this.maxGeneratedLength));this.depthContext.depth+=$;try{return this.generateNItems(X,Y,J)}finally{this.depthContext.depth-=$}}wrapper(X,Y,J,$){let G=Y?this.preFilter(X):X,Z=!1,K=[],W=[];for(let H=0;H!==G.length;++H){let _=G[H];Z=Z||_.hasToBeCloned,x(K,_.value),x(W,_.context)}if(Z)Q.makeItCloneable(K,G);return new k(K,{shrunkOnce:Y,lengthContext:X.length===G.length&&J!==void 0?J:void 0,itemsContexts:W,startIndex:$})}generate(X,Y){let J=this.applyBias(X,Y),$=J.size,G=this.setBuilder!==void 0?this.safeGenerateNItemsNoDuplicates(this.setBuilder,$,X,J.biasFactorItems):this.safeGenerateNItems($,X,J.biasFactorItems);return this.wrapper(G,!1,void 0,0)}applyBias(X,Y){if(Y===void 0)return{size:this.lengthArb.generate(X,void 0).value};if(this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(X,void 0).value,biasFactorItems:Y};if(X.nextInt(1,Y)!==1)return{size:this.lengthArb.generate(X,void 0).value};if(X.nextInt(1,Y)!==1||this.minLength===this.maxGeneratedLength)return{size:this.lengthArb.generate(X,void 0).value,biasFactorItems:Y};let J=FZ(this.minLength,this.maxGeneratedLength);return{size:O0({min:this.minLength,max:J}).generate(X,void 0).value,biasFactorItems:Y}}canShrinkWithoutContext(X){if(!yg(X)||this.minLength>X.length||X.length>this.maxLength)return!1;for(let Y=0;Y!==X.length;++Y){if(!(Y in X))return!1;if(!this.arb.canShrinkWithoutContext(X[Y]))return!1}return this.preFilter(G0(X,(Y)=>new k(Y,void 0))).length===X.length}shrinkItemByItem(X,Y,J){let $=[];for(let G=Y.startIndex;G<J;++G)x($,s4(()=>this.arb.shrink(X[G],Y.itemsContexts[G]).map((Z)=>{let K=G0(s0(X,0,G),(H,_)=>new k(Z9(H),Y.itemsContexts[_])),W=G0(s0(X,G+1),(H,_)=>new k(Z9(H),Y.itemsContexts[_+G+1]));return[[...K,Z,...W],void 0,G]})));return s.nil().join(...$)}shrinkImpl(X,Y){if(X.length===0)return s.nil();let J=Y!==void 0?Y:{shrunkOnce:!1,lengthContext:void 0,itemsContexts:[],startIndex:0};return this.lengthArb.shrink(X.length,J.lengthContext).drop(J.shrunkOnce&&J.lengthContext===void 0&&X.length>this.minLength+1?1:0).map(($)=>{let G=X.length-$.value;return[G0(s0(X,G),(Z,K)=>new k(Z9(Z),J.itemsContexts[K+G])),$.context,0]}).join(s4(()=>X.length>this.minLength?this.shrinkItemByItem(X,J,1):this.shrinkItemByItem(X,J,X.length))).join(X.length>this.minLength?s4(()=>{let $={shrunkOnce:!1,lengthContext:void 0,itemsContexts:s0(J.itemsContexts,1),startIndex:0};return this.shrinkImpl(s0(X,1),$).filter((G)=>this.minLength<=G[0].length+1).map((G)=>{return[[new k(Z9(X[0]),J.itemsContexts[0]),...G[0]],void 0,0]})}):s.nil())}shrink(X,Y){return this.shrinkImpl(X,Y).map((J)=>this.wrapper(J[0],!0,J[1],J[2]))}},bg=Math.floor,gg=Math.min,t6=2147483647,J9=["xsmall","small","medium","large","xlarge"],hg=["-4","-3","-2","-1","=","+1","+2","+3","+4"],zK="small";function mg(Q,X){switch(X){case"xsmall":return bg(1.1*Q)+1;case"small":return 2*Q+10;case"medium":return 11*Q+100;case"large":return 101*Q+1000;case"xlarge":return 1001*Q+1e4;default:throw Error(`Unable to compute lengths based on received size: ${X}`)}}function qX(Q,X){let Y=V4(hg,Q);if(Y===-1)return Q;let J=V4(J9,X);if(J===-1)throw Error(`Unable to offset size based on the unknown defaulted one: ${X}`);let $=J+Y-4;return $<0?J9[0]:$>=J9.length?J9[J9.length-1]:J9[$]}function VX(Q,X,Y,J){let{baseSize:$=zK,defaultSizeToMaxWhenMaxSpecified:G}=P8()||{},Z=Q!==void 0?Q:J&&G?"max":$;if(Z==="max")return Y;return gg(mg(X,qX(Z,$)),Y)}function dg(Q,X){if(typeof Q==="number")return 1/Q;let{baseSize:Y=zK,defaultSizeToMaxWhenMaxSpecified:J}=P8()||{},$=Q!==void 0?Q:X&&J?"max":Y;if($==="max")return 0;switch(qX($,Y)){case"xsmall":return 1;case"small":return 0.5;case"medium":return 0.25;case"large":return 0.125;case"xlarge":return 0.0625}}function FK(Q){let{baseSize:X=zK}=P8()||{};if(Q===void 0)return X;return qX(Q,X)}function P0(Q,X={}){let Y=X.size,J=X.minLength||0,$=X.maxLength,G=X.depthIdentifier,Z=$!==void 0?$:t6;return new yP(Q,J,VX(Y,J,Z,$!==void 0),Z,G,void 0,X.experimentalCustomSlices||[])}function K2(Q){return Q/E(2)}function $L(Q,X,Y){let J=Q-X;function*$(){let Z=Y?void 0:X,K=Y?J:K2(J);for(let W=K;W>0;W=K2(W)){let H=Q-W;yield new k(H,Z),Z=H}}function*G(){let Z=Y?void 0:X,K=Y?J:K2(J);for(let W=K;W<0;W=K2(W)){let H=Q-W;yield new k(H,Z),Z=H}}return J>0?t4($()):t4(G())}var pg=class Q extends C0{constructor(X,Y){super();this.min=X,this.max=Y}generate(X,Y){let J=this.computeGenerateRange(X,Y);return new k(X.nextBigInt(J.min,J.max),void 0)}computeGenerateRange(X,Y){if(Y===void 0||X.nextInt(1,Y)!==1)return{min:this.min,max:this.max};let J=kP(this.min,this.max,Ag);if(J.length===1)return J[0];let $=X.nextInt(-2*(J.length-1),J.length-2);return $<0?J[0]:J[$+1]}canShrinkWithoutContext(X){return typeof X==="bigint"&&this.min<=X&&X<=this.max}shrink(X,Y){if(!Q.isValidContext(X,Y))return $L(X,this.defaultTarget(),!0);if(this.isLastChanceTry(X,Y))return s.of(new k(Y,void 0));return $L(X,Y,!1)}defaultTarget(){if(this.min<=0&&this.max>=0)return E(0);return this.min<0?this.max:this.min}isLastChanceTry(X,Y){if(X>0)return X===Y+E(1)&&X>this.min;if(X<0)return X===Y-E(1)&&X<this.max;return!1}static isValidContext(X,Y){if(Y===void 0)return!1;if(typeof Y!=="bigint")throw Error("Invalid context type passed to BigIntArbitrary (#1)");let J=X>0&&Y<0||X<0&&Y>0;if(Y!==E(0)&&J)throw Error("Invalid context value passed to BigIntArbitrary (#2)");return!0}};function cg(Q){let Y=E(-1)<<E(255),J=(E(1)<<E(255))-E(1),$=Q.min,G=Q.max;return{min:$!==void 0?$:Y-(G!==void 0&&G<E(0)?G*G:E(0)),max:G!==void 0?G:J+($!==void 0&&$>E(0)?$*$:E(0))}}function fg(Q){if(Q[0]===void 0)return{};if(Q[1]===void 0)return Q[0];return{min:Q[0],max:Q[1]}}function e4(...Q){let X=cg(fg(Q));if(X.min>X.max)throw Error("fc.bigInt expects max to be greater than or equal to min");return new pg(X.min,X.max)}var ug=Object.getPrototypeOf,JX=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,void 0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return this.arb.shrink(Q,X)}};function A2(Q){if(ug(Q)===JX.prototype&&Q.generate===JX.prototype.generate&&Q.canShrinkWithoutContext===JX.prototype.canShrinkWithoutContext&&Q.shrink===JX.prototype.shrink)return Q;return new JX(Q)}function lg(Q){return Q===1}function rg(Q){if(typeof Q!=="boolean")throw Error("Unsupported input type");return Q===!0?1:0}function DX(){return A2(O0({min:0,max:1}).map(lg,rg))}var ZX=Object.is,og=class{constructor(Q){this.values=Q,this.fastValues=new K9(this.values);let X=!1,Y=!1;if(M2(this.fastValues,0))for(let J=0;J!==this.values.length;++J){let $=this.values[J];X=X||ZX($,-0),Y=Y||ZX($,0)}this.hasMinusZero=X,this.hasPlusZero=Y}has(Q){if(Q===0){if(ZX(Q,0))return this.hasPlusZero;return this.hasMinusZero}return M2(this.fastValues,Q)}},bP=class extends C0{constructor(Q){super();this.values=Q}generate(Q,X){let Y=this.values.length===1?0:Q.nextInt(0,this.values.length-1),J=this.values[Y];if(!s6(J))return new k(J,Y);return new k(J,Y,()=>J[r0]())}canShrinkWithoutContext(Q){if(this.values.length===1)return ZX(this.values[0],Q);if(this.fastValues===void 0)this.fastValues=new og(this.values);return this.fastValues.has(Q)}shrink(Q,X){if(X===0||ZX(Q,this.values[0]))return s.nil();return s.of(new k(this.values[0],0))}};function m8(...Q){if(Q.length===0)throw Error("fc.constantFrom expects at least one parameter");return new bP(Q)}function ng(Q){if(!Q||!Q.withBigInt)return m8(!1,null,void 0,0,"",NaN);return m8(!1,null,void 0,0,"",NaN,E(0))}function y0(Q){return new bP([Q])}var ig=class Q{constructor(){this.receivedLogs=[]}log(X){this.receivedLogs.push(X)}size(){return this.receivedLogs.length}toString(){return JSON.stringify({logs:this.receivedLogs})}[r0](){return new Q}};function ag(){return y0(new ig)}var sg=NaN,tg=Number.isNaN;function gP(Q){return new R2(Q)}function hP(Q){if(!(Q instanceof R2)||Q.constructor!==R2)throw new S("Not a valid value for date unmapper");return N2(Q)}function eg(Q){return(X)=>{return X===Q?new R2(sg):gP(X)}}function Qh(Q){return(X)=>{let Y=hP(X);return tg(Y)?Q:Y}}var GL=Number.isNaN;function mP(Q={}){let X=Q.min!==void 0?N2(Q.min):-8640000000000000,Y=Q.max!==void 0?N2(Q.max):8640000000000000,J=Q.noInvalidDate;if(GL(X))throw Error("fc.date min must be valid instance of Date");if(GL(Y))throw Error("fc.date max must be valid instance of Date");if(X>Y)throw Error("fc.date max must be greater or equal to min");if(J)return O0({min:X,max:Y}).map(gP,hP);let $=Y+1;return O0({min:X,max:Y+1}).map(eg($),Qh($))}var Xh=class extends C0{constructor(Q,X){super();this.startArb=Q,this.chainer=X}generate(Q,X){let Y=[],J=Q.clone(),$=this.startArb.generate(Q,X);Y.push({arbitrary:this.startArb,value:$.value_,context:$.context,clonedMrng:J});while(!0){let Z=this.chainer($.value_);if(Z===void 0)break;let K=Q.clone();$=Z.generate(Q,X),Y.push({arbitrary:Z,value:$.value_,context:$.context,clonedMrng:K})}let G={biasFactor:X,entries:Y,currentShrinkLevel:0};return new k($.value_,G)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){if(!this.isSafeContext(X))return s.nil();return new s(this.shrinkIterator(X))}*shrinkIterator(Q){let{entries:X,currentShrinkLevel:Y,biasFactor:J}=Q;for(let $=Y;$<X.length;++$){let G=X[$],Z=G.arbitrary.shrink(G.value,G.context);for(let K of Z){let W=X.slice(0,$);W.push({arbitrary:G.arbitrary,value:K.value_,context:K.context,clonedMrng:G.clonedMrng});let H=K,_=G.clonedMrng.clone();while(!0){let D=this.chainer(H.value_);if(D===void 0)break;let U=_.clone(),P=D.generate(_,J);W.push({arbitrary:D,value:P.value_,context:P.context,clonedMrng:U}),H=P}let V=W[W.length-1],q={biasFactor:J,entries:W,currentShrinkLevel:$};yield new k(V.value,q)}}}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"biasFactor"in Q&&"entries"in Q&&"currentShrinkLevel"in Q}};function Yh(Q,X){return new Xh(Q,X)}var Jh=Symbol.iterator,$h=Array.isArray,Gh=Object.is,Zh=class Q extends C0{constructor(X,Y){super();this.arb=X,this.numValues=Y}generate(X,Y){let J=[];if(this.numValues<=0)return this.wrapper(J);for(let $=0;$!==this.numValues-1;++$)x(J,this.arb.generate(X.clone(),Y));return x(J,this.arb.generate(X,Y)),this.wrapper(J)}canShrinkWithoutContext(X){if(!$h(X)||X.length!==this.numValues)return!1;if(X.length===0)return!0;for(let Y=1;Y<X.length;++Y)if(!Gh(X[0],X[Y]))return!1;return this.arb.canShrinkWithoutContext(X[0])}shrink(X,Y){if(X.length===0)return s.nil();return new s(this.shrinkImpl(X,Y!==void 0?Y:[])).map((J)=>this.wrapper(J))}*shrinkImpl(X,Y){let J=G0(X,(G,Z)=>this.arb.shrink(G,Y[Z])[Jh]()),$=G0(J,(G)=>G.next());while(!$[0].done)yield G0($,(G)=>G.value),$=G0(J,(G)=>G.next())}static makeItCloneable(X,Y){return X[r0]=()=>{let J=[];for(let $=0;$!==Y.length;++$)x(J,Y[$].value);return this.makeItCloneable(J,Y),J},X}wrapper(X){let Y=!1,J=[],$=[];for(let G=0;G!==X.length;++G){let Z=X[G];Y=Y||Z.hasToBeCloned,x(J,Z.value),x($,Z.context)}if(Y)Q.makeItCloneable(J,X);return new k(J,$)}};function Kh(Q,X){return new Zh(Q,X)}var ZL=class{constructor(Q){this.isEqual=Q,this.data=[]}tryAdd(Q){for(let X=0;X!==this.data.length;++X)if(this.isEqual(this.data[X],Q))return!1;return x(this.data,Q),!0}size(){return this.data.length}getData(){return this.data}},Wh=Number.isNaN,Hh=class{constructor(Q){this.selector=Q,this.selectedItemsExceptNaN=new K9,this.data=[]}tryAdd(Q){let X=this.selector(Q);if(Wh(X))return x(this.data,Q),!0;let Y=this.selectedItemsExceptNaN.size;if(KX(this.selectedItemsExceptNaN,X),Y!==this.selectedItemsExceptNaN.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},Vh=Object.is,_h=class{constructor(Q){this.selector=Q,this.selectedItemsExceptMinusZero=new K9,this.data=[],this.hasMinusZero=!1}tryAdd(Q){let X=this.selector(Q);if(Vh(X,-0)){if(this.hasMinusZero)return!1;return x(this.data,Q),this.hasMinusZero=!0,!0}let Y=this.selectedItemsExceptMinusZero.size;if(KX(this.selectedItemsExceptMinusZero,X),Y!==this.selectedItemsExceptMinusZero.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}},qh=class{constructor(Q){this.selector=Q,this.selectedItems=new K9,this.data=[]}tryAdd(Q){let X=this.selector(Q),Y=this.selectedItems.size;if(KX(this.selectedItems,X),Y!==this.selectedItems.size)return x(this.data,Q),!0;return!1}size(){return this.data.length}getData(){return this.data}};function Dh(Q){if(typeof Q.comparator==="function"){if(Q.selector===void 0){let K=Q.comparator,W=(H,_)=>K(H.value_,_.value_);return()=>new ZL(W)}let{comparator:J,selector:$}=Q,G=(K)=>$(K.value_),Z=(K,W)=>J(G(K),G(W));return()=>new ZL(Z)}let X=Q.selector||((J)=>J),Y=(J)=>X(J.value_);switch(Q.comparator){case"IsStrictlyEqual":return()=>new Hh(Y);case"SameValueZero":return()=>new qh(Y);case"SameValue":case void 0:return()=>new _h(Y)}}function e6(Q,X={}){let Y=X.minLength!==void 0?X.minLength:0,J=X.maxLength!==void 0?X.maxLength:t6,$=VX(X.size,Y,J,X.maxLength!==void 0),G=X.depthIdentifier,Z=new yP(Q,Y,$,J,G,Dh(X),[]);if(Y===0)return Z;return Z.filter((K)=>K.length>=Y)}var{create:Bh,defineProperty:Uh,getOwnPropertyDescriptor:Oh,getPrototypeOf:KL,prototype:zh}=Object,Fh=Reflect.ownKeys;function Lh(Q){let X=Q[1]?Bh(null):{};for(let Y of Q[0])Uh(X,Y[0],{enumerable:!0,configurable:!0,writable:!0,value:Y[1]});return X}function Ph(Q){return Q!==void 0&&!!Q.configurable&&!!Q.enumerable&&!!Q.writable&&Q.get===void 0&&Q.set===void 0}function Rh(Q){if(typeof Q!=="object"||Q===null)throw new S("Incompatible instance received: should be a non-null object");let X=KL(Q)===null,Y=KL(Q)===zh;if(!X&&!Y)throw new S("Incompatible instance received: should be of exact type Object");let J=G0(Fh(Q),($)=>[$,Oh(Q,$)]);if(!qP(J,([,$])=>Ph($)))throw new S("Incompatible instance received: should contain only c/e/w properties without get/set");return[G0(J,([$,G])=>[$,G.value]),X]}function Nh(Q){return Q[0]}function LK(Q,X,Y={}){let J=!!Y.noNullPrototype;return Q0(e6(Q0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:Nh,depthIdentifier:Y.depthIdentifier}),J?y0(!1):DX()).map(Lh,Rh)}var{POSITIVE_INFINITY:Mh,MAX_SAFE_INTEGER:Ah,isInteger:wh}=Number,Ch=Math.floor,Th=Math.pow,Ih=Math.min,cZ=class Q extends C0{static from(X,Y,J){if(X.length===0)throw Error(`${J} expects at least one weighted arbitrary`);let $=0;for(let G=0;G!==X.length;++G){if(X[G].arbitrary===void 0)throw Error(`${J} expects arbitraries to be specified`);let Z=X[G].weight;if($+=Z,!wh(Z))throw Error(`${J} expects weights to be integer values`);if(Z<0)throw Error(`${J} expects weights to be superior or equal to 0`)}if($<=0)throw Error(`${J} expects the sum of weights to be strictly superior to 0`);return new Q(X,{depthBias:dg(Y.depthSize,Y.maxDepth!==void 0),maxDepth:Y.maxDepth!==void 0?Y.maxDepth:Mh,withCrossShrink:!!Y.withCrossShrink},UK(Y.depthIdentifier))}constructor(X,Y,J){super();this.warbs=X,this.constraints=Y,this.context=J;let $=0;this.cumulatedWeights=[];for(let G=0;G!==X.length;++G)$+=X[G].weight,x(this.cumulatedWeights,$);this.totalWeight=$}generate(X,Y){if(this.mustGenerateFirst())return this.safeGenerateForIndex(X,0,Y);let J=X.nextInt(this.computeNegDepthBenefit(),this.totalWeight-1);for(let $=0;$!==this.cumulatedWeights.length;++$)if(J<this.cumulatedWeights[$])return this.safeGenerateForIndex(X,$,Y);throw Error("Unable to generate from fc.frequency")}canShrinkWithoutContext(X){return this.canShrinkWithoutContextIndex(X)!==-1}shrink(X,Y){if(Y!==void 0){let $=Y,G=$.selectedIndex,Z=$.originalBias,K=this.warbs[G].arbitrary.shrink(X,$.originalContext).map((W)=>this.mapIntoValue(G,W,null,Z));if($.clonedMrngForFallbackFirst!==null){if($.cachedGeneratedForFirst===void 0)$.cachedGeneratedForFirst=this.safeGenerateForIndex($.clonedMrngForFallbackFirst,0,Z);let W=$.cachedGeneratedForFirst;return s.of(W).join(K)}return K}let J=this.canShrinkWithoutContextIndex(X);if(J===-1)return s.nil();return this.defaultShrinkForFirst(J).join(this.warbs[J].arbitrary.shrink(X,void 0).map(($)=>this.mapIntoValue(J,$,null,void 0)))}defaultShrinkForFirst(X){++this.context.depth;try{if(!this.mustFallbackToFirstInShrink(X)||this.warbs[0].fallbackValue===void 0)return s.nil()}finally{--this.context.depth}let Y=new k(this.warbs[0].fallbackValue.default,void 0);return s.of(this.mapIntoValue(0,Y,null,void 0))}canShrinkWithoutContextIndex(X){if(this.mustGenerateFirst())return this.warbs[0].arbitrary.canShrinkWithoutContext(X)?0:-1;try{++this.context.depth;for(let Y=0;Y!==this.warbs.length;++Y){let J=this.warbs[Y];if(J.weight!==0&&J.arbitrary.canShrinkWithoutContext(X))return Y}return-1}finally{--this.context.depth}}mapIntoValue(X,Y,J,$){let G={selectedIndex:X,originalBias:$,originalContext:Y.context,clonedMrngForFallbackFirst:J};return new k(Y.value,G)}safeGenerateForIndex(X,Y,J){++this.context.depth;try{let $=this.warbs[Y].arbitrary.generate(X,J),G=this.mustFallbackToFirstInShrink(Y)?X.clone():null;return this.mapIntoValue(Y,$,G,J)}finally{--this.context.depth}}mustGenerateFirst(){return this.constraints.maxDepth<=this.context.depth}mustFallbackToFirstInShrink(X){return X!==0&&this.constraints.withCrossShrink&&this.warbs[0].weight!==0}computeNegDepthBenefit(){let X=this.constraints.depthBias;if(X<=0||this.warbs[0].weight===0)return 0;let Y=Ch(Th(1+X,this.context.depth))-1;return-Ih(this.totalWeight*Y,Ah)||0}};function jh(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&!("generate"in Q)&&!("arbitrary"in Q)&&!("weight"in Q)}function WL(Q){if(XP(Q))return{arbitrary:Q,weight:1};return Q}function l0(...Q){let X=Q[0];if(jh(X)){let J=G0(s0(Q,1),WL);return cZ.from(J,X,"fc.oneof")}let Y=G0(Q,WL);return cZ.from(Y,{},"fc.oneof")}var Eh=Number.isInteger;function a4(Q){let X=typeof Q==="number"?Q:Q&&Q.max!==void 0?Q.max:2147483647;if(X<0)throw Error("fc.nat value should be greater than or equal to 0");if(!Eh(X))throw Error("fc.nat maximum value should be an integer");return new V9(0,X)}var Sh=Object.is;function xh(Q){let X=0,Y=[];for(let J of Q){let $=X;X=$+J.num;let G=X-1;Y.push({from:$,to:G,entry:J})}return Y}function vh(Q,X){let Y=0,J=Q.length;while(J-Y>1){let $=~~((Y+J)/2);if(X<Q[$].from)J=$;else Y=$}return Q[Y]}function kh(Q){let X=xh(Q);return function(J){let $=vh(X,J);return $.entry.build(J-$.from)}}function yh(Q){let X={mapping:new q4,negativeZeroIndex:void 0},Y=0;for(let J=0;J!==Q.length;++J){let $=Q[J];for(let G=0;G!==$.num;++G){let Z=$.build(G);if(Z===0&&1/Z===_4.NEGATIVE_INFINITY)X.negativeZeroIndex=Y;else L8(X.mapping,Z,Y);++Y}}return X}function bh(Q){let X=null;return function(J){if(X===null)X=yh(Q);let $=Sh(J,-0)?X.negativeZeroIndex:c1(X.mapping,J);if($===void 0)throw new S("Unknown value encountered cannot be built using this mapToConstant");return $}}function gh(Q){if(Q.length===0)throw new S("fc.mapToConstant expects at least one option");let X=0;for(let Y=0;Y!==Q.length;++Y){if(Q[Y].num<0)throw new S("fc.mapToConstant expects all options to have a number of entries greater or equal to zero");X+=Q[Y].num}if(X===0)throw new S("fc.mapToConstant expects at least one choice among options");return X}function _9(...Q){return a4({max:gh(Q)-1}).map(kh(Q),bh(Q))}function dP(Q,X,Y,J){if(X.length===0){if(Y>0)return;return[]}if(J<=0)return;let $=[{endIndexChunks:0,nextStartIndex:1,chunks:[]}];while($.length>0){let G=HP($);for(let Z=G.nextStartIndex;Z<=X.length;++Z){let K=S0(X,G.endIndexChunks,Z);if(Q.canShrinkWithoutContext(K)){let W=[...G.chunks,K];if(Z===X.length){if(W.length<Y)break;return W}if(x($,{endIndexChunks:G.endIndexChunks,nextStartIndex:Z+1,chunks:G.chunks}),W.length<J)x($,{endIndexChunks:Z,nextStartIndex:Z+1,chunks:W});break}}}}function hh(Q){return w0(Q,"")}function pP(Q){return Q.minLength!==void 0?Q.minLength:0}function cP(Q){return Q.maxLength!==void 0?Q.maxLength:t6}function mh(Q,X){return pP(X)<=Q.length&&Q.length<=cP(X)}function dh(Q,X){return function(J){if(typeof J!=="string")throw new S("Unsupported value");let $=dP(Q,J,pP(X),cP(X));if($===void 0)throw new S("Unable to unmap received string");return $}}var fP=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","apply","arguments","bind","call","caller","length","name","prototype","key","ref"];function ph(Q,X,Y){let J;try{J=Y(Q)}catch{return}for(let $ of J)if(!X.canShrinkWithoutContext($))return;return J}function ch(Q,X){let Y=[];for(let J of fP){let $=ph(J,Q,X);if($!==void 0)x(Y,$)}return Y}var HL=new WeakMap;function fh(Q){let X=[];for(let Y of fP){let J=dP(Q,Y,0,t6);if(J!==void 0)x(X,J)}return X}function uh(Q,X){let Y=cy(HL,Q);if(Y===void 0)Y=fh(Q),py(HL,Q,Y);let J=[];for(let $ of Y)if(mh($,X))x(J,$);return J}var lh=[[0,127]],rh=[[0,55295],[57344,1114111]],oh=[[32,126],[160,172],[174,767],[880,887],[890,895],[900,906],[908],[910,929],[931,1154],[1162,1327],[1329,1366],[1369,1418],[1421,1423],[1470],[1472],[1475],[1478],[1488,1514],[1519,1524],[1542,1551],[1563],[1565,1610],[1632,1647],[1649,1749],[1758],[1765,1766],[1769],[1774,1805],[1808],[1810,1839],[1869,1957],[1969],[1984,2026],[2036,2042],[2046,2069],[2074],[2084],[2088],[2096,2110],[2112,2136],[2142],[2144,2154],[2160,2190],[2208,2249],[2308,2361],[2365],[2384],[2392,2401],[2404,2432],[2437,2444],[2447,2448],[2451,2472],[2474,2480],[2482],[2486,2489],[2493],[2510],[2524,2525],[2527,2529],[2534,2557],[2565,2570],[2575,2576],[2579,2600],[2602,2608],[2610,2611],[2613,2614],[2616,2617],[2649,2652],[2654],[2662,2671],[2674,2676],[2678],[2693,2701],[2703,2705],[2707,2728],[2730,2736],[2738,2739],[2741,2745],[2749],[2768],[2784,2785],[2790,2801],[2809],[2821,2828],[2831,2832],[2835,2856],[2858,2864],[2866,2867],[2869,2873],[2877],[2908,2909],[2911,2913],[2918,2935],[2947],[2949,2954],[2958,2960],[2962,2965],[2969,2970],[2972],[2974,2975],[2979,2980],[2984,2986],[2990,3001],[3024],[3046,3066],[3077,3084],[3086,3088],[3090,3112],[3114,3129],[3133],[3160,3162],[3165],[3168,3169],[3174,3183],[3191,3200],[3204,3212],[3214,3216],[3218,3240],[3242,3251],[3253,3257],[3261],[3293,3294],[3296,3297],[3302,3311],[3313,3314],[3332,3340],[3342,3344],[3346,3386],[3389],[3407],[3412,3414],[3416,3425],[3430,3455],[3461,3478],[3482,3505],[3507,3515],[3517],[3520,3526],[3558,3567],[3572],[3585,3632],[3634],[3647,3654],[3663,3675],[3713,3714],[3716],[3718,3722],[3724,3747],[3749],[3751,3760],[3762],[3773],[3776,3780],[3782],[3792,3801],[3804,3807],[3840,3863],[3866,3892],[3894],[3896],[3898,3901],[3904,3911],[3913,3948],[3973],[3976,3980],[4030,4037],[4039,4044],[4046,4058],[4096,4138],[4159,4181],[4186,4189],[4193],[4197,4198],[4206,4208],[4213,4225],[4238],[4240,4249],[4254,4293],[4295],[4301],[4304,4351],[4608,4680],[4682,4685],[4688,4694],[4696],[4698,4701],[4704,4744],[4746,4749],[4752,4784],[4786,4789],[4792,4798],[4800],[4802,4805],[4808,4822],[4824,4880],[4882,4885],[4888,4954],[4960,4988],[4992,5017],[5024,5109],[5112,5117],[5120,5788],[5792,5880],[5888,5905],[5919,5937],[5941,5942],[5952,5969],[5984,5996],[5998,6000],[6016,6067],[6100,6108],[6112,6121],[6128,6137],[6144,6154],[6160,6169],[6176,6264],[6272,6276],[6279,6312],[6314],[6320,6389],[6400,6430],[6464],[6468,6509],[6512,6516],[6528,6571],[6576,6601],[6608,6618],[6622,6678],[6686,6740],[6784,6793],[6800,6809],[6816,6829],[6917,6963],[6981,6988],[6992,7018],[7028,7038],[7043,7072],[7086,7141],[7164,7203],[7227,7241],[7245,7304],[7312,7354],[7357,7367],[7379],[7401,7404],[7406,7411],[7413,7414],[7418],[7424,7615],[7680,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8061],[8064,8116],[8118,8132],[8134,8147],[8150,8155],[8157,8175],[8178,8180],[8182,8190],[8192,8202],[8208,8233],[8239,8287],[8304,8305],[8308,8334],[8336,8348],[8352,8384],[8448,8587],[8592,9254],[9280,9290],[9312,11123],[11126,11157],[11159,11502],[11506,11507],[11513,11557],[11559],[11565],[11568,11623],[11631,11632],[11648,11670],[11680,11686],[11688,11694],[11696,11702],[11704,11710],[11712,11718],[11720,11726],[11728,11734],[11736,11742],[11776,11869],[11904,11929],[11931,12019],[12032,12245],[12272,12329],[12336,12351],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12771],[12783,12830],[12832,13312],[19903,19968],[40959,42124],[42128,42182],[42192,42539],[42560,42606],[42611],[42622,42653],[42656,42735],[42738,42743],[42752,42954],[42960,42961],[42963],[42965,42969],[42994,43009],[43011,43013],[43015,43018],[43020,43042],[43048,43051],[43056,43065],[43072,43127],[43138,43187],[43214,43225],[43250,43262],[43264,43301],[43310,43334],[43359],[43396,43442],[43457,43469],[43471,43481],[43486,43492],[43494,43518],[43520,43560],[43584,43586],[43588,43595],[43600,43609],[43612,43642],[43646,43695],[43697],[43701,43702],[43705,43709],[43712],[43714],[43739,43754],[43760,43764],[43777,43782],[43785,43790],[43793,43798],[43808,43814],[43816,43822],[43824,43883],[43888,44002],[44011],[44016,44025],[44032],[55203],[63744,64109],[64112,64217],[64256,64262],[64275,64279],[64285],[64287,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64450],[64467,64911],[64914,64967],[64975],[65008,65023],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65136,65140],[65142,65276],[65281,65437],[65440,65470],[65474,65479],[65482,65487],[65490,65495],[65498,65500],[65504,65510],[65512,65518],[65532,65533],[65536,65547],[65549,65574],[65576,65594],[65596,65597],[65599,65613],[65616,65629],[65664,65786],[65792,65794],[65799,65843],[65847,65934],[65936,65948],[65952],[66000,66044],[66176,66204],[66208,66256],[66273,66299],[66304,66339],[66349,66378],[66384,66421],[66432,66461],[66463,66499],[66504,66517],[66560,66717],[66720,66729],[66736,66771],[66776,66811],[66816,66855],[66864,66915],[66927,66938],[66940,66954],[66956,66962],[66964,66965],[66967,66977],[66979,66993],[66995,67001],[67003,67004],[67072,67382],[67392,67413],[67424,67431],[67456,67461],[67463,67504],[67506,67514],[67584,67589],[67592],[67594,67637],[67639,67640],[67644],[67647,67669],[67671,67742],[67751,67759],[67808,67826],[67828,67829],[67835,67867],[67871,67897],[67903],[67968,68023],[68028,68047],[68050,68096],[68112,68115],[68117,68119],[68121,68149],[68160,68168],[68176,68184],[68192,68255],[68288,68324],[68331,68342],[68352,68405],[68409,68437],[68440,68466],[68472,68497],[68505,68508],[68521,68527],[68608,68680],[68736,68786],[68800,68850],[68858,68899],[68912,68921],[69216,69246],[69248,69289],[69293],[69296,69297],[69376,69415],[69424,69445],[69457,69465],[69488,69505],[69510,69513],[69552,69579],[69600,69622],[69635,69687],[69703,69709],[69714,69743],[69745,69746],[69749],[69763,69807],[69819,69820],[69822,69825],[69840,69864],[69872,69881],[69891,69926],[69942,69956],[69959],[69968,70002],[70004,70006],[70019,70066],[70081],[70084,70088],[70093],[70096,70111],[70113,70132],[70144,70161],[70163,70187],[70200,70205],[70207,70208],[70272,70278],[70280],[70282,70285],[70287,70301],[70303,70313],[70320,70366],[70384,70393],[70405,70412],[70415,70416],[70419,70440],[70442,70448],[70450,70451],[70453,70457],[70461],[70480],[70493,70497],[70656,70708],[70727,70747],[70749],[70751,70753],[70784,70831],[70852,70855],[70864,70873],[71040,71086],[71105,71131],[71168,71215],[71233,71236],[71248,71257],[71264,71276],[71296,71338],[71352,71353],[71360,71369],[71424,71450],[71472,71494],[71680,71723],[71739],[71840,71922],[71935,71942],[71945],[71948,71955],[71957,71958],[71960,71983],[72004,72006],[72016,72025],[72096,72103],[72106,72144],[72161,72163],[72192],[72203,72242],[72255,72262],[72272],[72284,72323],[72346,72354],[72368,72440],[72448,72457],[72704,72712],[72714,72750],[72768,72773],[72784,72812],[72816,72847],[72960,72966],[72968,72969],[72971,73008],[73040,73049],[73056,73061],[73063,73064],[73066,73097],[73112],[73120,73129],[73440,73458],[73463,73464],[73476,73488],[73490,73523],[73539,73561],[73648],[73664,73713],[73727,74649],[74752,74862],[74864,74868],[74880,75075],[77712,77810],[77824,78895],[78913,78918],[82944,83526],[92160,92728],[92736,92766],[92768,92777],[92782,92862],[92864,92873],[92880,92909],[92917],[92928,92975],[92983,92997],[93008,93017],[93019,93025],[93027,93047],[93053,93071],[93760,93850],[93952,94026],[94032],[94099,94111],[94176,94179],[94208],[100343],[100352,101589],[101632],[101640],[110576,110579],[110581,110587],[110589,110590],[110592,110882],[110898],[110928,110930],[110933],[110948,110951],[110960,111355],[113664,113770],[113776,113788],[113792,113800],[113808,113817],[113820],[113823],[118608,118723],[118784,119029],[119040,119078],[119081,119140],[119146,119148],[119171,119172],[119180,119209],[119214,119274],[119296,119361],[119365],[119488,119507],[119520,119539],[119552,119638],[119648,119672],[119808,119892],[119894,119964],[119966,119967],[119970],[119973,119974],[119977,119980],[119982,119993],[119995],[119997,120003],[120005,120069],[120071,120074],[120077,120084],[120086,120092],[120094,120121],[120123,120126],[120128,120132],[120134],[120138,120144],[120146,120485],[120488,120779],[120782,121343],[121399,121402],[121453,121460],[121462,121475],[121477,121483],[122624,122654],[122661,122666],[122928,122989],[123136,123180],[123191,123197],[123200,123209],[123214,123215],[123536,123565],[123584,123627],[123632,123641],[123647],[124112,124139],[124144,124153],[124896,124902],[124904,124907],[124909,124910],[124912,124926],[124928,125124],[125127,125135],[125184,125251],[125259],[125264,125273],[125278,125279],[126065,126132],[126209,126269],[126464,126467],[126469,126495],[126497,126498],[126500],[126503],[126505,126514],[126516,126519],[126521],[126523],[126530],[126535],[126537],[126539],[126541,126543],[126545,126546],[126548],[126551],[126553],[126555],[126557],[126559],[126561,126562],[126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[126704,126705],[126976,127019],[127024,127123],[127136,127150],[127153,127167],[127169,127183],[127185,127221],[127232,127405],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127994],[128000,128727],[128732,128748],[128752,128764],[128768,128886],[128891,128985],[128992,129003],[129008],[129024,129035],[129040,129095],[129104,129113],[129120,129159],[129168,129197],[129200,129201],[129280,129619],[129632,129645],[129648,129660],[129664,129672],[129680,129725],[129727,129733],[129742,129755],[129760,129768],[129776,129784],[129792,129938],[129940,129994],[130032,130041],[131072],[173791],[173824],[177977],[177984],[178205],[178208],[183969],[183984],[191456],[191472],[192093],[194560,195101],[196608],[201546],[201552],[205743]],nh=[[192,197],[199,207],[209,214],[217,221],[224,229],[231,239],[241,246],[249,253],[255,271],[274,293],[296,304],[308,311],[313,318],[323,328],[332,337],[340,357],[360,382],[416,417],[431,432],[461,476],[478,483],[486,496],[500,501],[504,539],[542,543],[550,563],[901,902],[904,906],[908],[910,912],[938,944],[970,974],[979,980],[1024,1025],[1027],[1031],[1036,1038],[1049],[1081],[1104,1105],[1107],[1111],[1116,1118],[1142,1143],[1217,1218],[1232,1235],[1238,1239],[1242,1247],[1250,1255],[1258,1269],[1272,1273],[1570,1574],[1728],[1730],[1747],[2345],[2353],[2356],[2392,2399],[2524,2525],[2527],[2611],[2614],[2649,2651],[2654],[2908,2909],[2964],[3907],[3917],[3922],[3927],[3932],[3945],[4134],[6918],[6920],[6922],[6924],[6926],[6930],[7680,7833],[7835],[7840,7929],[7936,7957],[7960,7965],[7968,8005],[8008,8013],[8016,8023],[8025],[8027],[8029],[8031,8048],[8050],[8052],[8054],[8056],[8058],[8060],[8064,8116],[8118,8122],[8124],[8129,8132],[8134,8136],[8138],[8140,8146],[8150,8154],[8157,8162],[8164,8170],[8172,8173],[8178,8180],[8182,8184],[8186],[8188],[8602,8603],[8622],[8653,8655],[8708],[8713],[8716],[8740],[8742],[8769],[8772],[8775],[8777],[8800],[8802],[8813,8817],[8820,8821],[8824,8825],[8832,8833],[8836,8837],[8840,8841],[8876,8879],[8928,8931],[8938,8941],[10972],[12364],[12366],[12368],[12370],[12372],[12374],[12376],[12378],[12380],[12382],[12384],[12386],[12389],[12391],[12393],[12400,12401],[12403,12404],[12406,12407],[12409,12410],[12412,12413],[12436],[12446],[12460],[12462],[12464],[12466],[12468],[12470],[12472],[12474],[12476],[12478],[12480],[12482],[12485],[12487],[12489],[12496,12497],[12499,12500],[12502,12503],[12505,12506],[12508,12509],[12532],[12535,12538],[12542],[44032],[55203],[64285],[64287],[64298,64310],[64312,64316],[64318],[64320,64321],[64323,64324],[64326,64334],[69786],[69788],[69803],[119134,119140],[119227,119232]],VL=String.fromCodePoint,ih=Math.min,ah=Math.max;function fZ(Q){if(Q.length===1){let Y=VL(Q[0]);return{num:1,build:()=>Y}}let X=Q[0];return{num:Q[1]-Q[0]+1,build:(Y)=>VL(X+Y)}}function _L(Q,X){let Y=[],J=0,$=0;while(J<Q.length&&$<X.length){let G=Q[J],Z=G[0],K=G.length===1?G[0]:G[1],W=X[$],H=W[0],_=W.length===1?W[0]:W[1];if(K<H)J+=1;else if(_<Z)$+=1;else{let V=ah(Z,H),q=ih(K,_);if(Y.length>=1){let D=Y[Y.length-1];if((D.length===1?D[0]:D[1])+1===V)V=D[0],HP(Y)}if(x(Y,V===q?[V]:[V,q]),K<=q)J+=1;if(_<=q)$+=1}}return Y}var qL=Object.create(null);function sh(Q){switch(Q){case"full":return rh;case"ascii":return lh}}function th(Q,X){let Y=`${Q}:${X}`,J=qL[Y];if(J!==void 0)return J;let $=sh(X),G=Q==="binary"?$:_L($,oh),Z=[];for(let W of G)x(Z,fZ(W));if(Q==="grapheme"){let W=_L($,nh);for(let H of W){let _=fZ(H);x(Z,{num:_.num,build:(V)=>Zb(_.build(V),"NFD")})}}let K=_9(...Z);return qL[Y]=K,K}function $X(Q,X){return th(Q,X)}function eh(Q){if(typeof Q.unit==="object")return Q.unit;switch(Q.unit){case"grapheme":return $X("grapheme","full");case"grapheme-composite":return $X("composite","full");case"grapheme-ascii":case void 0:return $X("grapheme","ascii");case"binary":return $X("binary","full");case"binary-ascii":return $X("binary","ascii")}}function d0(Q={}){let X=eh(Q),Y=dh(X,Q),J=uh(X,Q);return P0(X,{...Q,experimentalCustomSlices:J}).map(hh,Y)}var uP=Map,PK=String.fromCharCode,RK={num:26,build:(Q)=>PK(Q+97)},Qm={num:26,build:(Q)=>PK(Q+65)},lP={num:10,build:(Q)=>PK(Q+48)};function Xm(Q){let X=Ly(Q);return Q!==X?X:`%${WX(W9(Q,0),16)}`}function Ym(Q){if(typeof Q!=="string")throw Error("Unsupported");return decodeURIComponent(Q)}var Jm=()=>d0({unit:"binary",minLength:1,maxLength:1}).map(Xm,Ym),LZ=void 0;function $m(){if(LZ===void 0)LZ=_9(RK);return LZ}var W2=void 0;function uZ(Q){if(W2===void 0)W2=new uP;let X=c1(W2,Q);if(X===void 0)X=_9(RK,lP,{num:Q.length,build:(Y)=>Q[Y]}),L8(W2,Q,X);return X}function Gm(Q){return _9(RK,Qm,lP,{num:Q.length,build:(X)=>Q[X]})}var H2=void 0;function NK(Q){if(H2===void 0)H2=new uP;let X=c1(H2,Q);if(X===void 0)X=l0({weight:10,arbitrary:Gm(Q)},{weight:1,arbitrary:Jm()}),L8(H2,Q,X);return X}function B4(Q,X={}){let Y=X.freq===void 0?6:X.freq,J=DP(X,"nil")?X.nil:null,$=[{arbitrary:y0(J),weight:1,fallbackValue:{default:J}},{arbitrary:Q,weight:Y-1}],G={withCrossShrink:!0,depthSize:X.depthSize,maxDepth:X.maxDepth,depthIdentifier:X.depthIdentifier};return cZ.from($,G,"fc.option")}function Zm(Q){if(Q.length>63)return!1;return Q.length<4||Q[0]!=="x"||Q[1]!=="n"||Q[2]!=="-"||Q[3]!=="-"}var rP=Symbol("adapted-value");function Km(Q,X){let Y=X(Q.value_);if(!Y.adapted)return Q;return new k(Y.value,rP)}var Wm=class extends C0{constructor(Q,X){super();this.sourceArb=Q,this.adapter=X,this.adaptValue=(Y)=>Km(Y,X)}generate(Q,X){let Y=this.sourceArb.generate(Q,X);return this.adaptValue(Y)}canShrinkWithoutContext(Q){return this.sourceArb.canShrinkWithoutContext(Q)&&!this.adapter(Q).adapted}shrink(Q,X){if(X===rP){if(!this.sourceArb.canShrinkWithoutContext(Q))return s.nil();return this.sourceArb.shrink(Q,void 0).map(this.adaptValue)}return this.sourceArb.shrink(Q,X).map(this.adaptValue)}};function oP(Q,X){return new Wm(Q,X)}function Hm([Q,X]){return X===null?Q:`${Q}${X[0]}${X[1]}`}function Vm(Q){if(typeof Q!=="string"||Q.length===0)throw Error("Unsupported");if(Q.length===1)return[Q[0],null];return[Q[0],[S0(Q,1,Q.length-1),Q[Q.length-1]]]}function _m(Q){let X=uZ("");return Q0(X,B4(Q0(d0({unit:uZ("-"),size:Q,maxLength:61}),X))).map(Hm,Vm).filter(Zm)}function qm(Q){return`${w0(Q[0],".")}.${Q[1]}`}function Dm(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=Q.lastIndexOf(".");return[P1(S0(Q,0,X),"."),S0(Q,X+1)]}function Bm(Q){let[X,Y]=Q,J=Y.length;for(let $=0;$!==X.length;++$)if(J+=1+X[$].length,J>255)return{adapted:!0,value:[s0(X,0,$),Y]};return{adapted:!1,value:Q}}function MK(Q={}){let X=FK(Q.size),Y=qX("-1",X),J=d0({unit:$m(),minLength:2,maxLength:63,size:Y});return oP(Q0(P0(_m(X),{size:Y,minLength:1,maxLength:127}),J),Bm).map(qm,Dm)}function Um(Q){let X=Q[0].length;for(let Y=1;Y!==Q.length;++Y)if(X+=1+Q[Y].length,X>64)return{adapted:!0,value:s0(Q,0,Y)};return{adapted:!1,value:Q}}function Om(Q){return w0(Q,".")}function zm(Q){if(typeof Q!=="string")throw Error("Unsupported");return P1(Q,".")}function Fm(Q){return`${Q[0]}@${Q[1]}`}function Lm(Q){if(typeof Q!=="string")throw Error("Unsupported");return P1(Q,"@",2)}function Pm(Q={}){return Q0(oP(P0(d0({unit:uZ("!#$%&'*+-/=?^_`{|}~"),minLength:1,maxLength:64,size:Q.size}),{minLength:1,maxLength:32,size:Q.size}),Um).map(Om,zm),MK({size:Q.size})).map(Fm,Lm)}var{NEGATIVE_INFINITY:Rm,POSITIVE_INFINITY:lZ,EPSILON:nP}=_4,AK=E(2146435072)*E(4294967296),Nm=-AK-E(1),DL=4503599627370496,Mm=E(4503599627370495),BL=E("9007199254740992"),rZ=new Float64Array(1),UL=new Uint32Array(rZ.buffer,rZ.byteOffset);function Am(Q){return rZ[0]=Q,[UL[1],UL[0]]}function wm(Q){let{0:X,1:Y}=Am(Q),J=X>>>31,$=X>>>20&2047,G=(X&1048575)*4294967296+Y,Z=$===0?-1022:$-1023,K=$===0?0:1;return K+=G*nP,K*=J===0?1:-1,{exponent:Z,significand:K}}function OL(Q,X){if(Q===-1022)return E(X*DL);return E((X-1)*DL)+(E(Q+1023)<<E(52))}function wK(Q){if(Q===lZ)return AK;if(Q===Rm)return Nm;let X=wm(Q),Y=X.exponent,J=X.significand;if(Q>0||Q===0&&1/Q===lZ)return OL(Y,J);else return-OL(Y,-J)-E(1)}function oZ(Q){if(Q<0)return-oZ(-Q-E(1));if(Q===AK)return lZ;if(Q<BL)return _4(Q)*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005;let X=Q-BL,Y=-1021+_4(X>>E(52));return(1+_4(X&Mm)*nP)*2**Y}var zL=Number.isInteger,FL=Object.is,PZ=Number.NEGATIVE_INFINITY,RZ=Number.POSITIVE_INFINITY;function iP(Q,X,Y,J){let{noDefaultInfinity:$=!1,minExcluded:G=!1,maxExcluded:Z=!1,min:K=$?-X:PZ,max:W=$?X:RZ}=Q,H=G?K<-Y?-J:Math.max(K,-Y):K===PZ?Math.max(K,-J):Math.max(K,-Y),_=Z?W>Y?J:Math.min(W,Y):W===RZ?Math.min(W,J):Math.min(W,Y);return{noDefaultInfinity:!1,minExcluded:G||(K!==PZ||G)&&zL(H),maxExcluded:Z||(W!==RZ||Z)&&zL(_),min:FL(H,-0)?0:H,max:FL(_,0)?-0:_,noNaN:Q.noNaN||!1}}var{NEGATIVE_INFINITY:aP,POSITIVE_INFINITY:sP,MAX_VALUE:Cm}=Number,Tm=4503599627370495.5,nZ=4503599627370496;function Im(Q){return iP(Q,Cm,Tm,nZ)}function jm(Q){return Q===4503599627370496?sP:Q===-4503599627370496?aP:Q}function Em(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===sP?nZ:Q===aP?-nZ:Q}var{isInteger:Sm,isNaN:tP,NEGATIVE_INFINITY:xm,POSITIVE_INFINITY:vm,MAX_VALUE:LL}=Number,km=NaN;function PL(Q,X){if(tP(Q))throw Error("fc.double constraints."+X+" must be a 64-bit float");return wK(Q)}function ym(Q){if(typeof Q!=="number")throw Error("Unsupported type");return wK(Q)}function bm(Q){return!Sm(Q)}function RL(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=X?-LL:xm,max:Z=X?LL:vm}=Q,K=PL(G,"min"),W=J?K+E(1):K,H=PL(Z,"max"),_=$?H-E(1):H;if(_<W)throw Error("fc.double constraints.min must be smaller or equal to constraints.max");if(Y)return e4({min:W,max:_}).map(oZ,ym);let V=_>E(0),q=V?W:W-E(1),D=V?_+E(1):_;return e4({min:q,max:D}).map((U)=>{if(_<U||U<W)return km;else return oZ(U)},(U)=>{if(typeof U!=="number")throw Error("Unsupported type");if(tP(U))return _!==D?D:q;return wK(U)})}function I2(Q={}){if(!Q.noInteger)return RL(Q);return RL(Im(Q)).map(jm,Em).filter(bm)}var{NEGATIVE_INFINITY:gm,POSITIVE_INFINITY:iZ}=Number,hm=Math.imul,aZ=340282346638528860000000000000000000000,eP=2139095040,mm=-2139095041,sZ=new Float32Array(1),dm=new Uint32Array(sZ.buffer,sZ.byteOffset);function pm(Q){return sZ[0]=Q,dm[0]}function cm(Q){let X=pm(Q),Y=X>>>31,J=X>>>23&255,$=X&8388607,G=J===0?-126:J-127,Z=J===0?0:1;return Z+=$/8388608,Z*=Y===0?1:-1,{exponent:G,significand:Z}}function NL(Q,X){if(Q===-126)return X*8388608;return hm(Q+127,8388608)+(X-1)*8388608}function CK(Q){if(Q===iZ)return eP;if(Q===gm)return mm;let X=cm(Q),Y=X.exponent,J=X.significand;if(Q>0||Q===0&&1/Q===iZ)return NL(Y,J);else return-NL(Y,-J)-1}function tZ(Q){if(Q<0)return-tZ(-Q-1);if(Q===eP)return iZ;if(Q<16777216)return Q*0.000000000000000000000000000000000000000000001401298464324817;let X=Q-16777216,Y=-125+(X>>23);return(1+(X&8388607)/8388608)*2**Y}var{NEGATIVE_INFINITY:QR,POSITIVE_INFINITY:XR}=Number,fm=aZ,um=8388607.5,eZ=8388608;function lm(Q){return iP(Q,fm,um,eZ)}function rm(Q){return Q===8388608?XR:Q===-8388608?QR:Q}function om(Q){if(typeof Q!=="number")throw Error("Unsupported type");return Q===XR?eZ:Q===QR?-eZ:Q}var{isInteger:nm,isNaN:YR}=Number,im=Math.fround,am=Number.NEGATIVE_INFINITY,sm=Number.POSITIVE_INFINITY,tm=NaN;function ML(Q,X){let Y="fc.float constraints."+X+" must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";if(YR(Q)||im(Q)!==Q)throw Error(Y);return CK(Q)}function em(Q){if(typeof Q!=="number")throw Error("Unsupported type");return CK(Q)}function Qd(Q){return!nm(Q)}function AL(Q){let{noDefaultInfinity:X=!1,noNaN:Y=!1,minExcluded:J=!1,maxExcluded:$=!1,min:G=X?-aZ:am,max:Z=X?aZ:sm}=Q,K=ML(G,"min"),W=J?K+1:K,H=ML(Z,"max"),_=$?H-1:H;if(W>_)throw Error("fc.float constraints.min must be smaller or equal to constraints.max");if(Y)return O0({min:W,max:_}).map(tZ,em);let V=_>0?W:W-1,q=_>0?_+1:_;return O0({min:V,max:q}).map((D)=>{if(D>_||D<W)return tm;else return tZ(D)},(D)=>{if(typeof D!=="number")throw Error("Unsupported type");if(YR(D))return _!==q?q:V;return CK(D)})}function JR(Q={}){if(!Q.noInteger)return AL(Q);return AL(lm(Q)).map(rm,om).filter(Qd)}function Xd(Q){return Q.replace(/([$`\\])/g,"\\$1").replace(/\r/g,"\\r")}function $R(Q){return Q.replace(/\*\//g,"*\\/")}var d1=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function w2(Q){let X=4294967295;for(let Y=0;Y<Q.length;++Y){let J=W9(Q,Y);if(J<128)X=d1[X&255^J]^X>>8;else if(J<2048)X=d1[X&255^(192|J>>6&31)]^X>>8,X=d1[X&255^(128|J&63)]^X>>8;else if(J>=55296&&J<57344){let $=W9(Q,++Y);if(J>=56320||$<56320||$>57343||Number.isNaN($))Y-=1,X=d1[X&255^239]^X>>8,X=d1[X&255^191]^X>>8,X=d1[X&255^189]^X>>8;else{let G=(J&1023)+64,Z=$&1023;X=d1[X&255^(240|G>>8&7)]^X>>8,X=d1[X&255^(128|G>>2&63)]^X>>8,X=d1[X&255^(128|Z>>6&15|(G&3)<<4)]^X>>8,X=d1[X&255^(128|Z&63)]^X>>8}}else X=d1[X&255^(224|J>>12&15)]^X>>8,X=d1[X&255^(128|J>>6&63)]^X>>8,X=d1[X&255^(128|J&63)]^X>>8}return(X|0)+2147483648}var Yd=Object.getPrototypeOf,GX=class extends C0{constructor(Q){super();this.arb=Q}generate(Q,X){return this.arb.generate(Q,X)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){return s.nil()}};function C2(Q){if(Yd(Q)===GX.prototype&&Q.generate===GX.prototype.generate&&Q.canShrinkWithoutContext===GX.prototype.canShrinkWithoutContext&&Q.shrink===GX.prototype.shrink)return Q;return new GX(Q)}var{assign:Jd,keys:$d}=Object;function GR(Q){return Q0(C2(O0()),C2(O0({min:1,max:4294967295}))).map(([X,Y])=>{let J=()=>{let $={};return Jd((Z,K)=>{let W=b0(Z),H=b0(K),_=Q(w2(`${X}${W}`)%Y,w2(`${X}${H}`)%Y);return $[`[${W},${H}]`]=_,_},{toString:()=>{let Z=$d($).sort().map((K)=>`${K} => ${b0($[K])}`).map((K)=>`/* ${$R(K)} */`);return`function(a, b) {
48
48
  // With hash and stringify coming from fast-check${Z.length!==0?`
49
49
  ${w0(Z,`
50
50
  `)}`:""}
51
- const cmp = ${X};
52
- const hA = hash('${Q}' + stringify(a)) % ${Y};
53
- const hB = hash('${Q}' + stringify(b)) % ${Y};
51
+ const cmp = ${Q};
52
+ const hA = hash('${X}' + stringify(a)) % ${Y};
53
+ const hB = hash('${X}' + stringify(b)) % ${Y};
54
54
  return cmp(hA, hB);
55
- }`},[r0]:J})};return J()})}var dm=Object.assign;function cm(){return BR(dm((X,Q)=>X<Q,{toString(){return"(hA, hB) => hA < hB"}}))}var fm=Object.assign;function um(){return BR(fm((X,Q)=>X-Q,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:lm,keys:rm}=Object;function om(X){return e(P0(X,{minLength:1}),k2(z0())).map(([Q,Y])=>{let J=()=>{let $={},G=(...K)=>{let W=g0(K),H=Q[x2(`${Y}${W}`)%Q.length];return $[W]=H,t6(H)?H[r0]():H};function Z(K){let W=G0(G0(PP(rm($)),(H)=>`${H} => ${g0($[H])}`),(H)=>`/* ${DR(H)} */`);return`function(...args) {
55
+ }`},[r0]:J})};return J()})}var Gd=Object.assign;function Zd(){return GR(Gd((Q,X)=>Q<X,{toString(){return"(hA, hB) => hA < hB"}}))}var Kd=Object.assign;function Wd(){return GR(Kd((Q,X)=>Q-X,{toString(){return"(hA, hB) => hA - hB"}}))}var{defineProperties:Hd,keys:Vd}=Object;function _d(Q){return Q0(P0(Q,{minLength:1}),C2(O0())).map(([X,Y])=>{let J=()=>{let $={},G=(...K)=>{let W=b0(K),H=X[w2(`${Y}${W}`)%X.length];return $[W]=H,s6(H)?H[r0]():H};function Z(K){let W=G0(G0(_P(Vd($)),(H)=>`${H} => ${b0($[H])}`),(H)=>`/* ${$R(H)} */`);return`function(...args) {
56
56
  // With hash and stringify coming from fast-check${W.length!==0?`
57
57
  ${W.join(`
58
58
  `)}`:""}
59
59
  const outs = ${K};
60
60
  return outs[hash('${Y}' + stringify(args)) % outs.length];
61
- }`}return lm(G,{toString:{value:()=>Z(g0(Q))},[M8]:{value:()=>Z(g0(Q))},[B4]:{value:async()=>Z(await wK(Q))},[r0]:{value:J,configurable:!0}})};return J()})}var{MIN_SAFE_INTEGER:nm,MAX_SAFE_INTEGER:im}=Number;function UR(){return new _9(nm,im)}var am=Number.MAX_SAFE_INTEGER;function sm(){return new _9(0,am)}var tm=Number.parseInt;function em(X){let[Q,Y]=X;switch(Q){case"oct":return`0${qQ(Y,8)}`;case"hex":return`0x${qQ(Y,16)}`;default:return`${Y}`}}function M2(X,Q){let Y=tm(X,Q);if(qQ(Y,Q)!==X)throw Error("Invalid value");return Y}function Xp(X){if(typeof X!=="string")throw Error("Invalid type");if(X.length>=2&&X[0]==="0"){if(X[1]==="x")return["hex",M2(S0(X,2),16)];return["oct",M2(S0(X,1),8)]}return["dec",M2(X,10)]}function Qp(X){return w0(X,".")}function Yp(X){if(typeof X!=="string")throw Error("Invalid type");return G0(L1(X,"."),(Q)=>M2(Q,10))}function pK(){return e(i4(255),i4(255),i4(255),i4(255)).map(Qp,Yp)}function h8(X){return e(m8("dec","oct","hex"),i4(X)).map(em,Xp)}function yZ(X){return w0(X,".")}function bZ(X){if(typeof X!=="string")throw Error("Invalid type");return L1(X,".")}function OR(){return l0(e(h8(255),h8(255),h8(255),h8(255)).map(yZ,bZ),e(h8(255),h8(255),h8(65535)).map(yZ,bZ),e(h8(255),h8(16777215)).map(yZ,bZ),h8(4294967295))}function dK(X){if(X.length===0)return[];else return L1(X,":")}function cK(X){let Q=L1(X,":");if(Q.length>=2&&Q[Q.length-1].length<=4)return[e0(Q,0,Q.length-2),`${Q[Q.length-2]}:${Q[Q.length-1]}`];return[e0(Q,0,Q.length-1),Q[Q.length-1]]}function Jp(X){return`${w0(X[0],":")}:${X[1]}`}function $p(X){if(typeof X!=="string")throw Error("Invalid type");return cK(X)}function Gp(X){return`::${w0(X[0],":")}:${X[1]}`}function Zp(X){if(typeof X!=="string")throw Error("Invalid type");if(!fy(X,"::"))throw Error("Invalid value");return cK(S0(X,2))}function A2(X){return`${w0(X[0],":")}::${w0(X[1],":")}:${X[2]}`}function w2(X){if(typeof X!=="string")throw Error("Invalid type");let[Q,Y]=L1(X,"::",2),[J,$]=cK(Y);return[dK(Q),J,$]}function Kp(X){return A2([X[0],[X[1]],X[2]])}function Wp(X){let Q=w2(X);return[Q[0],w0(Q[1],":"),Q[2]]}function kL(X){return`${w0(X[0],":")}::${X[1]}`}function yL(X){if(typeof X!=="string")throw Error("Invalid type");let[Q,Y]=L1(X,"::",2);return[dK(Q),Y]}function Hp(X){return`${w0(X[0],":")}::`}function Vp(X){if(typeof X!=="string")throw Error("Invalid type");if(!uy(X,"::"))throw Error("Invalid value");return[dK(S0(X,0,X.length-2))]}function _p([X,Q]){return`${X}:${Q}`}function qp(X){if(typeof X!=="string")throw new E("Invalid type");if(!X.includes(":"))throw new E("Invalid value");return X.split(":",2)}var Dp="0123456789abcdef",gZ=void 0;function Bp(){if(gZ===void 0)gZ=z0({min:0,max:15}).map((X)=>Dp[X],(X)=>{if(typeof X!=="string")throw new E("Not a string");if(X.length!==1)throw new E("Invalid length");let Q=H9(X,0);if(Q<=57)return Q-48;if(Q<97)throw new E("Invalid character");return Q-87});return gZ}function zR(){let X=p0({unit:Bp(),minLength:1,maxLength:4,size:"max"}),Q=l0(e(X,X).map(_p,qp),pK());return l0(e(P0(X,{minLength:6,maxLength:6,size:"max"}),Q).map(Jp,$p),e(P0(X,{minLength:5,maxLength:5,size:"max"}),Q).map(Gp,Zp),e(P0(X,{minLength:0,maxLength:1,size:"max"}),P0(X,{minLength:4,maxLength:4,size:"max"}),Q).map(A2,w2),e(P0(X,{minLength:0,maxLength:2,size:"max"}),P0(X,{minLength:3,maxLength:3,size:"max"}),Q).map(A2,w2),e(P0(X,{minLength:0,maxLength:3,size:"max"}),P0(X,{minLength:2,maxLength:2,size:"max"}),Q).map(A2,w2),e(P0(X,{minLength:0,maxLength:4,size:"max"}),X,Q).map(Kp,Wp),e(P0(X,{minLength:0,maxLength:5,size:"max"}),Q).map(kL,yL),e(P0(X,{minLength:0,maxLength:6,size:"max"}),X).map(kL,yL),e(P0(X,{minLength:0,maxLength:7,size:"max"})).map(Hp,Vp))}var Up=class extends I0{constructor(X){super();this.name=X,this.underlying=null}generate(X,Q){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(X,Q)}canShrinkWithoutContext(X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(X)}shrink(X,Q){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(X,Q)}},Op=Object.getOwnPropertyNames;function zp(){let X=new D4;return(Y)=>{let J=d1(X,Y);if(J!==void 0)return J;return J=new Up(String(Y)),R8(X,Y,J),J}}function FR(X){let Q=zp(),Y=X(Q),J=Op(Y);for(let $ of J){let G=Q($);G.underlying=Y[$]}return Y}function Fp(X,Q){for(let Y of X){let J=Q[Y]||{};if(J.maxLength===void 0||J.maxLength>0)return!0}return!1}function Lp(X,Q){if(X.length===0)return b0([]);if(!Fp(X,Q))throw new E("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return e(...X.map((Y)=>P0(b0(Y),Q[Y]))).map((Y)=>Fy(Y)).filter((Y)=>Y.length>0)}var{assign:bL,create:C2,defineProperty:LR,getPrototypeOf:gL,prototype:Pp}=Object;function Rp(X){return LR(C2(null),M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>X})}function hL(X,Q){return Rp(`<${F1(X)}#${Q}>`)}function Np(X,Q){let Y=C2(Pp);for(let J in X){let $=X[J],G=[];for(let Z of $){let K=bL(C2(gL(Z)),Z);G.push(K)}Y[J]=G}for(let J in Q){let $=Q[J];for(let G=0;G!==$.length;++G){let Z=$[G],K=Y[J][G];for(let W in Z){let H=Z[W];K[W]=H.index===void 0?void 0:typeof H.index==="number"?Y[H.type][H.index]:G0(H.index,(_)=>Y[H.type][_])}LR(K,M8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let W=X[J][G],H=bL(C2(gL(W)),W);for(let _ in Z){let V=Z[_];H[_]=V.index===void 0?void 0:typeof V.index==="number"?hL(V.type,V.index):G0(V.index,(q)=>hL(V.type,q))}return g0(H)}})}}return Y}function Mp(X){let Q=0,Y=new D4;for(let $ in X){let G=X[$];for(let Z in G){let K=G[Z];if(K.arity!=="inverse")continue;let W=d1(Y,K.type);if(W===void 0)W=new D4,R8(Y,K.type,W);if(vy(W,K.forwardRelationship))throw new E(`Cannot declare multiple inverse relationships for the same forward relationship ${F1(K.forwardRelationship)} on type ${F1(K.type)}`);R8(W,K.forwardRelationship,{type:$,property:Z}),Q+=1}}let J=new D4;if(Q===0)return J;for(let $ in X){let G=X[$],Z=d1(Y,$);if(Z===void 0)continue;for(let K in G){let W=G[K];if(W.arity==="inverse")continue;let H=d1(Z,K);if(H===void 0)continue;if(H.type!==W.type)throw new E(`Inverse relationship ${F1(H.property)} on type ${F1(H.type)} references forward relationship ${F1(K)} but types do not match`);R8(J,W,H)}}if(J.size!==Q)throw new E("Some inverse relationships could not be matched with their corresponding forward relationships");return J}var mL=Object.create;function Ap(X,Q,Y){switch(X){case"exclusive":return b0(Y);case"successor":return v2(z0({min:Q!==void 0?Q+1:0,max:Y}));case"any":return v2(z0({min:0,max:Y}))}}function wp(X,Q,Y,J,$,G,Z){let K=Ap(Q,Y,J);switch(X){case"0-1":return U4(K,{nil:void 0,depthIdentifier:$}).generate(G,Z).value;case"1":return K.generate(G,Z).value;case"many":{let W=0,H=U4(X5(K,{depthIdentifier:$,selector:(V)=>V===J?V+ ++W:V,minLength:1}),{nil:[],depthIdentifier:$}).generate(G,Z).value,_=0;return G0(H,(V)=>V===J?V+_++:V)}}}var Cp=class extends I0{constructor(X,Q){super();this.relations=X,this.defaultEntities=Q;let Y=new W9,J=new W9;for(let $ in X){let G=X[$];for(let Z in G){let K=G[Z];if(K.arity==="inverse")continue;if(K.strategy==="exclusive"){if(S2(Y,K.type))throw new E(`Cannot mix exclusive with other strategies for type ${F1(K.type)}`);_Q(J,K.type)}else{if(S2(J,K.type))throw new E(`Cannot mix exclusive with other strategies for type ${F1(K.type)}`);_Q(Y,K.type)}if(K.strategy==="successor"&&K.type!==$)throw new E("Cannot mix types for the strategy successor");if(K.strategy==="successor"&&K.arity==="1")throw new E("Cannot use an arity of 1 for the strategy successor")}}this.inversedRelations=Mp(X)}createEmptyLinksInstanceFor(X){let Q=mL(null),Y=this.relations[X];for(let J in Y){let $=Y[J];if($.arity==="inverse")Q[J]={type:$.type,index:[]}}return Q}generate(X,Q){let Y=mL(null);for(let G in this.relations)Y[G]=[];let J=[];for(let G of this.defaultEntities)S(J,{type:G,indexInType:Y[G].length,depth:0}),S(Y[G],this.createEmptyLinksInstanceFor(G));let $=-1;while(++$<J.length){let G=J[$],Z=this.relations[G.type],K=Y[G.type][G.indexInType],W=jK();W.depth=G.depth;for(let H in Z){let _=Z[H];if(_.arity==="inverse")continue;let V=_.type,q=Y[V],D=q.length,U=wp(_.arity,_.strategy||"any",V===G.type?G.indexInType:void 0,q.length,W,X,Q);K[H]={type:V,index:U};let R=U===void 0?[]:typeof U==="number"?[U]:U;for(let L of R){if(L>=D)S(J,{type:V,indexInType:L,depth:G.depth+1}),S(q,this.createEmptyLinksInstanceFor(V));let N=d1(this.inversedRelations,_);if(N!==void 0){let P=q[L][N.property].index;S(P,G.indexInType)}}}}return J.length=0,new k(Y,void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function Tp(X,Q){return new Cp(X,Q)}var{keys:Ip,getOwnPropertySymbols:jp,getOwnPropertyDescriptor:Ep}=Object;function Sp(X){let Q=Ip(X),Y=jp(X);for(let J=0;J!==Y.length;++J){let $=Y[J],G=Ep(X,$);if(G&&G.enumerable)Q.push($)}return Q}var{create:vp,defineProperty:xp,getOwnPropertyDescriptor:kp,getOwnPropertyNames:yp,getOwnPropertySymbols:bp}=Object;function gp(X,Q){return function(J){let $=J[1]?vp(null):{};for(let G=0;G!==X.length;++G){let Z=J[0][G];if(Z!==Q)xp($,X[G],{value:Z,configurable:!0,enumerable:!0,writable:!0})}return $}}function hp(X,Q){return function(J){if(typeof J!=="object"||J===null)throw Error("Incompatible instance received: should be a non-null object");let $=Object.getPrototypeOf(J)===null,G="constructor"in J&&J.constructor===Object;if(!$&&!G)throw Error("Incompatible instance received: should be of exact type Object");let Z=0,K=[];for(let _=0;_!==X.length;++_){let V=kp(J,X[_]);if(V!==void 0){if(!V.configurable||!V.enumerable||!V.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(V.get!==void 0||V.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++Z,S(K,V.value)}else S(K,Q)}let W=yp(J).length,H=bp(J).length;if(Z!==W+H)throw Error("Incompatible instance received: should not contain extra properties");return[K,$]}}var hZ=Symbol("no-key");function mZ(X,Q,Y){let J=Sp(X),$=[];for(let G=0;G!==J.length;++G){let Z=J[G],K=X[Z];if(Q===void 0||_4(Q,Z)!==-1)S($,K);else S($,U4(K,{nil:hZ}))}return e(e(...$),Y?b0(!1):zQ()).map(gp(J,hZ),hp(J,hZ))}function DK(X,Q){let Y=Q!==void 0&&!!Q.noNullPrototype;if(Q===void 0)return mZ(X,void 0,Y);if(!(("requiredKeys"in Q)&&Q.requiredKeys!==void 0))return mZ(X,void 0,Y);let J=("requiredKeys"in Q?Q.requiredKeys:void 0)||[];for(let $=0;$!==J.length;++$){let G=Object.getOwnPropertyDescriptor(X,J[$]);if(G===void 0)throw Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!G.enumerable)throw Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return mZ(X,J,Y)}var mp=Object.create;function pp(X,Q,Y,J){let $=mp(null);for(let G in X){let Z=X[G],K=DK(Z,J),W=Q(G),H=Y(G),_={minLength:W,maxLength:W};$[G]=H!==void 0?X5(K,{..._,selector:H}):P0(K,_)}return DK($)}var{create:pL,keys:dp}=Object;function cp(X,Q,Y={}){let J=dp(X),$=Y.initialPoolConstraints||pL(null),G=Y.unicityConstraints||pL(null),Z={noNullPrototype:Y.noNullPrototype};return Lp(J,$).chain((K)=>Tp(Q,K).chain((W)=>pp(X,(H)=>W[H].length,(H)=>G[H],Z).map((H)=>Np(H,W))))}function fp(X){return w0(G0(X,(Q)=>Q[Q.length-1]===","?S0(Q,0,Q.length-1):Q)," ")}function up(X){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");let J=[];for(let $ of L1(Y," "))if(X.canShrinkWithoutContext($))S(J,$);else if(X.canShrinkWithoutContext($+","))S(J,$+",");else throw Error("Unsupported word");return J}}function lp(X){let Q=w0(X," ");if(Q[Q.length-1]===",")Q=S0(Q,0,Q.length-1);return PK(Q[0])+S0(Q,1)+"."}function rp(X){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||PK(aZ(Y[0]))!==Y[0])throw Error("Unsupported value");let J=aZ(Y[0])+S0(Y,1,Y.length-1),$=[],G=L1(J," ");for(let Z=0;Z!==G.length;++Z){let K=G[Z];if(X.canShrinkWithoutContext(K))S($,K);else if(Z===G.length-1&&X.canShrinkWithoutContext(K+","))S($,K+",");else throw Error("Unsupported word")}return $}}function op(X){return w0(X," ")}function np(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=L1(X,". ");for(let Y=0;Y<Q.length-1;++Y)Q[Y]+=".";return Q}var z=(X,Q)=>{return{arbitrary:b0(X),weight:Q}};function ip(){return l0(z("non",6),z("adipiscing",5),z("ligula",5),z("enim",5),z("pellentesque",5),z("in",5),z("augue",5),z("et",5),z("nulla",5),z("lorem",4),z("sit",4),z("sed",4),z("diam",4),z("fermentum",4),z("ut",4),z("eu",4),z("aliquam",4),z("mauris",4),z("vitae",4),z("felis",4),z("ipsum",3),z("dolor",3),z("amet,",3),z("elit",3),z("euismod",3),z("mi",3),z("orci",3),z("erat",3),z("praesent",3),z("egestas",3),z("leo",3),z("vel",3),z("sapien",3),z("integer",3),z("curabitur",3),z("convallis",3),z("purus",3),z("risus",2),z("suspendisse",2),z("lectus",2),z("nec,",2),z("ultricies",2),z("sed,",2),z("cras",2),z("elementum",2),z("ultrices",2),z("maecenas",2),z("massa,",2),z("varius",2),z("a,",2),z("semper",2),z("proin",2),z("nec",2),z("nisl",2),z("amet",2),z("duis",2),z("congue",2),z("libero",2),z("vestibulum",2),z("pede",2),z("blandit",2),z("sodales",2),z("ante",2),z("nibh",2),z("ac",2),z("aenean",2),z("massa",2),z("suscipit",2),z("sollicitudin",2),z("fusce",2),z("tempus",2),z("aliquam,",2),z("nunc",2),z("ullamcorper",2),z("rhoncus",2),z("metus",2),z("faucibus,",2),z("justo",2),z("magna",2),z("at",2),z("tincidunt",2),z("consectetur",1),z("tortor,",1),z("dignissim",1),z("congue,",1),z("non,",1),z("porttitor,",1),z("nonummy",1),z("molestie,",1),z("est",1),z("eleifend",1),z("mi,",1),z("arcu",1),z("scelerisque",1),z("vitae,",1),z("consequat",1),z("in,",1),z("pretium",1),z("volutpat",1),z("pharetra",1),z("tempor",1),z("bibendum",1),z("odio",1),z("dui",1),z("primis",1),z("faucibus",1),z("luctus",1),z("posuere",1),z("cubilia",1),z("curae,",1),z("hendrerit",1),z("velit",1),z("mauris,",1),z("gravida",1),z("ornare",1),z("ut,",1),z("pulvinar",1),z("varius,",1),z("turpis",1),z("nibh,",1),z("eros",1),z("id",1),z("aliquet",1),z("quis",1),z("lobortis",1),z("consectetuer",1),z("morbi",1),z("vehicula",1),z("tortor",1),z("tellus,",1),z("id,",1),z("eu,",1),z("quam",1),z("feugiat,",1),z("posuere,",1),z("iaculis",1),z("lectus,",1),z("tristique",1),z("mollis,",1),z("nisl,",1),z("vulputate",1),z("sem",1),z("vivamus",1),z("placerat",1),z("imperdiet",1),z("cursus",1),z("rutrum",1),z("iaculis,",1),z("augue,",1),z("lacus",1))}function ap(X={}){let{maxCount:Q,mode:Y="words",size:J}=X;if(Q!==void 0&&Q<1)throw Error("lorem has to produce at least one word/sentence");let $=ip();if(Y==="sentences")return P0(P0($,{minLength:1,size:"small"}).map(lp,rp($)),{minLength:1,maxLength:Q,size:J}).map(op,np);else return P0($,{minLength:1,maxLength:Q,size:J}).map(fp,up($))}function sp(X){return new Map(X)}function tp(X){if(typeof X!=="object"||X===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in X)||X.constructor!==Map)throw Error("Incompatible instance received: should be of exact type Map");return Array.from(X)}function ep(X){return X[0]}function BK(X,Q,Y={}){return X5(e(X,Q),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:ep,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(sp,tp)}var F2=10;function Xd(X){let Q={};return(Y)=>{let J=Y!==void 0?Y:F2;if(!NP(Q,J)){let $=F2;F2=J-1,Q[J]=X(J),F2=$}return Q[J]}}function Qd(X){let Q=0;while(X>j(0)){if(X&j(1))++Q;X>>=j(1)}return Q}function Yd(X,Q){let Y=(j(1)<<j(Q))-j(1),J=X&Y,$=Qd(X-J),G=J;for(let Z=j(1);Z<=Y&&$!==0;Z<<=j(1))if(!(G&Z))G|=Z,--$;return G}function L2(X,Q){let Y=[];for(let J=X.length-1;J!==-1;--J)if(Q(X[J])!==X[J])S(Y,J);return Y}function Jd(X,Q,Y){let J=j(0);for(let $=0,G=j(1);$!==Y.length;++$,G<<=j(1))if(X[Y[$]]!==Q[Y[$]])J|=G;return J}function pZ(X,Q,Y,J){for(let $=0,G=j(1);$!==Y.length;++$,G<<=j(1))if(Q&G)X[Y[$]]=J(X[Y[$]])}var $d=class extends I0{constructor(X,Q,Y){super();this.stringArb=X,this.toggleCase=Q,this.untoggleAll=Y}buildContextFor(X,Q){return{rawString:X.value,rawStringContext:X.context,flags:Q.value,flagsContext:Q.context}}generate(X,Q){let Y=this.stringArb.generate(X,Q),J=[...Y.value],$=L2(J,this.toggleCase),G=t4(j(0),(j(1)<<j($.length))-j(1)).generate(X,void 0);return pZ(J,G.value,$,this.toggleCase),new k(w0(J,""),this.buildContextFor(Y,G))}canShrinkWithoutContext(X){if(typeof X!=="string")return!1;return this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(X)):this.stringArb.canShrinkWithoutContext(X)}shrink(X,Q){let Y;if(Q!==void 0)Y=Q;else if(this.untoggleAll!==void 0){let G=this.untoggleAll(X),Z=[...X],K=[...G];Y={rawString:G,rawStringContext:void 0,flags:Jd(K,Z,L2(K,this.toggleCase)),flagsContext:void 0}}else Y={rawString:X,rawStringContext:void 0,flags:j(0),flagsContext:void 0};let{rawString:J,flags:$}=Y;return this.stringArb.shrink(J,Y.rawStringContext).map((G)=>{let Z=[...G.value],K=L2(Z,this.toggleCase),W=Yd($,K.length);return pZ(Z,W,K,this.toggleCase),new k(w0(Z,""),this.buildContextFor(G,new k(W,void 0)))}).join(a4(()=>{let G=[...J],Z=L2(G,this.toggleCase);return t4(j(0),(j(1)<<j(Z.length))-j(1)).shrink($,Y.flagsContext).map((K)=>{let W=e0(G);return pZ(W,K.value,Z,this.toggleCase),new k(w0(W,""),this.buildContextFor(new k(J,Y.rawStringContext),K))})}))}};function Gd(X){let Q=PK(X);if(Q!==X)return Q;return aZ(X)}function Zd(X,Q){return new $d(X,Q&&Q.toggleCase||Gd,Q&&Q.untoggleAll)}function Kd(X){return UP.from(X)}function Wd(X){if(!(X instanceof UP))throw Error("Unexpected type");return[...X]}function PR(X={}){return P0(qR(X),X).map(Kd,Wd)}function Hd(X){return OP.from(X)}function Vd(X){if(!(X instanceof OP))throw Error("Unexpected type");return[...X]}function RR(X={}){return P0(b2(X),X).map(Hd,Vd)}function O4(X,Q,Y,J,$){let G=J.name,{min:Z=Q,max:K=Y,...W}=X;if(Z>K)throw Error(`Invalid range passed to ${G}: min must be lower than or equal to max`);if(Z<Q)throw Error(`Invalid min value passed to ${G}: min must be greater than or equal to ${Q}`);if(K>Y)throw Error(`Invalid max value passed to ${G}: max must be lower than or equal to ${Y}`);return P0($({min:Z,max:K}),W).map((H)=>J.from(H),(H)=>{if(!(H instanceof J))throw Error("Invalid type");return[...H]})}function NR(X={}){return O4(X,-32768,32767,ek,z0)}function MR(X={}){return O4(X,-2147483648,2147483647,Xy,z0)}function AR(X={}){return O4(X,-128,127,tk,z0)}function wR(X={}){return O4(X,0,65535,Jy,z0)}function CR(X={}){return O4(X,0,4294967295,$y,z0)}function TR(X={}){return O4(X,0,255,Qy,z0)}function IR(X={}){return O4(X,0,255,Yy,z0)}function _d(X){return X!==void 0}function dL(X){if(X.hasToBeCloned)return new k(X.value_,{generatorContext:X.context},()=>X.value);return new k(X.value_,{generatorContext:X.context})}function cL(X){if(X.hasToBeCloned)return new k(X.value_,{shrinkerContext:X.context},()=>X.value);return new k(X.value_,{shrinkerContext:X.context})}var qd=class extends I0{constructor(X,Q){super();this.generatorArbitrary=X,this.shrinkerArbitrary=Q}generate(X,Q){return dL(this.generatorArbitrary.generate(X,Q))}canShrinkWithoutContext(X){return this.shrinkerArbitrary.canShrinkWithoutContext(X)}shrink(X,Q){if(!_d(Q))return this.shrinkerArbitrary.shrink(X,void 0).map(cL);if("generatorContext"in Q)return this.generatorArbitrary.shrink(X,Q.generatorContext).map(dL);return this.shrinkerArbitrary.shrink(X,Q.shrinkerContext).map(cL)}};function UK(X,Q,Y){let J=z0({min:X,max:Q});if(Q===Y)return J;return new qd(J,z0({min:X,max:Y}))}var{min:Dd,max:OK}=Math,fL=DP.isArray,Bd=Object.entries;function Ud(X){let Q=-1;for(let Y=0;Y!==X.length;++Y)Q=OK(Q,X[Y][0]);return Q}function Od(X,Q){let Y=DP(X);for(let J=0;J!==Q.length;++J){let $=Q[J];if($[0]<X)Y[$[0]]=$[1]}return Y}function jR(X,Q={}){let{size:Y,minNumElements:J=0,maxLength:$=e6,maxNumElements:G=$,noTrailingHole:Z,depthIdentifier:K}=Q,W=BQ(Y,BQ(Y,J,G,Q.maxNumElements!==void 0),$,Q.maxLength!==void 0);if(J>$)throw Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(J>G)throw Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let H=Dd(G,$),_=Q.maxNumElements!==void 0||Y!==void 0?Y:"=",V=X5(e(UK(0,OK(W-1,0),OK($-1,0)),X),{size:_,minLength:J,maxLength:H,selector:(q)=>q[0],depthIdentifier:K}).map((q)=>{return Od(Ud(q)+1,q)},(q)=>{if(!fL(q))throw Error("Not supported entry type");if(Z&&q.length!==0&&!(q.length-1 in q))throw Error("No trailing hole");return G0(Bd(q),(D)=>[Number(D[0]),D[1]])});if(Z||$===J)return V;return e(V,UK(J,W,$)).map((q)=>{let D=q[0],U=q[1];if(D.length>=U)return D;let R=e0(D);return R.length=U,R},(q)=>{if(!fL(q))throw Error("Not supported entry type");return[q,q.length]})}function zd(X){return new Set(X)}function Fd(X){if(typeof X!=="object"||X===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in X)||X.constructor!==Set)throw Error("Incompatible instance received: should be of exact type Set");return Array.from(X)}function ER(X,Q={}){return X5(X,{minLength:Q.minLength,maxLength:Q.maxLength,size:Q.size,depthIdentifier:Q.depthIdentifier,comparator:"SameValueZero"}).map(zd,Fd)}function Ld(X,Q,Y,J,$,G){return vK(X,Q,{maxKeys:Y,noNullPrototype:!G,size:J,depthIdentifier:$})}function Pd(X){return l0(AR(X),TR(X),IR(X),NR(X),wR(X),MR(X),CR(X),PR(X),RR(X))}function SR(X){let{values:Q,depthSize:Y}=X,J=jK(),$=X.maxDepth,G=X.maxKeys,Z=X.size,K=l0(...Q,...X.withBigInt?[t4()]:[],...X.withDate?[nP()]:[]);return FR((W)=>({anything:l0({maxDepth:$,depthSize:Y,depthIdentifier:J},K,W("array"),W("object"),...X.withMap?[W("map")]:[],...X.withSet?[W("set")]:[],...X.withObjectString?[W("anything").map((H)=>g0(H))]:[],...X.withTypedArray?[Pd({maxLength:G,size:Z})]:[],...X.withSparseArray?[jR(W("anything"),{maxNumElements:G,size:Z,depthIdentifier:J})]:[]),keys:X.withObjectString?l0({arbitrary:X.key,weight:10},{arbitrary:W("anything").map((H)=>g0(H)),weight:1}):X.key,array:P0(W("anything"),{maxLength:G,size:Z,depthIdentifier:J}),set:ER(W("anything"),{maxLength:G,size:Z,depthIdentifier:J}),map:l0(BK(W("keys"),W("anything"),{maxKeys:G,size:Z,depthIdentifier:J}),BK(W("anything"),W("anything"),{maxKeys:G,size:Z,depthIdentifier:J})),object:Ld(W("keys"),W("anything"),G,Z,J,X.withNullPrototype)})).anything}function Rd(X){switch(typeof X){case"boolean":return new BP(X);case"number":return new q4(X);case"string":return new F1(X);default:return X}}function Nd(X){if(typeof X!=="object"||X===null||!("constructor"in X))return X;return X.constructor===BP||X.constructor===q4||X.constructor===F1?X.valueOf():X}function Md(X){return X.map(Rd,Nd)}function Ad(X,Q){return[zQ(),UR(),b2(),Q(X),l0(Q(X),b0(null),b0(void 0))]}function wd(X){return X.map((Q)=>Md(Q))}function Cd(X,Q){return Q?wd(X).concat(X):X}function vR(X={}){let Q={size:X.size,unit:"stringUnit"in X?X.stringUnit:X.withUnicodeString?"binary":void 0};return{key:X.key!==void 0?X.key:p0(Q),values:Cd(X.values!==void 0?X.values:Ad(Q,p0),X.withBoxedValues===!0),depthSize:X.depthSize,maxDepth:X.maxDepth,maxKeys:X.maxKeys,size:X.size,withSet:X.withSet===!0,withMap:X.withMap===!0,withObjectString:X.withObjectString===!0,withNullPrototype:X.withNullPrototype===!0,withBigInt:X.withBigInt===!0,withDate:X.withDate===!0,withTypedArray:X.withTypedArray===!0,withSparseArray:X.withSparseArray===!0}}function Td(X){return vK(X.key,SR(X),{maxKeys:X.maxKeys,noNullPrototype:!X.withNullPrototype,size:X.size})}function Id(X){return Td(vR(X))}function jd(X,Q){let{depthSize:Y,maxDepth:J}=Q;return{key:X,values:[zQ(),b2({noDefaultInfinity:!0,noNaN:!0}),X,b0(null)],depthSize:Y,maxDepth:J}}function xR(X){return SR(vR(X))}function kR(X={}){let Q=X.noUnicodeString===void 0||X.noUnicodeString===!0;return xR(jd("stringUnit"in X?p0({unit:X.stringUnit}):Q?p0():p0({unit:"binary"}),X))}var{stringify:Ed,parse:Sd}=JSON;function vd(X){if(typeof X!=="string")throw new E("Cannot unmap the passed value");return Sd(X)}function xd(X={}){return kR(X).map(Ed,vd)}var kd=Object.defineProperties;function dZ(X,Q){return`Stream(${Q!==void 0?`${w0(Q,",")}\u2026`:`${X} emitted`})`}var yd=class extends I0{constructor(X,Q){super();this.arb=X,this.history=Q}generate(X,Q){let Y=Q!==void 0&&X.nextInt(1,Q)===1?Q:void 0,J=()=>{let $=this.history?[]:null,G=0;return kd(new Q0(function*(K,W){while(!0){let H=K.generate(W,Y).value;if(G++,$!==null)S($,H);yield H}}(this.arb,X.clone())),{toString:{value:()=>dZ(G,$!==null?$.map(g0):void 0)},[M8]:{value:()=>dZ(G,$!==null?$.map(g0):void 0)},[B4]:{value:async()=>dZ(G,$!==null?await Promise.all($.map(wK)):void 0)},[r0]:{value:J,enumerable:!0}})};return new k(J(),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function bd(X,Q){return new yd(X,Q!==void 0&&typeof Q==="object"&&"noHistory"in Q?!Q.noHistory:!0)}function gd(X){return w0(X,"")}function uL(X){if(typeof X!=="string")throw Error("Cannot unmap the passed value");return[...X]}function hd(X){switch(X.length%4){case 0:return X;case 3:return`${X}=`;case 2:return`${X}==`;default:return S0(X,1)}}function md(X){if(typeof X!=="string"||X.length%4!==0)throw Error("Invalid string received");let Q=X.indexOf("=");if(Q===-1)return X;if(X.length-Q>2)throw Error("Cannot unmap the passed value");return S0(X,0,Q)}var cZ=String.fromCharCode;function pd(X){if(X<26)return cZ(X+65);if(X<52)return cZ(X+97-26);if(X<62)return cZ(X+48-52);return X===62?"+":"/"}function dd(X){if(typeof X!=="string"||X.length!==1)throw new E("Invalid entry");let Q=H9(X,0);if(Q>=65&&Q<=90)return Q-65;if(Q>=97&&Q<=122)return Q-97+26;if(Q>=48&&Q<=57)return Q-48+52;return Q===43?62:Q===47?63:-1}function cd(){return z0({min:0,max:63}).map(pd,dd)}function fd(X={}){let{minLength:Q=0,maxLength:Y=e6,size:J}=X,$=Q+3-(Q+3)%4,G=Y-Y%4,Z=X.maxLength===void 0&&J===void 0?"=":J;if($>G)throw new E("Minimal length should be inferior or equal to maximal length");if($%4!==0)throw new E("Minimal length of base64 strings must be a multiple of 4");if(G%4!==0)throw new E("Maximal length of base64 strings must be a multiple of 4");let K=cd();return P0(K,{minLength:$,maxLength:G,size:Z,experimentalCustomSlices:Ah(K,uL)}).map(gd,uL).map(hd,md)}var lL=Object.is;function ud(X,Q){let Y=new D4,J=0;for(let $ of X)if(lL($,-0))++J;else R8(Y,$,(d1(Y,$)||0)+1);for(let $=0;$!==Q.length;++$){if(!($ in Q))return!1;let G=Q[$];if(lL(G,-0)){if(J===0)return!1;--J}else{let Z=d1(Y,G)||0;if(Z===0)return!1;R8(Y,G,Z-1)}}return!0}var{floor:ld,log:rL}=Math,rd=Array.isArray,yR=class extends I0{constructor(X,Q,Y,J){super();if(this.originalArray=X,this.isOrdered=Q,this.minLength=Y,this.maxLength=J,Y<0||Y>X.length)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(J<0||J>X.length)throw Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(Y>J)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new _9(Y,J),this.biasedLengthArb=Y!==J?new _9(Y,Y+ld(rL(J-Y)/rL(2))):this.lengthArb}generate(X,Q){let Y=(Q!==void 0&&X.nextInt(1,Q)===1?this.biasedLengthArb:this.lengthArb).generate(X,void 0),J=Y.value,$=G0(this.originalArray,(Z,K)=>K),G=[];for(let Z=0;Z!==J;++Z){let K=X.nextInt(0,$.length-1);S(G,$[K]),LP($,K,1)}if(this.isOrdered)PP(G,(Z,K)=>Z-K);return new k(G0(G,(Z)=>this.originalArray[Z]),Y.context)}canShrinkWithoutContext(X){if(!rd(X))return!1;if(!this.lengthArb.canShrinkWithoutContext(X.length))return!1;return ud(this.originalArray,X)}shrink(X,Q){if(X.length===0)return Q0.nil();return this.lengthArb.shrink(X.length,Q).map((Y)=>{return new k(e0(X,X.length-Y.value),Y.context)}).join(X.length>this.minLength?a4(()=>this.shrink(e0(X,1),void 0).filter((Y)=>this.minLength<=Y.value.length+1).map((Y)=>new k([X[0],...Y.value],void 0))):Q0.nil())}};function od(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new yR(X,!0,Y,J)}function nd(X,Q={}){let{minLength:Y=0,maxLength:J=X.length}=Q;return new yR(X,!1,Y,J)}var id={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},ad={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function sd(X){return X<10?F1(X):id[X]}function oL(X,Q){let Y="";while(X.length+Y.length<Q)Y+="0";return Y+X}function nL(X){let Q="";for(let Y=X;Y!==0;){let J=Y>>5;Q=sd(Y-(J<<5))+Q,Y=J}return Q}function td(X,Q){let Y=~~(X/1073741824),J=X&1073741823;return oL(nL(Y),Q-6)+oL(nL(J),6)}function bR(X){return function(Y){return td(Y,X)}}function fZ(X){if(typeof X!=="string")throw new E("Unsupported type");let Q=0,Y=1;for(let J=X.length-1;J>=0;--J){let $=ad[X[J]];if($===void 0)throw new E("Unsupported type");Q+=$*Y,Y*=32}return Q}var ed=bR(10),iL=bR(8);function Xc(X){return ed(X[0])+iL(X[1])+iL(X[2])}function Qc(X){if(typeof X!=="string"||X.length!==26)throw Error("Unsupported type");return[fZ(X.slice(0,10)),fZ(X.slice(10,18)),fZ(X.slice(18))]}function Yc(){return e(z0({min:0,max:281474976710655}),z0({min:0,max:1099511627775}),z0({min:0,max:1099511627775})).map(Xc,Qc)}function gR(X){return ly(qQ(X,16),8,"0")}function Jc(X){if(typeof X!=="string")throw Error("Unsupported type");if(X.length!==8)throw Error("Unsupported value: invalid length");let Q=parseInt(X,16);if(X!==gR(Q))throw Error("Unsupported value: invalid content");return Q}function uZ(X,Q){return z0({min:X,max:Q}).map(gR,Jc)}function $c(X){return`${X[0]}-${S0(X[1],4)}-${S0(X[1],0,4)}-${S0(X[2],0,4)}-${S0(X[2],4)}${X[3]}`}var Gc=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function Zc(X){if(typeof X!=="string")throw Error("Unsupported type");let Q=Gc.exec(X);if(Q===null)throw Error("Unsupported type");return[Q[1],Q[3]+Q[2],Q[4]+S0(Q[5],0,4),S0(Q[5],4)]}var aL="0123456789abcdef";function Kc(X){let Q={},Y={};for(let G=0;G!==X.length;++G){let Z=aL[G],K=aL[X[G]];Q[Z]=K,Y[K]=Z}function J(G){return Q[G[0]]+S0(G,1)}function $(G){if(typeof G!=="string")throw new E("Cannot produce non-string values");let Z=Y[G[0]];if(Z===void 0)throw new E("Cannot produce strings not starting by the version in hexa code");return Z+S0(G,1)}return{versionsApplierMapper:J,versionsApplierUnmapper:$}}function Wc(X){let Q={};for(let Y of X){if(Q[Y])throw new E(`Version ${Y} has been requested at least twice for uuid`);if(Q[Y]=!0,Y<1||Y>15)throw new E(`Version must be a value in [1-15] for uuid, but received ${Y}`);if(~~Y!==Y)throw new E(`Version must be an integer value for uuid, but received ${Y}`)}if(X.length===0)throw new E("Must provide at least one version for uuid")}function Hc(X={}){let Q=uZ(0,4294967295),Y=X.version!==void 0?typeof X.version==="number"?[X.version]:X.version:[1,2,3,4,5,6,7,8];Wc(Y);let{versionsApplierMapper:J,versionsApplierUnmapper:$}=Kc(Y);return e(Q,uZ(0,268435456*Y.length-1).map(J,$),uZ(2147483648,3221225471),Q).map($c,Zc)}function Vc(X){return p0({unit:yK("-._~!$&'()*+,;=:"),size:X})}function _c([X,Q,Y]){return(X===null?"":`${X}@`)+Q+(Y===null?"":`:${Y}`)}function qc(X){if(typeof X!=="string")throw Error("Unsupported");let Q=X.indexOf("@"),Y=Q!==-1?X.substring(0,Q):null,J=/:(\d+)$/.exec(X),$=J!==null?Number(J[1]):null;return[Y,J!==null?X.substring(Q+1,X.length-J[1].length-1):X.substring(Q+1),$]}function Dc(X){return`[${X}]`}function Bc(X){if(typeof X!=="string"||X[0]!=="["||X[X.length-1]!=="]")throw Error("Unsupported");return X.substring(1,X.length-1)}function hR(X){let Q=X||{},Y=Q.size,J=[bK({size:Y}),...Q.withIPv4===!0?[pK()]:[],...Q.withIPv6===!0?[zR().map(Dc,Bc)]:[],...Q.withIPv4Extended===!0?[OR()]:[]];return e(Q.withUserInfo===!0?U4(Vc(Y)):b0(null),l0(...J),Q.withPort===!0?U4(i4(65535)):b0(null)).map(_c,qc)}function mR(X){return p0({unit:yK("-._~!$&'()*+,;=:@/?"),size:X})}function pR(X={}){return mR(X.size)}function dR(X={}){return p0({unit:yK("-._~!$&'()*+,;=:@"),size:X.size})}function Uc(X){return w0(G0(X,(Q)=>`/${Q}`),"")}function Oc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");if(X.length!==0&&X[0]!=="/")throw Error("Incompatible value received: start");return LP(L1(X,"/"),1)}function zc(X){switch(X){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function lZ(X,Q){return P0(dR({size:X}),{size:Q}).map(Uc,Oc)}function Fc(X){let[Q,Y]=zc(X);if(Q===Y)return lZ(Q,Y);return l0(lZ(Q,Y),lZ(Y,Q))}function cR(X){return Fc(SK((X||{}).size))}function fR(X={}){return mR(X.size)}function Lc(X){let[Q,Y,J]=X;return`${Q}://${Y}${J}${X[3]===null?"":`?${X[3]}`}${X[4]===null?"":`#${X[4]}`}`}var Pc=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function Rc(X){if(typeof X!=="string")throw Error("Incompatible value received: type");let Q=Pc.exec(X);if(Q===null)throw Error("Incompatible value received");let Y=Q[1],J=Q[2],$=Q[3],G=Q[4],Z=Q[5];return[Y,J,$,G!==void 0?G.substring(1):null,Z!==void 0?Z.substring(1):null]}function Nc(X){let Q=X||{},Y=SK(Q.size),J=Q.authoritySettings!==void 0&&Q.authoritySettings.size!==void 0?OQ(Q.authoritySettings.size,Y):Y,$={...Q.authoritySettings,size:J};return e(m8(...Q.validSchemes||["http","https"]),hR($),cR({size:Y}),Q.withQueryParameters===!0?U4(fR({size:Y})):b0(null),Q.withFragments===!0?U4(pR({size:Y})):b0(null)).map(Lc,Rc)}var Mc=class X{constructor(Q,Y){this.commands=Q,this.metadataForReplay=Y,this[r0]=function(){return new X(this.commands.map((J)=>J.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let Q=this.commands.filter((J)=>J.hasRan).map((J)=>J.toString()).join(","),Y=this.metadataForReplay();return Y.length!==0?`${Q} /*${Y}*/`:Q}},Ac=class X{constructor(Q){if(this.cmd=Q,this.hasRan=!1,MK(Q)){let Y=Q[M8];this[M8]=function(){return Y.call(Q)}}if(AK(Q)){let Y=Q[B4];this[B4]=function(){return Y.call(Q)}}}check(Q){return this.cmd.check(Q)}run(Q,Y){return this.hasRan=!0,this.cmd.run(Q,Y)}clone(){if(t6(this.cmd))return new X(this.cmd[r0]());return new X(this.cmd)}toString(){return this.cmd.toString()}},sL=class{static parse(X){let[Q,Y]=X.split(":"),J=this.parseCounts(Q),$=this.parseChanges(Y);return this.parseOccurences(J,$)}static stringify(X){let Q=this.countOccurences(X);return`${this.stringifyCounts(Q)}:${this.stringifyChanges(Q)}`}static intToB64(X){if(X<26)return String.fromCharCode(X+65);if(X<52)return String.fromCharCode(X+97-26);if(X<62)return String.fromCharCode(X+48-52);return String.fromCharCode(X===62?43:47)}static b64ToInt(X){if(X>="a")return X.charCodeAt(0)-97+26;if(X>="A")return X.charCodeAt(0)-65;if(X>="0")return X.charCodeAt(0)-48+52;return X==="+"?62:63}static countOccurences(X){return X.reduce((Q,Y)=>{if(Q.length===0||Q[Q.length-1].count===64||Q[Q.length-1].value!==Y)Q.push({value:Y,count:1});else Q[Q.length-1].count+=1;return Q},[])}static parseOccurences(X,Q){let Y=[];for(let J=0;J!==X.length;++J){let $=X[J],G=Q[J];for(let Z=0;Z!==$;++Z)Y.push(G)}return Y}static stringifyChanges(X){let Q="";for(let Y=0;Y<X.length;Y+=6){let J=X.slice(Y,Y+6).reduceRight(($,G)=>($<<1)+(G.value?1:0),0);Q+=this.intToB64(J)}return Q}static parseChanges(X){let Q=X.split("").map((J)=>this.b64ToInt(J)),Y=[];for(let J=0;J!==Q.length;++J){let $=Q[J];for(let G=0;G!==6;++G,$>>=1)Y.push($%2===1)}return Y}static stringifyCounts(X){return X.map(({count:Q})=>this.intToB64(Q-1)).join("")}static parseCounts(X){return X.split("").map((Q)=>this.b64ToInt(Q)+1)}},wc=class extends I0{constructor(X,Q,Y,J,$){super();this.sourceReplayPath=J,this.disableReplayLog=$,this.oneCommandArb=l0(...X).map((G)=>new Ac(G)),this.lengthArb=UK(0,Q,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(sL.stringify(this.replayPath))}`}buildValueFor(X,Q){let Y=X.map(($)=>$.value_),J={shrunkOnce:Q,items:X};return new k(new Mc(Y,()=>this.metadataForReplay()),J)}generate(X){let Q=this.lengthArb.generate(X,void 0).value,Y=Array(Q);for(let J=0;J!==Q;++J)Y[J]=this.oneCommandArb.generate(X,void 0);return this.replayPathPosition=0,this.buildValueFor(Y,!1)}canShrinkWithoutContext(X){return!1}filterOnExecution(X){let Q=[];for(let Y of X)if(Y.value_.hasRan)this.replayPath.push(!0),Q.push(Y);else this.replayPath.push(!1);return Q}filterOnReplay(X){return X.filter((Q,Y)=>{let J=this.replayPath[this.replayPathPosition+Y];if(J===void 0)throw Error("Too short replayPath");if(!J&&Q.value_.hasRan)throw Error("Mismatch between replayPath and real execution");return J})}filterForShrinkImpl(X){if(this.replayPathPosition===0)this.replayPath=this.sourceReplayPath!==null?sL.parse(this.sourceReplayPath):[];let Q=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(X):this.filterOnExecution(X);return this.replayPathPosition+=X.length,Q}shrink(X,Q){if(Q===void 0)return Q0.nil();let Y=Q,J=Y.shrunkOnce,$=Y.items,G=this.filterForShrinkImpl($);if(G.length===0)return Q0.nil();let Z=J?Q0.nil():new Q0([[]][Symbol.iterator]()),K=[];for(let W=0;W!==G.length;++W)K.push(a4(()=>{let H=G.slice(0,W);return this.lengthArb.shrink(G.length-1-W,void 0).map((_)=>H.concat(G.slice(G.length-(_.value+1))))}));for(let W=0;W!==G.length;++W)K.push(a4(()=>this.oneCommandArb.shrink(G[W].value_,G[W].context).map((H)=>G.slice(0,W).concat([H],G.slice(W+1)))));return Z.join(...K).map((W)=>{return this.buildValueFor(W.map((H)=>new k(H.value_.clone(),H.context)),!0)})}};function Cc(X,Q={}){let{size:Y,maxCommands:J=e6,disableReplayLog:$=!1,replayPath:G=null}=Q;return new wc(X,BQ(Y,0,J,Q.maxCommands!==void 0),J,G,$)}var Tc=class{constructor(X,Q){this.s=X,this.cmd=Q}async check(X){let Q=null,Y=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{Y=await Promise.resolve(this.cmd.check(X))}catch(J){throw Q=J,J}}}]).task).faulty)throw Q;return Y}async run(X,Q){let Y=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(X,Q)}catch(J){throw Y=J,J}}}]).task).faulty)throw Y}},Ic=function*(X,Q){for(let Y of Q)yield new Tc(X,Y)},uR=(X,Q,Y,J,$)=>{return X.then((G)=>{let{model:Z,real:K}=G,W=Y;for(let H of Q)W=$(W,()=>{return J(H,Z,K)});return W})},jc=(X,Q)=>{return uR({then:(G)=>{G(X())}},Q,void 0,(G,Z,K)=>{if(G.check(Z))G.run(Z,K)},(G,Z)=>Z())},Ec=(X)=>{return typeof X.then==="function"},lR=async(X,Q,Y=Promise.resolve())=>{return await uR({then:(Z)=>{let K=X();if(Ec(K))return K.then(Z);else return Z(K)}},Q,Y,async(Z,K,W)=>{if(await Z.check(K))await Z.run(K,W)},(Z,K)=>Z.then(K))};function Sc(X,Q){jc(X,Q)}async function vc(X,Q){await lR(X,Q)}async function xc(X,Q,Y){let J=lR(Q,Ic(X,Y),X.schedule(Promise.resolve(),"startModel"));await X.waitFor(J),await X.waitAll()}var P2=(X)=>X(),rR=class X{constructor(Q,Y){this.act=Q,this.taskSelector=Y,this.lastTaskId=0,this.sourceTaskSelector=Y.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[r0]=function(){return new X(this.act,this.sourceTaskSelector)}}static buildLog(Q){return`[task\${${Q.taskId}}] ${Q.label.length!==0?`${Q.schedulingType}::${Q.label}`:Q.schedulingType} ${Q.status}${Q.outputValue!==void 0?` with value ${gm(Q.outputValue)}`:""}`}log(Q,Y,J,$,G,Z){this.triggeredTasks.push({status:G,schedulingType:Q,taskId:Y,label:J,metadata:$,outputValue:Z!==void 0?g0(Z):void 0})}scheduleInternal(Q,Y,J,$,G,Z){let K=++this.lastTaskId,W=void 0,H=new Promise((_,V)=>{W=()=>{let q=Promise.resolve(Z!==void 0?J.then(()=>Z()):J);return q.then((D)=>{this.log(Q,K,Y,$,"resolved",D),_(D)},(D)=>{this.log(Q,K,Y,$,"rejected",D),V(D)}),q}});if(this.scheduledTasks.push({original:J,trigger:W,schedulingType:Q,taskId:K,label:Y,metadata:$,customAct:G}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return H}schedule(Q,Y,J,$){return this.scheduleInternal("promise",Y||"",Q,J,$||P2)}scheduleFunction(Q,Y){return(...J)=>this.scheduleInternal("function",`${Q.name}(${J.map(g0).join(",")})`,Q(...J),void 0,Y||P2)}scheduleSequence(Q,Y){let J={done:!1,faulty:!1},$={then:(_)=>_()},G=()=>{},Z=new Promise((_)=>{G=()=>_({done:J.done,faulty:J.faulty})}),K=()=>{J.faulty=!0,G()},W=()=>{J.done=!0,G()},H=(_,V)=>{if(_>=Q.length){V.then(W,K);return}V.then(()=>{let q=Q[_],[D,U,R]=typeof q==="function"?[q,q.name,void 0]:[q.builder,q.label,q.metadata],L=this.scheduleInternal("sequence",U,$,R,Y||P2,()=>D());H(_+1,L)},K)};return H(0,$),Object.assign(J,{task:Z})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw Error("No task scheduled");let Q=this.taskSelector.nextTaskIndex(this.scheduledTasks),[Y]=this.scheduledTasks.splice(Q,1);return Y.customAct(()=>{return Y.trigger().catch((J)=>{})})}waitOne(Q){let Y=Q||P2;return this.act(()=>Y(()=>this.internalWaitOne()))}async waitAll(Q){while(this.scheduledTasks.length>0)await this.waitOne(Q)}async internalWaitFor(Q,Y){let J=!1,$=Y.customAct,G=Y.onWaitStart,Z=Y.onWaitIdle,K=Y.launchAwaiterOnInit,W=void 0,H=void 0,_=0,V=null,q=null,D=async()=>{_=50;for(_=50;!J&&_>0;--_)await Promise.resolve();if(!J&&this.scheduledTasks.length>0){if(G!==void 0)G();return q=this.waitOne($),q.then(()=>{return q=null,D()},(N)=>{throw q=null,J=!0,H(N),N})}if(!J&&Z!==void 0)Z();V=null},U=()=>{if(V!==null){_=51;return}V=D().catch(()=>{})},R=()=>{let N=this.scheduledWatchers.indexOf(U);if(N!==-1)this.scheduledWatchers.splice(N,1);if(N===0&&this.scheduledWatchers.length!==0)this.scheduledWatchers[0]()},L=new Promise((N,P)=>{W=(y)=>{R(),N(y)},H=(y)=>{R(),P(y)}});if(Q.then((N)=>{if(J=!0,q===null)W(N);else q.then(()=>W(N),(P)=>H(P))},(N)=>{if(J=!0,q===null)H(N);else q.then(()=>H(N),()=>H(N))}),(this.scheduledTasks.length>0||K)&&this.scheduledWatchers.length===0)U();return this.scheduledWatchers.push(U),L}waitNext(Q,Y){let J=void 0,$=Q,G=$<=0?Promise.resolve():new Promise((Z)=>{J=()=>{if(--$<=0)Z()}});return this.internalWaitFor(G,{customAct:Y,onWaitStart:J,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(Q){let Y=void 0,J=new Promise(($)=>Y=$);return this.internalWaitFor(J,{customAct:Q,onWaitStart:void 0,onWaitIdle:Y,launchAwaiterOnInit:!0})}waitFor(Q,Y){return this.internalWaitFor(Q,{customAct:Y,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map((Q)=>({status:"pending",schedulingType:Q.schedulingType,taskId:Q.taskId,label:Q.label,metadata:Q.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(X.buildLog).map((Q)=>`-> ${Q}`).join(`
62
- `)+"`"}};function oR(X){let Q=0;return{clone:()=>oR(X),nextTaskIndex:(Y)=>{if(X.length<=Q)throw Error("Invalid schedulerFor defined: too many tasks have been scheduled");let J=Y.findIndex(($)=>$.taskId===X[Q]);if(J===-1)throw Error("Invalid schedulerFor defined: unable to find next task");return++Q,J}}}function tL(X,Q){return new rR(X,oR(Q))}function nR(X){let Q=X.clone();return{clone:()=>nR(Q),nextTaskIndex:(Y)=>{return X.nextInt(0,Y.length-1)}}}var kc=class extends I0{constructor(X){super();this.act=X}generate(X,Q){return new k(new rR(this.act,nR(X.clone())),void 0)}canShrinkWithoutContext(X){return!1}shrink(X,Q){return Q0.nil()}};function yc(X){let{act:Q=(Y)=>Y()}=X||{};return new kc(Q)}function bc(X,Q){let{act:Y=(J)=>J()}=Array.isArray(X)?Q||{}:X||{};if(Array.isArray(X))return tL(Y,X);return function(J,...$){return tL(Y,$)}}function gc(X={}){return O4(X,j("-9223372036854775808"),j("9223372036854775807"),ak,t4)}function hc(X={}){return O4(X,j(0),j("18446744073709551615"),sk,t4)}function mc(X,Q){return Q}var{floor:rZ,min:pc}=Math;function e1(X,Q){switch(X.type){case"Char":return{astNode:X,minLength:1};case"Repetition":switch(X.quantifier.kind){case"*":{let Y=e1(X.expression,Q);return{astNode:{type:"Repetition",quantifier:{...X.quantifier,kind:"Range",from:0,to:Q},expression:Y.astNode},minLength:0}}case"+":{let Y=e1(X.expression,Q),J=Y.minLength>1?Y.minLength:1;return{astNode:{type:"Repetition",quantifier:{...X.quantifier,kind:"Range",from:1,to:rZ(Q/J)},expression:Y.astNode},minLength:Y.minLength}}case"?":{let Y=e1(X.expression,Q);if(Q<Y.minLength)return{astNode:{type:"Repetition",quantifier:{...X.quantifier,kind:"Range",from:0,to:0},expression:Y.astNode},minLength:0};return{astNode:{...X,expression:Y.astNode},minLength:0}}case"Range":{let Y=X.quantifier.from>1?rZ(Q/X.quantifier.from):Q,J=e1(X.expression,Y),$=J.minLength>1?J.minLength:1;if(X.quantifier.to===void 0||X.quantifier.to*$>Q)return{astNode:{type:"Repetition",quantifier:{...X.quantifier,kind:"Range",to:rZ(Q/$)},expression:J.astNode},minLength:X.quantifier.from*J.minLength};return{astNode:{...X,expression:J.astNode},minLength:X.quantifier.from*J.minLength}}default:return mc(X.quantifier,{astNode:X,minLength:0})}case"Quantifier":return{astNode:X,minLength:0};case"Alternative":{let Y=0,J=[];for(let G=0;G!==X.expressions.length;++G){let Z=Q-Y,K=e1(X.expressions[G],Z);Y+=K.minLength,S(J,{value:K,allowance:Z})}let $=[];for(let G=0;G!==J.length;++G){let Z=J[G].value,K=J[G].allowance,W=Q-Y+Z.minLength;S($,(W!==K?e1(Z.astNode,W):Z).astNode)}return{astNode:{...X,expressions:$},minLength:Y}}case"CharacterClass":return{astNode:X,minLength:1};case"ClassRange":return{astNode:X,minLength:1};case"Group":{let Y=e1(X.expression,Q);return{astNode:{...X,expression:Y.astNode},minLength:Y.minLength}}case"Disjunction":{if(X.left===null){if(X.right===null)return{astNode:X,minLength:0};let $=e1(X.right,Q),G=$.minLength>Q?null:$.astNode;return{astNode:{...X,left:null,right:G},minLength:0}}if(X.right===null){let $=e1(X.left,Q),G=$.minLength>Q?null:$.astNode;return{astNode:{...X,left:G,right:null},minLength:0}}let Y=e1(X.left,Q),J=e1(X.right,Q);if(Y.minLength>Q)return J;if(J.minLength>Q)return Y;return{astNode:{...X,left:Y.astNode,right:J.astNode},minLength:pc(Y.minLength,J.minLength)}}case"Assertion":return{astNode:X,minLength:0};case"Backreference":return{astNode:X,minLength:0};case"UnicodeProperty":return{astNode:X,minLength:1}}}function dc(X,Q){return e1(X,Q).astNode}function cc(X){return Error(`Unsupported AST node! Received: ${g0(X)}`)}function T2(X,Q,Y){if(!Q&&!Y)return X;let J={hasStart:!1,hasEnd:!1},$=iR(X,Q,Y,J),G=Q&&!J.hasStart,Z=Y&&!J.hasEnd;if(!G&&!Z)return $;let K=[];if(G)K.push({type:"Assertion",kind:"^"}),K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}});if(K.push($),Z)K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),K.push({type:"Assertion",kind:"$"});return{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:K}}}function iR(X,Q,Y,J){switch(X.type){case"Char":return X;case"Repetition":return X;case"Quantifier":throw Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return J.hasStart=!0,J.hasEnd=!0,{...X,expressions:X.expressions.map(($,G)=>T2($,Q&&G===0,Y&&G===X.expressions.length-1))};case"CharacterClass":return X;case"ClassRange":return X;case"Group":return{...X,expression:iR(X.expression,Q,Y,J)};case"Disjunction":return J.hasStart=!0,J.hasEnd=!0,{...X,left:X.left!==null?T2(X.left,Q,Y):null,right:X.right!==null?T2(X.right,Q,Y):null};case"Assertion":if(X.kind==="^"||X.kind==="Lookahead")return J.hasStart=!0,X;else if(X.kind==="$"||X.kind==="Lookbehind")return J.hasEnd=!0,X;else throw Error(`Assertions of kind ${X.kind} not implemented yet!`);case"Backreference":return X;case"UnicodeProperty":return X;default:throw cc(X)}}function fc(X){return T2(X,!0,!0)}function eL(X,Q){return X[Q]>="\uD800"&&X[Q]<="\uDBFF"&&X[Q+1]>="\uDC00"&&X[Q+1]<="\uDFFF"?2:1}function m0(X){return X>="0"&&X<="9"||X>="a"&&X<="f"||X>="A"&&X<="F"}function zK(X){return X>="0"&&X<="9"}function aR(X,Q){for(let Y=Q;Y!==X.length;++Y){let J=X[Y];if(J==="\\")Y+=1;else if(J==="]")return Y}throw Error("Missing closing ']'")}function uc(X,Q){let Y=0;for(let J=Q;J!==X.length;++J){let $=X[J];if($==="\\")J+=1;else if($===")"){if(Y===0)return J;Y-=1}else if($==="[")J=aR(X,J);else if($==="(")Y+=1}throw Error("Missing closing ')'")}function lc(X,Q){let Y=!1;for(let J=Q;J!==X.length;++J){let $=X[J];if(zK($));else if(Q===J)return-1;else if($===","){if(Y)return-1;Y=!0}else if($==="}")return J;else return-1}return-1}var s6=function(X){return X[X.Full=0]="Full",X[X.Character=1]="Character",X}({});function rc(X,Q,Y,J){switch(X[Q]){case"[":if(J===s6.Character)return Q+1;return aR(X,Q+1)+1;case"{":{if(J===s6.Character)return Q+1;let $=lc(X,Q+1);if($===-1)return Q+1;return $+1}case"(":if(J===s6.Character)return Q+1;return uc(X,Q+1)+1;case"]":case"}":case")":return Q+1;case"\\":{let $=X[Q+1];switch($){case"x":if(m0(X[Q+2])&&m0(X[Q+3]))return Q+4;throw Error(`Unexpected token '${X.substring(Q,Q+4)}' found`);case"u":if(X[Q+2]==="{"){if(!Y)return Q+2;if(X[Q+4]==="}"){if(m0(X[Q+3]))return Q+5;throw Error(`Unexpected token '${X.substring(Q,Q+5)}' found`)}if(X[Q+5]==="}"){if(m0(X[Q+3])&&m0(X[Q+4]))return Q+6;throw Error(`Unexpected token '${X.substring(Q,Q+6)}' found`)}if(X[Q+6]==="}"){if(m0(X[Q+3])&&m0(X[Q+4])&&m0(X[Q+5]))return Q+7;throw Error(`Unexpected token '${X.substring(Q,Q+7)}' found`)}if(X[Q+7]==="}"){if(m0(X[Q+3])&&m0(X[Q+4])&&m0(X[Q+5])&&m0(X[Q+6]))return Q+8;throw Error(`Unexpected token '${X.substring(Q,Q+8)}' found`)}if(X[Q+8]==="}"&&m0(X[Q+3])&&m0(X[Q+4])&&m0(X[Q+5])&&m0(X[Q+6])&&m0(X[Q+7]))return Q+9;throw Error(`Unexpected token '${X.substring(Q,Q+9)}' found`)}if(m0(X[Q+2])&&m0(X[Q+3])&&m0(X[Q+4])&&m0(X[Q+5]))return Q+6;throw Error(`Unexpected token '${X.substring(Q,Q+6)}' found`);case"p":case"P":{if(!Y)return Q+2;let G=Q+2;for(;G<X.length&&X[G]!=="}";G+=X[G]==="\\"?2:1);if(X[G]!=="}")throw Error("Invalid \\P definition");return G+1}case"k":{let G=Q+2;for(;G<X.length&&X[G]!==">";++G);if(X[G]!==">"){if(!Y)return Q+2;throw Error("Invalid \\k definition")}return G+1}default:if(zK($)){let G=Y?X.length:Math.min(Q+4,X.length),Z=Q+2;for(;Z<G&&zK(X[Z]);++Z);return Z}return Q+(Y?eL(X,Q+1):1)+1}}default:return Q+(Y?eL(X,Q):1)}}function R2(X,Q,Y,J){let $=rc(X,Q,Y,J);return X.substring(Q,$)}var XP={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},g2={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},UQ=uK(g2),fK={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},FK=uK(fK),sR={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},QP=uK(sR);function uK(X){let Q={};for(let Y of Object.keys(X)){let J=X[Y];if(Array.isArray(J))for(let $=0;$!==J.length;++$)Q[J[$]]=Y;else Q[J]=Y}return Q}function oc(X){return X in fK||X in FK}function nc(X){return X in g2||X in UQ}function YP(X){if(X in XP)return XP[X];if(X in UQ)return UQ[X];if(X in g2||X==="General_Category"||X==="Script"||X==="Script_Extensions")return X;throw Error(`Unknown Unicode property name: ${X}`)}function JP(X){if(X in FK)return FK[X];if(X in QP)return QP[X];if(X in UQ)return UQ[X];if(X in fK||X in sR||X in g2)return X;throw Error(`Unknown Unicode property value: ${X}`)}function ic(X,Q){let Y=X.indexOf("=");if(Y!==-1){let J=X.substring(0,Y),$=X.substring(Y+1);return{type:"UnicodeProperty",name:J,value:$,negative:Q,shorthand:!1,binary:!1,canonicalName:YP(J),canonicalValue:JP($)}}if(oc(X))return{type:"UnicodeProperty",name:"General_Category",value:X,negative:Q,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:JP(X)};if(nc(X)){let J=YP(X);return{type:"UnicodeProperty",name:X,value:X,negative:Q,shorthand:!1,binary:!0,canonicalName:J,canonicalValue:J}}throw Error(`Invalid Unicode property: ${X}`)}var oZ=String.fromCodePoint;function nZ(X){let Q=X.pop();if(Q===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return Q}function tR(X){return X>="0"&&X<="9"}function I2(X,Q){return{type:"Char",kind:"simple",symbol:X,value:X,codePoint:X.codePointAt(0)||-1,escaped:Q}}function G9(X,Q){return{type:"Char",kind:"meta",symbol:Q,value:X,codePoint:Q.codePointAt(0)||-1}}function o4(X,Q){if(X.length>1)return{type:"Alternative",expressions:X};if(!Q&&X.length===0)throw Error("Unsupported no token");return X[0]}function iZ(X){if(X[0]==="\\"){let Q=X[1];switch(Q){case"x":{let Y=X.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"hex",symbol:oZ(J),value:X,codePoint:J}}case"u":{if(X==="\\u")return I2("u",!0);let Y=X[2]==="{"?X.substring(3,X.length-1):X.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"unicode",symbol:oZ(J),value:X,codePoint:J}}case"0":return G9(X,"\x00");case"n":return G9(X,`
63
- `);case"f":return G9(X,"\f");case"r":return G9(X,"\r");case"t":return G9(X,"\t");case"v":return G9(X,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:X,codePoint:NaN};default:if(tR(Q)){let Y=X.substring(1),J=Number(Y);return{type:"Char",kind:"decimal",symbol:oZ(J),value:X,codePoint:J}}if(X.length>2&&(Q==="p"||Q==="P")){let Y=Q==="P";return ic(X.substring(3,X.length-1),Y)}return I2(X.substring(1),!0)}}return I2(X)}function Z9(X,Q,Y,J){let $=null;for(let G=0,Z=R2(Q,G,Y,s6.Full);G!==Q.length;G+=Z.length,Z=R2(Q,G,Y,s6.Full)){let K=Z[0];switch(K){case"|":if($===null)$=[];$.push(o4(X.splice(0),!0)||null);break;case".":X.push({type:"Char",kind:"meta",symbol:Z,value:Z,codePoint:NaN});break;case"*":case"+":{let W=nZ(X);X.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"?":{let W=nZ(X);if(W.type==="Repetition")W.quantifier.greedy=!1,X.push(W);else X.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"{":{if(Z==="{"){X.push(I2(Z));break}let W=nZ(X),H=Z.substring(1,Z.length-1).split(","),_=Number(H[0]),V=H.length===1?_:H[1].length!==0?Number(H[1]):void 0;X.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:_,to:V}});break}case"[":{let W=Z.substring(1,Z.length-1),H=[],_=void 0,V=!1;for(let q=0,D=R2(W,q,Y,s6.Character);q!==W.length;q+=D.length,D=R2(W,q,Y,s6.Character)){if(q===0&&D==="^"){_=!0;continue}let U=iZ(D);if(D==="-")H.push(U),V=!0;else{let R=H.length>=2?H[H.length-2]:void 0;if(V&&R!==void 0&&R.type==="Char"&&U.type==="Char")H.pop(),H.pop(),H.push({type:"ClassRange",from:R,to:U});else H.push(U);V=!1}}X.push({type:"CharacterClass",expressions:H,negative:_});break}case"(":{let W=Z.substring(1,Z.length-1),H=[];if(W[0]==="?")if(W[1]===":")Z9(H,W.substring(2),Y,J),X.push({type:"Group",capturing:!1,expression:o4(H)});else if(W[1]==="="||W[1]==="!")Z9(H,W.substring(2),Y,J),X.push({type:"Assertion",kind:"Lookahead",negative:W[1]==="!"?!0:void 0,assertion:o4(H)});else if(W[1]==="<"&&(W[2]==="="||W[2]==="!"))Z9(H,W.substring(3),Y,J),X.push({type:"Assertion",kind:"Lookbehind",negative:W[2]==="!"?!0:void 0,assertion:o4(H)});else{let _=W.split(">");if(_.length<2||_[0][1]!=="<")throw Error(`Unsupported regex content found at ${JSON.stringify(Z)}`);let V=++J.lastIndex,q=_[0].substring(2);J.named.set(q,V),Z9(H,_.slice(1).join(">"),Y,J),X.push({type:"Group",capturing:!0,nameRaw:q,name:q,number:V,expression:o4(H)})}else{let _=++J.lastIndex;Z9(H,W,Y,J),X.push({type:"Group",capturing:!0,number:_,expression:o4(H)})}break}default:if(Z==="^")X.push({type:"Assertion",kind:Z});else if(Z==="$")X.push({type:"Assertion",kind:Z});else if(Z[0]==="\\"&&tR(Z[1])){let W=Number(Z.substring(1));if(Y||W<=J.lastIndex)X.push({type:"Backreference",kind:"number",number:W,reference:W});else X.push(iZ(Z))}else if(Z[0]==="\\"&&Z[1]==="k"&&Z.length!==2){let W=Z.substring(3,Z.length-1);X.push({type:"Backreference",kind:"name",number:J.named.get(W)||0,referenceRaw:W,reference:W})}else X.push(iZ(Z));break}}if($!==null){$.push(o4(X.splice(0),!0)||null);let G={type:"Disjunction",left:$[0],right:$[1]};for(let Z=2;Z<$.length;++Z)G={type:"Disjunction",left:G,right:$[Z]};X.push(G)}}function ac(X){let Q=_4([...X.flags],"u")!==-1,Y=X.source,J=[];return Z9(J,Y,Q,{lastIndex:0,named:new Map}),o4(J)}var sc=String.fromCodePoint;function tc(X){if(X.binary||X.shorthand)return X.canonicalValue;return`${X.canonicalName}=${X.canonicalValue}`}function $P(X,Q,Y,J){let $=-1;for(let G=Q;G<=Y;++G)if(X.test(sc(G))){if($===-1)$=G}else if($!==-1){let Z=G-1;J.push($===Z?[Z]:[$,Z]),$=-1}if($!==-1)J.push($===Y?[Y]:[$,Y])}function ec(X,Q){let Y=new RegExp(`^\\${Q?"P":"p"}{${X}}$`,"u"),J=[];return $P(Y,0,55295,J),$P(Y,57344,1114111,J),J}var GP=new Map;function Xf(X,Q){let Y=`${Q?"P":"p"}:${X}`,J=GP.get(Y);if(J!==void 0)return J;let $=ec(X,Q);return GP.set(Y,$),$}function Qf(X){return q9(...G0(Xf(tc(X),X.negative),(Q)=>YK(Q)))}var Yf=String.fromCodePoint,ZP=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],KP=[..."0123456789"],WP=[...` \r
64
- \v\f`],LK=[...`\r
65
- `],eR=[..."\x1E\x15"],Jf=[...LK,...eR],i6=()=>p0({unit:"grapheme-ascii",minLength:1,maxLength:1});function HP(X){return new E(`Unsupported AST node! Received: ${g0(X)}`)}function n4(X,Q,Y){switch(X.type){case"Char":if(X.kind==="meta")switch(X.value){case"\\w":return m8(...ZP);case"\\W":return i6().filter((J)=>_4(ZP,J)===-1);case"\\d":return m8(...KP);case"\\D":return i6().filter((J)=>_4(KP,J)===-1);case"\\s":return m8(...WP);case"\\S":return i6().filter((J)=>_4(WP,J)===-1);case"\\b":case"\\B":throw new E(`Meta character ${X.value} not implemented yet!`);case".":{let J=Y.dotAll?eR:Jf;return i6().filter(($)=>_4(J,$)===-1)}}if(X.symbol===void 0)throw new E(`Unexpected undefined symbol received for non-meta Char! Received: ${g0(X)}`);return b0(X.symbol);case"Repetition":{let J=n4(X.expression,Q,Y);switch(X.quantifier.kind){case"*":return p0({...Q,unit:J});case"+":return p0({...Q,minLength:1,unit:J});case"?":return p0({...Q,minLength:0,maxLength:1,unit:J});case"Range":return p0({...Q,minLength:X.quantifier.from,maxLength:X.quantifier.to,unit:J});default:throw HP(X.quantifier)}}case"Quantifier":throw new E("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return e(...G0(X.expressions,(J)=>n4(J,Q,Y))).map((J)=>w0(J,""));case"CharacterClass":if(X.negative){let J=G0(X.expressions,($)=>n4($,Q,Y));return i6().filter(($)=>RP(J,(G)=>!G.canShrinkWithoutContext($)))}return l0(...G0(X.expressions,(J)=>n4(J,Q,Y)));case"ClassRange":{let J=X.from.codePoint,$=X.to.codePoint;return z0({min:J,max:$}).map((G)=>Yf(G),(G)=>{if(typeof G!=="string")throw new E("Invalid type");if([...G].length!==1)throw new E("Invalid length");return H9(G,0)})}case"Group":return n4(X.expression,Q,Y);case"Disjunction":return l0(X.left!==null?n4(X.left,Q,Y):b0(""),X.right!==null?n4(X.right,Q,Y):b0(""));case"Assertion":if(X.kind==="^"||X.kind==="$"){if(Y.multiline)if(X.kind==="^")return l0(b0(""),e(p0({unit:i6()}),m8(...LK)).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new E("Invalid type");return[S0(J,0,J.length-1),J[J.length-1]]}));else return l0(b0(""),e(m8(...LK),p0({unit:i6()})).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new E("Invalid type");return[J[0],S0(J,1)]}));return b0("")}throw new E(`Assertions of kind ${X.kind} not implemented yet!`);case"Backreference":throw new E("Backreference nodes not implemented yet!");case"UnicodeProperty":return Qf(X);default:throw HP(X)}}function $f(X,Q={}){for(let K of X.flags)if(K!=="d"&&K!=="g"&&K!=="m"&&K!=="s"&&K!=="u")throw new E(`Unable to use "stringMatching" against a regex using the flag ${K}`);let Y=Q.maxLength,J={size:Q.size,maxLength:Y},$={multiline:X.multiline,dotAll:X.dotAll},G=fc(ac(X));if(Y!==void 0)G=dc(G,Y);let Z=n4(G,J,$);if(Y!==void 0)return Z.filter((K)=>[...K].length<=Y);return Z}function Gf(X){let Q=[];for(let Y=0;Y!==X.length;++Y)Q.push(X[Y].next());return Q}function Zf(X,Q){for(let Y=0;Y!==X.length;++Y)Q[Y]=X[Y].next()}function Kf(X){for(let Q=0;Q!==X.length;++Q)if(X[Q].done)return!0;return!1}function*Wf(...X){let Q=Gf(X);while(!Kf(Q))yield Q.map((Y)=>Y.value),Zf(X,Q)}function*Hf(X){let Q=X;while(!0)yield Q,++Q}var Vf=class extends I0{constructor(X,Q){super();this.arb=X,this.maxShrinks=Q}generate(X,Q){let Y=this.arb.generate(X,Q);return this.valueMapper(Y,0)}canShrinkWithoutContext(X){return this.arb.canShrinkWithoutContext(X)}shrink(X,Q){if(this.isSafeContext(Q))return this.safeShrink(X,Q.originalContext,Q.length);return this.safeShrink(X,void 0,0)}safeShrink(X,Q,Y){let J=this.maxShrinks-Y;if(J<=0)return Q0.nil();return new Q0(Wf(this.arb.shrink(X,Q),Hf(Y+1))).take(J).map(($)=>this.valueMapper($[0],$[1]))}valueMapper(X,Q){let Y={originalContext:X.context,length:Q};return new k(X.value,Y)}isSafeContext(X){return X!==null&&X!==void 0&&typeof X==="object"&&"originalContext"in X&&"length"in X}};function _f(X,Q){return new Vf(X,Q)}var qf="module",Df="4.7.0",Bf="fd1a1840b2fda7f909f825083bd486318adfcf11";var FQ=Y2;function c1(){return(X,Q,Y)=>{return T(new m6(X.map(oX),(J)=>Q(J.map(($)=>T($))),Y))}}function z4(X,Q){return c1()([],()=>(Y,J)=>X(Y)?h(Y):v(new x0(J,F(Y))),Q)}function Uf(X){return X}function Of(X){return(Q)=>Q.annotate(X)}function zf(X){return(Q)=>rK(rK(Q).annotate(X))}function Ff(X){return(Q)=>{return Q.rebuild(tX(Q.ast,X))}}function Lf(X){return X}function Pf(X){return M(X,J2)}function XN(X){return _8(X)?X.value:{issues:[{message:$$(X.cause)}]}}function Rf(X,Q){let Y=y0(X),J={errors:"all",...Q?.parseOptions},$=BU(Q),G=(Z)=>{let K=new w5,W=m5(g$(Y(Z,J),{onFailure:$,onSuccess:(_)=>({value:_})}),{scheduler:K});W.currentDispatcher?.flush();let H=W.pollUnsafe();if(H)return XN(H);return new Promise((_)=>{W.addObserver((V)=>{_(XN(V))})})};if("~standard"in X){let Z=X;if("validate"in Z["~standard"])return Z;return Object.assign(Z["~standard"],{validate:G}),Z}else return Object.assign(X,{"~standard":{version:1,vendor:"effect",validate:G}})}function QN(X,Q){let Y=LM(X);if(Q==="draft-2020-12"){let J=Y.schema;if(Object.keys(Y.definitions).length>0)J.$defs=Y.definitions;return J}else if(Q==="draft-07"){let J=cz(Y),$=J.schema;if(Object.keys(J.definitions).length>0)$.definitions=J.definitions;return $}throw new globalThis.Error(`Unsupported target: ${Q}`)}function Nf(X){let Q={input(Y){return QN(X,Y.target)},output(Y){return QN(P1(X),Y.target)}};if("~standard"in X){let Y=X;if("jsonSchema"in Y["~standard"])return Y;return Object.assign(Y["~standard"],{jsonSchema:Q}),Y}else return Object.assign(X,{"~standard":{version:1,vendor:"effect",jsonSchema:Q}})}var WN=zz,Mf=Lz;function HN(X){let Q=y0(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new V4($))}}var Af=HN;function VN(X){let Q=Nz(X);return(Y,J)=>{return d7(Q(Y,J),($)=>new V4($))}}var wf=VN,Cf=YZ,Tf=Mz,If=JZ,jf=Az,Ef=Pz,Sf=Rz,vf=$Z,xf=eY;function _N(X){let Q=r6(X);return(Y,J)=>{return y1(Q(Y,J),($)=>new V4($))}}var qN=_N;function DN(X){let Q=Cz(X);return(Y,J)=>{return d7(Q(Y,J),($)=>new V4($))}}var kf=DN,yf=ZZ,bf=Tz,gf=KZ,hf=Iz,mf=GZ,pf=wz,df=WZ,cf=X2,T=o6;function ff(X){class Q{}return Object.setPrototypeOf(Q,X)}function m2(X){return M(X,FQ)&&X[FQ]===FQ}var Q5=H1((X)=>T(lY(X.ast),{schema:X})),uf=H1((X)=>X.schema),U9=H1((X)=>Q5(c2(X))),lf=H1((X)=>X.schema.members[0]),rf=H1((X)=>T(lG(X.ast),{schema:X})),of=H1((X)=>X.schema),P1=H1((X)=>T(z8(X.ast),{schema:X})),O9=H1((X)=>T(J1(X.ast),{schema:X})),LQ="~effect/Schema/flip";function nf(X){return M(X,LQ)&&X[LQ]===LQ}function rK(X){if(nf(X))return X.schema.rebuild(O8(X.ast));return T(O8(X.ast),{[LQ]:LQ,schema:X})}function X1(X){let Q=T(new b1(X),{literal:X,transform(Y){return Q.pipe(m(X1(Y),{decode:n(()=>Y),encode:n(()=>X)}))}});return Q}function BN(X){return new gG(X.map((Q)=>m2(Q)?Q.ast:new b1(Q)))}function af(X){return T(BN(X),{parts:X})}function sf(X){return T(BN(X).asTemplateLiteralParser(),{parts:X})}function tf(X){return T(new bG(Object.keys(X).filter((Q)=>typeof X[X[Q]]!=="number").map((Q)=>[Q,X[Q]])),{enums:X})}var ef=T(zO),PQ=T(LO),p2=T(g6),aK=T(s5),sK=T(yG),r=T(p6),X6=T(mG),UN=T(TO),ON=T(jO),d2=T(SO),Xu=T(UO),Qu=T(NO);function Yu(X){return T(new hG(X))}function tK(X,Q){return T(X,{fields:Q,mapFields(Y,J){let $=Y(this.fields);return tK(hY($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function R0(X){return tK(hY(X,void 0),X)}function Ju(X){return H1((Q)=>Q.mapFields(Kz(X)))}function $u(X){return function(Q){let Y={},J={};for(let $ in Q.fields){let G=O9(Q.fields[$]);if(Object.hasOwn(X,$))Y[X[$]]=G,J[X[$]]=$;else Y[$]=G}return R0(Y).pipe(m(Q,v0({decode:sG(J),encode:sG(X)})))}}function Gu(X,Q){return(Y)=>{let J=P5(Y.fields,P1),$=R0({...J,...X});return Y.pipe(m($,v0({decode:(G)=>{let Z={...G};for(let K in X){let W=Q[K],H=W(G);if(B1(H))Z[K]=H.value}return Z},encode:(G)=>{let Z={...G};for(let K in X)delete Z[K];return Z}})))}}function zN(X,Q,Y){let J=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new gY(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return T(fO(X.ast,Q.ast,J),{key:X,value:Q})}function Zu(X,Q){return T(vO(X.ast,Q.map(oX)),{schema:X,records:Q})}function FN(X,Q){return T(X,{elements:Q,mapElements(Y,J){let $=Y(this.elements);return FN(cG($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function B9(X){return FN(cG(X),X)}function Ku(X,Q){return T(xO(X.ast,Q.map(oX)),{schema:X,rest:Q})}var c0=H1((X)=>T(new H4(!1,[],[X.ast]),{schema:X}));var Wu=H1((X)=>T(new H4(!1,[X.ast],[X.ast]),{schema:X}));function Hu(X){return o0([X,c0(X)]).pipe(m(c0(P1(X)),v0({decode:MH,encode:(Q)=>Q.length===1?Q[0]:Q})))}function Vu(X){return c0(X).check(mN())}var _u=H1((X)=>{return T(new H4(!0,X.ast.elements,X.ast.rest),{schema:X})});function LN(X,Q){return T(X,{members:Q,mapMembers(Y,J){let $=Y(this.members);return LN(mY($,this.ast.mode,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function o0(X,Q){return LN(mY(X,Q?.mode??"anyOf",void 0),X)}function eK(X){let Q=X.map(X1);return T(mY(Q,"anyOf",void 0),{literals:X,members:Q,mapMembers(Y){return o0(Y(this.members))},pick(Y){return eK(Y)},transform(Y){return o0(Q.map((J,$)=>J.transform(Y[$])))}})}var XW=H1((X)=>o0([X,aK])),c2=H1((X)=>o0([X,sK])),PN=H1((X)=>o0([X,aK,sK]));function RN(X){return T(new pY(()=>X().ast))}function qu(...X){return(Q)=>Q.check(...X)}function Du(X,Q){return(Y)=>T(u4(Y.ast,[dY(X,Q)]),{schema:Y})}function NN(X){return(Q)=>T(pO(Q.ast,X),{schema:Q,identifier:X})}function Bu(X,Q){return(Y)=>{return(Q.checks?Y.check(...Q.checks):Y).pipe(NN(X))}}function QW(X){return(Q)=>T(hO(Q.ast,new pX(X,b)),{schema:Q})}function MN(X){return(Q)=>T(mO(Q.ast,new pX(b,X)),{schema:Q})}function Uu(X){return AN(X)}function AN(X){return(Q)=>Q.pipe(QW(d5(X)))}function Ou(X){return wN(X)}function wN(X){return(Q)=>Q.pipe(MN(d5(X)))}function m(X,Q){return(Y)=>{return T(rY(Y.ast,X.ast,Q?jY(Q):b6()),{from:Y,to:X})}}function zu(X){return(Q)=>{return Q.pipe(m(P1(Q),X))}}function YW(X,Q){return(Y)=>{return Q?X.pipe(m(Y,Q)):X.pipe(m(Y))}}function Fu(X){return(Q)=>{return O9(Q).pipe(m(Q,X))}}function CN(X){return(Q)=>T(dO(Q.ast,X),{schema:Q})}function JW(X,Q){let Y=Q?.encodingStrategy==="omit"?RG():T1();return(J)=>{return Q5(O9(J)).pipe(m(J,{decode:mX(X),encode:Y}))}}function Lu(X,Q){return(Y)=>{return P1(Y).pipe(JW(X,Q),YW(Q5(Y)))}}function TN(X,Q){let Y=Q?.encodingStrategy==="omit"?RG():T1();return(J)=>{return U9(O9(J)).pipe(m(J,{decode:mX(X),encode:Y}))}}function Pu(X,Q){return(Y)=>{return P1(Y).pipe(TN(X,Q),YW(U9(Y)))}}function Y5(X){return X1(X).pipe(CN(h(X)))}function Ru(X){return Y5(X).pipe(JW(h(X),{encodingStrategy:"omit"}))}function f2(X,Q){return R0({_tag:Y5(X),...Q})}function IN(X){return(Q)=>{let Y={},J={},$=(K)=>(W)=>K.includes(W[X]);return G(Q),Object.assign(Q,{cases:Y,isAnyOf:$,guards:J,match:Z});function G(K){let W=K.ast;if(yY(W)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(m2))return K.members.forEach(G);let H=nX(W);if(H.length>0){let _=H.find((V)=>V.key===X)?.literal;if(jQ(_)){Y[_]=K,J[_]=WN(P1(K));return}}throw new globalThis.Error("No literal or unique symbol found")}function Z(){if(arguments.length===1){let H=arguments[0];return function(_){return H[_[X]](_)}}let K=arguments[0];return arguments[1][K[X]](K)}}}function Nu(X){let Q={},Y=[];for(let K of Object.keys(X))Y.push(Q[K]=f2(K,X[K]));let J=o0(Y),{guards:$,isAnyOf:G,match:Z}=IN("_tag")(J);return T(J.ast,{cases:Q,isAnyOf:G,guards:$,match:Z})}function Mu(){return(X)=>{class Q{}return Object.setPrototypeOf(Q,X)}}function p8(X,Q){return z4((Y)=>Y instanceof X,Q)}function O0(){return(X,Q)=>{return new B0(X.ast,jY(Q))}}var F0=fG;function Au(X,Q=void 0){return new f4(X,Q)}var YN="^\\S[\\s\\S]*\\S$|^\\S$|^$";function jN(X){return F0((Q)=>Q.trim()===Q,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(YN)},toArbitraryConstraint:{string:{patterns:[YN]}},...X})}var RQ=aX,wu=oG,Cu=nG,Tu=aG,Iu=(X)=>{if(X)return new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${X}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/};function ju(X,Q){let Y=Iu(X);return RQ(Y,{expected:X?`a UUID v${X}`:"a UUID",meta:{_tag:"isUUID",regExp:Y,version:X},...Q})}function Eu(X){let Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return RQ(Q,{meta:{_tag:"isULID",regExp:Q},...X})}function EN(X){let Q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return RQ(Q,{expected:"a base64 encoded string",meta:{_tag:"isBase64",regExp:Q},...X})}function Su(X){let Q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return RQ(Q,{expected:"a base64url encoded string",meta:{_tag:"isBase64Url",regExp:Q},...X})}function vu(X,Q){let Y=JSON.stringify(X);return F0((J)=>J.startsWith(X),{expected:`a string starting with ${Y}`,meta:{_tag:"isStartsWith",startsWith:X,regExp:new globalThis.RegExp(`^${X}`)},toArbitraryConstraint:{string:{patterns:[`^${X}`]}},...Q})}function xu(X,Q){let Y=JSON.stringify(X);return F0((J)=>J.endsWith(X),{expected:`a string ending with ${Y}`,meta:{_tag:"isEndsWith",endsWith:X,regExp:new globalThis.RegExp(`${X}$`)},toArbitraryConstraint:{string:{patterns:[`${X}$`]}},...Q})}function ku(X,Q){let Y=JSON.stringify(X);return F0((J)=>J.includes(X),{expected:`a string including ${Y}`,meta:{_tag:"isIncludes",includes:X,regExp:new globalThis.RegExp(X)},toArbitraryConstraint:{string:{patterns:[X]}},...Q})}var JN="^[^a-z]*$";function yu(X){return F0((Q)=>Q.toUpperCase()===Q,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(JN)},toArbitraryConstraint:{string:{patterns:[JN]}},...X})}var $N="^[^A-Z]*$";function bu(X){return F0((Q)=>Q.toLowerCase()===Q,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp($N)},toArbitraryConstraint:{string:{patterns:[$N]}},...X})}var GN="^[^a-z]?.*$";function gu(X){return F0((Q)=>Q.charAt(0).toUpperCase()===Q.charAt(0),{expected:"a string with the first character in uppercase",meta:{_tag:"isCapitalized",regExp:new globalThis.RegExp(GN)},toArbitraryConstraint:{string:{patterns:[GN]}},...X})}var ZN="^[^A-Z]?.*$";function hu(X){return F0((Q)=>Q.charAt(0).toLowerCase()===Q.charAt(0),{expected:"a string with the first character in lowercase",meta:{_tag:"isUncapitalized",regExp:new globalThis.RegExp(ZN)},toArbitraryConstraint:{string:{patterns:[ZN]}},...X})}function SN(X){return F0((Q)=>globalThis.Number.isFinite(Q),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...X})}function NQ(X){let Q=z5(X.order),Y=X.formatter??g;return(J,$)=>{return F0((G)=>Q(G,J),{expected:`a value greater than ${Y(J)}`,...X.annotate?.(J),...$})}}function MQ(X){let Q=nQ(X.order),Y=X.formatter??g;return(J,$)=>{return F0((G)=>Q(G,J),{expected:`a value greater than or equal to ${Y(J)}`,...X.annotate?.(J),...$})}}function AQ(X){let Q=rQ(X.order),Y=X.formatter??g;return(J,$)=>{return F0((G)=>Q(G,J),{expected:`a value less than ${Y(J)}`,...X.annotate?.(J),...$})}}function wQ(X){let Q=oQ(X.order),Y=X.formatter??g;return(J,$)=>{return F0((G)=>Q(G,J),{expected:`a value less than or equal to ${Y(J)}`,...X.annotate?.(J),...$})}}function CQ(X){let Q=nQ(X.order),Y=z5(X.order),J=oQ(X.order),$=rQ(X.order),G=X.formatter??g;return(Z,K)=>{let W=Z.exclusiveMinimum?Y:Q,H=Z.exclusiveMaximum?$:J;return F0((_)=>W(_,Z.minimum)&&H(_,Z.maximum),{expected:`a value between ${G(Z.minimum)}${Z.exclusiveMinimum?" (excluded)":""} and ${G(Z.maximum)}${Z.exclusiveMaximum?" (excluded)":""}`,...X.annotate?.(Z),...K})}}function vN(X){return(Q,Y)=>{let J=X.formatter??g;return F0(($)=>X.remainder($,Q)===X.zero,{expected:`a value that is a multiple of ${J(Q)}`,...X.annotate?.(Q),...Y})}}var mu=NQ({order:D1,annotate:(X)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:X},toArbitraryConstraint:{number:{min:X,minExcluded:!0}}})}),xN=MQ({order:D1,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:X},toArbitraryConstraint:{number:{min:X}}})}),pu=AQ({order:D1,annotate:(X)=>({meta:{_tag:"isLessThan",exclusiveMaximum:X},toArbitraryConstraint:{number:{max:X,maxExcluded:!0}}})}),du=wQ({order:D1,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:X},toArbitraryConstraint:{number:{max:X}}})}),$W=CQ({order:D1,annotate:(X)=>{return{meta:{_tag:"isBetween",...X},toArbitraryConstraint:{number:{min:X.minimum,max:X.maximum,...X.exclusiveMinimum&&{minExcluded:!0},...X.exclusiveMaximum&&{maxExcluded:!0}}}}}}),cu=vN({remainder:LD,zero:0,annotate:(X)=>({expected:`a value that is a multiple of ${X}`,meta:{_tag:"isMultipleOf",divisor:X}})});function u2(X){return F0((Q)=>globalThis.Number.isSafeInteger(Q),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...X})}function fu(X){return new f4([u2(X),$W({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...X})}function uu(X){return new f4([u2(),$W({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...X})}function kN(X){return F0((Q)=>!isNaN(Q.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},toArbitraryConstraint:{date:{noInvalidDate:!0}},...X})}var lu=NQ({order:O5,annotate:(X)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:X},toArbitraryConstraint:{date:{min:X,minExcluded:!0}}})}),ru=MQ({order:O5,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:X},toArbitraryConstraint:{date:{min:X}}})}),ou=AQ({order:O5,annotate:(X)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:X},toArbitraryConstraint:{date:{max:X,maxExcluded:!0}}})}),nu=wQ({order:O5,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:X},toArbitraryConstraint:{date:{max:X}}})}),iu=CQ({order:O5,annotate:(X)=>({meta:{_tag:"isBetweenDate",...X},toArbitraryConstraint:{date:{min:X.minimum,max:X.maximum}}})}),au=NQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:X},toArbitraryConstraint:{bigint:{min:X,minExcluded:!0}}})}),yN=MQ({order:T8,annotate:(X)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:X},toArbitraryConstraint:{bigint:{min:X}}})}),su=AQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:X},toArbitraryConstraint:{bigint:{max:X,maxExcluded:!0}}})}),tu=wQ({order:T8,annotate:(X)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:X},toArbitraryConstraint:{bigint:{max:X}}})}),eu=CQ({order:T8,annotate:(X)=>({meta:{_tag:"isBetweenBigInt",...X},toArbitraryConstraint:{bigint:{min:X.minimum,max:X.maximum}}})}),Xl=NQ({order:c5,formatter:(X)=>y8(X)}),Ql=MQ({order:c5,formatter:(X)=>y8(X)}),Yl=AQ({order:c5,formatter:(X)=>y8(X)}),Jl=wQ({order:c5,formatter:(X)=>y8(X)}),$l=CQ({order:c5,formatter:(X)=>y8(X)});function bN(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Y.length>=X,{expected:`a value with a length of at least ${X}`,meta:{_tag:"isMinLength",minLength:X},[h1]:!0,toArbitraryConstraint:{string:{minLength:X},array:{minLength:X}},...Q})}function gN(X){return bN(1,X)}function Gl(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Y.length<=X,{expected:`a value with a length of at most ${X}`,meta:{_tag:"isMaxLength",maxLength:X},[h1]:!0,toArbitraryConstraint:{string:{maxLength:X},array:{maxLength:X}},...Q})}function hN(X,Q,Y){return X=Math.max(0,Math.floor(X)),Q=Math.max(0,Math.floor(Q)),F0((J)=>J.length>=X&&J.length<=Q,{expected:X===Q?`a value with a length of ${X}`:`a value with a length between ${X} and ${Q}`,meta:{_tag:"isLengthBetween",minimum:X,maximum:Q},[h1]:!0,toArbitraryConstraint:{string:{minLength:X,maxLength:Q},array:{minLength:X,maxLength:Q}},...Y})}function Zl(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Y.size>=X,{expected:`a value with a size of at least ${X}`,meta:{_tag:"isMinSize",minSize:X},[h1]:!0,toArbitraryConstraint:{array:{minLength:X}},...Q})}function Kl(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Y.size<=X,{expected:`a value with a size of at most ${X}`,meta:{_tag:"isMaxSize",maxSize:X},[h1]:!0,toArbitraryConstraint:{array:{maxLength:X}},...Q})}function Wl(X,Q,Y){return X=Math.max(0,Math.floor(X)),Q=Math.max(0,Math.floor(Q)),F0((J)=>J.size>=X&&J.size<=Q,{expected:X===Q?`a value with a size of ${X}`:`a value with a size between ${X} and ${Q}`,meta:{_tag:"isSizeBetween",minimum:X,maximum:Q},[h1]:!0,toArbitraryConstraint:{array:{minLength:X,maxLength:Q}},...Y})}function Hl(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Reflect.ownKeys(Y).length>=X,{expected:`a value with at least ${X===1?"1 entry":`${X} entries`}`,meta:{_tag:"isMinProperties",minProperties:X},[h1]:!0,toArbitraryConstraint:{array:{minLength:X}},...Q})}function Vl(X,Q){return X=Math.max(0,Math.floor(X)),F0((Y)=>Reflect.ownKeys(Y).length<=X,{expected:`a value with at most ${X===1?"1 entry":`${X} entries`}`,meta:{_tag:"isMaxProperties",maxProperties:X},[h1]:!0,toArbitraryConstraint:{array:{maxLength:X}},...Q})}function _l(X,Q,Y){return X=Math.max(0,Math.floor(X)),Q=Math.max(0,Math.floor(Q)),F0((J)=>Reflect.ownKeys(J).length>=X&&Reflect.ownKeys(J).length<=Q,{expected:X===Q?`a value with exactly ${X===1?"1 entry":`${X} entries`}`:`a value with between ${X} and ${Q} entries`,meta:{_tag:"isPropertiesLengthBetween",minimum:X,maximum:Q},[h1]:!0,toArbitraryConstraint:{array:{minLength:X,maxLength:Q}},...Y})}function ql(X,Q){let Y=O9(X),J=Fz(Y.ast);return F0(($,G,Z)=>{let K=Reflect.ownKeys($),W=[];for(let H of K){let _=J(H,Z);if(_!==void 0){if(W.push(new A0([H],_)),Z.errors==="first")break}}if(H8(W))return new q0(G,F($),W);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Y.ast},[h1]:!0,...Q})}function mN(X){let Q=bQ();return F0((Y)=>h3(Y,Q).length===Y.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},toArbitraryConstraint:{array:{comparator:Q}},...X})}var Dl=r.check(gN()),Bl=r.check(hN(1,1));function J5(X){let Q=c1()([X],([Y])=>(J,$,G)=>{if(GH(J)){if(T0(J))return x8;return t0(y0(Y)(J.value,G),{onSuccess:F,onFailure:(Z)=>new q0($,F(J),[new A0(["value"],Z)])})}return v(new x0($,F(J)))},{typeConstructor:{_tag:"effect/Option"},generation:{runtime:"Schema.Option(?)",Type:"Option.Option<?>",importDeclaration:'import * as Option from "effect/Option"'},expected:"Option",toCodec:([Y])=>O0()(o0([R0({_tag:X1("Some"),value:Y}),R0({_tag:X1("None")})]),v0({decode:(J)=>J._tag==="None"?x():F(J.value),encode:(J)=>B1(J)?{_tag:"Some",value:J.value}:{_tag:"None"}})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Option"}:{},J.constant(x()),Y.map(F))},toEquivalence:([Y])=>HH(Y),toFormatter:([Y])=>G8({onNone:()=>"none()",onSome:(J)=>`some(${Y(J)})`})});return T(Q.ast,{value:X})}function Ul(X){return XW(X).pipe(m(J5(P1(X)),cU()))}function Ol(X){return c2(X).pipe(m(J5(P1(X)),fU()))}function zl(X,Q){return PN(X).pipe(m(J5(P1(X)),uU(Q)))}function Fl(X){return Q5(X).pipe(m(J5(P1(X)),lU()))}function Ll(X){return U9(X).pipe(m(J5(P1(X)),rU()))}function Pl(X,Q){let Y=Q===void 0?"omit":Q.onNoneEncoding,J=Y===null?null:void 0;return U9(XW(X)).pipe(m(J5(P1(X)),EY({decode:($)=>$.pipe(L5(EQ),F),encode:Y==="omit"?F5:($)=>F(aQ(F5($),()=>J))})))}function Rl(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!FH(G))return v(new x0(Z,F(G)));switch(G._tag){case"Success":return t0(tY(J)(G.success,K),{onSuccess:l,onFailure:(W)=>new q0(Z,F(G),[new A0(["success"],W)])});case"Failure":return t0(tY($)(G.failure,K),{onSuccess:f,onFailure:(W)=>new q0(Z,F(G),[new A0(["failure"],W)])})}},{typeConstructor:{_tag:"effect/Result"},generation:{runtime:"Schema.Result(?, ?)",Type:"Result.Result<?, ?>",importDeclaration:'import * as Result from "effect/Result"'},expected:"Result",toCodec:([J,$])=>O0()(o0([R0({_tag:X1("Success"),success:J}),R0({_tag:X1("Failure"),failure:$})]),v0({decode:(G)=>G._tag==="Success"?l(G.success):f(G.failure),encode:(G)=>A1(G)?{_tag:"Success",success:G.success}:{_tag:"Failure",failure:G.failure}})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"Result"}:{},J.map(l),$.map(f))},toEquivalence:([J,$])=>LH(J,$),toFormatter:([J,$])=>I8({onSuccess:(G)=>`success(${J(G)})`,onFailure:(G)=>`failure(${$(G)})`})});return T(Y.ast,{success:X,failure:Q})}function pN(X,Q){let Y=typeof Q?.label==="string"?y0(X1(Q.label)):void 0,J=c1()([X],([$])=>(G,Z,K)=>{if(DG(G)){let W=Y!==void 0?y1(Y(G.label,K),(H)=>new A0(["label"],H)):h4;return D8(W,()=>t0(y0($)(PY(G),K),{onSuccess:()=>G,onFailure:()=>{let H=F(G);return new q0(Z,H,[new A0(["value"],new Z0(H))])}}))}return v(new x0(Z,F(G)))},{typeConstructor:{_tag:"effect/Redacted"},generation:{runtime:"Schema.Redacted(?)",Type:"Redacted.Redacted<?>",importDeclaration:'import * as Redacted from "effect/Redacted"'},expected:"Redacted",toCodecJson:([$])=>O0()(GW($),{decode:n((G)=>Z4(G,{label:Q?.label})),encode:LG((G)=>"Cannot serialize Redacted"+(B1(G)&&typeof G.value.label==="string"?` with label: "${G.value.label}"`:""))}),toArbitrary:([$])=>()=>$.map((G)=>Z4(G,{label:Q?.label})),toFormatter:()=>globalThis.String,toEquivalence:([$])=>KU($)});return T(J.ast,{value:X})}function GW(X){return X.pipe(QW(y1(RY)))}function Nl(X,Q){return GW(X).pipe(m(pN(P1(X),Q),{decode:n((Y)=>Z4(Y,{label:Q?.label})),encode:LG((Y)=>"Cannot encode Redacted"+(B1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:""))}))}function oK(X,Q){let Y=c1()([X,Q],([J,$])=>(G,Z,K)=>{if(!J$(G))return v(new x0(Z,F(G)));switch(G._tag){case"Fail":return t0(y0(J)(G.error,K),{onSuccess:KX,onFailure:(W)=>new q0(Z,F(G),[new A0(["error"],W)])});case"Die":return t0(y0($)(G.defect,K),{onSuccess:WX,onFailure:(W)=>new q0(Z,F(G),[new A0(["defect"],W)])});case"Interrupt":return h(G)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([J,$])=>O0()(o0([R0({_tag:X1("Fail"),error:J}),R0({_tag:X1("Die"),defect:$}),R0({_tag:X1("Interrupt"),fiberId:c2(o2)})]),v0({decode:(G)=>{switch(G._tag){case"Fail":return KX(G.error);case"Die":return WX(G.defect);case"Interrupt":return HX(G.fiberId)}},encode:b})),toArbitrary:([J,$])=>dN(J,$),toEquivalence:([J,$])=>cN(J,$),toFormatter:([J,$])=>fN(J,$)});return T(Y.ast,{error:X,defect:Q})}function dN(X,Q){return(Y,J)=>{return Y.oneof(J?.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},Y.constant(HX()),Y.integer({min:1}).map(HX),X.map(($)=>KX($)),Q.map(($)=>WX($)))}}function cN(X,Q){return(Y,J)=>{if(Y._tag!==J._tag)return!1;switch(Y._tag){case"Fail":return X(Y.error,J.error);case"Die":return Q(Y.defect,J.defect);case"Interrupt":return Y.fiberId===J.fiberId}}}function fN(X,Q){return(Y)=>{switch(Y._tag){case"Fail":return`Fail(${X(Y.error)})`;case"Die":return`Die(${Q(Y.defect)})`;case"Interrupt":return"Interrupt"}}}function nK(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(oK(J,$));return(Z,K,W)=>{if(!Y$(Z))return v(new x0(K,F(Z)));return t0(y0(G)(Z.reasons,W),{onSuccess:ZX,onFailure:(H)=>new q0(K,F(Z),[new A0(["failures"],H)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([J,$])=>O0()(c0(oK(J,$)),v0({decode:ZX,encode:({reasons:G})=>G})),toArbitrary:([J,$])=>uN(J,$),toEquivalence:([J,$])=>lN(J,$),toFormatter:([J,$])=>rN(J,$)});return T(Y.ast,{error:X,defect:Q})}function uN(X,Q){return(Y,J)=>{return Y.array(dN(X,Q)(Y,J)).map(ZX)}}function lN(X,Q){let Y=rW(cN(X,Q));return(J,$)=>Y(J.reasons,$.reasons)}function rN(X,Q){let Y=fN(X,Q);return(J)=>`Cause([${J.reasons.map(Y).join(", ")}])`}var l2=R0({message:r,name:Q5(r),stack:Q5(r)}),oN=p8(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>O0()(l2,dX()),toArbitrary:()=>(X)=>X.string().map((Q)=>new globalThis.Error(Q))}),nN=p8(globalThis.Error,{typeConstructor:{_tag:"ErrorWithStack"},generation:{runtime:"Schema.ErrorWithStack",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>O0()(l2,dX({includeStack:!0})),toArbitrary:()=>(X)=>X.string().map((Q)=>new globalThis.Error(Q))}),h2=new K0(T1(),n((X)=>{try{return JSON.parse(JSON.stringify(X))}catch{return g(X)}})),Ml=o0([l2.pipe(m(oN,dX())),PQ.pipe(m(p2.annotate({toCodecJson:()=>O0()(PQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]),Al=o0([l2.pipe(m(nN,dX({includeStack:!0}))),PQ.pipe(m(p2.annotate({toCodecJson:()=>O0()(PQ,h2),toArbitrary:()=>(X)=>X.json()}),h2))]);function wl(X,Q,Y){let J=c1()([X,Q,Y],([$,G,Z])=>{let K=nK(G,Z);return(W,H,_)=>{if(!G$(W))return v(new x0(H,F(W)));switch(W._tag){case"Success":return t0(y0($)(W.value,_),{onSuccess:_X,onFailure:(V)=>new q0(H,F(W),[new A0(["value"],V)])});case"Failure":return t0(y0(K)(W.cause,_),{onSuccess:qX,onFailure:(V)=>new q0(H,F(W),[new A0(["cause"],V)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([$,G,Z])=>O0()(o0([R0({_tag:X1("Success"),value:$}),R0({_tag:X1("Failure"),cause:nK(G,Z)})]),v0({decode:(K)=>K._tag==="Success"?_X(K.value):qX(K.cause),encode:(K)=>_8(K)?{_tag:"Success",value:K.value}:{_tag:"Failure",cause:K.cause}})),toArbitrary:([$,G,Z])=>(K,W)=>K.oneof(W?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},$.map((H)=>_X(H)),uN(G,Z)(K,W).map((H)=>qX(H))),toEquivalence:([$,G,Z])=>{let K=lN(G,Z);return(W,H)=>{if(W._tag!==H._tag)return!1;switch(W._tag){case"Success":return $(W.value,H.value);case"Failure":return K(W.cause,H.cause)}}},toFormatter:([$,G,Z])=>{let K=rN(G,Z);return(W)=>{switch(W._tag){case"Success":return`Exit.Success(${$(W.value)})`;case"Failure":return`Exit.Failure(${K(W.cause)})`}}}});return T(J.ast,{value:X,error:Q,defect:Y})}function Cl(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(B9([J,$]));return(Z,K,W)=>{if(Z instanceof globalThis.Map)return t0(y0(G)([...Z],W),{onSuccess:(H)=>new globalThis.Map(H),onFailure:(H)=>new q0(K,F(Z),[new A0(["entries"],H)])});return v(new x0(K,F(Z)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([J,$])=>O0()(c0(B9([J,$])),v0({decode:(G)=>new globalThis.Map(G),encode:(G)=>[...G.entries()]})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlyMap"}:{},G.constant([]),G.array(G.tuple(J,$),Z?.constraints?.array)).map((K)=>new globalThis.Map(K))},toEquivalence:([J,$])=>kQ(J,$),toFormatter:([J,$])=>(G)=>{let Z=G.size;if(Z===0)return"ReadonlyMap(0) {}";let K=globalThis.Array.from(G.entries()).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`ReadonlyMap(${Z}) { ${K.join(", ")} }`}});return T(Y.ast,{key:X,value:Q})}function Tl(X,Q){let Y=c1()([X,Q],([J,$])=>{let G=c0(B9([J,$]));return(Z,K,W)=>{if(iB(Z))return t0(y0(G)(BY(Z),W),{onSuccess:DY,onFailure:(H)=>new q0(K,F(Z),[new A0(["entries"],H)])});return v(new x0(K,F(Z)))}},{typeConstructor:{_tag:"effect/HashMap"},generation:{runtime:"Schema.HashMap(?, ?)",Type:"HashMap.HashMap<?, ?>",importDeclaration:'import * as HashMap from "effect/HashMap"'},expected:"HashMap",toCodec:([J,$])=>O0()(c0(B9([J,$])),v0({decode:DY,encode:BY})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"HashMap"}:{},G.constant([]),G.array(G.tuple(J,$),Z?.constraints?.array)).map(DY)},toEquivalence:([J,$])=>kQ(J,$),toFormatter:([J,$])=>(G)=>{let Z=aB(G);if(Z===0)return"HashMap(0) {}";let K=BY(G).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`HashMap(${Z}) { ${K.join(", ")} }`}});return T(Y.ast,{key:X,value:Q})}function Il(X){let Q=c1()([X],([Y])=>{let J=c0(Y);return($,G,Z)=>{if($ instanceof globalThis.Set)return t0(y0(J)([...$],Z),{onSuccess:(K)=>new globalThis.Set(K),onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return v(new x0(G,F($)))}},{typeConstructor:{_tag:"ReadonlySet"},generation:{runtime:"Schema.ReadonlySet(?)",Type:"globalThis.ReadonlySet<?>"},expected:"ReadonlySet",toCodec:([Y])=>O0()(c0(Y),v0({decode:(J)=>new globalThis.Set(J),encode:(J)=>[...J.values()]})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlySet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map((G)=>new globalThis.Set(G))},toEquivalence:([Y])=>yQ(Y),toFormatter:([Y])=>(J)=>{let $=J.size;if($===0)return"ReadonlySet(0) {}";let G=globalThis.Array.from(J.values()).sort().map((Z)=>`${Y(Z)}`);return`ReadonlySet(${$}) { ${G.join(", ")} }`}});return T(Q.ast,{value:X})}function jl(X){let Q=c1()([X],([Y])=>{let J=c0(Y);return($,G,Z)=>{if(XU($))return t0(y0(J)(Z1($),Z),{onSuccess:OY,onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return v(new x0(G,F($)))}},{typeConstructor:{_tag:"effect/HashSet"},generation:{runtime:"Schema.HashSet(?)",Type:"HashSet.HashSet<?>"},expected:"HashSet",toCodec:([Y])=>O0()(c0(Y),v0({decode:OY,encode:Z1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"HashSet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(OY)},toEquivalence:([Y])=>yQ(Y),toFormatter:([Y])=>(J)=>{let $=QU(J);if($===0)return"HashSet(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`HashSet(${$}) { ${G.join(", ")} }`}});return T(Q.ast,{value:X})}function El(X){let Q=c1()([X],([Y])=>{let J=c0(Y);return($,G,Z)=>{if(YY($))return t0(y0(J)(Z1($),Z),{onSuccess:JY,onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return v(new x0(G,F($)))}},{typeConstructor:{_tag:"effect/Chunk"},generation:{runtime:"Schema.Chunk(?)",Type:"Chunk.Chunk<?>"},expected:"Chunk",toCodec:([Y])=>O0()(c0(Y),v0({decode:JY,encode:Z1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Chunk"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(JY)},toEquivalence:([Y])=>n$(Y),toFormatter:([Y])=>(J)=>{let $=UB(J);if($===0)return"Chunk(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`Chunk(${$}) { ${G.join(", ")} }`}});return T(Q.ast,{value:X})}var Sl=p8(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>O0()(R0({source:r,flags:r}),t1({decode:(X)=>m4({try:()=>new globalThis.RegExp(X.source,X.flags),catch:(Q)=>new Z0(F(Q),{message:globalThis.String(Q)})}),encode:(X)=>h({source:X.source,flags:X.flags})})),toArbitrary:()=>(X)=>X.tuple(X.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),X.uniqueArray(X.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((Q)=>Q.join(""))).map(([Q,Y])=>new globalThis.RegExp(Q,Y)),toEquivalence:()=>(X,Q)=>X.source===Q.source&&X.flags===Q.flags}),iN=r.annotate({expected:"a string that will be decoded as a URL"}),aN=p8(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>O0()(iN,TG),toArbitrary:()=>(X)=>X.webUrl().map((Q)=>new globalThis.URL(Q)),toEquivalence:()=>(X,Q)=>X.toString()===Q.toString()}),vl=iN.pipe(m(aN,TG)),sN=r.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),ZW=p8(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>O0()(sN,CG),toArbitrary:()=>(X,Q)=>X.date(Q?.constraints?.date)}),xl=sN.pipe(m(ZW,CG)),tN=ZW.check(kN()),r2=z4(p3,{typeConstructor:{_tag:"effect/Duration"},generation:{runtime:"Schema.Duration",Type:"Duration.Duration",importDeclaration:'import * as Duration from "effect/Duration"'},expected:"Duration",toCodecJson:()=>O0()(o0([R0({_tag:X1("Infinity")}),R0({_tag:X1("NegativeInfinity")}),R0({_tag:X1("Nanos"),value:d2}),R0({_tag:X1("Millis"),value:GM})]),v0({decode:(X)=>{switch(X._tag){case"Infinity":return i8;case"NegativeInfinity":return L6;case"Nanos":return a8(X.value);case"Millis":return S4(X.value)}},encode:(X)=>{switch(X.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:X.value.nanos};case"Millis":return{_tag:"Millis",value:X.value.millis}}}})),toArbitrary:()=>(X)=>X.oneof(X.constant(i8),X.constant(L6),X.bigInt().map(a8),X.maxSafeInteger().map(S4)),toFormatter:()=>globalThis.String,toEquivalence:()=>d3}),kl=r.annotate({expected:"a string that will be decoded as a Duration"}),yl=kl.pipe(m(r2,mU)),bl=globalThis.BigInt(0),gl=d2.check(yN(bl)).pipe(m(r2,pU)),hl=X6.check(xN(0)).pipe(m(r2,dU)),eN=r.annotate({expected:"a string that will be decoded as a BigDecimal"}),XM=z4(u$,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>O0()(eN,IG),toArbitrary:()=>(X)=>X.tuple(X.bigInt(),X.integer({min:0,max:20})).map(([Q,Y])=>S6(Q,Y)),toFormatter:()=>(X)=>y8(X),toEquivalence:()=>r$}),ml=eN.pipe(m(XM,IG)),pl=QM(p2);function QM(X){return r.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:J1(X.ast)}).pipe(m(X,sU))}var YM=p8(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>O0()(R0({data:r.check(EN()),type:r,name:r,lastModified:X6}),t1({decode:(X)=>I8(f5(X.data),{onFailure:(Q)=>v(new Z0(F(X.data),{message:Q.message})),onSuccess:(Q)=>{let Y=new globalThis.Uint8Array(Q);return h(new globalThis.File([Y],X.name,{type:X.type,lastModified:X.lastModified}))}}),encode:(X)=>y$({try:async()=>{let Q=new globalThis.Uint8Array(await X.arrayBuffer());return{data:WY(Q),type:X.type,name:X.name,lastModified:X.lastModified}},catch:(Q)=>new Z0(F(X),{message:globalThis.String(Q)})})}))}),JM=p8(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>O0()(c0(B9([r,o0([R0({_tag:Y5("String"),value:r}),R0({_tag:Y5("File"),value:YM})])])),t1({decode:(X)=>{let Q=new globalThis.FormData;for(let[Y,J]of X)Q.append(Y,J.value);return h(Q)},encode:(X)=>{return h(globalThis.Array.from(X.entries()).map(([Q,Y])=>{if(typeof Y==="string")return[Q,{_tag:"String",value:Y}];else return[Q,{_tag:"File",value:Y}]}))}}))});function dl(X){return JM.pipe(m(X,tU))}var $M=p8(globalThis.URLSearchParams,{typeConstructor:{_tag:"URLSearchParams"},generation:{runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"},expected:"URLSearchParams",toCodecJson:()=>O0()(r.annotate({expected:"a query string that will be decoded as URLSearchParams"}),v0({decode:(X)=>new globalThis.URLSearchParams(X),encode:(X)=>X.toString()}))});function cl(X){return $M.pipe(m(X,eU))}var o2=X6.check(SN()),GM=X6.check(u2()),fl=r.annotate({expected:"a string that will be decoded as a number"}).pipe(m(X6,n5)),ul=r.annotate({expected:"a string that will be decoded as a finite number"}).pipe(m(o2,n5)),ll=T(iG).pipe(m(d2,SY)),ZM=r.check(jN()),rl=r.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(m(ZM,hU())),ol=r.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,oU)),nl=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,nU)),il=r.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,iU)),al=r.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(m(r,aU)),iK=o0([o2,ON,r]),sl=R0({issues:c0(R0({message:r,path:U9(c0(o0([iK,R0({key:iK})])))}))}),tl=eK([0,1]).pipe(m(UN,v0({decode:(X)=>X===1,encode:(X)=>X?1:0}))),KM=r.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),n2=p8(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>O0()(KM,jG),toArbitrary:()=>(X)=>X.uint8Array()}),el=KM.pipe(m(n2,jG)),Xr=r.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:CU(),encode:TY()})),Qr=r.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(m(n2,{decode:IU(),encode:IY()})),i2=z4((X)=>a$(X)&&LB(X),{typeConstructor:{_tag:"effect/DateTime.Utc"},generation:{runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Utc",toCodecJson:()=>O0()(r,vG),toArbitrary:()=>(X,Q)=>X.date({noInvalidDate:!0,...Q?.constraints?.date}).map((Y)=>RB(Y)),toFormatter:()=>(X)=>X.toString(),toEquivalence:()=>s$}),Yr=tN.pipe(m(i2,{decode:MG(),encode:n(CB)})),Jr=r.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(m(i2,vG)),$r=X6.pipe(m(i2,{decode:MG(),encode:n(TB)})),Gr=z4(zB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Offset"},generation:{runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Offset",toCodecJson:()=>O0()(X6,XO),toArbitrary:()=>(X)=>X.integer({min:-43200000,max:50400000}).map((Q)=>jX(Q)),toFormatter:()=>(X)=>p4(X),toEquivalence:()=>(X,Q)=>X.offset===Q.offset}),WM=r.annotate({expected:"an IANA time zone identifier"}),HM=z4(FB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Named"},generation:{runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Named",toCodecJson:()=>O0()(WM,EG),toArbitrary:()=>(X)=>X.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(t$)),toFormatter:()=>(X)=>p4(X),toEquivalence:()=>(X,Q)=>X.id===Q.id}),Zr=WM.pipe(m(HM,EG)),VM=r.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),_M=z4(OB,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>O0()(VM,SG),toArbitrary:()=>(X)=>X.oneof(X.integer({min:-43200000,max:50400000}).map((Q)=>jX(Q)),X.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(t$))),toFormatter:()=>(X)=>p4(X),toEquivalence:()=>(X,Q)=>p4(X)===p4(Q)}),Kr=VM.pipe(m(_M,SG)),qM=r.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),DM=z4((X)=>a$(X)&&PB(X),{typeConstructor:{_tag:"effect/DateTime.Zoned"},generation:{runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Zoned",toCodecJson:()=>O0()(qM,xG),toArbitrary:()=>(X,Q)=>X.tuple(X.date({noInvalidDate:!0,min:new globalThis.Date(-8639999949600000),max:new globalThis.Date(8639999949600000),...Q?.constraints?.date}),X.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([Y,J])=>NB(Y,{timeZone:J})),toFormatter:()=>(X)=>ZY(X),toEquivalence:()=>s$}),Wr=qM.pipe(m(DM,xG)),Hr=globalThis.Symbol.for("immer-draftable");function KW(X,Q,Y,J,$){let G=_r(Y,Q,J),Z=BM(Q),K=class extends X{constructor(...[W,H]){W=W??{};let _=Y.make(W,H);super({...W,..._},{...H,disableChecks:!0})}static[FQ]=FQ;get[Z](){return Z}static[Hr]=!0;static identifier=Q;static fields=Y.fields;static get ast(){return G(this).ast}static pipe(){return a(this,arguments)}static rebuild(W){return G(this).rebuild(W)}static make(W,H){return new this(W,H)}static makeOption(W,H){return sY(G(this))(W??{},H)}static makeEffect(W,H){return y1(X9(G(this))(W??{},H),(_)=>new V4(_))}static annotate(W){return this.rebuild(f6(this.ast,W))}static annotateKey(W){return this.rebuild(tX(this.ast,W))}static check(...W){return this.rebuild(u4(this.ast,W))}static extend(W){return(H,_)=>{let V={...Y.fields,...H};return KW(this,W,tK(hY(V,Y.ast.checks,{identifier:W}),V),_,$)}}static mapFields(W,H){return Y.mapFields(W,H)}};if($!==void 0)Object.assign(K.prototype,$(Q));return K}function Vr(X){return new K0(n((Q)=>new X(Q)),T1())}function BM(X){return`~effect/Schema/Class/${X}`}function _r(X,Q,Y){let J;return($)=>{if(J===void 0){let G=Vr($),Z=T(new m6([X.ast],()=>(K,W)=>{return K instanceof $||M(K,BM(Q))?h(K):v(new x0(W,F(K)))},{identifier:Q,[e5]:([K])=>new B0(K,G),toCodec:([K])=>new B0(K.ast,G),toArbitrary:([K])=>()=>K.map((W)=>new $(W)),toFormatter:([K])=>(W)=>`${$.identifier}(${K(W)})`,"~sentinels":nX(X.ast),...Y}));J=X.pipe(m(Z,G))}return J}}function a2(X){return m2(X)}var UM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return KW(YD,X,J,Y,($)=>({toString(){return`${$}(${g({...this})})`}}))},qr=(X)=>{return(Q,Y,J)=>{return UM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Y5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}},OM=(X)=>(Q,Y)=>{let J=a2(Q)?Q:R0(Q);return KW(dQ,X,J,Y,(G)=>({name:G}))},Dr=(X)=>{return(Q,Y,J)=>{return OM(X??Q)(a2(Y)?Y.mapFields(($)=>({_tag:Y5(Q),...$}),{unsafePreserveChecks:!0}):f2(Q,Y),J)}};function zM(X){let Q=Uz(X.ast);return(Y)=>Q(Y,{})}function Br(X){return zM(X)(lK)}function Ur(X){return(Q)=>{return Q.annotate({toFormatter:X})}}function Or(X,Q){return Y(X.ast);function Y($){let G=U8($)?.toFormatter;if(typeof G==="function")return G(g8($)?$.typeParameters.map(Y):[]);if(Q?.onBefore){let Z=Q.onBefore($,Y);if(Z!==void 0)return Z}return J($)}function J($){switch($._tag){default:return g;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let G=$.elements.map(Y),Z=$.rest.map(Y);return(K)=>{let W=[],H=0;for(;H<G.length;H++)if(K.length<H+1){if(E0($.elements[H]))continue}else W.push(G[H](K[H]));if(Z.length>0){let[_,...V]=Z;for(;H<K.length-V.length;H++)W.push(_(K[H]));for(let q=0;q<V.length;q++)H+=q,W.push(V[q](K[H]))}return"["+W.join(", ")+"]"}}case"Objects":{let G=$.propertySignatures.map((K)=>Y(K.type)),Z=$.indexSignatures.map((K)=>Y(K.type));if($.propertySignatures.length===0&&$.indexSignatures.length===0)return g;return(K)=>{let W=[],H=new Set;for(let _=0;_<G.length;_++){let V=$.propertySignatures[_],q=V.name;if(H.add(q),E0(V.type)&&!Object.hasOwn(K,q))continue;W.push(`${N4(q)}: ${G[_](K[q])}`)}for(let _=0;_<Z.length;_++){let V=d6(K,$.indexSignatures[_].parameter);for(let q of V){if(H.has(q))continue;H.add(q),W.push(`${N4(q)}: ${Z[_](K[q])}`)}}return W.length>0?"{ "+W.join(", ")+" }":"{}"}}case"Union":{let G=(Z)=>iX(Z,$.types);return(Z)=>{let K=G(Z),W=K.map(JQ);for(let H=0;H<K.length;H++){let _=W[H];if(_(Z))return Y(K[H])(Z)}return g(Z)}}case"Suspend":{let G=c6(()=>Y($.thunk()));return(Z)=>G()(Z)}}}}function zr(X){return(Q)=>Q.annotate({toEquivalence:X})}function Fr(X){return vz(X.ast)}function FM(X){return yz(X.ast)}function LM(X,Q){let Y=FM(X),J=bz(Y,Q);return{dialect:"draft-2020-12",schema:J.schema,definitions:J.definitions}}function PM(X){return T(RM(X.ast))}var RM=u6((X)=>{let Q=Lr(X,RM);return Q!==X&&E0(X)?t5(Q):Q});function Lr(X,Q){switch(X._tag){case"Declaration":{let Y=X.annotations?.toCodecJson??X.annotations?.toCodec;if(Y8(Y)){let J=g8(X)?X.typeParameters.map((Z)=>o6(J1(Z))):[],$=Y(J),G=Q($.to);return D0(X,G===$.to?[$]:[new B0(G,$.transformation)])}return D0(X,[Yz])}case"Unknown":case"ObjectKeyword":return D0(X,[Jz]);case"Undefined":case"Void":case"Literal":case"Number":return X.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return X.toCodecStringTree();case"Objects":{if(X.propertySignatures.some((Y)=>typeof Y.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:X});return X.recur(Q)}case"Union":{let Y=$2(X.types);if(Y!==X.types)return new g1(Y,X.mode,X.annotations,X.checks,X.encoding,X.context).recur(Q);return X.recur(Q)}case"Arrays":case"Suspend":return X.recur(Q)}return X}function NM(X){return T(MM(z8(X.ast)))}var MM=d0((X)=>{let Q=Pr(X,MM);return Q!==X&&E0(X)?t5(Q):Q});function Pr(X,Q){switch(X._tag){case"Declaration":{let Y=X.annotations?.toCodecIso??X.annotations?.toCodec;if(Y8(Y)){let J=Y(X.typeParameters.map((G)=>o6(G))),$=Q(J.to);return D0(X,$===J.to?[J]:[new B0($,J.transformation)])}return X}case"Arrays":case"Objects":case"Union":case"Suspend":return X.recur(Q)}return X}function AM(X,Q){return T(IM(Q?.keepDeclarations===!0?TM(X.ast):CM(X.ast)))}function Rr(X,Q){let Y=l5(X.ast)??qG(X.ast),J=qN(AM(X));return($)=>J($).pipe(AX((G)=>Nr(G,{rootName:Y,...Q})))}function Nr(X,Q){let Y=Q.rootName??"root",J=Q.arrayItemName??"item",$=Q.pretty??!0,G=Q.indent??" ",Z=Q.sortKeys??!0,K=new Set,W=[];return _(Y,X,0),W.join($?`
66
- `:"");function H(V,q){W.push($?G.repeat(V)+q:q)}function _(V,q,D,U){let{attrs:R,safe:L}=D9.tagInfo(V,U);if(q===void 0)H(D,`<${L}${R}/>`);else if(typeof q==="string")H(D,`<${L}${R}>${D9.escapeText(q)}</${L}>`);else if(typeof q!=="object"||q===null)H(D,`<${L}${R}>${D9.escapeText(g(q))}</${L}>`);else{if(K.has(q))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:q});K.add(q);try{if(globalThis.globalThis.Array.isArray(q)){if(q.length===0){H(D,`<${L}${R}/>`);return}H(D,`<${L}${R}>`);for(let y of q)_(J,y,D+1);H(D,`</${L}>`);return}let N=q,P=Object.keys(N);if(Z)P.sort();if(P.length===0){H(D,`<${L}${R}/>`);return}H(D,`<${L}${R}>`);for(let y of P)_(D9.parseTagName(y).safe,N[y],D+1,y);H(D,`</${L}>`)}finally{K.delete(q)}}}}var D9={escapeText(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeAttribute(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},parseTagName(X){let Q=X,Y=X;if(!/^[A-Za-z_]/.test(Y))Y="_"+Y;if(Y=Y.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(Y))Y="_"+Y;return{safe:Y,changed:Y!==Q}},tagInfo(X,Q){let{changed:Y,safe:J}=D9.parseTagName(X),G=Y||Q&&Q!==X?` data-name="${D9.escapeAttribute(Q??X)}"`:"";return{safe:J,attrs:G}}};function Mr(X){switch(X._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}var Ar=_Z(Mr);function wM(X,Q,Y){switch(X._tag){case"Declaration":{let J=X.annotations?.toCodecJson??X.annotations?.toCodec;if(Y8(J)){let $=g8(X)?X.typeParameters.map((K)=>T(Q(J1(K)))):[],G=J($),Z=Q(G.to);return D0(X,Z===G.to?[G]:[new B0(Z,G.transformation)])}return Y(X)}case"Null":return D0(X,[wr]);case"Boolean":return D0(X,[Cr]);case"Unknown":case"ObjectKeyword":return D0(X,[$z]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return X.toCodecStringTree();case"Objects":{if(X.propertySignatures.some((J)=>typeof J.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:X});return X.recur(Q)}case"Union":{let J=Ar(X.types);if(J!==X.types)return new g1(J,X.mode,X.annotations,X.checks,X.encoding,X.context).recur(Q);return X.recur(Q)}case"Arrays":case"Suspend":return X.recur(Q)}return X}var wr=new B0(new b1("null"),new K0(n(()=>null),n(()=>"null"))),Cr=new B0(new g1([new b1("true"),new b1("false")],"anyOf"),new K0(n((X)=>X==="true"),y6())),CM=u6((X)=>{let Q=wM(X,CM,(Y)=>D0(Y,[Tr]));if(Q!==X&&E0(X))return t5(Q);return Q}),Tr=new B0(yG,new K0(T1(),n(()=>{return}))),TM=u6((X)=>{let Q=wM(X,TM,b);if(Q!==X&&E0(X))return t5(Q);return Q}),KN="~effect/Schema/SERIALIZER_ENSURE_ARRAY",IM=u6((X)=>{if(yY(X)&&X.annotations?.[KN])return X;let Q=Ir(X);if(kY(Q)){let Y=new g1([Q,rY(p6,Q,new K0(MU(),T1()))],"anyOf",{[KN]:!0});return E0(X)?lY(Y):Y}return Q});function Ir(X){switch(X._tag){default:return X;case"Declaration":case"Arrays":case"Objects":case"Union":case"Suspend":return X.recur(IM)}}function jr(X){let Q=NM(X);return uz(X2(Q),eY(Q))}function Er(X){return q2()}function Sr(X){return q2()}function vr(X,Q){return(Y)=>{return T(f6(Y.ast,{toCodecIso:()=>new B0(X.ast,jY(Q))}),{schema:Y})}}function xr(X){let Q=PM(X),Y=X2(Q),J=eY(Q);return{empty:[],diff:($,G)=>Z2(Y($),Y(G)),combine:($,G)=>[...$,...G],patch:($,G)=>{let Z=Y($),K=mz(G,Z);return Object.is(K,Z)?$:J(K)}}}function kr(X){let Q=RN(()=>Y),Y=o0([X,c0(Q),zN(r,Q)]);return Y}var yr=T(nY),br=T(Qz);function gr(X){return U8(X.ast)}function hr(X){return X.ast.context?.annotations}var cM=O(hM(),1),or=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],nr=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],fM=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),uM=new Set([";","&&","||","|","|&","&"]),lM=(X)=>typeof X==="string",F4=(X)=>{if(typeof X==="object"&&"op"in X&&typeof X.op==="string")return X.op;return null},ir=(X)=>typeof X==="object"&&("comment"in X),ar=(X)=>{try{let Q=[...new Bun.Glob(X).scanSync({onlyFiles:!1,dot:!0})];if(Q.length>0)return Q}catch{}return[X]},sr=(X)=>{if(lM(X))return[X];if(typeof X==="object"&&"op"in X&&X.op==="glob"&&"pattern"in X)return ar(String(X.pattern));let Q=F4(X);if(Q!==null){if(fM.has(Q)||uM.has(Q))return[];return[`__op_${Q}__`]}if(ir(X))return[];return["__tripwire_cmd_sub__"]},mM=(X,Q)=>{let Y=[],J=[],$=[],G=[],Z=0;while(Z<X.length){let K=X[Z],W=F4(K);if(W!==null&&fM.has(W)){let H=Y.at(-1);if(H!==void 0&&/^[0-9]+$/.test(H)&&Q.remaining>0)Y.pop(),Q.remaining--;let _=X[Z+1];if(_!==void 0&&lM(_)){G.push({op:W,target:_}),Z+=2;continue}Z++;continue}for(let H of sr(K))Y.push(H);Z++}if(Y.length===0)return null;for(let K=1;K<Y.length;K++){let W=Y[K];if(W.startsWith("-")&&W!=="-")$.push(W);else J.push(W)}return{head:Y[0],tokens:Y,args:J,flags:$,redirects:G,raw:Y.join(" ")}},tr=(X)=>`$${X}`,er=(X)=>{let Q=[];for(let Y=0;Y<X.length;Y++){let J=X[Y],$=X[Y+1];if(F4(J)==="&"&&$!==void 0&&(F4($)===">"||F4($)===">>")){let G={op:F4($)===">"?"&>":"&>>"};Q.push(G),Y++;continue}if(F4(J)===">"&&$!==void 0&&F4($)==="|"){Q.push({op:">"}),Y++;continue}Q.push(J)}return Q},Xo=(X)=>{return X.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0},VW=(X)=>{let Q=/<<-?\s*(?:"([^"]+)"|'([^']+)'|([A-Za-z_][A-Za-z0-9_]*))/u.exec(X);return Q?.[1]??Q?.[2]??Q?.[3]??null},Qo=/(?:^|[|;&]\s*)(?:\/(?:usr\/bin|bin|usr\/local\/bin|opt\/homebrew\/bin)\/)?(?:sh|bash|zsh|dash|ksh|ash)(?:\s|$)/u,_W=(X)=>Qo.test(X),rM=(X)=>{let Q=X.split(`
67
- `),Y=[];for(let J=0;J<Q.length;J++){let $=Q[J];Y.push($);let G=VW($);if(G===null||_W($))continue;J++;while(J<Q.length&&Q[J].trim()!==G)J++;if(J<Q.length)Y.push("__HEREDOC_BODY__"),Y.push(Q[J])}return Y.join(`
68
- `)},oM=(X)=>{let Q=new Map,Y=X.split(`
69
- `);for(let J=0;J<Y.length;J++){let $=Y[J],G=VW($);if(G===null||_W($))continue;let Z=[];J++;while(J<Y.length&&Y[J].trim()!==G)Z.push(Y[J]),J++;if(!Q.has(G))Q.set(G,Z.join(`
70
- `))}return Q},Yo=(X)=>{let Q=X.split(`
71
- `),Y=[];for(let J=0;J<Q.length;J++){let $=Q[J],G=VW($);if(G===null||!_W($))continue;let Z=[];J++;while(J<Q.length&&Q[J].trim()!==G)Z.push(Q[J]),J++;if(Z.length>0)Y.push(Z.join(`
72
- `))}return Y},Jo=(X,Q)=>{for(let Y=Q;Y<X.length;Y++){let J=X[Y];if(J==="\\"){Y++;continue}if(J==="`")return Y}return null},$o=(X,Q)=>{let Y=1,J=null;for(let $=Q;$<X.length;$++){let G=X[$];if(G==="\\"){$++;continue}if(J==="single"){if(G==="'")J=null;continue}if(G==="'"){J??="single";continue}if(G==='"'){J=J==="double"?null:"double";continue}if(G==="("){Y++;continue}if(G===")"){if(Y--,Y===0)return $}}return null},Go=(X)=>{let Q=[],Y=null;for(let J=0;J<X.length;J++){let $=X[J];if($==="\\"){J++;continue}if(Y==="single"){if($==="'")Y=null;continue}if($==="'"){Y??="single";continue}if($==='"'){Y=Y==="double"?null:"double";continue}if($==="`"){let H=Jo(X,J+1);if(H!==null)Q.push(X.slice(J+1,H)),J=H;continue}let G=X[J+1];if(!($==="$"&&G==="(")&&!(Y===null&&($==="<"||$===">")&&G==="("))continue;let W=$o(X,J+2);if(W!==null)Q.push(X.slice(J+2,W)),J=W}return Q},nM=/^\$\{?HOME\}?(?:\/|$)/,iM=(X)=>{if(X===""||X==="-")return!1;if(X==="/"||X==="~"||X==="."||X==="..")return!0;if(X.startsWith("/")||X.startsWith("~")||X.startsWith("./")||X.startsWith("../")||nM.test(X))return!0;return!1},t2=(X)=>{if(X==="/")return 100;if(X==="~"||nM.test(X))return 90;if(/^\/(etc|usr|bin|sbin|System|Library|var|boot|root|home)(\/|$)/.test(X))return 80;if(X.startsWith("/Users/"))return 70;if(X.startsWith("/")||X.startsWith("~"))return 60;if(X.startsWith("../"))return 40;if(X===".."||X==="."||X.startsWith("./"))return 10;return 50},Zo=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),Ko=(X,Q)=>{let Y=[],J=1;while(J<Q){let $=X[J];if(Zo.has($)){J+=2;continue}if($.startsWith("-")){J++;continue}if(iM($))Y.push($);J++}if(Y.length===0)return".";return Y.sort(($,G)=>t2(G)-t2($)),Y[0]},Wo=(X,Q)=>{let Y=[];for(let J=1;J<Q;J++){let $=X[J];if($.startsWith("-"))break;if(iM($))Y.push($)}if(Y.length===0)return".";return Y.sort((J,$)=>t2($)-t2(J)),Y[0]},pM={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:Ko},dM={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:Wo},Ho=Object.assign(Object.create(null),{fd:pM,fdfind:pM,find:dM,gfind:dM}),Vo=(X,Q,Y)=>X.map((J)=>Q.placeholders.has(J)?Y:J),_o=(X)=>{let Q=Ho[X.head];if(Q===void 0)return[];let Y=[],J=X.tokens;for(let $=1;$<J.length;$++){if(!Q.execFlags.has(J[$]))continue;let G=[],Z=$+1;while(Z<J.length){let H=J[Z];if(H===";"||H==="+")break;G.push(H),Z++}if(G.length===0)continue;let K=G[0];if(Q.placeholders.has(K))continue;let W=Q.pickRoot(J,$);Y.push(Vo(G,Q,W).join(" ")),$=Z}return Y},qo=/\$\(\s*cat\s+<<-?\s*['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\s*\1\s*\)/u,Do=/\$\(\s*(?:printf|echo)\s+(?:-[a-zA-Z]+\s+)*'([^']*)'/u,e2=(X,Q)=>{let Y=qo.exec(X);if(Y!==null){let $=Y[2]??X;if(Q!==void 0&&$.trim()==="__HEREDOC_BODY__"){let G=Y[1],Z=G===void 0?void 0:Q.get(G);if(Z!==void 0)return Z}return $}let J=Do.exec(X);if(J!==null)return J[1]??X;return X},Bo=new Set(["sh","bash","zsh","dash","ksh","ash","/bin/sh","/bin/bash","/bin/zsh","/bin/dash","/bin/ksh","/usr/bin/sh","/usr/bin/bash","/usr/bin/zsh","/usr/local/bin/bash","/opt/homebrew/bin/bash"]),Uo=(X)=>{if(!Bo.has(X.head))return[];let Q=X.tokens;for(let Y=1;Y<Q.length;Y++){let J=Q[Y];if(J==="-c"&&Y+1<Q.length)return[Q[Y+1]];if(J.startsWith("-")&&!J.startsWith("--")&&J.endsWith("c")&&J.length>2&&Y+1<Q.length)return[Q[Y+1]]}return[]},Oo=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","script","taskset"]),zo={command:new Set,env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),script:new Set(["-c","--command"]),taskset:new Set},Fo=(X)=>/^[A-Za-z_][A-Za-z0-9_]*=.*/u.test(X),Lo=(X)=>{let Q=X[0],Y=zo[Q]??new Set,J=1;while(J<X.length){let $=X[J];if(Q==="env"&&Fo($)){J++;continue}if(Y.has($)){J+=2;continue}if($.includes("=")&&Y.has($.slice(0,$.indexOf("=")))){J++;continue}if($.startsWith("--")&&$!=="--"){J++;continue}if($.startsWith("-")&&$!=="-"){J++;continue}break}return J},Po=(X)=>{if(!Oo.has(X.head))return[];if(X.head==="script")for(let J=1;J<X.tokens.length-1;J++){let $=X.tokens[J];if($==="-c"||$==="--command")return[X.tokens[J+1]];if($.startsWith("--command="))return[$.slice(10)]}let Q=Lo(X.tokens),Y=X.tokens.slice(Q).join(" ");return Y===""?[]:[Y]},Ro=new Set(["eval"]),No=(X)=>{if(!Ro.has(X.head))return[];let Q=X.tokens.slice(1).join(" ");return Q===""?[]:[Q]},L4=(X)=>{let Q,Y=rM(X);try{Q=cM.parse(Y,tr)}catch{return[]}Q=er(Q);let J={remaining:Xo(Y)},$=[],G=[];for(let W of Q){let H=F4(W);if(H!==null&&uM.has(H)){let _=mM(G,J);if(_!==null)$.push(_);G=[];continue}G.push(W)}let Z=mM(G,J);if(Z!==null)$.push(Z);for(let W of[...Go(X),...Yo(X)])for(let H of L4(W))$.push(H);let K=$.length;for(let W=0;W<K;W++){let H=$[W];for(let _ of _o(H))for(let V of L4(_))$.push(V);for(let _ of Uo(H))for(let V of L4(_))$.push(V);for(let _ of Po(H))for(let V of L4(_))$.push(V);for(let _ of No(H))for(let V of L4(_))$.push(V)}return $},Mo=(X)=>X.startsWith("./")?X.slice(2):X,qW=(X,Q=[],Y=[])=>{if(X==="")return!1;let J=Mo(X);if(J===".."||J.startsWith("../")||J.includes("/../"))return!1;for(let $ of[...nr,...Y])if(J===$||J.startsWith(`${$}/`))return!0;for(let $ of[...or,...Q])if(J===$||J.startsWith(`${$}/`))return!0;return!1},aM=(X=[],Q=[])=>{let Y={"build outputs":["dist","build","_build","out","target"],"js framework outputs":[".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless"],"tests / coverage":["coverage",".nyc_output"],caches:[".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox"],"language / package":["__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target"],"tmp / state":["tmp",".tmp",".state","/tmp","/var/tmp","/var/folders"],iac:[".terraform"],"bundler dev":[".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"]};if(X.length>0)Y["custom relative"]=X;if(Q.length>0)Y["custom absolute"]=Q;return Object.entries(Y).map(([J,$])=>` ${J}: ${$.join(", ")}`).join(`
73
- `)},V1=(X)=>/(^|\s)#\s*tripwire-allow\b/.test(rM(X));var F9=require("fs"),tM=require("os");var sM=w.Struct({pattern:w.String,message:w.String,action:w.optional(w.Union([w.Literal("deny"),w.Literal("ask")])),requiresFlags:w.optional(w.Array(w.String)),forbidsFlagValues:w.optional(w.Array(w.Struct({flag:w.String,values:w.Array(w.String)})))}),Ao=w.Struct({enabled:w.optional(w.Boolean),path:w.optional(w.String)}),wo=w.Struct({protectedBranches:w.optional(w.Array(w.String)),enforceConventionalCommits:w.optional(w.Boolean)}),Co=w.Struct({relative:w.optional(w.Array(w.String)),absolute:w.optional(w.Array(w.String))}),To=w.Struct({rtk:w.optional(Ao),git:w.optional(wo),safePaths:w.optional(Co),blockedCommands:w.optional(w.Array(sM)),allowedCommands:w.optional(w.Array(sM))}),eM=`${tM.homedir()}/.config/tripwire/config.json`,Io=()=>U0.sync(()=>{try{return F9.accessSync(eM,F9.constants.R_OK),!0}catch{return!1}}),jo=()=>U0.try({try:()=>F9.readFileSync(eM,"utf8"),catch:(X)=>X}),Eo=(X)=>U0.try({try:()=>JSON.parse(X),catch:(Q)=>Q}),So=(X)=>w.decodeUnknownEffect(To)(X),P4=()=>({rtk:{enabled:!1},git:{protectedBranches:["main","master","develop","production","release"],enforceConventionalCommits:!0},safePaths:{},blockedCommands:[],allowedCommands:[]}),DW=(X)=>({rtk:X.rtk??P4().rtk,git:X.git??P4().git,safePaths:X.safePaths??P4().safePaths,blockedCommands:X.blockedCommands??P4().blockedCommands,allowedCommands:X.allowedCommands??P4().allowedCommands}),XA=()=>U0.gen(function*(){if(!(yield*Io()))return P4();let Q=yield*jo(),Y=yield*Eo(Q),J=yield*So(Y);return DW(J)}).pipe(U0.timeout(1000),U0.catch(()=>{return console.error("[tripwire] Config loading failed, using defaults"),U0.succeed(P4())}));var QA={allow:0,warn:1,ask:2,deny:3},I=(X)=>({kind:"allow",rule:X,message:""}),Q6=(X,Q)=>({kind:"warn",rule:X,message:Q}),n0=(X,Q)=>({kind:"ask",rule:X,message:Q}),p=(X,Q)=>({kind:"deny",rule:X,message:Q}),BW=(X)=>{let Q=I("none"),Y;for(let J of X){if(QA[J.kind]>QA[Q.kind])Q=J;if(Y===void 0&&J.rewriteCommand!==void 0)Y=J.rewriteCommand}if(Y!==void 0&&Q.rewriteCommand===void 0)return{...Q,rewriteCommand:Y};return Q};var YA=w.Struct({hook_event_name:w.String,tool_name:w.optional(w.String),tool_input:w.optional(w.Unknown),tool_response:w.optional(w.Unknown),cwd:w.optional(w.String),session_id:w.optional(w.String),turn_id:w.optional(w.String),tool_use_id:w.optional(w.String)}),JA=(X)=>typeof X==="object"&&X!==null&&typeof X.command==="string",$A=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string"&&typeof X.old_string==="string"&&typeof X.new_string==="string",GA=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string"&&typeof X.content==="string",ZA=(X)=>typeof X==="object"&&X!==null&&typeof X.file_path==="string",KA=(X,Q)=>{if(typeof Q!=="object"||Q===null)return"";if(X==="Bash"){let Y=Q;return[Y.stdout??"",Y.stderr??""].filter((J)=>J.length>0).join(`
74
- `)}if(X==="Read"){let Y=Q;return Y.content??Y.file?.content??""}if(typeof Q.content==="string")return Q.content??"";return""};var X3=require("fs"),WA=require("os"),HA=require("path"),VA=`${WA.homedir()}/.claude/tripwire.log`;try{X3.mkdirSync(HA.dirname(VA),{recursive:!0})}catch{}var TQ=(X,Q)=>{let Y=new Date().toISOString(),J=Q instanceof Error?Q.stack??Q.message:String(Q);try{X3.appendFileSync(VA,`[${Y}] [${X}] ${J}
75
- `)}catch{}};var Q3=require("child_process"),vo=(X)=>{if(X.path!==void 0)return X.path;let Y=["/opt/homebrew/bin/rtk","/usr/local/bin/rtk",`${process.env.HOME??""}/.local/bin/rtk`];for(let J of Y)try{return Q3.spawnSync("test",["-x",J],{stdio:"ignore"}),J}catch{continue}try{let J=Q3.spawnSync("which",["rtk"],{stdio:"pipe"});if(J.status===0){let $=J.stdout;if($!==null){let G=String($).trim();if(G.length>0)return G}}}catch{}return null},_A=(X,Q,Y=2000)=>{if(!Q.enabled)return{};let J=vo(Q);if(J===null)return{};let $=JSON.stringify(X),G=Q3.spawnSync(J,["hook","claude"],{input:$,encoding:"utf8",timeout:Y,maxBuffer:1048576});if(G.error!==void 0||typeof G.stdout!=="string")return{};try{let Z=JSON.parse(G.stdout),K=Z.hookSpecificOutput?.updatedInput?.command,W=Z.hookSpecificOutput?.permissionDecisionReason;if(typeof K!=="string")return{};if(typeof W==="string")return{updatedCommand:K,reason:W};return{updatedCommand:K}}catch{return{}}};var xo=(X)=>X.tokens.slice(1).join(" "),qA=(X,...Q)=>X.flags.some((Y)=>Q.includes(Y)),ko=[{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(X)=>X.head==="rm"&&qA(X,"-rf","-fr","-Rf","-fR")&&X.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(X)=>X.head==="rm"&&qA(X,"-rf","-fr","-Rf","-fR")&&X.tokens.some((Q)=>/^(~|\$HOME|\$\{HOME\})$/.test(Q))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(X,Q)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/.test(Q)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(X)=>(X.head==="source"||X.head===".")&&X.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(X)=>X.head==="dd"&&/\bof=\/dev\/(disk|sd|nvme|rdisk)/i.test(xo(X))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(X)=>/^mkfs(\.[a-z0-9]+)?$/i.test(X.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(X)=>X.head==="kill"&&X.tokens.includes("-9")&&X.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(X)=>X.head==="chmod"&&X.flags.some((Q)=>Q.includes("R"))&&X.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(X)=>X.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(X,Q)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/.test(Q)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(X)=>X.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(X)=>["shutdown","reboot","halt","poweroff"].includes(X.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(X)=>X.head==="launchctl"&&typeof X.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(X.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(X)=>X.head==="defaults"&&X.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(X)=>X.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(X)=>X.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(X)=>X.head==="diskutil"&&typeof X.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(X.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(X)=>X.head==="tmutil"&&typeof X.tokens[1]==="string"&&["delete","disablelocal"].includes(X.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with Sean what you want done before running it.",match:(X)=>X.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(X)=>X.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(X)=>X.head==="rsync"&&X.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(X)=>X.head==="softwareupdate"&&X.flags.some((Q)=>Q==="--install"||Q==="-i"||Q==="-d"||Q.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need Sean.",match:(X)=>X.head==="pmset"&&X.tokens.length>1&&!X.tokens.includes("-g")&&!X.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(X)=>X.head==="dscl"&&X.tokens.some((Q)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(Q))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(X)=>X.head==="xattr"&&X.tokens.includes("-d")&&X.tokens.some((Q)=>Q.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(X)=>X.head==="spctl"&&X.flags.some((Q)=>Q==="--master-disable"||Q==="--global-disable"||Q==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 Sean handles this manually.",match:(X)=>X.head==="kextload"||X.head==="kextunload"||X.head==="kmutil"&&(X.tokens[1]==="load"||X.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(X)=>X.head==="security"&&typeof X.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(X.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(X)=>X.head==="security"&&typeof X.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(X.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(X)=>X.head==="systemsetup"&&X.tokens.some((Q)=>Q.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(X)=>X.head==="scutil"&&X.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(X)=>X.head==="brew"&&typeof X.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(X.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(X)=>X.head==="mas"&&typeof X.tokens[1]==="string"&&["install","uninstall","purchase"].includes(X.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(X)=>X.head==="gh"&&typeof X.tokens[1]==="string"&&typeof X.tokens[2]==="string"&&["repo","release","issue","pr"].includes(X.tokens[1])&&["delete","destroy","remove"].includes(X.tokens[2])},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(X)=>X.head==="flyctl"&&X.tokens.some((Q)=>Q==="destroy"||Q==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(X)=>X.head==="gcloud"&&X.tokens.includes("delete")}],yo=new Set(["rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign"]),DA=(X,Q)=>{let Y=V1(Q);for(let J of X)for(let $ of ko){if(!$.match(J,Q))continue;if(Y&&!yo.has($.rule))continue;return $.action==="deny"?p($.rule,$.message):n0($.rule,$.message)}return I("bash-deny")};var bo=["main","master","develop","production","release"],UW=(X)=>X.protectedBranches??bo,go=/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w./\- ]+\))?!?:\s+\S/,ho=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),mo=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),po=(X)=>{if(X.head!=="git")return null;let Q=X.tokens.slice(1),Y=0;while(Y<Q.length){let J=Q[Y];if(ho.has(J)){Y+=2;continue}if(mo.has(J)){Y++;continue}if(J.startsWith("--git-dir=")||J.startsWith("--work-tree=")||J.startsWith("--namespace=")||J.startsWith("--super-prefix=")||J.startsWith("--exec-path=")){Y++;continue}if(J.startsWith("-")){Y++;continue}return{subcommand:J,subArgs:Q.slice(Y+1)}}return null},co=(X,Q)=>{for(let Y=0;Y<X.length;Y++){let J=X[Y];if(J==="-m"||J==="--message"){let $=X[Y+1];return $===void 0?null:e2($,Q)}if(J.startsWith("--message="))return e2(J.slice(10),Q);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(J)){let $=X[Y+1];return $===void 0?null:e2($,Q)}}return null},fo=(X,Q)=>{let Y=UW(Q);for(let J of X)for(let $ of Y)if(J===$||J.endsWith(`:${$}`)||J.endsWith(`/${$}`))return $;return null},uo=(X)=>X.filter((Q)=>!Q.startsWith("-")),lo=(X)=>X.filter((Q)=>Q.startsWith("-")),h0=(X,...Q)=>Q.some((Y)=>X.includes(Y)),ro=({subArgs:X,positional:Q})=>{if(h0(X,"--global","--system"))return p("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!h0(X,"--get","-l","--list","--get-all","--get-regexp")&&Q.length>=2)return p("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return I("bash-git")},oo=({subArgs:X})=>{if(h0(X,"--cached"))return I("bash-git");return n0("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},no=({subArgs:X,positional:Q})=>{if(h0(X,"--staged","-S")&&!h0(X,"--worktree","-W"))return I("bash-git");if(Q.length>0)return p("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return I("bash-git")},io=({subArgs:X,positional:Q})=>{if(h0(X,"-b","-B"))return I("bash-git");if(h0(X,"-f","--force"))return p("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(X.includes("--"))return p("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");if(Q.length===1&&(Q[0]==="."||Q[0].startsWith("./")))return p("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return I("bash-git")},ao=({subArgs:X})=>{if(h0(X,"-f","--force","--discard-changes"))return p("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return I("bash-git")},so=({subArgs:X,flags:Q,positional:Y})=>{if(h0(X,"--hard"))return p("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(h0(X,"--keep"))return n0("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(Y.length===0&&Q.length===0)return I("bash-git");return n0("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},to=({flags:X})=>{if(X.some((Q)=>/^-[a-zA-Z]*[df]/.test(Q)||Q==="--force"))return p("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return I("bash-git")},eo=({subArgs:X,positional:Q,config:Y})=>{if(h0(X,"--abort","--quit","--continue","--skip","--edit-todo"))return I("bash-git");if(h0(X,"-i","--interactive"))return p("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let J=Q[0],$=UW(Y);if(J!==void 0&&$.includes(J))return n0("git-rebase-onto-protected",`Rebasing onto \`${J}\` rewrites history of the current branch. \`git merge ${J}\` is usually safer. Confirm intent.`);return n0("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},Xn=({subArgs:X})=>{if(h0(X,"--abort","--quit","--continue","--skip"))return I("bash-git");return n0("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},Qn=({subArgs:X})=>{if(h0(X,"--abort","--continue","--quit"))return I("bash-git");return n0("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Yn=({subArgs:X,config:Q,heredocBodies:Y})=>{if(h0(X,"--amend"))return p("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let J=co(X,Y),$=h0(X,"-F","--file","-c","-C","--reuse-message","--reedit-message"),G=h0(X,"--no-edit");if(J===null&&!$&&!G)return p("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(J!==null&&Q.enforceConventionalCommits!==!1&&!go.test(J))return p("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify(J)}`].join(`
76
- `));if(h0(X,"-a","--all")||X.some((Z)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(Z)))return n0("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return I("bash-git")},Jn=({subArgs:X,flags:Q,positional:Y,config:J})=>{if(Q.some((G)=>G==="--force"||G==="-f"||G.startsWith("--force-with-lease")))return p("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(h0(X,"--delete","--mirror")||X.some((G)=>G.startsWith(":")))return p("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let $=fo(Y,J);if($!==null)return p("git-push-protected",`Refusing to push directly to protected branch \`${$}\`. Open a PR instead: \`gh pr create\`.`);return I("bash-git")},$n=({subArgs:X,flags:Q,positional:Y,config:J})=>{let $=Q.find((G)=>G==="-D"||G==="-d"||G==="--delete"||/^-[a-zA-Z]*D/.test(G)||/^-[a-zA-Z]*d/.test(G));if($!==void 0){let G=Y,Z=UW(J),K=G.find((W)=>Z.includes(W));if(K!==void 0)return p("git-branch-delete-protected",`Refusing to delete protected branch \`${K}\`.`);if($==="-D"||$.includes("D"))return p("git-branch-force-delete",`\`git branch -D ${G.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return n0("git-branch-delete",`\`git branch -d ${G.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(h0(X,"-m","-M","--move"))return n0("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return I("bash-git")},Gn=({subArgs:X})=>{if(h0(X,"-d","--delete"))return p("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return I("bash-git")},Zn=({subArgs:X})=>{let Q=X[0]??"push";if(Q==="drop"||Q==="clear")return p("git-stash-drop",`\`git stash ${Q}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return I("bash-git")},Kn=({flags:X})=>{if(X.some((Q)=>Q.startsWith("--prune=")||Q==="--aggressive"))return p("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return I("bash-git")},Wn=({subArgs:X})=>{let Q=X[0];if(Q==="add"||Q==="remove"||Q==="rm"||Q==="set-url"||Q==="rename")return n0("git-remote-mutate",`\`git remote ${Q}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return I("bash-git")},BA=({subcommand:X,subArgs:Q})=>{let Y=Q[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(Y))return n0("git-submodule-worktree-mutate",`\`git ${X} ${Y}\` modifies repo structure. Confirm intent.`);return I("bash-git")},Hn=new Map([["config",ro],["add",()=>I("bash-git")],["mv",()=>I("bash-git")],["rm",oo],["restore",no],["checkout",io],["switch",ao],["reset",so],["clean",to],["rebase",eo],["cherry-pick",Xn],["merge",Qn],["commit",Yn],["push",Jn],["branch",$n],["tag",Gn],["stash",Zn],["filter-branch",({subcommand:X})=>p("git-filter",`\`git ${X}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:X})=>p("git-filter",`\`git ${X}\` rewrites entire repo history. Refuse.`)],["gc",Kn],["update-ref",()=>p("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",Wn],["submodule",BA],["worktree",BA],["init",({subcommand:X})=>Q6(`git-${X}`,`\`git ${X}\` is allowed but unusual mid-session. Make sure this is what Sean asked for.`)],["clone",({subcommand:X})=>Q6(`git-${X}`,`\`git ${X}\` is allowed but unusual mid-session. Make sure this is what Sean asked for.`)]]),Vn=(X,Q,Y)=>{let{subcommand:J,subArgs:$}=X,G=lo($),Z=uo($);if(new Set(["status","diff","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]).has(J)){if(J==="reflog"&&($[0]==="expire"||h0($,"--expire")))return p("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(J==="symbolic-ref"&&Z.length>=2)return p("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return I("bash-git")}let W=Hn.get(J);if(W!==void 0)return W({subcommand:J,subArgs:$,flags:G,positional:Z,config:Q,heredocBodies:Y});return Q6("git-unknown-subcommand",`\`git ${J}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},UA=(X,Q,Y)=>{if(V1(Q))return I("bash-git");let J=oM(Q);for(let $ of X){let G=po($);if(G===null)continue;let Z=Vn(G,Y,J);if(Z!==null&&Z.kind!=="allow")return Z}return I("bash-git")};var _n=new Set(["curl","wget","wget2","aria2c","xh"]),qn=new Set(["bash","sh","zsh","fish"]),Dn=(X)=>{for(let Q=0;Q<X.length-1;Q++){let Y=X[Q],J=X[Q+1];if(_n.has(Y.head)&&qn.has(J.head))return!0}return!1},Bn=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}],OA=(X,Q)=>{if(V1(Q))return I("bash-network-install");if(Dn(X))return p("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to Sean what you're running).");for(let Y of X)for(let J of Bn)if(Y.head===J.head&&Y.tokens[1]===J.subcommand)return n0(J.rule,J.message);return I("bash-network-install")};var Un=[{rule:"redirect-env",pattern:/(^|\/)\.env(\.[^/]+)?$/,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(^|\/)\.dev\.vars(\.[^/]+)?$/,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(^|\/)\.ssh\//,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(pem|key|p12|pfx)$/i,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(^|\/)\.aws\/credentials$/,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(^|\/)\.netrc$/,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(sd|disk|nvme|rdisk)/i,message:"Redirecting into a raw block device wipes the disk. Refuse."}],OW=(X)=>{for(let Q of Un)if(Q.pattern.test(X))return p(Q.rule,Q.message);return null},zA=(X,Q)=>{if(V1(Q))return I("bash-redirect");for(let Y of X){for(let J of Y.redirects)if(J.op===">"||J.op===">>"){let $=OW(J.target);if($!==null)return $}if(Y.head==="tee")for(let J of Y.args){let $=OW(J);if($!==null)return $}if(Y.head==="cp"||Y.head==="mv"){let J=Y.args.at(-1);if(J!==void 0){let $=OW(J);if($!==null)return $}}}return I("bash-redirect")};var On=(X,Q)=>{let Y=!1,J=[];for(let Z of X.tokens.slice(1)){if(!Y&&Z==="--"){Y=!0;continue}if(!Y&&Z.startsWith("-")&&Z!=="-")continue;J.push(Z)}let $=Q.relative??[],G=Q.absolute??[];return J.filter((Z)=>!qW(Z,$,G))},zn=(X,Q)=>{if(!X.tokens.includes("-delete"))return null;let Y=[];for(let Z of X.tokens.slice(1)){if(Z.startsWith("-"))break;Y.push(Z)}let J=Y.length===0?["."]:Y,$=Q.relative??[],G=Q.absolute??[];return J.filter((Z)=>!qW(Z,$,G))},FA=(X,Q,Y)=>{if(V1(Q))return I("bash-scoped-rm");let J=[];for(let K of X){if(K.head==="rm"){let W=On(K,Y);if(W.length>0)J.push({kind:"rm",targets:W});continue}if(K.head==="find"){let W=zn(K,Y);if(W!==null&&W.length>0)J.push({kind:"find -delete",targets:W})}}if(J.length===0)return I("bash-scoped-rm");let $=Y.relative??[],G=Y.absolute??[],Z=J.map((K)=>` \u2022 ${K.kind} on: ${K.targets.map((W)=>JSON.stringify(W)).join(", ")}`).join(`
77
- `);return p("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use \`trash\` (macOS Trash, recoverable) or \`rip\` (graveyard at ~/.local/share/graveyard, recoverable) instead. Real \`rm\` and \`find -delete\` are allowed only inside ephemeral build / cache / state directories:
78
- ${aM($,G)}
61
+ }`}return Hd(G,{toString:{value:()=>Z(b0(X))},[R8]:{value:()=>Z(b0(X))},[D4]:{value:async()=>Z(await qK(X))},[r0]:{value:J,configurable:!0}})};return J()})}var{MIN_SAFE_INTEGER:qd,MAX_SAFE_INTEGER:Dd}=Number;function ZR(){return new V9(qd,Dd)}var Bd=Number.MAX_SAFE_INTEGER;function Ud(){return new V9(0,Bd)}var Od=Number.parseInt;function zd(Q){let[X,Y]=Q;switch(X){case"oct":return`0${WX(Y,8)}`;case"hex":return`0x${WX(Y,16)}`;default:return`${Y}`}}function U2(Q,X){let Y=Od(Q,X);if(WX(Y,X)!==Q)throw Error("Invalid value");return Y}function Fd(Q){if(typeof Q!=="string")throw Error("Invalid type");if(Q.length>=2&&Q[0]==="0"){if(Q[1]==="x")return["hex",U2(S0(Q,2),16)];return["oct",U2(S0(Q,1),8)]}return["dec",U2(Q,10)]}function Ld(Q){return w0(Q,".")}function Pd(Q){if(typeof Q!=="string")throw Error("Invalid type");return G0(P1(Q,"."),(X)=>U2(X,10))}function TK(){return Q0(a4(255),a4(255),a4(255),a4(255)).map(Ld,Pd)}function h8(Q){return Q0(m8("dec","oct","hex"),a4(Q)).map(zd,Fd)}function NZ(Q){return w0(Q,".")}function MZ(Q){if(typeof Q!=="string")throw Error("Invalid type");return P1(Q,".")}function KR(){return l0(Q0(h8(255),h8(255),h8(255),h8(255)).map(NZ,MZ),Q0(h8(255),h8(255),h8(65535)).map(NZ,MZ),Q0(h8(255),h8(16777215)).map(NZ,MZ),h8(4294967295))}function IK(Q){if(Q.length===0)return[];else return P1(Q,":")}function jK(Q){let X=P1(Q,":");if(X.length>=2&&X[X.length-1].length<=4)return[s0(X,0,X.length-2),`${X[X.length-2]}:${X[X.length-1]}`];return[s0(X,0,X.length-1),X[X.length-1]]}function Rd(Q){return`${w0(Q[0],":")}:${Q[1]}`}function Nd(Q){if(typeof Q!=="string")throw Error("Invalid type");return jK(Q)}function Md(Q){return`::${w0(Q[0],":")}:${Q[1]}`}function Ad(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!Jb(Q,"::"))throw Error("Invalid value");return jK(S0(Q,2))}function O2(Q){return`${w0(Q[0],":")}::${w0(Q[1],":")}:${Q[2]}`}function z2(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=P1(Q,"::",2),[J,$]=jK(Y);return[IK(X),J,$]}function wd(Q){return O2([Q[0],[Q[1]],Q[2]])}function Cd(Q){let X=z2(Q);return[X[0],w0(X[1],":"),X[2]]}function wL(Q){return`${w0(Q[0],":")}::${Q[1]}`}function CL(Q){if(typeof Q!=="string")throw Error("Invalid type");let[X,Y]=P1(Q,"::",2);return[IK(X),Y]}function Td(Q){return`${w0(Q[0],":")}::`}function Id(Q){if(typeof Q!=="string")throw Error("Invalid type");if(!$b(Q,"::"))throw Error("Invalid value");return[IK(S0(Q,0,Q.length-2))]}function jd([Q,X]){return`${Q}:${X}`}function Ed(Q){if(typeof Q!=="string")throw new S("Invalid type");if(!Q.includes(":"))throw new S("Invalid value");return Q.split(":",2)}var Sd="0123456789abcdef",AZ=void 0;function xd(){if(AZ===void 0)AZ=O0({min:0,max:15}).map((Q)=>Sd[Q],(Q)=>{if(typeof Q!=="string")throw new S("Not a string");if(Q.length!==1)throw new S("Invalid length");let X=W9(Q,0);if(X<=57)return X-48;if(X<97)throw new S("Invalid character");return X-87});return AZ}function WR(){let Q=d0({unit:xd(),minLength:1,maxLength:4,size:"max"}),X=l0(Q0(Q,Q).map(jd,Ed),TK());return l0(Q0(P0(Q,{minLength:6,maxLength:6,size:"max"}),X).map(Rd,Nd),Q0(P0(Q,{minLength:5,maxLength:5,size:"max"}),X).map(Md,Ad),Q0(P0(Q,{minLength:0,maxLength:1,size:"max"}),P0(Q,{minLength:4,maxLength:4,size:"max"}),X).map(O2,z2),Q0(P0(Q,{minLength:0,maxLength:2,size:"max"}),P0(Q,{minLength:3,maxLength:3,size:"max"}),X).map(O2,z2),Q0(P0(Q,{minLength:0,maxLength:3,size:"max"}),P0(Q,{minLength:2,maxLength:2,size:"max"}),X).map(O2,z2),Q0(P0(Q,{minLength:0,maxLength:4,size:"max"}),Q,X).map(wd,Cd),Q0(P0(Q,{minLength:0,maxLength:5,size:"max"}),X).map(wL,CL),Q0(P0(Q,{minLength:0,maxLength:6,size:"max"}),Q).map(wL,CL),Q0(P0(Q,{minLength:0,maxLength:7,size:"max"})).map(Td,Id))}var vd=class extends C0{constructor(Q){super();this.name=Q,this.underlying=null}generate(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.generate(Q,X)}canShrinkWithoutContext(Q){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.underlying===null)throw Error(`Lazy arbitrary ${JSON.stringify(this.name)} not correctly initialized`);return this.underlying.shrink(Q,X)}},kd=Object.getOwnPropertyNames;function yd(){let Q=new q4;return(Y)=>{let J=c1(Q,Y);if(J!==void 0)return J;return J=new vd(String(Y)),L8(Q,Y,J),J}}function HR(Q){let X=yd(),Y=Q(X),J=kd(Y);for(let $ of J){let G=X($);G.underlying=Y[$]}return Y}function bd(Q,X){for(let Y of Q){let J=X[Y]||{};if(J.maxLength===void 0||J.maxLength>0)return!0}return!1}function gd(Q,X){if(Q.length===0)return y0([]);if(!bd(Q,X))throw new S("Contraints on pool must accept at least one entity, maxLength cannot sum to 0");return Q0(...Q.map((Y)=>P0(y0(Y),X[Y]))).map((Y)=>xy(Y)).filter((Y)=>Y.length>0)}var{assign:TL,create:F2,defineProperty:VR,getPrototypeOf:IL,prototype:hd}=Object;function md(Q){return VR(F2(null),R8,{configurable:!1,enumerable:!1,writable:!1,value:()=>Q})}function jL(Q,X){return md(`<${L1(Q)}#${X}>`)}function dd(Q,X){let Y=F2(hd);for(let J in Q){let $=Q[J],G=[];for(let Z of $){let K=TL(F2(IL(Z)),Z);G.push(K)}Y[J]=G}for(let J in X){let $=X[J];for(let G=0;G!==$.length;++G){let Z=$[G],K=Y[J][G];for(let W in Z){let H=Z[W];K[W]=H.index===void 0?void 0:typeof H.index==="number"?Y[H.type][H.index]:G0(H.index,(_)=>Y[H.type][_])}VR(K,R8,{configurable:!1,enumerable:!1,writable:!1,value:()=>{let W=Q[J][G],H=TL(F2(IL(W)),W);for(let _ in Z){let V=Z[_];H[_]=V.index===void 0?void 0:typeof V.index==="number"?jL(V.type,V.index):G0(V.index,(q)=>jL(V.type,q))}return b0(H)}})}}return Y}function pd(Q){let X=0,Y=new q4;for(let $ in Q){let G=Q[$];for(let Z in G){let K=G[Z];if(K.arity!=="inverse")continue;let W=c1(Y,K.type);if(W===void 0)W=new q4,L8(Y,K.type,W);if(ry(W,K.forwardRelationship))throw new S(`Cannot declare multiple inverse relationships for the same forward relationship ${L1(K.forwardRelationship)} on type ${L1(K.type)}`);L8(W,K.forwardRelationship,{type:$,property:Z}),X+=1}}let J=new q4;if(X===0)return J;for(let $ in Q){let G=Q[$],Z=c1(Y,$);if(Z===void 0)continue;for(let K in G){let W=G[K];if(W.arity==="inverse")continue;let H=c1(Z,K);if(H===void 0)continue;if(H.type!==W.type)throw new S(`Inverse relationship ${L1(H.property)} on type ${L1(H.type)} references forward relationship ${L1(K)} but types do not match`);L8(J,W,H)}}if(J.size!==X)throw new S("Some inverse relationships could not be matched with their corresponding forward relationships");return J}var EL=Object.create;function cd(Q,X,Y){switch(Q){case"exclusive":return y0(Y);case"successor":return A2(O0({min:X!==void 0?X+1:0,max:Y}));case"any":return A2(O0({min:0,max:Y}))}}function fd(Q,X,Y,J,$,G,Z){let K=cd(X,Y,J);switch(Q){case"0-1":return B4(K,{nil:void 0,depthIdentifier:$}).generate(G,Z).value;case"1":return K.generate(G,Z).value;case"many":{let W=0,H=B4(e6(K,{depthIdentifier:$,selector:(V)=>V===J?V+ ++W:V,minLength:1}),{nil:[],depthIdentifier:$}).generate(G,Z).value,_=0;return G0(H,(V)=>V===J?V+_++:V)}}}var ud=class extends C0{constructor(Q,X){super();this.relations=Q,this.defaultEntities=X;let Y=new K9,J=new K9;for(let $ in Q){let G=Q[$];for(let Z in G){let K=G[Z];if(K.arity==="inverse")continue;if(K.strategy==="exclusive"){if(M2(Y,K.type))throw new S(`Cannot mix exclusive with other strategies for type ${L1(K.type)}`);KX(J,K.type)}else{if(M2(J,K.type))throw new S(`Cannot mix exclusive with other strategies for type ${L1(K.type)}`);KX(Y,K.type)}if(K.strategy==="successor"&&K.type!==$)throw new S("Cannot mix types for the strategy successor");if(K.strategy==="successor"&&K.arity==="1")throw new S("Cannot use an arity of 1 for the strategy successor")}}this.inversedRelations=pd(Q)}createEmptyLinksInstanceFor(Q){let X=EL(null),Y=this.relations[Q];for(let J in Y){let $=Y[J];if($.arity==="inverse")X[J]={type:$.type,index:[]}}return X}generate(Q,X){let Y=EL(null);for(let G in this.relations)Y[G]=[];let J=[];for(let G of this.defaultEntities)x(J,{type:G,indexInType:Y[G].length,depth:0}),x(Y[G],this.createEmptyLinksInstanceFor(G));let $=-1;while(++$<J.length){let G=J[$],Z=this.relations[G.type],K=Y[G.type][G.indexInType],W=OK();W.depth=G.depth;for(let H in Z){let _=Z[H];if(_.arity==="inverse")continue;let V=_.type,q=Y[V],D=q.length,U=fd(_.arity,_.strategy||"any",V===G.type?G.indexInType:void 0,q.length,W,Q,X);K[H]={type:V,index:U};let P=U===void 0?[]:typeof U==="number"?[U]:U;for(let L of P){if(L>=D)x(J,{type:V,indexInType:L,depth:G.depth+1}),x(q,this.createEmptyLinksInstanceFor(V));let M=c1(this.inversedRelations,_);if(M!==void 0){let w=q[L][M.property].index;x(w,G.indexInType)}}}}return J.length=0,new k(Y,void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function ld(Q,X){return new ud(Q,X)}var{keys:rd,getOwnPropertySymbols:od,getOwnPropertyDescriptor:nd}=Object;function id(Q){let X=rd(Q),Y=od(Q);for(let J=0;J!==Y.length;++J){let $=Y[J],G=nd(Q,$);if(G&&G.enumerable)X.push($)}return X}var{create:ad,defineProperty:sd,getOwnPropertyDescriptor:td,getOwnPropertyNames:ed,getOwnPropertySymbols:Qp}=Object;function Xp(Q,X){return function(J){let $=J[1]?ad(null):{};for(let G=0;G!==Q.length;++G){let Z=J[0][G];if(Z!==X)sd($,Q[G],{value:Z,configurable:!0,enumerable:!0,writable:!0})}return $}}function Yp(Q,X){return function(J){if(typeof J!=="object"||J===null)throw Error("Incompatible instance received: should be a non-null object");let $=Object.getPrototypeOf(J)===null,G="constructor"in J&&J.constructor===Object;if(!$&&!G)throw Error("Incompatible instance received: should be of exact type Object");let Z=0,K=[];for(let _=0;_!==Q.length;++_){let V=td(J,Q[_]);if(V!==void 0){if(!V.configurable||!V.enumerable||!V.writable)throw Error("Incompatible instance received: should contain only c/e/w properties");if(V.get!==void 0||V.set!==void 0)throw Error("Incompatible instance received: should contain only no get/set properties");++Z,x(K,V.value)}else x(K,X)}let W=ed(J).length,H=Qp(J).length;if(Z!==W+H)throw Error("Incompatible instance received: should not contain extra properties");return[K,$]}}var wZ=Symbol("no-key");function CZ(Q,X,Y){let J=id(Q),$=[];for(let G=0;G!==J.length;++G){let Z=J[G],K=Q[Z];if(X===void 0||V4(X,Z)!==-1)x($,K);else x($,B4(K,{nil:wZ}))}return Q0(Q0(...$),Y?y0(!1):DX()).map(Xp(J,wZ),Yp(J,wZ))}function QK(Q,X){let Y=X!==void 0&&!!X.noNullPrototype;if(X===void 0)return CZ(Q,void 0,Y);if(!(("requiredKeys"in X)&&X.requiredKeys!==void 0))return CZ(Q,void 0,Y);let J=("requiredKeys"in X?X.requiredKeys:void 0)||[];for(let $=0;$!==J.length;++$){let G=Object.getOwnPropertyDescriptor(Q,J[$]);if(G===void 0)throw Error("requiredKeys cannot reference keys that have not been defined in recordModel");if(!G.enumerable)throw Error("requiredKeys cannot reference keys that are not enumerable in recordModel")}return CZ(Q,J,Y)}var Jp=Object.create;function $p(Q,X,Y,J){let $=Jp(null);for(let G in Q){let Z=Q[G],K=QK(Z,J),W=X(G),H=Y(G),_={minLength:W,maxLength:W};$[G]=H!==void 0?e6(K,{..._,selector:H}):P0(K,_)}return QK($)}var{create:SL,keys:Gp}=Object;function Zp(Q,X,Y={}){let J=Gp(Q),$=Y.initialPoolConstraints||SL(null),G=Y.unicityConstraints||SL(null),Z={noNullPrototype:Y.noNullPrototype};return gd(J,$).chain((K)=>ld(X,K).chain((W)=>$p(Q,(H)=>W[H].length,(H)=>G[H],Z).map((H)=>dd(H,W))))}function Kp(Q){return w0(G0(Q,(X)=>X[X.length-1]===","?S0(X,0,X.length-1):X)," ")}function Wp(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");let J=[];for(let $ of P1(Y," "))if(Q.canShrinkWithoutContext($))x(J,$);else if(Q.canShrinkWithoutContext($+","))x(J,$+",");else throw Error("Unsupported word");return J}}function Hp(Q){let X=w0(Q," ");if(X[X.length-1]===",")X=S0(X,0,X.length-1);return KK(X[0])+S0(X,1)+"."}function Vp(Q){return function(Y){if(typeof Y!=="string")throw Error("Unsupported type");if(Y.length<2||Y[Y.length-1]!=="."||Y[Y.length-2]===","||KK(gZ(Y[0]))!==Y[0])throw Error("Unsupported value");let J=gZ(Y[0])+S0(Y,1,Y.length-1),$=[],G=P1(J," ");for(let Z=0;Z!==G.length;++Z){let K=G[Z];if(Q.canShrinkWithoutContext(K))x($,K);else if(Z===G.length-1&&Q.canShrinkWithoutContext(K+","))x($,K+",");else throw Error("Unsupported word")}return $}}function _p(Q){return w0(Q," ")}function qp(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=P1(Q,". ");for(let Y=0;Y<X.length-1;++Y)X[Y]+=".";return X}var z=(Q,X)=>{return{arbitrary:y0(Q),weight:X}};function Dp(){return l0(z("non",6),z("adipiscing",5),z("ligula",5),z("enim",5),z("pellentesque",5),z("in",5),z("augue",5),z("et",5),z("nulla",5),z("lorem",4),z("sit",4),z("sed",4),z("diam",4),z("fermentum",4),z("ut",4),z("eu",4),z("aliquam",4),z("mauris",4),z("vitae",4),z("felis",4),z("ipsum",3),z("dolor",3),z("amet,",3),z("elit",3),z("euismod",3),z("mi",3),z("orci",3),z("erat",3),z("praesent",3),z("egestas",3),z("leo",3),z("vel",3),z("sapien",3),z("integer",3),z("curabitur",3),z("convallis",3),z("purus",3),z("risus",2),z("suspendisse",2),z("lectus",2),z("nec,",2),z("ultricies",2),z("sed,",2),z("cras",2),z("elementum",2),z("ultrices",2),z("maecenas",2),z("massa,",2),z("varius",2),z("a,",2),z("semper",2),z("proin",2),z("nec",2),z("nisl",2),z("amet",2),z("duis",2),z("congue",2),z("libero",2),z("vestibulum",2),z("pede",2),z("blandit",2),z("sodales",2),z("ante",2),z("nibh",2),z("ac",2),z("aenean",2),z("massa",2),z("suscipit",2),z("sollicitudin",2),z("fusce",2),z("tempus",2),z("aliquam,",2),z("nunc",2),z("ullamcorper",2),z("rhoncus",2),z("metus",2),z("faucibus,",2),z("justo",2),z("magna",2),z("at",2),z("tincidunt",2),z("consectetur",1),z("tortor,",1),z("dignissim",1),z("congue,",1),z("non,",1),z("porttitor,",1),z("nonummy",1),z("molestie,",1),z("est",1),z("eleifend",1),z("mi,",1),z("arcu",1),z("scelerisque",1),z("vitae,",1),z("consequat",1),z("in,",1),z("pretium",1),z("volutpat",1),z("pharetra",1),z("tempor",1),z("bibendum",1),z("odio",1),z("dui",1),z("primis",1),z("faucibus",1),z("luctus",1),z("posuere",1),z("cubilia",1),z("curae,",1),z("hendrerit",1),z("velit",1),z("mauris,",1),z("gravida",1),z("ornare",1),z("ut,",1),z("pulvinar",1),z("varius,",1),z("turpis",1),z("nibh,",1),z("eros",1),z("id",1),z("aliquet",1),z("quis",1),z("lobortis",1),z("consectetuer",1),z("morbi",1),z("vehicula",1),z("tortor",1),z("tellus,",1),z("id,",1),z("eu,",1),z("quam",1),z("feugiat,",1),z("posuere,",1),z("iaculis",1),z("lectus,",1),z("tristique",1),z("mollis,",1),z("nisl,",1),z("vulputate",1),z("sem",1),z("vivamus",1),z("placerat",1),z("imperdiet",1),z("cursus",1),z("rutrum",1),z("iaculis,",1),z("augue,",1),z("lacus",1))}function Bp(Q={}){let{maxCount:X,mode:Y="words",size:J}=Q;if(X!==void 0&&X<1)throw Error("lorem has to produce at least one word/sentence");let $=Dp();if(Y==="sentences")return P0(P0($,{minLength:1,size:"small"}).map(Hp,Vp($)),{minLength:1,maxLength:X,size:J}).map(_p,qp);else return P0($,{minLength:1,maxLength:X,size:J}).map(Kp,Wp($))}function Up(Q){return new Map(Q)}function Op(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Map)throw Error("Incompatible instance received: should be of exact type Map");return Array.from(Q)}function zp(Q){return Q[0]}function XK(Q,X,Y={}){return e6(Q0(Q,X),{minLength:Y.minKeys,maxLength:Y.maxKeys,size:Y.size,selector:zp,depthIdentifier:Y.depthIdentifier,comparator:"SameValueZero"}).map(Up,Op)}var V2=10;function Fp(Q){let X={};return(Y)=>{let J=Y!==void 0?Y:V2;if(!DP(X,J)){let $=V2;V2=J-1,X[J]=Q(J),V2=$}return X[J]}}function Lp(Q){let X=0;while(Q>E(0)){if(Q&E(1))++X;Q>>=E(1)}return X}function Pp(Q,X){let Y=(E(1)<<E(X))-E(1),J=Q&Y,$=Lp(Q-J),G=J;for(let Z=E(1);Z<=Y&&$!==0;Z<<=E(1))if(!(G&Z))G|=Z,--$;return G}function _2(Q,X){let Y=[];for(let J=Q.length-1;J!==-1;--J)if(X(Q[J])!==Q[J])x(Y,J);return Y}function Rp(Q,X,Y){let J=E(0);for(let $=0,G=E(1);$!==Y.length;++$,G<<=E(1))if(Q[Y[$]]!==X[Y[$]])J|=G;return J}function TZ(Q,X,Y,J){for(let $=0,G=E(1);$!==Y.length;++$,G<<=E(1))if(X&G)Q[Y[$]]=J(Q[Y[$]])}var Np=class extends C0{constructor(Q,X,Y){super();this.stringArb=Q,this.toggleCase=X,this.untoggleAll=Y}buildContextFor(Q,X){return{rawString:Q.value,rawStringContext:Q.context,flags:X.value,flagsContext:X.context}}generate(Q,X){let Y=this.stringArb.generate(Q,X),J=[...Y.value],$=_2(J,this.toggleCase),G=e4(E(0),(E(1)<<E($.length))-E(1)).generate(Q,void 0);return TZ(J,G.value,$,this.toggleCase),new k(w0(J,""),this.buildContextFor(Y,G))}canShrinkWithoutContext(Q){if(typeof Q!=="string")return!1;return this.untoggleAll!==void 0?this.stringArb.canShrinkWithoutContext(this.untoggleAll(Q)):this.stringArb.canShrinkWithoutContext(Q)}shrink(Q,X){let Y;if(X!==void 0)Y=X;else if(this.untoggleAll!==void 0){let G=this.untoggleAll(Q),Z=[...Q],K=[...G];Y={rawString:G,rawStringContext:void 0,flags:Rp(K,Z,_2(K,this.toggleCase)),flagsContext:void 0}}else Y={rawString:Q,rawStringContext:void 0,flags:E(0),flagsContext:void 0};let{rawString:J,flags:$}=Y;return this.stringArb.shrink(J,Y.rawStringContext).map((G)=>{let Z=[...G.value],K=_2(Z,this.toggleCase),W=Pp($,K.length);return TZ(Z,W,K,this.toggleCase),new k(w0(Z,""),this.buildContextFor(G,new k(W,void 0)))}).join(s4(()=>{let G=[...J],Z=_2(G,this.toggleCase);return e4(E(0),(E(1)<<E(Z.length))-E(1)).shrink($,Y.flagsContext).map((K)=>{let W=s0(G);return TZ(W,K.value,Z,this.toggleCase),new k(w0(W,""),this.buildContextFor(new k(J,Y.rawStringContext),K))})}))}};function Mp(Q){let X=KK(Q);if(X!==Q)return X;return gZ(Q)}function Ap(Q,X){return new Np(Q,X&&X.toggleCase||Mp,X&&X.untoggleAll)}function wp(Q){return ZP.from(Q)}function Cp(Q){if(!(Q instanceof ZP))throw Error("Unexpected type");return[...Q]}function _R(Q={}){return P0(JR(Q),Q).map(wp,Cp)}function Tp(Q){return KP.from(Q)}function Ip(Q){if(!(Q instanceof KP))throw Error("Unexpected type");return[...Q]}function qR(Q={}){return P0(I2(Q),Q).map(Tp,Ip)}function U4(Q,X,Y,J,$){let G=J.name,{min:Z=X,max:K=Y,...W}=Q;if(Z>K)throw Error(`Invalid range passed to ${G}: min must be lower than or equal to max`);if(Z<X)throw Error(`Invalid min value passed to ${G}: min must be greater than or equal to ${X}`);if(K>Y)throw Error(`Invalid max value passed to ${G}: max must be lower than or equal to ${Y}`);return P0($({min:Z,max:K}),W).map((H)=>J.from(H),(H)=>{if(!(H instanceof J))throw Error("Invalid type");return[...H]})}function DR(Q={}){return U4(Q,-32768,32767,Dy,O0)}function BR(Q={}){return U4(Q,-2147483648,2147483647,By,O0)}function UR(Q={}){return U4(Q,-128,127,qy,O0)}function OR(Q={}){return U4(Q,0,65535,zy,O0)}function zR(Q={}){return U4(Q,0,4294967295,Fy,O0)}function FR(Q={}){return U4(Q,0,255,Uy,O0)}function LR(Q={}){return U4(Q,0,255,Oy,O0)}function jp(Q){return Q!==void 0}function xL(Q){if(Q.hasToBeCloned)return new k(Q.value_,{generatorContext:Q.context},()=>Q.value);return new k(Q.value_,{generatorContext:Q.context})}function vL(Q){if(Q.hasToBeCloned)return new k(Q.value_,{shrinkerContext:Q.context},()=>Q.value);return new k(Q.value_,{shrinkerContext:Q.context})}var Ep=class extends C0{constructor(Q,X){super();this.generatorArbitrary=Q,this.shrinkerArbitrary=X}generate(Q,X){return xL(this.generatorArbitrary.generate(Q,X))}canShrinkWithoutContext(Q){return this.shrinkerArbitrary.canShrinkWithoutContext(Q)}shrink(Q,X){if(!jp(X))return this.shrinkerArbitrary.shrink(Q,void 0).map(vL);if("generatorContext"in X)return this.generatorArbitrary.shrink(Q,X.generatorContext).map(xL);return this.shrinkerArbitrary.shrink(Q,X.shrinkerContext).map(vL)}};function YK(Q,X,Y){let J=O0({min:Q,max:X});if(X===Y)return J;return new Ep(J,O0({min:Q,max:Y}))}var{min:Sp,max:JK}=Math,kL=$P.isArray,xp=Object.entries;function vp(Q){let X=-1;for(let Y=0;Y!==Q.length;++Y)X=JK(X,Q[Y][0]);return X}function kp(Q,X){let Y=$P(Q);for(let J=0;J!==X.length;++J){let $=X[J];if($[0]<Q)Y[$[0]]=$[1]}return Y}function PR(Q,X={}){let{size:Y,minNumElements:J=0,maxLength:$=t6,maxNumElements:G=$,noTrailingHole:Z,depthIdentifier:K}=X,W=VX(Y,VX(Y,J,G,X.maxNumElements!==void 0),$,X.maxLength!==void 0);if(J>$)throw Error("The minimal number of non-hole elements cannot be higher than the maximal length of the array");if(J>G)throw Error("The minimal number of non-hole elements cannot be higher than the maximal number of non-holes");let H=Sp(G,$),_=X.maxNumElements!==void 0||Y!==void 0?Y:"=",V=e6(Q0(YK(0,JK(W-1,0),JK($-1,0)),Q),{size:_,minLength:J,maxLength:H,selector:(q)=>q[0],depthIdentifier:K}).map((q)=>{return kp(vp(q)+1,q)},(q)=>{if(!kL(q))throw Error("Not supported entry type");if(Z&&q.length!==0&&!(q.length-1 in q))throw Error("No trailing hole");return G0(xp(q),(D)=>[Number(D[0]),D[1]])});if(Z||$===J)return V;return Q0(V,YK(J,W,$)).map((q)=>{let D=q[0],U=q[1];if(D.length>=U)return D;let P=s0(D);return P.length=U,P},(q)=>{if(!kL(q))throw Error("Not supported entry type");return[q,q.length]})}function yp(Q){return new Set(Q)}function bp(Q){if(typeof Q!=="object"||Q===null)throw Error("Incompatible instance received: should be a non-null object");if(!("constructor"in Q)||Q.constructor!==Set)throw Error("Incompatible instance received: should be of exact type Set");return Array.from(Q)}function RR(Q,X={}){return e6(Q,{minLength:X.minLength,maxLength:X.maxLength,size:X.size,depthIdentifier:X.depthIdentifier,comparator:"SameValueZero"}).map(yp,bp)}function gp(Q,X,Y,J,$,G){return LK(Q,X,{maxKeys:Y,noNullPrototype:!G,size:J,depthIdentifier:$})}function hp(Q){return l0(UR(Q),FR(Q),LR(Q),DR(Q),OR(Q),BR(Q),zR(Q),_R(Q),qR(Q))}function NR(Q){let{values:X,depthSize:Y}=Q,J=OK(),$=Q.maxDepth,G=Q.maxKeys,Z=Q.size,K=l0(...X,...Q.withBigInt?[e4()]:[],...Q.withDate?[mP()]:[]);return HR((W)=>({anything:l0({maxDepth:$,depthSize:Y,depthIdentifier:J},K,W("array"),W("object"),...Q.withMap?[W("map")]:[],...Q.withSet?[W("set")]:[],...Q.withObjectString?[W("anything").map((H)=>b0(H))]:[],...Q.withTypedArray?[hp({maxLength:G,size:Z})]:[],...Q.withSparseArray?[PR(W("anything"),{maxNumElements:G,size:Z,depthIdentifier:J})]:[]),keys:Q.withObjectString?l0({arbitrary:Q.key,weight:10},{arbitrary:W("anything").map((H)=>b0(H)),weight:1}):Q.key,array:P0(W("anything"),{maxLength:G,size:Z,depthIdentifier:J}),set:RR(W("anything"),{maxLength:G,size:Z,depthIdentifier:J}),map:l0(XK(W("keys"),W("anything"),{maxKeys:G,size:Z,depthIdentifier:J}),XK(W("anything"),W("anything"),{maxKeys:G,size:Z,depthIdentifier:J})),object:gp(W("keys"),W("anything"),G,Z,J,Q.withNullPrototype)})).anything}function mp(Q){switch(typeof Q){case"boolean":return new GP(Q);case"number":return new _4(Q);case"string":return new L1(Q);default:return Q}}function dp(Q){if(typeof Q!=="object"||Q===null||!("constructor"in Q))return Q;return Q.constructor===GP||Q.constructor===_4||Q.constructor===L1?Q.valueOf():Q}function pp(Q){return Q.map(mp,dp)}function cp(Q,X){return[DX(),ZR(),I2(),X(Q),l0(X(Q),y0(null),y0(void 0))]}function fp(Q){return Q.map((X)=>pp(X))}function up(Q,X){return X?fp(Q).concat(Q):Q}function MR(Q={}){let X={size:Q.size,unit:"stringUnit"in Q?Q.stringUnit:Q.withUnicodeString?"binary":void 0};return{key:Q.key!==void 0?Q.key:d0(X),values:up(Q.values!==void 0?Q.values:cp(X,d0),Q.withBoxedValues===!0),depthSize:Q.depthSize,maxDepth:Q.maxDepth,maxKeys:Q.maxKeys,size:Q.size,withSet:Q.withSet===!0,withMap:Q.withMap===!0,withObjectString:Q.withObjectString===!0,withNullPrototype:Q.withNullPrototype===!0,withBigInt:Q.withBigInt===!0,withDate:Q.withDate===!0,withTypedArray:Q.withTypedArray===!0,withSparseArray:Q.withSparseArray===!0}}function lp(Q){return LK(Q.key,NR(Q),{maxKeys:Q.maxKeys,noNullPrototype:!Q.withNullPrototype,size:Q.size})}function rp(Q){return lp(MR(Q))}function op(Q,X){let{depthSize:Y,maxDepth:J}=X;return{key:Q,values:[DX(),I2({noDefaultInfinity:!0,noNaN:!0}),Q,y0(null)],depthSize:Y,maxDepth:J}}function AR(Q){return NR(MR(Q))}function wR(Q={}){let X=Q.noUnicodeString===void 0||Q.noUnicodeString===!0;return AR(op("stringUnit"in Q?d0({unit:Q.stringUnit}):X?d0():d0({unit:"binary"}),Q))}var{stringify:np,parse:ip}=JSON;function ap(Q){if(typeof Q!=="string")throw new S("Cannot unmap the passed value");return ip(Q)}function sp(Q={}){return wR(Q).map(np,ap)}var tp=Object.defineProperties;function IZ(Q,X){return`Stream(${X!==void 0?`${w0(X,",")}\u2026`:`${Q} emitted`})`}var ep=class extends C0{constructor(Q,X){super();this.arb=Q,this.history=X}generate(Q,X){let Y=X!==void 0&&Q.nextInt(1,X)===1?X:void 0,J=()=>{let $=this.history?[]:null,G=0;return tp(new s(function*(K,W){while(!0){let H=K.generate(W,Y).value;if(G++,$!==null)x($,H);yield H}}(this.arb,Q.clone())),{toString:{value:()=>IZ(G,$!==null?$.map(b0):void 0)},[R8]:{value:()=>IZ(G,$!==null?$.map(b0):void 0)},[D4]:{value:async()=>IZ(G,$!==null?await Promise.all($.map(qK)):void 0)},[r0]:{value:J,enumerable:!0}})};return new k(J(),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function Qc(Q,X){return new ep(Q,X!==void 0&&typeof X==="object"&&"noHistory"in X?!X.noHistory:!0)}function Xc(Q){return w0(Q,"")}function yL(Q){if(typeof Q!=="string")throw Error("Cannot unmap the passed value");return[...Q]}function Yc(Q){switch(Q.length%4){case 0:return Q;case 3:return`${Q}=`;case 2:return`${Q}==`;default:return S0(Q,1)}}function Jc(Q){if(typeof Q!=="string"||Q.length%4!==0)throw Error("Invalid string received");let X=Q.indexOf("=");if(X===-1)return Q;if(Q.length-X>2)throw Error("Cannot unmap the passed value");return S0(Q,0,X)}var jZ=String.fromCharCode;function $c(Q){if(Q<26)return jZ(Q+65);if(Q<52)return jZ(Q+97-26);if(Q<62)return jZ(Q+48-52);return Q===62?"+":"/"}function Gc(Q){if(typeof Q!=="string"||Q.length!==1)throw new S("Invalid entry");let X=W9(Q,0);if(X>=65&&X<=90)return X-65;if(X>=97&&X<=122)return X-97+26;if(X>=48&&X<=57)return X-48+52;return X===43?62:X===47?63:-1}function Zc(){return O0({min:0,max:63}).map($c,Gc)}function Kc(Q={}){let{minLength:X=0,maxLength:Y=t6,size:J}=Q,$=X+3-(X+3)%4,G=Y-Y%4,Z=Q.maxLength===void 0&&J===void 0?"=":J;if($>G)throw new S("Minimal length should be inferior or equal to maximal length");if($%4!==0)throw new S("Minimal length of base64 strings must be a multiple of 4");if(G%4!==0)throw new S("Maximal length of base64 strings must be a multiple of 4");let K=Zc();return P0(K,{minLength:$,maxLength:G,size:Z,experimentalCustomSlices:ch(K,yL)}).map(Xc,yL).map(Yc,Jc)}var bL=Object.is;function Wc(Q,X){let Y=new q4,J=0;for(let $ of Q)if(bL($,-0))++J;else L8(Y,$,(c1(Y,$)||0)+1);for(let $=0;$!==X.length;++$){if(!($ in X))return!1;let G=X[$];if(bL(G,-0)){if(J===0)return!1;--J}else{let Z=c1(Y,G)||0;if(Z===0)return!1;L8(Y,G,Z-1)}}return!0}var{floor:Hc,log:gL}=Math,Vc=Array.isArray,CR=class extends C0{constructor(Q,X,Y,J){super();if(this.originalArray=Q,this.isOrdered=X,this.minLength=Y,this.maxLength=J,Y<0||Y>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be between 0 and the size of the original array");if(J<0||J>Q.length)throw Error("fc.*{s|S}ubarrayOf expects the maximal length to be between 0 and the size of the original array");if(Y>J)throw Error("fc.*{s|S}ubarrayOf expects the minimal length to be inferior or equal to the maximal length");this.lengthArb=new V9(Y,J),this.biasedLengthArb=Y!==J?new V9(Y,Y+Hc(gL(J-Y)/gL(2))):this.lengthArb}generate(Q,X){let Y=(X!==void 0&&Q.nextInt(1,X)===1?this.biasedLengthArb:this.lengthArb).generate(Q,void 0),J=Y.value,$=G0(this.originalArray,(Z,K)=>K),G=[];for(let Z=0;Z!==J;++Z){let K=Q.nextInt(0,$.length-1);x(G,$[K]),VP($,K,1)}if(this.isOrdered)_P(G,(Z,K)=>Z-K);return new k(G0(G,(Z)=>this.originalArray[Z]),Y.context)}canShrinkWithoutContext(Q){if(!Vc(Q))return!1;if(!this.lengthArb.canShrinkWithoutContext(Q.length))return!1;return Wc(this.originalArray,Q)}shrink(Q,X){if(Q.length===0)return s.nil();return this.lengthArb.shrink(Q.length,X).map((Y)=>{return new k(s0(Q,Q.length-Y.value),Y.context)}).join(Q.length>this.minLength?s4(()=>this.shrink(s0(Q,1),void 0).filter((Y)=>this.minLength<=Y.value.length+1).map((Y)=>new k([Q[0],...Y.value],void 0))):s.nil())}};function _c(Q,X={}){let{minLength:Y=0,maxLength:J=Q.length}=X;return new CR(Q,!0,Y,J)}function qc(Q,X={}){let{minLength:Y=0,maxLength:J=Q.length}=X;return new CR(Q,!1,Y,J)}var Dc={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F",16:"G",17:"H",18:"J",19:"K",20:"M",21:"N",22:"P",23:"Q",24:"R",25:"S",26:"T",27:"V",28:"W",29:"X",30:"Y",31:"Z"},Bc={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,J:18,K:19,M:20,N:21,P:22,Q:23,R:24,S:25,T:26,V:27,W:28,X:29,Y:30,Z:31};function Uc(Q){return Q<10?L1(Q):Dc[Q]}function hL(Q,X){let Y="";while(Q.length+Y.length<X)Y+="0";return Y+Q}function mL(Q){let X="";for(let Y=Q;Y!==0;){let J=Y>>5;X=Uc(Y-(J<<5))+X,Y=J}return X}function Oc(Q,X){let Y=~~(Q/1073741824),J=Q&1073741823;return hL(mL(Y),X-6)+hL(mL(J),6)}function TR(Q){return function(Y){return Oc(Y,Q)}}function EZ(Q){if(typeof Q!=="string")throw new S("Unsupported type");let X=0,Y=1;for(let J=Q.length-1;J>=0;--J){let $=Bc[Q[J]];if($===void 0)throw new S("Unsupported type");X+=$*Y,Y*=32}return X}var zc=TR(10),dL=TR(8);function Fc(Q){return zc(Q[0])+dL(Q[1])+dL(Q[2])}function Lc(Q){if(typeof Q!=="string"||Q.length!==26)throw Error("Unsupported type");return[EZ(Q.slice(0,10)),EZ(Q.slice(10,18)),EZ(Q.slice(18))]}function Pc(){return Q0(O0({min:0,max:281474976710655}),O0({min:0,max:1099511627775}),O0({min:0,max:1099511627775})).map(Fc,Lc)}function IR(Q){return Gb(WX(Q,16),8,"0")}function Rc(Q){if(typeof Q!=="string")throw Error("Unsupported type");if(Q.length!==8)throw Error("Unsupported value: invalid length");let X=parseInt(Q,16);if(Q!==IR(X))throw Error("Unsupported value: invalid content");return X}function SZ(Q,X){return O0({min:Q,max:X}).map(IR,Rc)}function Nc(Q){return`${Q[0]}-${S0(Q[1],4)}-${S0(Q[1],0,4)}-${S0(Q[2],0,4)}-${S0(Q[2],4)}${Q[3]}`}var Mc=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/;function Ac(Q){if(typeof Q!=="string")throw Error("Unsupported type");let X=Mc.exec(Q);if(X===null)throw Error("Unsupported type");return[X[1],X[3]+X[2],X[4]+S0(X[5],0,4),S0(X[5],4)]}var pL="0123456789abcdef";function wc(Q){let X={},Y={};for(let G=0;G!==Q.length;++G){let Z=pL[G],K=pL[Q[G]];X[Z]=K,Y[K]=Z}function J(G){return X[G[0]]+S0(G,1)}function $(G){if(typeof G!=="string")throw new S("Cannot produce non-string values");let Z=Y[G[0]];if(Z===void 0)throw new S("Cannot produce strings not starting by the version in hexa code");return Z+S0(G,1)}return{versionsApplierMapper:J,versionsApplierUnmapper:$}}function Cc(Q){let X={};for(let Y of Q){if(X[Y])throw new S(`Version ${Y} has been requested at least twice for uuid`);if(X[Y]=!0,Y<1||Y>15)throw new S(`Version must be a value in [1-15] for uuid, but received ${Y}`);if(~~Y!==Y)throw new S(`Version must be an integer value for uuid, but received ${Y}`)}if(Q.length===0)throw new S("Must provide at least one version for uuid")}function Tc(Q={}){let X=SZ(0,4294967295),Y=Q.version!==void 0?typeof Q.version==="number"?[Q.version]:Q.version:[1,2,3,4,5,6,7,8];Cc(Y);let{versionsApplierMapper:J,versionsApplierUnmapper:$}=wc(Y);return Q0(X,SZ(0,268435456*Y.length-1).map(J,$),SZ(2147483648,3221225471),X).map(Nc,Ac)}function Ic(Q){return d0({unit:NK("-._~!$&'()*+,;=:"),size:Q})}function jc([Q,X,Y]){return(Q===null?"":`${Q}@`)+X+(Y===null?"":`:${Y}`)}function Ec(Q){if(typeof Q!=="string")throw Error("Unsupported");let X=Q.indexOf("@"),Y=X!==-1?Q.substring(0,X):null,J=/:(\d+)$/.exec(Q),$=J!==null?Number(J[1]):null;return[Y,J!==null?Q.substring(X+1,Q.length-J[1].length-1):Q.substring(X+1),$]}function Sc(Q){return`[${Q}]`}function xc(Q){if(typeof Q!=="string"||Q[0]!=="["||Q[Q.length-1]!=="]")throw Error("Unsupported");return Q.substring(1,Q.length-1)}function jR(Q){let X=Q||{},Y=X.size,J=[MK({size:Y}),...X.withIPv4===!0?[TK()]:[],...X.withIPv6===!0?[WR().map(Sc,xc)]:[],...X.withIPv4Extended===!0?[KR()]:[]];return Q0(X.withUserInfo===!0?B4(Ic(Y)):y0(null),l0(...J),X.withPort===!0?B4(a4(65535)):y0(null)).map(jc,Ec)}function ER(Q){return d0({unit:NK("-._~!$&'()*+,;=:@/?"),size:Q})}function SR(Q={}){return ER(Q.size)}function xR(Q={}){return d0({unit:NK("-._~!$&'()*+,;=:@"),size:Q.size})}function vc(Q){return w0(G0(Q,(X)=>`/${X}`),"")}function kc(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");if(Q.length!==0&&Q[0]!=="/")throw Error("Incompatible value received: start");return VP(P1(Q,"/"),1)}function yc(Q){switch(Q){case"xsmall":return["xsmall","xsmall"];case"small":return["small","xsmall"];case"medium":return["small","small"];case"large":return["medium","small"];case"xlarge":return["medium","medium"]}}function xZ(Q,X){return P0(xR({size:Q}),{size:X}).map(vc,kc)}function bc(Q){let[X,Y]=yc(Q);if(X===Y)return xZ(X,Y);return l0(xZ(X,Y),xZ(Y,X))}function vR(Q){return bc(FK((Q||{}).size))}function kR(Q={}){return ER(Q.size)}function gc(Q){let[X,Y,J]=Q;return`${X}://${Y}${J}${Q[3]===null?"":`?${Q[3]}`}${Q[4]===null?"":`#${Q[4]}`}`}var hc=/^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;function mc(Q){if(typeof Q!=="string")throw Error("Incompatible value received: type");let X=hc.exec(Q);if(X===null)throw Error("Incompatible value received");let Y=X[1],J=X[2],$=X[3],G=X[4],Z=X[5];return[Y,J,$,G!==void 0?G.substring(1):null,Z!==void 0?Z.substring(1):null]}function dc(Q){let X=Q||{},Y=FK(X.size),J=X.authoritySettings!==void 0&&X.authoritySettings.size!==void 0?qX(X.authoritySettings.size,Y):Y,$={...X.authoritySettings,size:J};return Q0(m8(...X.validSchemes||["http","https"]),jR($),vR({size:Y}),X.withQueryParameters===!0?B4(kR({size:Y})):y0(null),X.withFragments===!0?B4(SR({size:Y})):y0(null)).map(gc,mc)}var pc=class Q{constructor(X,Y){this.commands=X,this.metadataForReplay=Y,this[r0]=function(){return new Q(this.commands.map((J)=>J.clone()),this.metadataForReplay)}}[Symbol.iterator](){return this.commands[Symbol.iterator]()}toString(){let X=this.commands.filter((J)=>J.hasRan).map((J)=>J.toString()).join(","),Y=this.metadataForReplay();return Y.length!==0?`${X} /*${Y}*/`:X}},cc=class Q{constructor(X){if(this.cmd=X,this.hasRan=!1,VK(X)){let Y=X[R8];this[R8]=function(){return Y.call(X)}}if(_K(X)){let Y=X[D4];this[D4]=function(){return Y.call(X)}}}check(X){return this.cmd.check(X)}run(X,Y){return this.hasRan=!0,this.cmd.run(X,Y)}clone(){if(s6(this.cmd))return new Q(this.cmd[r0]());return new Q(this.cmd)}toString(){return this.cmd.toString()}},cL=class{static parse(Q){let[X,Y]=Q.split(":"),J=this.parseCounts(X),$=this.parseChanges(Y);return this.parseOccurences(J,$)}static stringify(Q){let X=this.countOccurences(Q);return`${this.stringifyCounts(X)}:${this.stringifyChanges(X)}`}static intToB64(Q){if(Q<26)return String.fromCharCode(Q+65);if(Q<52)return String.fromCharCode(Q+97-26);if(Q<62)return String.fromCharCode(Q+48-52);return String.fromCharCode(Q===62?43:47)}static b64ToInt(Q){if(Q>="a")return Q.charCodeAt(0)-97+26;if(Q>="A")return Q.charCodeAt(0)-65;if(Q>="0")return Q.charCodeAt(0)-48+52;return Q==="+"?62:63}static countOccurences(Q){return Q.reduce((X,Y)=>{if(X.length===0||X[X.length-1].count===64||X[X.length-1].value!==Y)X.push({value:Y,count:1});else X[X.length-1].count+=1;return X},[])}static parseOccurences(Q,X){let Y=[];for(let J=0;J!==Q.length;++J){let $=Q[J],G=X[J];for(let Z=0;Z!==$;++Z)Y.push(G)}return Y}static stringifyChanges(Q){let X="";for(let Y=0;Y<Q.length;Y+=6){let J=Q.slice(Y,Y+6).reduceRight(($,G)=>($<<1)+(G.value?1:0),0);X+=this.intToB64(J)}return X}static parseChanges(Q){let X=Q.split("").map((J)=>this.b64ToInt(J)),Y=[];for(let J=0;J!==X.length;++J){let $=X[J];for(let G=0;G!==6;++G,$>>=1)Y.push($%2===1)}return Y}static stringifyCounts(Q){return Q.map(({count:X})=>this.intToB64(X-1)).join("")}static parseCounts(Q){return Q.split("").map((X)=>this.b64ToInt(X)+1)}},fc=class extends C0{constructor(Q,X,Y,J,$){super();this.sourceReplayPath=J,this.disableReplayLog=$,this.oneCommandArb=l0(...Q).map((G)=>new cc(G)),this.lengthArb=YK(0,X,Y),this.replayPath=[],this.replayPathPosition=0}metadataForReplay(){return this.disableReplayLog?"":`replayPath=${JSON.stringify(cL.stringify(this.replayPath))}`}buildValueFor(Q,X){let Y=Q.map(($)=>$.value_),J={shrunkOnce:X,items:Q};return new k(new pc(Y,()=>this.metadataForReplay()),J)}generate(Q){let X=this.lengthArb.generate(Q,void 0).value,Y=Array(X);for(let J=0;J!==X;++J)Y[J]=this.oneCommandArb.generate(Q,void 0);return this.replayPathPosition=0,this.buildValueFor(Y,!1)}canShrinkWithoutContext(Q){return!1}filterOnExecution(Q){let X=[];for(let Y of Q)if(Y.value_.hasRan)this.replayPath.push(!0),X.push(Y);else this.replayPath.push(!1);return X}filterOnReplay(Q){return Q.filter((X,Y)=>{let J=this.replayPath[this.replayPathPosition+Y];if(J===void 0)throw Error("Too short replayPath");if(!J&&X.value_.hasRan)throw Error("Mismatch between replayPath and real execution");return J})}filterForShrinkImpl(Q){if(this.replayPathPosition===0)this.replayPath=this.sourceReplayPath!==null?cL.parse(this.sourceReplayPath):[];let X=this.replayPathPosition<this.replayPath.length?this.filterOnReplay(Q):this.filterOnExecution(Q);return this.replayPathPosition+=Q.length,X}shrink(Q,X){if(X===void 0)return s.nil();let Y=X,J=Y.shrunkOnce,$=Y.items,G=this.filterForShrinkImpl($);if(G.length===0)return s.nil();let Z=J?s.nil():new s([[]][Symbol.iterator]()),K=[];for(let W=0;W!==G.length;++W)K.push(s4(()=>{let H=G.slice(0,W);return this.lengthArb.shrink(G.length-1-W,void 0).map((_)=>H.concat(G.slice(G.length-(_.value+1))))}));for(let W=0;W!==G.length;++W)K.push(s4(()=>this.oneCommandArb.shrink(G[W].value_,G[W].context).map((H)=>G.slice(0,W).concat([H],G.slice(W+1)))));return Z.join(...K).map((W)=>{return this.buildValueFor(W.map((H)=>new k(H.value_.clone(),H.context)),!0)})}};function uc(Q,X={}){let{size:Y,maxCommands:J=t6,disableReplayLog:$=!1,replayPath:G=null}=X;return new fc(Q,VX(Y,0,J,X.maxCommands!==void 0),J,G,$)}var lc=class{constructor(Q,X){this.s=Q,this.cmd=X}async check(Q){let X=null,Y=!1;if((await this.s.scheduleSequence([{label:`check@${this.cmd.toString()}`,builder:async()=>{try{Y=await Promise.resolve(this.cmd.check(Q))}catch(J){throw X=J,J}}}]).task).faulty)throw X;return Y}async run(Q,X){let Y=null;if((await this.s.scheduleSequence([{label:`run@${this.cmd.toString()}`,builder:async()=>{try{await this.cmd.run(Q,X)}catch(J){throw Y=J,J}}}]).task).faulty)throw Y}},rc=function*(Q,X){for(let Y of X)yield new lc(Q,Y)},yR=(Q,X,Y,J,$)=>{return Q.then((G)=>{let{model:Z,real:K}=G,W=Y;for(let H of X)W=$(W,()=>{return J(H,Z,K)});return W})},oc=(Q,X)=>{return yR({then:(G)=>{G(Q())}},X,void 0,(G,Z,K)=>{if(G.check(Z))G.run(Z,K)},(G,Z)=>Z())},nc=(Q)=>{return typeof Q.then==="function"},bR=async(Q,X,Y=Promise.resolve())=>{return await yR({then:(Z)=>{let K=Q();if(nc(K))return K.then(Z);else return Z(K)}},X,Y,async(Z,K,W)=>{if(await Z.check(K))await Z.run(K,W)},(Z,K)=>Z.then(K))};function ic(Q,X){oc(Q,X)}async function ac(Q,X){await bR(Q,X)}async function sc(Q,X,Y){let J=bR(X,rc(Q,Y),Q.schedule(Promise.resolve(),"startModel"));await Q.waitFor(J),await Q.waitAll()}var q2=(Q)=>Q(),gR=class Q{constructor(X,Y){this.act=X,this.taskSelector=Y,this.lastTaskId=0,this.sourceTaskSelector=Y.clone(),this.scheduledTasks=[],this.triggeredTasks=[],this.scheduledWatchers=[],this[r0]=function(){return new Q(this.act,this.sourceTaskSelector)}}static buildLog(X){return`[task\${${X.taskId}}] ${X.label.length!==0?`${X.schedulingType}::${X.label}`:X.schedulingType} ${X.status}${X.outputValue!==void 0?` with value ${Xd(X.outputValue)}`:""}`}log(X,Y,J,$,G,Z){this.triggeredTasks.push({status:G,schedulingType:X,taskId:Y,label:J,metadata:$,outputValue:Z!==void 0?b0(Z):void 0})}scheduleInternal(X,Y,J,$,G,Z){let K=++this.lastTaskId,W=void 0,H=new Promise((_,V)=>{W=()=>{let q=Promise.resolve(Z!==void 0?J.then(()=>Z()):J);return q.then((D)=>{this.log(X,K,Y,$,"resolved",D),_(D)},(D)=>{this.log(X,K,Y,$,"rejected",D),V(D)}),q}});if(this.scheduledTasks.push({original:J,trigger:W,schedulingType:X,taskId:K,label:Y,metadata:$,customAct:G}),this.scheduledWatchers.length!==0)this.scheduledWatchers[0]();return H}schedule(X,Y,J,$){return this.scheduleInternal("promise",Y||"",X,J,$||q2)}scheduleFunction(X,Y){return(...J)=>this.scheduleInternal("function",`${X.name}(${J.map(b0).join(",")})`,X(...J),void 0,Y||q2)}scheduleSequence(X,Y){let J={done:!1,faulty:!1},$={then:(_)=>_()},G=()=>{},Z=new Promise((_)=>{G=()=>_({done:J.done,faulty:J.faulty})}),K=()=>{J.faulty=!0,G()},W=()=>{J.done=!0,G()},H=(_,V)=>{if(_>=X.length){V.then(W,K);return}V.then(()=>{let q=X[_],[D,U,P]=typeof q==="function"?[q,q.name,void 0]:[q.builder,q.label,q.metadata],L=this.scheduleInternal("sequence",U,$,P,Y||q2,()=>D());H(_+1,L)},K)};return H(0,$),Object.assign(J,{task:Z})}count(){return this.scheduledTasks.length}internalWaitOne(){if(this.scheduledTasks.length===0)throw Error("No task scheduled");let X=this.taskSelector.nextTaskIndex(this.scheduledTasks),[Y]=this.scheduledTasks.splice(X,1);return Y.customAct(()=>{return Y.trigger().catch((J)=>{})})}waitOne(X){let Y=X||q2;return this.act(()=>Y(()=>this.internalWaitOne()))}async waitAll(X){while(this.scheduledTasks.length>0)await this.waitOne(X)}async internalWaitFor(X,Y){let J=!1,$=Y.customAct,G=Y.onWaitStart,Z=Y.onWaitIdle,K=Y.launchAwaiterOnInit,W=void 0,H=void 0,_=0,V=null,q=null,D=async()=>{_=50;for(_=50;!J&&_>0;--_)await Promise.resolve();if(!J&&this.scheduledTasks.length>0){if(G!==void 0)G();return q=this.waitOne($),q.then(()=>{return q=null,D()},(M)=>{throw q=null,J=!0,H(M),M})}if(!J&&Z!==void 0)Z();V=null},U=()=>{if(V!==null){_=51;return}V=D().catch(()=>{})},P=()=>{let M=this.scheduledWatchers.indexOf(U);if(M!==-1)this.scheduledWatchers.splice(M,1);if(M===0&&this.scheduledWatchers.length!==0)this.scheduledWatchers[0]()},L=new Promise((M,w)=>{W=(R)=>{P(),M(R)},H=(R)=>{P(),w(R)}});if(X.then((M)=>{if(J=!0,q===null)W(M);else q.then(()=>W(M),(w)=>H(w))},(M)=>{if(J=!0,q===null)H(M);else q.then(()=>H(M),()=>H(M))}),(this.scheduledTasks.length>0||K)&&this.scheduledWatchers.length===0)U();return this.scheduledWatchers.push(U),L}waitNext(X,Y){let J=void 0,$=X,G=$<=0?Promise.resolve():new Promise((Z)=>{J=()=>{if(--$<=0)Z()}});return this.internalWaitFor(G,{customAct:Y,onWaitStart:J,onWaitIdle:void 0,launchAwaiterOnInit:!1})}waitIdle(X){let Y=void 0,J=new Promise(($)=>Y=$);return this.internalWaitFor(J,{customAct:X,onWaitStart:void 0,onWaitIdle:Y,launchAwaiterOnInit:!0})}waitFor(X,Y){return this.internalWaitFor(X,{customAct:Y,onWaitStart:void 0,onWaitIdle:void 0,launchAwaiterOnInit:!1})}report(){return[...this.triggeredTasks,...this.scheduledTasks.map((X)=>({status:"pending",schedulingType:X.schedulingType,taskId:X.taskId,label:X.label,metadata:X.metadata}))]}toString(){return"schedulerFor()`\n"+this.report().map(Q.buildLog).map((X)=>`-> ${X}`).join(`
62
+ `)+"`"}};function hR(Q){let X=0;return{clone:()=>hR(Q),nextTaskIndex:(Y)=>{if(Q.length<=X)throw Error("Invalid schedulerFor defined: too many tasks have been scheduled");let J=Y.findIndex(($)=>$.taskId===Q[X]);if(J===-1)throw Error("Invalid schedulerFor defined: unable to find next task");return++X,J}}}function fL(Q,X){return new gR(Q,hR(X))}function mR(Q){let X=Q.clone();return{clone:()=>mR(X),nextTaskIndex:(Y)=>{return Q.nextInt(0,Y.length-1)}}}var tc=class extends C0{constructor(Q){super();this.act=Q}generate(Q,X){return new k(new gR(this.act,mR(Q.clone())),void 0)}canShrinkWithoutContext(Q){return!1}shrink(Q,X){return s.nil()}};function ec(Q){let{act:X=(Y)=>Y()}=Q||{};return new tc(X)}function Qf(Q,X){let{act:Y=(J)=>J()}=Array.isArray(Q)?X||{}:Q||{};if(Array.isArray(Q))return fL(Y,Q);return function(J,...$){return fL(Y,$)}}function Xf(Q={}){return U4(Q,E("-9223372036854775808"),E("9223372036854775807"),Vy,e4)}function Yf(Q={}){return U4(Q,E(0),E("18446744073709551615"),_y,e4)}function Jf(Q,X){return X}var{floor:vZ,min:$f}=Math;function Q8(Q,X){switch(Q.type){case"Char":return{astNode:Q,minLength:1};case"Repetition":switch(Q.quantifier.kind){case"*":{let Y=Q8(Q.expression,X);return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:X},expression:Y.astNode},minLength:0}}case"+":{let Y=Q8(Q.expression,X),J=Y.minLength>1?Y.minLength:1;return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:1,to:vZ(X/J)},expression:Y.astNode},minLength:Y.minLength}}case"?":{let Y=Q8(Q.expression,X);if(X<Y.minLength)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",from:0,to:0},expression:Y.astNode},minLength:0};return{astNode:{...Q,expression:Y.astNode},minLength:0}}case"Range":{let Y=Q.quantifier.from>1?vZ(X/Q.quantifier.from):X,J=Q8(Q.expression,Y),$=J.minLength>1?J.minLength:1;if(Q.quantifier.to===void 0||Q.quantifier.to*$>X)return{astNode:{type:"Repetition",quantifier:{...Q.quantifier,kind:"Range",to:vZ(X/$)},expression:J.astNode},minLength:Q.quantifier.from*J.minLength};return{astNode:{...Q,expression:J.astNode},minLength:Q.quantifier.from*J.minLength}}default:return Jf(Q.quantifier,{astNode:Q,minLength:0})}case"Quantifier":return{astNode:Q,minLength:0};case"Alternative":{let Y=0,J=[];for(let G=0;G!==Q.expressions.length;++G){let Z=X-Y,K=Q8(Q.expressions[G],Z);Y+=K.minLength,x(J,{value:K,allowance:Z})}let $=[];for(let G=0;G!==J.length;++G){let Z=J[G].value,K=J[G].allowance,W=X-Y+Z.minLength;x($,(W!==K?Q8(Z.astNode,W):Z).astNode)}return{astNode:{...Q,expressions:$},minLength:Y}}case"CharacterClass":return{astNode:Q,minLength:1};case"ClassRange":return{astNode:Q,minLength:1};case"Group":{let Y=Q8(Q.expression,X);return{astNode:{...Q,expression:Y.astNode},minLength:Y.minLength}}case"Disjunction":{if(Q.left===null){if(Q.right===null)return{astNode:Q,minLength:0};let $=Q8(Q.right,X),G=$.minLength>X?null:$.astNode;return{astNode:{...Q,left:null,right:G},minLength:0}}if(Q.right===null){let $=Q8(Q.left,X),G=$.minLength>X?null:$.astNode;return{astNode:{...Q,left:G,right:null},minLength:0}}let Y=Q8(Q.left,X),J=Q8(Q.right,X);if(Y.minLength>X)return J;if(J.minLength>X)return Y;return{astNode:{...Q,left:Y.astNode,right:J.astNode},minLength:$f(Y.minLength,J.minLength)}}case"Assertion":return{astNode:Q,minLength:0};case"Backreference":return{astNode:Q,minLength:0};case"UnicodeProperty":return{astNode:Q,minLength:1}}}function Gf(Q,X){return Q8(Q,X).astNode}function Zf(Q){return Error(`Unsupported AST node! Received: ${b0(Q)}`)}function L2(Q,X,Y){if(!X&&!Y)return Q;let J={hasStart:!1,hasEnd:!1},$=dR(Q,X,Y,J),G=X&&!J.hasStart,Z=Y&&!J.hasEnd;if(!G&&!Z)return $;let K=[];if(G)K.push({type:"Assertion",kind:"^"}),K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}});if(K.push($),Z)K.push({type:"Repetition",quantifier:{type:"Quantifier",kind:"*",greedy:!0},expression:{type:"Char",kind:"meta",symbol:".",value:".",codePoint:NaN}}),K.push({type:"Assertion",kind:"$"});return{type:"Group",capturing:!1,expression:{type:"Alternative",expressions:K}}}function dR(Q,X,Y,J){switch(Q.type){case"Char":return Q;case"Repetition":return Q;case"Quantifier":throw Error("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return J.hasStart=!0,J.hasEnd=!0,{...Q,expressions:Q.expressions.map(($,G)=>L2($,X&&G===0,Y&&G===Q.expressions.length-1))};case"CharacterClass":return Q;case"ClassRange":return Q;case"Group":return{...Q,expression:dR(Q.expression,X,Y,J)};case"Disjunction":return J.hasStart=!0,J.hasEnd=!0,{...Q,left:Q.left!==null?L2(Q.left,X,Y):null,right:Q.right!==null?L2(Q.right,X,Y):null};case"Assertion":if(Q.kind==="^"||Q.kind==="Lookahead")return J.hasStart=!0,Q;else if(Q.kind==="$"||Q.kind==="Lookbehind")return J.hasEnd=!0,Q;else throw Error(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":return Q;case"UnicodeProperty":return Q;default:throw Zf(Q)}}function Kf(Q){return L2(Q,!0,!0)}function uL(Q,X){return Q[X]>="\uD800"&&Q[X]<="\uDBFF"&&Q[X+1]>="\uDC00"&&Q[X+1]<="\uDFFF"?2:1}function m0(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"}function $K(Q){return Q>="0"&&Q<="9"}function pR(Q,X){for(let Y=X;Y!==Q.length;++Y){let J=Q[Y];if(J==="\\")Y+=1;else if(J==="]")return Y}throw Error("Missing closing ']'")}function Wf(Q,X){let Y=0;for(let J=X;J!==Q.length;++J){let $=Q[J];if($==="\\")J+=1;else if($===")"){if(Y===0)return J;Y-=1}else if($==="[")J=pR(Q,J);else if($==="(")Y+=1}throw Error("Missing closing ')'")}function Hf(Q,X){let Y=!1;for(let J=X;J!==Q.length;++J){let $=Q[J];if($K($));else if(X===J)return-1;else if($===","){if(Y)return-1;Y=!0}else if($==="}")return J;else return-1}return-1}function Vf(Q,X,Y,J){switch(Q[X]){case"[":if(J===1)return X+1;return pR(Q,X+1)+1;case"{":{if(J===1)return X+1;let $=Hf(Q,X+1);if($===-1)return X+1;return $+1}case"(":if(J===1)return X+1;return Wf(Q,X+1)+1;case"]":case"}":case")":return X+1;case"\\":{let $=Q[X+1];switch($){case"x":if(m0(Q[X+2])&&m0(Q[X+3]))return X+4;throw Error(`Unexpected token '${Q.substring(X,X+4)}' found`);case"u":if(Q[X+2]==="{"){if(!Y)return X+2;if(Q[X+4]==="}"){if(m0(Q[X+3]))return X+5;throw Error(`Unexpected token '${Q.substring(X,X+5)}' found`)}if(Q[X+5]==="}"){if(m0(Q[X+3])&&m0(Q[X+4]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`)}if(Q[X+6]==="}"){if(m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5]))return X+7;throw Error(`Unexpected token '${Q.substring(X,X+7)}' found`)}if(Q[X+7]==="}"){if(m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5])&&m0(Q[X+6]))return X+8;throw Error(`Unexpected token '${Q.substring(X,X+8)}' found`)}if(Q[X+8]==="}"&&m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5])&&m0(Q[X+6])&&m0(Q[X+7]))return X+9;throw Error(`Unexpected token '${Q.substring(X,X+9)}' found`)}if(m0(Q[X+2])&&m0(Q[X+3])&&m0(Q[X+4])&&m0(Q[X+5]))return X+6;throw Error(`Unexpected token '${Q.substring(X,X+6)}' found`);case"p":case"P":{if(!Y)return X+2;let G=X+2;for(;G<Q.length&&Q[G]!=="}";G+=Q[G]==="\\"?2:1);if(Q[G]!=="}")throw Error("Invalid \\P definition");return G+1}case"k":{let G=X+2;for(;G<Q.length&&Q[G]!==">";++G);if(Q[G]!==">"){if(!Y)return X+2;throw Error("Invalid \\k definition")}return G+1}default:if($K($)){let G=Y?Q.length:Math.min(X+4,Q.length),Z=X+2;for(;Z<G&&$K(Q[Z]);++Z);return Z}return X+(Y?uL(Q,X+1):1)+1}}default:return X+(Y?uL(Q,X):1)}}function D2(Q,X,Y,J){let $=Vf(Q,X,Y,J);return Q.substring(X,$)}var lL={gc:"General_Category",sc:"Script",scx:"Script_Extensions"},j2={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"},_X=SK(j2),EK={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"},GK=SK(EK),cR={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"},rL=SK(cR);function SK(Q){let X={};for(let Y of Object.keys(Q)){let J=Q[Y];if(Array.isArray(J))for(let $=0;$!==J.length;++$)X[J[$]]=Y;else X[J]=Y}return X}function _f(Q){return Q in EK||Q in GK}function qf(Q){return Q in j2||Q in _X}function oL(Q){if(Q in lL)return lL[Q];if(Q in _X)return _X[Q];if(Q in j2||Q==="General_Category"||Q==="Script"||Q==="Script_Extensions")return Q;throw Error(`Unknown Unicode property name: ${Q}`)}function nL(Q){if(Q in GK)return GK[Q];if(Q in rL)return rL[Q];if(Q in _X)return _X[Q];if(Q in EK||Q in cR||Q in j2)return Q;throw Error(`Unknown Unicode property value: ${Q}`)}function Df(Q,X){let Y=Q.indexOf("=");if(Y!==-1){let J=Q.substring(0,Y),$=Q.substring(Y+1);return{type:"UnicodeProperty",name:J,value:$,negative:X,shorthand:!1,binary:!1,canonicalName:oL(J),canonicalValue:nL($)}}if(_f(Q))return{type:"UnicodeProperty",name:"General_Category",value:Q,negative:X,shorthand:!0,binary:!1,canonicalName:"General_Category",canonicalValue:nL(Q)};if(qf(Q)){let J=oL(Q);return{type:"UnicodeProperty",name:Q,value:Q,negative:X,shorthand:!1,binary:!0,canonicalName:J,canonicalValue:J}}throw Error(`Invalid Unicode property: ${Q}`)}var kZ=String.fromCodePoint;function yZ(Q){let X=Q.pop();if(X===void 0)throw Error("Unable to extract token preceeding the currently parsed one");return X}function fR(Q){return Q>="0"&&Q<="9"}function P2(Q,X){return{type:"Char",kind:"simple",symbol:Q,value:Q,codePoint:Q.codePointAt(0)||-1,escaped:X}}function $9(Q,X){return{type:"Char",kind:"meta",symbol:X,value:Q,codePoint:X.codePointAt(0)||-1}}function n4(Q,X){if(Q.length>1)return{type:"Alternative",expressions:Q};if(!X&&Q.length===0)throw Error("Unsupported no token");return Q[0]}function bZ(Q){if(Q[0]==="\\"){let X=Q[1];switch(X){case"x":{let Y=Q.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"hex",symbol:kZ(J),value:Q,codePoint:J}}case"u":{if(Q==="\\u")return P2("u",!0);let Y=Q[2]==="{"?Q.substring(3,Q.length-1):Q.substring(2),J=Number.parseInt(Y,16);return{type:"Char",kind:"unicode",symbol:kZ(J),value:Q,codePoint:J}}case"0":return $9(Q,"\x00");case"n":return $9(Q,`
63
+ `);case"f":return $9(Q,"\f");case"r":return $9(Q,"\r");case"t":return $9(Q,"\t");case"v":return $9(Q,"\v");case"w":case"W":case"d":case"D":case"s":case"S":case"b":case"B":return{type:"Char",kind:"meta",symbol:void 0,value:Q,codePoint:NaN};default:if(fR(X)){let Y=Q.substring(1),J=Number(Y);return{type:"Char",kind:"decimal",symbol:kZ(J),value:Q,codePoint:J}}if(Q.length>2&&(X==="p"||X==="P")){let Y=X==="P";return Df(Q.substring(3,Q.length-1),Y)}return P2(Q.substring(1),!0)}}return P2(Q)}function G9(Q,X,Y,J){let $=null;for(let G=0,Z=D2(X,G,Y,0);G!==X.length;G+=Z.length,Z=D2(X,G,Y,0)){let K=Z[0];switch(K){case"|":if($===null)$=[];$.push(n4(Q.splice(0),!0)||null);break;case".":Q.push({type:"Char",kind:"meta",symbol:Z,value:Z,codePoint:NaN});break;case"*":case"+":{let W=yZ(Q);Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"?":{let W=yZ(Q);if(W.type==="Repetition")W.quantifier.greedy=!1,Q.push(W);else Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:K,greedy:!0}});break}case"{":{if(Z==="{"){Q.push(P2(Z));break}let W=yZ(Q),H=Z.substring(1,Z.length-1).split(","),_=Number(H[0]),V=H.length===1?_:H[1].length!==0?Number(H[1]):void 0;Q.push({type:"Repetition",expression:W,quantifier:{type:"Quantifier",kind:"Range",greedy:!0,from:_,to:V}});break}case"[":{let W=Z.substring(1,Z.length-1),H=[],_=void 0,V=!1;for(let q=0,D=D2(W,q,Y,1);q!==W.length;q+=D.length,D=D2(W,q,Y,1)){if(q===0&&D==="^"){_=!0;continue}let U=bZ(D);if(D==="-")H.push(U),V=!0;else{let P=H.length>=2?H[H.length-2]:void 0;if(V&&P!==void 0&&P.type==="Char"&&U.type==="Char")H.pop(),H.pop(),H.push({type:"ClassRange",from:P,to:U});else H.push(U);V=!1}}Q.push({type:"CharacterClass",expressions:H,negative:_});break}case"(":{let W=Z.substring(1,Z.length-1),H=[];if(W[0]==="?")if(W[1]===":")G9(H,W.substring(2),Y,J),Q.push({type:"Group",capturing:!1,expression:n4(H)});else if(W[1]==="="||W[1]==="!")G9(H,W.substring(2),Y,J),Q.push({type:"Assertion",kind:"Lookahead",negative:W[1]==="!"?!0:void 0,assertion:n4(H)});else if(W[1]==="<"&&(W[2]==="="||W[2]==="!"))G9(H,W.substring(3),Y,J),Q.push({type:"Assertion",kind:"Lookbehind",negative:W[2]==="!"?!0:void 0,assertion:n4(H)});else{let _=W.split(">");if(_.length<2||_[0][1]!=="<")throw Error(`Unsupported regex content found at ${JSON.stringify(Z)}`);let V=++J.lastIndex,q=_[0].substring(2);J.named.set(q,V),G9(H,_.slice(1).join(">"),Y,J),Q.push({type:"Group",capturing:!0,nameRaw:q,name:q,number:V,expression:n4(H)})}else{let _=++J.lastIndex;G9(H,W,Y,J),Q.push({type:"Group",capturing:!0,number:_,expression:n4(H)})}break}default:if(Z==="^")Q.push({type:"Assertion",kind:Z});else if(Z==="$")Q.push({type:"Assertion",kind:Z});else if(Z[0]==="\\"&&fR(Z[1])){let W=Number(Z.substring(1));if(Y||W<=J.lastIndex)Q.push({type:"Backreference",kind:"number",number:W,reference:W});else Q.push(bZ(Z))}else if(Z[0]==="\\"&&Z[1]==="k"&&Z.length!==2){let W=Z.substring(3,Z.length-1);Q.push({type:"Backreference",kind:"name",number:J.named.get(W)||0,referenceRaw:W,reference:W})}else Q.push(bZ(Z));break}}if($!==null){$.push(n4(Q.splice(0),!0)||null);let G={type:"Disjunction",left:$[0],right:$[1]};for(let Z=2;Z<$.length;++Z)G={type:"Disjunction",left:G,right:$[Z]};Q.push(G)}}function Bf(Q){let X=V4([...Q.flags],"u")!==-1,Y=Q.source,J=[];return G9(J,Y,X,{lastIndex:0,named:new Map}),n4(J)}var Uf=String.fromCodePoint;function Of(Q){if(Q.binary||Q.shorthand)return Q.canonicalValue;return`${Q.canonicalName}=${Q.canonicalValue}`}function iL(Q,X,Y,J){let $=-1;for(let G=X;G<=Y;++G)if(Q.test(Uf(G))){if($===-1)$=G}else if($!==-1){let Z=G-1;J.push($===Z?[Z]:[$,Z]),$=-1}if($!==-1)J.push($===Y?[Y]:[$,Y])}function zf(Q,X){let Y=new RegExp(`^\\${X?"P":"p"}{${Q}}$`,"u"),J=[];return iL(Y,0,55295,J),iL(Y,57344,1114111,J),J}var aL=new Map;function Ff(Q,X){let Y=`${X?"P":"p"}:${Q}`,J=aL.get(Y);if(J!==void 0)return J;let $=zf(Q,X);return aL.set(Y,$),$}function Lf(Q){return _9(...G0(Ff(Of(Q),Q.negative),(X)=>fZ(X)))}var Pf=String.fromCodePoint,sL=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],tL=[..."0123456789"],eL=[...` \r
64
+ \v\f`],ZK=[...`\r
65
+ `],uR=[..."\x1E\x15"],Rf=[...ZK,...uR],a6=()=>d0({unit:"grapheme-ascii",minLength:1,maxLength:1});function QP(Q){return new S(`Unsupported AST node! Received: ${b0(Q)}`)}function i4(Q,X,Y){switch(Q.type){case"Char":if(Q.kind==="meta")switch(Q.value){case"\\w":return m8(...sL);case"\\W":return a6().filter((J)=>V4(sL,J)===-1);case"\\d":return m8(...tL);case"\\D":return a6().filter((J)=>V4(tL,J)===-1);case"\\s":return m8(...eL);case"\\S":return a6().filter((J)=>V4(eL,J)===-1);case"\\b":case"\\B":throw new S(`Meta character ${Q.value} not implemented yet!`);case".":{let J=Y.dotAll?uR:Rf;return a6().filter(($)=>V4(J,$)===-1)}}if(Q.symbol===void 0)throw new S(`Unexpected undefined symbol received for non-meta Char! Received: ${b0(Q)}`);return y0(Q.symbol);case"Repetition":{let J=i4(Q.expression,X,Y);switch(Q.quantifier.kind){case"*":return d0({...X,unit:J});case"+":return d0({...X,minLength:1,unit:J});case"?":return d0({...X,minLength:0,maxLength:1,unit:J});case"Range":return d0({...X,minLength:Q.quantifier.from,maxLength:Q.quantifier.to,unit:J});default:throw QP(Q.quantifier)}}case"Quantifier":throw new S("Wrongly defined AST tree, Quantifier nodes not supposed to be scanned!");case"Alternative":return Q0(...G0(Q.expressions,(J)=>i4(J,X,Y))).map((J)=>w0(J,""));case"CharacterClass":if(Q.negative){let J=G0(Q.expressions,($)=>i4($,X,Y));return a6().filter(($)=>qP(J,(G)=>!G.canShrinkWithoutContext($)))}return l0(...G0(Q.expressions,(J)=>i4(J,X,Y)));case"ClassRange":{let J=Q.from.codePoint,$=Q.to.codePoint;return O0({min:J,max:$}).map((G)=>Pf(G),(G)=>{if(typeof G!=="string")throw new S("Invalid type");if([...G].length!==1)throw new S("Invalid length");return W9(G,0)})}case"Group":return i4(Q.expression,X,Y);case"Disjunction":return l0(Q.left!==null?i4(Q.left,X,Y):y0(""),Q.right!==null?i4(Q.right,X,Y):y0(""));case"Assertion":if(Q.kind==="^"||Q.kind==="$"){if(Y.multiline)if(Q.kind==="^")return l0(y0(""),Q0(d0({unit:a6()}),m8(...ZK)).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new S("Invalid type");return[S0(J,0,J.length-1),J[J.length-1]]}));else return l0(y0(""),Q0(m8(...ZK),d0({unit:a6()})).map((J)=>`${J[0]}${J[1]}`,(J)=>{if(typeof J!=="string"||J.length===0)throw new S("Invalid type");return[J[0],S0(J,1)]}));return y0("")}throw new S(`Assertions of kind ${Q.kind} not implemented yet!`);case"Backreference":throw new S("Backreference nodes not implemented yet!");case"UnicodeProperty":return Lf(Q);default:throw QP(Q)}}function Nf(Q,X={}){for(let K of Q.flags)if(K!=="d"&&K!=="g"&&K!=="m"&&K!=="s"&&K!=="u")throw new S(`Unable to use "stringMatching" against a regex using the flag ${K}`);let Y=X.maxLength,J={size:X.size,maxLength:Y},$={multiline:Q.multiline,dotAll:Q.dotAll},G=Kf(Bf(Q));if(Y!==void 0)G=Gf(G,Y);let Z=i4(G,J,$);if(Y!==void 0)return Z.filter((K)=>[...K].length<=Y);return Z}function Mf(Q){let X=[];for(let Y=0;Y!==Q.length;++Y)X.push(Q[Y].next());return X}function Af(Q,X){for(let Y=0;Y!==Q.length;++Y)X[Y]=Q[Y].next()}function wf(Q){for(let X=0;X!==Q.length;++X)if(Q[X].done)return!0;return!1}function*Cf(...Q){let X=Mf(Q);while(!wf(X))yield X.map((Y)=>Y.value),Af(Q,X)}function*Tf(Q){let X=Q;while(!0)yield X,++X}var If=class extends C0{constructor(Q,X){super();this.arb=Q,this.maxShrinks=X}generate(Q,X){let Y=this.arb.generate(Q,X);return this.valueMapper(Y,0)}canShrinkWithoutContext(Q){return this.arb.canShrinkWithoutContext(Q)}shrink(Q,X){if(this.isSafeContext(X))return this.safeShrink(Q,X.originalContext,X.length);return this.safeShrink(Q,void 0,0)}safeShrink(Q,X,Y){let J=this.maxShrinks-Y;if(J<=0)return s.nil();return new s(Cf(this.arb.shrink(Q,X),Tf(Y+1))).take(J).map(($)=>this.valueMapper($[0],$[1]))}valueMapper(Q,X){let Y={originalContext:Q.context,length:X};return new k(Q.value,Y)}isSafeContext(Q){return Q!==null&&Q!==void 0&&typeof Q==="object"&&"originalContext"in Q&&"length"in Q}};function jf(Q,X){return new If(Q,X)}var Ef="module",Sf="4.8.0",xf="c0da76fbcf6470339ad7bb2f0dfcebee06ede56c";var BX=nY;function f1(){return(Q,X,Y)=>{return I(new p6(Q.map(fQ),(J)=>X(J.map(($)=>I($))),Y))}}function O4(Q,X){return f1()([],()=>(Y,J)=>Q(Y)?h(Y):y(new v0(J,F(Y))),X)}function vf(Q){return Q}function kf(Q){return(X)=>X.annotate(Q)}function yf(Q){return(X)=>vK(vK(X).annotate(Q))}function bf(Q){return(X)=>{return X.rebuild(nQ(X.ast,Q))}}function gf(Q){return Q}function hf(Q){return N(Q,iY)}function lR(Q){return H8(Q)?Q.value:{issues:[{message:iJ(Q.cause)}]}}function mf(Q,X){let Y=h0(Q),J={errors:"all",...X?.parseOptions},$=YU(X),G=(Z)=>{let K=new M5,W=h5(E$(Y(Z,J),{onFailure:$,onSuccess:(_)=>({value:_})}),{scheduler:K});W.currentDispatcher?.flush();let H=W.pollUnsafe();if(H)return lR(H);return new Promise((_)=>{W.addObserver((V)=>{_(lR(V))})})};if("~standard"in Q){let Z=Q;if("validate"in Z["~standard"])return Z;return Object.assign(Z["~standard"],{validate:G}),Z}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",validate:G}})}function rR(Q,X){let Y=MM(Q);if(X==="draft-2020-12"){let J=Y.schema;if(Object.keys(Y.definitions).length>0)J.$defs=Y.definitions;return J}else if(X==="draft-07"){let J=vz(Y),$=J.schema;if(Object.keys(J.definitions).length>0)$.definitions=J.definitions;return $}throw new globalThis.Error(`Unsupported target: ${X}`)}function df(Q){let X={input(Y){return rR(Q,Y.target)},output(Y){return rR(R1(Q),Y.target)}};if("~standard"in Q){let Y=Q;if("jsonSchema"in Y["~standard"])return Y;return Object.assign(Y["~standard"],{jsonSchema:X}),Y}else return Object.assign(Q,{"~standard":{version:1,vendor:"effect",jsonSchema:X}})}var YN=Vz,pf=qz;function E2(Q,X){let Y=h0(Q,X);return(J,$)=>{return X1(Y(J,$),(G)=>new g8(G))}}var cf=E2;function JN(Q,X){let Y=Dz(Q,X);return(J,$)=>{return b7(Y(J,$),(G)=>new g8(G))}}var ff=JN,$N=Bz,uf=$N;function GN(Q,X){let Y=Uz(Q,X);return(J,$)=>{return z5(Y(J,$),(G)=>new g8(G))}}var lf=GN;function ZN(Q,X){let Y=E2(Q,X);return(J,$)=>{return NQ(Y(J,$))}}var rf=ZN;function KN(Q,X){let Y=E2(Q,X);return(J,$)=>{return d4(Y(J,$))}}var of=KN;function S2(Q,X){let Y=e5(Q,X);return(J,$)=>{return X1(Y(J,$),(G)=>new g8(G))}}var WN=S2;function HN(Q,X){let Y=Oz(Q,X);return(J,$)=>{return b7(Y(J,$),(G)=>new g8(G))}}var nf=HN,VN=zz,af=VN;function _N(Q,X){let Y=Fz(Q,X);return(J,$)=>{return z5(Y(J,$),(G)=>new g8(G))}}var sf=_N;function qN(Q,X){let Y=S2(Q,X);return(J,$)=>{return NQ(Y(J,$))}}var tf=qN;function DN(Q,X){let Y=S2(Q,X);return(J,$)=>{return d4(Y(J,$))}}var ef=DN,I=n6;function Qu(Q){class X{}return Object.setPrototypeOf(X,Q)}function x2(Q){return N(Q,BX)&&Q[BX]===BX}var X6=_1((Q)=>I(mY(Q.ast),{schema:Q})),Xu=_1((Q)=>Q.schema),B9=_1((Q)=>X6(k2(Q))),Yu=_1((Q)=>Q.schema.members[0]),Ju=_1((Q)=>I(gG(Q.ast),{schema:Q})),$u=_1((Q)=>Q.schema),R1=_1((Q)=>I(U8(Q.ast),{schema:Q})),U9=_1((Q)=>I(Y1(Q.ast),{schema:Q})),UX="~effect/Schema/flip";function Gu(Q){return N(Q,UX)&&Q[UX]===UX}function vK(Q){if(Gu(Q))return Q.schema.rebuild(B8(Q.ast));return I(B8(Q.ast),{[UX]:UX,schema:Q})}function t0(Q){let X=I(new g1(Q),{literal:Q,transform(Y){return X.pipe(p(t0(Y),{decode:r(()=>Y),encode:r(()=>Q)}))}});return X}function BN(Q){return new jG(Q.map((X)=>x2(X)?X.ast:new g1(X)))}function Zu(Q){return I(BN(Q),{parts:Q})}function Ku(Q){return I(BN(Q).asTemplateLiteralParser(),{parts:Q})}function Wu(Q){return I(new IG(Object.keys(Q).filter((X)=>typeof Q[Q[X]]!=="number").map((X)=>[X,Q[X]])),{enums:Q})}var Hu=I(VO),Vu=I(qO),gK=I(m6),hK=I(a5),mK=I(TG),o=I(c6),Y6=I(SG),UN=I(PO),ON=I(NO),v2=I(AO),_u=I(WO),qu=I(UO);function Du(Q){return I(new EG(Q))}function dK(Q,X){return I(Q,{fields:X,mapFields(Y,J){let $=Y(this.fields);return dK(xY($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function R0(Q){return dK(xY(Q,void 0),Q)}function Bu(Q){return _1((X)=>X.mapFields(Qz(Q)))}function Uu(Q){return function(X){let Y={},J={};for(let $ in X.fields){let G=U9(X.fields[$]);if(Object.hasOwn(Q,$))Y[Q[$]]=G,J[Q[$]]=$;else Y[$]=G}return R0(Y).pipe(p(X,j0({decode:fG(J),encode:fG(Q)})))}}function Ou(Q,X){return(Y)=>{let J=F5(Y.fields,R1),$=R0({...J,...Q});return Y.pipe(p($,j0({decode:(G)=>{let Z={...G};for(let K in Q){let W=X[K],H=W(G);if(O1(H))Z[K]=H.value}return Z},encode:(G)=>{let Z={...G};for(let K in Q)delete Z[K];return Z}})))}}function zN(Q,X,Y){let J=Y?.keyValueCombiner?.decode||Y?.keyValueCombiner?.encode?new SY(Y.keyValueCombiner.decode,Y.keyValueCombiner.encode):void 0;return I(bO(Q.ast,X.ast,J),{key:Q,value:X})}function zu(Q,X){return I(wO(Q.ast,X.map(fQ)),{schema:Q,records:X})}function FN(Q,X){return I(Q,{elements:X,mapElements(Y,J){let $=Y(this.elements);return FN(kG($,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function D9(Q){return FN(kG(Q),Q)}function Fu(Q,X){return I(CO(Q.ast,X.map(fQ)),{schema:Q,rest:X})}var f0=_1((Q)=>I(new H4(!1,[],[Q.ast]),{value:Q}));var Lu=_1((Q)=>I(new H4(!1,[Q.ast],[Q.ast]),{value:Q}));function Pu(Q){return J1([Q,f0(Q)]).pipe(p(f0(R1(Q)),j0({decode:DH,encode:(X)=>X.length===1?X[0]:X})))}function Ru(Q){return f0(Q).check(fN())}var Nu=_1((Q)=>{return I(new H4(!0,Q.ast.elements,Q.ast.rest),{schema:Q})});function LN(Q,X){return I(Q,{members:X,mapMembers(Y,J){let $=Y(this.members);return LN(vY($,this.ast.mode,J?.unsafePreserveChecks?this.ast.checks:void 0),$)}})}function J1(Q,X){return LN(vY(Q,X?.mode??"anyOf",void 0),Q)}function pK(Q){let X=Q.map(t0);return I(vY(X,"anyOf",void 0),{literals:Q,members:X,mapMembers(Y){return J1(Y(this.members))},pick(Y){return pK(Y)},transform(Y){return J1(X.map((J,$)=>J.transform(Y[$])))}})}var cK=_1((Q)=>J1([Q,hK])),k2=_1((Q)=>J1([Q,mK])),PN=_1((Q)=>J1([Q,hK,mK]));function RN(Q){return I(new kY(()=>Q().ast))}function Mu(...Q){return(X)=>X.check(...Q)}function Au(Q,X){return(Y)=>I(l4(Y.ast,[yY(Q,X)]),{schema:Y})}function NN(Q){return(X)=>I(vO(X.ast,Q),{schema:X,identifier:Q})}function wu(Q,X){return(Y)=>{return(X.checks?Y.check(...X.checks):Y).pipe(NN(Q))}}function fK(Q){return(X)=>I(SO(X.ast,new gQ(Q,g)),{schema:X})}function MN(Q){return(X)=>I(xO(X.ast,new gQ(g,Q)),{schema:X})}function Cu(Q){return AN(Q)}function AN(Q){return(X)=>X.pipe(fK(m5(Q)))}function Tu(Q){return wN(Q)}function wN(Q){return(X)=>X.pipe(MN(m5(Q)))}function p(Q,X){return(Y)=>{return I(dY(Y.ast,Q.ast,X?MY(X):h6()),{from:Y,to:Q})}}function Iu(Q){return(X)=>{return X.pipe(p(R1(X),Q))}}function uK(Q,X){return(Y)=>{return X?Q.pipe(p(Y,X)):Q.pipe(p(Y))}}function ju(Q){return(X)=>{return U9(X).pipe(p(X,Q))}}function CN(Q){return(X)=>I(kO(X.ast,X1(Q,(Y)=>Y.issue)),{schema:X})}function lK(Q,X){let Y=X?.encodingStrategy==="omit"?DG():b1();return(J)=>{return X6(U9(J)).pipe(p(J,{decode:bQ(X1(Q,($)=>$.issue)),encode:Y}))}}function Eu(Q,X){return(Y)=>{return R1(Y).pipe(lK(Q,X),uK(X6(Y)))}}function TN(Q,X){let Y=X?.encodingStrategy==="omit"?DG():b1();return(J)=>{return B9(U9(J)).pipe(p(J,{decode:bQ(X1(Q,($)=>$.issue)),encode:Y}))}}function Su(Q,X){return(Y)=>{return R1(Y).pipe(TN(Q,X),uK(B9(Y)))}}function Q5(Q){return t0(Q).pipe(CN(h(Q)))}function xu(Q){return Q5(Q).pipe(lK(h(Q),{encodingStrategy:"omit"}))}function y2(Q,X){return R0({_tag:Q5(Q),...X})}function IN(Q){return(X)=>{let Y={},J={},$=(K)=>(W)=>K.includes(W[Q]);return G(X),Object.assign(X,{cases:Y,isAnyOf:$,guards:J,match:Z});function G(K){let W=K.ast;if(jY(W)&&"members"in K&&globalThis.Array.isArray(K.members)&&K.members.every(x2))return K.members.forEach(G);let H=uQ(W);if(H.length>0){let _=H.find((V)=>V.key===Q)?.literal;if(AX(_)){Y[_]=K,J[_]=YN(R1(K));return}}throw new globalThis.Error("No literal or unique symbol found")}function Z(){if(arguments.length===1){let H=arguments[0];return function(_){return H[_[Q]](_)}}let K=arguments[0];return arguments[1][K[Q]](K)}}}function vu(Q){let X={},Y=[];for(let K of Object.keys(Q))Y.push(X[K]=y2(K,Q[K]));let J=J1(Y),{guards:$,isAnyOf:G,match:Z}=IN("_tag")(J);return I(J.ast,{cases:X,isAnyOf:G,guards:$,match:Z})}function ku(){return(Q)=>{class X{}return Object.setPrototypeOf(X,Q)}}function z4(Q,X){return O4((Y)=>Y instanceof Q,X)}function N0(){return(Q,X)=>{return new B0(Q.ast,MY(X))}}var z0=yG;function yu(Q,X=void 0){return new u4(Q,X)}var oR="^\\S[\\s\\S]*\\S$|^\\S$|^$";function jN(Q){return z0((X)=>X.trim()===X,{expected:"a string with no leading or trailing whitespace",meta:{_tag:"isTrimmed",regExp:new globalThis.RegExp(oR)},toArbitraryConstraint:{string:{patterns:[oR]}},...Q})}var O9=rQ,bu=mG,gu=dG,hu=cG,mu=(Q)=>{if(Q)return new globalThis.RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$/};function du(Q,X){let Y=mu(Q);return O9(Y,{expected:Q?`a UUID v${Q}`:"a UUID",meta:{_tag:"isUUID",regExp:Y,version:Q},...X})}var nR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;function pu(Q){return O9(nR,{expected:"a GUID",meta:{_tag:"isGUID",regExp:nR},...Q})}function cu(Q){let X=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;return O9(X,{meta:{_tag:"isULID",regExp:X},...Q})}function EN(Q){let X=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;return O9(X,{expected:"a base64 encoded string",meta:{_tag:"isBase64",regExp:X},...Q})}function fu(Q){let X=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;return O9(X,{expected:"a base64url encoded string",meta:{_tag:"isBase64Url",regExp:X},...Q})}function uu(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.startsWith(Q),{expected:`a string starting with ${Y}`,meta:{_tag:"isStartsWith",startsWith:Q,regExp:new globalThis.RegExp(`^${Q}`)},toArbitraryConstraint:{string:{patterns:[`^${Q}`]}},...X})}function lu(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.endsWith(Q),{expected:`a string ending with ${Y}`,meta:{_tag:"isEndsWith",endsWith:Q,regExp:new globalThis.RegExp(`${Q}$`)},toArbitraryConstraint:{string:{patterns:[`${Q}$`]}},...X})}function ru(Q,X){let Y=JSON.stringify(Q);return z0((J)=>J.includes(Q),{expected:`a string including ${Y}`,meta:{_tag:"isIncludes",includes:Q,regExp:new globalThis.RegExp(Q)},toArbitraryConstraint:{string:{patterns:[Q]}},...X})}var iR="^[^a-z]*$";function ou(Q){return z0((X)=>X.toUpperCase()===X,{expected:"a string with all characters in uppercase",meta:{_tag:"isUppercased",regExp:new globalThis.RegExp(iR)},toArbitraryConstraint:{string:{patterns:[iR]}},...Q})}var aR="^[^A-Z]*$";function nu(Q){return z0((X)=>X.toLowerCase()===X,{expected:"a string with all characters in lowercase",meta:{_tag:"isLowercased",regExp:new globalThis.RegExp(aR)},toArbitraryConstraint:{string:{patterns:[aR]}},...Q})}var sR="^[^a-z]?.*$";function iu(Q){return z0((X)=>X.charAt(0).toUpperCase()===X.charAt(0),{expected:"a string with the first character in uppercase",meta:{_tag:"isCapitalized",regExp:new globalThis.RegExp(sR)},toArbitraryConstraint:{string:{patterns:[sR]}},...Q})}var tR="^[^A-Z]?.*$";function au(Q){return z0((X)=>X.charAt(0).toLowerCase()===X.charAt(0),{expected:"a string with the first character in lowercase",meta:{_tag:"isUncapitalized",regExp:new globalThis.RegExp(tR)},toArbitraryConstraint:{string:{patterns:[tR]}},...Q})}function SN(Q){return z0((X)=>globalThis.Number.isFinite(X),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...Q})}function OX(Q){let X=B5(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((G)=>X(G,J),{expected:`a value greater than ${Y(J)}`,...Q.annotate?.(J),...$})}}function zX(Q){let X=fX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((G)=>X(G,J),{expected:`a value greater than or equal to ${Y(J)}`,...Q.annotate?.(J),...$})}}function FX(Q){let X=pX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((G)=>X(G,J),{expected:`a value less than ${Y(J)}`,...Q.annotate?.(J),...$})}}function LX(Q){let X=cX(Q.order),Y=Q.formatter??v;return(J,$)=>{return z0((G)=>X(G,J),{expected:`a value less than or equal to ${Y(J)}`,...Q.annotate?.(J),...$})}}function PX(Q){let X=fX(Q.order),Y=B5(Q.order),J=cX(Q.order),$=pX(Q.order),G=Q.formatter??v;return(Z,K)=>{let W=Z.exclusiveMinimum?Y:X,H=Z.exclusiveMaximum?$:J;return z0((_)=>W(_,Z.minimum)&&H(_,Z.maximum),{expected:`a value between ${G(Z.minimum)}${Z.exclusiveMinimum?" (excluded)":""} and ${G(Z.maximum)}${Z.exclusiveMaximum?" (excluded)":""}`,...Q.annotate?.(Z),...K})}}function xN(Q){return(X,Y)=>{let J=Q.formatter??v;return z0(($)=>Q.remainder($,X)===Q.zero,{expected:`a value that is a multiple of ${J(X)}`,...Q.annotate?.(X),...Y})}}var su=OX({order:U1,annotate:(Q)=>({meta:{_tag:"isGreaterThan",exclusiveMinimum:Q},toArbitraryConstraint:{number:{min:Q,minExcluded:!0}}})}),vN=zX({order:U1,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:Q},toArbitraryConstraint:{number:{min:Q}}})}),tu=FX({order:U1,annotate:(Q)=>({meta:{_tag:"isLessThan",exclusiveMaximum:Q},toArbitraryConstraint:{number:{max:Q,maxExcluded:!0}}})}),eu=LX({order:U1,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualTo",maximum:Q},toArbitraryConstraint:{number:{max:Q}}})}),rK=PX({order:U1,annotate:(Q)=>{return{meta:{_tag:"isBetween",...Q},toArbitraryConstraint:{number:{min:Q.minimum,max:Q.maximum,...Q.exclusiveMinimum&&{minExcluded:!0},...Q.exclusiveMaximum&&{maxExcluded:!0}}}}}}),Ql=xN({remainder:WD,zero:0,annotate:(Q)=>({expected:`a value that is a multiple of ${Q}`,meta:{_tag:"isMultipleOf",divisor:Q}})});function b2(Q){return z0((X)=>globalThis.Number.isSafeInteger(X),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...Q})}function Xl(Q){return new u4([b2(Q),rK({minimum:-2147483648,maximum:2147483647})],{expected:"a 32-bit integer",...Q})}function Yl(Q){return new u4([b2(),rK({minimum:0,maximum:4294967295})],{expected:"a 32-bit unsigned integer",...Q})}function kN(Q){return z0((X)=>!isNaN(X.getTime()),{expected:"a valid date",meta:{_tag:"isDateValid"},toArbitraryConstraint:{date:{noInvalidDate:!0}},...Q})}var yN=(Q)=>new globalThis.Date(Q.getTime()+1),bN=(Q)=>new globalThis.Date(Q.getTime()-1),Jl=OX({order:D5,annotate:(Q)=>({meta:{_tag:"isGreaterThanDate",exclusiveMinimum:Q},toArbitraryConstraint:{date:{min:yN(Q)}}})}),$l=zX({order:D5,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualToDate",minimum:Q},toArbitraryConstraint:{date:{min:Q}}})}),Gl=FX({order:D5,annotate:(Q)=>({meta:{_tag:"isLessThanDate",exclusiveMaximum:Q},toArbitraryConstraint:{date:{max:bN(Q)}}})}),Zl=LX({order:D5,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualToDate",maximum:Q},toArbitraryConstraint:{date:{max:Q}}})}),Kl=PX({order:D5,annotate:(Q)=>({meta:{_tag:"isBetweenDate",...Q},toArbitraryConstraint:{date:{min:Q.exclusiveMinimum?yN(Q.minimum):Q.minimum,max:Q.exclusiveMaximum?bN(Q.maximum):Q.maximum}}})}),gN=(Q)=>Q+globalThis.BigInt(1),hN=(Q)=>Q-globalThis.BigInt(1),Wl=OX({order:T8,annotate:(Q)=>({meta:{_tag:"isGreaterThanBigInt",exclusiveMinimum:Q},toArbitraryConstraint:{bigint:{min:gN(Q)}}})}),mN=zX({order:T8,annotate:(Q)=>({meta:{_tag:"isGreaterThanOrEqualToBigInt",minimum:Q},toArbitraryConstraint:{bigint:{min:Q}}})}),Hl=FX({order:T8,annotate:(Q)=>({meta:{_tag:"isLessThanBigInt",exclusiveMaximum:Q},toArbitraryConstraint:{bigint:{max:hN(Q)}}})}),Vl=LX({order:T8,annotate:(Q)=>({meta:{_tag:"isLessThanOrEqualToBigInt",maximum:Q},toArbitraryConstraint:{bigint:{max:Q}}})}),_l=PX({order:T8,annotate:(Q)=>({meta:{_tag:"isBetweenBigInt",...Q},toArbitraryConstraint:{bigint:{min:Q.exclusiveMinimum?gN(Q.minimum):Q.minimum,max:Q.exclusiveMaximum?hN(Q.maximum):Q.maximum}}})}),ql=OX({order:d5,formatter:(Q)=>k8(Q)}),Dl=zX({order:d5,formatter:(Q)=>k8(Q)}),Bl=FX({order:d5,formatter:(Q)=>k8(Q)}),Ul=LX({order:d5,formatter:(Q)=>k8(Q)}),Ol=PX({order:d5,formatter:(Q)=>k8(Q)});function dN(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.length>=Q,{expected:`a value with a length of at least ${Q}`,meta:{_tag:"isMinLength",minLength:Q},[m1]:!0,toArbitraryConstraint:{string:{minLength:Q},array:{minLength:Q}},...X})}function pN(Q){return dN(1,Q)}function zl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.length<=Q,{expected:`a value with a length of at most ${Q}`,meta:{_tag:"isMaxLength",maxLength:Q},[m1]:!0,toArbitraryConstraint:{string:{maxLength:Q},array:{maxLength:Q}},...X})}function cN(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>J.length>=Q&&J.length<=X,{expected:Q===X?`a value with a length of ${Q}`:`a value with a length between ${Q} and ${X}`,meta:{_tag:"isLengthBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{string:{minLength:Q,maxLength:X},array:{minLength:Q,maxLength:X}},...Y})}function Fl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.size>=Q,{expected:`a value with a size of at least ${Q}`,meta:{_tag:"isMinSize",minSize:Q},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q}},...X})}function Ll(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Y.size<=Q,{expected:`a value with a size of at most ${Q}`,meta:{_tag:"isMaxSize",maxSize:Q},[m1]:!0,toArbitraryConstraint:{array:{maxLength:Q}},...X})}function Pl(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>J.size>=Q&&J.size<=X,{expected:Q===X?`a value with a size of ${Q}`:`a value with a size between ${Q} and ${X}`,meta:{_tag:"isSizeBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q,maxLength:X}},...Y})}function Rl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Reflect.ownKeys(Y).length>=Q,{expected:`a value with at least ${Q===1?"1 entry":`${Q} entries`}`,meta:{_tag:"isMinProperties",minProperties:Q},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q}},...X})}function Nl(Q,X){return Q=Math.max(0,Math.floor(Q)),z0((Y)=>Reflect.ownKeys(Y).length<=Q,{expected:`a value with at most ${Q===1?"1 entry":`${Q} entries`}`,meta:{_tag:"isMaxProperties",maxProperties:Q},[m1]:!0,toArbitraryConstraint:{array:{maxLength:Q}},...X})}function Ml(Q,X,Y){return Q=Math.max(0,Math.floor(Q)),X=Math.max(0,Math.floor(X)),z0((J)=>Reflect.ownKeys(J).length>=Q&&Reflect.ownKeys(J).length<=X,{expected:Q===X?`a value with exactly ${Q===1?"1 entry":`${Q} entries`}`:`a value with between ${Q} and ${X} entries`,meta:{_tag:"isPropertiesLengthBetween",minimum:Q,maximum:X},[m1]:!0,toArbitraryConstraint:{array:{minLength:Q,maxLength:X}},...Y})}function Al(Q,X){let Y=U9(Q),J=_z(Y.ast);return z0(($,G,Z)=>{let K=Reflect.ownKeys($),W=[];for(let H of K){let _=J(H,Z);if(_!==void 0){if(W.push(new A0([H],_)),Z.errors==="first")break}}if(K8(W))return new q0(G,F($),W);return!0},{expected:"an object with property names matching the schema",meta:{_tag:"isPropertyNames",propertyNames:Y.ast},[m1]:!0,...X})}function fN(Q){let X=SX();return z0((Y)=>j3(Y,X).length===Y.length,{expected:"an array with unique items",meta:{_tag:"isUnique"},toArbitraryConstraint:{array:{comparator:X}},...Q})}var wl=o.check(pN()),Cl=o.check(cN(1,1));function X5(Q){let X=f1()([Q],([Y])=>(J,$,G)=>{if(iW(J)){if(I0(J))return x8;return a0(h0(Y)(J.value,G),{onSuccess:F,onFailure:(Z)=>new q0($,F(J),[new A0(["value"],Z)])})}return y(new v0($,F(J)))},{typeConstructor:{_tag:"effect/Option"},generation:{runtime:"Schema.Option(?)",Type:"Option.Option<?>",importDeclaration:'import * as Option from "effect/Option"'},expected:"Option",toCodec:([Y])=>N0()(J1([R0({_tag:t0("Some"),value:Y}),R0({_tag:t0("None")})]),j0({decode:(J)=>J._tag==="None"?b():F(J.value),encode:(J)=>O1(J)?{_tag:"Some",value:J.value}:{_tag:"None"}})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Option"}:{},J.constant(b()),Y.map(F))},toEquivalence:([Y])=>eW(Y),toFormatter:([Y])=>E1({onNone:()=>"none()",onSome:(J)=>`some(${Y(J)})`})});return I(X.ast,{value:Q})}function Tl(Q){return cK(Q).pipe(p(X5(R1(Q)),yU()))}function Il(Q){return k2(Q).pipe(p(X5(R1(Q)),bU()))}function jl(Q,X){return PN(Q).pipe(p(X5(R1(Q)),gU(X)))}function El(Q){return X6(Q).pipe(p(X5(R1(Q)),hU()))}function Sl(Q){return B9(Q).pipe(p(X5(R1(Q)),mU()))}function xl(Q,X){let Y=X===void 0?"omit":X.onNoneEncoding,J=Y===null?null:void 0;return B9(cK(Q)).pipe(p(X5(R1(Q)),AY({decode:($)=>$.pipe(O5(wX),F),encode:Y==="omit"?U5:($)=>F(lX(U5($),()=>J))})))}function vl(Q,X){let Y=f1()([Q,X],([J,$])=>(G,Z,K)=>{if(!WH(G))return y(new v0(Z,F(G)));switch(G._tag){case"Success":return a0(nG(J)(G.success,K),{onSuccess:l,onFailure:(W)=>new q0(Z,F(G),[new A0(["success"],W)])});case"Failure":return a0(nG($)(G.failure,K),{onSuccess:f,onFailure:(W)=>new q0(Z,F(G),[new A0(["failure"],W)])})}},{typeConstructor:{_tag:"effect/Result"},generation:{runtime:"Schema.Result(?, ?)",Type:"Result.Result<?, ?>",importDeclaration:'import * as Result from "effect/Result"'},expected:"Result",toCodec:([J,$])=>N0()(J1([R0({_tag:t0("Success"),success:J}),R0({_tag:t0("Failure"),failure:$})]),j0({decode:(G)=>G._tag==="Success"?l(G.success):f(G.failure),encode:(G)=>w1(G)?{_tag:"Success",success:G.success}:{_tag:"Failure",failure:G.failure}})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"Result"}:{},J.map(l),$.map(f))},toEquivalence:([J,$])=>HH(J,$),toFormatter:([J,$])=>o1({onSuccess:(G)=>`success(${J(G)})`,onFailure:(G)=>`failure(${$(G)})`})});return I(Y.ast,{success:Q,failure:X})}function uN(Q,X){let Y=typeof X?.label==="string"?h0(t0(X.label)):void 0,J=f1()([Q],([$])=>(G,Z,K)=>{if(GG(G)){let W=Y!==void 0?X1(Y(G.label,K),(H)=>new A0(["label"],H)):h4;return _8(W,()=>a0(h0($)(l5(G),K),{onSuccess:()=>G,onFailure:()=>{let H=F(G);return new q0(Z,H,[new A0(["value"],new Z0(H))])}}))}return y(new v0(Z,F(G)))},{typeConstructor:{_tag:"effect/Redacted",options:X},generation:{runtime:X!==void 0?`Schema.Redacted(?, ${v(X)})`:"Schema.Redacted(?)",Type:"Redacted.Redacted<?>",importDeclaration:'import * as Redacted from "effect/Redacted"'},expected:"Redacted",toCodecJson:([$])=>N0()(oK($),{decode:r((G)=>Z4(G,{label:X?.label})),encode:X?.disallowJsonEncode?_G((G)=>"Cannot serialize Redacted"+(O1(G)&&typeof G.value.label==="string"?` with label: "${G.value.label}"`:"")):r(l5)}),toArbitrary:([$])=>()=>$.map((G)=>Z4(G,{label:X?.label})),toFormatter:()=>globalThis.String,toEquivalence:([$])=>iB($)});return I(J.ast,{value:Q})}function oK(Q){return Q.pipe(fK(X1(UY)))}function kl(Q,X){return oK(Q).pipe(p(uN(R1(Q),{label:X?.label,disallowJsonEncode:X?.disallowEncode}),{decode:r((Y)=>Z4(Y,{label:X?.label})),encode:X?.disallowEncode?_G((Y)=>"Cannot encode Redacted"+(O1(Y)&&typeof Y.value.label==="string"?` with label: "${Y.value.label}"`:"")):r(l5)}))}function kK(Q,X){let Y=f1()([Q,X],([J,$])=>(G,Z,K)=>{if(!nJ(G))return y(new v0(Z,F(G)));switch(G._tag){case"Fail":return a0(h0(J)(G.error,K),{onSuccess:GQ,onFailure:(W)=>new q0(Z,F(G),[new A0(["error"],W)])});case"Die":return a0(h0($)(G.defect,K),{onSuccess:ZQ,onFailure:(W)=>new q0(Z,F(G),[new A0(["defect"],W)])});case"Interrupt":return h(G)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([J,$])=>N0()(J1([R0({_tag:t0("Fail"),error:J}),R0({_tag:t0("Die"),defect:$}),R0({_tag:t0("Interrupt"),fiberId:k2(h2)})]),j0({decode:(G)=>{switch(G._tag){case"Fail":return GQ(G.error);case"Die":return ZQ(G.defect);case"Interrupt":return KQ(G.fiberId)}},encode:g})),toArbitrary:([J,$])=>lN(J,$),toEquivalence:([J,$])=>rN(J,$),toFormatter:([J,$])=>oN(J,$)});return I(Y.ast,{error:Q,defect:X})}function lN(Q,X){return(Y,J)=>{return Y.oneof(J?.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},Y.constant(KQ()),Y.integer({min:1}).map(KQ),Q.map(($)=>GQ($)),X.map(($)=>ZQ($)))}}function rN(Q,X){return(Y,J)=>{if(Y._tag!==J._tag)return!1;switch(Y._tag){case"Fail":return Q(Y.error,J.error);case"Die":return X(Y.defect,J.defect);case"Interrupt":return Y.fiberId===J.fiberId}}}function oN(Q,X){return(Y)=>{switch(Y._tag){case"Fail":return`Fail(${Q(Y.error)})`;case"Die":return`Die(${X(Y.defect)})`;case"Interrupt":return"Interrupt"}}}function yK(Q,X){let Y=f1()([Q,X],([J,$])=>{let G=f0(kK(J,$));return(Z,K,W)=>{if(!oJ(Z))return y(new v0(K,F(Z)));return a0(h0(G)(Z.reasons,W),{onSuccess:$Q,onFailure:(H)=>new q0(K,F(Z),[new A0(["failures"],H)])})}},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([J,$])=>N0()(f0(kK(J,$)),j0({decode:$Q,encode:({reasons:G})=>G})),toArbitrary:([J,$])=>nN(J,$),toEquivalence:([J,$])=>iN(J,$),toFormatter:([J,$])=>aN(J,$)});return I(Y.ast,{error:Q,defect:X})}function nN(Q,X){return(Y,J)=>{return Y.array(lN(Q,X)(Y,J)).map($Q)}}function iN(Q,X){let Y=bW(rN(Q,X));return(J,$)=>Y(J.reasons,$.reasons)}function aN(Q,X){let Y=oN(Q,X);return(J)=>`Cause([${J.reasons.map(Y).join(", ")}])`}var sN=(Q)=>(Q?.includeStack===!0?1:0)|(Q?.excludeCause===!0?2:0),tN=(Q)=>{switch(Q){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},eR=[];function yl(Q){let X=sN(Q),Y=eR[X];if(Y!==void 0)return Y;let J=tN(X),$=z4(globalThis.Error,{typeConstructor:{_tag:"Error",...J===void 0?{}:{options:J}},generation:{runtime:J!==void 0?`Schema.Error(${v(J)})`:"Schema.Error()",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>N0()(or,vU(J)),toArbitrary:()=>(G)=>G.string().map((Z)=>new globalThis.Error(Z))});return eR[X]=$,$}var QN=[];function bl(Q){let X=sN(Q),Y=QN[X];if(Y!==void 0)return Y;let J=aK.pipe(p(gK,kU(tN(X))));return QN[X]=J,J}function gl(Q,X,Y){let J=f1()([Q,X,Y],([$,G,Z])=>{let K=yK(G,Z);return(W,H,_)=>{if(!aJ(W))return y(new v0(H,F(W)));switch(W._tag){case"Success":return a0(h0($)(W.value,_),{onSuccess:HQ,onFailure:(V)=>new q0(H,F(W),[new A0(["value"],V)])});case"Failure":return a0(h0(K)(W.cause,_),{onSuccess:VQ,onFailure:(V)=>new q0(H,F(W),[new A0(["cause"],V)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([$,G,Z])=>N0()(J1([R0({_tag:t0("Success"),value:$}),R0({_tag:t0("Failure"),cause:yK(G,Z)})]),j0({decode:(K)=>K._tag==="Success"?HQ(K.value):VQ(K.cause),encode:(K)=>H8(K)?{_tag:"Success",value:K.value}:{_tag:"Failure",cause:K.cause}})),toArbitrary:([$,G,Z])=>(K,W)=>K.oneof(W?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},$.map((H)=>HQ(H)),nN(G,Z)(K,W).map((H)=>VQ(H))),toEquivalence:([$,G,Z])=>{let K=iN(G,Z);return(W,H)=>{if(W._tag!==H._tag)return!1;switch(W._tag){case"Success":return $(W.value,H.value);case"Failure":return K(W.cause,H.cause)}}},toFormatter:([$,G,Z])=>{let K=aN(G,Z);return(W)=>{switch(W._tag){case"Success":return`Exit.Success(${$(W.value)})`;case"Failure":return`Exit.Failure(${K(W.cause)})`}}}});return I(J.ast,{value:Q,error:X,defect:Y})}function hl(Q,X){let Y=f1()([Q,X],([J,$])=>{let G=f0(D9([J,$]));return(Z,K,W)=>{if(Z instanceof globalThis.Map)return a0(h0(G)([...Z],W),{onSuccess:(H)=>new globalThis.Map(H),onFailure:(H)=>new q0(K,F(Z),[new A0(["entries"],H)])});return y(new v0(K,F(Z)))}},{typeConstructor:{_tag:"ReadonlyMap"},generation:{runtime:"Schema.ReadonlyMap(?, ?)",Type:"globalThis.ReadonlyMap<?, ?>"},expected:"ReadonlyMap",toCodec:([J,$])=>N0()(f0(D9([J,$])),j0({decode:(G)=>new globalThis.Map(G),encode:(G)=>[...G.entries()]})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlyMap"}:{},G.constant([]),G.array(G.tuple(J,$),Z?.constraints?.array)).map((K)=>new globalThis.Map(K))},toEquivalence:([J,$])=>jX(J,$),toFormatter:([J,$])=>(G)=>{let Z=G.size;if(Z===0)return"ReadonlyMap(0) {}";let K=globalThis.Array.from(G.entries()).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`ReadonlyMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:Q,value:X})}function ml(Q,X){let Y=f1()([Q,X],([J,$])=>{let G=f0(D9([J,$]));return(Z,K,W)=>{if(gB(Z))return a0(h0(G)(HY(Z),W),{onSuccess:WY,onFailure:(H)=>new q0(K,F(Z),[new A0(["entries"],H)])});return y(new v0(K,F(Z)))}},{typeConstructor:{_tag:"effect/HashMap"},generation:{runtime:"Schema.HashMap(?, ?)",Type:"HashMap.HashMap<?, ?>",importDeclaration:'import * as HashMap from "effect/HashMap"'},expected:"HashMap",toCodec:([J,$])=>N0()(f0(D9([J,$])),j0({decode:WY,encode:HY})),toArbitrary:([J,$])=>(G,Z)=>{return G.oneof(Z?.isSuspend?{maxDepth:2,depthIdentifier:"HashMap"}:{},G.constant([]),G.array(G.tuple(J,$),Z?.constraints?.array)).map(WY)},toEquivalence:([J,$])=>jX(J,$),toFormatter:([J,$])=>(G)=>{let Z=hB(G);if(Z===0)return"HashMap(0) {}";let K=HY(G).sort().map(([W,H])=>`${J(W)} => ${$(H)}`);return`HashMap(${Z}) { ${K.join(", ")} }`}});return I(Y.ast,{key:Q,value:X})}function dl(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,G,Z)=>{if($ instanceof globalThis.Set)return a0(h0(J)([...$],Z),{onSuccess:(K)=>new globalThis.Set(K),onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return y(new v0(G,F($)))}},{typeConstructor:{_tag:"ReadonlySet"},generation:{runtime:"Schema.ReadonlySet(?)",Type:"globalThis.ReadonlySet<?>"},expected:"ReadonlySet",toCodec:([Y])=>N0()(f0(Y),j0({decode:(J)=>new globalThis.Set(J),encode:(J)=>[...J.values()]})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"ReadonlySet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map((G)=>new globalThis.Set(G))},toEquivalence:([Y])=>EX(Y),toFormatter:([Y])=>(J)=>{let $=J.size;if($===0)return"ReadonlySet(0) {}";let G=globalThis.Array.from(J.values()).sort().map((Z)=>`${Y(Z)}`);return`ReadonlySet(${$}) { ${G.join(", ")} }`}});return I(X.ast,{value:Q})}function pl(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,G,Z)=>{if(cB($))return a0(h0(J)(W1($),Z),{onSuccess:_Y,onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return y(new v0(G,F($)))}},{typeConstructor:{_tag:"effect/HashSet"},generation:{runtime:"Schema.HashSet(?)",Type:"HashSet.HashSet<?>"},expected:"HashSet",toCodec:([Y])=>N0()(f0(Y),j0({decode:_Y,encode:W1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"HashSet"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(_Y)},toEquivalence:([Y])=>EX(Y),toFormatter:([Y])=>(J)=>{let $=fB(J);if($===0)return"HashSet(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`HashSet(${$}) { ${G.join(", ")} }`}});return I(X.ast,{value:Q})}function cl(Q){let X=f1()([Q],([Y])=>{let J=f0(Y);return($,G,Z)=>{if(s7($))return a0(h0(J)(W1($),Z),{onSuccess:t7,onFailure:(K)=>new q0(G,F($),[new A0(["values"],K)])});return y(new v0(G,F($)))}},{typeConstructor:{_tag:"effect/Chunk"},generation:{runtime:"Schema.Chunk(?)",Type:"Chunk.Chunk<?>"},expected:"Chunk",toCodec:([Y])=>N0()(f0(Y),j0({decode:t7,encode:W1})),toArbitrary:([Y])=>(J,$)=>{return J.oneof($?.isSuspend?{maxDepth:2,depthIdentifier:"Chunk"}:{},J.constant([]),J.array(Y,$?.constraints?.array)).map(t7)},toEquivalence:([Y])=>d$(Y),toFormatter:([Y])=>(J)=>{let $=JB(J);if($===0)return"Chunk(0) {}";let G=globalThis.Array.from(J).sort().map((Z)=>`${Y(Z)}`);return`Chunk(${$}) { ${G.join(", ")} }`}});return I(X.ast,{value:Q})}var fl=z4(globalThis.RegExp,{typeConstructor:{_tag:"RegExp"},generation:{runtime:"Schema.RegExp",Type:"globalThis.RegExp"},expected:"RegExp",toCodecJson:()=>N0()(R0({source:o,flags:o}),e1({decode:(Q)=>m4({try:()=>new globalThis.RegExp(Q.source,Q.flags),catch:(X)=>new Z0(F(X),{message:globalThis.String(X)})}),encode:(Q)=>h({source:Q.source,flags:Q.flags})})),toArbitrary:()=>(Q)=>Q.tuple(Q.constantFrom(".",".*","\\d+","\\w+","[a-z]+","[A-Z]+","[0-9]+","^[a-zA-Z0-9]+$","^\\d{4}-\\d{2}-\\d{2}$"),Q.uniqueArray(Q.constantFrom("g","i","m","s","u","y"),{minLength:0,maxLength:6}).map((X)=>X.join(""))).map(([X,Y])=>new globalThis.RegExp(X,Y)),toEquivalence:()=>(Q,X)=>Q.source===X.source&&Q.flags===X.flags}),eN=o.annotate({expected:"a string that will be decoded as a URL"}),QM=z4(globalThis.URL,{typeConstructor:{_tag:"URL"},generation:{runtime:"Schema.URL",Type:"globalThis.URL"},expected:"URL",toCodecJson:()=>N0()(eN,LG),toArbitrary:()=>(Q)=>Q.webUrl().map((X)=>new globalThis.URL(X)),toEquivalence:()=>(Q,X)=>Q.toString()===X.toString()}),ul=eN.pipe(p(QM,LG)),XM=o.annotate({expected:"a string in ISO 8601 format that will be decoded as a Date"}),nK=z4(globalThis.Date,{typeConstructor:{_tag:"Date"},generation:{runtime:"Schema.Date",Type:"globalThis.Date"},expected:"Date",toCodecJson:()=>N0()(XM,FG),toArbitrary:()=>(Q,X)=>Q.date(X?.constraints?.date)}),ll=XM.pipe(p(nK,FG)),YM=nK.check(kN()),g2=O4(S3,{typeConstructor:{_tag:"effect/Duration"},generation:{runtime:"Schema.Duration",Type:"Duration.Duration",importDeclaration:'import * as Duration from "effect/Duration"'},expected:"Duration",toCodecJson:()=>N0()(J1([R0({_tag:t0("Infinity")}),R0({_tag:t0("NegativeInfinity")}),R0({_tag:t0("Nanos"),value:v2}),R0({_tag:t0("Millis"),value:HM})]),j0({decode:(Q)=>{switch(Q._tag){case"Infinity":return i8;case"NegativeInfinity":return P6;case"Nanos":return a8(Q.value);case"Millis":return S4(Q.value)}},encode:(Q)=>{switch(Q.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:Q.value.nanos};case"Millis":return{_tag:"Millis",value:Q.value.millis}}}})),toArbitrary:()=>(Q)=>Q.oneof(Q.constant(i8),Q.constant(P6),Q.bigInt().map(a8),Q.maxSafeInteger().map(S4)),toFormatter:()=>globalThis.String,toEquivalence:()=>x3}),rl=o.annotate({expected:"a string that will be decoded as a Duration"}),ol=rl.pipe(p(g2,TU)),nl=globalThis.BigInt(0),il=v2.check(mN(nl)).pipe(p(g2,IU)),al=Y6.check(vN(0)).pipe(p(g2,jU)),JM=o.annotate({expected:"a string that will be decoded as a BigDecimal"}),$M=O4(b$,{typeConstructor:{_tag:"effect/BigDecimal"},generation:{runtime:"Schema.BigDecimal",Type:"BigDecimal.BigDecimal",importDeclaration:'import * as BigDecimal from "effect/BigDecimal"'},expected:"BigDecimal",toCodecJson:()=>N0()(JM,PG),toArbitrary:()=>(Q)=>Q.tuple(Q.bigInt(),Q.integer({min:0,max:20})).map(([X,Y])=>v6(X,Y)),toFormatter:()=>(Q)=>k8(Q),toEquivalence:()=>h$}),sl=JM.pipe(p($M,PG)),tl=GM(gK);function GM(Q){return o.annotate({expected:"a string that will be decoded as JSON",contentMediaType:"application/json",contentSchema:Y1(Q.ast)}).pipe(p(Q,uU))}var ZM=z4(globalThis.File,{typeConstructor:{_tag:"File"},generation:{runtime:"Schema.File",Type:"globalThis.File"},expected:"File",toCodecJson:()=>N0()(R0({data:o.check(EN()),type:o,name:o,lastModified:Y6}),e1({decode:(Q)=>o1(p5(Q.data),{onFailure:(X)=>y(new Z0(F(Q.data),{message:X.message})),onSuccess:(X)=>{let Y=new globalThis.Uint8Array(X);return h(new globalThis.File([Y],Q.name,{type:Q.type,lastModified:Q.lastModified}))}}),encode:(Q)=>C$({try:async()=>{let X=new globalThis.Uint8Array(await Q.arrayBuffer());return{data:JY(X),type:Q.type,name:Q.name,lastModified:Q.lastModified}},catch:(X)=>new Z0(F(Q),{message:globalThis.String(X)})})}))}),KM=z4(globalThis.FormData,{typeConstructor:{_tag:"FormData"},generation:{runtime:"Schema.FormData",Type:"globalThis.FormData"},expected:"FormData",toCodecJson:()=>N0()(f0(D9([o,J1([R0({_tag:Q5("String"),value:o}),R0({_tag:Q5("File"),value:ZM})])])),e1({decode:(Q)=>{let X=new globalThis.FormData;for(let[Y,J]of Q)X.append(Y,J.value);return h(X)},encode:(Q)=>{return h(globalThis.Array.from(Q.entries()).map(([X,Y])=>{if(typeof Y==="string")return[X,{_tag:"String",value:Y}];else return[X,{_tag:"File",value:Y}]}))}}))});function el(Q){return KM.pipe(p(Q,lU))}var WM=z4(globalThis.URLSearchParams,{typeConstructor:{_tag:"URLSearchParams"},generation:{runtime:"Schema.URLSearchParams",Type:"globalThis.URLSearchParams"},expected:"URLSearchParams",toCodecJson:()=>N0()(o.annotate({expected:"a query string that will be decoded as URLSearchParams"}),j0({decode:(Q)=>new globalThis.URLSearchParams(Q),encode:(Q)=>Q.toString()}))});function Qr(Q){return WM.pipe(p(Q,rU))}var h2=Y6.check(SN()),HM=Y6.check(b2()),Xr=o.annotate({expected:"a string that will be decoded as a number"}).pipe(p(Y6,o5)),Yr=o.annotate({expected:"a string that will be decoded as a finite number"}).pipe(p(h2,o5)),Jr=I(pG).pipe(p(v2,wY)),VM=o.check(jN()),$r=o.annotate({expected:"a string that will be decoded as a trimmed string"}).pipe(p(VM,CU())),Gr=o.annotate({expected:"a base64 encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,dU)),Zr=o.annotate({expected:"a base64 (URL) encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,pU)),Kr=o.annotate({expected:"a hex encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,cU)),Wr=o.annotate({expected:"a URI component encoded string that will be decoded as a UTF-8 string"}).pipe(p(o,fU)),bK=J1([h2,ON,o]),Hr=R0({issues:f0(R0({message:o,path:B9(f0(J1([bK,R0({key:bK})])))}))}),Vr=pK([0,1]).pipe(p(UN,j0({decode:(Q)=>Q===1,encode:(Q)=>Q?1:0}))),_M=o.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),m2=z4(globalThis.Uint8Array,{typeConstructor:{_tag:"Uint8Array"},generation:{runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"},expected:"Uint8Array",toCodecJson:()=>N0()(_M,RG),toArbitrary:()=>(Q)=>Q.uint8Array()}),_r=_M.pipe(p(m2,RG)),qr=o.annotate({expected:"a base64 (URL) encoded string that will be decoded as a Uint8Array"}).pipe(p(m2,{decode:BU(),encode:RY()})),Dr=o.annotate({expected:"a hex encoded string that will be decoded as a Uint8Array"}).pipe(p(m2,{decode:OU(),encode:NY()})),d2=O4((Q)=>c$(Q)&&KB(Q),{typeConstructor:{_tag:"effect/DateTime.Utc"},generation:{runtime:"Schema.DateTimeUtc",Type:"DateTime.Utc",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Utc",toCodecJson:()=>N0()(o,AG),toArbitrary:()=>(Q,X)=>Q.date({noInvalidDate:!0,...X?.constraints?.date}).map((Y)=>HB(Y)),toFormatter:()=>(Q)=>Q.toString(),toEquivalence:()=>f$}),Br=YM.pipe(p(d2,{decode:UG(),encode:r(BB)})),Ur=o.annotate({expected:"a string that will be decoded as a DateTime.Utc"}).pipe(p(d2,AG)),Or=Y6.pipe(p(d2,{decode:UG(),encode:r(UB)})),zr=O4(GB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Offset"},generation:{runtime:"Schema.TimeZoneOffset",Type:"DateTime.TimeZone.Offset",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Offset",toCodecJson:()=>N0()(Y6,oU),toArbitrary:()=>(Q)=>Q.integer({min:-43200000,max:50400000}).map((X)=>CQ(X)),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>Q.offset===X.offset}),qM=o.annotate({expected:"an IANA time zone identifier"}),DM=O4(ZB,{typeConstructor:{_tag:"effect/DateTime.TimeZone.Named"},generation:{runtime:"Schema.TimeZoneNamed",Type:"DateTime.TimeZone.Named",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone.Named",toCodecJson:()=>N0()(qM,NG),toArbitrary:()=>(Q)=>Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(u$)),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>Q.id===X.id}),Fr=qM.pipe(p(DM,NG)),BM=o.annotate({expected:"a time zone string (IANA identifier or offset like +03:00)"}),UM=O4($B,{typeConstructor:{_tag:"effect/DateTime.TimeZone"},generation:{runtime:"Schema.TimeZone",Type:"DateTime.TimeZone",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.TimeZone",toCodecJson:()=>N0()(BM,MG),toArbitrary:()=>(Q)=>Q.oneof(Q.integer({min:-43200000,max:50400000}).map((X)=>CQ(X)),Q.constantFrom(...["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"].map(u$))),toFormatter:()=>(Q)=>p4(Q),toEquivalence:()=>(Q,X)=>p4(Q)===p4(X)}),Lr=BM.pipe(p(UM,MG)),OM=o.annotate({expected:"a zoned DateTime string (e.g. 2024-01-01T00:00:00.000+00:00[Europe/London])"}),zM=O4((Q)=>c$(Q)&&WB(Q),{typeConstructor:{_tag:"effect/DateTime.Zoned"},generation:{runtime:"Schema.DateTimeZoned",Type:"DateTime.Zoned",importDeclaration:'import * as DateTime from "effect/DateTime"'},expected:"DateTime.Zoned",toCodecJson:()=>N0()(OM,wG),toArbitrary:()=>(Q,X)=>Q.tuple(Q.date({noInvalidDate:!0,min:new globalThis.Date(-8639999949600000),max:new globalThis.Date(8639999949600000),...X?.constraints?.date}),Q.constantFrom("UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney")).map(([Y,J])=>VB(Y,{timeZone:J})),toFormatter:()=>(Q)=>XY(Q),toEquivalence:()=>f$}),Pr=OM.pipe(p(zM,wG)),Rr=globalThis.Symbol.for("immer-draftable");function iK(Q,X,Y,J,$){let G=Mr(Y,X,J),Z=FM(X),K=class extends Q{constructor(...[W,H]){W=W??{};let _=Y.make(W,H);super({...W,..._},{...H,disableChecks:!0})}static[BX]=BX;get[Z](){return Z}static[Rr]=!0;static identifier=X;static fields=Y.fields;static get ast(){return G(this).ast}static pipe(){return X0(this,arguments)}static rebuild(W){return G(this).rebuild(W)}static make(W,H){return new this(W,H)}static makeOption(W,H){return rY(G(this))(W??{},H)}static makeEffect(W,H){return G(this).makeEffect(W??{},H)}static annotate(W){return this.rebuild(l6(this.ast,W))}static annotateKey(W){return this.rebuild(nQ(this.ast,W))}static check(...W){return this.rebuild(l4(this.ast,W))}static extend(W){return(H,_)=>{let V={...Y.fields,...H};return iK(this,W,dK(xY(V,Y.ast.checks,{identifier:W}),V),_,$)}}static mapFields(W,H){return Y.mapFields(W,H)}};if($!==void 0)Object.assign(K.prototype,$(X));return K}function Nr(Q){return new H0(r((X)=>new Q(X)),b1())}function FM(Q){return`~effect/Schema/Class/${Q}`}function Mr(Q,X,Y){let J;return($)=>{if(J===void 0){let G=Nr($),Z=I(new p6([Q.ast],()=>(K,W)=>{return K instanceof $||N(K,FM(X))?h(K):y(new v0(W,F(K)))},{identifier:X,[t5]:([K])=>new B0(K,G),toCodec:([K])=>new B0(K.ast,G),toArbitrary:([K])=>()=>K.map((W)=>new $(W)),toFormatter:([K])=>(W)=>`${$.identifier}(${K(W)})`,"~sentinels":uQ(Q.ast),...Y}));J=Q.pipe(p(Z,G))}return J}}function p2(Q){return x2(Q)}var LM=(Q)=>(X,Y)=>{let J=p2(X)?X:R0(X);return iK(lq,Q,J,Y,($)=>({toString(){return`${$}(${v({...this})})`}}))},Ar=(Q)=>{return(X,Y,J)=>{let $=p2(Y)?Y.mapFields((G)=>({_tag:Q5(X),...G}),{unsafePreserveChecks:!0}):y2(X,Y);return LM(Q??X)($,J)}},PM=(Q)=>(X,Y)=>{let J=p2(X)?X:R0(X);return iK(bX,Q,J,Y,(G)=>({name:G}))},wr=(Q)=>{return(X,Y,J)=>{let $=p2(Y)?Y.mapFields((G)=>({_tag:Q5(X),...G}),{unsafePreserveChecks:!0}):y2(X,Y);return PM(Q??X)($,J)}};function RM(Q){let X=Wz(Q.ast);return(Y)=>X(Y,{})}function Cr(Q){return RM(Q)(xK)}function Tr(Q){return(X)=>{return X.annotate({toFormatter:Q})}}function Ir(Q,X){return Y(Q.ast);function Y($){let G=D8($)?.toFormatter;if(typeof G==="function")return G(b8($)?$.typeParameters.map(Y):[]);if(X?.onBefore){let Z=X.onBefore($,Y);if(Z!==void 0)return Z}return J($)}function J($){switch($._tag){default:return v;case"Never":return()=>"never";case"Void":return()=>"void";case"Arrays":{let G=$.elements.map(Y),Z=$.rest.map(Y);return(K)=>{let W=[],H=0;for(;H<G.length;H++)if(K.length<H+1){if(E0($.elements[H]))continue}else W.push(G[H](K[H]));if(Z.length>0){let[_,...V]=Z;for(;H<K.length-V.length;H++)W.push(_(K[H]));for(let q=0;q<V.length;q++)H+=q,W.push(V[q](K[H]))}return"["+W.join(", ")+"]"}}case"Objects":{let G=$.propertySignatures.map((K)=>Y(K.type)),Z=$.indexSignatures.map((K)=>Y(K.type));if($.propertySignatures.length===0&&$.indexSignatures.length===0)return v;return(K)=>{let W=[],H=new Set;for(let _=0;_<G.length;_++){let V=$.propertySignatures[_],q=V.name;if(H.add(q),E0(V.type)&&!Object.hasOwn(K,q))continue;W.push(`${R4(q)}: ${G[_](K[q])}`)}for(let _=0;_<Z.length;_++){let V=f6(K,$.indexSignatures[_].parameter);for(let q of V){if(H.has(q))continue;H.add(q),W.push(`${R4(q)}: ${Z[_](K[q])}`)}}return W.length>0?"{ "+W.join(", ")+" }":"{}"}}case"Union":{let G=(Z)=>lQ(Z,$.types);return(Z)=>{let K=G(Z),W=K.map(eQ);for(let H=0;H<K.length;H++){let _=W[H];if(_(Z))return Y(K[H])(Z)}return v(Z)}}case"Suspend":{let G=u6(()=>Y($.thunk()));return(Z)=>G()(Z)}}}}function jr(Q){return(X)=>X.annotate({toEquivalence:Q})}function Er(Q){return Mz(Q.ast)}function NM(Q){return Cz(Q.ast)}function MM(Q,X){let Y=NM(Q),J=Tz(Y,X);return{dialect:"draft-2020-12",schema:J.schema,definitions:J.definitions}}function AM(Q){return I(wM(Q.ast))}var wM=r6((Q)=>{let X=Sr(Q,wM);return X!==Q&&E0(Q)?s5(X):X});function Sr(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecJson??Q.annotations?.toCodec;if(Y8(Y)){let J=b8(Q)?Q.typeParameters.map((Z)=>n6(Y1(Z))):[],$=Y(J),G=X($.to);return D0(Q,G===$.to?[$]:[new B0(G,$.transformation)])}return D0(Q,[iO])}case"Unknown":case"ObjectKeyword":return D0(Q,[aO]);case"Undefined":case"Void":case"Literal":case"Number":return Q.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":{if(Q.propertySignatures.some((Y)=>typeof Y.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:Q});return Q.recur(X)}case"Union":{let Y=aY(Q.types);if(Y!==Q.types)return new h1(Y,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}function CM(Q){return I(TM(U8(Q.ast)))}var TM=p0((Q)=>{let X=xr(Q,TM);return X!==Q&&E0(Q)?s5(X):X});function xr(Q,X){switch(Q._tag){case"Declaration":{let Y=Q.annotations?.toCodecIso??Q.annotations?.toCodec;if(Y8(Y)){let J=Y(Q.typeParameters.map((G)=>n6(G))),$=X(J.to);return D0(Q,$===J.to?[J]:[new B0($,J.transformation)])}return Q}case"Arrays":case"Objects":case"Union":case"Suspend":return Q.recur(X)}return Q}function IM(Q,X){return I(xM(X?.keepDeclarations===!0?SM(Q.ast):EM(Q.ast)))}function vr(Q,X){let Y=f5(Q.ast)??$G(Q.ast),J=WN(IM(Q));return($)=>J($).pipe(j$((G)=>kr(G,{rootName:Y,...X})))}function kr(Q,X){let Y=X.rootName??"root",J=X.arrayItemName??"item",$=X.pretty??!0,G=X.indent??" ",Z=X.sortKeys??!0,K=new Set,W=[];return _(Y,Q,0),W.join($?`
66
+ `:"");function H(V,q){W.push($?G.repeat(V)+q:q)}function _(V,q,D,U){let{attrs:P,safe:L}=q9.tagInfo(V,U);if(q===void 0)H(D,`<${L}${P}/>`);else if(typeof q==="string")H(D,`<${L}${P}>${q9.escapeText(q)}</${L}>`);else if(typeof q!=="object"||q===null)H(D,`<${L}${P}>${q9.escapeText(v(q))}</${L}>`);else{if(K.has(q))throw new globalThis.Error("Cycle detected while serializing to XML.",{cause:q});K.add(q);try{if(globalThis.globalThis.Array.isArray(q)){if(q.length===0){H(D,`<${L}${P}/>`);return}H(D,`<${L}${P}>`);for(let R of q)_(J,R,D+1);H(D,`</${L}>`);return}let M=q,w=Object.keys(M);if(Z)w.sort();if(w.length===0){H(D,`<${L}${P}/>`);return}H(D,`<${L}${P}>`);for(let R of w)_(q9.parseTagName(R).safe,M[R],D+1,R);H(D,`</${L}>`)}finally{K.delete(q)}}}}var q9={escapeText(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeAttribute(Q){return Q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},parseTagName(Q){let X=Q,Y=Q;if(!/^[A-Za-z_]/.test(Y))Y="_"+Y;if(Y=Y.replace(/[^A-Za-z0-9._-]/g,"_"),/^xml/i.test(Y))Y="_"+Y;return{safe:Y,changed:Y!==X}},tagInfo(Q,X){let{changed:Y,safe:J}=q9.parseTagName(Q),G=Y||X&&X!==Q?` data-name="${q9.escapeAttribute(X??Q)}"`:"";return{safe:J,attrs:G}}};function yr(Q){switch(Q._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}var br=tG(yr);function jM(Q,X,Y){switch(Q._tag){case"Declaration":{let J=Q.annotations?.toCodecJson??Q.annotations?.toCodec;if(Y8(J)){let $=b8(Q)?Q.typeParameters.map((K)=>I(X(Y1(K)))):[],G=J($),Z=X(G.to);return D0(Q,Z===G.to?[G]:[new B0(Z,G.transformation)])}return Y(Q)}case"Null":return D0(Q,[gr]);case"Boolean":return D0(Q,[hr]);case"Unknown":case"ObjectKeyword":return D0(Q,[sO]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return Q.toCodecStringTree();case"Objects":{if(Q.propertySignatures.some((J)=>typeof J.name!=="string"))throw new globalThis.Error("Objects property names must be strings",{cause:Q});return Q.recur(X)}case"Union":{let J=br(Q.types);if(J!==Q.types)return new h1(J,Q.mode,Q.annotations,Q.checks,Q.encoding,Q.context).recur(X);return Q.recur(X)}case"Arrays":case"Suspend":return Q.recur(X)}return Q}var gr=new B0(new g1("null"),new H0(r(()=>null),r(()=>"null"))),hr=new B0(new h1([new g1("true"),new g1("false")],"anyOf"),new H0(r((Q)=>Q==="true"),g6())),EM=r6((Q)=>{let X=jM(Q,EM,(Y)=>D0(Y,[mr]));if(X!==Q&&E0(Q))return s5(X);return X}),mr=new B0(TG,new H0(b1(),r(()=>{return}))),SM=r6((Q)=>{let X=jM(Q,SM,g);if(X!==Q&&E0(Q))return s5(X);return X}),XN="~effect/Schema/SERIALIZER_ENSURE_ARRAY",xM=r6((Q)=>{if(jY(Q)&&Q.annotations?.[XN])return Q;let X=dr(Q);if(IY(X)){let Y=new h1([X,dY(c6,X,new H0(_U(),b1()))],"anyOf",{[XN]:!0});return E0(Q)?mY(Y):Y}return X});function dr(Q){switch(Q._tag){default:return Q;case"Declaration":case"Arrays":case"Objects":case"Union":case"Suspend":return Q.recur(xM)}}function pr(Q){let X=CM(Q);return yz(aG(X),iG(X))}function cr(Q){return $2()}function fr(Q){return $2()}function ur(Q,X){return(Y)=>{return I(l6(Y.ast,{toCodecIso:()=>new B0(Q.ast,MY(X))}),{schema:Y})}}function lr(Q){let X=AM(Q),Y=aG(X),J=iG(X);return{empty:[],diff:($,G)=>tY(Y($),Y(G)),combine:($,G)=>[...$,...G],patch:($,G)=>{let Z=Y($),K=Ez(G,Z);return Object.is(K,Z)?$:J(K)}}}function rr(Q){let X=RN(()=>Y),Y=J1([Q,f0(X),zN(o,X)]);return Y}var aK=I(cY),or=R0({message:o,name:X6(o),stack:X6(o),cause:X6(aK)}),nr=I(nO);function ir(Q){return D8(Q.ast)}function ar(Q){return Q.ast.context?.annotations}var oM=O(fM(),1),Ko=["dist","build","_build","out","target",".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless","coverage",".nyc_output",".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox","__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target","tmp",".tmp",".state",".terraform",".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"],Wo=["/tmp","/var/tmp","/var/folders","/private/tmp","/private/var/tmp","/private/var/folders"],nM=new Set([">",">>","<","<<","<<<","<>",">&","<&","&>","&>>"]),iM=new Set([";","&&","||","|","|&","&"]),aM=(Q)=>typeof Q==="string",F4=(Q)=>{if(typeof Q==="object"&&"op"in Q&&typeof Q.op==="string")return Q.op;return null},Ho=(Q)=>typeof Q==="object"&&("comment"in Q),Vo=(Q)=>{try{let X=[...new Bun.Glob(Q).scanSync({onlyFiles:!1,dot:!0})];if(X.length>0)return X}catch{}return[Q]},_o=(Q)=>{if(aM(Q))return[Q];if(typeof Q==="object"&&"op"in Q&&Q.op==="glob"&&"pattern"in Q)return Vo(String(Q.pattern));let X=F4(Q);if(X!==null){if(nM.has(X)||iM.has(X))return[];return[`__op_${X}__`]}if(Ho(Q))return[];return["__tripwire_cmd_sub__"]},uM=(Q,X)=>{let Y=[],J=[],$=[],G=[],Z=0;while(Z<Q.length){let K=Q[Z],W=F4(K);if(W!==null&&nM.has(W)){let H=Y.at(-1);if(H!==void 0&&/^[0-9]+$/.test(H)&&X.remaining>0)Y.pop(),X.remaining--;let _=Q[Z+1];if(_!==void 0&&aM(_)){G.push({op:W,target:_}),Z+=2;continue}Z++;continue}for(let H of _o(K))Y.push(H);Z++}if(Y.length===0)return null;for(let K=1;K<Y.length;K++){let W=Y[K];if(W.startsWith("-")&&W!=="-")$.push(W);else J.push(W)}return{head:Y[0],tokens:Y,args:J,flags:$,redirects:G,raw:Y.join(" ")}},qo=(Q)=>`$${Q}`,Do=(Q)=>{let X=[];for(let Y=0;Y<Q.length;Y++){let J=Q[Y],$=Q[Y+1];if(F4(J)==="&"&&$!==void 0&&(F4($)===">"||F4($)===">>")){let G={op:F4($)===">"?"&>":"&>>"};X.push(G),Y++;continue}if(F4(J)===">"&&$!==void 0&&F4($)==="|"){X.push({op:">"}),Y++;continue}X.push(J)}return X},Bo=(Q)=>{return Q.match(/(?<![\w$])\d+(?=[<>])/g)?.length??0},eK=(Q)=>{let X=/<<-?\s*(?:"(?<quoted>[^"]+)"|'(?<single>[^']+)'|(?<unquoted>[A-Za-z_][A-Za-z0-9_]*))/u.exec(Q);return X?.groups?.quoted??X?.groups?.single??X?.groups?.unquoted??null},Uo=/(?:^|[|;&]\s*)(?:\/(?:usr\/bin|bin|usr\/local\/bin|opt\/homebrew\/bin)\/)?(?:sh|bash|zsh|dash|ksh|ash)(?:\s|$)/u,QW=(Q)=>Uo.test(Q),sM=(Q)=>{let X=Q.split(`
67
+ `),Y=[];for(let J=0;J<X.length;J++){let $=X[J];Y.push($);let G=eK($);if(G===null||QW($))continue;J++;while(J<X.length&&X[J].trim()!==G)J++;if(J<X.length)Y.push("__HEREDOC_BODY__"),Y.push(X[J])}return Y.join(`
68
+ `)},tM=(Q)=>{let X=new Map,Y=Q.split(`
69
+ `);for(let J=0;J<Y.length;J++){let $=Y[J],G=eK($);if(G===null||QW($))continue;let Z=[];J++;while(J<Y.length&&Y[J].trim()!==G)Z.push(Y[J]),J++;if(!X.has(G))X.set(G,Z.join(`
70
+ `))}return X},Oo=(Q)=>{let X=Q.split(`
71
+ `),Y=[];for(let J=0;J<X.length;J++){let $=X[J],G=eK($);if(G===null||!QW($))continue;let Z=[];J++;while(J<X.length&&X[J].trim()!==G)Z.push(X[J]),J++;if(Z.length>0)Y.push(Z.join(`
72
+ `))}return Y},zo=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let J=Q[Y];if(J==="\\"){Y++;continue}if(J==="`")return Y}return null},Fo=(Q,X)=>{let Y=1,J=null;for(let $=X;$<Q.length;$++){let G=Q[$];if(G==="\\"){$++;continue}if(J==="single"){if(G==="'")J=null;continue}if(G==="'"){J??="single";continue}if(G==='"'){J=J==="double"?null:"double";continue}if(G==="("){Y++;continue}if(G===")"){if(Y--,Y===0)return $}}return null},Lo=(Q)=>{let X=[],Y=null;for(let J=0;J<Q.length;J++){let $=Q[J];if($==="\\"){J++;continue}if(Y==="single"){if($==="'")Y=null;continue}if($==="'"){Y??="single";continue}if($==='"'){Y=Y==="double"?null:"double";continue}if($==="`"){let H=zo(Q,J+1);if(H!==null)X.push(Q.slice(J+1,H)),J=H;continue}let G=Q[J+1];if(!($==="$"&&G==="(")&&!(Y===null&&($==="<"||$===">")&&G==="("))continue;let W=Fo(Q,J+2);if(W!==null)X.push(Q.slice(J+2,W)),J=W}return X},eM=/^\$\{?HOME\}?(?:\/|$)/,QA=(Q)=>{if(Q===""||Q==="-")return!1;if(Q==="/"||Q==="~"||Q==="."||Q==="..")return!0;if(Q.startsWith("/")||Q.startsWith("~")||Q.startsWith("./")||Q.startsWith("../")||eM.test(Q))return!0;return!1},f2=(Q)=>{if(Q==="/")return 100;if(Q==="~"||eM.test(Q))return 90;if(/^\/(?<dir>etc|usr|bin|sbin|System|Library|var|boot|root|home)(?<suffix>\/|$)/.test(Q))return 80;if(Q.startsWith("/Users/"))return 70;if(Q.startsWith("/")||Q.startsWith("~"))return 60;if(Q.startsWith("../"))return 40;if(Q===".."||Q==="."||Q.startsWith("./"))return 10;return 50},Po=new Set(["-e","--extension","-t","--type","-E","--exclude","-d","--max-depth","--min-depth","--exact-depth","-c","--color","--changed-within","--changed-before","-S","--size","-o","--owner","-j","--threads","-g","--glob","--format","--max-results","--ignore-file","--search-path","--base-directory","--path-separator","--and"]),Ro=(Q,X)=>{let Y=[],J=1;while(J<X){let $=Q[J];if(Po.has($)){J+=2;continue}if($.startsWith("-")){J++;continue}if(QA($))Y.push($);J++}if(Y.length===0)return".";return Y.sort(($,G)=>f2(G)-f2($)),Y[0]},No=(Q,X)=>{let Y=[];for(let J=1;J<X;J++){let $=Q[J];if($.startsWith("-"))break;if(QA($))Y.push($)}if(Y.length===0)return".";return Y.sort((J,$)=>f2($)-f2(J)),Y[0]},lM={execFlags:new Set(["-x","-X","--exec","--exec-batch"]),placeholders:new Set(["{}","{/}","{//}","{.}","{/.}"]),pickRoot:Ro},rM={execFlags:new Set(["-exec","-execdir","-ok","-okdir"]),placeholders:new Set(["{}"]),pickRoot:No},Mo=Object.assign(Object.create(null),{fd:lM,fdfind:lM,find:rM,gfind:rM}),Ao=(Q,X,Y)=>Q.map((J)=>X.placeholders.has(J)?Y:J),wo=(Q)=>{let X=Mo[Q.head];if(X===void 0)return[];let Y=[],J=Q.tokens;for(let $=1;$<J.length;$++){if(!X.execFlags.has(J[$]))continue;let G=[],Z=$+1;while(Z<J.length){let H=J[Z];if(H===";"||H==="+")break;G.push(H),Z++}if(G.length===0)continue;let K=G[0];if(X.placeholders.has(K))continue;let W=X.pickRoot(J,$);Y.push(Ao(G,X,W).join(" ")),$=Z}return Y},Co=/\$\(\s*cat\s+<<-?\s*['"]?(?<delimiter>\w+)['"]?\s*\n(?<body>[\s\S]*?)\n\s*\k<delimiter>\s*\)/u,To=/\$\(\s*(?:printf|echo)\s+(?:-[a-zA-Z]+\s+)*'(?<content>[^']*)'/u,u2=(Q,X)=>{let Y=Co.exec(Q);if(Y!==null){let $=Y.groups?.body??Q;if(X!==void 0&&$.trim()==="__HEREDOC_BODY__"){let G=Y.groups?.delimiter,Z=G===void 0?void 0:X.get(G);if(Z!==void 0)return Z}return $}let J=To.exec(Q);if(J!==null)return J.groups?.content??Q;return Q},Io=new Set(["sh","bash","zsh","dash","ksh","ash","/bin/sh","/bin/bash","/bin/zsh","/bin/dash","/bin/ksh","/usr/bin/sh","/usr/bin/bash","/usr/bin/zsh","/usr/local/bin/bash","/opt/homebrew/bin/bash"]),jo=(Q)=>{if(!Io.has(Q.head))return[];let X=Q.tokens;for(let Y=1;Y<X.length;Y++){let J=X[Y];if(J==="-c"&&Y+1<X.length)return[X[Y+1]];if(J.startsWith("-")&&!J.startsWith("--")&&J.endsWith("c")&&J.length>2&&Y+1<X.length)return[X[Y+1]]}return[]},Eo=new Set(["command","exec","env","time","nohup","setsid","nice","ionice","chronic","stdbuf","unbuffer","script","taskset","sudo","doas","xargs","watch"]),So={command:new Set,env:new Set(["-u","--unset","-C","--chdir","-S","--split-string","--block-signal"]),time:new Set(["-f","--format","-o","--output"]),nice:new Set(["-n","--adjustment"]),ionice:new Set(["-c","--class","-n","--classdata","-p","--pid"]),stdbuf:new Set(["-i","--input","-o","--output","-e","--error"]),script:new Set(["-c","--command"]),taskset:new Set,sudo:new Set(["-u","--user","-g","--group","-C","--close-from","-D","--chdir","-h","--host","-p","--prompt","-r","--role","-t","--type","-U","--other-user","-R","--chroot","-T","--command-timeout"]),doas:new Set(["-a","-C","-u"]),xargs:new Set(["-I","-i","-J","-n","--max-args","-P","--max-procs","-s","--max-chars","-L","--max-lines","-E","--eof","-d","--delimiter","-a","--arg-file","--replace"]),watch:new Set(["-n","--interval"])},xo=(Q)=>/^[A-Za-z_][A-Za-z0-9_]*=.*/u.test(Q),vo=(Q)=>{let X=Q[0],Y=So[X]??new Set,J=1;while(J<Q.length){let $=Q[J];if(X==="env"&&xo($)){J++;continue}if(Y.has($)){J+=2;continue}if($.includes("=")&&Y.has($.slice(0,$.indexOf("=")))){J++;continue}if($.startsWith("--")&&$!=="--"){J++;continue}if($.startsWith("-")&&$!=="-"){J++;continue}break}return J},ko=(Q)=>{if(!Eo.has(Q.head))return[];if(Q.head==="script")for(let J=1;J<Q.tokens.length-1;J++){let $=Q.tokens[J];if($==="-c"||$==="--command")return[Q.tokens[J+1]];if($.startsWith("--command="))return[$.slice(10)]}let X=vo(Q.tokens),Y=Q.tokens.slice(X).join(" ");return Y===""?[]:[Y]},yo=new Set(["eval"]),bo=(Q)=>{if(!yo.has(Q.head))return[];let X=Q.tokens.slice(1).join(" ");return X===""?[]:[X]},go=new Set(["run","proxy","err","test","summary"]),ho=(Q)=>Q==="rtk"||Q.endsWith("/rtk"),mo=(Q)=>{let X=1;while(X<Q.length){let Y=Q[X];if(Y.startsWith("-")&&Y!=="-"&&Y!=="--"){X++;continue}break}return X},XA=(Q,X)=>{for(let Y=X;Y<Q.length;Y++){let J=Q[Y];if((J==="-c"||J==="--command")&&Y+1<Q.length)return Q[Y+1];if(J.startsWith("--command="))return J.slice(10)}return null},po=(Q)=>{if(!ho(Q.head))return[];let X=mo(Q.tokens),Y=Q.tokens[X];if(Y===void 0)return[];if(go.has(Y)){let $=XA(Q.tokens,X+1);if($!==null)return $===""?[]:[$];let G=X+1;while(G<Q.tokens.length){let K=Q.tokens[G];if(K==="--"){G++;break}if(K.startsWith("-")&&K!=="-"){G++;continue}break}let Z=Q.tokens.slice(G).join(" ");return Z===""?[]:[Z]}let J=Q.tokens.slice(X).join(" ");return J===""?[]:[J]},co={timeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},gtimeout:{valueFlags:new Set(["-s","--signal","-k","--kill-after"]),skipPositionals:1,dashCommand:!1},chroot:{valueFlags:new Set(["--userspec","--groups"]),skipPositionals:1,dashCommand:!1},flock:{valueFlags:new Set(["-w","--wait","--timeout","-E","--conflict-exit-code"]),skipPositionals:1,dashCommand:!0},su:{valueFlags:new Set,skipPositionals:0,dashCommand:!0}},fo=(Q)=>{let X=co[Q.head];if(X===void 0)return[];if(X.dashCommand){let $=XA(Q.tokens,1);if($!==null)return $===""?[]:[$]}let Y=1;while(Y<Q.tokens.length){let $=Q.tokens[Y];if(X.valueFlags.has($)){Y+=2;continue}if($.includes("=")&&X.valueFlags.has($.slice(0,$.indexOf("=")))){Y++;continue}if($==="--"){Y++;break}if($.startsWith("-")&&$!=="-"){Y++;continue}break}Y+=X.skipPositionals;let J=Q.tokens.slice(Y).join(" ");return J===""?[]:[J]},uo=[wo,jo,ko,bo,po,fo],F9=(Q)=>{let X,Y=sM(Q);try{X=oM.parse(Y,qo)}catch{return[]}X=Do(X);let J={remaining:Bo(Y)},$=[],G=[];for(let W of X){let H=F4(W);if(H!==null&&iM.has(H)){let _=uM(G,J);if(_!==null)$.push(_);G=[];continue}G.push(W)}let Z=uM(G,J);if(Z!==null)$.push(Z);for(let W of[...Lo(Q),...Oo(Q)])for(let H of F9(W))$.push(H);let K=$.length;for(let W=0;W<K;W++){let H=$[W];for(let _ of uo)for(let V of _(H))for(let q of F9(V))$.push(q)}return $},lo=(Q)=>Q.startsWith("./")?Q.slice(2):Q,XW=(Q,X=[],Y=[])=>{if(Q==="")return!1;let J=lo(Q);if(J===".."||J.startsWith("../")||J.includes("/../"))return!1;for(let $ of[...Wo,...Y])if(J===$||J.startsWith(`${$}/`))return!0;for(let $ of[...Ko,...X])if(J===$||J.startsWith(`${$}/`))return!0;return!1},YA=(Q=[],X=[])=>{let Y={"build outputs":["dist","build","_build","out","target"],"js framework outputs":[".next",".nuxt",".svelte-kit",".output",".astro",".angular",".vite",".parcel-cache",".turbo",".vercel",".netlify",".fly",".wrangler",".serverless"],"tests / coverage":["coverage",".nyc_output"],caches:[".cache",".ruff_cache",".mypy_cache",".pytest_cache",".ty_cache",".tox"],"language / package":["__pycache__",".venv","venv","node_modules",".gradle","DerivedData",".bundle",".cargo-target"],"tmp / state":["tmp",".tmp",".state","/tmp","/var/tmp","/var/folders"],iac:[".terraform"],"bundler dev":[".yarn/cache",".yarn/install-state.gz",".pnpm-store",".bun"]};if(Q.length>0)Y["custom relative"]=Q;if(X.length>0)Y["custom absolute"]=X;return Object.entries(Y).map(([J,$])=>` ${J}: ${$.join(", ")}`).join(`
73
+ `)},q1=(Q)=>/(?<prefix>^|\s)#\s*tripwire-allow\b/.test(sM(Q));var L9=require("fs"),$A=require("os");var JA=C.Struct({pattern:C.String,message:C.String,action:C.optional(C.Union([C.Literal("deny"),C.Literal("ask")])),requiresFlags:C.optional(C.Array(C.String)),forbidsFlagValues:C.optional(C.Array(C.Struct({flag:C.String,values:C.Array(C.String)})))}),ro=C.Struct({enabled:C.optional(C.Boolean),path:C.optional(C.String)}),oo=C.Struct({protectedBranches:C.optional(C.Array(C.String)),enforceConventionalCommits:C.optional(C.Boolean)}),no=C.Struct({relative:C.optional(C.Array(C.String)),absolute:C.optional(C.Array(C.String))}),io=C.Struct({rtk:C.optional(ro),git:C.optional(oo),safePaths:C.optional(no),blockedCommands:C.optional(C.Array(JA)),allowedCommands:C.optional(C.Array(JA))}),GA=`${$A.homedir()}/.config/tripwire/config.json`,ao=()=>U0.sync(()=>{try{return L9.accessSync(GA,L9.constants.R_OK),!0}catch{return!1}}),so=()=>U0.try({try:()=>L9.readFileSync(GA,"utf8"),catch:(Q)=>Q}),to=(Q)=>U0.try({try:()=>JSON.parse(Q),catch:(X)=>X}),eo=(Q)=>C.decodeUnknownEffect(io)(Q),L4=()=>({rtk:{enabled:!1},git:{protectedBranches:["main","master","develop","production","release"],enforceConventionalCommits:!0},safePaths:{},blockedCommands:[],allowedCommands:[]}),YW=(Q)=>({rtk:Q.rtk??L4().rtk,git:Q.git??L4().git,safePaths:Q.safePaths??L4().safePaths,blockedCommands:Q.blockedCommands??L4().blockedCommands,allowedCommands:Q.allowedCommands??L4().allowedCommands}),ZA=()=>U0.gen(function*(){if(!(yield*ao()))return L4();let X=yield*so(),Y=yield*to(X),J=yield*eo(Y);return YW(J)}).pipe(U0.timeout(1000),U0.catch(()=>{return console.error("[tripwire] Config loading failed, using defaults"),U0.succeed(L4())}));var KA={allow:0,warn:1,ask:2,deny:3},j=(Q)=>({kind:"allow",rule:Q,message:""}),J6=(Q,X)=>({kind:"warn",rule:Q,message:X}),o0=(Q,X)=>({kind:"ask",rule:Q,message:X}),m=(Q,X)=>({kind:"deny",rule:Q,message:X}),RX=(Q)=>{let X=j("none"),Y;for(let J of Q){if(KA[J.kind]>KA[X.kind])X=J;if(Y===void 0&&J.rewriteCommand!==void 0)Y=J.rewriteCommand}if(Y!==void 0&&X.rewriteCommand===void 0)return{...X,rewriteCommand:Y};return X};var WA=C.Struct({hook_event_name:C.String,tool_name:C.optional(C.String),tool_input:C.optional(C.Unknown),tool_response:C.optional(C.Unknown),cwd:C.optional(C.String),session_id:C.optional(C.String),turn_id:C.optional(C.String),tool_use_id:C.optional(C.String)}),HA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.command==="string",VA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.old_string==="string"&&typeof Q.new_string==="string",_A=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string"&&typeof Q.content==="string",qA=(Q)=>typeof Q==="object"&&Q!==null&&typeof Q.file_path==="string",DA=(Q,X)=>{if(typeof X!=="object"||X===null)return"";if(Q==="Bash"){let Y=X;return[Y.stdout??"",Y.stderr??""].filter((J)=>J.length>0).join(`
74
+ `)}if(Q==="Read"){let Y=X;return Y.content??Y.file?.content??""}if(typeof X.content==="string")return X.content??"";return""};var l2=require("fs"),BA=require("os"),UA=require("path"),OA=`${BA.homedir()}/.claude/tripwire.log`;try{l2.mkdirSync(UA.dirname(OA),{recursive:!0})}catch{}var NX=(Q,X)=>{let Y=new Date().toISOString(),J=X instanceof Error?X.stack??X.message:String(X);try{l2.appendFileSync(OA,`[${Y}] [${Q}] ${J}
75
+ `)}catch{}};var r2=require("child_process"),Qn=(Q)=>{if(Q.path!==void 0)return Q.path;let Y=["/opt/homebrew/bin/rtk","/usr/local/bin/rtk",`${process.env.HOME??""}/.local/bin/rtk`];for(let J of Y)try{return r2.spawnSync("test",["-x",J],{stdio:"ignore"}),J}catch{continue}try{let J=r2.spawnSync("which",["rtk"],{stdio:"pipe"});if(J.status===0){let $=J.stdout;if($!==null){let G=String($).trim();if(G.length>0)return G}}}catch{}return null},zA=(Q,X,Y=2000)=>{if(!X.enabled)return{};let J=Qn(X);if(J===null)return{};let $=JSON.stringify(Q),G=r2.spawnSync(J,["hook","claude"],{input:$,encoding:"utf8",timeout:Y,maxBuffer:1048576});if(G.error!==void 0||typeof G.stdout!=="string")return{};try{let Z=JSON.parse(G.stdout),K=Z.hookSpecificOutput?.updatedInput?.command,W=Z.hookSpecificOutput?.permissionDecisionReason;if(typeof K!=="string")return{};if(typeof W==="string")return{updatedCommand:K,reason:W};return{updatedCommand:K}}catch{return{}}};var Xn=(Q)=>Q.tokens.slice(1).join(" "),FA=(Q,...X)=>Q.flags.some((Y)=>X.includes(Y)),Yn=[{rule:"rm-rf-root",action:"deny",message:"rm -rf / is catastrophic. If the goal is cleaning a subdirectory, scope the path inside the project (e.g. ./dist).",match:(Q)=>Q.head==="rm"&&FA(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.includes("/")},{rule:"rm-rf-home",action:"deny",message:"rm -rf on $HOME / ~ would erase the home directory. Refuse.",match:(Q)=>Q.head==="rm"&&FA(Q,"-rf","-fr","-Rf","-fR")&&Q.tokens.some((X)=>/^(?<home>~|\$HOME|\$\{HOME\})$/.test(X))},{rule:"fork-bomb",action:"deny",message:"Fork bomb pattern detected. Refuse.",match:(Q,X)=>/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;/.test(X)},{rule:"source-script",action:"deny",message:"`source` / `.` executes a file in the current shell. Refuse arbitrary sourced scripts.",match:(Q)=>(Q.head==="source"||Q.head===".")&&Q.tokens.length>1},{rule:"dd-raw-device",action:"deny",message:"dd writing to a raw block device wipes the disk. Refuse.",match:(Q)=>Q.head==="dd"&&/\bof=\/dev\/(?<type>disk|sd|nvme|rdisk)/i.test(Xn(Q))},{rule:"mkfs",action:"deny",message:"mkfs formats a filesystem. Refuse.",match:(Q)=>/^mkfs(?<ext>\.[a-z0-9]+)?$/i.test(Q.head)},{rule:"kill-all",action:"deny",message:"kill -9 -1 kills every process you own. Refuse.",match:(Q)=>Q.head==="kill"&&Q.tokens.includes("-9")&&Q.tokens.includes("-1")},{rule:"chmod-777-recursive",action:"deny",message:"Recursive chmod 777 makes everything world-writable. Use 755 for directories, 644 for files, scoped narrowly.",match:(Q)=>Q.head==="chmod"&&Q.flags.some((X)=>X.includes("R"))&&Q.tokens.includes("777")},{rule:"no-verify",action:"deny",message:"--no-verify skips git hooks. Per policy: never skip hooks. Fix the underlying issue.",match:(Q)=>Q.tokens.includes("--no-verify")},{rule:"no-gpg-sign",action:"deny",message:"Bypassing GPG signing is off-limits unless explicitly requested.",match:(Q,X)=>/--no-gpg-sign\b|-c\s+commit\.gpgsign=false/.test(X)},{rule:"sudo",action:"ask",message:"sudo escalates privileges and is almost never needed in a coding session. If genuinely required, explain why; otherwise find a non-sudo path.",match:(Q)=>Q.head==="sudo"},{rule:"shutdown",action:"deny",message:"shutdown / reboot / halt control the machine. Refuse \u2014 system control should be done manually.",match:(Q)=>["shutdown","reboot","halt","poweroff"].includes(Q.head)},{rule:"launchctl-mutation",action:"deny",message:"launchctl load/unload/bootstrap/bootout/kickstart mutates system services. Refuse \u2014 surface the intent instead.",match:(Q)=>Q.head==="launchctl"&&typeof Q.tokens[1]==="string"&&["load","unload","bootstrap","bootout","kickstart","enable","disable"].includes(Q.tokens[1])},{rule:"defaults-write",action:"deny",message:"`defaults write` mutates macOS preferences. Refuse \u2014 surface the intent.",match:(Q)=>Q.head==="defaults"&&Q.tokens[1]==="write"},{rule:"csrutil",action:"deny",message:"csrutil controls System Integrity Protection. Refuse.",match:(Q)=>Q.head==="csrutil"},{rule:"nvram",action:"deny",message:"nvram modifies firmware variables. Refuse.",match:(Q)=>Q.head==="nvram"},{rule:"diskutil-destructive",action:"deny",message:"diskutil eraseDisk / reformat / partitionDisk wipes disks. Refuse.",match:(Q)=>Q.head==="diskutil"&&typeof Q.tokens[1]==="string"&&["eraseDisk","reformat","partitionDisk","eraseVolume","secureErase"].includes(Q.tokens[1])},{rule:"tmutil-destructive",action:"deny",message:"tmutil delete / disablelocal touches Time Machine. Refuse.",match:(Q)=>Q.head==="tmutil"&&typeof Q.tokens[1]==="string"&&["delete","disablelocal"].includes(Q.tokens[1])},{rule:"osascript",action:"ask",message:"osascript runs arbitrary AppleScript and can do almost anything (move files, send emails, drive apps). Confirm with the user what you want done before running it.",match:(Q)=>Q.head==="osascript"},{rule:"topgrade",action:"deny",message:"topgrade upgrades everything (brew, mas, npm globals, rust, mise). System upgrades should be done manually.",match:(Q)=>Q.head==="topgrade"},{rule:"rsync-delete",action:"deny",message:"rsync --delete removes files at the destination. High blast radius \u2014 surface the intent instead.",match:(Q)=>Q.head==="rsync"&&Q.flags.includes("--delete")},{rule:"softwareupdate-install",action:"deny",message:"`softwareupdate --install / -i / -d` triggers macOS system updates. Refuse \u2014 system updates should be done manually.",match:(Q)=>Q.head==="softwareupdate"&&Q.flags.some((X)=>X==="--install"||X==="-i"||X==="-d"||X.startsWith("--download"))},{rule:"pmset-write",action:"deny",message:"`pmset` (with arguments) writes power-management settings. Read-only `pmset -g` is fine; mutations need the user.",match:(Q)=>Q.head==="pmset"&&Q.tokens.length>1&&!Q.tokens.includes("-g")&&!Q.tokens.includes("-G")},{rule:"dscl-mutate",action:"deny",message:"`dscl . -create / -delete / -append / -change / -merge` modifies the local directory service (your user account, groups, etc.). Refuse.",match:(Q)=>Q.head==="dscl"&&Q.tokens.some((X)=>["-create","-delete","-append","-change","-merge","-passwd"].includes(X))},{rule:"xattr-quarantine-bypass",action:"deny",message:"`xattr -d com.apple.quarantine` removes Gatekeeper's quarantine bit \u2014 the macOS protection against running untrusted binaries. Refuse.",match:(Q)=>Q.head==="xattr"&&Q.tokens.includes("-d")&&Q.tokens.some((X)=>X.includes("com.apple.quarantine"))},{rule:"spctl-disable",action:"deny",message:"`spctl --master-disable` / `--global-disable` disables Gatekeeper system-wide. Refuse.",match:(Q)=>Q.head==="spctl"&&Q.flags.some((X)=>X==="--master-disable"||X==="--global-disable"||X==="--disable")},{rule:"kextload",action:"deny",message:"Loading a kernel extension (`kextload`, `kmutil load`) is a system-level mutation. Refuse \u2014 the user handles this manually.",match:(Q)=>Q.head==="kextload"||Q.head==="kextunload"||Q.head==="kmutil"&&(Q.tokens[1]==="load"||Q.tokens[1]==="unload")},{rule:"security-keychain-destructive",action:"deny",message:"`security delete-keychain / delete-generic-password / delete-internet-password / set-keychain-settings` mutates your Keychain (where CLIs store their secrets). Refuse \u2014 Keychain should be managed manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["delete-keychain","delete-generic-password","delete-internet-password","delete-certificate","delete-identity","set-keychain-settings","unlock-keychain","lock-keychain","create-keychain"].includes(Q.tokens[1])},{rule:"security-keychain-add-write",action:"ask",message:"`security add-generic-password / add-internet-password / add-certificate` writes to your Keychain. Other tools manage their own entries \u2014 confirm this is the right path before adding anything else manually.",match:(Q)=>Q.head==="security"&&typeof Q.tokens[1]==="string"&&["add-generic-password","add-internet-password","add-certificate"].includes(Q.tokens[1])},{rule:"systemsetup",action:"deny",message:"`systemsetup -set...` writes machine-wide settings (timezone, sleep, network time, restart-on-power-failure). Refuse.",match:(Q)=>Q.head==="systemsetup"&&Q.tokens.some((X)=>X.startsWith("-set"))},{rule:"scutil-set",action:"deny",message:"`scutil --set` writes system configuration (computer name, hostname, LocalHostName). Refuse \u2014 read-only `scutil --get` is fine.",match:(Q)=>Q.head==="scutil"&&Q.tokens.includes("--set")},{rule:"brew-mutation",action:"ask",message:"`brew install/uninstall/upgrade/untap` modifies the machine globally. Confirm before running.",match:(Q)=>Q.head==="brew"&&typeof Q.tokens[1]==="string"&&["install","uninstall","upgrade","reinstall","untap","tap"].includes(Q.tokens[1])},{rule:"mas-mutation",action:"ask",message:"`mas install/uninstall` changes installed Mac App Store apps. Confirm.",match:(Q)=>Q.head==="mas"&&typeof Q.tokens[1]==="string"&&["install","uninstall","purchase"].includes(Q.tokens[1])},{rule:"gh-destructive",action:"deny",message:"gh repo/release/issue delete is destructive on shared state. Refuse.",match:(Q)=>Q.head==="gh"&&typeof Q.tokens[1]==="string"&&typeof Q.tokens[2]==="string"&&["repo","release","issue","pr"].includes(Q.tokens[1])&&["delete","destroy","remove"].includes(Q.tokens[2])},{rule:"flyctl-destroy",action:"deny",message:"flyctl apps destroy / volumes destroy nukes deployed infra. Refuse.",match:(Q)=>Q.head==="flyctl"&&Q.tokens.some((X)=>X==="destroy"||X==="delete")},{rule:"gcloud-delete",action:"deny",message:"`gcloud ... delete` affects cloud resources. Refuse.",match:(Q)=>Q.head==="gcloud"&&Q.tokens.includes("delete")}],Jn=new Set(["rm-rf-root","rm-rf-home","fork-bomb","dd-raw-device","mkfs","kill-all","diskutil-destructive","tmutil-destructive","shutdown","csrutil","nvram","kextload","spctl-disable","xattr-quarantine-bypass","topgrade","softwareupdate-install","systemsetup","scutil-set","security-keychain-destructive","no-verify","no-gpg-sign"]),LA=(Q,X)=>{let Y=q1(X),J=[];for(let $ of Q)for(let G of Yn){if(!G.match($,X))continue;if(Y&&!Jn.has(G.rule))continue;J.push(G.action==="deny"?m(G.rule,G.message):o0(G.rule,G.message));break}return J.length===0?j("bash-deny"):RX(J)};var $n=["main","master","develop","production","release"],JW=(Q)=>Q.protectedBranches??$n,Gn=/^(?<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?<scope>\([\w./\- ]+\))?!?:\s+\S/,Zn=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix"]),Kn=new Set(["--bare","--paginate","-p","--no-pager","--no-replace-objects","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-optional-locks","--exec-path","--html-path","--man-path","--info-path"]),Wn=(Q)=>{if(Q.head!=="git")return null;let X=Q.tokens.slice(1),Y=0;while(Y<X.length){let J=X[Y];if(Zn.has(J)){Y+=2;continue}if(Kn.has(J)){Y++;continue}if(J.startsWith("--git-dir=")||J.startsWith("--work-tree=")||J.startsWith("--namespace=")||J.startsWith("--super-prefix=")||J.startsWith("--exec-path=")){Y++;continue}if(J.startsWith("-")){Y++;continue}return{subcommand:J,subArgs:X.slice(Y+1)}}return null},Hn=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let J=Q[Y];if(J==="-m"||J==="--message"){let $=Q[Y+1];return $===void 0?null:u2($,X)}if(J.startsWith("--message="))return u2(J.slice(10),X);if(/^-[a-zA-Z]*m[a-zA-Z]*$/.test(J)){let $=Q[Y+1];return $===void 0?null:u2($,X)}}return null},Vn=(Q,X)=>{let Y=JW(X);for(let J of Q)for(let $ of Y)if(J===$||J.endsWith(`:${$}`)||J.endsWith(`/${$}`))return $;return null},_n=(Q)=>Q.filter((X)=>!X.startsWith("-")),qn=(Q)=>Q.filter((X)=>X.startsWith("-")),g0=(Q,...X)=>X.some((Y)=>Q.includes(Y)),Dn=({subArgs:Q,positional:X})=>{if(g0(Q,"--global","--system"))return m("git-config-global","Modifying global / system git config is off-limits \u2014 that is your personal identity. Read-only `git config --get` is fine.");if(!g0(Q,"--get","-l","--list","--get-all","--get-regexp")&&X.length>=2)return m("git-config-write","Local git config writes should be done explicitly. To read a value, use `git config --get <key>`.");return j("bash-git")},Bn=({subArgs:Q})=>{if(g0(Q,"--cached"))return j("bash-git");return o0("git-rm","`git rm <path>` removes from the index AND the working tree. To untrack-only, use `git rm --cached <path>`. To delete the file separately, use `trash` / `rip`. Confirm intent.")},Un=({subArgs:Q,positional:X})=>{if(g0(Q,"--staged","-S")&&!g0(Q,"--worktree","-W"))return j("bash-git");if(X.length>0)return m("git-restore-discard","`git restore <path>` discards uncommitted changes in the working tree. Refuse \u2014 `git diff <path>` to inspect first, or `git stash push <path>` to preserve.");return j("bash-git")},On=({subArgs:Q,positional:X})=>{if(g0(Q,"-b","-B"))return j("bash-git");if(g0(Q,"-f","--force"))return m("git-checkout-force","`git checkout -f` overwrites the working tree without preserving uncommitted changes. Refuse.");if(Q.includes("--"))return m("git-checkout-discard","`git checkout -- <path>` discards uncommitted working-tree changes. Refuse \u2014 use `git stash push <path>` to preserve, or `git diff <path>` to inspect first.");if(X.length===1&&(X[0]==="."||X[0].startsWith("./")))return m("git-checkout-discard-all","`git checkout .` discards ALL uncommitted working-tree changes. Refuse \u2014 `git stash` to preserve, or `git diff` to inspect first.");return j("bash-git")},zn=({subArgs:Q})=>{if(g0(Q,"-f","--force","--discard-changes"))return m("git-switch-force","`git switch -f / --discard-changes` throws away uncommitted working-tree changes. Refuse.");return j("bash-git")},Fn=({subArgs:Q,flags:X,positional:Y})=>{if(g0(Q,"--hard"))return m("git-reset-hard","`git reset --hard` discards all uncommitted changes AND moves HEAD. Refuse \u2014 describe the intent in chat. If undoing a published commit, `git revert <sha>` is safer.");if(g0(Q,"--keep"))return o0("git-reset-keep","`git reset --keep` resets HEAD but preserves uncommitted local changes. Confirm intent.");if(Y.length===0&&X.length===0)return j("bash-git");return o0("git-reset-mixed","`git reset` moves HEAD. Confirm intent \u2014 if undoing a commit, `git revert` is usually safer.")},Ln=({flags:Q})=>{if(Q.some((X)=>/^-[a-zA-Z]*[df]/.test(X)||X==="--force"))return m("git-clean-fd","`git clean -fd` deletes untracked files (often your in-progress work). Refuse \u2014 inspect with `git clean -dn` (dry run) first. If genuinely needed, append ` # tripwire-allow: <reason>`.");return j("bash-git")},Pn=({subArgs:Q,positional:X,config:Y})=>{if(g0(Q,"--abort","--quit","--continue","--skip","--edit-todo"))return j("bash-git");if(g0(Q,"-i","--interactive"))return m("git-rebase-interactive","`git rebase -i` rewrites history interactively. Refuse \u2014 too easy to lose commits in the agent loop. If this is genuinely required, do it manually outside the agent.");let J=X[0],$=JW(Y);if(J!==void 0&&$.includes(J))return o0("git-rebase-onto-protected",`Rebasing onto \`${J}\` rewrites history of the current branch. \`git merge ${J}\` is usually safer. Confirm intent.`);return o0("git-rebase","`git rebase` rewrites commit history. `git merge` is usually safer. Confirm intent.")},Rn=({subArgs:Q})=>{if(g0(Q,"--abort","--quit","--continue","--skip"))return j("bash-git");return o0("git-cherry-pick","`git cherry-pick` applies commits onto the current branch and can create conflicts. Confirm intent.")},Nn=({subArgs:Q})=>{if(g0(Q,"--abort","--continue","--quit"))return j("bash-git");return o0("git-merge","`git merge <branch>` may create merge conflicts. Confirm intent.")},Mn=({subArgs:Q,config:X,heredocBodies:Y})=>{if(g0(Q,"--amend"))return m("git-commit-amend","`git commit --amend` rewrites the last commit. If it has been pushed, this causes upstream divergence. Refuse \u2014 surface the intent.");let J=Hn(Q,Y),$=g0(Q,"-F","--file","-c","-C","--reuse-message","--reedit-message"),G=g0(Q,"--no-edit");if(J===null&&!$&&!G)return m("git-commit-no-message",'`git commit` without `-m "..."` opens an editor and hangs the agent. Use `git commit -m "<conventional message>"`.');if(J!==null&&X.enforceConventionalCommits!==!1&&!Gn.test(J))return m("git-commit-non-conventional",["Commit message must follow Conventional Commits format:"," `<type>(<scope>)?(!)?: <description>`","Allowed types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.","Examples:"," `fix(auth): handle expired token refresh`"," `feat: add bash-git rule`"," `chore: bump deps`",`Got: ${JSON.stringify(J)}`].join(`
76
+ `));if(g0(Q,"-a","--all")||Q.some((Z)=>/^-[a-zA-Z]*a[a-zA-Z]*$/.test(Z)))return o0("git-commit-auto-stage","`git commit -a / --all` auto-stages every tracked change. Explicit `git add <files>` first is usually clearer about what is being committed. Confirm.");return j("bash-git")},An=({subArgs:Q,flags:X,positional:Y,config:J})=>{if(X.some((G)=>G==="--force"||G==="-f"||G.startsWith("--force-with-lease")))return m("git-force-push","Force push is forbidden. If a branch needs to be reset upstream, surface the intent \u2014 there is almost always a non-force path.");if(g0(Q,"--delete","--mirror")||Q.some((G)=>G.startsWith(":")))return m("git-push-delete","Refusing to delete a remote branch via push. If genuinely needed, surface the intent.");let $=Vn(Y,J);if($!==null)return m("git-push-protected",`Refusing to push directly to protected branch \`${$}\`. Open a PR instead: \`gh pr create\`.`);return j("bash-git")},wn=({subArgs:Q,flags:X,positional:Y,config:J})=>{let $=X.find((G)=>G==="-D"||G==="-d"||G==="--delete"||/^-[a-zA-Z]*D/.test(G)||/^-[a-zA-Z]*d/.test(G));if($!==void 0){let G=Y,Z=JW(J),K=G.find((W)=>Z.includes(W));if(K!==void 0)return m("git-branch-delete-protected",`Refusing to delete protected branch \`${K}\`.`);if($==="-D"||$.includes("D"))return m("git-branch-force-delete",`\`git branch -D ${G.join(" ")}\` force-deletes branches even if unmerged (potential data loss). To delete a merged branch, use \`-d\`. To force, append \` # tripwire-allow: <reason>\`.`);return o0("git-branch-delete",`\`git branch -d ${G.join(" ")}\` deletes a branch (merged-only check). Confirm intent.`)}if(g0(Q,"-m","-M","--move"))return o0("git-branch-move","Renaming a branch can confuse pushed remotes. Confirm intent.");return j("bash-git")},Cn=({subArgs:Q})=>{if(g0(Q,"-d","--delete"))return m("git-tag-delete","`git tag -d` deletes a tag. Refuse \u2014 surface intent.");return j("bash-git")},Tn=({subArgs:Q})=>{let X=Q[0]??"push";if(X==="drop"||X==="clear")return m("git-stash-drop",`\`git stash ${X}\` discards stashed work. Refuse \u2014 \`git stash list\` and \`git stash show\` to inspect first.`);return j("bash-git")},In=({flags:Q})=>{if(Q.some((X)=>X.startsWith("--prune=")||X==="--aggressive"))return m("git-gc-prune","`git gc --prune=now` / `--aggressive` destroys reflog recovery options. Refuse.");return j("bash-git")},jn=({subArgs:Q})=>{let X=Q[0];if(X==="add"||X==="remove"||X==="rm"||X==="set-url"||X==="rename")return o0("git-remote-mutate",`\`git remote ${X}\` changes which remote you're pushing to. Confirm \u2014 accidentally pointing at the wrong remote is high blast-radius.`);return j("bash-git")},PA=({subcommand:Q,subArgs:X})=>{let Y=X[0]??"";if(["add","remove","rm","deinit","sync","set-url"].includes(Y))return o0("git-submodule-worktree-mutate",`\`git ${Q} ${Y}\` modifies repo structure. Confirm intent.`);return j("bash-git")},En=new Map([["config",Dn],["add",()=>j("bash-git")],["mv",()=>j("bash-git")],["rm",Bn],["restore",Un],["checkout",On],["switch",zn],["reset",Fn],["clean",Ln],["rebase",Pn],["cherry-pick",Rn],["merge",Nn],["commit",Mn],["push",An],["branch",wn],["tag",Cn],["stash",Tn],["filter-branch",({subcommand:Q})=>m("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["filter-repo",({subcommand:Q})=>m("git-filter",`\`git ${Q}\` rewrites entire repo history. Refuse.`)],["gc",In],["update-ref",()=>m("git-update-ref","`git update-ref` directly mutates refs and bypasses normal git operations. Refuse.")],["remote",jn],["submodule",PA],["worktree",PA],["init",({subcommand:Q})=>J6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)],["clone",({subcommand:Q})=>J6(`git-${Q}`,`\`git ${Q}\` is allowed but unusual mid-session. Make sure this is what the user asked for.`)]]),Sn=(Q,X,Y)=>{let{subcommand:J,subArgs:$}=Q,G=qn($),Z=_n($);if(new Set(["status","diff","log","show","blame","rev-parse","rev-list","ls-files","ls-tree","cat-file","reflog","describe","shortlog","whatchanged","archive","bundle","fsck","fetch","ls-remote","help","version","grep","name-rev","merge-base","symbolic-ref","check-ignore","count-objects","verify-commit","verify-tag"]).has(J)){if(J==="reflog"&&($[0]==="expire"||g0($,"--expire")))return m("git-reflog-expire","`git reflog expire` destroys git's recovery history. Refuse \u2014 surface the intent.");if(J==="symbolic-ref"&&Z.length>=2)return m("git-symbolic-ref-write","`git symbolic-ref <name> <ref>` rewrites a symbolic ref. Refuse.");return j("bash-git")}let W=En.get(J);if(W!==void 0)return W({subcommand:J,subArgs:$,flags:G,positional:Z,config:X,heredocBodies:Y});return J6("git-unknown-subcommand",`\`git ${J}\` is not classified by tripwire. Allowing \u2014 flag if this looks like history-rewriting or data-loss territory.`)},RA=(Q,X,Y)=>{if(q1(X))return j("bash-git");let J=tM(X);for(let $ of Q){let G=Wn($);if(G===null)continue;let Z=Sn(G,Y,J);if(Z!==null&&Z.kind!=="allow")return Z}return j("bash-git")};var xn=new Set(["curl","wget","wget2","aria2c","xh"]),vn=new Set(["bash","sh","zsh","fish"]),kn=(Q)=>{for(let X=0;X<Q.length-1;X++){let Y=Q[X],J=Q[X+1];if(xn.has(Y.head)&&vn.has(J.head))return!0}return!1},yn=[{head:"cargo",subcommand:"install",rule:"cargo-install",message:"Confirm before `cargo install <crate>`: this builds and installs arbitrary code from crates.io into ~/.cargo/bin globally."},{head:"go",subcommand:"install",rule:"go-install",message:"Confirm before `go install`: this fetches and installs arbitrary Go code globally."},{head:"gem",subcommand:"install",rule:"gem-install",message:"Confirm before `gem install`: pulls arbitrary code from rubygems.org."}],NA=(Q,X)=>{if(q1(X))return j("bash-network-install");if(kn(Q))return m("curl-pipe-shell","Piping `curl` / `wget` directly into a shell runs whatever the remote URL serves. Refuse \u2014 download to a file, inspect, then run if appropriate. If you genuinely need this, append ` # tripwire-allow: <reason>` (and explain to the user what you're running).");for(let Y of Q)for(let J of yn)if(Y.head===J.head&&Y.tokens[1]===J.subcommand)return o0(J.rule,J.message);return j("bash-network-install")};var bn=[{rule:"redirect-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:"Refusing to write into a .env file via shell redirect / tee / cp / mv. .env files hold secrets \u2014 never overwrite from a tool call."},{rule:"redirect-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refusing to write into .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"redirect-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refusing to write into ~/.ssh/ via shell."},{rule:"redirect-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refusing to overwrite a private-key-shaped file via shell."},{rule:"redirect-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refusing to write into ~/.aws/credentials via shell."},{rule:"redirect-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refusing to write into ~/.netrc via shell."},{rule:"redirect-block-device",pattern:/^\/dev\/(?<type>sd|disk|nvme|rdisk)/i,message:"Redirecting into a raw block device wipes the disk. Refuse."}],$W=(Q)=>{for(let X of bn)if(X.pattern.test(Q))return m(X.rule,X.message);return null},MA=(Q,X)=>{if(q1(X))return j("bash-redirect");for(let Y of Q){for(let J of Y.redirects)if(J.op===">"||J.op===">>"){let $=$W(J.target);if($!==null)return $}if(Y.head==="tee")for(let J of Y.args){let $=$W(J);if($!==null)return $}if(Y.head==="cp"||Y.head==="mv"){let J=Y.args.at(-1);if(J!==void 0){let $=$W(J);if($!==null)return $}}}return j("bash-redirect")};var gn=(Q,X)=>{let Y=!1,J=[];for(let Z of Q.tokens.slice(1)){if(!Y&&Z==="--"){Y=!0;continue}if(!Y&&Z.startsWith("-")&&Z!=="-")continue;J.push(Z)}let $=X.relative??[],G=X.absolute??[];return J.filter((Z)=>!XW(Z,$,G))},hn=(Q,X)=>{if(!Q.tokens.includes("-delete"))return null;let Y=[];for(let Z of Q.tokens.slice(1)){if(Z.startsWith("-"))break;Y.push(Z)}let J=Y.length===0?["."]:Y,$=X.relative??[],G=X.absolute??[];return J.filter((Z)=>!XW(Z,$,G))},AA=(Q,X,Y)=>{if(q1(X))return j("bash-scoped-rm");let J=[];for(let K of Q){if(K.head==="rm"){let W=gn(K,Y);if(W.length>0)J.push({kind:"rm",targets:W});continue}if(K.head==="find"){let W=hn(K,Y);if(W!==null&&W.length>0)J.push({kind:"find -delete",targets:W})}}if(J.length===0)return j("bash-scoped-rm");let $=Y.relative??[],G=Y.absolute??[],Z=J.map((K)=>` \u2022 ${K.kind} on: ${K.targets.map((W)=>JSON.stringify(W)).join(", ")}`).join(`
77
+ `);return m("destructive-outside-safe-paths",`Destructive deletion outside known-safe scopes is blocked. Use \`trash\` (macOS Trash, recoverable) or \`rip\` (graveyard at /tmp/graveyard-$USER, recoverable until reboot) instead. Real \`rm\` and \`find -delete\` are allowed only inside ephemeral build / cache / state directories:
78
+ ${YA($,G)}
79
79
 
80
80
  Flagged targets:
81
81
  ${Z}
82
82
 
83
- If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var Fn=(X)=>X==="-x"||X==="-xf"||X==="-xzf"||X==="-xjf"||X==="-xJf"||X==="-xvf"||X==="-xvzf"||X==="-xvjf"||X==="--extract"||/^-[xvzjJtf]+$/.test(X),Ln=(X)=>{for(let Q=0;Q<X.tokens.length;Q++){let Y=X.tokens[Q];if(Y==="-C"||Y==="--directory")return X.tokens[Q+1]??null;if(Y.startsWith("--directory="))return Y.slice(12)}return null},LA=(X)=>{return X==="/"||/^(~|\$HOME|\$\{HOME\})$/.test(X)},PA=(X,Q)=>{if(V1(Q))return I("bash-tar-explosion");for(let Y of X){if(Y.head!=="tar")continue;if(!(Y.flags.some(Fn)||Y.tokens.includes("--extract")))continue;let $=Ln(Y);if($!==null&&LA($))return p("tar-extract-to-root",`tar -x with -C ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let Y of X){if(Y.head!=="unzip")continue;for(let J=0;J<Y.tokens.length;J++)if(Y.tokens[J]==="-d"){let $=Y.tokens[J+1];if($!==void 0&&LA($))return p("unzip-to-root",`unzip -d ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return I("bash-tar-explosion")};var Pn=[{rule:"use-bun-not-npm",action:"deny",message:"Use `bun` instead of `npm`. Translations: `npm install` \u2192 `bun install`, `npm install <pkg>` \u2192 `bun add <pkg>`, `npm install -D <pkg>` \u2192 `bun add -d <pkg>`, `npm run X` \u2192 `bun run X` (or `bun X` for bin scripts), `npm test` \u2192 `bun test`. If you genuinely need npm (publishing to a registry that requires it, working in a non-Sean repo), append ` # tripwire-allow: <reason>` to the command.",fires:(X)=>X.head==="npm"},{rule:"use-bunx-not-npx",action:"deny",message:"Use `bunx` instead of `npx`. Same usage shape, faster, no implicit npm cache.",fires:(X)=>X.head==="npx"},{rule:"use-bun-not-pnpm",action:"deny",message:"Use `bun` instead of `pnpm`. Sean is bun-only across his repos.",fires:(X)=>X.head==="pnpm"},{rule:"use-bun-not-yarn",action:"deny",message:"Use `bun` instead of `yarn`. Sean is bun-only.",fires:(X)=>X.head==="yarn"},{rule:"use-uv-not-pip",action:"deny",message:"Use `uv` instead of `pip`. Translations: `pip install <pkg>` \u2192 `uv add <pkg>` (project dependency) or `uv pip install <pkg>` (env-only escape hatch). `pip freeze` \u2192 `uv pip freeze`. `pip list` \u2192 `uv pip list`. Sean is uv-only across Python repos.",fires:(X)=>X.head==="pip"||X.head==="pip3"},{rule:"use-uv-sync-not-venv",action:"deny",message:"`python -m venv` creates a bare venv; use `uv sync` instead. uv sync creates the venv AND installs from pyproject.toml + uv.lock in one atomic step. To activate: `source .venv/bin/activate` after.",fires:(X)=>(X.head==="python"||X.head==="python3")&&X.tokens.includes("-m")&&X.tokens.includes("venv")},{rule:"uv-sync-over-uv-venv",action:"deny",message:"Use `uv sync` instead of `uv venv`. `uv venv` creates an empty venv that you then have to populate; `uv sync` creates the venv AND resolves+installs from pyproject.toml + uv.lock in one step. The only reason to use `uv venv` standalone is when there is no pyproject.toml \u2014 and in that case, `uv init` first.",fires:(X)=>X.head==="uv"&&X.tokens[1]==="venv"},{rule:"use-bun-patch-not-patch-package",action:"deny",message:"Use `bun patch` instead of `patch-package`. Bun has built-in patch support that integrates with bun.lock; patch-package is npm-era and produces patches in a different format.",fires:(X)=>X.head==="patch-package"},{rule:"consider-fd",action:"warn",message:'Consider `fd` instead of `find`. Faster, simpler syntax, respects .gitignore by default. Examples: `find . -name "*.ts"` \u2192 `fd -e ts`, `find . -type f -name "X"` \u2192 `fd -t f X`, `find PATH ...` \u2192 `fd ... PATH`. Sean has both installed; either works.',fires:(X)=>X.head==="find"},{rule:"consider-rg",action:"warn",message:"Consider `rg` (ripgrep) instead of `grep`. Faster, recursive by default, respects .gitignore, sane defaults. Most flags carry over: `-i`, `-n`, `-v`, `-l`, `-c`. `grep -r PATTERN .` \u2192 `rg PATTERN`.",fires:(X)=>X.head==="grep"||X.head==="egrep"||X.head==="fgrep"},{rule:"consider-btop",action:"warn",message:"Consider `btop` instead of `top`. Better UI, more info, modern.",fires:(X)=>X.head==="top"},{rule:"consider-dust",action:"warn",message:"Consider `dust` instead of `du -sh`. Sorted, colorful, faster.",fires:(X)=>X.head==="du"},{rule:"consider-duf",action:"warn",message:"Consider `duf` instead of `df -h`. Better formatting, more readable.",fires:(X)=>X.head==="df"},{rule:"consider-procs",action:"warn",message:"Consider `procs` instead of `ps aux`. Better filtering and output.",fires:(X)=>X.head==="ps"}],RA=(X,Q)=>{if(V1(Q))return I("bash-tool-policy");for(let Y of X)for(let J of Pn)if(J.fires(Y))return J.action==="deny"?p(J.rule,J.message):Q6(J.rule,J.message);return I("bash-tool-policy")};var Rn="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",Nn=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]]),NA=(X)=>Nn.get(X)??X,MA=(X)=>{let Q=X.lastIndexOf("/");return Q===-1?X:X.slice(Q+1)},Mn=(X,Q)=>X.some((Y)=>Y===Q||Y.startsWith(`${Q}=`)),An=(X,Q)=>{for(let Y=0;Y<X.length;Y++){let J=X[Y];if(J===Q)return X[Y+1]??"";if(J.startsWith(`${Q}=`))return J.slice(Q.length+1)}return null},wn=(X)=>{let Q=[],Y=X.tokens.slice(1);for(let J=0;J<Y.length;J++){let $=Y[J];if($.startsWith("-")){if(!$.includes("=")&&Y[J+1]!==void 0&&!Y[J+1].startsWith("-"))J++;continue}Q.push($)}return Q},AA=(X,Q)=>{let Y=Q.pattern,J=L4(Y);if(J.length===0)return!1;let $=J[0].tokens,G=$[0];if(G===void 0)return!1;let Z=$.slice(1);for(let K of X){if(MA(K.head)!==MA(G))continue;if(Z.length>0){let _=wn(K);if(!Z.every((q,D)=>_[D]!==void 0&&NA(_[D])===NA(q)))continue}if((Q.requiresFlags??[]).some((_)=>!Mn(K.tokens,_)))continue;if(!(Q.forbidsFlagValues??[]).every((_)=>{let V=An(K.tokens,_.flag);return V!==null&&_.values.includes(V)}))continue;if(Z.length===0&&Q.requiresFlags===void 0&&Q.forbidsFlagValues===void 0)return!0;return!0}return!1},wA=(X,Q,Y,J)=>{if(V1(Q))return I("config-custom");for(let $ of J)if(AA(X,$))return I("config-custom");for(let $ of Y)if(AA(X,$)){let G=$.message.includes("tripwire-allow")?$.message:`${$.message} ${Rn}`;return $.action==="ask"?n0("config-custom",G):p("config-custom",G)}return I("config-custom")};var CA=require("fs"),TA=(X,Q)=>{let Y=new Set(X.split(`
84
- `).map((J)=>J.trim()).filter((J)=>J.length>0));return Q.split(`
85
- `).filter((J)=>J.trim().length>0).filter((J)=>!Y.has(J.trim()))},IA=(X)=>{try{return CA.readFileSync(X,"utf8")}catch{return""}};var Cn=[/\bTODO\s*:/i,/\bFIXME\s*:/i,/\bXXX\s*:/i,/\bHACK\s*:/i,/\bfor now\b/i,/\bnot implemented\b/i,/\bNotImplementedError\b/,/\btemp fix\b/i,/\bfallback\b/i,/\bplaceholder\b/i,/\bbackwards?[ -]?compat(ibility)?\b/i,/\bfor later\b/i,/\blater on\b/i,/\bget back to\b/i,/\bI'?ll fix\b/i,/\bto be implemented\b/i,/\bnot yet (implemented|done)\b/i,/\bstubbed\b/i],Tn=/\.(ts|tsx|js|jsx|mjs|cjs|py|rs|go|rb|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|zsh|bash|lua|ex|exs|clj|scala|dart)$/i,In=/(^|\/)(__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(\/|$)|\.(test|spec|fixture|mock|stories)\.[^/]+$/i,jn=/tripwire-allow\b/,En=(X)=>{if(jn.test(X))return!1;for(let Q of Cn)if(Q.test(X))return!0;return!1},zW=(X)=>{let Q=X.file_path;if(!Tn.test(Q)||In.test(Q))return I("lazy-code");let Y="content"in X?X.content:X.new_string,J="content"in X?IA(Q):X.old_string,$=[];for(let K of TA(J,Y))if(En(K))$.push(K.slice(0,200));if($.length===0)return I("lazy-code");let G=$.slice(0,3).map((K)=>` \u2022 ${K}`).join(`
83
+ If raw \`rm\` is genuinely needed, append \` # tripwire-allow: <reason>\` to the command.`)};var mn=(Q)=>Q==="-x"||Q==="-xf"||Q==="-xzf"||Q==="-xjf"||Q==="-xJf"||Q==="-xvf"||Q==="-xvzf"||Q==="-xvjf"||Q==="--extract"||/^-[xvzjJtf]+$/.test(Q),dn=(Q)=>{for(let X=0;X<Q.tokens.length;X++){let Y=Q.tokens[X];if(Y==="-C"||Y==="--directory")return Q.tokens[X+1]??null;if(Y.startsWith("--directory="))return Y.slice(12)}return null},wA=(Q)=>{return Q==="/"||/^(?<home>~|\$HOME|\$\{HOME\})$/.test(Q)},CA=(Q,X)=>{if(q1(X))return j("bash-tar-explosion");for(let Y of Q){if(Y.head!=="tar")continue;if(!(Y.flags.some(mn)||Y.tokens.includes("--extract")))continue;let $=dn(Y);if($!==null&&wA($))return m("tar-extract-to-root",`tar -x with -C ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory (e.g. ./tmp/extract) and inspect before moving anything elsewhere.`)}for(let Y of Q){if(Y.head!=="unzip")continue;for(let J=0;J<Y.tokens.length;J++)if(Y.tokens[J]==="-d"){let $=Y.tokens[J+1];if($!==void 0&&wA($))return m("unzip-to-root",`unzip -d ${$} can overwrite arbitrary system files. Refuse \u2014 extract to a contained directory.`)}}return j("bash-tar-explosion")};var pn=[{rule:"use-bun-not-npm",action:"deny",message:"Use `bun` instead of `npm`. Translations: `npm install` \u2192 `bun install`, `npm install <pkg>` \u2192 `bun add <pkg>`, `npm install -D <pkg>` \u2192 `bun add -d <pkg>`, `npm run X` \u2192 `bun run X` (or `bun X` for bin scripts), `npm test` \u2192 `bun test`. If you genuinely need npm (publishing to a registry that requires it, working in a different repo), append ` # tripwire-allow: <reason>` to the command.",fires:(Q)=>Q.head==="npm"},{rule:"use-bunx-not-npx",action:"deny",message:"Use `bunx` instead of `npx`. Same usage shape, faster, no implicit npm cache.",fires:(Q)=>Q.head==="npx"},{rule:"use-bun-not-pnpm",action:"deny",message:"Use `bun` instead of `pnpm`. The user is bun-only across their repos.",fires:(Q)=>Q.head==="pnpm"},{rule:"use-bun-not-yarn",action:"deny",message:"Use `bun` instead of `yarn`. The user is bun-only.",fires:(Q)=>Q.head==="yarn"},{rule:"use-uv-not-pip",action:"deny",message:"Use `uv` instead of `pip`. Translations: `pip install <pkg>` \u2192 `uv add <pkg>` (project dependency) or `uv pip install <pkg>` (env-only escape hatch). `pip freeze` \u2192 `uv pip freeze`. `pip list` \u2192 `uv pip list`. The user is uv-only across Python repos.",fires:(Q)=>Q.head==="pip"||Q.head==="pip3"},{rule:"use-uv-sync-not-venv",action:"deny",message:"`python -m venv` creates a bare venv; use `uv sync` instead. uv sync creates the venv AND installs from pyproject.toml + uv.lock in one atomic step. To activate: `source .venv/bin/activate` after.",fires:(Q)=>(Q.head==="python"||Q.head==="python3")&&Q.tokens.includes("-m")&&Q.tokens.includes("venv")},{rule:"uv-sync-over-uv-venv",action:"deny",message:"Use `uv sync` instead of `uv venv`. `uv venv` creates an empty venv that you then have to populate; `uv sync` creates the venv AND resolves+installs from pyproject.toml + uv.lock in one step. The only reason to use `uv venv` standalone is when there is no pyproject.toml \u2014 and in that case, `uv init` first.",fires:(Q)=>Q.head==="uv"&&Q.tokens[1]==="venv"},{rule:"use-bun-patch-not-patch-package",action:"deny",message:"Use `bun patch` instead of `patch-package`. Bun has built-in patch support that integrates with bun.lock; patch-package is npm-era and produces patches in a different format.",fires:(Q)=>Q.head==="patch-package"},{rule:"consider-fd",action:"warn",message:'Consider `fd` instead of `find`. Faster, simpler syntax, respects .gitignore by default. Examples: `find . -name "*.ts"` \u2192 `fd -e ts`, `find . -type f -name "X"` \u2192 `fd -t f X`, `find PATH ...` \u2192 `fd ... PATH`. The user has both installed; either works.',fires:(Q)=>Q.head==="find"},{rule:"consider-rg",action:"warn",message:"Consider `rg` (ripgrep) instead of `grep`. Faster, recursive by default, respects .gitignore, sane defaults. Most flags carry over: `-i`, `-n`, `-v`, `-l`, `-c`. `grep -r PATTERN .` \u2192 `rg PATTERN`.",fires:(Q)=>Q.head==="grep"||Q.head==="egrep"||Q.head==="fgrep"},{rule:"consider-btop",action:"warn",message:"Consider `btop` instead of `top`. Better UI, more info, modern.",fires:(Q)=>Q.head==="top"},{rule:"consider-dust",action:"warn",message:"Consider `dust` instead of `du -sh`. Sorted, colorful, faster.",fires:(Q)=>Q.head==="du"},{rule:"consider-duf",action:"warn",message:"Consider `duf` instead of `df -h`. Better formatting, more readable.",fires:(Q)=>Q.head==="df"},{rule:"consider-procs",action:"warn",message:"Consider `procs` instead of `ps aux`. Better filtering and output.",fires:(Q)=>Q.head==="ps"}],TA=(Q,X)=>{if(q1(X))return j("bash-tool-policy");for(let Y of Q)for(let J of pn)if(J.fires(Y))return J.action==="deny"?m(J.rule,J.message):J6(J.rule,J.message);return j("bash-tool-policy")};var cn="If this is intentional, append ` # tripwire-allow: <reason>` to the command.",fn=new Map([["add","create"],["new","create"],["edit","update"],["set","update"],["rm","delete"],["del","delete"],["remove","delete"]]),IA=(Q)=>fn.get(Q)??Q,jA=(Q)=>{let X=Q.lastIndexOf("/");return X===-1?Q:Q.slice(X+1)},un=(Q,X)=>Q.some((Y)=>Y===X||Y.startsWith(`${X}=`)),ln=(Q,X)=>{for(let Y=0;Y<Q.length;Y++){let J=Q[Y];if(J===X)return Q[Y+1]??"";if(J.startsWith(`${X}=`))return J.slice(X.length+1)}return null},rn=(Q)=>{let X=[],Y=Q.tokens.slice(1);for(let J=0;J<Y.length;J++){let $=Y[J];if($.startsWith("-")){if(!$.includes("=")&&Y[J+1]!==void 0&&!Y[J+1].startsWith("-"))J++;continue}X.push($)}return X},EA=(Q,X)=>{let Y=X.pattern,J=F9(Y);if(J.length===0)return!1;let $=J[0].tokens,G=$[0];if(G===void 0)return!1;let Z=$.slice(1);for(let K of Q){if(jA(K.head)!==jA(G))continue;if(Z.length>0){let _=rn(K);if(!Z.every((q,D)=>_[D]!==void 0&&IA(_[D])===IA(q)))continue}if((X.requiresFlags??[]).some((_)=>!un(K.tokens,_)))continue;if(!(X.forbidsFlagValues??[]).every((_)=>{let V=ln(K.tokens,_.flag);return V!==null&&_.values.includes(V)}))continue;if(Z.length===0&&X.requiresFlags===void 0&&X.forbidsFlagValues===void 0)return!0;return!0}return!1},SA=(Q,X,Y,J)=>{if(q1(X))return j("config-custom");for(let $ of J)if(EA(Q,$))return j("config-custom");for(let $ of Y)if(EA(Q,$)){let G=$.message.includes("tripwire-allow")?$.message:`${$.message} ${cn}`;return $.action==="ask"?o0("config-custom",G):m("config-custom",G)}return j("config-custom")};var xA=require("fs"),vA=(Q,X)=>{let Y=new Set(Q.split(`
84
+ `).map((J)=>J.trim()).filter((J)=>J.length>0));return X.split(`
85
+ `).filter((J)=>J.trim().length>0).filter((J)=>!Y.has(J.trim()))},kA=(Q)=>{try{return xA.readFileSync(Q,"utf8")}catch{return""}};var on=[/\bTODO\s*:/i,/\bFIXME\s*:/i,/\bXXX\s*:/i,/\bHACK\s*:/i,/\bfor now\b/i,/\bnot implemented\b/i,/\bNotImplementedError\b/,/\btemp fix\b/i,/\bfallback\b/i,/\bplaceholder\b/i,/\bbackwards?[ -]?compat(?<ibility>ibility)?\b/i,/\bfor later\b/i,/\blater on\b/i,/\bget back to\b/i,/\bI'?ll fix\b/i,/\bto be implemented\b/i,/\bnot yet (?<state>implemented|done)\b/i,/\bstubbed\b/i],nn=/\.(?<ext>ts|tsx|js|jsx|mjs|cjs|py|rs|go|rb|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|zsh|bash|lua|ex|exs|clj|scala|dart)$/i,an=/(?<prefix>^|\/)(?<dir>__tests__|tests?|spec|fixtures?|mocks?|__mocks__|stories)(?<suffix>\/|$)|\.(?<ext>test|spec|fixture|mock|stories)\.[^/]+$/i,sn=/tripwire-allow\b/,tn=(Q)=>{if(sn.test(Q))return!1;for(let X of on)if(X.test(Q))return!0;return!1},GW=(Q)=>{let X=Q.file_path;if(!nn.test(X)||an.test(X))return j("lazy-code");let Y="content"in Q?Q.content:Q.new_string,J="content"in Q?kA(X):Q.old_string,$=[];for(let K of vA(J,Y))if(tn(K))$.push(K.slice(0,200));if($.length===0)return j("lazy-code");let G=$.slice(0,3).map((K)=>` \u2022 ${K}`).join(`
86
86
  `),Z=$.length>3?`
87
- \u2026and ${$.length-3} more`:"";return Q6("lazy-code-marker",["Heads up: line(s) you just added contain words that often signal incomplete or deferred work. The write went through \u2014 this is a flag, not a block.","",'Why this exists: AI coding agents have a strong pull toward stubbing things, deferring "for now," and shipping half-built fallbacks instead of finishing the work in the same turn. The point of this warning is to push back on that pull on every iteration. If you stubbed something out for time, finish it this turn rather than leaving deferred work for later.',"",'If the marker is genuinely permanent \u2014 a real product term ("auth fallback flow", "retry fallback chain", an HTML input placeholder, a public API field literally named "placeholder"), a logging tag, or a comment intentionally left for a human reader \u2014 no action needed. To silence the flag on subsequent edits of that line, append `tripwire-allow: <one-line reason>` (any comment syntax: `//`, `#`, `--`, etc.).',"","Flagged additions:",G+Z].join(`
88
- `))};var jA=require("path");var Sn=[{pattern:/(^|\/)\.env(\.[^/]+)?$/,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(^|\/)\.dev\.vars(\.[^/]+)?$/,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(^|\/)\.ssh\//,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(^|\/)(id_rsa|id_ed25519|id_ecdsa|id_dsa)(\.pub)?$/,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(pem|key|p12|pfx)$/i,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let Sean review."},{pattern:/(^|\/)secrets?\.(json|ya?ml|toml|env)$/i,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(^|\/)\.aws\/credentials$/,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(^|\/)\.netrc$/,rule:"netrc",message:".netrc holds host credentials. Refuse."}],FW=(X)=>{let Q=jA.resolve(X.file_path);for(let Y of Sn)if(Y.pattern.test(Q))return p(Y.rule,Y.message);return I("path-protect")};var EA=require("child_process"),Y6=require("fs"),SA=require("os"),Y3=require("path"),vn="/opt/homebrew/bin/betterleaks",xn=(X)=>{let Q=new Map;for(let Y of X)Q.set(Y.RuleID,(Q.get(Y.RuleID)??0)+1);return[...Q.entries()].map(([Y,J])=>({rule:Y,count:J}))};var kn=(X,Q)=>{let Y=X,J=[...Q].toSorted(($,G)=>G.Secret.length-$.Secret.length);for(let $ of J){if($.Secret==="")continue;Y=Y.replaceAll($.Secret,`[REDACTED:${$.RuleID}]`)}return Y},vA=(X,Q=5000)=>{if(X.length===0)return{hits:[],redacted:X};let Y=Y6.mkdtempSync(Y3.join(SA.tmpdir(),"tripwire-scan-")),J=Y3.join(Y,"input"),$=Y3.join(Y,"report.json");try{if(Y6.writeFileSync(J,X),EA.spawnSync(vn,["detect","--no-git","--no-banner","--no-color","--report-format","json","--report-path",$,"--source",J,"--exit-code","0","--log-level","error"],{encoding:"utf8",timeout:Q,maxBuffer:67108864}).error!==void 0)return{hits:[],redacted:X};let Z;try{let K=Y6.readFileSync($,"utf8"),W=JSON.parse(K||"[]");Z=Array.isArray(W)?W:[]}catch{return{hits:[],redacted:X}}if(Z.length===0)return{hits:[],redacted:X};return{hits:xn(Z),redacted:kn(X,Z)}}finally{try{Y6.rmSync(Y,{recursive:!0,force:!0})}catch{}}};var xA=(X)=>{let Q=KA(X.toolName,X.response);if(Q.length===0)return I("post-secret-scrub");let{hits:Y,redacted:J}=vA(Q);if(Y.length===0)return I("post-secret-scrub");let $=Y.map((G)=>`${G.rule}\xD7${G.count}`).join(", ");return p("secrets-in-output",[`tripwire intercepted ${Y.length} secret pattern(s) in this tool's output (${$}). The original output was withheld so the secret never enters the model context. A redacted form is below \u2014 work from this, do not re-run the same command in a way that re-fetches the underlying secret.`,"","Redacted output:",J.slice(0,16000)+(J.length>16000?`
87
+ \u2026and ${$.length-3} more`:"";return J6("lazy-code-marker",["Heads up: line(s) you just added contain words that often signal incomplete or deferred work. The write went through \u2014 this is a flag, not a block.","",'Why this exists: AI coding agents have a strong pull toward stubbing things, deferring "for now," and shipping half-built fallbacks instead of finishing the work in the same turn. The point of this warning is to push back on that pull on every iteration. If you stubbed something out for time, finish it this turn rather than leaving deferred work for later.',"",'If the marker is genuinely permanent \u2014 a real product term ("auth fallback flow", "retry fallback chain", an HTML input placeholder, a public API field literally named "placeholder"), a logging tag, or a comment intentionally left for a human reader \u2014 no action needed. To silence the flag on subsequent edits of that line, append `tripwire-allow: <one-line reason>` (any comment syntax: `//`, `#`, `--`, etc.).',"","Flagged additions:",G+Z].join(`
88
+ `))};var yA=require("path");var en=[{pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,rule:"env-file",message:".env files hold secrets that should never be sent to the model. Refuse to write or edit. If an example is needed, create .env.example with redacted placeholders."},{pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,rule:"dev-vars",message:".dev.vars holds Cloudflare/Wrangler secrets. Do not modify."},{pattern:/(?<prefix>^|\/)\.ssh\//,rule:"ssh-dir",message:"Never write into ~/.ssh/. Refuse."},{pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)(?<pub>\.pub)?$/,rule:"ssh-key",message:"SSH key file. Refuse."},{pattern:/\.(?<ext>pem|key|p12|pfx)$/i,rule:"private-key",message:"Private key file. Refuse to overwrite. If generating a new key, use a different filename and let the user review."},{pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,rule:"secrets-file",message:"Secrets file. Refuse."},{pattern:/(?<prefix>^|\/)\.aws\/credentials$/,rule:"aws-credentials",message:"AWS credentials file. Refuse."},{pattern:/(?<prefix>^|\/)\.netrc$/,rule:"netrc",message:".netrc holds host credentials. Refuse."}],ZW=(Q)=>{let X=yA.resolve(Q.file_path);for(let Y of en)if(Y.pattern.test(X))return m(Y.rule,Y.message);return j("path-protect")};var bA=require("child_process"),$6=require("fs"),gA=require("os"),o2=require("path"),Qi="/opt/homebrew/bin/betterleaks",Xi=(Q)=>{let X=new Map;for(let Y of Q)X.set(Y.RuleID,(X.get(Y.RuleID)??0)+1);return[...X.entries()].map(([Y,J])=>({rule:Y,count:J}))};var Yi=(Q,X)=>{let Y=Q,J=[...X].toSorted(($,G)=>G.Secret.length-$.Secret.length);for(let $ of J){if($.Secret==="")continue;Y=Y.replaceAll($.Secret,`[REDACTED:${$.RuleID}]`)}return Y},hA=(Q,X=5000)=>{if(Q.length===0)return{hits:[],redacted:Q};let Y=$6.mkdtempSync(o2.join(gA.tmpdir(),"tripwire-scan-")),J=o2.join(Y,"input"),$=o2.join(Y,"report.json");try{if($6.writeFileSync(J,Q),bA.spawnSync(Qi,["detect","--no-git","--no-banner","--no-color","--report-format","json","--report-path",$,"--source",J,"--exit-code","0","--log-level","error"],{encoding:"utf8",timeout:X,maxBuffer:67108864}).error!==void 0)return{hits:[],redacted:Q};let Z;try{let K=$6.readFileSync($,"utf8"),W=JSON.parse(K||"[]");Z=Array.isArray(W)?W:[]}catch{return{hits:[],redacted:Q}}if(Z.length===0)return{hits:[],redacted:Q};return{hits:Xi(Z),redacted:Yi(Q,Z)}}finally{try{$6.rmSync(Y,{recursive:!0,force:!0})}catch{}}};var mA=(Q)=>{let X=DA(Q.toolName,Q.response);if(X.length===0)return j("post-secret-scrub");let{hits:Y,redacted:J}=hA(X);if(Y.length===0)return j("post-secret-scrub");let $=Y.map((G)=>`${G.rule}\xD7${G.count}`).join(", ");return m("secrets-in-output",[`tripwire intercepted ${Y.length} secret pattern(s) in this tool's output (${$}). The original output was withheld so the secret never enters the model context. A redacted form is below \u2014 work from this, do not re-run the same command in a way that re-fetches the underlying secret.`,"","Redacted output:",J.slice(0,16000)+(J.length>16000?`
89
89
  \u2026[truncated]`:"")].join(`
90
- `))};var kA=require("path");var yn=[{rule:"read-env",pattern:/(^|\/)\.env(\.[^/]+)?$/,message:".env files hold secrets that should never enter the model context. Refuse to read. If the goal is documenting required env vars, look at .env.example or describe the schema from memory."},{rule:"read-dev-vars",pattern:/(^|\/)\.dev\.vars(\.[^/]+)?$/,message:"Refuse to read .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"read-ssh",pattern:/(^|\/)\.ssh\//,message:"Refuse to read files inside ~/.ssh/."},{rule:"read-ssh-key",pattern:/(^|\/)(id_rsa|id_ed25519|id_ecdsa|id_dsa)$/,message:"Refuse to read SSH private key files."},{rule:"read-private-key",pattern:/\.(pem|key|p12|pfx)$/i,message:"Refuse to read private-key-shaped files."},{rule:"read-aws-credentials",pattern:/(^|\/)\.aws\/credentials$/,message:"Refuse to read ~/.aws/credentials."},{rule:"read-netrc",pattern:/(^|\/)\.netrc$/,message:"Refuse to read ~/.netrc (host credentials)."},{rule:"read-secrets-file",pattern:/(^|\/)secrets?\.(json|ya?ml|toml|env)$/i,message:"Refuse to read a file named secrets.{json,yaml,toml,env}."}],yA=(X)=>{let Q=kA.resolve(X.file_path);for(let Y of yn)if(Y.pattern.test(Q))return p(Y.rule,Y.message);return I("read-protect")};var bn=async()=>{let X=[];for await(let Q of process.stdin)X.push(Q);return Buffer.concat(X).toString("utf8")},J6=()=>{process.stdout.write(`{"continue": true}
91
- `)},bA=(X)=>X.turn_id!==void 0,gn=(X,Q,Y)=>{if(bA(X)){J6();return}let J={continue:!0,hookSpecificOutput:{hookEventName:X.hook_event_name,updatedInput:{command:Q}}};process.stdout.write(`${JSON.stringify(J)}
92
- `)},LW=(X,Q)=>{let Y=X.hook_event_name,J=`[tripwire:${Q.rule}] ${Q.message}`;if(bA(X)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:J})}
93
- `);return}let $={hookEventName:Y,additionalContext:J};if(Q.rewriteCommand!==void 0)$.updatedInput={command:Q.rewriteCommand};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:$})}
94
- `)},hn=(X,Q)=>{let Y={hookSpecificOutput:{hookEventName:X,permissionDecision:Q.kind==="deny"?"deny":"ask",permissionDecisionReason:`[tripwire:${Q.rule}] ${Q.message}`}};process.stdout.write(`${JSON.stringify(Y)}
95
- `)},mn=(X)=>{let Q={continue:!0,decision:"block",reason:`[tripwire:${X.rule}] ${X.message}`};process.stdout.write(`${JSON.stringify(Q)}
96
- `)},NW=(X)=>{let Q=X.toLowerCase();if(Q==="bash"||Q==="exec"||Q==="shell"||Q==="run_command")return"Bash";if(Q==="read"||Q==="read_file")return"Read";if(Q==="write"||Q==="write_file")return"Write";if(Q==="edit"||Q==="edit_file"||Q==="multiedit"||Q==="apply_patch")return"Edit";if(Q==="webfetch"||Q==="web_fetch"||Q==="fetch")return"WebFetch";return X},pn=(X,Q,Y)=>U0.gen(function*(){let J=yield*U0.exit(U0.try({try:Q,catch:($)=>$}).pipe(U0.timeout(Y)));if(q8.isSuccess(J))return J.value;return TQ(X,k1.pretty(J.cause)),I(X)}),gA=(X,Q,Y)=>{let J=[];if(X==="Bash"&&JA(Q)){let Z=Q,K=L4(Z.command);return J.push({name:"bash-deny",fn:()=>DA(K,Z.command)}),J.push({name:"bash-git",fn:()=>UA(K,Z.command,Y.git??{enforceConventionalCommits:!0})}),J.push({name:"bash-scoped-rm",fn:()=>FA(K,Z.command,Y.safePaths??{})}),J.push({name:"bash-redirect",fn:()=>zA(K,Z.command)}),J.push({name:"bash-network-install",fn:()=>OA(K,Z.command)}),J.push({name:"bash-tar-explosion",fn:()=>PA(K,Z.command)}),J.push({name:"bash-tool-policy",fn:()=>RA(K,Z.command)}),J.push({name:"config-custom",fn:()=>wA(K,Z.command,Y.blockedCommands??[],Y.allowedCommands??[])}),J}if(X==="Read"&&ZA(Q)){let Z=Q;return J.push({name:"read-protect",fn:()=>yA(Z)}),J}let $=(X==="Edit"||X==="MultiEdit")&&$A(Q),G=X==="Write"&&GA(Q);if($){let Z=Q;J.push({name:"path-protect",fn:()=>FW(Z)}),J.push({name:"lazy-code",fn:()=>zW(Z)})}else if(G){let Z=Q;J.push({name:"path-protect",fn:()=>FW(Z)}),J.push({name:"lazy-code",fn:()=>zW(Z)})}return J},hA=(X,Q)=>{if(X==="Bash"||X==="Read"||X==="WebFetch")return[{name:"post-secret-scrub",fn:()=>xA({toolName:X,response:Q})}];return[]},dn=(X,Q)=>U0.gen(function*(){if(X.length===0)return I("no-rules");let Y=[];for(let J of X)Y.push(yield*pn(J.name,J.fn,Q));return BW(Y)}),PW=(X)=>{if(X.length===0)return I("no-rules");return BW(X.map((Q)=>Q.fn()))},RW=(X,Q=P4())=>{let Y=DW(Q),J=NW(X.tool_name??"");if(X.hook_event_name==="PreToolUse")return PW(gA(J,X.tool_input,Y));if(X.hook_event_name==="PostToolUse")return PW(hA(J,X.tool_response));return I("no-rules")},cn=(X,Q,Y)=>{let J=_A(X,Y.rtk??{enabled:!1}),$=X.tool_input?.command??"",G=J.updatedCommand!==void 0&&J.updatedCommand!==$?J.updatedCommand:null;if(Q.kind==="warn"){if(G!==null){LW(X,{...Q,rewriteCommand:G});return}LW(X,Q);return}if(G!==null){gn(X,G,J.reason);return}J6()},fn=(X,Q,Y)=>{let J=X.hook_event_name,$=NW(X.tool_name??"");if(J==="PreToolUse"&&$==="Bash"){cn(X,Q,Y);return}if(Q.kind==="warn"){LW(X,Q);return}J6()},un=U0.gen(function*(){let X=yield*XA(),Q=yield*U0.promise(bn),Y=yield*U0.exit(U0.try({try:()=>JSON.parse(Q),catch:(G)=>G}));if(q8.isFailure(Y)){TQ("parse",k1.pretty(Y.cause)),J6();return}let J=yield*U0.exit(w.decodeUnknownEffect(YA)(Y.value));if(q8.isFailure(J)){TQ("decode",k1.pretty(J.cause)),J6();return}let $=J.value;if($.hook_event_name==="PreToolUse"){let G=RW($,X);if(G.kind==="deny"||G.kind==="ask"){hn($.hook_event_name,G);return}fn($,G,X);return}if($.hook_event_name==="PostToolUse"){let G=RW($,X);if(G.kind==="deny"){mn(G);return}J6();return}J6()}),ln=un.pipe(U0.catchCause((X)=>{return TQ("dispatch-fatal",k1.pretty(X)),J6(),U0.void}));if(require.main==module)XY.runMain(ln);})
90
+ `))};var dA=require("path");var Ji=[{rule:"read-env",pattern:/(?<prefix>^|\/)\.env(?<ext>\.[^/]+)?$/,message:".env files hold secrets that should never enter the model context. Refuse to read. If the goal is documenting required env vars, look at .env.example or describe the schema from memory."},{rule:"read-dev-vars",pattern:/(?<prefix>^|\/)\.dev\.vars(?<ext>\.[^/]+)?$/,message:"Refuse to read .dev.vars (Cloudflare/Wrangler secrets)."},{rule:"read-ssh",pattern:/(?<prefix>^|\/)\.ssh\//,message:"Refuse to read files inside ~/.ssh/."},{rule:"read-ssh-key",pattern:/(?<prefix>^|\/)(?<key>id_rsa|id_ed25519|id_ecdsa|id_dsa)$/,message:"Refuse to read SSH private key files."},{rule:"read-private-key",pattern:/\.(?<ext>pem|key|p12|pfx)$/i,message:"Refuse to read private-key-shaped files."},{rule:"read-aws-credentials",pattern:/(?<prefix>^|\/)\.aws\/credentials$/,message:"Refuse to read ~/.aws/credentials."},{rule:"read-netrc",pattern:/(?<prefix>^|\/)\.netrc$/,message:"Refuse to read ~/.netrc (host credentials)."},{rule:"read-secrets-file",pattern:/(?<prefix>^|\/)secrets?\.(?<ext>json|ya?ml|toml|env)$/i,message:"Refuse to read a file named secrets.{json,yaml,toml,env}."}],pA=(Q)=>{let X=dA.resolve(Q.file_path);for(let Y of Ji)if(Y.pattern.test(X))return m(Y.rule,Y.message);return j("read-protect")};var $i=async()=>{let Q=[];for await(let X of process.stdin)Q.push(X);return Buffer.concat(Q).toString("utf8")},G6=()=>{process.stdout.write(`{"continue": true}
91
+ `)},cA=(Q)=>Q.turn_id!==void 0,Gi=(Q,X,Y)=>{if(cA(Q)){G6();return}let J={continue:!0,hookSpecificOutput:{hookEventName:Q.hook_event_name,updatedInput:{command:X}}};process.stdout.write(`${JSON.stringify(J)}
92
+ `)},KW=(Q,X)=>{let Y=Q.hook_event_name,J=`[tripwire:${X.rule}] ${X.message}`;if(cA(Q)){process.stdout.write(`${JSON.stringify({continue:!0,systemMessage:J})}
93
+ `);return}let $={hookEventName:Y,additionalContext:J};if(X.rewriteCommand!==void 0)$.updatedInput={command:X.rewriteCommand};process.stdout.write(`${JSON.stringify({continue:!0,hookSpecificOutput:$})}
94
+ `)},Zi=(Q,X)=>{let Y={hookSpecificOutput:{hookEventName:Q,permissionDecision:X.kind==="deny"?"deny":"ask",permissionDecisionReason:`[tripwire:${X.rule}] ${X.message}`}};process.stdout.write(`${JSON.stringify(Y)}
95
+ `)},Ki=(Q)=>{let X={continue:!0,decision:"block",reason:`[tripwire:${Q.rule}] ${Q.message}`};process.stdout.write(`${JSON.stringify(X)}
96
+ `)},VW=(Q)=>{let X=Q.toLowerCase();if(X==="bash"||X==="exec"||X==="shell"||X==="run_command")return"Bash";if(X==="read"||X==="read_file")return"Read";if(X==="write"||X==="write_file")return"Write";if(X==="edit"||X==="edit_file"||X==="multiedit"||X==="apply_patch")return"Edit";if(X==="webfetch"||X==="web_fetch"||X==="fetch")return"WebFetch";return Q},Wi=(Q,X,Y)=>U0.gen(function*(){let J=yield*U0.exit(U0.try({try:X,catch:($)=>$}).pipe(U0.timeout(Y)));if(V8.isSuccess(J))return J.value;return NX(Q,y1.pretty(J.cause)),j(Q)}),fA=(Q,X,Y)=>{let J=[];if(Q==="Bash"&&HA(X)){let Z=X,K=F9(Z.command);return J.push({name:"bash-deny",fn:()=>LA(K,Z.command)}),J.push({name:"bash-git",fn:()=>RA(K,Z.command,Y.git??{enforceConventionalCommits:!0})}),J.push({name:"bash-scoped-rm",fn:()=>AA(K,Z.command,Y.safePaths??{})}),J.push({name:"bash-redirect",fn:()=>MA(K,Z.command)}),J.push({name:"bash-network-install",fn:()=>NA(K,Z.command)}),J.push({name:"bash-tar-explosion",fn:()=>CA(K,Z.command)}),J.push({name:"bash-tool-policy",fn:()=>TA(K,Z.command)}),J.push({name:"config-custom",fn:()=>SA(K,Z.command,Y.blockedCommands??[],Y.allowedCommands??[])}),J}if(Q==="Read"&&qA(X)){let Z=X;return J.push({name:"read-protect",fn:()=>pA(Z)}),J}let $=(Q==="Edit"||Q==="MultiEdit")&&VA(X),G=Q==="Write"&&_A(X);if($){let Z=X;J.push({name:"path-protect",fn:()=>ZW(Z)}),J.push({name:"lazy-code",fn:()=>GW(Z)})}else if(G){let Z=X;J.push({name:"path-protect",fn:()=>ZW(Z)}),J.push({name:"lazy-code",fn:()=>GW(Z)})}return J},uA=(Q,X)=>{if(Q==="Bash"||Q==="Read"||Q==="WebFetch")return[{name:"post-secret-scrub",fn:()=>mA({toolName:Q,response:X})}];return[]},Hi=(Q,X)=>U0.gen(function*(){if(Q.length===0)return j("no-rules");let Y=[];for(let J of Q)Y.push(yield*Wi(J.name,J.fn,X));return RX(Y)}),WW=(Q)=>{if(Q.length===0)return j("no-rules");return RX(Q.map((X)=>X.fn()))},HW=(Q,X=L4())=>{let Y=YW(X),J=VW(Q.tool_name??"");if(Q.hook_event_name==="PreToolUse")return WW(fA(J,Q.tool_input,Y));if(Q.hook_event_name==="PostToolUse")return WW(uA(J,Q.tool_response));return j("no-rules")},Vi=(Q,X,Y)=>{let J=zA(Q,Y.rtk??{enabled:!1}),$=Q.tool_input?.command??"",G=J.updatedCommand!==void 0&&J.updatedCommand!==$?J.updatedCommand:null;if(X.kind==="warn"){if(G!==null){KW(Q,{...X,rewriteCommand:G});return}KW(Q,X);return}if(G!==null){Gi(Q,G,J.reason);return}G6()},_i=(Q,X,Y)=>{let J=Q.hook_event_name,$=VW(Q.tool_name??"");if(J==="PreToolUse"&&$==="Bash"){Vi(Q,X,Y);return}if(X.kind==="warn"){KW(Q,X);return}G6()},qi=U0.gen(function*(){let Q=yield*ZA(),X=yield*U0.promise($i),Y=yield*U0.exit(U0.try({try:()=>JSON.parse(X),catch:(G)=>G}));if(V8.isFailure(Y)){NX("parse",y1.pretty(Y.cause)),G6();return}let J=yield*U0.exit(C.decodeUnknownEffect(WA)(Y.value));if(V8.isFailure(J)){NX("decode",y1.pretty(J.cause)),G6();return}let $=J.value;if($.hook_event_name==="PreToolUse"){let G=HW($,Q);if(G.kind==="deny"||G.kind==="ask"){Zi($.hook_event_name,G);return}_i($,G,Q);return}if($.hook_event_name==="PostToolUse"){let G=HW($,Q);if(G.kind==="deny"){Ki(G);return}G6();return}G6()}),Di=qi.pipe(U0.catchCause((Q)=>{return NX("dispatch-fatal",y1.pretty(Q)),G6(),U0.void}));if(require.main==module)i7.runMain(Di);})